summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:59 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:59 -0400
commitce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61 (patch)
treeacdb9a8816483652a9db1a47db71df5df43707c5 /ext
parent10f5b47dc7c1cf2b9a00991629f43652710322d3 (diff)
downloadphp-ce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61.tar.gz
Imported Upstream version 5.1.1upstream/5.1.1
Diffstat (limited to 'ext')
-rw-r--r--ext/bcmath/bcmath.c4
-rw-r--r--ext/bcmath/config.m44
-rw-r--r--ext/bcmath/php_bcmath.h4
-rw-r--r--ext/bz2/bz2.c13
-rw-r--r--ext/bz2/bz2.dsp4
-rw-r--r--ext/bz2/bz2_filter.c384
-rw-r--r--ext/bz2/config.m48
-rw-r--r--ext/bz2/config.w324
-rw-r--r--ext/bz2/php_bz2.h11
-rw-r--r--ext/bz2/tests/bz2_filter_compress.phpt17
-rw-r--r--ext/bz2/tests/bz2_filter_decompress.phpt17
-rw-r--r--ext/calendar/cal_unix.c2
-rw-r--r--ext/calendar/calendar.c4
-rw-r--r--ext/calendar/easter.c2
-rw-r--r--ext/calendar/tests/cal_days_in_month.phpt20
-rw-r--r--ext/calendar/tests/cal_to_jd.phpt16
-rw-r--r--ext/calendar/tests/easter_days.phpt14
-rw-r--r--ext/calendar/tests/frenchtojd.phpt16
-rw-r--r--ext/calendar/tests/skipif.inc4
-rw-r--r--ext/com_dotnet/com_com.c4
-rw-r--r--ext/com_dotnet/com_dotnet.c7
-rw-r--r--ext/com_dotnet/com_extension.c4
-rw-r--r--ext/com_dotnet/com_handlers.c17
-rw-r--r--ext/com_dotnet/com_iterator.c6
-rw-r--r--ext/com_dotnet/com_misc.c6
-rw-r--r--ext/com_dotnet/com_olechar.c4
-rwxr-xr-xext/com_dotnet/com_persist.c30
-rw-r--r--ext/com_dotnet/com_saproxy.c10
-rw-r--r--ext/com_dotnet/com_typeinfo.c4
-rw-r--r--ext/com_dotnet/com_variant.c4
-rw-r--r--ext/com_dotnet/com_wrapper.c109
-rw-r--r--ext/com_dotnet/php_com_dotnet.h4
-rw-r--r--ext/com_dotnet/php_com_dotnet_internal.h6
-rw-r--r--ext/cpdf/CREDITS2
-rw-r--r--ext/cpdf/config.m484
-rw-r--r--ext/cpdf/config.w3214
-rw-r--r--ext/cpdf/cpdf.c2267
-rw-r--r--ext/cpdf/cpdf.dsp111
-rw-r--r--ext/cpdf/package.xml44
-rw-r--r--ext/cpdf/php_cpdf.h119
-rw-r--r--ext/ctype/ctype.c43
-rw-r--r--ext/ctype/php_ctype.h2
-rw-r--r--ext/ctype/tests/bug34645.phpt11
-rw-r--r--ext/curl/config.m444
-rw-r--r--ext/curl/config.w323
-rw-r--r--ext/curl/interface.c204
-rw-r--r--ext/curl/multi.c8
-rw-r--r--ext/curl/php_curl.h8
-rw-r--r--ext/curl/streams.c6
-rw-r--r--ext/date/CREDITS2
-rw-r--r--ext/date/TODO6
-rw-r--r--ext/date/config.m425
-rwxr-xr-xext/date/config.w3210
-rw-r--r--ext/date/lib/README6
-rw-r--r--ext/date/lib/dow.c147
-rw-r--r--ext/date/lib/fallbackmap.h40
-rw-r--r--ext/date/lib/parse_date.c19804
-rw-r--r--ext/date/lib/parse_date.c.orig19884
-rw-r--r--ext/date/lib/parse_date.re1495
-rw-r--r--ext/date/lib/parse_tz.c360
-rw-r--r--ext/date/lib/timelib.c188
-rw-r--r--ext/date/lib/timelib.h90
-rw-r--r--ext/date/lib/timelib.m480
-rw-r--r--ext/date/lib/timelib_structs.h181
-rw-r--r--ext/date/lib/timezonedb.h16437
-rw-r--r--ext/date/lib/timezonemap.h1631
-rw-r--r--ext/date/lib/tm2unixtime.c276
-rw-r--r--ext/date/lib/unixtime2tm.c236
-rw-r--r--ext/date/php_date.c1510
-rw-r--r--ext/date/php_date.h104
-rw-r--r--ext/date/tests/002.phpt (renamed from ext/standard/tests/time/002.phpt)9
-rw-r--r--ext/date/tests/bug13142.phpt (renamed from ext/standard/tests/time/bug13142.phpt)2
-rw-r--r--ext/date/tests/bug14561.phpt11
-rw-r--r--ext/date/tests/bug17988.phpt (renamed from ext/standard/tests/time/bug17988.phpt)2
-rw-r--r--ext/date/tests/bug20382-1.phpt (renamed from ext/standard/tests/time/bug20382.phpt)2
-rw-r--r--ext/date/tests/bug20382-2.phpt170
-rw-r--r--ext/date/tests/bug21399.phpt9
-rw-r--r--ext/date/tests/bug21966.phpt (renamed from ext/standard/tests/time/bug21966.phpt)0
-rw-r--r--ext/date/tests/bug26090.phpt14
-rw-r--r--ext/date/tests/bug26198.phpt11
-rw-r--r--ext/date/tests/bug26317.phpt (renamed from ext/standard/tests/time/bug26317.phpt)0
-rw-r--r--ext/date/tests/bug26320.phpt (renamed from ext/standard/tests/time/bug26320.phpt)0
-rw-r--r--ext/date/tests/bug26694.phpt9
-rw-r--r--ext/date/tests/bug27719.phpt (renamed from ext/standard/tests/time/bug27719.phpt)14
-rw-r--r--ext/date/tests/bug27780.phpt (renamed from ext/standard/tests/time/bug27780.phpt)4
-rw-r--r--ext/date/tests/bug28024.phpt11
-rw-r--r--ext/date/tests/bug28088.phpt17
-rw-r--r--ext/date/tests/bug28599.phpt (renamed from ext/standard/tests/time/bug28599.phpt)1
-rw-r--r--ext/date/tests/bug29150.phpt9
-rw-r--r--ext/date/tests/bug29585.phpt9
-rw-r--r--ext/date/tests/bug29595.phpt11
-rw-r--r--ext/date/tests/bug30096.phpt48
-rw-r--r--ext/date/tests/bug30532.phpt23
-rw-r--r--ext/date/tests/bug32086.phpt49
-rw-r--r--ext/date/tests/bug32270.phpt25
-rw-r--r--ext/date/tests/bug32555.phpt17
-rw-r--r--ext/date/tests/bug32588.phpt13
-rw-r--r--ext/date/tests/bug33056.phpt13
-rw-r--r--ext/date/tests/bug33414-1.phpt320
-rw-r--r--ext/date/tests/bug33414-2.phpt121
-rw-r--r--ext/date/tests/bug33415-1.phpt33
-rw-r--r--ext/date/tests/bug33415-2.phpt342
-rw-r--r--ext/date/tests/bug33452.phpt11
-rw-r--r--ext/date/tests/bug33532.phpt38
-rw-r--r--ext/date/tests/bug33536.phpt13
-rw-r--r--ext/date/tests/bug33562.phpt11
-rw-r--r--ext/date/tests/bug33563.phpt12
-rw-r--r--ext/date/tests/bug33578.phpt21
-rw-r--r--ext/date/tests/bug33869.phpt26
-rw-r--r--ext/date/tests/bug33957.phpt103
-rw-r--r--ext/date/tests/bug34087.phpt20
-rw-r--r--ext/date/tests/bug34304.phpt11
-rw-r--r--ext/date/tests/bug34676.phpt19
-rw-r--r--ext/date/tests/bug34771.phpt32
-rw-r--r--ext/date/tests/bug35143.phpt21
-rw-r--r--ext/date/tests/bug35218.phpt14
-rw-r--r--ext/date/tests/date.phpt (renamed from ext/standard/tests/time/date.phpt)4
-rw-r--r--ext/date/tests/date_create-1.phpt48
-rw-r--r--ext/date/tests/date_create-2.phpt12
-rw-r--r--ext/date/tests/date_default_timezone_get-1.phpt16
-rw-r--r--ext/date/tests/date_default_timezone_get-2.phpt12
-rw-r--r--ext/date/tests/date_default_timezone_get-3.phpt15
-rw-r--r--ext/date/tests/date_default_timezone_set-1.phpt28
-rw-r--r--ext/date/tests/date_modify-1.phpt30
-rw-r--r--ext/date/tests/date_modify-2.phpt15
-rw-r--r--ext/date/tests/default-timezone-1.phpt11
-rw-r--r--ext/date/tests/default-timezone-2.phpt11
-rw-r--r--ext/date/tests/format-negative-timestamp.phpt24
-rw-r--r--ext/date/tests/mktime-1.phpt (renamed from ext/standard/tests/time/003.phpt)3
-rw-r--r--ext/date/tests/mktime-2.phpt (renamed from ext/standard/tests/time/mktime.phpt)6
-rw-r--r--ext/date/tests/mktime-3.phpt52
-rw-r--r--ext/date/tests/strtotime.phpt16
-rw-r--r--ext/date/tests/timezone-configuration.phpt19
-rw-r--r--ext/dba/config.m497
-rw-r--r--ext/dba/config.w326
-rw-r--r--ext/dba/dba.c10
-rw-r--r--ext/dba/dba_cdb.c4
-rwxr-xr-xext/dba/dba_db1.c197
-rw-r--r--ext/dba/dba_db2.c4
-rw-r--r--ext/dba/dba_db3.c4
-rw-r--r--ext/dba/dba_db4.c4
-rw-r--r--ext/dba/dba_dbm.c4
-rw-r--r--ext/dba/dba_flatfile.c4
-rw-r--r--ext/dba/dba_gdbm.c4
-rw-r--r--ext/dba/dba_inifile.c4
-rw-r--r--ext/dba/dba_ndbm.c4
-rwxr-xr-xext/dba/dba_qdbm.c4
-rw-r--r--ext/dba/libcdb/cdb.c6
-rw-r--r--ext/dba/libcdb/cdb.h4
-rw-r--r--ext/dba/libcdb/cdb_make.c6
-rw-r--r--ext/dba/libcdb/cdb_make.h4
-rw-r--r--ext/dba/libcdb/uint32.c4
-rw-r--r--ext/dba/libcdb/uint32.h4
-rw-r--r--ext/dba/libflatfile/flatfile.c6
-rw-r--r--ext/dba/libflatfile/flatfile.h4
-rw-r--r--ext/dba/libinifile/inifile.c6
-rw-r--r--ext/dba/libinifile/inifile.h4
-rwxr-xr-xext/dba/php_db1.h12
-rw-r--r--ext/dba/php_dba.h4
-rwxr-xr-xext/dba/tests/dba_db1.phpt46
-rw-r--r--ext/dba/tests/dba_handler.inc3
-rw-r--r--ext/dbase/config.m44
-rw-r--r--ext/dbase/dbase.c4
-rw-r--r--ext/dbase/php_dbase.h4
-rw-r--r--ext/dbx/CREDITS2
-rw-r--r--ext/dbx/INSTALL25
-rw-r--r--ext/dbx/config.m410
-rw-r--r--ext/dbx/config.w3210
-rw-r--r--ext/dbx/dbx.c995
-rw-r--r--ext/dbx/dbx.dsp181
-rw-r--r--ext/dbx/dbx.h63
-rw-r--r--ext/dbx/dbx_fbsql.c283
-rw-r--r--ext/dbx/dbx_fbsql.h63
-rw-r--r--ext/dbx/dbx_mssql.c282
-rw-r--r--ext/dbx/dbx_mssql.h62
-rw-r--r--ext/dbx/dbx_mysql.c304
-rw-r--r--ext/dbx/dbx_mysql.h62
-rw-r--r--ext/dbx/dbx_oci8.c293
-rw-r--r--ext/dbx/dbx_oci8.h62
-rw-r--r--ext/dbx/dbx_odbc.c301
-rw-r--r--ext/dbx/dbx_odbc.h62
-rw-r--r--ext/dbx/dbx_pgsql.c297
-rw-r--r--ext/dbx/dbx_pgsql.h58
-rw-r--r--ext/dbx/dbx_sqlite.c273
-rw-r--r--ext/dbx/dbx_sqlite.h62
-rw-r--r--ext/dbx/dbx_sybasect.c307
-rw-r--r--ext/dbx/dbx_sybasect.h62
-rw-r--r--ext/dbx/howto_extend_dbx.html316
-rw-r--r--ext/dbx/package.xml89
-rw-r--r--ext/dbx/php_dbx.h89
-rw-r--r--ext/dbx/tests/001.phpt10
-rw-r--r--ext/dbx/tests/002.phpt31
-rw-r--r--ext/dbx/tests/003.phpt139
-rw-r--r--ext/dbx/tests/004.phpt35
-rw-r--r--ext/dbx/tests/005.phpt113
-rw-r--r--ext/dbx/tests/006.phpt57
-rw-r--r--ext/dbx/tests/007.phpt74
-rw-r--r--ext/dbx/tests/008.phpt146
-rw-r--r--ext/dbx/tests/009.phpt65
-rw-r--r--ext/dbx/tests/010.phpt52
-rw-r--r--ext/dbx/tests/dbx_test.p73
-rw-r--r--ext/dbx/tests/dbx_test.pgsql.script37
-rw-r--r--ext/dbx/tests/dbx_test.script38
-rw-r--r--ext/dbx/tests/skipif.inc6
-rw-r--r--ext/dio/config.m410
-rw-r--r--ext/dio/config.w329
-rw-r--r--ext/dio/dio.c654
-rw-r--r--ext/dio/package.xml46
-rw-r--r--ext/dio/php_dio.h62
-rw-r--r--ext/dio/tests/001.phpt21
-rw-r--r--ext/dom/attr.c6
-rw-r--r--ext/dom/cdatasection.c4
-rw-r--r--ext/dom/characterdata.c4
-rw-r--r--ext/dom/comment.c4
-rw-r--r--ext/dom/config.m48
-rw-r--r--ext/dom/document.c193
-rw-r--r--ext/dom/documentfragment.c75
-rw-r--r--ext/dom/documenttype.c4
-rw-r--r--ext/dom/dom_ce.h4
-rw-r--r--ext/dom/dom_fe.h6
-rw-r--r--ext/dom/dom_iterators.c4
-rw-r--r--ext/dom/dom_properties.h6
-rw-r--r--ext/dom/domconfiguration.c4
-rw-r--r--ext/dom/domerror.c4
-rw-r--r--ext/dom/domerrorhandler.c4
-rw-r--r--ext/dom/domexception.c20
-rw-r--r--ext/dom/domimplementation.c6
-rw-r--r--ext/dom/domimplementationlist.c4
-rw-r--r--ext/dom/domimplementationsource.c4
-rw-r--r--ext/dom/domlocator.c4
-rw-r--r--ext/dom/domstringlist.c4
-rw-r--r--ext/dom/element.c69
-rw-r--r--ext/dom/entity.c4
-rw-r--r--ext/dom/entityreference.c4
-rw-r--r--ext/dom/namednodemap.c7
-rw-r--r--ext/dom/namelist.c4
-rw-r--r--ext/dom/node.c18
-rw-r--r--ext/dom/nodelist.c7
-rw-r--r--ext/dom/notation.c4
-rw-r--r--ext/dom/php_dom.c74
-rw-r--r--ext/dom/php_dom.h7
-rw-r--r--ext/dom/processinginstruction.c4
-rw-r--r--ext/dom/string_extend.c4
-rw-r--r--ext/dom/tests/bug34276.phpt43
-rw-r--r--ext/dom/tests/bug35342.phpt17
-rw-r--r--ext/dom/tests/dom002.phpt2
-rw-r--r--ext/dom/tests/dom003.phpt2
-rw-r--r--ext/dom/tests/dom005.phpt10
-rw-r--r--ext/dom/tests/dom_set_attr_node.phpt67
-rw-r--r--ext/dom/tests/dom_xinclude.phpt15
-rw-r--r--ext/dom/text.c5
-rw-r--r--ext/dom/typeinfo.c4
-rw-r--r--ext/dom/userdatahandler.c4
-rw-r--r--ext/dom/xml_common.h13
-rw-r--r--ext/dom/xpath.c135
-rw-r--r--ext/exif/config.w324
-rw-r--r--ext/exif/exif.c12
-rw-r--r--ext/exif/php_exif.h4
-rwxr-xr-xext/exif/tests/bug34704.jpgbin0 -> 9976 bytes
-rwxr-xr-xext/exif/tests/bug34704.phpt43
-rw-r--r--ext/fam/CREDITS2
-rw-r--r--ext/fam/config.m456
-rw-r--r--ext/fam/fam.c403
-rw-r--r--ext/fam/package.xml48
-rw-r--r--ext/fbsql/config.m44
-rw-r--r--ext/fbsql/php_fbsql.c289
-rw-r--r--ext/fbsql/php_fbsql.h6
-rw-r--r--ext/fdf/config.m44
-rw-r--r--ext/fdf/fdf.c8
-rw-r--r--ext/fdf/php_fdf.h4
-rw-r--r--ext/filepro/config.m44
-rw-r--r--ext/filepro/filepro.c4
-rw-r--r--ext/filepro/package.xml2
-rw-r--r--ext/filepro/php_filepro.h4
-rw-r--r--ext/ftp/config.m413
-rw-r--r--ext/ftp/ftp.c34
-rw-r--r--ext/ftp/ftp.h4
-rw-r--r--ext/ftp/php_ftp.c4
-rw-r--r--ext/ftp/php_ftp.h4
-rw-r--r--ext/gd/config.m453
-rw-r--r--ext/gd/config.w3220
-rw-r--r--ext/gd/gd.c100
-rw-r--r--ext/gd/gd.dsp2
-rw-r--r--ext/gd/gd_ctx.c10
-rw-r--r--ext/gd/gdcache.c2
-rw-r--r--ext/gd/gdttf.c2
-rw-r--r--ext/gd/libgd/gd.c127
-rw-r--r--ext/gd/libgd/gd.h16
-rw-r--r--ext/gd/libgd/gd_arc_f_buggy.c4
-rw-r--r--ext/gd/libgd/gd_gd2.c108
-rw-r--r--ext/gd/libgd/gd_gif_in.c10
-rw-r--r--ext/gd/libgd/gd_io.c20
-rw-r--r--ext/gd/libgd/gd_jpeg.c4
-rw-r--r--ext/gd/libgd/gd_png.c24
-rw-r--r--ext/gd/libgd/gd_ss.c4
-rw-r--r--ext/gd/libgd/gd_wbmp.c4
-rw-r--r--ext/gd/libgd/gdft.c2
-rw-r--r--ext/gd/libgd/gdtables.c6
-rw-r--r--ext/gd/libgd/gdxpm.c6
-rw-r--r--ext/gd/libgd/wbmp.h5
-rw-r--r--ext/gd/libgd/xbm.c6
-rw-r--r--ext/gd/php_gd.h14
-rw-r--r--ext/gd/tests/bug24155.phpt10
-rw-r--r--ext/gd/tests/bug27582_1.phpt10
-rw-r--r--ext/gettext/config.m46
-rw-r--r--ext/gettext/gettext.c4
-rw-r--r--ext/gettext/php_gettext.h4
-rw-r--r--ext/gmp/config.m48
-rw-r--r--ext/gmp/config.w3214
-rw-r--r--ext/gmp/gmp.c8
-rw-r--r--ext/gmp/php_gmp.h2
-rw-r--r--ext/gmp/tests/bug32773.phpt4
-rw-r--r--ext/hwapi/hwapi.cpp6
-rw-r--r--ext/hwapi/php_hwapi.h6
-rw-r--r--ext/iconv/config.m421
-rw-r--r--ext/iconv/config.w322
-rw-r--r--ext/iconv/iconv.c52
-rw-r--r--ext/iconv/php_iconv.h4
-rw-r--r--ext/iconv/tests/bug16069.phpt4
-rw-r--r--ext/iconv/tests/eucjp2iso2022jp.phpt2
-rw-r--r--ext/iconv/tests/eucjp2sjis.phpt2
-rw-r--r--ext/iconv/tests/eucjp2utf8.phpt2
-rw-r--r--ext/iconv/tests/iconv001.phpt2
-rw-r--r--ext/iconv/tests/iconv002.phpt2
-rw-r--r--ext/iconv/tests/iconv_mime_encode.phpt2
-rw-r--r--ext/iconv/tests/iconv_substr.phpt2
-rw-r--r--ext/iconv/tests/ob_iconv_handler.phpt2
-rw-r--r--ext/iconv/tests/skipif.inc9
-rw-r--r--ext/iconv/tests/translit-failure.phpt2
-rw-r--r--ext/iconv/tests/translit-utf8.phpt2
-rw-r--r--ext/imap/config.m414
-rw-r--r--ext/imap/config.w324
-rw-r--r--ext/imap/php_imap.c37
-rw-r--r--ext/imap/php_imap.h4
-rw-r--r--ext/imap/tests/bug32589.phpt34
-rw-r--r--ext/informix/Makefile.frag4
-rw-r--r--ext/informix/config.m429
-rw-r--r--ext/informix/config.w322
-rw-r--r--ext/informix/ifx.ec4
-rw-r--r--ext/informix/php_informix.h4
-rw-r--r--ext/informix/php_informix_includes.h4
-rw-r--r--ext/ingres_ii/CREDITS2
-rw-r--r--ext/ingres_ii/EXPERIMENTAL5
-rw-r--r--ext/ingres_ii/README13
-rw-r--r--ext/ingres_ii/config.m437
-rw-r--r--ext/ingres_ii/config.w3236
-rw-r--r--ext/ingres_ii/ii.c1545
-rw-r--r--ext/ingres_ii/ii.h65
-rw-r--r--ext/ingres_ii/ingres.dsp111
-rw-r--r--ext/ingres_ii/php_ii.h100
-rw-r--r--ext/interbase/ibase_blobs.c4
-rw-r--r--ext/interbase/ibase_events.c4
-rw-r--r--ext/interbase/ibase_query.c4
-rw-r--r--ext/interbase/ibase_service.c6
-rw-r--r--ext/interbase/interbase.c4
-rw-r--r--ext/interbase/interbase.rc4
-rwxr-xr-xext/interbase/php_ibase_includes.h4
-rw-r--r--ext/interbase/php_ibase_udf.c8
-rw-r--r--ext/interbase/php_interbase.h4
-rw-r--r--ext/ircg/CREDITS3
-rw-r--r--ext/ircg/Makefile.frag2
-rw-r--r--ext/ircg/README.txt10
-rw-r--r--ext/ircg/config.m447
-rw-r--r--ext/ircg/ircg.c2764
-rw-r--r--ext/ircg/ircg.php10
-rw-r--r--ext/ircg/ircg_common.c290
-rw-r--r--ext/ircg/ircg_scanner.c1208
-rw-r--r--ext/ircg/ircg_scanner.re320
-rw-r--r--ext/ircg/php_ircg.h95
-rw-r--r--ext/ircg/php_ircg_alloc.h20
-rw-r--r--ext/ircg/php_ircg_cache.c91
-rw-r--r--ext/ircg/php_ircg_cache.h21
-rw-r--r--ext/ircg/php_ircg_conversion.c74
-rw-r--r--ext/ircg/php_ircg_conversion.h4
-rw-r--r--ext/ircg/php_ircg_error.c106
-rw-r--r--ext/ircg/php_ircg_error.h17
-rw-r--r--ext/ircg/php_ircg_formats.h46
-rw-r--r--ext/ircg/php_ircg_hash.h15
-rw-r--r--ext/ircg/php_ircg_lock.h5
-rw-r--r--ext/ircg/php_ircg_private.h68
-rw-r--r--ext/ircg/php_ircg_smart_str.h12
-rw-r--r--ext/ircg/php_ircg_tokenizer.c228
-rw-r--r--ext/ircg/php_ircg_tokenizer.h61
-rw-r--r--ext/ldap/config.m432
-rw-r--r--ext/ldap/config.w322
-rw-r--r--ext/ldap/ldap.c8
-rw-r--r--ext/ldap/php_ldap.h4
-rw-r--r--ext/libxml/config.w323
-rw-r--r--ext/libxml/config0.m47
-rw-r--r--ext/libxml/libxml.c388
-rw-r--r--ext/libxml/php_libxml.h16
-rw-r--r--ext/mbstring/config.m454
-rw-r--r--ext/mbstring/config.w329
-rw-r--r--ext/mbstring/libmbfl/README2
-rw-r--r--ext/mbstring/libmbfl/filters/Makefile.am2
-rw-r--r--ext/mbstring/libmbfl/filters/Makefile.bcc322
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_armscii8.c149
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_armscii8.h45
-rwxr-xr-xext/mbstring/libmbfl/filters/mk_sb_tbl.awk2
-rw-r--r--ext/mbstring/libmbfl/filters/unicode_table_armscii8.h54
-rw-r--r--ext/mbstring/libmbfl/libmbfl.dsp20
-rw-r--r--ext/mbstring/libmbfl/mbfl.rc2
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfilter.c2
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_consts.h1
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_convert.c3
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_encoding.c2
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_encoding.h1
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_ident.c2
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_language.c2
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_language.h1
-rw-r--r--ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk2
-rw-r--r--ext/mbstring/libmbfl/nls/Makefile.am2
-rw-r--r--ext/mbstring/libmbfl/nls/Makefile.bcc322
-rw-r--r--ext/mbstring/libmbfl/nls/nls_hy.c20
-rw-r--r--ext/mbstring/libmbfl/nls/nls_hy.h9
-rw-r--r--ext/mbstring/mb_gpc.c45
-rw-r--r--ext/mbstring/mb_gpc.h2
-rw-r--r--ext/mbstring/mbstring.c106
-rw-r--r--ext/mbstring/mbstring.dsp20
-rw-r--r--ext/mbstring/mbstring.h4
-rw-r--r--ext/mbstring/oniguruma/HISTORY14
-rwxr-xr-xext/mbstring/oniguruma/index.html31
-rw-r--r--ext/mbstring/oniguruma/oniggnu.h38
-rw-r--r--ext/mbstring/oniguruma/oniguruma.h78
-rw-r--r--ext/mbstring/oniguruma/regcomp.c3
-rw-r--r--ext/mbstring/oniguruma/regexec.c33
-rw-r--r--ext/mbstring/oniguruma/reggnu.c2
-rw-r--r--ext/mbstring/oniguruma/regint.h2
-rw-r--r--ext/mbstring/php_mbregex.c56
-rw-r--r--ext/mbstring/php_mbregex.h4
-rw-r--r--ext/mbstring/php_unicode.c2
-rw-r--r--ext/mbstring/php_unicode.h2
-rw-r--r--ext/mbstring/tests/htmlent.phpt18
-rw-r--r--ext/mcrypt/config.m44
-rw-r--r--ext/mcrypt/mcrypt.c4
-rw-r--r--ext/mcrypt/php_mcrypt.h4
-rw-r--r--ext/mcve/CREDITS2
-rw-r--r--ext/mcve/config.m4110
-rw-r--r--ext/mcve/config.w3218
-rw-r--r--ext/mcve/mcve.c2603
-rw-r--r--ext/mcve/mcve.dsp107
-rw-r--r--ext/mcve/mcve.php12
-rw-r--r--ext/mcve/mcve_simple_test.php19
-rw-r--r--ext/mcve/mcve_test1.php83
-rw-r--r--ext/mcve/mcve_test2.php68
-rw-r--r--ext/mcve/php_mcve.h220
-rw-r--r--ext/mcve/tests/001.phpt21
-rw-r--r--ext/mhash/config.m44
-rw-r--r--ext/mhash/mhash.c4
-rw-r--r--ext/mhash/php_mhash.h4
-rw-r--r--ext/mime_magic/mime_magic.c26
-rw-r--r--ext/mime_magic/php_mime_magic.h4
-rw-r--r--ext/mime_magic/phpmimemagic.h5
-rw-r--r--ext/ming/config.m415
-rw-r--r--ext/ming/config.w322
-rw-r--r--ext/ming/ming.c12
-rw-r--r--ext/ming/php_ming.h4
-rwxr-xr-xext/ming/tests/swfaction-new.phpt2
-rw-r--r--ext/ming/tests/swfaction.phpt2
-rw-r--r--ext/mnogosearch/CREDITS2
-rw-r--r--ext/mnogosearch/README24
-rw-r--r--ext/mnogosearch/config.m453
-rw-r--r--ext/mnogosearch/index.php1055
-rw-r--r--ext/mnogosearch/php_mnogo.c2667
-rw-r--r--ext/mnogosearch/php_mnogo.h113
-rw-r--r--ext/msession/msession.c23
-rw-r--r--ext/msession/php_msession.h5
-rw-r--r--ext/msession/reqclient.h2
-rw-r--r--ext/msql/config.m44
-rw-r--r--ext/msql/php_msql.c8
-rw-r--r--ext/msql/php_msql.h4
-rw-r--r--ext/mssql/config.m426
-rw-r--r--ext/mssql/config.w3223
-rw-r--r--ext/mssql/mssql.dsp6
-rw-r--r--ext/mssql/php_mssql.c264
-rw-r--r--ext/mssql/php_mssql.h16
-rw-r--r--ext/mysql/config.m444
-rw-r--r--ext/mysql/config.w325
-rw-r--r--ext/mysql/package.xml13
-rw-r--r--ext/mysql/php_mysql.c29
-rw-r--r--ext/mysql/php_mysql.h4
-rwxr-xr-xext/mysql/tests/001.phpt2
-rw-r--r--ext/mysqli/config.m415
-rw-r--r--ext/mysqli/config.w326
-rw-r--r--ext/mysqli/mysqli.c206
-rw-r--r--ext/mysqli/mysqli_api.c142
-rw-r--r--ext/mysqli/mysqli_driver.c163
-rw-r--r--ext/mysqli/mysqli_embedded.c132
-rw-r--r--ext/mysqli/mysqli_exception.c84
-rw-r--r--ext/mysqli/mysqli_fe.c29
-rw-r--r--ext/mysqli/mysqli_nonapi.c166
-rw-r--r--ext/mysqli/mysqli_prop.c19
-rw-r--r--ext/mysqli/mysqli_repl.c4
-rw-r--r--ext/mysqli/mysqli_report.c8
-rw-r--r--ext/mysqli/mysqli_report.h14
-rw-r--r--ext/mysqli/mysqli_warning.c235
-rw-r--r--ext/mysqli/php_mysqli.h99
-rw-r--r--ext/mysqli/tests/001.phpt3
-rw-r--r--ext/mysqli/tests/003.phpt4
-rw-r--r--ext/mysqli/tests/006.phpt1
-rw-r--r--ext/mysqli/tests/007.phpt1
-rw-r--r--ext/mysqli/tests/008.phpt1
-rw-r--r--ext/mysqli/tests/009.phpt32
-rw-r--r--ext/mysqli/tests/010.phpt1
-rw-r--r--ext/mysqli/tests/014.phpt4
-rw-r--r--ext/mysqli/tests/017.phpt1
-rw-r--r--ext/mysqli/tests/020.phpt1
-rw-r--r--ext/mysqli/tests/023.phpt1
-rw-r--r--ext/mysqli/tests/024.phpt1
-rw-r--r--ext/mysqli/tests/025.phpt1
-rw-r--r--ext/mysqli/tests/026.phpt1
-rw-r--r--ext/mysqli/tests/033.phpt3
-rw-r--r--ext/mysqli/tests/034.phpt1
-rw-r--r--ext/mysqli/tests/036.phpt8
-rw-r--r--ext/mysqli/tests/041.phpt8
-rw-r--r--ext/mysqli/tests/042.phpt1
-rw-r--r--ext/mysqli/tests/045.phpt1
-rw-r--r--ext/mysqli/tests/047.phpt4
-rw-r--r--ext/mysqli/tests/049.phpt1
-rw-r--r--ext/mysqli/tests/060.phpt1
-rw-r--r--ext/mysqli/tests/061.csv1
-rw-r--r--ext/mysqli/tests/061.phpt9
-rw-r--r--ext/mysqli/tests/062.phpt25
-rw-r--r--ext/mysqli/tests/063.phpt21
-rw-r--r--ext/mysqli/tests/064.phpt2
-rw-r--r--ext/mysqli/tests/065.phpt4
-rw-r--r--ext/mysqli/tests/066.phpt28
-rw-r--r--ext/mysqli/tests/067.phpt51
-rw-r--r--ext/mysqli/tests/bug28817.phpt39
-rw-r--r--ext/mysqli/tests/bug32405.phpt1
-rw-r--r--ext/mysqli/tests/bug33491.phpt26
-rw-r--r--ext/mysqli/tests/bug34785.phpt47
-rw-r--r--ext/mysqli/tests/bug34810.phpt38
-rw-r--r--ext/mysqli/tests/connect.inc19
-rw-r--r--ext/mysqli/tests/skipif.inc10
-rw-r--r--ext/mysqli/tests/skipifemb.inc5
-rw-r--r--ext/ncurses/config.m412
-rw-r--r--ext/ncurses/ncurses.c24
-rw-r--r--ext/ncurses/ncurses_fe.c2
-rw-r--r--ext/ncurses/ncurses_functions.c9
-rw-r--r--ext/ncurses/php_ncurses.h4
-rw-r--r--ext/ncurses/php_ncurses_fe.h2
-rw-r--r--ext/oci8/config.m4102
-rw-r--r--ext/oci8/oci8.c54
-rw-r--r--ext/oci8/php_oci8.h4
-rw-r--r--ext/odbc/birdstep.c4
-rw-r--r--ext/odbc/config.m4116
-rw-r--r--ext/odbc/php_birdstep.h4
-rw-r--r--ext/odbc/php_odbc.c96
-rw-r--r--ext/odbc/php_odbc.h4
-rw-r--r--ext/odbc/php_odbc_includes.h18
-rw-r--r--ext/openssl/config0.m42
-rw-r--r--ext/openssl/openssl.c32
-rw-r--r--ext/openssl/openssl.mak185
-rw-r--r--ext/openssl/php_openssl.h4
-rw-r--r--ext/openssl/xp_ssl.c30
-rw-r--r--ext/oracle/CREDITS2
-rw-r--r--ext/oracle/config.m4159
-rw-r--r--ext/oracle/config.w3218
-rw-r--r--ext/oracle/oracle.c1770
-rw-r--r--ext/oracle/oracle.dsp113
-rw-r--r--ext/oracle/package.xml68
-rw-r--r--ext/oracle/php_oracle.h137
-rw-r--r--ext/ovrimos/CREDITS2
-rw-r--r--ext/ovrimos/config.m426
-rw-r--r--ext/ovrimos/ovrimos.c1291
-rw-r--r--ext/ovrimos/php_ovrimos.h44
-rwxr-xr-xext/pcntl/pcntl.c4
-rw-r--r--ext/pcntl/php_pcntl.h4
-rw-r--r--ext/pcntl/php_signal.c4
-rw-r--r--ext/pcntl/php_signal.h4
-rw-r--r--ext/pcre/config.w322
-rw-r--r--ext/pcre/config0.m4 (renamed from ext/pcre/config.m4)5
-rw-r--r--ext/pcre/php_pcre.c65
-rw-r--r--ext/pcre/php_pcre.h6
-rwxr-xr-xext/pcre/tests/bug34790.phpt23
-rw-r--r--ext/pcre/tests/pcre_count.phpt40
-rwxr-xr-xext/pdo/CREDITS2
-rw-r--r--ext/pdo/EXPERIMENTAL (renamed from ext/dio/EXPERIMENTAL)0
-rw-r--r--ext/pdo/Makefile.frag26
-rwxr-xr-xext/pdo/README56
-rwxr-xr-xext/pdo/TODO97
-rwxr-xr-xext/pdo/config.m468
-rwxr-xr-xext/pdo/config.w3210
-rwxr-xr-xext/pdo/package.xml116
-rwxr-xr-xext/pdo/pdo.c399
-rwxr-xr-xext/pdo/pdo.php62
-rwxr-xr-xext/pdo/pdo_dbh.c1433
-rw-r--r--ext/pdo/pdo_sql_parser.c692
-rw-r--r--ext/pdo/pdo_sql_parser.c.orig712
-rw-r--r--ext/pdo/pdo_sql_parser.re487
-rw-r--r--ext/pdo/pdo_sqlstate.c340
-rwxr-xr-xext/pdo/pdo_stmt.c2490
-rwxr-xr-xext/pdo/php_pdo.h91
-rwxr-xr-xext/pdo/php_pdo_driver.h660
-rwxr-xr-xext/pdo/php_pdo_int.h84
-rw-r--r--ext/pdo/tests/bug_34630.phpt57
-rw-r--r--ext/pdo/tests/bug_34687.phpt32
-rwxr-xr-xext/pdo/tests/pdo.inc11
-rw-r--r--ext/pdo/tests/pdo_001.phpt50
-rw-r--r--ext/pdo/tests/pdo_002.phpt50
-rw-r--r--ext/pdo/tests/pdo_003.phpt62
-rw-r--r--ext/pdo/tests/pdo_004.phpt50
-rw-r--r--ext/pdo/tests/pdo_005.phpt154
-rw-r--r--ext/pdo/tests/pdo_006.phpt77
-rw-r--r--ext/pdo/tests/pdo_007.phpt65
-rw-r--r--ext/pdo/tests/pdo_008.phpt40
-rw-r--r--ext/pdo/tests/pdo_009.phpt131
-rw-r--r--ext/pdo/tests/pdo_010.phpt119
-rw-r--r--ext/pdo/tests/pdo_011.phpt245
-rw-r--r--ext/pdo/tests/pdo_012.phpt98
-rw-r--r--ext/pdo/tests/pdo_013.phpt96
-rw-r--r--ext/pdo/tests/pdo_014.phpt102
-rw-r--r--ext/pdo/tests/pdo_015.phpt100
-rw-r--r--ext/pdo/tests/pdo_016.phpt199
-rwxr-xr-xext/pdo/tests/pdo_016a.phpt199
-rw-r--r--ext/pdo/tests/pdo_017.phpt63
-rw-r--r--ext/pdo/tests/pdo_018.phpt270
-rw-r--r--ext/pdo/tests/pdo_019.phpt71
-rw-r--r--ext/pdo/tests/pdo_020.phpt34
-rw-r--r--ext/pdo/tests/pdo_021.phpt57
-rw-r--r--ext/pdo/tests/pdo_022.phpt62
-rw-r--r--ext/pdo/tests/pdo_023.phpt112
-rw-r--r--ext/pdo/tests/pdo_024.phpt35
-rw-r--r--ext/pdo/tests/pdo_025.phpt113
-rw-r--r--ext/pdo/tests/pdo_026.phpt111
-rw-r--r--ext/pdo/tests/pdo_027.phpt29
-rw-r--r--ext/pdo/tests/pdo_028.phpt45
-rwxr-xr-xext/pdo/tests/pdo_029.phpt125
-rwxr-xr-xext/pdo/tests/pdo_030.phpt176
-rwxr-xr-xext/pdo/tests/pdo_031.phpt63
-rw-r--r--ext/pdo/tests/pdo_032.phpt83
-rw-r--r--ext/pdo/tests/pdo_test.inc85
-rw-r--r--ext/pdo/tests/pecl_bug_5217.phpt29
-rw-r--r--ext/pdo/tests/pecl_bug_5772.phpt29
-rw-r--r--ext/pdo/tests/pecl_bug_5809.phpt34
-rw-r--r--ext/pdo_dblib/CREDITS2
-rw-r--r--ext/pdo_dblib/README25
-rw-r--r--ext/pdo_dblib/config.m488
-rwxr-xr-xext/pdo_dblib/config.w3269
-rw-r--r--ext/pdo_dblib/db.php31
-rw-r--r--ext/pdo_dblib/dblib_driver.c272
-rw-r--r--ext/pdo_dblib/dblib_stmt.c265
-rw-r--r--ext/pdo_dblib/package.xml60
-rw-r--r--ext/pdo_dblib/pdo_dblib.c224
-rw-r--r--ext/pdo_dblib/php_pdo_dblib.h45
-rw-r--r--ext/pdo_dblib/php_pdo_dblib_int.h156
-rw-r--r--ext/pdo_firebird/CREDITS2
-rw-r--r--ext/pdo_firebird/EXPERIMENTAL (renamed from ext/w32api/EXPERIMENTAL)0
-rw-r--r--ext/pdo_firebird/config.m453
-rw-r--r--ext/pdo_firebird/config.w3218
-rw-r--r--ext/pdo_firebird/firebird_driver.c664
-rw-r--r--ext/pdo_firebird/firebird_statement.c702
-rw-r--r--ext/pdo_firebird/package.xml57
-rw-r--r--ext/pdo_firebird/pdo_firebird.c87
-rw-r--r--ext/pdo_firebird/php_pdo_firebird.h58
-rw-r--r--ext/pdo_firebird/php_pdo_firebird_int.h127
-rw-r--r--ext/pdo_firebird/tests/common.phpt27
-rw-r--r--ext/pdo_firebird/tests/connect.phpt16
-rw-r--r--ext/pdo_firebird/tests/ddl.phpt37
-rw-r--r--ext/pdo_firebird/tests/execute.phpt65
-rw-r--r--ext/pdo_firebird/tests/skipif.inc5
-rw-r--r--ext/pdo_firebird/tests/testdb.inc34
-rwxr-xr-xext/pdo_mysql/CREDITS2
-rwxr-xr-xext/pdo_mysql/config.m4131
-rw-r--r--ext/pdo_mysql/config.w3215
-rw-r--r--ext/pdo_mysql/get_error_codes.php27
-rwxr-xr-xext/pdo_mysql/mysql_driver.c526
-rwxr-xr-xext/pdo_mysql/mysql_statement.c608
-rw-r--r--ext/pdo_mysql/package.xml67
-rwxr-xr-xext/pdo_mysql/pdo_mysql.c114
-rwxr-xr-xext/pdo_mysql/php_pdo_mysql.h53
-rwxr-xr-xext/pdo_mysql/php_pdo_mysql_int.h86
-rw-r--r--ext/pdo_mysql/php_pdo_mysql_sqlstate.h388
-rw-r--r--ext/pdo_mysql/tests/bug_33689.phpt50
-rw-r--r--ext/pdo_mysql/tests/common.phpt28
-rw-r--r--ext/pdo_mysql/tests/config.inc19
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5200.phpt30
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5780.phpt41
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5802.phpt52
-rw-r--r--ext/pdo_mysql/tests/show_tables.phpt20
-rwxr-xr-xext/pdo_oci/CREDITS2
-rw-r--r--ext/pdo_oci/EXPERIMENTAL0
-rwxr-xr-xext/pdo_oci/config.m4209
-rwxr-xr-xext/pdo_oci/config.w3286
-rwxr-xr-xext/pdo_oci/oci_driver.c558
-rwxr-xr-xext/pdo_oci/oci_statement.c732
-rwxr-xr-xext/pdo_oci/package.xml53
-rwxr-xr-xext/pdo_oci/pdo_oci.c133
-rwxr-xr-xext/pdo_oci/php_pdo_oci.h53
-rwxr-xr-xext/pdo_oci/php_pdo_oci_int.h94
-rw-r--r--ext/pdo_oci/tests/bug_33707.phpt30
-rw-r--r--ext/pdo_oci/tests/common.phpt26
-rwxr-xr-xext/pdo_odbc/CREDITS2
-rw-r--r--ext/pdo_odbc/EXPERIMENTAL2
-rwxr-xr-xext/pdo_odbc/config.m4169
-rwxr-xr-xext/pdo_odbc/config.w3215
-rwxr-xr-xext/pdo_odbc/odbc_driver.c432
-rwxr-xr-xext/pdo_odbc/odbc_stmt.c616
-rwxr-xr-xext/pdo_odbc/package.xml51
-rwxr-xr-xext/pdo_odbc/pdo_odbc.c184
-rw-r--r--ext/pdo_odbc/php_pdo_odbc.h (renamed from ext/fam/php_fam.h)57
-rwxr-xr-xext/pdo_odbc/php_pdo_odbc_int.h182
-rw-r--r--ext/pdo_odbc/tests/common.phpt48
-rw-r--r--ext/pdo_odbc/tests/long_columns.phpt44
-rw-r--r--ext/pdo_pgsql/CREDITS2
-rw-r--r--ext/pdo_pgsql/config.m4131
-rw-r--r--ext/pdo_pgsql/config.w3217
-rw-r--r--ext/pdo_pgsql/package.xml63
-rw-r--r--ext/pdo_pgsql/pdo_pgsql.c129
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c492
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c576
-rw-r--r--ext/pdo_pgsql/php_pdo_pgsql.h55
-rw-r--r--ext/pdo_pgsql/php_pdo_pgsql_int.h102
-rw-r--r--ext/pdo_pgsql/tests/bug_33876.phpt149
-rw-r--r--ext/pdo_pgsql/tests/common.phpt23
-rw-r--r--ext/pdo_sqlite/CREDITS2
-rw-r--r--ext/pdo_sqlite/EXPERIMENTAL0
-rw-r--r--ext/pdo_sqlite/config.m4122
-rw-r--r--ext/pdo_sqlite/config.w3231
-rwxr-xr-xext/pdo_sqlite/package.xml177
-rw-r--r--ext/pdo_sqlite/pdo_sqlite.c116
-rw-r--r--ext/pdo_sqlite/php_pdo_sqlite.h71
-rw-r--r--ext/pdo_sqlite/php_pdo_sqlite_int.h69
-rwxr-xr-xext/pdo_sqlite/post-bundle.sh10
-rw-r--r--ext/pdo_sqlite/sqlite/Makefile.in660
-rw-r--r--ext/pdo_sqlite/sqlite/Makefile.linux-gcc112
-rw-r--r--ext/pdo_sqlite/sqlite/README35
-rw-r--r--ext/pdo_sqlite/sqlite/VERSION1
-rw-r--r--ext/pdo_sqlite/sqlite/aclocal.m45913
-rw-r--r--ext/pdo_sqlite/sqlite/config.guess1432
-rw-r--r--ext/pdo_sqlite/sqlite/config.sub1537
-rwxr-xr-xext/pdo_sqlite/sqlite/configure21326
-rw-r--r--ext/pdo_sqlite/sqlite/configure.ac616
-rwxr-xr-xext/pdo_sqlite/sqlite/install-sh251
-rw-r--r--ext/pdo_sqlite/sqlite/ltmain.sh6399
-rw-r--r--ext/pdo_sqlite/sqlite/main.mk565
-rw-r--r--ext/pdo_sqlite/sqlite/mkdll.sh44
-rw-r--r--ext/pdo_sqlite/sqlite/mkopcodec.awk28
-rw-r--r--ext/pdo_sqlite/sqlite/mkopcodeh.awk110
-rw-r--r--ext/pdo_sqlite/sqlite/mkso.sh29
-rw-r--r--ext/pdo_sqlite/sqlite/publish.sh115
-rw-r--r--ext/pdo_sqlite/sqlite/spec.template62
-rw-r--r--ext/pdo_sqlite/sqlite/sqlite.1203
-rw-r--r--ext/pdo_sqlite/sqlite/sqlite.pc.in12
-rw-r--r--ext/pdo_sqlite/sqlite/sqlite3.def97
-rw-r--r--ext/pdo_sqlite/sqlite/sqlite3.pc.in12
-rw-r--r--ext/pdo_sqlite/sqlite/src/alter.c557
-rw-r--r--ext/pdo_sqlite/sqlite/src/analyze.c386
-rw-r--r--ext/pdo_sqlite/sqlite/src/attach.c352
-rw-r--r--ext/pdo_sqlite/sqlite/src/auth.c225
-rw-r--r--ext/pdo_sqlite/sqlite/src/btree.c5833
-rw-r--r--ext/pdo_sqlite/sqlite/src/btree.h144
-rw-r--r--ext/pdo_sqlite/sqlite/src/build.c2938
-rw-r--r--ext/pdo_sqlite/sqlite/src/callback.c305
-rw-r--r--ext/pdo_sqlite/sqlite/src/date.c996
-rw-r--r--ext/pdo_sqlite/sqlite/src/delete.c445
-rw-r--r--ext/pdo_sqlite/sqlite/src/experimental.c37
-rw-r--r--ext/pdo_sqlite/sqlite/src/expr.c2253
-rw-r--r--ext/pdo_sqlite/sqlite/src/func.c1118
-rw-r--r--ext/pdo_sqlite/sqlite/src/hash.c387
-rw-r--r--ext/pdo_sqlite/sqlite/src/hash.h109
-rw-r--r--ext/pdo_sqlite/sqlite/src/insert.c1107
-rw-r--r--ext/pdo_sqlite/sqlite/src/keywordhash.h97
-rw-r--r--ext/pdo_sqlite/sqlite/src/legacy.c138
-rw-r--r--ext/pdo_sqlite/sqlite/src/main.c1060
-rw-r--r--ext/pdo_sqlite/sqlite/src/md5.c387
-rw-r--r--ext/pdo_sqlite/sqlite/src/opcodes.c137
-rw-r--r--ext/pdo_sqlite/sqlite/src/opcodes.h149
-rw-r--r--ext/pdo_sqlite/sqlite/src/os.h207
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_common.h123
-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_test.c463
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_test.h40
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_unix.c1460
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_unix.h116
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_win.c940
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_win.h40
-rw-r--r--ext/pdo_sqlite/sqlite/src/pager.c3634
-rw-r--r--ext/pdo_sqlite/sqlite/src/pager.h116
-rw-r--r--ext/pdo_sqlite/sqlite/src/parse.c3449
-rw-r--r--ext/pdo_sqlite/sqlite/src/parse.h145
-rw-r--r--ext/pdo_sqlite/sqlite/src/parse.y1065
-rw-r--r--ext/pdo_sqlite/sqlite/src/pragma.c935
-rw-r--r--ext/pdo_sqlite/sqlite/src/prepare.c540
-rw-r--r--ext/pdo_sqlite/sqlite/src/printf.c866
-rw-r--r--ext/pdo_sqlite/sqlite/src/random.c100
-rw-r--r--ext/pdo_sqlite/sqlite/src/select.c3127
-rw-r--r--ext/pdo_sqlite/sqlite/src/shell.c1813
-rw-r--r--ext/pdo_sqlite/sqlite/src/sqlite.h.in1275
-rw-r--r--ext/pdo_sqlite/sqlite/src/sqliteInt.h1664
-rw-r--r--ext/pdo_sqlite/sqlite/src/sqlite_config.w32.h8
-rw-r--r--ext/pdo_sqlite/sqlite/src/table.c195
-rw-r--r--ext/pdo_sqlite/sqlite/src/tclsqlite.c2079
-rw-r--r--ext/pdo_sqlite/sqlite/src/test1.c3254
-rw-r--r--ext/pdo_sqlite/sqlite/src/test2.c604
-rw-r--r--ext/pdo_sqlite/sqlite/src/test3.c1458
-rw-r--r--ext/pdo_sqlite/sqlite/src/test4.c647
-rw-r--r--ext/pdo_sqlite/sqlite/src/test5.c218
-rw-r--r--ext/pdo_sqlite/sqlite/src/tokenize.c433
-rw-r--r--ext/pdo_sqlite/sqlite/src/trigger.c803
-rw-r--r--ext/pdo_sqlite/sqlite/src/update.c506
-rw-r--r--ext/pdo_sqlite/sqlite/src/utf.c570
-rw-r--r--ext/pdo_sqlite/sqlite/src/util.c1005
-rw-r--r--ext/pdo_sqlite/sqlite/src/vacuum.c310
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbe.c4432
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbe.h131
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbeInt.h377
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbeapi.c737
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbeaux.c1819
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbefifo.c114
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbemem.c840
-rw-r--r--ext/pdo_sqlite/sqlite/src/where.c2052
-rw-r--r--ext/pdo_sqlite/sqlite/tool/diffdb.c44
-rw-r--r--ext/pdo_sqlite/sqlite/tool/lemon.c4587
-rw-r--r--ext/pdo_sqlite/sqlite/tool/lempar.c714
-rw-r--r--ext/pdo_sqlite/sqlite/tool/memleak.awk29
-rw-r--r--ext/pdo_sqlite/sqlite/tool/memleak2.awk29
-rw-r--r--ext/pdo_sqlite/sqlite/tool/memleak3.tcl232
-rw-r--r--ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c501
-rwxr-xr-xext/pdo_sqlite/sqlite/tool/mkopts.tcl51
-rw-r--r--ext/pdo_sqlite/sqlite/tool/opcodeDoc.awk23
-rw-r--r--ext/pdo_sqlite/sqlite/tool/report1.txt66
-rw-r--r--ext/pdo_sqlite/sqlite/tool/showdb.c85
-rw-r--r--ext/pdo_sqlite/sqlite/tool/showjournal.c76
-rw-r--r--ext/pdo_sqlite/sqlite/tool/space_used.tcl111
-rw-r--r--ext/pdo_sqlite/sqlite/tool/spaceanal.tcl801
-rw-r--r--ext/pdo_sqlite/sqlite/tool/speedtest.tcl275
-rw-r--r--ext/pdo_sqlite/sqlite/tool/speedtest2.tcl207
-rw-r--r--ext/pdo_sqlite/sqlite_driver.c744
-rw-r--r--ext/pdo_sqlite/sqlite_statement.c325
-rw-r--r--ext/pdo_sqlite/tests/bug33841.phpt28
-rw-r--r--ext/pdo_sqlite/tests/bug35336.phpt22
-rw-r--r--ext/pdo_sqlite/tests/common.phpt12
-rw-r--r--ext/pfpro/CREDITS2
-rw-r--r--ext/pfpro/TODO12
-rw-r--r--ext/pfpro/config.m470
-rw-r--r--ext/pfpro/pfpro.c549
-rw-r--r--ext/pfpro/php_pfpro.h85
-rw-r--r--ext/pgsql/CREDITS2
-rw-r--r--ext/pgsql/config.m418
-rw-r--r--ext/pgsql/config.w326
-rw-r--r--ext/pgsql/pgsql.c960
-rw-r--r--ext/pgsql/php_pgsql.h33
-rw-r--r--ext/pgsql/tests/02connection.phpt6
-rw-r--r--ext/pgsql/tests/03sync_query.phpt20
-rw-r--r--ext/pgsql/tests/06copy.phpt7
-rw-r--r--ext/pgsql/tests/07optional.phpt5
-rw-r--r--ext/pgsql/tests/08escape.phpt15
-rw-r--r--ext/pgsql/tests/23sync_query_params.phpt59
-rw-r--r--ext/pgsql/tests/24sync_query_prepared.phpt65
-rw-r--r--ext/pgsql/tests/25async_query_params.phpt70
-rw-r--r--ext/pgsql/tests/26async_query_prepared.phpt106
-rwxr-xr-xext/pgsql/tests/80_bug32223.phpt54
-rwxr-xr-xext/pgsql/tests/80_bug32223b.phpt57
-rw-r--r--ext/posix/config.m44
-rw-r--r--ext/posix/php_posix.h10
-rw-r--r--ext/posix/posix.c132
-rw-r--r--ext/pspell/README2
-rw-r--r--ext/pspell/config.m46
-rw-r--r--ext/pspell/php_pspell.h4
-rw-r--r--ext/pspell/pspell.c144
-rw-r--r--ext/pspell/tests/01pspell_basic.phpt34
-rw-r--r--ext/readline/config.m432
-rw-r--r--ext/readline/php_readline.h4
-rw-r--r--ext/readline/readline.c199
-rw-r--r--ext/recode/config.m410
-rw-r--r--ext/recode/config9.m42
-rw-r--r--ext/recode/php_recode.h4
-rw-r--r--ext/recode/recode.c43
-rw-r--r--ext/session/config.m48
-rw-r--r--ext/session/mod_files.c12
-rw-r--r--ext/session/mod_files.h4
-rw-r--r--ext/session/mod_files.sh12
-rw-r--r--ext/session/mod_mm.c4
-rw-r--r--ext/session/mod_mm.h4
-rw-r--r--ext/session/mod_user.c4
-rw-r--r--ext/session/mod_user.h4
-rw-r--r--ext/session/php_session.h9
-rw-r--r--ext/session/session.c100
-rw-r--r--ext/session/tests/001.phpt1
-rw-r--r--ext/session/tests/003.phpt1
-rw-r--r--ext/session/tests/006.phpt3
-rw-r--r--ext/session/tests/007.phpt3
-rw-r--r--ext/session/tests/008-php4.2.3.phpt3
-rw-r--r--ext/session/tests/009.phpt3
-rw-r--r--ext/session/tests/012.phpt1
-rw-r--r--ext/session/tests/013.phpt1
-rw-r--r--ext/session/tests/014.phpt1
-rw-r--r--ext/session/tests/015.phpt1
-rw-r--r--ext/session/tests/017.phpt1
-rw-r--r--ext/session/tests/018.phpt1
-rw-r--r--ext/session/tests/019.phpt1
-rw-r--r--ext/session/tests/020.phpt1
-rw-r--r--ext/session/tests/021.phpt1
-rw-r--r--ext/session/tests/bug24592.phpt1
-rw-r--r--ext/session/tests/bug26862.phpt1
-rw-r--r--ext/shmop/php_shmop.h5
-rw-r--r--ext/shmop/shmop.c36
-rw-r--r--ext/simplexml/config.m44
-rw-r--r--ext/simplexml/php_simplexml.h6
-rwxr-xr-xext/simplexml/php_simplexml_exports.h10
-rw-r--r--ext/simplexml/simplexml.c112
-rwxr-xr-xext/simplexml/tests/016a.phpt29
-rwxr-xr-xext/simplexml/tests/022.phpt30
-rwxr-xr-xext/simplexml/tests/023.phpt31
-rwxr-xr-xext/simplexml/tests/sxe.dtd25
-rw-r--r--ext/skeleton/skeleton.php10
-rw-r--r--ext/snmp/config.m49
-rw-r--r--ext/snmp/php_snmp.h4
-rw-r--r--ext/snmp/snmp.c135
-rw-r--r--ext/snmp/winsnmp.c12
-rw-r--r--ext/soap/TODO2
-rw-r--r--ext/soap/config.m44
-rw-r--r--ext/soap/interop/client_round2_interop.php2
-rw-r--r--ext/soap/php_encoding.c197
-rw-r--r--ext/soap/php_encoding.h4
-rw-r--r--ext/soap/php_http.c83
-rw-r--r--ext/soap/php_http.h4
-rw-r--r--ext/soap/php_packet_soap.c4
-rw-r--r--ext/soap/php_packet_soap.h4
-rw-r--r--ext/soap/php_schema.c42
-rw-r--r--ext/soap/php_schema.h6
-rw-r--r--ext/soap/php_sdl.c65
-rw-r--r--ext/soap/php_sdl.h4
-rw-r--r--ext/soap/php_soap.h6
-rw-r--r--ext/soap/php_xml.c11
-rw-r--r--ext/soap/php_xml.h6
-rw-r--r--ext/soap/soap.c94
-rwxr-xr-xext/soap/tests/any.phpt83
-rwxr-xr-xext/soap/tests/bugs/bug34449.phpt20
-rwxr-xr-xext/soap/tests/bugs/bug34453.phpt41
-rwxr-xr-xext/soap/tests/bugs/bug34453.wsdl42
-rwxr-xr-xext/soap/tests/bugs/bug34643.phpt48
-rwxr-xr-xext/soap/tests/bugs/bug34643.wsdl42
-rwxr-xr-xext/soap/tests/bugs/bug35142.phpt135
-rwxr-xr-xext/soap/tests/bugs/bug35142.wsdl543
-rwxr-xr-xext/soap/tests/bugs/bug35273.phpt21
-rwxr-xr-xext/soap/tests/bugs/xml2.xsd146
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt23
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt21
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt20
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt24
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt24
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt27
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt24
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt27
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt28
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt38
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt28
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/Base/round2_base.inc80
-rw-r--r--ext/soap/tests/interop/Round2/Base/round2_base.wsdl332
-rw-r--r--ext/soap/tests/interop/Round2/Base/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt24
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt19
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt31
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt22
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt29
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt29
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt29
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt24
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt29
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt24
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc37
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl192
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl20
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl22
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd12
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt28
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt37
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt27
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt27
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt27
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt27
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt27
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt27
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc17
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl85
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc12
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl65
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc28
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl135
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc29
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl175
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc14
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl37
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc14
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl26
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc14
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl26
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl26
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc19
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl75
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc28
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl126
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt35
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt42
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt49
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt28
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt50
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt50
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc17
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl61
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt15
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt20
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt20
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt23
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc14
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl72
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl73
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc22
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl70
-rw-r--r--ext/soap/tests/interop/Round3/GroupF/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc33
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl216
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc33
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl171
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc25
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl185
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc25
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl151
-rw-r--r--ext/soap/tests/interop/Round4/GroupG/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt26
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt32
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt40
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt35
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt35
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt35
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt51
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt51
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt51
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt51
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt26
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt25
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt33
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt33
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt33
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt33
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt41
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt41
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt41
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt41
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt18
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc38
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl329
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc38
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl301
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc56
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl418
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc56
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl408
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc22
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl81
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/skipif.inc3
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phptbin0 -> 1045 bytes
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt27
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt28
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt27
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt27
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt27
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt28
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt21
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt35
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt29
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt28
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt27
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt19
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt20
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc198
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl1113
-rw-r--r--ext/soap/tests/interop/Round4/GroupI/skipif.inc3
-rw-r--r--ext/soap/tests/schema/schema049.phpt1
-rw-r--r--ext/soap/tests/schema/schema062.phpt2
-rwxr-xr-xext/soap/tests/server022.phpt40
-rw-r--r--ext/sockets/config.m43
-rw-r--r--ext/sockets/php_sockets.h4
-rw-r--r--ext/sockets/php_sockets_win.c4
-rw-r--r--ext/sockets/php_sockets_win.h4
-rw-r--r--ext/sockets/sockets.c34
-rw-r--r--ext/sockets/unix_socket_constants.h4
-rw-r--r--ext/sockets/win32_socket_constants.h4
-rwxr-xr-xext/spl/README45
-rwxr-xr-xext/spl/config.m44
-rw-r--r--ext/spl/config.w324
-rwxr-xr-xext/spl/doxygen.cfg426
-rwxr-xr-xext/spl/examples/autoload.inc2
-rw-r--r--ext/spl/examples/cachingrecursiveiterator.inc28
-rwxr-xr-xext/spl/examples/class_tree.php87
-rwxr-xr-xext/spl/examples/dba_array.php2
-rwxr-xr-xext/spl/examples/dba_dump.php6
-rwxr-xr-xext/spl/examples/dbaarray.inc4
-rwxr-xr-xext/spl/examples/dbareader.inc2
-rwxr-xr-xext/spl/examples/directoryfilterdots.inc24
-rw-r--r--ext/spl/examples/directorygraphiterator.inc25
-rwxr-xr-xext/spl/examples/directorytree.inc2
-rwxr-xr-xext/spl/examples/directorytree.php4
-rw-r--r--ext/spl/examples/directorytreeiterator.inc4
-rwxr-xr-xext/spl/examples/findfile.inc6
-rwxr-xr-xext/spl/examples/findfile.php4
-rwxr-xr-xext/spl/examples/findregex.php2
-rwxr-xr-xext/spl/examples/infiniteiterator.inc102
-rwxr-xr-xext/spl/examples/ini_groups.php6
-rwxr-xr-xext/spl/examples/inigroups.inc6
-rwxr-xr-xext/spl/examples/keyfilter.inc2
-rwxr-xr-xext/spl/examples/nocvsdir.php54
-rwxr-xr-xext/spl/examples/norewinditerator.inc53
-rwxr-xr-xext/spl/examples/recursivetreeiterator.inc113
-rwxr-xr-xext/spl/examples/regexfindfile.inc2
-rwxr-xr-xext/spl/examples/searchiterator.inc2
-rwxr-xr-xext/spl/examples/tests/examples.inc4
-rwxr-xr-xext/spl/examples/tree.php7
-rwxr-xr-xext/spl/internal/appenditerator.inc (renamed from ext/spl/examples/appenditerator.inc)14
-rwxr-xr-xext/spl/internal/cachingiterator.inc100
-rwxr-xr-xext/spl/internal/cachingrecursiveiterator.inc53
-rwxr-xr-xext/spl/internal/emptyiterator.inc (renamed from ext/spl/examples/emptyiterator.inc)8
-rwxr-xr-xext/spl/internal/filteriterator.inc38
-rwxr-xr-xext/spl/internal/infiniteiterator.inc48
-rwxr-xr-xext/spl/internal/iteratoriterator.inc121
-rwxr-xr-xext/spl/internal/limititerator.inc72
-rwxr-xr-xext/spl/internal/norewinditerator.inc28
-rwxr-xr-xext/spl/internal/outeriterator.inc25
-rwxr-xr-xext/spl/internal/parentiterator.inc33
-rwxr-xr-xext/spl/internal/recursivearrayiterator.inc59
-rwxr-xr-xext/spl/internal/recursivecachingiterator.inc99
-rwxr-xr-xext/spl/internal/recursivefilteriterator.inc62
-rwxr-xr-xext/spl/internal/recursiveiterator.inc21
-rwxr-xr-xext/spl/internal/recursiveiteratoriterator.inc154
-rwxr-xr-xext/spl/internal/seekableiterator.inc31
-rwxr-xr-xext/spl/internal/splfileobject.inc353
-rwxr-xr-xext/spl/internal/splobjectstorage.inc118
-rwxr-xr-xext/spl/php_spl.c615
-rwxr-xr-xext/spl/php_spl.h5
-rwxr-xr-xext/spl/spl.php946
-rwxr-xr-xext/spl/spl_array.c700
-rwxr-xr-xext/spl/spl_array.h8
-rwxr-xr-xext/spl/spl_directory.c891
-rwxr-xr-xext/spl/spl_directory.h32
-rwxr-xr-xext/spl/spl_engine.c2
-rwxr-xr-xext/spl/spl_engine.h4
-rwxr-xr-xext/spl/spl_exceptions.c81
-rwxr-xr-xext/spl/spl_exceptions.h53
-rwxr-xr-xext/spl/spl_functions.c14
-rwxr-xr-xext/spl/spl_functions.h9
-rwxr-xr-xext/spl/spl_iterators.c1004
-rwxr-xr-xext/spl/spl_iterators.h60
-rwxr-xr-xext/spl/spl_observer.c273
-rwxr-xr-x[-rw-r--r--]ext/spl/spl_observer.h (renamed from ext/ircg/ircg_thttpd.c)39
-rwxr-xr-xext/spl/spl_sxe.c27
-rwxr-xr-xext/spl/spl_sxe.h4
-rwxr-xr-xext/spl/tests/array_009.phpt15
-rwxr-xr-xext/spl/tests/array_009a.phpt39
-rwxr-xr-xext/spl/tests/array_016.phpt34
-rwxr-xr-xext/spl/tests/array_017.phpt649
-rwxr-xr-xext/spl/tests/array_018.phpt42
-rwxr-xr-xext/spl/tests/bug31926.phpt11
-rwxr-xr-xext/spl/tests/bug33136.phpt72
-rw-r--r--ext/spl/tests/bug34548.phpt38
-rwxr-xr-xext/spl/tests/fileobject_001.phpt88
-rwxr-xr-xext/spl/tests/fileobject_001a.txt6
-rwxr-xr-xext/spl/tests/fileobject_001b.txt6
-rwxr-xr-xext/spl/tests/fileobject_002.phpt122
-rwxr-xr-xext/spl/tests/iterator_001.phpt39
-rwxr-xr-xext/spl/tests/iterator_002.phpt2
-rwxr-xr-xext/spl/tests/iterator_005.phpt54
-rwxr-xr-xext/spl/tests/iterator_006.phpt24
-rwxr-xr-xext/spl/tests/iterator_007.phpt168
-rwxr-xr-xext/spl/tests/iterator_008.phpt91
-rwxr-xr-xext/spl/tests/iterator_009.phpt47
-rwxr-xr-xext/spl/tests/iterator_010.phpt (renamed from ext/spl/examples/tests/iterators_001.phpt)2
-rwxr-xr-xext/spl/tests/iterator_011.phpt51
-rwxr-xr-xext/spl/tests/iterator_012.phpt (renamed from ext/spl/examples/tests/iterators_003.phpt)2
-rwxr-xr-xext/spl/tests/iterator_013.phpt (renamed from ext/spl/examples/tests/iterators_004.phpt)2
-rwxr-xr-xext/spl/tests/iterator_014.phpt138
-rwxr-xr-xext/spl/tests/iterator_015.phpt62
-rwxr-xr-xext/spl/tests/iterator_016.phpt76
-rwxr-xr-xext/spl/tests/iterator_017.phpt18
-rwxr-xr-xext/spl/tests/iterator_018.phpt (renamed from ext/spl/examples/tests/iterators_002.phpt)2
-rwxr-xr-xext/spl/tests/iterator_019.phpt33
-rwxr-xr-xext/spl/tests/iterator_020.phpt66
-rwxr-xr-xext/spl/tests/iterator_021.phpt180
-rwxr-xr-xext/spl/tests/iterator_022.phpt186
-rwxr-xr-xext/spl/tests/iterator_023.phpt193
-rwxr-xr-xext/spl/tests/iterator_024.phpt49
-rwxr-xr-xext/spl/tests/iterator_025.phpt92
-rwxr-xr-xext/spl/tests/iterator_026.phpt34
-rwxr-xr-xext/spl/tests/iterator_028.phpt170
-rwxr-xr-xext/spl/tests/observer_001.phpt116
-rwxr-xr-xext/spl/tests/observer_002.phpt199
-rwxr-xr-xext/spl/tests/spl_001.phpt34
-rwxr-xr-xext/spl/tests/spl_002.phpt22
-rwxr-xr-xext/spl/tests/spl_003.phpt76
-rwxr-xr-xext/spl/tests/spl_autoload_001.phpt136
-rwxr-xr-xext/spl/tests/spl_autoload_002.phpt68
-rwxr-xr-xext/spl/tests/spl_autoload_003.phpt44
-rwxr-xr-xext/spl/tests/spl_autoload_004.phpt56
-rwxr-xr-xext/spl/tests/spl_autoload_005.phpt55
-rwxr-xr-xext/spl/tests/spl_autoload_006.phpt37
-rwxr-xr-xext/spl/tests/sxe_001.phpt7
-rwxr-xr-xext/spl/tests/sxe_002.phpt6
-rwxr-xr-xext/spl/tests/sxe_003.phpt6
-rwxr-xr-xext/spl/tests/sxe_004.phpt206
-rwxr-xr-xext/spl/tests/testclass5
-rwxr-xr-xext/spl/tests/testclass.class.inc9
-rwxr-xr-xext/spl/tests/testclass.inc5
-rwxr-xr-xext/spl/tests/testclass.php.inc5
-rw-r--r--ext/sqlite/Makefile.frag2
-rw-r--r--ext/sqlite/TODO4
-rw-r--r--ext/sqlite/config.m4142
-rw-r--r--ext/sqlite/config.w3219
-rw-r--r--ext/sqlite/libsqlite/VERSION2
-rw-r--r--ext/sqlite/libsqlite/src/attach.c2
-rw-r--r--ext/sqlite/libsqlite/src/auth.c10
-rw-r--r--ext/sqlite/libsqlite/src/btree.c2
-rw-r--r--ext/sqlite/libsqlite/src/btree.h2
-rw-r--r--ext/sqlite/libsqlite/src/btree_rb.c35
-rw-r--r--ext/sqlite/libsqlite/src/build.c6
-rw-r--r--ext/sqlite/libsqlite/src/copy.c2
-rw-r--r--ext/sqlite/libsqlite/src/date.c16
-rw-r--r--ext/sqlite/libsqlite/src/delete.c2
-rw-r--r--ext/sqlite/libsqlite/src/encode.c2
-rw-r--r--ext/sqlite/libsqlite/src/expr.c9
-rw-r--r--ext/sqlite/libsqlite/src/func.c38
-rw-r--r--ext/sqlite/libsqlite/src/hash.c2
-rw-r--r--ext/sqlite/libsqlite/src/hash.h2
-rw-r--r--ext/sqlite/libsqlite/src/insert.c2
-rw-r--r--ext/sqlite/libsqlite/src/main.c126
-rw-r--r--ext/sqlite/libsqlite/src/os.c6
-rw-r--r--ext/sqlite/libsqlite/src/pager.c2
-rw-r--r--ext/sqlite/libsqlite/src/pager.h2
-rw-r--r--ext/sqlite/libsqlite/src/parse.c2
-rw-r--r--ext/sqlite/libsqlite/src/parse.y2
-rw-r--r--ext/sqlite/libsqlite/src/pragma.c2
-rw-r--r--ext/sqlite/libsqlite/src/printf.c9
-rw-r--r--ext/sqlite/libsqlite/src/random.c2
-rw-r--r--ext/sqlite/libsqlite/src/select.c78
-rw-r--r--ext/sqlite/libsqlite/src/sqlite.h.in24
-rw-r--r--ext/sqlite/libsqlite/src/sqlite.w32.h4
-rw-r--r--ext/sqlite/libsqlite/src/sqliteInt.h10
-rw-r--r--ext/sqlite/libsqlite/src/tokenize.c2
-rw-r--r--ext/sqlite/libsqlite/src/update.c2
-rw-r--r--ext/sqlite/libsqlite/src/util.c6
-rw-r--r--ext/sqlite/libsqlite/src/vacuum.c46
-rw-r--r--ext/sqlite/libsqlite/src/vdbe.c11
-rw-r--r--ext/sqlite/libsqlite/src/vdbe.h2
-rw-r--r--ext/sqlite/libsqlite/src/where.c61
-rw-r--r--ext/sqlite/pdo_sqlite2.c629
-rw-r--r--ext/sqlite/php_sqlite.h5
-rw-r--r--ext/sqlite/sess_sqlite.c4
-rw-r--r--ext/sqlite/sqlite.c234
-rw-r--r--ext/sqlite/tests/bug35248.phpt15
-rw-r--r--ext/sqlite/tests/pdo/common.phpt12
-rwxr-xr-xext/sqlite/tests/sqlite_oo_030.phpt4
-rwxr-xr-xext/sqlite/tests/sqlite_spl_001.phpt (renamed from ext/sqlite/tests/sqlite_oo_031.phpt)4
-rwxr-xr-xext/sqlite/tests/sqlite_spl_002.phpt29
-rwxr-xr-xext/sqlite/tests/sqlite_spl_003.phpt28
-rw-r--r--ext/standard/Makefile.frag7
-rw-r--r--ext/standard/array.c356
-rw-r--r--ext/standard/assert.c6
-rw-r--r--ext/standard/base64.c13
-rw-r--r--ext/standard/base64.h4
-rw-r--r--ext/standard/basic_functions.c244
-rw-r--r--ext/standard/basic_functions.h11
-rw-r--r--ext/standard/browscap.c8
-rw-r--r--ext/standard/config.m431
-rw-r--r--ext/standard/config.w326
-rw-r--r--ext/standard/crc32.c4
-rw-r--r--ext/standard/crc32.h4
-rw-r--r--ext/standard/credits.c28
-rw-r--r--ext/standard/credits.h4
-rw-r--r--ext/standard/credits_ext.h21
-rw-r--r--ext/standard/credits_sapi.h2
-rw-r--r--ext/standard/crypt.c4
-rw-r--r--ext/standard/css.c4
-rw-r--r--ext/standard/css.h4
-rw-r--r--ext/standard/cyr_convert.c4
-rw-r--r--ext/standard/cyr_convert.h4
-rw-r--r--ext/standard/datetime.c886
-rw-r--r--ext/standard/datetime.h24
-rw-r--r--ext/standard/dir.c25
-rw-r--r--ext/standard/dl.c63
-rw-r--r--ext/standard/dl.h7
-rw-r--r--ext/standard/dns.c319
-rw-r--r--ext/standard/dns.h4
-rw-r--r--ext/standard/exec.c10
-rw-r--r--ext/standard/exec.h8
-rw-r--r--ext/standard/file.c314
-rw-r--r--ext/standard/file.h7
-rw-r--r--ext/standard/filestat.c48
-rw-r--r--ext/standard/filters.c312
-rw-r--r--ext/standard/flock_compat.c4
-rw-r--r--ext/standard/flock_compat.h4
-rw-r--r--ext/standard/formatted_print.c4
-rw-r--r--ext/standard/fsock.c4
-rw-r--r--ext/standard/fsock.h4
-rw-r--r--ext/standard/ftok.c6
-rw-r--r--ext/standard/ftp_fopen_wrapper.c161
-rw-r--r--ext/standard/head.c14
-rw-r--r--ext/standard/head.h4
-rw-r--r--ext/standard/html.c76
-rw-r--r--ext/standard/html.h5
-rw-r--r--ext/standard/http.c6
-rw-r--r--ext/standard/http_fopen_wrapper.c239
-rw-r--r--ext/standard/image.c8
-rw-r--r--ext/standard/incomplete_class.c12
-rw-r--r--ext/standard/info.c61
-rw-r--r--ext/standard/info.h4
-rw-r--r--ext/standard/iptc.c9
-rw-r--r--ext/standard/lcg.c4
-rw-r--r--ext/standard/levenshtein.c4
-rw-r--r--ext/standard/link.c4
-rw-r--r--ext/standard/mail.c6
-rw-r--r--ext/standard/math.c148
-rw-r--r--ext/standard/md5.c4
-rw-r--r--ext/standard/md5.h4
-rw-r--r--ext/standard/metaphone.c4
-rw-r--r--ext/standard/microtime.c103
-rw-r--r--ext/standard/microtime.h4
-rw-r--r--ext/standard/pack.c4
-rw-r--r--ext/standard/pack.h4
-rw-r--r--ext/standard/pageinfo.c4
-rw-r--r--ext/standard/pageinfo.h4
-rw-r--r--ext/standard/parsedate.c2404
-rw-r--r--ext/standard/parsedate.h29
-rw-r--r--ext/standard/parsedate.y1161
-rw-r--r--ext/standard/php_array.h22
-rw-r--r--ext/standard/php_assert.h4
-rw-r--r--ext/standard/php_browscap.h4
-rw-r--r--ext/standard/php_crypt.h4
-rw-r--r--ext/standard/php_dir.h4
-rw-r--r--ext/standard/php_ext_syslog.h4
-rw-r--r--ext/standard/php_filestat.h4
-rw-r--r--ext/standard/php_fopen_wrapper.c19
-rw-r--r--ext/standard/php_fopen_wrappers.h4
-rw-r--r--ext/standard/php_ftok.h4
-rw-r--r--ext/standard/php_http.h4
-rw-r--r--ext/standard/php_image.h4
-rw-r--r--ext/standard/php_incomplete_class.h10
-rw-r--r--ext/standard/php_iptc.h4
-rw-r--r--ext/standard/php_lcg.h4
-rw-r--r--ext/standard/php_link.h4
-rw-r--r--ext/standard/php_mail.h4
-rw-r--r--ext/standard/php_math.h6
-rw-r--r--ext/standard/php_metaphone.h4
-rw-r--r--ext/standard/php_parsedate.h26
-rw-r--r--ext/standard/php_rand.h4
-rw-r--r--ext/standard/php_smart_str.h4
-rw-r--r--ext/standard/php_smart_str_public.h4
-rw-r--r--ext/standard/php_standard.h4
-rw-r--r--ext/standard/php_string.h4
-rw-r--r--ext/standard/php_sunfuncs.h4
-rw-r--r--ext/standard/php_type.h4
-rw-r--r--ext/standard/php_uuencode.h4
-rw-r--r--ext/standard/php_var.h4
-rw-r--r--ext/standard/php_versioning.h4
-rw-r--r--ext/standard/proc_open.c6
-rw-r--r--ext/standard/proc_open.h4
-rw-r--r--ext/standard/quot_print.c4
-rw-r--r--ext/standard/quot_print.h4
-rw-r--r--ext/standard/rand.c4
-rw-r--r--ext/standard/reg.c12
-rw-r--r--ext/standard/reg.h4
-rw-r--r--ext/standard/scanf.c4
-rw-r--r--ext/standard/scanf.h4
-rw-r--r--ext/standard/sha1.c4
-rw-r--r--ext/standard/sha1.h4
-rw-r--r--ext/standard/soundex.c4
-rw-r--r--ext/standard/streamsfuncs.c171
-rw-r--r--ext/standard/streamsfuncs.h10
-rw-r--r--ext/standard/string.c197
-rw-r--r--ext/standard/sunfuncs.c8
-rw-r--r--ext/standard/syslog.c4
-rw-r--r--ext/standard/tests/array/007.phpt400
-rw-r--r--ext/standard/tests/array/array_diff_key.phpt250
-rw-r--r--ext/standard/tests/array/array_intersect_1.phpt560
-rw-r--r--ext/standard/tests/array/array_intersect_key.phpt209
-rw-r--r--ext/standard/tests/array/array_sum.phpt2
-rw-r--r--ext/standard/tests/array/bug25359.phpt32
-rwxr-xr-xext/standard/tests/array/bug29253.phpt27
-rwxr-xr-xext/standard/tests/array/bug29992.phpt44
-rwxr-xr-xext/standard/tests/array/bug30266.phpt37
-rw-r--r--ext/standard/tests/array/bug30833.phpt2
-rw-r--r--ext/standard/tests/array/bug33382.phpt27
-rwxr-xr-xext/standard/tests/array/bug33940.phpt125
-rwxr-xr-xext/standard/tests/array/bug34982.phpt40
-rw-r--r--ext/standard/tests/array/bug35014.phpt34
-rw-r--r--ext/standard/tests/array/bug35022.phpt21
-rw-r--r--ext/standard/tests/array/locale_sort.phpt56
-rw-r--r--ext/standard/tests/array/var_export.phpt6
-rw-r--r--ext/standard/tests/array/var_export3.phpt24
-rw-r--r--ext/standard/tests/file/bug24482.phpt2
-rw-r--r--ext/standard/tests/file/bug26615.phpt2
-rw-r--r--ext/standard/tests/file/bug27508.phpt69
-rw-r--r--ext/standard/tests/file/bug32160.phpt14
-rw-r--r--ext/standard/tests/file/bug32160.txt1
-rwxr-xr-xext/standard/tests/file/fputcsv.phpt107
-rw-r--r--ext/standard/tests/file/stream_get_line.phpt18
-rw-r--r--ext/standard/tests/filters/basic.phpt12
-rw-r--r--ext/standard/tests/general_functions/bug29038.phpt4
-rw-r--r--ext/standard/tests/general_functions/bug31190.phpt2
-rwxr-xr-xext/standard/tests/general_functions/bug35229.phpt30
-rw-r--r--ext/standard/tests/general_functions/sunfuncts.phpt48
-rw-r--r--ext/standard/tests/math/bug25665.phpt5
-rwxr-xr-xext/standard/tests/math/bug30069.phpt12
-rwxr-xr-xext/standard/tests/serialize/005.phpt186
-rw-r--r--ext/standard/tests/serialize/006.phpt29
-rwxr-xr-xext/standard/tests/serialize/bug30234.phpt2
-rw-r--r--ext/standard/tests/serialize/bug31402.phpt55
-rwxr-xr-xext/standard/tests/serialize/bug31442.phpt8
-rw-r--r--ext/standard/tests/strings/bug34214.phpt10
-rw-r--r--ext/standard/tests/strings/explode.phpt40
-rw-r--r--ext/standard/tests/strings/str_word_count.phpt228
-rw-r--r--ext/standard/tests/strings/substr_count.phpt5
-rw-r--r--ext/standard/tests/time/002-win32.phpt66
-rw-r--r--ext/standard/tests/time/bug26198.phpt10
-rw-r--r--ext/standard/tests/time/idate.phpt2
-rw-r--r--ext/standard/type.c38
-rw-r--r--ext/standard/uniqid.c13
-rw-r--r--ext/standard/uniqid.h4
-rw-r--r--ext/standard/url.c4
-rw-r--r--ext/standard/url.h4
-rw-r--r--ext/standard/url_scanner.c4
-rw-r--r--ext/standard/url_scanner.h4
-rw-r--r--ext/standard/url_scanner_ex.c57
-rw-r--r--ext/standard/url_scanner_ex.c.orig169
-rw-r--r--ext/standard/url_scanner_ex.h4
-rw-r--r--ext/standard/url_scanner_ex.re4
-rw-r--r--ext/standard/user_filters.c5
-rw-r--r--ext/standard/uuencode.c4
-rw-r--r--ext/standard/var.c73
-rw-r--r--ext/standard/var_unserializer.c366
-rw-r--r--ext/standard/var_unserializer.c.orig426
-rw-r--r--ext/standard/var_unserializer.re68
-rw-r--r--ext/standard/versioning.c4
-rw-r--r--ext/sybase/config.m47
-rw-r--r--ext/sybase/php_sybase_db.c11
-rw-r--r--ext/sybase/php_sybase_db.h4
-rw-r--r--ext/sybase_ct/config.m44
-rw-r--r--ext/sybase_ct/php_sybase_ct.c32
-rw-r--r--ext/sybase_ct/php_sybase_ct.h4
-rw-r--r--ext/sybase_ct/tests/bug22403.phpt4
-rw-r--r--ext/sybase_ct/tests/bug26407.phpt6
-rw-r--r--ext/sybase_ct/tests/bug27843.phpt8
-rw-r--r--ext/sybase_ct/tests/bug28354.phpt4
-rw-r--r--ext/sybase_ct/tests/bug30312.phpt27
-rw-r--r--ext/sybase_ct/tests/index.php216
-rw-r--r--ext/sybase_ct/tests/skipif.inc2
-rw-r--r--ext/sybase_ct/tests/test_appname.phpt8
-rw-r--r--ext/sysvmsg/php_sysvmsg.h4
-rw-r--r--ext/sysvmsg/sysvmsg.c6
-rw-r--r--ext/sysvmsg/tests/001.phpt2
-rw-r--r--ext/sysvsem/config.m44
-rw-r--r--ext/sysvsem/php_sysvsem.h4
-rw-r--r--ext/sysvsem/sysvsem.c4
-rw-r--r--ext/sysvshm/config.m44
-rw-r--r--ext/sysvshm/php_sysvshm.h4
-rw-r--r--ext/sysvshm/sysvshm.c6
-rw-r--r--ext/tidy/config.m410
-rw-r--r--ext/tidy/examples/cleanhtml5.php4
-rw-r--r--ext/tidy/examples/dumpit.php93
-rw-r--r--ext/tidy/examples/dumpit5.php4
-rw-r--r--ext/tidy/examples/urlgrab.php62
-rw-r--r--ext/tidy/examples/urlgrab5.php2
-rw-r--r--ext/tidy/php_tidy.def1
-rw-r--r--ext/tidy/php_tidy.h7
-rw-r--r--ext/tidy/tests/010.phpt96
-rw-r--r--ext/tidy/tests/012.phpt168
-rw-r--r--ext/tidy/tests/016.phpt2
-rw-r--r--ext/tidy/tests/018.phpt16
-rw-r--r--ext/tidy/tidy.c171
-rw-r--r--ext/tokenizer/php_tokenizer.h4
-rw-r--r--ext/tokenizer/tokenizer.c12
-rw-r--r--ext/w32api/CREDITS2
-rw-r--r--ext/w32api/README5
-rw-r--r--ext/w32api/TODO3
-rw-r--r--ext/w32api/package.xml47
-rw-r--r--ext/w32api/php_w32api.h345
-rw-r--r--ext/w32api/w32api.c2293
-rw-r--r--ext/w32api/w32api.dsp281
-rw-r--r--ext/w32api/w32api_function_definition_parser.y67
-rw-r--r--ext/w32api/w32api_function_definition_scanner.l63
-rw-r--r--ext/w32api/w32api_type_definition_parser.y67
-rw-r--r--ext/w32api/w32api_type_definition_scanner.l56
-rw-r--r--ext/wddx/config.m44
-rw-r--r--ext/wddx/config.w323
-rw-r--r--ext/wddx/php_wddx.h4
-rw-r--r--ext/wddx/php_wddx_api.h4
-rwxr-xr-xext/wddx/tests/bug34306.phpt12
-rw-r--r--ext/wddx/wddx.c40
-rw-r--r--ext/xml/compat.c78
-rw-r--r--ext/xml/config.m410
-rw-r--r--ext/xml/expat_compat.h11
-rw-r--r--ext/xml/php_xml.h4
-rw-r--r--ext/xml/tests/bug26614.phpt2
-rwxr-xr-xext/xml/tests/bug26614_libxml.phpt90
-rw-r--r--ext/xml/tests/bug27908.phpt19
-rw-r--r--ext/xml/tests/bug30266.phpt48
-rw-r--r--ext/xml/tests/bug32001.phpt10
-rw-r--r--ext/xml/xml.c25
-rw-r--r--ext/xmlreader/CREDITS2
-rw-r--r--ext/xmlreader/README5
-rw-r--r--ext/xmlreader/TODO8
-rw-r--r--ext/xmlreader/config.m426
-rw-r--r--ext/xmlreader/config.w3214
-rw-r--r--ext/xmlreader/examples/dtdexample.dtd8
-rw-r--r--ext/xmlreader/examples/dtdexample.xml15
-rw-r--r--ext/xmlreader/examples/relaxNG.rng11
-rw-r--r--ext/xmlreader/examples/relaxNG.xml1
-rw-r--r--ext/xmlreader/examples/relaxNG2.rng23
-rw-r--r--ext/xmlreader/examples/relaxNG3.rng8
-rw-r--r--ext/xmlreader/examples/xmlreader.xml10
-rw-r--r--ext/xmlreader/examples/xmlreader_file.php20
-rw-r--r--ext/xmlreader/examples/xmlreader_relaxNG.php25
-rw-r--r--ext/xmlreader/examples/xmlreader_string.php31
-rw-r--r--ext/xmlreader/examples/xmlreader_validatedtd.php18
-rw-r--r--ext/xmlreader/package.xml75
-rw-r--r--ext/xmlreader/php_xmlreader.c1176
-rw-r--r--ext/xmlreader/php_xmlreader.h74
-rw-r--r--ext/xmlreader/xmlreader.dsp114
-rw-r--r--ext/xmlrpc/config.m465
-rw-r--r--ext/xmlrpc/libxmlrpc/xml_element.c24
-rw-r--r--ext/xmlrpc/libxmlrpc/xmlrpc.c11
-rw-r--r--ext/xmlrpc/php_xmlrpc.h4
-rw-r--r--ext/xmlrpc/xmlrpc-epi-php.c65
-rw-r--r--ext/xsl/config.m47
-rw-r--r--ext/xsl/config.w322
-rw-r--r--ext/xsl/php_xsl.c33
-rw-r--r--ext/xsl/php_xsl.h6
-rw-r--r--ext/xsl/tests/xslt012.phpt52
-rw-r--r--ext/xsl/tests/xslt012.xsl29
-rw-r--r--ext/xsl/xsl_fe.h6
-rw-r--r--ext/xsl/xsltprocessor.c184
-rw-r--r--ext/yp/CREDITS2
-rw-r--r--ext/yp/config.m438
-rw-r--r--ext/yp/package.xml46
-rw-r--r--ext/yp/php_yp.h69
-rw-r--r--ext/yp/yp.c430
-rw-r--r--ext/zlib/config.w324
-rw-r--r--ext/zlib/config0.m410
-rw-r--r--ext/zlib/php_zlib.h5
-rw-r--r--ext/zlib/tests/bug_34821.phpt41
-rw-r--r--ext/zlib/tests/compress_zlib_wrapper.phpt19
-rw-r--r--ext/zlib/tests/zlib_filter_deflate.phpt17
-rw-r--r--ext/zlib/tests/zlib_filter_inflate.phpt17
-rw-r--r--ext/zlib/zlib.c23
-rw-r--r--ext/zlib/zlib.dsp238
-rw-r--r--ext/zlib/zlib_filter.c421
-rw-r--r--ext/zlib/zlib_fopen_wrapper.c4
1690 files changed, 241530 insertions, 44210 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index a3ce3e4ae..42bbe4465 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: bcmath.c,v 1.61 2004/07/14 00:14:43 pollita Exp $ */
+/* $Id: bcmath.c,v 1.62 2005/08/03 14:06:38 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4
index c03972f0b..ea794dffd 100644
--- a/ext/bcmath/config.m4
+++ b/ext/bcmath/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.16 2003/12/09 23:59:32 sniper Exp $
+dnl $Id: config.m4,v 1.17 2005/05/29 23:16:40 sniper Exp $
dnl
PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions,
-[ --enable-bcmath Enable bc style precision math functions.])
+[ --enable-bcmath Enable bc style precision math functions])
if test "$PHP_BCMATH" != "no"; then
PHP_NEW_EXTENSION(bcmath, bcmath.c \
diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h
index 36d962441..cab97b09d 100644
--- a/ext/bcmath/php_bcmath.h
+++ b/ext/bcmath/php_bcmath.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_bcmath.h,v 1.19 2004/07/14 00:14:43 pollita Exp $ */
+/* $Id: php_bcmath.h,v 1.20 2005/08/03 14:06:39 sniper Exp $ */
#ifndef PHP_BCMATH_H
#define PHP_BCMATH_H
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index 69023ab1d..2dd8dd858 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: bz2.c,v 1.6.2.5 2005/06/09 16:13:24 iliaa Exp $ */
+/* $Id: bz2.c,v 1.14.2.1 2005/10/25 15:53:06 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -240,13 +240,14 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int);
PHP_MINIT_FUNCTION(bz2)
{
php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC);
-
+ php_stream_filter_register_factory("bzip2.*", &php_bz2_filter_factory TSRMLS_CC);
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(bz2)
{
php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC);
+ php_stream_filter_unregister_factory("bzip2.*" TSRMLS_CC);
return SUCCESS;
}
@@ -255,6 +256,8 @@ PHP_MINFO_FUNCTION(bz2)
{
php_info_print_table_start();
php_info_print_table_row(2, "BZip2 Support", "Enabled");
+ php_info_print_table_row(2, "Stream Wrapper support", "compress.bz2://");
+ php_info_print_table_row(2, "Stream Filter support", "bzip2.decompress, bzip2.compress");
php_info_print_table_row(2, "BZip2 Version", (char *) BZ2_bzlibVersion());
php_info_print_table_end();
}
@@ -438,7 +441,11 @@ PHP_FUNCTION(bzdecompress)
char *source, *dest;
int source_len, error;
long small = 0;
+#if defined(PHP_WIN32)
+ unsigned __int64 size = 0;
+#else
unsigned long long size = 0;
+#endif
bz_stream bzs;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &small)) {
diff --git a/ext/bz2/bz2.dsp b/ext/bz2/bz2.dsp
index ebe183cca..a054c522a 100644
--- a/ext/bz2/bz2.dsp
+++ b/ext/bz2/bz2.dsp
@@ -95,6 +95,10 @@ LINK32=link.exe
SOURCE=.\bz2.c
# End Source File
+# Begin Source File
+
+SOURCE=.\bz2_filter.c
+# End Source File
# End Group
# Begin Group "Header Files"
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c
new file mode 100644
index 000000000..78e4ba3c4
--- /dev/null
+++ b/ext/bz2/bz2_filter.c
@@ -0,0 +1,384 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Sara Golemon (pollita@php.net) |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: bz2_filter.c,v 1.3 2005/08/03 14:06:39 sniper Exp $ */
+
+#include "php.h"
+#include "php_bz2.h"
+
+/* {{{ data structure */
+
+typedef struct _php_bz2_filter_data {
+ int persistent;
+ bz_stream strm;
+ char *inbuf;
+ size_t inbuf_len;
+ char *outbuf;
+ size_t outbuf_len;
+} php_bz2_filter_data;
+
+/* }}} */
+
+/* {{{ Memory management wrappers */
+
+static void *php_bz2_alloc(void *opaque, int items, int size)
+{
+ return (void *)safe_pemalloc(items, size, 0, ((php_bz2_filter_data*)opaque)->persistent);
+}
+
+static void php_bz2_free(void *opaque, void *address)
+{
+ pefree((void *)address, ((php_bz2_filter_data*)opaque)->persistent);
+}
+/* }}} */
+
+/* {{{ bzip2.decompress filter implementation */
+
+static php_stream_filter_status_t php_bz2_decompress_filter(
+ php_stream *stream,
+ php_stream_filter *thisfilter,
+ php_stream_bucket_brigade *buckets_in,
+ php_stream_bucket_brigade *buckets_out,
+ size_t *bytes_consumed,
+ int flags
+ TSRMLS_DC)
+{
+ php_bz2_filter_data *data;
+ php_stream_bucket *bucket;
+ size_t consumed = 0;
+ int status;
+ php_stream_filter_status_t exit_status = PSFS_FEED_ME;
+ bz_stream *streamp;
+
+ if (!thisfilter || !thisfilter->abstract) {
+ /* Should never happen */
+ return PSFS_ERR_FATAL;
+ }
+
+ data = (php_bz2_filter_data *)(thisfilter->abstract);
+ streamp = &(data->strm);
+
+ while (buckets_in->head) {
+ size_t bin = 0, desired;
+
+ bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ while (bin < bucket->buflen) {
+ desired = bucket->buflen - bin;
+ if (desired > data->inbuf_len) {
+ desired = data->inbuf_len;
+ }
+ memcpy(data->strm.next_in, bucket->buf + bin, desired);
+ data->strm.avail_in = desired;
+
+ status = BZ2_bzDecompress(&(data->strm));
+ if (status != BZ_OK && status != BZ_STREAM_END) {
+ /* Something bad happened */
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ return PSFS_ERR_FATAL;
+ }
+ desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
+ data->strm.next_in = data->inbuf;
+ data->strm.avail_in = 0;
+ consumed += desired;
+ bin += desired;
+
+ if (data->strm.avail_out < data->outbuf_len) {
+ php_stream_bucket *out_bucket;
+ size_t bucketlen = data->outbuf_len - data->strm.avail_out;
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ data->strm.avail_out = data->outbuf_len;
+ data->strm.next_out = data->outbuf;
+ exit_status = PSFS_PASS_ON;
+ }
+ }
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ }
+
+ if (flags & PSFS_FLAG_FLUSH_CLOSE) {
+ /* Spit it out! */
+ status = BZ_OK;
+ while (status == BZ_OK) {
+ status = BZ2_bzDecompress(&(data->strm));
+ if (data->strm.avail_out < data->outbuf_len) {
+ size_t bucketlen = data->outbuf_len - data->strm.avail_out;
+
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ data->strm.avail_out = data->outbuf_len;
+ data->strm.next_out = data->outbuf;
+ exit_status = PSFS_PASS_ON;
+ }
+ }
+ }
+
+ if (bytes_consumed) {
+ *bytes_consumed = consumed;
+ }
+
+ return exit_status;
+}
+
+static void php_bz2_decompress_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+{
+ if (thisfilter && thisfilter->abstract) {
+ php_bz2_filter_data *data = thisfilter->abstract;
+ BZ2_bzDecompressEnd(&(data->strm));
+ pefree(data->inbuf, data->persistent);
+ pefree(data->outbuf, data->persistent);
+ pefree(data, data->persistent);
+ }
+}
+
+static php_stream_filter_ops php_bz2_decompress_ops = {
+ php_bz2_decompress_filter,
+ php_bz2_decompress_dtor,
+ "bzip2.decompress"
+};
+/* }}} */
+
+/* {{{ bzip2.compress filter implementation */
+
+static php_stream_filter_status_t php_bz2_compress_filter(
+ php_stream *stream,
+ php_stream_filter *thisfilter,
+ php_stream_bucket_brigade *buckets_in,
+ php_stream_bucket_brigade *buckets_out,
+ size_t *bytes_consumed,
+ int flags
+ TSRMLS_DC)
+{
+ php_bz2_filter_data *data;
+ php_stream_bucket *bucket;
+ size_t consumed = 0;
+ int status;
+ php_stream_filter_status_t exit_status = PSFS_FEED_ME;
+ bz_stream *streamp;
+
+ if (!thisfilter || !thisfilter->abstract) {
+ /* Should never happen */
+ return PSFS_ERR_FATAL;
+ }
+
+ data = (php_bz2_filter_data *)(thisfilter->abstract);
+ streamp = &(data->strm);
+
+ while (buckets_in->head) {
+ size_t bin = 0, desired;
+
+ bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+
+ while (bin < bucket->buflen) {
+ desired = bucket->buflen - bin;
+ if (desired > data->inbuf_len) {
+ desired = data->inbuf_len;
+ }
+ memcpy(data->strm.next_in, bucket->buf + bin, desired);
+ data->strm.avail_in = desired;
+
+ status = BZ2_bzCompress(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? BZ_FINISH : (flags & PSFS_FLAG_FLUSH_INC ? BZ_FLUSH : BZ_RUN));
+ if (status != BZ_RUN_OK && status != BZ_FLUSH_OK && status != BZ_FINISH_OK) {
+ /* Something bad happened */
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ return PSFS_ERR_FATAL;
+ }
+ desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
+ data->strm.next_in = data->inbuf;
+ data->strm.avail_in = 0;
+ consumed += desired;
+ bin += desired;
+
+ if (data->strm.avail_out < data->outbuf_len) {
+ php_stream_bucket *out_bucket;
+ size_t bucketlen = data->outbuf_len - data->strm.avail_out;
+
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ data->strm.avail_out = data->outbuf_len;
+ data->strm.next_out = data->outbuf;
+ exit_status = PSFS_PASS_ON;
+ }
+ }
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ }
+
+ if (flags & PSFS_FLAG_FLUSH_CLOSE) {
+ /* Spit it out! */
+ status = BZ_OUTBUFF_FULL;
+ while (status == BZ_OUTBUFF_FULL) {
+ status = BZ2_bzCompress(&(data->strm), BZ_FINISH);
+ if (data->strm.avail_out < data->outbuf_len) {
+ size_t bucketlen = data->outbuf_len - data->strm.avail_out;
+
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ data->strm.avail_out = data->outbuf_len;
+ data->strm.next_out = data->outbuf;
+ exit_status = PSFS_PASS_ON;
+ }
+ }
+ }
+
+ if (bytes_consumed) {
+ *bytes_consumed = consumed;
+ }
+ return exit_status;
+}
+
+static void php_bz2_compress_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+{
+ if (thisfilter && thisfilter->abstract) {
+ php_bz2_filter_data *data = thisfilter->abstract;
+ BZ2_bzCompressEnd(&(data->strm));
+ pefree(data->inbuf, data->persistent);
+ pefree(data->outbuf, data->persistent);
+ pefree(data, data->persistent);
+ }
+}
+
+static php_stream_filter_ops php_bz2_compress_ops = {
+ php_bz2_compress_filter,
+ php_bz2_compress_dtor,
+ "bzip2.compress"
+};
+
+/* }}} */
+
+/* {{{ bzip2.* common factory */
+
+static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+{
+ php_stream_filter_ops *fops = NULL;
+ php_bz2_filter_data *data;
+ int status;
+
+ /* Create this filter */
+ data = pecalloc(1, sizeof(php_bz2_filter_data), persistent);
+ if (!data) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", sizeof(php_bz2_filter_data));
+ return NULL;
+ }
+
+ /* Circular reference */
+ data->strm.opaque = (void *) data;
+
+ data->strm.bzalloc = php_bz2_alloc;
+ data->strm.bzfree = php_bz2_free;
+ data->persistent = persistent;
+ data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048;
+ data->strm.next_in = data->inbuf = (char *) pemalloc(data->inbuf_len, persistent);
+ if (!data->inbuf) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", data->inbuf_len);
+ pefree(data, persistent);
+ return NULL;
+ }
+ data->strm.avail_in = 0;
+ data->strm.next_out = data->outbuf = (char *) pemalloc(data->outbuf_len, persistent);
+ if (!data->outbuf) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", data->outbuf_len);
+ pefree(data->inbuf, persistent);
+ pefree(data, persistent);
+ return NULL;
+ }
+
+ if (strcasecmp(filtername, "bzip2.decompress") == 0) {
+ int smallFootprint = 0;
+
+ if (filterparams) {
+ zval **tmpzval = NULL;
+
+ if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) {
+ zend_hash_find(HASH_OF(filterparams), "small", sizeof("small"), (void **) &tmpzval);
+ } else {
+ tmpzval = &filterparams;
+ }
+
+ if (tmpzval) {
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_boolean_ex(tmpzval);
+ smallFootprint = Z_LVAL_PP(tmpzval);
+ zval_ptr_dtor(tmpzval);
+ }
+ }
+
+ status = BZ2_bzDecompressInit(&(data->strm), 0, smallFootprint);
+ fops = &php_bz2_decompress_ops;
+ } else if (strcasecmp(filtername, "bzip2.compress") == 0) {
+ int blockSize100k = PHP_BZ2_FILTER_DEFAULT_BLOCKSIZE;
+ int workFactor = PHP_BZ2_FILTER_DEFAULT_WORKFACTOR;
+
+ if (filterparams) {
+ zval **tmpzval;
+
+ if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) {
+ if (zend_hash_find(HASH_OF(filterparams), "blocks", sizeof("blocks"), (void**) &tmpzval) == SUCCESS) {
+ /* How much memory to allocate (1 - 9) x 100kb */
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_long_ex(tmpzval);
+ if (Z_LVAL_PP(tmpzval) < 1 || Z_LVAL_PP(tmpzval) > 9) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%ld)", Z_LVAL_PP(tmpzval));
+ } else {
+ blockSize100k = Z_LVAL_PP(tmpzval);
+ }
+ zval_ptr_dtor(tmpzval);
+ }
+
+ if (zend_hash_find(HASH_OF(filterparams), "work", sizeof("work"), (void**) &tmpzval) == SUCCESS) {
+ /* Work Factor (0 - 250) */
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_long_ex(tmpzval);
+ if (Z_LVAL_PP(tmpzval) < 0 || Z_LVAL_PP(tmpzval) > 250) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", Z_LVAL_PP(tmpzval));
+ } else {
+ workFactor = Z_LVAL_PP(tmpzval);
+ }
+ zval_ptr_dtor(tmpzval);
+ }
+ }
+ }
+
+ status = BZ2_bzCompressInit(&(data->strm), blockSize100k, 0, workFactor);
+ fops = &php_bz2_compress_ops;
+ } else {
+ status = BZ_DATA_ERROR;
+ }
+
+ if (status != BZ_OK) {
+ /* Unspecified (probably strm) error, let stream-filter error do its own whining */
+ pefree(data->strm.next_in, persistent);
+ pefree(data->strm.next_out, persistent);
+ pefree(data, persistent);
+ return NULL;
+ }
+
+ return php_stream_filter_alloc(fops, data, persistent);
+}
+
+php_stream_filter_factory php_bz2_filter_factory = {
+ php_bz2_filter_create
+};
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: sw=4 ts=4 fdm=marker
+ * vim<600: sw=4 ts=4
+ */
diff --git a/ext/bz2/config.m4 b/ext/bz2/config.m4
index b6051dfcf..4c574e81d 100644
--- a/ext/bz2/config.m4
+++ b/ext/bz2/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.3 2004/01/21 05:04:30 sniper Exp $
+dnl $Id: config.m4,v 1.5 2004/11/03 14:32:48 jorton Exp $
dnl
PHP_ARG_WITH(bz2, for BZip2 support,
@@ -27,14 +27,14 @@ if test "$PHP_BZ2" != "no"; then
PHP_CHECK_LIBRARY(bz2, BZ2_bzerror,
[
PHP_ADD_INCLUDE($BZIP_DIR/include)
- PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/lib, BZ2_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/$PHP_LIBDIR, BZ2_SHARED_LIBADD)
AC_DEFINE(HAVE_BZ2,1,[ ])
], [
AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0)
], [
- -L$BZIP_DIR/lib
+ -L$BZIP_DIR/$PHP_LIBDIR
])
- PHP_NEW_EXTENSION(bz2, bz2.c, $ext_shared)
+ PHP_NEW_EXTENSION(bz2, bz2.c bz2_filter.c, $ext_shared)
PHP_SUBST(BZ2_SHARED_LIBADD)
fi
diff --git a/ext/bz2/config.w32 b/ext/bz2/config.w32
index 8fd8cbea0..2df794056 100644
--- a/ext/bz2/config.w32
+++ b/ext/bz2/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.3 2004/04/14 13:56:18 edink Exp $
+// $Id: config.w32,v 1.4 2004/07/20 05:26:33 pollita Exp $
// vim:ft=javascript
ARG_WITH("bz2", "BZip2", "no");
@@ -6,7 +6,7 @@ ARG_WITH("bz2", "BZip2", "no");
if (PHP_BZ2 != "no") {
if (CHECK_LIB("libbz2.lib", "bz2", PHP_BZ2) &&
CHECK_HEADER_ADD_INCLUDE("bzlib.h", "CFLAGS_BZ2")) {
- EXTENSION("bz2", "bz2.c");
+ EXTENSION("bz2", "bz2.c bz2_filter.c");
AC_DEFINE('HAVE_BZ2', 1, 'Have BZ2 library');
// BZ2 extension does this slightly differently from others
if (PHP_BZ2_SHARED) {
diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h
index a8b1df013..fc598923c 100644
--- a/ext/bz2/php_bz2.h
+++ b/ext/bz2/php_bz2.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_bz2.h,v 1.5 2004/01/12 16:30:55 martin Exp $ */
+/* $Id: php_bz2.h,v 1.7 2005/08/03 14:06:39 sniper Exp $ */
#ifndef PHP_BZ2_H
#define PHP_BZ2_H
@@ -62,9 +62,16 @@ PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode,
#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC)
#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC)
+php_stream_filter_factory php_bz2_filter_factory;
extern php_stream_ops php_stream_bz2io_ops;
#define PHP_STREAM_IS_BZIP2 &php_stream_bz2io_ops
+/* 400kb */
+#define PHP_BZ2_FILTER_DEFAULT_BLOCKSIZE 4
+
+/* BZ2 Internal Default */
+#define PHP_BZ2_FILTER_DEFAULT_WORKFACTOR 0
+
#endif
diff --git a/ext/bz2/tests/bz2_filter_compress.phpt b/ext/bz2/tests/bz2_filter_compress.phpt
new file mode 100644
index 000000000..b3d7b0acf
--- /dev/null
+++ b/ext/bz2/tests/bz2_filter_compress.phpt
@@ -0,0 +1,17 @@
+--TEST--
+bzip2.compress (with convert.base64-encode)
+--SKIPIF--
+<?php if (!extension_loaded("bz2")) print "skip"; ?>
+--FILE--
+<?php /* $Id: bz2_filter_compress.phpt,v 1.1 2004/07/20 05:26:33 pollita Exp $ */
+$text = 'I am the very model of a modern major general, I\'ve information vegetable, animal, and mineral.';
+
+$fp = fopen('php://stdout', 'w');
+stream_filter_append($fp, 'bzip2.compress', STREAM_FILTER_WRITE);
+stream_filter_append($fp, 'convert.base64-encode', STREAM_FILTER_WRITE);
+fwrite($fp, $text);
+fclose($fp);
+
+?>
+--EXPECT--
+QlpoNDFBWSZTWRN6QG0AAAoVgECFACA395UgIABIintI1N6mpowIQ0E1MTTAQGYTNcRyMZm5kgW3ib7hVboE7Tmqj3ToGZ5G3q1ZauD2G58hibSck8KS95EEAbx1Cn+LuSKcKEgJvSA2gA==
diff --git a/ext/bz2/tests/bz2_filter_decompress.phpt b/ext/bz2/tests/bz2_filter_decompress.phpt
new file mode 100644
index 000000000..f1f38aa8f
--- /dev/null
+++ b/ext/bz2/tests/bz2_filter_decompress.phpt
@@ -0,0 +1,17 @@
+--TEST--
+bzip2.decompress (with convert.base64-decode)
+--SKIPIF--
+<?php if (!extension_loaded("bz2")) print "skip"; ?>
+--FILE--
+<?php /* $Id: bz2_filter_decompress.phpt,v 1.1 2004/07/20 05:26:33 pollita Exp $ */
+$text = 'QlpoNDFBWSZTWRN6QG0AAAoVgECFACA395UgIABIintI1N6mpowIQ0E1MTTAQGYTNcRyMZm5kgW3ib7hVboE7Tmqj3ToGZ5G3q1ZauD2G58hibSck8KS95EEAbx1Cn+LuSKcKEgJvSA2gA==';
+
+$fp = fopen('php://stdout', 'w');
+stream_filter_append($fp, 'convert.base64-decode', STREAM_FILTER_WRITE);
+stream_filter_append($fp, 'bzip2.decompress', STREAM_FILTER_WRITE);
+fwrite($fp, $text);
+fclose($fp);
+
+?>
+--EXPECT--
+I am the very model of a modern major general, I've information vegetable, animal, and mineral.
diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c
index d48a2d24f..a455eb09a 100644
--- a/ext/calendar/cal_unix.c
+++ b/ext/calendar/cal_unix.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index 184626016..c1bb37153 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
| Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: calendar.c,v 1.40.2.4 2005/04/14 15:36:45 sniper Exp $ */
+/* $Id: calendar.c,v 1.46 2005/08/03 14:06:40 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c
index 419b0505d..225904489 100644
--- a/ext/calendar/easter.c
+++ b/ext/calendar/easter.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/calendar/tests/cal_days_in_month.phpt b/ext/calendar/tests/cal_days_in_month.phpt
new file mode 100644
index 000000000..9aaf3efdd
--- /dev/null
+++ b/ext/calendar/tests/cal_days_in_month.phpt
@@ -0,0 +1,20 @@
+--TEST--
+cal_days_in_month()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+$num = cal_days_in_month(CAL_GREGORIAN, 8, 2003);
+echo "There are $num days in August 2003\n";
+$num = cal_days_in_month(CAL_GREGORIAN, 2, 2003);
+echo "There are $num days in February 2003\n";
+$num = cal_days_in_month(CAL_GREGORIAN, 2, 2004);
+echo "There are $num days in February 2004\n";
+$num = cal_days_in_month(CAL_GREGORIAN, 12, 2034);
+echo "There are $num days in December 2034\n";
+?>
+--EXPECT--
+There are 31 days in August 2003
+There are 28 days in February 2003
+There are 29 days in February 2004
+There are 31 days in December 2034
diff --git a/ext/calendar/tests/cal_to_jd.phpt b/ext/calendar/tests/cal_to_jd.phpt
new file mode 100644
index 000000000..fde1e0b45
--- /dev/null
+++ b/ext/calendar/tests/cal_to_jd.phpt
@@ -0,0 +1,16 @@
+--TEST--
+cal_to_jd()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo cal_to_jd(CAL_GREGORIAN, 8, 26, 74), "\n";
+echo cal_to_jd(CAL_JULIAN, 8, 26, 74), "\n";
+echo cal_to_jd(CAL_JEWISH, 8, 26, 74), "\n";
+echo cal_to_jd(CAL_FRENCH, 8, 26, 74), "\n";
+?>
+--EXPECT--
+1748326
+1748324
+374867
+0
diff --git a/ext/calendar/tests/easter_days.phpt b/ext/calendar/tests/easter_days.phpt
new file mode 100644
index 000000000..04aa7ae11
--- /dev/null
+++ b/ext/calendar/tests/easter_days.phpt
@@ -0,0 +1,14 @@
+--TEST--
+easter_days()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo easter_days(1999), "\n";
+echo easter_days(1492), "\n";
+echo easter_days(1913), "\n";
+?>
+--EXPECT--
+14
+32
+2
diff --git a/ext/calendar/tests/frenchtojd.phpt b/ext/calendar/tests/frenchtojd.phpt
new file mode 100644
index 000000000..73addb6b8
--- /dev/null
+++ b/ext/calendar/tests/frenchtojd.phpt
@@ -0,0 +1,16 @@
+--TEST--
+frenchtojd()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo frenchtojd(-1,-1,-1), "\n";
+echo frenchtojd(0,0,0), "\n";
+echo frenchtojd(1,1,1), "\n";
+echo frenchtojd(14,31,15), "\n";
+?>
+--EXPECT--
+0
+0
+2375840
+0
diff --git a/ext/calendar/tests/skipif.inc b/ext/calendar/tests/skipif.inc
new file mode 100644
index 000000000..de8e4ae93
--- /dev/null
+++ b/ext/calendar/tests/skipif.inc
@@ -0,0 +1,4 @@
+<?php
+if(!extension_loaded("calendar"))
+ print "skip - CALENDAR extension not available";
+?>
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index dd0d56898..ef6b83c30 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_com.c,v 1.14.2.1 2005/04/19 05:57:21 wez Exp $ */
+/* $Id: com_com.c,v 1.16 2005/08/03 14:06:40 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c
index c44d18800..b2f004360 100644
--- a/ext/com_dotnet/com_dotnet.c
+++ b/ext/com_dotnet/com_dotnet.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_dotnet.c,v 1.7.2.2 2004/10/09 13:10:37 wez Exp $ */
+/* $Id: com_dotnet.c,v 1.14 2005/08/03 14:06:41 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -126,7 +126,6 @@ static HRESULT dotnet_init(char **p_where TSRMLS_DC)
HRESULT hr;
struct dotnet_runtime_stuff *stuff;
IUnknown *unk = NULL;
- OLECHAR *olename, *oletmp;
char *where = "";
stuff = malloc(sizeof(*stuff));
@@ -188,7 +187,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
char *assembly_name, *datatype_name;
int assembly_name_len, datatype_name_len;
struct dotnet_runtime_stuff *stuff;
- OLECHAR *olestring, *oleassembly, *oletype;
+ OLECHAR *oleassembly, *oletype;
HRESULT hr;
int ret = FAILURE;
char *where = "";
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index 5186fc286..4e50cfa3d 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_extension.c,v 1.14.2.2 2005/04/22 09:14:34 tony2001 Exp $ */
+/* $Id: com_extension.c,v 1.17 2005/08/03 14:06:41 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c
index f30a5345f..c7bb88852 100644
--- a/ext/com_dotnet/com_handlers.c
+++ b/ext/com_dotnet/com_handlers.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_handlers.c,v 1.22.2.5 2005/04/19 05:57:21 wez Exp $ */
+/* $Id: com_handlers.c,v 1.30.2.1 2005/11/27 12:19:04 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -259,12 +259,13 @@ static PHP_FUNCTION(com_method_handler)
INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
-static union _zend_function *com_method_get(zval *object, char *name, int len TSRMLS_DC)
+static union _zend_function *com_method_get(zval **object_ptr, char *name, int len TSRMLS_DC)
{
zend_internal_function f, *fptr = NULL;
php_com_dotnet_object *obj;
union _zend_function *func;
DISPID dummy;
+ zval *object = *object_ptr;
obj = CDNO_FETCH(object);
@@ -287,7 +288,7 @@ static union _zend_function *com_method_get(zval *object, char *name, int len TS
f.handler = PHP_FN(com_method_handler);
fptr = &f;
-
+
if (obj->typeinfo) {
/* look for byref params */
ITypeComp *comp;
@@ -492,7 +493,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f
VARTYPE vt = VT_EMPTY;
zval free_obj;
HRESULT res = S_OK;
-
+
if (should_free) {
free_obj = *writeobj;
}
@@ -523,9 +524,11 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f
case IS_STRING:
vt = VT_BSTR;
break;
+ default:
+ ;
}
- if (vt != VT_EMPTY) {
+ if (vt != VT_EMPTY && vt != V_VT(&v)) {
res = VariantChangeType(&v, &v, 0, vt);
}
@@ -534,6 +537,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f
}
VariantClear(&v);
+
if (should_free) {
zval_dtor(&free_obj);
}
@@ -673,6 +677,7 @@ zend_object_value php_com_object_new(zend_class_entry *ce TSRMLS_DC)
VariantInit(&obj->v);
obj->code_page = CP_ACP;
obj->ce = ce;
+ obj->zo.ce = ce;
retval.handle = zend_objects_store_put(obj, NULL, php_com_object_free_storage, php_com_object_clone TSRMLS_CC);
retval.handlers = &php_com_object_handlers;
diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c
index d39d2d7b5..7b1b744d9 100644
--- a/ext/com_dotnet/com_iterator.c
+++ b/ext/com_dotnet/com_iterator.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_iterator.c,v 1.7 2004/03/08 21:17:39 helly Exp $ */
+/* $Id: com_iterator.c,v 1.9 2005/08/03 14:06:41 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -232,7 +232,7 @@ fail:
if (I) {
VariantClear(&I->safe_array);
VariantClear(&I->v);
- free(I);
+ efree(I);
}
return NULL;
}
diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c
index d67d1c861..8a2ea2217 100644
--- a/ext/com_dotnet/com_misc.c
+++ b/ext/com_dotnet/com_misc.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_misc.c,v 1.7 2004/05/09 14:28:19 wez Exp $ */
+/* $Id: com_misc.c,v 1.8.2.1 2005/11/27 12:19:04 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -51,6 +51,7 @@ PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
memset(obj, 0, sizeof(*obj));
obj->code_page = codepage;
obj->ce = php_com_variant_class_entry;
+ obj->zo.ce = php_com_variant_class_entry;
VariantInit(&obj->v);
V_VT(&obj->v) = VT_DISPATCH;
@@ -73,6 +74,7 @@ PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
memset(obj, 0, sizeof(*obj));
obj->code_page = codepage;
obj->ce = php_com_variant_class_entry;
+ obj->zo.ce = php_com_variant_class_entry;
VariantInit(&obj->v);
VariantCopyInd(&obj->v, v);
diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c
index c2909d30a..be0976d90 100644
--- a/ext/com_dotnet/com_olechar.c
+++ b/ext/com_dotnet/com_olechar.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_olechar.c,v 1.4 2004/01/08 08:14:20 andi Exp $ */
+/* $Id: com_olechar.c,v 1.5 2005/08/03 14:06:42 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index e9d71a0e7..954b89cb5 100755
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_persist.c,v 1.2 2004/06/16 23:57:25 abies Exp $ */
+/* $Id: com_persist.c,v 1.5 2005/08/03 14:06:42 sniper Exp $ */
/* Infrastructure for working with persistent COM objects.
* Implements: IStream* wrapper for PHP streams.
@@ -38,7 +38,7 @@
typedef struct {
CONST_VTBL struct IStreamVtbl *lpVtbl;
- THREAD_T engine_thread;
+ DWORD engine_thread;
LONG refcount;
php_stream *stream;
int id;
@@ -53,17 +53,23 @@ static void istream_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
istream_destructor(stm);
}
+#ifdef ZTS
+# define TSRMLS_FIXED() TSRMLS_FETCH();
+#else
+# define TSRMLS_FIXED()
+#endif
+
#define FETCH_STM() \
+ TSRMLS_FIXED() \
php_istream *stm = (php_istream*)This; \
- if (tsrm_thread_id() != stm->engine_thread) \
- return E_UNEXPECTED;
+ if (GetCurrentThreadId() != stm->engine_thread) \
+ return RPC_E_WRONG_THREAD;
static HRESULT STDMETHODCALLTYPE stm_queryinterface(
IStream *This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject)
{
- TSRMLS_FETCH();
FETCH_STM();
if (IsEqualGUID(&IID_IUnknown, riid) ||
@@ -79,7 +85,6 @@ static HRESULT STDMETHODCALLTYPE stm_queryinterface(
static ULONG STDMETHODCALLTYPE stm_addref(IStream *This)
{
- TSRMLS_FETCH();
FETCH_STM();
return InterlockedIncrement(&stm->refcount);
@@ -88,7 +93,6 @@ static ULONG STDMETHODCALLTYPE stm_addref(IStream *This)
static ULONG STDMETHODCALLTYPE stm_release(IStream *This)
{
ULONG ret;
- TSRMLS_FETCH();
FETCH_STM();
ret = InterlockedDecrement(&stm->refcount);
@@ -103,7 +107,6 @@ static ULONG STDMETHODCALLTYPE stm_release(IStream *This)
static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULONG *pcbRead)
{
int nread;
- TSRMLS_FETCH();
FETCH_STM();
nread = php_stream_read(stm->stream, pv, cb);
@@ -120,7 +123,6 @@ static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULO
static HRESULT STDMETHODCALLTYPE stm_write(IStream *This, void const *pv, ULONG cb, ULONG *pcbWritten)
{
int nwrote;
- TSRMLS_FETCH();
FETCH_STM();
nwrote = php_stream_write(stm->stream, pv, cb);
@@ -140,7 +142,6 @@ static HRESULT STDMETHODCALLTYPE stm_seek(IStream *This, LARGE_INTEGER dlibMove,
off_t offset;
int whence;
int ret;
- TSRMLS_FETCH();
FETCH_STM();
switch (dwOrigin) {
@@ -169,7 +170,6 @@ static HRESULT STDMETHODCALLTYPE stm_seek(IStream *This, LARGE_INTEGER dlibMove,
static HRESULT STDMETHODCALLTYPE stm_set_size(IStream *This, ULARGE_INTEGER libNewSize)
{
- TSRMLS_FETCH();
FETCH_STM();
if (libNewSize.HighPart) {
@@ -190,7 +190,6 @@ static HRESULT STDMETHODCALLTYPE stm_set_size(IStream *This, ULARGE_INTEGER libN
static HRESULT STDMETHODCALLTYPE stm_copy_to(IStream *This, IStream *pstm, ULARGE_INTEGER cb,
ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
{
- TSRMLS_FETCH();
FETCH_STM();
return E_NOTIMPL;
@@ -198,7 +197,6 @@ static HRESULT STDMETHODCALLTYPE stm_copy_to(IStream *This, IStream *pstm, ULARG
static HRESULT STDMETHODCALLTYPE stm_commit(IStream *This, DWORD grfCommitFlags)
{
- TSRMLS_FETCH();
FETCH_STM();
php_stream_flush(stm->stream);
@@ -281,7 +279,7 @@ PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
return NULL;
memset(stm, 0, sizeof(*stm));
- stm->engine_thread = tsrm_thread_id();
+ stm->engine_thread = GetCurrentThreadId();
stm->lpVtbl = &php_istream_vtbl;
stm->refcount = 1;
stm->stream = stream;
@@ -719,7 +717,6 @@ static void helper_free_storage(void *obj TSRMLS_DC)
static void helper_clone(void *obj, void **clone_ptr TSRMLS_DC)
{
php_com_persist_helper *clone, *object = (php_com_persist_helper*)obj;
- zval *tmp;
clone = emalloc(sizeof(*object));
memcpy(clone, object, sizeof(*object));
@@ -746,7 +743,6 @@ static zend_object_value helper_new(zend_class_entry *ce TSRMLS_DC)
{
php_com_persist_helper *helper;
zend_object_value retval;
- zval *tmp;
helper = emalloc(sizeof(*helper));
memset(helper, 0, sizeof(*helper));
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index dfd9be017..64aee94b6 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_saproxy.c,v 1.13 2004/07/08 01:18:43 iliaa Exp $ */
+/* $Id: com_saproxy.c,v 1.15.2.1 2005/11/27 12:19:04 rrichards Exp $ */
/* This module implements a SafeArray proxy which is used internally
* by the engine when resolving multi-dimensional array accesses on
@@ -168,7 +168,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
VariantInit(&v);
/* we can return a real value */
- indices = emalloc(dims * sizeof(LONG));
+ indices = safe_emalloc(dims, sizeof(LONG), 0);
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
@@ -244,7 +244,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
VARTYPE vt;
dims = SafeArrayGetDim(V_ARRAY(&proxy->obj->v));
- indices = emalloc(dims * sizeof(LONG));
+ indices = safe_emalloc(dims, sizeof(LONG), 0);
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
convert_to_long(proxy->indices[i]);
@@ -323,7 +323,7 @@ static HashTable *saproxy_properties_get(zval *object TSRMLS_DC)
return NULL;
}
-static union _zend_function *saproxy_method_get(zval *object, char *name, int len TSRMLS_DC)
+static union _zend_function *saproxy_method_get(zval **object, char *name, int len TSRMLS_DC)
{
/* no methods */
return NULL;
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c
index 7dbb15ba3..6e074de29 100644
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_typeinfo.c,v 1.4.2.2 2005/04/19 05:57:21 wez Exp $ */
+/* $Id: com_typeinfo.c,v 1.7 2005/08/03 14:06:43 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 382b48c59..31289f793 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_variant.c,v 1.9.2.1 2004/07/28 23:48:26 wez Exp $ */
+/* $Id: com_variant.c,v 1.11 2005/08/03 14:06:43 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c
index 888cca150..9663d29d9 100644
--- a/ext/com_dotnet/com_wrapper.c
+++ b/ext/com_dotnet/com_wrapper.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: com_wrapper.c,v 1.4.2.1 2004/07/28 23:48:26 wez Exp $ */
+/* $Id: com_wrapper.c,v 1.9 2005/08/03 14:06:43 sniper Exp $ */
/* This module exports a PHP object as a COM object by wrapping it
* using IDispatchEx */
@@ -38,7 +38,7 @@ typedef struct {
/* now the PHP stuff */
- THREAD_T engine_thread; /* for sanity checking */
+ DWORD engine_thread; /* for sanity checking */
zval *object; /* the object exported */
LONG refcount; /* COM reference count */
@@ -74,7 +74,7 @@ static inline void trace(char *fmt, ...)
va_list ap;
char buf[4096];
- sprintf(buf, "T=%08x ", tsrm_thread_id());
+ sprintf(buf, "T=%08x ", GetCurrentThreadId());
OutputDebugString(buf);
va_start(ap, fmt);
@@ -86,11 +86,18 @@ static inline void trace(char *fmt, ...)
}
/* }}} */
+#ifdef ZTS
+# define TSRMLS_FIXED() TSRMLS_FETCH();
+#else
+# define TSRMLS_FIXED()
+#endif
+
#define FETCH_DISP(methname) \
+ TSRMLS_FIXED() \
php_dispatchex *disp = (php_dispatchex*)This; \
trace(" PHP:%s %s\n", Z_OBJCE_P(disp->object)->name, methname); \
- if (tsrm_thread_id() != disp->engine_thread) \
- return E_UNEXPECTED;
+ if (GetCurrentThreadId() != disp->engine_thread) \
+ return RPC_E_WRONG_THREAD;
static HRESULT STDMETHODCALLTYPE disp_queryinterface(
@@ -98,8 +105,6 @@ static HRESULT STDMETHODCALLTYPE disp_queryinterface(
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject)
{
- TSRMLS_FETCH();
-
FETCH_DISP("QueryInterface");
if (IsEqualGUID(&IID_IUnknown, riid) ||
@@ -117,8 +122,6 @@ static HRESULT STDMETHODCALLTYPE disp_queryinterface(
static ULONG STDMETHODCALLTYPE disp_addref(IDispatchEx *This)
{
- TSRMLS_FETCH();
-
FETCH_DISP("AddRef");
return InterlockedIncrement(&disp->refcount);
@@ -127,8 +130,6 @@ static ULONG STDMETHODCALLTYPE disp_addref(IDispatchEx *This)
static ULONG STDMETHODCALLTYPE disp_release(IDispatchEx *This)
{
ULONG ret;
- TSRMLS_FETCH();
-
FETCH_DISP("Release");
ret = InterlockedDecrement(&disp->refcount);
@@ -145,8 +146,6 @@ static HRESULT STDMETHODCALLTYPE disp_gettypeinfocount(
IDispatchEx *This,
/* [out] */ UINT *pctinfo)
{
- TSRMLS_FETCH();
-
FETCH_DISP("GetTypeInfoCount");
*pctinfo = 0;
@@ -159,8 +158,6 @@ static HRESULT STDMETHODCALLTYPE disp_gettypeinfo(
/* [in] */ LCID lcid,
/* [out] */ ITypeInfo **ppTInfo)
{
- TSRMLS_FETCH();
-
FETCH_DISP("GetTypeInfo");
*ppTInfo = NULL;
@@ -177,8 +174,6 @@ static HRESULT STDMETHODCALLTYPE disp_getidsofnames(
{
UINT i;
HRESULT ret = S_OK;
- TSRMLS_FETCH();
-
FETCH_DISP("GetIDsOfNames");
for (i = 0; i < cNames; i++) {
@@ -229,14 +224,15 @@ static HRESULT STDMETHODCALLTYPE disp_getdispid(
char *name;
unsigned int namelen;
zval **tmp;
- TSRMLS_FETCH();
-
FETCH_DISP("GetDispID");
name = php_com_olestring_to_string(bstrName, &namelen, COMG(code_page) TSRMLS_CC);
+ trace("Looking for %s, namelen=%d in %p\n", name, namelen, disp->name_to_dispid);
+
/* Lookup the name in the hash */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS) {
+ trace("found it\n");
*pid = Z_LVAL_PP(tmp);
ret = S_OK;
}
@@ -261,29 +257,30 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
zval *retval = NULL;
zval ***params = NULL;
HRESULT ret = DISP_E_MEMBERNOTFOUND;
- TSRMLS_FETCH();
-
FETCH_DISP("InvokeEx");
if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) {
/* TODO: add support for overloaded objects */
- trace("-- Invoke: %d %20s flags=%08x args=%d\n", id, Z_STRVAL_PP(name), wFlags, pdp->cArgs);
+ trace("-- Invoke: %d %20s [%d] flags=%08x args=%d\n", id, Z_STRVAL_PP(name), Z_STRLEN_PP(name), wFlags, pdp->cArgs);
/* convert args into zvals.
* Args are in reverse order */
- params = (zval ***)safe_emalloc(sizeof(zval **), pdp->cArgs, 0);
- for (i = 0; i < pdp->cArgs; i++) {
- VARIANT *arg;
- zval *zarg;
-
- arg = &pdp->rgvarg[ pdp->cArgs - 1 - i];
+ if (pdp->cArgs) {
+ params = (zval ***)safe_emalloc(sizeof(zval **), pdp->cArgs, 0);
+ for (i = 0; i < pdp->cArgs; i++) {
+ VARIANT *arg;
+ zval *zarg;
+
+ arg = &pdp->rgvarg[ pdp->cArgs - 1 - i];
- trace("alloc zval for arg %d VT=%08x\n", i, V_VT(arg));
+ trace("alloc zval for arg %d VT=%08x\n", i, V_VT(arg));
- ALLOC_INIT_ZVAL(zarg);
- php_com_wrap_variant(zarg, arg, COMG(code_page) TSRMLS_CC);
- params[i] = &zarg;
+ ALLOC_INIT_ZVAL(zarg);
+ php_com_wrap_variant(zarg, arg, COMG(code_page) TSRMLS_CC);
+ params[i] = (zval**)emalloc(sizeof(zval**));
+ *params[i] = zarg;
+ }
}
trace("arguments processed, prepare to do some work\n");
@@ -300,10 +297,13 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name,
&retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) {
ret = S_OK;
+ trace("function called ok\n");
} else {
+ trace("failed to call func\n");
ret = DISP_E_EXCEPTION;
}
} zend_catch {
+ trace("something blew up\n");
ret = DISP_E_EXCEPTION;
} zend_end_try();
} else {
@@ -311,9 +311,13 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
}
/* release arguments */
- for (i = 0; i < pdp->cArgs; i++)
- zval_ptr_dtor(params[i]);
- efree(params);
+ if (params) {
+ for (i = 0; i < pdp->cArgs; i++) {
+ zval_ptr_dtor(params[i]);
+ efree(params[i]);
+ }
+ efree(params);
+ }
/* return value */
if (retval) {
@@ -338,8 +342,6 @@ static HRESULT STDMETHODCALLTYPE disp_deletememberbyname(
/* [in] */ BSTR bstrName,
/* [in] */ DWORD grfdex)
{
- TSRMLS_FETCH();
-
FETCH_DISP("DeleteMemberByName");
/* TODO: unset */
@@ -351,8 +353,6 @@ static HRESULT STDMETHODCALLTYPE disp_deletememberbydispid(
IDispatchEx *This,
/* [in] */ DISPID id)
{
- TSRMLS_FETCH();
-
FETCH_DISP("DeleteMemberByDispID");
/* TODO: unset */
@@ -366,8 +366,6 @@ static HRESULT STDMETHODCALLTYPE disp_getmemberproperties(
/* [in] */ DWORD grfdexFetch,
/* [out] */ DWORD *pgrfdex)
{
- TSRMLS_FETCH();
-
FETCH_DISP("GetMemberProperties");
return DISP_E_UNKNOWNNAME;
@@ -379,8 +377,6 @@ static HRESULT STDMETHODCALLTYPE disp_getmembername(
/* [out] */ BSTR *pbstrName)
{
zval *name;
- TSRMLS_FETCH();
-
FETCH_DISP("GetMemberName");
if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) {
@@ -400,8 +396,6 @@ static HRESULT STDMETHODCALLTYPE disp_getnextdispid(
/* [out] */ DISPID *pid)
{
ulong next = id+1;
- TSRMLS_FETCH();
-
FETCH_DISP("GetNextDispID");
while(!zend_hash_index_exists(disp->dispid_to_name, next))
@@ -418,8 +412,6 @@ static HRESULT STDMETHODCALLTYPE disp_getnamespaceparent(
IDispatchEx *This,
/* [out] */ IUnknown **ppunk)
{
- TSRMLS_FETCH();
-
FETCH_DISP("GetNameSpaceParent");
*ppunk = NULL;
@@ -473,23 +465,23 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
if (keytype == HASH_KEY_IS_LONG) {
sprintf(namebuf, "%d", pid);
name = namebuf;
- namelen = strlen(namebuf);
+ namelen = strlen(namebuf)+1;
}
zend_hash_move_forward_ex(Z_OBJPROP_P(disp->object), &pos);
/* Find the existing id */
- if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS)
+ if (zend_hash_find(disp->name_to_dispid, name, namelen, (void**)&tmp) == SUCCESS)
continue;
/* add the mappings */
MAKE_STD_ZVAL(tmp);
- ZVAL_STRINGL(tmp, name, namelen, 1);
+ ZVAL_STRINGL(tmp, name, namelen-1, 1);
zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
- zend_hash_update(disp->name_to_dispid, name, namelen+1, (void*)&tmp, sizeof(zval *), NULL);
+ zend_hash_update(disp->name_to_dispid, name, namelen, (void*)&tmp, sizeof(zval *), NULL);
}
}
@@ -504,23 +496,23 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
if (keytype == HASH_KEY_IS_LONG) {
sprintf(namebuf, "%d", pid);
name = namebuf;
- namelen = strlen(namebuf);
+ namelen = strlen(namebuf) + 1;
}
zend_hash_move_forward_ex(Z_OBJPROP_P(disp->object), &pos);
/* Find the existing id */
- if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS)
+ if (zend_hash_find(disp->name_to_dispid, name, namelen, (void**)&tmp) == SUCCESS)
continue;
/* add the mappings */
MAKE_STD_ZVAL(tmp);
- ZVAL_STRINGL(tmp, name, namelen, 1);
+ ZVAL_STRINGL(tmp, name, namelen-1, 1);
zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
- zend_hash_update(disp->name_to_dispid, name, namelen+1, (void*)&tmp, sizeof(zval *), NULL);
+ zend_hash_update(disp->name_to_dispid, name, namelen, (void*)&tmp, sizeof(zval *), NULL);
}
}
}
@@ -536,7 +528,7 @@ static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
memset(disp, 0, sizeof(php_dispatchex));
- disp->engine_thread = tsrm_thread_id();
+ disp->engine_thread = GetCurrentThreadId();
disp->lpVtbl = &php_dispatch_vtbl;
disp->refcount = 1;
@@ -615,8 +607,9 @@ PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
{
php_dispatchex *disp = NULL;
- if (Z_TYPE_P(val) != IS_OBJECT)
+ if (Z_TYPE_P(val) != IS_OBJECT) {
return NULL;
+ }
if (php_com_is_valid_object(val TSRMLS_CC)) {
/* pass back its IDispatch directly */
diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h
index 70c0f8230..079fb2b75 100644
--- a/ext/com_dotnet/php_com_dotnet.h
+++ b/ext/com_dotnet/php_com_dotnet.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_com_dotnet.h,v 1.4 2004/01/08 17:31:51 sniper Exp $ */
+/* $Id: php_com_dotnet.h,v 1.5 2005/08/03 14:06:43 sniper Exp $ */
#ifndef PHP_COM_DOTNET_H
#define PHP_COM_DOTNET_H
diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h
index a9322410e..b3a599ecf 100644
--- a/ext/com_dotnet/php_com_dotnet_internal.h
+++ b/ext/com_dotnet/php_com_dotnet_internal.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_com_dotnet_internal.h,v 1.12.2.1 2005/04/19 05:57:21 wez Exp $ */
+/* $Id: php_com_dotnet_internal.h,v 1.14.2.1 2005/11/27 12:19:04 rrichards Exp $ */
#ifndef PHP_COM_DOTNET_INTERNAL_H
#define PHP_COM_DOTNET_INTERNAL_H
@@ -33,6 +33,8 @@
#undef php_win_err
typedef struct _php_com_dotnet_object {
+ zend_object zo;
+
VARIANT v;
ITypeInfo *typeinfo;
diff --git a/ext/cpdf/CREDITS b/ext/cpdf/CREDITS
deleted file mode 100644
index 94cc1de43..000000000
--- a/ext/cpdf/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-cpdf
-Uwe Steinmann
diff --git a/ext/cpdf/config.m4 b/ext/cpdf/config.m4
deleted file mode 100644
index 62b26a57d..000000000
--- a/ext/cpdf/config.m4
+++ /dev/null
@@ -1,84 +0,0 @@
-dnl $Id: config.m4,v 1.20.2.2 2004/12/30 07:04:10 sniper Exp $
-
-AC_DEFUN([CPDF_JPEG_TEST],[
- AC_ARG_WITH(jpeg-dir,
- [ --with-jpeg-dir[=DIR] CPDF: Set the path to libjpeg install prefix.],[
- for i in $withval /usr/local /usr; do
- if test -f "$i/lib/libjpeg.$SHLIB_SUFFIX_NAME" -o -f "$i/lib/libjpeg.a"; then
- CPDF_JPEG_DIR=$i
- break;
- fi
- done
- if test -z "$CPDF_JPEG_DIR"; then
- AC_MSG_ERROR([libjpeg.(a|so) not found.])
- fi
- PHP_CHECK_LIBRARY(jpeg, jpeg_read_header, [
- PHP_ADD_LIBRARY_WITH_PATH(jpeg, $CPDF_JPEG_DIR/lib, CPDF_SHARED_LIBADD)
- ] ,[
- AC_MSG_ERROR([CPDF: Problem with libjpeg.(a|so). Please check config.log for more information.])
- ], [
- -L$CPDF_JPEG_DIR/lib
- ])
- ],)
-])
-
-AC_DEFUN([CPDF_TIFF_TEST],[
- AC_ARG_WITH(tiff-dir,
- [ --with-tiff-dir[=DIR] CPDF: Set the path to libtiff install prefix.],[
- for i in $withval /usr/local /usr; do
- if test -f "$i/lib/libtiff.$SHLIB_SUFFIX_NAME" -o -f "$i/lib/libtiff.a"; then
- CPDF_TIFF_DIR=$i
- break;
- fi
- done
- if test -z "$CPDF_TIFF_DIR"; then
- AC_MSG_ERROR([libtiff.(a|so) not found.])
- fi
- PHP_CHECK_LIBRARY(tiff, TIFFOpen, [
- PHP_ADD_LIBRARY_WITH_PATH(tiff, $CPDF_TIFF_DIR/lib, CPDF_SHARED_LIBADD)
- ] ,[
- AC_MSG_ERROR([CPDF: Problem with libtiff.(a|so). Please check config.log for more information.])
- ], [
- -L$CPDF_TIFF_DIR/lib
- ])
- ],)
-])
-
-PHP_ARG_WITH(cpdflib, for cpdflib support,
-[ --with-cpdflib[=DIR] Include cpdflib support (requires cpdflib >= 2).])
-
-if test "$PHP_CPDFLIB" != "no"; then
- PHP_NEW_EXTENSION(cpdf, cpdf.c, $ext_shared,, \\$(GDLIB_CFLAGS))
- PHP_SUBST(CPDF_SHARED_LIBADD)
- CPDF_JPEG_TEST
- CPDF_TIFF_TEST
-
- for i in $PHP_CPDFLIB /usr/local /usr; do
- if test -f "$i/include/cpdflib.h"; then
- CPDFLIB_INCLUDE=$i/include
-
- PHP_CHECK_LIBRARY(cpdf, cpdf_open, [
- cpdf_libname=cpdf
- ], [
- PHP_CHECK_LIBRARY(cpdfm, cpdf_open, [
- cpdf_libname=cpdfm
- ], [
- AC_MSG_ERROR([Cpdflib module requires cpdflib >= 2.])
- ], [
- -L$i/lib $CPDF_SHARED_LIBADD
- ])
- ], [
- -L$i/lib $CPDF_SHARED_LIBADD
- ])
-
- PHP_ADD_LIBRARY_WITH_PATH($cpdf_libname, $i/lib, CPDF_SHARED_LIBADD)
- PHP_ADD_INCLUDE($CPDFLIB_INCLUDE)
- AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])
- break
- fi
- done
-
- if test -z "$CPDFLIB_INCLUDE"; then
- AC_MSG_ERROR([cpdflib.h not found])
- fi
-fi
diff --git a/ext/cpdf/config.w32 b/ext/cpdf/config.w32
deleted file mode 100644
index 6cda25033..000000000
--- a/ext/cpdf/config.w32
+++ /dev/null
@@ -1,14 +0,0 @@
-// $Id: config.w32,v 1.1 2003/12/04 03:46:10 wez Exp $
-// vim:ft=javascript
-
-ARG_WITH("cpdflib", "cpdflib >= 2", "no");
-
-if (PHP_CPDFLIB != "no") {
- if (CHECK_LIB("cpdf.lib", "cpdf", PHP_CPDFLIB) &&
- CHECK_HEADER_ADD_INCLUDE("cpdflib.h", "CFLAGS_CPDF")) {
- EXTENSION("cpdf", "cpdf.c", PHP_CPDFLIB_SHARED);
- AC_DEFINE('HAVE_CPDFLIB', 1, 'Have CPDF library');
- } else {
- WARNING("cpdf not enabled; libraries and headers not found");
- }
-}
diff --git a/ext/cpdf/cpdf.c b/ext/cpdf/cpdf.c
deleted file mode 100644
index b5843e821..000000000
--- a/ext/cpdf/cpdf.c
+++ /dev/null
@@ -1,2267 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Uwe Steinmann <Uwe.Steinmann@fernuni-hagen.de> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: cpdf.c,v 1.58.2.1 2004/11/09 00:44:29 iliaa Exp $ */
-/* cpdflib.h -- C language API definitions for ClibPDF library
- * Copyright (C) 1998 FastIO Systems, All Rights Reserved.
-*/
-
-/* Note that there is no code from the cpdflib package in this file */
-
-#if defined(THREAD_SAFE)
-#undef THREAD_SAFE
-#endif
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_globals.h"
-#include "zend_list.h"
-#include "ext/standard/php_standard.h"
-#include "ext/standard/head.h"
-#include <math.h>
-#if HAVE_GD_BUNDLED
-# include "../gd/libgd/gd.h"
-#else
-# if HAVE_LIBGD13
-# include <gd.h>
-# endif
-#endif
-
-#include <cpdflib.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#ifdef PHP_WIN32
-# include <io.h>
-# include <fcntl.h>
-#endif
-
-#if HAVE_CPDFLIB
-#include "php_cpdf.h"
-#include "ext/standard/info.h"
-
-#ifdef THREAD_SAFE
-DWORD CPDFlibTls;
-static int numthreads=0;
-
-typedef struct cpdflib_global_struct{
- int le_cpdf;
- int le_outline;
-#if HAVE_LIBGD13
- int le_gd;
-#endif
-} cpdflib_global_struct;
-
-# define CPDF_GLOBAL(v) TSRMG(CPDFlibTls, cpdflib_global_struct *, v)
-
-#else
-# define CPDF_GLOBAL(a) a
-static int le_cpdf;
-static int le_outline;
-#if HAVE_LIBGD13
-static int le_gd;
-#endif
-#endif
-
-#define CPDF_FETCH_CPDFDOC(pdf_zval) \
- convert_to_long_ex(pdf_zval); \
- id = Z_LVAL_PP(pdf_zval); \
- pdf = zend_list_find(id, &type); \
- if(!pdf || type != CPDF_GLOBAL(le_cpdf)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find identifier %d", id); \
- RETURN_FALSE; \
- } \
-
-function_entry cpdf_functions[] = {
- PHP_FE(cpdf_global_set_document_limits, NULL)
- PHP_FE(cpdf_set_creator, NULL)
- PHP_FE(cpdf_set_title, NULL)
- PHP_FE(cpdf_set_subject, NULL)
- PHP_FE(cpdf_set_keywords, NULL)
- PHP_FE(cpdf_open, NULL)
- PHP_FE(cpdf_close, NULL)
- PHP_FE(cpdf_set_viewer_preferences, NULL)
- PHP_FE(cpdf_page_init, NULL)
- PHP_FE(cpdf_finalize_page, NULL)
- PHP_FE(cpdf_set_current_page, NULL)
- PHP_FE(cpdf_begin_text, NULL)
- PHP_FE(cpdf_end_text, NULL)
- PHP_FE(cpdf_show, NULL)
- PHP_FE(cpdf_show_xy, NULL)
- PHP_FE(cpdf_text, NULL)
- PHP_FE(cpdf_continue_text, NULL)
- PHP_FE(cpdf_set_font, NULL)
- PHP_FE(cpdf_set_font_directories, NULL)
- PHP_FE(cpdf_set_font_map_file, NULL)
- PHP_FE(cpdf_set_leading, NULL)
- PHP_FE(cpdf_set_text_rendering, NULL)
- PHP_FE(cpdf_set_horiz_scaling, NULL)
- PHP_FE(cpdf_set_text_rise, NULL)
- PHP_FE(cpdf_set_text_matrix, NULL)
- PHP_FE(cpdf_set_text_pos, NULL)
- PHP_FE(cpdf_rotate_text, NULL)
- PHP_FE(cpdf_set_char_spacing, NULL)
- PHP_FE(cpdf_set_word_spacing, NULL)
- PHP_FE(cpdf_stringwidth, NULL)
- PHP_FE(cpdf_save, NULL)
- PHP_FE(cpdf_restore, NULL)
- PHP_FE(cpdf_translate, NULL)
- PHP_FE(cpdf_scale, NULL)
- PHP_FE(cpdf_rotate, NULL)
- PHP_FE(cpdf_setflat, NULL)
- PHP_FE(cpdf_setlinejoin, NULL)
- PHP_FE(cpdf_setlinecap, NULL)
- PHP_FE(cpdf_setmiterlimit, NULL)
- PHP_FE(cpdf_setlinewidth, NULL)
- PHP_FE(cpdf_setdash, NULL)
- PHP_FE(cpdf_moveto, NULL)
- PHP_FE(cpdf_rmoveto, NULL)
- PHP_FE(cpdf_lineto, NULL)
- PHP_FE(cpdf_rlineto, NULL)
- PHP_FE(cpdf_curveto, NULL)
- PHP_FE(cpdf_circle, NULL)
- PHP_FE(cpdf_arc, NULL)
- PHP_FE(cpdf_rect, NULL)
- PHP_FE(cpdf_newpath, NULL)
- PHP_FE(cpdf_closepath, NULL)
- PHP_FE(cpdf_stroke, NULL)
- PHP_FE(cpdf_closepath_stroke, NULL)
- PHP_FE(cpdf_fill, NULL)
- PHP_FE(cpdf_fill_stroke, NULL)
- PHP_FE(cpdf_closepath_fill_stroke, NULL)
- PHP_FE(cpdf_clip, NULL)
- PHP_FE(cpdf_setgray_fill, NULL)
- PHP_FE(cpdf_setgray_stroke, NULL)
- PHP_FE(cpdf_setgray, NULL)
- PHP_FE(cpdf_setrgbcolor_fill, NULL)
- PHP_FE(cpdf_setrgbcolor_stroke, NULL)
- PHP_FE(cpdf_setrgbcolor, NULL)
- PHP_FE(cpdf_set_page_animation, NULL)
- PHP_FE(cpdf_finalize, NULL)
- PHP_FE(cpdf_output_buffer, NULL)
- PHP_FE(cpdf_save_to_file, NULL)
- PHP_FE(cpdf_import_jpeg, NULL)
-#if HAVE_LIBGD13
- PHP_FE(cpdf_place_inline_image, NULL)
-#endif
- PHP_FE(cpdf_add_annotation, NULL)
- PHP_FE(cpdf_add_outline, NULL)
- PHP_FE(cpdf_set_action_url, NULL)
- {NULL, NULL, NULL}
-};
-
-zend_module_entry cpdf_module_entry = {
- STANDARD_MODULE_HEADER,
- "cpdf",
- cpdf_functions,
- PHP_MINIT(cpdf),
- PHP_MSHUTDOWN(cpdf),
- PHP_RINIT(cpdf),
- NULL,
- PHP_MINFO(cpdf),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_CPDF
-ZEND_GET_MODULE(cpdf)
-#endif
-
-static void _free_outline(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
-}
-
-static void _free_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- CPDFdoc *pdf = (CPDFdoc *)rsrc->ptr;
-
- cpdf_close(pdf);
-}
-
-PHP_MINIT_FUNCTION(cpdf)
-{
- CPDF_GLOBAL(le_outline) = zend_register_list_destructors_ex(_free_outline, NULL, "cpdf outline", module_number);
- CPDF_GLOBAL(le_cpdf) = zend_register_list_destructors_ex(_free_doc, NULL, "cpdf", module_number);
-
- REGISTER_LONG_CONSTANT("CPDF_PM_NONE", PM_NONE, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("CPDF_PM_OUTLINES", PM_OUTLINES, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("CPDF_PM_THUMBS", PM_THUMBS, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("CPDF_PM_FULLSCREEN", PM_FULLSCREEN, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("CPDF_PL_SINGLE", PL_SINGLE, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("CPDF_PL_1COLUMN", PL_1COLUMN, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("CPDF_PL_2LCOLUMN", PL_2LCOLUMN, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("CPDF_PL_2RCOLUMN", PL_2RCOLUMN, CONST_CS | CONST_PERSISTENT);
-
-
- return SUCCESS;
-}
-
-PHP_RINIT_FUNCTION(cpdf)
-{
-/* CPDF_GLOBAL(le_outline) = NULL; */
- return SUCCESS;
-}
-
-PHP_MINFO_FUNCTION(cpdf) {
- /* need to use a PHPAPI function here because it is external module in windows */
- /* (don't knwo if that still applies (cmv) */
- php_info_print_table_start();
- php_info_print_table_row(2, "CPDF Support", "enabled");
- php_info_print_table_row(2, "Version", cpdf_version() );
- php_info_print_table_end();
-}
-
-PHP_MSHUTDOWN_FUNCTION(cpdf)
-{
- return SUCCESS;
-}
-
-/* {{{ proto bool cpdf_global_set_document_limits(int maxPages, int maxFonts, int maxImages, int maxAnnots, int maxObjects)
- Sets document settings for all documents */
-PHP_FUNCTION(cpdf_global_set_document_limits)
-{
- zval **argv[5];
-
- if (ZEND_NUM_ARGS() != 5 || (zend_get_parameters_array_ex(5, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long_ex(argv[0]);
- convert_to_long_ex(argv[1]);
- convert_to_long_ex(argv[2]);
- convert_to_long_ex(argv[3]);
- convert_to_long_ex(argv[4]);
-
- cpdf_setGlobalDocumentLimits(Z_LVAL_PP(argv[0]), Z_LVAL_PP(argv[1]), Z_LVAL_PP(argv[2]), Z_LVAL_PP(argv[3]), Z_LVAL_PP(argv[4]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_creator(int pdfdoc, string creator)
- Sets the creator field */
-PHP_FUNCTION(cpdf_set_creator)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
-
- cpdf_setCreator(pdf, Z_STRVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_title(int pdfptr, string title)
- Fills the title field of the info structure */
-PHP_FUNCTION(cpdf_set_title)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
-
- cpdf_setTitle(pdf, Z_STRVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_subject(int pdfptr, string subject)
- Fills the subject field of the info structure */
-PHP_FUNCTION(cpdf_set_subject)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
-
- cpdf_setSubject(pdf, Z_STRVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_keywords(int pdfptr, string keywords)
- Fills the keywords field of the info structure */
-PHP_FUNCTION(cpdf_set_keywords)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
-
- cpdf_setKeywords(pdf, Z_STRVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_viewer_preferences(int pdfdoc, array preferences)
- How to show the document in the viewer */
-PHP_FUNCTION(cpdf_set_viewer_preferences)
-{
- zval **arg1, **arg2;
- zval **zvalue;
- int id, type;
- CPDFdoc *pdf;
- CPDFviewerPrefs vP = { 0, 0, 0, 0, 0, 0, 0, 0 };
-
- if(ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_array_ex(arg2);
-
- if (zend_hash_find (Z_ARRVAL_PP(arg2), "pagemode", sizeof ("pagemode"), (void **) &zvalue) == SUCCESS) {
- convert_to_long_ex(zvalue);
- vP.pageMode = Z_LVAL_PP(zvalue);
- }
- if (zend_hash_find (Z_ARRVAL_PP(arg2), "hidetoolbar", sizeof ("hidetoolbar"), (void **) &zvalue) == SUCCESS) {
- convert_to_long_ex(zvalue);
- vP.hideToolbar = Z_LVAL_PP(zvalue);
- }
- if (zend_hash_find (Z_ARRVAL_PP(arg2), "hidemenubar", sizeof ("hidemenubar"), (void **) &zvalue) == SUCCESS) {
- convert_to_long_ex(zvalue);
- vP.hideMenubar = Z_LVAL_PP(zvalue);
- }
- if (zend_hash_find (Z_ARRVAL_PP(arg2), "hidewindowui", sizeof ("hidewindowui"), (void **) &zvalue) == SUCCESS) {
- convert_to_long_ex(zvalue);
- vP.hideWindowUI = Z_LVAL_PP(zvalue);
- }
- if (zend_hash_find (Z_ARRVAL_PP(arg2), "fitwindow", sizeof ("fitwindow"), (void **) &zvalue) == SUCCESS) {
- convert_to_long_ex(zvalue);
- vP.fitWindow = Z_LVAL_PP(zvalue);
- }
- if (zend_hash_find (Z_ARRVAL_PP(arg2), "centerwindow", sizeof ("centerwindow"), (void **) &zvalue) == SUCCESS) {
- convert_to_long_ex(zvalue);
- vP.centerWindow = Z_LVAL_PP(zvalue);
- }
- if (zend_hash_find (Z_ARRVAL_PP(arg2), "pagelayout", sizeof ("pagelayout"), (void **) &zvalue) == SUCCESS) {
- convert_to_long_ex(zvalue);
- vP.pageLayout = Z_LVAL_PP(zvalue);
- }
- if (zend_hash_find (Z_ARRVAL_PP(arg2), "nonfspagemode", sizeof ("nonfspagemode"), (void **) &zvalue) == SUCCESS) {
- convert_to_long_ex(zvalue);
- vP.nonFSPageMode = Z_LVAL_PP(zvalue);
- }
-
- cpdf_setViewerPreferences(pdf, &vP);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int cpdf_open(int compression [, string filename [, array doc_limits]])
- Opens a new pdf document */
-PHP_FUNCTION(cpdf_open)
-{
- zval **arg1, **arg2 = NULL, **arg3 = NULL;
- int id;
- CPDFdoc *cpdf;
-
- if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 3 || (zend_get_parameters_ex(ZEND_NUM_ARGS(), &arg1, &arg2, &arg3) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long_ex(arg1);
-
- cpdf = cpdf_open(0, NULL);
- if(!cpdf)
- RETURN_FALSE;
- if(Z_LVAL_PP(arg1) == 1)
- cpdf_enableCompression(cpdf, YES);
- else
- cpdf_enableCompression(cpdf, NO);
-
- if(arg2) {
- convert_to_string_ex(arg2);
-#if APACHE
- if(strcmp(Z_STRVAL_PP(arg2), "-") == 0)
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Writing to stdout as described in the ClibPDF manual is not possible if php is used as an Apache module. Write to a memory stream and use cpdf_output_buffer() instead.");
-#endif
-
- if (php_check_open_basedir(Z_STRVAL_PP(arg2) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(arg2), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
- cpdf_close(cpdf);
- RETURN_FALSE;
- }
-
- cpdf_setOutputFilename(cpdf, Z_STRVAL_PP(arg2));
- }
- cpdf_init(cpdf);
-
- id = zend_list_insert(cpdf, CPDF_GLOBAL(le_cpdf));
- RETURN_LONG(id);
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_close(int pdfdoc)
- Closes the pdf document */
-PHP_FUNCTION(cpdf_close)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- zend_list_delete(id);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-#define BUFFERLEN 40
-/* {{{ proto bool cpdf_page_init(int pdfdoc, int pagenr, int orientation, int height, int width [, float unit])
- Starts page */
-PHP_FUNCTION(cpdf_page_init)
-{
- zval **argv[6];
- int id, type, pagenr, orientation;
- int height, width;
- char buffer[BUFFERLEN];
- CPDFdoc *pdf;
- int argc = ZEND_NUM_ARGS();
-
- if(argc < 5 || argc > 6 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_long_ex(argv[1]);
- convert_to_long_ex(argv[2]);
- convert_to_long_ex(argv[3]);
- convert_to_long_ex(argv[4]);
- pagenr=Z_LVAL_PP(argv[1]);
- orientation=Z_LVAL_PP(argv[2]);
- height = Z_LVAL_PP(argv[3]);
- width = Z_LVAL_PP(argv[4]);
-
- if(argc > 5) {
- convert_to_double_ex(argv[5]);
- if(Z_DVAL_PP(argv[5]) > 0.0)
- cpdf_setDefaultDomainUnit(pdf, Z_DVAL_PP(argv[5]));
- }
- snprintf(buffer, BUFFERLEN, "0 0 %d %d", width, height);
- cpdf_pageInit(pdf, pagenr, orientation, buffer, buffer);
-
- RETURN_TRUE;
-}
-/* }}} */
-#undef BUFFERLEN
-
-/* {{{ proto bool cpdf_finalize_page(int pdfdoc, int pagenr)
- Ends the page to save memory */
-PHP_FUNCTION(cpdf_finalize_page)
-{
- zval **arg1, **arg2;
- int id, type, pagenr;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_long_ex(arg2);
- pagenr=Z_LVAL_PP(arg2);
-
- cpdf_finalizePage(pdf, pagenr);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_current_page(int pdfdoc, int pagenr)
- Sets page for output */
-PHP_FUNCTION(cpdf_set_current_page)
-{
- zval **arg1, **arg2;
- int id, type, pagenr;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_long_ex(arg2);
- pagenr=Z_LVAL_PP(arg2);
-
- cpdf_setCurrentPage(pdf, pagenr);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_begin_text(int pdfdoc)
- Starts text section */
-PHP_FUNCTION(cpdf_begin_text)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_beginText(pdf, 0);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_end_text(int pdfdoc)
- Ends text section */
-PHP_FUNCTION(cpdf_end_text)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_endText(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_show(int pdfdoc, string text)
- Output text at current position */
-PHP_FUNCTION(cpdf_show)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
-
- cpdf_textShow(pdf, Z_STRVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_show_xy(int pdfdoc, string text, float x-koor, float y-koor [, int mode])
- Output text at position */
-PHP_FUNCTION(cpdf_show_xy)
-{
- zval **argv[5];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- argc = ZEND_NUM_ARGS();
- if(argc < 4 || argc > 5 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_string_ex(argv[1]);
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
-
- if(argc == 5) {
- convert_to_long_ex(argv[4]);
- mode = Z_LVAL_PP(argv[4]);
- }
- if(mode == 1)
- cpdf_rawText(pdf, (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), 0.0, Z_STRVAL_PP(argv[1]));
- else
- cpdf_text(pdf, (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), 0.0, Z_STRVAL_PP(argv[1]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_continue_text(int pdfdoc, string text)
- Outputs text in next line */
-PHP_FUNCTION(cpdf_continue_text)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
-
- cpdf_textCRLFshow(pdf, Z_STRVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_text(int pdfdoc, string text [, float x-koor, float y-koor [, int mode [, float orientation [, int alignmode]]]])
- Outputs text */
-PHP_FUNCTION(cpdf_text)
-{
- zval **argv[7];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 2 || argc == 3 || argc > 7 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_string_ex(argv[1]);
-
- if(argc > 4) {
- convert_to_long_ex(argv[4]);
- mode = Z_LVAL_PP(argv[2]);
- }
- switch(argc) {
- case 2:
- cpdf_textShow(pdf, Z_STRVAL_PP(argv[1]));
- break;
- case 4:
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- cpdf_text(pdf, (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), 0.0, Z_STRVAL_PP(argv[1]));
- break;
- case 5:
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- if(mode == 1)
- cpdf_rawText(pdf, (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), 0.0, Z_STRVAL_PP(argv[1]));
- else
- cpdf_text(pdf, (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), 0.0, Z_STRVAL_PP(argv[1]));
- break;
- case 6:
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- convert_to_double_ex(argv[5]);
- if(mode == 1)
- cpdf_rawText(pdf, (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), (float) Z_DVAL_PP(argv[5]), Z_STRVAL_PP(argv[1]));
- else
- cpdf_text(pdf, (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), (float) Z_DVAL_PP(argv[5]), Z_STRVAL_PP(argv[1]));
- break;
- case 7:
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- convert_to_double_ex(argv[5]);
- convert_to_long_ex(argv[6]);
- if(mode == 1)
- cpdf_rawTextAligned(pdf, (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), (float) Z_DVAL_PP(argv[5]), Z_LVAL_PP(argv[6]), Z_STRVAL_PP(argv[1]));
- else
- cpdf_textAligned(pdf, (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), (float) Z_DVAL_PP(argv[5]), Z_LVAL_PP(argv[6]), Z_STRVAL_PP(argv[1]));
- break;
- }
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_font(int pdfdoc, string font, float size, string encoding)
- Selects the current font face, size and encoding */
-PHP_FUNCTION(cpdf_set_font)
-{
- zval **arg1, **arg2, **arg3, **arg4;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
- convert_to_double_ex(arg3);
- convert_to_string_ex(arg4);
-
-/* if(Z_LVAL_PP(arg4) > 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Font encoding set to 5");
- Z_LVAL_PP(arg4) = 5;
- }
-*/
- cpdf_setFont(pdf, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg4), (float) Z_DVAL_PP(arg3));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_font_directories(int pdfdoc, string pfmdir, string pfbdir)
- Sets directories to search when using external fonts */
-PHP_FUNCTION(cpdf_set_font_directories)
-{
- zval **arg1, **arg2, **arg3;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
-
- cpdf_setFontDirectories(pdf, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_font_map_file(int pdfdoc, string filename)
- Sets fontname to filename translation map when using external fonts */
-PHP_FUNCTION(cpdf_set_font_map_file)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
-
- if (php_check_open_basedir(Z_STRVAL_PP(arg2) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(arg2), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
- RETURN_FALSE;
- }
-
- cpdf_setFontMapFile(pdf, Z_STRVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_leading(int pdfdoc, float distance)
- Sets distance between text lines */
-PHP_FUNCTION(cpdf_set_leading)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_setTextLeading(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_text_rendering(int pdfdoc, int rendermode)
- Determines how text is rendered */
-PHP_FUNCTION(cpdf_set_text_rendering)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_long_ex(arg2);
-
- cpdf_setTextRenderingMode(pdf, Z_LVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_horiz_scaling(int pdfdoc, float scale)
- Sets horizontal scaling of text */
-PHP_FUNCTION(cpdf_set_horiz_scaling)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_setHorizontalScaling(pdf, (float) Z_DVAL_PP(arg2) * 100.0);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_text_rise(int pdfdoc, float value)
- Sets the text rise */
-PHP_FUNCTION(cpdf_set_text_rise)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_setTextRise(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_text_matrix(int pdfdoc, arry matrix)
- Sets the text matrix */
-PHP_FUNCTION(cpdf_set_text_matrix)
-{
- zval **arg1, **arg2, *data;
- int id, type, i;
- HashTable *matrix;
- CPDFdoc *pdf;
- float *pdfmatrixptr;
- float pdfmatrix[6];
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_array_ex(arg2);
- matrix = Z_ARRVAL_PP(arg2);
-
- if(zend_hash_num_elements(matrix) != 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Text matrix must have 6 elements");
- RETURN_FALSE;
- }
-
- pdfmatrixptr = pdfmatrix;
- zend_hash_internal_pointer_reset(matrix);
- for(i=0; i<zend_hash_num_elements(matrix); i++) {
- zend_hash_get_current_data(matrix, (void *) &data);
- switch(Z_TYPE_P(data)) {
- case IS_DOUBLE:
- *pdfmatrixptr++ = (float) Z_DVAL_P(data);
- break;
- default:
- *pdfmatrixptr++ = 0.0;
- break;
- }
- zend_hash_move_forward(matrix);
- }
-
- cpdf_setTextMatrix(pdf, pdfmatrix[0], pdfmatrix[1],
- pdfmatrix[2], pdfmatrix[3],
- pdfmatrix[4], pdfmatrix[5]);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_text_pos(int pdfdoc, float x, float y [, int mode])
- Sets the position of text for the next cpdf_show call */
-PHP_FUNCTION(cpdf_set_text_pos)
-{
- zval **argv[4];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 3 || argc > 4 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
-
- if(argc > 3) {
- convert_to_long_ex(argv[3]);
- mode = Z_LVAL_PP(argv[3]);
- }
- if(mode == 1)
- cpdf_rawSetTextPosition(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
- else
- cpdf_setTextPosition(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_rotate_text(int pdfdoc, float angle)
- Sets text rotation angle */
-PHP_FUNCTION(cpdf_rotate_text)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_rotateText(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_char_spacing(int pdfdoc, float space)
- Sets character spacing */
-PHP_FUNCTION(cpdf_set_char_spacing)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_setCharacterSpacing(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_word_spacing(int pdfdoc, float space)
- Sets spacing between words */
-PHP_FUNCTION(cpdf_set_word_spacing)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_setWordSpacing(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto float cpdf_stringwidth(int pdfdoc, string text)
- Returns width of text in current font */
-PHP_FUNCTION(cpdf_stringwidth)
-{
- zval **arg1, **arg2;
- int id, type;
- double width;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
-
- width = (double) cpdf_stringWidth(pdf, Z_STRVAL_PP(arg2));
-
- RETURN_DOUBLE((double)width);
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_save(int pdfdoc)
- Saves current enviroment */
-PHP_FUNCTION(cpdf_save)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_gsave(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_restore(int pdfdoc)
- Restores formerly saved enviroment */
-PHP_FUNCTION(cpdf_restore)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_grestore(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_translate(int pdfdoc, float x, float y)
- Sets origin of coordinate system */
-PHP_FUNCTION(cpdf_translate)
-{
- zval **arg1, **arg2, **arg3;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
- convert_to_double_ex(arg3);
-
- cpdf_rawTranslate(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_scale(int pdfdoc, float x_scale, float y_scale)
- Sets scaling */
-PHP_FUNCTION(cpdf_scale)
-{
- zval **arg1, **arg2, **arg3;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
- convert_to_double_ex(arg3);
-
- cpdf_scale(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_rotate(int pdfdoc, float angle)
- Sets rotation */
-PHP_FUNCTION(cpdf_rotate)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_rotate(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setflat(int pdfdoc, float value)
- Sets flatness */
-PHP_FUNCTION(cpdf_setflat)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- if((Z_LVAL_PP(arg2) > 100) && (Z_LVAL_PP(arg2) < 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter has to between 0 and 100");
- RETURN_FALSE;
- }
-
- cpdf_setflat(pdf, (int) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setlinejoin(int pdfdoc, int value)
- Sets linejoin parameter */
-PHP_FUNCTION(cpdf_setlinejoin)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_long_ex(arg2);
-
- if((Z_LVAL_PP(arg2) > 2) && (Z_LVAL_PP(arg2) < 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter has to between 0 and 2");
- RETURN_FALSE;
- }
-
- cpdf_setlinejoin(pdf, Z_LVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setlinecap(int pdfdoc, int value)
- Sets linecap parameter */
-PHP_FUNCTION(cpdf_setlinecap)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_long_ex(arg2);
-
- if((Z_LVAL_PP(arg2) > 2) && (Z_LVAL_PP(arg2) < 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter has to be > 0 and =< 2");
- RETURN_FALSE;
- }
-
- cpdf_setlinecap(pdf, Z_LVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setmiterlimit(int pdfdoc, float value)
- Sets miter limit */
-PHP_FUNCTION(cpdf_setmiterlimit)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- if(Z_DVAL_PP(arg2) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter has to be >= 1");
- RETURN_FALSE;
- }
-
- cpdf_setmiterlimit(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setlinewidth(int pdfdoc, float width)
- Sets line width */
-PHP_FUNCTION(cpdf_setlinewidth)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_setlinewidth(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-#define BUFFERLEN 20
-/* {{{ proto bool cpdf_setdash(int pdfdoc, long white, long black)
- Sets dash pattern */
-PHP_FUNCTION(cpdf_setdash)
-{
- zval **arg1, **arg2, **arg3;
- int id, type;
- char buffer[BUFFERLEN];
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_long_ex(arg2);
- convert_to_long_ex(arg3);
-
- if (!pdf->currentMemStream) {
- RETURN_FALSE;
- }
-
- snprintf(buffer, BUFFERLEN, "[%d %d] 0", (int) Z_LVAL_PP(arg2), (int) Z_LVAL_PP(arg3));
- cpdf_setdash(pdf, buffer);
-
- RETURN_TRUE;
-}
-/* }}} */
-#undef BUFFERLEN
-
-/* {{{ proto bool cpdf_moveto(int pdfdoc, float x, float y [, int mode])
- Sets current point */
-PHP_FUNCTION(cpdf_moveto)
-{
- zval **argv[4];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 3 || argc > 4 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
-
- if(argc > 3) {
- convert_to_long_ex(argv[3]);
- mode = Z_LVAL_PP(argv[3]);
- }
- if(mode == 1)
- cpdf_rawMoveto(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
- else
- cpdf_moveto(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_rmoveto(int pdfdoc, float x, float y [, int mode])
- Sets current point */
-PHP_FUNCTION(cpdf_rmoveto)
-{
- zval **argv[4];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 3 || argc > 4 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
-
- if(argc > 3) {
- convert_to_long_ex(argv[3]);
- mode = Z_LVAL_PP(argv[3]);
- }
- if(mode == 1)
- cpdf_rawRmoveto(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
- else
- cpdf_rmoveto(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_curveto(int pdfdoc, float x1, float y1, float x2, float y2, float x3, float y3 [, int mode])
- Draws a curve */
-PHP_FUNCTION(cpdf_curveto)
-{
- zval **argv[8];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 7 || argc > 8 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- convert_to_double_ex(argv[4]);
- convert_to_double_ex(argv[5]);
- convert_to_double_ex(argv[6]);
-
- if(argc > 7) {
- convert_to_long_ex(argv[7]);
- mode = Z_LVAL_PP(argv[7]);
- }
- if(mode == 1)
- cpdf_rawCurveto(pdf, (float) Z_DVAL_PP(argv[1]),
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- (float) Z_DVAL_PP(argv[5]),
- (float) Z_DVAL_PP(argv[6]));
- else
- cpdf_curveto(pdf, (float) Z_DVAL_PP(argv[1]),
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- (float) Z_DVAL_PP(argv[5]),
- (float) Z_DVAL_PP(argv[6]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_lineto(int pdfdoc, float x, float y [, int mode])
- Draws a line */
-PHP_FUNCTION(cpdf_lineto)
-{
- zval **argv[4];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 3 || argc > 4 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
-
- if(argc > 3) {
- convert_to_long_ex(argv[3]);
- mode = Z_LVAL_PP(argv[3]);
- }
- if(mode == 1)
- cpdf_rawLineto(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
- else
- cpdf_lineto(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_rlineto(int pdfdoc, float x, float y [, int mode])
- Draws a line relative to current point */
-PHP_FUNCTION(cpdf_rlineto)
-{
- zval **argv[4];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 3 || argc > 4 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
-
- if(argc > 3) {
- convert_to_long_ex(argv[3]);
- mode = Z_LVAL_PP(argv[3]);
- }
- if(mode == 1)
- cpdf_rawRlineto(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
- else
- cpdf_rlineto(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_circle(int pdfdoc, float x, float y, float radius [, int mode])
- Draws a circle */
-PHP_FUNCTION(cpdf_circle)
-{
- zval **argv[5];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 4 || argc > 5 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
-
- if(argc > 4) {
- convert_to_long_ex(argv[4]);
- mode = Z_LVAL_PP(argv[4]);
- }
- if(mode == 1)
- cpdf_rawCircle(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]));
- else
- cpdf_circle(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_arc(int pdfdoc, float x, float y, float radius, float start, float end [, int mode])
- Draws an arc */
-PHP_FUNCTION(cpdf_arc)
-{
- zval **argv[7];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 6 || argc > 7 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- convert_to_double_ex(argv[4]);
- convert_to_double_ex(argv[5]);
-
- if(argc > 6) {
- convert_to_long_ex(argv[6]);
- mode = Z_LVAL_PP(argv[6]);
- }
- if(mode == 1)
- cpdf_rawArc(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), (float) Z_DVAL_PP(argv[4]), (float) Z_DVAL_PP(argv[5]), 1);
- else
- cpdf_arc(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), (float) Z_DVAL_PP(argv[4]), (float) Z_DVAL_PP(argv[5]), 1);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_rect(int pdfdoc, float x, float y, float width, float height [, int mode])
- Draws a rectangle */
-PHP_FUNCTION(cpdf_rect)
-{
- zval **argv[6];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
-
- if(argc < 5 || argc > 6 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- convert_to_double_ex(argv[4]);
-
- if(argc > 5) {
- convert_to_long_ex(argv[5]);
- mode = Z_LVAL_PP(argv[5]);
- }
- if(mode == 1)
- cpdf_rawRect(pdf, (float) Z_DVAL_PP(argv[1]),
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]));
- else
- cpdf_rect(pdf, (float) Z_DVAL_PP(argv[1]),
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_newpath(int pdfdoc)
- Starts new path */
-PHP_FUNCTION(cpdf_newpath)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_newpath(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_closepath(int pdfdoc)
- Close path */
-PHP_FUNCTION(cpdf_closepath)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_closepath(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_closepath_stroke(int pdfdoc)
- Close path and draw line along path */
-PHP_FUNCTION(cpdf_closepath_stroke)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_closepath(pdf);
- cpdf_stroke(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_stroke(int pdfdoc)
- Draws line along path path */
-PHP_FUNCTION(cpdf_stroke)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_stroke(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_fill(int pdfdoc)
- Fills current path */
-PHP_FUNCTION(cpdf_fill)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_fill(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_fill_stroke(int pdfdoc)
- Fills and stroke current path */
-PHP_FUNCTION(cpdf_fill_stroke)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_fill(pdf);
- cpdf_stroke(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_closepath_fill_stroke(int pdfdoc)
- Close, fill and stroke current path */
-PHP_FUNCTION(cpdf_closepath_fill_stroke)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_closepath(pdf);
- cpdf_fill(pdf);
- cpdf_stroke(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_clip(int pdfdoc)
- Clips to current path */
-PHP_FUNCTION(cpdf_clip)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_clip(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setgray_fill(int pdfdoc, float value)
- Sets filling color to gray value */
-PHP_FUNCTION(cpdf_setgray_fill)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_setgrayFill(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setgray_stroke(int pdfdoc, float value)
- Sets drawing color to gray value */
-PHP_FUNCTION(cpdf_setgray_stroke)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_setgrayStroke(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setgray(int pdfdoc, float value)
- Sets drawing and filling color to gray value */
-PHP_FUNCTION(cpdf_setgray)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
-
- cpdf_setgray(pdf, (float) Z_DVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setrgbcolor_fill(int pdfdoc, float red, float green, float blue)
- Sets filling color to rgb color value */
-PHP_FUNCTION(cpdf_setrgbcolor_fill)
-{
- zval **arg1, **arg2, **arg3, **arg4;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
- convert_to_double_ex(arg3);
- convert_to_double_ex(arg4);
-
- cpdf_setrgbcolorFill(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setrgbcolor_stroke(int pdfdoc, float red, float green, float blue)
- Sets drawing color to RGB color value */
-PHP_FUNCTION(cpdf_setrgbcolor_stroke)
-{
- zval **arg1, **arg2, **arg3, **arg4;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
- convert_to_double_ex(arg3);
- convert_to_double_ex(arg4);
-
- cpdf_setrgbcolorStroke(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_setrgbcolor(int pdfdoc, float red, float green, float blue)
- Sets drawing and filling color to RGB color value */
-PHP_FUNCTION(cpdf_setrgbcolor)
-{
- zval **arg1, **arg2, **arg3, **arg4;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_double_ex(arg2);
- convert_to_double_ex(arg3);
- convert_to_double_ex(arg4);
-
- cpdf_setrgbcolor(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_page_animation(int pdfdoc, int transition, float duration, float direction, int orientation, int inout)
- Sets transition between pages */
-PHP_FUNCTION(cpdf_set_page_animation)
-{
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_long_ex(arg2);
- convert_to_double_ex(arg3);
- convert_to_double_ex(arg4);
- convert_to_long_ex(arg5);
- convert_to_long_ex(arg6);
-
- cpdf_setPageTransition(pdf, Z_LVAL_PP(arg2), Z_DVAL_PP(arg3), Z_DVAL_PP(arg4),
- Z_LVAL_PP(arg5), Z_LVAL_PP(arg6));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_finalize(int pdfdoc)
- Creates PDF doc in memory */
-PHP_FUNCTION(cpdf_finalize)
-{
- zval **arg1;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- cpdf_finalizeAll(pdf);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_output_buffer(int pdfdoc)
- Returns the internal memory stream as string */
-PHP_FUNCTION(cpdf_output_buffer)
-{
- zval **arg1;
- int id, type, lenght;
- CPDFdoc *pdf;
- char *buffer;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
-
- buffer = cpdf_getBufferForPDF(pdf, &lenght);
-
- php_write(buffer, lenght TSRMLS_CC);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_save_to_file(int pdfdoc, string filename)
- Saves the internal memory stream to a file */
-PHP_FUNCTION(cpdf_save_to_file)
-{
- zval **arg1, **arg2;
- int id, type;
- CPDFdoc *pdf;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(arg1);
- convert_to_string_ex(arg2);
-
-#if APACHE
- if(strcmp(Z_STRVAL_PP(arg2), "-") == 0)
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Writing to stdout as described in the ClibPDF manual is not possible if php is used as an Apache module. Use cpdf_output_buffer() instead.");
-#endif
-
- if (php_check_open_basedir(Z_STRVAL_PP(arg2) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(arg2), "wb+", CHECKUID_CHECK_MODE_PARAM))) {
- RETURN_FALSE;
- }
-
- cpdf_savePDFmemoryStreamToFile(pdf, Z_STRVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_import_jpeg(int pdfdoc, string filename, float x, float y, float angle, float width, float height, float x_scale, float y_scale, int gsave [, int mode])
- Includes JPEG image */
-PHP_FUNCTION(cpdf_import_jpeg)
-{
- zval **argv[11];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- float width, height, xscale, yscale;
- CPDFdoc *pdf;
-
- if(argc < 10 || argc > 11 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_string_ex(argv[1]);
-
- if (php_check_open_basedir(Z_STRVAL_PP(argv[1]) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(argv[1]), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
- RETURN_FALSE;
- }
-
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- convert_to_double_ex(argv[4]);
- convert_to_double_ex(argv[5]);
- width = (float) Z_DVAL_PP(argv[5]);
- convert_to_double_ex(argv[6]);
- height = (float) Z_DVAL_PP(argv[6]);
- convert_to_double_ex(argv[7]);
- xscale = (float) Z_DVAL_PP(argv[7]);
- convert_to_double_ex(argv[8]);
- yscale = (float) Z_DVAL_PP(argv[8]);
- convert_to_long_ex(argv[9]);
-
- if(argc > 10) {
- convert_to_long_ex(argv[10]);
- mode = Z_LVAL_PP(argv[10]);
- }
- if(mode == 1)
- cpdf_rawImportImage(pdf, Z_STRVAL_PP(argv[1]),
- JPEG_IMG,
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- &width,
- &height,
- &xscale,
- &yscale,
- Z_LVAL_PP(argv[9]));
- else
- cpdf_rawImportImage(pdf, Z_STRVAL_PP(argv[1]),
- JPEG_IMG,
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- &width,
- &height,
- &xscale,
- &yscale,
- Z_LVAL_PP(argv[9]));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-#if HAVE_LIBGD13
-/* {{{ proto bool cpdf_place_inline_image(int pdfdoc, int gdimage, float x, float y, float angle, fload width, float height, int gsave [, int mode])
- Includes image */
-PHP_FUNCTION(cpdf_place_inline_image)
-{
- zval **argv[11];
- int id, gid, type, mode = 0, argc = ZEND_NUM_ARGS();
- int count, i, j, color;
- CPDFdoc *pdf;
- unsigned char *buffer, *ptr;
- gdImagePtr im;
-
- if(argc < 8 || argc > 9 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_long_ex(argv[1]);
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- convert_to_double_ex(argv[4]);
- convert_to_double_ex(argv[5]);
- convert_to_double_ex(argv[6]);
- convert_to_long_ex(argv[7]);
-
- gid=Z_LVAL_PP(argv[1]);
- im = zend_list_find(gid, &type);
-
- ZEND_GET_RESOURCE_TYPE_ID(CPDF_GLOBAL(le_gd), "gd");
- if(!CPDF_GLOBAL(le_gd))
- {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to find handle for GD image stream. Please check the GD extension is loaded.");
- }
-
- if (!im || type != CPDF_GLOBAL(le_gd)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find image pointer");
- RETURN_FALSE;
- }
-
- if(argc > 8) {
- convert_to_long_ex(argv[8]);
- mode = Z_LVAL_PP(argv[8]);
- }
-
- count = 3 * im->sx * im->sy;
- buffer = (unsigned char *) safe_emalloc(3 * im->sx, im->sy, 0);
-
- ptr = buffer;
- for(i=0; i<im->sy; i++) {
- for(j=0; j<im->sx; j++) {
-#if HAVE_LIBGD20
- if(gdImageTrueColor(im)) {
- if (im->tpixels && gdImageBoundsSafe(im, j, i)) {
- color = gdImageTrueColorPixel(im, j, i);
- *ptr++ = (color >> 16) & 0xFF;
- *ptr++ = (color >> 8) & 0xFF;
- *ptr++ = color & 0xFF;
- }
- } else {
-#endif
- if (im->pixels && gdImageBoundsSafe(im, j, i)) {
- color = im->pixels[i][j];
- *ptr++ = im->red[color];
- *ptr++ = im->green[color];
- *ptr++ = im->blue[color];
- }
-#if HAVE_LIBGD20
- }
-#endif
- }
- }
-
- if(mode == 1)
- cpdf_placeInLineImage(pdf, buffer, count,
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- (float) Z_DVAL_PP(argv[5]),
- (float) Z_DVAL_PP(argv[6]),
- im->sx,
- im->sy,
- 8, 2, Z_LVAL_PP(argv[7]));
- else
- cpdf_rawPlaceInLineImage(pdf, buffer, count,
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- (float) Z_DVAL_PP(argv[5]),
- (float) Z_DVAL_PP(argv[6]),
- im->sx,
- im->sy,
- 8, 2, Z_LVAL_PP(argv[7]));
-
- efree(buffer);
- RETURN_TRUE;
-}
-/* }}} */
-#endif
-
-/* {{{ proto bool cpdf_add_annotation(int pdfdoc, float xll, float yll, float xur, float xur, string title, string text [, int mode])
- Sets annotation */
-PHP_FUNCTION(cpdf_add_annotation)
-{
- zval **argv[11];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
- CPDFannotAttrib attrib;
-
- if(argc < 7 || argc > 8 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- convert_to_double_ex(argv[4]);
- convert_to_string_ex(argv[5]);
- convert_to_string_ex(argv[6]);
-
- attrib.flags = AF_NOZOOM | AF_NOROTATE | AF_READONLY;
- attrib.border_array = "[0 0 1 [4 2]]";
- attrib.BS = NULL;
- attrib.r = 0.00;
- attrib.g = 1.00;
- attrib.b = 1.00;
- if(argc > 7) {
- convert_to_long_ex(argv[7]);
- mode = Z_LVAL_PP(argv[7]);
- }
- if(mode == 1)
- cpdf_rawSetAnnotation(pdf, (float) Z_DVAL_PP(argv[1]),
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- Z_STRVAL_PP(argv[5]),
- Z_STRVAL_PP(argv[6]),
- &attrib);
- else
- cpdf_setAnnotation(pdf, (float) Z_DVAL_PP(argv[1]),
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- Z_STRVAL_PP(argv[5]),
- Z_STRVAL_PP(argv[6]),
- &attrib);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool cpdf_set_action_url(int pdfdoc, float xll, float yll, float xur, float xur, string url [, int mode])
- Sets hyperlink */
-PHP_FUNCTION(cpdf_set_action_url)
-{
- zval **argv[11];
- int id, type, mode = 0, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
- CPDFannotAttrib attrib;
-
- if(argc < 6 || argc > 7 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_double_ex(argv[1]);
- convert_to_double_ex(argv[2]);
- convert_to_double_ex(argv[3]);
- convert_to_double_ex(argv[4]);
- convert_to_string_ex(argv[5]);
-
- attrib.flags = AF_NOZOOM | AF_NOROTATE | AF_READONLY;
- attrib.border_array = "[0 0 1 [4 0]]";
- attrib.BS = NULL;
- attrib.r = 0.00;
- attrib.g = 0.00;
- attrib.b = 1.00;
- if(argc > 6) {
- convert_to_long_ex(argv[6]);
- mode = Z_LVAL_PP(argv[6]);
- }
- if(mode == 1)
- cpdf_rawSetActionURL(pdf, (float) Z_DVAL_PP(argv[1]),
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- Z_STRVAL_PP(argv[5]),
- &attrib);
- else
- cpdf_setActionURL(pdf, (float) Z_DVAL_PP(argv[1]),
- (float) Z_DVAL_PP(argv[2]),
- (float) Z_DVAL_PP(argv[3]),
- (float) Z_DVAL_PP(argv[4]),
- Z_STRVAL_PP(argv[5]),
- &attrib);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int cpdf_add_outline(int pdfdoc, int lastoutline, int sublevel, int open, int pagenr, string title)
- Adds outline */
-PHP_FUNCTION(cpdf_add_outline)
-{
- zval **argv[11];
- int id, oid, type, argc = ZEND_NUM_ARGS();
- CPDFdoc *pdf;
- CPDFoutlineEntry *lastoutline;
-
- if(argc != 6 || (zend_get_parameters_array_ex(argc, argv) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- CPDF_FETCH_CPDFDOC(argv[0]);
- convert_to_long_ex(argv[1]);
- convert_to_long_ex(argv[2]);
- convert_to_long_ex(argv[3]);
- convert_to_long_ex(argv[4]);
- convert_to_string_ex(argv[5]);
-
- oid=Z_LVAL_PP(argv[1]);
- lastoutline = zend_list_find(oid, &type);
- if(!lastoutline || type!=CPDF_GLOBAL(le_outline)) {
- lastoutline = NULL;
-/* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find last outline entry %d", id);
- RETURN_FALSE; */
- }
-
- lastoutline = cpdf_addOutlineEntry(pdf, lastoutline,
- Z_LVAL_PP(argv[2]),
- Z_LVAL_PP(argv[3]),
- Z_LVAL_PP(argv[4]),
- Z_STRVAL_PP(argv[5]),
- 1, 0.0, 0.0, 0.0, 0.0);
-
- id = zend_list_insert(lastoutline, CPDF_GLOBAL(le_outline));
- RETURN_LONG(id);
-}
-/* }}} */
-
-#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/cpdf/cpdf.dsp b/ext/cpdf/cpdf.dsp
deleted file mode 100644
index 6b952944e..000000000
--- a/ext/cpdf/cpdf.dsp
+++ /dev/null
@@ -1,111 +0,0 @@
-# Microsoft Developer Studio Project File - Name="cpdf" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=cpdf - 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 "cpdf.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 "cpdf.mak" CFG="cpdf - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "cpdf - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "cpdf - 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)" == "cpdf - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CPDF" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CPDF_EXPORTS" /D "COMPILE_DL_CPDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CPDFLIB=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 cpdfi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib cpdf.lib user32.lib winspool.lib kernel32.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_cpdf.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "cpdf - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CPDF" /D ZTS=1 /D MSSQL70=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CPDF_EXPORTS" /D "COMPILE_DL_CPDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CPDFLIB=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib cpdfi32.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 cpdf.lib php5ts_debug.lib user32.lib winspool.lib kernel32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_cpdf.dll" /libpath:"..\..\Debug_TS"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "cpdf - Win32 Release_TS"
-# Name "cpdf - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\cpdf.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_cpdf.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/cpdf/package.xml b/ext/cpdf/package.xml
deleted file mode 100644
index c3a572db8..000000000
--- a/ext/cpdf/package.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>cpdf</name>
- <summary>Clib PDF functions</summary>
- <maintainers>
- <maintainer>
- <user>steinm</user>
- <name>Uwe Steinmann</name>
- <email>steinm@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-ClibPDF lets you create PDF documents with PHP.
-ClibPDF functionality and API are similar to PDFlib.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support intallation using pear installer
- </notes>
- <configureoptions>
- <configureoption name="with-cpdf" default="autodetect" prompt="path to cpdf installation?"/>
- </configureoptions>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.mw32"/>
- <file role="src" name="cpdf.dsp"/>
- <file role="src" name="cpdf.c"/>
- <file role="src" name="php_cpdf.h"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/cpdf/php_cpdf.h b/ext/cpdf/php_cpdf.h
deleted file mode 100644
index 0dfee8797..000000000
--- a/ext/cpdf/php_cpdf.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Uwe Steinmann <Uwe.Steinmann@fernuni-hagen.de> |
- +----------------------------------------------------------------------+
- */
-/* $Id: php_cpdf.h,v 1.16 2004/01/08 17:31:52 sniper Exp $ */
-
-#ifndef PHP_CPDF_H
-#define PHP_CPDF_H
-
-#if HAVE_CPDFLIB
-
-/* The macro T is defined in the IMAP headers and clashes with a function
- declaration here. Get rid of it. */
-
-#ifdef T
-#undef T
-#endif
-
-extern zend_module_entry cpdf_module_entry;
-#define cpdf_module_ptr &cpdf_module_entry
-
-PHP_MINFO_FUNCTION(cpdf);
-PHP_MINIT_FUNCTION(cpdf);
-PHP_RINIT_FUNCTION(cpdf);
-PHP_MSHUTDOWN_FUNCTION(cpdf);
-PHP_FUNCTION(cpdf_global_set_document_limits);
-PHP_FUNCTION(cpdf_set_creator);
-PHP_FUNCTION(cpdf_set_title);
-PHP_FUNCTION(cpdf_set_subject);
-PHP_FUNCTION(cpdf_set_keywords);
-PHP_FUNCTION(cpdf_set_viewer_preferences);
-PHP_FUNCTION(cpdf_open);
-PHP_FUNCTION(cpdf_close);
-PHP_FUNCTION(cpdf_page_init);
-PHP_FUNCTION(cpdf_finalize_page);
-PHP_FUNCTION(cpdf_set_current_page);
-PHP_FUNCTION(cpdf_begin_text);
-PHP_FUNCTION(cpdf_end_text);
-PHP_FUNCTION(cpdf_show);
-PHP_FUNCTION(cpdf_show_xy);
-PHP_FUNCTION(cpdf_continue_text);
-PHP_FUNCTION(cpdf_text);
-PHP_FUNCTION(cpdf_set_font);
-PHP_FUNCTION(cpdf_set_font_directories);
-PHP_FUNCTION(cpdf_set_font_map_file);
-PHP_FUNCTION(cpdf_set_leading);
-PHP_FUNCTION(cpdf_set_text_rendering);
-PHP_FUNCTION(cpdf_set_horiz_scaling);
-PHP_FUNCTION(cpdf_set_text_rise);
-PHP_FUNCTION(cpdf_set_text_matrix);
-PHP_FUNCTION(cpdf_set_text_pos);
-PHP_FUNCTION(cpdf_rotate_text);
-PHP_FUNCTION(cpdf_set_char_spacing);
-PHP_FUNCTION(cpdf_set_word_spacing);
-PHP_FUNCTION(cpdf_continue_text);
-PHP_FUNCTION(cpdf_stringwidth);
-PHP_FUNCTION(cpdf_save);
-PHP_FUNCTION(cpdf_restore);
-PHP_FUNCTION(cpdf_translate);
-PHP_FUNCTION(cpdf_scale);
-PHP_FUNCTION(cpdf_rotate);
-PHP_FUNCTION(cpdf_setflat);
-PHP_FUNCTION(cpdf_setlinejoin);
-PHP_FUNCTION(cpdf_setlinecap);
-PHP_FUNCTION(cpdf_setmiterlimit);
-PHP_FUNCTION(cpdf_setlinewidth);
-PHP_FUNCTION(cpdf_setdash);
-PHP_FUNCTION(cpdf_moveto);
-PHP_FUNCTION(cpdf_rmoveto);
-PHP_FUNCTION(cpdf_curveto);
-PHP_FUNCTION(cpdf_lineto);
-PHP_FUNCTION(cpdf_rlineto);
-PHP_FUNCTION(cpdf_circle);
-PHP_FUNCTION(cpdf_arc);
-PHP_FUNCTION(cpdf_rect);
-PHP_FUNCTION(cpdf_newpath);
-PHP_FUNCTION(cpdf_closepath);
-PHP_FUNCTION(cpdf_closepath_stroke);
-PHP_FUNCTION(cpdf_stroke);
-PHP_FUNCTION(cpdf_fill);
-PHP_FUNCTION(cpdf_fill_stroke);
-PHP_FUNCTION(cpdf_closepath_fill_stroke);
-PHP_FUNCTION(cpdf_endpath);
-PHP_FUNCTION(cpdf_clip);
-PHP_FUNCTION(cpdf_setgray_fill);
-PHP_FUNCTION(cpdf_setgray_stroke);
-PHP_FUNCTION(cpdf_setgray);
-PHP_FUNCTION(cpdf_setrgbcolor_fill);
-PHP_FUNCTION(cpdf_setrgbcolor_stroke);
-PHP_FUNCTION(cpdf_setrgbcolor);
-PHP_FUNCTION(cpdf_add_outline);
-PHP_FUNCTION(cpdf_set_page_animation);
-PHP_FUNCTION(cpdf_finalize);
-PHP_FUNCTION(cpdf_output_buffer);
-PHP_FUNCTION(cpdf_save_to_file);
-PHP_FUNCTION(cpdf_add_annotation);
-PHP_FUNCTION(cpdf_import_jpeg);
-#if HAVE_LIBGD13
-PHP_FUNCTION(cpdf_place_inline_image);
-#endif
-PHP_FUNCTION(cpdf_set_action_url);
-#else
-#define cpdf_module_ptr NULL
-#endif
-#define phpext_cpdf_ptr cpdf_module_ptr
-#endif /* _PHP_PDF_H */
diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c
index 78f6d293e..506abc561 100644
--- a/ext/ctype/ctype.c
+++ b/ext/ctype/ctype.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -92,34 +92,39 @@ PHP_MINFO_FUNCTION(ctype)
/* {{{ ctype
*/
#define CTYPE(iswhat) \
- zval *c; \
+ zval *c, tmp; \
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE) \
return; \
- switch (Z_TYPE_P(c)) { \
- case IS_LONG: \
+ if (Z_TYPE_P(c) == IS_LONG) { \
if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
} else if (Z_LVAL_P(c) >= -128 && Z_LVAL_P(c) < 0) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
} \
- SEPARATE_ZVAL(&c); \
- convert_to_string(c); \
- case IS_STRING: \
- { \
- char *p; \
- int n, len; \
- p=Z_STRVAL_P(c); \
- len = Z_STRLEN_P(c); \
- for(n=0;n<len;n++) { \
- if(!iswhat((int)*(unsigned char *)(p++))) RETURN_FALSE; \
+ tmp = *c; \
+ zval_copy_ctor(&tmp); \
+ convert_to_string(&tmp); \
+ } else { \
+ tmp = *c; \
+ } \
+ if (Z_TYPE(tmp) == IS_STRING) { \
+ char *p = Z_STRVAL(tmp), *e = Z_STRVAL(tmp) + Z_STRLEN(tmp); \
+ if (e == p) { \
+ if (Z_TYPE_P(c) == IS_LONG) zval_dtor(&tmp); \
+ RETURN_FALSE; \
+ } \
+ while (p < e) { \
+ if(!iswhat((int)*(unsigned char *)(p++))) { \
+ if (Z_TYPE_P(c) == IS_LONG) zval_dtor(&tmp); \
+ RETURN_FALSE; \
} \
- RETURN_TRUE; \
} \
- default: \
- break; \
+ if (Z_TYPE_P(c) == IS_LONG) zval_dtor(&tmp); \
+ RETURN_TRUE; \
+ } else { \
+ RETURN_FALSE; \
} \
- RETURN_FALSE;
-
+
/* }}} */
/* {{{ proto bool ctype_alnum(mixed c)
diff --git a/ext/ctype/php_ctype.h b/ext/ctype/php_ctype.h
index 12b5e9008..0e12c9389 100644
--- a/ext/ctype/php_ctype.h
+++ b/ext/ctype/php_ctype.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/ctype/tests/bug34645.phpt b/ext/ctype/tests/bug34645.phpt
new file mode 100644
index 000000000..412c8c992
--- /dev/null
+++ b/ext/ctype/tests/bug34645.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #34645 (ctype corrupts memory when validating large numbers)
+--FILE--
+<?php
+$id = 394829384;
+var_dump(ctype_digit($id));
+var_dump($id);
+?>
+--EXPECT--
+bool(true)
+int(394829384)
diff --git a/ext/curl/config.m4 b/ext/curl/config.m4
index 312a932b1..81df11307 100644
--- a/ext/curl/config.m4
+++ b/ext/curl/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.25.2.1 2005/02/09 16:23:31 rasmus Exp $
+dnl $Id: config.m4,v 1.28.2.3 2005/11/22 22:53:34 tony2001 Exp $
dnl
PHP_ARG_WITH(curl, for CURL support,
@@ -36,22 +36,54 @@ if test "$PHP_CURL" != "no"; then
CURL_CONFIG=${CURL_DIR}/bin/curl-config
else
if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then
- CURL_CONFIG=${CURL_DIR}/curl-config
+ CURL_CONFIG=${CURL_DIR}/curl-config
fi
fi
curl_version_full=`$CURL_CONFIG --version`
- curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+ curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test "$curl_version" -ge 7010005; then
AC_MSG_RESULT($curl_version_full)
CURL_LIBS=`$CURL_CONFIG --libs`
else
AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support)
fi
+
+ AC_MSG_CHECKING([for SSL support in libcurl])
+ CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL`
+ if test "$CURL_SSL" = "SSL"; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_CURL_SSL], [1], [Have cURL with SSL support])
+
+ AC_MSG_CHECKING([for SSL library used])
+ CURL_SSL_FLAVOUR=
+ for i in $CURL_LIBS; do
+ if test "$i" = "-lssl"; then
+ CURL_SSL_FLAVOUR="openssl"
+ AC_MSG_RESULT([openssl])
+ AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support])
+ AC_CHECK_HEADERS([openssl/crypto.h])
+ break
+ elif test "$i" = "-lgnutls"; then
+ CURL_SSL_FLAVOUR="gnutls"
+ AC_MSG_RESULT([gnutls])
+ AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support])
+ AC_CHECK_HEADERS([gcrypt.h])
+ break
+ fi
+ done
+ if test -z "$CURL_SSL_FLAVOUR"; then
+ AC_MSG_RESULT([unknown!])
+ AC_MSG_WARN([Could not determine the type of SSL library used!])
+ AC_MSG_WARN([Building will fail in ZTS mode!])
+ fi
+ else
+ AC_MSG_RESULT([no])
+ fi
PHP_ADD_INCLUDE($CURL_DIR/include)
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, CURL_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)
PHP_CHECK_LIBRARY(curl,curl_easy_perform,
[
@@ -59,14 +91,14 @@ if test "$PHP_CURL" != "no"; then
],[
AC_MSG_ERROR(There is something wrong. Please check config.log for more information.)
],[
- $CURL_LIBS -L$CURL_DIR/lib
+ $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
])
PHP_CHECK_LIBRARY(curl,curl_version_info,
[
AC_DEFINE(HAVE_CURL_VERSION_INFO,1,[ ])
],[],[
- $CURL_LIBS -L$CURL_DIR/lib
+ $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
])
if test "$PHP_CURLWRAPPERS" != "no" ; then
diff --git a/ext/curl/config.w32 b/ext/curl/config.w32
index 9aec31013..a1bdc0c05 100644
--- a/ext/curl/config.w32
+++ b/ext/curl/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.3 2004/01/13 05:30:53 pollita Exp $
+// $Id: config.w32,v 1.3.4.1 2005/10/25 14:32:33 mike Exp $
// vim:ft=javascript
ARG_WITH("curl", "CURL support", "no");
@@ -12,6 +12,7 @@ if (PHP_CURL != "no") {
CHECK_LIB("winmm.lib", "curl", PHP_CURL)) {
EXTENSION("curl", "interface.c multi.c streams.c");
AC_DEFINE('HAVE_CURL', 1, 'Have CURL library');
+ AC_DEFINE('HAVE_CURL_SSL', 1, 'Have SSL suppurt in CURL');
// TODO: check for curl_version_info
// AC_DEFINE('PHP_CURL_URL_WRAPPERS', 0, 'Use curl for URL wrappers [experimental]');
} else {
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index bdefe9960..3bcb676e6 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: interface.c,v 1.46.2.8 2005/06/02 21:04:43 tony2001 Exp $ */
+/* $Id: interface.c,v 1.62.2.7 2005/11/27 20:07:36 iliaa Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -44,6 +44,45 @@
#define HttpPost curl_httppost
#endif
+/* {{{ cruft for thread safe SSL crypto locks */
+#if defined(ZTS) && defined(HAVE_CURL_SSL)
+# ifdef PHP_WIN32
+# define PHP_CURL_NEED_SSL_TSL
+# define PHP_CURL_NEED_OPENSSL_TSL
+# include <openssl/crypto.h>
+# else /* !PHP_WIN32 */
+# if defined(HAVE_CURL_OPENSSL)
+# if defined(HAVE_OPENSSL_CRYPTO_H)
+# define PHP_CURL_NEED_SSL_TSL
+# define PHP_CURL_NEED_OPENSSL_TSL
+# include <openssl/crypto.h>
+# else
+# warning \
+ "libcurl was compiled with OpenSSL support, but configure could not find " \
+ "openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \
+ "cause random crashes on SSL requests"
+# endif
+# elif defined(HAVE_CURL_GNUTLS)
+# if defined(HAVE_GCRYPT_H)
+# define PHP_CURL_NEED_SSL_TSL
+# define PHP_CURL_NEED_GNUTLS_TSL
+# include <gcrypt.h>
+# else
+# warning \
+ "libcurl was compiled with GnuTLS support, but configure could not find " \
+ "gcrypt.h; thus no SSL crypto locking callbacks will be set, which may " \
+ "cause random crashes on SSL requests"
+# endif
+# else
+# warning \
+ "libcurl was compiled with SSL support, but configure could not determine which" \
+ "library was used; thus no SSL crypto locking callbacks will be set, which may " \
+ "cause random crashes on SSL requests"
+# endif /* HAVE_CURL_OPENSSL || HAVE_CURL_GNUTLS */
+# endif /* PHP_WIN32 */
+#endif /* ZTS && HAVE_CURL_SSL */
+/* }}} */
+
#define SMART_STR_PREALLOC 4096
#include "ext/standard/php_smart_str.h"
@@ -52,6 +91,14 @@
#include "ext/standard/url.h"
#include "php_curl.h"
+int le_curl;
+int le_curl_multi_handle;
+
+#ifdef PHP_CURL_NEED_SSL_TSL
+static inline void php_curl_ssl_init(void);
+static inline void php_curl_ssl_cleanup(void);
+#endif
+
static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err;
@@ -62,8 +109,8 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
#define CAAZ(s, v) add_assoc_zval_ex(return_value, s, sizeof(s), (zval *) v);
#define PHP_CURL_CHECK_OPEN_BASEDIR(str, len) \
- if (PG(open_basedir) && *PG(open_basedir) && \
- strncasecmp(str, "file://", sizeof("file://") - 1) == 0) \
+ if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && \
+ strncasecmp(str, "file:", sizeof("file:") - 1) == 0) \
{ \
php_url *tmp_url; \
\
@@ -72,7 +119,7 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
RETURN_FALSE; \
} \
\
- if (php_check_open_basedir(tmp_url->path TSRMLS_CC) || \
+ if (tmp_url->query || tmp_url->fragment || php_check_open_basedir(tmp_url->path TSRMLS_CC) || \
(PG(safe_mode) && !php_checkuid(tmp_url->path, "rb+", CHECKUID_CHECK_MODE_PARAM)) \
) { \
php_url_free(tmp_url); \
@@ -188,6 +235,8 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_TIME);
REGISTER_CURL_CONSTANT(CURLOPT_RESUME_FROM);
REGISTER_CURL_CONSTANT(CURLOPT_COOKIE);
+ REGISTER_CURL_CONSTANT(CURLOPT_COOKIESESSION);
+ REGISTER_CURL_CONSTANT(CURLOPT_AUTOREFERER);
REGISTER_CURL_CONSTANT(CURLOPT_SSLCERT);
REGISTER_CURL_CONSTANT(CURLOPT_SSLCERTPASSWD);
REGISTER_CURL_CONSTANT(CURLOPT_WRITEHEADER);
@@ -390,7 +439,17 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLM_INTERNAL_ERROR);
REGISTER_CURL_CONSTANT(CURLMSG_DONE);
-
+
+#ifdef CURLOPT_FTPSSLAUTH
+ REGISTER_CURL_CONSTANT(CURLOPT_FTPSSLAUTH);
+ REGISTER_CURL_CONSTANT(CURLFTPAUTH_DEFAULT);
+ REGISTER_CURL_CONSTANT(CURLFTPAUTH_SSL);
+ REGISTER_CURL_CONSTANT(CURLFTPAUTH_TLS);
+#endif
+
+#ifdef PHP_CURL_NEED_SSL_TSL
+ php_curl_ssl_init();
+#endif
if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) {
return FAILURE;
}
@@ -428,7 +487,9 @@ PHP_MSHUTDOWN_FUNCTION(curl)
php_unregister_url_stream_wrapper("ldap" TSRMLS_CC);
#endif
curl_global_cleanup();
-
+#ifdef PHP_CURL_NEED_SSL_TSL
+ php_curl_ssl_cleanup();
+#endif
return SUCCESS;
}
/* }}} */
@@ -452,7 +513,6 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
PHPWRITE(data, length);
break;
case PHP_CURL_FILE:
- fflush(t->fp);
return fwrite(data, size, nmemb, t->fp);
case PHP_CURL_RETURN:
smart_str_appendl(&t->buf, data, (int) length);
@@ -561,6 +621,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
ch->in_callback = 0;
if (error == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
+ length = -1;
} else if (retval_ptr) {
if (Z_TYPE_P(retval_ptr) == IS_STRING) {
length = MIN(size * nmemb, Z_STRLEN_P(retval_ptr));
@@ -780,7 +841,7 @@ static void alloc_curl_handle(php_curl **ch)
(*ch)->handlers->read = ecalloc(1, sizeof(php_curl_read));
(*ch)->in_callback = 0;
-
+
memset(&(*ch)->err, 0, sizeof((*ch)->err));
zend_llist_init(&(*ch)->to_free.str, sizeof(char *), (void(*)(void *)) curl_free_string, 0);
@@ -870,7 +931,7 @@ PHP_FUNCTION(curl_copy_handle)
cp = curl_easy_duphandle(ch->cp);
if (!cp) {
- php_error(E_WARNING, "Cannot duplicate cURL handle");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot duplicate cURL handle");
RETURN_FALSE;
}
@@ -958,8 +1019,14 @@ PHP_FUNCTION(curl_setopt)
#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH is available since curl 7.10.7 */
case CURLOPT_PROXYAUTH:
#endif
+
+#ifdef CURLOPT_FTPSSLAUTH
+ case CURLOPT_FTPSSLAUTH:
+#endif
case CURLOPT_UNRESTRICTED_AUTH:
case CURLOPT_PORT:
+ case CURLOPT_AUTOREFERER:
+ case CURLOPT_COOKIESESSION:
convert_to_long_ex(zvalue);
error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
break;
@@ -1128,10 +1195,15 @@ PHP_FUNCTION(curl_setopt)
* must be explicitly cast to long in curl_formadd
* use since curl needs a long not an int. */
if (*postval == '@') {
+ ++postval;
+ /* safe_mode / open_basedir check */
+ if (php_check_open_basedir(postval TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(postval, "rb+", CHECKUID_CHECK_MODE_PARAM))) {
+ RETURN_FALSE;
+ }
error = curl_formadd(&first, &last,
CURLFORM_COPYNAME, string_key,
CURLFORM_NAMELENGTH, (long)string_key_len - 1,
- CURLFORM_FILE, ++postval,
+ CURLFORM_FILE, postval,
CURLFORM_END);
} else {
error = curl_formadd(&first, &last,
@@ -1237,11 +1309,7 @@ PHP_FUNCTION(curl_setopt)
Cleanup an execution phase */
void _php_curl_cleanup_handle(php_curl *ch)
{
- if (ch->uses < 1) {
- return;
- }
-
- if (ch->handlers->write->buf.len) {
+ if (ch->handlers->write->buf.len > 0) {
memset(&ch->handlers->write->buf, 0, sizeof(smart_str));
}
@@ -1280,12 +1348,13 @@ PHP_FUNCTION(curl_exec)
ch->uses++;
if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) {
+ --ch->uses;
if (ch->handlers->write->type != PHP_CURL_BINARY) {
smart_str_0(&ch->handlers->write->buf);
}
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 0);
}
-
+ --ch->uses;
RETURN_TRUE;
}
/* }}} */
@@ -1525,7 +1594,106 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
/* }}} */
-#endif
+#ifdef PHP_CURL_NEED_OPENSSL_TSL
+/* {{{ */
+static MUTEX_T *php_curl_openssl_tsl = NULL;
+
+static void php_curl_ssl_lock(int mode, int n, const char * file, int line)
+{
+ if (mode & CRYPTO_LOCK) {
+ tsrm_mutex_lock(php_curl_openssl_tsl[n]);
+ } else {
+ tsrm_mutex_unlock(php_curl_openssl_tsl[n]);
+ }
+}
+
+static unsigned long php_curl_ssl_id(void)
+{
+ return (unsigned long) tsrm_thread_id();
+}
+
+static inline void php_curl_ssl_init(void)
+{
+ int i, c = CRYPTO_num_locks();
+
+ php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));
+
+ for (i = 0; i < c; ++i) {
+ php_curl_openssl_tsl[i] = tsrm_mutex_alloc();
+ }
+
+ CRYPTO_set_id_callback(php_curl_ssl_id);
+ CRYPTO_set_locking_callback(php_curl_ssl_lock);
+}
+
+static inline void php_curl_ssl_cleanup(void)
+{
+ if (php_curl_openssl_tsl) {
+ int i, c = CRYPTO_num_locks();
+
+ CRYPTO_set_id_callback(NULL);
+ CRYPTO_set_locking_callback(NULL);
+
+ for (i = 0; i < c; ++i) {
+ tsrm_mutex_free(php_curl_openssl_tsl[i]);
+ }
+
+ free(php_curl_openssl_tsl);
+ php_curl_openssl_tsl = NULL;
+ }
+}
+#endif /* PHP_CURL_NEED_OPENSSL_TSL */
+/* }}} */
+
+#ifdef PHP_CURL_NEED_GNUTLS_TSL
+/* {{{ */
+static int php_curl_ssl_mutex_create(void **m)
+{
+ if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) {
+ return SUCCESS;
+ } else {
+ return FAILURE;
+ }
+}
+
+static int php_curl_ssl_mutex_destroy(void **m)
+{
+ tsrm_mutex_free(*((MUTEX_T *) m));
+ return SUCCESS;
+}
+
+static int php_curl_ssl_mutex_lock(void **m)
+{
+ return tsrm_mutex_lock(*((MUTEX_T *) m));
+}
+
+static int php_curl_ssl_mutex_unlock(void **m)
+{
+ return tsrm_mutex_unlock(*((MUTEX_T *) m));
+}
+
+static struct gcry_thread_cbs php_curl_gnutls_tsl = {
+ GCRY_THREAD_OPTIONS_USER,
+ NULL,
+ php_curl_ssl_mutex_create,
+ php_curl_ssl_mutex_destroy,
+ php_curl_ssl_mutex_lock,
+ php_curl_ssl_mutex_unlock
+};
+
+static inline void php_curl_ssl_init(void)
+{
+ gcry_control(GCRYCTL_SET_THREAD_CBS, &php_curl_gnutls_tsl);
+}
+
+static inline void php_curl_ssl_cleanup(void)
+{
+ return;
+}
+#endif /* PHP_CURL_NEED_GNUTLS_TSL */
+/* }}} */
+
+#endif /* HAVE_CURL */
/*
* Local variables:
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index 8224d300a..eb3e2252b 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: multi.c,v 1.16 2004/03/11 00:27:16 iliaa Exp $ */
+/* $Id: multi.c,v 1.19.2.1 2005/09/08 14:50:23 iliaa Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -111,7 +111,7 @@ PHP_FUNCTION(curl_multi_remove_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_ptr_dtor(&z_ch);
+ --ch->uses;
RETURN_LONG((long) curl_multi_remove_handle(mh->multi, ch->cp));
}
@@ -195,7 +195,7 @@ PHP_FUNCTION(curl_multi_getcontent)
ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl);
if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) {
- if (ch->handlers->write->type == PHP_CURL_BINARY) {
+ if (ch->handlers->write->type != PHP_CURL_BINARY) {
smart_str_0(&ch->handlers->write->buf);
}
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h
index 5f87cca98..4c00e5750 100644
--- a/ext/curl/php_curl.h
+++ b/ext/curl/php_curl.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_curl.h,v 1.41.2.1 2005/06/02 21:04:43 tony2001 Exp $ */
+/* $Id: php_curl.h,v 1.44 2005/08/03 14:06:45 sniper Exp $ */
#ifndef _PHP_CURL_H
#define _PHP_CURL_H
@@ -51,9 +51,9 @@ extern zend_module_entry curl_module_entry;
#define PHP_CURL_BINARY 6
#define PHP_CURL_IGNORE 7
-int le_curl;
+extern int le_curl;
#define le_curl_name "cURL handle"
-int le_curl_multi_handle;
+extern int le_curl_multi_handle;
#define le_curl_multi_handle_name "cURL Multi Handle"
PHP_MINIT_FUNCTION(curl);
diff --git a/ext/curl/streams.c b/ext/curl/streams.c
index 6bb8456e3..e0403e144 100644
--- a/ext/curl/streams.c
+++ b/ext/curl/streams.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: streams.c,v 1.12.2.1 2004/08/31 20:11:32 pollita Exp $ */
+/* $Id: streams.c,v 1.14.2.1 2005/08/25 12:25:10 sniper Exp $ */
/* This file implements cURL based wrappers.
* NOTE: If you are implementing your own streams that are intended to
@@ -361,7 +361,7 @@ static php_stream_wrapper_ops php_curl_wrapper_ops = {
NULL, /* stream_stat: curl streams know how to stat themselves */
NULL, /* stat url */
NULL, /* opendir */
- NULL, /* label */
+ "cURL", /* label */
NULL, /* unlink */
NULL, /* rename */
NULL, /* mkdir */
diff --git a/ext/date/CREDITS b/ext/date/CREDITS
new file mode 100644
index 000000000..bfcacbe98
--- /dev/null
+++ b/ext/date/CREDITS
@@ -0,0 +1,2 @@
+Date/Time Support
+Derick Rethans
diff --git a/ext/date/TODO b/ext/date/TODO
new file mode 100644
index 000000000..4b1237c4a
--- /dev/null
+++ b/ext/date/TODO
@@ -0,0 +1,6 @@
+- Port over my 200 test cases to .phpt format.
+- Write an error handler for unexpected characters while parsing dates.
+- Cache lookups for timezone information.
+- Optimize parsing @ with a negative timestamp.
+- Make sure that date_default_timezone_set() validates the passed timezone
+ identifier.
diff --git a/ext/date/config.m4 b/ext/date/config.m4
new file mode 100644
index 000000000..c82a3784e
--- /dev/null
+++ b/ext/date/config.m4
@@ -0,0 +1,25 @@
+dnl $Id: config.m4,v 1.10.2.1 2005/10/03 20:21:01 sniper Exp $
+dnl config.m4 for date extension
+
+sinclude(ext/date/lib/timelib.m4)
+sinclude(lib/timelib.m4)
+
+PHP_DATE_CFLAGS="-I@ext_builddir@/lib"
+timelib_sources="lib/dow.c lib/parse_date.c lib/parse_tz.c
+ lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c"
+
+PHP_NEW_EXTENSION(date, php_date.c $timelib_sources, no,, $PHP_DATE_CFLAGS)
+
+PHP_ADD_BUILD_DIR([$ext_builddir/lib], 1)
+PHP_ADD_INCLUDE([$ext_builddir/lib])
+PHP_ADD_INCLUDE([$ext_srcdir/lib])
+
+PHP_INSTALL_HEADERS([ext/date], [php_date.h lib/timelib.h lib/timelib_structs.h lib/timelib_config.h])
+
+cat > $ext_builddir/lib/timelib_config.h <<EOF
+#ifdef PHP_WIN32
+# include "config.w32.h"
+#else
+# include <php_config.h>
+#endif
+EOF
diff --git a/ext/date/config.w32 b/ext/date/config.w32
new file mode 100755
index 000000000..0f7bdd86d
--- /dev/null
+++ b/ext/date/config.w32
@@ -0,0 +1,10 @@
+// $Id: config.w32,v 1.5 2005/06/17 12:03:02 derick Exp $
+// vim:ft=javascript
+
+EXTENSION("date", "php_date.c", false, "-Iext/date/lib");
+ADD_SOURCES("ext/date/lib", "timelib.c dow.c parse_date.c parse_tz.c tm2unixtime.c unixtime2tm.c", "date");
+AC_DEFINE('HAVE_DATE', 1, 'Have date/time support');
+
+var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true);
+tl_config.WriteLine("#include \"config.w32.h\"");
+tl_config.Close();
diff --git a/ext/date/lib/README b/ext/date/lib/README
new file mode 100644
index 000000000..12f09bc5e
--- /dev/null
+++ b/ext/date/lib/README
@@ -0,0 +1,6 @@
+Regenerating Parser
+===================
+
+Make sure you use re2c 0.9.10 or higher:
+
+/dat/dev/sf/re2c/re2c -d -b -o ext/date/lib/parse_date.c ext/date/lib/parse_date.re
diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c
new file mode 100644
index 000000000..51f3267a0
--- /dev/null
+++ b/ext/date/lib/dow.c
@@ -0,0 +1,147 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: dow.c,v 1.8.2.2 2005/09/02 09:33:08 derick Exp $ */
+
+#include "timelib.h"
+
+static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
+static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
+
+static timelib_sll century_value(timelib_sll j)
+{
+ timelib_sll i = j - 17;
+ timelib_sll c = (4 - i * 2 + (i + 1) / 4) % 7;
+
+ return c < 0 ? c + 7 : c;
+}
+
+static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso)
+{
+ timelib_sll c1, y1, m1, dow;
+
+ /* Only valid for Gregorian calendar */
+ if (y < 1753) {
+ return -1;
+ }
+ c1 = century_value(y / 100);
+ y1 = (y % 100);
+ m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m];
+ dow = (c1 + y1 + m1 + (y1 / 4) + d) % 7;
+ if (iso) {
+ if (dow == 0) {
+ dow = 7;
+ }
+ }
+ return dow;
+}
+
+timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d)
+{
+ return timelib_day_of_week_ex(y, m, d, 0);
+}
+
+timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d)
+{
+ return timelib_day_of_week_ex(y, m, d, 1);
+}
+
+ /* jan feb mar apr may jun jul aug sep oct nov dec */
+static int d_table_common[13] = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+static int d_table_leap[13] = { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
+static int ml_table_common[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+static int ml_table_leap[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+
+timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d)
+{
+ return (timelib_is_leap(y) ? d_table_leap[m] : d_table_common[m]) + d - 1;
+}
+
+timelib_sll timelib_days_in_month(timelib_sll y, timelib_sll m)
+{
+ return timelib_is_leap(y) ? ml_table_leap[m] : ml_table_common[m];
+}
+
+void timelib_isoweek_from_date(timelib_sll y, timelib_sll m, timelib_sll d, timelib_sll *iw, timelib_sll *iy)
+{
+ int y_leap, prev_y_leap, doy, jan1weekday, weekday;
+
+ y_leap = timelib_is_leap(y);
+ prev_y_leap = timelib_is_leap(y-1);
+ doy = timelib_day_of_year(y, m, d) + 1;
+ if (y_leap && m > 2) {
+ doy++;
+ }
+ jan1weekday = timelib_day_of_week(y, 1, 1);
+ weekday = timelib_day_of_week(y, m, d);
+ if (weekday == 0) weekday = 7;
+ if (jan1weekday == 0) jan1weekday = 7;
+ /* Find if Y M D falls in YearNumber Y-1, WeekNumber 52 or 53 */
+ if (doy <= (8 - jan1weekday) && jan1weekday > 4) {
+ *iy = y - 1;
+ if (jan1weekday == 5 || (jan1weekday == 6 && prev_y_leap)) {
+ *iw = 53;
+ } else {
+ *iw = 52;
+ }
+ } else {
+ *iy = y;
+ }
+ /* 8. Find if Y M D falls in YearNumber Y+1, WeekNumber 1 */
+ if (*iy == y) {
+ int i;
+
+ i = y_leap ? 366 : 365;
+ if ((i - (doy - y_leap)) < (4 - weekday)) {
+ *iy = y + 1;
+ *iw = 1;
+ return;
+ }
+ }
+ /* 9. Find if Y M D falls in YearNumber Y, WeekNumber 1 through 53 */
+ if (*iy == y) {
+ int j;
+
+ j = doy + (7 - weekday) + (jan1weekday - 1);
+ *iw = j / 7;
+ if (jan1weekday > 4) {
+ *iw -= 1;
+ }
+ }
+}
+
+timelib_sll timelib_daynr_from_weeknr(timelib_sll y, timelib_sll w, timelib_sll d)
+{
+ timelib_sll dow, day;
+
+ /* Figure out the dayofweek for y-1-1 */
+ dow = timelib_day_of_week(y, 1, 1);
+ /* then use that to figure out the offset for day 1 of week 1 */
+ day = 0 - (dow > 4 ? dow - 7 : dow);
+
+ /* Add weeks and days */
+ return day + ((w - 1) * 7) + d;
+}
+
+#if 0
+int main(void)
+{
+ printf("dow = %d\n", timelib_day_of_week(1978, 12, 22)); /* 5 */
+ printf("dow = %d\n", timelib_day_of_week(2005, 2, 19)); /* 6 */
+}
+#endif
diff --git a/ext/date/lib/fallbackmap.h b/ext/date/lib/fallbackmap.h
new file mode 100644
index 000000000..7189eb88e
--- /dev/null
+++ b/ext/date/lib/fallbackmap.h
@@ -0,0 +1,40 @@
+ { "sst", 0, -11, "Pacific/Apia" },
+ { "hst", 0, -10, "Pacific/Honolulu" },
+ { "akst", 0, -9, "America/Anchorage" },
+ { "akdt", 1, -8, "America/Anchorage" },
+ { "pst", 0, -8, "America/Los_Angeles" },
+ { "pdt", 1, -7, "America/Los_Angeles" },
+ { "mst", 0, -7, "America/Denver" },
+ { "mdt", 1, -6, "America/Denver" },
+ { "cst", 0, -6, "America/Chicago" },
+ { "cdt", 1, -5, "America/Chicago" },
+ { "est", 0, -5, "America/New_York" },
+ { "edt", 1, -4, "America/New_York" },
+ { "ast", 0, -4, "America/Halifax" },
+ { "adt", 1, -3, "America/Halifax" },
+ { "brt", 0, -3, "America/Sao_Paulo" },
+ { "brst", 1, -2, "America/Sao_Paulo" },
+ { "azost", 0, -1, "Atlantic/Azores" },
+ { "azodt", 1, 0, "Atlantic/Azores" },
+ { "gmt", 0, 0, "Europe/London" },
+ { "bst", 1, 1, "Europe/London" },
+ { "cet", 0, 1, "Europe/Paris" },
+ { "cest", 1, 2, "Europe/Paris" },
+ { "eet", 0, 2, "Europe/Helsinki" },
+ { "eest", 1, 3, "Europe/Helsinki" },
+ { "msk", 0, 3, "Europe/Moscow" },
+ { "msd", 1, 4, "Europe/Moscow" },
+ { "gst", 0, 4, "Asia/Dubai" },
+ { "pkt", 0, 5, "Asia/Karachi" },
+ { "ist", 0, 5.5, "Asia/Calcutta" },
+ { "npt", 0, 5.75, "Asia/Katmandu" },
+ { "yekt", 1, 6, "Asia/Yekaterinburg" },
+ { "novst", 1, 7, "Asia/Novosibirsk" },
+ { "krat", 0, 7, "Asia/Krasnoyarsk" },
+ { "krast", 1, 8, "Asia/Krasnoyarsk" },
+ { "jst", 0, 9, "Asia/Tokyo" },
+ { "est", 0, 10, "Australia/Melbourne" },
+ { "cst", 1, 10.5, "Australia/Adelaide" },
+ { "est", 1, 11, "Australia/Melbourne" },
+ { "nzst", 0, 12, "Pacific/Auckland" },
+ { "nzdt", 1, 13, "Pacific/Auckland" },
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
new file mode 100644
index 000000000..fe08aaab5
--- /dev/null
+++ b/ext/date/lib/parse_date.c
@@ -0,0 +1,19804 @@
+/* Generated by re2c 0.9.10.dev on Thu Nov 17 13:55:10 2005 */
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: parse_date.c,v 1.29.2.10 2005/11/17 13:04:25 derick Exp $ */
+
+#include "timelib.h"
+
+#include <stdio.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if defined(_MSC_VER)
+# define strtoll(s, f, b) _atoi64(s)
+#elif !defined(HAVE_STRTOLL)
+# if defined(HAVE_ATOLL)
+# define strtoll(s, f, b) atoll(s)
+# else
+# define strtoll(s, f, b) strtol(s, f, b)
+# endif
+#endif
+
+#define TIMELIB_SECOND 1
+#define TIMELIB_MINUTE 2
+#define TIMELIB_HOUR 3
+#define TIMELIB_DAY 4
+#define TIMELIB_MONTH 5
+#define TIMELIB_YEAR 6
+#define TIMELIB_WEEKDAY 7
+
+#define EOI 257
+#define TIME 258
+#define DATE 259
+
+#define TIMELIB_XMLRPC_SOAP 260
+#define TIMELIB_TIME12 261
+#define TIMELIB_TIME24 262
+#define TIMELIB_GNU_NOCOLON 263
+#define TIMELIB_GNU_NOCOLON_TZ 264
+#define TIMELIB_ISO_NOCOLON 265
+
+#define TIMELIB_AMERICAN 266
+#define TIMELIB_ISO_DATE 267
+#define TIMELIB_DATE_FULL 268
+#define TIMELIB_DATE_TEXT 269
+#define TIMELIB_DATE_NOCOLON 270
+#define TIMELIB_PG_YEARDAY 271
+#define TIMELIB_PG_TEXT 272
+#define TIMELIB_PG_REVERSE 273
+#define TIMELIB_CLF 274
+#define TIMELIB_DATE_NO_DAY 275
+#define TIMELIB_SHORTDATE_WITH_TIME 276
+#define TIMELIB_DATE_FULL_POINTED 277
+#define TIMELIB_TIME24_WITH_ZONE 278
+#define TIMELIB_ISO_WEEK 279
+
+#define TIMELIB_TIMEZONE 300
+#define TIMELIB_AGO 301
+
+#define TIMELIB_RELATIVE 310
+
+#define TIMELIB_ERROR 999
+
+typedef unsigned char uchar;
+
+#define BSIZE 8192
+
+#define YYCTYPE uchar
+#define YYCURSOR cursor
+#define YYLIMIT s->lim
+#define YYMARKER s->ptr
+#define YYFILL(n) return EOI;
+
+#define RET(i) {s->cur = cursor; return i;}
+
+#define timelib_string_free free
+
+#define TIMELIB_HAVE_TIME() { if (s->time->have_time) { return TIMELIB_ERROR; } else { s->time->have_time = 1; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } }
+#define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; }
+#define TIMELIB_HAVE_DATE() { if (s->time->have_date) { return TIMELIB_ERROR; } else { s->time->have_date = 1; } }
+#define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y = 0; }
+#define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 0; }
+#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; }
+#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { return TIMELIB_ERROR; } else { s->time.have_zone = 1; } }
+
+#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
+#define TIMELIB_DEINIT timelib_string_free(str)
+#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; }
+
+#define TIMELIB_PROCESS_YEAR(x) { \
+ if ((x) == -1) { \
+ /* (x) = 0; */ \
+ } else if ((x) < 100) { \
+ if ((x) < 70) { \
+ (x) += 2000; \
+ } else { \
+ (x) += 1900; \
+ } \
+ } \
+}
+
+#ifdef DEBUG_PARSER
+#define DEBUG_OUTPUT(s) printf("%s\n", s);
+#define YYDEBUG(s,c) { if (s != -1) { printf("state: %d ", s); printf("[%c]\n", c); } }
+#else
+#define DEBUG_OUTPUT(s)
+#define YYDEBUG(s,c)
+#endif
+
+#include "timelib_structs.h"
+
+typedef struct timelib_elems {
+ unsigned int c; /* Number of elements */
+ char **v; /* Values */
+} timelib_elems;
+
+typedef struct Scanner {
+ int fd;
+ uchar *lim, *str, *ptr, *cur, *tok, *pos;
+ unsigned int line, len;
+ int errors;
+
+ struct timelib_time *time;
+ timelib_tzdb *tzdb;
+} Scanner;
+
+typedef struct _timelib_lookup_table {
+ const char *name;
+ int type;
+ int value;
+} timelib_lookup_table;
+
+typedef struct _timelib_relunit {
+ const char *name;
+ int unit;
+ int multiplier;
+} timelib_relunit;
+
+#define HOUR(a) (int)(a * 60)
+
+/* The timezone table. */
+static timelib_tz_lookup_table timelib_timezone_lookup[] = {
+#include "timezonemap.h"
+ { NULL, 0, 0, NULL },
+};
+
+static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = {
+#include "fallbackmap.h"
+ { NULL, 0, 0, NULL },
+};
+
+static timelib_relunit const timelib_relunit_lookup[] = {
+ { "sec", TIMELIB_SECOND, 1 },
+ { "secs", TIMELIB_SECOND, 1 },
+ { "second", TIMELIB_SECOND, 1 },
+ { "seconds", TIMELIB_SECOND, 1 },
+ { "min", TIMELIB_MINUTE, 1 },
+ { "mins", TIMELIB_MINUTE, 1 },
+ { "minute", TIMELIB_MINUTE, 1 },
+ { "minutes", TIMELIB_MINUTE, 1 },
+ { "hour", TIMELIB_HOUR, 1 },
+ { "hours", TIMELIB_HOUR, 1 },
+ { "day", TIMELIB_DAY, 1 },
+ { "days", TIMELIB_DAY, 1 },
+ { "week", TIMELIB_DAY, 7 },
+ { "weeks", TIMELIB_DAY, 7 },
+ { "fortnight", TIMELIB_DAY, 14 },
+ { "fortnights", TIMELIB_DAY, 14 },
+ { "forthnight", TIMELIB_DAY, 14 },
+ { "forthnights", TIMELIB_DAY, 14 },
+ { "month", TIMELIB_MONTH, 1 },
+ { "months", TIMELIB_MONTH, 1 },
+ { "year", TIMELIB_YEAR, 1 },
+ { "years", TIMELIB_YEAR, 1 },
+
+ { "monday", TIMELIB_WEEKDAY, 1 },
+ { "tuesday", TIMELIB_WEEKDAY, 2 },
+ { "wednesday", TIMELIB_WEEKDAY, 3 },
+ { "thursday", TIMELIB_WEEKDAY, 4 },
+ { "friday", TIMELIB_WEEKDAY, 5 },
+ { "saturday", TIMELIB_WEEKDAY, 6 },
+ { "sunday", TIMELIB_WEEKDAY, 0 },
+
+ { NULL, 0, 0 }
+};
+
+/* The relative text table. */
+static timelib_lookup_table const timelib_reltext_lookup[] = {
+ { "first", 0, 1 },
+ { "next", 0, 1 },
+ { "second", 0, 2 },
+ { "third", 0, 3 },
+ { "fourth", 0, 4 },
+ { "fifth", 0, 5 },
+ { "sixth", 0, 6 },
+ { "seventh", 0, 7 },
+ { "eight", 0, 8 },
+ { "ninth", 0, 9 },
+ { "tenth", 0, 10 },
+ { "eleventh", 0, 11 },
+ { "twelfth", 0, 12 },
+ { "last", 0, -1 },
+ { "previous", 0, -1 },
+ { "this", 1, 0 },
+ { NULL, 1, 0 }
+};
+
+/* The month table. */
+static timelib_lookup_table const timelib_month_lookup[] = {
+ { "jan", 0, 1 },
+ { "feb", 0, 2 },
+ { "mar", 0, 3 },
+ { "apr", 0, 4 },
+ { "may", 0, 5 },
+ { "jun", 0, 6 },
+ { "jul", 0, 7 },
+ { "aug", 0, 8 },
+ { "sep", 0, 9 },
+ { "sept", 0, 9 },
+ { "oct", 0, 10 },
+ { "nov", 0, 11 },
+ { "dec", 0, 12 },
+ { "i", 0, 1 },
+ { "ii", 0, 2 },
+ { "iii", 0, 3 },
+ { "iv", 0, 4 },
+ { "v", 0, 5 },
+ { "vi", 0, 6 },
+ { "vii", 0, 7 },
+ { "viii", 0, 8 },
+ { "ix", 0, 9 },
+ { "x", 0, 10 },
+ { "xi", 0, 11 },
+ { "xii", 0, 12 },
+
+ { "january", 0, 1 },
+ { "february", 0, 2 },
+ { "march", 0, 3 },
+ { "april", 0, 4 },
+ { "may", 0, 5 },
+ { "june", 0, 6 },
+ { "july", 0, 7 },
+ { "august", 0, 8 },
+ { "september", 0, 9 },
+ { "october", 0, 10 },
+ { "november", 0, 11 },
+ { "december", 0, 12 },
+ { NULL, 0, 0 }
+};
+
+#if 0
+static char* timelib_ltrim(char *s)
+{
+ char *ptr = s;
+ while (ptr[0] == ' ') {
+ ptr++;
+ }
+ return ptr;
+}
+#endif
+
+#if 0
+uchar *fill(Scanner *s, uchar *cursor){
+ if(!s->eof){
+ unsigned int cnt = s->tok - s->bot;
+ if(cnt){
+ memcpy(s->bot, s->tok, s->lim - s->tok);
+ s->tok = s->bot;
+ s->ptr -= cnt;
+ cursor -= cnt;
+ s->pos -= cnt;
+ s->lim -= cnt;
+ }
+ if((s->top - s->lim) < BSIZE){
+ uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
+ memcpy(buf, s->tok, s->lim - s->tok);
+ s->tok = buf;
+ s->ptr = &buf[s->ptr - s->bot];
+ cursor = &buf[cursor - s->bot];
+ s->pos = &buf[s->pos - s->bot];
+ s->lim = &buf[s->lim - s->bot];
+ s->top = &s->lim[BSIZE];
+ free(s->bot);
+ s->bot = buf;
+ }
+ if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){
+ s->eof = &s->lim[cnt]; *(s->eof)++ = '\n';
+ }
+ s->lim += cnt;
+ }
+ return cursor;
+}
+#endif
+
+static timelib_sll timelib_meridian(char **ptr, timelib_sll h)
+{
+ timelib_sll retval = 0;
+
+ while (!strchr("AaPp", **ptr)) {
+ ++*ptr;
+ }
+ if (**ptr == 'a' || **ptr == 'A') {
+ if (h == 12) {
+ retval = -12;
+ }
+ } else if (h != 12) {
+ retval = 12;
+ }
+ ++*ptr;
+ if (**ptr == '.') {
+ *ptr += 3;
+ } else {
+ ++*ptr;
+ }
+ return retval;
+}
+
+static char *timelib_string(Scanner *s)
+{
+ char *tmp = calloc(1, s->cur - s->tok + 1);
+ memcpy(tmp, s->tok, s->cur - s->tok);
+
+ return tmp;
+}
+
+static timelib_sll timelib_get_nr(char **ptr, int max_length)
+{
+ char *begin, *end, *str;
+ timelib_sll tmp_nr = -1;
+ int len = 0;
+
+ while ((**ptr < '0') || (**ptr > '9')) {
+ if (**ptr == '\0') {
+ return -1;
+ }
+ ++*ptr;
+ }
+ begin = *ptr;
+ while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) {
+ ++*ptr;
+ ++len;
+ }
+ end = *ptr;
+ str = calloc(1, end - begin + 1);
+ memcpy(str, begin, end - begin);
+ tmp_nr = strtoll(str, NULL, 10);
+ free(str);
+ return tmp_nr;
+}
+
+static double timelib_get_frac_nr(char **ptr, int max_length)
+{
+ char *begin, *end, *str;
+ double tmp_nr = -1;
+ int len = 0;
+
+ while ((**ptr != '.') && ((**ptr < '0') || (**ptr > '9'))) {
+ if (**ptr == '\0') {
+ return -1;
+ }
+ ++*ptr;
+ }
+ begin = *ptr;
+ while (((**ptr == '.') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_length) {
+ ++*ptr;
+ ++len;
+ }
+ end = *ptr;
+ str = calloc(1, end - begin + 1);
+ memcpy(str, begin, end - begin);
+ tmp_nr = strtod(str, NULL);
+ free(str);
+ return tmp_nr;
+}
+
+static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length)
+{
+ timelib_ull dir = 1;
+
+ while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) {
+ if (**ptr == '\0') {
+ return -1;
+ }
+ ++*ptr;
+ }
+ if (**ptr == '+') {
+ ++*ptr;
+ } else if (**ptr == '-') {
+ dir = -1;
+ ++*ptr;
+ }
+ return dir * timelib_get_nr(ptr, max_length);
+}
+
+static long timelib_parse_tz_cor(char **ptr)
+{
+ char *begin = *ptr, *end;
+ long tmp;
+
+ while (**ptr != '\0') {
+ ++*ptr;
+ }
+ end = *ptr;
+ switch (end - begin) {
+ case 1:
+ case 2:
+ return HOUR(strtol(begin, NULL, 10));
+ break;
+ case 3:
+ case 4:
+ tmp = strtol(begin, NULL, 10);
+ return HOUR(tmp / 100) + tmp % 100;
+ case 5:
+ tmp = HOUR(strtol(begin, NULL, 10)) +
+ strtol(begin + 3, NULL, 10);
+ return tmp;
+ }
+ return 0;
+}
+
+static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ timelib_sll value = 0;
+ const timelib_lookup_table *tp;
+
+ while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ for (tp = timelib_reltext_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ value = tp->value;
+ *behavior = tp->type;
+ }
+ }
+
+ free(word);
+ return value;
+}
+
+static timelib_sll timelib_get_relative_text(char **ptr, int *behavior)
+{
+ while (**ptr == ' ' || **ptr == '-' || **ptr == '/') {
+ ++*ptr;
+ }
+ return timelib_lookup_relative_text(ptr, behavior);
+}
+
+static long timelib_lookup_month(char **ptr)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ long value = 0;
+ const timelib_lookup_table *tp;
+
+ while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ for (tp = timelib_month_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ value = tp->value;
+ }
+ }
+
+ free(word);
+ return value;
+}
+
+static long timelib_get_month(char **ptr)
+{
+ while (**ptr == ' ' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
+ ++*ptr;
+ }
+ return timelib_lookup_month(ptr);
+}
+
+static void timelib_eat_spaces(char **ptr)
+{
+ while (**ptr == ' ') {
+ ++*ptr;
+ }
+}
+
+static const timelib_relunit* timelib_lookup_relunit(char **ptr)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ const timelib_relunit *tp, *value = NULL;
+
+ while (**ptr != '\0' && **ptr != ' ') {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ for (tp = timelib_relunit_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ value = tp;
+ break;
+ }
+ }
+
+ free(word);
+ return value;
+}
+
+static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s)
+{
+ const timelib_relunit* relunit;
+
+ relunit = timelib_lookup_relunit(ptr);
+ switch (relunit->unit) {
+ case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
+ case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
+ case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
+ case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
+ case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
+ case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
+
+ case TIMELIB_WEEKDAY:
+ TIMELIB_HAVE_WEEKDAY_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+ s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
+ s->time->relative.weekday = relunit->multiplier;
+ s->time->relative.weekday_behavior = behavior;
+ break;
+ }
+}
+
+static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
+{
+ int first_found = 0;
+ timelib_tz_lookup_table *tp, *first_found_elem;
+ timelib_tz_lookup_table *fmp;
+
+ for (tp = timelib_timezone_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ if (!first_found) {
+ first_found = 1;
+ first_found_elem = tp;
+ if (gmtoffset == -1) {
+ return tp;
+ }
+ }
+ if (tp->gmtoffset == gmtoffset) {
+ return tp;
+ }
+ }
+ }
+ if (first_found) {
+ return first_found_elem;
+ }
+ /* Still didn't find anything, let's find the zone solely based on
+ * offset/isdst then */
+ for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
+ if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) {
+ return fmp;
+ }
+ }
+ return NULL;
+}
+
+static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ long value = 0;
+ timelib_tz_lookup_table *tp;
+
+ while (**ptr != '\0' && **ptr != ')') {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ if ((tp = zone_search(word, -1, 0))) {
+ value = -tp->gmtoffset / 60;
+ *dst = tp->type;
+ value += tp->type * 60;
+ *found = 1;
+ } else {
+ *found = 0;
+ }
+
+ *tz_abbr = word;
+ return value;
+}
+
+static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb)
+{
+ timelib_tzinfo *res;
+ long retval = 0;
+
+ *tz_not_found = 0;
+
+ while (**ptr == ' ' || **ptr == '(') {
+ ++*ptr;
+ }
+ if (**ptr == '+') {
+ ++*ptr;
+ t->is_localtime = 1;
+ t->zone_type = TIMELIB_ZONETYPE_OFFSET;
+ *tz_not_found = 0;
+ t->dst = 0;
+
+ retval = -1 * timelib_parse_tz_cor(ptr);
+ } else if (**ptr == '-') {
+ ++*ptr;
+ t->is_localtime = 1;
+ t->zone_type = TIMELIB_ZONETYPE_OFFSET;
+ *tz_not_found = 0;
+ t->dst = 0;
+
+ retval = timelib_parse_tz_cor(ptr);
+ } else {
+ int found = 0;
+ long offset;
+ char *tz_abbr;
+
+ t->is_localtime = 1;
+ t->zone_type = TIMELIB_ZONETYPE_ABBR;
+
+ offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found);
+#if 0
+ /* If we found a TimeZone identifier, use it */
+ if (tz_name) {
+ t->tz_info = timelib_parse_tzfile(tz_name);
+ t->zone_type = TIMELIB_ZONETYPE_ID;
+ }
+#endif
+ /* If we have a TimeZone identifier to start with, use it */
+ if (strstr(tz_abbr, "/")) {
+ if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) {
+ t->tz_info = res;
+ t->zone_type = TIMELIB_ZONETYPE_ID;
+ found++;
+ }
+ }
+ if (t->zone_type != TIMELIB_ZONETYPE_ID) {
+ timelib_time_tz_abbr_update(t, tz_abbr);
+ }
+ free(tz_abbr);
+ *tz_not_found = (found == 0);
+ retval = offset;
+ }
+ while (**ptr == ')') {
+ ++*ptr;
+ }
+ return retval;
+}
+
+#define timelib_split_free(arg) { \
+ int i; \
+ for (i = 0; i < arg.c; i++) { \
+ free(arg.v[i]); \
+ } \
+ if (arg.v) { \
+ free(arg.v); \
+ } \
+}
+
+static int scan(Scanner *s)
+{
+ uchar *cursor = s->cur;
+ char *str, *ptr = NULL;
+
+std:
+ s->tok = cursor;
+ s->len = 0;
+
+
+{
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 208, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 192, 64, 192, 0,
+ 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 8, 8, 8, 136, 8, 8, 8,
+ 136, 8, 8, 8, 8, 8, 136, 8,
+ 8, 8, 136, 136, 136, 8, 8, 8,
+ 8, 8, 8, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ goto yy0;
+
+ YYDEBUG(1, *YYCURSOR);
+ ++YYCURSOR;
+yy0:
+ if((YYLIMIT - YYCURSOR) < 26) YYFILL(26);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 0x00: case 0x0A: goto yy46;
+ case ' ': case ',': case '.': goto yy44;
+ case '(': goto yy41;
+ case '+': case '-': goto yy40;
+ case '0': goto yy9;
+ case '1': goto yy10;
+ case '2': goto yy11;
+ case '3': goto yy12;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy13;
+ case '@': goto yy7;
+ case 'A': goto yy22;
+ case 'B':
+ case 'C': case 'G':
+ case 'H': case 'K': case 'Q':
+ case 'R': case 'U': case 'Y':
+ case 'Z': goto yy42;
+ case 'D': goto yy29;
+ case 'E': goto yy32;
+ case 'F': goto yy19;
+ case 'I': goto yy14;
+ case 'J': goto yy17;
+ case 'L': goto yy34;
+ case 'M': goto yy21;
+ case 'N': goto yy28;
+ case 'O': goto yy26;
+ case 'P': goto yy36;
+ case 'S': goto yy24;
+ case 'T': goto yy31;
+ case 'V': goto yy15;
+ case 'W': goto yy38;
+ case 'X': goto yy16;
+ case 'a': goto yy23;
+ case 'b':
+ case 'c': case 'g':
+ case 'h':
+ case 'i': case 'k': case 'q':
+ case 'r': case 'u':
+ case 'v': case 'x': case 'z': goto yy43;
+ case 'd': goto yy30;
+ case 'e': goto yy33;
+ case 'f': goto yy20;
+ case 'j': goto yy18;
+ case 'l': goto yy35;
+ case 'm': goto yy5;
+ case 'n': goto yy4;
+ case 'o': goto yy27;
+ case 'p': goto yy37;
+ case 's': goto yy25;
+ case 't': goto yy6;
+ case 'w': goto yy39;
+ case 'y': goto yy2;
+ default: goto yy48;
+ }
+yy2:
+ YYDEBUG(2, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych >= 'A') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'd'){
+ if(yych >= 'a') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'e') goto yy1333;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy3:
+ YYDEBUG(3, *YYCURSOR);
+
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("tzcorrection | tz");
+ TIMELIB_INIT;
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ TIMELIB_DEINIT;
+ return TIMELIB_TIMEZONE;
+ }
+yy4:
+ YYDEBUG(4, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= 'D'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'E') goto yy610;
+ goto yy50;
+ } else {
+ if(yych <= 'I') goto yy611;
+ if(yych <= 'N') goto yy50;
+ goto yy606;
+ }
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy610;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'i') goto yy611;
+ goto yy50;
+ } else {
+ if(yych <= 'o') goto yy1327;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy5:
+ YYDEBUG(5, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy705;
+ if(yych == 'O') goto yy708;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= '`') goto yy3;
+ if(yych <= 'a') goto yy705;
+ if(yych <= 'h') goto yy50;
+ goto yy1321;
+ } else {
+ if(yych == 'o') goto yy708;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy6:
+ YYDEBUG(6, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych <= 'G'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'E') goto yy472;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'U'){
+ if(yych <= 'H') goto yy473;
+ if(yych <= 'T') goto yy50;
+ goto yy474;
+ } else {
+ if(yych == 'W') goto yy475;
+ goto yy50;
+ }
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'e'){
+ if(yych <= '`') goto yy3;
+ if(yych <= 'd') goto yy50;
+ goto yy472;
+ } else {
+ if(yych == 'h') goto yy473;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'o') goto yy1309;
+ if(yych <= 't') goto yy50;
+ goto yy474;
+ } else {
+ if(yych == 'w') goto yy475;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy7:
+ YYDEBUG(7, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '-') goto yy1305;
+ if(yych <= '0') goto yy8;
+ if(yych <= '9') goto yy1306;
+ goto yy8;
+yy8:
+ YYDEBUG(8, *YYCURSOR);
+
+{
+/* printf("unexpected character: #%d, %c ", *s->tok, *s->tok); */
+ s->errors++;
+ goto std;
+ }
+yy9:
+ YYDEBUG(9, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o': case 's':
+ case 't': case 'w': case 'y': goto yy1262;
+ case '-': goto yy789;
+ case '.': goto yy1271;
+ case '/': goto yy788;
+ case '0': goto yy1304;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1303;
+ case ':': goto yy1272;
+ default: goto yy8;
+ }
+yy10:
+ YYDEBUG(10, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O':
+ case 'P': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o':
+ case 'p': case 's':
+ case 't': case 'w': case 'y': goto yy782;
+ case '-': goto yy789;
+ case '.': goto yy792;
+ case '/': goto yy788;
+ case '0':
+ case '1':
+ case '2': goto yy1303;
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1270;
+ case ':': goto yy801;
+ default: goto yy8;
+ }
+yy11:
+ YYDEBUG(11, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O':
+ case 'P': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o':
+ case 'p': case 's':
+ case 't': case 'w': case 'y': goto yy782;
+ case '-': goto yy789;
+ case '.': goto yy792;
+ case '/': goto yy788;
+ case '0':
+ case '1':
+ case '2':
+ case '3': goto yy1270;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1260;
+ case ':': goto yy801;
+ default: goto yy8;
+ }
+yy12:
+ YYDEBUG(12, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O':
+ case 'P': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o':
+ case 'p': case 's':
+ case 't': case 'w': case 'y': goto yy782;
+ case '-': goto yy789;
+ case '.': goto yy792;
+ case '/': goto yy788;
+ case '0':
+ case '1': goto yy1260;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy787;
+ case ':': goto yy801;
+ default: goto yy8;
+ }
+yy13:
+ YYDEBUG(13, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O':
+ case 'P': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o':
+ case 'p': case 's':
+ case 't': case 'w': case 'y': goto yy782;
+ case '-': goto yy789;
+ case '.': goto yy792;
+ case '/': goto yy788;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy787;
+ case ':': goto yy801;
+ default: goto yy8;
+ }
+yy14:
+ YYDEBUG(14, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'W'){
+ if(yych <= 'I') goto yy780;
+ if(yych == 'V') goto yy779;
+ goto yy50;
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= 'X') goto yy779;
+ goto yy50;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy15:
+ YYDEBUG(15, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy50;
+ goto yy777;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy16:
+ YYDEBUG(16, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy50;
+ goto yy775;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy17:
+ YYDEBUG(17, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy758;
+ if(yych <= 'T') goto yy50;
+ goto yy757;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy767;
+ } else {
+ if(yych == 'u') goto yy766;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy18:
+ YYDEBUG(18, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy758;
+ if(yych <= 'T') goto yy50;
+ goto yy757;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy758;
+ } else {
+ if(yych == 'u') goto yy757;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy19:
+ YYDEBUG(19, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy721;
+ }
+ } else {
+ if(yych <= 'N'){
+ if(yych == 'I') goto yy722;
+ goto yy50;
+ } else {
+ if(yych <= 'O') goto yy723;
+ if(yych <= 'Q') goto yy50;
+ goto yy724;
+ }
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'e') goto yy739;
+ if(yych <= 'h') goto yy53;
+ goto yy740;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych == 'o') goto yy741;
+ goto yy53;
+ } else {
+ if(yych <= 'r') goto yy742;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy20:
+ YYDEBUG(20, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy721;
+ }
+ } else {
+ if(yych <= 'N'){
+ if(yych == 'I') goto yy722;
+ goto yy50;
+ } else {
+ if(yych <= 'O') goto yy723;
+ if(yych <= 'Q') goto yy50;
+ goto yy724;
+ }
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'e') goto yy721;
+ if(yych <= 'h') goto yy50;
+ goto yy722;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych == 'o') goto yy723;
+ goto yy50;
+ } else {
+ if(yych <= 'r') goto yy724;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy21:
+ YYDEBUG(21, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy705;
+ if(yych <= 'N') goto yy50;
+ goto yy708;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy706;
+ } else {
+ if(yych == 'o') goto yy707;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy22:
+ YYDEBUG(22, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'F'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'O'){
+ if(yych <= 'G') goto yy688;
+ goto yy50;
+ } else {
+ if(yych <= 'P') goto yy687;
+ if(yych <= 'T') goto yy50;
+ goto yy686;
+ }
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy698;
+ goto yy53;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'p') goto yy697;
+ goto yy53;
+ } else {
+ if(yych <= 'u') goto yy696;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy23:
+ YYDEBUG(23, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'F'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'O'){
+ if(yych <= 'G') goto yy688;
+ goto yy50;
+ } else {
+ if(yych <= 'P') goto yy687;
+ if(yych <= 'T') goto yy50;
+ goto yy686;
+ }
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy688;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'p') goto yy687;
+ goto yy50;
+ } else {
+ if(yych <= 'u') goto yy686;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy24:
+ YYDEBUG(24, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'A') goto yy639;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'E') goto yy638;
+ goto yy50;
+ } else {
+ if(yych <= 'I') goto yy640;
+ if(yych <= 'T') goto yy50;
+ goto yy641;
+ }
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy663;
+ if(yych <= 'd') goto yy53;
+ goto yy662;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych == 'i') goto yy664;
+ goto yy53;
+ } else {
+ if(yych <= 'u') goto yy665;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy25:
+ YYDEBUG(25, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'A') goto yy639;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'E') goto yy638;
+ goto yy50;
+ } else {
+ if(yych <= 'I') goto yy640;
+ if(yych <= 'T') goto yy50;
+ goto yy641;
+ }
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy639;
+ if(yych <= 'd') goto yy50;
+ goto yy638;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych == 'i') goto yy640;
+ goto yy50;
+ } else {
+ if(yych <= 'u') goto yy641;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy26:
+ YYDEBUG(26, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'C'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'B') goto yy50;
+ goto yy628;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'c') goto yy633;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy27:
+ YYDEBUG(27, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'C'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'B') goto yy50;
+ goto yy628;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'c') goto yy628;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy28:
+ YYDEBUG(28, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= 'D'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'E') goto yy610;
+ goto yy50;
+ } else {
+ if(yych <= 'I') goto yy611;
+ if(yych <= 'N') goto yy50;
+ goto yy606;
+ }
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy608;
+ goto yy53;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'i') goto yy609;
+ goto yy53;
+ } else {
+ if(yych <= 'o') goto yy607;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy29:
+ YYDEBUG(29, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy506;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'e') goto yy599;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy30:
+ YYDEBUG(30, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy506;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'e') goto yy506;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy31:
+ YYDEBUG(31, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'W'){
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy472;
+ }
+ } else {
+ if(yych <= 'T'){
+ if(yych == 'H') goto yy473;
+ goto yy50;
+ } else {
+ if(yych <= 'U') goto yy474;
+ if(yych <= 'V') goto yy50;
+ goto yy475;
+ }
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'e') goto yy468;
+ if(yych <= 'g') goto yy53;
+ goto yy469;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych == 'u') goto yy470;
+ goto yy53;
+ } else {
+ if(yych <= 'w') goto yy471;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy32:
+ YYDEBUG(32, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'I') goto yy456;
+ if(yych <= 'K') goto yy50;
+ goto yy457;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'h') goto yy53;
+ goto yy462;
+ } else {
+ if(yych == 'l') goto yy463;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy33:
+ YYDEBUG(33, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'I') goto yy456;
+ if(yych <= 'K') goto yy50;
+ goto yy457;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'h') goto yy50;
+ goto yy456;
+ } else {
+ if(yych == 'l') goto yy457;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy34:
+ YYDEBUG(34, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'A'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy450;
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy453;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy35:
+ YYDEBUG(35, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'A'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy450;
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy450;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy36:
+ YYDEBUG(36, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy50;
+ goto yy170;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'r') goto yy311;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy37:
+ YYDEBUG(37, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy50;
+ goto yy170;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'r') goto yy170;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy38:
+ YYDEBUG(38, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy152;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'e') goto yy162;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy39:
+ YYDEBUG(39, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy152;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'e') goto yy152;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy40:
+ YYDEBUG(40, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy8;
+ if(yych <= '1') goto yy64;
+ if(yych <= '2') goto yy65;
+ if(yych <= '9') goto yy66;
+ goto yy8;
+yy41:
+ YYDEBUG(41, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@') goto yy8;
+ if(yych <= 'Z') goto yy63;
+ if(yych <= '`') goto yy8;
+ if(yych <= 'z') goto yy63;
+ goto yy8;
+yy42:
+ YYDEBUG(42, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+yy43:
+ YYDEBUG(43, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+yy44:
+ YYDEBUG(44, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy45;
+yy45:
+ YYDEBUG(45, *YYCURSOR);
+
+{
+ goto std;
+ }
+yy46:
+ YYDEBUG(46, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy47;
+yy47:
+ YYDEBUG(47, *YYCURSOR);
+
+{
+ s->pos = cursor; s->line++;
+ goto std;
+ }
+yy48:
+ YYDEBUG(48, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy8;
+yy49:
+ YYDEBUG(49, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy3;
+yy50:
+ YYDEBUG(50, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych >= '{') goto yy3;
+ goto yy51;
+ }
+yy51:
+ YYDEBUG(51, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ if(yych >= '{') goto yy3;
+ goto yy52;
+ }
+yy52:
+ YYDEBUG(52, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == ')') goto yy49;
+ goto yy3;
+yy53:
+ YYDEBUG(53, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych == '/') goto yy55;
+ goto yy3;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych >= '{') goto yy3;
+ goto yy54;
+ }
+ }
+yy54:
+ YYDEBUG(54, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych != '/') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy55:
+ YYDEBUG(55, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '@') goto yy56;
+ if(yych <= 'Z') goto yy57;
+ goto yy56;
+yy56:
+ YYDEBUG(56, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 11: goto yy808;
+ case 20: goto yy1275;
+ case 21: goto yy1283;
+ case 12: goto yy953;
+ case 18: goto yy1182;
+ case 8: goto yy568;
+ case 17: goto yy1047;
+ case 6: goto yy513;
+ case 10: goto yy794;
+ case 16: goto yy1080;
+ case 19: goto yy1091;
+ case 15: goto yy1073;
+ case 13: goto yy986;
+ case 14: goto yy1038;
+ case 9: goto yy690;
+ case 5: goto yy193;
+ case 4: goto yy161;
+ case 3: goto yy154;
+ case 1: goto yy3;
+ case 7: goto yy531;
+ case 2: goto yy88;
+ case 0: goto yy8;
+ }
+yy57:
+ YYDEBUG(57, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 8) {
+ goto yy58;
+ }
+ goto yy56;
+yy58:
+ YYDEBUG(58, *YYCURSOR);
+ yyaccept = 1;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy59;
+yy59:
+ YYDEBUG(59, *YYCURSOR);
+ if(yybm[0+yych] & 8) {
+ goto yy58;
+ }
+ if(yych == '/') goto yy55;
+ if(yych == '_') goto yy55;
+ goto yy3;
+yy60:
+ YYDEBUG(60, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych >= '{') goto yy3;
+ goto yy61;
+ }
+ }
+yy61:
+ YYDEBUG(61, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy62;
+yy62:
+ YYDEBUG(62, *YYCURSOR);
+ if(yych <= '^'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+yy63:
+ YYDEBUG(63, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+yy64:
+ YYDEBUG(64, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5': goto yy150;
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy66;
+ case ':': goto yy67;
+ default: goto yy3;
+ }
+yy65:
+ YYDEBUG(65, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3': goto yy150;
+ case '4':
+ case '5': goto yy68;
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case ':': goto yy67;
+ default: goto yy3;
+ }
+yy66:
+ YYDEBUG(66, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5': goto yy68;
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case ':': goto yy67;
+ default: goto yy3;
+ }
+yy67:
+ YYDEBUG(67, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy3;
+ if(yych <= '5') goto yy149;
+ goto yy3;
+yy68:
+ YYDEBUG(68, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy148;
+ goto yy70;
+yy69:
+ YYDEBUG(69, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy70;
+yy70:
+ YYDEBUG(70, *YYCURSOR);
+ if(yybm[0+yych] & 16) {
+ goto yy69;
+ }
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'D': case 'd': goto yy74;
+ case 'F': case 'f': goto yy76;
+ case 'H': case 'h': goto yy73;
+ case 'M': case 'm': goto yy72;
+ case 'S': case 's': goto yy71;
+ case 'T': case 't': goto yy78;
+ case 'W': case 'w': goto yy75;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy71:
+ YYDEBUG(71, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych == 'A') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy136;
+ if(yych <= 'T') goto yy56;
+ goto yy135;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych == 'a') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'e') goto yy136;
+ if(yych == 'u') goto yy135;
+ goto yy56;
+ }
+ }
+yy72:
+ YYDEBUG(72, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'O'){
+ if(yych == 'I') goto yy126;
+ if(yych <= 'N') goto yy56;
+ goto yy125;
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'h') goto yy56;
+ goto yy126;
+ } else {
+ if(yych == 'o') goto yy125;
+ goto yy56;
+ }
+ }
+yy73:
+ YYDEBUG(73, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'O') goto yy123;
+ if(yych == 'o') goto yy123;
+ goto yy56;
+yy74:
+ YYDEBUG(74, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy122;
+ if(yych == 'a') goto yy122;
+ goto yy56;
+yy75:
+ YYDEBUG(75, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy114;
+ if(yych == 'e') goto yy114;
+ goto yy56;
+yy76:
+ YYDEBUG(76, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'R'){
+ if(yych == 'O') goto yy99;
+ if(yych <= 'Q') goto yy56;
+ goto yy98;
+ } else {
+ if(yych <= 'o'){
+ if(yych <= 'n') goto yy56;
+ goto yy99;
+ } else {
+ if(yych == 'r') goto yy98;
+ goto yy56;
+ }
+ }
+yy77:
+ YYDEBUG(77, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy95;
+ if(yych == 'e') goto yy95;
+ goto yy56;
+yy78:
+ YYDEBUG(78, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'H') goto yy81;
+ if(yych <= 'T') goto yy56;
+ goto yy82;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy56;
+ goto yy81;
+ } else {
+ if(yych == 'u') goto yy82;
+ goto yy56;
+ }
+ }
+yy79:
+ YYDEBUG(79, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy80;
+yy80:
+ YYDEBUG(80, *YYCURSOR);
+ if(yybm[0+yych] & 16) {
+ goto yy69;
+ }
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case 'D': case 'd': goto yy74;
+ case 'F': case 'f': goto yy76;
+ case 'H': case 'h': goto yy73;
+ case 'M': case 'm': goto yy72;
+ case 'S': case 's': goto yy71;
+ case 'T': case 't': goto yy78;
+ case 'W': case 'w': goto yy75;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy81:
+ YYDEBUG(81, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy90;
+ if(yych == 'u') goto yy90;
+ goto yy56;
+yy82:
+ YYDEBUG(82, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy83;
+ if(yych != 'e') goto yy56;
+ goto yy83;
+yy83:
+ YYDEBUG(83, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy84;
+ if(yych != 's') goto yy56;
+ goto yy84;
+yy84:
+ YYDEBUG(84, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy85;
+ if(yych != 'd') goto yy56;
+ goto yy85;
+yy85:
+ YYDEBUG(85, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy86;
+ if(yych != 'a') goto yy56;
+ goto yy86;
+yy86:
+ YYDEBUG(86, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych != 'y') goto yy56;
+ goto yy87;
+yy87:
+ YYDEBUG(87, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych == '+') goto yy89;
+ if(yych == '-') goto yy89;
+ goto yy88;
+yy88:
+ YYDEBUG(88, *YYCURSOR);
+
+{
+ timelib_ull i;
+ DEBUG_OUTPUT("relative");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+
+ while(*ptr) {
+ i = timelib_get_unsigned_nr((char **) &ptr, 24);
+ timelib_eat_spaces((char **) &ptr);
+ timelib_set_relative((char **) &ptr, i, 0, s);
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+yy89:
+ YYDEBUG(89, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ goto yy56;
+yy90:
+ YYDEBUG(90, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy91;
+ if(yych != 'r') goto yy56;
+ goto yy91;
+yy91:
+ YYDEBUG(91, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy92;
+ if(yych != 's') goto yy56;
+ goto yy92;
+yy92:
+ YYDEBUG(92, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy93;
+ if(yych != 'd') goto yy56;
+ goto yy93;
+yy93:
+ YYDEBUG(93, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy94;
+ if(yych != 'a') goto yy56;
+ goto yy94;
+yy94:
+ YYDEBUG(94, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy95:
+ YYDEBUG(95, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy96;
+ if(yych != 'a') goto yy56;
+ goto yy96;
+yy96:
+ YYDEBUG(96, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy97;
+ if(yych != 'r') goto yy56;
+ goto yy97;
+yy97:
+ YYDEBUG(97, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= '-'){
+ if(yych == '+') goto yy89;
+ if(yych <= ',') goto yy88;
+ goto yy89;
+ } else {
+ if(yych <= 'S'){
+ if(yych <= 'R') goto yy88;
+ goto yy87;
+ } else {
+ if(yych == 's') goto yy87;
+ goto yy88;
+ }
+ }
+yy98:
+ YYDEBUG(98, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy111;
+ if(yych == 'i') goto yy111;
+ goto yy56;
+yy99:
+ YYDEBUG(99, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy100;
+ if(yych != 'r') goto yy56;
+ goto yy100;
+yy100:
+ YYDEBUG(100, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy101;
+ if(yych != 't') goto yy56;
+ goto yy101;
+yy101:
+ YYDEBUG(101, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'H') goto yy103;
+ if(yych <= 'M') goto yy56;
+ goto yy102;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy56;
+ goto yy103;
+ } else {
+ if(yych != 'n') goto yy56;
+ goto yy102;
+ }
+ }
+yy102:
+ YYDEBUG(102, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy108;
+ if(yych == 'i') goto yy108;
+ goto yy56;
+yy103:
+ YYDEBUG(103, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy104;
+ if(yych != 'n') goto yy56;
+ goto yy104;
+yy104:
+ YYDEBUG(104, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy105;
+ if(yych != 'i') goto yy56;
+ goto yy105;
+yy105:
+ YYDEBUG(105, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy106;
+ if(yych != 'g') goto yy56;
+ goto yy106;
+yy106:
+ YYDEBUG(106, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy107;
+ if(yych != 'h') goto yy56;
+ goto yy107;
+yy107:
+ YYDEBUG(107, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy97;
+ if(yych == 't') goto yy97;
+ goto yy56;
+yy108:
+ YYDEBUG(108, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy109;
+ if(yych != 'g') goto yy56;
+ goto yy109;
+yy109:
+ YYDEBUG(109, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy110;
+ if(yych != 'h') goto yy56;
+ goto yy110;
+yy110:
+ YYDEBUG(110, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy97;
+ if(yych == 't') goto yy97;
+ goto yy56;
+yy111:
+ YYDEBUG(111, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy112;
+ if(yych != 'd') goto yy56;
+ goto yy112;
+yy112:
+ YYDEBUG(112, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy113;
+ if(yych != 'a') goto yy56;
+ goto yy113;
+yy113:
+ YYDEBUG(113, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy114:
+ YYDEBUG(114, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= 'C') goto yy56;
+ if(yych <= 'D') goto yy116;
+ goto yy115;
+ } else {
+ if(yych <= 'c') goto yy56;
+ if(yych <= 'd') goto yy116;
+ if(yych >= 'f') goto yy56;
+ goto yy115;
+ }
+yy115:
+ YYDEBUG(115, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'K') goto yy97;
+ if(yych == 'k') goto yy97;
+ goto yy56;
+yy116:
+ YYDEBUG(116, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy117;
+ if(yych != 'n') goto yy56;
+ goto yy117;
+yy117:
+ YYDEBUG(117, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy118;
+ if(yych != 'e') goto yy56;
+ goto yy118;
+yy118:
+ YYDEBUG(118, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy119;
+ if(yych != 's') goto yy56;
+ goto yy119;
+yy119:
+ YYDEBUG(119, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy120;
+ if(yych != 'd') goto yy56;
+ goto yy120;
+yy120:
+ YYDEBUG(120, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy121;
+ if(yych != 'a') goto yy56;
+ goto yy121;
+yy121:
+ YYDEBUG(121, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy122:
+ YYDEBUG(122, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy97;
+ if(yych == 'y') goto yy97;
+ goto yy56;
+yy123:
+ YYDEBUG(123, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy124;
+ if(yych != 'u') goto yy56;
+ goto yy124;
+yy124:
+ YYDEBUG(124, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy97;
+ if(yych == 'r') goto yy97;
+ goto yy56;
+yy125:
+ YYDEBUG(125, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy130;
+ if(yych == 'n') goto yy130;
+ goto yy56;
+yy126:
+ YYDEBUG(126, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy127;
+ if(yych != 'n') goto yy56;
+ goto yy127;
+yy127:
+ YYDEBUG(127, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'S'){
+ if(yych <= ','){
+ if(yych == '+') goto yy89;
+ goto yy88;
+ } else {
+ if(yych <= '-') goto yy89;
+ if(yych <= 'R') goto yy88;
+ goto yy87;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych != 'U') goto yy88;
+ goto yy128;
+ } else {
+ if(yych <= 's') goto yy87;
+ if(yych != 'u') goto yy88;
+ goto yy128;
+ }
+ }
+yy128:
+ YYDEBUG(128, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy129;
+ if(yych != 't') goto yy56;
+ goto yy129;
+yy129:
+ YYDEBUG(129, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy97;
+ if(yych == 'e') goto yy97;
+ goto yy56;
+yy130:
+ YYDEBUG(130, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'T'){
+ if(yych == 'D') goto yy131;
+ if(yych <= 'S') goto yy56;
+ goto yy132;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy56;
+ goto yy131;
+ } else {
+ if(yych == 't') goto yy132;
+ goto yy56;
+ }
+ }
+yy131:
+ YYDEBUG(131, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy133;
+ if(yych == 'a') goto yy133;
+ goto yy56;
+yy132:
+ YYDEBUG(132, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy97;
+ if(yych == 'h') goto yy97;
+ goto yy56;
+yy133:
+ YYDEBUG(133, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy134:
+ YYDEBUG(134, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy143;
+ if(yych == 't') goto yy143;
+ goto yy56;
+yy135:
+ YYDEBUG(135, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy140;
+ if(yych == 'n') goto yy140;
+ goto yy56;
+yy136:
+ YYDEBUG(136, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'C') goto yy137;
+ if(yych != 'c') goto yy56;
+ goto yy137;
+yy137:
+ YYDEBUG(137, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'O'){
+ if(yych <= ','){
+ if(yych == '+') goto yy89;
+ goto yy88;
+ } else {
+ if(yych <= '-') goto yy89;
+ if(yych <= 'N') goto yy88;
+ goto yy138;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych == 'S') goto yy87;
+ goto yy88;
+ } else {
+ if(yych <= 'o') goto yy138;
+ if(yych == 's') goto yy87;
+ goto yy88;
+ }
+ }
+yy138:
+ YYDEBUG(138, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy139;
+ if(yych != 'n') goto yy56;
+ goto yy139;
+yy139:
+ YYDEBUG(139, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy97;
+ if(yych == 'd') goto yy97;
+ goto yy56;
+yy140:
+ YYDEBUG(140, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy141;
+ if(yych != 'd') goto yy56;
+ goto yy141;
+yy141:
+ YYDEBUG(141, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy142;
+ if(yych != 'a') goto yy56;
+ goto yy142;
+yy142:
+ YYDEBUG(142, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy143:
+ YYDEBUG(143, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy144;
+ if(yych != 'u') goto yy56;
+ goto yy144;
+yy144:
+ YYDEBUG(144, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy145;
+ if(yych != 'r') goto yy56;
+ goto yy145;
+yy145:
+ YYDEBUG(145, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy146;
+ if(yych != 'd') goto yy56;
+ goto yy146;
+yy146:
+ YYDEBUG(146, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy147;
+ if(yych != 'a') goto yy56;
+ goto yy147;
+yy147:
+ YYDEBUG(147, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy148:
+ YYDEBUG(148, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'X'){
+ if(yych <= 'G'){
+ if(yych <= 'C'){
+ if(yych == ' ') goto yy70;
+ goto yy3;
+ } else {
+ if(yych == 'E') goto yy3;
+ if(yych <= 'F') goto yy70;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'R'){
+ if(yych <= 'H') goto yy70;
+ if(yych == 'M') goto yy70;
+ goto yy3;
+ } else {
+ if(yych <= 'T') goto yy70;
+ if(yych == 'W') goto yy70;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'e'){
+ if(yych <= 'Y') goto yy70;
+ if(yych == 'd') goto yy70;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy3;
+ if(yych <= 'h') goto yy70;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych <= 'm') goto yy70;
+ if(yych <= 'r') goto yy3;
+ if(yych <= 't') goto yy70;
+ goto yy3;
+ } else {
+ if(yych == 'x') goto yy3;
+ if(yych <= 'y') goto yy70;
+ goto yy3;
+ }
+ }
+ }
+yy149:
+ YYDEBUG(149, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy49;
+ goto yy56;
+yy150:
+ YYDEBUG(150, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5': goto yy151;
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy148;
+ case ':': goto yy67;
+ default: goto yy3;
+ }
+yy151:
+ YYDEBUG(151, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy148;
+ default: goto yy3;
+ }
+yy152:
+ YYDEBUG(152, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'C') goto yy51;
+ goto yy153;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'd') goto yy153;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy153:
+ YYDEBUG(153, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= 'N'){
+ if(yych <= ')'){
+ if(yych >= ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'M') goto yy52;
+ goto yy155;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy52;
+ if(yych >= 'a') goto yy52;
+ goto yy154;
+ } else {
+ if(yych <= 'n') goto yy155;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy154:
+ YYDEBUG(154, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("dayabbr");
+ goto std;
+ }
+yy155:
+ YYDEBUG(155, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'E') goto yy156;
+ if(yych != 'e') goto yy3;
+ goto yy156;
+ }
+yy156:
+ YYDEBUG(156, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy157;
+ if(yych != 's') goto yy56;
+ goto yy157;
+yy157:
+ YYDEBUG(157, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy158;
+ if(yych != 'd') goto yy56;
+ goto yy158;
+yy158:
+ YYDEBUG(158, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy159;
+ if(yych != 'a') goto yy56;
+ goto yy159;
+yy159:
+ YYDEBUG(159, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych != 'y') goto yy56;
+ goto yy160;
+yy160:
+ YYDEBUG(160, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy161;
+yy161:
+ YYDEBUG(161, *YYCURSOR);
+
+{
+ const timelib_relunit* relunit;
+ DEBUG_OUTPUT("dayfull");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_HAVE_WEEKDAY_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+
+ relunit = timelib_lookup_relunit((char**) &ptr);
+ s->time->relative.weekday = relunit->multiplier;
+ s->time->relative.weekday_behavior = 1;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+yy162:
+ YYDEBUG(162, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'C') goto yy51;
+ goto yy153;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'd') goto yy163;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy163:
+ YYDEBUG(163, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'M') goto yy52;
+ goto yy155;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'n') goto yy164;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy164:
+ YYDEBUG(164, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'D') goto yy3;
+ goto yy156;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy165;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy165:
+ YYDEBUG(165, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy157;
+ if(yych != 's') goto yy62;
+ goto yy166;
+yy166:
+ YYDEBUG(166, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy158;
+ if(yych != 'd') goto yy62;
+ goto yy167;
+yy167:
+ YYDEBUG(167, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy159;
+ if(yych != 'a') goto yy62;
+ goto yy168;
+yy168:
+ YYDEBUG(168, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych != 'y') goto yy62;
+ goto yy169;
+yy169:
+ YYDEBUG(169, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '^'){
+ if(yych == '/') goto yy55;
+ goto yy161;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy161;
+ if(yych <= 'z') goto yy61;
+ goto yy161;
+ }
+yy170:
+ YYDEBUG(170, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy171;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'e') goto yy171;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy171:
+ YYDEBUG(171, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy52;
+ goto yy172;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'v') goto yy172;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy172:
+ YYDEBUG(172, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'I') goto yy173;
+ if(yych != 'i') goto yy3;
+ goto yy173;
+ }
+yy173:
+ YYDEBUG(173, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'O') goto yy174;
+ if(yych != 'o') goto yy56;
+ goto yy174;
+yy174:
+ YYDEBUG(174, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy175;
+ if(yych != 'u') goto yy56;
+ goto yy175;
+yy175:
+ YYDEBUG(175, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy176;
+ if(yych != 's') goto yy56;
+ goto yy176;
+yy176:
+ YYDEBUG(176, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy177;
+yy177:
+ YYDEBUG(177, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy176;
+ case 'D': case 'd': goto yy181;
+ case 'F': case 'f': goto yy183;
+ case 'H': case 'h': goto yy180;
+ case 'M': case 'm': goto yy179;
+ case 'S': case 's': goto yy178;
+ case 'T': case 't': goto yy185;
+ case 'W': case 'w': goto yy182;
+ case 'Y': case 'y': goto yy184;
+ default: goto yy56;
+ }
+yy178:
+ YYDEBUG(178, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych == 'A') goto yy297;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy299;
+ if(yych <= 'T') goto yy56;
+ goto yy298;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych == 'a') goto yy297;
+ goto yy56;
+ } else {
+ if(yych <= 'e') goto yy299;
+ if(yych == 'u') goto yy298;
+ goto yy56;
+ }
+ }
+yy179:
+ YYDEBUG(179, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'O'){
+ if(yych == 'I') goto yy289;
+ if(yych <= 'N') goto yy56;
+ goto yy288;
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'h') goto yy56;
+ goto yy289;
+ } else {
+ if(yych == 'o') goto yy288;
+ goto yy56;
+ }
+ }
+yy180:
+ YYDEBUG(180, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'O') goto yy286;
+ if(yych == 'o') goto yy286;
+ goto yy56;
+yy181:
+ YYDEBUG(181, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy285;
+ if(yych == 'a') goto yy285;
+ goto yy56;
+yy182:
+ YYDEBUG(182, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy277;
+ if(yych == 'e') goto yy277;
+ goto yy56;
+yy183:
+ YYDEBUG(183, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'R'){
+ if(yych == 'O') goto yy262;
+ if(yych <= 'Q') goto yy56;
+ goto yy261;
+ } else {
+ if(yych <= 'o'){
+ if(yych <= 'n') goto yy56;
+ goto yy262;
+ } else {
+ if(yych == 'r') goto yy261;
+ goto yy56;
+ }
+ }
+yy184:
+ YYDEBUG(184, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy256;
+ if(yych == 'e') goto yy256;
+ goto yy56;
+yy185:
+ YYDEBUG(185, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'H') goto yy186;
+ if(yych <= 'T') goto yy56;
+ goto yy187;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy56;
+ goto yy186;
+ } else {
+ if(yych == 'u') goto yy187;
+ goto yy56;
+ }
+ }
+yy186:
+ YYDEBUG(186, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy251;
+ if(yych == 'u') goto yy251;
+ goto yy56;
+yy187:
+ YYDEBUG(187, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy188;
+ if(yych != 'e') goto yy56;
+ goto yy188;
+yy188:
+ YYDEBUG(188, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy189;
+ if(yych != 's') goto yy56;
+ goto yy189;
+yy189:
+ YYDEBUG(189, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy190;
+ if(yych != 'd') goto yy56;
+ goto yy190;
+yy190:
+ YYDEBUG(190, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy191;
+ if(yych != 'a') goto yy56;
+ goto yy191;
+yy191:
+ YYDEBUG(191, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych != 'y') goto yy56;
+ goto yy192;
+yy192:
+ YYDEBUG(192, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy198;
+ case 'F': case 'f': goto yy194;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy196;
+ case 'T': case 't': goto yy197;
+ default: goto yy193;
+ }
+yy193:
+ YYDEBUG(193, *YYCURSOR);
+
+{
+ timelib_sll i;
+ int behavior;
+ DEBUG_OUTPUT("relativetext");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+
+ while(*ptr) {
+ i = timelib_get_relative_text((char **) &ptr, &behavior);
+ timelib_eat_spaces((char **) &ptr);
+ timelib_set_relative((char **) &ptr, i, behavior, s);
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+yy194:
+ YYDEBUG(194, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'O'){
+ if(yych == 'I') goto yy242;
+ if(yych <= 'N') goto yy56;
+ goto yy243;
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'h') goto yy56;
+ goto yy242;
+ } else {
+ if(yych == 'o') goto yy243;
+ goto yy56;
+ }
+ }
+yy195:
+ YYDEBUG(195, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'I'){
+ if(yych == 'E') goto yy238;
+ if(yych <= 'H') goto yy56;
+ goto yy237;
+ } else {
+ if(yych <= 'e'){
+ if(yych <= 'd') goto yy56;
+ goto yy238;
+ } else {
+ if(yych == 'i') goto yy237;
+ goto yy56;
+ }
+ }
+yy196:
+ YYDEBUG(196, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'I'){
+ if(yych == 'E') goto yy226;
+ if(yych <= 'H') goto yy56;
+ goto yy227;
+ } else {
+ if(yych <= 'e'){
+ if(yych <= 'd') goto yy56;
+ goto yy226;
+ } else {
+ if(yych == 'i') goto yy227;
+ goto yy56;
+ }
+ }
+yy197:
+ YYDEBUG(197, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'W'){
+ if(yych <= 'G'){
+ if(yych == 'E') goto yy217;
+ goto yy56;
+ } else {
+ if(yych <= 'H') goto yy215;
+ if(yych <= 'V') goto yy56;
+ goto yy216;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych == 'e') goto yy217;
+ goto yy56;
+ } else {
+ if(yych <= 'h') goto yy215;
+ if(yych == 'w') goto yy216;
+ goto yy56;
+ }
+ }
+yy198:
+ YYDEBUG(198, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'L'){
+ if(yych == 'I') goto yy207;
+ if(yych <= 'K') goto yy56;
+ goto yy206;
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'h') goto yy56;
+ goto yy207;
+ } else {
+ if(yych == 'l') goto yy206;
+ goto yy56;
+ }
+ }
+yy199:
+ YYDEBUG(199, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy204;
+ if(yych == 'a') goto yy204;
+ goto yy56;
+yy200:
+ YYDEBUG(200, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy201;
+ if(yych != 'r') goto yy56;
+ goto yy201;
+yy201:
+ YYDEBUG(201, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy202;
+ if(yych != 'e') goto yy56;
+ goto yy202;
+yy202:
+ YYDEBUG(202, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'V') goto yy203;
+ if(yych != 'v') goto yy56;
+ goto yy203;
+yy203:
+ YYDEBUG(203, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy173;
+ if(yych == 'i') goto yy173;
+ goto yy56;
+yy204:
+ YYDEBUG(204, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy205;
+ if(yych != 's') goto yy56;
+ goto yy205;
+yy205:
+ YYDEBUG(205, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy56;
+yy206:
+ YYDEBUG(206, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy210;
+ if(yych == 'e') goto yy210;
+ goto yy56;
+yy207:
+ YYDEBUG(207, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy208;
+ if(yych != 'g') goto yy56;
+ goto yy208;
+yy208:
+ YYDEBUG(208, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy209;
+ if(yych != 'h') goto yy56;
+ goto yy209;
+yy209:
+ YYDEBUG(209, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy56;
+yy210:
+ YYDEBUG(210, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'V') goto yy211;
+ if(yych != 'v') goto yy56;
+ goto yy211;
+yy211:
+ YYDEBUG(211, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy212;
+ if(yych != 'e') goto yy56;
+ goto yy212;
+yy212:
+ YYDEBUG(212, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy213;
+ if(yych != 'n') goto yy56;
+ goto yy213;
+yy213:
+ YYDEBUG(213, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy214;
+ if(yych != 't') goto yy56;
+ goto yy214;
+yy214:
+ YYDEBUG(214, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy215:
+ YYDEBUG(215, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy224;
+ if(yych == 'i') goto yy224;
+ goto yy56;
+yy216:
+ YYDEBUG(216, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy220;
+ if(yych == 'e') goto yy220;
+ goto yy56;
+yy217:
+ YYDEBUG(217, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy218;
+ if(yych != 'n') goto yy56;
+ goto yy218;
+yy218:
+ YYDEBUG(218, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy219;
+ if(yych != 't') goto yy56;
+ goto yy219;
+yy219:
+ YYDEBUG(219, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy220:
+ YYDEBUG(220, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'L') goto yy221;
+ if(yych != 'l') goto yy56;
+ goto yy221;
+yy221:
+ YYDEBUG(221, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'F') goto yy222;
+ if(yych != 'f') goto yy56;
+ goto yy222;
+yy222:
+ YYDEBUG(222, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy223;
+ if(yych != 't') goto yy56;
+ goto yy223;
+yy223:
+ YYDEBUG(223, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy224:
+ YYDEBUG(224, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= 'Q') goto yy56;
+ if(yych >= 'S') goto yy176;
+ goto yy225;
+ } else {
+ if(yych <= 'q') goto yy56;
+ if(yych <= 'r') goto yy225;
+ if(yych <= 's') goto yy176;
+ goto yy56;
+ }
+yy225:
+ YYDEBUG(225, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy176;
+ if(yych == 'd') goto yy176;
+ goto yy56;
+yy226:
+ YYDEBUG(226, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'V'){
+ if(yych == 'C') goto yy230;
+ if(yych <= 'U') goto yy56;
+ goto yy231;
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'b') goto yy56;
+ goto yy230;
+ } else {
+ if(yych == 'v') goto yy231;
+ goto yy56;
+ }
+ }
+yy227:
+ YYDEBUG(227, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'X') goto yy228;
+ if(yych != 'x') goto yy56;
+ goto yy228;
+yy228:
+ YYDEBUG(228, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy229;
+ if(yych != 't') goto yy56;
+ goto yy229;
+yy229:
+ YYDEBUG(229, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy230:
+ YYDEBUG(230, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'O') goto yy235;
+ if(yych == 'o') goto yy235;
+ goto yy56;
+yy231:
+ YYDEBUG(231, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy232;
+ if(yych != 'e') goto yy56;
+ goto yy232;
+yy232:
+ YYDEBUG(232, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy233;
+ if(yych != 'n') goto yy56;
+ goto yy233;
+yy233:
+ YYDEBUG(233, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy234;
+ if(yych != 't') goto yy56;
+ goto yy234;
+yy234:
+ YYDEBUG(234, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy235:
+ YYDEBUG(235, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy236;
+ if(yych != 'n') goto yy56;
+ goto yy236;
+yy236:
+ YYDEBUG(236, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy176;
+ if(yych == 'd') goto yy176;
+ goto yy56;
+yy237:
+ YYDEBUG(237, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy240;
+ if(yych == 'n') goto yy240;
+ goto yy56;
+yy238:
+ YYDEBUG(238, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'X') goto yy239;
+ if(yych != 'x') goto yy56;
+ goto yy239;
+yy239:
+ YYDEBUG(239, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy56;
+yy240:
+ YYDEBUG(240, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy241;
+ if(yych != 't') goto yy56;
+ goto yy241;
+yy241:
+ YYDEBUG(241, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy242:
+ YYDEBUG(242, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'R'){
+ if(yych == 'F') goto yy248;
+ if(yych <= 'Q') goto yy56;
+ goto yy247;
+ } else {
+ if(yych <= 'f'){
+ if(yych <= 'e') goto yy56;
+ goto yy248;
+ } else {
+ if(yych == 'r') goto yy247;
+ goto yy56;
+ }
+ }
+yy243:
+ YYDEBUG(243, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy244;
+ if(yych != 'u') goto yy56;
+ goto yy244;
+yy244:
+ YYDEBUG(244, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy245;
+ if(yych != 'r') goto yy56;
+ goto yy245;
+yy245:
+ YYDEBUG(245, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy246;
+ if(yych != 't') goto yy56;
+ goto yy246;
+yy246:
+ YYDEBUG(246, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy247:
+ YYDEBUG(247, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy250;
+ if(yych == 's') goto yy250;
+ goto yy56;
+yy248:
+ YYDEBUG(248, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy249;
+ if(yych != 't') goto yy56;
+ goto yy249;
+yy249:
+ YYDEBUG(249, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy250:
+ YYDEBUG(250, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy56;
+yy251:
+ YYDEBUG(251, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy252;
+ if(yych != 'r') goto yy56;
+ goto yy252;
+yy252:
+ YYDEBUG(252, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy253;
+ if(yych != 's') goto yy56;
+ goto yy253;
+yy253:
+ YYDEBUG(253, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy254;
+ if(yych != 'd') goto yy56;
+ goto yy254;
+yy254:
+ YYDEBUG(254, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy255;
+ if(yych != 'a') goto yy56;
+ goto yy255;
+yy255:
+ YYDEBUG(255, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy256:
+ YYDEBUG(256, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy257;
+ if(yych != 'a') goto yy56;
+ goto yy257;
+yy257:
+ YYDEBUG(257, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy258;
+ if(yych != 'r') goto yy56;
+ goto yy258;
+yy258:
+ YYDEBUG(258, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy198;
+ case 'F': case 'f': goto yy194;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy259;
+ case 'T': case 't': goto yy197;
+ default: goto yy193;
+ }
+yy259:
+ YYDEBUG(259, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy260;
+ case 'F': case 'f': goto yy194;
+ case 'I': case 'i': goto yy227;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy196;
+ case 'T': case 't': goto yy197;
+ default: goto yy193;
+ }
+yy260:
+ YYDEBUG(260, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= 'I'){
+ if(yych == 'C') goto yy230;
+ if(yych <= 'H') goto yy56;
+ goto yy207;
+ } else {
+ if(yych == 'L') goto yy206;
+ if(yych <= 'U') goto yy56;
+ goto yy231;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych == 'c') goto yy230;
+ if(yych <= 'h') goto yy56;
+ goto yy207;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy206;
+ } else {
+ if(yych == 'v') goto yy231;
+ goto yy56;
+ }
+ }
+ }
+yy261:
+ YYDEBUG(261, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy274;
+ if(yych == 'i') goto yy274;
+ goto yy56;
+yy262:
+ YYDEBUG(262, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy263;
+ if(yych != 'r') goto yy56;
+ goto yy263;
+yy263:
+ YYDEBUG(263, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy264;
+ if(yych != 't') goto yy56;
+ goto yy264;
+yy264:
+ YYDEBUG(264, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'H') goto yy266;
+ if(yych <= 'M') goto yy56;
+ goto yy265;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy56;
+ goto yy266;
+ } else {
+ if(yych != 'n') goto yy56;
+ goto yy265;
+ }
+ }
+yy265:
+ YYDEBUG(265, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy271;
+ if(yych == 'i') goto yy271;
+ goto yy56;
+yy266:
+ YYDEBUG(266, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy267;
+ if(yych != 'n') goto yy56;
+ goto yy267;
+yy267:
+ YYDEBUG(267, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy268;
+ if(yych != 'i') goto yy56;
+ goto yy268;
+yy268:
+ YYDEBUG(268, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy269;
+ if(yych != 'g') goto yy56;
+ goto yy269;
+yy269:
+ YYDEBUG(269, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy270;
+ if(yych != 'h') goto yy56;
+ goto yy270;
+yy270:
+ YYDEBUG(270, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy258;
+ if(yych == 't') goto yy258;
+ goto yy56;
+yy271:
+ YYDEBUG(271, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy272;
+ if(yych != 'g') goto yy56;
+ goto yy272;
+yy272:
+ YYDEBUG(272, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy273;
+ if(yych != 'h') goto yy56;
+ goto yy273;
+yy273:
+ YYDEBUG(273, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy258;
+ if(yych == 't') goto yy258;
+ goto yy56;
+yy274:
+ YYDEBUG(274, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy275;
+ if(yych != 'd') goto yy56;
+ goto yy275;
+yy275:
+ YYDEBUG(275, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy276;
+ if(yych != 'a') goto yy56;
+ goto yy276;
+yy276:
+ YYDEBUG(276, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy277:
+ YYDEBUG(277, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= 'C') goto yy56;
+ if(yych <= 'D') goto yy279;
+ goto yy278;
+ } else {
+ if(yych <= 'c') goto yy56;
+ if(yych <= 'd') goto yy279;
+ if(yych >= 'f') goto yy56;
+ goto yy278;
+ }
+yy278:
+ YYDEBUG(278, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'K') goto yy258;
+ if(yych == 'k') goto yy258;
+ goto yy56;
+yy279:
+ YYDEBUG(279, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy280;
+ if(yych != 'n') goto yy56;
+ goto yy280;
+yy280:
+ YYDEBUG(280, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy281;
+ if(yych != 'e') goto yy56;
+ goto yy281;
+yy281:
+ YYDEBUG(281, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy282;
+ if(yych != 's') goto yy56;
+ goto yy282;
+yy282:
+ YYDEBUG(282, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy283;
+ if(yych != 'd') goto yy56;
+ goto yy283;
+yy283:
+ YYDEBUG(283, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy284;
+ if(yych != 'a') goto yy56;
+ goto yy284;
+yy284:
+ YYDEBUG(284, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy285:
+ YYDEBUG(285, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy258;
+ if(yych == 'y') goto yy258;
+ goto yy56;
+yy286:
+ YYDEBUG(286, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy287;
+ if(yych != 'u') goto yy56;
+ goto yy287;
+yy287:
+ YYDEBUG(287, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy258;
+ if(yych == 'r') goto yy258;
+ goto yy56;
+yy288:
+ YYDEBUG(288, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy293;
+ if(yych == 'n') goto yy293;
+ goto yy56;
+yy289:
+ YYDEBUG(289, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy290;
+ if(yych != 'n') goto yy56;
+ goto yy290;
+yy290:
+ YYDEBUG(290, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy198;
+ case 'F': case 'f': goto yy194;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy259;
+ case 'T': case 't': goto yy197;
+ case 'U': case 'u': goto yy291;
+ default: goto yy193;
+ }
+yy291:
+ YYDEBUG(291, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy292;
+ if(yych != 't') goto yy56;
+ goto yy292;
+yy292:
+ YYDEBUG(292, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy258;
+ if(yych == 'e') goto yy258;
+ goto yy56;
+yy293:
+ YYDEBUG(293, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'T'){
+ if(yych == 'D') goto yy294;
+ if(yych <= 'S') goto yy56;
+ goto yy295;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy56;
+ goto yy294;
+ } else {
+ if(yych == 't') goto yy295;
+ goto yy56;
+ }
+ }
+yy294:
+ YYDEBUG(294, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy296;
+ if(yych == 'a') goto yy296;
+ goto yy56;
+yy295:
+ YYDEBUG(295, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy258;
+ if(yych == 'h') goto yy258;
+ goto yy56;
+yy296:
+ YYDEBUG(296, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy297:
+ YYDEBUG(297, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy306;
+ if(yych == 't') goto yy306;
+ goto yy56;
+yy298:
+ YYDEBUG(298, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy303;
+ if(yych == 'n') goto yy303;
+ goto yy56;
+yy299:
+ YYDEBUG(299, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'C') goto yy300;
+ if(yych != 'c') goto yy56;
+ goto yy300;
+yy300:
+ YYDEBUG(300, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy198;
+ case 'F': case 'f': goto yy194;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'O': case 'o': goto yy301;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy259;
+ case 'T': case 't': goto yy197;
+ default: goto yy193;
+ }
+yy301:
+ YYDEBUG(301, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy302;
+ if(yych != 'n') goto yy56;
+ goto yy302;
+yy302:
+ YYDEBUG(302, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy258;
+ if(yych == 'd') goto yy258;
+ goto yy56;
+yy303:
+ YYDEBUG(303, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy304;
+ if(yych != 'd') goto yy56;
+ goto yy304;
+yy304:
+ YYDEBUG(304, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy305;
+ if(yych != 'a') goto yy56;
+ goto yy305;
+yy305:
+ YYDEBUG(305, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy306:
+ YYDEBUG(306, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy307;
+ if(yych != 'u') goto yy56;
+ goto yy307;
+yy307:
+ YYDEBUG(307, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy308;
+ if(yych != 'r') goto yy56;
+ goto yy308;
+yy308:
+ YYDEBUG(308, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy309;
+ if(yych != 'd') goto yy56;
+ goto yy309;
+yy309:
+ YYDEBUG(309, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy310;
+ if(yych != 'a') goto yy56;
+ goto yy310;
+yy310:
+ YYDEBUG(310, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy311:
+ YYDEBUG(311, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy171;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy312;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy312:
+ YYDEBUG(312, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'V'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy52;
+ goto yy172;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'v') goto yy313;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy313:
+ YYDEBUG(313, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'I'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'H') goto yy3;
+ goto yy173;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'i') goto yy314;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy314:
+ YYDEBUG(314, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'O') goto yy174;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'o') goto yy315;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy315:
+ YYDEBUG(315, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy175;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy316;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy316:
+ YYDEBUG(316, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy317:
+ YYDEBUG(317, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy176;
+ case '/': case '_': goto yy55;
+ case 'D': goto yy181;
+ case 'F': goto yy183;
+ case 'H': goto yy180;
+ case 'M': goto yy179;
+ case 'S': goto yy178;
+ case 'T': goto yy185;
+ case 'W': goto yy182;
+ case 'Y': goto yy184;
+ 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 yy61;
+ case 'd': goto yy321;
+ case 'f': goto yy323;
+ case 'h': goto yy320;
+ case 'm': goto yy319;
+ case 's': goto yy318;
+ case 't': goto yy325;
+ case 'w': goto yy322;
+ case 'y': goto yy324;
+ default: goto yy56;
+ }
+yy318:
+ YYDEBUG(318, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'A'){
+ if(yych == '/') goto yy55;
+ if(yych <= '@') goto yy56;
+ goto yy297;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy56;
+ goto yy299;
+ } else {
+ if(yych == 'U') goto yy298;
+ goto yy56;
+ }
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'a') goto yy436;
+ goto yy61;
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'e') goto yy437;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy438;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+ }
+yy319:
+ YYDEBUG(319, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'H'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy289;
+ if(yych == 'O') goto yy288;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'h') goto yy61;
+ goto yy427;
+ } else {
+ if(yych == 'o') goto yy428;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy320:
+ YYDEBUG(320, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'O') goto yy286;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'o') goto yy425;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy321:
+ YYDEBUG(321, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy285;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy424;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy322:
+ YYDEBUG(322, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy277;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy416;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy323:
+ YYDEBUG(323, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'N'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'O') goto yy262;
+ if(yych == 'R') goto yy261;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'n') goto yy61;
+ goto yy400;
+ } else {
+ if(yych == 'r') goto yy401;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy324:
+ YYDEBUG(324, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy256;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy395;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy325:
+ YYDEBUG(325, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'G'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'H') goto yy186;
+ if(yych == 'U') goto yy187;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'g') goto yy61;
+ goto yy326;
+ } else {
+ if(yych == 'u') goto yy327;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy326:
+ YYDEBUG(326, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy251;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy390;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy327:
+ YYDEBUG(327, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy188;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy328;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy328:
+ YYDEBUG(328, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy189;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy329;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy329:
+ YYDEBUG(329, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy190;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy330;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy330:
+ YYDEBUG(330, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy191;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy331;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy331:
+ YYDEBUG(331, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy332:
+ YYDEBUG(332, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy198;
+ case 'F': goto yy194;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'P': goto yy200;
+ case 'S': goto yy196;
+ case 'T': goto yy197;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k': case 'm': case 'o': case 'q':
+ case 'r': case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy333;
+ case 'f': goto yy334;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'p': goto yy337;
+ case 's': goto yy338;
+ case 't': goto yy339;
+ default: goto yy193;
+ }
+yy333:
+ YYDEBUG(333, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'H'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy207;
+ if(yych == 'L') goto yy206;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'h') goto yy61;
+ goto yy382;
+ } else {
+ if(yych == 'l') goto yy381;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy334:
+ YYDEBUG(334, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'H'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy242;
+ if(yych == 'O') goto yy243;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'h') goto yy61;
+ goto yy372;
+ } else {
+ if(yych == 'o') goto yy373;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy335:
+ YYDEBUG(335, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy204;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy370;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy336:
+ YYDEBUG(336, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'D'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy238;
+ if(yych == 'I') goto yy237;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'd') goto yy61;
+ goto yy366;
+ } else {
+ if(yych == 'i') goto yy365;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy337:
+ YYDEBUG(337, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy201;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy362;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy338:
+ YYDEBUG(338, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'D'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy226;
+ if(yych == 'I') goto yy227;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'd') goto yy61;
+ goto yy351;
+ } else {
+ if(yych == 'i') goto yy352;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy339:
+ YYDEBUG(339, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'E'){
+ if(yych == '/') goto yy55;
+ if(yych <= 'D') goto yy56;
+ goto yy217;
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'G') goto yy56;
+ goto yy215;
+ } else {
+ if(yych == 'W') goto yy216;
+ goto yy56;
+ }
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych == 'e') goto yy342;
+ goto yy61;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych >= 'i') goto yy61;
+ goto yy340;
+ } else {
+ if(yych <= 'w') goto yy341;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+ }
+yy340:
+ YYDEBUG(340, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy224;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy349;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy341:
+ YYDEBUG(341, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy220;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy345;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy342:
+ YYDEBUG(342, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy218;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy343;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy343:
+ YYDEBUG(343, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy219;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy344;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy344:
+ YYDEBUG(344, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy345:
+ YYDEBUG(345, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'L') goto yy221;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'k'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'l') goto yy346;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy346:
+ YYDEBUG(346, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'F') goto yy222;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'f') goto yy347;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy347:
+ YYDEBUG(347, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy223;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy348;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy348:
+ YYDEBUG(348, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy349:
+ YYDEBUG(349, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'Q'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'R') goto yy225;
+ if(yych <= 'S') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy350;
+ if(yych <= 's') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy350:
+ YYDEBUG(350, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy351:
+ YYDEBUG(351, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'B'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'C') goto yy230;
+ if(yych == 'V') goto yy231;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'b') goto yy61;
+ goto yy355;
+ } else {
+ if(yych == 'v') goto yy356;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy352:
+ YYDEBUG(352, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'X') goto yy228;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'w'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'x') goto yy353;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy353:
+ YYDEBUG(353, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy229;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy354;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy354:
+ YYDEBUG(354, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy355:
+ YYDEBUG(355, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'O') goto yy235;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'o') goto yy360;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy356:
+ YYDEBUG(356, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy232;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy357;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy357:
+ YYDEBUG(357, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy233;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy358;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy358:
+ YYDEBUG(358, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy234;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy359;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy359:
+ YYDEBUG(359, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy360:
+ YYDEBUG(360, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy236;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy361;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy361:
+ YYDEBUG(361, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy362:
+ YYDEBUG(362, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy202;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy363;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy363:
+ YYDEBUG(363, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'V') goto yy203;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'v') goto yy364;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy364:
+ YYDEBUG(364, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy173;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy314;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy365:
+ YYDEBUG(365, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy240;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy368;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy366:
+ YYDEBUG(366, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'X') goto yy239;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'w'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'x') goto yy367;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy367:
+ YYDEBUG(367, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy368:
+ YYDEBUG(368, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy241;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy369;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy369:
+ YYDEBUG(369, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy370:
+ YYDEBUG(370, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy205;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy371;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy371:
+ YYDEBUG(371, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy372:
+ YYDEBUG(372, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'E'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'F') goto yy248;
+ if(yych == 'R') goto yy247;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'e') goto yy61;
+ goto yy377;
+ } else {
+ if(yych == 'r') goto yy378;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy373:
+ YYDEBUG(373, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy244;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy374;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy374:
+ YYDEBUG(374, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy245;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy375;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy375:
+ YYDEBUG(375, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy246;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy376;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy376:
+ YYDEBUG(376, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy377:
+ YYDEBUG(377, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy249;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy380;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy378:
+ YYDEBUG(378, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy250;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy379;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy379:
+ YYDEBUG(379, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy380:
+ YYDEBUG(380, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy381:
+ YYDEBUG(381, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy210;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy385;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy382:
+ YYDEBUG(382, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'G') goto yy208;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'g') goto yy383;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy383:
+ YYDEBUG(383, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy209;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy384;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy384:
+ YYDEBUG(384, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy385:
+ YYDEBUG(385, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'V') goto yy211;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'v') goto yy386;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy386:
+ YYDEBUG(386, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy212;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy387;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy387:
+ YYDEBUG(387, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy213;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy388;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy388:
+ YYDEBUG(388, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy214;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy389;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy389:
+ YYDEBUG(389, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy390:
+ YYDEBUG(390, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy252;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy391;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy391:
+ YYDEBUG(391, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy253;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy392;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy392:
+ YYDEBUG(392, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy254;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy393;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy393:
+ YYDEBUG(393, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy255;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy394;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy394:
+ YYDEBUG(394, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy395:
+ YYDEBUG(395, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy257;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy396;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy396:
+ YYDEBUG(396, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy397:
+ YYDEBUG(397, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy198;
+ case 'F': goto yy194;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'P': goto yy200;
+ case 'S': goto yy259;
+ case 'T': goto yy197;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k': case 'm': case 'o': case 'q':
+ case 'r': case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy333;
+ case 'f': goto yy334;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'p': goto yy337;
+ case 's': goto yy398;
+ case 't': goto yy339;
+ default: goto yy193;
+ }
+yy398:
+ YYDEBUG(398, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy260;
+ case 'F': goto yy194;
+ case 'I': goto yy227;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'P': goto yy200;
+ case 'S': goto yy196;
+ case 'T': goto yy197;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h': case 'j':
+ case 'k': case 'm': case 'o': case 'q':
+ case 'r': case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy399;
+ case 'f': goto yy334;
+ case 'i': goto yy352;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'p': goto yy337;
+ case 's': goto yy338;
+ case 't': goto yy339;
+ default: goto yy193;
+ }
+yy399:
+ YYDEBUG(399, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'H'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'C') goto yy230;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'L'){
+ if(yych <= 'I') goto yy207;
+ if(yych <= 'K') goto yy56;
+ goto yy206;
+ } else {
+ if(yych == 'V') goto yy231;
+ goto yy56;
+ }
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'b'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'c') goto yy355;
+ if(yych <= 'h') goto yy61;
+ goto yy382;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych == 'l') goto yy381;
+ goto yy61;
+ } else {
+ if(yych <= 'v') goto yy356;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+ }
+yy400:
+ YYDEBUG(400, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy263;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy405;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy401:
+ YYDEBUG(401, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy274;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy402;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy402:
+ YYDEBUG(402, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy275;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy403;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy403:
+ YYDEBUG(403, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy276;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy404;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy404:
+ YYDEBUG(404, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy405:
+ YYDEBUG(405, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy264;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy406;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy406:
+ YYDEBUG(406, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'G'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'H') goto yy266;
+ if(yych == 'N') goto yy265;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'g') goto yy61;
+ goto yy408;
+ } else {
+ if(yych == 'n') goto yy407;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy407:
+ YYDEBUG(407, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy271;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy413;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy408:
+ YYDEBUG(408, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy267;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy409;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy409:
+ YYDEBUG(409, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy268;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy410;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy410:
+ YYDEBUG(410, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'G') goto yy269;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'g') goto yy411;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy411:
+ YYDEBUG(411, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy270;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy412;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy412:
+ YYDEBUG(412, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy413:
+ YYDEBUG(413, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'G') goto yy272;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'g') goto yy414;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy414:
+ YYDEBUG(414, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy273;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy415;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy415:
+ YYDEBUG(415, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy416:
+ YYDEBUG(416, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'C'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'D') goto yy279;
+ if(yych <= 'E') goto yy278;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy418;
+ if(yych <= 'e') goto yy417;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy417:
+ YYDEBUG(417, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'K') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'j'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'k') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy418:
+ YYDEBUG(418, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy280;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy419;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy419:
+ YYDEBUG(419, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy281;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy420;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy420:
+ YYDEBUG(420, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy282;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy421;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy421:
+ YYDEBUG(421, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy283;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy422;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy422:
+ YYDEBUG(422, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy284;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy423;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy423:
+ YYDEBUG(423, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy424:
+ YYDEBUG(424, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy425:
+ YYDEBUG(425, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy287;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy426;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy426:
+ YYDEBUG(426, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy427:
+ YYDEBUG(427, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy290;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy433;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy428:
+ YYDEBUG(428, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy293;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy429;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy429:
+ YYDEBUG(429, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'C'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'D') goto yy294;
+ if(yych == 'T') goto yy295;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'c') goto yy61;
+ goto yy430;
+ } else {
+ if(yych == 't') goto yy431;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy430:
+ YYDEBUG(430, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy296;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy432;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy431:
+ YYDEBUG(431, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy432:
+ YYDEBUG(432, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy433:
+ YYDEBUG(433, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy198;
+ case 'F': goto yy194;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'P': goto yy200;
+ case 'S': goto yy259;
+ case 'T': goto yy197;
+ case 'U': goto yy291;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k': case 'm': case 'o': case 'q':
+ case 'r': case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy333;
+ case 'f': goto yy334;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'p': goto yy337;
+ case 's': goto yy398;
+ case 't': goto yy339;
+ case 'u': goto yy434;
+ default: goto yy193;
+ }
+yy434:
+ YYDEBUG(434, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy292;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy435;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy435:
+ YYDEBUG(435, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy436:
+ YYDEBUG(436, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy306;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy445;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy437:
+ YYDEBUG(437, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'C') goto yy300;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'c') goto yy442;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy438:
+ YYDEBUG(438, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy303;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy439;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy439:
+ YYDEBUG(439, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy304;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy440;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy440:
+ YYDEBUG(440, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy305;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy441;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy441:
+ YYDEBUG(441, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy442:
+ YYDEBUG(442, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy198;
+ case 'F': goto yy194;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'O': goto yy301;
+ case 'P': goto yy200;
+ case 'S': goto yy259;
+ case 'T': goto yy197;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k': case 'm': case 'q':
+ case 'r': case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy333;
+ case 'f': goto yy334;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'o': goto yy443;
+ case 'p': goto yy337;
+ case 's': goto yy398;
+ case 't': goto yy339;
+ default: goto yy193;
+ }
+yy443:
+ YYDEBUG(443, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy302;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy444;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy444:
+ YYDEBUG(444, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy445:
+ YYDEBUG(445, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy307;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy446;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy446:
+ YYDEBUG(446, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy308;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy447;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy447:
+ YYDEBUG(447, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy309;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy448;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy448:
+ YYDEBUG(448, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy310;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy449;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy449:
+ YYDEBUG(449, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy450:
+ YYDEBUG(450, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy51;
+ goto yy451;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 's') goto yy451;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy451:
+ YYDEBUG(451, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy452;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy452;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy452:
+ YYDEBUG(452, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy177;
+ case ')': goto yy49;
+ default: goto yy3;
+ }
+yy453:
+ YYDEBUG(453, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy51;
+ goto yy451;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 's') goto yy454;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy454:
+ YYDEBUG(454, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy452;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy455;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy455:
+ YYDEBUG(455, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': goto yy177;
+ case ')': goto yy49;
+ case '/': case '_': goto yy55;
+ 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 yy61;
+ case 'd': goto yy321;
+ case 'f': goto yy323;
+ case 'h': goto yy320;
+ case 'm': goto yy319;
+ case 's': goto yy318;
+ case 't': goto yy325;
+ case 'w': goto yy322;
+ case 'y': goto yy324;
+ default: goto yy3;
+ }
+yy456:
+ YYDEBUG(456, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'G'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'F') goto yy51;
+ goto yy460;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'g') goto yy460;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy457:
+ YYDEBUG(457, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy458;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'e') goto yy458;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy458:
+ YYDEBUG(458, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy52;
+ goto yy459;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'v') goto yy459;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy459:
+ YYDEBUG(459, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'E') goto yy212;
+ if(yych == 'e') goto yy212;
+ goto yy3;
+ }
+yy460:
+ YYDEBUG(460, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'H'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'G') goto yy52;
+ goto yy461;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'h') goto yy461;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy461:
+ YYDEBUG(461, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy3;
+ }
+yy462:
+ YYDEBUG(462, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'F') goto yy51;
+ goto yy460;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy466;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy463:
+ YYDEBUG(463, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy458;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy464;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy464:
+ YYDEBUG(464, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'V'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy52;
+ goto yy459;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'v') goto yy465;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy465:
+ YYDEBUG(465, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'D') goto yy3;
+ goto yy212;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy387;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy466:
+ YYDEBUG(466, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'G') goto yy52;
+ goto yy461;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy467;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy467:
+ YYDEBUG(467, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'S') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy468:
+ YYDEBUG(468, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy489;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy504;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy469:
+ YYDEBUG(469, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'U'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'H'){
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'I') goto yy482;
+ if(yych <= 'T') goto yy51;
+ goto yy483;
+ }
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '^'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ goto yy54;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'i') goto yy497;
+ goto yy54;
+ } else {
+ if(yych <= 'u') goto yy498;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy470:
+ YYDEBUG(470, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy478;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy493;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy471:
+ YYDEBUG(471, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy476;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy491;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy472:
+ YYDEBUG(472, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy489;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy489;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy473:
+ YYDEBUG(473, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'I') goto yy482;
+ if(yych <= 'T') goto yy51;
+ goto yy483;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'h') goto yy51;
+ goto yy482;
+ } else {
+ if(yych == 'u') goto yy483;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy474:
+ YYDEBUG(474, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy478;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'e') goto yy478;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy475:
+ YYDEBUG(475, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy476;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'e') goto yy476;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy476:
+ YYDEBUG(476, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'K') goto yy52;
+ goto yy477;
+ }
+ } else {
+ if(yych <= 'k'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'l') goto yy477;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy477:
+ YYDEBUG(477, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'F') goto yy222;
+ if(yych == 'f') goto yy222;
+ goto yy3;
+ }
+yy478:
+ YYDEBUG(478, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'R') goto yy52;
+ goto yy479;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 's') goto yy479;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy479:
+ YYDEBUG(479, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'C'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'D') goto yy480;
+ if(yych != 'd') goto yy3;
+ goto yy480;
+ }
+yy480:
+ YYDEBUG(480, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy481;
+ if(yych != 'a') goto yy56;
+ goto yy481;
+yy481:
+ YYDEBUG(481, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy482:
+ YYDEBUG(482, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Q') goto yy52;
+ if(yych <= 'R') goto yy488;
+ goto yy452;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'r') goto yy488;
+ if(yych <= 's') goto yy452;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy483:
+ YYDEBUG(483, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'Q') goto yy52;
+ goto yy484;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'r') goto yy484;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy484:
+ YYDEBUG(484, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'S') goto yy485;
+ if(yych != 's') goto yy3;
+ goto yy485;
+ }
+yy485:
+ YYDEBUG(485, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy486;
+ if(yych != 'd') goto yy56;
+ goto yy486;
+yy486:
+ YYDEBUG(486, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy487;
+ if(yych != 'a') goto yy56;
+ goto yy487;
+yy487:
+ YYDEBUG(487, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy488:
+ YYDEBUG(488, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'C'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'D') goto yy176;
+ if(yych == 'd') goto yy176;
+ goto yy3;
+ }
+yy489:
+ YYDEBUG(489, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy490;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy490;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy490:
+ YYDEBUG(490, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy3;
+ }
+yy491:
+ YYDEBUG(491, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'K') goto yy52;
+ goto yy477;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'l') goto yy492;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy492:
+ YYDEBUG(492, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'F'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'E') goto yy3;
+ goto yy222;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'f') goto yy347;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy493:
+ YYDEBUG(493, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'R') goto yy52;
+ goto yy479;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 's') goto yy494;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy494:
+ YYDEBUG(494, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'C') goto yy3;
+ goto yy480;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'd') goto yy495;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy495:
+ YYDEBUG(495, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy481;
+ if(yych != 'a') goto yy62;
+ goto yy496;
+yy496:
+ YYDEBUG(496, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy497:
+ YYDEBUG(497, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy52;
+ if(yych <= 'R') goto yy488;
+ goto yy452;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy60;
+ goto yy503;
+ } else {
+ if(yych <= 's') goto yy455;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy498:
+ YYDEBUG(498, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'Q') goto yy52;
+ goto yy484;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'r') goto yy499;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy499:
+ YYDEBUG(499, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'R') goto yy3;
+ goto yy485;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 's') goto yy500;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy500:
+ YYDEBUG(500, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy486;
+ if(yych != 'd') goto yy62;
+ goto yy501;
+yy501:
+ YYDEBUG(501, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy487;
+ if(yych != 'a') goto yy62;
+ goto yy502;
+yy502:
+ YYDEBUG(502, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy503:
+ YYDEBUG(503, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'C') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'd') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy504:
+ YYDEBUG(504, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy490;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy505;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy505:
+ YYDEBUG(505, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy506:
+ YYDEBUG(506, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'C'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'B') goto yy51;
+ goto yy507;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'c') goto yy507;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy507:
+ YYDEBUG(507, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'E') goto yy516;
+ goto yy52;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'e') goto yy516;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy508:
+ YYDEBUG(508, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 17) YYFILL(17);
+ yych = *YYCURSOR;
+ goto yy509;
+yy509:
+ YYDEBUG(509, *YYCURSOR);
+ if(yybm[0+yych] & 64) {
+ goto yy508;
+ }
+ if(yych <= '/') goto yy56;
+ if(yych <= '2') goto yy512;
+ if(yych <= '3') goto yy514;
+ if(yych <= '9') goto yy515;
+ goto yy56;
+yy510:
+ YYDEBUG(510, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 0x1F) goto yy3;
+ if(yych == '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+yy511:
+ YYDEBUG(511, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy509;
+ if(yych <= '0') goto yy588;
+ if(yych <= '2') goto yy589;
+ if(yych <= '3') goto yy590;
+ goto yy509;
+yy512:
+ YYDEBUG(512, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy524;
+ if(yych == '2') goto yy587;
+ if(yych <= '9') goto yy570;
+ goto yy524;
+yy513:
+ YYDEBUG(513, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("datetextual | datenoyear");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_TEXT;
+ }
+yy514:
+ YYDEBUG(514, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy524;
+ if(yych <= '1') goto yy570;
+ if(yych <= '2') goto yy521;
+ if(yych <= '9') goto yy522;
+ goto yy524;
+yy515:
+ YYDEBUG(515, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy524;
+ if(yych <= '1') goto yy520;
+ if(yych <= '2') goto yy521;
+ if(yych <= '9') goto yy522;
+ goto yy524;
+yy516:
+ YYDEBUG(516, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'M') goto yy517;
+ if(yych != 'm') goto yy3;
+ goto yy517;
+ }
+yy517:
+ YYDEBUG(517, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy518;
+ if(yych != 'b') goto yy56;
+ goto yy518;
+yy518:
+ YYDEBUG(518, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy519;
+ if(yych != 'e') goto yy56;
+ goto yy519;
+yy519:
+ YYDEBUG(519, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy508;
+ if(yych == 'r') goto yy508;
+ goto yy56;
+yy520:
+ YYDEBUG(520, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy569;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy521:
+ YYDEBUG(521, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '3') goto yy569;
+ if(yych <= '9') goto yy566;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy522:
+ YYDEBUG(522, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy566;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy523:
+ YYDEBUG(523, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 14) YYFILL(14);
+ yych = *YYCURSOR;
+ goto yy524;
+yy524:
+ YYDEBUG(524, *YYCURSOR);
+ if(yybm[0+yych] & 128) {
+ goto yy523;
+ }
+ if(yych <= '/') goto yy513;
+ if(yych <= '1') goto yy525;
+ if(yych <= '2') goto yy526;
+ if(yych <= '9') goto yy527;
+ goto yy513;
+yy525:
+ YYDEBUG(525, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy565;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy526:
+ YYDEBUG(526, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '3') goto yy565;
+ if(yych <= '9') goto yy528;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy527:
+ YYDEBUG(527, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy528;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy528:
+ YYDEBUG(528, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy513;
+ if(yych <= '9') goto yy563;
+ goto yy513;
+yy529:
+ YYDEBUG(529, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy530;
+ if(yych <= '9') goto yy532;
+ goto yy56;
+yy530:
+ YYDEBUG(530, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy533;
+ goto yy531;
+ } else {
+ if(yych <= '9') goto yy532;
+ if(yych <= ':') goto yy533;
+ goto yy531;
+ }
+yy531:
+ YYDEBUG(531, *YYCURSOR);
+
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
+ }
+ }
+
+ if (*ptr != '\0') {
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_SHORTDATE_WITH_TIME;
+ }
+yy532:
+ YYDEBUG(532, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy533;
+ if(yych != ':') goto yy531;
+ goto yy533;
+yy533:
+ YYDEBUG(533, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy534;
+ if(yych <= '6') goto yy535;
+ if(yych <= '9') goto yy536;
+ goto yy56;
+yy534:
+ YYDEBUG(534, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy531;
+ if(yych <= '9') goto yy537;
+ goto yy531;
+yy535:
+ YYDEBUG(535, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '0') goto yy537;
+ goto yy531;
+yy536:
+ YYDEBUG(536, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy531;
+yy537:
+ YYDEBUG(537, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '+'){
+ if(yych <= '\''){
+ if(yych != ' ') goto yy531;
+ goto yy538;
+ } else {
+ if(yych <= '(') goto yy541;
+ if(yych <= '*') goto yy531;
+ goto yy540;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == '-') goto yy540;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy542;
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy543;
+ goto yy531;
+ }
+ }
+yy538:
+ YYDEBUG(538, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
+ yych = *YYCURSOR;
+ goto yy539;
+yy539:
+ YYDEBUG(539, *YYCURSOR);
+ if(yych <= '+'){
+ if(yych <= '\''){
+ if(yych == ' ') goto yy538;
+ goto yy56;
+ } else {
+ if(yych <= '(') goto yy541;
+ if(yych <= '*') goto yy56;
+ goto yy540;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych != '-') goto yy56;
+ goto yy540;
+ } else {
+ if(yych <= 'Z') goto yy542;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'z') goto yy543;
+ goto yy56;
+ }
+ }
+yy540:
+ YYDEBUG(540, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy556;
+ if(yych <= '2') goto yy557;
+ if(yych <= '9') goto yy558;
+ goto yy56;
+yy541:
+ YYDEBUG(541, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@') goto yy56;
+ if(yych <= 'Z') goto yy543;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'z') goto yy543;
+ goto yy56;
+yy542:
+ YYDEBUG(542, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy536;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy544;
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy547;
+ goto yy531;
+ }
+yy543:
+ YYDEBUG(543, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy536;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy544;
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy544;
+ }
+yy544:
+ YYDEBUG(544, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy536;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy545;
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy545;
+ }
+yy545:
+ YYDEBUG(545, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy536;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy546;
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy546;
+ }
+yy546:
+ YYDEBUG(546, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == ')') goto yy536;
+ goto yy531;
+yy547:
+ YYDEBUG(547, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy531;
+ goto yy536;
+ } else {
+ if(yych == '/') goto yy549;
+ goto yy531;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy545;
+ if(yych <= '^') goto yy531;
+ goto yy549;
+ } else {
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy548;
+ }
+ }
+yy548:
+ YYDEBUG(548, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy531;
+ goto yy536;
+ } else {
+ if(yych != '/') goto yy531;
+ goto yy549;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy546;
+ if(yych <= '^') goto yy531;
+ goto yy549;
+ } else {
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy553;
+ goto yy531;
+ }
+ }
+yy549:
+ YYDEBUG(549, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '@') goto yy56;
+ if(yych >= '[') goto yy56;
+ goto yy550;
+yy550:
+ YYDEBUG(550, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '`') goto yy56;
+ if(yych >= '{') goto yy56;
+ goto yy551;
+yy551:
+ YYDEBUG(551, *YYCURSOR);
+ yyaccept = 7;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy552;
+yy552:
+ YYDEBUG(552, *YYCURSOR);
+ if(yych <= '^'){
+ if(yych == '/') goto yy549;
+ goto yy531;
+ } else {
+ if(yych <= '_') goto yy549;
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy551;
+ goto yy531;
+ }
+yy553:
+ YYDEBUG(553, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == ')') goto yy536;
+ if(yych <= '.') goto yy531;
+ goto yy549;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy531;
+ goto yy549;
+ } else {
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy554;
+ }
+ }
+yy554:
+ YYDEBUG(554, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy555;
+yy555:
+ YYDEBUG(555, *YYCURSOR);
+ if(yych <= '^'){
+ if(yych == '/') goto yy549;
+ goto yy56;
+ } else {
+ if(yych <= '_') goto yy549;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'z') goto yy554;
+ goto yy56;
+ }
+yy556:
+ YYDEBUG(556, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy531;
+ if(yych <= '5') goto yy561;
+ if(yych <= '9') goto yy558;
+ if(yych <= ':') goto yy559;
+ goto yy531;
+yy557:
+ YYDEBUG(557, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '5'){
+ if(yych <= '/') goto yy531;
+ if(yych <= '3') goto yy561;
+ goto yy560;
+ } else {
+ if(yych == ':') goto yy559;
+ goto yy531;
+ }
+yy558:
+ YYDEBUG(558, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy531;
+ if(yych <= '5') goto yy560;
+ if(yych != ':') goto yy531;
+ goto yy559;
+yy559:
+ YYDEBUG(559, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy531;
+ if(yych >= '6') goto yy531;
+ goto yy560;
+yy560:
+ YYDEBUG(560, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy536;
+ goto yy56;
+yy561:
+ YYDEBUG(561, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy531;
+ if(yych <= '5') goto yy562;
+ if(yych <= '9') goto yy536;
+ if(yych <= ':') goto yy559;
+ goto yy531;
+yy562:
+ YYDEBUG(562, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy531;
+ if(yych <= '9') goto yy536;
+ goto yy531;
+yy563:
+ YYDEBUG(563, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy513;
+ if(yych >= ':') goto yy513;
+ goto yy564;
+yy564:
+ YYDEBUG(564, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy513;
+yy565:
+ YYDEBUG(565, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy563;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy566:
+ YYDEBUG(566, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy513;
+ if(yych >= ':') goto yy513;
+ goto yy567;
+yy567:
+ YYDEBUG(567, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy568;
+ if(yych <= '9') goto yy564;
+ goto yy568;
+yy568:
+ YYDEBUG(568, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("datenoday");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->d = 1;
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_NO_DAY;
+ }
+yy569:
+ YYDEBUG(569, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy567;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy570:
+ YYDEBUG(570, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '1'){
+ if(yych == '.') goto yy571;
+ if(yych <= '/') goto yy524;
+ goto yy572;
+ } else {
+ if(yych <= '2') goto yy573;
+ if(yych <= '9') goto yy574;
+ if(yych <= ':') goto yy529;
+ goto yy524;
+ }
+yy571:
+ YYDEBUG(571, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy524;
+ if(yych <= '1') goto yy577;
+ goto yy578;
+ } else {
+ if(yych <= '5') goto yy579;
+ if(yych <= '9') goto yy580;
+ goto yy524;
+ }
+yy572:
+ YYDEBUG(572, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy576;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy573:
+ YYDEBUG(573, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '3') goto yy576;
+ if(yych <= '9') goto yy575;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy574:
+ YYDEBUG(574, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy575;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy575:
+ YYDEBUG(575, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy568;
+ if(yych <= '9') goto yy563;
+ goto yy568;
+yy576:
+ YYDEBUG(576, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy568;
+ } else {
+ if(yych <= '9') goto yy563;
+ if(yych <= ':') goto yy529;
+ goto yy568;
+ }
+yy577:
+ YYDEBUG(577, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy581;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy586;
+ if(yych <= ':') goto yy581;
+ goto yy513;
+ }
+yy578:
+ YYDEBUG(578, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy581;
+ goto yy513;
+ } else {
+ if(yych <= '3') goto yy586;
+ if(yych <= '9') goto yy585;
+ if(yych <= ':') goto yy581;
+ goto yy513;
+ }
+yy579:
+ YYDEBUG(579, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy581;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy585;
+ if(yych <= ':') goto yy581;
+ goto yy513;
+ }
+yy580:
+ YYDEBUG(580, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych != '.') goto yy513;
+ goto yy581;
+ } else {
+ if(yych <= '9') goto yy528;
+ if(yych >= ';') goto yy513;
+ goto yy581;
+ }
+yy581:
+ YYDEBUG(581, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy582;
+ if(yych <= '6') goto yy583;
+ if(yych <= '9') goto yy532;
+ goto yy56;
+yy582:
+ YYDEBUG(582, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy533;
+ goto yy531;
+ } else {
+ if(yych <= '9') goto yy584;
+ if(yych <= ':') goto yy533;
+ goto yy531;
+ }
+yy583:
+ YYDEBUG(583, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy533;
+ goto yy531;
+ } else {
+ if(yych <= '0') goto yy537;
+ if(yych == ':') goto yy533;
+ goto yy531;
+ }
+yy584:
+ YYDEBUG(584, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= '('){
+ if(yych == ' ') goto yy538;
+ if(yych <= '\'') goto yy531;
+ goto yy541;
+ } else {
+ if(yych == '+') goto yy540;
+ if(yych <= ',') goto yy531;
+ goto yy540;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych <= '.') goto yy533;
+ if(yych == ':') goto yy533;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy542;
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy543;
+ goto yy531;
+ }
+ }
+yy585:
+ YYDEBUG(585, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy533;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy563;
+ if(yych <= ':') goto yy533;
+ goto yy513;
+ }
+yy586:
+ YYDEBUG(586, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy581;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy563;
+ if(yych <= ':') goto yy581;
+ goto yy513;
+ }
+yy587:
+ YYDEBUG(587, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '1'){
+ if(yych == '.') goto yy571;
+ if(yych <= '/') goto yy524;
+ goto yy572;
+ } else {
+ if(yych <= '2') goto yy573;
+ if(yych <= '9') goto yy574;
+ if(yych <= ':') goto yy529;
+ goto yy524;
+ }
+yy588:
+ YYDEBUG(588, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '1'){
+ if(yych <= '/') goto yy524;
+ if(yych <= '0') goto yy570;
+ goto yy591;
+ } else {
+ if(yych <= '2') goto yy598;
+ if(yych <= '9') goto yy591;
+ goto yy524;
+ }
+yy589:
+ YYDEBUG(589, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy524;
+ if(yych == '2') goto yy598;
+ if(yych <= '9') goto yy591;
+ goto yy524;
+yy590:
+ YYDEBUG(590, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy524;
+ if(yych <= '1') goto yy591;
+ if(yych <= '2') goto yy521;
+ if(yych <= '9') goto yy522;
+ goto yy524;
+yy591:
+ YYDEBUG(591, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '-': goto yy592;
+ case '.': goto yy571;
+ case '0':
+ case '1': goto yy572;
+ case '2': goto yy573;
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy574;
+ case ':': goto yy529;
+ default: goto yy524;
+ }
+yy592:
+ YYDEBUG(592, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy593;
+yy593:
+ YYDEBUG(593, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy594;
+ if(yych <= '9') goto yy595;
+ goto yy594;
+yy594:
+ YYDEBUG(594, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("pgtextshort");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_PG_TEXT;
+ }
+yy595:
+ YYDEBUG(595, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy594;
+ if(yych >= ':') goto yy594;
+ goto yy596;
+yy596:
+ YYDEBUG(596, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy594;
+ if(yych >= ':') goto yy594;
+ goto yy597;
+yy597:
+ YYDEBUG(597, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy594;
+yy598:
+ YYDEBUG(598, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '-': goto yy592;
+ case '.': goto yy571;
+ case '0':
+ case '1': goto yy572;
+ case '2': goto yy573;
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy574;
+ case ':': goto yy529;
+ default: goto yy524;
+ }
+yy599:
+ YYDEBUG(599, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'C'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'B') goto yy51;
+ goto yy507;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'c') goto yy600;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy600:
+ YYDEBUG(600, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy52;
+ goto yy516;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'e') goto yy601;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy601:
+ YYDEBUG(601, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'M'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'L') goto yy3;
+ goto yy517;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'm') goto yy602;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy602:
+ YYDEBUG(602, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy518;
+ if(yych != 'b') goto yy62;
+ goto yy603;
+yy603:
+ YYDEBUG(603, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy519;
+ if(yych != 'e') goto yy62;
+ goto yy604;
+yy604:
+ YYDEBUG(604, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy605:
+ YYDEBUG(605, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych == '/') goto yy55;
+ goto yy509;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy509;
+ if(yych <= 'z') goto yy61;
+ goto yy509;
+ }
+yy606:
+ YYDEBUG(606, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy51;
+ goto yy618;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'v') goto yy618;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy607:
+ YYDEBUG(607, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'V'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy51;
+ goto yy618;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'v') goto yy619;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy608:
+ YYDEBUG(608, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'X'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'W') goto yy51;
+ goto yy614;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'x') goto yy617;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy609:
+ YYDEBUG(609, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy612;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy615;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy610:
+ YYDEBUG(610, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'X'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'W') goto yy51;
+ goto yy614;
+ }
+ } else {
+ if(yych <= 'w'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'x') goto yy614;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy611:
+ YYDEBUG(611, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy612;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy612;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy612:
+ YYDEBUG(612, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy613;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy613;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy613:
+ YYDEBUG(613, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy3;
+ }
+yy614:
+ YYDEBUG(614, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy452;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy452;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy615:
+ YYDEBUG(615, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy613;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy616;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy616:
+ YYDEBUG(616, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy617:
+ YYDEBUG(617, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy452;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy455;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy618:
+ YYDEBUG(618, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'E') goto yy620;
+ goto yy52;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'e') goto yy620;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy619:
+ YYDEBUG(619, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy52;
+ goto yy620;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'e') goto yy621;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy620:
+ YYDEBUG(620, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'M') goto yy622;
+ if(yych == 'm') goto yy622;
+ goto yy3;
+ }
+yy621:
+ YYDEBUG(621, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'M'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'L') goto yy3;
+ goto yy622;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'm') goto yy623;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy622:
+ YYDEBUG(622, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy624;
+ if(yych == 'b') goto yy624;
+ goto yy56;
+yy623:
+ YYDEBUG(623, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy624;
+ if(yych == 'b') goto yy625;
+ goto yy62;
+yy624:
+ YYDEBUG(624, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy626;
+ if(yych == 'e') goto yy626;
+ goto yy56;
+yy625:
+ YYDEBUG(625, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy626;
+ if(yych == 'e') goto yy627;
+ goto yy62;
+yy626:
+ YYDEBUG(626, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy508;
+ if(yych == 'r') goto yy508;
+ goto yy56;
+yy627:
+ YYDEBUG(627, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy628:
+ YYDEBUG(628, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy51;
+ goto yy629;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 't') goto yy629;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy629:
+ YYDEBUG(629, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'O') goto yy52;
+ goto yy630;
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'o') goto yy630;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy630:
+ YYDEBUG(630, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'B') goto yy631;
+ if(yych != 'b') goto yy3;
+ goto yy631;
+ }
+yy631:
+ YYDEBUG(631, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy632;
+ if(yych != 'e') goto yy56;
+ goto yy632;
+yy632:
+ YYDEBUG(632, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy508;
+ if(yych == 'r') goto yy508;
+ goto yy56;
+yy633:
+ YYDEBUG(633, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy51;
+ goto yy629;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy634;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy634:
+ YYDEBUG(634, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'O'){
+ if(yych <= 'N') goto yy52;
+ goto yy630;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'o') goto yy635;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy635:
+ YYDEBUG(635, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'B'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'A') goto yy3;
+ goto yy631;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'b') goto yy636;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy636:
+ YYDEBUG(636, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy632;
+ if(yych != 'e') goto yy62;
+ goto yy637;
+yy637:
+ YYDEBUG(637, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy638:
+ YYDEBUG(638, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= 'B'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'O'){
+ if(yych <= 'C') goto yy653;
+ goto yy51;
+ } else {
+ if(yych <= 'P') goto yy652;
+ if(yych <= 'U') goto yy51;
+ goto yy654;
+ }
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych == 'c') goto yy653;
+ goto yy51;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'p') goto yy652;
+ goto yy51;
+ } else {
+ if(yych <= 'v') goto yy654;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+ }
+yy639:
+ YYDEBUG(639, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy51;
+ goto yy647;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 't') goto yy647;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy640:
+ YYDEBUG(640, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'X'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'W') goto yy51;
+ goto yy645;
+ }
+ } else {
+ if(yych <= 'w'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'x') goto yy645;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy641:
+ YYDEBUG(641, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy642;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy642;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy642:
+ YYDEBUG(642, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy643;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'd') goto yy643;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy643:
+ YYDEBUG(643, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy644;
+ if(yych != 'a') goto yy3;
+ goto yy644;
+ }
+yy644:
+ YYDEBUG(644, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy645:
+ YYDEBUG(645, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy646;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy646;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy646:
+ YYDEBUG(646, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy3;
+ }
+yy647:
+ YYDEBUG(647, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'T') goto yy52;
+ goto yy648;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'u') goto yy648;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy648:
+ YYDEBUG(648, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'Q'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'R') goto yy649;
+ if(yych != 'r') goto yy3;
+ goto yy649;
+ }
+yy649:
+ YYDEBUG(649, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy650;
+ if(yych != 'd') goto yy56;
+ goto yy650;
+yy650:
+ YYDEBUG(650, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy651;
+ if(yych != 'a') goto yy56;
+ goto yy651;
+yy651:
+ YYDEBUG(651, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy652:
+ YYDEBUG(652, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'T') goto yy657;
+ goto yy52;
+ } else {
+ if(yych <= 's'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy657;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy653:
+ YYDEBUG(653, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'N') goto yy52;
+ goto yy656;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'o') goto yy656;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy654:
+ YYDEBUG(654, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy52;
+ goto yy655;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'e') goto yy655;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy655:
+ YYDEBUG(655, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'M'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'N') goto yy233;
+ if(yych == 'n') goto yy233;
+ goto yy3;
+ }
+yy656:
+ YYDEBUG(656, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'M'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'N') goto yy236;
+ if(yych == 'n') goto yy236;
+ goto yy3;
+ }
+yy657:
+ YYDEBUG(657, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '-') goto yy511;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'D'){
+ if(yych <= '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ } else {
+ if(yych <= 'E') goto yy658;
+ if(yych != 'e') goto yy3;
+ goto yy658;
+ }
+ }
+yy658:
+ YYDEBUG(658, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy659;
+ if(yych != 'm') goto yy56;
+ goto yy659;
+yy659:
+ YYDEBUG(659, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy660;
+ if(yych != 'b') goto yy56;
+ goto yy660;
+yy660:
+ YYDEBUG(660, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy661;
+ if(yych != 'e') goto yy56;
+ goto yy661;
+yy661:
+ YYDEBUG(661, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy508;
+ if(yych == 'r') goto yy508;
+ goto yy56;
+yy662:
+ YYDEBUG(662, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'V'){
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych == '/') goto yy55;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'O'){
+ if(yych == 'C') goto yy653;
+ goto yy51;
+ } else {
+ if(yych <= 'P') goto yy652;
+ if(yych <= 'U') goto yy51;
+ goto yy654;
+ }
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'b') goto yy54;
+ goto yy677;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych == 'p') goto yy676;
+ goto yy54;
+ } else {
+ if(yych <= 'v') goto yy678;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy663:
+ YYDEBUG(663, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy51;
+ goto yy647;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy671;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy664:
+ YYDEBUG(664, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'X'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'W') goto yy51;
+ goto yy645;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'x') goto yy669;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy665:
+ YYDEBUG(665, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy642;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy666;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy666:
+ YYDEBUG(666, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy643;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'd') goto yy667;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy667:
+ YYDEBUG(667, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ goto yy644;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy668;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy668:
+ YYDEBUG(668, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy669:
+ YYDEBUG(669, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy646;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy670;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy670:
+ YYDEBUG(670, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy671:
+ YYDEBUG(671, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'U'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'T') goto yy52;
+ goto yy648;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'u') goto yy672;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy672:
+ YYDEBUG(672, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'Q') goto yy3;
+ goto yy649;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'r') goto yy673;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy673:
+ YYDEBUG(673, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy650;
+ if(yych != 'd') goto yy62;
+ goto yy674;
+yy674:
+ YYDEBUG(674, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy651;
+ if(yych != 'a') goto yy62;
+ goto yy675;
+yy675:
+ YYDEBUG(675, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy676:
+ YYDEBUG(676, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'T'){
+ if(yych <= 'S') goto yy52;
+ goto yy657;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 't') goto yy681;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy677:
+ YYDEBUG(677, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'O'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'N') goto yy52;
+ goto yy656;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'o') goto yy680;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy678:
+ YYDEBUG(678, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy52;
+ goto yy655;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy679;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy679:
+ YYDEBUG(679, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'M') goto yy3;
+ goto yy233;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy358;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy680:
+ YYDEBUG(680, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'M') goto yy3;
+ goto yy236;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy361;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy681:
+ YYDEBUG(681, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy55;
+ goto yy509;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych == 'E') goto yy658;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy682;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+ }
+yy682:
+ YYDEBUG(682, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy659;
+ if(yych != 'm') goto yy62;
+ goto yy683;
+yy683:
+ YYDEBUG(683, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy660;
+ if(yych != 'b') goto yy62;
+ goto yy684;
+yy684:
+ YYDEBUG(684, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy661;
+ if(yych != 'e') goto yy62;
+ goto yy685;
+yy685:
+ YYDEBUG(685, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy686:
+ YYDEBUG(686, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'G'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'F') goto yy51;
+ goto yy693;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'g') goto yy693;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy687:
+ YYDEBUG(687, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy51;
+ goto yy691;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'r') goto yy691;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy688:
+ YYDEBUG(688, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'N') goto yy51;
+ goto yy689;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'o') goto yy689;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy689:
+ YYDEBUG(689, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy690;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy690;
+ if(yych <= 'z') goto yy52;
+ goto yy690;
+ }
+yy690:
+ YYDEBUG(690, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("ago");
+ TIMELIB_INIT;
+ s->time->relative.y = 0 - s->time->relative.y;
+ s->time->relative.m = 0 - s->time->relative.m;
+ s->time->relative.d = 0 - s->time->relative.d;
+ s->time->relative.h = 0 - s->time->relative.h;
+ s->time->relative.i = 0 - s->time->relative.i;
+ s->time->relative.s = 0 - s->time->relative.s;
+ s->time->relative.weekday = 0 - s->time->relative.weekday;
+ TIMELIB_DEINIT;
+ return TIMELIB_AGO;
+ }
+yy691:
+ YYDEBUG(691, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'I') goto yy52;
+ goto yy692;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'i') goto yy692;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy692:
+ YYDEBUG(692, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'K'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'L') goto yy508;
+ if(yych == 'l') goto yy508;
+ goto yy3;
+ }
+yy693:
+ YYDEBUG(693, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'U') goto yy52;
+ goto yy694;
+ } else {
+ if(yych <= 't'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'u') goto yy694;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy694:
+ YYDEBUG(694, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'S') goto yy695;
+ if(yych != 's') goto yy3;
+ goto yy695;
+ }
+yy695:
+ YYDEBUG(695, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy508;
+ if(yych == 't') goto yy508;
+ goto yy56;
+yy696:
+ YYDEBUG(696, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'F') goto yy51;
+ goto yy693;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy702;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy697:
+ YYDEBUG(697, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy51;
+ goto yy691;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'r') goto yy700;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy698:
+ YYDEBUG(698, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'O'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'N') goto yy51;
+ goto yy689;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'o') goto yy699;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy699:
+ YYDEBUG(699, *YYCURSOR);
+ yyaccept = 9;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy690;
+ goto yy49;
+ } else {
+ if(yych == '/') goto yy55;
+ goto yy690;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy690;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy690;
+ if(yych <= 'z') goto yy60;
+ goto yy690;
+ }
+ }
+yy700:
+ YYDEBUG(700, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'I'){
+ if(yych <= 'H') goto yy52;
+ goto yy692;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'i') goto yy701;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy701:
+ YYDEBUG(701, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'K') goto yy3;
+ goto yy508;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'l') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy702:
+ YYDEBUG(702, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'U'){
+ if(yych <= 'T') goto yy52;
+ goto yy694;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'u') goto yy703;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy703:
+ YYDEBUG(703, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'R') goto yy3;
+ goto yy695;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 's') goto yy704;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy704:
+ YYDEBUG(704, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy705:
+ YYDEBUG(705, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'R') goto yy715;
+ if(yych <= 'X') goto yy51;
+ goto yy717;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'q') goto yy51;
+ goto yy715;
+ } else {
+ if(yych == 'y') goto yy717;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy706:
+ YYDEBUG(706, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'Y'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'Q'){
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'R') goto yy715;
+ if(yych <= 'X') goto yy51;
+ goto yy717;
+ }
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '^'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ goto yy54;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= 'r') goto yy716;
+ goto yy54;
+ } else {
+ if(yych <= 'y') goto yy718;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy707:
+ YYDEBUG(707, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy709;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy712;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy708:
+ YYDEBUG(708, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy709;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy709;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy709:
+ YYDEBUG(709, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy710;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'd') goto yy710;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy710:
+ YYDEBUG(710, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy711;
+ if(yych != 'a') goto yy3;
+ goto yy711;
+ }
+yy711:
+ YYDEBUG(711, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy712:
+ YYDEBUG(712, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy710;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'd') goto yy713;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy713:
+ YYDEBUG(713, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ goto yy711;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy714;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy714:
+ YYDEBUG(714, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy715:
+ YYDEBUG(715, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'C') goto yy719;
+ goto yy52;
+ } else {
+ if(yych <= 'b'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'c') goto yy719;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy716:
+ YYDEBUG(716, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'C'){
+ if(yych <= 'B') goto yy52;
+ goto yy719;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'c') goto yy720;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy717:
+ YYDEBUG(717, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '-') goto yy511;
+ goto yy509;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych <= '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy718:
+ YYDEBUG(718, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '-') goto yy511;
+ if(yych <= '.') goto yy509;
+ goto yy55;
+ }
+ } else {
+ if(yych <= '^'){
+ if(yych <= '9') goto yy509;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Z') goto yy52;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy719:
+ YYDEBUG(719, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy508;
+ if(yych == 'h') goto yy508;
+ goto yy3;
+ }
+yy720:
+ YYDEBUG(720, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy508;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy721:
+ YYDEBUG(721, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'B'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'A') goto yy51;
+ goto yy734;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'b') goto yy734;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy722:
+ YYDEBUG(722, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'F') goto yy731;
+ if(yych <= 'Q') goto yy51;
+ goto yy730;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'e') goto yy51;
+ goto yy731;
+ } else {
+ if(yych == 'r') goto yy730;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy723:
+ YYDEBUG(723, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'T') goto yy51;
+ goto yy728;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'u') goto yy728;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy724:
+ YYDEBUG(724, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'I'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy725;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'i') goto yy725;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy725:
+ YYDEBUG(725, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy726;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'd') goto yy726;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy726:
+ YYDEBUG(726, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy727;
+ if(yych != 'a') goto yy3;
+ goto yy727;
+ }
+yy727:
+ YYDEBUG(727, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy728:
+ YYDEBUG(728, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy52;
+ goto yy729;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'r') goto yy729;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy729:
+ YYDEBUG(729, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'T') goto yy246;
+ if(yych == 't') goto yy246;
+ goto yy3;
+ }
+yy730:
+ YYDEBUG(730, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy52;
+ goto yy733;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 's') goto yy733;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy731:
+ YYDEBUG(731, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy732;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy732;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy732:
+ YYDEBUG(732, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy3;
+ }
+yy733:
+ YYDEBUG(733, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy3;
+ }
+yy734:
+ YYDEBUG(734, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'R') goto yy52;
+ goto yy735;
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'r') goto yy735;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy735:
+ YYDEBUG(735, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'U') goto yy736;
+ if(yych != 'u') goto yy3;
+ goto yy736;
+ }
+yy736:
+ YYDEBUG(736, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy737;
+ if(yych != 'a') goto yy56;
+ goto yy737;
+yy737:
+ YYDEBUG(737, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy738;
+ if(yych != 'r') goto yy56;
+ goto yy738;
+yy738:
+ YYDEBUG(738, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy508;
+ if(yych == 'y') goto yy508;
+ goto yy56;
+yy739:
+ YYDEBUG(739, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'B'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'A') goto yy51;
+ goto yy734;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'b') goto yy752;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy740:
+ YYDEBUG(740, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'F') goto yy731;
+ if(yych <= 'Q') goto yy51;
+ goto yy730;
+ }
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '^'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ goto yy54;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'f') goto yy749;
+ goto yy54;
+ } else {
+ if(yych <= 'r') goto yy748;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy741:
+ YYDEBUG(741, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'U'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'T') goto yy51;
+ goto yy728;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'u') goto yy746;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy742:
+ YYDEBUG(742, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'I'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy725;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'i') goto yy743;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy743:
+ YYDEBUG(743, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy726;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'd') goto yy744;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy744:
+ YYDEBUG(744, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ goto yy727;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy745;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy745:
+ YYDEBUG(745, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy746:
+ YYDEBUG(746, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy52;
+ goto yy729;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'r') goto yy747;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy747:
+ YYDEBUG(747, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'S') goto yy3;
+ goto yy246;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy376;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy748:
+ YYDEBUG(748, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy52;
+ goto yy733;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 's') goto yy751;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy749:
+ YYDEBUG(749, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy732;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy750;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy750:
+ YYDEBUG(750, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy751:
+ YYDEBUG(751, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'S') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy752:
+ YYDEBUG(752, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'R'){
+ if(yych <= 'Q') goto yy52;
+ goto yy735;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'r') goto yy753;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy753:
+ YYDEBUG(753, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'U'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'T') goto yy3;
+ goto yy736;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'u') goto yy754;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy754:
+ YYDEBUG(754, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy737;
+ if(yych != 'a') goto yy62;
+ goto yy755;
+yy755:
+ YYDEBUG(755, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy738;
+ if(yych != 'r') goto yy62;
+ goto yy756;
+yy756:
+ YYDEBUG(756, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy757:
+ YYDEBUG(757, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'L') goto yy764;
+ if(yych <= 'M') goto yy51;
+ goto yy763;
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'k') goto yy51;
+ goto yy764;
+ } else {
+ if(yych == 'n') goto yy763;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy758:
+ YYDEBUG(758, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy759;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy759;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy759:
+ YYDEBUG(759, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'U') goto yy52;
+ goto yy760;
+ } else {
+ if(yych <= 't'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'u') goto yy760;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy760:
+ YYDEBUG(760, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy761;
+ if(yych != 'a') goto yy3;
+ goto yy761;
+ }
+yy761:
+ YYDEBUG(761, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy762;
+ if(yych != 'r') goto yy56;
+ goto yy762;
+yy762:
+ YYDEBUG(762, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy508;
+ if(yych == 'y') goto yy508;
+ goto yy56;
+yy763:
+ YYDEBUG(763, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'E') goto yy765;
+ goto yy52;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'e') goto yy765;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy764:
+ YYDEBUG(764, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'Y') goto yy52;
+ goto yy765;
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'y') goto yy765;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy765:
+ YYDEBUG(765, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+yy766:
+ YYDEBUG(766, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'K'){
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'L') goto yy764;
+ if(yych <= 'M') goto yy51;
+ goto yy763;
+ }
+ }
+ } else {
+ if(yych <= 'k'){
+ if(yych <= '^'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ goto yy54;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'l') goto yy773;
+ goto yy54;
+ } else {
+ if(yych <= 'n') goto yy772;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy767:
+ YYDEBUG(767, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy759;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy768;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy768:
+ YYDEBUG(768, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'U'){
+ if(yych <= 'T') goto yy52;
+ goto yy760;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'u') goto yy769;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy769:
+ YYDEBUG(769, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ goto yy761;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy770;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy770:
+ YYDEBUG(770, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy762;
+ if(yych != 'r') goto yy62;
+ goto yy771;
+yy771:
+ YYDEBUG(771, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy772:
+ YYDEBUG(772, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy52;
+ goto yy765;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'e') goto yy774;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy773:
+ YYDEBUG(773, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Y'){
+ if(yych <= 'X') goto yy52;
+ goto yy765;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'y') goto yy774;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy774:
+ YYDEBUG(774, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= '('){
+ if(yych <= 0x1F) goto yy3;
+ goto yy509;
+ } else {
+ if(yych <= ')') goto yy510;
+ if(yych <= '.') goto yy509;
+ goto yy55;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= '9') goto yy509;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy775:
+ YYDEBUG(775, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy776;
+ } else {
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy776:
+ YYDEBUG(776, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= '('){
+ if(yych <= 0x1F) goto yy3;
+ goto yy509;
+ } else {
+ if(yych <= ')') goto yy510;
+ if(yych <= '.') goto yy509;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '9') goto yy509;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy777:
+ YYDEBUG(777, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy778;
+ } else {
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy778:
+ YYDEBUG(778, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy52;
+ goto yy765;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy779:
+ YYDEBUG(779, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= '('){
+ if(yych <= 0x1F) goto yy3;
+ goto yy509;
+ } else {
+ if(yych <= ')') goto yy510;
+ if(yych <= '.') goto yy509;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '9') goto yy509;
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy780:
+ YYDEBUG(780, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy776;
+ } else {
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy781:
+ YYDEBUG(781, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
+ yych = *YYCURSOR;
+ goto yy782;
+yy782:
+ YYDEBUG(782, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy781;
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy790;
+ case 'A': case 'a': goto yy798;
+ case 'D': case 'd': goto yy785;
+ case 'F': case 'f': goto yy786;
+ case 'H': case 'h': goto yy73;
+ case 'I': goto yy793;
+ case 'J': case 'j': goto yy797;
+ case 'M': case 'm': goto yy784;
+ case 'N': case 'n': goto yy800;
+ case 'O': case 'o': goto yy799;
+ case 'P': case 'p': goto yy802;
+ case 'S': case 's': goto yy783;
+ case 'T': case 't': goto yy78;
+ case 'V': goto yy795;
+ case 'W': case 'w': goto yy75;
+ case 'X': goto yy796;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy783:
+ YYDEBUG(783, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych == 'A') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy1259;
+ if(yych <= 'T') goto yy56;
+ goto yy135;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych == 'a') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'e') goto yy1259;
+ if(yych == 'u') goto yy135;
+ goto yy56;
+ }
+ }
+yy784:
+ YYDEBUG(784, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= 'H'){
+ if(yych == 'A') goto yy889;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy126;
+ if(yych <= 'N') goto yy56;
+ goto yy125;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych == 'a') goto yy889;
+ goto yy56;
+ } else {
+ if(yych <= 'i') goto yy126;
+ if(yych == 'o') goto yy125;
+ goto yy56;
+ }
+ }
+yy785:
+ YYDEBUG(785, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych == 'A') goto yy122;
+ if(yych <= 'D') goto yy56;
+ goto yy876;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy122;
+ } else {
+ if(yych == 'e') goto yy876;
+ goto yy56;
+ }
+ }
+yy786:
+ YYDEBUG(786, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= 'N'){
+ if(yych == 'E') goto yy892;
+ goto yy56;
+ } else {
+ if(yych <= 'O') goto yy99;
+ if(yych <= 'Q') goto yy56;
+ goto yy98;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych == 'e') goto yy892;
+ goto yy56;
+ } else {
+ if(yych <= 'o') goto yy99;
+ if(yych == 'r') goto yy98;
+ goto yy56;
+ }
+ }
+yy787:
+ YYDEBUG(787, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy1010;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1009;
+ goto yy70;
+yy788:
+ YYDEBUG(788, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0':
+ case '1':
+ case '2': goto yy952;
+ case '3': goto yy954;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy955;
+ case 'A': case 'a': goto yy959;
+ case 'D': case 'd': goto yy963;
+ case 'F': case 'f': goto yy957;
+ case 'J': case 'j': goto yy956;
+ case 'M': case 'm': goto yy958;
+ case 'N': case 'n': goto yy962;
+ case 'O': case 'o': goto yy961;
+ case 'S': case 's': goto yy960;
+ default: goto yy56;
+ }
+yy789:
+ YYDEBUG(789, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0': goto yy908;
+ case '1': goto yy909;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy910;
+ case 'A': case 'a': goto yy914;
+ case 'D': case 'd': goto yy918;
+ case 'F': case 'f': goto yy912;
+ case 'J': case 'j': goto yy911;
+ case 'M': case 'm': goto yy913;
+ case 'N': case 'n': goto yy917;
+ case 'O': case 'o': goto yy916;
+ case 'S': case 's': goto yy915;
+ default: goto yy791;
+ }
+yy790:
+ YYDEBUG(790, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
+ yych = *YYCURSOR;
+ goto yy791;
+yy791:
+ YYDEBUG(791, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy790;
+ case 'A': case 'a': goto yy873;
+ case 'D': case 'd': goto yy875;
+ case 'F': case 'f': goto yy871;
+ case 'I': goto yy793;
+ case 'J': case 'j': goto yy797;
+ case 'M': case 'm': goto yy872;
+ case 'N': case 'n': goto yy800;
+ case 'O': case 'o': goto yy799;
+ case 'S': case 's': goto yy874;
+ case 'V': goto yy795;
+ case 'X': goto yy796;
+ default: goto yy56;
+ }
+yy792:
+ YYDEBUG(792, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '1'){
+ if(yych <= '/') goto yy791;
+ if(yych <= '0') goto yy867;
+ goto yy868;
+ } else {
+ if(yych <= '5') goto yy869;
+ if(yych <= '9') goto yy870;
+ goto yy791;
+ }
+yy793:
+ YYDEBUG(793, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych >= ' ') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '/') goto yy794;
+ if(yych <= '9') goto yy833;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'V'){
+ if(yych <= 'I') goto yy866;
+ if(yych >= 'V') goto yy839;
+ goto yy794;
+ } else {
+ if(yych == 'X') goto yy839;
+ goto yy794;
+ }
+ }
+yy794:
+ YYDEBUG(794, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("datenoyearrev");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_month((char **) &ptr);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_TEXT;
+ }
+yy795:
+ YYDEBUG(795, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy864;
+ goto yy794;
+ }
+yy796:
+ YYDEBUG(796, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy863;
+ goto yy794;
+ }
+yy797:
+ YYDEBUG(797, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy856;
+ if(yych <= 'T') goto yy56;
+ goto yy855;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy856;
+ } else {
+ if(yych == 'u') goto yy855;
+ goto yy56;
+ }
+ }
+yy798:
+ YYDEBUG(798, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= 'L'){
+ if(yych == '.') goto yy803;
+ goto yy56;
+ } else {
+ if(yych <= 'M') goto yy804;
+ if(yych == 'P') goto yy849;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= 'U') goto yy848;
+ if(yych == 'm') goto yy804;
+ goto yy56;
+ } else {
+ if(yych <= 'p') goto yy849;
+ if(yych == 'u') goto yy848;
+ goto yy56;
+ }
+ }
+yy799:
+ YYDEBUG(799, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy843;
+ if(yych == 'c') goto yy843;
+ goto yy56;
+yy800:
+ YYDEBUG(800, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy829;
+ if(yych == 'o') goto yy829;
+ goto yy56;
+yy801:
+ YYDEBUG(801, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy807;
+ if(yych <= '9') goto yy809;
+ goto yy56;
+yy802:
+ YYDEBUG(802, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych != '.') goto yy56;
+ goto yy803;
+ } else {
+ if(yych <= 'M') goto yy804;
+ if(yych == 'm') goto yy804;
+ goto yy56;
+ }
+yy803:
+ YYDEBUG(803, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy804;
+ if(yych != 'm') goto yy56;
+ goto yy804;
+yy804:
+ YYDEBUG(804, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) == '.') goto yy806;
+ goto yy805;
+yy805:
+ YYDEBUG(805, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':' || *ptr == '.') {
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':' || *ptr == '.') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+ }
+ }
+ s->time->h += timelib_meridian((char **) &ptr, s->time->h);
+ TIMELIB_DEINIT;
+ return TIMELIB_TIME12;
+ }
+yy806:
+ YYDEBUG(806, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy805;
+yy807:
+ YYDEBUG(807, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy810;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy823;
+ if(yych <= ':') goto yy810;
+ goto yy808;
+ }
+yy808:
+ YYDEBUG(808, *YYCURSOR);
+
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':' || *ptr == '.') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
+ }
+ }
+
+ if (*ptr != '\0') {
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_TIME24_WITH_ZONE;
+ }
+yy809:
+ YYDEBUG(809, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy810;
+ if(yych != ':') goto yy808;
+ goto yy810;
+yy810:
+ YYDEBUG(810, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy811;
+ if(yych <= '6') goto yy812;
+ if(yych <= '9') goto yy813;
+ goto yy56;
+yy811:
+ YYDEBUG(811, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy817;
+ goto yy808;
+yy812:
+ YYDEBUG(812, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych == '0') goto yy817;
+ goto yy808;
+yy813:
+ YYDEBUG(813, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != '.') goto yy808;
+ goto yy814;
+yy814:
+ YYDEBUG(814, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy815;
+yy815:
+ YYDEBUG(815, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy816;
+yy816:
+ YYDEBUG(816, *YYCURSOR);
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy815;
+ goto yy808;
+yy817:
+ YYDEBUG(817, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '-'){
+ if(yych != ' ') goto yy808;
+ goto yy818;
+ } else {
+ if(yych <= '.') goto yy814;
+ if(yych <= '@') goto yy808;
+ goto yy820;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == 'P') goto yy820;
+ goto yy808;
+ } else {
+ if(yych <= 'a') goto yy820;
+ if(yych == 'p') goto yy820;
+ goto yy808;
+ }
+ }
+yy818:
+ YYDEBUG(818, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
+ yych = *YYCURSOR;
+ goto yy819;
+yy819:
+ YYDEBUG(819, *YYCURSOR);
+ if(yych <= 'O'){
+ if(yych <= ' '){
+ if(yych <= 0x1F) goto yy56;
+ goto yy818;
+ } else {
+ if(yych != 'A') goto yy56;
+ goto yy820;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'P') goto yy820;
+ if(yych <= '`') goto yy56;
+ goto yy820;
+ } else {
+ if(yych != 'p') goto yy56;
+ goto yy820;
+ }
+ }
+yy820:
+ YYDEBUG(820, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych != '.') goto yy56;
+ goto yy821;
+ } else {
+ if(yych <= 'M') goto yy822;
+ if(yych == 'm') goto yy822;
+ goto yy56;
+ }
+yy821:
+ YYDEBUG(821, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy822;
+ if(yych != 'm') goto yy56;
+ goto yy822;
+yy822:
+ YYDEBUG(822, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '.') goto yy806;
+ goto yy805;
+yy823:
+ YYDEBUG(823, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= '-'){
+ if(yych != ' ') goto yy808;
+ goto yy824;
+ } else {
+ if(yych <= '.') goto yy810;
+ if(yych == ':') goto yy810;
+ goto yy808;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'A') goto yy826;
+ if(yych == 'P') goto yy826;
+ goto yy808;
+ } else {
+ if(yych <= 'a') goto yy826;
+ if(yych == 'p') goto yy826;
+ goto yy808;
+ }
+ }
+yy824:
+ YYDEBUG(824, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
+ yych = *YYCURSOR;
+ goto yy825;
+yy825:
+ YYDEBUG(825, *YYCURSOR);
+ if(yych <= 'O'){
+ if(yych <= ' '){
+ if(yych <= 0x1F) goto yy56;
+ goto yy824;
+ } else {
+ if(yych != 'A') goto yy56;
+ goto yy826;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'P') goto yy826;
+ if(yych <= '`') goto yy56;
+ goto yy826;
+ } else {
+ if(yych != 'p') goto yy56;
+ goto yy826;
+ }
+ }
+yy826:
+ YYDEBUG(826, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych != '.') goto yy56;
+ goto yy827;
+ } else {
+ if(yych <= 'M') goto yy828;
+ if(yych == 'm') goto yy828;
+ goto yy56;
+ }
+yy827:
+ YYDEBUG(827, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy828;
+ if(yych != 'm') goto yy56;
+ goto yy828;
+yy828:
+ YYDEBUG(828, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '.') goto yy806;
+ goto yy805;
+yy829:
+ YYDEBUG(829, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy830;
+ if(yych != 'v') goto yy56;
+ goto yy830;
+yy830:
+ YYDEBUG(830, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy794;
+ goto yy835;
+ } else {
+ if(yych == 'e') goto yy835;
+ goto yy794;
+ }
+ }
+yy831:
+ YYDEBUG(831, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
+ yych = *YYCURSOR;
+ goto yy832;
+yy832:
+ YYDEBUG(832, *YYCURSOR);
+ if(yych <= 0x1F) goto yy56;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy833;
+yy833:
+ YYDEBUG(833, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy834;
+ if(yych <= '9') goto yy840;
+ goto yy834;
+yy834:
+ YYDEBUG(834, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("datefull");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_FULL;
+ }
+yy835:
+ YYDEBUG(835, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy836;
+ if(yych != 'm') goto yy56;
+ goto yy836;
+yy836:
+ YYDEBUG(836, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy837;
+ if(yych != 'b') goto yy56;
+ goto yy837;
+yy837:
+ YYDEBUG(837, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy838;
+ if(yych != 'e') goto yy56;
+ goto yy838;
+yy838:
+ YYDEBUG(838, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy839;
+ if(yych != 'r') goto yy56;
+ goto yy839;
+yy839:
+ YYDEBUG(839, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ if(yych <= '9') goto yy833;
+ goto yy794;
+yy840:
+ YYDEBUG(840, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych >= ':') goto yy834;
+ goto yy841;
+yy841:
+ YYDEBUG(841, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych >= ':') goto yy834;
+ goto yy842;
+yy842:
+ YYDEBUG(842, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy834;
+yy843:
+ YYDEBUG(843, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy844;
+ if(yych != 't') goto yy56;
+ goto yy844;
+yy844:
+ YYDEBUG(844, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'O'){
+ if(yych <= 'N') goto yy794;
+ goto yy845;
+ } else {
+ if(yych != 'o') goto yy794;
+ goto yy845;
+ }
+ }
+yy845:
+ YYDEBUG(845, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy846;
+ if(yych != 'b') goto yy56;
+ goto yy846;
+yy846:
+ YYDEBUG(846, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy847;
+ if(yych != 'e') goto yy56;
+ goto yy847;
+yy847:
+ YYDEBUG(847, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy839;
+ if(yych == 'r') goto yy839;
+ goto yy56;
+yy848:
+ YYDEBUG(848, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy852;
+ if(yych == 'g') goto yy852;
+ goto yy56;
+yy849:
+ YYDEBUG(849, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy850;
+ if(yych != 'r') goto yy56;
+ goto yy850;
+yy850:
+ YYDEBUG(850, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'I'){
+ if(yych <= 'H') goto yy794;
+ goto yy851;
+ } else {
+ if(yych != 'i') goto yy794;
+ goto yy851;
+ }
+ }
+yy851:
+ YYDEBUG(851, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'L') goto yy839;
+ if(yych == 'l') goto yy839;
+ goto yy56;
+yy852:
+ YYDEBUG(852, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'U'){
+ if(yych <= 'T') goto yy794;
+ goto yy853;
+ } else {
+ if(yych != 'u') goto yy794;
+ goto yy853;
+ }
+ }
+yy853:
+ YYDEBUG(853, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy854;
+ if(yych != 's') goto yy56;
+ goto yy854;
+yy854:
+ YYDEBUG(854, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy839;
+ if(yych == 't') goto yy839;
+ goto yy56;
+yy855:
+ YYDEBUG(855, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy862;
+ if(yych <= 'M') goto yy56;
+ goto yy861;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy862;
+ } else {
+ if(yych == 'n') goto yy861;
+ goto yy56;
+ }
+ }
+yy856:
+ YYDEBUG(856, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy857;
+ if(yych != 'n') goto yy56;
+ goto yy857;
+yy857:
+ YYDEBUG(857, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'U'){
+ if(yych <= 'T') goto yy794;
+ goto yy858;
+ } else {
+ if(yych != 'u') goto yy794;
+ goto yy858;
+ }
+ }
+yy858:
+ YYDEBUG(858, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy859;
+ if(yych != 'a') goto yy56;
+ goto yy859;
+yy859:
+ YYDEBUG(859, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy860;
+ if(yych != 'r') goto yy56;
+ goto yy860;
+yy860:
+ YYDEBUG(860, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy839;
+ if(yych == 'y') goto yy839;
+ goto yy56;
+yy861:
+ YYDEBUG(861, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy794;
+ goto yy839;
+ } else {
+ if(yych == 'e') goto yy839;
+ goto yy794;
+ }
+ }
+yy862:
+ YYDEBUG(862, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'Y'){
+ if(yych <= 'X') goto yy794;
+ goto yy839;
+ } else {
+ if(yych == 'y') goto yy839;
+ goto yy794;
+ }
+ }
+yy863:
+ YYDEBUG(863, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy839;
+ goto yy794;
+ }
+yy864:
+ YYDEBUG(864, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych != 'I') goto yy794;
+ goto yy865;
+ }
+yy865:
+ YYDEBUG(865, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy839;
+ goto yy794;
+ }
+yy866:
+ YYDEBUG(866, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy839;
+ goto yy794;
+ }
+yy867:
+ YYDEBUG(867, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy898;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy907;
+ if(yych <= ':') goto yy810;
+ goto yy808;
+ }
+yy868:
+ YYDEBUG(868, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy898;
+ goto yy808;
+ } else {
+ if(yych <= '2') goto yy907;
+ if(yych <= '9') goto yy823;
+ if(yych <= ':') goto yy810;
+ goto yy808;
+ }
+yy869:
+ YYDEBUG(869, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy898;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy823;
+ if(yych <= ':') goto yy810;
+ goto yy808;
+ }
+yy870:
+ YYDEBUG(870, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy898;
+ if(yych == ':') goto yy810;
+ goto yy808;
+yy871:
+ YYDEBUG(871, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy892;
+ if(yych == 'e') goto yy892;
+ goto yy56;
+yy872:
+ YYDEBUG(872, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy889;
+ if(yych == 'a') goto yy889;
+ goto yy56;
+yy873:
+ YYDEBUG(873, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy849;
+ if(yych <= 'T') goto yy56;
+ goto yy848;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy849;
+ } else {
+ if(yych == 'u') goto yy848;
+ goto yy56;
+ }
+ }
+yy874:
+ YYDEBUG(874, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy882;
+ if(yych == 'e') goto yy882;
+ goto yy56;
+yy875:
+ YYDEBUG(875, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy876;
+ if(yych != 'e') goto yy56;
+ goto yy876;
+yy876:
+ YYDEBUG(876, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy877;
+ if(yych != 'c') goto yy56;
+ goto yy877;
+yy877:
+ YYDEBUG(877, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy794;
+ goto yy878;
+ } else {
+ if(yych != 'e') goto yy794;
+ goto yy878;
+ }
+ }
+yy878:
+ YYDEBUG(878, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy879;
+ if(yych != 'm') goto yy56;
+ goto yy879;
+yy879:
+ YYDEBUG(879, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy880;
+ if(yych != 'b') goto yy56;
+ goto yy880;
+yy880:
+ YYDEBUG(880, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy881;
+ if(yych != 'e') goto yy56;
+ goto yy881;
+yy881:
+ YYDEBUG(881, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy839;
+ if(yych == 'r') goto yy839;
+ goto yy56;
+yy882:
+ YYDEBUG(882, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy883;
+ if(yych != 'p') goto yy56;
+ goto yy883;
+yy883:
+ YYDEBUG(883, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'T'){
+ if(yych <= 'S') goto yy794;
+ goto yy884;
+ } else {
+ if(yych != 't') goto yy794;
+ goto yy884;
+ }
+ }
+yy884:
+ YYDEBUG(884, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy794;
+ goto yy885;
+ } else {
+ if(yych != 'e') goto yy794;
+ goto yy885;
+ }
+ }
+yy885:
+ YYDEBUG(885, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy886;
+ if(yych != 'm') goto yy56;
+ goto yy886;
+yy886:
+ YYDEBUG(886, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy887;
+ if(yych != 'b') goto yy56;
+ goto yy887;
+yy887:
+ YYDEBUG(887, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy888;
+ if(yych != 'e') goto yy56;
+ goto yy888;
+yy888:
+ YYDEBUG(888, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy839;
+ if(yych == 'r') goto yy839;
+ goto yy56;
+yy889:
+ YYDEBUG(889, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy890;
+ if(yych <= 'X') goto yy56;
+ goto yy839;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy890;
+ } else {
+ if(yych == 'y') goto yy839;
+ goto yy56;
+ }
+ }
+yy890:
+ YYDEBUG(890, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'C'){
+ if(yych <= 'B') goto yy794;
+ goto yy891;
+ } else {
+ if(yych != 'c') goto yy794;
+ goto yy891;
+ }
+ }
+yy891:
+ YYDEBUG(891, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'H') goto yy839;
+ if(yych == 'h') goto yy839;
+ goto yy56;
+yy892:
+ YYDEBUG(892, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy893;
+ if(yych != 'b') goto yy56;
+ goto yy893;
+yy893:
+ YYDEBUG(893, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'R'){
+ if(yych <= 'Q') goto yy794;
+ goto yy894;
+ } else {
+ if(yych != 'r') goto yy794;
+ goto yy894;
+ }
+ }
+yy894:
+ YYDEBUG(894, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'U') goto yy895;
+ if(yych != 'u') goto yy56;
+ goto yy895;
+yy895:
+ YYDEBUG(895, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy896;
+ if(yych != 'a') goto yy56;
+ goto yy896;
+yy896:
+ YYDEBUG(896, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy897;
+ if(yych != 'r') goto yy56;
+ goto yy897;
+yy897:
+ YYDEBUG(897, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy839;
+ if(yych == 'y') goto yy839;
+ goto yy56;
+yy898:
+ YYDEBUG(898, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy899;
+ if(yych <= '6') goto yy900;
+ if(yych <= '9') goto yy901;
+ goto yy56;
+yy899:
+ YYDEBUG(899, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy906;
+ goto yy808;
+yy900:
+ YYDEBUG(900, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy814;
+ goto yy808;
+ } else {
+ if(yych <= '0') goto yy906;
+ if(yych <= '9') goto yy902;
+ goto yy808;
+ }
+yy901:
+ YYDEBUG(901, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych >= ':') goto yy808;
+ goto yy902;
+yy902:
+ YYDEBUG(902, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy903;
+ if(yych <= '9') goto yy904;
+ goto yy903;
+yy903:
+ YYDEBUG(903, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("pointed date");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_FULL_POINTED;
+ }
+yy904:
+ YYDEBUG(904, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy903;
+ if(yych >= ':') goto yy903;
+ goto yy905;
+yy905:
+ YYDEBUG(905, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy903;
+yy906:
+ YYDEBUG(906, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= '-'){
+ if(yych == ' ') goto yy818;
+ goto yy808;
+ } else {
+ if(yych <= '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy904;
+ goto yy808;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'A') goto yy820;
+ if(yych == 'P') goto yy820;
+ goto yy808;
+ } else {
+ if(yych <= 'a') goto yy820;
+ if(yych == 'p') goto yy820;
+ goto yy808;
+ }
+ }
+yy907:
+ YYDEBUG(907, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= '-'){
+ if(yych == ' ') goto yy824;
+ goto yy808;
+ } else {
+ if(yych <= '.') goto yy898;
+ if(yych == ':') goto yy810;
+ goto yy808;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'A') goto yy826;
+ if(yych == 'P') goto yy826;
+ goto yy808;
+ } else {
+ if(yych <= 'a') goto yy826;
+ if(yych == 'p') goto yy826;
+ goto yy808;
+ }
+ }
+yy908:
+ YYDEBUG(908, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy947;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy910;
+ goto yy56;
+yy909:
+ YYDEBUG(909, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy947;
+ if(yych <= '/') goto yy56;
+ if(yych >= '3') goto yy56;
+ goto yy910;
+yy910:
+ YYDEBUG(910, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy947;
+ goto yy56;
+yy911:
+ YYDEBUG(911, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy943;
+ if(yych <= 'T') goto yy56;
+ goto yy942;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy943;
+ } else {
+ if(yych == 'u') goto yy942;
+ goto yy56;
+ }
+ }
+yy912:
+ YYDEBUG(912, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy940;
+ if(yych == 'e') goto yy940;
+ goto yy56;
+yy913:
+ YYDEBUG(913, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy937;
+ if(yych == 'a') goto yy937;
+ goto yy56;
+yy914:
+ YYDEBUG(914, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy934;
+ if(yych <= 'T') goto yy56;
+ goto yy933;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy934;
+ } else {
+ if(yych == 'u') goto yy933;
+ goto yy56;
+ }
+ }
+yy915:
+ YYDEBUG(915, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy930;
+ if(yych == 'e') goto yy930;
+ goto yy56;
+yy916:
+ YYDEBUG(916, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy928;
+ if(yych == 'c') goto yy928;
+ goto yy56;
+yy917:
+ YYDEBUG(917, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy926;
+ if(yych == 'o') goto yy926;
+ goto yy56;
+yy918:
+ YYDEBUG(918, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy919;
+ if(yych != 'e') goto yy56;
+ goto yy919;
+yy919:
+ YYDEBUG(919, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy920;
+ if(yych != 'c') goto yy56;
+ goto yy920;
+yy920:
+ YYDEBUG(920, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'D') goto yy794;
+ goto yy878;
+ } else {
+ if(yych == 'e') goto yy878;
+ goto yy794;
+ }
+ }
+yy921:
+ YYDEBUG(921, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy832;
+ if(yych <= '0') goto yy922;
+ if(yych <= '2') goto yy923;
+ if(yych <= '3') goto yy924;
+ goto yy832;
+yy922:
+ YYDEBUG(922, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych <= '0') goto yy840;
+ if(yych <= '9') goto yy925;
+ goto yy834;
+yy923:
+ YYDEBUG(923, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych <= '9') goto yy925;
+ goto yy834;
+yy924:
+ YYDEBUG(924, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych <= '1') goto yy925;
+ if(yych <= '9') goto yy840;
+ goto yy834;
+yy925:
+ YYDEBUG(925, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych <= '9') goto yy841;
+ goto yy834;
+yy926:
+ YYDEBUG(926, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy927;
+ if(yych != 'v') goto yy56;
+ goto yy927;
+yy927:
+ YYDEBUG(927, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'D') goto yy794;
+ goto yy835;
+ } else {
+ if(yych == 'e') goto yy835;
+ goto yy794;
+ }
+ }
+yy928:
+ YYDEBUG(928, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy929;
+ if(yych != 't') goto yy56;
+ goto yy929;
+yy929:
+ YYDEBUG(929, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'O'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'N') goto yy794;
+ goto yy845;
+ } else {
+ if(yych == 'o') goto yy845;
+ goto yy794;
+ }
+ }
+yy930:
+ YYDEBUG(930, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy931;
+ if(yych != 'p') goto yy56;
+ goto yy931;
+yy931:
+ YYDEBUG(931, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'T'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'S') goto yy794;
+ goto yy932;
+ } else {
+ if(yych != 't') goto yy794;
+ goto yy932;
+ }
+ }
+yy932:
+ YYDEBUG(932, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'D') goto yy794;
+ goto yy885;
+ } else {
+ if(yych == 'e') goto yy885;
+ goto yy794;
+ }
+ }
+yy933:
+ YYDEBUG(933, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy936;
+ if(yych == 'g') goto yy936;
+ goto yy56;
+yy934:
+ YYDEBUG(934, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy935;
+ if(yych != 'r') goto yy56;
+ goto yy935;
+yy935:
+ YYDEBUG(935, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'H') goto yy794;
+ goto yy851;
+ } else {
+ if(yych == 'i') goto yy851;
+ goto yy794;
+ }
+ }
+yy936:
+ YYDEBUG(936, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'U'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'T') goto yy794;
+ goto yy853;
+ } else {
+ if(yych == 'u') goto yy853;
+ goto yy794;
+ }
+ }
+yy937:
+ YYDEBUG(937, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy938;
+ if(yych <= 'X') goto yy56;
+ goto yy939;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy938;
+ } else {
+ if(yych == 'y') goto yy939;
+ goto yy56;
+ }
+ }
+yy938:
+ YYDEBUG(938, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'C'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'B') goto yy794;
+ goto yy891;
+ } else {
+ if(yych == 'c') goto yy891;
+ goto yy794;
+ }
+ }
+yy939:
+ YYDEBUG(939, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= ',') goto yy831;
+ goto yy921;
+ } else {
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ if(yych <= '9') goto yy833;
+ goto yy794;
+ }
+yy940:
+ YYDEBUG(940, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy941;
+ if(yych != 'b') goto yy56;
+ goto yy941;
+yy941:
+ YYDEBUG(941, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'R'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'Q') goto yy794;
+ goto yy894;
+ } else {
+ if(yych == 'r') goto yy894;
+ goto yy794;
+ }
+ }
+yy942:
+ YYDEBUG(942, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy946;
+ if(yych <= 'M') goto yy56;
+ goto yy945;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy946;
+ } else {
+ if(yych == 'n') goto yy945;
+ goto yy56;
+ }
+ }
+yy943:
+ YYDEBUG(943, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy944;
+ if(yych != 'n') goto yy56;
+ goto yy944;
+yy944:
+ YYDEBUG(944, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'U'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'T') goto yy794;
+ goto yy858;
+ } else {
+ if(yych == 'u') goto yy858;
+ goto yy794;
+ }
+ }
+yy945:
+ YYDEBUG(945, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'D') goto yy794;
+ goto yy839;
+ } else {
+ if(yych == 'e') goto yy839;
+ goto yy794;
+ }
+ }
+yy946:
+ YYDEBUG(946, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'Y'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'X') goto yy794;
+ goto yy839;
+ } else {
+ if(yych == 'y') goto yy839;
+ goto yy794;
+ }
+ }
+yy947:
+ YYDEBUG(947, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '2') goto yy948;
+ if(yych <= '3') goto yy950;
+ if(yych <= '9') goto yy951;
+ goto yy56;
+yy948:
+ YYDEBUG(948, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy949;
+ if(yych <= '9') goto yy951;
+ goto yy949;
+yy949:
+ YYDEBUG(949, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("gnudateshort");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_DATE;
+ }
+yy950:
+ YYDEBUG(950, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy949;
+ if(yych >= '2') goto yy949;
+ goto yy951;
+yy951:
+ YYDEBUG(951, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy949;
+yy952:
+ YYDEBUG(952, *YYCURSOR);
+ yyaccept = 12;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.') goto yy953;
+ if(yych <= '/') goto yy1004;
+ if(yych <= '9') goto yy955;
+ goto yy953;
+yy953:
+ YYDEBUG(953, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("americanshort | american");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == '/') {
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_AMERICAN;
+ }
+yy954:
+ YYDEBUG(954, *YYCURSOR);
+ yyaccept = 12;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.') goto yy953;
+ if(yych <= '/') goto yy1004;
+ if(yych >= '2') goto yy953;
+ goto yy955;
+yy955:
+ YYDEBUG(955, *YYCURSOR);
+ yyaccept = 12;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '/') goto yy1004;
+ goto yy953;
+yy956:
+ YYDEBUG(956, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy1003;
+ if(yych <= 'T') goto yy56;
+ goto yy1002;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy1003;
+ } else {
+ if(yych == 'u') goto yy1002;
+ goto yy56;
+ }
+ }
+yy957:
+ YYDEBUG(957, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1001;
+ if(yych == 'e') goto yy1001;
+ goto yy56;
+yy958:
+ YYDEBUG(958, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1000;
+ if(yych == 'a') goto yy1000;
+ goto yy56;
+yy959:
+ YYDEBUG(959, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy999;
+ if(yych <= 'T') goto yy56;
+ goto yy998;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy999;
+ } else {
+ if(yych == 'u') goto yy998;
+ goto yy56;
+ }
+ }
+yy960:
+ YYDEBUG(960, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy996;
+ if(yych == 'e') goto yy996;
+ goto yy56;
+yy961:
+ YYDEBUG(961, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy995;
+ if(yych == 'c') goto yy995;
+ goto yy56;
+yy962:
+ YYDEBUG(962, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy994;
+ if(yych == 'o') goto yy994;
+ goto yy56;
+yy963:
+ YYDEBUG(963, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy964;
+ if(yych != 'e') goto yy56;
+ goto yy964;
+yy964:
+ YYDEBUG(964, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy965;
+ if(yych != 'c') goto yy56;
+ goto yy965;
+yy965:
+ YYDEBUG(965, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '/') goto yy56;
+ goto yy966;
+yy966:
+ YYDEBUG(966, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy967;
+yy967:
+ YYDEBUG(967, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy968;
+yy968:
+ YYDEBUG(968, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy969;
+yy969:
+ YYDEBUG(969, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy970;
+yy970:
+ YYDEBUG(970, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy971;
+yy971:
+ YYDEBUG(971, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy972;
+ if(yych <= '2') goto yy973;
+ goto yy56;
+yy972:
+ YYDEBUG(972, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy974;
+ goto yy56;
+yy973:
+ YYDEBUG(973, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '4') goto yy56;
+ goto yy974;
+yy974:
+ YYDEBUG(974, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy975;
+yy975:
+ YYDEBUG(975, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy976;
+yy976:
+ YYDEBUG(976, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy977;
+yy977:
+ YYDEBUG(977, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy978;
+yy978:
+ YYDEBUG(978, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy979;
+ if(yych <= '6') goto yy980;
+ goto yy56;
+yy979:
+ YYDEBUG(979, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy981;
+ goto yy56;
+yy980:
+ YYDEBUG(980, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '0') goto yy56;
+ goto yy981;
+yy981:
+ YYDEBUG(981, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ' ') goto yy56;
+ goto yy982;
+yy982:
+ YYDEBUG(982, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
+ yych = *YYCURSOR;
+ goto yy983;
+yy983:
+ YYDEBUG(983, *YYCURSOR);
+ if(yych <= '*'){
+ if(yych == ' ') goto yy982;
+ goto yy56;
+ } else {
+ if(yych == ',') goto yy56;
+ if(yych >= '.') goto yy56;
+ goto yy984;
+ }
+yy984:
+ YYDEBUG(984, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy985;
+ if(yych <= '2') goto yy987;
+ if(yych <= '9') goto yy988;
+ goto yy56;
+yy985:
+ YYDEBUG(985, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy986;
+ if(yych <= '5') goto yy992;
+ if(yych <= '9') goto yy988;
+ if(yych <= ':') goto yy989;
+ goto yy986;
+yy986:
+ YYDEBUG(986, *YYCURSOR);
+
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("clf");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ TIMELIB_DEINIT;
+ return TIMELIB_CLF;
+ }
+yy987:
+ YYDEBUG(987, *YYCURSOR);
+ yyaccept = 13;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '5'){
+ if(yych <= '/') goto yy986;
+ if(yych <= '3') goto yy992;
+ goto yy990;
+ } else {
+ if(yych == ':') goto yy989;
+ goto yy986;
+ }
+yy988:
+ YYDEBUG(988, *YYCURSOR);
+ yyaccept = 13;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy986;
+ if(yych <= '5') goto yy990;
+ if(yych != ':') goto yy986;
+ goto yy989;
+yy989:
+ YYDEBUG(989, *YYCURSOR);
+ yyaccept = 13;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy986;
+ if(yych >= '6') goto yy986;
+ goto yy990;
+yy990:
+ YYDEBUG(990, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy991;
+yy991:
+ YYDEBUG(991, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy986;
+yy992:
+ YYDEBUG(992, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy986;
+ if(yych <= '5') goto yy993;
+ if(yych <= '9') goto yy991;
+ if(yych <= ':') goto yy989;
+ goto yy986;
+yy993:
+ YYDEBUG(993, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy986;
+ if(yych <= '9') goto yy991;
+ goto yy986;
+yy994:
+ YYDEBUG(994, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy965;
+ if(yych == 'v') goto yy965;
+ goto yy56;
+yy995:
+ YYDEBUG(995, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy965;
+ if(yych == 't') goto yy965;
+ goto yy56;
+yy996:
+ YYDEBUG(996, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy997;
+ if(yych != 'p') goto yy56;
+ goto yy997;
+yy997:
+ YYDEBUG(997, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych == '/') goto yy966;
+ goto yy56;
+ } else {
+ if(yych <= 'T') goto yy965;
+ if(yych == 't') goto yy965;
+ goto yy56;
+ }
+yy998:
+ YYDEBUG(998, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy965;
+ if(yych == 'g') goto yy965;
+ goto yy56;
+yy999:
+ YYDEBUG(999, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy965;
+ if(yych == 'r') goto yy965;
+ goto yy56;
+yy1000:
+ YYDEBUG(1000, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy965;
+ if(yych <= 'X') goto yy56;
+ goto yy965;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy965;
+ } else {
+ if(yych == 'y') goto yy965;
+ goto yy56;
+ }
+ }
+yy1001:
+ YYDEBUG(1001, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy965;
+ if(yych == 'b') goto yy965;
+ goto yy56;
+yy1002:
+ YYDEBUG(1002, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy965;
+ if(yych <= 'M') goto yy56;
+ goto yy965;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy965;
+ } else {
+ if(yych == 'n') goto yy965;
+ goto yy56;
+ }
+ }
+yy1003:
+ YYDEBUG(1003, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy965;
+ if(yych == 'n') goto yy965;
+ goto yy56;
+yy1004:
+ YYDEBUG(1004, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1005;
+yy1005:
+ YYDEBUG(1005, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy953;
+ if(yych >= ':') goto yy953;
+ goto yy1006;
+yy1006:
+ YYDEBUG(1006, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy953;
+ if(yych >= ':') goto yy953;
+ goto yy1007;
+yy1007:
+ YYDEBUG(1007, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy953;
+ if(yych >= ':') goto yy953;
+ goto yy1008;
+yy1008:
+ YYDEBUG(1008, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy953;
+yy1009:
+ YYDEBUG(1009, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy1010;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1037;
+ goto yy70;
+yy1010:
+ YYDEBUG(1010, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0': goto yy908;
+ case '1': goto yy909;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy910;
+ case 'A': case 'a': goto yy1014;
+ case 'D': case 'd': goto yy1018;
+ case 'F': case 'f': goto yy1012;
+ case 'J': case 'j': goto yy1011;
+ case 'M': case 'm': goto yy1013;
+ case 'N': case 'n': goto yy1017;
+ case 'O': case 'o': goto yy1016;
+ case 'S': case 's': goto yy1015;
+ default: goto yy56;
+ }
+yy1011:
+ YYDEBUG(1011, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy1036;
+ if(yych <= 'T') goto yy56;
+ goto yy1035;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy1036;
+ } else {
+ if(yych == 'u') goto yy1035;
+ goto yy56;
+ }
+ }
+yy1012:
+ YYDEBUG(1012, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1034;
+ if(yych == 'e') goto yy1034;
+ goto yy56;
+yy1013:
+ YYDEBUG(1013, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1033;
+ if(yych == 'a') goto yy1033;
+ goto yy56;
+yy1014:
+ YYDEBUG(1014, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy1032;
+ if(yych <= 'T') goto yy56;
+ goto yy1031;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy1032;
+ } else {
+ if(yych == 'u') goto yy1031;
+ goto yy56;
+ }
+ }
+yy1015:
+ YYDEBUG(1015, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1029;
+ if(yych == 'e') goto yy1029;
+ goto yy56;
+yy1016:
+ YYDEBUG(1016, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1028;
+ if(yych == 'c') goto yy1028;
+ goto yy56;
+yy1017:
+ YYDEBUG(1017, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy1027;
+ if(yych == 'o') goto yy1027;
+ goto yy56;
+yy1018:
+ YYDEBUG(1018, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1019;
+ if(yych != 'e') goto yy56;
+ goto yy1019;
+yy1019:
+ YYDEBUG(1019, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1020;
+ if(yych != 'c') goto yy56;
+ goto yy1020;
+yy1020:
+ YYDEBUG(1020, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '-') goto yy56;
+ goto yy1021;
+yy1021:
+ YYDEBUG(1021, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1022;
+ if(yych <= '2') goto yy1023;
+ if(yych <= '3') goto yy1024;
+ goto yy56;
+yy1022:
+ YYDEBUG(1022, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '0') goto yy56;
+ if(yych <= '9') goto yy1025;
+ goto yy56;
+yy1023:
+ YYDEBUG(1023, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1025;
+ goto yy56;
+yy1024:
+ YYDEBUG(1024, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '2') goto yy56;
+ goto yy1025;
+yy1025:
+ YYDEBUG(1025, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1026;
+yy1026:
+ YYDEBUG(1026, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("pgtextreverse");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_PG_TEXT;
+ }
+yy1027:
+ YYDEBUG(1027, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy1020;
+ if(yych == 'v') goto yy1020;
+ goto yy56;
+yy1028:
+ YYDEBUG(1028, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1020;
+ if(yych == 't') goto yy1020;
+ goto yy56;
+yy1029:
+ YYDEBUG(1029, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy1030;
+ if(yych != 'p') goto yy56;
+ goto yy1030;
+yy1030:
+ YYDEBUG(1030, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych == '-') goto yy1021;
+ goto yy56;
+ } else {
+ if(yych <= 'T') goto yy1020;
+ if(yych == 't') goto yy1020;
+ goto yy56;
+ }
+yy1031:
+ YYDEBUG(1031, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy1020;
+ if(yych == 'g') goto yy1020;
+ goto yy56;
+yy1032:
+ YYDEBUG(1032, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1020;
+ if(yych == 'r') goto yy1020;
+ goto yy56;
+yy1033:
+ YYDEBUG(1033, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy1020;
+ if(yych <= 'X') goto yy56;
+ goto yy1020;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy1020;
+ } else {
+ if(yych == 'y') goto yy1020;
+ goto yy56;
+ }
+ }
+yy1034:
+ YYDEBUG(1034, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1020;
+ if(yych == 'b') goto yy1020;
+ goto yy56;
+yy1035:
+ YYDEBUG(1035, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy1020;
+ if(yych <= 'M') goto yy56;
+ goto yy1020;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy1020;
+ } else {
+ if(yych == 'n') goto yy1020;
+ goto yy56;
+ }
+ }
+yy1036:
+ YYDEBUG(1036, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy1020;
+ if(yych == 'n') goto yy1020;
+ goto yy56;
+yy1037:
+ YYDEBUG(1037, *YYCURSOR);
+ yyaccept = 14;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O': case 'S':
+ case 'T': case 'V': case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o': case 's':
+ case 't': case 'w': case 'y': goto yy1042;
+ case '-': goto yy1039;
+ case '.': goto yy1045;
+ case '/': goto yy1040;
+ case '0': goto yy1058;
+ case '1': goto yy1059;
+ case '2': goto yy1060;
+ case '3': goto yy1061;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case 'W': goto yy1062;
+ default: goto yy1038;
+ }
+yy1038:
+ YYDEBUG(1038, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("year4");
+ TIMELIB_INIT;
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_DEINIT;
+ return TIMELIB_CLF;
+ }
+yy1039:
+ YYDEBUG(1039, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0': goto yy1199;
+ case '1': goto yy1200;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy910;
+ case 'A': case 'a': goto yy1194;
+ case 'D': case 'd': goto yy1198;
+ case 'F': case 'f': goto yy1192;
+ case 'J': case 'j': goto yy1191;
+ case 'M': case 'm': goto yy1193;
+ case 'N': case 'n': goto yy1197;
+ case 'O': case 'o': goto yy1196;
+ case 'S': case 's': goto yy1195;
+ default: goto yy1044;
+ }
+yy1040:
+ YYDEBUG(1040, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1177;
+ if(yych <= '1') goto yy1178;
+ if(yych <= '9') goto yy1179;
+ goto yy56;
+yy1041:
+ YYDEBUG(1041, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
+ yych = *YYCURSOR;
+ goto yy1042;
+yy1042:
+ YYDEBUG(1042, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy1041;
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy1043;
+ case 'A': case 'a': goto yy1053;
+ case 'D': case 'd': goto yy1057;
+ case 'F': case 'f': goto yy1051;
+ case 'H': case 'h': goto yy73;
+ case 'I': goto yy1046;
+ case 'J': case 'j': goto yy1050;
+ case 'M': case 'm': goto yy1052;
+ case 'N': case 'n': goto yy1056;
+ case 'O': case 'o': goto yy1055;
+ case 'S': case 's': goto yy1054;
+ case 'T': case 't': goto yy78;
+ case 'V': goto yy1048;
+ case 'W': case 'w': goto yy75;
+ case 'X': goto yy1049;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy1043:
+ YYDEBUG(1043, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
+ yych = *YYCURSOR;
+ goto yy1044;
+yy1044:
+ YYDEBUG(1044, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy1043;
+ case 'A': case 'a': goto yy1053;
+ case 'D': case 'd': goto yy1169;
+ case 'F': case 'f': goto yy1166;
+ case 'I': goto yy1046;
+ case 'J': case 'j': goto yy1050;
+ case 'M': case 'm': goto yy1167;
+ case 'N': case 'n': goto yy1056;
+ case 'O': case 'o': goto yy1055;
+ case 'S': case 's': goto yy1168;
+ case 'V': goto yy1048;
+ case 'X': goto yy1049;
+ default: goto yy56;
+ }
+yy1045:
+ YYDEBUG(1045, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1044;
+ if(yych <= '0') goto yy1163;
+ if(yych <= '2') goto yy1164;
+ if(yych <= '3') goto yy1165;
+ goto yy1044;
+yy1046:
+ YYDEBUG(1046, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= 'U'){
+ if(yych == 'I') goto yy1162;
+ goto yy1047;
+ } else {
+ if(yych == 'W') goto yy1047;
+ if(yych <= 'X') goto yy1116;
+ goto yy1047;
+ }
+yy1047:
+ YYDEBUG(1047, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("datenodayrev");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = 1;
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_NO_DAY;
+ }
+yy1048:
+ YYDEBUG(1048, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1160;
+ goto yy1047;
+yy1049:
+ YYDEBUG(1049, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1159;
+ goto yy1047;
+yy1050:
+ YYDEBUG(1050, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy1152;
+ if(yych <= 'T') goto yy56;
+ goto yy1151;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy1152;
+ } else {
+ if(yych == 'u') goto yy1151;
+ goto yy56;
+ }
+ }
+yy1051:
+ YYDEBUG(1051, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= 'N'){
+ if(yych == 'E') goto yy1145;
+ goto yy56;
+ } else {
+ if(yych <= 'O') goto yy99;
+ if(yych <= 'Q') goto yy56;
+ goto yy98;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych == 'e') goto yy1145;
+ goto yy56;
+ } else {
+ if(yych <= 'o') goto yy99;
+ if(yych == 'r') goto yy98;
+ goto yy56;
+ }
+ }
+yy1052:
+ YYDEBUG(1052, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= 'H'){
+ if(yych == 'A') goto yy1142;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy126;
+ if(yych <= 'N') goto yy56;
+ goto yy125;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych == 'a') goto yy1142;
+ goto yy56;
+ } else {
+ if(yych <= 'i') goto yy126;
+ if(yych == 'o') goto yy125;
+ goto yy56;
+ }
+ }
+yy1053:
+ YYDEBUG(1053, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy1136;
+ if(yych <= 'T') goto yy56;
+ goto yy1135;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy1136;
+ } else {
+ if(yych == 'u') goto yy1135;
+ goto yy56;
+ }
+ }
+yy1054:
+ YYDEBUG(1054, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych == 'A') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy1128;
+ if(yych <= 'T') goto yy56;
+ goto yy135;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych == 'a') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'e') goto yy1128;
+ if(yych == 'u') goto yy135;
+ goto yy56;
+ }
+ }
+yy1055:
+ YYDEBUG(1055, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1123;
+ if(yych == 'c') goto yy1123;
+ goto yy56;
+yy1056:
+ YYDEBUG(1056, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy1117;
+ if(yych == 'o') goto yy1117;
+ goto yy56;
+yy1057:
+ YYDEBUG(1057, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych == 'A') goto yy122;
+ if(yych <= 'D') goto yy56;
+ goto yy1110;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy122;
+ } else {
+ if(yych == 'e') goto yy1110;
+ goto yy56;
+ }
+ }
+yy1058:
+ YYDEBUG(1058, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy1108;
+ if(yych <= '9') goto yy1109;
+ goto yy70;
+yy1059:
+ YYDEBUG(1059, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '2') goto yy1075;
+ if(yych <= '9') goto yy1074;
+ goto yy70;
+yy1060:
+ YYDEBUG(1060, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1074;
+ goto yy70;
+yy1061:
+ YYDEBUG(1061, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '5') goto yy1070;
+ if(yych <= '6') goto yy1071;
+ if(yych <= '9') goto yy79;
+ goto yy70;
+yy1062:
+ YYDEBUG(1062, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '5'){
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1063;
+ if(yych <= '4') goto yy1064;
+ goto yy1065;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy56;
+ goto yy114;
+ } else {
+ if(yych == 'e') goto yy114;
+ goto yy56;
+ }
+ }
+yy1063:
+ YYDEBUG(1063, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '0') goto yy56;
+ if(yych <= '9') goto yy1066;
+ goto yy56;
+yy1064:
+ YYDEBUG(1064, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1066;
+ goto yy56;
+yy1065:
+ YYDEBUG(1065, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '4') goto yy56;
+ goto yy1066;
+yy1066:
+ YYDEBUG(1066, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy1067;
+ if(yych <= '7') goto yy1068;
+ goto yy1067;
+yy1067:
+ YYDEBUG(1067, *YYCURSOR);
+
+{
+ timelib_sll w, d;
+ DEBUG_OUTPUT("isoweek");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ TIMELIB_HAVE_RELATIVE();
+
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ w = timelib_get_nr((char **) &ptr, 2);
+ d = 1;
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
+
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_WEEK;
+ }
+yy1068:
+ YYDEBUG(1068, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1069;
+yy1069:
+ YYDEBUG(1069, *YYCURSOR);
+
+{
+ timelib_sll w, d;
+ DEBUG_OUTPUT("isoweekday");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ TIMELIB_HAVE_RELATIVE();
+
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ w = timelib_get_nr((char **) &ptr, 2);
+ d = timelib_get_nr((char **) &ptr, 1);
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
+
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_WEEK;
+ }
+yy1070:
+ YYDEBUG(1070, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+yy1071:
+ YYDEBUG(1071, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '6') goto yy1072;
+ if(yych <= '9') goto yy79;
+ goto yy70;
+yy1072:
+ YYDEBUG(1072, *YYCURSOR);
+ yyaccept = 15;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'X'){
+ if(yych <= 'G'){
+ if(yych <= 'C'){
+ if(yych == ' ') goto yy70;
+ goto yy1073;
+ } else {
+ if(yych == 'E') goto yy1073;
+ if(yych <= 'F') goto yy70;
+ goto yy1073;
+ }
+ } else {
+ if(yych <= 'R'){
+ if(yych <= 'H') goto yy70;
+ if(yych == 'M') goto yy70;
+ goto yy1073;
+ } else {
+ if(yych <= 'T') goto yy70;
+ if(yych == 'W') goto yy70;
+ goto yy1073;
+ }
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'e'){
+ if(yych <= 'Y') goto yy70;
+ if(yych == 'd') goto yy70;
+ goto yy1073;
+ } else {
+ if(yych == 'g') goto yy1073;
+ if(yych <= 'h') goto yy70;
+ goto yy1073;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych <= 'm') goto yy70;
+ if(yych <= 'r') goto yy1073;
+ if(yych <= 't') goto yy70;
+ goto yy1073;
+ } else {
+ if(yych == 'x') goto yy1073;
+ if(yych <= 'y') goto yy70;
+ goto yy1073;
+ }
+ }
+ }
+yy1073:
+ YYDEBUG(1073, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("pgydotd");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->d = timelib_get_nr((char **) &ptr, 3);
+ s->time->m = 1;
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_PG_YEARDAY;
+ }
+yy1074:
+ YYDEBUG(1074, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+yy1075:
+ YYDEBUG(1075, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy70;
+ if(yych >= '1') goto yy1077;
+ goto yy1076;
+ } else {
+ if(yych <= '3') goto yy1078;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+ }
+yy1076:
+ YYDEBUG(1076, *YYCURSOR);
+ yyaccept = 15;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0': goto yy79;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1079;
+ default: goto yy1073;
+ }
+yy1077:
+ YYDEBUG(1077, *YYCURSOR);
+ yyaccept = 15;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1079;
+ default: goto yy1073;
+ }
+yy1078:
+ YYDEBUG(1078, *YYCURSOR);
+ yyaccept = 15;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1': goto yy1079;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ default: goto yy1073;
+ }
+yy1079:
+ YYDEBUG(1079, *YYCURSOR);
+ yyaccept = 16;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 16) {
+ goto yy69;
+ }
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case 'D': case 'd': goto yy74;
+ case 'F': case 'f': goto yy76;
+ case 'H': case 'h': goto yy73;
+ case 'M': case 'm': goto yy72;
+ case 'S': case 's': goto yy71;
+ case 'T': goto yy1081;
+ case 'W': case 'w': goto yy75;
+ case 'Y': case 'y': goto yy77;
+ case 't': goto yy1082;
+ default: goto yy1080;
+ }
+yy1080:
+ YYDEBUG(1080, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("datenocolon");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_NOCOLON;
+ }
+yy1081:
+ YYDEBUG(1081, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'H'){
+ if(yych <= '2'){
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy1098;
+ goto yy1099;
+ } else {
+ if(yych <= '9') goto yy1100;
+ if(yych <= 'G') goto yy56;
+ goto yy81;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych == 'U') goto yy82;
+ goto yy56;
+ } else {
+ if(yych <= 'h') goto yy81;
+ if(yych == 'u') goto yy82;
+ goto yy56;
+ }
+ }
+yy1082:
+ YYDEBUG(1082, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'H'){
+ if(yych <= '2'){
+ if(yych <= '/') goto yy56;
+ if(yych >= '2') goto yy1084;
+ goto yy1083;
+ } else {
+ if(yych <= '9') goto yy1085;
+ if(yych <= 'G') goto yy56;
+ goto yy81;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych == 'U') goto yy82;
+ goto yy56;
+ } else {
+ if(yych <= 'h') goto yy81;
+ if(yych == 'u') goto yy82;
+ goto yy56;
+ }
+ }
+yy1083:
+ YYDEBUG(1083, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1092;
+ if(yych <= '9') goto yy1085;
+ goto yy56;
+yy1084:
+ YYDEBUG(1084, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '3') goto yy1092;
+ if(yych <= '5') goto yy1086;
+ goto yy56;
+yy1085:
+ YYDEBUG(1085, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy1086;
+yy1086:
+ YYDEBUG(1086, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1087;
+yy1087:
+ YYDEBUG(1087, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1088;
+ if(yych <= '6') goto yy1089;
+ goto yy56;
+yy1088:
+ YYDEBUG(1088, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1089:
+ YYDEBUG(1089, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '0') goto yy56;
+ goto yy1090;
+yy1090:
+ YYDEBUG(1090, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1091;
+yy1091:
+ YYDEBUG(1091, *YYCURSOR);
+
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_XMLRPC_SOAP;
+ }
+yy1092:
+ YYDEBUG(1092, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1093;
+ if(yych <= '9') goto yy1087;
+ goto yy56;
+yy1093:
+ YYDEBUG(1093, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1094;
+ if(yych <= '6') goto yy1095;
+ if(yych <= '9') goto yy1087;
+ goto yy56;
+yy1094:
+ YYDEBUG(1094, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1096;
+ if(yych <= '6') goto yy1097;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1095:
+ YYDEBUG(1095, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1096;
+ if(yych <= '5') goto yy1088;
+ if(yych <= '6') goto yy1089;
+ goto yy56;
+yy1096:
+ YYDEBUG(1096, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1091;
+ if(yych <= '9') goto yy1090;
+ goto yy1091;
+yy1097:
+ YYDEBUG(1097, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '0') goto yy1090;
+ goto yy1091;
+yy1098:
+ YYDEBUG(1098, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1107;
+ if(yych <= '9') goto yy1100;
+ if(yych <= ':') goto yy1101;
+ goto yy56;
+yy1099:
+ YYDEBUG(1099, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '5'){
+ if(yych <= '/') goto yy56;
+ if(yych <= '3') goto yy1107;
+ goto yy1086;
+ } else {
+ if(yych == ':') goto yy1101;
+ goto yy56;
+ }
+yy1100:
+ YYDEBUG(1100, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1086;
+ if(yych != ':') goto yy56;
+ goto yy1101;
+yy1101:
+ YYDEBUG(1101, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy1102;
+yy1102:
+ YYDEBUG(1102, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1103;
+yy1103:
+ YYDEBUG(1103, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1104;
+yy1104:
+ YYDEBUG(1104, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1105;
+ if(yych <= '6') goto yy1106;
+ goto yy56;
+yy1105:
+ YYDEBUG(1105, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1106:
+ YYDEBUG(1106, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '0') goto yy1090;
+ goto yy56;
+yy1107:
+ YYDEBUG(1107, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1093;
+ if(yych <= '9') goto yy1087;
+ if(yych <= ':') goto yy1101;
+ goto yy56;
+yy1108:
+ YYDEBUG(1108, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy79;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+yy1109:
+ YYDEBUG(1109, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy1076;
+ goto yy1077;
+ } else {
+ if(yych <= '3') goto yy1078;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+ }
+yy1110:
+ YYDEBUG(1110, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1111;
+ if(yych != 'c') goto yy56;
+ goto yy1111;
+yy1111:
+ YYDEBUG(1111, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'E') goto yy1112;
+ if(yych != 'e') goto yy1047;
+ goto yy1112;
+yy1112:
+ YYDEBUG(1112, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy1113;
+ if(yych != 'm') goto yy56;
+ goto yy1113;
+yy1113:
+ YYDEBUG(1113, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1114;
+ if(yych != 'b') goto yy56;
+ goto yy1114;
+yy1114:
+ YYDEBUG(1114, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1115;
+ if(yych != 'e') goto yy56;
+ goto yy1115;
+yy1115:
+ YYDEBUG(1115, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1116;
+ if(yych != 'r') goto yy56;
+ goto yy1116;
+yy1116:
+ YYDEBUG(1116, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy1047;
+yy1117:
+ YYDEBUG(1117, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy1118;
+ if(yych != 'v') goto yy56;
+ goto yy1118;
+yy1118:
+ YYDEBUG(1118, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'E') goto yy1119;
+ if(yych != 'e') goto yy1047;
+ goto yy1119;
+yy1119:
+ YYDEBUG(1119, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy1120;
+ if(yych != 'm') goto yy56;
+ goto yy1120;
+yy1120:
+ YYDEBUG(1120, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1121;
+ if(yych != 'b') goto yy56;
+ goto yy1121;
+yy1121:
+ YYDEBUG(1121, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1122;
+ if(yych != 'e') goto yy56;
+ goto yy1122;
+yy1122:
+ YYDEBUG(1122, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1116;
+ if(yych == 'r') goto yy1116;
+ goto yy56;
+yy1123:
+ YYDEBUG(1123, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1124;
+ if(yych != 't') goto yy56;
+ goto yy1124;
+yy1124:
+ YYDEBUG(1124, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'O') goto yy1125;
+ if(yych != 'o') goto yy1047;
+ goto yy1125;
+yy1125:
+ YYDEBUG(1125, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1126;
+ if(yych != 'b') goto yy56;
+ goto yy1126;
+yy1126:
+ YYDEBUG(1126, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1127;
+ if(yych != 'e') goto yy56;
+ goto yy1127;
+yy1127:
+ YYDEBUG(1127, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1116;
+ if(yych == 'r') goto yy1116;
+ goto yy56;
+yy1128:
+ YYDEBUG(1128, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'P'){
+ if(yych == 'C') goto yy137;
+ if(yych <= 'O') goto yy56;
+ goto yy1129;
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'b') goto yy56;
+ goto yy137;
+ } else {
+ if(yych != 'p') goto yy56;
+ goto yy1129;
+ }
+ }
+yy1129:
+ YYDEBUG(1129, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1130;
+ if(yych != 't') goto yy1047;
+ goto yy1130;
+yy1130:
+ YYDEBUG(1130, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'E') goto yy1131;
+ if(yych != 'e') goto yy1047;
+ goto yy1131;
+yy1131:
+ YYDEBUG(1131, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy1132;
+ if(yych != 'm') goto yy56;
+ goto yy1132;
+yy1132:
+ YYDEBUG(1132, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1133;
+ if(yych != 'b') goto yy56;
+ goto yy1133;
+yy1133:
+ YYDEBUG(1133, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1134;
+ if(yych != 'e') goto yy56;
+ goto yy1134;
+yy1134:
+ YYDEBUG(1134, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1116;
+ if(yych == 'r') goto yy1116;
+ goto yy56;
+yy1135:
+ YYDEBUG(1135, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy1139;
+ if(yych == 'g') goto yy1139;
+ goto yy56;
+yy1136:
+ YYDEBUG(1136, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1137;
+ if(yych != 'r') goto yy56;
+ goto yy1137;
+yy1137:
+ YYDEBUG(1137, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'I') goto yy1138;
+ if(yych != 'i') goto yy1047;
+ goto yy1138;
+yy1138:
+ YYDEBUG(1138, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'L') goto yy1116;
+ if(yych == 'l') goto yy1116;
+ goto yy56;
+yy1139:
+ YYDEBUG(1139, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'U') goto yy1140;
+ if(yych != 'u') goto yy1047;
+ goto yy1140;
+yy1140:
+ YYDEBUG(1140, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy1141;
+ if(yych != 's') goto yy56;
+ goto yy1141;
+yy1141:
+ YYDEBUG(1141, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1116;
+ if(yych == 't') goto yy1116;
+ goto yy56;
+yy1142:
+ YYDEBUG(1142, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy1143;
+ if(yych <= 'X') goto yy56;
+ goto yy1116;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy1143;
+ } else {
+ if(yych == 'y') goto yy1116;
+ goto yy56;
+ }
+ }
+yy1143:
+ YYDEBUG(1143, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'C') goto yy1144;
+ if(yych != 'c') goto yy1047;
+ goto yy1144;
+yy1144:
+ YYDEBUG(1144, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'H') goto yy1116;
+ if(yych == 'h') goto yy1116;
+ goto yy56;
+yy1145:
+ YYDEBUG(1145, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1146;
+ if(yych != 'b') goto yy56;
+ goto yy1146;
+yy1146:
+ YYDEBUG(1146, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'R') goto yy1147;
+ if(yych != 'r') goto yy1047;
+ goto yy1147;
+yy1147:
+ YYDEBUG(1147, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'U') goto yy1148;
+ if(yych != 'u') goto yy56;
+ goto yy1148;
+yy1148:
+ YYDEBUG(1148, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1149;
+ if(yych != 'a') goto yy56;
+ goto yy1149;
+yy1149:
+ YYDEBUG(1149, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1150;
+ if(yych != 'r') goto yy56;
+ goto yy1150;
+yy1150:
+ YYDEBUG(1150, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy1116;
+ if(yych == 'y') goto yy1116;
+ goto yy56;
+yy1151:
+ YYDEBUG(1151, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy1158;
+ if(yych <= 'M') goto yy56;
+ goto yy1157;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy1158;
+ } else {
+ if(yych == 'n') goto yy1157;
+ goto yy56;
+ }
+ }
+yy1152:
+ YYDEBUG(1152, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy1153;
+ if(yych != 'n') goto yy56;
+ goto yy1153;
+yy1153:
+ YYDEBUG(1153, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'U') goto yy1154;
+ if(yych != 'u') goto yy1047;
+ goto yy1154;
+yy1154:
+ YYDEBUG(1154, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1155;
+ if(yych != 'a') goto yy56;
+ goto yy1155;
+yy1155:
+ YYDEBUG(1155, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1156;
+ if(yych != 'r') goto yy56;
+ goto yy1156;
+yy1156:
+ YYDEBUG(1156, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy1116;
+ if(yych == 'y') goto yy1116;
+ goto yy56;
+yy1157:
+ YYDEBUG(1157, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1116;
+ if(yych == 'e') goto yy1116;
+ goto yy1047;
+yy1158:
+ YYDEBUG(1158, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy1116;
+ if(yych == 'y') goto yy1116;
+ goto yy1047;
+yy1159:
+ YYDEBUG(1159, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1116;
+ goto yy1047;
+yy1160:
+ YYDEBUG(1160, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'I') goto yy1047;
+ goto yy1161;
+yy1161:
+ YYDEBUG(1161, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1116;
+ goto yy1047;
+yy1162:
+ YYDEBUG(1162, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1116;
+ goto yy1047;
+yy1163:
+ YYDEBUG(1163, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1176;
+ if(yych <= '9') goto yy1175;
+ goto yy56;
+yy1164:
+ YYDEBUG(1164, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1174;
+ goto yy56;
+yy1165:
+ YYDEBUG(1165, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1172;
+ if(yych <= '6') goto yy1171;
+ goto yy56;
+yy1166:
+ YYDEBUG(1166, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1145;
+ if(yych == 'e') goto yy1145;
+ goto yy56;
+yy1167:
+ YYDEBUG(1167, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1142;
+ if(yych == 'a') goto yy1142;
+ goto yy56;
+yy1168:
+ YYDEBUG(1168, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1170;
+ if(yych == 'e') goto yy1170;
+ goto yy56;
+yy1169:
+ YYDEBUG(1169, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1110;
+ if(yych == 'e') goto yy1110;
+ goto yy56;
+yy1170:
+ YYDEBUG(1170, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy1129;
+ if(yych == 'p') goto yy1129;
+ goto yy56;
+yy1171:
+ YYDEBUG(1171, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '6') goto yy1173;
+ goto yy56;
+yy1172:
+ YYDEBUG(1172, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1173;
+yy1173:
+ YYDEBUG(1173, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy1073;
+yy1174:
+ YYDEBUG(1174, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1173;
+ goto yy56;
+yy1175:
+ YYDEBUG(1175, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1173;
+ goto yy56;
+yy1176:
+ YYDEBUG(1176, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '0') goto yy56;
+ if(yych <= '9') goto yy1173;
+ goto yy56;
+yy1177:
+ YYDEBUG(1177, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '.') goto yy56;
+ if(yych <= '/') goto yy1180;
+ if(yych <= '0') goto yy1179;
+ if(yych <= '9') goto yy1185;
+ goto yy56;
+yy1178:
+ YYDEBUG(1178, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '.') goto yy56;
+ if(yych <= '/') goto yy1180;
+ if(yych <= '2') goto yy1185;
+ goto yy56;
+yy1179:
+ YYDEBUG(1179, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '/') goto yy56;
+ goto yy1180;
+yy1180:
+ YYDEBUG(1180, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '2') goto yy1181;
+ if(yych <= '3') goto yy1183;
+ if(yych <= '9') goto yy1184;
+ goto yy56;
+yy1181:
+ YYDEBUG(1181, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy1182;
+ if(yych <= '9') goto yy1184;
+ goto yy1182;
+yy1182:
+ YYDEBUG(1182, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_DATE;
+ }
+yy1183:
+ YYDEBUG(1183, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1182;
+ if(yych >= '2') goto yy1182;
+ goto yy1184;
+yy1184:
+ YYDEBUG(1184, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy1182;
+yy1185:
+ YYDEBUG(1185, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '/') goto yy56;
+ goto yy1186;
+yy1186:
+ YYDEBUG(1186, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy56;
+ if(yych >= '1') goto yy1188;
+ goto yy1187;
+ } else {
+ if(yych <= '3') goto yy1189;
+ if(yych <= '9') goto yy1184;
+ goto yy56;
+ }
+yy1187:
+ YYDEBUG(1187, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1182;
+ if(yych <= '0') goto yy1184;
+ if(yych <= '9') goto yy1190;
+ goto yy1182;
+yy1188:
+ YYDEBUG(1188, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1182;
+ if(yych <= '9') goto yy1190;
+ goto yy1182;
+yy1189:
+ YYDEBUG(1189, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1182;
+ if(yych >= '2') goto yy1182;
+ goto yy1190;
+yy1190:
+ YYDEBUG(1190, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '/') goto yy1184;
+ goto yy1182;
+yy1191:
+ YYDEBUG(1191, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy1255;
+ if(yych <= 'T') goto yy56;
+ goto yy1254;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy1255;
+ } else {
+ if(yych == 'u') goto yy1254;
+ goto yy56;
+ }
+ }
+yy1192:
+ YYDEBUG(1192, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1252;
+ if(yych == 'e') goto yy1252;
+ goto yy56;
+yy1193:
+ YYDEBUG(1193, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1249;
+ if(yych == 'a') goto yy1249;
+ goto yy56;
+yy1194:
+ YYDEBUG(1194, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy1246;
+ if(yych <= 'T') goto yy56;
+ goto yy1245;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy1246;
+ } else {
+ if(yych == 'u') goto yy1245;
+ goto yy56;
+ }
+ }
+yy1195:
+ YYDEBUG(1195, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1242;
+ if(yych == 'e') goto yy1242;
+ goto yy56;
+yy1196:
+ YYDEBUG(1196, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1240;
+ if(yych == 'c') goto yy1240;
+ goto yy56;
+yy1197:
+ YYDEBUG(1197, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy1238;
+ if(yych == 'o') goto yy1238;
+ goto yy56;
+yy1198:
+ YYDEBUG(1198, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1236;
+ if(yych == 'e') goto yy1236;
+ goto yy56;
+yy1199:
+ YYDEBUG(1199, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/'){
+ if(yych == '-') goto yy947;
+ goto yy56;
+ } else {
+ if(yych <= '0') goto yy910;
+ if(yych <= '9') goto yy1201;
+ goto yy56;
+ }
+yy1200:
+ YYDEBUG(1200, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy947;
+ if(yych <= '/') goto yy56;
+ if(yych >= '3') goto yy56;
+ goto yy1201;
+yy1201:
+ YYDEBUG(1201, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '-') goto yy56;
+ goto yy1202;
+yy1202:
+ YYDEBUG(1202, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy56;
+ if(yych >= '1') goto yy1204;
+ goto yy1203;
+ } else {
+ if(yych <= '3') goto yy1205;
+ if(yych <= '9') goto yy951;
+ goto yy56;
+ }
+yy1203:
+ YYDEBUG(1203, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy949;
+ if(yych <= '0') goto yy951;
+ if(yych <= '9') goto yy1206;
+ goto yy949;
+yy1204:
+ YYDEBUG(1204, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy949;
+ if(yych <= '9') goto yy1206;
+ goto yy949;
+yy1205:
+ YYDEBUG(1205, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy949;
+ if(yych >= '2') goto yy949;
+ goto yy1206;
+yy1206:
+ YYDEBUG(1206, *YYCURSOR);
+ yyaccept = 18;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != 'T') goto yy1182;
+ goto yy1207;
+yy1207:
+ YYDEBUG(1207, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy1208;
+ if(yych <= '2') goto yy1209;
+ if(yych <= '9') goto yy1210;
+ goto yy56;
+yy1208:
+ YYDEBUG(1208, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1217;
+ if(yych <= ':') goto yy1211;
+ goto yy56;
+yy1209:
+ YYDEBUG(1209, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '3') goto yy1217;
+ if(yych == ':') goto yy1211;
+ goto yy56;
+yy1210:
+ YYDEBUG(1210, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1211;
+yy1211:
+ YYDEBUG(1211, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy1212;
+yy1212:
+ YYDEBUG(1212, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1213;
+yy1213:
+ YYDEBUG(1213, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1214;
+yy1214:
+ YYDEBUG(1214, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1215;
+ if(yych <= '6') goto yy1216;
+ goto yy56;
+yy1215:
+ YYDEBUG(1215, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1216:
+ YYDEBUG(1216, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '0') goto yy1090;
+ goto yy56;
+yy1217:
+ YYDEBUG(1217, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1218;
+yy1218:
+ YYDEBUG(1218, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy1219;
+yy1219:
+ YYDEBUG(1219, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1220;
+yy1220:
+ YYDEBUG(1220, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1221;
+yy1221:
+ YYDEBUG(1221, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1222;
+ if(yych <= '6') goto yy1223;
+ goto yy56;
+yy1222:
+ YYDEBUG(1222, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1224;
+ goto yy56;
+yy1223:
+ YYDEBUG(1223, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '0') goto yy56;
+ goto yy1224;
+yy1224:
+ YYDEBUG(1224, *YYCURSOR);
+ yyaccept = 19;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != '.') goto yy1091;
+ goto yy1225;
+yy1225:
+ YYDEBUG(1225, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1226;
+yy1226:
+ YYDEBUG(1226, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
+ yych = *YYCURSOR;
+ goto yy1227;
+yy1227:
+ YYDEBUG(1227, *YYCURSOR);
+ if(yych <= ','){
+ if(yych != '+') goto yy56;
+ goto yy1228;
+ } else {
+ if(yych <= '-') goto yy1228;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1226;
+ goto yy56;
+ }
+yy1228:
+ YYDEBUG(1228, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy1229;
+ if(yych <= '2') goto yy1230;
+ if(yych <= '9') goto yy1231;
+ goto yy56;
+yy1229:
+ YYDEBUG(1229, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1091;
+ if(yych <= '5') goto yy1234;
+ if(yych <= '9') goto yy1231;
+ if(yych <= ':') goto yy1232;
+ goto yy1091;
+yy1230:
+ YYDEBUG(1230, *YYCURSOR);
+ yyaccept = 19;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '5'){
+ if(yych <= '/') goto yy1091;
+ if(yych <= '3') goto yy1234;
+ goto yy1233;
+ } else {
+ if(yych == ':') goto yy1232;
+ goto yy1091;
+ }
+yy1231:
+ YYDEBUG(1231, *YYCURSOR);
+ yyaccept = 19;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy1091;
+ if(yych <= '5') goto yy1233;
+ if(yych != ':') goto yy1091;
+ goto yy1232;
+yy1232:
+ YYDEBUG(1232, *YYCURSOR);
+ yyaccept = 19;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy1091;
+ if(yych >= '6') goto yy1091;
+ goto yy1233;
+yy1233:
+ YYDEBUG(1233, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1234:
+ YYDEBUG(1234, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1091;
+ if(yych <= '5') goto yy1235;
+ if(yych <= '9') goto yy1090;
+ if(yych <= ':') goto yy1232;
+ goto yy1091;
+yy1235:
+ YYDEBUG(1235, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1091;
+ if(yych <= '9') goto yy1090;
+ goto yy1091;
+yy1236:
+ YYDEBUG(1236, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1237;
+ if(yych != 'c') goto yy56;
+ goto yy1237;
+yy1237:
+ YYDEBUG(1237, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'E') goto yy1112;
+ if(yych == 'e') goto yy1112;
+ goto yy1047;
+ }
+yy1238:
+ YYDEBUG(1238, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy1239;
+ if(yych != 'v') goto yy56;
+ goto yy1239;
+yy1239:
+ YYDEBUG(1239, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'E') goto yy1119;
+ if(yych == 'e') goto yy1119;
+ goto yy1047;
+ }
+yy1240:
+ YYDEBUG(1240, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1241;
+ if(yych != 't') goto yy56;
+ goto yy1241;
+yy1241:
+ YYDEBUG(1241, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'O') goto yy1125;
+ if(yych == 'o') goto yy1125;
+ goto yy1047;
+ }
+yy1242:
+ YYDEBUG(1242, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy1243;
+ if(yych != 'p') goto yy56;
+ goto yy1243;
+yy1243:
+ YYDEBUG(1243, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'T') goto yy1244;
+ if(yych != 't') goto yy1047;
+ goto yy1244;
+ }
+yy1244:
+ YYDEBUG(1244, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'E') goto yy1131;
+ if(yych == 'e') goto yy1131;
+ goto yy1047;
+ }
+yy1245:
+ YYDEBUG(1245, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy1248;
+ if(yych == 'g') goto yy1248;
+ goto yy56;
+yy1246:
+ YYDEBUG(1246, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1247;
+ if(yych != 'r') goto yy56;
+ goto yy1247;
+yy1247:
+ YYDEBUG(1247, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'I') goto yy1138;
+ if(yych == 'i') goto yy1138;
+ goto yy1047;
+ }
+yy1248:
+ YYDEBUG(1248, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'U') goto yy1140;
+ if(yych == 'u') goto yy1140;
+ goto yy1047;
+ }
+yy1249:
+ YYDEBUG(1249, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy1250;
+ if(yych <= 'X') goto yy56;
+ goto yy1251;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy1250;
+ } else {
+ if(yych == 'y') goto yy1251;
+ goto yy56;
+ }
+ }
+yy1250:
+ YYDEBUG(1250, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'B'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'C') goto yy1144;
+ if(yych == 'c') goto yy1144;
+ goto yy1047;
+ }
+yy1251:
+ YYDEBUG(1251, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+yy1252:
+ YYDEBUG(1252, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1253;
+ if(yych != 'b') goto yy56;
+ goto yy1253;
+yy1253:
+ YYDEBUG(1253, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'Q'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'R') goto yy1147;
+ if(yych == 'r') goto yy1147;
+ goto yy1047;
+ }
+yy1254:
+ YYDEBUG(1254, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy1258;
+ if(yych <= 'M') goto yy56;
+ goto yy1257;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy1258;
+ } else {
+ if(yych == 'n') goto yy1257;
+ goto yy56;
+ }
+ }
+yy1255:
+ YYDEBUG(1255, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy1256;
+ if(yych != 'n') goto yy56;
+ goto yy1256;
+yy1256:
+ YYDEBUG(1256, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'U') goto yy1154;
+ if(yych == 'u') goto yy1154;
+ goto yy1047;
+ }
+yy1257:
+ YYDEBUG(1257, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'E') goto yy1116;
+ if(yych == 'e') goto yy1116;
+ goto yy1047;
+ }
+yy1258:
+ YYDEBUG(1258, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'X'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'Y') goto yy1116;
+ if(yych == 'y') goto yy1116;
+ goto yy1047;
+ }
+yy1259:
+ YYDEBUG(1259, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'P'){
+ if(yych == 'C') goto yy137;
+ if(yych <= 'O') goto yy56;
+ goto yy883;
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'b') goto yy56;
+ goto yy137;
+ } else {
+ if(yych == 'p') goto yy883;
+ goto yy56;
+ }
+ }
+yy1260:
+ YYDEBUG(1260, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '.'){
+ if(yych <= ',') goto yy1262;
+ if(yych <= '-') goto yy789;
+ goto yy1263;
+ } else {
+ if(yych <= '/') goto yy1264;
+ if(yych <= '9') goto yy1009;
+ goto yy1262;
+ }
+yy1261:
+ YYDEBUG(1261, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
+ yych = *YYCURSOR;
+ goto yy1262;
+yy1262:
+ YYDEBUG(1262, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy1261;
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy790;
+ case 'A': case 'a': goto yy873;
+ case 'D': case 'd': goto yy785;
+ case 'F': case 'f': goto yy786;
+ case 'H': case 'h': goto yy73;
+ case 'I': goto yy793;
+ case 'J': case 'j': goto yy797;
+ case 'M': case 'm': goto yy784;
+ case 'N': case 'n': goto yy800;
+ case 'O': case 'o': goto yy799;
+ case 'S': case 's': goto yy783;
+ case 'T': case 't': goto yy78;
+ case 'V': goto yy795;
+ case 'W': case 'w': goto yy75;
+ case 'X': goto yy796;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy1263:
+ YYDEBUG(1263, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy791;
+ if(yych <= '0') goto yy1265;
+ if(yych <= '1') goto yy1266;
+ if(yych <= '9') goto yy1267;
+ goto yy791;
+yy1264:
+ YYDEBUG(1264, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'A': case 'a': goto yy959;
+ case 'D': case 'd': goto yy963;
+ case 'F': case 'f': goto yy957;
+ case 'J': case 'j': goto yy956;
+ case 'M': case 'm': goto yy958;
+ case 'N': case 'n': goto yy962;
+ case 'O': case 'o': goto yy961;
+ case 'S': case 's': goto yy960;
+ default: goto yy56;
+ }
+yy1265:
+ YYDEBUG(1265, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '.') goto yy1268;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1267;
+ goto yy56;
+yy1266:
+ YYDEBUG(1266, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '.') goto yy1268;
+ if(yych <= '/') goto yy56;
+ if(yych >= '3') goto yy56;
+ goto yy1267;
+yy1267:
+ YYDEBUG(1267, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '.') goto yy56;
+ goto yy1268;
+yy1268:
+ YYDEBUG(1268, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1269;
+yy1269:
+ YYDEBUG(1269, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy903;
+ if(yych <= '9') goto yy902;
+ goto yy903;
+yy1270:
+ YYDEBUG(1270, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy1262;
+ if(yych <= '-') goto yy789;
+ if(yych >= '/') goto yy1264;
+ goto yy1271;
+ } else {
+ if(yych <= '5') goto yy1273;
+ if(yych <= '9') goto yy1009;
+ if(yych <= ':') goto yy1272;
+ goto yy1262;
+ }
+yy1271:
+ YYDEBUG(1271, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '1'){
+ if(yych <= '/') goto yy791;
+ if(yych <= '0') goto yy1295;
+ goto yy1296;
+ } else {
+ if(yych <= '5') goto yy1297;
+ if(yych <= '9') goto yy1298;
+ goto yy791;
+ }
+yy1272:
+ YYDEBUG(1272, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1290;
+ if(yych <= '9') goto yy1291;
+ goto yy56;
+yy1273:
+ YYDEBUG(1273, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy1010;
+ if(yych <= '/') goto yy70;
+ if(yych >= ':') goto yy70;
+ goto yy1274;
+yy1274:
+ YYDEBUG(1274, *YYCURSOR);
+ yyaccept = 20;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O': case 'S':
+ case 'T': case 'V': case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o': case 's':
+ case 't': case 'w': case 'y': goto yy1042;
+ case '-': goto yy1039;
+ case '.': goto yy1045;
+ case '/': goto yy1040;
+ case '0': goto yy1276;
+ case '1': goto yy1277;
+ case '2': goto yy1278;
+ case '3': goto yy1279;
+ case '4':
+ case '5': goto yy1280;
+ case '6': goto yy1281;
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case 'W': goto yy1062;
+ default: goto yy1275;
+ }
+yy1275:
+ YYDEBUG(1275, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("gnunocolon");
+ TIMELIB_INIT;
+ switch (s->time->have_time) {
+ case 0:
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = 0;
+ break;
+ case 1:
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ break;
+ default:
+ TIMELIB_DEINIT;
+ return TIMELIB_ERROR;
+ }
+ s->time->have_time++;
+ TIMELIB_DEINIT;
+ return TIMELIB_GNU_NOCOLON;
+ }
+yy1276:
+ YYDEBUG(1276, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy1288;
+ if(yych <= '9') goto yy1289;
+ goto yy70;
+yy1277:
+ YYDEBUG(1277, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '2') goto yy1287;
+ if(yych <= '9') goto yy1286;
+ goto yy70;
+yy1278:
+ YYDEBUG(1278, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1286;
+ goto yy70;
+yy1279:
+ YYDEBUG(1279, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '5') goto yy1284;
+ if(yych <= '6') goto yy1285;
+ if(yych <= '9') goto yy1282;
+ goto yy70;
+yy1280:
+ YYDEBUG(1280, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1282;
+ goto yy70;
+yy1281:
+ YYDEBUG(1281, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy1282;
+ if(yych <= '9') goto yy79;
+ goto yy70;
+yy1282:
+ YYDEBUG(1282, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'X'){
+ if(yych <= 'G'){
+ if(yych <= 'C'){
+ if(yych == ' ') goto yy70;
+ goto yy1283;
+ } else {
+ if(yych == 'E') goto yy1283;
+ if(yych <= 'F') goto yy70;
+ goto yy1283;
+ }
+ } else {
+ if(yych <= 'R'){
+ if(yych <= 'H') goto yy70;
+ if(yych == 'M') goto yy70;
+ goto yy1283;
+ } else {
+ if(yych <= 'T') goto yy70;
+ if(yych == 'W') goto yy70;
+ goto yy1283;
+ }
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'e'){
+ if(yych <= 'Y') goto yy70;
+ if(yych == 'd') goto yy70;
+ goto yy1283;
+ } else {
+ if(yych == 'g') goto yy1283;
+ if(yych <= 'h') goto yy70;
+ goto yy1283;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych <= 'm') goto yy70;
+ if(yych <= 'r') goto yy1283;
+ if(yych <= 't') goto yy70;
+ goto yy1283;
+ } else {
+ if(yych == 'x') goto yy1283;
+ if(yych <= 'y') goto yy70;
+ goto yy1283;
+ }
+ }
+ }
+yy1283:
+ YYDEBUG(1283, *YYCURSOR);
+
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("iso8601nocolon");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr != '\0') {
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_NOCOLON;
+ }
+yy1284:
+ YYDEBUG(1284, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1285:
+ YYDEBUG(1285, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6': goto yy1072;
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ default: goto yy1283;
+ }
+yy1286:
+ YYDEBUG(1286, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1287:
+ YYDEBUG(1287, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0': goto yy1076;
+ case '1':
+ case '2': goto yy1077;
+ case '3': goto yy1078;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1288:
+ YYDEBUG(1288, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0': goto yy79;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1289:
+ YYDEBUG(1289, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0': goto yy1076;
+ case '1':
+ case '2': goto yy1077;
+ case '3': goto yy1078;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1290:
+ YYDEBUG(1290, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy1292;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy1291;
+ if(yych <= ':') goto yy1292;
+ goto yy808;
+ }
+yy1291:
+ YYDEBUG(1291, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy1292;
+ if(yych != ':') goto yy808;
+ goto yy1292;
+yy1292:
+ YYDEBUG(1292, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1293;
+ if(yych <= '6') goto yy1294;
+ if(yych <= '9') goto yy813;
+ goto yy56;
+yy1293:
+ YYDEBUG(1293, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy813;
+ goto yy808;
+yy1294:
+ YYDEBUG(1294, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych == '0') goto yy813;
+ goto yy808;
+yy1295:
+ YYDEBUG(1295, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy1299;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy1298;
+ if(yych <= ':') goto yy1292;
+ goto yy808;
+ }
+yy1296:
+ YYDEBUG(1296, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy1299;
+ goto yy808;
+ } else {
+ if(yych <= '2') goto yy1298;
+ if(yych <= '9') goto yy1291;
+ if(yych <= ':') goto yy1292;
+ goto yy808;
+ }
+yy1297:
+ YYDEBUG(1297, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy1299;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy1291;
+ if(yych <= ':') goto yy1292;
+ goto yy808;
+ }
+yy1298:
+ YYDEBUG(1298, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy1299;
+ if(yych == ':') goto yy1292;
+ goto yy808;
+yy1299:
+ YYDEBUG(1299, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1300;
+ if(yych <= '6') goto yy1301;
+ if(yych <= '9') goto yy901;
+ goto yy56;
+yy1300:
+ YYDEBUG(1300, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy1302;
+ goto yy808;
+yy1301:
+ YYDEBUG(1301, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy814;
+ goto yy808;
+ } else {
+ if(yych <= '0') goto yy1302;
+ if(yych <= '9') goto yy902;
+ goto yy808;
+ }
+yy1302:
+ YYDEBUG(1302, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy904;
+ goto yy808;
+yy1303:
+ YYDEBUG(1303, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy782;
+ if(yych <= '-') goto yy789;
+ if(yych <= '.') goto yy792;
+ goto yy788;
+ } else {
+ if(yych <= '5') goto yy1273;
+ if(yych <= '9') goto yy1009;
+ if(yych <= ':') goto yy801;
+ goto yy782;
+ }
+yy1304:
+ YYDEBUG(1304, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy1262;
+ if(yych <= '-') goto yy789;
+ if(yych <= '.') goto yy1271;
+ goto yy788;
+ } else {
+ if(yych <= '5') goto yy1273;
+ if(yych <= '9') goto yy1009;
+ if(yych <= ':') goto yy1272;
+ goto yy1262;
+ }
+yy1305:
+ YYDEBUG(1305, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '0') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1306;
+yy1306:
+ YYDEBUG(1306, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy1307;
+yy1307:
+ YYDEBUG(1307, *YYCURSOR);
+ if(yych <= '/') goto yy1308;
+ if(yych <= '9') goto yy1306;
+ goto yy1308;
+yy1308:
+ YYDEBUG(1308, *YYCURSOR);
+
+{
+ timelib_ull i;
+
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_UNHAVE_DATE();
+ TIMELIB_UNHAVE_TIME();
+
+ i = timelib_get_unsigned_nr((char **) &ptr, 24);
+ s->time->y = 1970;
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->h = s->time->i = s->time->s = 0;
+ s->time->f = 0.0;
+ s->time->relative.s += i;
+ s->time->is_localtime = 1;
+ s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
+ s->time->z = 0;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+yy1309:
+ YYDEBUG(1309, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '`'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych != 'd') goto yy51;
+ goto yy1310;
+ } else {
+ if(yych <= 'm') goto yy1311;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy1310:
+ YYDEBUG(1310, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'a') goto yy1318;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+yy1311:
+ YYDEBUG(1311, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'o') goto yy1312;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy1312:
+ YYDEBUG(1312, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == ')') goto yy49;
+ if(yych != 'r') goto yy3;
+ goto yy1313;
+yy1313:
+ YYDEBUG(1313, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'r') goto yy56;
+ goto yy1314;
+yy1314:
+ YYDEBUG(1314, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'o') goto yy56;
+ goto yy1315;
+yy1315:
+ YYDEBUG(1315, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'w') goto yy56;
+ goto yy1316;
+yy1316:
+ YYDEBUG(1316, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1317;
+yy1317:
+ YYDEBUG(1317, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("tomorrow");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+
+ s->time->relative.d = 1;
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+yy1318:
+ YYDEBUG(1318, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == ')') goto yy49;
+ if(yych != 'y') goto yy3;
+ goto yy1319;
+yy1319:
+ YYDEBUG(1319, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1320;
+yy1320:
+ YYDEBUG(1320, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("midnight | today");
+ TIMELIB_INIT;
+ TIMELIB_UNHAVE_TIME();
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+yy1321:
+ YYDEBUG(1321, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'd') goto yy1322;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy1322:
+ YYDEBUG(1322, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'n') goto yy1323;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy1323:
+ YYDEBUG(1323, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == ')') goto yy49;
+ if(yych != 'i') goto yy3;
+ goto yy1324;
+yy1324:
+ YYDEBUG(1324, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'g') goto yy56;
+ goto yy1325;
+yy1325:
+ YYDEBUG(1325, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'h') goto yy56;
+ goto yy1326;
+yy1326:
+ YYDEBUG(1326, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 't') goto yy1319;
+ goto yy56;
+yy1327:
+ YYDEBUG(1327, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '`'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'V') goto yy618;
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych == 'o') goto yy1330;
+ goto yy51;
+ } else {
+ if(yych <= 'v') goto yy618;
+ if(yych <= 'w') goto yy1328;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy1328:
+ YYDEBUG(1328, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy1329;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy1329;
+ if(yych <= 'z') goto yy52;
+ goto yy1329;
+ }
+yy1329:
+ YYDEBUG(1329, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("now");
+ TIMELIB_INIT;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+yy1330:
+ YYDEBUG(1330, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'n') goto yy1331;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy1331:
+ YYDEBUG(1331, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) == ')') goto yy49;
+ goto yy1332;
+yy1332:
+ YYDEBUG(1332, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("noon");
+ TIMELIB_INIT;
+ TIMELIB_UNHAVE_TIME();
+ TIMELIB_HAVE_TIME();
+ s->time->h = 12;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+yy1333:
+ YYDEBUG(1333, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 's') goto yy1334;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy1334:
+ YYDEBUG(1334, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 's'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy1335;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy1335:
+ YYDEBUG(1335, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == ')') goto yy49;
+ if(yych != 'e') goto yy3;
+ goto yy1336;
+yy1336:
+ YYDEBUG(1336, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'r') goto yy56;
+ goto yy1337;
+yy1337:
+ YYDEBUG(1337, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'd') goto yy56;
+ goto yy1338;
+yy1338:
+ YYDEBUG(1338, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'a') goto yy56;
+ goto yy1339;
+yy1339:
+ YYDEBUG(1339, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'y') goto yy56;
+ goto yy1340;
+yy1340:
+ YYDEBUG(1340, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1341;
+yy1341:
+ YYDEBUG(1341, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("yesterday");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+
+ s->time->relative.d = -1;
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+}
+}
+
+}
+
+#define YYMAXFILL 26
+
+
+timelib_time* timelib_strtotime(char *s, int *errors, timelib_tzdb *tzdb)
+{
+ Scanner in;
+ int t;
+
+ memset(&in, 0, sizeof(in));
+ in.str = malloc(strlen(s) + YYMAXFILL);
+ memset(in.str, 0, strlen(s) + YYMAXFILL);
+ memcpy(in.str, s, strlen(s));
+ in.lim = in.str + strlen(s) + YYMAXFILL;
+ in.cur = in.str;
+ in.time = timelib_time_ctor();
+ in.time->y = -1;
+ in.time->d = -1;
+ in.time->m = -1;
+ in.time->h = -1;
+ in.time->i = -1;
+ in.time->s = -1;
+ in.time->f = -1;
+ in.time->z = -1;
+ in.time->dst = -1;
+ in.errors = 0;
+ in.tzdb = tzdb;
+ in.time->is_localtime = 0;
+ in.time->zone_type = 0;
+
+ do {
+ t = scan(&in);
+#ifdef DEBUG_PARSER
+ printf("%d\n", t);
+#endif
+ } while(t != EOI);
+
+ free(in.str);
+ *errors = in.errors;
+ return in.time;
+}
+
+void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
+{
+ if (!(options && TIMELIB_OVERRIDE_TIME) && parsed->have_date && !parsed->have_time) {
+ parsed->h = 0;
+ parsed->i = 0;
+ parsed->s = 0;
+ parsed->f = 0;
+ }
+ if (parsed->y == -1) parsed->y = now->y != -1 ? now->y : 0;
+ if (parsed->d == -1) parsed->d = now->d != -1 ? now->d : 0;
+ if (parsed->m == -1) parsed->m = now->m != -1 ? now->m : 0;
+ if (parsed->h == -1) parsed->h = now->h != -1 ? now->h : 0;
+ if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0;
+ if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0;
+ if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0;
+ if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0;
+ if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0;
+
+ if (!parsed->tz_abbr) {
+ parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
+ }
+ if (!parsed->tz_info) {
+ parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL;
+ }
+ if (parsed->zone_type == 0 && now->zone_type != 0) {
+ parsed->zone_type = now->zone_type;
+/* parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
+ parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL;
+*/ parsed->is_localtime = 1;
+ }
+/* timelib_dump_date(parsed, 2);
+ timelib_dump_date(now, 2);
+*/
+}
+
+char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
+{
+ timelib_tz_lookup_table *tp;
+
+ tp = zone_search(abbr, gmtoffset, isdst);
+ if (tp) {
+ return (tp->full_tz_name);
+ } else {
+ return NULL;
+ }
+}
+
+timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void)
+{
+ return timelib_timezone_lookup;
+}
+
+#ifdef DEBUG_PARSER_STUB
+int main(void)
+{
+ timelib_time time = timelib_strtotime("May 12");
+
+ printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d",
+ time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
+ if (time.have_relative) {
+ printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
+ time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s);
+ }
+ if (time.have_weekday_relative) {
+ printf (" / %d", time.relative.weekday);
+ }
+ if (time.have_weeknr_day) {
+ printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);
+ }
+ return 0;
+}
+#endif
+
+/*
+ * vim: syntax=c
+ */
diff --git a/ext/date/lib/parse_date.c.orig b/ext/date/lib/parse_date.c.orig
new file mode 100644
index 000000000..45228fba2
--- /dev/null
+++ b/ext/date/lib/parse_date.c.orig
@@ -0,0 +1,19884 @@
+/* Generated by re2c 0.9.10.dev on Thu Nov 17 13:55:10 2005 */
+#line 1 "ext/date/lib/parse_date.re"
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Derick Rethans <derick@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: parse_date.c,v 1.29.2.10 2005/11/17 13:04:25 derick Exp $ */
+
+#include "timelib.h"
+
+#include <stdio.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if defined(_MSC_VER)
+# define strtoll(s, f, b) _atoi64(s)
+#elif !defined(HAVE_STRTOLL)
+# if defined(HAVE_ATOLL)
+# define strtoll(s, f, b) atoll(s)
+# else
+# define strtoll(s, f, b) strtol(s, f, b)
+# endif
+#endif
+
+#define TIMELIB_SECOND 1
+#define TIMELIB_MINUTE 2
+#define TIMELIB_HOUR 3
+#define TIMELIB_DAY 4
+#define TIMELIB_MONTH 5
+#define TIMELIB_YEAR 6
+#define TIMELIB_WEEKDAY 7
+
+#define EOI 257
+#define TIME 258
+#define DATE 259
+
+#define TIMELIB_XMLRPC_SOAP 260
+#define TIMELIB_TIME12 261
+#define TIMELIB_TIME24 262
+#define TIMELIB_GNU_NOCOLON 263
+#define TIMELIB_GNU_NOCOLON_TZ 264
+#define TIMELIB_ISO_NOCOLON 265
+
+#define TIMELIB_AMERICAN 266
+#define TIMELIB_ISO_DATE 267
+#define TIMELIB_DATE_FULL 268
+#define TIMELIB_DATE_TEXT 269
+#define TIMELIB_DATE_NOCOLON 270
+#define TIMELIB_PG_YEARDAY 271
+#define TIMELIB_PG_TEXT 272
+#define TIMELIB_PG_REVERSE 273
+#define TIMELIB_CLF 274
+#define TIMELIB_DATE_NO_DAY 275
+#define TIMELIB_SHORTDATE_WITH_TIME 276
+#define TIMELIB_DATE_FULL_POINTED 277
+#define TIMELIB_TIME24_WITH_ZONE 278
+#define TIMELIB_ISO_WEEK 279
+
+#define TIMELIB_TIMEZONE 300
+#define TIMELIB_AGO 301
+
+#define TIMELIB_RELATIVE 310
+
+#define TIMELIB_ERROR 999
+
+typedef unsigned char uchar;
+
+#define BSIZE 8192
+
+#define YYCTYPE uchar
+#define YYCURSOR cursor
+#define YYLIMIT s->lim
+#define YYMARKER s->ptr
+#define YYFILL(n) return EOI;
+
+#define RET(i) {s->cur = cursor; return i;}
+
+#define timelib_string_free free
+
+#define TIMELIB_HAVE_TIME() { if (s->time->have_time) { return TIMELIB_ERROR; } else { s->time->have_time = 1; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } }
+#define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; }
+#define TIMELIB_HAVE_DATE() { if (s->time->have_date) { return TIMELIB_ERROR; } else { s->time->have_date = 1; } }
+#define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y = 0; }
+#define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 0; }
+#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; }
+#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { return TIMELIB_ERROR; } else { s->time.have_zone = 1; } }
+
+#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
+#define TIMELIB_DEINIT timelib_string_free(str)
+#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; }
+
+#define TIMELIB_PROCESS_YEAR(x) { \
+ if ((x) == -1) { \
+ /* (x) = 0; */ \
+ } else if ((x) < 100) { \
+ if ((x) < 70) { \
+ (x) += 2000; \
+ } else { \
+ (x) += 1900; \
+ } \
+ } \
+}
+
+#ifdef DEBUG_PARSER
+#define DEBUG_OUTPUT(s) printf("%s\n", s);
+#define YYDEBUG(s,c) { if (s != -1) { printf("state: %d ", s); printf("[%c]\n", c); } }
+#else
+#define DEBUG_OUTPUT(s)
+#define YYDEBUG(s,c)
+#endif
+
+#include "timelib_structs.h"
+
+typedef struct timelib_elems {
+ unsigned int c; /* Number of elements */
+ char **v; /* Values */
+} timelib_elems;
+
+typedef struct Scanner {
+ int fd;
+ uchar *lim, *str, *ptr, *cur, *tok, *pos;
+ unsigned int line, len;
+ int errors;
+
+ struct timelib_time *time;
+ timelib_tzdb *tzdb;
+} Scanner;
+
+typedef struct _timelib_lookup_table {
+ const char *name;
+ int type;
+ int value;
+} timelib_lookup_table;
+
+typedef struct _timelib_relunit {
+ const char *name;
+ int unit;
+ int multiplier;
+} timelib_relunit;
+
+#define HOUR(a) (int)(a * 60)
+
+/* The timezone table. */
+static timelib_tz_lookup_table timelib_timezone_lookup[] = {
+#include "timezonemap.h"
+ { NULL, 0, 0, NULL },
+};
+
+static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = {
+#include "fallbackmap.h"
+ { NULL, 0, 0, NULL },
+};
+
+static timelib_relunit const timelib_relunit_lookup[] = {
+ { "sec", TIMELIB_SECOND, 1 },
+ { "secs", TIMELIB_SECOND, 1 },
+ { "second", TIMELIB_SECOND, 1 },
+ { "seconds", TIMELIB_SECOND, 1 },
+ { "min", TIMELIB_MINUTE, 1 },
+ { "mins", TIMELIB_MINUTE, 1 },
+ { "minute", TIMELIB_MINUTE, 1 },
+ { "minutes", TIMELIB_MINUTE, 1 },
+ { "hour", TIMELIB_HOUR, 1 },
+ { "hours", TIMELIB_HOUR, 1 },
+ { "day", TIMELIB_DAY, 1 },
+ { "days", TIMELIB_DAY, 1 },
+ { "week", TIMELIB_DAY, 7 },
+ { "weeks", TIMELIB_DAY, 7 },
+ { "fortnight", TIMELIB_DAY, 14 },
+ { "fortnights", TIMELIB_DAY, 14 },
+ { "forthnight", TIMELIB_DAY, 14 },
+ { "forthnights", TIMELIB_DAY, 14 },
+ { "month", TIMELIB_MONTH, 1 },
+ { "months", TIMELIB_MONTH, 1 },
+ { "year", TIMELIB_YEAR, 1 },
+ { "years", TIMELIB_YEAR, 1 },
+
+ { "monday", TIMELIB_WEEKDAY, 1 },
+ { "tuesday", TIMELIB_WEEKDAY, 2 },
+ { "wednesday", TIMELIB_WEEKDAY, 3 },
+ { "thursday", TIMELIB_WEEKDAY, 4 },
+ { "friday", TIMELIB_WEEKDAY, 5 },
+ { "saturday", TIMELIB_WEEKDAY, 6 },
+ { "sunday", TIMELIB_WEEKDAY, 0 },
+
+ { NULL, 0, 0 }
+};
+
+/* The relative text table. */
+static timelib_lookup_table const timelib_reltext_lookup[] = {
+ { "first", 0, 1 },
+ { "next", 0, 1 },
+ { "second", 0, 2 },
+ { "third", 0, 3 },
+ { "fourth", 0, 4 },
+ { "fifth", 0, 5 },
+ { "sixth", 0, 6 },
+ { "seventh", 0, 7 },
+ { "eight", 0, 8 },
+ { "ninth", 0, 9 },
+ { "tenth", 0, 10 },
+ { "eleventh", 0, 11 },
+ { "twelfth", 0, 12 },
+ { "last", 0, -1 },
+ { "previous", 0, -1 },
+ { "this", 1, 0 },
+ { NULL, 1, 0 }
+};
+
+/* The month table. */
+static timelib_lookup_table const timelib_month_lookup[] = {
+ { "jan", 0, 1 },
+ { "feb", 0, 2 },
+ { "mar", 0, 3 },
+ { "apr", 0, 4 },
+ { "may", 0, 5 },
+ { "jun", 0, 6 },
+ { "jul", 0, 7 },
+ { "aug", 0, 8 },
+ { "sep", 0, 9 },
+ { "sept", 0, 9 },
+ { "oct", 0, 10 },
+ { "nov", 0, 11 },
+ { "dec", 0, 12 },
+ { "i", 0, 1 },
+ { "ii", 0, 2 },
+ { "iii", 0, 3 },
+ { "iv", 0, 4 },
+ { "v", 0, 5 },
+ { "vi", 0, 6 },
+ { "vii", 0, 7 },
+ { "viii", 0, 8 },
+ { "ix", 0, 9 },
+ { "x", 0, 10 },
+ { "xi", 0, 11 },
+ { "xii", 0, 12 },
+
+ { "january", 0, 1 },
+ { "february", 0, 2 },
+ { "march", 0, 3 },
+ { "april", 0, 4 },
+ { "may", 0, 5 },
+ { "june", 0, 6 },
+ { "july", 0, 7 },
+ { "august", 0, 8 },
+ { "september", 0, 9 },
+ { "october", 0, 10 },
+ { "november", 0, 11 },
+ { "december", 0, 12 },
+ { NULL, 0, 0 }
+};
+
+#if 0
+static char* timelib_ltrim(char *s)
+{
+ char *ptr = s;
+ while (ptr[0] == ' ') {
+ ptr++;
+ }
+ return ptr;
+}
+#endif
+
+#if 0
+uchar *fill(Scanner *s, uchar *cursor){
+ if(!s->eof){
+ unsigned int cnt = s->tok - s->bot;
+ if(cnt){
+ memcpy(s->bot, s->tok, s->lim - s->tok);
+ s->tok = s->bot;
+ s->ptr -= cnt;
+ cursor -= cnt;
+ s->pos -= cnt;
+ s->lim -= cnt;
+ }
+ if((s->top - s->lim) < BSIZE){
+ uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
+ memcpy(buf, s->tok, s->lim - s->tok);
+ s->tok = buf;
+ s->ptr = &buf[s->ptr - s->bot];
+ cursor = &buf[cursor - s->bot];
+ s->pos = &buf[s->pos - s->bot];
+ s->lim = &buf[s->lim - s->bot];
+ s->top = &s->lim[BSIZE];
+ free(s->bot);
+ s->bot = buf;
+ }
+ if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){
+ s->eof = &s->lim[cnt]; *(s->eof)++ = '\n';
+ }
+ s->lim += cnt;
+ }
+ return cursor;
+}
+#endif
+
+static timelib_sll timelib_meridian(char **ptr, timelib_sll h)
+{
+ timelib_sll retval = 0;
+
+ while (!strchr("AaPp", **ptr)) {
+ ++*ptr;
+ }
+ if (**ptr == 'a' || **ptr == 'A') {
+ if (h == 12) {
+ retval = -12;
+ }
+ } else if (h != 12) {
+ retval = 12;
+ }
+ ++*ptr;
+ if (**ptr == '.') {
+ *ptr += 3;
+ } else {
+ ++*ptr;
+ }
+ return retval;
+}
+
+static char *timelib_string(Scanner *s)
+{
+ char *tmp = calloc(1, s->cur - s->tok + 1);
+ memcpy(tmp, s->tok, s->cur - s->tok);
+
+ return tmp;
+}
+
+static timelib_sll timelib_get_nr(char **ptr, int max_length)
+{
+ char *begin, *end, *str;
+ timelib_sll tmp_nr = -1;
+ int len = 0;
+
+ while ((**ptr < '0') || (**ptr > '9')) {
+ if (**ptr == '\0') {
+ return -1;
+ }
+ ++*ptr;
+ }
+ begin = *ptr;
+ while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) {
+ ++*ptr;
+ ++len;
+ }
+ end = *ptr;
+ str = calloc(1, end - begin + 1);
+ memcpy(str, begin, end - begin);
+ tmp_nr = strtoll(str, NULL, 10);
+ free(str);
+ return tmp_nr;
+}
+
+static double timelib_get_frac_nr(char **ptr, int max_length)
+{
+ char *begin, *end, *str;
+ double tmp_nr = -1;
+ int len = 0;
+
+ while ((**ptr != '.') && ((**ptr < '0') || (**ptr > '9'))) {
+ if (**ptr == '\0') {
+ return -1;
+ }
+ ++*ptr;
+ }
+ begin = *ptr;
+ while (((**ptr == '.') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_length) {
+ ++*ptr;
+ ++len;
+ }
+ end = *ptr;
+ str = calloc(1, end - begin + 1);
+ memcpy(str, begin, end - begin);
+ tmp_nr = strtod(str, NULL);
+ free(str);
+ return tmp_nr;
+}
+
+static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length)
+{
+ timelib_ull dir = 1;
+
+ while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) {
+ if (**ptr == '\0') {
+ return -1;
+ }
+ ++*ptr;
+ }
+ if (**ptr == '+') {
+ ++*ptr;
+ } else if (**ptr == '-') {
+ dir = -1;
+ ++*ptr;
+ }
+ return dir * timelib_get_nr(ptr, max_length);
+}
+
+static long timelib_parse_tz_cor(char **ptr)
+{
+ char *begin = *ptr, *end;
+ long tmp;
+
+ while (**ptr != '\0') {
+ ++*ptr;
+ }
+ end = *ptr;
+ switch (end - begin) {
+ case 1:
+ case 2:
+ return HOUR(strtol(begin, NULL, 10));
+ break;
+ case 3:
+ case 4:
+ tmp = strtol(begin, NULL, 10);
+ return HOUR(tmp / 100) + tmp % 100;
+ case 5:
+ tmp = HOUR(strtol(begin, NULL, 10)) +
+ strtol(begin + 3, NULL, 10);
+ return tmp;
+ }
+ return 0;
+}
+
+static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ timelib_sll value = 0;
+ const timelib_lookup_table *tp;
+
+ while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ for (tp = timelib_reltext_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ value = tp->value;
+ *behavior = tp->type;
+ }
+ }
+
+ free(word);
+ return value;
+}
+
+static timelib_sll timelib_get_relative_text(char **ptr, int *behavior)
+{
+ while (**ptr == ' ' || **ptr == '-' || **ptr == '/') {
+ ++*ptr;
+ }
+ return timelib_lookup_relative_text(ptr, behavior);
+}
+
+static long timelib_lookup_month(char **ptr)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ long value = 0;
+ const timelib_lookup_table *tp;
+
+ while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ for (tp = timelib_month_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ value = tp->value;
+ }
+ }
+
+ free(word);
+ return value;
+}
+
+static long timelib_get_month(char **ptr)
+{
+ while (**ptr == ' ' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
+ ++*ptr;
+ }
+ return timelib_lookup_month(ptr);
+}
+
+static void timelib_eat_spaces(char **ptr)
+{
+ while (**ptr == ' ') {
+ ++*ptr;
+ }
+}
+
+static const timelib_relunit* timelib_lookup_relunit(char **ptr)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ const timelib_relunit *tp, *value = NULL;
+
+ while (**ptr != '\0' && **ptr != ' ') {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ for (tp = timelib_relunit_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ value = tp;
+ break;
+ }
+ }
+
+ free(word);
+ return value;
+}
+
+static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s)
+{
+ const timelib_relunit* relunit;
+
+ relunit = timelib_lookup_relunit(ptr);
+ switch (relunit->unit) {
+ case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
+ case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
+ case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
+ case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
+ case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
+ case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
+
+ case TIMELIB_WEEKDAY:
+ TIMELIB_HAVE_WEEKDAY_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+ s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
+ s->time->relative.weekday = relunit->multiplier;
+ s->time->relative.weekday_behavior = behavior;
+ break;
+ }
+}
+
+static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
+{
+ int first_found = 0;
+ timelib_tz_lookup_table *tp, *first_found_elem;
+ timelib_tz_lookup_table *fmp;
+
+ for (tp = timelib_timezone_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ if (!first_found) {
+ first_found = 1;
+ first_found_elem = tp;
+ if (gmtoffset == -1) {
+ return tp;
+ }
+ }
+ if (tp->gmtoffset == gmtoffset) {
+ return tp;
+ }
+ }
+ }
+ if (first_found) {
+ return first_found_elem;
+ }
+ /* Still didn't find anything, let's find the zone solely based on
+ * offset/isdst then */
+ for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
+ if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) {
+ return fmp;
+ }
+ }
+ return NULL;
+}
+
+static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ long value = 0;
+ timelib_tz_lookup_table *tp;
+
+ while (**ptr != '\0' && **ptr != ')') {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ if ((tp = zone_search(word, -1, 0))) {
+ value = -tp->gmtoffset / 60;
+ *dst = tp->type;
+ value += tp->type * 60;
+ *found = 1;
+ } else {
+ *found = 0;
+ }
+
+ *tz_abbr = word;
+ return value;
+}
+
+static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb)
+{
+ timelib_tzinfo *res;
+ long retval = 0;
+
+ *tz_not_found = 0;
+
+ while (**ptr == ' ' || **ptr == '(') {
+ ++*ptr;
+ }
+ if (**ptr == '+') {
+ ++*ptr;
+ t->is_localtime = 1;
+ t->zone_type = TIMELIB_ZONETYPE_OFFSET;
+ *tz_not_found = 0;
+ t->dst = 0;
+
+ retval = -1 * timelib_parse_tz_cor(ptr);
+ } else if (**ptr == '-') {
+ ++*ptr;
+ t->is_localtime = 1;
+ t->zone_type = TIMELIB_ZONETYPE_OFFSET;
+ *tz_not_found = 0;
+ t->dst = 0;
+
+ retval = timelib_parse_tz_cor(ptr);
+ } else {
+ int found = 0;
+ long offset;
+ char *tz_abbr;
+
+ t->is_localtime = 1;
+ t->zone_type = TIMELIB_ZONETYPE_ABBR;
+
+ offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found);
+#if 0
+ /* If we found a TimeZone identifier, use it */
+ if (tz_name) {
+ t->tz_info = timelib_parse_tzfile(tz_name);
+ t->zone_type = TIMELIB_ZONETYPE_ID;
+ }
+#endif
+ /* If we have a TimeZone identifier to start with, use it */
+ if (strstr(tz_abbr, "/")) {
+ if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) {
+ t->tz_info = res;
+ t->zone_type = TIMELIB_ZONETYPE_ID;
+ found++;
+ }
+ }
+ if (t->zone_type != TIMELIB_ZONETYPE_ID) {
+ timelib_time_tz_abbr_update(t, tz_abbr);
+ }
+ free(tz_abbr);
+ *tz_not_found = (found == 0);
+ retval = offset;
+ }
+ while (**ptr == ')') {
+ ++*ptr;
+ }
+ return retval;
+}
+
+#define timelib_split_free(arg) { \
+ int i; \
+ for (i = 0; i < arg.c; i++) { \
+ free(arg.v[i]); \
+ } \
+ if (arg.v) { \
+ free(arg.v); \
+ } \
+}
+
+static int scan(Scanner *s)
+{
+ uchar *cursor = s->cur;
+ char *str, *ptr = NULL;
+
+std:
+ s->tok = cursor;
+ s->len = 0;
+#line 808 "ext/date/lib/parse_date.re"
+
+
+{
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 208, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 192, 64, 192, 0,
+ 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 8, 8, 8, 136, 8, 8, 8,
+ 136, 8, 8, 8, 8, 8, 136, 8,
+ 8, 8, 136, 136, 136, 8, 8, 8,
+ 8, 8, 8, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+
+#line 744 "ext/date/lib/parse_date.c"
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ goto yy0;
+
+ YYDEBUG(1, *YYCURSOR);
+ ++YYCURSOR;
+yy0:
+ if((YYLIMIT - YYCURSOR) < 26) YYFILL(26);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 0x00: case 0x0A: goto yy46;
+ case ' ': case ',': case '.': goto yy44;
+ case '(': goto yy41;
+ case '+': case '-': goto yy40;
+ case '0': goto yy9;
+ case '1': goto yy10;
+ case '2': goto yy11;
+ case '3': goto yy12;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy13;
+ case '@': goto yy7;
+ case 'A': goto yy22;
+ case 'B':
+ case 'C': case 'G':
+ case 'H': case 'K': case 'Q':
+ case 'R': case 'U': case 'Y':
+ case 'Z': goto yy42;
+ case 'D': goto yy29;
+ case 'E': goto yy32;
+ case 'F': goto yy19;
+ case 'I': goto yy14;
+ case 'J': goto yy17;
+ case 'L': goto yy34;
+ case 'M': goto yy21;
+ case 'N': goto yy28;
+ case 'O': goto yy26;
+ case 'P': goto yy36;
+ case 'S': goto yy24;
+ case 'T': goto yy31;
+ case 'V': goto yy15;
+ case 'W': goto yy38;
+ case 'X': goto yy16;
+ case 'a': goto yy23;
+ case 'b':
+ case 'c': case 'g':
+ case 'h':
+ case 'i': case 'k': case 'q':
+ case 'r': case 'u':
+ case 'v': case 'x': case 'z': goto yy43;
+ case 'd': goto yy30;
+ case 'e': goto yy33;
+ case 'f': goto yy20;
+ case 'j': goto yy18;
+ case 'l': goto yy35;
+ case 'm': goto yy5;
+ case 'n': goto yy4;
+ case 'o': goto yy27;
+ case 'p': goto yy37;
+ case 's': goto yy25;
+ case 't': goto yy6;
+ case 'w': goto yy39;
+ case 'y': goto yy2;
+ default: goto yy48;
+ }
+yy2:
+ YYDEBUG(2, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych >= 'A') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'd'){
+ if(yych >= 'a') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'e') goto yy1333;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy3:
+ YYDEBUG(3, *YYCURSOR);
+
+#line 1306 "ext/date/lib/parse_date.re"
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("tzcorrection | tz");
+ TIMELIB_INIT;
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ TIMELIB_DEINIT;
+ return TIMELIB_TIMEZONE;
+ }
+#line 838 "ext/date/lib/parse_date.c"
+yy4:
+ YYDEBUG(4, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= 'D'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'E') goto yy610;
+ goto yy50;
+ } else {
+ if(yych <= 'I') goto yy611;
+ if(yych <= 'N') goto yy50;
+ goto yy606;
+ }
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy610;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'i') goto yy611;
+ goto yy50;
+ } else {
+ if(yych <= 'o') goto yy1327;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy5:
+ YYDEBUG(5, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy705;
+ if(yych == 'O') goto yy708;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= '`') goto yy3;
+ if(yych <= 'a') goto yy705;
+ if(yych <= 'h') goto yy50;
+ goto yy1321;
+ } else {
+ if(yych == 'o') goto yy708;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy6:
+ YYDEBUG(6, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych <= 'G'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'E') goto yy472;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'U'){
+ if(yych <= 'H') goto yy473;
+ if(yych <= 'T') goto yy50;
+ goto yy474;
+ } else {
+ if(yych == 'W') goto yy475;
+ goto yy50;
+ }
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'e'){
+ if(yych <= '`') goto yy3;
+ if(yych <= 'd') goto yy50;
+ goto yy472;
+ } else {
+ if(yych == 'h') goto yy473;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'o') goto yy1309;
+ if(yych <= 't') goto yy50;
+ goto yy474;
+ } else {
+ if(yych == 'w') goto yy475;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy7:
+ YYDEBUG(7, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '-') goto yy1305;
+ if(yych <= '0') goto yy8;
+ if(yych <= '9') goto yy1306;
+ goto yy8;
+yy8:
+ YYDEBUG(8, *YYCURSOR);
+
+#line 1372 "ext/date/lib/parse_date.re"
+{
+/* printf("unexpected character: #%d, %c ", *s->tok, *s->tok); */
+ s->errors++;
+ goto std;
+ }
+#line 952 "ext/date/lib/parse_date.c"
+yy9:
+ YYDEBUG(9, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o': case 's':
+ case 't': case 'w': case 'y': goto yy1262;
+ case '-': goto yy789;
+ case '.': goto yy1271;
+ case '/': goto yy788;
+ case '0': goto yy1304;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1303;
+ case ':': goto yy1272;
+ default: goto yy8;
+ }
+yy10:
+ YYDEBUG(10, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O':
+ case 'P': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o':
+ case 'p': case 's':
+ case 't': case 'w': case 'y': goto yy782;
+ case '-': goto yy789;
+ case '.': goto yy792;
+ case '/': goto yy788;
+ case '0':
+ case '1':
+ case '2': goto yy1303;
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1270;
+ case ':': goto yy801;
+ default: goto yy8;
+ }
+yy11:
+ YYDEBUG(11, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O':
+ case 'P': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o':
+ case 'p': case 's':
+ case 't': case 'w': case 'y': goto yy782;
+ case '-': goto yy789;
+ case '.': goto yy792;
+ case '/': goto yy788;
+ case '0':
+ case '1':
+ case '2':
+ case '3': goto yy1270;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1260;
+ case ':': goto yy801;
+ default: goto yy8;
+ }
+yy12:
+ YYDEBUG(12, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O':
+ case 'P': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o':
+ case 'p': case 's':
+ case 't': case 'w': case 'y': goto yy782;
+ case '-': goto yy789;
+ case '.': goto yy792;
+ case '/': goto yy788;
+ case '0':
+ case '1': goto yy1260;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy787;
+ case ':': goto yy801;
+ default: goto yy8;
+ }
+yy13:
+ YYDEBUG(13, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O':
+ case 'P': case 'S':
+ case 'T': case 'V':
+ case 'W':
+ case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o':
+ case 'p': case 's':
+ case 't': case 'w': case 'y': goto yy782;
+ case '-': goto yy789;
+ case '.': goto yy792;
+ case '/': goto yy788;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy787;
+ case ':': goto yy801;
+ default: goto yy8;
+ }
+yy14:
+ YYDEBUG(14, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'W'){
+ if(yych <= 'I') goto yy780;
+ if(yych == 'V') goto yy779;
+ goto yy50;
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= 'X') goto yy779;
+ goto yy50;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy15:
+ YYDEBUG(15, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy50;
+ goto yy777;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy16:
+ YYDEBUG(16, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy50;
+ goto yy775;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy17:
+ YYDEBUG(17, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy758;
+ if(yych <= 'T') goto yy50;
+ goto yy757;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy767;
+ } else {
+ if(yych == 'u') goto yy766;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy18:
+ YYDEBUG(18, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy758;
+ if(yych <= 'T') goto yy50;
+ goto yy757;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy758;
+ } else {
+ if(yych == 'u') goto yy757;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy19:
+ YYDEBUG(19, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy721;
+ }
+ } else {
+ if(yych <= 'N'){
+ if(yych == 'I') goto yy722;
+ goto yy50;
+ } else {
+ if(yych <= 'O') goto yy723;
+ if(yych <= 'Q') goto yy50;
+ goto yy724;
+ }
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'e') goto yy739;
+ if(yych <= 'h') goto yy53;
+ goto yy740;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych == 'o') goto yy741;
+ goto yy53;
+ } else {
+ if(yych <= 'r') goto yy742;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy20:
+ YYDEBUG(20, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy721;
+ }
+ } else {
+ if(yych <= 'N'){
+ if(yych == 'I') goto yy722;
+ goto yy50;
+ } else {
+ if(yych <= 'O') goto yy723;
+ if(yych <= 'Q') goto yy50;
+ goto yy724;
+ }
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'e') goto yy721;
+ if(yych <= 'h') goto yy50;
+ goto yy722;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych == 'o') goto yy723;
+ goto yy50;
+ } else {
+ if(yych <= 'r') goto yy724;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy21:
+ YYDEBUG(21, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy705;
+ if(yych <= 'N') goto yy50;
+ goto yy708;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy706;
+ } else {
+ if(yych == 'o') goto yy707;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy22:
+ YYDEBUG(22, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'F'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'O'){
+ if(yych <= 'G') goto yy688;
+ goto yy50;
+ } else {
+ if(yych <= 'P') goto yy687;
+ if(yych <= 'T') goto yy50;
+ goto yy686;
+ }
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy698;
+ goto yy53;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'p') goto yy697;
+ goto yy53;
+ } else {
+ if(yych <= 'u') goto yy696;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy23:
+ YYDEBUG(23, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'F'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'O'){
+ if(yych <= 'G') goto yy688;
+ goto yy50;
+ } else {
+ if(yych <= 'P') goto yy687;
+ if(yych <= 'T') goto yy50;
+ goto yy686;
+ }
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy688;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'p') goto yy687;
+ goto yy50;
+ } else {
+ if(yych <= 'u') goto yy686;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy24:
+ YYDEBUG(24, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'A') goto yy639;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'E') goto yy638;
+ goto yy50;
+ } else {
+ if(yych <= 'I') goto yy640;
+ if(yych <= 'T') goto yy50;
+ goto yy641;
+ }
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy663;
+ if(yych <= 'd') goto yy53;
+ goto yy662;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych == 'i') goto yy664;
+ goto yy53;
+ } else {
+ if(yych <= 'u') goto yy665;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy25:
+ YYDEBUG(25, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'A') goto yy639;
+ goto yy50;
+ }
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'E') goto yy638;
+ goto yy50;
+ } else {
+ if(yych <= 'I') goto yy640;
+ if(yych <= 'T') goto yy50;
+ goto yy641;
+ }
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy639;
+ if(yych <= 'd') goto yy50;
+ goto yy638;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych == 'i') goto yy640;
+ goto yy50;
+ } else {
+ if(yych <= 'u') goto yy641;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+ }
+yy26:
+ YYDEBUG(26, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'C'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'B') goto yy50;
+ goto yy628;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'c') goto yy633;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy27:
+ YYDEBUG(27, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'C'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'B') goto yy50;
+ goto yy628;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'c') goto yy628;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy28:
+ YYDEBUG(28, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= 'D'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'E') goto yy610;
+ goto yy50;
+ } else {
+ if(yych <= 'I') goto yy611;
+ if(yych <= 'N') goto yy50;
+ goto yy606;
+ }
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy608;
+ goto yy53;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'i') goto yy609;
+ goto yy53;
+ } else {
+ if(yych <= 'o') goto yy607;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy29:
+ YYDEBUG(29, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy506;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'e') goto yy599;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy30:
+ YYDEBUG(30, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy506;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'e') goto yy506;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy31:
+ YYDEBUG(31, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'W'){
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy472;
+ }
+ } else {
+ if(yych <= 'T'){
+ if(yych == 'H') goto yy473;
+ goto yy50;
+ } else {
+ if(yych <= 'U') goto yy474;
+ if(yych <= 'V') goto yy50;
+ goto yy475;
+ }
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'e') goto yy468;
+ if(yych <= 'g') goto yy53;
+ goto yy469;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych == 'u') goto yy470;
+ goto yy53;
+ } else {
+ if(yych <= 'w') goto yy471;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+ }
+yy32:
+ YYDEBUG(32, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'I') goto yy456;
+ if(yych <= 'K') goto yy50;
+ goto yy457;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'h') goto yy53;
+ goto yy462;
+ } else {
+ if(yych == 'l') goto yy463;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy33:
+ YYDEBUG(33, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'I') goto yy456;
+ if(yych <= 'K') goto yy50;
+ goto yy457;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'h') goto yy50;
+ goto yy456;
+ } else {
+ if(yych == 'l') goto yy457;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy34:
+ YYDEBUG(34, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'A'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy450;
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy453;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy35:
+ YYDEBUG(35, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'A'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy450;
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy50;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy450;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy36:
+ YYDEBUG(36, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy50;
+ goto yy170;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'r') goto yy311;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy37:
+ YYDEBUG(37, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy50;
+ goto yy170;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'r') goto yy170;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy38:
+ YYDEBUG(38, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy152;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy53;
+ } else {
+ if(yych <= 'e') goto yy162;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+ }
+yy39:
+ YYDEBUG(39, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy50;
+ goto yy152;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ goto yy50;
+ } else {
+ if(yych <= 'e') goto yy152;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+ }
+yy40:
+ YYDEBUG(40, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy8;
+ if(yych <= '1') goto yy64;
+ if(yych <= '2') goto yy65;
+ if(yych <= '9') goto yy66;
+ goto yy8;
+yy41:
+ YYDEBUG(41, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@') goto yy8;
+ if(yych <= 'Z') goto yy63;
+ if(yych <= '`') goto yy8;
+ if(yych <= 'z') goto yy63;
+ goto yy8;
+yy42:
+ YYDEBUG(42, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy53;
+ goto yy3;
+ }
+yy43:
+ YYDEBUG(43, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+yy44:
+ YYDEBUG(44, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy45;
+yy45:
+ YYDEBUG(45, *YYCURSOR);
+
+#line 1361 "ext/date/lib/parse_date.re"
+{
+ goto std;
+ }
+#line 1916 "ext/date/lib/parse_date.c"
+yy46:
+ YYDEBUG(46, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy47;
+yy47:
+ YYDEBUG(47, *YYCURSOR);
+
+#line 1366 "ext/date/lib/parse_date.re"
+{
+ s->pos = cursor; s->line++;
+ goto std;
+ }
+#line 1925 "ext/date/lib/parse_date.c"
+yy48:
+ YYDEBUG(48, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy8;
+yy49:
+ YYDEBUG(49, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy3;
+yy50:
+ YYDEBUG(50, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych >= '{') goto yy3;
+ goto yy51;
+ }
+yy51:
+ YYDEBUG(51, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ if(yych >= '{') goto yy3;
+ goto yy52;
+ }
+yy52:
+ YYDEBUG(52, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == ')') goto yy49;
+ goto yy3;
+yy53:
+ YYDEBUG(53, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych == '/') goto yy55;
+ goto yy3;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych >= '{') goto yy3;
+ goto yy54;
+ }
+ }
+yy54:
+ YYDEBUG(54, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych != '/') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy55:
+ YYDEBUG(55, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '@') goto yy56;
+ if(yych <= 'Z') goto yy57;
+ goto yy56;
+yy56:
+ YYDEBUG(56, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 11: goto yy808;
+ case 20: goto yy1275;
+ case 21: goto yy1283;
+ case 12: goto yy953;
+ case 18: goto yy1182;
+ case 8: goto yy568;
+ case 17: goto yy1047;
+ case 6: goto yy513;
+ case 10: goto yy794;
+ case 16: goto yy1080;
+ case 19: goto yy1091;
+ case 15: goto yy1073;
+ case 13: goto yy986;
+ case 14: goto yy1038;
+ case 9: goto yy690;
+ case 5: goto yy193;
+ case 4: goto yy161;
+ case 3: goto yy154;
+ case 1: goto yy3;
+ case 7: goto yy531;
+ case 2: goto yy88;
+ case 0: goto yy8;
+ }
+yy57:
+ YYDEBUG(57, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 8) {
+ goto yy58;
+ }
+ goto yy56;
+yy58:
+ YYDEBUG(58, *YYCURSOR);
+ yyaccept = 1;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy59;
+yy59:
+ YYDEBUG(59, *YYCURSOR);
+ if(yybm[0+yych] & 8) {
+ goto yy58;
+ }
+ if(yych == '/') goto yy55;
+ if(yych == '_') goto yy55;
+ goto yy3;
+yy60:
+ YYDEBUG(60, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych >= '{') goto yy3;
+ goto yy61;
+ }
+ }
+yy61:
+ YYDEBUG(61, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy62;
+yy62:
+ YYDEBUG(62, *YYCURSOR);
+ if(yych <= '^'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+yy63:
+ YYDEBUG(63, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy50;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy50;
+ goto yy3;
+ }
+yy64:
+ YYDEBUG(64, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5': goto yy150;
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy66;
+ case ':': goto yy67;
+ default: goto yy3;
+ }
+yy65:
+ YYDEBUG(65, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3': goto yy150;
+ case '4':
+ case '5': goto yy68;
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case ':': goto yy67;
+ default: goto yy3;
+ }
+yy66:
+ YYDEBUG(66, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5': goto yy68;
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case ':': goto yy67;
+ default: goto yy3;
+ }
+yy67:
+ YYDEBUG(67, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy3;
+ if(yych <= '5') goto yy149;
+ goto yy3;
+yy68:
+ YYDEBUG(68, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy148;
+ goto yy70;
+yy69:
+ YYDEBUG(69, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy70;
+yy70:
+ YYDEBUG(70, *YYCURSOR);
+ if(yybm[0+yych] & 16) {
+ goto yy69;
+ }
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'D': case 'd': goto yy74;
+ case 'F': case 'f': goto yy76;
+ case 'H': case 'h': goto yy73;
+ case 'M': case 'm': goto yy72;
+ case 'S': case 's': goto yy71;
+ case 'T': case 't': goto yy78;
+ case 'W': case 'w': goto yy75;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy71:
+ YYDEBUG(71, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych == 'A') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy136;
+ if(yych <= 'T') goto yy56;
+ goto yy135;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych == 'a') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'e') goto yy136;
+ if(yych == 'u') goto yy135;
+ goto yy56;
+ }
+ }
+yy72:
+ YYDEBUG(72, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'O'){
+ if(yych == 'I') goto yy126;
+ if(yych <= 'N') goto yy56;
+ goto yy125;
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'h') goto yy56;
+ goto yy126;
+ } else {
+ if(yych == 'o') goto yy125;
+ goto yy56;
+ }
+ }
+yy73:
+ YYDEBUG(73, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'O') goto yy123;
+ if(yych == 'o') goto yy123;
+ goto yy56;
+yy74:
+ YYDEBUG(74, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy122;
+ if(yych == 'a') goto yy122;
+ goto yy56;
+yy75:
+ YYDEBUG(75, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy114;
+ if(yych == 'e') goto yy114;
+ goto yy56;
+yy76:
+ YYDEBUG(76, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'R'){
+ if(yych == 'O') goto yy99;
+ if(yych <= 'Q') goto yy56;
+ goto yy98;
+ } else {
+ if(yych <= 'o'){
+ if(yych <= 'n') goto yy56;
+ goto yy99;
+ } else {
+ if(yych == 'r') goto yy98;
+ goto yy56;
+ }
+ }
+yy77:
+ YYDEBUG(77, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy95;
+ if(yych == 'e') goto yy95;
+ goto yy56;
+yy78:
+ YYDEBUG(78, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'H') goto yy81;
+ if(yych <= 'T') goto yy56;
+ goto yy82;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy56;
+ goto yy81;
+ } else {
+ if(yych == 'u') goto yy82;
+ goto yy56;
+ }
+ }
+yy79:
+ YYDEBUG(79, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy80;
+yy80:
+ YYDEBUG(80, *YYCURSOR);
+ if(yybm[0+yych] & 16) {
+ goto yy69;
+ }
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case 'D': case 'd': goto yy74;
+ case 'F': case 'f': goto yy76;
+ case 'H': case 'h': goto yy73;
+ case 'M': case 'm': goto yy72;
+ case 'S': case 's': goto yy71;
+ case 'T': case 't': goto yy78;
+ case 'W': case 'w': goto yy75;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy81:
+ YYDEBUG(81, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy90;
+ if(yych == 'u') goto yy90;
+ goto yy56;
+yy82:
+ YYDEBUG(82, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy83;
+ if(yych != 'e') goto yy56;
+ goto yy83;
+yy83:
+ YYDEBUG(83, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy84;
+ if(yych != 's') goto yy56;
+ goto yy84;
+yy84:
+ YYDEBUG(84, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy85;
+ if(yych != 'd') goto yy56;
+ goto yy85;
+yy85:
+ YYDEBUG(85, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy86;
+ if(yych != 'a') goto yy56;
+ goto yy86;
+yy86:
+ YYDEBUG(86, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych != 'y') goto yy56;
+ goto yy87;
+yy87:
+ YYDEBUG(87, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych == '+') goto yy89;
+ if(yych == '-') goto yy89;
+ goto yy88;
+yy88:
+ YYDEBUG(88, *YYCURSOR);
+
+#line 1345 "ext/date/lib/parse_date.re"
+{
+ timelib_ull i;
+ DEBUG_OUTPUT("relative");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+
+ while(*ptr) {
+ i = timelib_get_unsigned_nr((char **) &ptr, 24);
+ timelib_eat_spaces((char **) &ptr);
+ timelib_set_relative((char **) &ptr, i, 0, s);
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+#line 2351 "ext/date/lib/parse_date.c"
+yy89:
+ YYDEBUG(89, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ goto yy56;
+yy90:
+ YYDEBUG(90, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy91;
+ if(yych != 'r') goto yy56;
+ goto yy91;
+yy91:
+ YYDEBUG(91, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy92;
+ if(yych != 's') goto yy56;
+ goto yy92;
+yy92:
+ YYDEBUG(92, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy93;
+ if(yych != 'd') goto yy56;
+ goto yy93;
+yy93:
+ YYDEBUG(93, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy94;
+ if(yych != 'a') goto yy56;
+ goto yy94;
+yy94:
+ YYDEBUG(94, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy95:
+ YYDEBUG(95, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy96;
+ if(yych != 'a') goto yy56;
+ goto yy96;
+yy96:
+ YYDEBUG(96, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy97;
+ if(yych != 'r') goto yy56;
+ goto yy97;
+yy97:
+ YYDEBUG(97, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= '-'){
+ if(yych == '+') goto yy89;
+ if(yych <= ',') goto yy88;
+ goto yy89;
+ } else {
+ if(yych <= 'S'){
+ if(yych <= 'R') goto yy88;
+ goto yy87;
+ } else {
+ if(yych == 's') goto yy87;
+ goto yy88;
+ }
+ }
+yy98:
+ YYDEBUG(98, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy111;
+ if(yych == 'i') goto yy111;
+ goto yy56;
+yy99:
+ YYDEBUG(99, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy100;
+ if(yych != 'r') goto yy56;
+ goto yy100;
+yy100:
+ YYDEBUG(100, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy101;
+ if(yych != 't') goto yy56;
+ goto yy101;
+yy101:
+ YYDEBUG(101, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'H') goto yy103;
+ if(yych <= 'M') goto yy56;
+ goto yy102;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy56;
+ goto yy103;
+ } else {
+ if(yych != 'n') goto yy56;
+ goto yy102;
+ }
+ }
+yy102:
+ YYDEBUG(102, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy108;
+ if(yych == 'i') goto yy108;
+ goto yy56;
+yy103:
+ YYDEBUG(103, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy104;
+ if(yych != 'n') goto yy56;
+ goto yy104;
+yy104:
+ YYDEBUG(104, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy105;
+ if(yych != 'i') goto yy56;
+ goto yy105;
+yy105:
+ YYDEBUG(105, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy106;
+ if(yych != 'g') goto yy56;
+ goto yy106;
+yy106:
+ YYDEBUG(106, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy107;
+ if(yych != 'h') goto yy56;
+ goto yy107;
+yy107:
+ YYDEBUG(107, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy97;
+ if(yych == 't') goto yy97;
+ goto yy56;
+yy108:
+ YYDEBUG(108, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy109;
+ if(yych != 'g') goto yy56;
+ goto yy109;
+yy109:
+ YYDEBUG(109, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy110;
+ if(yych != 'h') goto yy56;
+ goto yy110;
+yy110:
+ YYDEBUG(110, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy97;
+ if(yych == 't') goto yy97;
+ goto yy56;
+yy111:
+ YYDEBUG(111, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy112;
+ if(yych != 'd') goto yy56;
+ goto yy112;
+yy112:
+ YYDEBUG(112, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy113;
+ if(yych != 'a') goto yy56;
+ goto yy113;
+yy113:
+ YYDEBUG(113, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy114:
+ YYDEBUG(114, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= 'C') goto yy56;
+ if(yych <= 'D') goto yy116;
+ goto yy115;
+ } else {
+ if(yych <= 'c') goto yy56;
+ if(yych <= 'd') goto yy116;
+ if(yych >= 'f') goto yy56;
+ goto yy115;
+ }
+yy115:
+ YYDEBUG(115, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'K') goto yy97;
+ if(yych == 'k') goto yy97;
+ goto yy56;
+yy116:
+ YYDEBUG(116, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy117;
+ if(yych != 'n') goto yy56;
+ goto yy117;
+yy117:
+ YYDEBUG(117, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy118;
+ if(yych != 'e') goto yy56;
+ goto yy118;
+yy118:
+ YYDEBUG(118, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy119;
+ if(yych != 's') goto yy56;
+ goto yy119;
+yy119:
+ YYDEBUG(119, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy120;
+ if(yych != 'd') goto yy56;
+ goto yy120;
+yy120:
+ YYDEBUG(120, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy121;
+ if(yych != 'a') goto yy56;
+ goto yy121;
+yy121:
+ YYDEBUG(121, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy122:
+ YYDEBUG(122, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy97;
+ if(yych == 'y') goto yy97;
+ goto yy56;
+yy123:
+ YYDEBUG(123, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy124;
+ if(yych != 'u') goto yy56;
+ goto yy124;
+yy124:
+ YYDEBUG(124, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy97;
+ if(yych == 'r') goto yy97;
+ goto yy56;
+yy125:
+ YYDEBUG(125, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy130;
+ if(yych == 'n') goto yy130;
+ goto yy56;
+yy126:
+ YYDEBUG(126, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy127;
+ if(yych != 'n') goto yy56;
+ goto yy127;
+yy127:
+ YYDEBUG(127, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'S'){
+ if(yych <= ','){
+ if(yych == '+') goto yy89;
+ goto yy88;
+ } else {
+ if(yych <= '-') goto yy89;
+ if(yych <= 'R') goto yy88;
+ goto yy87;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych != 'U') goto yy88;
+ goto yy128;
+ } else {
+ if(yych <= 's') goto yy87;
+ if(yych != 'u') goto yy88;
+ goto yy128;
+ }
+ }
+yy128:
+ YYDEBUG(128, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy129;
+ if(yych != 't') goto yy56;
+ goto yy129;
+yy129:
+ YYDEBUG(129, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy97;
+ if(yych == 'e') goto yy97;
+ goto yy56;
+yy130:
+ YYDEBUG(130, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'T'){
+ if(yych == 'D') goto yy131;
+ if(yych <= 'S') goto yy56;
+ goto yy132;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy56;
+ goto yy131;
+ } else {
+ if(yych == 't') goto yy132;
+ goto yy56;
+ }
+ }
+yy131:
+ YYDEBUG(131, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy133;
+ if(yych == 'a') goto yy133;
+ goto yy56;
+yy132:
+ YYDEBUG(132, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy97;
+ if(yych == 'h') goto yy97;
+ goto yy56;
+yy133:
+ YYDEBUG(133, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy134:
+ YYDEBUG(134, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy143;
+ if(yych == 't') goto yy143;
+ goto yy56;
+yy135:
+ YYDEBUG(135, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy140;
+ if(yych == 'n') goto yy140;
+ goto yy56;
+yy136:
+ YYDEBUG(136, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'C') goto yy137;
+ if(yych != 'c') goto yy56;
+ goto yy137;
+yy137:
+ YYDEBUG(137, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'O'){
+ if(yych <= ','){
+ if(yych == '+') goto yy89;
+ goto yy88;
+ } else {
+ if(yych <= '-') goto yy89;
+ if(yych <= 'N') goto yy88;
+ goto yy138;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych == 'S') goto yy87;
+ goto yy88;
+ } else {
+ if(yych <= 'o') goto yy138;
+ if(yych == 's') goto yy87;
+ goto yy88;
+ }
+ }
+yy138:
+ YYDEBUG(138, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy139;
+ if(yych != 'n') goto yy56;
+ goto yy139;
+yy139:
+ YYDEBUG(139, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy97;
+ if(yych == 'd') goto yy97;
+ goto yy56;
+yy140:
+ YYDEBUG(140, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy141;
+ if(yych != 'd') goto yy56;
+ goto yy141;
+yy141:
+ YYDEBUG(141, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy142;
+ if(yych != 'a') goto yy56;
+ goto yy142;
+yy142:
+ YYDEBUG(142, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy143:
+ YYDEBUG(143, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy144;
+ if(yych != 'u') goto yy56;
+ goto yy144;
+yy144:
+ YYDEBUG(144, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy145;
+ if(yych != 'r') goto yy56;
+ goto yy145;
+yy145:
+ YYDEBUG(145, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy146;
+ if(yych != 'd') goto yy56;
+ goto yy146;
+yy146:
+ YYDEBUG(146, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy147;
+ if(yych != 'a') goto yy56;
+ goto yy147;
+yy147:
+ YYDEBUG(147, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy87;
+ if(yych == 'y') goto yy87;
+ goto yy56;
+yy148:
+ YYDEBUG(148, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'X'){
+ if(yych <= 'G'){
+ if(yych <= 'C'){
+ if(yych == ' ') goto yy70;
+ goto yy3;
+ } else {
+ if(yych == 'E') goto yy3;
+ if(yych <= 'F') goto yy70;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'R'){
+ if(yych <= 'H') goto yy70;
+ if(yych == 'M') goto yy70;
+ goto yy3;
+ } else {
+ if(yych <= 'T') goto yy70;
+ if(yych == 'W') goto yy70;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'e'){
+ if(yych <= 'Y') goto yy70;
+ if(yych == 'd') goto yy70;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy3;
+ if(yych <= 'h') goto yy70;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych <= 'm') goto yy70;
+ if(yych <= 'r') goto yy3;
+ if(yych <= 't') goto yy70;
+ goto yy3;
+ } else {
+ if(yych == 'x') goto yy3;
+ if(yych <= 'y') goto yy70;
+ goto yy3;
+ }
+ }
+ }
+yy149:
+ YYDEBUG(149, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy49;
+ goto yy56;
+yy150:
+ YYDEBUG(150, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5': goto yy151;
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy148;
+ case ':': goto yy67;
+ default: goto yy3;
+ }
+yy151:
+ YYDEBUG(151, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy148;
+ default: goto yy3;
+ }
+yy152:
+ YYDEBUG(152, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'C') goto yy51;
+ goto yy153;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'd') goto yy153;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy153:
+ YYDEBUG(153, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= 'N'){
+ if(yych <= ')'){
+ if(yych >= ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'M') goto yy52;
+ goto yy155;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy52;
+ if(yych >= 'a') goto yy52;
+ goto yy154;
+ } else {
+ if(yych <= 'n') goto yy155;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy154:
+ YYDEBUG(154, *YYCURSOR);
+
+#line 1300 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("dayabbr");
+ goto std;
+ }
+#line 2927 "ext/date/lib/parse_date.c"
+yy155:
+ YYDEBUG(155, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'E') goto yy156;
+ if(yych != 'e') goto yy3;
+ goto yy156;
+ }
+yy156:
+ YYDEBUG(156, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy157;
+ if(yych != 's') goto yy56;
+ goto yy157;
+yy157:
+ YYDEBUG(157, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy158;
+ if(yych != 'd') goto yy56;
+ goto yy158;
+yy158:
+ YYDEBUG(158, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy159;
+ if(yych != 'a') goto yy56;
+ goto yy159;
+yy159:
+ YYDEBUG(159, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych != 'y') goto yy56;
+ goto yy160;
+yy160:
+ YYDEBUG(160, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy161;
+yy161:
+ YYDEBUG(161, *YYCURSOR);
+
+#line 1283 "ext/date/lib/parse_date.re"
+{
+ const timelib_relunit* relunit;
+ DEBUG_OUTPUT("dayfull");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_HAVE_WEEKDAY_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+
+ relunit = timelib_lookup_relunit((char**) &ptr);
+ s->time->relative.weekday = relunit->multiplier;
+ s->time->relative.weekday_behavior = 1;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+#line 2973 "ext/date/lib/parse_date.c"
+yy162:
+ YYDEBUG(162, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'C') goto yy51;
+ goto yy153;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'd') goto yy163;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy163:
+ YYDEBUG(163, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'M') goto yy52;
+ goto yy155;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'n') goto yy164;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy164:
+ YYDEBUG(164, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'D') goto yy3;
+ goto yy156;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy165;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy165:
+ YYDEBUG(165, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy157;
+ if(yych != 's') goto yy62;
+ goto yy166;
+yy166:
+ YYDEBUG(166, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy158;
+ if(yych != 'd') goto yy62;
+ goto yy167;
+yy167:
+ YYDEBUG(167, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy159;
+ if(yych != 'a') goto yy62;
+ goto yy168;
+yy168:
+ YYDEBUG(168, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych != 'y') goto yy62;
+ goto yy169;
+yy169:
+ YYDEBUG(169, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '^'){
+ if(yych == '/') goto yy55;
+ goto yy161;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy161;
+ if(yych <= 'z') goto yy61;
+ goto yy161;
+ }
+yy170:
+ YYDEBUG(170, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy171;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'e') goto yy171;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy171:
+ YYDEBUG(171, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy52;
+ goto yy172;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'v') goto yy172;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy172:
+ YYDEBUG(172, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'I') goto yy173;
+ if(yych != 'i') goto yy3;
+ goto yy173;
+ }
+yy173:
+ YYDEBUG(173, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'O') goto yy174;
+ if(yych != 'o') goto yy56;
+ goto yy174;
+yy174:
+ YYDEBUG(174, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy175;
+ if(yych != 'u') goto yy56;
+ goto yy175;
+yy175:
+ YYDEBUG(175, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy176;
+ if(yych != 's') goto yy56;
+ goto yy176;
+yy176:
+ YYDEBUG(176, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy177;
+yy177:
+ YYDEBUG(177, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy176;
+ case 'D': case 'd': goto yy181;
+ case 'F': case 'f': goto yy183;
+ case 'H': case 'h': goto yy180;
+ case 'M': case 'm': goto yy179;
+ case 'S': case 's': goto yy178;
+ case 'T': case 't': goto yy185;
+ case 'W': case 'w': goto yy182;
+ case 'Y': case 'y': goto yy184;
+ default: goto yy56;
+ }
+yy178:
+ YYDEBUG(178, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych == 'A') goto yy297;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy299;
+ if(yych <= 'T') goto yy56;
+ goto yy298;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych == 'a') goto yy297;
+ goto yy56;
+ } else {
+ if(yych <= 'e') goto yy299;
+ if(yych == 'u') goto yy298;
+ goto yy56;
+ }
+ }
+yy179:
+ YYDEBUG(179, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'O'){
+ if(yych == 'I') goto yy289;
+ if(yych <= 'N') goto yy56;
+ goto yy288;
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'h') goto yy56;
+ goto yy289;
+ } else {
+ if(yych == 'o') goto yy288;
+ goto yy56;
+ }
+ }
+yy180:
+ YYDEBUG(180, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'O') goto yy286;
+ if(yych == 'o') goto yy286;
+ goto yy56;
+yy181:
+ YYDEBUG(181, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy285;
+ if(yych == 'a') goto yy285;
+ goto yy56;
+yy182:
+ YYDEBUG(182, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy277;
+ if(yych == 'e') goto yy277;
+ goto yy56;
+yy183:
+ YYDEBUG(183, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'R'){
+ if(yych == 'O') goto yy262;
+ if(yych <= 'Q') goto yy56;
+ goto yy261;
+ } else {
+ if(yych <= 'o'){
+ if(yych <= 'n') goto yy56;
+ goto yy262;
+ } else {
+ if(yych == 'r') goto yy261;
+ goto yy56;
+ }
+ }
+yy184:
+ YYDEBUG(184, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy256;
+ if(yych == 'e') goto yy256;
+ goto yy56;
+yy185:
+ YYDEBUG(185, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'H') goto yy186;
+ if(yych <= 'T') goto yy56;
+ goto yy187;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy56;
+ goto yy186;
+ } else {
+ if(yych == 'u') goto yy187;
+ goto yy56;
+ }
+ }
+yy186:
+ YYDEBUG(186, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy251;
+ if(yych == 'u') goto yy251;
+ goto yy56;
+yy187:
+ YYDEBUG(187, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy188;
+ if(yych != 'e') goto yy56;
+ goto yy188;
+yy188:
+ YYDEBUG(188, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy189;
+ if(yych != 's') goto yy56;
+ goto yy189;
+yy189:
+ YYDEBUG(189, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy190;
+ if(yych != 'd') goto yy56;
+ goto yy190;
+yy190:
+ YYDEBUG(190, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy191;
+ if(yych != 'a') goto yy56;
+ goto yy191;
+yy191:
+ YYDEBUG(191, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych != 'y') goto yy56;
+ goto yy192;
+yy192:
+ YYDEBUG(192, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy198;
+ case 'F': case 'f': goto yy194;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy196;
+ case 'T': case 't': goto yy197;
+ default: goto yy193;
+ }
+yy193:
+ YYDEBUG(193, *YYCURSOR);
+
+#line 1266 "ext/date/lib/parse_date.re"
+{
+ timelib_sll i;
+ int behavior;
+ DEBUG_OUTPUT("relativetext");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+
+ while(*ptr) {
+ i = timelib_get_relative_text((char **) &ptr, &behavior);
+ timelib_eat_spaces((char **) &ptr);
+ timelib_set_relative((char **) &ptr, i, behavior, s);
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+#line 3315 "ext/date/lib/parse_date.c"
+yy194:
+ YYDEBUG(194, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'O'){
+ if(yych == 'I') goto yy242;
+ if(yych <= 'N') goto yy56;
+ goto yy243;
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'h') goto yy56;
+ goto yy242;
+ } else {
+ if(yych == 'o') goto yy243;
+ goto yy56;
+ }
+ }
+yy195:
+ YYDEBUG(195, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'I'){
+ if(yych == 'E') goto yy238;
+ if(yych <= 'H') goto yy56;
+ goto yy237;
+ } else {
+ if(yych <= 'e'){
+ if(yych <= 'd') goto yy56;
+ goto yy238;
+ } else {
+ if(yych == 'i') goto yy237;
+ goto yy56;
+ }
+ }
+yy196:
+ YYDEBUG(196, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'I'){
+ if(yych == 'E') goto yy226;
+ if(yych <= 'H') goto yy56;
+ goto yy227;
+ } else {
+ if(yych <= 'e'){
+ if(yych <= 'd') goto yy56;
+ goto yy226;
+ } else {
+ if(yych == 'i') goto yy227;
+ goto yy56;
+ }
+ }
+yy197:
+ YYDEBUG(197, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'W'){
+ if(yych <= 'G'){
+ if(yych == 'E') goto yy217;
+ goto yy56;
+ } else {
+ if(yych <= 'H') goto yy215;
+ if(yych <= 'V') goto yy56;
+ goto yy216;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych == 'e') goto yy217;
+ goto yy56;
+ } else {
+ if(yych <= 'h') goto yy215;
+ if(yych == 'w') goto yy216;
+ goto yy56;
+ }
+ }
+yy198:
+ YYDEBUG(198, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'L'){
+ if(yych == 'I') goto yy207;
+ if(yych <= 'K') goto yy56;
+ goto yy206;
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'h') goto yy56;
+ goto yy207;
+ } else {
+ if(yych == 'l') goto yy206;
+ goto yy56;
+ }
+ }
+yy199:
+ YYDEBUG(199, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy204;
+ if(yych == 'a') goto yy204;
+ goto yy56;
+yy200:
+ YYDEBUG(200, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy201;
+ if(yych != 'r') goto yy56;
+ goto yy201;
+yy201:
+ YYDEBUG(201, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy202;
+ if(yych != 'e') goto yy56;
+ goto yy202;
+yy202:
+ YYDEBUG(202, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'V') goto yy203;
+ if(yych != 'v') goto yy56;
+ goto yy203;
+yy203:
+ YYDEBUG(203, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy173;
+ if(yych == 'i') goto yy173;
+ goto yy56;
+yy204:
+ YYDEBUG(204, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy205;
+ if(yych != 's') goto yy56;
+ goto yy205;
+yy205:
+ YYDEBUG(205, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy56;
+yy206:
+ YYDEBUG(206, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy210;
+ if(yych == 'e') goto yy210;
+ goto yy56;
+yy207:
+ YYDEBUG(207, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy208;
+ if(yych != 'g') goto yy56;
+ goto yy208;
+yy208:
+ YYDEBUG(208, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy209;
+ if(yych != 'h') goto yy56;
+ goto yy209;
+yy209:
+ YYDEBUG(209, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy56;
+yy210:
+ YYDEBUG(210, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'V') goto yy211;
+ if(yych != 'v') goto yy56;
+ goto yy211;
+yy211:
+ YYDEBUG(211, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy212;
+ if(yych != 'e') goto yy56;
+ goto yy212;
+yy212:
+ YYDEBUG(212, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy213;
+ if(yych != 'n') goto yy56;
+ goto yy213;
+yy213:
+ YYDEBUG(213, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy214;
+ if(yych != 't') goto yy56;
+ goto yy214;
+yy214:
+ YYDEBUG(214, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy215:
+ YYDEBUG(215, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy224;
+ if(yych == 'i') goto yy224;
+ goto yy56;
+yy216:
+ YYDEBUG(216, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy220;
+ if(yych == 'e') goto yy220;
+ goto yy56;
+yy217:
+ YYDEBUG(217, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy218;
+ if(yych != 'n') goto yy56;
+ goto yy218;
+yy218:
+ YYDEBUG(218, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy219;
+ if(yych != 't') goto yy56;
+ goto yy219;
+yy219:
+ YYDEBUG(219, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy220:
+ YYDEBUG(220, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'L') goto yy221;
+ if(yych != 'l') goto yy56;
+ goto yy221;
+yy221:
+ YYDEBUG(221, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'F') goto yy222;
+ if(yych != 'f') goto yy56;
+ goto yy222;
+yy222:
+ YYDEBUG(222, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy223;
+ if(yych != 't') goto yy56;
+ goto yy223;
+yy223:
+ YYDEBUG(223, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy224:
+ YYDEBUG(224, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= 'Q') goto yy56;
+ if(yych >= 'S') goto yy176;
+ goto yy225;
+ } else {
+ if(yych <= 'q') goto yy56;
+ if(yych <= 'r') goto yy225;
+ if(yych <= 's') goto yy176;
+ goto yy56;
+ }
+yy225:
+ YYDEBUG(225, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy176;
+ if(yych == 'd') goto yy176;
+ goto yy56;
+yy226:
+ YYDEBUG(226, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'V'){
+ if(yych == 'C') goto yy230;
+ if(yych <= 'U') goto yy56;
+ goto yy231;
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'b') goto yy56;
+ goto yy230;
+ } else {
+ if(yych == 'v') goto yy231;
+ goto yy56;
+ }
+ }
+yy227:
+ YYDEBUG(227, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'X') goto yy228;
+ if(yych != 'x') goto yy56;
+ goto yy228;
+yy228:
+ YYDEBUG(228, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy229;
+ if(yych != 't') goto yy56;
+ goto yy229;
+yy229:
+ YYDEBUG(229, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy230:
+ YYDEBUG(230, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'O') goto yy235;
+ if(yych == 'o') goto yy235;
+ goto yy56;
+yy231:
+ YYDEBUG(231, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy232;
+ if(yych != 'e') goto yy56;
+ goto yy232;
+yy232:
+ YYDEBUG(232, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy233;
+ if(yych != 'n') goto yy56;
+ goto yy233;
+yy233:
+ YYDEBUG(233, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy234;
+ if(yych != 't') goto yy56;
+ goto yy234;
+yy234:
+ YYDEBUG(234, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy235:
+ YYDEBUG(235, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy236;
+ if(yych != 'n') goto yy56;
+ goto yy236;
+yy236:
+ YYDEBUG(236, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy176;
+ if(yych == 'd') goto yy176;
+ goto yy56;
+yy237:
+ YYDEBUG(237, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy240;
+ if(yych == 'n') goto yy240;
+ goto yy56;
+yy238:
+ YYDEBUG(238, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'X') goto yy239;
+ if(yych != 'x') goto yy56;
+ goto yy239;
+yy239:
+ YYDEBUG(239, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy56;
+yy240:
+ YYDEBUG(240, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy241;
+ if(yych != 't') goto yy56;
+ goto yy241;
+yy241:
+ YYDEBUG(241, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy242:
+ YYDEBUG(242, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'R'){
+ if(yych == 'F') goto yy248;
+ if(yych <= 'Q') goto yy56;
+ goto yy247;
+ } else {
+ if(yych <= 'f'){
+ if(yych <= 'e') goto yy56;
+ goto yy248;
+ } else {
+ if(yych == 'r') goto yy247;
+ goto yy56;
+ }
+ }
+yy243:
+ YYDEBUG(243, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy244;
+ if(yych != 'u') goto yy56;
+ goto yy244;
+yy244:
+ YYDEBUG(244, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy245;
+ if(yych != 'r') goto yy56;
+ goto yy245;
+yy245:
+ YYDEBUG(245, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy246;
+ if(yych != 't') goto yy56;
+ goto yy246;
+yy246:
+ YYDEBUG(246, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy247:
+ YYDEBUG(247, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy250;
+ if(yych == 's') goto yy250;
+ goto yy56;
+yy248:
+ YYDEBUG(248, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy249;
+ if(yych != 't') goto yy56;
+ goto yy249;
+yy249:
+ YYDEBUG(249, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy56;
+yy250:
+ YYDEBUG(250, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy56;
+yy251:
+ YYDEBUG(251, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy252;
+ if(yych != 'r') goto yy56;
+ goto yy252;
+yy252:
+ YYDEBUG(252, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy253;
+ if(yych != 's') goto yy56;
+ goto yy253;
+yy253:
+ YYDEBUG(253, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy254;
+ if(yych != 'd') goto yy56;
+ goto yy254;
+yy254:
+ YYDEBUG(254, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy255;
+ if(yych != 'a') goto yy56;
+ goto yy255;
+yy255:
+ YYDEBUG(255, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy256:
+ YYDEBUG(256, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy257;
+ if(yych != 'a') goto yy56;
+ goto yy257;
+yy257:
+ YYDEBUG(257, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy258;
+ if(yych != 'r') goto yy56;
+ goto yy258;
+yy258:
+ YYDEBUG(258, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy198;
+ case 'F': case 'f': goto yy194;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy259;
+ case 'T': case 't': goto yy197;
+ default: goto yy193;
+ }
+yy259:
+ YYDEBUG(259, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy260;
+ case 'F': case 'f': goto yy194;
+ case 'I': case 'i': goto yy227;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy196;
+ case 'T': case 't': goto yy197;
+ default: goto yy193;
+ }
+yy260:
+ YYDEBUG(260, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= 'I'){
+ if(yych == 'C') goto yy230;
+ if(yych <= 'H') goto yy56;
+ goto yy207;
+ } else {
+ if(yych == 'L') goto yy206;
+ if(yych <= 'U') goto yy56;
+ goto yy231;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych == 'c') goto yy230;
+ if(yych <= 'h') goto yy56;
+ goto yy207;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy206;
+ } else {
+ if(yych == 'v') goto yy231;
+ goto yy56;
+ }
+ }
+ }
+yy261:
+ YYDEBUG(261, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy274;
+ if(yych == 'i') goto yy274;
+ goto yy56;
+yy262:
+ YYDEBUG(262, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy263;
+ if(yych != 'r') goto yy56;
+ goto yy263;
+yy263:
+ YYDEBUG(263, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy264;
+ if(yych != 't') goto yy56;
+ goto yy264;
+yy264:
+ YYDEBUG(264, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'H') goto yy266;
+ if(yych <= 'M') goto yy56;
+ goto yy265;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy56;
+ goto yy266;
+ } else {
+ if(yych != 'n') goto yy56;
+ goto yy265;
+ }
+ }
+yy265:
+ YYDEBUG(265, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy271;
+ if(yych == 'i') goto yy271;
+ goto yy56;
+yy266:
+ YYDEBUG(266, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy267;
+ if(yych != 'n') goto yy56;
+ goto yy267;
+yy267:
+ YYDEBUG(267, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'I') goto yy268;
+ if(yych != 'i') goto yy56;
+ goto yy268;
+yy268:
+ YYDEBUG(268, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy269;
+ if(yych != 'g') goto yy56;
+ goto yy269;
+yy269:
+ YYDEBUG(269, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy270;
+ if(yych != 'h') goto yy56;
+ goto yy270;
+yy270:
+ YYDEBUG(270, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy258;
+ if(yych == 't') goto yy258;
+ goto yy56;
+yy271:
+ YYDEBUG(271, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'G') goto yy272;
+ if(yych != 'g') goto yy56;
+ goto yy272;
+yy272:
+ YYDEBUG(272, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy273;
+ if(yych != 'h') goto yy56;
+ goto yy273;
+yy273:
+ YYDEBUG(273, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy258;
+ if(yych == 't') goto yy258;
+ goto yy56;
+yy274:
+ YYDEBUG(274, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy275;
+ if(yych != 'd') goto yy56;
+ goto yy275;
+yy275:
+ YYDEBUG(275, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy276;
+ if(yych != 'a') goto yy56;
+ goto yy276;
+yy276:
+ YYDEBUG(276, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy277:
+ YYDEBUG(277, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= 'C') goto yy56;
+ if(yych <= 'D') goto yy279;
+ goto yy278;
+ } else {
+ if(yych <= 'c') goto yy56;
+ if(yych <= 'd') goto yy279;
+ if(yych >= 'f') goto yy56;
+ goto yy278;
+ }
+yy278:
+ YYDEBUG(278, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'K') goto yy258;
+ if(yych == 'k') goto yy258;
+ goto yy56;
+yy279:
+ YYDEBUG(279, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy280;
+ if(yych != 'n') goto yy56;
+ goto yy280;
+yy280:
+ YYDEBUG(280, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy281;
+ if(yych != 'e') goto yy56;
+ goto yy281;
+yy281:
+ YYDEBUG(281, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'S') goto yy282;
+ if(yych != 's') goto yy56;
+ goto yy282;
+yy282:
+ YYDEBUG(282, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy283;
+ if(yych != 'd') goto yy56;
+ goto yy283;
+yy283:
+ YYDEBUG(283, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy284;
+ if(yych != 'a') goto yy56;
+ goto yy284;
+yy284:
+ YYDEBUG(284, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy285:
+ YYDEBUG(285, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy258;
+ if(yych == 'y') goto yy258;
+ goto yy56;
+yy286:
+ YYDEBUG(286, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy287;
+ if(yych != 'u') goto yy56;
+ goto yy287;
+yy287:
+ YYDEBUG(287, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy258;
+ if(yych == 'r') goto yy258;
+ goto yy56;
+yy288:
+ YYDEBUG(288, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy293;
+ if(yych == 'n') goto yy293;
+ goto yy56;
+yy289:
+ YYDEBUG(289, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy290;
+ if(yych != 'n') goto yy56;
+ goto yy290;
+yy290:
+ YYDEBUG(290, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy198;
+ case 'F': case 'f': goto yy194;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy259;
+ case 'T': case 't': goto yy197;
+ case 'U': case 'u': goto yy291;
+ default: goto yy193;
+ }
+yy291:
+ YYDEBUG(291, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy292;
+ if(yych != 't') goto yy56;
+ goto yy292;
+yy292:
+ YYDEBUG(292, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'E') goto yy258;
+ if(yych == 'e') goto yy258;
+ goto yy56;
+yy293:
+ YYDEBUG(293, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= 'T'){
+ if(yych == 'D') goto yy294;
+ if(yych <= 'S') goto yy56;
+ goto yy295;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy56;
+ goto yy294;
+ } else {
+ if(yych == 't') goto yy295;
+ goto yy56;
+ }
+ }
+yy294:
+ YYDEBUG(294, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy296;
+ if(yych == 'a') goto yy296;
+ goto yy56;
+yy295:
+ YYDEBUG(295, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'H') goto yy258;
+ if(yych == 'h') goto yy258;
+ goto yy56;
+yy296:
+ YYDEBUG(296, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy297:
+ YYDEBUG(297, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'T') goto yy306;
+ if(yych == 't') goto yy306;
+ goto yy56;
+yy298:
+ YYDEBUG(298, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy303;
+ if(yych == 'n') goto yy303;
+ goto yy56;
+yy299:
+ YYDEBUG(299, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'C') goto yy300;
+ if(yych != 'c') goto yy56;
+ goto yy300;
+yy300:
+ YYDEBUG(300, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'E': case 'e': goto yy198;
+ case 'F': case 'f': goto yy194;
+ case 'L': case 'l': goto yy199;
+ case 'N': case 'n': goto yy195;
+ case 'O': case 'o': goto yy301;
+ case 'P': case 'p': goto yy200;
+ case 'S': case 's': goto yy259;
+ case 'T': case 't': goto yy197;
+ default: goto yy193;
+ }
+yy301:
+ YYDEBUG(301, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'N') goto yy302;
+ if(yych != 'n') goto yy56;
+ goto yy302;
+yy302:
+ YYDEBUG(302, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy258;
+ if(yych == 'd') goto yy258;
+ goto yy56;
+yy303:
+ YYDEBUG(303, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy304;
+ if(yych != 'd') goto yy56;
+ goto yy304;
+yy304:
+ YYDEBUG(304, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy305;
+ if(yych != 'a') goto yy56;
+ goto yy305;
+yy305:
+ YYDEBUG(305, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy306:
+ YYDEBUG(306, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'U') goto yy307;
+ if(yych != 'u') goto yy56;
+ goto yy307;
+yy307:
+ YYDEBUG(307, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'R') goto yy308;
+ if(yych != 'r') goto yy56;
+ goto yy308;
+yy308:
+ YYDEBUG(308, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'D') goto yy309;
+ if(yych != 'd') goto yy56;
+ goto yy309;
+yy309:
+ YYDEBUG(309, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'A') goto yy310;
+ if(yych != 'a') goto yy56;
+ goto yy310;
+yy310:
+ YYDEBUG(310, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == 'Y') goto yy192;
+ if(yych == 'y') goto yy192;
+ goto yy56;
+yy311:
+ YYDEBUG(311, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy171;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy312;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy312:
+ YYDEBUG(312, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'V'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy52;
+ goto yy172;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'v') goto yy313;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy313:
+ YYDEBUG(313, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'I'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'H') goto yy3;
+ goto yy173;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'i') goto yy314;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy314:
+ YYDEBUG(314, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'O') goto yy174;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'o') goto yy315;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy315:
+ YYDEBUG(315, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy175;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy316;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy316:
+ YYDEBUG(316, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy317:
+ YYDEBUG(317, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy176;
+ case '/': case '_': goto yy55;
+ case 'D': goto yy181;
+ case 'F': goto yy183;
+ case 'H': goto yy180;
+ case 'M': goto yy179;
+ case 'S': goto yy178;
+ case 'T': goto yy185;
+ case 'W': goto yy182;
+ case 'Y': goto yy184;
+ 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 yy61;
+ case 'd': goto yy321;
+ case 'f': goto yy323;
+ case 'h': goto yy320;
+ case 'm': goto yy319;
+ case 's': goto yy318;
+ case 't': goto yy325;
+ case 'w': goto yy322;
+ case 'y': goto yy324;
+ default: goto yy56;
+ }
+yy318:
+ YYDEBUG(318, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'A'){
+ if(yych == '/') goto yy55;
+ if(yych <= '@') goto yy56;
+ goto yy297;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy56;
+ goto yy299;
+ } else {
+ if(yych == 'U') goto yy298;
+ goto yy56;
+ }
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'a') goto yy436;
+ goto yy61;
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'e') goto yy437;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy438;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+ }
+yy319:
+ YYDEBUG(319, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'H'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy289;
+ if(yych == 'O') goto yy288;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'h') goto yy61;
+ goto yy427;
+ } else {
+ if(yych == 'o') goto yy428;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy320:
+ YYDEBUG(320, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'O') goto yy286;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'o') goto yy425;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy321:
+ YYDEBUG(321, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy285;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy424;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy322:
+ YYDEBUG(322, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy277;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy416;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy323:
+ YYDEBUG(323, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'N'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'O') goto yy262;
+ if(yych == 'R') goto yy261;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'n') goto yy61;
+ goto yy400;
+ } else {
+ if(yych == 'r') goto yy401;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy324:
+ YYDEBUG(324, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy256;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy395;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy325:
+ YYDEBUG(325, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'G'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'H') goto yy186;
+ if(yych == 'U') goto yy187;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'g') goto yy61;
+ goto yy326;
+ } else {
+ if(yych == 'u') goto yy327;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy326:
+ YYDEBUG(326, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy251;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy390;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy327:
+ YYDEBUG(327, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy188;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy328;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy328:
+ YYDEBUG(328, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy189;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy329;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy329:
+ YYDEBUG(329, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy190;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy330;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy330:
+ YYDEBUG(330, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy191;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy331;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy331:
+ YYDEBUG(331, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy332:
+ YYDEBUG(332, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy198;
+ case 'F': goto yy194;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'P': goto yy200;
+ case 'S': goto yy196;
+ case 'T': goto yy197;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k': case 'm': case 'o': case 'q':
+ case 'r': case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy333;
+ case 'f': goto yy334;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'p': goto yy337;
+ case 's': goto yy338;
+ case 't': goto yy339;
+ default: goto yy193;
+ }
+yy333:
+ YYDEBUG(333, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'H'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy207;
+ if(yych == 'L') goto yy206;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'h') goto yy61;
+ goto yy382;
+ } else {
+ if(yych == 'l') goto yy381;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy334:
+ YYDEBUG(334, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'H'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy242;
+ if(yych == 'O') goto yy243;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'h') goto yy61;
+ goto yy372;
+ } else {
+ if(yych == 'o') goto yy373;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy335:
+ YYDEBUG(335, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy204;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy370;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy336:
+ YYDEBUG(336, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'D'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy238;
+ if(yych == 'I') goto yy237;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'd') goto yy61;
+ goto yy366;
+ } else {
+ if(yych == 'i') goto yy365;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy337:
+ YYDEBUG(337, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy201;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy362;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy338:
+ YYDEBUG(338, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'D'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy226;
+ if(yych == 'I') goto yy227;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'd') goto yy61;
+ goto yy351;
+ } else {
+ if(yych == 'i') goto yy352;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy339:
+ YYDEBUG(339, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'E'){
+ if(yych == '/') goto yy55;
+ if(yych <= 'D') goto yy56;
+ goto yy217;
+ } else {
+ if(yych <= 'H'){
+ if(yych <= 'G') goto yy56;
+ goto yy215;
+ } else {
+ if(yych == 'W') goto yy216;
+ goto yy56;
+ }
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych == 'e') goto yy342;
+ goto yy61;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych >= 'i') goto yy61;
+ goto yy340;
+ } else {
+ if(yych <= 'w') goto yy341;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+ }
+yy340:
+ YYDEBUG(340, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy224;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy349;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy341:
+ YYDEBUG(341, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy220;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy345;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy342:
+ YYDEBUG(342, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy218;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy343;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy343:
+ YYDEBUG(343, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy219;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy344;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy344:
+ YYDEBUG(344, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy345:
+ YYDEBUG(345, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'L') goto yy221;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'k'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'l') goto yy346;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy346:
+ YYDEBUG(346, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'F') goto yy222;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'f') goto yy347;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy347:
+ YYDEBUG(347, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy223;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy348;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy348:
+ YYDEBUG(348, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy349:
+ YYDEBUG(349, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'Q'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'R') goto yy225;
+ if(yych <= 'S') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy350;
+ if(yych <= 's') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy350:
+ YYDEBUG(350, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy351:
+ YYDEBUG(351, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'B'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'C') goto yy230;
+ if(yych == 'V') goto yy231;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'b') goto yy61;
+ goto yy355;
+ } else {
+ if(yych == 'v') goto yy356;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy352:
+ YYDEBUG(352, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'X') goto yy228;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'w'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'x') goto yy353;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy353:
+ YYDEBUG(353, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy229;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy354;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy354:
+ YYDEBUG(354, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy355:
+ YYDEBUG(355, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'O') goto yy235;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'o') goto yy360;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy356:
+ YYDEBUG(356, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy232;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy357;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy357:
+ YYDEBUG(357, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy233;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy358;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy358:
+ YYDEBUG(358, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy234;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy359;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy359:
+ YYDEBUG(359, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy360:
+ YYDEBUG(360, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy236;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy361;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy361:
+ YYDEBUG(361, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy362:
+ YYDEBUG(362, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy202;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy363;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy363:
+ YYDEBUG(363, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'V') goto yy203;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'v') goto yy364;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy364:
+ YYDEBUG(364, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy173;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy314;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy365:
+ YYDEBUG(365, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy240;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy368;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy366:
+ YYDEBUG(366, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'X') goto yy239;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'w'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'x') goto yy367;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy367:
+ YYDEBUG(367, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy368:
+ YYDEBUG(368, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy241;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy369;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy369:
+ YYDEBUG(369, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy370:
+ YYDEBUG(370, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy205;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy371;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy371:
+ YYDEBUG(371, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy372:
+ YYDEBUG(372, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'E'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'F') goto yy248;
+ if(yych == 'R') goto yy247;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'e') goto yy61;
+ goto yy377;
+ } else {
+ if(yych == 'r') goto yy378;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy373:
+ YYDEBUG(373, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy244;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy374;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy374:
+ YYDEBUG(374, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy245;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy375;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy375:
+ YYDEBUG(375, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy246;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy376;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy376:
+ YYDEBUG(376, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy377:
+ YYDEBUG(377, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy249;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy380;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy378:
+ YYDEBUG(378, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy250;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy379;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy379:
+ YYDEBUG(379, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy380:
+ YYDEBUG(380, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy381:
+ YYDEBUG(381, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy210;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy385;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy382:
+ YYDEBUG(382, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'G') goto yy208;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'g') goto yy383;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy383:
+ YYDEBUG(383, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy209;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy384;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy384:
+ YYDEBUG(384, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy385:
+ YYDEBUG(385, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'V') goto yy211;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'v') goto yy386;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy386:
+ YYDEBUG(386, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy212;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy387;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy387:
+ YYDEBUG(387, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy213;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy388;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy388:
+ YYDEBUG(388, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy214;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy389;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy389:
+ YYDEBUG(389, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy176;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy390:
+ YYDEBUG(390, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy252;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy391;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy391:
+ YYDEBUG(391, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy253;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy392;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy392:
+ YYDEBUG(392, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy254;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy393;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy393:
+ YYDEBUG(393, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy255;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy394;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy394:
+ YYDEBUG(394, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy395:
+ YYDEBUG(395, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy257;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy396;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy396:
+ YYDEBUG(396, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy397:
+ YYDEBUG(397, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy198;
+ case 'F': goto yy194;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'P': goto yy200;
+ case 'S': goto yy259;
+ case 'T': goto yy197;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k': case 'm': case 'o': case 'q':
+ case 'r': case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy333;
+ case 'f': goto yy334;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'p': goto yy337;
+ case 's': goto yy398;
+ case 't': goto yy339;
+ default: goto yy193;
+ }
+yy398:
+ YYDEBUG(398, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy260;
+ case 'F': goto yy194;
+ case 'I': goto yy227;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'P': goto yy200;
+ case 'S': goto yy196;
+ case 'T': goto yy197;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h': case 'j':
+ case 'k': case 'm': case 'o': case 'q':
+ case 'r': case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy399;
+ case 'f': goto yy334;
+ case 'i': goto yy352;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'p': goto yy337;
+ case 's': goto yy338;
+ case 't': goto yy339;
+ default: goto yy193;
+ }
+yy399:
+ YYDEBUG(399, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'H'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'C') goto yy230;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'L'){
+ if(yych <= 'I') goto yy207;
+ if(yych <= 'K') goto yy56;
+ goto yy206;
+ } else {
+ if(yych == 'V') goto yy231;
+ goto yy56;
+ }
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'b'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'c') goto yy355;
+ if(yych <= 'h') goto yy61;
+ goto yy382;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych == 'l') goto yy381;
+ goto yy61;
+ } else {
+ if(yych <= 'v') goto yy356;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+ }
+yy400:
+ YYDEBUG(400, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy263;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy405;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy401:
+ YYDEBUG(401, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy274;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy402;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy402:
+ YYDEBUG(402, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy275;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy403;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy403:
+ YYDEBUG(403, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy276;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy404;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy404:
+ YYDEBUG(404, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy405:
+ YYDEBUG(405, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy264;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy406;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy406:
+ YYDEBUG(406, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'G'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'H') goto yy266;
+ if(yych == 'N') goto yy265;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'g') goto yy61;
+ goto yy408;
+ } else {
+ if(yych == 'n') goto yy407;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy407:
+ YYDEBUG(407, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy271;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy413;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy408:
+ YYDEBUG(408, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy267;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy409;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy409:
+ YYDEBUG(409, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'I') goto yy268;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'i') goto yy410;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy410:
+ YYDEBUG(410, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'G') goto yy269;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'g') goto yy411;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy411:
+ YYDEBUG(411, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy270;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy412;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy412:
+ YYDEBUG(412, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy413:
+ YYDEBUG(413, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'G') goto yy272;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'g') goto yy414;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy414:
+ YYDEBUG(414, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy273;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy415;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy415:
+ YYDEBUG(415, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy416:
+ YYDEBUG(416, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'C'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'D') goto yy279;
+ if(yych <= 'E') goto yy278;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy418;
+ if(yych <= 'e') goto yy417;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy417:
+ YYDEBUG(417, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'K') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'j'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'k') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy418:
+ YYDEBUG(418, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy280;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy419;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy419:
+ YYDEBUG(419, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy281;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy420;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy420:
+ YYDEBUG(420, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'S') goto yy282;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 's') goto yy421;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy421:
+ YYDEBUG(421, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy283;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy422;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy422:
+ YYDEBUG(422, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy284;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy423;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy423:
+ YYDEBUG(423, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy424:
+ YYDEBUG(424, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy425:
+ YYDEBUG(425, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy287;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy426;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy426:
+ YYDEBUG(426, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy427:
+ YYDEBUG(427, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy290;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy433;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy428:
+ YYDEBUG(428, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy293;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy429;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy429:
+ YYDEBUG(429, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= 'C'){
+ if(yych == '/') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'D') goto yy294;
+ if(yych == 'T') goto yy295;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'c') goto yy61;
+ goto yy430;
+ } else {
+ if(yych == 't') goto yy431;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy430:
+ YYDEBUG(430, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy296;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy432;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy431:
+ YYDEBUG(431, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'H') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'h') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy432:
+ YYDEBUG(432, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy433:
+ YYDEBUG(433, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy198;
+ case 'F': goto yy194;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'P': goto yy200;
+ case 'S': goto yy259;
+ case 'T': goto yy197;
+ case 'U': goto yy291;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k': case 'm': case 'o': case 'q':
+ case 'r': case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy333;
+ case 'f': goto yy334;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'p': goto yy337;
+ case 's': goto yy398;
+ case 't': goto yy339;
+ case 'u': goto yy434;
+ default: goto yy193;
+ }
+yy434:
+ YYDEBUG(434, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy292;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy435;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy435:
+ YYDEBUG(435, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'E') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy436:
+ YYDEBUG(436, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy306;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy445;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy437:
+ YYDEBUG(437, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'C') goto yy300;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'c') goto yy442;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy438:
+ YYDEBUG(438, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy303;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy439;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy439:
+ YYDEBUG(439, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy304;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy440;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy440:
+ YYDEBUG(440, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy305;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy441;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy441:
+ YYDEBUG(441, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy442:
+ YYDEBUG(442, *YYCURSOR);
+ yyaccept = 5;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '/': case '_': goto yy55;
+ case 'E': goto yy198;
+ case 'F': goto yy194;
+ case 'L': goto yy199;
+ case 'N': goto yy195;
+ case 'O': goto yy301;
+ case 'P': goto yy200;
+ case 'S': goto yy259;
+ case 'T': goto yy197;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd': case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k': case 'm': case 'q':
+ case 'r': case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy61;
+ case 'e': goto yy333;
+ case 'f': goto yy334;
+ case 'l': goto yy335;
+ case 'n': goto yy336;
+ case 'o': goto yy443;
+ case 'p': goto yy337;
+ case 's': goto yy398;
+ case 't': goto yy339;
+ default: goto yy193;
+ }
+yy443:
+ YYDEBUG(443, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'N') goto yy302;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'n') goto yy444;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy444:
+ YYDEBUG(444, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy258;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy397;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy445:
+ YYDEBUG(445, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'U') goto yy307;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'u') goto yy446;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy446:
+ YYDEBUG(446, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy308;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy447;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy447:
+ YYDEBUG(447, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'D') goto yy309;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'd') goto yy448;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy448:
+ YYDEBUG(448, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'A') goto yy310;
+ goto yy56;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= '_') goto yy55;
+ goto yy56;
+ } else {
+ if(yych <= 'a') goto yy449;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy449:
+ YYDEBUG(449, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy192;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy332;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy450:
+ YYDEBUG(450, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy51;
+ goto yy451;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 's') goto yy451;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy451:
+ YYDEBUG(451, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy452;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy452;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy452:
+ YYDEBUG(452, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy177;
+ case ')': goto yy49;
+ default: goto yy3;
+ }
+yy453:
+ YYDEBUG(453, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy51;
+ goto yy451;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 's') goto yy454;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy454:
+ YYDEBUG(454, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy452;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy455;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy455:
+ YYDEBUG(455, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': goto yy177;
+ case ')': goto yy49;
+ case '/': case '_': goto yy55;
+ 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 yy61;
+ case 'd': goto yy321;
+ case 'f': goto yy323;
+ case 'h': goto yy320;
+ case 'm': goto yy319;
+ case 's': goto yy318;
+ case 't': goto yy325;
+ case 'w': goto yy322;
+ case 'y': goto yy324;
+ default: goto yy3;
+ }
+yy456:
+ YYDEBUG(456, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'G'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'F') goto yy51;
+ goto yy460;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'g') goto yy460;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy457:
+ YYDEBUG(457, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy458;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'e') goto yy458;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy458:
+ YYDEBUG(458, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy52;
+ goto yy459;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'v') goto yy459;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy459:
+ YYDEBUG(459, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'E') goto yy212;
+ if(yych == 'e') goto yy212;
+ goto yy3;
+ }
+yy460:
+ YYDEBUG(460, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'H'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'G') goto yy52;
+ goto yy461;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'h') goto yy461;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy461:
+ YYDEBUG(461, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy3;
+ }
+yy462:
+ YYDEBUG(462, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'F') goto yy51;
+ goto yy460;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy466;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy463:
+ YYDEBUG(463, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy458;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy464;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy464:
+ YYDEBUG(464, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'V'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy52;
+ goto yy459;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'v') goto yy465;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy465:
+ YYDEBUG(465, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'D') goto yy3;
+ goto yy212;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy387;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy466:
+ YYDEBUG(466, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'G') goto yy52;
+ goto yy461;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy467;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy467:
+ YYDEBUG(467, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'S') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy468:
+ YYDEBUG(468, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy489;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy504;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy469:
+ YYDEBUG(469, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'U'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'H'){
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'I') goto yy482;
+ if(yych <= 'T') goto yy51;
+ goto yy483;
+ }
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '^'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ goto yy54;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'i') goto yy497;
+ goto yy54;
+ } else {
+ if(yych <= 'u') goto yy498;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy470:
+ YYDEBUG(470, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy478;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy493;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy471:
+ YYDEBUG(471, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy476;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy491;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy472:
+ YYDEBUG(472, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy489;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy489;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy473:
+ YYDEBUG(473, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'I') goto yy482;
+ if(yych <= 'T') goto yy51;
+ goto yy483;
+ }
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'h') goto yy51;
+ goto yy482;
+ } else {
+ if(yych == 'u') goto yy483;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy474:
+ YYDEBUG(474, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy478;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'e') goto yy478;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy475:
+ YYDEBUG(475, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy51;
+ goto yy476;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'e') goto yy476;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy476:
+ YYDEBUG(476, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'K') goto yy52;
+ goto yy477;
+ }
+ } else {
+ if(yych <= 'k'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'l') goto yy477;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy477:
+ YYDEBUG(477, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'F') goto yy222;
+ if(yych == 'f') goto yy222;
+ goto yy3;
+ }
+yy478:
+ YYDEBUG(478, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'R') goto yy52;
+ goto yy479;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 's') goto yy479;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy479:
+ YYDEBUG(479, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'C'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'D') goto yy480;
+ if(yych != 'd') goto yy3;
+ goto yy480;
+ }
+yy480:
+ YYDEBUG(480, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy481;
+ if(yych != 'a') goto yy56;
+ goto yy481;
+yy481:
+ YYDEBUG(481, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy482:
+ YYDEBUG(482, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'Q') goto yy52;
+ if(yych <= 'R') goto yy488;
+ goto yy452;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'r') goto yy488;
+ if(yych <= 's') goto yy452;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy483:
+ YYDEBUG(483, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'Q') goto yy52;
+ goto yy484;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'r') goto yy484;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy484:
+ YYDEBUG(484, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'S') goto yy485;
+ if(yych != 's') goto yy3;
+ goto yy485;
+ }
+yy485:
+ YYDEBUG(485, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy486;
+ if(yych != 'd') goto yy56;
+ goto yy486;
+yy486:
+ YYDEBUG(486, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy487;
+ if(yych != 'a') goto yy56;
+ goto yy487;
+yy487:
+ YYDEBUG(487, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy488:
+ YYDEBUG(488, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'C'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'D') goto yy176;
+ if(yych == 'd') goto yy176;
+ goto yy3;
+ }
+yy489:
+ YYDEBUG(489, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy490;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy490;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy490:
+ YYDEBUG(490, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy3;
+ }
+yy491:
+ YYDEBUG(491, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'K') goto yy52;
+ goto yy477;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'l') goto yy492;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy492:
+ YYDEBUG(492, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'F'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'E') goto yy3;
+ goto yy222;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'f') goto yy347;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy493:
+ YYDEBUG(493, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'R') goto yy52;
+ goto yy479;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 's') goto yy494;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy494:
+ YYDEBUG(494, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'C') goto yy3;
+ goto yy480;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'd') goto yy495;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy495:
+ YYDEBUG(495, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy481;
+ if(yych != 'a') goto yy62;
+ goto yy496;
+yy496:
+ YYDEBUG(496, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy497:
+ YYDEBUG(497, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy52;
+ if(yych <= 'R') goto yy488;
+ goto yy452;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy60;
+ goto yy503;
+ } else {
+ if(yych <= 's') goto yy455;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy498:
+ YYDEBUG(498, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'Q') goto yy52;
+ goto yy484;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'r') goto yy499;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy499:
+ YYDEBUG(499, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'R') goto yy3;
+ goto yy485;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 's') goto yy500;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy500:
+ YYDEBUG(500, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy486;
+ if(yych != 'd') goto yy62;
+ goto yy501;
+yy501:
+ YYDEBUG(501, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy487;
+ if(yych != 'a') goto yy62;
+ goto yy502;
+yy502:
+ YYDEBUG(502, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy503:
+ YYDEBUG(503, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'C') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'd') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy504:
+ YYDEBUG(504, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy490;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy505;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy505:
+ YYDEBUG(505, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy506:
+ YYDEBUG(506, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'C'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'B') goto yy51;
+ goto yy507;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'c') goto yy507;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy507:
+ YYDEBUG(507, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'E') goto yy516;
+ goto yy52;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'e') goto yy516;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy508:
+ YYDEBUG(508, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 17) YYFILL(17);
+ yych = *YYCURSOR;
+ goto yy509;
+yy509:
+ YYDEBUG(509, *YYCURSOR);
+ if(yybm[0+yych] & 64) {
+ goto yy508;
+ }
+ if(yych <= '/') goto yy56;
+ if(yych <= '2') goto yy512;
+ if(yych <= '3') goto yy514;
+ if(yych <= '9') goto yy515;
+ goto yy56;
+yy510:
+ YYDEBUG(510, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 0x1F) goto yy3;
+ if(yych == '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+yy511:
+ YYDEBUG(511, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy509;
+ if(yych <= '0') goto yy588;
+ if(yych <= '2') goto yy589;
+ if(yych <= '3') goto yy590;
+ goto yy509;
+yy512:
+ YYDEBUG(512, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy524;
+ if(yych == '2') goto yy587;
+ if(yych <= '9') goto yy570;
+ goto yy524;
+yy513:
+ YYDEBUG(513, *YYCURSOR);
+
+#line 1088 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("datetextual | datenoyear");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_TEXT;
+ }
+#line 8463 "ext/date/lib/parse_date.c"
+yy514:
+ YYDEBUG(514, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy524;
+ if(yych <= '1') goto yy570;
+ if(yych <= '2') goto yy521;
+ if(yych <= '9') goto yy522;
+ goto yy524;
+yy515:
+ YYDEBUG(515, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy524;
+ if(yych <= '1') goto yy520;
+ if(yych <= '2') goto yy521;
+ if(yych <= '9') goto yy522;
+ goto yy524;
+yy516:
+ YYDEBUG(516, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'M') goto yy517;
+ if(yych != 'm') goto yy3;
+ goto yy517;
+ }
+yy517:
+ YYDEBUG(517, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy518;
+ if(yych != 'b') goto yy56;
+ goto yy518;
+yy518:
+ YYDEBUG(518, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy519;
+ if(yych != 'e') goto yy56;
+ goto yy519;
+yy519:
+ YYDEBUG(519, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy508;
+ if(yych == 'r') goto yy508;
+ goto yy56;
+yy520:
+ YYDEBUG(520, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy569;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy521:
+ YYDEBUG(521, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '3') goto yy569;
+ if(yych <= '9') goto yy566;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy522:
+ YYDEBUG(522, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy566;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy523:
+ YYDEBUG(523, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 14) YYFILL(14);
+ yych = *YYCURSOR;
+ goto yy524;
+yy524:
+ YYDEBUG(524, *YYCURSOR);
+ if(yybm[0+yych] & 128) {
+ goto yy523;
+ }
+ if(yych <= '/') goto yy513;
+ if(yych <= '1') goto yy525;
+ if(yych <= '2') goto yy526;
+ if(yych <= '9') goto yy527;
+ goto yy513;
+yy525:
+ YYDEBUG(525, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy565;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy526:
+ YYDEBUG(526, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '3') goto yy565;
+ if(yych <= '9') goto yy528;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy527:
+ YYDEBUG(527, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy528;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy528:
+ YYDEBUG(528, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy513;
+ if(yych <= '9') goto yy563;
+ goto yy513;
+yy529:
+ YYDEBUG(529, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy530;
+ if(yych <= '9') goto yy532;
+ goto yy56;
+yy530:
+ YYDEBUG(530, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy533;
+ goto yy531;
+ } else {
+ if(yych <= '9') goto yy532;
+ if(yych <= ':') goto yy533;
+ goto yy531;
+ }
+yy531:
+ YYDEBUG(531, *YYCURSOR);
+
+#line 1317 "ext/date/lib/parse_date.re"
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
+ }
+ }
+
+ if (*ptr != '\0') {
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_SHORTDATE_WITH_TIME;
+ }
+#line 8619 "ext/date/lib/parse_date.c"
+yy532:
+ YYDEBUG(532, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy533;
+ if(yych != ':') goto yy531;
+ goto yy533;
+yy533:
+ YYDEBUG(533, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy534;
+ if(yych <= '6') goto yy535;
+ if(yych <= '9') goto yy536;
+ goto yy56;
+yy534:
+ YYDEBUG(534, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy531;
+ if(yych <= '9') goto yy537;
+ goto yy531;
+yy535:
+ YYDEBUG(535, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '0') goto yy537;
+ goto yy531;
+yy536:
+ YYDEBUG(536, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy531;
+yy537:
+ YYDEBUG(537, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '+'){
+ if(yych <= '\''){
+ if(yych != ' ') goto yy531;
+ goto yy538;
+ } else {
+ if(yych <= '(') goto yy541;
+ if(yych <= '*') goto yy531;
+ goto yy540;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == '-') goto yy540;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy542;
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy543;
+ goto yy531;
+ }
+ }
+yy538:
+ YYDEBUG(538, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
+ yych = *YYCURSOR;
+ goto yy539;
+yy539:
+ YYDEBUG(539, *YYCURSOR);
+ if(yych <= '+'){
+ if(yych <= '\''){
+ if(yych == ' ') goto yy538;
+ goto yy56;
+ } else {
+ if(yych <= '(') goto yy541;
+ if(yych <= '*') goto yy56;
+ goto yy540;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych != '-') goto yy56;
+ goto yy540;
+ } else {
+ if(yych <= 'Z') goto yy542;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'z') goto yy543;
+ goto yy56;
+ }
+ }
+yy540:
+ YYDEBUG(540, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy556;
+ if(yych <= '2') goto yy557;
+ if(yych <= '9') goto yy558;
+ goto yy56;
+yy541:
+ YYDEBUG(541, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@') goto yy56;
+ if(yych <= 'Z') goto yy543;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'z') goto yy543;
+ goto yy56;
+yy542:
+ YYDEBUG(542, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy536;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy544;
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy547;
+ goto yy531;
+ }
+yy543:
+ YYDEBUG(543, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy536;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy544;
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy544;
+ }
+yy544:
+ YYDEBUG(544, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy536;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy545;
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy545;
+ }
+yy545:
+ YYDEBUG(545, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '@'){
+ if(yych == ')') goto yy536;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy546;
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy546;
+ }
+yy546:
+ YYDEBUG(546, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == ')') goto yy536;
+ goto yy531;
+yy547:
+ YYDEBUG(547, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy531;
+ goto yy536;
+ } else {
+ if(yych == '/') goto yy549;
+ goto yy531;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy545;
+ if(yych <= '^') goto yy531;
+ goto yy549;
+ } else {
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy548;
+ }
+ }
+yy548:
+ YYDEBUG(548, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy531;
+ goto yy536;
+ } else {
+ if(yych != '/') goto yy531;
+ goto yy549;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy546;
+ if(yych <= '^') goto yy531;
+ goto yy549;
+ } else {
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy553;
+ goto yy531;
+ }
+ }
+yy549:
+ YYDEBUG(549, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '@') goto yy56;
+ if(yych >= '[') goto yy56;
+ goto yy550;
+yy550:
+ YYDEBUG(550, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '`') goto yy56;
+ if(yych >= '{') goto yy56;
+ goto yy551;
+yy551:
+ YYDEBUG(551, *YYCURSOR);
+ yyaccept = 7;
+ YYMARKER = ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy552;
+yy552:
+ YYDEBUG(552, *YYCURSOR);
+ if(yych <= '^'){
+ if(yych == '/') goto yy549;
+ goto yy531;
+ } else {
+ if(yych <= '_') goto yy549;
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy551;
+ goto yy531;
+ }
+yy553:
+ YYDEBUG(553, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == ')') goto yy536;
+ if(yych <= '.') goto yy531;
+ goto yy549;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy531;
+ goto yy549;
+ } else {
+ if(yych <= '`') goto yy531;
+ if(yych >= '{') goto yy531;
+ goto yy554;
+ }
+ }
+yy554:
+ YYDEBUG(554, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy555;
+yy555:
+ YYDEBUG(555, *YYCURSOR);
+ if(yych <= '^'){
+ if(yych == '/') goto yy549;
+ goto yy56;
+ } else {
+ if(yych <= '_') goto yy549;
+ if(yych <= '`') goto yy56;
+ if(yych <= 'z') goto yy554;
+ goto yy56;
+ }
+yy556:
+ YYDEBUG(556, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy531;
+ if(yych <= '5') goto yy561;
+ if(yych <= '9') goto yy558;
+ if(yych <= ':') goto yy559;
+ goto yy531;
+yy557:
+ YYDEBUG(557, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '5'){
+ if(yych <= '/') goto yy531;
+ if(yych <= '3') goto yy561;
+ goto yy560;
+ } else {
+ if(yych == ':') goto yy559;
+ goto yy531;
+ }
+yy558:
+ YYDEBUG(558, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy531;
+ if(yych <= '5') goto yy560;
+ if(yych != ':') goto yy531;
+ goto yy559;
+yy559:
+ YYDEBUG(559, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy531;
+ if(yych >= '6') goto yy531;
+ goto yy560;
+yy560:
+ YYDEBUG(560, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy536;
+ goto yy56;
+yy561:
+ YYDEBUG(561, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy531;
+ if(yych <= '5') goto yy562;
+ if(yych <= '9') goto yy536;
+ if(yych <= ':') goto yy559;
+ goto yy531;
+yy562:
+ YYDEBUG(562, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy531;
+ if(yych <= '9') goto yy536;
+ goto yy531;
+yy563:
+ YYDEBUG(563, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy513;
+ if(yych >= ':') goto yy513;
+ goto yy564;
+yy564:
+ YYDEBUG(564, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy513;
+yy565:
+ YYDEBUG(565, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy563;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy566:
+ YYDEBUG(566, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy513;
+ if(yych >= ':') goto yy513;
+ goto yy567;
+yy567:
+ YYDEBUG(567, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy568;
+ if(yych <= '9') goto yy564;
+ goto yy568;
+yy568:
+ YYDEBUG(568, *YYCURSOR);
+
+#line 1062 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("datenoday");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->d = 1;
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_NO_DAY;
+ }
+#line 8916 "ext/date/lib/parse_date.c"
+yy569:
+ YYDEBUG(569, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy567;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy570:
+ YYDEBUG(570, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '1'){
+ if(yych == '.') goto yy571;
+ if(yych <= '/') goto yy524;
+ goto yy572;
+ } else {
+ if(yych <= '2') goto yy573;
+ if(yych <= '9') goto yy574;
+ if(yych <= ':') goto yy529;
+ goto yy524;
+ }
+yy571:
+ YYDEBUG(571, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy524;
+ if(yych <= '1') goto yy577;
+ goto yy578;
+ } else {
+ if(yych <= '5') goto yy579;
+ if(yych <= '9') goto yy580;
+ goto yy524;
+ }
+yy572:
+ YYDEBUG(572, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy576;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy573:
+ YYDEBUG(573, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '3') goto yy576;
+ if(yych <= '9') goto yy575;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy574:
+ YYDEBUG(574, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy575;
+ if(yych <= ':') goto yy529;
+ goto yy513;
+ }
+yy575:
+ YYDEBUG(575, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy568;
+ if(yych <= '9') goto yy563;
+ goto yy568;
+yy576:
+ YYDEBUG(576, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy529;
+ goto yy568;
+ } else {
+ if(yych <= '9') goto yy563;
+ if(yych <= ':') goto yy529;
+ goto yy568;
+ }
+yy577:
+ YYDEBUG(577, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy581;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy586;
+ if(yych <= ':') goto yy581;
+ goto yy513;
+ }
+yy578:
+ YYDEBUG(578, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy581;
+ goto yy513;
+ } else {
+ if(yych <= '3') goto yy586;
+ if(yych <= '9') goto yy585;
+ if(yych <= ':') goto yy581;
+ goto yy513;
+ }
+yy579:
+ YYDEBUG(579, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy581;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy585;
+ if(yych <= ':') goto yy581;
+ goto yy513;
+ }
+yy580:
+ YYDEBUG(580, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych != '.') goto yy513;
+ goto yy581;
+ } else {
+ if(yych <= '9') goto yy528;
+ if(yych >= ';') goto yy513;
+ goto yy581;
+ }
+yy581:
+ YYDEBUG(581, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy582;
+ if(yych <= '6') goto yy583;
+ if(yych <= '9') goto yy532;
+ goto yy56;
+yy582:
+ YYDEBUG(582, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy533;
+ goto yy531;
+ } else {
+ if(yych <= '9') goto yy584;
+ if(yych <= ':') goto yy533;
+ goto yy531;
+ }
+yy583:
+ YYDEBUG(583, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy533;
+ goto yy531;
+ } else {
+ if(yych <= '0') goto yy537;
+ if(yych == ':') goto yy533;
+ goto yy531;
+ }
+yy584:
+ YYDEBUG(584, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= '('){
+ if(yych == ' ') goto yy538;
+ if(yych <= '\'') goto yy531;
+ goto yy541;
+ } else {
+ if(yych == '+') goto yy540;
+ if(yych <= ',') goto yy531;
+ goto yy540;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych <= '.') goto yy533;
+ if(yych == ':') goto yy533;
+ goto yy531;
+ } else {
+ if(yych <= 'Z') goto yy542;
+ if(yych <= '`') goto yy531;
+ if(yych <= 'z') goto yy543;
+ goto yy531;
+ }
+ }
+yy585:
+ YYDEBUG(585, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy533;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy563;
+ if(yych <= ':') goto yy533;
+ goto yy513;
+ }
+yy586:
+ YYDEBUG(586, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy581;
+ goto yy513;
+ } else {
+ if(yych <= '9') goto yy563;
+ if(yych <= ':') goto yy581;
+ goto yy513;
+ }
+yy587:
+ YYDEBUG(587, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '1'){
+ if(yych == '.') goto yy571;
+ if(yych <= '/') goto yy524;
+ goto yy572;
+ } else {
+ if(yych <= '2') goto yy573;
+ if(yych <= '9') goto yy574;
+ if(yych <= ':') goto yy529;
+ goto yy524;
+ }
+yy588:
+ YYDEBUG(588, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '1'){
+ if(yych <= '/') goto yy524;
+ if(yych <= '0') goto yy570;
+ goto yy591;
+ } else {
+ if(yych <= '2') goto yy598;
+ if(yych <= '9') goto yy591;
+ goto yy524;
+ }
+yy589:
+ YYDEBUG(589, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy524;
+ if(yych == '2') goto yy598;
+ if(yych <= '9') goto yy591;
+ goto yy524;
+yy590:
+ YYDEBUG(590, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy524;
+ if(yych <= '1') goto yy591;
+ if(yych <= '2') goto yy521;
+ if(yych <= '9') goto yy522;
+ goto yy524;
+yy591:
+ YYDEBUG(591, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '-': goto yy592;
+ case '.': goto yy571;
+ case '0':
+ case '1': goto yy572;
+ case '2': goto yy573;
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy574;
+ case ':': goto yy529;
+ default: goto yy524;
+ }
+yy592:
+ YYDEBUG(592, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy593;
+yy593:
+ YYDEBUG(593, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy594;
+ if(yych <= '9') goto yy595;
+ goto yy594;
+yy594:
+ YYDEBUG(594, *YYCURSOR);
+
+#line 1197 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("pgtextshort");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_PG_TEXT;
+ }
+#line 9177 "ext/date/lib/parse_date.c"
+yy595:
+ YYDEBUG(595, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy594;
+ if(yych >= ':') goto yy594;
+ goto yy596;
+yy596:
+ YYDEBUG(596, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy594;
+ if(yych >= ':') goto yy594;
+ goto yy597;
+yy597:
+ YYDEBUG(597, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy594;
+yy598:
+ YYDEBUG(598, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '-': goto yy592;
+ case '.': goto yy571;
+ case '0':
+ case '1': goto yy572;
+ case '2': goto yy573;
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy574;
+ case ':': goto yy529;
+ default: goto yy524;
+ }
+yy599:
+ YYDEBUG(599, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'C'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'B') goto yy51;
+ goto yy507;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'c') goto yy600;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy600:
+ YYDEBUG(600, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy52;
+ goto yy516;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'e') goto yy601;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy601:
+ YYDEBUG(601, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'M'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'L') goto yy3;
+ goto yy517;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'm') goto yy602;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy602:
+ YYDEBUG(602, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy518;
+ if(yych != 'b') goto yy62;
+ goto yy603;
+yy603:
+ YYDEBUG(603, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy519;
+ if(yych != 'e') goto yy62;
+ goto yy604;
+yy604:
+ YYDEBUG(604, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy605:
+ YYDEBUG(605, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych == '/') goto yy55;
+ goto yy509;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy509;
+ if(yych <= 'z') goto yy61;
+ goto yy509;
+ }
+yy606:
+ YYDEBUG(606, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy51;
+ goto yy618;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'v') goto yy618;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy607:
+ YYDEBUG(607, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'V'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy51;
+ goto yy618;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'v') goto yy619;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy608:
+ YYDEBUG(608, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'X'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'W') goto yy51;
+ goto yy614;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'x') goto yy617;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy609:
+ YYDEBUG(609, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy612;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy615;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy610:
+ YYDEBUG(610, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'X'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'W') goto yy51;
+ goto yy614;
+ }
+ } else {
+ if(yych <= 'w'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'x') goto yy614;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy611:
+ YYDEBUG(611, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy612;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy612;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy612:
+ YYDEBUG(612, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy613;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy613;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy613:
+ YYDEBUG(613, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy3;
+ }
+yy614:
+ YYDEBUG(614, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy452;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy452;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy615:
+ YYDEBUG(615, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy613;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy616;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy616:
+ YYDEBUG(616, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy617:
+ YYDEBUG(617, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy452;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy455;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy618:
+ YYDEBUG(618, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'E') goto yy620;
+ goto yy52;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'e') goto yy620;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy619:
+ YYDEBUG(619, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy52;
+ goto yy620;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'e') goto yy621;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy620:
+ YYDEBUG(620, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'M') goto yy622;
+ if(yych == 'm') goto yy622;
+ goto yy3;
+ }
+yy621:
+ YYDEBUG(621, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'M'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'L') goto yy3;
+ goto yy622;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'm') goto yy623;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy622:
+ YYDEBUG(622, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy624;
+ if(yych == 'b') goto yy624;
+ goto yy56;
+yy623:
+ YYDEBUG(623, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy624;
+ if(yych == 'b') goto yy625;
+ goto yy62;
+yy624:
+ YYDEBUG(624, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy626;
+ if(yych == 'e') goto yy626;
+ goto yy56;
+yy625:
+ YYDEBUG(625, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy626;
+ if(yych == 'e') goto yy627;
+ goto yy62;
+yy626:
+ YYDEBUG(626, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy508;
+ if(yych == 'r') goto yy508;
+ goto yy56;
+yy627:
+ YYDEBUG(627, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy628:
+ YYDEBUG(628, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy51;
+ goto yy629;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 't') goto yy629;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy629:
+ YYDEBUG(629, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'O') goto yy52;
+ goto yy630;
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'o') goto yy630;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy630:
+ YYDEBUG(630, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'B') goto yy631;
+ if(yych != 'b') goto yy3;
+ goto yy631;
+ }
+yy631:
+ YYDEBUG(631, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy632;
+ if(yych != 'e') goto yy56;
+ goto yy632;
+yy632:
+ YYDEBUG(632, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy508;
+ if(yych == 'r') goto yy508;
+ goto yy56;
+yy633:
+ YYDEBUG(633, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy51;
+ goto yy629;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy634;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy634:
+ YYDEBUG(634, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'O'){
+ if(yych <= 'N') goto yy52;
+ goto yy630;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'o') goto yy635;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy635:
+ YYDEBUG(635, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'B'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'A') goto yy3;
+ goto yy631;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'b') goto yy636;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy636:
+ YYDEBUG(636, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy632;
+ if(yych != 'e') goto yy62;
+ goto yy637;
+yy637:
+ YYDEBUG(637, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy638:
+ YYDEBUG(638, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'V'){
+ if(yych <= 'B'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'O'){
+ if(yych <= 'C') goto yy653;
+ goto yy51;
+ } else {
+ if(yych <= 'P') goto yy652;
+ if(yych <= 'U') goto yy51;
+ goto yy654;
+ }
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych == 'c') goto yy653;
+ goto yy51;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych <= 'p') goto yy652;
+ goto yy51;
+ } else {
+ if(yych <= 'v') goto yy654;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+ }
+yy639:
+ YYDEBUG(639, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy51;
+ goto yy647;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 't') goto yy647;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy640:
+ YYDEBUG(640, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'X'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'W') goto yy51;
+ goto yy645;
+ }
+ } else {
+ if(yych <= 'w'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'x') goto yy645;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy641:
+ YYDEBUG(641, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy642;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy642;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy642:
+ YYDEBUG(642, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy643;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'd') goto yy643;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy643:
+ YYDEBUG(643, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy644;
+ if(yych != 'a') goto yy3;
+ goto yy644;
+ }
+yy644:
+ YYDEBUG(644, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy645:
+ YYDEBUG(645, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy646;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy646;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy646:
+ YYDEBUG(646, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy3;
+ }
+yy647:
+ YYDEBUG(647, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'T') goto yy52;
+ goto yy648;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'u') goto yy648;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy648:
+ YYDEBUG(648, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'Q'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'R') goto yy649;
+ if(yych != 'r') goto yy3;
+ goto yy649;
+ }
+yy649:
+ YYDEBUG(649, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy650;
+ if(yych != 'd') goto yy56;
+ goto yy650;
+yy650:
+ YYDEBUG(650, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy651;
+ if(yych != 'a') goto yy56;
+ goto yy651;
+yy651:
+ YYDEBUG(651, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy652:
+ YYDEBUG(652, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'T') goto yy657;
+ goto yy52;
+ } else {
+ if(yych <= 's'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy657;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy653:
+ YYDEBUG(653, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'N') goto yy52;
+ goto yy656;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'o') goto yy656;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy654:
+ YYDEBUG(654, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy52;
+ goto yy655;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'e') goto yy655;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy655:
+ YYDEBUG(655, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'M'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'N') goto yy233;
+ if(yych == 'n') goto yy233;
+ goto yy3;
+ }
+yy656:
+ YYDEBUG(656, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'M'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'N') goto yy236;
+ if(yych == 'n') goto yy236;
+ goto yy3;
+ }
+yy657:
+ YYDEBUG(657, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '-') goto yy511;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'D'){
+ if(yych <= '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ } else {
+ if(yych <= 'E') goto yy658;
+ if(yych != 'e') goto yy3;
+ goto yy658;
+ }
+ }
+yy658:
+ YYDEBUG(658, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy659;
+ if(yych != 'm') goto yy56;
+ goto yy659;
+yy659:
+ YYDEBUG(659, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy660;
+ if(yych != 'b') goto yy56;
+ goto yy660;
+yy660:
+ YYDEBUG(660, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy661;
+ if(yych != 'e') goto yy56;
+ goto yy661;
+yy661:
+ YYDEBUG(661, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy508;
+ if(yych == 'r') goto yy508;
+ goto yy56;
+yy662:
+ YYDEBUG(662, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'V'){
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych == '/') goto yy55;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'O'){
+ if(yych == 'C') goto yy653;
+ goto yy51;
+ } else {
+ if(yych <= 'P') goto yy652;
+ if(yych <= 'U') goto yy51;
+ goto yy654;
+ }
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'b') goto yy54;
+ goto yy677;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych == 'p') goto yy676;
+ goto yy54;
+ } else {
+ if(yych <= 'v') goto yy678;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy663:
+ YYDEBUG(663, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy51;
+ goto yy647;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy671;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy664:
+ YYDEBUG(664, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'X'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'W') goto yy51;
+ goto yy645;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'x') goto yy669;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy665:
+ YYDEBUG(665, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy642;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy666;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy666:
+ YYDEBUG(666, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy643;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'd') goto yy667;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy667:
+ YYDEBUG(667, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ goto yy644;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy668;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy668:
+ YYDEBUG(668, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy669:
+ YYDEBUG(669, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy646;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy670;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy670:
+ YYDEBUG(670, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy671:
+ YYDEBUG(671, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'U'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'T') goto yy52;
+ goto yy648;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'u') goto yy672;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy672:
+ YYDEBUG(672, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'Q') goto yy3;
+ goto yy649;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'r') goto yy673;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy673:
+ YYDEBUG(673, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy650;
+ if(yych != 'd') goto yy62;
+ goto yy674;
+yy674:
+ YYDEBUG(674, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy651;
+ if(yych != 'a') goto yy62;
+ goto yy675;
+yy675:
+ YYDEBUG(675, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy676:
+ YYDEBUG(676, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'T'){
+ if(yych <= 'S') goto yy52;
+ goto yy657;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 't') goto yy681;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy677:
+ YYDEBUG(677, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'O'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'N') goto yy52;
+ goto yy656;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'o') goto yy680;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy678:
+ YYDEBUG(678, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'E'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy52;
+ goto yy655;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'e') goto yy679;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy679:
+ YYDEBUG(679, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'M') goto yy3;
+ goto yy233;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy358;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy680:
+ YYDEBUG(680, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'M') goto yy3;
+ goto yy236;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy361;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy681:
+ YYDEBUG(681, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy55;
+ goto yy509;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych == 'E') goto yy658;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy61;
+ } else {
+ if(yych <= 'e') goto yy682;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+ }
+yy682:
+ YYDEBUG(682, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy659;
+ if(yych != 'm') goto yy62;
+ goto yy683;
+yy683:
+ YYDEBUG(683, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy660;
+ if(yych != 'b') goto yy62;
+ goto yy684;
+yy684:
+ YYDEBUG(684, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy661;
+ if(yych != 'e') goto yy62;
+ goto yy685;
+yy685:
+ YYDEBUG(685, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'R') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'r') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy686:
+ YYDEBUG(686, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'G'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'F') goto yy51;
+ goto yy693;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'g') goto yy693;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy687:
+ YYDEBUG(687, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy51;
+ goto yy691;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'r') goto yy691;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy688:
+ YYDEBUG(688, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'N') goto yy51;
+ goto yy689;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'o') goto yy689;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy689:
+ YYDEBUG(689, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy690;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy690;
+ if(yych <= 'z') goto yy52;
+ goto yy690;
+ }
+yy690:
+ YYDEBUG(690, *YYCURSOR);
+
+#line 1251 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("ago");
+ TIMELIB_INIT;
+ s->time->relative.y = 0 - s->time->relative.y;
+ s->time->relative.m = 0 - s->time->relative.m;
+ s->time->relative.d = 0 - s->time->relative.d;
+ s->time->relative.h = 0 - s->time->relative.h;
+ s->time->relative.i = 0 - s->time->relative.i;
+ s->time->relative.s = 0 - s->time->relative.s;
+ s->time->relative.weekday = 0 - s->time->relative.weekday;
+ TIMELIB_DEINIT;
+ return TIMELIB_AGO;
+ }
+#line 10757 "ext/date/lib/parse_date.c"
+yy691:
+ YYDEBUG(691, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'I') goto yy52;
+ goto yy692;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'i') goto yy692;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy692:
+ YYDEBUG(692, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'K'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'L') goto yy508;
+ if(yych == 'l') goto yy508;
+ goto yy3;
+ }
+yy693:
+ YYDEBUG(693, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'U') goto yy52;
+ goto yy694;
+ } else {
+ if(yych <= 't'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'u') goto yy694;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy694:
+ YYDEBUG(694, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'S') goto yy695;
+ if(yych != 's') goto yy3;
+ goto yy695;
+ }
+yy695:
+ YYDEBUG(695, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy508;
+ if(yych == 't') goto yy508;
+ goto yy56;
+yy696:
+ YYDEBUG(696, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'F') goto yy51;
+ goto yy693;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'g') goto yy702;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy697:
+ YYDEBUG(697, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy51;
+ goto yy691;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'r') goto yy700;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy698:
+ YYDEBUG(698, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'O'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'N') goto yy51;
+ goto yy689;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'o') goto yy699;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy699:
+ YYDEBUG(699, *YYCURSOR);
+ yyaccept = 9;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy690;
+ goto yy49;
+ } else {
+ if(yych == '/') goto yy55;
+ goto yy690;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy690;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy690;
+ if(yych <= 'z') goto yy60;
+ goto yy690;
+ }
+ }
+yy700:
+ YYDEBUG(700, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'I'){
+ if(yych <= 'H') goto yy52;
+ goto yy692;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'i') goto yy701;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy701:
+ YYDEBUG(701, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'K') goto yy3;
+ goto yy508;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'l') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy702:
+ YYDEBUG(702, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'U'){
+ if(yych <= 'T') goto yy52;
+ goto yy694;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'u') goto yy703;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy703:
+ YYDEBUG(703, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'R') goto yy3;
+ goto yy695;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 's') goto yy704;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy704:
+ YYDEBUG(704, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'T') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 't') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy705:
+ YYDEBUG(705, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'R') goto yy715;
+ if(yych <= 'X') goto yy51;
+ goto yy717;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'q') goto yy51;
+ goto yy715;
+ } else {
+ if(yych == 'y') goto yy717;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy706:
+ YYDEBUG(706, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'Y'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'Q'){
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'R') goto yy715;
+ if(yych <= 'X') goto yy51;
+ goto yy717;
+ }
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '^'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ goto yy54;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= 'r') goto yy716;
+ goto yy54;
+ } else {
+ if(yych <= 'y') goto yy718;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy707:
+ YYDEBUG(707, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy709;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy712;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy708:
+ YYDEBUG(708, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy709;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy709;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy709:
+ YYDEBUG(709, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy710;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'd') goto yy710;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy710:
+ YYDEBUG(710, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy711;
+ if(yych != 'a') goto yy3;
+ goto yy711;
+ }
+yy711:
+ YYDEBUG(711, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy712:
+ YYDEBUG(712, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy710;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'd') goto yy713;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy713:
+ YYDEBUG(713, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ goto yy711;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy714;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy714:
+ YYDEBUG(714, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy715:
+ YYDEBUG(715, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'C') goto yy719;
+ goto yy52;
+ } else {
+ if(yych <= 'b'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'c') goto yy719;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy716:
+ YYDEBUG(716, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'C'){
+ if(yych <= 'B') goto yy52;
+ goto yy719;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'b'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'c') goto yy720;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy717:
+ YYDEBUG(717, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '-') goto yy511;
+ goto yy509;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych <= '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy718:
+ YYDEBUG(718, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '-') goto yy511;
+ if(yych <= '.') goto yy509;
+ goto yy55;
+ }
+ } else {
+ if(yych <= '^'){
+ if(yych <= '9') goto yy509;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Z') goto yy52;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy719:
+ YYDEBUG(719, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy508;
+ if(yych == 'h') goto yy508;
+ goto yy3;
+ }
+yy720:
+ YYDEBUG(720, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy508;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy721:
+ YYDEBUG(721, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'B'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'A') goto yy51;
+ goto yy734;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'b') goto yy734;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy722:
+ YYDEBUG(722, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'F') goto yy731;
+ if(yych <= 'Q') goto yy51;
+ goto yy730;
+ }
+ } else {
+ if(yych <= 'f'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'e') goto yy51;
+ goto yy731;
+ } else {
+ if(yych == 'r') goto yy730;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy723:
+ YYDEBUG(723, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'T') goto yy51;
+ goto yy728;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'u') goto yy728;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy724:
+ YYDEBUG(724, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'I'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy725;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'i') goto yy725;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy725:
+ YYDEBUG(725, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'D'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy154;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy726;
+ }
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy154;
+ goto yy52;
+ } else {
+ if(yych <= 'd') goto yy726;
+ if(yych <= 'z') goto yy52;
+ goto yy154;
+ }
+ }
+yy726:
+ YYDEBUG(726, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy727;
+ if(yych != 'a') goto yy3;
+ goto yy727;
+ }
+yy727:
+ YYDEBUG(727, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy160;
+ goto yy56;
+yy728:
+ YYDEBUG(728, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy52;
+ goto yy729;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'r') goto yy729;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy729:
+ YYDEBUG(729, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'T') goto yy246;
+ if(yych == 't') goto yy246;
+ goto yy3;
+ }
+yy730:
+ YYDEBUG(730, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy52;
+ goto yy733;
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 's') goto yy733;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy731:
+ YYDEBUG(731, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy732;
+ }
+ } else {
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy732;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy732:
+ YYDEBUG(732, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'G'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'H') goto yy176;
+ if(yych == 'h') goto yy176;
+ goto yy3;
+ }
+yy733:
+ YYDEBUG(733, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'T') goto yy176;
+ if(yych == 't') goto yy176;
+ goto yy3;
+ }
+yy734:
+ YYDEBUG(734, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'R') goto yy52;
+ goto yy735;
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'r') goto yy735;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy735:
+ YYDEBUG(735, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'U') goto yy736;
+ if(yych != 'u') goto yy3;
+ goto yy736;
+ }
+yy736:
+ YYDEBUG(736, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy737;
+ if(yych != 'a') goto yy56;
+ goto yy737;
+yy737:
+ YYDEBUG(737, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy738;
+ if(yych != 'r') goto yy56;
+ goto yy738;
+yy738:
+ YYDEBUG(738, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy508;
+ if(yych == 'y') goto yy508;
+ goto yy56;
+yy739:
+ YYDEBUG(739, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'B'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'A') goto yy51;
+ goto yy734;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'b') goto yy752;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy740:
+ YYDEBUG(740, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'F') goto yy731;
+ if(yych <= 'Q') goto yy51;
+ goto yy730;
+ }
+ }
+ } else {
+ if(yych <= 'e'){
+ if(yych <= '^'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ goto yy54;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= 'f') goto yy749;
+ goto yy54;
+ } else {
+ if(yych <= 'r') goto yy748;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy741:
+ YYDEBUG(741, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'U'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'T') goto yy51;
+ goto yy728;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'u') goto yy746;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy742:
+ YYDEBUG(742, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'I'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy725;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'i') goto yy743;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy743:
+ YYDEBUG(743, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy154;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy154;
+ if(yych <= 'C') goto yy52;
+ goto yy726;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy154;
+ } else {
+ if(yych == 'd') goto yy744;
+ if(yych <= 'z') goto yy60;
+ goto yy154;
+ }
+ }
+yy744:
+ YYDEBUG(744, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ goto yy727;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy745;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy745:
+ YYDEBUG(745, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy160;
+ if(yych == 'y') goto yy169;
+ goto yy62;
+yy746:
+ YYDEBUG(746, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'R'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Q') goto yy52;
+ goto yy729;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'r') goto yy747;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy747:
+ YYDEBUG(747, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'S') goto yy3;
+ goto yy246;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy376;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy748:
+ YYDEBUG(748, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy52;
+ goto yy733;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 's') goto yy751;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy749:
+ YYDEBUG(749, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy52;
+ goto yy732;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy52;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy750;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+yy750:
+ YYDEBUG(750, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'G') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'h') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy751:
+ YYDEBUG(751, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'S') goto yy3;
+ goto yy176;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 't') goto yy317;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy752:
+ YYDEBUG(752, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'R'){
+ if(yych <= 'Q') goto yy52;
+ goto yy735;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'r') goto yy753;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy753:
+ YYDEBUG(753, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'U'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= 'T') goto yy3;
+ goto yy736;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'u') goto yy754;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy754:
+ YYDEBUG(754, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy737;
+ if(yych != 'a') goto yy62;
+ goto yy755;
+yy755:
+ YYDEBUG(755, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy738;
+ if(yych != 'r') goto yy62;
+ goto yy756;
+yy756:
+ YYDEBUG(756, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy757:
+ YYDEBUG(757, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'L') goto yy764;
+ if(yych <= 'M') goto yy51;
+ goto yy763;
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'k') goto yy51;
+ goto yy764;
+ } else {
+ if(yych == 'n') goto yy763;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy758:
+ YYDEBUG(758, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy759;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'n') goto yy759;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy759:
+ YYDEBUG(759, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'U') goto yy52;
+ goto yy760;
+ } else {
+ if(yych <= 't'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'u') goto yy760;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy760:
+ YYDEBUG(760, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= 'A') goto yy761;
+ if(yych != 'a') goto yy3;
+ goto yy761;
+ }
+yy761:
+ YYDEBUG(761, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy762;
+ if(yych != 'r') goto yy56;
+ goto yy762;
+yy762:
+ YYDEBUG(762, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy508;
+ if(yych == 'y') goto yy508;
+ goto yy56;
+yy763:
+ YYDEBUG(763, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych == 'E') goto yy765;
+ goto yy52;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'e') goto yy765;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy764:
+ YYDEBUG(764, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '-') goto yy511;
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy3;
+ if(yych != 'Y') goto yy52;
+ goto yy765;
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'y') goto yy765;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+ }
+yy765:
+ YYDEBUG(765, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+yy766:
+ YYDEBUG(766, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '/'){
+ if(yych == ')') goto yy49;
+ if(yych <= '.') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= 'K'){
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'L') goto yy764;
+ if(yych <= 'M') goto yy51;
+ goto yy763;
+ }
+ }
+ } else {
+ if(yych <= 'k'){
+ if(yych <= '^'){
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy3;
+ goto yy54;
+ }
+ } else {
+ if(yych <= 'm'){
+ if(yych <= 'l') goto yy773;
+ goto yy54;
+ } else {
+ if(yych <= 'n') goto yy772;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+ }
+yy767:
+ YYDEBUG(767, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy51;
+ goto yy759;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy51;
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych == 'n') goto yy768;
+ if(yych <= 'z') goto yy54;
+ goto yy3;
+ }
+ }
+yy768:
+ YYDEBUG(768, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'U'){
+ if(yych <= 'T') goto yy52;
+ goto yy760;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'u') goto yy769;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy769:
+ YYDEBUG(769, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '.'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '@') goto yy3;
+ goto yy761;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == '_') goto yy55;
+ goto yy3;
+ } else {
+ if(yych <= 'a') goto yy770;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy770:
+ YYDEBUG(770, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy762;
+ if(yych != 'r') goto yy62;
+ goto yy771;
+yy771:
+ YYDEBUG(771, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy56;
+ goto yy55;
+ } else {
+ if(yych == 'Y') goto yy508;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '_') goto yy55;
+ if(yych <= '`') goto yy56;
+ goto yy61;
+ } else {
+ if(yych <= 'y') goto yy605;
+ if(yych <= 'z') goto yy61;
+ goto yy56;
+ }
+ }
+yy772:
+ YYDEBUG(772, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy52;
+ goto yy765;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'e') goto yy774;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy773:
+ YYDEBUG(773, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy3;
+ if(yych == ')') goto yy510;
+ goto yy509;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy511;
+ goto yy509;
+ } else {
+ if(yych <= '/') goto yy55;
+ if(yych <= '9') goto yy509;
+ goto yy3;
+ }
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= 'Y'){
+ if(yych <= 'X') goto yy52;
+ goto yy765;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= '`') goto yy3;
+ goto yy60;
+ } else {
+ if(yych <= 'y') goto yy774;
+ if(yych <= 'z') goto yy60;
+ goto yy3;
+ }
+ }
+ }
+yy774:
+ YYDEBUG(774, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= '('){
+ if(yych <= 0x1F) goto yy3;
+ goto yy509;
+ } else {
+ if(yych <= ')') goto yy510;
+ if(yych <= '.') goto yy509;
+ goto yy55;
+ }
+ } else {
+ if(yych <= '_'){
+ if(yych <= '9') goto yy509;
+ if(yych <= '^') goto yy3;
+ goto yy55;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy61;
+ goto yy3;
+ }
+ }
+yy775:
+ YYDEBUG(775, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy776;
+ } else {
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy776:
+ YYDEBUG(776, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= '('){
+ if(yych <= 0x1F) goto yy3;
+ goto yy509;
+ } else {
+ if(yych <= ')') goto yy510;
+ if(yych <= '.') goto yy509;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '9') goto yy509;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy777:
+ YYDEBUG(777, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy778;
+ } else {
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy778:
+ YYDEBUG(778, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy52;
+ goto yy765;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy779:
+ YYDEBUG(779, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= '('){
+ if(yych <= 0x1F) goto yy3;
+ goto yy509;
+ } else {
+ if(yych <= ')') goto yy510;
+ if(yych <= '.') goto yy509;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '9') goto yy509;
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy780:
+ YYDEBUG(780, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= ')'){
+ if(yych <= 0x1F) goto yy3;
+ if(yych <= '(') goto yy509;
+ goto yy510;
+ } else {
+ if(yych == '/') goto yy3;
+ goto yy509;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '@') goto yy3;
+ if(yych <= 'H') goto yy51;
+ goto yy776;
+ } else {
+ if(yych <= 'Z') goto yy51;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy781:
+ YYDEBUG(781, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
+ yych = *YYCURSOR;
+ goto yy782;
+yy782:
+ YYDEBUG(782, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy781;
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy790;
+ case 'A': case 'a': goto yy798;
+ case 'D': case 'd': goto yy785;
+ case 'F': case 'f': goto yy786;
+ case 'H': case 'h': goto yy73;
+ case 'I': goto yy793;
+ case 'J': case 'j': goto yy797;
+ case 'M': case 'm': goto yy784;
+ case 'N': case 'n': goto yy800;
+ case 'O': case 'o': goto yy799;
+ case 'P': case 'p': goto yy802;
+ case 'S': case 's': goto yy783;
+ case 'T': case 't': goto yy78;
+ case 'V': goto yy795;
+ case 'W': case 'w': goto yy75;
+ case 'X': goto yy796;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy783:
+ YYDEBUG(783, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych == 'A') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy1259;
+ if(yych <= 'T') goto yy56;
+ goto yy135;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych == 'a') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'e') goto yy1259;
+ if(yych == 'u') goto yy135;
+ goto yy56;
+ }
+ }
+yy784:
+ YYDEBUG(784, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= 'H'){
+ if(yych == 'A') goto yy889;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy126;
+ if(yych <= 'N') goto yy56;
+ goto yy125;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych == 'a') goto yy889;
+ goto yy56;
+ } else {
+ if(yych <= 'i') goto yy126;
+ if(yych == 'o') goto yy125;
+ goto yy56;
+ }
+ }
+yy785:
+ YYDEBUG(785, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych == 'A') goto yy122;
+ if(yych <= 'D') goto yy56;
+ goto yy876;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy122;
+ } else {
+ if(yych == 'e') goto yy876;
+ goto yy56;
+ }
+ }
+yy786:
+ YYDEBUG(786, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= 'N'){
+ if(yych == 'E') goto yy892;
+ goto yy56;
+ } else {
+ if(yych <= 'O') goto yy99;
+ if(yych <= 'Q') goto yy56;
+ goto yy98;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych == 'e') goto yy892;
+ goto yy56;
+ } else {
+ if(yych <= 'o') goto yy99;
+ if(yych == 'r') goto yy98;
+ goto yy56;
+ }
+ }
+yy787:
+ YYDEBUG(787, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy1010;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1009;
+ goto yy70;
+yy788:
+ YYDEBUG(788, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0':
+ case '1':
+ case '2': goto yy952;
+ case '3': goto yy954;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy955;
+ case 'A': case 'a': goto yy959;
+ case 'D': case 'd': goto yy963;
+ case 'F': case 'f': goto yy957;
+ case 'J': case 'j': goto yy956;
+ case 'M': case 'm': goto yy958;
+ case 'N': case 'n': goto yy962;
+ case 'O': case 'o': goto yy961;
+ case 'S': case 's': goto yy960;
+ default: goto yy56;
+ }
+yy789:
+ YYDEBUG(789, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0': goto yy908;
+ case '1': goto yy909;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy910;
+ case 'A': case 'a': goto yy914;
+ case 'D': case 'd': goto yy918;
+ case 'F': case 'f': goto yy912;
+ case 'J': case 'j': goto yy911;
+ case 'M': case 'm': goto yy913;
+ case 'N': case 'n': goto yy917;
+ case 'O': case 'o': goto yy916;
+ case 'S': case 's': goto yy915;
+ default: goto yy791;
+ }
+yy790:
+ YYDEBUG(790, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
+ yych = *YYCURSOR;
+ goto yy791;
+yy791:
+ YYDEBUG(791, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy790;
+ case 'A': case 'a': goto yy873;
+ case 'D': case 'd': goto yy875;
+ case 'F': case 'f': goto yy871;
+ case 'I': goto yy793;
+ case 'J': case 'j': goto yy797;
+ case 'M': case 'm': goto yy872;
+ case 'N': case 'n': goto yy800;
+ case 'O': case 'o': goto yy799;
+ case 'S': case 's': goto yy874;
+ case 'V': goto yy795;
+ case 'X': goto yy796;
+ default: goto yy56;
+ }
+yy792:
+ YYDEBUG(792, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '1'){
+ if(yych <= '/') goto yy791;
+ if(yych <= '0') goto yy867;
+ goto yy868;
+ } else {
+ if(yych <= '5') goto yy869;
+ if(yych <= '9') goto yy870;
+ goto yy791;
+ }
+yy793:
+ YYDEBUG(793, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych <= '.'){
+ if(yych >= ' ') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '/') goto yy794;
+ if(yych <= '9') goto yy833;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'V'){
+ if(yych <= 'I') goto yy866;
+ if(yych >= 'V') goto yy839;
+ goto yy794;
+ } else {
+ if(yych == 'X') goto yy839;
+ goto yy794;
+ }
+ }
+yy794:
+ YYDEBUG(794, *YYCURSOR);
+
+#line 1101 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("datenoyearrev");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_month((char **) &ptr);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_TEXT;
+ }
+#line 12805 "ext/date/lib/parse_date.c"
+yy795:
+ YYDEBUG(795, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy864;
+ goto yy794;
+ }
+yy796:
+ YYDEBUG(796, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy863;
+ goto yy794;
+ }
+yy797:
+ YYDEBUG(797, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy856;
+ if(yych <= 'T') goto yy56;
+ goto yy855;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy856;
+ } else {
+ if(yych == 'u') goto yy855;
+ goto yy56;
+ }
+ }
+yy798:
+ YYDEBUG(798, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'T'){
+ if(yych <= 'L'){
+ if(yych == '.') goto yy803;
+ goto yy56;
+ } else {
+ if(yych <= 'M') goto yy804;
+ if(yych == 'P') goto yy849;
+ goto yy56;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= 'U') goto yy848;
+ if(yych == 'm') goto yy804;
+ goto yy56;
+ } else {
+ if(yych <= 'p') goto yy849;
+ if(yych == 'u') goto yy848;
+ goto yy56;
+ }
+ }
+yy799:
+ YYDEBUG(799, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy843;
+ if(yych == 'c') goto yy843;
+ goto yy56;
+yy800:
+ YYDEBUG(800, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy829;
+ if(yych == 'o') goto yy829;
+ goto yy56;
+yy801:
+ YYDEBUG(801, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy807;
+ if(yych <= '9') goto yy809;
+ goto yy56;
+yy802:
+ YYDEBUG(802, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych != '.') goto yy56;
+ goto yy803;
+ } else {
+ if(yych <= 'M') goto yy804;
+ if(yych == 'm') goto yy804;
+ goto yy56;
+ }
+yy803:
+ YYDEBUG(803, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy804;
+ if(yych != 'm') goto yy56;
+ goto yy804;
+yy804:
+ YYDEBUG(804, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) == '.') goto yy806;
+ goto yy805;
+yy805:
+ YYDEBUG(805, *YYCURSOR);
+
+#line 892 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':' || *ptr == '.') {
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':' || *ptr == '.') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+ }
+ }
+ s->time->h += timelib_meridian((char **) &ptr, s->time->h);
+ TIMELIB_DEINIT;
+ return TIMELIB_TIME12;
+ }
+#line 12909 "ext/date/lib/parse_date.c"
+yy806:
+ YYDEBUG(806, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy805;
+yy807:
+ YYDEBUG(807, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy810;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy823;
+ if(yych <= ':') goto yy810;
+ goto yy808;
+ }
+yy808:
+ YYDEBUG(808, *YYCURSOR);
+
+#line 909 "ext/date/lib/parse_date.re"
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':' || *ptr == '.') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
+ }
+ }
+
+ if (*ptr != '\0') {
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_TIME24_WITH_ZONE;
+ }
+#line 12946 "ext/date/lib/parse_date.c"
+yy809:
+ YYDEBUG(809, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy810;
+ if(yych != ':') goto yy808;
+ goto yy810;
+yy810:
+ YYDEBUG(810, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy811;
+ if(yych <= '6') goto yy812;
+ if(yych <= '9') goto yy813;
+ goto yy56;
+yy811:
+ YYDEBUG(811, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy817;
+ goto yy808;
+yy812:
+ YYDEBUG(812, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych == '0') goto yy817;
+ goto yy808;
+yy813:
+ YYDEBUG(813, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != '.') goto yy808;
+ goto yy814;
+yy814:
+ YYDEBUG(814, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy815;
+yy815:
+ YYDEBUG(815, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy816;
+yy816:
+ YYDEBUG(816, *YYCURSOR);
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy815;
+ goto yy808;
+yy817:
+ YYDEBUG(817, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= '-'){
+ if(yych != ' ') goto yy808;
+ goto yy818;
+ } else {
+ if(yych <= '.') goto yy814;
+ if(yych <= '@') goto yy808;
+ goto yy820;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych == 'P') goto yy820;
+ goto yy808;
+ } else {
+ if(yych <= 'a') goto yy820;
+ if(yych == 'p') goto yy820;
+ goto yy808;
+ }
+ }
+yy818:
+ YYDEBUG(818, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
+ yych = *YYCURSOR;
+ goto yy819;
+yy819:
+ YYDEBUG(819, *YYCURSOR);
+ if(yych <= 'O'){
+ if(yych <= ' '){
+ if(yych <= 0x1F) goto yy56;
+ goto yy818;
+ } else {
+ if(yych != 'A') goto yy56;
+ goto yy820;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'P') goto yy820;
+ if(yych <= '`') goto yy56;
+ goto yy820;
+ } else {
+ if(yych != 'p') goto yy56;
+ goto yy820;
+ }
+ }
+yy820:
+ YYDEBUG(820, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych != '.') goto yy56;
+ goto yy821;
+ } else {
+ if(yych <= 'M') goto yy822;
+ if(yych == 'm') goto yy822;
+ goto yy56;
+ }
+yy821:
+ YYDEBUG(821, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy822;
+ if(yych != 'm') goto yy56;
+ goto yy822;
+yy822:
+ YYDEBUG(822, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '.') goto yy806;
+ goto yy805;
+yy823:
+ YYDEBUG(823, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= '-'){
+ if(yych != ' ') goto yy808;
+ goto yy824;
+ } else {
+ if(yych <= '.') goto yy810;
+ if(yych == ':') goto yy810;
+ goto yy808;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'A') goto yy826;
+ if(yych == 'P') goto yy826;
+ goto yy808;
+ } else {
+ if(yych <= 'a') goto yy826;
+ if(yych == 'p') goto yy826;
+ goto yy808;
+ }
+ }
+yy824:
+ YYDEBUG(824, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
+ yych = *YYCURSOR;
+ goto yy825;
+yy825:
+ YYDEBUG(825, *YYCURSOR);
+ if(yych <= 'O'){
+ if(yych <= ' '){
+ if(yych <= 0x1F) goto yy56;
+ goto yy824;
+ } else {
+ if(yych != 'A') goto yy56;
+ goto yy826;
+ }
+ } else {
+ if(yych <= 'a'){
+ if(yych <= 'P') goto yy826;
+ if(yych <= '`') goto yy56;
+ goto yy826;
+ } else {
+ if(yych != 'p') goto yy56;
+ goto yy826;
+ }
+ }
+yy826:
+ YYDEBUG(826, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych != '.') goto yy56;
+ goto yy827;
+ } else {
+ if(yych <= 'M') goto yy828;
+ if(yych == 'm') goto yy828;
+ goto yy56;
+ }
+yy827:
+ YYDEBUG(827, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy828;
+ if(yych != 'm') goto yy56;
+ goto yy828;
+yy828:
+ YYDEBUG(828, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '.') goto yy806;
+ goto yy805;
+yy829:
+ YYDEBUG(829, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy830;
+ if(yych != 'v') goto yy56;
+ goto yy830;
+yy830:
+ YYDEBUG(830, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy794;
+ goto yy835;
+ } else {
+ if(yych == 'e') goto yy835;
+ goto yy794;
+ }
+ }
+yy831:
+ YYDEBUG(831, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
+ yych = *YYCURSOR;
+ goto yy832;
+yy832:
+ YYDEBUG(832, *YYCURSOR);
+ if(yych <= 0x1F) goto yy56;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy833;
+yy833:
+ YYDEBUG(833, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy834;
+ if(yych <= '9') goto yy840;
+ goto yy834;
+yy834:
+ YYDEBUG(834, *YYCURSOR);
+
+#line 1036 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("datefull");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_FULL;
+ }
+#line 13149 "ext/date/lib/parse_date.c"
+yy835:
+ YYDEBUG(835, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy836;
+ if(yych != 'm') goto yy56;
+ goto yy836;
+yy836:
+ YYDEBUG(836, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy837;
+ if(yych != 'b') goto yy56;
+ goto yy837;
+yy837:
+ YYDEBUG(837, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy838;
+ if(yych != 'e') goto yy56;
+ goto yy838;
+yy838:
+ YYDEBUG(838, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy839;
+ if(yych != 'r') goto yy56;
+ goto yy839;
+yy839:
+ YYDEBUG(839, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ if(yych <= '9') goto yy833;
+ goto yy794;
+yy840:
+ YYDEBUG(840, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych >= ':') goto yy834;
+ goto yy841;
+yy841:
+ YYDEBUG(841, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych >= ':') goto yy834;
+ goto yy842;
+yy842:
+ YYDEBUG(842, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy834;
+yy843:
+ YYDEBUG(843, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy844;
+ if(yych != 't') goto yy56;
+ goto yy844;
+yy844:
+ YYDEBUG(844, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'O'){
+ if(yych <= 'N') goto yy794;
+ goto yy845;
+ } else {
+ if(yych != 'o') goto yy794;
+ goto yy845;
+ }
+ }
+yy845:
+ YYDEBUG(845, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy846;
+ if(yych != 'b') goto yy56;
+ goto yy846;
+yy846:
+ YYDEBUG(846, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy847;
+ if(yych != 'e') goto yy56;
+ goto yy847;
+yy847:
+ YYDEBUG(847, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy839;
+ if(yych == 'r') goto yy839;
+ goto yy56;
+yy848:
+ YYDEBUG(848, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy852;
+ if(yych == 'g') goto yy852;
+ goto yy56;
+yy849:
+ YYDEBUG(849, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy850;
+ if(yych != 'r') goto yy56;
+ goto yy850;
+yy850:
+ YYDEBUG(850, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'I'){
+ if(yych <= 'H') goto yy794;
+ goto yy851;
+ } else {
+ if(yych != 'i') goto yy794;
+ goto yy851;
+ }
+ }
+yy851:
+ YYDEBUG(851, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'L') goto yy839;
+ if(yych == 'l') goto yy839;
+ goto yy56;
+yy852:
+ YYDEBUG(852, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'U'){
+ if(yych <= 'T') goto yy794;
+ goto yy853;
+ } else {
+ if(yych != 'u') goto yy794;
+ goto yy853;
+ }
+ }
+yy853:
+ YYDEBUG(853, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy854;
+ if(yych != 's') goto yy56;
+ goto yy854;
+yy854:
+ YYDEBUG(854, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy839;
+ if(yych == 't') goto yy839;
+ goto yy56;
+yy855:
+ YYDEBUG(855, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy862;
+ if(yych <= 'M') goto yy56;
+ goto yy861;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy862;
+ } else {
+ if(yych == 'n') goto yy861;
+ goto yy56;
+ }
+ }
+yy856:
+ YYDEBUG(856, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy857;
+ if(yych != 'n') goto yy56;
+ goto yy857;
+yy857:
+ YYDEBUG(857, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'U'){
+ if(yych <= 'T') goto yy794;
+ goto yy858;
+ } else {
+ if(yych != 'u') goto yy794;
+ goto yy858;
+ }
+ }
+yy858:
+ YYDEBUG(858, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy859;
+ if(yych != 'a') goto yy56;
+ goto yy859;
+yy859:
+ YYDEBUG(859, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy860;
+ if(yych != 'r') goto yy56;
+ goto yy860;
+yy860:
+ YYDEBUG(860, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy839;
+ if(yych == 'y') goto yy839;
+ goto yy56;
+yy861:
+ YYDEBUG(861, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy794;
+ goto yy839;
+ } else {
+ if(yych == 'e') goto yy839;
+ goto yy794;
+ }
+ }
+yy862:
+ YYDEBUG(862, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'Y'){
+ if(yych <= 'X') goto yy794;
+ goto yy839;
+ } else {
+ if(yych == 'y') goto yy839;
+ goto yy794;
+ }
+ }
+yy863:
+ YYDEBUG(863, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy839;
+ goto yy794;
+ }
+yy864:
+ YYDEBUG(864, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych != 'I') goto yy794;
+ goto yy865;
+ }
+yy865:
+ YYDEBUG(865, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy839;
+ goto yy794;
+ }
+yy866:
+ YYDEBUG(866, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ } else {
+ if(yych <= '9') goto yy833;
+ if(yych == 'I') goto yy839;
+ goto yy794;
+ }
+yy867:
+ YYDEBUG(867, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy898;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy907;
+ if(yych <= ':') goto yy810;
+ goto yy808;
+ }
+yy868:
+ YYDEBUG(868, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy898;
+ goto yy808;
+ } else {
+ if(yych <= '2') goto yy907;
+ if(yych <= '9') goto yy823;
+ if(yych <= ':') goto yy810;
+ goto yy808;
+ }
+yy869:
+ YYDEBUG(869, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy898;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy823;
+ if(yych <= ':') goto yy810;
+ goto yy808;
+ }
+yy870:
+ YYDEBUG(870, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy898;
+ if(yych == ':') goto yy810;
+ goto yy808;
+yy871:
+ YYDEBUG(871, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy892;
+ if(yych == 'e') goto yy892;
+ goto yy56;
+yy872:
+ YYDEBUG(872, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy889;
+ if(yych == 'a') goto yy889;
+ goto yy56;
+yy873:
+ YYDEBUG(873, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy849;
+ if(yych <= 'T') goto yy56;
+ goto yy848;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy849;
+ } else {
+ if(yych == 'u') goto yy848;
+ goto yy56;
+ }
+ }
+yy874:
+ YYDEBUG(874, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy882;
+ if(yych == 'e') goto yy882;
+ goto yy56;
+yy875:
+ YYDEBUG(875, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy876;
+ if(yych != 'e') goto yy56;
+ goto yy876;
+yy876:
+ YYDEBUG(876, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy877;
+ if(yych != 'c') goto yy56;
+ goto yy877;
+yy877:
+ YYDEBUG(877, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy794;
+ goto yy878;
+ } else {
+ if(yych != 'e') goto yy794;
+ goto yy878;
+ }
+ }
+yy878:
+ YYDEBUG(878, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy879;
+ if(yych != 'm') goto yy56;
+ goto yy879;
+yy879:
+ YYDEBUG(879, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy880;
+ if(yych != 'b') goto yy56;
+ goto yy880;
+yy880:
+ YYDEBUG(880, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy881;
+ if(yych != 'e') goto yy56;
+ goto yy881;
+yy881:
+ YYDEBUG(881, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy839;
+ if(yych == 'r') goto yy839;
+ goto yy56;
+yy882:
+ YYDEBUG(882, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy883;
+ if(yych != 'p') goto yy56;
+ goto yy883;
+yy883:
+ YYDEBUG(883, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'T'){
+ if(yych <= 'S') goto yy794;
+ goto yy884;
+ } else {
+ if(yych != 't') goto yy794;
+ goto yy884;
+ }
+ }
+yy884:
+ YYDEBUG(884, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy794;
+ goto yy885;
+ } else {
+ if(yych != 'e') goto yy794;
+ goto yy885;
+ }
+ }
+yy885:
+ YYDEBUG(885, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy886;
+ if(yych != 'm') goto yy56;
+ goto yy886;
+yy886:
+ YYDEBUG(886, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy887;
+ if(yych != 'b') goto yy56;
+ goto yy887;
+yy887:
+ YYDEBUG(887, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy888;
+ if(yych != 'e') goto yy56;
+ goto yy888;
+yy888:
+ YYDEBUG(888, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy839;
+ if(yych == 'r') goto yy839;
+ goto yy56;
+yy889:
+ YYDEBUG(889, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy890;
+ if(yych <= 'X') goto yy56;
+ goto yy839;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy890;
+ } else {
+ if(yych == 'y') goto yy839;
+ goto yy56;
+ }
+ }
+yy890:
+ YYDEBUG(890, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'C'){
+ if(yych <= 'B') goto yy794;
+ goto yy891;
+ } else {
+ if(yych != 'c') goto yy794;
+ goto yy891;
+ }
+ }
+yy891:
+ YYDEBUG(891, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'H') goto yy839;
+ if(yych == 'h') goto yy839;
+ goto yy56;
+yy892:
+ YYDEBUG(892, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy893;
+ if(yych != 'b') goto yy56;
+ goto yy893;
+yy893:
+ YYDEBUG(893, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ goto yy833;
+ } else {
+ if(yych <= 'R'){
+ if(yych <= 'Q') goto yy794;
+ goto yy894;
+ } else {
+ if(yych != 'r') goto yy794;
+ goto yy894;
+ }
+ }
+yy894:
+ YYDEBUG(894, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'U') goto yy895;
+ if(yych != 'u') goto yy56;
+ goto yy895;
+yy895:
+ YYDEBUG(895, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy896;
+ if(yych != 'a') goto yy56;
+ goto yy896;
+yy896:
+ YYDEBUG(896, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy897;
+ if(yych != 'r') goto yy56;
+ goto yy897;
+yy897:
+ YYDEBUG(897, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy839;
+ if(yych == 'y') goto yy839;
+ goto yy56;
+yy898:
+ YYDEBUG(898, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy899;
+ if(yych <= '6') goto yy900;
+ if(yych <= '9') goto yy901;
+ goto yy56;
+yy899:
+ YYDEBUG(899, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy906;
+ goto yy808;
+yy900:
+ YYDEBUG(900, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy814;
+ goto yy808;
+ } else {
+ if(yych <= '0') goto yy906;
+ if(yych <= '9') goto yy902;
+ goto yy808;
+ }
+yy901:
+ YYDEBUG(901, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych >= ':') goto yy808;
+ goto yy902;
+yy902:
+ YYDEBUG(902, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy903;
+ if(yych <= '9') goto yy904;
+ goto yy903;
+yy903:
+ YYDEBUG(903, *YYCURSOR);
+
+#line 1049 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("pointed date");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_FULL_POINTED;
+ }
+#line 13658 "ext/date/lib/parse_date.c"
+yy904:
+ YYDEBUG(904, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy903;
+ if(yych >= ':') goto yy903;
+ goto yy905;
+yy905:
+ YYDEBUG(905, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy903;
+yy906:
+ YYDEBUG(906, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= '-'){
+ if(yych == ' ') goto yy818;
+ goto yy808;
+ } else {
+ if(yych <= '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy904;
+ goto yy808;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'A') goto yy820;
+ if(yych == 'P') goto yy820;
+ goto yy808;
+ } else {
+ if(yych <= 'a') goto yy820;
+ if(yych == 'p') goto yy820;
+ goto yy808;
+ }
+ }
+yy907:
+ YYDEBUG(907, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '@'){
+ if(yych <= '-'){
+ if(yych == ' ') goto yy824;
+ goto yy808;
+ } else {
+ if(yych <= '.') goto yy898;
+ if(yych == ':') goto yy810;
+ goto yy808;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'A') goto yy826;
+ if(yych == 'P') goto yy826;
+ goto yy808;
+ } else {
+ if(yych <= 'a') goto yy826;
+ if(yych == 'p') goto yy826;
+ goto yy808;
+ }
+ }
+yy908:
+ YYDEBUG(908, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy947;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy910;
+ goto yy56;
+yy909:
+ YYDEBUG(909, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy947;
+ if(yych <= '/') goto yy56;
+ if(yych >= '3') goto yy56;
+ goto yy910;
+yy910:
+ YYDEBUG(910, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy947;
+ goto yy56;
+yy911:
+ YYDEBUG(911, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy943;
+ if(yych <= 'T') goto yy56;
+ goto yy942;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy943;
+ } else {
+ if(yych == 'u') goto yy942;
+ goto yy56;
+ }
+ }
+yy912:
+ YYDEBUG(912, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy940;
+ if(yych == 'e') goto yy940;
+ goto yy56;
+yy913:
+ YYDEBUG(913, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy937;
+ if(yych == 'a') goto yy937;
+ goto yy56;
+yy914:
+ YYDEBUG(914, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy934;
+ if(yych <= 'T') goto yy56;
+ goto yy933;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy934;
+ } else {
+ if(yych == 'u') goto yy933;
+ goto yy56;
+ }
+ }
+yy915:
+ YYDEBUG(915, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy930;
+ if(yych == 'e') goto yy930;
+ goto yy56;
+yy916:
+ YYDEBUG(916, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy928;
+ if(yych == 'c') goto yy928;
+ goto yy56;
+yy917:
+ YYDEBUG(917, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy926;
+ if(yych == 'o') goto yy926;
+ goto yy56;
+yy918:
+ YYDEBUG(918, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy919;
+ if(yych != 'e') goto yy56;
+ goto yy919;
+yy919:
+ YYDEBUG(919, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy920;
+ if(yych != 'c') goto yy56;
+ goto yy920;
+yy920:
+ YYDEBUG(920, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'D') goto yy794;
+ goto yy878;
+ } else {
+ if(yych == 'e') goto yy878;
+ goto yy794;
+ }
+ }
+yy921:
+ YYDEBUG(921, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy832;
+ if(yych <= '0') goto yy922;
+ if(yych <= '2') goto yy923;
+ if(yych <= '3') goto yy924;
+ goto yy832;
+yy922:
+ YYDEBUG(922, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych <= '0') goto yy840;
+ if(yych <= '9') goto yy925;
+ goto yy834;
+yy923:
+ YYDEBUG(923, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych <= '9') goto yy925;
+ goto yy834;
+yy924:
+ YYDEBUG(924, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych <= '1') goto yy925;
+ if(yych <= '9') goto yy840;
+ goto yy834;
+yy925:
+ YYDEBUG(925, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy834;
+ if(yych <= '9') goto yy841;
+ goto yy834;
+yy926:
+ YYDEBUG(926, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy927;
+ if(yych != 'v') goto yy56;
+ goto yy927;
+yy927:
+ YYDEBUG(927, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'D') goto yy794;
+ goto yy835;
+ } else {
+ if(yych == 'e') goto yy835;
+ goto yy794;
+ }
+ }
+yy928:
+ YYDEBUG(928, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy929;
+ if(yych != 't') goto yy56;
+ goto yy929;
+yy929:
+ YYDEBUG(929, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'O'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'N') goto yy794;
+ goto yy845;
+ } else {
+ if(yych == 'o') goto yy845;
+ goto yy794;
+ }
+ }
+yy930:
+ YYDEBUG(930, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy931;
+ if(yych != 'p') goto yy56;
+ goto yy931;
+yy931:
+ YYDEBUG(931, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'T'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'S') goto yy794;
+ goto yy932;
+ } else {
+ if(yych != 't') goto yy794;
+ goto yy932;
+ }
+ }
+yy932:
+ YYDEBUG(932, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'D') goto yy794;
+ goto yy885;
+ } else {
+ if(yych == 'e') goto yy885;
+ goto yy794;
+ }
+ }
+yy933:
+ YYDEBUG(933, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy936;
+ if(yych == 'g') goto yy936;
+ goto yy56;
+yy934:
+ YYDEBUG(934, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy935;
+ if(yych != 'r') goto yy56;
+ goto yy935;
+yy935:
+ YYDEBUG(935, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'I'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'H') goto yy794;
+ goto yy851;
+ } else {
+ if(yych == 'i') goto yy851;
+ goto yy794;
+ }
+ }
+yy936:
+ YYDEBUG(936, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'U'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'T') goto yy794;
+ goto yy853;
+ } else {
+ if(yych == 'u') goto yy853;
+ goto yy794;
+ }
+ }
+yy937:
+ YYDEBUG(937, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy938;
+ if(yych <= 'X') goto yy56;
+ goto yy939;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy938;
+ } else {
+ if(yych == 'y') goto yy939;
+ goto yy56;
+ }
+ }
+yy938:
+ YYDEBUG(938, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'C'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'B') goto yy794;
+ goto yy891;
+ } else {
+ if(yych == 'c') goto yy891;
+ goto yy794;
+ }
+ }
+yy939:
+ YYDEBUG(939, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= 0x1F) goto yy794;
+ if(yych <= ',') goto yy831;
+ goto yy921;
+ } else {
+ if(yych <= '.') goto yy831;
+ if(yych <= '/') goto yy794;
+ if(yych <= '9') goto yy833;
+ goto yy794;
+ }
+yy940:
+ YYDEBUG(940, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy941;
+ if(yych != 'b') goto yy56;
+ goto yy941;
+yy941:
+ YYDEBUG(941, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'R'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'Q') goto yy794;
+ goto yy894;
+ } else {
+ if(yych == 'r') goto yy894;
+ goto yy794;
+ }
+ }
+yy942:
+ YYDEBUG(942, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy946;
+ if(yych <= 'M') goto yy56;
+ goto yy945;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy946;
+ } else {
+ if(yych == 'n') goto yy945;
+ goto yy56;
+ }
+ }
+yy943:
+ YYDEBUG(943, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy944;
+ if(yych != 'n') goto yy56;
+ goto yy944;
+yy944:
+ YYDEBUG(944, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'U'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'T') goto yy794;
+ goto yy858;
+ } else {
+ if(yych == 'u') goto yy858;
+ goto yy794;
+ }
+ }
+yy945:
+ YYDEBUG(945, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'E'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'D') goto yy794;
+ goto yy839;
+ } else {
+ if(yych == 'e') goto yy839;
+ goto yy794;
+ }
+ }
+yy946:
+ YYDEBUG(946, *YYCURSOR);
+ yyaccept = 10;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych <= ','){
+ if(yych <= 0x1F) goto yy794;
+ goto yy831;
+ } else {
+ if(yych <= '-') goto yy921;
+ if(yych <= '.') goto yy831;
+ goto yy794;
+ }
+ } else {
+ if(yych <= 'Y'){
+ if(yych <= '9') goto yy833;
+ if(yych <= 'X') goto yy794;
+ goto yy839;
+ } else {
+ if(yych == 'y') goto yy839;
+ goto yy794;
+ }
+ }
+yy947:
+ YYDEBUG(947, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '2') goto yy948;
+ if(yych <= '3') goto yy950;
+ if(yych <= '9') goto yy951;
+ goto yy56;
+yy948:
+ YYDEBUG(948, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy949;
+ if(yych <= '9') goto yy951;
+ goto yy949;
+yy949:
+ YYDEBUG(949, *YYCURSOR);
+
+#line 1023 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("gnudateshort");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_DATE;
+ }
+#line 14146 "ext/date/lib/parse_date.c"
+yy950:
+ YYDEBUG(950, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy949;
+ if(yych >= '2') goto yy949;
+ goto yy951;
+yy951:
+ YYDEBUG(951, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy949;
+yy952:
+ YYDEBUG(952, *YYCURSOR);
+ yyaccept = 12;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.') goto yy953;
+ if(yych <= '/') goto yy1004;
+ if(yych <= '9') goto yy955;
+ goto yy953;
+yy953:
+ YYDEBUG(953, *YYCURSOR);
+
+#line 996 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("americanshort | american");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == '/') {
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_AMERICAN;
+ }
+#line 14174 "ext/date/lib/parse_date.c"
+yy954:
+ YYDEBUG(954, *YYCURSOR);
+ yyaccept = 12;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.') goto yy953;
+ if(yych <= '/') goto yy1004;
+ if(yych >= '2') goto yy953;
+ goto yy955;
+yy955:
+ YYDEBUG(955, *YYCURSOR);
+ yyaccept = 12;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '/') goto yy1004;
+ goto yy953;
+yy956:
+ YYDEBUG(956, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy1003;
+ if(yych <= 'T') goto yy56;
+ goto yy1002;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy1003;
+ } else {
+ if(yych == 'u') goto yy1002;
+ goto yy56;
+ }
+ }
+yy957:
+ YYDEBUG(957, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1001;
+ if(yych == 'e') goto yy1001;
+ goto yy56;
+yy958:
+ YYDEBUG(958, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1000;
+ if(yych == 'a') goto yy1000;
+ goto yy56;
+yy959:
+ YYDEBUG(959, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy999;
+ if(yych <= 'T') goto yy56;
+ goto yy998;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy999;
+ } else {
+ if(yych == 'u') goto yy998;
+ goto yy56;
+ }
+ }
+yy960:
+ YYDEBUG(960, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy996;
+ if(yych == 'e') goto yy996;
+ goto yy56;
+yy961:
+ YYDEBUG(961, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy995;
+ if(yych == 'c') goto yy995;
+ goto yy56;
+yy962:
+ YYDEBUG(962, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy994;
+ if(yych == 'o') goto yy994;
+ goto yy56;
+yy963:
+ YYDEBUG(963, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy964;
+ if(yych != 'e') goto yy56;
+ goto yy964;
+yy964:
+ YYDEBUG(964, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy965;
+ if(yych != 'c') goto yy56;
+ goto yy965;
+yy965:
+ YYDEBUG(965, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '/') goto yy56;
+ goto yy966;
+yy966:
+ YYDEBUG(966, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy967;
+yy967:
+ YYDEBUG(967, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy968;
+yy968:
+ YYDEBUG(968, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy969;
+yy969:
+ YYDEBUG(969, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy970;
+yy970:
+ YYDEBUG(970, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy971;
+yy971:
+ YYDEBUG(971, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy972;
+ if(yych <= '2') goto yy973;
+ goto yy56;
+yy972:
+ YYDEBUG(972, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy974;
+ goto yy56;
+yy973:
+ YYDEBUG(973, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '4') goto yy56;
+ goto yy974;
+yy974:
+ YYDEBUG(974, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy975;
+yy975:
+ YYDEBUG(975, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy976;
+yy976:
+ YYDEBUG(976, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy977;
+yy977:
+ YYDEBUG(977, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy978;
+yy978:
+ YYDEBUG(978, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy979;
+ if(yych <= '6') goto yy980;
+ goto yy56;
+yy979:
+ YYDEBUG(979, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy981;
+ goto yy56;
+yy980:
+ YYDEBUG(980, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '0') goto yy56;
+ goto yy981;
+yy981:
+ YYDEBUG(981, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ' ') goto yy56;
+ goto yy982;
+yy982:
+ YYDEBUG(982, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
+ yych = *YYCURSOR;
+ goto yy983;
+yy983:
+ YYDEBUG(983, *YYCURSOR);
+ if(yych <= '*'){
+ if(yych == ' ') goto yy982;
+ goto yy56;
+ } else {
+ if(yych == ',') goto yy56;
+ if(yych >= '.') goto yy56;
+ goto yy984;
+ }
+yy984:
+ YYDEBUG(984, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy985;
+ if(yych <= '2') goto yy987;
+ if(yych <= '9') goto yy988;
+ goto yy56;
+yy985:
+ YYDEBUG(985, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy986;
+ if(yych <= '5') goto yy992;
+ if(yych <= '9') goto yy988;
+ if(yych <= ':') goto yy989;
+ goto yy986;
+yy986:
+ YYDEBUG(986, *YYCURSOR);
+
+#line 1223 "ext/date/lib/parse_date.re"
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("clf");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ TIMELIB_DEINIT;
+ return TIMELIB_CLF;
+ }
+#line 14348 "ext/date/lib/parse_date.c"
+yy987:
+ YYDEBUG(987, *YYCURSOR);
+ yyaccept = 13;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '5'){
+ if(yych <= '/') goto yy986;
+ if(yych <= '3') goto yy992;
+ goto yy990;
+ } else {
+ if(yych == ':') goto yy989;
+ goto yy986;
+ }
+yy988:
+ YYDEBUG(988, *YYCURSOR);
+ yyaccept = 13;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy986;
+ if(yych <= '5') goto yy990;
+ if(yych != ':') goto yy986;
+ goto yy989;
+yy989:
+ YYDEBUG(989, *YYCURSOR);
+ yyaccept = 13;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy986;
+ if(yych >= '6') goto yy986;
+ goto yy990;
+yy990:
+ YYDEBUG(990, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy991;
+yy991:
+ YYDEBUG(991, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy986;
+yy992:
+ YYDEBUG(992, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy986;
+ if(yych <= '5') goto yy993;
+ if(yych <= '9') goto yy991;
+ if(yych <= ':') goto yy989;
+ goto yy986;
+yy993:
+ YYDEBUG(993, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy986;
+ if(yych <= '9') goto yy991;
+ goto yy986;
+yy994:
+ YYDEBUG(994, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy965;
+ if(yych == 'v') goto yy965;
+ goto yy56;
+yy995:
+ YYDEBUG(995, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy965;
+ if(yych == 't') goto yy965;
+ goto yy56;
+yy996:
+ YYDEBUG(996, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy997;
+ if(yych != 'p') goto yy56;
+ goto yy997;
+yy997:
+ YYDEBUG(997, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych == '/') goto yy966;
+ goto yy56;
+ } else {
+ if(yych <= 'T') goto yy965;
+ if(yych == 't') goto yy965;
+ goto yy56;
+ }
+yy998:
+ YYDEBUG(998, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy965;
+ if(yych == 'g') goto yy965;
+ goto yy56;
+yy999:
+ YYDEBUG(999, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy965;
+ if(yych == 'r') goto yy965;
+ goto yy56;
+yy1000:
+ YYDEBUG(1000, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy965;
+ if(yych <= 'X') goto yy56;
+ goto yy965;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy965;
+ } else {
+ if(yych == 'y') goto yy965;
+ goto yy56;
+ }
+ }
+yy1001:
+ YYDEBUG(1001, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy965;
+ if(yych == 'b') goto yy965;
+ goto yy56;
+yy1002:
+ YYDEBUG(1002, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy965;
+ if(yych <= 'M') goto yy56;
+ goto yy965;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy965;
+ } else {
+ if(yych == 'n') goto yy965;
+ goto yy56;
+ }
+ }
+yy1003:
+ YYDEBUG(1003, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy965;
+ if(yych == 'n') goto yy965;
+ goto yy56;
+yy1004:
+ YYDEBUG(1004, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1005;
+yy1005:
+ YYDEBUG(1005, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy953;
+ if(yych >= ':') goto yy953;
+ goto yy1006;
+yy1006:
+ YYDEBUG(1006, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy953;
+ if(yych >= ':') goto yy953;
+ goto yy1007;
+yy1007:
+ YYDEBUG(1007, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy953;
+ if(yych >= ':') goto yy953;
+ goto yy1008;
+yy1008:
+ YYDEBUG(1008, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy953;
+yy1009:
+ YYDEBUG(1009, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy1010;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1037;
+ goto yy70;
+yy1010:
+ YYDEBUG(1010, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0': goto yy908;
+ case '1': goto yy909;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy910;
+ case 'A': case 'a': goto yy1014;
+ case 'D': case 'd': goto yy1018;
+ case 'F': case 'f': goto yy1012;
+ case 'J': case 'j': goto yy1011;
+ case 'M': case 'm': goto yy1013;
+ case 'N': case 'n': goto yy1017;
+ case 'O': case 'o': goto yy1016;
+ case 'S': case 's': goto yy1015;
+ default: goto yy56;
+ }
+yy1011:
+ YYDEBUG(1011, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy1036;
+ if(yych <= 'T') goto yy56;
+ goto yy1035;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy1036;
+ } else {
+ if(yych == 'u') goto yy1035;
+ goto yy56;
+ }
+ }
+yy1012:
+ YYDEBUG(1012, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1034;
+ if(yych == 'e') goto yy1034;
+ goto yy56;
+yy1013:
+ YYDEBUG(1013, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1033;
+ if(yych == 'a') goto yy1033;
+ goto yy56;
+yy1014:
+ YYDEBUG(1014, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy1032;
+ if(yych <= 'T') goto yy56;
+ goto yy1031;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy1032;
+ } else {
+ if(yych == 'u') goto yy1031;
+ goto yy56;
+ }
+ }
+yy1015:
+ YYDEBUG(1015, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1029;
+ if(yych == 'e') goto yy1029;
+ goto yy56;
+yy1016:
+ YYDEBUG(1016, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1028;
+ if(yych == 'c') goto yy1028;
+ goto yy56;
+yy1017:
+ YYDEBUG(1017, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy1027;
+ if(yych == 'o') goto yy1027;
+ goto yy56;
+yy1018:
+ YYDEBUG(1018, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1019;
+ if(yych != 'e') goto yy56;
+ goto yy1019;
+yy1019:
+ YYDEBUG(1019, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1020;
+ if(yych != 'c') goto yy56;
+ goto yy1020;
+yy1020:
+ YYDEBUG(1020, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '-') goto yy56;
+ goto yy1021;
+yy1021:
+ YYDEBUG(1021, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1022;
+ if(yych <= '2') goto yy1023;
+ if(yych <= '3') goto yy1024;
+ goto yy56;
+yy1022:
+ YYDEBUG(1022, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '0') goto yy56;
+ if(yych <= '9') goto yy1025;
+ goto yy56;
+yy1023:
+ YYDEBUG(1023, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1025;
+ goto yy56;
+yy1024:
+ YYDEBUG(1024, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '2') goto yy56;
+ goto yy1025;
+yy1025:
+ YYDEBUG(1025, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1026;
+yy1026:
+ YYDEBUG(1026, *YYCURSOR);
+
+#line 1210 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("pgtextreverse");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_PG_TEXT;
+ }
+#line 14588 "ext/date/lib/parse_date.c"
+yy1027:
+ YYDEBUG(1027, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy1020;
+ if(yych == 'v') goto yy1020;
+ goto yy56;
+yy1028:
+ YYDEBUG(1028, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1020;
+ if(yych == 't') goto yy1020;
+ goto yy56;
+yy1029:
+ YYDEBUG(1029, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy1030;
+ if(yych != 'p') goto yy56;
+ goto yy1030;
+yy1030:
+ YYDEBUG(1030, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych == '-') goto yy1021;
+ goto yy56;
+ } else {
+ if(yych <= 'T') goto yy1020;
+ if(yych == 't') goto yy1020;
+ goto yy56;
+ }
+yy1031:
+ YYDEBUG(1031, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy1020;
+ if(yych == 'g') goto yy1020;
+ goto yy56;
+yy1032:
+ YYDEBUG(1032, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1020;
+ if(yych == 'r') goto yy1020;
+ goto yy56;
+yy1033:
+ YYDEBUG(1033, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy1020;
+ if(yych <= 'X') goto yy56;
+ goto yy1020;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy1020;
+ } else {
+ if(yych == 'y') goto yy1020;
+ goto yy56;
+ }
+ }
+yy1034:
+ YYDEBUG(1034, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1020;
+ if(yych == 'b') goto yy1020;
+ goto yy56;
+yy1035:
+ YYDEBUG(1035, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy1020;
+ if(yych <= 'M') goto yy56;
+ goto yy1020;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy1020;
+ } else {
+ if(yych == 'n') goto yy1020;
+ goto yy56;
+ }
+ }
+yy1036:
+ YYDEBUG(1036, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy1020;
+ if(yych == 'n') goto yy1020;
+ goto yy56;
+yy1037:
+ YYDEBUG(1037, *YYCURSOR);
+ yyaccept = 14;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O': case 'S':
+ case 'T': case 'V': case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o': case 's':
+ case 't': case 'w': case 'y': goto yy1042;
+ case '-': goto yy1039;
+ case '.': goto yy1045;
+ case '/': goto yy1040;
+ case '0': goto yy1058;
+ case '1': goto yy1059;
+ case '2': goto yy1060;
+ case '3': goto yy1061;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case 'W': goto yy1062;
+ default: goto yy1038;
+ }
+yy1038:
+ YYDEBUG(1038, *YYCURSOR);
+
+#line 1242 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("year4");
+ TIMELIB_INIT;
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_DEINIT;
+ return TIMELIB_CLF;
+ }
+#line 14704 "ext/date/lib/parse_date.c"
+yy1039:
+ YYDEBUG(1039, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0': goto yy1199;
+ case '1': goto yy1200;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy910;
+ case 'A': case 'a': goto yy1194;
+ case 'D': case 'd': goto yy1198;
+ case 'F': case 'f': goto yy1192;
+ case 'J': case 'j': goto yy1191;
+ case 'M': case 'm': goto yy1193;
+ case 'N': case 'n': goto yy1197;
+ case 'O': case 'o': goto yy1196;
+ case 'S': case 's': goto yy1195;
+ default: goto yy1044;
+ }
+yy1040:
+ YYDEBUG(1040, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1177;
+ if(yych <= '1') goto yy1178;
+ if(yych <= '9') goto yy1179;
+ goto yy56;
+yy1041:
+ YYDEBUG(1041, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
+ yych = *YYCURSOR;
+ goto yy1042;
+yy1042:
+ YYDEBUG(1042, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy1041;
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy1043;
+ case 'A': case 'a': goto yy1053;
+ case 'D': case 'd': goto yy1057;
+ case 'F': case 'f': goto yy1051;
+ case 'H': case 'h': goto yy73;
+ case 'I': goto yy1046;
+ case 'J': case 'j': goto yy1050;
+ case 'M': case 'm': goto yy1052;
+ case 'N': case 'n': goto yy1056;
+ case 'O': case 'o': goto yy1055;
+ case 'S': case 's': goto yy1054;
+ case 'T': case 't': goto yy78;
+ case 'V': goto yy1048;
+ case 'W': case 'w': goto yy75;
+ case 'X': goto yy1049;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy1043:
+ YYDEBUG(1043, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
+ yych = *YYCURSOR;
+ goto yy1044;
+yy1044:
+ YYDEBUG(1044, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy1043;
+ case 'A': case 'a': goto yy1053;
+ case 'D': case 'd': goto yy1169;
+ case 'F': case 'f': goto yy1166;
+ case 'I': goto yy1046;
+ case 'J': case 'j': goto yy1050;
+ case 'M': case 'm': goto yy1167;
+ case 'N': case 'n': goto yy1056;
+ case 'O': case 'o': goto yy1055;
+ case 'S': case 's': goto yy1168;
+ case 'V': goto yy1048;
+ case 'X': goto yy1049;
+ default: goto yy56;
+ }
+yy1045:
+ YYDEBUG(1045, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1044;
+ if(yych <= '0') goto yy1163;
+ if(yych <= '2') goto yy1164;
+ if(yych <= '3') goto yy1165;
+ goto yy1044;
+yy1046:
+ YYDEBUG(1046, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= 'U'){
+ if(yych == 'I') goto yy1162;
+ goto yy1047;
+ } else {
+ if(yych == 'W') goto yy1047;
+ if(yych <= 'X') goto yy1116;
+ goto yy1047;
+ }
+yy1047:
+ YYDEBUG(1047, *YYCURSOR);
+
+#line 1075 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("datenodayrev");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = 1;
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_NO_DAY;
+ }
+#line 14831 "ext/date/lib/parse_date.c"
+yy1048:
+ YYDEBUG(1048, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1160;
+ goto yy1047;
+yy1049:
+ YYDEBUG(1049, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1159;
+ goto yy1047;
+yy1050:
+ YYDEBUG(1050, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy1152;
+ if(yych <= 'T') goto yy56;
+ goto yy1151;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy1152;
+ } else {
+ if(yych == 'u') goto yy1151;
+ goto yy56;
+ }
+ }
+yy1051:
+ YYDEBUG(1051, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'R'){
+ if(yych <= 'N'){
+ if(yych == 'E') goto yy1145;
+ goto yy56;
+ } else {
+ if(yych <= 'O') goto yy99;
+ if(yych <= 'Q') goto yy56;
+ goto yy98;
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych == 'e') goto yy1145;
+ goto yy56;
+ } else {
+ if(yych <= 'o') goto yy99;
+ if(yych == 'r') goto yy98;
+ goto yy56;
+ }
+ }
+yy1052:
+ YYDEBUG(1052, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'O'){
+ if(yych <= 'H'){
+ if(yych == 'A') goto yy1142;
+ goto yy56;
+ } else {
+ if(yych <= 'I') goto yy126;
+ if(yych <= 'N') goto yy56;
+ goto yy125;
+ }
+ } else {
+ if(yych <= 'h'){
+ if(yych == 'a') goto yy1142;
+ goto yy56;
+ } else {
+ if(yych <= 'i') goto yy126;
+ if(yych == 'o') goto yy125;
+ goto yy56;
+ }
+ }
+yy1053:
+ YYDEBUG(1053, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy1136;
+ if(yych <= 'T') goto yy56;
+ goto yy1135;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy1136;
+ } else {
+ if(yych == 'u') goto yy1135;
+ goto yy56;
+ }
+ }
+yy1054:
+ YYDEBUG(1054, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych <= 'D'){
+ if(yych == 'A') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'E') goto yy1128;
+ if(yych <= 'T') goto yy56;
+ goto yy135;
+ }
+ } else {
+ if(yych <= 'd'){
+ if(yych == 'a') goto yy134;
+ goto yy56;
+ } else {
+ if(yych <= 'e') goto yy1128;
+ if(yych == 'u') goto yy135;
+ goto yy56;
+ }
+ }
+yy1055:
+ YYDEBUG(1055, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1123;
+ if(yych == 'c') goto yy1123;
+ goto yy56;
+yy1056:
+ YYDEBUG(1056, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy1117;
+ if(yych == 'o') goto yy1117;
+ goto yy56;
+yy1057:
+ YYDEBUG(1057, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
+ if(yych == 'A') goto yy122;
+ if(yych <= 'D') goto yy56;
+ goto yy1110;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy122;
+ } else {
+ if(yych == 'e') goto yy1110;
+ goto yy56;
+ }
+ }
+yy1058:
+ YYDEBUG(1058, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy1108;
+ if(yych <= '9') goto yy1109;
+ goto yy70;
+yy1059:
+ YYDEBUG(1059, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '2') goto yy1075;
+ if(yych <= '9') goto yy1074;
+ goto yy70;
+yy1060:
+ YYDEBUG(1060, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1074;
+ goto yy70;
+yy1061:
+ YYDEBUG(1061, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '5') goto yy1070;
+ if(yych <= '6') goto yy1071;
+ if(yych <= '9') goto yy79;
+ goto yy70;
+yy1062:
+ YYDEBUG(1062, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '5'){
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1063;
+ if(yych <= '4') goto yy1064;
+ goto yy1065;
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy56;
+ goto yy114;
+ } else {
+ if(yych == 'e') goto yy114;
+ goto yy56;
+ }
+ }
+yy1063:
+ YYDEBUG(1063, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '0') goto yy56;
+ if(yych <= '9') goto yy1066;
+ goto yy56;
+yy1064:
+ YYDEBUG(1064, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1066;
+ goto yy56;
+yy1065:
+ YYDEBUG(1065, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '4') goto yy56;
+ goto yy1066;
+yy1066:
+ YYDEBUG(1066, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy1067;
+ if(yych <= '7') goto yy1068;
+ goto yy1067;
+yy1067:
+ YYDEBUG(1067, *YYCURSOR);
+
+#line 1178 "ext/date/lib/parse_date.re"
+{
+ timelib_sll w, d;
+ DEBUG_OUTPUT("isoweek");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ TIMELIB_HAVE_RELATIVE();
+
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ w = timelib_get_nr((char **) &ptr, 2);
+ d = 1;
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
+
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_WEEK;
+ }
+#line 15018 "ext/date/lib/parse_date.c"
+yy1068:
+ YYDEBUG(1068, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1069;
+yy1069:
+ YYDEBUG(1069, *YYCURSOR);
+
+#line 1159 "ext/date/lib/parse_date.re"
+{
+ timelib_sll w, d;
+ DEBUG_OUTPUT("isoweekday");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ TIMELIB_HAVE_RELATIVE();
+
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ w = timelib_get_nr((char **) &ptr, 2);
+ d = timelib_get_nr((char **) &ptr, 1);
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
+
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_WEEK;
+ }
+#line 15040 "ext/date/lib/parse_date.c"
+yy1070:
+ YYDEBUG(1070, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+yy1071:
+ YYDEBUG(1071, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '6') goto yy1072;
+ if(yych <= '9') goto yy79;
+ goto yy70;
+yy1072:
+ YYDEBUG(1072, *YYCURSOR);
+ yyaccept = 15;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'X'){
+ if(yych <= 'G'){
+ if(yych <= 'C'){
+ if(yych == ' ') goto yy70;
+ goto yy1073;
+ } else {
+ if(yych == 'E') goto yy1073;
+ if(yych <= 'F') goto yy70;
+ goto yy1073;
+ }
+ } else {
+ if(yych <= 'R'){
+ if(yych <= 'H') goto yy70;
+ if(yych == 'M') goto yy70;
+ goto yy1073;
+ } else {
+ if(yych <= 'T') goto yy70;
+ if(yych == 'W') goto yy70;
+ goto yy1073;
+ }
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'e'){
+ if(yych <= 'Y') goto yy70;
+ if(yych == 'd') goto yy70;
+ goto yy1073;
+ } else {
+ if(yych == 'g') goto yy1073;
+ if(yych <= 'h') goto yy70;
+ goto yy1073;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych <= 'm') goto yy70;
+ if(yych <= 'r') goto yy1073;
+ if(yych <= 't') goto yy70;
+ goto yy1073;
+ } else {
+ if(yych == 'x') goto yy1073;
+ if(yych <= 'y') goto yy70;
+ goto yy1073;
+ }
+ }
+ }
+yy1073:
+ YYDEBUG(1073, *YYCURSOR);
+
+#line 1146 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("pgydotd");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->d = timelib_get_nr((char **) &ptr, 3);
+ s->time->m = 1;
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_PG_YEARDAY;
+ }
+#line 15113 "ext/date/lib/parse_date.c"
+yy1074:
+ YYDEBUG(1074, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+yy1075:
+ YYDEBUG(1075, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy70;
+ if(yych >= '1') goto yy1077;
+ goto yy1076;
+ } else {
+ if(yych <= '3') goto yy1078;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+ }
+yy1076:
+ YYDEBUG(1076, *YYCURSOR);
+ yyaccept = 15;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0': goto yy79;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1079;
+ default: goto yy1073;
+ }
+yy1077:
+ YYDEBUG(1077, *YYCURSOR);
+ yyaccept = 15;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1079;
+ default: goto yy1073;
+ }
+yy1078:
+ YYDEBUG(1078, *YYCURSOR);
+ yyaccept = 15;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1': goto yy1079;
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ default: goto yy1073;
+ }
+yy1079:
+ YYDEBUG(1079, *YYCURSOR);
+ yyaccept = 16;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 16) {
+ goto yy69;
+ }
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case 'D': case 'd': goto yy74;
+ case 'F': case 'f': goto yy76;
+ case 'H': case 'h': goto yy73;
+ case 'M': case 'm': goto yy72;
+ case 'S': case 's': goto yy71;
+ case 'T': goto yy1081;
+ case 'W': case 'w': goto yy75;
+ case 'Y': case 'y': goto yy77;
+ case 't': goto yy1082;
+ default: goto yy1080;
+ }
+yy1080:
+ YYDEBUG(1080, *YYCURSOR);
+
+#line 1112 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("datenocolon");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_NOCOLON;
+ }
+#line 15221 "ext/date/lib/parse_date.c"
+yy1081:
+ YYDEBUG(1081, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'H'){
+ if(yych <= '2'){
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy1098;
+ goto yy1099;
+ } else {
+ if(yych <= '9') goto yy1100;
+ if(yych <= 'G') goto yy56;
+ goto yy81;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych == 'U') goto yy82;
+ goto yy56;
+ } else {
+ if(yych <= 'h') goto yy81;
+ if(yych == 'u') goto yy82;
+ goto yy56;
+ }
+ }
+yy1082:
+ YYDEBUG(1082, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'H'){
+ if(yych <= '2'){
+ if(yych <= '/') goto yy56;
+ if(yych >= '2') goto yy1084;
+ goto yy1083;
+ } else {
+ if(yych <= '9') goto yy1085;
+ if(yych <= 'G') goto yy56;
+ goto yy81;
+ }
+ } else {
+ if(yych <= 'g'){
+ if(yych == 'U') goto yy82;
+ goto yy56;
+ } else {
+ if(yych <= 'h') goto yy81;
+ if(yych == 'u') goto yy82;
+ goto yy56;
+ }
+ }
+yy1083:
+ YYDEBUG(1083, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1092;
+ if(yych <= '9') goto yy1085;
+ goto yy56;
+yy1084:
+ YYDEBUG(1084, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '3') goto yy1092;
+ if(yych <= '5') goto yy1086;
+ goto yy56;
+yy1085:
+ YYDEBUG(1085, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy1086;
+yy1086:
+ YYDEBUG(1086, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1087;
+yy1087:
+ YYDEBUG(1087, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1088;
+ if(yych <= '6') goto yy1089;
+ goto yy56;
+yy1088:
+ YYDEBUG(1088, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1089:
+ YYDEBUG(1089, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '0') goto yy56;
+ goto yy1090;
+yy1090:
+ YYDEBUG(1090, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1091;
+yy1091:
+ YYDEBUG(1091, *YYCURSOR);
+
+#line 1124 "ext/date/lib/parse_date.re"
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_XMLRPC_SOAP;
+ }
+#line 15318 "ext/date/lib/parse_date.c"
+yy1092:
+ YYDEBUG(1092, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1093;
+ if(yych <= '9') goto yy1087;
+ goto yy56;
+yy1093:
+ YYDEBUG(1093, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1094;
+ if(yych <= '6') goto yy1095;
+ if(yych <= '9') goto yy1087;
+ goto yy56;
+yy1094:
+ YYDEBUG(1094, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1096;
+ if(yych <= '6') goto yy1097;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1095:
+ YYDEBUG(1095, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1096;
+ if(yych <= '5') goto yy1088;
+ if(yych <= '6') goto yy1089;
+ goto yy56;
+yy1096:
+ YYDEBUG(1096, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1091;
+ if(yych <= '9') goto yy1090;
+ goto yy1091;
+yy1097:
+ YYDEBUG(1097, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '0') goto yy1090;
+ goto yy1091;
+yy1098:
+ YYDEBUG(1098, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1107;
+ if(yych <= '9') goto yy1100;
+ if(yych <= ':') goto yy1101;
+ goto yy56;
+yy1099:
+ YYDEBUG(1099, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '5'){
+ if(yych <= '/') goto yy56;
+ if(yych <= '3') goto yy1107;
+ goto yy1086;
+ } else {
+ if(yych == ':') goto yy1101;
+ goto yy56;
+ }
+yy1100:
+ YYDEBUG(1100, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1086;
+ if(yych != ':') goto yy56;
+ goto yy1101;
+yy1101:
+ YYDEBUG(1101, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy1102;
+yy1102:
+ YYDEBUG(1102, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1103;
+yy1103:
+ YYDEBUG(1103, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1104;
+yy1104:
+ YYDEBUG(1104, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1105;
+ if(yych <= '6') goto yy1106;
+ goto yy56;
+yy1105:
+ YYDEBUG(1105, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1106:
+ YYDEBUG(1106, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '0') goto yy1090;
+ goto yy56;
+yy1107:
+ YYDEBUG(1107, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1093;
+ if(yych <= '9') goto yy1087;
+ if(yych <= ':') goto yy1101;
+ goto yy56;
+yy1108:
+ YYDEBUG(1108, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy79;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+yy1109:
+ YYDEBUG(1109, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy1076;
+ goto yy1077;
+ } else {
+ if(yych <= '3') goto yy1078;
+ if(yych <= '9') goto yy1072;
+ goto yy70;
+ }
+yy1110:
+ YYDEBUG(1110, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1111;
+ if(yych != 'c') goto yy56;
+ goto yy1111;
+yy1111:
+ YYDEBUG(1111, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'E') goto yy1112;
+ if(yych != 'e') goto yy1047;
+ goto yy1112;
+yy1112:
+ YYDEBUG(1112, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy1113;
+ if(yych != 'm') goto yy56;
+ goto yy1113;
+yy1113:
+ YYDEBUG(1113, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1114;
+ if(yych != 'b') goto yy56;
+ goto yy1114;
+yy1114:
+ YYDEBUG(1114, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1115;
+ if(yych != 'e') goto yy56;
+ goto yy1115;
+yy1115:
+ YYDEBUG(1115, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1116;
+ if(yych != 'r') goto yy56;
+ goto yy1116;
+yy1116:
+ YYDEBUG(1116, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy1047;
+yy1117:
+ YYDEBUG(1117, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy1118;
+ if(yych != 'v') goto yy56;
+ goto yy1118;
+yy1118:
+ YYDEBUG(1118, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'E') goto yy1119;
+ if(yych != 'e') goto yy1047;
+ goto yy1119;
+yy1119:
+ YYDEBUG(1119, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy1120;
+ if(yych != 'm') goto yy56;
+ goto yy1120;
+yy1120:
+ YYDEBUG(1120, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1121;
+ if(yych != 'b') goto yy56;
+ goto yy1121;
+yy1121:
+ YYDEBUG(1121, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1122;
+ if(yych != 'e') goto yy56;
+ goto yy1122;
+yy1122:
+ YYDEBUG(1122, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1116;
+ if(yych == 'r') goto yy1116;
+ goto yy56;
+yy1123:
+ YYDEBUG(1123, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1124;
+ if(yych != 't') goto yy56;
+ goto yy1124;
+yy1124:
+ YYDEBUG(1124, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'O') goto yy1125;
+ if(yych != 'o') goto yy1047;
+ goto yy1125;
+yy1125:
+ YYDEBUG(1125, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1126;
+ if(yych != 'b') goto yy56;
+ goto yy1126;
+yy1126:
+ YYDEBUG(1126, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1127;
+ if(yych != 'e') goto yy56;
+ goto yy1127;
+yy1127:
+ YYDEBUG(1127, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1116;
+ if(yych == 'r') goto yy1116;
+ goto yy56;
+yy1128:
+ YYDEBUG(1128, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'P'){
+ if(yych == 'C') goto yy137;
+ if(yych <= 'O') goto yy56;
+ goto yy1129;
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'b') goto yy56;
+ goto yy137;
+ } else {
+ if(yych != 'p') goto yy56;
+ goto yy1129;
+ }
+ }
+yy1129:
+ YYDEBUG(1129, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1130;
+ if(yych != 't') goto yy1047;
+ goto yy1130;
+yy1130:
+ YYDEBUG(1130, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'E') goto yy1131;
+ if(yych != 'e') goto yy1047;
+ goto yy1131;
+yy1131:
+ YYDEBUG(1131, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy1132;
+ if(yych != 'm') goto yy56;
+ goto yy1132;
+yy1132:
+ YYDEBUG(1132, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1133;
+ if(yych != 'b') goto yy56;
+ goto yy1133;
+yy1133:
+ YYDEBUG(1133, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1134;
+ if(yych != 'e') goto yy56;
+ goto yy1134;
+yy1134:
+ YYDEBUG(1134, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1116;
+ if(yych == 'r') goto yy1116;
+ goto yy56;
+yy1135:
+ YYDEBUG(1135, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy1139;
+ if(yych == 'g') goto yy1139;
+ goto yy56;
+yy1136:
+ YYDEBUG(1136, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1137;
+ if(yych != 'r') goto yy56;
+ goto yy1137;
+yy1137:
+ YYDEBUG(1137, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'I') goto yy1138;
+ if(yych != 'i') goto yy1047;
+ goto yy1138;
+yy1138:
+ YYDEBUG(1138, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'L') goto yy1116;
+ if(yych == 'l') goto yy1116;
+ goto yy56;
+yy1139:
+ YYDEBUG(1139, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'U') goto yy1140;
+ if(yych != 'u') goto yy1047;
+ goto yy1140;
+yy1140:
+ YYDEBUG(1140, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy1141;
+ if(yych != 's') goto yy56;
+ goto yy1141;
+yy1141:
+ YYDEBUG(1141, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1116;
+ if(yych == 't') goto yy1116;
+ goto yy56;
+yy1142:
+ YYDEBUG(1142, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy1143;
+ if(yych <= 'X') goto yy56;
+ goto yy1116;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy1143;
+ } else {
+ if(yych == 'y') goto yy1116;
+ goto yy56;
+ }
+ }
+yy1143:
+ YYDEBUG(1143, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'C') goto yy1144;
+ if(yych != 'c') goto yy1047;
+ goto yy1144;
+yy1144:
+ YYDEBUG(1144, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'H') goto yy1116;
+ if(yych == 'h') goto yy1116;
+ goto yy56;
+yy1145:
+ YYDEBUG(1145, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1146;
+ if(yych != 'b') goto yy56;
+ goto yy1146;
+yy1146:
+ YYDEBUG(1146, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'R') goto yy1147;
+ if(yych != 'r') goto yy1047;
+ goto yy1147;
+yy1147:
+ YYDEBUG(1147, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'U') goto yy1148;
+ if(yych != 'u') goto yy56;
+ goto yy1148;
+yy1148:
+ YYDEBUG(1148, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1149;
+ if(yych != 'a') goto yy56;
+ goto yy1149;
+yy1149:
+ YYDEBUG(1149, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1150;
+ if(yych != 'r') goto yy56;
+ goto yy1150;
+yy1150:
+ YYDEBUG(1150, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy1116;
+ if(yych == 'y') goto yy1116;
+ goto yy56;
+yy1151:
+ YYDEBUG(1151, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy1158;
+ if(yych <= 'M') goto yy56;
+ goto yy1157;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy1158;
+ } else {
+ if(yych == 'n') goto yy1157;
+ goto yy56;
+ }
+ }
+yy1152:
+ YYDEBUG(1152, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy1153;
+ if(yych != 'n') goto yy56;
+ goto yy1153;
+yy1153:
+ YYDEBUG(1153, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'U') goto yy1154;
+ if(yych != 'u') goto yy1047;
+ goto yy1154;
+yy1154:
+ YYDEBUG(1154, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1155;
+ if(yych != 'a') goto yy56;
+ goto yy1155;
+yy1155:
+ YYDEBUG(1155, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1156;
+ if(yych != 'r') goto yy56;
+ goto yy1156;
+yy1156:
+ YYDEBUG(1156, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy1116;
+ if(yych == 'y') goto yy1116;
+ goto yy56;
+yy1157:
+ YYDEBUG(1157, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1116;
+ if(yych == 'e') goto yy1116;
+ goto yy1047;
+yy1158:
+ YYDEBUG(1158, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy1116;
+ if(yych == 'y') goto yy1116;
+ goto yy1047;
+yy1159:
+ YYDEBUG(1159, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1116;
+ goto yy1047;
+yy1160:
+ YYDEBUG(1160, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'I') goto yy1047;
+ goto yy1161;
+yy1161:
+ YYDEBUG(1161, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1116;
+ goto yy1047;
+yy1162:
+ YYDEBUG(1162, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'I') goto yy1116;
+ goto yy1047;
+yy1163:
+ YYDEBUG(1163, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '0') goto yy1176;
+ if(yych <= '9') goto yy1175;
+ goto yy56;
+yy1164:
+ YYDEBUG(1164, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1174;
+ goto yy56;
+yy1165:
+ YYDEBUG(1165, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1172;
+ if(yych <= '6') goto yy1171;
+ goto yy56;
+yy1166:
+ YYDEBUG(1166, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1145;
+ if(yych == 'e') goto yy1145;
+ goto yy56;
+yy1167:
+ YYDEBUG(1167, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1142;
+ if(yych == 'a') goto yy1142;
+ goto yy56;
+yy1168:
+ YYDEBUG(1168, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1170;
+ if(yych == 'e') goto yy1170;
+ goto yy56;
+yy1169:
+ YYDEBUG(1169, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1110;
+ if(yych == 'e') goto yy1110;
+ goto yy56;
+yy1170:
+ YYDEBUG(1170, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy1129;
+ if(yych == 'p') goto yy1129;
+ goto yy56;
+yy1171:
+ YYDEBUG(1171, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '6') goto yy1173;
+ goto yy56;
+yy1172:
+ YYDEBUG(1172, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1173;
+yy1173:
+ YYDEBUG(1173, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy1073;
+yy1174:
+ YYDEBUG(1174, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1173;
+ goto yy56;
+yy1175:
+ YYDEBUG(1175, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1173;
+ goto yy56;
+yy1176:
+ YYDEBUG(1176, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '0') goto yy56;
+ if(yych <= '9') goto yy1173;
+ goto yy56;
+yy1177:
+ YYDEBUG(1177, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '.') goto yy56;
+ if(yych <= '/') goto yy1180;
+ if(yych <= '0') goto yy1179;
+ if(yych <= '9') goto yy1185;
+ goto yy56;
+yy1178:
+ YYDEBUG(1178, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '.') goto yy56;
+ if(yych <= '/') goto yy1180;
+ if(yych <= '2') goto yy1185;
+ goto yy56;
+yy1179:
+ YYDEBUG(1179, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '/') goto yy56;
+ goto yy1180;
+yy1180:
+ YYDEBUG(1180, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '2') goto yy1181;
+ if(yych <= '3') goto yy1183;
+ if(yych <= '9') goto yy1184;
+ goto yy56;
+yy1181:
+ YYDEBUG(1181, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy1182;
+ if(yych <= '9') goto yy1184;
+ goto yy1182;
+yy1182:
+ YYDEBUG(1182, *YYCURSOR);
+
+#line 1011 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_DATE;
+ }
+#line 15750 "ext/date/lib/parse_date.c"
+yy1183:
+ YYDEBUG(1183, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1182;
+ if(yych >= '2') goto yy1182;
+ goto yy1184;
+yy1184:
+ YYDEBUG(1184, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy1182;
+yy1185:
+ YYDEBUG(1185, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '/') goto yy56;
+ goto yy1186;
+yy1186:
+ YYDEBUG(1186, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy56;
+ if(yych >= '1') goto yy1188;
+ goto yy1187;
+ } else {
+ if(yych <= '3') goto yy1189;
+ if(yych <= '9') goto yy1184;
+ goto yy56;
+ }
+yy1187:
+ YYDEBUG(1187, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1182;
+ if(yych <= '0') goto yy1184;
+ if(yych <= '9') goto yy1190;
+ goto yy1182;
+yy1188:
+ YYDEBUG(1188, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1182;
+ if(yych <= '9') goto yy1190;
+ goto yy1182;
+yy1189:
+ YYDEBUG(1189, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1182;
+ if(yych >= '2') goto yy1182;
+ goto yy1190;
+yy1190:
+ YYDEBUG(1190, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '/') goto yy1184;
+ goto yy1182;
+yy1191:
+ YYDEBUG(1191, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'A') goto yy1255;
+ if(yych <= 'T') goto yy56;
+ goto yy1254;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy56;
+ goto yy1255;
+ } else {
+ if(yych == 'u') goto yy1254;
+ goto yy56;
+ }
+ }
+yy1192:
+ YYDEBUG(1192, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1252;
+ if(yych == 'e') goto yy1252;
+ goto yy56;
+yy1193:
+ YYDEBUG(1193, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy1249;
+ if(yych == 'a') goto yy1249;
+ goto yy56;
+yy1194:
+ YYDEBUG(1194, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'U'){
+ if(yych == 'P') goto yy1246;
+ if(yych <= 'T') goto yy56;
+ goto yy1245;
+ } else {
+ if(yych <= 'p'){
+ if(yych <= 'o') goto yy56;
+ goto yy1246;
+ } else {
+ if(yych == 'u') goto yy1245;
+ goto yy56;
+ }
+ }
+yy1195:
+ YYDEBUG(1195, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1242;
+ if(yych == 'e') goto yy1242;
+ goto yy56;
+yy1196:
+ YYDEBUG(1196, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1240;
+ if(yych == 'c') goto yy1240;
+ goto yy56;
+yy1197:
+ YYDEBUG(1197, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'O') goto yy1238;
+ if(yych == 'o') goto yy1238;
+ goto yy56;
+yy1198:
+ YYDEBUG(1198, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'E') goto yy1236;
+ if(yych == 'e') goto yy1236;
+ goto yy56;
+yy1199:
+ YYDEBUG(1199, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/'){
+ if(yych == '-') goto yy947;
+ goto yy56;
+ } else {
+ if(yych <= '0') goto yy910;
+ if(yych <= '9') goto yy1201;
+ goto yy56;
+ }
+yy1200:
+ YYDEBUG(1200, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy947;
+ if(yych <= '/') goto yy56;
+ if(yych >= '3') goto yy56;
+ goto yy1201;
+yy1201:
+ YYDEBUG(1201, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '-') goto yy56;
+ goto yy1202;
+yy1202:
+ YYDEBUG(1202, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '2'){
+ if(yych <= '/') goto yy56;
+ if(yych >= '1') goto yy1204;
+ goto yy1203;
+ } else {
+ if(yych <= '3') goto yy1205;
+ if(yych <= '9') goto yy951;
+ goto yy56;
+ }
+yy1203:
+ YYDEBUG(1203, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy949;
+ if(yych <= '0') goto yy951;
+ if(yych <= '9') goto yy1206;
+ goto yy949;
+yy1204:
+ YYDEBUG(1204, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy949;
+ if(yych <= '9') goto yy1206;
+ goto yy949;
+yy1205:
+ YYDEBUG(1205, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy949;
+ if(yych >= '2') goto yy949;
+ goto yy1206;
+yy1206:
+ YYDEBUG(1206, *YYCURSOR);
+ yyaccept = 18;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != 'T') goto yy1182;
+ goto yy1207;
+yy1207:
+ YYDEBUG(1207, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy1208;
+ if(yych <= '2') goto yy1209;
+ if(yych <= '9') goto yy1210;
+ goto yy56;
+yy1208:
+ YYDEBUG(1208, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1217;
+ if(yych <= ':') goto yy1211;
+ goto yy56;
+yy1209:
+ YYDEBUG(1209, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '3') goto yy1217;
+ if(yych == ':') goto yy1211;
+ goto yy56;
+yy1210:
+ YYDEBUG(1210, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1211;
+yy1211:
+ YYDEBUG(1211, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy1212;
+yy1212:
+ YYDEBUG(1212, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1213;
+yy1213:
+ YYDEBUG(1213, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1214;
+yy1214:
+ YYDEBUG(1214, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1215;
+ if(yych <= '6') goto yy1216;
+ goto yy56;
+yy1215:
+ YYDEBUG(1215, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1216:
+ YYDEBUG(1216, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '0') goto yy1090;
+ goto yy56;
+yy1217:
+ YYDEBUG(1217, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1218;
+yy1218:
+ YYDEBUG(1218, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= '6') goto yy56;
+ goto yy1219;
+yy1219:
+ YYDEBUG(1219, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1220;
+yy1220:
+ YYDEBUG(1220, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != ':') goto yy56;
+ goto yy1221;
+yy1221:
+ YYDEBUG(1221, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1222;
+ if(yych <= '6') goto yy1223;
+ goto yy56;
+yy1222:
+ YYDEBUG(1222, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1224;
+ goto yy56;
+yy1223:
+ YYDEBUG(1223, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '0') goto yy56;
+ goto yy1224;
+yy1224:
+ YYDEBUG(1224, *YYCURSOR);
+ yyaccept = 19;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != '.') goto yy1091;
+ goto yy1225;
+yy1225:
+ YYDEBUG(1225, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1226;
+yy1226:
+ YYDEBUG(1226, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
+ yych = *YYCURSOR;
+ goto yy1227;
+yy1227:
+ YYDEBUG(1227, *YYCURSOR);
+ if(yych <= ','){
+ if(yych != '+') goto yy56;
+ goto yy1228;
+ } else {
+ if(yych <= '-') goto yy1228;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1226;
+ goto yy56;
+ }
+yy1228:
+ YYDEBUG(1228, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '1') goto yy1229;
+ if(yych <= '2') goto yy1230;
+ if(yych <= '9') goto yy1231;
+ goto yy56;
+yy1229:
+ YYDEBUG(1229, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1091;
+ if(yych <= '5') goto yy1234;
+ if(yych <= '9') goto yy1231;
+ if(yych <= ':') goto yy1232;
+ goto yy1091;
+yy1230:
+ YYDEBUG(1230, *YYCURSOR);
+ yyaccept = 19;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '5'){
+ if(yych <= '/') goto yy1091;
+ if(yych <= '3') goto yy1234;
+ goto yy1233;
+ } else {
+ if(yych == ':') goto yy1232;
+ goto yy1091;
+ }
+yy1231:
+ YYDEBUG(1231, *YYCURSOR);
+ yyaccept = 19;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy1091;
+ if(yych <= '5') goto yy1233;
+ if(yych != ':') goto yy1091;
+ goto yy1232;
+yy1232:
+ YYDEBUG(1232, *YYCURSOR);
+ yyaccept = 19;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy1091;
+ if(yych >= '6') goto yy1091;
+ goto yy1233;
+yy1233:
+ YYDEBUG(1233, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1090;
+ goto yy56;
+yy1234:
+ YYDEBUG(1234, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1091;
+ if(yych <= '5') goto yy1235;
+ if(yych <= '9') goto yy1090;
+ if(yych <= ':') goto yy1232;
+ goto yy1091;
+yy1235:
+ YYDEBUG(1235, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy1091;
+ if(yych <= '9') goto yy1090;
+ goto yy1091;
+yy1236:
+ YYDEBUG(1236, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy1237;
+ if(yych != 'c') goto yy56;
+ goto yy1237;
+yy1237:
+ YYDEBUG(1237, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'E') goto yy1112;
+ if(yych == 'e') goto yy1112;
+ goto yy1047;
+ }
+yy1238:
+ YYDEBUG(1238, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'V') goto yy1239;
+ if(yych != 'v') goto yy56;
+ goto yy1239;
+yy1239:
+ YYDEBUG(1239, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'E') goto yy1119;
+ if(yych == 'e') goto yy1119;
+ goto yy1047;
+ }
+yy1240:
+ YYDEBUG(1240, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy1241;
+ if(yych != 't') goto yy56;
+ goto yy1241;
+yy1241:
+ YYDEBUG(1241, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'O') goto yy1125;
+ if(yych == 'o') goto yy1125;
+ goto yy1047;
+ }
+yy1242:
+ YYDEBUG(1242, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'P') goto yy1243;
+ if(yych != 'p') goto yy56;
+ goto yy1243;
+yy1243:
+ YYDEBUG(1243, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'T') goto yy1244;
+ if(yych != 't') goto yy1047;
+ goto yy1244;
+ }
+yy1244:
+ YYDEBUG(1244, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'E') goto yy1131;
+ if(yych == 'e') goto yy1131;
+ goto yy1047;
+ }
+yy1245:
+ YYDEBUG(1245, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'G') goto yy1248;
+ if(yych == 'g') goto yy1248;
+ goto yy56;
+yy1246:
+ YYDEBUG(1246, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy1247;
+ if(yych != 'r') goto yy56;
+ goto yy1247;
+yy1247:
+ YYDEBUG(1247, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'H'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'I') goto yy1138;
+ if(yych == 'i') goto yy1138;
+ goto yy1047;
+ }
+yy1248:
+ YYDEBUG(1248, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'U') goto yy1140;
+ if(yych == 'u') goto yy1140;
+ goto yy1047;
+ }
+yy1249:
+ YYDEBUG(1249, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Y'){
+ if(yych == 'R') goto yy1250;
+ if(yych <= 'X') goto yy56;
+ goto yy1251;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'q') goto yy56;
+ goto yy1250;
+ } else {
+ if(yych == 'y') goto yy1251;
+ goto yy56;
+ }
+ }
+yy1250:
+ YYDEBUG(1250, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'B'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'C') goto yy1144;
+ if(yych == 'c') goto yy1144;
+ goto yy1047;
+ }
+yy1251:
+ YYDEBUG(1251, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+yy1252:
+ YYDEBUG(1252, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'B') goto yy1253;
+ if(yych != 'b') goto yy56;
+ goto yy1253;
+yy1253:
+ YYDEBUG(1253, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'Q'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'R') goto yy1147;
+ if(yych == 'r') goto yy1147;
+ goto yy1047;
+ }
+yy1254:
+ YYDEBUG(1254, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'N'){
+ if(yych == 'L') goto yy1258;
+ if(yych <= 'M') goto yy56;
+ goto yy1257;
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'k') goto yy56;
+ goto yy1258;
+ } else {
+ if(yych == 'n') goto yy1257;
+ goto yy56;
+ }
+ }
+yy1255:
+ YYDEBUG(1255, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy1256;
+ if(yych != 'n') goto yy56;
+ goto yy1256;
+yy1256:
+ YYDEBUG(1256, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'T'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'U') goto yy1154;
+ if(yych == 'u') goto yy1154;
+ goto yy1047;
+ }
+yy1257:
+ YYDEBUG(1257, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'D'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'E') goto yy1116;
+ if(yych == 'e') goto yy1116;
+ goto yy1047;
+ }
+yy1258:
+ YYDEBUG(1258, *YYCURSOR);
+ yyaccept = 17;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'X'){
+ if(yych == '-') goto yy1021;
+ goto yy1047;
+ } else {
+ if(yych <= 'Y') goto yy1116;
+ if(yych == 'y') goto yy1116;
+ goto yy1047;
+ }
+yy1259:
+ YYDEBUG(1259, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'P'){
+ if(yych == 'C') goto yy137;
+ if(yych <= 'O') goto yy56;
+ goto yy883;
+ } else {
+ if(yych <= 'c'){
+ if(yych <= 'b') goto yy56;
+ goto yy137;
+ } else {
+ if(yych == 'p') goto yy883;
+ goto yy56;
+ }
+ }
+yy1260:
+ YYDEBUG(1260, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '.'){
+ if(yych <= ',') goto yy1262;
+ if(yych <= '-') goto yy789;
+ goto yy1263;
+ } else {
+ if(yych <= '/') goto yy1264;
+ if(yych <= '9') goto yy1009;
+ goto yy1262;
+ }
+yy1261:
+ YYDEBUG(1261, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
+ yych = *YYCURSOR;
+ goto yy1262;
+yy1262:
+ YYDEBUG(1262, *YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': goto yy1261;
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.': goto yy790;
+ case 'A': case 'a': goto yy873;
+ case 'D': case 'd': goto yy785;
+ case 'F': case 'f': goto yy786;
+ case 'H': case 'h': goto yy73;
+ case 'I': goto yy793;
+ case 'J': case 'j': goto yy797;
+ case 'M': case 'm': goto yy784;
+ case 'N': case 'n': goto yy800;
+ case 'O': case 'o': goto yy799;
+ case 'S': case 's': goto yy783;
+ case 'T': case 't': goto yy78;
+ case 'V': goto yy795;
+ case 'W': case 'w': goto yy75;
+ case 'X': goto yy796;
+ case 'Y': case 'y': goto yy77;
+ default: goto yy56;
+ }
+yy1263:
+ YYDEBUG(1263, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy791;
+ if(yych <= '0') goto yy1265;
+ if(yych <= '1') goto yy1266;
+ if(yych <= '9') goto yy1267;
+ goto yy791;
+yy1264:
+ YYDEBUG(1264, *YYCURSOR);
+ yych = *++YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case 'A': case 'a': goto yy959;
+ case 'D': case 'd': goto yy963;
+ case 'F': case 'f': goto yy957;
+ case 'J': case 'j': goto yy956;
+ case 'M': case 'm': goto yy958;
+ case 'N': case 'n': goto yy962;
+ case 'O': case 'o': goto yy961;
+ case 'S': case 's': goto yy960;
+ default: goto yy56;
+ }
+yy1265:
+ YYDEBUG(1265, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '.') goto yy1268;
+ if(yych <= '/') goto yy56;
+ if(yych <= '9') goto yy1267;
+ goto yy56;
+yy1266:
+ YYDEBUG(1266, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '.') goto yy1268;
+ if(yych <= '/') goto yy56;
+ if(yych >= '3') goto yy56;
+ goto yy1267;
+yy1267:
+ YYDEBUG(1267, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '.') goto yy56;
+ goto yy1268;
+yy1268:
+ YYDEBUG(1268, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1269;
+yy1269:
+ YYDEBUG(1269, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy903;
+ if(yych <= '9') goto yy902;
+ goto yy903;
+yy1270:
+ YYDEBUG(1270, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy1262;
+ if(yych <= '-') goto yy789;
+ if(yych >= '/') goto yy1264;
+ goto yy1271;
+ } else {
+ if(yych <= '5') goto yy1273;
+ if(yych <= '9') goto yy1009;
+ if(yych <= ':') goto yy1272;
+ goto yy1262;
+ }
+yy1271:
+ YYDEBUG(1271, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '1'){
+ if(yych <= '/') goto yy791;
+ if(yych <= '0') goto yy1295;
+ goto yy1296;
+ } else {
+ if(yych <= '5') goto yy1297;
+ if(yych <= '9') goto yy1298;
+ goto yy791;
+ }
+yy1272:
+ YYDEBUG(1272, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1290;
+ if(yych <= '9') goto yy1291;
+ goto yy56;
+yy1273:
+ YYDEBUG(1273, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == '-') goto yy1010;
+ if(yych <= '/') goto yy70;
+ if(yych >= ':') goto yy70;
+ goto yy1274;
+yy1274:
+ YYDEBUG(1274, *YYCURSOR);
+ yyaccept = 20;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ':
+ case '!':
+ case '"':
+ case '#':
+ case '$':
+ case '%':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',': case 'A': case 'D': case 'F': case 'H':
+ case 'I':
+ case 'J': case 'M':
+ case 'N':
+ case 'O': case 'S':
+ case 'T': case 'V': case 'X':
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm':
+ case 'n':
+ case 'o': case 's':
+ case 't': case 'w': case 'y': goto yy1042;
+ case '-': goto yy1039;
+ case '.': goto yy1045;
+ case '/': goto yy1040;
+ case '0': goto yy1276;
+ case '1': goto yy1277;
+ case '2': goto yy1278;
+ case '3': goto yy1279;
+ case '4':
+ case '5': goto yy1280;
+ case '6': goto yy1281;
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ case 'W': goto yy1062;
+ default: goto yy1275;
+ }
+yy1275:
+ YYDEBUG(1275, *YYCURSOR);
+
+#line 933 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("gnunocolon");
+ TIMELIB_INIT;
+ switch (s->time->have_time) {
+ case 0:
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = 0;
+ break;
+ case 1:
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ break;
+ default:
+ TIMELIB_DEINIT;
+ return TIMELIB_ERROR;
+ }
+ s->time->have_time++;
+ TIMELIB_DEINIT;
+ return TIMELIB_GNU_NOCOLON;
+ }
+#line 16397 "ext/date/lib/parse_date.c"
+yy1276:
+ YYDEBUG(1276, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy1288;
+ if(yych <= '9') goto yy1289;
+ goto yy70;
+yy1277:
+ YYDEBUG(1277, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '2') goto yy1287;
+ if(yych <= '9') goto yy1286;
+ goto yy70;
+yy1278:
+ YYDEBUG(1278, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1286;
+ goto yy70;
+yy1279:
+ YYDEBUG(1279, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '5') goto yy1284;
+ if(yych <= '6') goto yy1285;
+ if(yych <= '9') goto yy1282;
+ goto yy70;
+yy1280:
+ YYDEBUG(1280, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '9') goto yy1282;
+ goto yy70;
+yy1281:
+ YYDEBUG(1281, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy70;
+ if(yych <= '0') goto yy1282;
+ if(yych <= '9') goto yy79;
+ goto yy70;
+yy1282:
+ YYDEBUG(1282, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 32) {
+ goto yy79;
+ }
+ if(yych <= 'X'){
+ if(yych <= 'G'){
+ if(yych <= 'C'){
+ if(yych == ' ') goto yy70;
+ goto yy1283;
+ } else {
+ if(yych == 'E') goto yy1283;
+ if(yych <= 'F') goto yy70;
+ goto yy1283;
+ }
+ } else {
+ if(yych <= 'R'){
+ if(yych <= 'H') goto yy70;
+ if(yych == 'M') goto yy70;
+ goto yy1283;
+ } else {
+ if(yych <= 'T') goto yy70;
+ if(yych == 'W') goto yy70;
+ goto yy1283;
+ }
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych <= 'e'){
+ if(yych <= 'Y') goto yy70;
+ if(yych == 'd') goto yy70;
+ goto yy1283;
+ } else {
+ if(yych == 'g') goto yy1283;
+ if(yych <= 'h') goto yy70;
+ goto yy1283;
+ }
+ } else {
+ if(yych <= 'v'){
+ if(yych <= 'm') goto yy70;
+ if(yych <= 'r') goto yy1283;
+ if(yych <= 't') goto yy70;
+ goto yy1283;
+ } else {
+ if(yych == 'x') goto yy1283;
+ if(yych <= 'y') goto yy70;
+ goto yy1283;
+ }
+ }
+ }
+yy1283:
+ YYDEBUG(1283, *YYCURSOR);
+
+#line 978 "ext/date/lib/parse_date.re"
+{
+ int tz_not_found;
+ DEBUG_OUTPUT("iso8601nocolon");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr != '\0') {
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_NOCOLON;
+ }
+#line 16495 "ext/date/lib/parse_date.c"
+yy1284:
+ YYDEBUG(1284, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1285:
+ YYDEBUG(1285, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6': goto yy1072;
+ case '7':
+ case '8':
+ case '9': goto yy79;
+ default: goto yy1283;
+ }
+yy1286:
+ YYDEBUG(1286, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1287:
+ YYDEBUG(1287, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0': goto yy1076;
+ case '1':
+ case '2': goto yy1077;
+ case '3': goto yy1078;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1288:
+ YYDEBUG(1288, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0': goto yy79;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1289:
+ YYDEBUG(1289, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ YYDEBUG(-1, yych);
+ switch(yych){
+ case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
+ case 'T': case 'W': case 'Y': case 'd': case 'f': case 'h': case 'm': case 's':
+ case 't': case 'w': case 'y': goto yy70;
+ case '0': goto yy1076;
+ case '1':
+ case '2': goto yy1077;
+ case '3': goto yy1078;
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy1072;
+ default: goto yy1283;
+ }
+yy1290:
+ YYDEBUG(1290, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy1292;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy1291;
+ if(yych <= ':') goto yy1292;
+ goto yy808;
+ }
+yy1291:
+ YYDEBUG(1291, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy1292;
+ if(yych != ':') goto yy808;
+ goto yy1292;
+yy1292:
+ YYDEBUG(1292, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1293;
+ if(yych <= '6') goto yy1294;
+ if(yych <= '9') goto yy813;
+ goto yy56;
+yy1293:
+ YYDEBUG(1293, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy813;
+ goto yy808;
+yy1294:
+ YYDEBUG(1294, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych == '0') goto yy813;
+ goto yy808;
+yy1295:
+ YYDEBUG(1295, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy1299;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy1298;
+ if(yych <= ':') goto yy1292;
+ goto yy808;
+ }
+yy1296:
+ YYDEBUG(1296, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy1299;
+ goto yy808;
+ } else {
+ if(yych <= '2') goto yy1298;
+ if(yych <= '9') goto yy1291;
+ if(yych <= ':') goto yy1292;
+ goto yy808;
+ }
+yy1297:
+ YYDEBUG(1297, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy1299;
+ goto yy808;
+ } else {
+ if(yych <= '9') goto yy1291;
+ if(yych <= ':') goto yy1292;
+ goto yy808;
+ }
+yy1298:
+ YYDEBUG(1298, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy1299;
+ if(yych == ':') goto yy1292;
+ goto yy808;
+yy1299:
+ YYDEBUG(1299, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy56;
+ if(yych <= '5') goto yy1300;
+ if(yych <= '6') goto yy1301;
+ if(yych <= '9') goto yy901;
+ goto yy56;
+yy1300:
+ YYDEBUG(1300, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy1302;
+ goto yy808;
+yy1301:
+ YYDEBUG(1301, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy814;
+ goto yy808;
+ } else {
+ if(yych <= '0') goto yy1302;
+ if(yych <= '9') goto yy902;
+ goto yy808;
+ }
+yy1302:
+ YYDEBUG(1302, *YYCURSOR);
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy814;
+ if(yych <= '/') goto yy808;
+ if(yych <= '9') goto yy904;
+ goto yy808;
+yy1303:
+ YYDEBUG(1303, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy782;
+ if(yych <= '-') goto yy789;
+ if(yych <= '.') goto yy792;
+ goto yy788;
+ } else {
+ if(yych <= '5') goto yy1273;
+ if(yych <= '9') goto yy1009;
+ if(yych <= ':') goto yy801;
+ goto yy782;
+ }
+yy1304:
+ YYDEBUG(1304, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy1262;
+ if(yych <= '-') goto yy789;
+ if(yych <= '.') goto yy1271;
+ goto yy788;
+ } else {
+ if(yych <= '5') goto yy1273;
+ if(yych <= '9') goto yy1009;
+ if(yych <= ':') goto yy1272;
+ goto yy1262;
+ }
+yy1305:
+ YYDEBUG(1305, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '0') goto yy56;
+ if(yych >= ':') goto yy56;
+ goto yy1306;
+yy1306:
+ YYDEBUG(1306, *YYCURSOR);
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy1307;
+yy1307:
+ YYDEBUG(1307, *YYCURSOR);
+ if(yych <= '/') goto yy1308;
+ if(yych <= '9') goto yy1306;
+ goto yy1308;
+yy1308:
+ YYDEBUG(1308, *YYCURSOR);
+
+#line 868 "ext/date/lib/parse_date.re"
+{
+ timelib_ull i;
+
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_UNHAVE_DATE();
+ TIMELIB_UNHAVE_TIME();
+
+ i = timelib_get_unsigned_nr((char **) &ptr, 24);
+ s->time->y = 1970;
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->h = s->time->i = s->time->s = 0;
+ s->time->f = 0.0;
+ s->time->relative.s += i;
+ s->time->is_localtime = 1;
+ s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
+ s->time->z = 0;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+#line 16759 "ext/date/lib/parse_date.c"
+yy1309:
+ YYDEBUG(1309, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '`'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy49;
+ } else {
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'l'){
+ if(yych != 'd') goto yy51;
+ goto yy1310;
+ } else {
+ if(yych <= 'm') goto yy1311;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy1310:
+ YYDEBUG(1310, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'a') goto yy1318;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+yy1311:
+ YYDEBUG(1311, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'n'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'o') goto yy1312;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy1312:
+ YYDEBUG(1312, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == ')') goto yy49;
+ if(yych != 'r') goto yy3;
+ goto yy1313;
+yy1313:
+ YYDEBUG(1313, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'r') goto yy56;
+ goto yy1314;
+yy1314:
+ YYDEBUG(1314, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'o') goto yy56;
+ goto yy1315;
+yy1315:
+ YYDEBUG(1315, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'w') goto yy56;
+ goto yy1316;
+yy1316:
+ YYDEBUG(1316, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1317;
+yy1317:
+ YYDEBUG(1317, *YYCURSOR);
+
+#line 856 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("tomorrow");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+
+ s->time->relative.d = 1;
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+#line 16834 "ext/date/lib/parse_date.c"
+yy1318:
+ YYDEBUG(1318, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == ')') goto yy49;
+ if(yych != 'y') goto yy3;
+ goto yy1319;
+yy1319:
+ YYDEBUG(1319, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1320;
+yy1320:
+ YYDEBUG(1320, *YYCURSOR);
+
+#line 846 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("midnight | today");
+ TIMELIB_INIT;
+ TIMELIB_UNHAVE_TIME();
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+#line 16851 "ext/date/lib/parse_date.c"
+yy1321:
+ YYDEBUG(1321, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'c'){
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'd') goto yy1322;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy1322:
+ YYDEBUG(1322, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'n') goto yy1323;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy1323:
+ YYDEBUG(1323, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == ')') goto yy49;
+ if(yych != 'i') goto yy3;
+ goto yy1324;
+yy1324:
+ YYDEBUG(1324, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'g') goto yy56;
+ goto yy1325;
+yy1325:
+ YYDEBUG(1325, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'h') goto yy56;
+ goto yy1326;
+yy1326:
+ YYDEBUG(1326, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 't') goto yy1319;
+ goto yy56;
+yy1327:
+ YYDEBUG(1327, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '`'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy3;
+ } else {
+ if(yych == 'V') goto yy618;
+ if(yych <= 'Z') goto yy51;
+ goto yy3;
+ }
+ } else {
+ if(yych <= 'u'){
+ if(yych == 'o') goto yy1330;
+ goto yy51;
+ } else {
+ if(yych <= 'v') goto yy618;
+ if(yych <= 'w') goto yy1328;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy1328:
+ YYDEBUG(1328, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '@'){
+ if(yych == ')') goto yy49;
+ goto yy1329;
+ } else {
+ if(yych <= 'Z') goto yy52;
+ if(yych <= '`') goto yy1329;
+ if(yych <= 'z') goto yy52;
+ goto yy1329;
+ }
+yy1329:
+ YYDEBUG(1329, *YYCURSOR);
+
+#line 825 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("now");
+ TIMELIB_INIT;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+#line 16936 "ext/date/lib/parse_date.c"
+yy1330:
+ YYDEBUG(1330, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'm'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 'n') goto yy1331;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy1331:
+ YYDEBUG(1331, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) == ')') goto yy49;
+ goto yy1332;
+yy1332:
+ YYDEBUG(1332, *YYCURSOR);
+
+#line 834 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("noon");
+ TIMELIB_INIT;
+ TIMELIB_UNHAVE_TIME();
+ TIMELIB_HAVE_TIME();
+ s->time->h = 12;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+#line 16967 "ext/date/lib/parse_date.c"
+yy1333:
+ YYDEBUG(1333, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 'r'){
+ if(yych <= '`') goto yy3;
+ goto yy51;
+ } else {
+ if(yych <= 's') goto yy1334;
+ if(yych <= 'z') goto yy51;
+ goto yy3;
+ }
+ }
+yy1334:
+ YYDEBUG(1334, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'Z'){
+ if(yych == ')') goto yy49;
+ if(yych <= '@') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 's'){
+ if(yych <= '`') goto yy3;
+ goto yy52;
+ } else {
+ if(yych <= 't') goto yy1335;
+ if(yych <= 'z') goto yy52;
+ goto yy3;
+ }
+ }
+yy1335:
+ YYDEBUG(1335, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == ')') goto yy49;
+ if(yych != 'e') goto yy3;
+ goto yy1336;
+yy1336:
+ YYDEBUG(1336, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'r') goto yy56;
+ goto yy1337;
+yy1337:
+ YYDEBUG(1337, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'd') goto yy56;
+ goto yy1338;
+yy1338:
+ YYDEBUG(1338, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'a') goto yy56;
+ goto yy1339;
+yy1339:
+ YYDEBUG(1339, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != 'y') goto yy56;
+ goto yy1340;
+yy1340:
+ YYDEBUG(1340, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy1341;
+yy1341:
+ YYDEBUG(1341, *YYCURSOR);
+
+#line 813 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("yesterday");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+
+ s->time->relative.d = -1;
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+#line 17029 "ext/date/lib/parse_date.c"
+}
+}
+#line 1377 "ext/date/lib/parse_date.re"
+
+}
+
+#define YYMAXFILL 26
+
+
+timelib_time* timelib_strtotime(char *s, int *errors, timelib_tzdb *tzdb)
+{
+ Scanner in;
+ int t;
+
+ memset(&in, 0, sizeof(in));
+ in.str = malloc(strlen(s) + YYMAXFILL);
+ memset(in.str, 0, strlen(s) + YYMAXFILL);
+ memcpy(in.str, s, strlen(s));
+ in.lim = in.str + strlen(s) + YYMAXFILL;
+ in.cur = in.str;
+ in.time = timelib_time_ctor();
+ in.time->y = -1;
+ in.time->d = -1;
+ in.time->m = -1;
+ in.time->h = -1;
+ in.time->i = -1;
+ in.time->s = -1;
+ in.time->f = -1;
+ in.time->z = -1;
+ in.time->dst = -1;
+ in.errors = 0;
+ in.tzdb = tzdb;
+ in.time->is_localtime = 0;
+ in.time->zone_type = 0;
+
+ do {
+ t = scan(&in);
+#ifdef DEBUG_PARSER
+ printf("%d\n", t);
+#endif
+ } while(t != EOI);
+
+ free(in.str);
+ *errors = in.errors;
+ return in.time;
+}
+
+void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
+{
+ if (!(options && TIMELIB_OVERRIDE_TIME) && parsed->have_date && !parsed->have_time) {
+ parsed->h = 0;
+ parsed->i = 0;
+ parsed->s = 0;
+ parsed->f = 0;
+ }
+ if (parsed->y == -1) parsed->y = now->y != -1 ? now->y : 0;
+ if (parsed->d == -1) parsed->d = now->d != -1 ? now->d : 0;
+ if (parsed->m == -1) parsed->m = now->m != -1 ? now->m : 0;
+ if (parsed->h == -1) parsed->h = now->h != -1 ? now->h : 0;
+ if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0;
+ if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0;
+ if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0;
+ if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0;
+ if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0;
+
+ if (!parsed->tz_abbr) {
+ parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
+ }
+ if (!parsed->tz_info) {
+ parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL;
+ }
+ if (parsed->zone_type == 0 && now->zone_type != 0) {
+ parsed->zone_type = now->zone_type;
+/* parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
+ parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL;
+*/ parsed->is_localtime = 1;
+ }
+/* timelib_dump_date(parsed, 2);
+ timelib_dump_date(now, 2);
+*/
+}
+
+char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
+{
+ timelib_tz_lookup_table *tp;
+
+ tp = zone_search(abbr, gmtoffset, isdst);
+ if (tp) {
+ return (tp->full_tz_name);
+ } else {
+ return NULL;
+ }
+}
+
+timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void)
+{
+ return timelib_timezone_lookup;
+}
+
+#ifdef DEBUG_PARSER_STUB
+int main(void)
+{
+ timelib_time time = timelib_strtotime("May 12");
+
+ printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d",
+ time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
+ if (time.have_relative) {
+ printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
+ time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s);
+ }
+ if (time.have_weekday_relative) {
+ printf (" / %d", time.relative.weekday);
+ }
+ if (time.have_weeknr_day) {
+ printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);
+ }
+ return 0;
+}
+#endif
+
+/*
+ * vim: syntax=c
+ */
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
new file mode 100644
index 000000000..cce0144d9
--- /dev/null
+++ b/ext/date/lib/parse_date.re
@@ -0,0 +1,1495 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: parse_date.re,v 1.26.2.9 2005/11/17 13:04:29 derick Exp $ */
+
+#include "timelib.h"
+
+#include <stdio.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if defined(_MSC_VER)
+# define strtoll(s, f, b) _atoi64(s)
+#elif !defined(HAVE_STRTOLL)
+# if defined(HAVE_ATOLL)
+# define strtoll(s, f, b) atoll(s)
+# else
+# define strtoll(s, f, b) strtol(s, f, b)
+# endif
+#endif
+
+#define TIMELIB_SECOND 1
+#define TIMELIB_MINUTE 2
+#define TIMELIB_HOUR 3
+#define TIMELIB_DAY 4
+#define TIMELIB_MONTH 5
+#define TIMELIB_YEAR 6
+#define TIMELIB_WEEKDAY 7
+
+#define EOI 257
+#define TIME 258
+#define DATE 259
+
+#define TIMELIB_XMLRPC_SOAP 260
+#define TIMELIB_TIME12 261
+#define TIMELIB_TIME24 262
+#define TIMELIB_GNU_NOCOLON 263
+#define TIMELIB_GNU_NOCOLON_TZ 264
+#define TIMELIB_ISO_NOCOLON 265
+
+#define TIMELIB_AMERICAN 266
+#define TIMELIB_ISO_DATE 267
+#define TIMELIB_DATE_FULL 268
+#define TIMELIB_DATE_TEXT 269
+#define TIMELIB_DATE_NOCOLON 270
+#define TIMELIB_PG_YEARDAY 271
+#define TIMELIB_PG_TEXT 272
+#define TIMELIB_PG_REVERSE 273
+#define TIMELIB_CLF 274
+#define TIMELIB_DATE_NO_DAY 275
+#define TIMELIB_SHORTDATE_WITH_TIME 276
+#define TIMELIB_DATE_FULL_POINTED 277
+#define TIMELIB_TIME24_WITH_ZONE 278
+#define TIMELIB_ISO_WEEK 279
+
+#define TIMELIB_TIMEZONE 300
+#define TIMELIB_AGO 301
+
+#define TIMELIB_RELATIVE 310
+
+#define TIMELIB_ERROR 999
+
+typedef unsigned char uchar;
+
+#define BSIZE 8192
+
+#define YYCTYPE uchar
+#define YYCURSOR cursor
+#define YYLIMIT s->lim
+#define YYMARKER s->ptr
+#define YYFILL(n) return EOI;
+
+#define RET(i) {s->cur = cursor; return i;}
+
+#define timelib_string_free free
+
+#define TIMELIB_HAVE_TIME() { if (s->time->have_time) { return TIMELIB_ERROR; } else { s->time->have_time = 1; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } }
+#define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; }
+#define TIMELIB_HAVE_DATE() { if (s->time->have_date) { return TIMELIB_ERROR; } else { s->time->have_date = 1; } }
+#define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y = 0; }
+#define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 0; }
+#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; }
+#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { return TIMELIB_ERROR; } else { s->time.have_zone = 1; } }
+
+#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
+#define TIMELIB_DEINIT timelib_string_free(str)
+#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; }
+
+#define TIMELIB_PROCESS_YEAR(x) { \
+ if ((x) == -1) { \
+ /* (x) = 0; */ \
+ } else if ((x) < 100) { \
+ if ((x) < 70) { \
+ (x) += 2000; \
+ } else { \
+ (x) += 1900; \
+ } \
+ } \
+}
+
+#ifdef DEBUG_PARSER
+#define DEBUG_OUTPUT(s) printf("%s\n", s);
+#define YYDEBUG(s,c) { if (s != -1) { printf("state: %d ", s); printf("[%c]\n", c); } }
+#else
+#define DEBUG_OUTPUT(s)
+#define YYDEBUG(s,c)
+#endif
+
+#include "timelib_structs.h"
+
+typedef struct timelib_elems {
+ unsigned int c; /* Number of elements */
+ char **v; /* Values */
+} timelib_elems;
+
+typedef struct Scanner {
+ int fd;
+ uchar *lim, *str, *ptr, *cur, *tok, *pos;
+ unsigned int line, len;
+ int errors;
+
+ struct timelib_time *time;
+ timelib_tzdb *tzdb;
+} Scanner;
+
+typedef struct _timelib_lookup_table {
+ const char *name;
+ int type;
+ int value;
+} timelib_lookup_table;
+
+typedef struct _timelib_relunit {
+ const char *name;
+ int unit;
+ int multiplier;
+} timelib_relunit;
+
+#define HOUR(a) (int)(a * 60)
+
+/* The timezone table. */
+static timelib_tz_lookup_table timelib_timezone_lookup[] = {
+#include "timezonemap.h"
+ { NULL, 0, 0, NULL },
+};
+
+static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = {
+#include "fallbackmap.h"
+ { NULL, 0, 0, NULL },
+};
+
+static timelib_relunit const timelib_relunit_lookup[] = {
+ { "sec", TIMELIB_SECOND, 1 },
+ { "secs", TIMELIB_SECOND, 1 },
+ { "second", TIMELIB_SECOND, 1 },
+ { "seconds", TIMELIB_SECOND, 1 },
+ { "min", TIMELIB_MINUTE, 1 },
+ { "mins", TIMELIB_MINUTE, 1 },
+ { "minute", TIMELIB_MINUTE, 1 },
+ { "minutes", TIMELIB_MINUTE, 1 },
+ { "hour", TIMELIB_HOUR, 1 },
+ { "hours", TIMELIB_HOUR, 1 },
+ { "day", TIMELIB_DAY, 1 },
+ { "days", TIMELIB_DAY, 1 },
+ { "week", TIMELIB_DAY, 7 },
+ { "weeks", TIMELIB_DAY, 7 },
+ { "fortnight", TIMELIB_DAY, 14 },
+ { "fortnights", TIMELIB_DAY, 14 },
+ { "forthnight", TIMELIB_DAY, 14 },
+ { "forthnights", TIMELIB_DAY, 14 },
+ { "month", TIMELIB_MONTH, 1 },
+ { "months", TIMELIB_MONTH, 1 },
+ { "year", TIMELIB_YEAR, 1 },
+ { "years", TIMELIB_YEAR, 1 },
+
+ { "monday", TIMELIB_WEEKDAY, 1 },
+ { "tuesday", TIMELIB_WEEKDAY, 2 },
+ { "wednesday", TIMELIB_WEEKDAY, 3 },
+ { "thursday", TIMELIB_WEEKDAY, 4 },
+ { "friday", TIMELIB_WEEKDAY, 5 },
+ { "saturday", TIMELIB_WEEKDAY, 6 },
+ { "sunday", TIMELIB_WEEKDAY, 0 },
+
+ { NULL, 0, 0 }
+};
+
+/* The relative text table. */
+static timelib_lookup_table const timelib_reltext_lookup[] = {
+ { "first", 0, 1 },
+ { "next", 0, 1 },
+ { "second", 0, 2 },
+ { "third", 0, 3 },
+ { "fourth", 0, 4 },
+ { "fifth", 0, 5 },
+ { "sixth", 0, 6 },
+ { "seventh", 0, 7 },
+ { "eight", 0, 8 },
+ { "ninth", 0, 9 },
+ { "tenth", 0, 10 },
+ { "eleventh", 0, 11 },
+ { "twelfth", 0, 12 },
+ { "last", 0, -1 },
+ { "previous", 0, -1 },
+ { "this", 1, 0 },
+ { NULL, 1, 0 }
+};
+
+/* The month table. */
+static timelib_lookup_table const timelib_month_lookup[] = {
+ { "jan", 0, 1 },
+ { "feb", 0, 2 },
+ { "mar", 0, 3 },
+ { "apr", 0, 4 },
+ { "may", 0, 5 },
+ { "jun", 0, 6 },
+ { "jul", 0, 7 },
+ { "aug", 0, 8 },
+ { "sep", 0, 9 },
+ { "sept", 0, 9 },
+ { "oct", 0, 10 },
+ { "nov", 0, 11 },
+ { "dec", 0, 12 },
+ { "i", 0, 1 },
+ { "ii", 0, 2 },
+ { "iii", 0, 3 },
+ { "iv", 0, 4 },
+ { "v", 0, 5 },
+ { "vi", 0, 6 },
+ { "vii", 0, 7 },
+ { "viii", 0, 8 },
+ { "ix", 0, 9 },
+ { "x", 0, 10 },
+ { "xi", 0, 11 },
+ { "xii", 0, 12 },
+
+ { "january", 0, 1 },
+ { "february", 0, 2 },
+ { "march", 0, 3 },
+ { "april", 0, 4 },
+ { "may", 0, 5 },
+ { "june", 0, 6 },
+ { "july", 0, 7 },
+ { "august", 0, 8 },
+ { "september", 0, 9 },
+ { "october", 0, 10 },
+ { "november", 0, 11 },
+ { "december", 0, 12 },
+ { NULL, 0, 0 }
+};
+
+#if 0
+static char* timelib_ltrim(char *s)
+{
+ char *ptr = s;
+ while (ptr[0] == ' ') {
+ ptr++;
+ }
+ return ptr;
+}
+#endif
+
+#if 0
+uchar *fill(Scanner *s, uchar *cursor){
+ if(!s->eof){
+ unsigned int cnt = s->tok - s->bot;
+ if(cnt){
+ memcpy(s->bot, s->tok, s->lim - s->tok);
+ s->tok = s->bot;
+ s->ptr -= cnt;
+ cursor -= cnt;
+ s->pos -= cnt;
+ s->lim -= cnt;
+ }
+ if((s->top - s->lim) < BSIZE){
+ uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
+ memcpy(buf, s->tok, s->lim - s->tok);
+ s->tok = buf;
+ s->ptr = &buf[s->ptr - s->bot];
+ cursor = &buf[cursor - s->bot];
+ s->pos = &buf[s->pos - s->bot];
+ s->lim = &buf[s->lim - s->bot];
+ s->top = &s->lim[BSIZE];
+ free(s->bot);
+ s->bot = buf;
+ }
+ if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){
+ s->eof = &s->lim[cnt]; *(s->eof)++ = '\n';
+ }
+ s->lim += cnt;
+ }
+ return cursor;
+}
+#endif
+
+static timelib_sll timelib_meridian(char **ptr, timelib_sll h)
+{
+ timelib_sll retval = 0;
+
+ while (!strchr("AaPp", **ptr)) {
+ ++*ptr;
+ }
+ if (**ptr == 'a' || **ptr == 'A') {
+ if (h == 12) {
+ retval = -12;
+ }
+ } else if (h != 12) {
+ retval = 12;
+ }
+ ++*ptr;
+ if (**ptr == '.') {
+ *ptr += 3;
+ } else {
+ ++*ptr;
+ }
+ return retval;
+}
+
+static char *timelib_string(Scanner *s)
+{
+ char *tmp = calloc(1, s->cur - s->tok + 1);
+ memcpy(tmp, s->tok, s->cur - s->tok);
+
+ return tmp;
+}
+
+static timelib_sll timelib_get_nr(char **ptr, int max_length)
+{
+ char *begin, *end, *str;
+ timelib_sll tmp_nr = -1;
+ int len = 0;
+
+ while ((**ptr < '0') || (**ptr > '9')) {
+ if (**ptr == '\0') {
+ return -1;
+ }
+ ++*ptr;
+ }
+ begin = *ptr;
+ while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) {
+ ++*ptr;
+ ++len;
+ }
+ end = *ptr;
+ str = calloc(1, end - begin + 1);
+ memcpy(str, begin, end - begin);
+ tmp_nr = strtoll(str, NULL, 10);
+ free(str);
+ return tmp_nr;
+}
+
+static double timelib_get_frac_nr(char **ptr, int max_length)
+{
+ char *begin, *end, *str;
+ double tmp_nr = -1;
+ int len = 0;
+
+ while ((**ptr != '.') && ((**ptr < '0') || (**ptr > '9'))) {
+ if (**ptr == '\0') {
+ return -1;
+ }
+ ++*ptr;
+ }
+ begin = *ptr;
+ while (((**ptr == '.') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_length) {
+ ++*ptr;
+ ++len;
+ }
+ end = *ptr;
+ str = calloc(1, end - begin + 1);
+ memcpy(str, begin, end - begin);
+ tmp_nr = strtod(str, NULL);
+ free(str);
+ return tmp_nr;
+}
+
+static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length)
+{
+ timelib_ull dir = 1;
+
+ while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) {
+ if (**ptr == '\0') {
+ return -1;
+ }
+ ++*ptr;
+ }
+ if (**ptr == '+') {
+ ++*ptr;
+ } else if (**ptr == '-') {
+ dir = -1;
+ ++*ptr;
+ }
+ return dir * timelib_get_nr(ptr, max_length);
+}
+
+static long timelib_parse_tz_cor(char **ptr)
+{
+ char *begin = *ptr, *end;
+ long tmp;
+
+ while (**ptr != '\0') {
+ ++*ptr;
+ }
+ end = *ptr;
+ switch (end - begin) {
+ case 1:
+ case 2:
+ return HOUR(strtol(begin, NULL, 10));
+ break;
+ case 3:
+ case 4:
+ tmp = strtol(begin, NULL, 10);
+ return HOUR(tmp / 100) + tmp % 100;
+ case 5:
+ tmp = HOUR(strtol(begin, NULL, 10)) +
+ strtol(begin + 3, NULL, 10);
+ return tmp;
+ }
+ return 0;
+}
+
+static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ timelib_sll value = 0;
+ const timelib_lookup_table *tp;
+
+ while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ for (tp = timelib_reltext_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ value = tp->value;
+ *behavior = tp->type;
+ }
+ }
+
+ free(word);
+ return value;
+}
+
+static timelib_sll timelib_get_relative_text(char **ptr, int *behavior)
+{
+ while (**ptr == ' ' || **ptr == '-' || **ptr == '/') {
+ ++*ptr;
+ }
+ return timelib_lookup_relative_text(ptr, behavior);
+}
+
+static long timelib_lookup_month(char **ptr)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ long value = 0;
+ const timelib_lookup_table *tp;
+
+ while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ for (tp = timelib_month_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ value = tp->value;
+ }
+ }
+
+ free(word);
+ return value;
+}
+
+static long timelib_get_month(char **ptr)
+{
+ while (**ptr == ' ' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
+ ++*ptr;
+ }
+ return timelib_lookup_month(ptr);
+}
+
+static void timelib_eat_spaces(char **ptr)
+{
+ while (**ptr == ' ') {
+ ++*ptr;
+ }
+}
+
+static const timelib_relunit* timelib_lookup_relunit(char **ptr)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ const timelib_relunit *tp, *value = NULL;
+
+ while (**ptr != '\0' && **ptr != ' ') {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ for (tp = timelib_relunit_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ value = tp;
+ break;
+ }
+ }
+
+ free(word);
+ return value;
+}
+
+static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s)
+{
+ const timelib_relunit* relunit;
+
+ relunit = timelib_lookup_relunit(ptr);
+ switch (relunit->unit) {
+ case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
+ case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
+ case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
+ case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
+ case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
+ case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
+
+ case TIMELIB_WEEKDAY:
+ TIMELIB_HAVE_WEEKDAY_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+ s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
+ s->time->relative.weekday = relunit->multiplier;
+ s->time->relative.weekday_behavior = behavior;
+ break;
+ }
+}
+
+static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
+{
+ int first_found = 0;
+ timelib_tz_lookup_table *tp, *first_found_elem;
+ timelib_tz_lookup_table *fmp;
+
+ for (tp = timelib_timezone_lookup; tp->name; tp++) {
+ if (strcasecmp(word, tp->name) == 0) {
+ if (!first_found) {
+ first_found = 1;
+ first_found_elem = tp;
+ if (gmtoffset == -1) {
+ return tp;
+ }
+ }
+ if (tp->gmtoffset == gmtoffset) {
+ return tp;
+ }
+ }
+ }
+ if (first_found) {
+ return first_found_elem;
+ }
+ /* Still didn't find anything, let's find the zone solely based on
+ * offset/isdst then */
+ for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
+ if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) {
+ return fmp;
+ }
+ }
+ return NULL;
+}
+
+static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found)
+{
+ char *word;
+ char *begin = *ptr, *end;
+ long value = 0;
+ timelib_tz_lookup_table *tp;
+
+ while (**ptr != '\0' && **ptr != ')') {
+ ++*ptr;
+ }
+ end = *ptr;
+ word = calloc(1, end - begin + 1);
+ memcpy(word, begin, end - begin);
+
+ if ((tp = zone_search(word, -1, 0))) {
+ value = -tp->gmtoffset / 60;
+ *dst = tp->type;
+ value += tp->type * 60;
+ *found = 1;
+ } else {
+ *found = 0;
+ }
+
+ *tz_abbr = word;
+ return value;
+}
+
+static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb)
+{
+ timelib_tzinfo *res;
+ long retval = 0;
+
+ *tz_not_found = 0;
+
+ while (**ptr == ' ' || **ptr == '(') {
+ ++*ptr;
+ }
+ if (**ptr == '+') {
+ ++*ptr;
+ t->is_localtime = 1;
+ t->zone_type = TIMELIB_ZONETYPE_OFFSET;
+ *tz_not_found = 0;
+ t->dst = 0;
+
+ retval = -1 * timelib_parse_tz_cor(ptr);
+ } else if (**ptr == '-') {
+ ++*ptr;
+ t->is_localtime = 1;
+ t->zone_type = TIMELIB_ZONETYPE_OFFSET;
+ *tz_not_found = 0;
+ t->dst = 0;
+
+ retval = timelib_parse_tz_cor(ptr);
+ } else {
+ int found = 0;
+ long offset;
+ char *tz_abbr;
+
+ t->is_localtime = 1;
+ t->zone_type = TIMELIB_ZONETYPE_ABBR;
+
+ offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found);
+#if 0
+ /* If we found a TimeZone identifier, use it */
+ if (tz_name) {
+ t->tz_info = timelib_parse_tzfile(tz_name);
+ t->zone_type = TIMELIB_ZONETYPE_ID;
+ }
+#endif
+ /* If we have a TimeZone identifier to start with, use it */
+ if (strstr(tz_abbr, "/")) {
+ if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) {
+ t->tz_info = res;
+ t->zone_type = TIMELIB_ZONETYPE_ID;
+ found++;
+ }
+ }
+ if (t->zone_type != TIMELIB_ZONETYPE_ID) {
+ timelib_time_tz_abbr_update(t, tz_abbr);
+ }
+ free(tz_abbr);
+ *tz_not_found = (found == 0);
+ retval = offset;
+ }
+ while (**ptr == ')') {
+ ++*ptr;
+ }
+ return retval;
+}
+
+#define timelib_split_free(arg) { \
+ int i; \
+ for (i = 0; i < arg.c; i++) { \
+ free(arg.v[i]); \
+ } \
+ if (arg.v) { \
+ free(arg.v); \
+ } \
+}
+
+static int scan(Scanner *s)
+{
+ uchar *cursor = s->cur;
+ char *str, *ptr = NULL;
+
+std:
+ s->tok = cursor;
+ s->len = 0;
+/*!re2c
+any = [\000-\377];
+
+space = [ ]+;
+frac = "."[0-9]+;
+
+ago = 'ago';
+
+hour24 = [01]?[0-9] | "2"[0-3];
+hour24lz = [01][0-9] | "2"[0-3];
+hour12 = "0"?[1-9] | "1"[0-2];
+minute = [0-5]?[0-9];
+minutelz = [0-5][0-9];
+second = minute | "60";
+secondlz = minutelz | "60";
+meridian = [AaPp] "."? [Mm] "."?;
+tz = "("? [A-Za-z]{1,4} ")"? | [A-Z][a-z]+([_/][A-Z][a-z]+)+;
+tzcorrection = [+-] hour24 ":"? minutelz?;
+
+month = "0"? [0-9] | "1"[0-2];
+day = [0-2]?[0-9] | "3"[01];
+year = [0-9]{1,4};
+year2 = [0-9]{2};
+year4 = [0-9]{4};
+
+dayofyear = "00"[1-9] | "0"[1-9][0-9] | [1-2][0-9][0-9] | "3"[0-5][0-9] | "36"[0-6];
+weekofyear = "0"[1-9] | [1-4][0-9] | "5"[0-3];
+
+monthlz = "0" [1-9] | "1" [0-2];
+daylz = "0" [1-9] | [1-2][0-9] | "3" [01];
+
+dayfull = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
+dayabbr = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
+daytext = dayfull | dayabbr;
+
+monthfull = 'january' | 'february' | 'march' | 'april' | 'may' | 'june' | 'july' | 'august' | 'september' | 'october' | 'november' | 'december';
+monthabbr = 'jan' | 'feb' | 'mar' | 'apr' | 'may' | 'jun' | 'jul' | 'aug' | 'sep' | 'sept' | 'oct' | 'nov' | 'dec';
+monthroman = "I" | "II" | "III" | "IV" | "V" | "VI" | "VII" | "VIII" | "IX" | "X" | "XI" | "XII";
+monthtext = monthfull | monthabbr | monthroman;
+
+/* Time formats */
+timetiny12 = hour12 space? meridian;
+timeshort12 = hour12[:.]minutelz space? meridian;
+timelong12 = hour12[:.]minute[:.]secondlz space? meridian;
+
+timeshort24 = hour24[:.]minute;
+timelong24 = hour24[:.]minute[:.]second;
+iso8601long = hour24 [:.] minute [:.] second frac;
+
+/* iso8601shorttz = hour24 [:] minutelz space? (tzcorrection | tz); */
+iso8601normtz = hour24 [:.] minute [:.] secondlz space? (tzcorrection | tz);
+/* iso8601longtz = hour24 [:] minute [:] secondlz frac space? (tzcorrection | tz); */
+
+gnunocolon = hour24lz minutelz;
+/* gnunocolontz = hour24lz minutelz space? (tzcorrection | tz); */
+iso8601nocolon = hour24lz minutelz secondlz;
+/* iso8601nocolontz = hour24lz minutelz secondlz space? (tzcorrection | tz); */
+
+/* Date formats */
+americanshort = month "/" day;
+american = month "/" day "/" year;
+iso8601dateslash = year4 "/" monthlz "/" daylz "/"?;
+dateslash = year4 "/" month "/" day;
+gnudateshort = year "-" month "-" day;
+iso8601date = year4 "-" monthlz "-" daylz;
+pointeddate = day "." month "." year;
+datefull = day ([ -.])* monthtext ([ -.])* year;
+datenoday = monthtext ([ -.])* year4;
+datenodayrev = year4 ([ -.])* monthtext;
+datetextual = monthtext ([ -.])* day [,.stndrh ]* year;
+datenoyear = monthtext ([ -.])* day [,.stndrh ]*;
+datenoyearrev = day ([ -.])* monthtext;
+datenocolon = year4 monthlz daylz;
+
+/* Special formats */
+soap = year4 "-" monthlz "-" daylz "T" hour24lz ":" minutelz ":" secondlz frac tzcorrection;
+xmlrpc = year4 monthlz daylz "T" hour24 ":" minutelz ":" secondlz;
+xmlrpcnocolon = year4 monthlz daylz 't' hour24 minutelz secondlz;
+wddx = year4 "-" monthlz "-" daylz "T" hour24 ":" minutelz ":" secondlz;
+pgydotd = year4 "."? dayofyear;
+pgtextshort = monthabbr "-" daylz "-" year;
+pgtextreverse = year "-" monthabbr "-" daylz;
+isoweekday = year4 "W" weekofyear [0-7];
+isoweek = year4 "W" weekofyear;
+
+/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */
+clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection;
+
+/* Timestamp format: @1126396800 */
+timestamp = "@" "-"? [1-9] [0-9]*;
+
+/* To fix some ambiguities */
+dateshortwithtimeshort = datenoyear timeshort24;
+dateshortwithtimelong = datenoyear timelong24;
+dateshortwithtimelongtz = datenoyear iso8601normtz;
+
+/*
+ * Relative regexps
+ */
+reltextnumber = 'first'|'next'|'second'|'third'|'fourth'|'fifth'|'sixth'|'seventh'|'eight'|'ninth'|'tenth'|'eleventh'|'twelfth'|'last'|'previous'|'this';
+reltextunit = (('sec'|'second'|'min'|'minute'|'hour'|'day'|'week'|'fortnight'|'forthnight'|'month'|'year') 's'?) | dayfull;
+
+relnumber = ([+-]?[0-9]+);
+relative = (relnumber space? reltextunit)+;
+relativetext = (reltextnumber space? reltextunit)+;
+
+*/
+
+/*!re2c
+ /* so that vim highlights correctly */
+ "yesterday"
+ {
+ DEBUG_OUTPUT("yesterday");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+
+ s->time->relative.d = -1;
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+
+ "now"
+ {
+ DEBUG_OUTPUT("now");
+ TIMELIB_INIT;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+
+ "noon"
+ {
+ DEBUG_OUTPUT("noon");
+ TIMELIB_INIT;
+ TIMELIB_UNHAVE_TIME();
+ TIMELIB_HAVE_TIME();
+ s->time->h = 12;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+
+ "midnight" | "today"
+ {
+ DEBUG_OUTPUT("midnight | today");
+ TIMELIB_INIT;
+ TIMELIB_UNHAVE_TIME();
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+
+ "tomorrow"
+ {
+ DEBUG_OUTPUT("tomorrow");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+
+ s->time->relative.d = 1;
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+
+ timestamp
+ {
+ timelib_ull i;
+
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_UNHAVE_DATE();
+ TIMELIB_UNHAVE_TIME();
+
+ i = timelib_get_unsigned_nr((char **) &ptr, 24);
+ s->time->y = 1970;
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->h = s->time->i = s->time->s = 0;
+ s->time->f = 0.0;
+ s->time->relative.s += i;
+ s->time->is_localtime = 1;
+ s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
+ s->time->z = 0;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+
+ timetiny12 | timeshort12 | timelong12
+ {
+ DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':' || *ptr == '.') {
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':' || *ptr == '.') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+ }
+ }
+ s->time->h += timelib_meridian((char **) &ptr, s->time->h);
+ TIMELIB_DEINIT;
+ return TIMELIB_TIME12;
+ }
+
+ timeshort24 | timelong24 /* | iso8601short | iso8601norm */ | iso8601long /*| iso8601shorttz | iso8601normtz | iso8601longtz*/
+ {
+ int tz_not_found;
+ DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':' || *ptr == '.') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
+ }
+ }
+
+ if (*ptr != '\0') {
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_TIME24_WITH_ZONE;
+ }
+
+ gnunocolon
+ {
+ DEBUG_OUTPUT("gnunocolon");
+ TIMELIB_INIT;
+ switch (s->time->have_time) {
+ case 0:
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = 0;
+ break;
+ case 1:
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ break;
+ default:
+ TIMELIB_DEINIT;
+ return TIMELIB_ERROR;
+ }
+ s->time->have_time++;
+ TIMELIB_DEINIT;
+ return TIMELIB_GNU_NOCOLON;
+ }
+/*
+ gnunocolontz
+ {
+ DEBUG_OUTPUT("gnunocolontz");
+ TIMELIB_INIT;
+ switch (s->time->have_time) {
+ case 0:
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = 0;
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb);
+ break;
+ case 1:
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ break;
+ default:
+ TIMELIB_DEINIT;
+ return TIMELIB_ERROR;
+ }
+ s->time->have_time++;
+ TIMELIB_DEINIT;
+ return TIMELIB_GNU_NOCOLON_TZ;
+ }
+*/
+ iso8601nocolon /*| iso8601nocolontz*/
+ {
+ int tz_not_found;
+ DEBUG_OUTPUT("iso8601nocolon");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr != '\0') {
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_NOCOLON;
+ }
+
+ americanshort | american
+ {
+ DEBUG_OUTPUT("americanshort | american");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == '/') {
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_AMERICAN;
+ }
+
+ iso8601date | iso8601dateslash | dateslash
+ {
+ DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_DATE;
+ }
+
+ gnudateshort
+ {
+ DEBUG_OUTPUT("gnudateshort");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_DATE;
+ }
+
+ datefull
+ {
+ DEBUG_OUTPUT("datefull");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_FULL;
+ }
+
+ pointeddate
+ {
+ DEBUG_OUTPUT("pointed date");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_FULL_POINTED;
+ }
+
+ datenoday
+ {
+ DEBUG_OUTPUT("datenoday");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->d = 1;
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_NO_DAY;
+ }
+
+ datenodayrev
+ {
+ DEBUG_OUTPUT("datenodayrev");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = 1;
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_NO_DAY;
+ }
+
+ datetextual | datenoyear
+ {
+ DEBUG_OUTPUT("datetextual | datenoyear");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_TEXT;
+ }
+
+ datenoyearrev
+ {
+ DEBUG_OUTPUT("datenoyearrev");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_month((char **) &ptr);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_TEXT;
+ }
+
+ datenocolon
+ {
+ DEBUG_OUTPUT("datenocolon");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_NOCOLON;
+ }
+
+ xmlrpc | xmlrpcnocolon | soap | wddx
+ {
+ int tz_not_found;
+ DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_XMLRPC_SOAP;
+ }
+
+ pgydotd
+ {
+ DEBUG_OUTPUT("pgydotd");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->d = timelib_get_nr((char **) &ptr, 3);
+ s->time->m = 1;
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_PG_YEARDAY;
+ }
+
+ isoweekday
+ {
+ timelib_sll w, d;
+ DEBUG_OUTPUT("isoweekday");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ TIMELIB_HAVE_RELATIVE();
+
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ w = timelib_get_nr((char **) &ptr, 2);
+ d = timelib_get_nr((char **) &ptr, 1);
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
+
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_WEEK;
+ }
+
+ isoweek
+ {
+ timelib_sll w, d;
+ DEBUG_OUTPUT("isoweek");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ TIMELIB_HAVE_RELATIVE();
+
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ w = timelib_get_nr((char **) &ptr, 2);
+ d = 1;
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
+
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_WEEK;
+ }
+
+ pgtextshort
+ {
+ DEBUG_OUTPUT("pgtextshort");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_PG_TEXT;
+ }
+
+ pgtextreverse
+ {
+ DEBUG_OUTPUT("pgtextreverse");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_PG_TEXT;
+ }
+
+ clf
+ {
+ int tz_not_found;
+ DEBUG_OUTPUT("clf");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_TIME();
+ TIMELIB_HAVE_DATE();
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ TIMELIB_DEINIT;
+ return TIMELIB_CLF;
+ }
+
+ year4
+ {
+ DEBUG_OUTPUT("year4");
+ TIMELIB_INIT;
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ TIMELIB_DEINIT;
+ return TIMELIB_CLF;
+ }
+
+ ago
+ {
+ DEBUG_OUTPUT("ago");
+ TIMELIB_INIT;
+ s->time->relative.y = 0 - s->time->relative.y;
+ s->time->relative.m = 0 - s->time->relative.m;
+ s->time->relative.d = 0 - s->time->relative.d;
+ s->time->relative.h = 0 - s->time->relative.h;
+ s->time->relative.i = 0 - s->time->relative.i;
+ s->time->relative.s = 0 - s->time->relative.s;
+ s->time->relative.weekday = 0 - s->time->relative.weekday;
+ TIMELIB_DEINIT;
+ return TIMELIB_AGO;
+ }
+
+ relativetext
+ {
+ timelib_sll i;
+ int behavior;
+ DEBUG_OUTPUT("relativetext");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+
+ while(*ptr) {
+ i = timelib_get_relative_text((char **) &ptr, &behavior);
+ timelib_eat_spaces((char **) &ptr);
+ timelib_set_relative((char **) &ptr, i, behavior, s);
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+
+ dayfull
+ {
+ const timelib_relunit* relunit;
+ DEBUG_OUTPUT("dayfull");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+ TIMELIB_HAVE_WEEKDAY_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+
+ relunit = timelib_lookup_relunit((char**) &ptr);
+ s->time->relative.weekday = relunit->multiplier;
+ s->time->relative.weekday_behavior = 1;
+
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+
+ dayabbr
+ {
+ DEBUG_OUTPUT("dayabbr");
+ goto std;
+ }
+
+ tzcorrection | tz
+ {
+ int tz_not_found;
+ DEBUG_OUTPUT("tzcorrection | tz");
+ TIMELIB_INIT;
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ TIMELIB_DEINIT;
+ return TIMELIB_TIMEZONE;
+ }
+
+ dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz
+ {
+ int tz_not_found;
+ DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_get_month((char **) &ptr);
+ s->time->d = timelib_get_nr((char **) &ptr, 2);
+
+ TIMELIB_HAVE_TIME();
+ s->time->h = timelib_get_nr((char **) &ptr, 2);
+ s->time->i = timelib_get_nr((char **) &ptr, 2);
+ if (*ptr == ':') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
+ }
+ }
+
+ if (*ptr != '\0') {
+ s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
+ s->errors += tz_not_found;
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_SHORTDATE_WITH_TIME;
+ }
+
+ relative
+ {
+ timelib_ull i;
+ DEBUG_OUTPUT("relative");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_RELATIVE();
+
+ while(*ptr) {
+ i = timelib_get_unsigned_nr((char **) &ptr, 24);
+ timelib_eat_spaces((char **) &ptr);
+ timelib_set_relative((char **) &ptr, i, 0, s);
+ }
+ TIMELIB_DEINIT;
+ return TIMELIB_RELATIVE;
+ }
+
+ [ .,]
+ {
+ goto std;
+ }
+
+ "\000"|"\n"
+ {
+ s->pos = cursor; s->line++;
+ goto std;
+ }
+
+ any
+ {
+/* printf("unexpected character: #%d, %c ", *s->tok, *s->tok); */
+ s->errors++;
+ goto std;
+ }
+*/
+}
+
+/*!max:re2c */
+
+timelib_time* timelib_strtotime(char *s, int *errors, timelib_tzdb *tzdb)
+{
+ Scanner in;
+ int t;
+
+ memset(&in, 0, sizeof(in));
+ in.str = malloc(strlen(s) + YYMAXFILL);
+ memset(in.str, 0, strlen(s) + YYMAXFILL);
+ memcpy(in.str, s, strlen(s));
+ in.lim = in.str + strlen(s) + YYMAXFILL;
+ in.cur = in.str;
+ in.time = timelib_time_ctor();
+ in.time->y = -1;
+ in.time->d = -1;
+ in.time->m = -1;
+ in.time->h = -1;
+ in.time->i = -1;
+ in.time->s = -1;
+ in.time->f = -1;
+ in.time->z = -1;
+ in.time->dst = -1;
+ in.errors = 0;
+ in.tzdb = tzdb;
+ in.time->is_localtime = 0;
+ in.time->zone_type = 0;
+
+ do {
+ t = scan(&in);
+#ifdef DEBUG_PARSER
+ printf("%d\n", t);
+#endif
+ } while(t != EOI);
+
+ free(in.str);
+ *errors = in.errors;
+ return in.time;
+}
+
+void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
+{
+ if (!(options && TIMELIB_OVERRIDE_TIME) && parsed->have_date && !parsed->have_time) {
+ parsed->h = 0;
+ parsed->i = 0;
+ parsed->s = 0;
+ parsed->f = 0;
+ }
+ if (parsed->y == -1) parsed->y = now->y != -1 ? now->y : 0;
+ if (parsed->d == -1) parsed->d = now->d != -1 ? now->d : 0;
+ if (parsed->m == -1) parsed->m = now->m != -1 ? now->m : 0;
+ if (parsed->h == -1) parsed->h = now->h != -1 ? now->h : 0;
+ if (parsed->i == -1) parsed->i = now->i != -1 ? now->i : 0;
+ if (parsed->s == -1) parsed->s = now->s != -1 ? now->s : 0;
+ if (parsed->f == -1) parsed->f = now->f != -1 ? now->f : 0;
+ if (parsed->z == -1) parsed->z = now->z != -1 ? now->z : 0;
+ if (parsed->dst == -1) parsed->dst = now->dst != -1 ? now->dst : 0;
+
+ if (!parsed->tz_abbr) {
+ parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
+ }
+ if (!parsed->tz_info) {
+ parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL;
+ }
+ if (parsed->zone_type == 0 && now->zone_type != 0) {
+ parsed->zone_type = now->zone_type;
+/* parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
+ parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL;
+*/ parsed->is_localtime = 1;
+ }
+/* timelib_dump_date(parsed, 2);
+ timelib_dump_date(now, 2);
+*/
+}
+
+char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
+{
+ timelib_tz_lookup_table *tp;
+
+ tp = zone_search(abbr, gmtoffset, isdst);
+ if (tp) {
+ return (tp->full_tz_name);
+ } else {
+ return NULL;
+ }
+}
+
+timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void)
+{
+ return timelib_timezone_lookup;
+}
+
+#ifdef DEBUG_PARSER_STUB
+int main(void)
+{
+ timelib_time time = timelib_strtotime("May 12");
+
+ printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d",
+ time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
+ if (time.have_relative) {
+ printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
+ time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s);
+ }
+ if (time.have_weekday_relative) {
+ printf (" / %d", time.relative.weekday);
+ }
+ if (time.have_weeknr_day) {
+ printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);
+ }
+ return 0;
+}
+#endif
+
+/*
+ * vim: syntax=c
+ */
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
new file mode 100644
index 000000000..61b07f042
--- /dev/null
+++ b/ext/date/lib/parse_tz.c
@@ -0,0 +1,360 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: parse_tz.c,v 1.20.2.2 2005/10/03 11:17:24 derick Exp $ */
+
+#include "timelib.h"
+
+#include <stdio.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include "timezonedb.h"
+
+#ifdef WORDS_BIGENDIAN
+#define timelib_conv_int(l) (l)
+#else
+#define timelib_conv_int(l) ((l & 0x000000ff) << 24) + ((l & 0x0000ff00) << 8) + ((l & 0x00ff0000) >> 8) + ((l & 0xff000000) >> 24)
+#endif
+
+static void read_header(char **tzf, timelib_tzinfo *tz)
+{
+ uint32_t buffer[6];
+
+ memcpy(&buffer, *tzf, sizeof(buffer));
+ tz->ttisgmtcnt = timelib_conv_int(buffer[0]);
+ tz->ttisstdcnt = timelib_conv_int(buffer[1]);
+ tz->leapcnt = timelib_conv_int(buffer[2]);
+ tz->timecnt = timelib_conv_int(buffer[3]);
+ tz->typecnt = timelib_conv_int(buffer[4]);
+ tz->charcnt = timelib_conv_int(buffer[5]);
+ *tzf += sizeof(buffer);
+}
+
+static void read_transistions(char **tzf, timelib_tzinfo *tz)
+{
+ int32_t *buffer = NULL;
+ uint32_t i;
+ unsigned char *cbuffer = NULL;
+
+ if (tz->timecnt) {
+ buffer = (int32_t*) malloc(tz->timecnt * sizeof(int32_t));
+ if (!buffer) {
+ return;
+ }
+ memcpy(buffer, *tzf, sizeof(int32_t) * tz->timecnt);
+ *tzf += (sizeof(int32_t) * tz->timecnt);
+ for (i = 0; i < tz->timecnt; i++) {
+ buffer[i] = timelib_conv_int(buffer[i]);
+ }
+
+ cbuffer = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
+ if (!cbuffer) {
+ return;
+ }
+ memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt);
+ *tzf += sizeof(unsigned char) * tz->timecnt;
+ }
+
+ tz->trans = buffer;
+ tz->trans_idx = cbuffer;
+}
+
+static void read_types(char **tzf, timelib_tzinfo *tz)
+{
+ unsigned char *buffer;
+ int32_t *leap_buffer;
+ unsigned int i, j;
+
+ buffer = (unsigned char*) malloc(tz->typecnt * sizeof(unsigned char) * 6);
+ if (!buffer) {
+ return;
+ }
+ memcpy(buffer, *tzf, sizeof(unsigned char) * 6 * tz->typecnt);
+ *tzf += sizeof(unsigned char) * 6 * tz->typecnt;
+
+ tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo));
+ if (!tz->type) {
+ return;
+ }
+
+ for (i = 0; i < tz->typecnt; i++) {
+ j = i * 6;
+ tz->type[i].offset = (buffer[j] * 16777216) + (buffer[j + 1] * 65536) + (buffer[j + 2] * 256) + buffer[j + 3];
+ tz->type[i].isdst = buffer[j + 4];
+ tz->type[i].abbr_idx = buffer[j + 5];
+ }
+ free(buffer);
+
+ tz->timezone_abbr = (char*) malloc(tz->charcnt);
+ if (!tz->timezone_abbr) {
+ return;
+ }
+ memcpy(tz->timezone_abbr, *tzf, sizeof(char) * tz->charcnt);
+ *tzf += sizeof(char) * tz->charcnt;
+
+ leap_buffer = (int32_t *) malloc(tz->leapcnt * 2 * sizeof(int32_t));
+ if (!leap_buffer) {
+ return;
+ }
+ memcpy(leap_buffer, *tzf, sizeof(int32_t) * tz->leapcnt * 2);
+ *tzf += sizeof(int32_t) * tz->leapcnt * 2;
+
+ tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
+ if (!tz->leap_times) {
+ return;
+ }
+ for (i = 0; i < tz->leapcnt; i++) {
+ tz->leap_times[i].trans = timelib_conv_int(leap_buffer[i * 2]);
+ tz->leap_times[i].offset = timelib_conv_int(leap_buffer[i * 2 + 1]);
+ }
+ free(leap_buffer);
+
+ buffer = (unsigned char*) malloc(tz->ttisstdcnt * sizeof(unsigned char));
+ if (!buffer) {
+ return;
+ }
+ memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisstdcnt);
+ *tzf += sizeof(unsigned char) * tz->ttisstdcnt;
+
+ for (i = 0; i < tz->ttisstdcnt; i++) {
+ tz->type[i].isstdcnt = buffer[i];
+ }
+ free(buffer);
+
+ buffer = (unsigned char*) malloc(tz->ttisgmtcnt * sizeof(unsigned char));
+ if (!buffer) {
+ return;
+ }
+ memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisgmtcnt);
+ *tzf += sizeof(unsigned char) * tz->ttisgmtcnt;
+
+ for (i = 0; i < tz->ttisgmtcnt; i++) {
+ tz->type[i].isgmtcnt = buffer[i];
+ }
+ free(buffer);
+}
+
+void timelib_dump_tzinfo(timelib_tzinfo *tz)
+{
+ uint32_t i;
+
+ printf("UTC/Local count: %lu\n", (unsigned long) tz->ttisgmtcnt);
+ printf("Std/Wall count: %lu\n", (unsigned long) tz->ttisstdcnt);
+ printf("Leap.sec. count: %lu\n", (unsigned long) tz->leapcnt);
+ printf("Trans. count: %lu\n", (unsigned long) tz->timecnt);
+ printf("Local types count: %lu\n", (unsigned long) tz->typecnt);
+ printf("Zone Abbr. count: %lu\n", (unsigned long) tz->charcnt);
+
+ printf ("%8s (%12s) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n",
+ "", "", 0,
+ (long int) tz->type[0].offset,
+ tz->type[0].isdst,
+ tz->type[0].abbr_idx,
+ &tz->timezone_abbr[tz->type[0].abbr_idx],
+ tz->type[0].isstdcnt,
+ tz->type[0].isgmtcnt
+ );
+ for (i = 0; i < tz->timecnt; i++) {
+ printf ("%08X (%12d) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n",
+ tz->trans[i], tz->trans[i], tz->trans_idx[i],
+ (long int) tz->type[tz->trans_idx[i]].offset,
+ tz->type[tz->trans_idx[i]].isdst,
+ tz->type[tz->trans_idx[i]].abbr_idx,
+ &tz->timezone_abbr[tz->type[tz->trans_idx[i]].abbr_idx],
+ tz->type[tz->trans_idx[i]].isstdcnt,
+ tz->type[tz->trans_idx[i]].isgmtcnt
+ );
+ }
+ for (i = 0; i < tz->leapcnt; i++) {
+ printf ("%08X (%12ld) = %d\n",
+ tz->leap_times[i].trans,
+ (long) tz->leap_times[i].trans,
+ tz->leap_times[i].offset);
+ }
+}
+
+static int tz_search(char *timezone, int left, int right, timelib_tzdb *tzdb)
+{
+ int mid, cmp;
+
+ if (left > right) {
+ return -1; /* not found */
+ }
+
+ mid = (left + right) / 2;
+
+ cmp = strcasecmp(timezone, tzdb->index[mid].id);
+ if (cmp < 0) {
+ return tz_search(timezone, left, mid - 1, tzdb);
+ } else if (cmp > 0) {
+ return tz_search(timezone, mid + 1, right, tzdb);
+ } else { /* (cmp == 0) */
+ return tzdb->index[mid].pos;
+ }
+}
+
+
+static int seek_to_tz_position(char **tzf, char *timezone, timelib_tzdb *tzdb)
+{
+ int pos;
+
+ pos = tz_search(timezone, 0, tzdb->index_size, tzdb);
+
+ if (pos == -1) {
+ return 0;
+ }
+
+ (*tzf) = &(tzdb->data[pos + 20]);
+ return 1;
+}
+
+timelib_tzdb *timelib_builtin_db(void)
+{
+ return &timezonedb_builtin;
+}
+
+timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count)
+{
+ *count = sizeof(timezonedb_idx_builtin) / sizeof(*timezonedb_idx_builtin);
+ return timezonedb_idx_builtin;
+}
+
+timelib_tzinfo *timelib_parse_tzfile(char *timezone, timelib_tzdb *tzdb)
+{
+ char *tzf;
+ timelib_tzinfo *tmp;
+
+ if (seek_to_tz_position((char**) &tzf, timezone, tzdb)) {
+ tmp = timelib_tzinfo_ctor(timezone);
+
+ read_header((char**) &tzf, tmp);
+ read_transistions((char**) &tzf, tmp);
+ read_types((char**) &tzf, tmp);
+ } else {
+ tmp = NULL;
+ }
+
+ return tmp;
+}
+
+static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib_sll *transition_time)
+{
+ uint32_t i;
+
+ /* If there is no transistion time, we pick the first one, if that doesn't
+ * exist we return NULL */
+ if (!tz->timecnt || !tz->trans) {
+ *transition_time = 0;
+ if (tz->typecnt == 1) {
+ return &(tz->type[0]);
+ }
+ return NULL;
+ }
+
+ /* If the TS is lower than the first transistion time, then we scan over
+ * all the transistion times to find the first non-DST one, or the first
+ * one in case there are only DST entries. Not sure which smartass came up
+ * with this idea in the first though :) */
+ if (ts < tz->trans[0]) {
+ uint32_t j;
+
+ *transition_time = 0;
+ j = 0;
+ while (j < tz->timecnt && tz->type[j].isdst) {
+ ++j;
+ }
+ if (j == tz->timecnt) {
+ j = 0;
+ }
+ return &(tz->type[j]);
+ }
+
+ /* In all other cases we loop through the available transtion times to find
+ * the correct entry */
+ for (i = 0; i < tz->timecnt; i++) {
+ if (ts < tz->trans[i]) {
+ *transition_time = tz->trans[i - 1];
+ return &(tz->type[tz->trans_idx[i - 1]]);
+ }
+ }
+ *transition_time = tz->trans[tz->timecnt - 1];
+ return &(tz->type[tz->trans_idx[tz->timecnt - 1]]);
+}
+
+static tlinfo* fetch_leaptime_offset(timelib_tzinfo *tz, timelib_sll ts)
+{
+ int i;
+
+ if (!tz->leapcnt || !tz->leap_times) {
+ return NULL;
+ }
+
+ for (i = tz->leapcnt - 1; i > 0; i--) {
+ if (ts > tz->leap_times[i].trans) {
+ return &(tz->leap_times[i]);
+ }
+ }
+ return NULL;
+}
+
+int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz)
+{
+ ttinfo *to;
+ timelib_sll dummy;
+
+ if ((to = fetch_timezone_offset(tz, ts, &dummy))) {
+ return to->isdst;
+ }
+ return -1;
+}
+
+timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo *tz)
+{
+ ttinfo *to;
+ tlinfo *tl;
+ int32_t offset = 0, leap_secs = 0;
+ char *abbr;
+ timelib_time_offset *tmp = timelib_time_offset_ctor();
+ timelib_sll transistion_time;
+
+ if ((to = fetch_timezone_offset(tz, ts, &transistion_time))) {
+ offset = to->offset;
+ abbr = &(tz->timezone_abbr[to->abbr_idx]);
+ tmp->is_dst = to->isdst;
+ tmp->transistion_time = transistion_time;
+ } else {
+ offset = 0;
+ abbr = tz->timezone_abbr;
+ tmp->is_dst = 0;
+ tmp->transistion_time = 0;
+ }
+
+ if ((tl = fetch_leaptime_offset(tz, ts))) {
+ leap_secs = -tl->offset;
+ }
+
+ tmp->offset = offset;
+ tmp->leap_secs = leap_secs;
+ tmp->abbr = abbr ? strdup(abbr) : strdup("GMT");
+
+ return tmp;
+}
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
new file mode 100644
index 000000000..7129aa788
--- /dev/null
+++ b/ext/date/lib/timelib.c
@@ -0,0 +1,188 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: timelib.c,v 1.7.2.1 2005/10/19 21:08:32 derick Exp $ */
+
+#include "timelib.h"
+#include <ctype.h>
+
+#define TIMELIB_TIME_FREE(m) \
+ if (m) { \
+ free(m); \
+ m = NULL; \
+ } \
+
+timelib_time* timelib_time_ctor()
+{
+ timelib_time *t;
+ t = calloc(1, sizeof(timelib_time));
+
+ return t;
+}
+
+void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr)
+{
+ unsigned int i;
+
+ TIMELIB_TIME_FREE(tm->tz_abbr);
+ tm->tz_abbr = strdup(tz_abbr);
+ for (i = 0; i < strlen(tz_abbr); i++) {
+ tm->tz_abbr[i] = toupper(tz_abbr[i]);
+ }
+}
+
+void timelib_time_dtor(timelib_time* t)
+{
+ TIMELIB_TIME_FREE(t->tz_abbr);
+ TIMELIB_TIME_FREE(t);
+}
+
+timelib_time_offset* timelib_time_offset_ctor()
+{
+ timelib_time_offset *t;
+ t = calloc(1, sizeof(timelib_time_offset));
+
+ return t;
+}
+
+void timelib_time_offset_dtor(timelib_time_offset* t)
+{
+ TIMELIB_TIME_FREE(t->abbr);
+ TIMELIB_TIME_FREE(t);
+}
+
+timelib_tzinfo* timelib_tzinfo_ctor(char *name)
+{
+ timelib_tzinfo *t;
+ t = calloc(1, sizeof(timelib_tzinfo));
+ t->name = strdup(name);
+
+ return t;
+}
+
+timelib_tzinfo *timelib_tzinfo_clone(timelib_tzinfo *tz)
+{
+ timelib_tzinfo *tmp = timelib_tzinfo_ctor(tz->name);
+ tmp->ttisgmtcnt = tz->ttisgmtcnt;
+ tmp->ttisstdcnt = tz->ttisstdcnt;
+ tmp->leapcnt = tz->leapcnt;
+ tmp->timecnt = tz->timecnt;
+ tmp->typecnt = tz->typecnt;
+ tmp->charcnt = tz->charcnt;
+
+ tmp->trans = (int32_t *) malloc(tz->timecnt * sizeof(int32_t));
+ tmp->trans_idx = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
+ memcpy(tmp->trans, tz->trans, tz->timecnt * sizeof(int32_t));
+ memcpy(tmp->trans_idx, tz->trans_idx, tz->timecnt * sizeof(unsigned char));
+
+ tmp->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo));
+ memcpy(tmp->type, tz->type, tz->typecnt * sizeof(struct ttinfo));
+
+ tmp->timezone_abbr = (char*) malloc(tz->charcnt);
+ memcpy(tmp->timezone_abbr, tz->timezone_abbr, tz->charcnt);
+
+ tmp->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
+ memcpy(tmp->leap_times, tz->leap_times, tz->leapcnt * sizeof(tlinfo));
+
+ return tmp;
+}
+
+void timelib_tzinfo_dtor(timelib_tzinfo *tz)
+{
+ TIMELIB_TIME_FREE(tz->name);
+ TIMELIB_TIME_FREE(tz->trans);
+ TIMELIB_TIME_FREE(tz->trans_idx);
+ TIMELIB_TIME_FREE(tz->type);
+ TIMELIB_TIME_FREE(tz->timezone_abbr);
+ TIMELIB_TIME_FREE(tz->leap_times);
+ TIMELIB_TIME_FREE(tz);
+}
+
+char *timelib_get_tz_abbr_ptr(timelib_time *t)
+{
+ if (!t->sse_uptodate) {
+ timelib_update_ts(t, NULL);
+ };
+ return t->tz_abbr;
+}
+
+signed long timelib_date_to_int(timelib_time *d, int *error)
+{
+ timelib_sll ts;
+
+ ts = d->sse;
+
+ if (ts < LONG_MIN || ts > LONG_MAX) {
+ if (error) {
+ *error = 1;
+ }
+ return 0;
+ }
+ if (error) {
+ *error = 0;
+ }
+ return (signed long) d->sse;
+}
+
+void timelib_dump_date(timelib_time *d, int options)
+{
+ if ((options & 2) == 2) {
+ printf("TYPE: %d ", d->zone_type);
+ }
+ printf("TS: %lld | %04lld-%02lld-%02lld %02lld:%02lld:%02lld",
+ d->sse, d->y, d->m, d->d, d->h, d->i, d->s);
+ if (d->f > +0.0) {
+ printf(" %.5f", d->f);
+ }
+
+ if (d->is_localtime) {
+ switch (d->zone_type) {
+ case TIMELIB_ZONETYPE_OFFSET: /* Only offset */
+ printf(" GMT %05d%s", d->z, d->dst == 1 ? " (DST)" : "");
+ break;
+ case TIMELIB_ZONETYPE_ID: /* Timezone struct */
+ /* Show abbreviation if wanted */
+ if (d->tz_abbr) {
+ printf(" %s", d->tz_abbr);
+ }
+ /* Do we have a TimeZone struct? */
+ if (d->tz_info) {
+ printf(" %s", d->tz_info->name);
+ }
+ break;
+ case TIMELIB_ZONETYPE_ABBR:
+ printf(" %s", d->tz_abbr);
+ printf(" %05d%s", d->z, d->dst == 1 ? " (DST)" : "");
+ break;
+ }
+ } else {
+ printf(" GMT 00000");
+ }
+
+ if ((options & 1) == 1) {
+ if (d->have_relative) {
+ printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS",
+ d->relative.y, d->relative.m, d->relative.d, d->relative.h, d->relative.i, d->relative.s);
+ }
+ if (d->have_weekday_relative) {
+ printf(" / %d.%d", d->relative.weekday, d->relative.weekday_behavior);
+ }
+ }
+ printf("\n");
+}
+
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
new file mode 100644
index 000000000..bffb8d7b5
--- /dev/null
+++ b/ext/date/lib/timelib.h
@@ -0,0 +1,90 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: timelib.h,v 1.10.2.4 2005/10/03 11:17:24 derick Exp $ */
+
+#ifndef __TIMELIB_H__
+#define __TIMELIB_H__
+
+#include "timelib_structs.h"
+
+#define TIMELIB_NONE 0x00
+#define TIMELIB_OVERRIDE_TIME 0x01
+
+#ifndef LONG_MAX
+#define LONG_MAX 2147483647L
+#endif
+
+#ifndef LONG_MIN
+#define LONG_MIN (- LONG_MAX - 1)
+#endif
+
+#if defined(_MSC_VER) && !defined(strcasecmp)
+#define strcasecmp stricmp
+#endif
+
+/* From dow.c */
+timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d);
+timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d);
+timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d);
+timelib_sll timelib_daynr_from_weeknr(timelib_sll y, timelib_sll w, timelib_sll d);
+timelib_sll timelib_days_in_month(timelib_sll y, timelib_sll m);
+void timelib_isoweek_from_date(timelib_sll y, timelib_sll m, timelib_sll d, timelib_sll *iw, timelib_sll *iy);
+
+/* From parse_date.re */
+timelib_time *timelib_strtotime(char *s, int *errors, timelib_tzdb *tzdb);
+void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options);
+char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst);
+timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void);
+
+/* From tm2unixtime.c */
+void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi);
+
+/* From unixtime2tm.c */
+int timelib_apply_localtime(timelib_time *t, unsigned int localtime);
+void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts);
+void timelib_unixtime2local(timelib_time *tm, timelib_sll ts, timelib_tzinfo* tz);
+void timelib_update_from_sse(timelib_time *tm);
+void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz);
+
+/* From parse_tz.c */
+timelib_tzinfo *timelib_parse_tzfile(char *timezone, timelib_tzdb *tzdb);
+int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz);
+timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo *tz);
+void timelib_dump_tzinfo(timelib_tzinfo *tz);
+timelib_tzdb *timelib_builtin_db(void);
+timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count);
+
+/* From timelib.c */
+timelib_tzinfo* timelib_tzinfo_ctor();
+void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr);
+void timelib_time_tz_name_update(timelib_time* tm, char* tz_name);
+void timelib_tzinfo_dtor(timelib_tzinfo *tz);
+timelib_tzinfo* timelib_tzinfo_clone(timelib_tzinfo *tz);
+
+timelib_time* timelib_time_ctor();
+void timelib_time_set_option(timelib_time* tm, int option, void* option_value);
+void timelib_time_dtor(timelib_time* t);
+
+timelib_time_offset* timelib_time_offset_ctor();
+void timelib_time_offset_dtor(timelib_time_offset* t);
+
+signed long timelib_date_to_int(timelib_time *d, int *error);
+void timelib_dump_date(timelib_time *d, int options);
+
+#endif
diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4
new file mode 100644
index 000000000..c3b3a06d9
--- /dev/null
+++ b/ext/date/lib/timelib.m4
@@ -0,0 +1,80 @@
+dnl
+dnl $Id: timelib.m4,v 1.4 2005/07/03 23:30:52 sniper Exp $
+dnl
+dnl
+dnl TL_DEF_HAVE(what [, why])
+dnl
+dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [WHY])'
+dnl
+AC_DEFUN([TL_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___),1,[ $2 ])])dnl
+
+dnl
+dnl TL_CHECK_INT_TYPE(type)
+dnl
+AC_DEFUN([TL_CHECK_INT_TYPE],[
+AC_CACHE_CHECK([for $1], ac_cv_int_type_$1, [
+AC_TRY_COMPILE([
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#elif HAVE_STDINT_H
+# include <stdint.h>
+#endif],
+[if (($1 *) 0)
+ return 0;
+if (sizeof ($1))
+ return 0;
+], [ac_cv_int_type_$1=yes], [ac_cv_int_type_$1=no])
+])
+if test "$ac_cv_int_type_$1" = "yes"; then
+ TL_DEF_HAVE($1, [Define if $1 type is present.])
+fi
+])dnl
+
+dnl
+dnl AC_TIMELIB_C_BIGENDIAN
+dnl Replacement macro for AC_C_BIGENDIAN
+dnl
+AC_DEFUN([AC_TIMELIB_C_BIGENDIAN],
+[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
+ [
+ ac_cv_c_bigendian_php=unknown
+ AC_TRY_RUN(
+ [
+int main(void)
+{
+ short one = 1;
+ char *cp = (char *)&one;
+
+ if (*cp == 0) {
+ return(0);
+ } else {
+ return(1);
+ }
+}
+ ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
+ ])
+ if test $ac_cv_c_bigendian_php = yes; then
+ AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
+ fi
+])dnl
+
+dnl Check for types, sizes, etc. needed by timelib
+AC_CHECK_SIZEOF(long, 8)
+AC_CHECK_SIZEOF(int, 4)
+TL_CHECK_INT_TYPE(int32_t)
+TL_CHECK_INT_TYPE(uint32_t)
+
+dnl Check for headers needed by timelib
+AC_CHECK_HEADERS([ \
+sys/types.h \
+inttypes.h \
+stdint.h \
+string.h \
+stdlib.h
+])
+
+dnl Check for strtoll, atoll
+AC_CHECK_FUNCS(strtoll atoll strftime)
diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h
new file mode 100644
index 000000000..7f9436820
--- /dev/null
+++ b/ext/date/lib/timelib_structs.h
@@ -0,0 +1,181 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: timelib_structs.h,v 1.13.2.4 2005/10/19 21:08:32 derick Exp $ */
+
+#ifndef __TIMELIB_STRUCTS_H__
+#define __TIMELIB_STRUCTS_H__
+
+#include <timelib_config.h>
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
+
+#ifndef HAVE_INT32_T
+# if SIZEOF_INT == 4
+typedef int int32_t;
+# elif SIZEOF_LONG == 4
+typedef long int int32_t;
+# endif
+#endif
+
+#ifndef HAVE_UINT32_T
+# if SIZEOF_INT == 4
+typedef unsigned int uint32_t;
+# elif SIZEOF_LONG == 4
+typedef unsigned long int uint32_t;
+# endif
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if defined(_MSC_VER)
+typedef unsigned __int64 timelib_ull;
+typedef __int64 timelib_sll;
+#else
+typedef unsigned long long timelib_ull;
+typedef signed long long timelib_sll;
+#endif
+
+#if defined(_MSC_VER)
+#define int32_t __int32
+#define uint32_t unsigned __int32
+#endif
+
+typedef struct ttinfo
+{
+ int32_t offset;
+ int isdst;
+ unsigned int abbr_idx;
+
+ unsigned int isstdcnt;
+ unsigned int isgmtcnt;
+} ttinfo;
+
+typedef struct tlinfo
+{
+ int32_t trans;
+ int32_t offset;
+} tlinfo;
+
+typedef struct timelib_tzinfo
+{
+ char *name;
+ uint32_t ttisgmtcnt;
+ uint32_t ttisstdcnt;
+ uint32_t leapcnt;
+ uint32_t timecnt;
+ uint32_t typecnt;
+ uint32_t charcnt;
+
+ int32_t *trans;
+ unsigned char *trans_idx;
+
+ ttinfo *type;
+ char *timezone_abbr;
+
+ tlinfo *leap_times;
+} timelib_tzinfo;
+
+typedef struct timelib_rel_time {
+ timelib_sll y, m, d; /* Years, Months and Days */
+ timelib_sll h, i, s; /* Hours, mInutes and Seconds */
+
+ int weekday; /* Stores the day in 'next monday' */
+ int weekday_behavior; /* 0: the current day should *not* be counted when advancing forwards; 1: the current day *should* be counted */
+} timelib_rel_time;
+
+typedef struct timelib_time_offset {
+ int32_t offset;
+ unsigned int leap_secs;
+ unsigned int is_dst;
+ char *abbr;
+ timelib_sll transistion_time;
+} timelib_time_offset;
+
+typedef struct timelib_time {
+ timelib_sll y, m, d; /* Year, Month, Day */
+ timelib_sll h, i, s; /* Hour, mInute, Second */
+ double f; /* Fraction */
+ int z; /* GMT offset in minutes */
+ char *tz_abbr; /* Timezone abbreviation (display only) */
+ timelib_tzinfo *tz_info; /* Timezone structure */
+ signed int dst; /* Flag if we were parsing a DST zone */
+ timelib_rel_time relative;
+
+ timelib_sll sse; /* Seconds since epoch */
+
+ unsigned int have_time, have_date, have_zone, have_relative, have_weekday_relative, have_weeknr_day;
+
+ unsigned int sse_uptodate; /* !0 if the sse member is up to date with the date/time members */
+ unsigned int tim_uptodate; /* !0 if the date/time members are up to date with the sse member */
+ unsigned int is_localtime; /* 1 if the current struct represents localtime, 0 if it is in GMT */
+ unsigned int zone_type; /* 1 time offset,
+ * 3 TimeZone identifier,
+ * 2 TimeZone abbreviation */
+} timelib_time;
+
+typedef struct _timelib_tz_lookup_table {
+ char *name;
+ int type;
+ int gmtoffset;
+ char *full_tz_name;
+} timelib_tz_lookup_table;
+
+typedef struct _timelib_tzdb_index_entry {
+ char *id;
+ unsigned int pos;
+} timelib_tzdb_index_entry;
+
+typedef struct _timelib_tzdb {
+ char *version;
+ int index_size;
+ timelib_tzdb_index_entry *index;
+ char *data;
+} timelib_tzdb;
+
+#define TIMELIB_ZONETYPE_OFFSET 1
+#define TIMELIB_ZONETYPE_ABBR 2
+#define TIMELIB_ZONETYPE_ID 3
+
+#define SECS_PER_DAY 86400
+#define DAYS_PER_YEAR 365
+#define DAYS_PER_LYEAR 366
+
+#define timelib_is_leap(y) ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
+
+#define DEBUG(s) if (0) { s }
+
+#endif
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h
new file mode 100644
index 000000000..c87838209
--- /dev/null
+++ b/ext/date/lib/timezonedb.h
@@ -0,0 +1,16437 @@
+timelib_tzdb_index_entry timezonedb_idx_builtin[535] = {
+ { "Africa/Abidjan" , 0x000000 },
+ { "Africa/Accra" , 0x000049 },
+ { "Africa/Addis_Ababa" , 0x0000E5 },
+ { "Africa/Algiers" , 0x00012F },
+ { "Africa/Asmera" , 0x00024E },
+ { "Africa/Bamako" , 0x000298 },
+ { "Africa/Bangui" , 0x0002F7 },
+ { "Africa/Banjul" , 0x000340 },
+ { "Africa/Bissau" , 0x0003AB },
+ { "Africa/Blantyre" , 0x000405 },
+ { "Africa/Brazzaville" , 0x00044E },
+ { "Africa/Bujumbura" , 0x000497 },
+ { "Africa/Cairo" , 0x0004CF },
+ { "Africa/Casablanca" , 0x00088A },
+ { "Africa/Ceuta" , 0x000946 },
+ { "Africa/Conakry" , 0x000C32 },
+ { "Africa/Dakar" , 0x000C91 },
+ { "Africa/Dar_es_Salaam" , 0x000CEB },
+ { "Africa/Djibouti" , 0x000D4C },
+ { "Africa/Douala" , 0x000D95 },
+ { "Africa/El_Aaiun" , 0x000DDE },
+ { "Africa/Freetown" , 0x000E38 },
+ { "Africa/Gaborone" , 0x000F3B },
+ { "Africa/Harare" , 0x000F8A },
+ { "Africa/Johannesburg" , 0x000FD3 },
+ { "Africa/Kampala" , 0x001035 },
+ { "Africa/Khartoum" , 0x0010A8 },
+ { "Africa/Kigali" , 0x0011AF },
+ { "Africa/Kinshasa" , 0x0011F8 },
+ { "Africa/Lagos" , 0x001230 },
+ { "Africa/Libreville" , 0x001279 },
+ { "Africa/Lome" , 0x0012C2 },
+ { "Africa/Luanda" , 0x0012FA },
+ { "Africa/Lubumbashi" , 0x001343 },
+ { "Africa/Lusaka" , 0x00137B },
+ { "Africa/Malabo" , 0x0013C4 },
+ { "Africa/Maputo" , 0x00141E },
+ { "Africa/Maseru" , 0x001467 },
+ { "Africa/Mbabane" , 0x0014C3 },
+ { "Africa/Mogadishu" , 0x00150D },
+ { "Africa/Monrovia" , 0x00155C },
+ { "Africa/Nairobi" , 0x0015B6 },
+ { "Africa/Ndjamena" , 0x001629 },
+ { "Africa/Niamey" , 0x001689 },
+ { "Africa/Nouakchott" , 0x0016F0 },
+ { "Africa/Ouagadougou" , 0x00174F },
+ { "Africa/Porto-Novo" , 0x001798 },
+ { "Africa/Sao_Tome" , 0x0017F2 },
+ { "Africa/Timbuktu" , 0x00183B },
+ { "Africa/Tripoli" , 0x00189A },
+ { "Africa/Tunis" , 0x001988 },
+ { "Africa/Windhoek" , 0x001A70 },
+ { "America/Adak" , 0x001CAB },
+ { "America/Anchorage" , 0x002005 },
+ { "America/Anguilla" , 0x00235D },
+ { "America/Antigua" , 0x0023A6 },
+ { "America/Araguaina" , 0x002400 },
+ { "America/Argentina/Buenos_Aires" , 0x002546 },
+ { "America/Argentina/Catamarca" , 0x0026BF },
+ { "America/Argentina/ComodRivadavia" , 0x00284F },
+ { "America/Argentina/Cordoba" , 0x0029DF },
+ { "America/Argentina/Jujuy" , 0x002B65 },
+ { "America/Argentina/La_Rioja" , 0x002CF9 },
+ { "America/Argentina/Mendoza" , 0x002E8E },
+ { "America/Argentina/Rio_Gallegos" , 0x00302C },
+ { "America/Argentina/San_Juan" , 0x0031BC },
+ { "America/Argentina/Tucuman" , 0x003351 },
+ { "America/Argentina/Ushuaia" , 0x0034E1 },
+ { "America/Aruba" , 0x003671 },
+ { "America/Asuncion" , 0x0036CB },
+ { "America/Atka" , 0x0039A4 },
+ { "America/Bahia" , 0x003CFE },
+ { "America/Barbados" , 0x003E76 },
+ { "America/Belem" , 0x003F04 },
+ { "America/Belize" , 0x003FE6 },
+ { "America/Boa_Vista" , 0x004156 },
+ { "America/Bogota" , 0x00424C },
+ { "America/Boise" , 0x0042AC },
+ { "America/Buenos_Aires" , 0x00460E },
+ { "America/Cambridge_Bay" , 0x004787 },
+ { "America/Campo_Grande" , 0x004A8A },
+ { "America/Cancun" , 0x004D5B },
+ { "America/Caracas" , 0x004F76 },
+ { "America/Catamarca" , 0x004FCC },
+ { "America/Cayenne" , 0x00515C },
+ { "America/Cayman" , 0x0051B2 },
+ { "America/Chicago" , 0x0051FB },
+ { "America/Chihuahua" , 0x0056FA },
+ { "America/Coral_Harbour" , 0x005924 },
+ { "America/Cordoba" , 0x0059A3 },
+ { "America/Costa_Rica" , 0x005B29 },
+ { "America/Cuiaba" , 0x005BA7 },
+ { "America/Curacao" , 0x005E6E },
+ { "America/Danmarkshavn" , 0x005EC8 },
+ { "America/Dawson" , 0x005FDF },
+ { "America/Dawson_Creek" , 0x0062D6 },
+ { "America/Denver" , 0x00645B },
+ { "America/Detroit" , 0x0067C8 },
+ { "America/Dominica" , 0x006AF3 },
+ { "America/Edmonton" , 0x006B3C },
+ { "America/Eirunepe" , 0x006EA6 },
+ { "America/El_Salvador" , 0x006F92 },
+ { "America/Ensenada" , 0x006FFB },
+ { "America/Fort_Wayne" , 0x00745B },
+ { "America/Fortaleza" , 0x007347 },
+ { "America/Glace_Bay" , 0x0076B9 },
+ { "America/Godthab" , 0x0079DD },
+ { "America/Goose_Bay" , 0x007C87 },
+ { "America/Grand_Turk" , 0x00810F },
+ { "America/Grenada" , 0x0083B2 },
+ { "America/Guadeloupe" , 0x0083FB },
+ { "America/Guatemala" , 0x008444 },
+ { "America/Guayaquil" , 0x0084B7 },
+ { "America/Guyana" , 0x008500 },
+ { "America/Halifax" , 0x008575 },
+ { "America/Havana" , 0x008A51 },
+ { "America/Hermosillo" , 0x008DC2 },
+ { "America/Indiana/Indianapolis" , 0x008E75 },
+ { "America/Indiana/Knox" , 0x0090D3 },
+ { "America/Indiana/Marengo" , 0x009444 },
+ { "America/Indiana/Vevay" , 0x009914 },
+ { "America/Indianapolis" , 0x0096B6 },
+ { "America/Inuvik" , 0x009B18 },
+ { "America/Iqaluit" , 0x009E0F },
+ { "America/Jamaica" , 0x00A101 },
+ { "America/Jujuy" , 0x00A1BA },
+ { "America/Juneau" , 0x00A34E },
+ { "America/Kentucky/Louisville" , 0x00A6A2 },
+ { "America/Kentucky/Monticello" , 0x00AA8B },
+ { "America/Knox_IN" , 0x00ADDE },
+ { "America/La_Paz" , 0x00B14F },
+ { "America/Lima" , 0x00B1AA },
+ { "America/Los_Angeles" , 0x00B246 },
+ { "America/Louisville" , 0x00B63F },
+ { "America/Maceio" , 0x00BA28 },
+ { "America/Managua" , 0x00BB46 },
+ { "America/Manaus" , 0x00BBE3 },
+ { "America/Martinique" , 0x00BCCF },
+ { "America/Mazatlan" , 0x00BD2F },
+ { "America/Mendoza" , 0x00BF68 },
+ { "America/Menominee" , 0x00C106 },
+ { "America/Merida" , 0x00C434 },
+ { "America/Mexico_City" , 0x00C643 },
+ { "America/Miquelon" , 0x00C895 },
+ { "America/Monterrey" , 0x00CAFB },
+ { "America/Montevideo" , 0x00CCFE },
+ { "America/Montreal" , 0x00CEC4 },
+ { "America/Montserrat" , 0x00D3A8 },
+ { "America/Nassau" , 0x00D3F1 },
+ { "America/New_York" , 0x00D72A },
+ { "America/Nipigon" , 0x00DC1D },
+ { "America/Nome" , 0x00DF17 },
+ { "America/Noronha" , 0x00E270 },
+ { "America/North_Dakota/Center" , 0x00E384 },
+ { "America/Panama" , 0x00E6E1 },
+ { "America/Pangnirtung" , 0x00E72A },
+ { "America/Paramaribo" , 0x00EA34 },
+ { "America/Phoenix" , 0x00EABA },
+ { "America/Port-au-Prince" , 0x00EB3C },
+ { "America/Port_of_Spain" , 0x00ED24 },
+ { "America/Porto_Acre" , 0x00EC42 },
+ { "America/Porto_Velho" , 0x00ED6D },
+ { "America/Puerto_Rico" , 0x00EE4F },
+ { "America/Rainy_River" , 0x00EE9D },
+ { "America/Rankin_Inlet" , 0x00F197 },
+ { "America/Recife" , 0x00F47D },
+ { "America/Regina" , 0x00F591 },
+ { "America/Rio_Branco" , 0x00F70E },
+ { "America/Rosario" , 0x00F7F0 },
+ { "America/Santiago" , 0x00F976 },
+ { "America/Santo_Domingo" , 0x00FCF0 },
+ { "America/Sao_Paulo" , 0x00FDAA },
+ { "America/Scoresbysund" , 0x01007B },
+ { "America/Shiprock" , 0x01033E },
+ { "America/St_Johns" , 0x0106AB },
+ { "America/St_Kitts" , 0x010BCA },
+ { "America/St_Lucia" , 0x010C13 },
+ { "America/St_Thomas" , 0x010C5C },
+ { "America/St_Vincent" , 0x010CA5 },
+ { "America/Swift_Current" , 0x010CEE },
+ { "America/Tegucigalpa" , 0x010DD5 },
+ { "America/Thule" , 0x010E3E },
+ { "America/Thunder_Bay" , 0x011069 },
+ { "America/Tijuana" , 0x011383 },
+ { "America/Toronto" , 0x0116CF },
+ { "America/Tortola" , 0x011BB3 },
+ { "America/Vancouver" , 0x011BFC },
+ { "America/Virgin" , 0x012009 },
+ { "America/Whitehorse" , 0x012052 },
+ { "America/Winnipeg" , 0x012349 },
+ { "America/Yakutat" , 0x01274A },
+ { "America/Yellowknife" , 0x012A86 },
+ { "Antarctica/Casey" , 0x012D60 },
+ { "Antarctica/Davis" , 0x012DA9 },
+ { "Antarctica/DumontDUrville" , 0x012DFD },
+ { "Antarctica/Mawson" , 0x012E5D },
+ { "Antarctica/McMurdo" , 0x012EA7 },
+ { "Antarctica/Palmer" , 0x013181 },
+ { "Antarctica/Rothera" , 0x01348A },
+ { "Antarctica/South_Pole" , 0x0134D4 },
+ { "Antarctica/Syowa" , 0x0137AE },
+ { "Antarctica/Vostok" , 0x0137F8 },
+ { "Arctic/Longyearbyen" , 0x013842 },
+ { "Asia/Aden" , 0x013B68 },
+ { "Asia/Almaty" , 0x013BB1 },
+ { "Asia/Amman" , 0x013D16 },
+ { "Asia/Anadyr" , 0x013FCA },
+ { "Asia/Aqtau" , 0x014296 },
+ { "Asia/Aqtobe" , 0x014458 },
+ { "Asia/Ashgabat" , 0x0145F5 },
+ { "Asia/Ashkhabad" , 0x014706 },
+ { "Asia/Baghdad" , 0x014817 },
+ { "Asia/Bahrain" , 0x014AAC },
+ { "Asia/Baku" , 0x014B06 },
+ { "Asia/Bangkok" , 0x014DE7 },
+ { "Asia/Beirut" , 0x014E30 },
+ { "Asia/Bishkek" , 0x015131 },
+ { "Asia/Brunei" , 0x0152D1 },
+ { "Asia/Calcutta" , 0x015327 },
+ { "Asia/Choibalsan" , 0x015394 },
+ { "Asia/Chongqing" , 0x015628 },
+ { "Asia/Chungking" , 0x0156CB },
+ { "Asia/Colombo" , 0x01576E },
+ { "Asia/Dacca" , 0x0157F9 },
+ { "Asia/Damascus" , 0x01587C },
+ { "Asia/Dhaka" , 0x015BC0 },
+ { "Asia/Dili" , 0x015C43 },
+ { "Asia/Dubai" , 0x015CC0 },
+ { "Asia/Dushanbe" , 0x015D09 },
+ { "Asia/Gaza" , 0x015E00 },
+ { "Asia/Harbin" , 0x01613D },
+ { "Asia/Hong_Kong" , 0x0161F7 },
+ { "Asia/Hovd" , 0x0163A1 },
+ { "Asia/Irkutsk" , 0x016628 },
+ { "Asia/Istanbul" , 0x0168EC },
+ { "Asia/Jakarta" , 0x016CCD },
+ { "Asia/Jayapura" , 0x016D5D },
+ { "Asia/Jerusalem" , 0x016DBC },
+ { "Asia/Kabul" , 0x0170DF },
+ { "Asia/Kamchatka" , 0x017124 },
+ { "Asia/Karachi" , 0x0173E8 },
+ { "Asia/Kashgar" , 0x01747D },
+ { "Asia/Katmandu" , 0x01752D },
+ { "Asia/Krasnoyarsk" , 0x017587 },
+ { "Asia/Kuala_Lumpur" , 0x01784B },
+ { "Asia/Kuching" , 0x0178E9 },
+ { "Asia/Kuwait" , 0x0179BC },
+ { "Asia/Macao" , 0x017A05 },
+ { "Asia/Macau" , 0x017B34 },
+ { "Asia/Magadan" , 0x017C63 },
+ { "Asia/Makassar" , 0x017F27 },
+ { "Asia/Manila" , 0x017F97 },
+ { "Asia/Muscat" , 0x018010 },
+ { "Asia/Nicosia" , 0x018059 },
+ { "Asia/Novosibirsk" , 0x018335 },
+ { "Asia/Omsk" , 0x018606 },
+ { "Asia/Oral" , 0x0188CA },
+ { "Asia/Phnom_Penh" , 0x018A7F },
+ { "Asia/Pontianak" , 0x018AEB },
+ { "Asia/Pyongyang" , 0x018B8B },
+ { "Asia/Qatar" , 0x018BEC },
+ { "Asia/Qyzylorda" , 0x018C46 },
+ { "Asia/Rangoon" , 0x018DF0 },
+ { "Asia/Riyadh" , 0x018E5C },
+ { "Asia/Saigon" , 0x018EA5 },
+ { "Asia/Sakhalin" , 0x018F11 },
+ { "Asia/Samarkand" , 0x0191EA },
+ { "Asia/Seoul" , 0x01932D },
+ { "Asia/Shanghai" , 0x0193C5 },
+ { "Asia/Singapore" , 0x01946A },
+ { "Asia/Taipei" , 0x019515 },
+ { "Asia/Tashkent" , 0x019621 },
+ { "Asia/Tbilisi" , 0x019749 },
+ { "Asia/Tehran" , 0x019A44 },
+ { "Asia/Tel_Aviv" , 0x019CBA },
+ { "Asia/Thimbu" , 0x019FDD },
+ { "Asia/Thimphu" , 0x01A037 },
+ { "Asia/Tokyo" , 0x01A091 },
+ { "Asia/Ujung_Pandang" , 0x01A10E },
+ { "Asia/Ulaanbaatar" , 0x01A17E },
+ { "Asia/Ulan_Bator" , 0x01A405 },
+ { "Asia/Urumqi" , 0x01A68C },
+ { "Asia/Vientiane" , 0x01A72F },
+ { "Asia/Vladivostok" , 0x01A79B },
+ { "Asia/Yakutsk" , 0x01AA66 },
+ { "Asia/Yekaterinburg" , 0x01AD2A },
+ { "Asia/Yerevan" , 0x01B019 },
+ { "Atlantic/Azores" , 0x01B311 },
+ { "Atlantic/Bermuda" , 0x01B802 },
+ { "Atlantic/Canary" , 0x01BAD7 },
+ { "Atlantic/Cape_Verde" , 0x01BD93 },
+ { "Atlantic/Faeroe" , 0x01BE00 },
+ { "Atlantic/Jan_Mayen" , 0x01C098 },
+ { "Atlantic/Madeira" , 0x01C3BE },
+ { "Atlantic/Reykjavik" , 0x01C8AC },
+ { "Atlantic/South_Georgia" , 0x01CA59 },
+ { "Atlantic/St_Helena" , 0x01CD59 },
+ { "Atlantic/Stanley" , 0x01CA91 },
+ { "Australia/ACT" , 0x01CDA2 },
+ { "Australia/Adelaide" , 0x01D0B3 },
+ { "Australia/Brisbane" , 0x01D3C4 },
+ { "Australia/Broken_Hill" , 0x01D464 },
+ { "Australia/Canberra" , 0x01D77A },
+ { "Australia/Currie" , 0x01DA8B },
+ { "Australia/Darwin" , 0x01DD9C },
+ { "Australia/Hobart" , 0x01DE04 },
+ { "Australia/LHI" , 0x01E13D },
+ { "Australia/Lindeman" , 0x01E3CC },
+ { "Australia/Lord_Howe" , 0x01E485 },
+ { "Australia/Melbourne" , 0x01E714 },
+ { "Australia/North" , 0x01EA25 },
+ { "Australia/NSW" , 0x01EA8D },
+ { "Australia/Perth" , 0x01ED9E },
+ { "Australia/Queensland" , 0x01EE2A },
+ { "Australia/South" , 0x01EECA },
+ { "Australia/Sydney" , 0x01F1DB },
+ { "Australia/Tasmania" , 0x01F4EC },
+ { "Australia/Victoria" , 0x01F825 },
+ { "Australia/West" , 0x01FB36 },
+ { "Australia/Yancowinna" , 0x01FBC2 },
+ { "Brazil/Acre" , 0x01FED8 },
+ { "Brazil/DeNoronha" , 0x01FFBA },
+ { "Brazil/East" , 0x0200CE },
+ { "Brazil/West" , 0x02039F },
+ { "Canada/Atlantic" , 0x02048B },
+ { "Canada/Central" , 0x020967 },
+ { "Canada/East-Saskatchewan" , 0x02124C },
+ { "Canada/Eastern" , 0x020D68 },
+ { "Canada/Mountain" , 0x0213C9 },
+ { "Canada/Newfoundland" , 0x021733 },
+ { "Canada/Pacific" , 0x021C52 },
+ { "Canada/Saskatchewan" , 0x02205F },
+ { "Canada/Yukon" , 0x0221DC },
+ { "CET" , 0x0224D3 },
+ { "Chile/Continental" , 0x0227C6 },
+ { "Chile/EasterIsland" , 0x022B40 },
+ { "CST6CDT" , 0x022E88 },
+ { "Cuba" , 0x023387 },
+ { "EET" , 0x0236F8 },
+ { "Egypt" , 0x02399F },
+ { "Eire" , 0x023D5A },
+ { "EST" , 0x02425F },
+ { "EST5EDT" , 0x0242A8 },
+ { "Etc/GMT" , 0x02479B },
+ { "Etc/GMT+0" , 0x024843 },
+ { "Etc/GMT+1" , 0x0248B5 },
+ { "Etc/GMT+10" , 0x02492A },
+ { "Etc/GMT+11" , 0x0249A0 },
+ { "Etc/GMT+12" , 0x024A16 },
+ { "Etc/GMT+2" , 0x024B01 },
+ { "Etc/GMT+3" , 0x024B75 },
+ { "Etc/GMT+4" , 0x024BE9 },
+ { "Etc/GMT+5" , 0x024C5D },
+ { "Etc/GMT+6" , 0x024CD1 },
+ { "Etc/GMT+7" , 0x024D45 },
+ { "Etc/GMT+8" , 0x024DB9 },
+ { "Etc/GMT+9" , 0x024E2D },
+ { "Etc/GMT-0" , 0x02480B },
+ { "Etc/GMT-1" , 0x02487B },
+ { "Etc/GMT-10" , 0x0248EF },
+ { "Etc/GMT-11" , 0x024965 },
+ { "Etc/GMT-12" , 0x0249DB },
+ { "Etc/GMT-13" , 0x024A51 },
+ { "Etc/GMT-14" , 0x024A8C },
+ { "Etc/GMT-2" , 0x024AC7 },
+ { "Etc/GMT-3" , 0x024B3B },
+ { "Etc/GMT-4" , 0x024BAF },
+ { "Etc/GMT-5" , 0x024C23 },
+ { "Etc/GMT-6" , 0x024C97 },
+ { "Etc/GMT-7" , 0x024D0B },
+ { "Etc/GMT-8" , 0x024D7F },
+ { "Etc/GMT-9" , 0x024DF3 },
+ { "Etc/GMT0" , 0x0247D3 },
+ { "Etc/Greenwich" , 0x024E67 },
+ { "Etc/UCT" , 0x024E9F },
+ { "Etc/Universal" , 0x024ED7 },
+ { "Etc/UTC" , 0x024F0F },
+ { "Etc/Zulu" , 0x024F47 },
+ { "Europe/Amsterdam" , 0x024F7F },
+ { "Europe/Andorra" , 0x0253B1 },
+ { "Europe/Athens" , 0x025621 },
+ { "Europe/Belfast" , 0x025958 },
+ { "Europe/Belgrade" , 0x025E83 },
+ { "Europe/Berlin" , 0x02613B },
+ { "Europe/Bratislava" , 0x026480 },
+ { "Europe/Brussels" , 0x0267A6 },
+ { "Europe/Bucharest" , 0x026BD1 },
+ { "Europe/Budapest" , 0x026EEF },
+ { "Europe/Chisinau" , 0x027251 },
+ { "Europe/Copenhagen" , 0x0275D3 },
+ { "Europe/Dublin" , 0x0278D1 },
+ { "Europe/Gibraltar" , 0x027DD6 },
+ { "Europe/Helsinki" , 0x028221 },
+ { "Europe/Istanbul" , 0x0284CB },
+ { "Europe/Kaliningrad" , 0x0288AC },
+ { "Europe/Kiev" , 0x028BEC },
+ { "Europe/Lisbon" , 0x028EE9 },
+ { "Europe/Ljubljana" , 0x0293D9 },
+ { "Europe/London" , 0x029691 },
+ { "Europe/Luxembourg" , 0x029BBC },
+ { "Europe/Madrid" , 0x02A006 },
+ { "Europe/Malta" , 0x02A3B8 },
+ { "Europe/Mariehamn" , 0x02A765 },
+ { "Europe/Minsk" , 0x02AA0F },
+ { "Europe/Monaco" , 0x02AD0E },
+ { "Europe/Moscow" , 0x02B13D },
+ { "Europe/Nicosia" , 0x02B46C },
+ { "Europe/Oslo" , 0x02B748 },
+ { "Europe/Paris" , 0x02BA6E },
+ { "Europe/Prague" , 0x02BEA8 },
+ { "Europe/Riga" , 0x02C1CE },
+ { "Europe/Rome" , 0x02C507 },
+ { "Europe/Samara" , 0x02C8BE },
+ { "Europe/San_Marino" , 0x02CBBD },
+ { "Europe/Sarajevo" , 0x02CF74 },
+ { "Europe/Simferopol" , 0x02D22C },
+ { "Europe/Skopje" , 0x02D53D },
+ { "Europe/Sofia" , 0x02D7F5 },
+ { "Europe/Stockholm" , 0x02DAE4 },
+ { "Europe/Tallinn" , 0x02DD87 },
+ { "Europe/Tirane" , 0x02E0B5 },
+ { "Europe/Tiraspol" , 0x02E3AF },
+ { "Europe/Uzhgorod" , 0x02E731 },
+ { "Europe/Vaduz" , 0x02EA34 },
+ { "Europe/Vatican" , 0x02ECBB },
+ { "Europe/Vienna" , 0x02F072 },
+ { "Europe/Vilnius" , 0x02F393 },
+ { "Europe/Warsaw" , 0x02F6C6 },
+ { "Europe/Zagreb" , 0x02FA96 },
+ { "Europe/Zaporozhye" , 0x02FD4E },
+ { "Europe/Zurich" , 0x030055 },
+ { "Factory" , 0x030302 },
+ { "GB" , 0x030367 },
+ { "GB-Eire" , 0x030892 },
+ { "GMT" , 0x030DBD },
+ { "GMT+0" , 0x030E65 },
+ { "GMT-0" , 0x030E2D },
+ { "GMT0" , 0x030DF5 },
+ { "Greenwich" , 0x030E9D },
+ { "Hongkong" , 0x030ED5 },
+ { "HST" , 0x03107F },
+ { "Iceland" , 0x031101 },
+ { "Indian/Antananarivo" , 0x0312AE },
+ { "Indian/Chagos" , 0x031316 },
+ { "Indian/Christmas" , 0x03136C },
+ { "Indian/Cocos" , 0x0313A4 },
+ { "Indian/Comoro" , 0x0313DC },
+ { "Indian/Kerguelen" , 0x031425 },
+ { "Indian/Mahe" , 0x03146E },
+ { "Indian/Maldives" , 0x0314B7 },
+ { "Indian/Mauritius" , 0x031500 },
+ { "Indian/Mayotte" , 0x031549 },
+ { "Indian/Reunion" , 0x031592 },
+ { "Iran" , 0x0315DB },
+ { "Israel" , 0x031851 },
+ { "Jamaica" , 0x031B74 },
+ { "Japan" , 0x031C2D },
+ { "Kwajalein" , 0x031CAA },
+ { "Libya" , 0x031D01 },
+ { "MET" , 0x031DEF },
+ { "Mexico/BajaNorte" , 0x0320E2 },
+ { "Mexico/BajaSur" , 0x03242E },
+ { "Mexico/General" , 0x032667 },
+ { "MST" , 0x0328B9 },
+ { "MST7MDT" , 0x03293B },
+ { "Navajo" , 0x032CA8 },
+ { "NZ" , 0x033015 },
+ { "NZ-CHAT" , 0x033387 },
+ { "Pacific/Apia" , 0x033663 },
+ { "Pacific/Auckland" , 0x0336BE },
+ { "Pacific/Chatham" , 0x033A30 },
+ { "Pacific/Easter" , 0x033D0C },
+ { "Pacific/Efate" , 0x034054 },
+ { "Pacific/Enderbury" , 0x03410E },
+ { "Pacific/Fakaofo" , 0x034161 },
+ { "Pacific/Fiji" , 0x034199 },
+ { "Pacific/Funafuti" , 0x034203 },
+ { "Pacific/Galapagos" , 0x03423B },
+ { "Pacific/Gambier" , 0x034296 },
+ { "Pacific/Guadalcanal" , 0x0342E0 },
+ { "Pacific/Guam" , 0x034329 },
+ { "Pacific/Honolulu" , 0x034373 },
+ { "Pacific/Johnston" , 0x0343F5 },
+ { "Pacific/Kiritimati" , 0x03442D },
+ { "Pacific/Kosrae" , 0x034480 },
+ { "Pacific/Kwajalein" , 0x0344CB },
+ { "Pacific/Majuro" , 0x034522 },
+ { "Pacific/Marquesas" , 0x034567 },
+ { "Pacific/Midway" , 0x0345B1 },
+ { "Pacific/Nauru" , 0x034621 },
+ { "Pacific/Niue" , 0x03468D },
+ { "Pacific/Norfolk" , 0x0346DF },
+ { "Pacific/Noumea" , 0x034728 },
+ { "Pacific/Pago_Pago" , 0x0347AC },
+ { "Pacific/Palau" , 0x034829 },
+ { "Pacific/Pitcairn" , 0x034861 },
+ { "Pacific/Ponape" , 0x0348AA },
+ { "Pacific/Port_Moresby" , 0x0348E3 },
+ { "Pacific/Rarotonga" , 0x03491B },
+ { "Pacific/Saipan" , 0x0349EB },
+ { "Pacific/Samoa" , 0x034A42 },
+ { "Pacific/Tahiti" , 0x034ABF },
+ { "Pacific/Tarawa" , 0x034B09 },
+ { "Pacific/Tongatapu" , 0x034B42 },
+ { "Pacific/Truk" , 0x034BC2 },
+ { "Pacific/Wake" , 0x034BFB },
+ { "Pacific/Wallis" , 0x034C34 },
+ { "Pacific/Yap" , 0x034C6C },
+ { "Poland" , 0x034CA5 },
+ { "Portugal" , 0x035075 },
+ { "PRC" , 0x035565 },
+ { "PST8PDT" , 0x03560A },
+ { "ROC" , 0x035A03 },
+ { "ROK" , 0x035B0F },
+ { "Singapore" , 0x035BA7 },
+ { "Turkey" , 0x035C52 },
+ { "UCT" , 0x036033 },
+ { "Universal" , 0x03606B },
+ { "US/Alaska" , 0x0360A3 },
+ { "US/Aleutian" , 0x0363FB },
+ { "US/Arizona" , 0x036755 },
+ { "US/Central" , 0x0367D7 },
+ { "US/East-Indiana" , 0x0371C9 },
+ { "US/Eastern" , 0x036CD6 },
+ { "US/Hawaii" , 0x037427 },
+ { "US/Indiana-Starke" , 0x0374A9 },
+ { "US/Michigan" , 0x03781A },
+ { "US/Mountain" , 0x037B45 },
+ { "US/Pacific" , 0x037EB2 },
+ { "US/Pacific-New" , 0x0382AB },
+ { "US/Samoa" , 0x0386A4 },
+ { "UTC" , 0x038721 },
+ { "W-SU" , 0x038A00 },
+ { "WET" , 0x038759 },
+ { "Zulu" , 0x038D2F },
+};
+/* This is a generated file, do not modify */
+unsigned char timelib_timezone_db_data_builtin[232807] = {
+
+
+/* Africa/Abidjan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x92, 0x48,
+0x01, 0xFF, 0xFF, 0xFC, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Accra */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x9E, 0x30, 0x66, 0xB4,
+0xC1, 0x4C, 0xF9, 0x80, 0xC1, 0xEC, 0x7A, 0x50, 0xC3, 0x2E, 0x2D, 0x00, 0xC3, 0xCD, 0xAD, 0xD0,
+0xC5, 0x0F, 0x60, 0x80, 0xC5, 0xAE, 0xE1, 0x50, 0xC6, 0xF0, 0x94, 0x00, 0xC7, 0x90, 0x14, 0xD0,
+0xC8, 0xD3, 0x19, 0x00, 0xC9, 0x72, 0x99, 0xD0, 0xCA, 0xB4, 0x4C, 0x80, 0xCB, 0x53, 0xCD, 0x50,
+0xCC, 0x95, 0x80, 0x00, 0xCD, 0x35, 0x00, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xFF, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x04,
+0xB0, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x48, 0x53,
+0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Addis_Ababa */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98,
+0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D,
+0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Algiers */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x91, 0x60, 0x50, 0x4F,
+0x9B, 0x47, 0x78, 0xF0, 0x9B, 0xD7, 0x2C, 0x70, 0x9C, 0xBC, 0x91, 0x70, 0x9D, 0xC0, 0x48, 0xF0,
+0x9E, 0x89, 0xFE, 0x70, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x80, 0x0C, 0xF0,
+0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, 0xA4, 0xB8, 0x06, 0x70,
+0xC6, 0xFF, 0x06, 0x70, 0xC7, 0x58, 0xBA, 0x80, 0xC7, 0xDA, 0x09, 0xA0, 0xCF, 0x92, 0x34, 0x10,
+0xD0, 0x8A, 0x00, 0x00, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x24, 0x70, 0xD4, 0x4B, 0x07, 0x70,
+0xE5, 0xCE, 0xD3, 0x00, 0xF3, 0x5C, 0xB0, 0xF0, 0x02, 0x78, 0xC1, 0xF0, 0x03, 0x43, 0xC8, 0xF0,
+0x0D, 0xCF, 0xD7, 0x00, 0x0E, 0xAD, 0x44, 0xF0, 0x0F, 0x78, 0x5A, 0x00, 0x10, 0x68, 0x59, 0x10,
+0x12, 0x76, 0x43, 0x70, 0x13, 0x66, 0x42, 0x80, 0x14, 0x5F, 0x7C, 0x10, 0x15, 0x4F, 0x5F, 0x00,
+0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x03, 0x05, 0x03, 0x01, 0x02, 0x06, 0x05, 0x04, 0x05, 0x03, 0x06, 0x03,
+0x05, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x50, 0x4D, 0x54, 0x00, 0x57,
+0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Asmera */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98,
+0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D,
+0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Bamako */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x96, 0x00,
+0xBC, 0x92, 0xB8, 0x80, 0xEE, 0x11, 0x87, 0x10, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF8, 0x80, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Bangui */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x7D, 0x14,
+0x01, 0x00, 0x00, 0x11, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Banjul */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x92, 0xE6, 0x9E, 0x1C,
+0xBE, 0x2A, 0x27, 0x9C, 0xF4, 0xB6, 0x36, 0x10, 0x01, 0x02, 0x03, 0xFF, 0xFF, 0xF0, 0x64, 0x00,
+0x00, 0xFF, 0xFF, 0xF0, 0x64, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x47,
+0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Bissau */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x91, 0xC4, 0x93, 0x1C,
+0x09, 0x67, 0x61, 0x10, 0x01, 0x02, 0xFF, 0xFF, 0xF1, 0x64, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0,
+0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00,
+0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Blantyre */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC3, 0xB0,
+0x01, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Brazzaville */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x80, 0x2C,
+0x01, 0x00, 0x00, 0x0E, 0x54, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Bujumbura */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20,
+0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00,
+
+/* Africa/Cairo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xC8, 0x93, 0xB4, 0xE0,
+0xC8, 0xFA, 0x7B, 0xD0, 0xC9, 0xFC, 0xEF, 0xE0, 0xCA, 0xC7, 0xE8, 0xD0, 0xCB, 0xCB, 0xAE, 0x60,
+0xCC, 0xDF, 0x29, 0xD0, 0xCD, 0xAC, 0xE1, 0xE0, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0,
+0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xAD, 0x50, 0xE8, 0x36, 0x63, 0x60,
+0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, 0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xFA, 0xF0,
+0xEC, 0xB5, 0x6D, 0x00, 0xED, 0xCF, 0x7F, 0xF0, 0xEE, 0x97, 0xF2, 0x00, 0xEF, 0xB0, 0xB3, 0x70,
+0xF0, 0x79, 0x25, 0x80, 0xF1, 0x91, 0xE6, 0xF0, 0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x73, 0x1A, 0x70,
+0xF4, 0x3B, 0x8C, 0x80, 0xF5, 0x55, 0x9F, 0x70, 0xF6, 0x1E, 0x11, 0x80, 0xF7, 0x36, 0xD2, 0xF0,
+0xF7, 0xFF, 0x45, 0x00, 0xF9, 0x18, 0x06, 0x70, 0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0,
+0xFB, 0xC2, 0xFD, 0x80, 0xFC, 0xDB, 0xBE, 0xF0, 0xFD, 0xA5, 0x82, 0x80, 0xFE, 0xBC, 0xF2, 0x70,
+0xFF, 0x86, 0xB6, 0x00, 0x00, 0x9E, 0x25, 0xF0, 0x01, 0x67, 0xE9, 0x80, 0x02, 0x7F, 0x59, 0x70,
+0x03, 0x49, 0x1D, 0x00, 0x04, 0x61, 0xDE, 0x70, 0x05, 0x2B, 0xA2, 0x00, 0x06, 0x43, 0x11, 0xF0,
+0x07, 0x0C, 0xD5, 0x80, 0x08, 0x24, 0x45, 0x70, 0x08, 0xEE, 0x09, 0x00, 0x0A, 0x05, 0x78, 0xF0,
+0x0A, 0xCF, 0x3C, 0x80, 0x0B, 0xE7, 0xFD, 0xF0, 0x0C, 0xB1, 0xC1, 0x80, 0x0D, 0xC9, 0x31, 0x70,
+0x0E, 0x92, 0xF5, 0x00, 0x0F, 0xAA, 0x64, 0xF0, 0x10, 0x74, 0x28, 0x80, 0x11, 0x8B, 0x98, 0x70,
+0x12, 0x55, 0x5C, 0x00, 0x13, 0x6E, 0x1D, 0x70, 0x14, 0x37, 0xE1, 0x00, 0x15, 0x4F, 0x50, 0xF0,
+0x16, 0x19, 0x14, 0x80, 0x17, 0xA0, 0x93, 0xF0, 0x17, 0xFA, 0x48, 0x00, 0x19, 0x70, 0xA3, 0xF0,
+0x19, 0xDB, 0x7B, 0x80, 0x1A, 0xF4, 0x3C, 0xF0, 0x1B, 0xBE, 0x00, 0x80, 0x1C, 0xD5, 0x70, 0x70,
+0x1D, 0x9F, 0x34, 0x00, 0x1E, 0xB6, 0xA3, 0xF0, 0x1F, 0x80, 0x67, 0x80, 0x20, 0x97, 0xD7, 0x70,
+0x21, 0x61, 0x9B, 0x00, 0x22, 0x7A, 0x5C, 0x70, 0x23, 0x44, 0x20, 0x00, 0x24, 0x62, 0x27, 0x70,
+0x25, 0x25, 0x53, 0x80, 0x26, 0x3C, 0xC3, 0x70, 0x27, 0x06, 0x87, 0x00, 0x28, 0x1D, 0xF6, 0xF0,
+0x28, 0xE7, 0xBA, 0x80, 0x2A, 0x00, 0x7B, 0xF0, 0x2A, 0xCA, 0x3F, 0x80, 0x2B, 0xE1, 0xAF, 0x70,
+0x2C, 0xAB, 0x73, 0x00, 0x2D, 0xC2, 0xE2, 0xF0, 0x2E, 0x8C, 0xA6, 0x80, 0x2F, 0xA0, 0x13, 0xE0,
+0x30, 0x6B, 0x0C, 0xD0, 0x31, 0x7F, 0xF5, 0xE0, 0x32, 0x4A, 0xEE, 0xD0, 0x33, 0x5F, 0xD7, 0xE0,
+0x34, 0x2A, 0xD0, 0xD0, 0x35, 0x3F, 0xB9, 0xE0, 0x36, 0x0A, 0xB2, 0xD0, 0x37, 0x28, 0xD6, 0x60,
+0x37, 0xF3, 0xCF, 0x50, 0x39, 0x08, 0xB8, 0x60, 0x39, 0xD3, 0xB1, 0x50, 0x3A, 0xE8, 0x9A, 0x60,
+0x3B, 0xB3, 0x93, 0x50, 0x3C, 0xC8, 0x7C, 0x60, 0x3D, 0x93, 0x75, 0x50, 0x3E, 0xA8, 0x5E, 0x60,
+0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0,
+0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x1C, 0x37, 0xD0, 0x46, 0x31, 0x20, 0xE0,
+0x46, 0xFC, 0x19, 0xD0, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xDB, 0xFB, 0xD0, 0x49, 0xF0, 0xE4, 0xE0,
+0x4A, 0xBB, 0xDD, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60,
+0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60,
+0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60,
+0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xED, 0x80, 0xD0, 0x59, 0x02, 0x69, 0xE0,
+0x59, 0xCD, 0x62, 0xD0, 0x5A, 0xE2, 0x4B, 0xE0, 0x5B, 0xAD, 0x44, 0xD0, 0x5C, 0xC2, 0x2D, 0xE0,
+0x5D, 0x8D, 0x26, 0xD0, 0x5E, 0xA2, 0x0F, 0xE0, 0x5F, 0x6D, 0x08, 0xD0, 0x60, 0x8B, 0x2C, 0x60,
+0x61, 0x56, 0x25, 0x50, 0x62, 0x6B, 0x0E, 0x60, 0x63, 0x36, 0x07, 0x50, 0x64, 0x4A, 0xF0, 0x60,
+0x65, 0x15, 0xE9, 0x50, 0x66, 0x2A, 0xD2, 0x60, 0x66, 0xF5, 0xCB, 0x50, 0x68, 0x0A, 0xB4, 0x60,
+0x68, 0xD5, 0xAD, 0x50, 0x69, 0xEA, 0x96, 0x60, 0x6A, 0xB5, 0x8F, 0x50, 0x6B, 0xD3, 0xB2, 0xE0,
+0x6C, 0x9E, 0xAB, 0xD0, 0x6D, 0xB3, 0x94, 0xE0, 0x6E, 0x7E, 0x8D, 0xD0, 0x6F, 0x93, 0x76, 0xE0,
+0x70, 0x5E, 0x6F, 0xD0, 0x71, 0x73, 0x58, 0xE0, 0x72, 0x3E, 0x51, 0xD0, 0x73, 0x53, 0x3A, 0xE0,
+0x74, 0x1E, 0x33, 0xD0, 0x75, 0x3C, 0x57, 0x60, 0x76, 0x07, 0x50, 0x50, 0x77, 0x1C, 0x39, 0x60,
+0x77, 0xE7, 0x32, 0x50, 0x78, 0xFC, 0x1B, 0x60, 0x79, 0xC7, 0x14, 0x50, 0x7A, 0xDB, 0xFD, 0x60,
+0x7B, 0xA6, 0xF6, 0x50, 0x7C, 0xBB, 0xDF, 0x60, 0x7D, 0x86, 0xD8, 0x50, 0x7E, 0x9B, 0xC1, 0x60,
+0x7F, 0x66, 0xBA, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00,
+0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45,
+0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Casablanca */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0x51, 0xF9, 0x9C,
+0xC6, 0xFF, 0x14, 0x80, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xED, 0x80, 0xD2, 0xA1, 0x32, 0xF0,
+0xDB, 0x35, 0xA4, 0x00, 0xDB, 0xEE, 0x27, 0xF0, 0xFB, 0x25, 0x72, 0x40, 0xFB, 0xC2, 0xEF, 0x70,
+0x08, 0x6B, 0x84, 0x80, 0x08, 0xC6, 0x6D, 0xF0, 0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0x61, 0x47, 0xF0,
+0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x8E, 0xF2, 0x70, 0x0F, 0xD3, 0x51, 0x80, 0x10, 0x27, 0xA3, 0x70,
+0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x18, 0x6F, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xF8, 0xE4, 0x00,
+0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00,
+0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Ceuta */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x12, 0x9E, 0xD6, 0x75, 0x70,
+0x9F, 0xA1, 0x6E, 0x60, 0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0,
+0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0,
+0xB2, 0x70, 0x22, 0x70, 0xB2, 0xE1, 0x91, 0x80, 0xFB, 0x25, 0x72, 0x40, 0xFB, 0xC2, 0xEF, 0x70,
+0x08, 0x6B, 0x84, 0x80, 0x08, 0xC6, 0x6D, 0xF0, 0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0x61, 0x47, 0xF0,
+0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x8E, 0xF2, 0x70, 0x0F, 0xD3, 0x51, 0x80, 0x10, 0x27, 0xA3, 0x70,
+0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00,
+0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x57, 0x45, 0x54, 0x00,
+0x57, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Africa/Conakry */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9B, 0x5C,
+0xBC, 0x92, 0xB8, 0x80, 0xED, 0x30, 0x16, 0x90, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF3, 0x24, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Dakar */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9E, 0xD8,
+0xCA, 0x3B, 0x10, 0x90, 0x01, 0x02, 0xFF, 0xFF, 0xEF, 0xA8, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0,
+0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00,
+0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Dar_es_Salaam */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0E, 0xB6, 0xA3, 0xD3, 0xAC,
+0xD6, 0x9D, 0x7F, 0xD0, 0xEF, 0x12, 0x66, 0xE3, 0x01, 0x02, 0x01, 0x00, 0x00, 0x24, 0xD4, 0x00,
+0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x26, 0x9D, 0x00, 0x08, 0x4C, 0x4D, 0x54,
+0x00, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* Africa/Djibouti */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD2, 0x0C,
+0x01, 0x00, 0x00, 0x28, 0x74, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Douala */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x85, 0x68,
+0x01, 0x00, 0x00, 0x09, 0x18, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/El_Aaiun */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xBC, 0x48, 0xF0, 0xE0,
+0x0B, 0xD1, 0xB0, 0x90, 0x01, 0x02, 0xFF, 0xFF, 0xF3, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0,
+0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00,
+0x57, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Freetown */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x95, 0x90, 0x32, 0x6C,
+0xBE, 0xF1, 0x38, 0x90, 0xBF, 0x92, 0x06, 0x30, 0xC0, 0xD3, 0xBD, 0x90, 0xC1, 0x74, 0x8B, 0x30,
+0xC2, 0xB4, 0xF1, 0x10, 0xC3, 0x55, 0xBE, 0xB0, 0xC4, 0x96, 0x24, 0x90, 0xC5, 0x36, 0xF2, 0x30,
+0xC6, 0x77, 0x58, 0x10, 0xC7, 0x18, 0x25, 0xB0, 0xC8, 0x59, 0xDD, 0x10, 0xC8, 0xFA, 0xAA, 0xB0,
+0xCA, 0x3B, 0x10, 0x90, 0xCA, 0xDB, 0xDE, 0x30, 0xCC, 0x1C, 0x44, 0x10, 0xCC, 0xBD, 0x11, 0xB0,
+0xE7, 0x8C, 0x7C, 0x10, 0xE8, 0x53, 0x80, 0x80, 0xE8, 0xCC, 0xBC, 0x70, 0xEA, 0x34, 0xB4, 0x00,
+0xEA, 0xAD, 0xEF, 0xF0, 0xEC, 0x15, 0xE7, 0x80, 0xEC, 0x8F, 0x23, 0x70, 0xED, 0xF8, 0x6C, 0x80,
+0xEE, 0x71, 0xA8, 0x70, 0xEF, 0xD9, 0xA0, 0x00, 0xF0, 0x52, 0xDB, 0xF0, 0xF1, 0xBA, 0xD3, 0x80,
+0xF2, 0x34, 0x0F, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0xFF, 0xFF, 0xF3, 0x94, 0x00, 0x00, 0xFF, 0xFF, 0xFB, 0x50, 0x01, 0x04, 0xFF, 0xFF,
+0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x46, 0x4D, 0x54, 0x00, 0x53, 0x4C, 0x53, 0x54, 0x00, 0x57,
+0x41, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Africa/Gaborone */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xCE, 0x8E, 0x6E, 0x80,
+0xCF, 0x7E, 0x51, 0x70, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30,
+0x01, 0x04, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Harare */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC7, 0x64,
+0x01, 0x00, 0x00, 0x1D, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Johannesburg */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68,
+0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* Africa/Kampala */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDF, 0x1C,
+0xB4, 0xC2, 0x9A, 0xD0, 0xD6, 0x9D, 0x86, 0xD8, 0xE7, 0x8C, 0x47, 0x63, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x1E, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0x9D, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Africa/Khartoum */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xDA, 0x00,
+0x00, 0x9E, 0x17, 0xE0, 0x01, 0x7A, 0x34, 0x50, 0x02, 0x7D, 0xF9, 0xE0, 0x03, 0x5B, 0x67, 0xD0,
+0x04, 0x60, 0x7E, 0xE0, 0x05, 0x3D, 0xEC, 0xD0, 0x06, 0x40, 0x60, 0xE0, 0x07, 0x1F, 0x20, 0x50,
+0x08, 0x20, 0x42, 0xE0, 0x09, 0x00, 0x53, 0xD0, 0x0A, 0x00, 0x24, 0xE0, 0x0A, 0xE1, 0x87, 0x50,
+0x0B, 0xE0, 0x06, 0xE0, 0x0C, 0xC4, 0x0C, 0x50, 0x0D, 0xBF, 0xE8, 0xE0, 0x0E, 0xA5, 0x3F, 0xD0,
+0x0F, 0xA9, 0x05, 0x60, 0x10, 0x86, 0x73, 0x50, 0x11, 0x88, 0xE7, 0x60, 0x12, 0x67, 0xA6, 0xD0,
+0x13, 0x68, 0xC9, 0x60, 0x14, 0x4A, 0x2B, 0xD0, 0x15, 0x48, 0xAB, 0x60, 0x16, 0x2B, 0x5F, 0x50,
+0x17, 0x28, 0x8D, 0x60, 0x18, 0x0C, 0x92, 0xD0, 0x19, 0x08, 0x6F, 0x60, 0x19, 0xED, 0xC6, 0x50,
+0x1A, 0xF1, 0x8B, 0xE0, 0x1B, 0xD0, 0x4B, 0x50, 0x1C, 0xD1, 0x6D, 0xE0, 0x1D, 0xB1, 0x7E, 0xD0,
+0x38, 0x80, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, 0x1E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30,
+0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D,
+0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Kigali */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xBE, 0xF1, 0x0E, 0x50,
+0x01, 0x00, 0x00, 0x1C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Kinshasa */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00,
+
+/* Africa/Lagos */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0x51, 0xF3, 0x50,
+0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Libreville */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x85, 0xA4,
+0x01, 0x00, 0x00, 0x08, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Lome */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* Africa/Luanda */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xC4, 0x78, 0x4C,
+0x01, 0x00, 0x00, 0x0C, 0x34, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x41, 0x4F, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Lubumbashi */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20,
+0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00,
+
+/* Africa/Lusaka */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC9, 0xFC,
+0x01, 0x00, 0x00, 0x1A, 0x84, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Malabo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x86, 0x44,
+0xF4, 0x9F, 0xBE, 0x80, 0x01, 0x02, 0x00, 0x00, 0x08, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00,
+0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Maputo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4,
+0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Maseru */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xCA, 0xB8,
+0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x19, 0xC8, 0x00,
+0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Mbabane */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xC7, 0x58,
+0x01, 0x00, 0x00, 0x1D, 0x28, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Mogadishu */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xB6, 0xA3, 0xCE, 0x50,
+0xE7, 0x8C, 0x4A, 0xD8, 0x01, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x00, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x04, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Monrovia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA0, 0x5F, 0x6C, 0x9C,
+0x04, 0x61, 0xF6, 0xEE, 0x01, 0x02, 0xFF, 0xFF, 0xF5, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xF5, 0x92,
+0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4D, 0x4D, 0x54, 0x00, 0x4C, 0x52, 0x54, 0x00,
+0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Nairobi */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xE3, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0x9D, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Africa/Ndjamena */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x92, 0xE6, 0x80, 0x64,
+0x12, 0x66, 0x71, 0x70, 0x13, 0x26, 0xDE, 0x60, 0x01, 0x02, 0x01, 0x00, 0x00, 0x0E, 0x1C, 0x00,
+0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x4C, 0x4D, 0x54,
+0x00, 0x57, 0x41, 0x54, 0x00, 0x57, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Africa/Niamey */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x8C, 0x84,
+0xBC, 0x92, 0xC6, 0x90, 0xED, 0x30, 0x08, 0x80, 0x01, 0x02, 0x03, 0x00, 0x00, 0x01, 0xFC, 0x00,
+0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Nouakchott */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9D, 0x74,
+0xBC, 0x92, 0xB8, 0x80, 0xEE, 0xE5, 0xC8, 0x90, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF1, 0x0C, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Ouagadougou */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x8F, 0xEC,
+0x01, 0xFF, 0xFF, 0xFE, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Porto-Novo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x8C, 0x0C,
+0xBC, 0x92, 0xB8, 0x80, 0x01, 0x02, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00,
+0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Sao_Tome */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x97, 0x10,
+0x01, 0xFF, 0xFF, 0xF7, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Timbuktu */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x96, 0x00,
+0xBC, 0x92, 0xB8, 0x80, 0xEE, 0x11, 0x87, 0x10, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF8, 0x80, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Tripoli */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0xC1, 0x24,
+0xDD, 0xBB, 0xB1, 0x10, 0xDE, 0x23, 0xAD, 0x60, 0xE1, 0x78, 0xD2, 0x10, 0xE1, 0xE7, 0x65, 0xE0,
+0xE5, 0x2F, 0x3F, 0x70, 0xE5, 0xA9, 0xCC, 0xE0, 0xEB, 0x4E, 0xC6, 0xF0, 0x16, 0x92, 0x42, 0x60,
+0x17, 0x08, 0xF7, 0x70, 0x17, 0xFA, 0x2B, 0xE0, 0x18, 0xEA, 0x2A, 0xF0, 0x19, 0xDB, 0x5F, 0x60,
+0x1A, 0xCC, 0xAF, 0xF0, 0x1B, 0xBD, 0xE4, 0x60, 0x1C, 0xB4, 0x7A, 0xF0, 0x1D, 0x9F, 0x17, 0xE0,
+0x1E, 0x93, 0x0B, 0x70, 0x1F, 0x82, 0xEE, 0x60, 0x20, 0x70, 0x4A, 0x70, 0x21, 0x61, 0x7E, 0xE0,
+0x22, 0x52, 0xCF, 0x70, 0x23, 0x44, 0x03, 0xE0, 0x24, 0x34, 0x02, 0xF0, 0x25, 0x25, 0x37, 0x60,
+0x26, 0x40, 0xB7, 0xF0, 0x32, 0x4E, 0xF1, 0x60, 0x33, 0x44, 0x36, 0x70, 0x34, 0x35, 0x6A, 0xE0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x03, 0x00, 0x00, 0x0C,
+0x5C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00,
+0x00, 0x1C, 0x20, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45,
+0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Tunis */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x91, 0x60, 0x50, 0x4F,
+0xC6, 0x3A, 0x88, 0xE0, 0xC7, 0x58, 0x9E, 0x60, 0xC7, 0xDB, 0x22, 0xE0, 0xCA, 0xE2, 0x54, 0xE0,
+0xCB, 0xAD, 0x69, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCD, 0xC2, 0x16, 0x00,
+0xCD, 0xCC, 0xB0, 0x10, 0xCE, 0xA2, 0x35, 0x00, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x89, 0xE3, 0xE0,
+0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x16, 0x60, 0x0D, 0xC7, 0xDF, 0xF0, 0x0E, 0x89, 0xAC, 0x70,
+0x0F, 0xAA, 0x64, 0xF0, 0x10, 0x74, 0x1A, 0x70, 0x22, 0xA3, 0x3A, 0xF0, 0x23, 0x3C, 0x28, 0xF0,
+0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x3C, 0xC3, 0x70, 0x27, 0x05, 0x27, 0x70,
+0x42, 0x74, 0x0D, 0xF0, 0x43, 0x3C, 0x80, 0x00, 0x03, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x04, 0x50, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Africa/Windhoek */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x13, 0x82, 0x46, 0xCF, 0x68,
+0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0x26, 0x06, 0xA7, 0xE0, 0x2D, 0x9D, 0xEA, 0xE0,
+0x2E, 0x69, 0x1C, 0x10, 0x2F, 0x7D, 0xE9, 0x00, 0x30, 0x48, 0xFE, 0x10, 0x31, 0x67, 0x05, 0x80,
+0x32, 0x28, 0xE0, 0x10, 0x33, 0x46, 0xE7, 0x80, 0x34, 0x11, 0xFC, 0x90, 0x35, 0x26, 0xC9, 0x80,
+0x35, 0xF1, 0xDE, 0x90, 0x37, 0x06, 0xAB, 0x80, 0x37, 0xD1, 0xC0, 0x90, 0x38, 0xE6, 0x8D, 0x80,
+0x39, 0xB1, 0xA2, 0x90, 0x3A, 0xC6, 0x6F, 0x80, 0x3B, 0x91, 0x84, 0x90, 0x3C, 0xAF, 0x8C, 0x00,
+0x3D, 0x71, 0x66, 0x90, 0x3E, 0x8F, 0x6E, 0x00, 0x3F, 0x5A, 0x83, 0x10, 0x40, 0x6F, 0x50, 0x00,
+0x41, 0x3A, 0x65, 0x10, 0x42, 0x4F, 0x32, 0x00, 0x43, 0x1A, 0x47, 0x10, 0x44, 0x2F, 0x14, 0x00,
+0x44, 0xFA, 0x29, 0x10, 0x46, 0x0E, 0xF6, 0x00, 0x46, 0xDA, 0x0B, 0x10, 0x47, 0xF8, 0x12, 0x80,
+0x48, 0xC3, 0x27, 0x90, 0x49, 0xD7, 0xF4, 0x80, 0x4A, 0xA3, 0x09, 0x90, 0x4B, 0xB7, 0xD6, 0x80,
+0x4C, 0x82, 0xEB, 0x90, 0x4D, 0x97, 0xB8, 0x80, 0x4E, 0x62, 0xCD, 0x90, 0x4F, 0x77, 0x9A, 0x80,
+0x50, 0x42, 0xAF, 0x90, 0x51, 0x60, 0xB7, 0x00, 0x52, 0x22, 0x91, 0x90, 0x53, 0x40, 0x99, 0x00,
+0x54, 0x0B, 0xAE, 0x10, 0x55, 0x20, 0x7B, 0x00, 0x55, 0xEB, 0x90, 0x10, 0x57, 0x00, 0x5D, 0x00,
+0x57, 0xCB, 0x72, 0x10, 0x58, 0xE0, 0x3F, 0x00, 0x59, 0xAB, 0x54, 0x10, 0x5A, 0xC0, 0x21, 0x00,
+0x5B, 0x8B, 0x36, 0x10, 0x5C, 0xA9, 0x3D, 0x80, 0x5D, 0x6B, 0x18, 0x10, 0x5E, 0x89, 0x1F, 0x80,
+0x5F, 0x54, 0x34, 0x90, 0x60, 0x69, 0x01, 0x80, 0x61, 0x34, 0x16, 0x90, 0x62, 0x48, 0xE3, 0x80,
+0x63, 0x13, 0xF8, 0x90, 0x64, 0x28, 0xC5, 0x80, 0x64, 0xF3, 0xDA, 0x90, 0x66, 0x11, 0xE2, 0x00,
+0x66, 0xD3, 0xBC, 0x90, 0x67, 0xF1, 0xC4, 0x00, 0x68, 0xBC, 0xD9, 0x10, 0x69, 0xD1, 0xA6, 0x00,
+0x6A, 0x9C, 0xBB, 0x10, 0x6B, 0xB1, 0x88, 0x00, 0x6C, 0x7C, 0x9D, 0x10, 0x6D, 0x91, 0x6A, 0x00,
+0x6E, 0x5C, 0x7F, 0x10, 0x6F, 0x71, 0x4C, 0x00, 0x70, 0x3C, 0x61, 0x10, 0x71, 0x5A, 0x68, 0x80,
+0x72, 0x1C, 0x43, 0x10, 0x73, 0x3A, 0x4A, 0x80, 0x74, 0x05, 0x5F, 0x90, 0x75, 0x1A, 0x2C, 0x80,
+0x75, 0xE5, 0x41, 0x90, 0x76, 0xFA, 0x0E, 0x80, 0x77, 0xC5, 0x23, 0x90, 0x78, 0xD9, 0xF0, 0x80,
+0x79, 0xA5, 0x05, 0x90, 0x7A, 0xB9, 0xD2, 0x80, 0x7B, 0x84, 0xE7, 0x90, 0x7C, 0xA2, 0xEF, 0x00,
+0x7D, 0x6E, 0x04, 0x10, 0x7E, 0x82, 0xD1, 0x00, 0x7F, 0x4D, 0xE6, 0x10, 0x01, 0x02, 0x01, 0x03,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00,
+0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0A,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x0E, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x01, 0x53, 0x57, 0x41, 0x54,
+0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x57, 0x41, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Adak */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0xCB, 0x89, 0x44, 0xD0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50,
+0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50,
+0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0,
+0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50,
+0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0,
+0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50,
+0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50,
+0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50,
+0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x22, 0x20, 0x1A, 0xF2, 0x50, 0xC0, 0x1B, 0xE2, 0x33, 0xB0,
+0x1C, 0xD2, 0x32, 0xC0, 0x1D, 0xC2, 0x15, 0xB0, 0x1E, 0xB2, 0x14, 0xC0, 0x1F, 0xA1, 0xF7, 0xB0,
+0x20, 0x76, 0x47, 0x40, 0x21, 0x81, 0xD9, 0xB0, 0x22, 0x56, 0x29, 0x40, 0x23, 0x6A, 0xF6, 0x30,
+0x24, 0x36, 0x0B, 0x40, 0x25, 0x4A, 0xD8, 0x30, 0x26, 0x15, 0xED, 0x40, 0x27, 0x2A, 0xBA, 0x30,
+0x27, 0xFF, 0x09, 0xC0, 0x29, 0x0A, 0x9C, 0x30, 0x29, 0xDE, 0xEB, 0xC0, 0x2A, 0xEA, 0x7E, 0x30,
+0x2B, 0xBE, 0xCD, 0xC0, 0x2C, 0xD3, 0x9A, 0xB0, 0x2D, 0x9E, 0xAF, 0xC0, 0x2E, 0xB3, 0x7C, 0xB0,
+0x2F, 0x7E, 0x91, 0xC0, 0x30, 0x93, 0x5E, 0xB0, 0x31, 0x67, 0xAE, 0x40, 0x32, 0x73, 0x40, 0xB0,
+0x33, 0x47, 0x90, 0x40, 0x34, 0x53, 0x22, 0xB0, 0x35, 0x27, 0x72, 0x40, 0x36, 0x33, 0x04, 0xB0,
+0x37, 0x07, 0x54, 0x40, 0x38, 0x1C, 0x21, 0x30, 0x38, 0xE7, 0x36, 0x40, 0x39, 0xFC, 0x03, 0x30,
+0x3A, 0xC7, 0x18, 0x40, 0x3B, 0xDB, 0xE5, 0x30, 0x3C, 0xB0, 0x34, 0xC0, 0x3D, 0xBB, 0xC7, 0x30,
+0x3E, 0x90, 0x16, 0xC0, 0x3F, 0x9B, 0xA9, 0x30, 0x40, 0x6F, 0xF8, 0xC0, 0x41, 0x84, 0xC5, 0xB0,
+0x42, 0x4F, 0xDA, 0xC0, 0x43, 0x64, 0xA7, 0xB0, 0x44, 0x2F, 0xBC, 0xC0, 0x45, 0x44, 0x89, 0xB0,
+0x45, 0xF3, 0xEF, 0x40, 0x47, 0x2D, 0xA6, 0x30, 0x47, 0xD3, 0xD1, 0x40, 0x49, 0x0D, 0x88, 0x30,
+0x49, 0xB3, 0xB3, 0x40, 0x4A, 0xED, 0x6A, 0x30, 0x4B, 0x9C, 0xCF, 0xC0, 0x4C, 0xD6, 0x86, 0xB0,
+0x4D, 0x7C, 0xB1, 0xC0, 0x4E, 0xB6, 0x68, 0xB0, 0x4F, 0x5C, 0x93, 0xC0, 0x50, 0x96, 0x4A, 0xB0,
+0x51, 0x3C, 0x75, 0xC0, 0x52, 0x76, 0x2C, 0xB0, 0x53, 0x1C, 0x57, 0xC0, 0x54, 0x56, 0x0E, 0xB0,
+0x54, 0xFC, 0x39, 0xC0, 0x56, 0x35, 0xF0, 0xB0, 0x56, 0xE5, 0x56, 0x40, 0x58, 0x1F, 0x0D, 0x30,
+0x58, 0xC5, 0x38, 0x40, 0x59, 0xFE, 0xEF, 0x30, 0x5A, 0xA5, 0x1A, 0x40, 0x5B, 0xDE, 0xD1, 0x30,
+0x5C, 0x84, 0xFC, 0x40, 0x5D, 0xBE, 0xB3, 0x30, 0x5E, 0x64, 0xDE, 0x40, 0x5F, 0x9E, 0x95, 0x30,
+0x60, 0x4D, 0xFA, 0xC0, 0x61, 0x87, 0xB1, 0xB0, 0x62, 0x2D, 0xDC, 0xC0, 0x63, 0x67, 0x93, 0xB0,
+0x64, 0x0D, 0xBE, 0xC0, 0x65, 0x47, 0x75, 0xB0, 0x65, 0xED, 0xA0, 0xC0, 0x67, 0x27, 0x57, 0xB0,
+0x67, 0xCD, 0x82, 0xC0, 0x69, 0x07, 0x39, 0xB0, 0x69, 0xAD, 0x64, 0xC0, 0x6A, 0xE7, 0x1B, 0xB0,
+0x6B, 0x96, 0x81, 0x40, 0x6C, 0xD0, 0x38, 0x30, 0x6D, 0x76, 0x63, 0x40, 0x6E, 0xB0, 0x1A, 0x30,
+0x6F, 0x56, 0x45, 0x40, 0x70, 0x8F, 0xFC, 0x30, 0x71, 0x36, 0x27, 0x40, 0x72, 0x6F, 0xDE, 0x30,
+0x73, 0x16, 0x09, 0x40, 0x74, 0x4F, 0xC0, 0x30, 0x74, 0xFF, 0x25, 0xC0, 0x76, 0x38, 0xDC, 0xB0,
+0x76, 0xDF, 0x07, 0xC0, 0x78, 0x18, 0xBE, 0xB0, 0x78, 0xBE, 0xE9, 0xC0, 0x79, 0xF8, 0xA0, 0xB0,
+0x7A, 0x9E, 0xCB, 0xC0, 0x7B, 0xD8, 0x82, 0xB0, 0x7C, 0x7E, 0xAD, 0xC0, 0x7D, 0xB8, 0x64, 0xB0,
+0x7E, 0x5E, 0x8F, 0xC0, 0x7F, 0x98, 0x46, 0xB0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73,
+0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF,
+0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x14, 0xFF, 0xFF, 0x81, 0x70, 0x01,
+0x19, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x1E, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E,
+0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00,
+0x48, 0x41, 0x44, 0x54, 0x00, 0x48, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Anchorage */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0xCB, 0x89, 0x36, 0xC0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x42, 0x30, 0xFA, 0xD2, 0x47, 0xA0, 0xFE, 0xB8, 0x63, 0x40,
+0xFF, 0xA8, 0x46, 0x30, 0x00, 0x98, 0x45, 0x40, 0x01, 0x88, 0x28, 0x30, 0x02, 0x78, 0x27, 0x40,
+0x03, 0x71, 0x44, 0xB0, 0x04, 0x61, 0x43, 0xC0, 0x05, 0x51, 0x26, 0xB0, 0x06, 0x41, 0x25, 0xC0,
+0x07, 0x31, 0x08, 0xB0, 0x07, 0x8D, 0x5F, 0xC0, 0x09, 0x10, 0xEA, 0xB0, 0x09, 0xAD, 0xDB, 0x40,
+0x0A, 0xF0, 0xCC, 0xB0, 0x0B, 0xE0, 0xCB, 0xC0, 0x0C, 0xD9, 0xE9, 0x30, 0x0D, 0xC0, 0xAD, 0xC0,
+0x0E, 0xB9, 0xCB, 0x30, 0x0F, 0xA9, 0xCA, 0x40, 0x10, 0x99, 0xAD, 0x30, 0x11, 0x89, 0xAC, 0x40,
+0x12, 0x79, 0x8F, 0x30, 0x13, 0x69, 0x8E, 0x40, 0x14, 0x59, 0x71, 0x30, 0x15, 0x49, 0x70, 0x40,
+0x16, 0x39, 0x53, 0x30, 0x17, 0x29, 0x52, 0x40, 0x18, 0x22, 0x6F, 0xB0, 0x19, 0x09, 0x34, 0x40,
+0x1A, 0x02, 0x51, 0xB0, 0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0,
+0x1C, 0xD2, 0x24, 0xB0, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0,
+0x20, 0x76, 0x39, 0x30, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20,
+0x24, 0x35, 0xFD, 0x30, 0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20,
+0x27, 0xFE, 0xFB, 0xB0, 0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20,
+0x2B, 0xBE, 0xBF, 0xB0, 0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0,
+0x2F, 0x7E, 0x83, 0xB0, 0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0,
+0x33, 0x47, 0x82, 0x30, 0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0,
+0x37, 0x07, 0x46, 0x30, 0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20,
+0x3A, 0xC7, 0x0A, 0x30, 0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20,
+0x3E, 0x90, 0x08, 0xB0, 0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0,
+0x42, 0x4F, 0xCC, 0xB0, 0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0,
+0x45, 0xF3, 0xE1, 0x30, 0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20,
+0x49, 0xB3, 0xA5, 0x30, 0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0,
+0x4D, 0x7C, 0xA3, 0xB0, 0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0,
+0x51, 0x3C, 0x67, 0xB0, 0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0,
+0x54, 0xFC, 0x2B, 0xB0, 0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20,
+0x58, 0xC5, 0x2A, 0x30, 0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20,
+0x5C, 0x84, 0xEE, 0x30, 0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20,
+0x60, 0x4D, 0xEC, 0xB0, 0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0,
+0x64, 0x0D, 0xB0, 0xB0, 0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0,
+0x67, 0xCD, 0x74, 0xB0, 0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0,
+0x6B, 0x96, 0x73, 0x30, 0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20,
+0x6F, 0x56, 0x37, 0x30, 0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20,
+0x73, 0x15, 0xFB, 0x30, 0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0,
+0x76, 0xDE, 0xF9, 0xB0, 0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0,
+0x7A, 0x9E, 0xBD, 0xB0, 0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0,
+0x7E, 0x5E, 0x81, 0xB0, 0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0x81,
+0x70, 0x01, 0x04, 0xFF, 0xFF, 0x81, 0x70, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x09, 0xFF,
+0xFF, 0x81, 0x70, 0x01, 0x0E, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x13, 0xFF, 0xFF, 0x8F, 0x80, 0x01,
+0x17, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x1C, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x57, 0x54, 0x00,
+0x41, 0x48, 0x53, 0x54, 0x00, 0x41, 0x48, 0x44, 0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x41, 0x4B,
+0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Anguilla */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x35, 0x20,
+0x01, 0xFF, 0xFF, 0xC4, 0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Antigua */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x37, 0x33, 0xF0,
+0xDC, 0x42, 0xDC, 0x50, 0x01, 0x02, 0xFF, 0xFF, 0xC6, 0x10, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0,
+0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00,
+0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Araguaina */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x30,
+0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20,
+0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20,
+0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20,
+0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0,
+0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0,
+0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0,
+0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0,
+0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20,
+0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, 0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20,
+0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, 0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0,
+0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0,
+0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0xFF, 0xFF, 0xD2, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5,
+0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Argentina/Buenos_Aires */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04,
+0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0,
+0x00, 0x04, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Argentina/Catamarca */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30,
+0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF,
+0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08,
+0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57,
+0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* America/Argentina/ComodRivadavia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30,
+0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF,
+0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08,
+0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57,
+0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* America/Argentina/Cordoba */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04,
+0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04,
+0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0,
+0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00,
+0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Argentina/Jujuy */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x2A, 0x57, 0xC0,
+0x27, 0xE2, 0xDB, 0xB0, 0x28, 0xEE, 0x8A, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x03, 0x04,
+0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04,
+0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0,
+0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D,
+0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00,
+0x57, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* America/Argentina/La_Rioja */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xCD, 0xB5, 0xA0, 0x28, 0x26, 0x26, 0x40, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0,
+0x2A, 0xE0, 0xD3, 0x30, 0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0,
+0x40, 0xBB, 0xF1, 0x30, 0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02,
+0x04, 0x05, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF,
+0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00,
+0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41,
+0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Argentina/Mendoza */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x19, 0x34, 0x40,
+0x27, 0xCD, 0xC3, 0xB0, 0x28, 0xFA, 0x67, 0xC0, 0x29, 0xB0, 0x48, 0xB0, 0x2A, 0xE0, 0xE1, 0x40,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xB0, 0x13, 0xB0,
+0x41, 0x56, 0x3E, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF,
+0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08,
+0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00,
+0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x57, 0x41, 0x52, 0x53, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Argentina/Rio_Gallegos */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30,
+0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF,
+0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08,
+0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57,
+0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* America/Argentina/San_Juan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xCD, 0xB5, 0xA0, 0x28, 0x26, 0x26, 0x40, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0,
+0x2A, 0xE0, 0xD3, 0x30, 0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0,
+0x40, 0xBA, 0x9F, 0xB0, 0x41, 0x03, 0x30, 0x40, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02,
+0x04, 0x05, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF,
+0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00,
+0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41,
+0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Argentina/Tucuman */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30,
+0x40, 0xCB, 0xD1, 0x40, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF,
+0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08,
+0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57,
+0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* America/Argentina/Ushuaia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xB9, 0x4E, 0x30,
+0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF,
+0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08,
+0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57,
+0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* America/Aruba */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2F, 0x38,
+0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBE, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8,
+0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4E, 0x54, 0x00,
+0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Asuncion */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xB8, 0x17, 0xF5, 0x90,
+0x05, 0x2B, 0xDA, 0x40, 0x07, 0xFC, 0xF0, 0xB0, 0x0A, 0xCF, 0x74, 0xC0, 0x0B, 0x97, 0xCA, 0xB0,
+0x0C, 0xB1, 0xF9, 0xC0, 0x0D, 0x78, 0xFE, 0x30, 0x0E, 0x93, 0x2D, 0x40, 0x0F, 0x5A, 0x31, 0xB0,
+0x10, 0x74, 0x60, 0xC0, 0x11, 0x64, 0x43, 0xB0, 0x12, 0x55, 0x94, 0x40, 0x13, 0x46, 0xC8, 0xB0,
+0x14, 0x38, 0x19, 0x40, 0x15, 0x27, 0xFC, 0x30, 0x16, 0x19, 0x4C, 0xC0, 0x17, 0x09, 0x2F, 0xB0,
+0x17, 0xFA, 0x80, 0x40, 0x18, 0xEA, 0x63, 0x30, 0x19, 0xDB, 0xB3, 0xC0, 0x1A, 0xCC, 0xE8, 0x30,
+0x1B, 0xBE, 0x38, 0xC0, 0x1C, 0xAE, 0x1B, 0xB0, 0x1D, 0x9F, 0x6C, 0x40, 0x1E, 0x8F, 0x4F, 0x30,
+0x1F, 0x80, 0x9F, 0xC0, 0x20, 0x70, 0x82, 0xB0, 0x21, 0x61, 0xD3, 0x40, 0x22, 0x53, 0x07, 0xB0,
+0x23, 0x44, 0x58, 0x40, 0x24, 0x34, 0x3B, 0x30, 0x25, 0x41, 0x3B, 0x40, 0x26, 0x15, 0x6E, 0xB0,
+0x27, 0x06, 0xBF, 0x40, 0x27, 0xF6, 0xA2, 0x30, 0x28, 0xEE, 0x8A, 0x40, 0x29, 0xB0, 0x48, 0xB0,
+0x2A, 0xCF, 0xBD, 0xC0, 0x2B, 0xB9, 0x09, 0x30, 0x2C, 0xAB, 0xAB, 0x40, 0x2D, 0x70, 0x0C, 0xB0,
+0x2E, 0x8C, 0xDE, 0xC0, 0x2F, 0x4F, 0xEE, 0xB0, 0x30, 0x6E, 0x12, 0x40, 0x31, 0x36, 0x68, 0x30,
+0x32, 0x57, 0x2E, 0xC0, 0x33, 0x0F, 0xB2, 0xB0, 0x34, 0x37, 0x10, 0xC0, 0x34, 0xF8, 0xCF, 0x30,
+0x36, 0x16, 0xF2, 0xC0, 0x36, 0xE1, 0xEB, 0xB0, 0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xC1, 0xCD, 0xB0,
+0x39, 0xD6, 0xB6, 0xC0, 0x3A, 0xA1, 0xAF, 0xB0, 0x3B, 0xBF, 0xD3, 0x40, 0x3C, 0xAF, 0xB6, 0x30,
+0x3D, 0x71, 0x90, 0xC0, 0x3E, 0x8F, 0x98, 0x30, 0x3F, 0x5A, 0xAD, 0x40, 0x40, 0x6F, 0x7A, 0x30,
+0x41, 0x71, 0xEE, 0x40, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x51, 0xD0, 0x40, 0x44, 0x13, 0x8E, 0xB0,
+0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x1A, 0xCE, 0xC0, 0x47, 0xD3, 0x52, 0xB0,
+0x48, 0xFA, 0xB0, 0xC0, 0x49, 0xB3, 0x34, 0xB0, 0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0x9C, 0x51, 0x30,
+0x4C, 0xBA, 0x74, 0xC0, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x9A, 0x56, 0xC0, 0x4F, 0x5C, 0x15, 0x30,
+0x50, 0x83, 0x73, 0x40, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x63, 0x55, 0x40, 0x53, 0x1B, 0xD9, 0x30,
+0x54, 0x43, 0x37, 0x40, 0x54, 0xFB, 0xBB, 0x30, 0x56, 0x23, 0x19, 0x40, 0x56, 0xE4, 0xD7, 0xB0,
+0x58, 0x02, 0xFB, 0x40, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0xA4, 0x9B, 0xB0,
+0x5B, 0xCB, 0xF9, 0xC0, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xAB, 0xDB, 0xC0, 0x5E, 0x64, 0x5F, 0xB0,
+0x5F, 0x8B, 0xBD, 0xC0, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x6B, 0x9F, 0xC0, 0x62, 0x2D, 0x5E, 0x30,
+0x63, 0x4B, 0x81, 0xC0, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xED, 0x22, 0x30,
+0x67, 0x14, 0x80, 0x40, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xF4, 0x62, 0x40, 0x69, 0xAC, 0xE6, 0x30,
+0x6A, 0xD4, 0x44, 0x40, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xB4, 0x26, 0x40, 0x6D, 0x75, 0xE4, 0xB0,
+0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x7D, 0x24, 0xC0, 0x71, 0x35, 0xA8, 0xB0,
+0x72, 0x5D, 0x06, 0xC0, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x3C, 0xE8, 0xC0, 0x74, 0xFE, 0xA7, 0x30,
+0x76, 0x1C, 0xCA, 0xC0, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xFC, 0xAC, 0xC0, 0x78, 0xBE, 0x6B, 0x30,
+0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xC5, 0xAB, 0x40, 0x7C, 0x7E, 0x2F, 0x30,
+0x7D, 0xA5, 0x8D, 0x40, 0x7E, 0x5E, 0x11, 0x30, 0x7F, 0x85, 0x6F, 0x40, 0x01, 0x02, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0xFF, 0xFF, 0xC9, 0xF0,
+0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF,
+0xD5, 0xD0, 0x01, 0x08, 0x41, 0x4D, 0x54, 0x00, 0x50, 0x59, 0x54, 0x00, 0x50, 0x59, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Atka */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0xCB, 0x89, 0x44, 0xD0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50,
+0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50,
+0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0,
+0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50,
+0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0,
+0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50,
+0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50,
+0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50,
+0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x22, 0x20, 0x1A, 0xF2, 0x50, 0xC0, 0x1B, 0xE2, 0x33, 0xB0,
+0x1C, 0xD2, 0x32, 0xC0, 0x1D, 0xC2, 0x15, 0xB0, 0x1E, 0xB2, 0x14, 0xC0, 0x1F, 0xA1, 0xF7, 0xB0,
+0x20, 0x76, 0x47, 0x40, 0x21, 0x81, 0xD9, 0xB0, 0x22, 0x56, 0x29, 0x40, 0x23, 0x6A, 0xF6, 0x30,
+0x24, 0x36, 0x0B, 0x40, 0x25, 0x4A, 0xD8, 0x30, 0x26, 0x15, 0xED, 0x40, 0x27, 0x2A, 0xBA, 0x30,
+0x27, 0xFF, 0x09, 0xC0, 0x29, 0x0A, 0x9C, 0x30, 0x29, 0xDE, 0xEB, 0xC0, 0x2A, 0xEA, 0x7E, 0x30,
+0x2B, 0xBE, 0xCD, 0xC0, 0x2C, 0xD3, 0x9A, 0xB0, 0x2D, 0x9E, 0xAF, 0xC0, 0x2E, 0xB3, 0x7C, 0xB0,
+0x2F, 0x7E, 0x91, 0xC0, 0x30, 0x93, 0x5E, 0xB0, 0x31, 0x67, 0xAE, 0x40, 0x32, 0x73, 0x40, 0xB0,
+0x33, 0x47, 0x90, 0x40, 0x34, 0x53, 0x22, 0xB0, 0x35, 0x27, 0x72, 0x40, 0x36, 0x33, 0x04, 0xB0,
+0x37, 0x07, 0x54, 0x40, 0x38, 0x1C, 0x21, 0x30, 0x38, 0xE7, 0x36, 0x40, 0x39, 0xFC, 0x03, 0x30,
+0x3A, 0xC7, 0x18, 0x40, 0x3B, 0xDB, 0xE5, 0x30, 0x3C, 0xB0, 0x34, 0xC0, 0x3D, 0xBB, 0xC7, 0x30,
+0x3E, 0x90, 0x16, 0xC0, 0x3F, 0x9B, 0xA9, 0x30, 0x40, 0x6F, 0xF8, 0xC0, 0x41, 0x84, 0xC5, 0xB0,
+0x42, 0x4F, 0xDA, 0xC0, 0x43, 0x64, 0xA7, 0xB0, 0x44, 0x2F, 0xBC, 0xC0, 0x45, 0x44, 0x89, 0xB0,
+0x45, 0xF3, 0xEF, 0x40, 0x47, 0x2D, 0xA6, 0x30, 0x47, 0xD3, 0xD1, 0x40, 0x49, 0x0D, 0x88, 0x30,
+0x49, 0xB3, 0xB3, 0x40, 0x4A, 0xED, 0x6A, 0x30, 0x4B, 0x9C, 0xCF, 0xC0, 0x4C, 0xD6, 0x86, 0xB0,
+0x4D, 0x7C, 0xB1, 0xC0, 0x4E, 0xB6, 0x68, 0xB0, 0x4F, 0x5C, 0x93, 0xC0, 0x50, 0x96, 0x4A, 0xB0,
+0x51, 0x3C, 0x75, 0xC0, 0x52, 0x76, 0x2C, 0xB0, 0x53, 0x1C, 0x57, 0xC0, 0x54, 0x56, 0x0E, 0xB0,
+0x54, 0xFC, 0x39, 0xC0, 0x56, 0x35, 0xF0, 0xB0, 0x56, 0xE5, 0x56, 0x40, 0x58, 0x1F, 0x0D, 0x30,
+0x58, 0xC5, 0x38, 0x40, 0x59, 0xFE, 0xEF, 0x30, 0x5A, 0xA5, 0x1A, 0x40, 0x5B, 0xDE, 0xD1, 0x30,
+0x5C, 0x84, 0xFC, 0x40, 0x5D, 0xBE, 0xB3, 0x30, 0x5E, 0x64, 0xDE, 0x40, 0x5F, 0x9E, 0x95, 0x30,
+0x60, 0x4D, 0xFA, 0xC0, 0x61, 0x87, 0xB1, 0xB0, 0x62, 0x2D, 0xDC, 0xC0, 0x63, 0x67, 0x93, 0xB0,
+0x64, 0x0D, 0xBE, 0xC0, 0x65, 0x47, 0x75, 0xB0, 0x65, 0xED, 0xA0, 0xC0, 0x67, 0x27, 0x57, 0xB0,
+0x67, 0xCD, 0x82, 0xC0, 0x69, 0x07, 0x39, 0xB0, 0x69, 0xAD, 0x64, 0xC0, 0x6A, 0xE7, 0x1B, 0xB0,
+0x6B, 0x96, 0x81, 0x40, 0x6C, 0xD0, 0x38, 0x30, 0x6D, 0x76, 0x63, 0x40, 0x6E, 0xB0, 0x1A, 0x30,
+0x6F, 0x56, 0x45, 0x40, 0x70, 0x8F, 0xFC, 0x30, 0x71, 0x36, 0x27, 0x40, 0x72, 0x6F, 0xDE, 0x30,
+0x73, 0x16, 0x09, 0x40, 0x74, 0x4F, 0xC0, 0x30, 0x74, 0xFF, 0x25, 0xC0, 0x76, 0x38, 0xDC, 0xB0,
+0x76, 0xDF, 0x07, 0xC0, 0x78, 0x18, 0xBE, 0xB0, 0x78, 0xBE, 0xE9, 0xC0, 0x79, 0xF8, 0xA0, 0xB0,
+0x7A, 0x9E, 0xCB, 0xC0, 0x7B, 0xD8, 0x82, 0xB0, 0x7C, 0x7E, 0xAD, 0xC0, 0x7D, 0xB8, 0x64, 0xB0,
+0x7E, 0x5E, 0x8F, 0xC0, 0x7F, 0x98, 0x46, 0xB0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73,
+0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF,
+0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x14, 0xFF, 0xFF, 0x81, 0x70, 0x01,
+0x19, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x1E, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E,
+0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00,
+0x48, 0x41, 0x44, 0x54, 0x00, 0x48, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Bahia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x6B, 0x1C,
+0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20,
+0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20,
+0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20,
+0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0,
+0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0,
+0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0,
+0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0,
+0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20,
+0x27, 0x21, 0x0F, 0x30, 0x27, 0xBD, 0xE3, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0x94, 0x8B, 0x20,
+0x2A, 0xEA, 0x0D, 0xB0, 0x2B, 0x6B, 0x32, 0xA0, 0x2C, 0xC0, 0xB5, 0x30, 0x2D, 0x66, 0xC4, 0x20,
+0x2E, 0xA0, 0x97, 0x30, 0x2F, 0x46, 0xA6, 0x20, 0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0,
+0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20,
+0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20,
+0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0,
+0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0xFF, 0xFF, 0xDB, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF,
+0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Barbados */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA9, 0x79, 0x24, 0xE4,
+0xB8, 0x85, 0x63, 0xE4, 0x0E, 0x00, 0xF2, 0xE0, 0x0E, 0x94, 0x8C, 0xD0, 0x0F, 0x97, 0x00, 0xE0,
+0x10, 0x74, 0x6E, 0xD0, 0x11, 0x76, 0xE2, 0xE0, 0x12, 0x54, 0x50, 0xD0, 0x13, 0x5F, 0xFF, 0x60,
+0x14, 0x30, 0x3E, 0x50, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0xFF, 0xFF,
+0xC8, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xC8, 0x1C, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08,
+0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x41, 0x44,
+0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Belem */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x74,
+0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20,
+0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20,
+0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20,
+0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0,
+0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0,
+0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0,
+0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xD2,
+0x8C, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C,
+0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* America/Belize */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x93, 0x5E, 0xD9, 0xB0,
+0x9F, 0x9F, 0x3B, 0xE0, 0xA0, 0x45, 0x51, 0xD8, 0xA1, 0x7F, 0x1D, 0xE0, 0xA2, 0x2E, 0x6E, 0x58,
+0xA3, 0x5E, 0xFF, 0xE0, 0xA4, 0x0E, 0x50, 0x58, 0xA5, 0x3E, 0xE1, 0xE0, 0xA5, 0xEE, 0x32, 0x58,
+0xA7, 0x27, 0xFE, 0x60, 0xA7, 0xCE, 0x14, 0x58, 0xA9, 0x07, 0xE0, 0x60, 0xA9, 0xAD, 0xF6, 0x58,
+0xAA, 0xE7, 0xC2, 0x60, 0xAB, 0x97, 0x12, 0xD8, 0xAC, 0xC7, 0xA4, 0x60, 0xAD, 0x76, 0xF4, 0xD8,
+0xAE, 0xA7, 0x86, 0x60, 0xAF, 0x56, 0xD6, 0xD8, 0xB0, 0x87, 0x68, 0x60, 0xB1, 0x36, 0xB8, 0xD8,
+0xB2, 0x70, 0x84, 0xE0, 0xB3, 0x16, 0x9A, 0xD8, 0xB4, 0x50, 0x66, 0xE0, 0xB4, 0xF6, 0x7C, 0xD8,
+0xB6, 0x30, 0x48, 0xE0, 0xB6, 0xDF, 0x99, 0x58, 0xB8, 0x10, 0x2A, 0xE0, 0xB8, 0xBF, 0x7B, 0x58,
+0xB9, 0xF0, 0x0C, 0xE0, 0xBA, 0x9F, 0x5D, 0x58, 0xBB, 0xD9, 0x29, 0x60, 0xBC, 0x7F, 0x3F, 0x58,
+0xBD, 0xB9, 0x0B, 0x60, 0xBE, 0x5F, 0x21, 0x58, 0xBF, 0x98, 0xED, 0x60, 0xC0, 0x3F, 0x03, 0x58,
+0xC1, 0x78, 0xCF, 0x60, 0xC2, 0x28, 0x1F, 0xD8, 0xC3, 0x58, 0xB1, 0x60, 0xC4, 0x08, 0x01, 0xD8,
+0xC5, 0x38, 0x93, 0x60, 0xC5, 0xE7, 0xE3, 0xD8, 0xC7, 0x21, 0xAF, 0xE0, 0xC7, 0xC7, 0xC5, 0xD8,
+0xC9, 0x01, 0x91, 0xE0, 0xC9, 0xA7, 0xA7, 0xD8, 0xCA, 0xE1, 0x73, 0xE0, 0xCB, 0x90, 0xC4, 0x58,
+0xCC, 0xC1, 0x55, 0xE0, 0xCD, 0x70, 0xA6, 0x58, 0x07, 0x62, 0xDB, 0x60, 0x07, 0xB9, 0xD0, 0x50,
+0x18, 0x61, 0x71, 0x60, 0x18, 0xAB, 0x37, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0xFF,
+0xFF, 0xAD, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xB2, 0xA8, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00,
+0x09, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x48, 0x44, 0x54, 0x00,
+0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* America/Boa_Vista */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7F, 0xE0,
+0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30,
+0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30,
+0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30,
+0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0,
+0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0,
+0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0,
+0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0,
+0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xB8, 0x93, 0x30, 0x39, 0xDF, 0xF1, 0x40, 0x39, 0xE9, 0x1D, 0xB0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0xFF, 0xFF, 0xC7, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7,
+0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Bogota */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x98, 0x58, 0x55, 0x74,
+0x2A, 0x02, 0x21, 0xD0, 0x2B, 0x42, 0x70, 0x40, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBA, 0x8C, 0x00,
+0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x42, 0x4D, 0x54,
+0x00, 0x43, 0x4F, 0x53, 0x54, 0x00, 0x43, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* America/Boise */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x48, 0xA0,
+0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xA8, 0x46, 0x4C, 0x20,
+0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xFA, 0xF8, 0x75, 0x10,
+0xFB, 0xE8, 0x58, 0x00, 0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10,
+0xFF, 0xA8, 0x1C, 0x00, 0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10,
+0x03, 0x71, 0x1A, 0x80, 0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90,
+0x07, 0x30, 0xDE, 0x80, 0x07, 0xB2, 0x1F, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10,
+0x0A, 0xF0, 0xA2, 0x80, 0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90,
+0x0E, 0xB9, 0xA1, 0x00, 0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10,
+0x12, 0x79, 0x65, 0x00, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10,
+0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10,
+0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90,
+0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10,
+0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10,
+0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90,
+0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90,
+0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90,
+0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10,
+0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10,
+0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10,
+0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90,
+0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90,
+0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10,
+0x47, 0x2D, 0x7C, 0x00, 0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10,
+0x4A, 0xED, 0x40, 0x00, 0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90,
+0x4E, 0xB6, 0x3E, 0x80, 0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90,
+0x52, 0x76, 0x02, 0x80, 0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90,
+0x56, 0x35, 0xC6, 0x80, 0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10,
+0x59, 0xFE, 0xC5, 0x00, 0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10,
+0x5D, 0xBE, 0x89, 0x00, 0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90,
+0x61, 0x87, 0x87, 0x80, 0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90,
+0x65, 0x47, 0x4B, 0x80, 0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90,
+0x69, 0x07, 0x0F, 0x80, 0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10,
+0x6C, 0xD0, 0x0E, 0x00, 0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10,
+0x70, 0x8F, 0xD2, 0x00, 0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10,
+0x74, 0x4F, 0x96, 0x00, 0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90,
+0x78, 0x18, 0x94, 0x80, 0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90,
+0x7B, 0xD8, 0x58, 0x80, 0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90,
+0x7F, 0x98, 0x1C, 0x80, 0x00, 0x01, 0x00, 0x01, 0x04, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00,
+0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0,
+0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x14, 0x50, 0x44,
+0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x4D, 0x53,
+0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x00, 0x00,
+
+/* America/Buenos_Aires */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04,
+0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0,
+0x00, 0x04, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Cambridge_Bay */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0x9E, 0xB8, 0xAF, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0xCF, 0xF0, 0x90, 0xA1, 0xA2, 0xB6, 0x60, 0xCB, 0x89, 0x0C, 0x90,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x85, 0xF0,
+0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80,
+0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0x04, 0xE9, 0x50, 0x3A, 0xC6, 0xEE, 0x10,
+0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90,
+0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90,
+0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90,
+0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10,
+0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10,
+0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90,
+0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90,
+0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90,
+0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10,
+0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10,
+0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10,
+0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90,
+0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90,
+0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90,
+0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10,
+0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10,
+0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10,
+0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90,
+0x7F, 0x8E, 0xE2, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x06, 0x05, 0x07, 0x06, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF,
+0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x10,
+0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x15, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x19, 0xFF, 0xFF, 0xB9, 0xB0,
+0x00, 0x1D, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50,
+0x54, 0x00, 0x4D, 0x44, 0x44, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00, 0x00, 0x00,
+
+/* America/Campo_Grande */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7A, 0x34,
+0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30,
+0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30,
+0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30,
+0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0,
+0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0,
+0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0,
+0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0,
+0x23, 0x58, 0x1E, 0xC0, 0x23, 0xE2, 0x7E, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x25, 0xD4, 0xD5, 0x30,
+0x27, 0x21, 0x1D, 0x40, 0x27, 0xBD, 0xF1, 0xB0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0x94, 0x99, 0x30,
+0x2A, 0xEA, 0x1B, 0xC0, 0x2B, 0x6B, 0x40, 0xB0, 0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30,
+0x2E, 0xA0, 0xA5, 0x40, 0x2F, 0x46, 0xB4, 0x30, 0x30, 0x80, 0x87, 0x40, 0x31, 0x1D, 0x5B, 0xB0,
+0x32, 0x57, 0x2E, 0xC0, 0x33, 0x06, 0x78, 0x30, 0x34, 0x38, 0x62, 0x40, 0x34, 0xF8, 0xCF, 0x30,
+0x36, 0x20, 0x2D, 0x40, 0x36, 0xCF, 0x76, 0xB0, 0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xB8, 0x93, 0x30,
+0x39, 0xDF, 0xF1, 0x40, 0x3A, 0x8F, 0x3A, 0xB0, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x6F, 0x1C, 0xB0,
+0x3D, 0xC4, 0x9F, 0x40, 0x3E, 0x4E, 0xFE, 0xB0, 0x3F, 0x92, 0x0C, 0x40, 0x40, 0x2E, 0xE0, 0xB0,
+0x41, 0x87, 0x06, 0x40, 0x42, 0x17, 0xFD, 0x30, 0x43, 0x51, 0xD0, 0x40, 0x43, 0xF7, 0xDF, 0x30,
+0x45, 0x31, 0xB2, 0x40, 0x45, 0xD7, 0xC1, 0x30, 0x47, 0x1A, 0xCE, 0xC0, 0x47, 0xB7, 0xA3, 0x30,
+0x48, 0xFA, 0xB0, 0xC0, 0x49, 0x97, 0x85, 0x30, 0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0x80, 0xA1, 0xB0,
+0x4C, 0xBA, 0x74, 0xC0, 0x4D, 0x60, 0x83, 0xB0, 0x4E, 0x9A, 0x56, 0xC0, 0x4F, 0x40, 0x65, 0xB0,
+0x50, 0x83, 0x73, 0x40, 0x51, 0x20, 0x47, 0xB0, 0x52, 0x63, 0x55, 0x40, 0x53, 0x00, 0x29, 0xB0,
+0x54, 0x43, 0x37, 0x40, 0x54, 0xE0, 0x0B, 0xB0, 0x56, 0x23, 0x19, 0x40, 0x56, 0xC9, 0x28, 0x30,
+0x58, 0x02, 0xFB, 0x40, 0x58, 0xA9, 0x0A, 0x30, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0x88, 0xEC, 0x30,
+0x5B, 0xCB, 0xF9, 0xC0, 0x5C, 0x68, 0xCE, 0x30, 0x5D, 0xAB, 0xDB, 0xC0, 0x5E, 0x48, 0xB0, 0x30,
+0x5F, 0x8B, 0xBD, 0xC0, 0x60, 0x31, 0xCC, 0xB0, 0x61, 0x6B, 0x9F, 0xC0, 0x62, 0x11, 0xAE, 0xB0,
+0x63, 0x4B, 0x81, 0xC0, 0x63, 0xF1, 0x90, 0xB0, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xD1, 0x72, 0xB0,
+0x67, 0x14, 0x80, 0x40, 0x67, 0xB1, 0x54, 0xB0, 0x68, 0xF4, 0x62, 0x40, 0x69, 0x91, 0x36, 0xB0,
+0x6A, 0xD4, 0x44, 0x40, 0x6B, 0x7A, 0x53, 0x30, 0x6C, 0xB4, 0x26, 0x40, 0x6D, 0x5A, 0x35, 0x30,
+0x6E, 0x94, 0x08, 0x40, 0x6F, 0x3A, 0x17, 0x30, 0x70, 0x7D, 0x24, 0xC0, 0x71, 0x19, 0xF9, 0x30,
+0x72, 0x5D, 0x06, 0xC0, 0x72, 0xF9, 0xDB, 0x30, 0x74, 0x3C, 0xE8, 0xC0, 0x74, 0xD9, 0xBD, 0x30,
+0x76, 0x1C, 0xCA, 0xC0, 0x76, 0xC2, 0xD9, 0xB0, 0x77, 0xFC, 0xAC, 0xC0, 0x78, 0xA2, 0xBB, 0xB0,
+0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x82, 0x9D, 0xB0, 0x7B, 0xC5, 0xAB, 0x40, 0x7C, 0x62, 0x7F, 0xB0,
+0x7D, 0xA5, 0x8D, 0x40, 0x7E, 0x42, 0x61, 0xB0, 0x7F, 0x85, 0x6F, 0x40, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xCC, 0xCC,
+0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D,
+0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* America/Cancun */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xDA, 0x60,
+0x16, 0x86, 0xD5, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0,
+0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x35, 0xC4, 0x00, 0x60, 0x36, 0x32, 0xCC, 0x70,
+0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0,
+0x3A, 0xF5, 0x04, 0x80, 0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0,
+0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70,
+0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70,
+0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70,
+0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0,
+0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0,
+0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0,
+0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70,
+0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70,
+0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70,
+0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0,
+0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0,
+0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0,
+0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70,
+0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70,
+0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0,
+0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0,
+0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0,
+0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF,
+0xFF, 0xAE, 0xA8, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01,
+0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x10, 0x4C, 0x4D, 0x54,
+0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Caracas */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x93, 0x1E, 0x2C, 0x3C,
+0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xC1, 0x44, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8,
+0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x43, 0x4D, 0x54, 0x00, 0x56, 0x45, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Catamarca */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30,
+0x40, 0xD5, 0x0B, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF,
+0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08,
+0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57,
+0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* America/Cayenne */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x2B, 0x90,
+0xFB, 0xC3, 0x35, 0xC0, 0x01, 0x02, 0xFF, 0xFF, 0xCE, 0xF0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x46, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Cayman */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x0F, 0xB5, 0x00,
+0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x4B, 0x4D, 0x54,
+0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Chicago */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA2, 0xCB, 0x74, 0x00,
+0xA3, 0x83, 0xF7, 0xF0, 0xA4, 0x45, 0xD2, 0x80, 0xA5, 0x63, 0xD9, 0xF0, 0xA6, 0x53, 0xD9, 0x00,
+0xA7, 0x15, 0x97, 0x70, 0xA8, 0x33, 0xBB, 0x00, 0xA8, 0xFE, 0xB3, 0xF0, 0xAA, 0x13, 0x9D, 0x00,
+0xAA, 0xDE, 0x95, 0xF0, 0xAB, 0xF3, 0x7F, 0x00, 0xAC, 0xBE, 0x77, 0xF0, 0xAD, 0xD3, 0x61, 0x00,
+0xAE, 0x9E, 0x59, 0xF0, 0xAF, 0xB3, 0x43, 0x00, 0xB0, 0x7E, 0x3B, 0xF0, 0xB1, 0x9C, 0x5F, 0x80,
+0xB2, 0x67, 0x58, 0x70, 0xB3, 0x7C, 0x41, 0x80, 0xB4, 0x47, 0x3A, 0x70, 0xB5, 0x5C, 0x23, 0x80,
+0xB6, 0x27, 0x1C, 0x70, 0xB7, 0x3C, 0x05, 0x80, 0xB8, 0x06, 0xFE, 0x70, 0xB9, 0x1B, 0xE7, 0x80,
+0xB9, 0xE6, 0xE0, 0x70, 0xBB, 0x05, 0x04, 0x00, 0xBB, 0xC6, 0xC2, 0x70, 0xBC, 0xE4, 0xE6, 0x00,
+0xBD, 0xAF, 0xDE, 0xF0, 0xBE, 0xC4, 0xC8, 0x00, 0xBF, 0x8F, 0xC0, 0xF0, 0xC0, 0x5A, 0xD6, 0x00,
+0xC1, 0xB0, 0x3C, 0x70, 0xC2, 0x84, 0x8C, 0x00, 0xC3, 0x4F, 0x84, 0xF0, 0xC4, 0x64, 0x6E, 0x00,
+0xC5, 0x2F, 0x66, 0xF0, 0xC6, 0x4D, 0x8A, 0x80, 0xC7, 0x0F, 0x48, 0xF0, 0xC8, 0x2D, 0x6C, 0x80,
+0xC8, 0xF8, 0x65, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0,
+0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, 0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0,
+0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, 0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0,
+0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, 0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70,
+0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70,
+0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0,
+0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0,
+0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70,
+0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70,
+0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xF6, 0x3F, 0x69, 0x70,
+0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x85, 0xF0, 0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0,
+0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0,
+0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0,
+0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70,
+0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70,
+0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0,
+0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0,
+0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0,
+0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70,
+0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70,
+0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70,
+0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0,
+0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0,
+0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0,
+0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70,
+0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70,
+0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70,
+0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0,
+0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0,
+0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70,
+0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70,
+0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0,
+0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70,
+0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70,
+0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70,
+0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0,
+0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0,
+0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0,
+0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70,
+0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70,
+0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70,
+0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0,
+0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0,
+0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70,
+0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70,
+0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70,
+0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF,
+0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54,
+0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
+
+/* America/Chihuahua */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70,
+0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60,
+0xB8, 0xFD, 0x86, 0xF0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00,
+0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10,
+0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xF5, 0x12, 0x90,
+0x3B, 0xB6, 0xD1, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90,
+0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90,
+0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90,
+0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10,
+0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10,
+0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90,
+0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90,
+0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90,
+0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10,
+0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10,
+0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10,
+0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90,
+0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90,
+0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90,
+0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10,
+0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10,
+0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10,
+0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90,
+0x7F, 0x8E, 0xE2, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF,
+0x9C, 0x8C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08,
+0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00,
+0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Coral_Harbour */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70,
+0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0xCF, 0xD4, 0x70, 0xA1, 0xA2, 0x9A, 0x40, 0xCB, 0x88, 0xF0, 0x70,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0xFF,
+0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01,
+0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45,
+0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* America/Cordoba */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04,
+0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04,
+0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0,
+0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00,
+0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Costa_Rica */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xA3, 0xE8, 0x16, 0x54,
+0x11, 0x36, 0x49, 0x60, 0x11, 0xB7, 0x6E, 0x50, 0x13, 0x16, 0x2B, 0x60, 0x13, 0x97, 0x50, 0x50,
+0x27, 0x97, 0xE0, 0x60, 0x28, 0x6E, 0xB6, 0xD0, 0x29, 0x77, 0xC2, 0x60, 0x29, 0xC2, 0xD9, 0xD0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xB1, 0x2C, 0x00, 0x00, 0xFF,
+0xFF, 0xB9, 0xB0, 0x01, 0x05, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x09, 0x53, 0x4A, 0x4D, 0x54, 0x00,
+0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Cuiaba */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7B, 0x94,
+0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30,
+0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30,
+0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30,
+0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0,
+0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0,
+0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0,
+0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0,
+0x23, 0x58, 0x1E, 0xC0, 0x23, 0xE2, 0x7E, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x25, 0xD4, 0xD5, 0x30,
+0x27, 0x21, 0x1D, 0x40, 0x27, 0xBD, 0xF1, 0xB0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0x94, 0x99, 0x30,
+0x2A, 0xEA, 0x1B, 0xC0, 0x2B, 0x6B, 0x40, 0xB0, 0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30,
+0x2E, 0xA0, 0xA5, 0x40, 0x2F, 0x46, 0xB4, 0x30, 0x30, 0x80, 0x87, 0x40, 0x31, 0x1D, 0x5B, 0xB0,
+0x32, 0x57, 0x2E, 0xC0, 0x33, 0x06, 0x78, 0x30, 0x34, 0x38, 0x62, 0x40, 0x34, 0xF8, 0xCF, 0x30,
+0x36, 0x20, 0x2D, 0x40, 0x36, 0xCF, 0x76, 0xB0, 0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xB8, 0x93, 0x30,
+0x39, 0xDF, 0xF1, 0x40, 0x3A, 0x8F, 0x3A, 0xB0, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x6F, 0x1C, 0xB0,
+0x3D, 0xC4, 0x9F, 0x40, 0x3E, 0x4E, 0xFE, 0xB0, 0x41, 0x87, 0x06, 0x40, 0x42, 0x17, 0xFD, 0x30,
+0x43, 0x51, 0xD0, 0x40, 0x43, 0xF7, 0xDF, 0x30, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xD7, 0xC1, 0x30,
+0x47, 0x1A, 0xCE, 0xC0, 0x47, 0xB7, 0xA3, 0x30, 0x48, 0xFA, 0xB0, 0xC0, 0x49, 0x97, 0x85, 0x30,
+0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0x80, 0xA1, 0xB0, 0x4C, 0xBA, 0x74, 0xC0, 0x4D, 0x60, 0x83, 0xB0,
+0x4E, 0x9A, 0x56, 0xC0, 0x4F, 0x40, 0x65, 0xB0, 0x50, 0x83, 0x73, 0x40, 0x51, 0x20, 0x47, 0xB0,
+0x52, 0x63, 0x55, 0x40, 0x53, 0x00, 0x29, 0xB0, 0x54, 0x43, 0x37, 0x40, 0x54, 0xE0, 0x0B, 0xB0,
+0x56, 0x23, 0x19, 0x40, 0x56, 0xC9, 0x28, 0x30, 0x58, 0x02, 0xFB, 0x40, 0x58, 0xA9, 0x0A, 0x30,
+0x59, 0xE2, 0xDD, 0x40, 0x5A, 0x88, 0xEC, 0x30, 0x5B, 0xCB, 0xF9, 0xC0, 0x5C, 0x68, 0xCE, 0x30,
+0x5D, 0xAB, 0xDB, 0xC0, 0x5E, 0x48, 0xB0, 0x30, 0x5F, 0x8B, 0xBD, 0xC0, 0x60, 0x31, 0xCC, 0xB0,
+0x61, 0x6B, 0x9F, 0xC0, 0x62, 0x11, 0xAE, 0xB0, 0x63, 0x4B, 0x81, 0xC0, 0x63, 0xF1, 0x90, 0xB0,
+0x65, 0x2B, 0x63, 0xC0, 0x65, 0xD1, 0x72, 0xB0, 0x67, 0x14, 0x80, 0x40, 0x67, 0xB1, 0x54, 0xB0,
+0x68, 0xF4, 0x62, 0x40, 0x69, 0x91, 0x36, 0xB0, 0x6A, 0xD4, 0x44, 0x40, 0x6B, 0x7A, 0x53, 0x30,
+0x6C, 0xB4, 0x26, 0x40, 0x6D, 0x5A, 0x35, 0x30, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x3A, 0x17, 0x30,
+0x70, 0x7D, 0x24, 0xC0, 0x71, 0x19, 0xF9, 0x30, 0x72, 0x5D, 0x06, 0xC0, 0x72, 0xF9, 0xDB, 0x30,
+0x74, 0x3C, 0xE8, 0xC0, 0x74, 0xD9, 0xBD, 0x30, 0x76, 0x1C, 0xCA, 0xC0, 0x76, 0xC2, 0xD9, 0xB0,
+0x77, 0xFC, 0xAC, 0xC0, 0x78, 0xA2, 0xBB, 0xB0, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x82, 0x9D, 0xB0,
+0x7B, 0xC5, 0xAB, 0x40, 0x7C, 0x62, 0x7F, 0xB0, 0x7D, 0xA5, 0x8D, 0x40, 0x7E, 0x42, 0x61, 0xB0,
+0x7F, 0x85, 0x6F, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0xFF, 0xFF, 0xCB, 0x6C, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF,
+0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Curacao */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2E, 0x20,
+0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBF, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8,
+0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4E, 0x54, 0x00,
+0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Danmarkshavn */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x9B, 0x80, 0x49, 0x00,
+0x13, 0x4D, 0x7C, 0x50, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x30, 0xE7, 0x4E, 0x30, 0x01, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x05, 0xFF, 0xFF, 0xEE, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0,
+0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF,
+0xE3, 0xE0, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x47,
+0x54, 0x00, 0x57, 0x47, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+
+/* America/Dawson */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xCB, 0xB0,
+0x9F, 0xBB, 0x23, 0xA0, 0xA0, 0xD0, 0x0C, 0xB0, 0xA1, 0xA2, 0xD2, 0x80, 0xCB, 0x89, 0x28, 0xB0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0xA2, 0x10,
+0x07, 0x30, 0xEC, 0x90, 0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20,
+0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20,
+0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0,
+0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20,
+0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20,
+0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0,
+0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0,
+0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0,
+0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20,
+0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20,
+0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20,
+0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0,
+0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0,
+0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0,
+0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20,
+0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20,
+0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0,
+0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0,
+0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0,
+0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20,
+0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20,
+0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20,
+0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0,
+0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0,
+0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0,
+0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20,
+0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20,
+0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20,
+0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0,
+0x7F, 0x8E, 0xF0, 0x10, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0xFF, 0xFF,
+0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10,
+0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x15, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x19, 0x59, 0x44, 0x54, 0x00,
+0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, 0x54, 0x00, 0x59, 0x44, 0x44, 0x54,
+0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+
+/* America/Dawson_Creek */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xB8, 0xBD, 0xA0,
+0x9F, 0xC0, 0x5B, 0x90, 0xCB, 0x89, 0x1A, 0xA0, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10,
+0xD5, 0x55, 0xF1, 0x20, 0xD6, 0x20, 0xEA, 0x10, 0xD7, 0x35, 0xD3, 0x20, 0xD8, 0x00, 0xCC, 0x10,
+0xD9, 0x15, 0xB5, 0x20, 0xD9, 0xE0, 0xAE, 0x10, 0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10,
+0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, 0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90,
+0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90,
+0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10,
+0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10,
+0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10,
+0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, 0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90,
+0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, 0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90,
+0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, 0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10,
+0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, 0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10,
+0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, 0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10,
+0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, 0x04, 0x61, 0x27, 0xA0, 0x05, 0x01, 0xF0, 0x90,
+0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF,
+0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01,
+0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x10, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50,
+0x57, 0x54, 0x00, 0x50, 0x50, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* America/Denver */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90,
+0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00,
+0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00,
+0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00,
+0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80,
+0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80,
+0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80,
+0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00,
+0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00,
+0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80,
+0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00,
+0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00,
+0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00,
+0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80,
+0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80,
+0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80,
+0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00,
+0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00,
+0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80,
+0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80,
+0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80,
+0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00,
+0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00,
+0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00,
+0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80,
+0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80,
+0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB,
+0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF,
+0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54,
+0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* America/Detroit */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x85, 0xBD, 0x22, 0x5B,
+0x99, 0x3C, 0x94, 0x00, 0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0,
+0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, 0xFB, 0x33, 0xAC, 0x70, 0xFB, 0xE8, 0x3B, 0xE0,
+0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60,
+0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0,
+0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0,
+0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0,
+0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60,
+0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60,
+0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60,
+0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0,
+0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0,
+0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0,
+0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60,
+0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60,
+0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60,
+0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0,
+0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0,
+0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60,
+0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60,
+0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0,
+0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60,
+0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60,
+0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60,
+0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0,
+0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0,
+0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0,
+0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60,
+0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60,
+0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60,
+0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0,
+0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0,
+0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60,
+0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60,
+0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60,
+0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x01, 0x02, 0x03, 0x04, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0xFF, 0xFF, 0xB2, 0x25, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF,
+0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01,
+0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* America/Dominica */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x4C,
+0x01, 0xFF, 0xFF, 0xC6, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Edmonton */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x88, 0xDE, 0xCE, 0xE0,
+0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xA0, 0x98, 0x91, 0x90, 0xA0, 0xD2, 0x85, 0x80,
+0xA2, 0x8A, 0xE8, 0x90, 0xA3, 0x84, 0x06, 0x00, 0xA4, 0x6A, 0xCA, 0x90, 0xA5, 0x35, 0xC3, 0x80,
+0xA6, 0x53, 0xE7, 0x10, 0xA7, 0x15, 0xA5, 0x80, 0xA8, 0x33, 0xC9, 0x10, 0xA8, 0xFE, 0xC2, 0x00,
+0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xD5, 0x55, 0xE3, 0x10,
+0xD6, 0x20, 0xDC, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, 0xFE, 0xB8, 0x39, 0x10,
+0xFF, 0xA8, 0x1C, 0x00, 0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90,
+0x07, 0x30, 0xDE, 0x80, 0x08, 0x20, 0xDD, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xBF, 0x90,
+0x0A, 0xF0, 0xA2, 0x80, 0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90,
+0x0E, 0xB9, 0xA1, 0x00, 0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10,
+0x12, 0x79, 0x65, 0x00, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10,
+0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10,
+0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90,
+0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10,
+0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10,
+0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90,
+0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90,
+0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90,
+0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10,
+0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10,
+0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10,
+0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90,
+0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90,
+0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90,
+0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10,
+0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10,
+0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90,
+0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90,
+0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90,
+0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10,
+0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10,
+0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10,
+0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90,
+0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90,
+0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90,
+0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10,
+0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10,
+0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10,
+0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90,
+0x7F, 0x8E, 0xE2, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF,
+0x95, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08,
+0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00,
+0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
+
+/* America/Eirunepe */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x88, 0x80,
+0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40,
+0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40,
+0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40,
+0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0,
+0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0,
+0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0,
+0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0,
+0x2C, 0xC0, 0xD1, 0x50, 0x2D, 0x66, 0xE0, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBE, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xC7,
+0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x43, 0x53,
+0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/El_Salvador */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA3, 0xD5, 0xA6, 0x20,
+0x20, 0x9A, 0xDC, 0xE0, 0x21, 0x5C, 0x9B, 0x50, 0x22, 0x7A, 0xBE, 0xE0, 0x23, 0x3C, 0x7D, 0x50,
+0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xAC, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43,
+0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Ensenada */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xF6, 0x80,
+0xA9, 0x79, 0x4F, 0x70, 0xAF, 0xF2, 0x7C, 0xF0, 0xB6, 0x66, 0x64, 0x70, 0xB7, 0x1B, 0x10, 0x00,
+0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x99, 0xBA, 0x70, 0xD7, 0x1B, 0x59, 0x00,
+0xD8, 0x91, 0xB4, 0xF0, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0,
+0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20,
+0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20,
+0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0x0B, 0xE0, 0xAF, 0xA0,
+0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, 0x0F, 0xA9, 0xAE, 0x20,
+0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, 0x13, 0x69, 0x72, 0x20,
+0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20,
+0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0,
+0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0,
+0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20,
+0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20,
+0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0,
+0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0,
+0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20,
+0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20,
+0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20,
+0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0,
+0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0,
+0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0,
+0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20,
+0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20,
+0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20,
+0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0,
+0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0,
+0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0,
+0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20,
+0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20,
+0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0,
+0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0,
+0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0,
+0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20,
+0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20,
+0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20,
+0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0,
+0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, 0x01, 0x02, 0x01, 0x02,
+0x03, 0x02, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0xFF, 0xFF, 0x92, 0x4C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0x8F, 0x80,
+0x00, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, 0x4C, 0x4D,
+0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Fortaleza */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x6B, 0x18,
+0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20,
+0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20,
+0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20,
+0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0,
+0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0,
+0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0,
+0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0,
+0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20,
+0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x39, 0xF2, 0x4A, 0x20,
+0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF,
+0xFF, 0xDB, 0xE8, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00,
+0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* America/Fort_Wayne */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80,
+0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0,
+0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0,
+0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0,
+0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0,
+0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0,
+0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0,
+0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70,
+0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70,
+0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70,
+0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0,
+0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0,
+0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70,
+0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70,
+0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70,
+0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0,
+0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0,
+0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0,
+0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70,
+0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70,
+0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70,
+0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04,
+0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0,
+0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF,
+0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53,
+0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* America/Glace_Bay */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xA8, 0x34,
+0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50, 0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x60, 0xED, 0xD0, 0xE0, 0x9E, 0x3F, 0x60, 0xE1, 0x69, 0x38, 0x50, 0x04, 0x60, 0xEF, 0x60,
+0x05, 0x50, 0xD2, 0x50, 0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60,
+0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60,
+0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0,
+0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0,
+0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0,
+0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60,
+0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60,
+0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0,
+0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0,
+0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60,
+0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60,
+0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0,
+0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0,
+0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0,
+0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60,
+0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60,
+0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60,
+0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50, 0x47, 0xF8, 0x66, 0xE0,
+0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xB8, 0x2A, 0xE0,
+0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x77, 0xEE, 0xE0,
+0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x40, 0xED, 0x60,
+0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0, 0x57, 0x00, 0xB1, 0x60,
+0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xC0, 0x75, 0x60,
+0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x89, 0x73, 0xE0,
+0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x49, 0x37, 0xE0,
+0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0, 0x66, 0x12, 0x36, 0x60,
+0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xD1, 0xFA, 0x60,
+0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x91, 0xBE, 0x60,
+0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x5A, 0xBC, 0xE0,
+0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50, 0x75, 0x1A, 0x80, 0xE0,
+0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xDA, 0x44, 0xE0,
+0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0xA3, 0x43, 0x60,
+0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x03,
+0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC7, 0xCC, 0x00, 0x00, 0xFF, 0xFF,
+0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C,
+0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53,
+0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x01,
+
+/* America/Godthab */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x80, 0x68, 0x00,
+0x13, 0x4D, 0x7C, 0x50, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xCF, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x00,
+0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xE3,
+0xE0, 0x01, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x47, 0x54, 0x00, 0x57, 0x47, 0x53, 0x54, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+
+/* America/Goose_Bay */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xCB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0x7E, 0x8C,
+0x9F, 0xC0, 0x1C, 0x7C, 0xBE, 0x9E, 0x4D, 0x6C, 0xC0, 0xB8, 0x31, 0x38, 0xC1, 0x79, 0xEF, 0xA8,
+0xC2, 0x98, 0x13, 0x38, 0xC3, 0x59, 0xD1, 0xA8, 0xC4, 0x77, 0xF5, 0x38, 0xC5, 0x39, 0xB3, 0xA8,
+0xC6, 0x61, 0x11, 0xB8, 0xC7, 0x19, 0x95, 0xA8, 0xC8, 0x40, 0xF3, 0xB8, 0xC9, 0x02, 0xB2, 0x28,
+0xCA, 0x20, 0xD5, 0xB8, 0xCA, 0xE2, 0x94, 0x28, 0xCC, 0x00, 0xB7, 0xB8, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x60, 0xE6, 0xC8, 0xD3, 0x88, 0x44, 0xD8, 0xD4, 0x4A, 0x03, 0x48, 0xD5, 0x68, 0x26, 0xD8,
+0xD6, 0x29, 0xE5, 0x48, 0xD7, 0x48, 0x08, 0xD8, 0xD8, 0x09, 0xC7, 0x48, 0xD9, 0x27, 0xEA, 0xD8,
+0xD9, 0xE9, 0xA9, 0x48, 0xDB, 0x11, 0x07, 0x58, 0xDB, 0xD2, 0xC5, 0xC8, 0xDC, 0xDE, 0x74, 0x58,
+0xDD, 0xA9, 0x6D, 0x48, 0xDE, 0xBE, 0x56, 0x58, 0xDF, 0x89, 0x4F, 0x48, 0xE0, 0x9E, 0x38, 0x58,
+0xE1, 0x69, 0x31, 0x48, 0xE2, 0x7E, 0x1A, 0x58, 0xE3, 0x49, 0x13, 0x48, 0xE4, 0x5D, 0xFC, 0x58,
+0xE5, 0x28, 0xF5, 0x48, 0xE6, 0x47, 0x18, 0xD8, 0xE7, 0x12, 0x11, 0xC8, 0xE8, 0x26, 0xFA, 0xD8,
+0xE8, 0xF1, 0xF3, 0xC8, 0xEA, 0x06, 0xDC, 0xD8, 0xEA, 0xD1, 0xD5, 0xC8, 0xEB, 0xE6, 0xBE, 0xD8,
+0xEC, 0xB1, 0xB7, 0xC8, 0xED, 0xC6, 0xA0, 0xD8, 0xEE, 0xBF, 0xBE, 0x48, 0xEF, 0xAF, 0xBD, 0x58,
+0xF0, 0x9F, 0xA0, 0x48, 0xF1, 0x8F, 0x9F, 0x58, 0xF2, 0x7F, 0x82, 0x48, 0xF3, 0x6F, 0x81, 0x58,
+0xF4, 0x5F, 0x64, 0x48, 0xF5, 0x4F, 0x63, 0x58, 0xF6, 0x3F, 0x46, 0x48, 0xF7, 0x2F, 0x45, 0x58,
+0xF8, 0x28, 0x62, 0xC8, 0xF8, 0xDA, 0x6B, 0x58, 0xF9, 0x0F, 0x2E, 0x60, 0xFA, 0x08, 0x4B, 0xD0,
+0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0, 0xFD, 0xC8, 0x0F, 0xD0,
+0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0, 0x01, 0x87, 0xD3, 0xD0,
+0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60, 0x05, 0x50, 0xD2, 0x50,
+0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60, 0x09, 0x10, 0x96, 0x50,
+0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, 0x0C, 0xD9, 0x94, 0xD0,
+0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, 0x10, 0x99, 0x58, 0xD0,
+0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0,
+0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50,
+0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50,
+0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50,
+0x20, 0x75, 0xD6, 0xFC, 0x21, 0x81, 0x69, 0x6C, 0x22, 0x55, 0xB8, 0xFC, 0x23, 0x6A, 0x77, 0xDC,
+0x24, 0x35, 0x9A, 0xFC, 0x25, 0x4A, 0x67, 0xEC, 0x26, 0x15, 0x7C, 0xFC, 0x27, 0x2A, 0x49, 0xEC,
+0x27, 0xFE, 0x99, 0x7C, 0x29, 0x0A, 0x2B, 0xEC, 0x29, 0xDE, 0x7B, 0x7C, 0x2A, 0xEA, 0x0D, 0xEC,
+0x2B, 0xBE, 0x5D, 0x7C, 0x2C, 0xD3, 0x2A, 0x6C, 0x2D, 0x9E, 0x3F, 0x7C, 0x2E, 0xB3, 0x0C, 0x6C,
+0x2F, 0x7E, 0x21, 0x7C, 0x30, 0x92, 0xEE, 0x6C, 0x31, 0x67, 0x3D, 0xFC, 0x32, 0x72, 0xD0, 0x6C,
+0x33, 0x47, 0x1F, 0xFC, 0x34, 0x52, 0xB2, 0x6C, 0x35, 0x27, 0x01, 0xFC, 0x36, 0x32, 0x94, 0x6C,
+0x37, 0x06, 0xE3, 0xFC, 0x38, 0x1B, 0xB0, 0xEC, 0x38, 0xE6, 0xC5, 0xFC, 0x39, 0xFB, 0x92, 0xEC,
+0x3A, 0xC6, 0xA7, 0xFC, 0x3B, 0xDB, 0x74, 0xEC, 0x3C, 0xAF, 0xC4, 0x7C, 0x3D, 0xBB, 0x56, 0xEC,
+0x3E, 0x8F, 0xA6, 0x7C, 0x3F, 0x9B, 0x38, 0xEC, 0x40, 0x6F, 0x88, 0x7C, 0x41, 0x84, 0x55, 0x6C,
+0x42, 0x4F, 0x6A, 0x7C, 0x43, 0x64, 0x37, 0x6C, 0x44, 0x2F, 0x4C, 0x7C, 0x45, 0x44, 0x19, 0x6C,
+0x46, 0x0F, 0x2E, 0x7C, 0x47, 0x23, 0xFB, 0x6C, 0x47, 0xF8, 0x4A, 0xFC, 0x49, 0x03, 0xDD, 0x6C,
+0x49, 0xD8, 0x2C, 0xFC, 0x4A, 0xE3, 0xBF, 0x6C, 0x4B, 0xB8, 0x0E, 0xFC, 0x4C, 0xCC, 0xDB, 0xEC,
+0x4D, 0x97, 0xF0, 0xFC, 0x4E, 0xAC, 0xBD, 0xEC, 0x4F, 0x77, 0xD2, 0xFC, 0x50, 0x8C, 0x9F, 0xEC,
+0x51, 0x60, 0xEF, 0x7C, 0x52, 0x6C, 0x81, 0xEC, 0x53, 0x40, 0xD1, 0x7C, 0x54, 0x4C, 0x63, 0xEC,
+0x55, 0x20, 0xB3, 0x7C, 0x56, 0x2C, 0x45, 0xEC, 0x57, 0x00, 0x95, 0x7C, 0x58, 0x15, 0x62, 0x6C,
+0x58, 0xE0, 0x77, 0x7C, 0x59, 0xF5, 0x44, 0x6C, 0x5A, 0xC0, 0x59, 0x7C, 0x5B, 0xD5, 0x26, 0x6C,
+0x5C, 0xA9, 0x75, 0xFC, 0x5D, 0xB5, 0x08, 0x6C, 0x5E, 0x89, 0x57, 0xFC, 0x5F, 0x94, 0xEA, 0x6C,
+0x60, 0x69, 0x39, 0xFC, 0x61, 0x7E, 0x06, 0xEC, 0x62, 0x49, 0x1B, 0xFC, 0x63, 0x5D, 0xE8, 0xEC,
+0x64, 0x28, 0xFD, 0xFC, 0x65, 0x3D, 0xCA, 0xEC, 0x66, 0x12, 0x1A, 0x7C, 0x67, 0x1D, 0xAC, 0xEC,
+0x67, 0xF1, 0xFC, 0x7C, 0x68, 0xFD, 0x8E, 0xEC, 0x69, 0xD1, 0xDE, 0x7C, 0x6A, 0xDD, 0x70, 0xEC,
+0x6B, 0xB1, 0xC0, 0x7C, 0x6C, 0xC6, 0x8D, 0x6C, 0x6D, 0x91, 0xA2, 0x7C, 0x6E, 0xA6, 0x6F, 0x6C,
+0x6F, 0x71, 0x84, 0x7C, 0x70, 0x86, 0x51, 0x6C, 0x71, 0x5A, 0xA0, 0xFC, 0x72, 0x66, 0x33, 0x6C,
+0x73, 0x3A, 0x82, 0xFC, 0x74, 0x46, 0x15, 0x6C, 0x75, 0x1A, 0x64, 0xFC, 0x76, 0x2F, 0x31, 0xEC,
+0x76, 0xFA, 0x46, 0xFC, 0x78, 0x0F, 0x13, 0xEC, 0x78, 0xDA, 0x28, 0xFC, 0x79, 0xEE, 0xF5, 0xEC,
+0x7A, 0xBA, 0x0A, 0xFC, 0x7B, 0xCE, 0xD7, 0xEC, 0x7C, 0xA3, 0x27, 0x7C, 0x7D, 0xAE, 0xB9, 0xEC,
+0x7E, 0x83, 0x09, 0x7C, 0x7F, 0x8E, 0x9B, 0xEC, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x05, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x08,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0xFF, 0xFF, 0xCE, 0x94, 0x00, 0x00, 0xFF, 0xFF, 0xDC, 0xA4, 0x01, 0x04, 0xFF,
+0xFF, 0xCE, 0xC8, 0x00, 0x00, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x04, 0xFF, 0xFF, 0xDC, 0xD8, 0x01,
+0x08, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0xFF, 0xFF, 0xC7,
+0xC0, 0x00, 0x14, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x18, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x44, 0x54,
+0x00, 0x4E, 0x50, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54,
+0x00, 0x41, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Grand_Turk */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00,
+0x11, 0x89, 0x49, 0xD0, 0x12, 0x79, 0x2C, 0xC0, 0x13, 0x69, 0x2B, 0xD0, 0x14, 0x59, 0x0E, 0xC0,
+0x15, 0x49, 0x0D, 0xD0, 0x16, 0x38, 0xF0, 0xC0, 0x17, 0x28, 0xEF, 0xD0, 0x18, 0x22, 0x0D, 0x40,
+0x19, 0x08, 0xD1, 0xD0, 0x1A, 0x01, 0xEF, 0x40, 0x1A, 0xF1, 0xEE, 0x50, 0x1B, 0xE1, 0xD1, 0x40,
+0x1C, 0xD1, 0xD0, 0x50, 0x1D, 0xC1, 0xB3, 0x40, 0x1E, 0xB1, 0xB2, 0x50, 0x1F, 0xA1, 0x95, 0x40,
+0x20, 0x75, 0xE4, 0xD0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x55, 0xC6, 0xD0, 0x23, 0x6A, 0x93, 0xC0,
+0x24, 0x35, 0xA8, 0xD0, 0x25, 0x4A, 0x75, 0xC0, 0x26, 0x15, 0x8A, 0xD0, 0x27, 0x2A, 0x57, 0xC0,
+0x27, 0xFE, 0xA7, 0x50, 0x29, 0x0A, 0x39, 0xC0, 0x29, 0xDE, 0x89, 0x50, 0x2A, 0xEA, 0x1B, 0xC0,
+0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xD3, 0x38, 0x40, 0x2D, 0x9E, 0x4D, 0x50, 0x2E, 0xB3, 0x1A, 0x40,
+0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x92, 0xFC, 0x40, 0x31, 0x67, 0x4B, 0xD0, 0x32, 0x72, 0xDE, 0x40,
+0x33, 0x47, 0x2D, 0xD0, 0x34, 0x52, 0xC0, 0x40, 0x35, 0x27, 0x0F, 0xD0, 0x36, 0x32, 0xA2, 0x40,
+0x37, 0x06, 0xF1, 0xD0, 0x38, 0x1B, 0xBE, 0xC0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xA0, 0xC0,
+0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x82, 0xC0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x64, 0xC0,
+0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x46, 0xC0, 0x40, 0x6F, 0x96, 0x50, 0x41, 0x84, 0x63, 0x40,
+0x42, 0x4F, 0x78, 0x50, 0x43, 0x64, 0x45, 0x40, 0x44, 0x2F, 0x5A, 0x50, 0x45, 0x44, 0x27, 0x40,
+0x46, 0x0F, 0x3C, 0x50, 0x47, 0x24, 0x09, 0x40, 0x47, 0xF8, 0x58, 0xD0, 0x49, 0x03, 0xEB, 0x40,
+0x49, 0xD8, 0x3A, 0xD0, 0x4A, 0xE3, 0xCD, 0x40, 0x4B, 0xB8, 0x1C, 0xD0, 0x4C, 0xCC, 0xE9, 0xC0,
+0x4D, 0x97, 0xFE, 0xD0, 0x4E, 0xAC, 0xCB, 0xC0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x8C, 0xAD, 0xC0,
+0x51, 0x60, 0xFD, 0x50, 0x52, 0x6C, 0x8F, 0xC0, 0x53, 0x40, 0xDF, 0x50, 0x54, 0x4C, 0x71, 0xC0,
+0x55, 0x20, 0xC1, 0x50, 0x56, 0x2C, 0x53, 0xC0, 0x57, 0x00, 0xA3, 0x50, 0x58, 0x15, 0x70, 0x40,
+0x58, 0xE0, 0x85, 0x50, 0x59, 0xF5, 0x52, 0x40, 0x5A, 0xC0, 0x67, 0x50, 0x5B, 0xD5, 0x34, 0x40,
+0x5C, 0xA9, 0x83, 0xD0, 0x5D, 0xB5, 0x16, 0x40, 0x5E, 0x89, 0x65, 0xD0, 0x5F, 0x94, 0xF8, 0x40,
+0x60, 0x69, 0x47, 0xD0, 0x61, 0x7E, 0x14, 0xC0, 0x62, 0x49, 0x29, 0xD0, 0x63, 0x5D, 0xF6, 0xC0,
+0x64, 0x29, 0x0B, 0xD0, 0x65, 0x3D, 0xD8, 0xC0, 0x66, 0x12, 0x28, 0x50, 0x67, 0x1D, 0xBA, 0xC0,
+0x67, 0xF2, 0x0A, 0x50, 0x68, 0xFD, 0x9C, 0xC0, 0x69, 0xD1, 0xEC, 0x50, 0x6A, 0xDD, 0x7E, 0xC0,
+0x6B, 0xB1, 0xCE, 0x50, 0x6C, 0xC6, 0x9B, 0x40, 0x6D, 0x91, 0xB0, 0x50, 0x6E, 0xA6, 0x7D, 0x40,
+0x6F, 0x71, 0x92, 0x50, 0x70, 0x86, 0x5F, 0x40, 0x71, 0x5A, 0xAE, 0xD0, 0x72, 0x66, 0x41, 0x40,
+0x73, 0x3A, 0x90, 0xD0, 0x74, 0x46, 0x23, 0x40, 0x75, 0x1A, 0x72, 0xD0, 0x76, 0x2F, 0x3F, 0xC0,
+0x76, 0xFA, 0x54, 0xD0, 0x78, 0x0F, 0x21, 0xC0, 0x78, 0xDA, 0x36, 0xD0, 0x79, 0xEF, 0x03, 0xC0,
+0x7A, 0xBA, 0x18, 0xD0, 0x7B, 0xCE, 0xE5, 0xC0, 0x7C, 0xA3, 0x35, 0x50, 0x7D, 0xAE, 0xC7, 0xC0,
+0x7E, 0x83, 0x17, 0x50, 0x7F, 0x8E, 0xA9, 0xC0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF,
+0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00,
+0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* America/Grenada */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x64,
+0x01, 0xFF, 0xFF, 0xC6, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Guadeloupe */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0,
+0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Guatemala */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9F, 0x9D, 0xEA, 0xDC,
+0x07, 0x55, 0xAC, 0x60, 0x07, 0xCD, 0x96, 0xD0, 0x19, 0x2C, 0x78, 0x60, 0x19, 0xCF, 0xE4, 0x50,
+0x27, 0xEA, 0xEE, 0xE0, 0x28, 0xC8, 0x5C, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF,
+0xFF, 0xAB, 0x24, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00,
+0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* America/Guayaquil */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xB6, 0xA4, 0x42, 0x18,
+0x01, 0xFF, 0xFF, 0xB6, 0x68, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x51, 0x4D, 0x54,
+0x00, 0x45, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Guyana */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x98, 0xD9, 0x79, 0x88,
+0xF9, 0x39, 0x3E, 0xBC, 0x0A, 0x7D, 0xB4, 0x3C, 0x27, 0x7F, 0xFB, 0x30, 0x01, 0x02, 0x03, 0x04,
+0xFF, 0xFF, 0xC9, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0xCB, 0x44, 0x00, 0x04, 0xFF, 0xFF, 0xCB, 0x44,
+0x00, 0x09, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D,
+0x54, 0x00, 0x47, 0x42, 0x47, 0x54, 0x00, 0x47, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Halifax */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xAB, 0xA0,
+0x9A, 0xE4, 0xDE, 0xC0, 0x9B, 0xD6, 0x13, 0x30, 0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50,
+0xA2, 0x9D, 0x17, 0x40, 0xA3, 0x30, 0xB1, 0x30, 0xA4, 0x7A, 0x56, 0x40, 0xA5, 0x1B, 0x1F, 0x30,
+0xA6, 0x53, 0xA0, 0xC0, 0xA6, 0xFC, 0x52, 0xB0, 0xA8, 0x3C, 0xBD, 0x40, 0xA8, 0xDC, 0x34, 0xB0,
+0xAA, 0x1C, 0x9F, 0x40, 0xAA, 0xCD, 0x3A, 0x30, 0xAB, 0xFC, 0x81, 0x40, 0xAC, 0xBF, 0x91, 0x30,
+0xAD, 0xEE, 0xD8, 0x40, 0xAE, 0x8C, 0xFE, 0x30, 0xAF, 0xBC, 0x45, 0x40, 0xB0, 0x7F, 0x55, 0x30,
+0xB1, 0xAE, 0x9C, 0x40, 0xB2, 0x4B, 0x70, 0xB0, 0xB3, 0x8E, 0x7E, 0x40, 0xB4, 0x24, 0xBB, 0x30,
+0xB5, 0x6E, 0x60, 0x40, 0xB6, 0x15, 0xC0, 0xB0, 0xB7, 0x4E, 0x42, 0x40, 0xB8, 0x08, 0x17, 0xB0,
+0xB9, 0x24, 0xE9, 0xC0, 0xB9, 0xE7, 0xF9, 0xB0, 0xBB, 0x04, 0xCB, 0xC0, 0xBB, 0xD1, 0x16, 0x30,
+0xBD, 0x00, 0x5D, 0x40, 0xBD, 0x9D, 0x31, 0xB0, 0xBE, 0xF2, 0xB4, 0x40, 0xBF, 0x90, 0xDA, 0x30,
+0xC0, 0xD3, 0xE7, 0xC0, 0xC1, 0x5E, 0x47, 0x30, 0xC2, 0x8D, 0x8E, 0x40, 0xC3, 0x50, 0x9E, 0x30,
+0xC4, 0x6D, 0x70, 0x40, 0xC5, 0x30, 0x80, 0x30, 0xC6, 0x72, 0x3C, 0x40, 0xC7, 0x10, 0x62, 0x30,
+0xC8, 0x36, 0x6E, 0xC0, 0xC8, 0xF9, 0x7E, 0xB0, 0xCA, 0x16, 0x50, 0xC0, 0xCA, 0xD9, 0x60, 0xB0,
+0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xD3, 0x75, 0xD6, 0xE0,
+0xD4, 0x40, 0xCF, 0xD0, 0xD5, 0x55, 0xB8, 0xE0, 0xD6, 0x20, 0xB1, 0xD0, 0xD7, 0x35, 0x9A, 0xE0,
+0xD8, 0x00, 0x93, 0xD0, 0xD9, 0x15, 0x7C, 0xE0, 0xD9, 0xE0, 0x75, 0xD0, 0xDC, 0xDE, 0x7B, 0x60,
+0xDD, 0xA9, 0x74, 0x50, 0xDE, 0xBE, 0x5D, 0x60, 0xDF, 0x89, 0x56, 0x50, 0xE0, 0x9E, 0x3F, 0x60,
+0xE1, 0x69, 0x38, 0x50, 0xE2, 0x7E, 0x21, 0x60, 0xE3, 0x49, 0x1A, 0x50, 0xE6, 0x47, 0x1F, 0xE0,
+0xE7, 0x12, 0x18, 0xD0, 0xE8, 0x27, 0x01, 0xE0, 0xE8, 0xF1, 0xFA, 0xD0, 0xEA, 0x06, 0xE3, 0xE0,
+0xEA, 0xD1, 0xDC, 0xD0, 0xEB, 0xE6, 0xC5, 0xE0, 0xEC, 0xB1, 0xBE, 0xD0, 0xF1, 0x8F, 0xA6, 0x60,
+0xF2, 0x7F, 0x89, 0x50, 0xF3, 0x6F, 0x88, 0x60, 0xF4, 0x5F, 0x6B, 0x50, 0xF5, 0x4F, 0x6A, 0x60,
+0xF6, 0x3F, 0x4D, 0x50, 0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x69, 0xD0, 0xF9, 0x0F, 0x2E, 0x60,
+0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0,
+0xFD, 0xC8, 0x0F, 0xD0, 0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0,
+0x01, 0x87, 0xD3, 0xD0, 0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60,
+0x05, 0x50, 0xD2, 0x50, 0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60,
+0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60,
+0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0,
+0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0,
+0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0,
+0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60,
+0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60,
+0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0,
+0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0,
+0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60,
+0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60,
+0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0,
+0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0,
+0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0,
+0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60,
+0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60,
+0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60,
+0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50, 0x47, 0xF8, 0x66, 0xE0,
+0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xB8, 0x2A, 0xE0,
+0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x77, 0xEE, 0xE0,
+0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x40, 0xED, 0x60,
+0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0, 0x57, 0x00, 0xB1, 0x60,
+0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xC0, 0x75, 0x60,
+0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x89, 0x73, 0xE0,
+0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x49, 0x37, 0xE0,
+0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0, 0x66, 0x12, 0x36, 0x60,
+0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xD1, 0xFA, 0x60,
+0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x91, 0xBE, 0x60,
+0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x5A, 0xBC, 0xE0,
+0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50, 0x75, 0x1A, 0x80, 0xE0,
+0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xDA, 0x44, 0xE0,
+0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0xA3, 0x43, 0x60,
+0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0xFF, 0xFF, 0xC4, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0x4C, 0x4D,
+0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
+
+/* America/Havana */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0xAC, 0x62, 0xC2, 0x80,
+0xB1, 0xD3, 0x94, 0x50, 0xB2, 0x74, 0x5D, 0x40, 0xC8, 0x5B, 0x66, 0xD0, 0xC8, 0xD3, 0x51, 0x40,
+0xCA, 0x3B, 0x48, 0xD0, 0xCA, 0xBC, 0x6D, 0xC0, 0xCC, 0x24, 0x65, 0x50, 0xCC, 0x9C, 0x4F, 0xC0,
+0xD1, 0xC4, 0x0B, 0x50, 0xD2, 0x3B, 0xF5, 0xC0, 0xD3, 0xA3, 0xED, 0x50, 0xD4, 0x1B, 0xD7, 0xC0,
+0xF7, 0x60, 0x05, 0xD0, 0xF7, 0xFF, 0x7D, 0x40, 0xF9, 0x3D, 0x44, 0xD0, 0xF9, 0xE3, 0x53, 0xC0,
+0xFA, 0xDB, 0x3B, 0xD0, 0xFB, 0xA7, 0x86, 0x40, 0xFC, 0xC5, 0xA9, 0xD0, 0xFD, 0x87, 0x68, 0x40,
+0xFE, 0xB8, 0x00, 0xD0, 0xFF, 0xA7, 0xE3, 0xC0, 0x00, 0x97, 0xE2, 0xD0, 0x01, 0x87, 0xC5, 0xC0,
+0x02, 0x77, 0xC4, 0xD0, 0x03, 0x70, 0xE2, 0x40, 0x04, 0x60, 0xE1, 0x50, 0x05, 0x35, 0x14, 0xC0,
+0x06, 0x40, 0xC3, 0x50, 0x07, 0x16, 0x48, 0x40, 0x08, 0x20, 0xA5, 0x50, 0x08, 0xF7, 0x7B, 0xC0,
+0x0A, 0x00, 0x87, 0x50, 0x0A, 0xF0, 0x6A, 0x40, 0x0B, 0xE0, 0x69, 0x50, 0x0C, 0xD9, 0x86, 0xC0,
+0x0D, 0xC0, 0x4B, 0x50, 0x0E, 0xB9, 0x68, 0xC0, 0x0F, 0xB2, 0xA2, 0x50, 0x10, 0x7D, 0x9B, 0x40,
+0x11, 0x51, 0xEA, 0xD0, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x31, 0xCC, 0xD0, 0x14, 0x46, 0x99, 0xC0,
+0x15, 0x5B, 0x82, 0xD0, 0x16, 0x26, 0x7B, 0xC0, 0x17, 0x3B, 0x64, 0xD0, 0x18, 0x06, 0x5D, 0xC0,
+0x19, 0x1B, 0x46, 0xD0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xFB, 0x28, 0xD0, 0x1B, 0xCF, 0x5C, 0x40,
+0x1C, 0xDB, 0x0A, 0xD0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x7A, 0x53, 0x50, 0x1F, 0x8F, 0x20, 0x40,
+0x20, 0x5A, 0x35, 0x50, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x43, 0x51, 0xD0, 0x23, 0x4E, 0xE4, 0x40,
+0x24, 0x23, 0x33, 0xD0, 0x25, 0x2E, 0xC6, 0x40, 0x26, 0x15, 0x8A, 0xD0, 0x27, 0x17, 0xE2, 0xC0,
+0x27, 0xFE, 0xA7, 0x50, 0x28, 0xF7, 0xD2, 0xD0, 0x29, 0xDE, 0x89, 0x50, 0x2A, 0xD7, 0xB4, 0xD0,
+0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xB7, 0x96, 0xD0, 0x2D, 0x9E, 0x4D, 0x50, 0x2E, 0x97, 0x78, 0xD0,
+0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x77, 0x5A, 0xD0, 0x31, 0x67, 0x4B, 0xD0, 0x32, 0x57, 0x3C, 0xD0,
+0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50,
+0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0,
+0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0,
+0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x43, 0x64, 0x53, 0x50,
+0x44, 0x2F, 0x5A, 0x50, 0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x3C, 0x50, 0x47, 0x24, 0x17, 0x50,
+0x47, 0xF8, 0x58, 0xD0, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x3A, 0xD0, 0x4A, 0xE3, 0xDB, 0x50,
+0x4B, 0xB8, 0x1C, 0xD0, 0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x97, 0xFE, 0xD0, 0x4E, 0xAC, 0xD9, 0xD0,
+0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x60, 0xFD, 0x50, 0x52, 0x6C, 0x9D, 0xD0,
+0x53, 0x40, 0xDF, 0x50, 0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xC1, 0x50, 0x56, 0x2C, 0x61, 0xD0,
+0x57, 0x00, 0xA3, 0x50, 0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x85, 0x50, 0x59, 0xF5, 0x60, 0x50,
+0x5A, 0xC0, 0x67, 0x50, 0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x83, 0xD0, 0x5D, 0xB5, 0x24, 0x50,
+0x5E, 0x89, 0x65, 0xD0, 0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x47, 0xD0, 0x61, 0x7E, 0x22, 0xD0,
+0x62, 0x49, 0x29, 0xD0, 0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x0B, 0xD0, 0x65, 0x3D, 0xE6, 0xD0,
+0x66, 0x12, 0x28, 0x50, 0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x0A, 0x50, 0x68, 0xFD, 0xAA, 0xD0,
+0x69, 0xD1, 0xEC, 0x50, 0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xCE, 0x50, 0x6C, 0xC6, 0xA9, 0x50,
+0x6D, 0x91, 0xB0, 0x50, 0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0x92, 0x50, 0x70, 0x86, 0x6D, 0x50,
+0x71, 0x5A, 0xAE, 0xD0, 0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x90, 0xD0, 0x74, 0x46, 0x31, 0x50,
+0x75, 0x1A, 0x72, 0xD0, 0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x54, 0xD0, 0x78, 0x0F, 0x2F, 0xD0,
+0x78, 0xDA, 0x36, 0xD0, 0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x18, 0xD0, 0x7B, 0xCE, 0xF3, 0xD0,
+0x7C, 0xA3, 0x35, 0x50, 0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x17, 0x50, 0x7F, 0x8E, 0xB7, 0xD0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xB2,
+0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF,
+0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0x48, 0x4D, 0x54, 0x00, 0x43,
+0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* America/Hermosillo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70,
+0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60,
+0xB8, 0xFD, 0x86, 0xF0, 0xCB, 0xEA, 0x71, 0x60, 0xD8, 0x91, 0xB4, 0xF0, 0x00, 0x00, 0x70, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, 0x97, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x9D,
+0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x0C, 0xFF,
+0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54,
+0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* America/Indiana/Indianapolis */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80,
+0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0,
+0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0,
+0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0,
+0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0,
+0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0,
+0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0,
+0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70,
+0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70,
+0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70,
+0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0,
+0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0,
+0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70,
+0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70,
+0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70,
+0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0,
+0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0,
+0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0,
+0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70,
+0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70,
+0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70,
+0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04,
+0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0,
+0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF,
+0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53,
+0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* America/Indiana/Knox */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0,
+0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0,
+0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0,
+0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0,
+0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70,
+0xF1, 0x8F, 0xC2, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0,
+0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0,
+0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70,
+0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70,
+0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70,
+0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0,
+0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0,
+0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0,
+0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70,
+0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70,
+0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70,
+0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0,
+0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0,
+0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0,
+0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0,
+0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60,
+0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60,
+0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60,
+0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0,
+0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0,
+0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60,
+0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60,
+0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60,
+0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0,
+0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0,
+0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0,
+0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60,
+0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60,
+0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF,
+0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54,
+0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54,
+0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00,
+
+/* America/Indiana/Marengo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70,
+0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xB1, 0xDA, 0xF0,
+0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xEF, 0xAF, 0xE0, 0x80, 0xFE, 0xB8, 0x1C, 0xF0,
+0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0,
+0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70,
+0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0x94, 0xF0,
+0x0A, 0xF0, 0x86, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0,
+0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0,
+0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70,
+0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70,
+0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70,
+0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0,
+0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0,
+0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70,
+0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70,
+0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70,
+0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0,
+0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0,
+0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0,
+0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70,
+0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70,
+0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70,
+0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00,
+0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0,
+0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44,
+0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53,
+0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x00, 0x00,
+
+/* America/Indianapolis */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80,
+0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0,
+0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0,
+0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0,
+0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0,
+0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0,
+0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0,
+0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70,
+0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70,
+0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70,
+0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0,
+0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0,
+0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70,
+0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70,
+0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70,
+0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0,
+0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0,
+0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0,
+0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70,
+0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70,
+0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70,
+0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04,
+0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0,
+0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF,
+0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53,
+0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* America/Indiana/Vevay */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xE2, 0x7E, 0x3D, 0x80, 0xFE, 0xB8, 0x1C, 0xF0,
+0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0,
+0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x44, 0x2F, 0x76, 0x70,
+0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0,
+0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70,
+0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70,
+0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70,
+0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0,
+0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0,
+0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0,
+0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70,
+0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70,
+0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70,
+0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0,
+0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0,
+0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70,
+0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70,
+0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70,
+0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01,
+0x02, 0x03, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0,
+0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF,
+0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14,
+0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00,
+0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x00, 0x00,
+
+/* America/Inuvik */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xBD, 0xA0,
+0x9F, 0xBB, 0x15, 0x90, 0xA0, 0xCF, 0xFE, 0xA0, 0xA1, 0xA2, 0xC4, 0x70, 0xCB, 0x89, 0x1A, 0xA0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x94, 0x00,
+0x11, 0x89, 0x90, 0x20, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10,
+0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10,
+0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90,
+0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10,
+0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10,
+0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90,
+0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90,
+0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90,
+0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10,
+0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10,
+0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10,
+0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90,
+0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90,
+0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90,
+0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10,
+0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10,
+0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90,
+0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90,
+0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90,
+0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10,
+0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10,
+0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10,
+0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90,
+0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90,
+0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90,
+0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10,
+0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10,
+0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10,
+0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90,
+0x7F, 0x8E, 0xE2, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF,
+0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10,
+0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x15, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x19, 0x50, 0x44, 0x54, 0x00,
+0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, 0x00, 0x50, 0x44, 0x44, 0x54,
+0x00, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+
+/* America/Iqaluit */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0x93, 0x70,
+0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0xCF, 0xD4, 0x70, 0xA1, 0xA2, 0x9A, 0x40, 0xCB, 0x88, 0xF0, 0x70,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xF7, 0x2F, 0x3E, 0x50, 0xF8, 0x28, 0x69, 0xD0,
+0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0,
+0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60,
+0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60,
+0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60,
+0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0,
+0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0,
+0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60,
+0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60,
+0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60,
+0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0,
+0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0,
+0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0,
+0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60,
+0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60,
+0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60,
+0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0,
+0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0,
+0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0,
+0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60,
+0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60,
+0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0,
+0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0,
+0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0,
+0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60,
+0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60,
+0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60,
+0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0,
+0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0,
+0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x05, 0x06, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7,
+0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF,
+0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00,
+0x15, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x19, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45,
+0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00,
+0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00, 0x00,
+
+/* America/Jamaica */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00,
+0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60,
+0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0,
+0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0,
+0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0,
+0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00,
+0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45,
+0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Jujuy */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x2A, 0x57, 0xC0,
+0x27, 0xE2, 0xDB, 0xB0, 0x28, 0xEE, 0x8A, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x03, 0x04,
+0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04,
+0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0,
+0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D,
+0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00,
+0x57, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* America/Juneau */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0xCB, 0x89, 0x1A, 0xA0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10,
+0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90,
+0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90,
+0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90,
+0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10,
+0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10,
+0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10,
+0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90,
+0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, 0x1C, 0xD2, 0x24, 0xB0,
+0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, 0x20, 0x76, 0x39, 0x30,
+0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, 0x24, 0x35, 0xFD, 0x30,
+0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, 0x27, 0xFE, 0xFB, 0xB0,
+0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, 0x2B, 0xBE, 0xBF, 0xB0,
+0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, 0x2F, 0x7E, 0x83, 0xB0,
+0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, 0x33, 0x47, 0x82, 0x30,
+0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, 0x37, 0x07, 0x46, 0x30,
+0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, 0x3A, 0xC7, 0x0A, 0x30,
+0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, 0x3E, 0x90, 0x08, 0xB0,
+0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, 0x42, 0x4F, 0xCC, 0xB0,
+0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, 0x45, 0xF3, 0xE1, 0x30,
+0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, 0x49, 0xB3, 0xA5, 0x30,
+0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, 0x4D, 0x7C, 0xA3, 0xB0,
+0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, 0x51, 0x3C, 0x67, 0xB0,
+0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, 0x54, 0xFC, 0x2B, 0xB0,
+0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, 0x58, 0xC5, 0x2A, 0x30,
+0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, 0x5C, 0x84, 0xEE, 0x30,
+0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, 0x60, 0x4D, 0xEC, 0xB0,
+0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, 0x64, 0x0D, 0xB0, 0xB0,
+0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, 0x67, 0xCD, 0x74, 0xB0,
+0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, 0x6B, 0x96, 0x73, 0x30,
+0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, 0x6F, 0x56, 0x37, 0x30,
+0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, 0x73, 0x15, 0xFB, 0x30,
+0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, 0x76, 0xDE, 0xF9, 0xB0,
+0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, 0x7A, 0x9E, 0xBD, 0xB0,
+0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, 0x7E, 0x5E, 0x81, 0xB0,
+0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
+0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
+0x00, 0x03, 0x00, 0x03, 0x04, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x04, 0xFF, 0xFF,
+0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x10,
+0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x14, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x18, 0xFF, 0xFF, 0x81, 0x70,
+0x00, 0x1D, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, 0x00, 0x50, 0x44,
+0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x59, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x44, 0x54, 0x00, 0x41,
+0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* America/Kentucky/Louisville */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA4, 0x73, 0xF7, 0x00,
+0xA5, 0x16, 0x11, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD2, 0xDB, 0x97, 0x60, 0xD3, 0xA4, 0x09, 0x70,
+0xD5, 0x55, 0xD5, 0x00, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70,
+0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0,
+0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x1E, 0x90, 0x70,
+0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0,
+0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60,
+0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60,
+0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60,
+0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0,
+0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0,
+0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0,
+0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60,
+0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60,
+0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60,
+0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0,
+0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0,
+0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60,
+0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60,
+0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60,
+0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0,
+0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0,
+0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0,
+0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60,
+0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0,
+0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0,
+0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60,
+0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60,
+0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60,
+0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0,
+0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0,
+0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60,
+0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60,
+0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60,
+0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0,
+0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0,
+0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0,
+0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60,
+0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60,
+0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9,
+0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF,
+0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54,
+0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* America/Kentucky/Monticello */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0,
+0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0,
+0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70,
+0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70,
+0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0,
+0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0,
+0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0,
+0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70,
+0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70,
+0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70,
+0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0,
+0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0,
+0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0,
+0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70,
+0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70,
+0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70,
+0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0,
+0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0,
+0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60,
+0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60,
+0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0,
+0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60,
+0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60,
+0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60,
+0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0,
+0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0,
+0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0,
+0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60,
+0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60,
+0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60,
+0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0,
+0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0,
+0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60,
+0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60,
+0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60,
+0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9,
+0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x10, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x14, 0x43,
+0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45,
+0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00,
+
+/* America/Knox_IN */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0,
+0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0,
+0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0,
+0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0,
+0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70,
+0xF1, 0x8F, 0xC2, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0,
+0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0,
+0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70,
+0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70,
+0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70,
+0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0,
+0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0,
+0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0,
+0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70,
+0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70,
+0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70,
+0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0,
+0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0,
+0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0,
+0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0,
+0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60,
+0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60,
+0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60,
+0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0,
+0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0,
+0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60,
+0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60,
+0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60,
+0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0,
+0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0,
+0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0,
+0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60,
+0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60,
+0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF,
+0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54,
+0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54,
+0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00,
+
+/* America/La_Paz */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xB8, 0x1E, 0x96, 0xE4,
+0xB8, 0xEE, 0xD5, 0xD4, 0x01, 0x02, 0xFF, 0xFF, 0xC0, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xCE, 0x2C,
+0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x43, 0x4D, 0x54, 0x00, 0x42, 0x4F, 0x53, 0x54,
+0x00, 0x42, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Lima */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x8C, 0x74, 0x40, 0xD4,
+0xC3, 0xCF, 0x4A, 0x50, 0xC4, 0x45, 0xE3, 0x40, 0xC5, 0x2F, 0x4A, 0xD0, 0xC6, 0x1F, 0x2D, 0xC0,
+0xC7, 0x0F, 0x2C, 0xD0, 0xC7, 0xFF, 0x0F, 0xC0, 0x1E, 0x18, 0xC4, 0x50, 0x1E, 0x8F, 0x5D, 0x40,
+0x1F, 0xF9, 0xF7, 0xD0, 0x20, 0x70, 0x90, 0xC0, 0x25, 0x9E, 0xE3, 0xD0, 0x26, 0x15, 0x7C, 0xC0,
+0x2D, 0x25, 0x03, 0x50, 0x2D, 0x9B, 0x9C, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xB7, 0xAC, 0x00, 0x00, 0xFF, 0xFF, 0xC7,
+0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x45, 0x53,
+0x54, 0x00, 0x50, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Los_Angeles */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0,
+0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90,
+0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90,
+0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90,
+0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90,
+0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10,
+0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10,
+0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10,
+0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90,
+0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10,
+0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10,
+0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10,
+0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90,
+0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90,
+0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90,
+0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10,
+0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10,
+0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10,
+0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90,
+0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90,
+0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90,
+0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10,
+0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10,
+0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90,
+0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90,
+0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90,
+0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10,
+0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10,
+0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10,
+0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90,
+0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10,
+0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10,
+0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90,
+0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90,
+0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90,
+0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10,
+0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10,
+0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90,
+0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90,
+0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90,
+0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10,
+0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10,
+0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10,
+0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90,
+0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90,
+0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF,
+0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01,
+0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* America/Louisville */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA4, 0x73, 0xF7, 0x00,
+0xA5, 0x16, 0x11, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD2, 0xDB, 0x97, 0x60, 0xD3, 0xA4, 0x09, 0x70,
+0xD5, 0x55, 0xD5, 0x00, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70,
+0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0,
+0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x1E, 0x90, 0x70,
+0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0,
+0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60,
+0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60,
+0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60,
+0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0,
+0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0,
+0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0,
+0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60,
+0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60,
+0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60,
+0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0,
+0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0,
+0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60,
+0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60,
+0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60,
+0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0,
+0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0,
+0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0,
+0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60,
+0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0,
+0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0,
+0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60,
+0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60,
+0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60,
+0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0,
+0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0,
+0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60,
+0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60,
+0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60,
+0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0,
+0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0,
+0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0,
+0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60,
+0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60,
+0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9,
+0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF,
+0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54,
+0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* America/Maceio */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x68, 0x7C,
+0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20,
+0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20,
+0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20,
+0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0,
+0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0,
+0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0,
+0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0,
+0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20,
+0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20,
+0x39, 0xDF, 0xE3, 0x30, 0x39, 0xF2, 0x4A, 0x20, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xDE, 0x84, 0x00, 0x00, 0xFF,
+0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42,
+0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Managua */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xBD, 0x2D, 0x48, 0xE8,
+0x06, 0x43, 0x74, 0x60, 0x09, 0xA4, 0x3E, 0x50, 0x11, 0x51, 0xF8, 0xE0, 0x11, 0xD4, 0x6F, 0x50,
+0x13, 0x31, 0xDA, 0xE0, 0x13, 0xB4, 0x51, 0x50, 0x29, 0x61, 0x91, 0x20, 0x2A, 0xC1, 0x4B, 0x50,
+0x2B, 0x44, 0x16, 0x20, 0x36, 0x63, 0x77, 0xD0, 0x42, 0x58, 0xC0, 0xE0, 0x43, 0x2C, 0xF4, 0x50,
+0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x03, 0x01, 0xFF, 0xFF, 0xAF,
+0x18, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF,
+0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0x4D, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54,
+0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Manaus */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7F, 0x44,
+0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30,
+0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30,
+0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30,
+0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0,
+0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0,
+0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0,
+0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0,
+0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC7, 0xBC, 0x00, 0x00, 0xFF, 0xFF, 0xD5,
+0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53,
+0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Martinique */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xA3, 0xC8, 0x44,
+0x13, 0x4D, 0x6E, 0x40, 0x14, 0x34, 0x16, 0xB0, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xC6, 0xBC, 0x00,
+0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x05, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x09, 0x46, 0x46, 0x4D,
+0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* America/Mazatlan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70,
+0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60,
+0xB8, 0xFD, 0x86, 0xF0, 0xCB, 0xEA, 0x71, 0x60, 0xD8, 0x91, 0xB4, 0xF0, 0x00, 0x00, 0x70, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xF5, 0x12, 0x90, 0x3B, 0xB6, 0xD1, 0x00,
+0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, 0x47, 0x24, 0x41, 0x80,
+0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, 0x4A, 0xE4, 0x05, 0x80,
+0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, 0x4E, 0xAD, 0x04, 0x00,
+0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, 0x52, 0x6C, 0xC8, 0x00,
+0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, 0x56, 0x2C, 0x8C, 0x00,
+0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, 0x59, 0xF5, 0x8A, 0x80,
+0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, 0x5D, 0xB5, 0x4E, 0x80,
+0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, 0x61, 0x7E, 0x4D, 0x00,
+0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, 0x65, 0x3E, 0x11, 0x00,
+0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, 0x68, 0xFD, 0xD5, 0x00,
+0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, 0x6C, 0xC6, 0xD3, 0x80,
+0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, 0x70, 0x86, 0x97, 0x80,
+0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, 0x74, 0x46, 0x5B, 0x80,
+0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, 0x78, 0x0F, 0x5A, 0x00,
+0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, 0x7B, 0xCF, 0x1E, 0x00,
+0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, 0x7F, 0x8E, 0xE2, 0x00,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, 0x9C,
+0x3C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF,
+0xFF, 0x8F, 0x80, 0x00, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D,
+0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Mendoza */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x19, 0x34, 0x40,
+0x27, 0xCD, 0xC3, 0xB0, 0x28, 0xFA, 0x67, 0xC0, 0x29, 0xB0, 0x48, 0xB0, 0x2A, 0xE0, 0xE1, 0x40,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xB0, 0x13, 0xB0,
+0x41, 0x56, 0x3E, 0xC0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0xFF, 0xFF,
+0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08,
+0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00,
+0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x57, 0x41, 0x52, 0x53, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Menominee */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0,
+0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0x06, 0x40, 0xDF, 0x70,
+0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00,
+0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80,
+0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00,
+0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00,
+0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00,
+0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80,
+0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00,
+0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00,
+0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80,
+0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, 0x2B, 0xBE, 0x95, 0x80,
+0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80,
+0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00,
+0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00,
+0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00,
+0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80,
+0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80,
+0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00,
+0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00,
+0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80,
+0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80,
+0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80,
+0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00,
+0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00,
+0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80,
+0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80,
+0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80,
+0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00,
+0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00,
+0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00,
+0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80,
+0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80,
+0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80,
+0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF,
+0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10,
+0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00,
+0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* America/Merida */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA5, 0xB6, 0xDA, 0x60,
+0x16, 0x86, 0xD5, 0x60, 0x18, 0x4C, 0x4B, 0x50, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70,
+0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70,
+0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0,
+0x3A, 0xF5, 0x04, 0x80, 0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0,
+0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70,
+0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70,
+0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70,
+0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0,
+0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0,
+0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0,
+0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70,
+0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70,
+0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70,
+0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0,
+0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0,
+0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0,
+0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70,
+0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70,
+0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0,
+0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0,
+0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0,
+0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03,
+0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0xFF,
+0xFF, 0xAB, 0xFC, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00,
+0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Mexico_City */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70,
+0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60,
+0xB8, 0xFD, 0x86, 0xF0, 0xC5, 0xDE, 0xB0, 0x60, 0xC6, 0x97, 0x34, 0x50, 0xC9, 0x55, 0xF1, 0xE0,
+0xC9, 0xEA, 0xDD, 0x50, 0xCF, 0x02, 0xC6, 0xE0, 0xCF, 0xB7, 0x56, 0x50, 0xDA, 0x99, 0x15, 0xE0,
+0xDB, 0x76, 0x83, 0xD0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00,
+0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00,
+0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xF5, 0x04, 0x80,
+0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80,
+0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80,
+0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80,
+0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00,
+0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00,
+0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80,
+0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80,
+0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80,
+0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00,
+0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00,
+0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00,
+0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80,
+0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80,
+0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80,
+0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00,
+0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00,
+0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00,
+0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80,
+0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xA3, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90,
+0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF,
+0xB9, 0xB0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00,
+0x43, 0x44, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* America/Miquelon */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x91, 0xB6, 0x38, 0xA8,
+0x13, 0x6E, 0x63, 0xC0, 0x20, 0x75, 0xE4, 0xD0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x55, 0xC6, 0xD0,
+0x23, 0x6A, 0x93, 0xC0, 0x24, 0x35, 0xA8, 0xD0, 0x25, 0x4A, 0x75, 0xC0, 0x26, 0x15, 0x8A, 0xD0,
+0x27, 0x2A, 0x57, 0xC0, 0x27, 0xFE, 0xA7, 0x50, 0x29, 0x0A, 0x39, 0xC0, 0x29, 0xDE, 0x89, 0x50,
+0x2A, 0xEA, 0x1B, 0xC0, 0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xD3, 0x38, 0x40, 0x2D, 0x9E, 0x4D, 0x50,
+0x2E, 0xB3, 0x1A, 0x40, 0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x92, 0xFC, 0x40, 0x31, 0x67, 0x4B, 0xD0,
+0x32, 0x72, 0xDE, 0x40, 0x33, 0x47, 0x2D, 0xD0, 0x34, 0x52, 0xC0, 0x40, 0x35, 0x27, 0x0F, 0xD0,
+0x36, 0x32, 0xA2, 0x40, 0x37, 0x06, 0xF1, 0xD0, 0x38, 0x1B, 0xBE, 0xC0, 0x38, 0xE6, 0xD3, 0xD0,
+0x39, 0xFB, 0xA0, 0xC0, 0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x82, 0xC0, 0x3C, 0xAF, 0xD2, 0x50,
+0x3D, 0xBB, 0x64, 0xC0, 0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x46, 0xC0, 0x40, 0x6F, 0x96, 0x50,
+0x41, 0x84, 0x63, 0x40, 0x42, 0x4F, 0x78, 0x50, 0x43, 0x64, 0x45, 0x40, 0x44, 0x2F, 0x5A, 0x50,
+0x45, 0x44, 0x27, 0x40, 0x46, 0x0F, 0x3C, 0x50, 0x47, 0x24, 0x09, 0x40, 0x47, 0xF8, 0x58, 0xD0,
+0x49, 0x03, 0xEB, 0x40, 0x49, 0xD8, 0x3A, 0xD0, 0x4A, 0xE3, 0xCD, 0x40, 0x4B, 0xB8, 0x1C, 0xD0,
+0x4C, 0xCC, 0xE9, 0xC0, 0x4D, 0x97, 0xFE, 0xD0, 0x4E, 0xAC, 0xCB, 0xC0, 0x4F, 0x77, 0xE0, 0xD0,
+0x50, 0x8C, 0xAD, 0xC0, 0x51, 0x60, 0xFD, 0x50, 0x52, 0x6C, 0x8F, 0xC0, 0x53, 0x40, 0xDF, 0x50,
+0x54, 0x4C, 0x71, 0xC0, 0x55, 0x20, 0xC1, 0x50, 0x56, 0x2C, 0x53, 0xC0, 0x57, 0x00, 0xA3, 0x50,
+0x58, 0x15, 0x70, 0x40, 0x58, 0xE0, 0x85, 0x50, 0x59, 0xF5, 0x52, 0x40, 0x5A, 0xC0, 0x67, 0x50,
+0x5B, 0xD5, 0x34, 0x40, 0x5C, 0xA9, 0x83, 0xD0, 0x5D, 0xB5, 0x16, 0x40, 0x5E, 0x89, 0x65, 0xD0,
+0x5F, 0x94, 0xF8, 0x40, 0x60, 0x69, 0x47, 0xD0, 0x61, 0x7E, 0x14, 0xC0, 0x62, 0x49, 0x29, 0xD0,
+0x63, 0x5D, 0xF6, 0xC0, 0x64, 0x29, 0x0B, 0xD0, 0x65, 0x3D, 0xD8, 0xC0, 0x66, 0x12, 0x28, 0x50,
+0x67, 0x1D, 0xBA, 0xC0, 0x67, 0xF2, 0x0A, 0x50, 0x68, 0xFD, 0x9C, 0xC0, 0x69, 0xD1, 0xEC, 0x50,
+0x6A, 0xDD, 0x7E, 0xC0, 0x6B, 0xB1, 0xCE, 0x50, 0x6C, 0xC6, 0x9B, 0x40, 0x6D, 0x91, 0xB0, 0x50,
+0x6E, 0xA6, 0x7D, 0x40, 0x6F, 0x71, 0x92, 0x50, 0x70, 0x86, 0x5F, 0x40, 0x71, 0x5A, 0xAE, 0xD0,
+0x72, 0x66, 0x41, 0x40, 0x73, 0x3A, 0x90, 0xD0, 0x74, 0x46, 0x23, 0x40, 0x75, 0x1A, 0x72, 0xD0,
+0x76, 0x2F, 0x3F, 0xC0, 0x76, 0xFA, 0x54, 0xD0, 0x78, 0x0F, 0x21, 0xC0, 0x78, 0xDA, 0x36, 0xD0,
+0x79, 0xEF, 0x03, 0xC0, 0x7A, 0xBA, 0x18, 0xD0, 0x7B, 0xCE, 0xE5, 0xC0, 0x7C, 0xA3, 0x35, 0x50,
+0x7D, 0xAE, 0xC7, 0xC0, 0x7E, 0x83, 0x17, 0x50, 0x7F, 0x8E, 0xA9, 0xC0, 0x01, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xCB, 0x58, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04,
+0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00,
+0x41, 0x53, 0x54, 0x00, 0x50, 0x4D, 0x53, 0x54, 0x00, 0x50, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Monterrey */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA5, 0xB6, 0xDA, 0x60,
+0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70,
+0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70,
+0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0,
+0x3A, 0xF5, 0x04, 0x80, 0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0,
+0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70,
+0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70,
+0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70,
+0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0,
+0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0,
+0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0,
+0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70,
+0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70,
+0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70,
+0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0,
+0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0,
+0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0,
+0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70,
+0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70,
+0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0,
+0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0,
+0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0,
+0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF,
+0xFF, 0xA1, 0xF4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* America/Montevideo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0xA2, 0x92, 0x87, 0xAC,
+0xA9, 0x01, 0x25, 0xB8, 0xA9, 0xF1, 0x0F, 0xB0, 0xAA, 0xE2, 0x59, 0x38, 0xAB, 0xD2, 0x43, 0x30,
+0xAC, 0xC3, 0x8C, 0xB8, 0xAD, 0xB3, 0x76, 0xB0, 0xBB, 0xF4, 0xB5, 0xB8, 0xBC, 0xBF, 0xB5, 0xB0,
+0xBD, 0xD4, 0x97, 0xB8, 0xBE, 0x9F, 0x97, 0xB0, 0xBF, 0xB4, 0x79, 0xB8, 0xC0, 0x7F, 0x79, 0xB0,
+0xC1, 0x9D, 0x96, 0x38, 0xC2, 0x5F, 0x5B, 0xB0, 0xC3, 0x7D, 0x78, 0x38, 0xC4, 0x3F, 0x3D, 0xB0,
+0xC5, 0x5D, 0x5A, 0x38, 0xC6, 0x1F, 0x1F, 0xB0, 0xC7, 0x3D, 0x3C, 0x38, 0xC8, 0x08, 0x3C, 0x30,
+0xC9, 0x1D, 0x1E, 0x38, 0xC9, 0xE8, 0x1E, 0x30, 0xCB, 0x55, 0x54, 0xB8, 0xCD, 0x1E, 0xC6, 0x30,
+0xCD, 0x95, 0x5F, 0x20, 0xEC, 0x0B, 0x85, 0xB0, 0xEC, 0xF2, 0x2E, 0x20, 0xED, 0x45, 0x4A, 0xB0,
+0xED, 0x85, 0xD6, 0x20, 0xF7, 0x13, 0x72, 0xB0, 0xF7, 0xFA, 0x1B, 0x20, 0xF8, 0xF3, 0x54, 0xB0,
+0xFA, 0x09, 0x73, 0x20, 0xFA, 0xD3, 0x36, 0xB0, 0xFB, 0xEA, 0xA6, 0xA0, 0xFC, 0xFE, 0x3E, 0x30,
+0xFD, 0xF7, 0x62, 0xA8, 0xFE, 0xDF, 0x71, 0xB0, 0xFF, 0xD8, 0x96, 0x28, 0x00, 0xC0, 0xA5, 0x30,
+0x01, 0xB9, 0xC9, 0xA8, 0x04, 0x58, 0xDC, 0x30, 0x04, 0xED, 0xC7, 0xA0, 0x07, 0xDF, 0xEF, 0xB0,
+0x09, 0x5A, 0x47, 0x28, 0x0C, 0xB1, 0xDD, 0xA0, 0x0E, 0xE7, 0x7F, 0x30, 0x0F, 0x83, 0x02, 0x20,
+0x12, 0x55, 0x86, 0x30, 0x13, 0x6E, 0x47, 0xA0, 0x21, 0xC3, 0x54, 0x30, 0x22, 0x3B, 0x3E, 0xA0,
+0x23, 0xA1, 0xE4, 0xB0, 0x24, 0x19, 0xCF, 0x20, 0x25, 0x4A, 0x67, 0xB0, 0x25, 0xF0, 0x76, 0xA0,
+0x27, 0x21, 0x0F, 0x30, 0x27, 0xD0, 0x58, 0xA0, 0x29, 0x0A, 0x2B, 0xB0, 0x29, 0xB0, 0x3A, 0xA0,
+0x2A, 0xE0, 0xD3, 0x30, 0x2B, 0x90, 0x1C, 0xA0, 0x41, 0x4C, 0xF6, 0x30, 0x42, 0x46, 0x2F, 0xC0,
+0x43, 0x48, 0xA3, 0xD0, 0x44, 0x13, 0x9C, 0xC0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x04, 0x06, 0x04,
+0x06, 0x04, 0x05, 0x04, 0x06, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xCB, 0x54, 0x00,
+0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x0A, 0xFF, 0xFF, 0xCE,
+0xC8, 0x00, 0x0A, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x0A, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x0E, 0xFF,
+0xFF, 0xDC, 0xD8, 0x01, 0x04, 0x4D, 0x4D, 0x54, 0x00, 0x55, 0x59, 0x48, 0x53, 0x54, 0x00, 0x55,
+0x59, 0x54, 0x00, 0x55, 0x59, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Montreal */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9C, 0xBD, 0x01, 0xF0,
+0x9C, 0xE4, 0x64, 0xC0, 0x9E, 0xB8, 0x93, 0x70, 0x9F, 0xC0, 0x31, 0x60, 0xA0, 0x87, 0x58, 0xF8,
+0xA1, 0x99, 0x82, 0xE8, 0xA2, 0x94, 0x0D, 0xF8, 0xA3, 0x5F, 0x06, 0xE8, 0xA4, 0x73, 0xE8, 0xF0,
+0xA5, 0x3E, 0xE8, 0xE8, 0xA6, 0x53, 0xCA, 0xF0, 0xA7, 0x1E, 0xCA, 0xE8, 0xAA, 0x2D, 0xEC, 0xF0,
+0xAA, 0xDE, 0x8E, 0xE8, 0xAB, 0xFC, 0xAB, 0x70, 0xAC, 0xBE, 0x70, 0xE8, 0xAD, 0xDC, 0x8D, 0x70,
+0xAE, 0x9E, 0x52, 0xE8, 0xAF, 0xBC, 0x53, 0x50, 0xB0, 0x7E, 0x11, 0xC0, 0xB1, 0x9C, 0x35, 0x50,
+0xB2, 0x67, 0x2E, 0x40, 0xB3, 0x7C, 0x17, 0x50, 0xB4, 0x47, 0x10, 0x40, 0xB5, 0x5B, 0xF9, 0x50,
+0xB6, 0x26, 0xF2, 0x40, 0xB7, 0x3B, 0xDB, 0x50, 0xB8, 0x06, 0xD4, 0x40, 0xB9, 0x24, 0xF7, 0xD0,
+0xB9, 0xE6, 0xB6, 0x40, 0xBB, 0x04, 0xD9, 0xD0, 0xBB, 0xCF, 0xD2, 0xC0, 0xBC, 0xE4, 0xBB, 0xD0,
+0xBD, 0xAF, 0xB4, 0xC0, 0xBE, 0xC4, 0x9D, 0xD0, 0xBF, 0x8F, 0x96, 0xC0, 0xC0, 0xA4, 0x7F, 0xD0,
+0xC1, 0x6F, 0x78, 0xC0, 0xC2, 0x84, 0x61, 0xD0, 0xC3, 0x4F, 0x5A, 0xC0, 0xC4, 0x64, 0x43, 0xD0,
+0xC5, 0x2F, 0x3C, 0xC0, 0xC6, 0x4D, 0x60, 0x50, 0xC7, 0x0F, 0x1E, 0xC0, 0xC8, 0x2D, 0x42, 0x50,
+0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0,
+0xD4, 0x40, 0xDD, 0xE0, 0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0,
+0xD8, 0x00, 0xA1, 0xE0, 0xD9, 0x15, 0x8A, 0xF0, 0xDA, 0x0E, 0xA8, 0x60, 0xDA, 0xFE, 0xA7, 0x70,
+0xDB, 0xEE, 0x8A, 0x60, 0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70,
+0xDF, 0x89, 0x64, 0x60, 0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70,
+0xE3, 0x49, 0x28, 0x60, 0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x29, 0x0A, 0x60, 0xE6, 0x47, 0x2D, 0xF0,
+0xE7, 0x12, 0x26, 0xE0, 0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0,
+0xEA, 0xF6, 0xD4, 0xE0, 0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0,
+0xEE, 0xBF, 0xD3, 0x60, 0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70,
+0xF2, 0x7F, 0x97, 0x60, 0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70,
+0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70,
+0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0,
+0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0,
+0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70,
+0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x08, 0x20, 0xC1, 0x70,
+0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70,
+0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0,
+0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0,
+0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0,
+0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70,
+0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70,
+0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0,
+0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0,
+0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70,
+0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70,
+0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0,
+0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0,
+0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0,
+0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70,
+0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70,
+0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70,
+0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0,
+0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0,
+0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0,
+0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70,
+0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70,
+0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70,
+0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0,
+0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0,
+0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70,
+0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70,
+0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70,
+0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0,
+0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0,
+0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0,
+0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70,
+0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04,
+0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00,
+0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x00, 0x00, 0x00, 0x01,
+
+/* America/Montserrat */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x35, 0x10,
+0x01, 0xFF, 0xFF, 0xC5, 0xAC, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Nassau */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x37, 0x42, 0x84,
+0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0,
+0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0,
+0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0,
+0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60,
+0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60,
+0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60,
+0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0,
+0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0,
+0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0,
+0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60,
+0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60,
+0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60,
+0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0,
+0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0,
+0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60,
+0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60,
+0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60,
+0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0,
+0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0,
+0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0,
+0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60,
+0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60,
+0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60,
+0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0,
+0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0,
+0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0,
+0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60,
+0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60,
+0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0,
+0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0,
+0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0,
+0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60,
+0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60,
+0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60,
+0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0,
+0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0,
+0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xB7, 0x7C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01,
+0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/New_York */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x1E, 0x70,
+0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x86, 0x00, 0x70, 0xA1, 0x9A, 0xCD, 0x60, 0xA2, 0x65, 0xE2, 0x70,
+0xA3, 0x83, 0xE9, 0xE0, 0xA4, 0x6A, 0xAE, 0x70, 0xA5, 0x35, 0xA7, 0x60, 0xA6, 0x53, 0xCA, 0xF0,
+0xA7, 0x15, 0x89, 0x60, 0xA8, 0x33, 0xAC, 0xF0, 0xA8, 0xFE, 0xA5, 0xE0, 0xAA, 0x13, 0x8E, 0xF0,
+0xAA, 0xDE, 0x87, 0xE0, 0xAB, 0xF3, 0x70, 0xF0, 0xAC, 0xBE, 0x69, 0xE0, 0xAD, 0xD3, 0x52, 0xF0,
+0xAE, 0x9E, 0x4B, 0xE0, 0xAF, 0xB3, 0x34, 0xF0, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70,
+0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70,
+0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x1B, 0xD9, 0x70,
+0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xC6, 0xB4, 0x60, 0xBC, 0xE4, 0xD7, 0xF0,
+0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0,
+0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0,
+0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70,
+0xC8, 0xF8, 0x57, 0x60, 0xCA, 0x0D, 0x40, 0x70, 0xCA, 0xD8, 0x39, 0x60, 0xCB, 0x88, 0xF0, 0x70,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, 0xD4, 0x40, 0xDD, 0xE0,
+0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0,
+0xD9, 0x15, 0x8A, 0xF0, 0xD9, 0xE0, 0x83, 0xE0, 0xDA, 0xFE, 0xA7, 0x70, 0xDB, 0xC0, 0x65, 0xE0,
+0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, 0xDF, 0x89, 0x64, 0x60,
+0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, 0xE3, 0x49, 0x28, 0x60,
+0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x57, 0x2E, 0xE0, 0xE6, 0x47, 0x2D, 0xF0, 0xE7, 0x37, 0x10, 0xE0,
+0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, 0xEA, 0xF6, 0xD4, 0xE0,
+0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, 0xEE, 0xBF, 0xD3, 0x60,
+0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, 0xF2, 0x7F, 0x97, 0x60,
+0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60,
+0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0,
+0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0,
+0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0,
+0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60,
+0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60,
+0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0,
+0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0,
+0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0,
+0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60,
+0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60,
+0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60,
+0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0,
+0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0,
+0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0,
+0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60,
+0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60,
+0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60,
+0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0,
+0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0,
+0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60,
+0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60,
+0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0,
+0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60,
+0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60,
+0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60,
+0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0,
+0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0,
+0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0,
+0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60,
+0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60,
+0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60,
+0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0,
+0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0,
+0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60,
+0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60,
+0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60,
+0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF,
+0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00, 0x00, 0x01,
+
+/* America/Nipigon */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70,
+0x9F, 0xC0, 0x31, 0x60, 0xC8, 0xF8, 0x49, 0x50, 0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x60, 0xFB, 0xE0, 0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70,
+0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70,
+0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0,
+0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0,
+0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0,
+0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70,
+0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0,
+0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0,
+0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70,
+0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70,
+0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70,
+0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0,
+0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0,
+0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0,
+0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70,
+0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70,
+0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70,
+0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0,
+0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0,
+0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70,
+0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70,
+0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70,
+0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0,
+0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0,
+0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0,
+0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70,
+0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70,
+0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70,
+0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0,
+0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0,
+0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0,
+0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70,
+0x7F, 0x8E, 0xC5, 0xE0, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00,
+0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0,
+0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* America/Nome */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0xCB, 0x89, 0x44, 0xD0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50,
+0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50,
+0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0,
+0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50,
+0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0,
+0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50,
+0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50,
+0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50,
+0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0,
+0x1C, 0xD2, 0x24, 0xB0, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0,
+0x20, 0x76, 0x39, 0x30, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20,
+0x24, 0x35, 0xFD, 0x30, 0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20,
+0x27, 0xFE, 0xFB, 0xB0, 0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20,
+0x2B, 0xBE, 0xBF, 0xB0, 0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0,
+0x2F, 0x7E, 0x83, 0xB0, 0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0,
+0x33, 0x47, 0x82, 0x30, 0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0,
+0x37, 0x07, 0x46, 0x30, 0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20,
+0x3A, 0xC7, 0x0A, 0x30, 0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20,
+0x3E, 0x90, 0x08, 0xB0, 0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0,
+0x42, 0x4F, 0xCC, 0xB0, 0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0,
+0x45, 0xF3, 0xE1, 0x30, 0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20,
+0x49, 0xB3, 0xA5, 0x30, 0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0,
+0x4D, 0x7C, 0xA3, 0xB0, 0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0,
+0x51, 0x3C, 0x67, 0xB0, 0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0,
+0x54, 0xFC, 0x2B, 0xB0, 0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20,
+0x58, 0xC5, 0x2A, 0x30, 0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20,
+0x5C, 0x84, 0xEE, 0x30, 0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20,
+0x60, 0x4D, 0xEC, 0xB0, 0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0,
+0x64, 0x0D, 0xB0, 0xB0, 0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0,
+0x67, 0xCD, 0x74, 0xB0, 0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0,
+0x6B, 0x96, 0x73, 0x30, 0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20,
+0x6F, 0x56, 0x37, 0x30, 0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20,
+0x73, 0x15, 0xFB, 0x30, 0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0,
+0x76, 0xDE, 0xF9, 0xB0, 0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0,
+0x7A, 0x9E, 0xBD, 0xB0, 0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0,
+0x7E, 0x5E, 0x81, 0xB0, 0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73,
+0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF,
+0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x14, 0xFF, 0xFF, 0x8F, 0x80, 0x01,
+0x18, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x1D, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E,
+0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x41,
+0x4B, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Noronha */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x65, 0x64,
+0xB8, 0x0F, 0x3B, 0xD0, 0xB8, 0xFD, 0x32, 0x90, 0xB9, 0xF1, 0x26, 0x20, 0xBA, 0xDE, 0x66, 0x10,
+0xDA, 0x38, 0xA0, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDC, 0x19, 0xD3, 0xA0, 0xDC, 0xB9, 0x4B, 0x10,
+0xDD, 0xFB, 0x07, 0x20, 0xDE, 0x9B, 0xD0, 0x10, 0xDF, 0xDD, 0x8C, 0x20, 0xE0, 0x54, 0x25, 0x10,
+0xF4, 0x97, 0xF1, 0xA0, 0xF5, 0x05, 0x50, 0x10, 0xF6, 0xC0, 0x56, 0x20, 0xF7, 0x0E, 0x10, 0x90,
+0xF8, 0x51, 0x1E, 0x20, 0xF8, 0xC7, 0xB7, 0x10, 0xFA, 0x0A, 0xC4, 0xA0, 0xFA, 0xA8, 0xEA, 0x90,
+0xFB, 0xEB, 0xF8, 0x20, 0xFC, 0x8B, 0x6F, 0x90, 0x1D, 0xC9, 0x80, 0x20, 0x1E, 0x78, 0xC9, 0x90,
+0x1F, 0xA0, 0x27, 0xA0, 0x20, 0x33, 0xC1, 0x90, 0x21, 0x81, 0x5B, 0x20, 0x22, 0x0B, 0xBA, 0x90,
+0x23, 0x58, 0x02, 0xA0, 0x23, 0xE2, 0x62, 0x10, 0x25, 0x37, 0xE4, 0xA0, 0x25, 0xD4, 0xB9, 0x10,
+0x37, 0xF6, 0xB8, 0xA0, 0x38, 0xB8, 0x77, 0x10, 0x39, 0xDF, 0xD5, 0x20, 0x39, 0xE9, 0x01, 0x90,
+0x3B, 0xC8, 0xF1, 0xA0, 0x3C, 0x6F, 0x00, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF,
+0xFF, 0xE1, 0x9C, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x00,
+0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4E, 0x53, 0x54, 0x00, 0x46, 0x4E, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* America/North_Dakota/Center */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x3A, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00,
+0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00,
+0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80,
+0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80,
+0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80,
+0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00,
+0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00,
+0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70,
+0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70,
+0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70,
+0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0,
+0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0,
+0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0,
+0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70,
+0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0,
+0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0,
+0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70,
+0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70,
+0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70,
+0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0,
+0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0,
+0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70,
+0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70,
+0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70,
+0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0,
+0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0,
+0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0,
+0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70,
+0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70,
+0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00,
+0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9,
+0xB0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54,
+0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* America/Panama */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x8B, 0xF4, 0x61, 0xE8,
+0x01, 0xFF, 0xFF, 0xB5, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x43, 0x4D, 0x54,
+0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Pangnirtung */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x25, 0x9E, 0xB8, 0x85, 0x60,
+0x9F, 0xBA, 0xDD, 0x50, 0xA0, 0xCF, 0xC6, 0x60, 0xA1, 0xA2, 0x8C, 0x30, 0xCB, 0x88, 0xE2, 0x60,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xF7, 0x2F, 0x30, 0x40, 0xF8, 0x28, 0x5B, 0xC0,
+0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0,
+0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50,
+0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50,
+0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50,
+0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0,
+0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0,
+0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50,
+0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x18, 0x60,
+0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60,
+0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0,
+0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0,
+0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0,
+0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60,
+0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60,
+0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60,
+0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0,
+0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0,
+0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0,
+0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60,
+0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60,
+0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0,
+0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0,
+0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0,
+0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60,
+0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60,
+0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60,
+0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0,
+0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0,
+0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x07, 0x08, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0xFF, 0xFF, 0xD5,
+0xD0, 0x01, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF,
+0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01,
+0x15, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x19, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x1D, 0xFF, 0xFF, 0xB9,
+0xB0, 0x01, 0x21, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41,
+0x50, 0x54, 0x00, 0x41, 0x44, 0x44, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00,
+0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Paramaribo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x91, 0x05, 0x8E, 0xB8,
+0xBE, 0x2A, 0x4B, 0xC4, 0xD2, 0x62, 0x2C, 0xB4, 0x0B, 0x11, 0x58, 0xB8, 0x1B, 0xBE, 0x31, 0xB8,
+0x01, 0x02, 0x03, 0x04, 0x05, 0xFF, 0xFF, 0xCC, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xCC, 0x3C, 0x00,
+0x04, 0xFF, 0xFF, 0xCC, 0x4C, 0x00, 0x04, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x08, 0xFF, 0xFF, 0xCE,
+0xC8, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4D, 0x54,
+0x00, 0x4E, 0x45, 0x47, 0x54, 0x00, 0x53, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Phoenix */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0xA6, 0x3A, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90,
+0xCF, 0x17, 0xDF, 0x1C, 0xCF, 0x8F, 0xE5, 0xAC, 0xD0, 0x81, 0x1A, 0x1C, 0xFA, 0xF8, 0x75, 0x10,
+0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF,
+0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08,
+0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* America/Port-au-Prince */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x9C, 0x6E, 0x71, 0xFC,
+0x19, 0x1B, 0x46, 0xD0, 0x1A, 0x01, 0xEF, 0x40, 0x1A, 0xF1, 0xEE, 0x50, 0x1B, 0xE1, 0xD1, 0x40,
+0x1C, 0xD1, 0xD0, 0x50, 0x1D, 0xC1, 0xB3, 0x40, 0x1E, 0xB1, 0xB2, 0x50, 0x1F, 0xA1, 0x95, 0x40,
+0x20, 0x91, 0x94, 0x50, 0x21, 0x81, 0x77, 0x40, 0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xAF, 0xE0,
+0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x73, 0xE0,
+0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x37, 0xE0,
+0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x36, 0x60,
+0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xFA, 0x60,
+0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xDC, 0x60, 0x42, 0x4F, 0x78, 0x50, 0x43, 0x64, 0x45, 0x40,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01,
+0x02, 0xFF, 0xFF, 0xBC, 0x44, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9,
+0xB0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x50,
+0x50, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Porto_Acre */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x86, 0x90,
+0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40,
+0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40,
+0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40,
+0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0,
+0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0,
+0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0,
+0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC0,
+0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C,
+0x4D, 0x54, 0x00, 0x41, 0x43, 0x53, 0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* America/Port_of_Spain */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC,
+0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Porto_Velho */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x82, 0xE8,
+0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30,
+0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30,
+0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30,
+0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0,
+0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0,
+0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0,
+0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC4,
+0x18, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C,
+0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* America/Puerto_Rico */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xCB, 0xF6, 0x32, 0xC0,
+0xD2, 0x60, 0xED, 0xD0, 0x01, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0,
+0x01, 0x04, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Rainy_River */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0xA1, 0x80,
+0x9F, 0xC0, 0x3F, 0x70, 0xC8, 0xF8, 0x57, 0x60, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x61, 0x09, 0xF0, 0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x0A, 0x00, 0xB1, 0x80,
+0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80,
+0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00,
+0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00,
+0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00,
+0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80,
+0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00,
+0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00,
+0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80,
+0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, 0x2B, 0xBE, 0x95, 0x80,
+0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80,
+0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00,
+0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00,
+0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00,
+0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80,
+0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80,
+0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80,
+0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00,
+0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00,
+0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80,
+0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80,
+0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80,
+0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00,
+0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00,
+0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00,
+0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80,
+0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80,
+0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80,
+0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00,
+0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00,
+0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00,
+0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80,
+0x7F, 0x8E, 0xD3, 0xF0, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00,
+0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0,
+0x01, 0x0C, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* America/Rankin_Inlet */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x19, 0x9E, 0xB8, 0xA1, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0xCF, 0xE2, 0x80, 0xA1, 0xA2, 0xA8, 0x50, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x77, 0xE0,
+0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0,
+0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70,
+0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70,
+0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70,
+0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0,
+0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0,
+0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70,
+0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70,
+0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70,
+0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0,
+0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0,
+0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0,
+0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70,
+0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70,
+0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70,
+0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0,
+0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0,
+0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0,
+0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70,
+0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70,
+0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0,
+0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0,
+0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0,
+0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70,
+0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70,
+0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70,
+0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0,
+0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0,
+0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9,
+0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF,
+0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x10, 0xFF, 0xFF, 0xB9, 0xB0, 0x00,
+0x15, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54,
+0x00, 0x43, 0x44, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* America/Recife */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x67, 0xB8,
+0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20,
+0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20,
+0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20,
+0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0,
+0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0,
+0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0,
+0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0,
+0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20,
+0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x39, 0xE9, 0x0F, 0xA0,
+0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF,
+0xFF, 0xDF, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00,
+0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* America/Regina */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x93, 0x1C,
+0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xB5, 0x65, 0x4F, 0xF0, 0xB6, 0x30, 0x48, 0xE0,
+0xB7, 0x45, 0x31, 0xF0, 0xB8, 0x10, 0x2A, 0xE0, 0xB9, 0x25, 0x13, 0xF0, 0xB9, 0xF0, 0x0C, 0xE0,
+0xBB, 0x0E, 0x30, 0x70, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xEE, 0x12, 0x70, 0xBD, 0xB9, 0x0B, 0x60,
+0xC2, 0x72, 0x08, 0xF0, 0xC3, 0x61, 0xEB, 0xE0, 0xC4, 0x51, 0xEA, 0xF0, 0xC5, 0x38, 0x93, 0x60,
+0xC6, 0x31, 0xCC, 0xF0, 0xC7, 0x21, 0xAF, 0xE0, 0xC8, 0x1A, 0xE9, 0x70, 0xC9, 0x0A, 0xCC, 0x60,
+0xC9, 0xFA, 0xCB, 0x70, 0xCA, 0xEA, 0xAE, 0x60, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x61, 0x18, 0x00, 0xD3, 0x63, 0x8C, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10,
+0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10,
+0xD9, 0xE0, 0xA0, 0x00, 0xDA, 0xFE, 0xC3, 0x90, 0xDB, 0xC0, 0x82, 0x00, 0xDC, 0xDE, 0xA5, 0x90,
+0xDD, 0xA9, 0x9E, 0x80, 0xDE, 0xBE, 0x87, 0x90, 0xDF, 0x89, 0x80, 0x80, 0xE0, 0x9E, 0x69, 0x90,
+0xE1, 0x69, 0x62, 0x80, 0xE2, 0x7E, 0x4B, 0x90, 0xE3, 0x49, 0x44, 0x80, 0xE4, 0x5E, 0x2D, 0x90,
+0xE5, 0x29, 0x26, 0x80, 0xE6, 0x47, 0x4A, 0x10, 0xE7, 0x12, 0x43, 0x00, 0xE8, 0x27, 0x2C, 0x10,
+0xE8, 0xF2, 0x25, 0x00, 0xEB, 0xE6, 0xF0, 0x10, 0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, 0xFF, 0x9D, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01,
+0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB,
+0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54,
+0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* America/Rio_Branco */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x86, 0x90,
+0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40,
+0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40,
+0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40,
+0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0,
+0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0,
+0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0,
+0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC0,
+0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C,
+0x4D, 0x54, 0x00, 0x41, 0x43, 0x53, 0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* America/Rosario */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30,
+0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30,
+0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30,
+0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0,
+0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0,
+0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30,
+0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30,
+0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30,
+0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0,
+0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0,
+0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30,
+0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0,
+0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30,
+0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30,
+0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04,
+0x03, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04,
+0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0,
+0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00,
+0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Santiago */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0D, 0x8F, 0x24, 0x69, 0xC0,
+0x9F, 0x71, 0x09, 0x50, 0xA1, 0x01, 0xC3, 0x40, 0xB0, 0x5E, 0x7B, 0xD0, 0xB1, 0x77, 0x3D, 0x40,
+0xB2, 0x41, 0x00, 0xD0, 0xB3, 0x58, 0x70, 0xC0, 0xB4, 0x22, 0x34, 0x50, 0xB5, 0x39, 0xA4, 0x40,
+0xB6, 0x03, 0x67, 0xD0, 0xB7, 0x1A, 0xD7, 0xC0, 0xB7, 0xE4, 0x9B, 0x50, 0xB8, 0xFD, 0x5C, 0xC0,
+0xB9, 0xC7, 0x20, 0x50, 0xF9, 0xEC, 0x8E, 0x40, 0xFA, 0xB7, 0x87, 0x30, 0xFB, 0xD5, 0xAA, 0xC0,
+0xFC, 0x97, 0x69, 0x30, 0xFD, 0xB5, 0x8C, 0xC0, 0xFE, 0x77, 0x4B, 0x30, 0xFF, 0x95, 0x6E, 0xC0,
+0x00, 0x60, 0x67, 0xB0, 0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0,
+0x04, 0x20, 0x2B, 0xB0, 0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, 0x07, 0x1E, 0x31, 0x40,
+0x07, 0xDF, 0xEF, 0xB0, 0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40,
+0x0B, 0xA8, 0xEE, 0x30, 0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40,
+0x0F, 0x68, 0xB2, 0x30, 0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0,
+0x13, 0x28, 0x76, 0x30, 0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0,
+0x16, 0xF1, 0x74, 0xB0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0,
+0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40,
+0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40,
+0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40, 0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0,
+0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0, 0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0,
+0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0,
+0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40,
+0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40,
+0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40,
+0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0,
+0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0,
+0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0,
+0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40,
+0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40,
+0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40,
+0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0,
+0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0,
+0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40,
+0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40,
+0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40,
+0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0,
+0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0,
+0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0,
+0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40,
+0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40,
+0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40,
+0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0,
+0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xBD,
+0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF,
+0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00,
+0x09, 0x53, 0x4D, 0x54, 0x00, 0x43, 0x4C, 0x53, 0x54, 0x00, 0x43, 0x4C, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+
+/* America/Santo_Domingo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0xBA, 0xDF, 0x42, 0x60,
+0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xA7, 0xC3, 0x40, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x43, 0x7B, 0xC8,
+0x01, 0x87, 0xD3, 0xD0, 0x01, 0xFA, 0x7F, 0x48, 0x03, 0x70, 0xF0, 0x50, 0x03, 0xDD, 0x04, 0x48,
+0x05, 0x50, 0xD2, 0x50, 0x05, 0xBF, 0x89, 0x48, 0x07, 0x30, 0xB4, 0x50, 0x07, 0xA0, 0xBC, 0xC8,
+0x09, 0x10, 0x96, 0x50, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0x29, 0xE1, 0x60, 0x02, 0x01, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xBE, 0x60,
+0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF, 0xFF,
+0xC0, 0xB8, 0x01, 0x0D, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x12, 0x53, 0x44, 0x4D, 0x54, 0x00, 0x45,
+0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x48, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Sao_Paulo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x72, 0xB4,
+0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20,
+0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20,
+0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20,
+0xF4, 0x5A, 0x09, 0x30, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0,
+0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0,
+0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0,
+0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0,
+0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20,
+0x27, 0x21, 0x0F, 0x30, 0x27, 0xBD, 0xE3, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0x94, 0x8B, 0x20,
+0x2A, 0xEA, 0x0D, 0xB0, 0x2B, 0x6B, 0x32, 0xA0, 0x2C, 0xC0, 0xB5, 0x30, 0x2D, 0x66, 0xC4, 0x20,
+0x2E, 0xA0, 0x97, 0x30, 0x2F, 0x46, 0xA6, 0x20, 0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0,
+0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20,
+0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20,
+0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0,
+0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x3F, 0x91, 0xFE, 0x30, 0x40, 0x2E, 0xD2, 0xA0,
+0x41, 0x86, 0xF8, 0x30, 0x42, 0x17, 0xEF, 0x20, 0x43, 0x51, 0xC2, 0x30, 0x43, 0xF7, 0xD1, 0x20,
+0x45, 0x31, 0xA4, 0x30, 0x45, 0xD7, 0xB3, 0x20, 0x47, 0x1A, 0xC0, 0xB0, 0x47, 0xB7, 0x95, 0x20,
+0x48, 0xFA, 0xA2, 0xB0, 0x49, 0x97, 0x77, 0x20, 0x4A, 0xDA, 0x84, 0xB0, 0x4B, 0x80, 0x93, 0xA0,
+0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x60, 0x75, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, 0x4F, 0x40, 0x57, 0xA0,
+0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0,
+0x54, 0x43, 0x29, 0x30, 0x54, 0xDF, 0xFD, 0xA0, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20,
+0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20,
+0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20,
+0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0,
+0x63, 0x4B, 0x73, 0xB0, 0x63, 0xF1, 0x82, 0xA0, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0,
+0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x91, 0x28, 0xA0,
+0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20,
+0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20,
+0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20,
+0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xA2, 0xAD, 0xA0,
+0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0,
+0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x42, 0x53, 0xA0, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xD4, 0x4C,
+0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D,
+0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* America/Scoresbysund */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x80, 0x4C, 0x5C,
+0x13, 0x4D, 0x6E, 0x40, 0x14, 0x34, 0x24, 0xC0, 0x15, 0x23, 0xF9, 0xA0, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x02, 0x03, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xEB, 0x24, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x00,
+0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x04, 0xFF, 0xFF, 0xF1,
+0xF0, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x4C,
+0x4D, 0x54, 0x00, 0x43, 0x47, 0x54, 0x00, 0x43, 0x47, 0x53, 0x54, 0x00, 0x45, 0x47, 0x54, 0x00,
+0x45, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00,
+
+/* America/Shiprock */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90,
+0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00,
+0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00,
+0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00,
+0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80,
+0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80,
+0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80,
+0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00,
+0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00,
+0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80,
+0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00,
+0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00,
+0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00,
+0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80,
+0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80,
+0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80,
+0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00,
+0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00,
+0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80,
+0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80,
+0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80,
+0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00,
+0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00,
+0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00,
+0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80,
+0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80,
+0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB,
+0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF,
+0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54,
+0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* America/St_Johns */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xEE, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x9C, 0xCF, 0x62, 0x0C,
+0x9D, 0xA4, 0xE6, 0xFC, 0x9E, 0xB8, 0x7E, 0x8C, 0x9F, 0xC0, 0x1C, 0x7C, 0xA0, 0xB6, 0x88, 0xDC,
+0xA1, 0x38, 0xFF, 0x4C, 0xA2, 0x95, 0x19, 0x5C, 0xA3, 0x84, 0xFC, 0x4C, 0xA4, 0x74, 0xFB, 0x5C,
+0xA5, 0x64, 0xDE, 0x4C, 0xA6, 0x5E, 0x17, 0xDC, 0xA7, 0x44, 0xC0, 0x4C, 0xA8, 0x3D, 0xF9, 0xDC,
+0xA9, 0x24, 0xA2, 0x4C, 0xAA, 0x1D, 0xDB, 0xDC, 0xAB, 0x04, 0x84, 0x4C, 0xAB, 0xFD, 0xBD, 0xDC,
+0xAC, 0xE4, 0x66, 0x4C, 0xAD, 0xDD, 0x9F, 0xDC, 0xAE, 0xCD, 0x82, 0xCC, 0xAF, 0xBD, 0x81, 0xDC,
+0xB0, 0xAD, 0x64, 0xCC, 0xB1, 0xA6, 0x9E, 0x5C, 0xB2, 0x8D, 0x46, 0xCC, 0xB3, 0x86, 0x80, 0x5C,
+0xB4, 0x6D, 0x28, 0xCC, 0xB5, 0x66, 0x62, 0x5C, 0xB6, 0x4D, 0x0A, 0xCC, 0xB7, 0x46, 0x44, 0x5C,
+0xB8, 0x2C, 0xEC, 0xCC, 0xB9, 0x26, 0x26, 0x5C, 0xBA, 0x16, 0x09, 0x4C, 0xBB, 0x0F, 0x42, 0xDC,
+0xBB, 0xF5, 0xEB, 0x4C, 0xBC, 0xEF, 0x24, 0xDC, 0xBD, 0xD5, 0xCD, 0x4C, 0xBE, 0x9E, 0x4D, 0x6C,
+0xBE, 0xCF, 0x06, 0xA8, 0xBF, 0xB5, 0xAF, 0x18, 0xC0, 0xB8, 0x31, 0x38, 0xC1, 0x79, 0xEF, 0xA8,
+0xC2, 0x98, 0x13, 0x38, 0xC3, 0x59, 0xD1, 0xA8, 0xC4, 0x77, 0xF5, 0x38, 0xC5, 0x39, 0xB3, 0xA8,
+0xC6, 0x61, 0x11, 0xB8, 0xC7, 0x19, 0x95, 0xA8, 0xC8, 0x40, 0xF3, 0xB8, 0xC9, 0x02, 0xB2, 0x28,
+0xCA, 0x20, 0xD5, 0xB8, 0xCA, 0xE2, 0x94, 0x28, 0xCC, 0x00, 0xB7, 0xB8, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x60, 0xE6, 0xC8, 0xD3, 0x88, 0x44, 0xD8, 0xD4, 0x4A, 0x03, 0x48, 0xD5, 0x68, 0x26, 0xD8,
+0xD6, 0x29, 0xE5, 0x48, 0xD7, 0x48, 0x08, 0xD8, 0xD8, 0x09, 0xC7, 0x48, 0xD9, 0x27, 0xEA, 0xD8,
+0xD9, 0xE9, 0xA9, 0x48, 0xDB, 0x11, 0x07, 0x58, 0xDB, 0xD2, 0xC5, 0xC8, 0xDC, 0xDE, 0x74, 0x58,
+0xDD, 0xA9, 0x6D, 0x48, 0xDE, 0xBE, 0x56, 0x58, 0xDF, 0x89, 0x4F, 0x48, 0xE0, 0x9E, 0x38, 0x58,
+0xE1, 0x69, 0x31, 0x48, 0xE2, 0x7E, 0x1A, 0x58, 0xE3, 0x49, 0x13, 0x48, 0xE4, 0x5D, 0xFC, 0x58,
+0xE5, 0x28, 0xF5, 0x48, 0xE6, 0x47, 0x18, 0xD8, 0xE7, 0x12, 0x11, 0xC8, 0xE8, 0x26, 0xFA, 0xD8,
+0xE8, 0xF1, 0xF3, 0xC8, 0xEA, 0x06, 0xDC, 0xD8, 0xEA, 0xD1, 0xD5, 0xC8, 0xEB, 0xE6, 0xBE, 0xD8,
+0xEC, 0xB1, 0xB7, 0xC8, 0xED, 0xC6, 0xA0, 0xD8, 0xEE, 0xBF, 0xBE, 0x48, 0xEF, 0xAF, 0xBD, 0x58,
+0xF0, 0x9F, 0xA0, 0x48, 0xF1, 0x8F, 0x9F, 0x58, 0xF2, 0x7F, 0x82, 0x48, 0xF3, 0x6F, 0x81, 0x58,
+0xF4, 0x5F, 0x64, 0x48, 0xF5, 0x4F, 0x63, 0x58, 0xF6, 0x3F, 0x46, 0x48, 0xF7, 0x2F, 0x45, 0x58,
+0xF8, 0x28, 0x62, 0xC8, 0xF9, 0x0F, 0x27, 0x58, 0xFA, 0x08, 0x44, 0xC8, 0xFA, 0xF8, 0x43, 0xD8,
+0xFB, 0xE8, 0x26, 0xC8, 0xFC, 0xD8, 0x25, 0xD8, 0xFD, 0xC8, 0x08, 0xC8, 0xFE, 0xB8, 0x07, 0xD8,
+0xFF, 0xA7, 0xEA, 0xC8, 0x00, 0x97, 0xE9, 0xD8, 0x01, 0x87, 0xCC, 0xC8, 0x02, 0x77, 0xCB, 0xD8,
+0x03, 0x70, 0xE9, 0x48, 0x04, 0x60, 0xE8, 0x58, 0x05, 0x50, 0xCB, 0x48, 0x06, 0x40, 0xCA, 0x58,
+0x07, 0x30, 0xAD, 0x48, 0x08, 0x20, 0xAC, 0x58, 0x09, 0x10, 0x8F, 0x48, 0x0A, 0x00, 0x8E, 0x58,
+0x0A, 0xF0, 0x71, 0x48, 0x0B, 0xE0, 0x70, 0x58, 0x0C, 0xD9, 0x8D, 0xC8, 0x0D, 0xC0, 0x52, 0x58,
+0x0E, 0xB9, 0x6F, 0xC8, 0x0F, 0xA9, 0x6E, 0xD8, 0x10, 0x99, 0x51, 0xC8, 0x11, 0x89, 0x50, 0xD8,
+0x12, 0x79, 0x33, 0xC8, 0x13, 0x69, 0x32, 0xD8, 0x14, 0x59, 0x15, 0xC8, 0x15, 0x49, 0x14, 0xD8,
+0x16, 0x38, 0xF7, 0xC8, 0x17, 0x28, 0xF6, 0xD8, 0x18, 0x22, 0x14, 0x48, 0x19, 0x08, 0xD8, 0xD8,
+0x1A, 0x01, 0xF6, 0x48, 0x1A, 0xF1, 0xF5, 0x58, 0x1B, 0xE1, 0xD8, 0x48, 0x1C, 0xD1, 0xD7, 0x58,
+0x1D, 0xC1, 0xBA, 0x48, 0x1E, 0xB1, 0xB9, 0x58, 0x1F, 0xA1, 0x9C, 0x48, 0x20, 0x75, 0xCF, 0xF4,
+0x21, 0x81, 0x62, 0x64, 0x22, 0x55, 0xB1, 0xF4, 0x23, 0x6A, 0x70, 0xD4, 0x24, 0x35, 0x93, 0xF4,
+0x25, 0x4A, 0x60, 0xE4, 0x26, 0x15, 0x75, 0xF4, 0x27, 0x2A, 0x42, 0xE4, 0x27, 0xFE, 0x92, 0x74,
+0x29, 0x0A, 0x24, 0xE4, 0x29, 0xDE, 0x74, 0x74, 0x2A, 0xEA, 0x06, 0xE4, 0x2B, 0xBE, 0x56, 0x74,
+0x2C, 0xD3, 0x23, 0x64, 0x2D, 0x9E, 0x38, 0x74, 0x2E, 0xB3, 0x05, 0x64, 0x2F, 0x7E, 0x1A, 0x74,
+0x30, 0x92, 0xE7, 0x64, 0x31, 0x67, 0x36, 0xF4, 0x32, 0x72, 0xC9, 0x64, 0x33, 0x47, 0x18, 0xF4,
+0x34, 0x52, 0xAB, 0x64, 0x35, 0x26, 0xFA, 0xF4, 0x36, 0x32, 0x8D, 0x64, 0x37, 0x06, 0xDC, 0xF4,
+0x38, 0x1B, 0xA9, 0xE4, 0x38, 0xE6, 0xBE, 0xF4, 0x39, 0xFB, 0x8B, 0xE4, 0x3A, 0xC6, 0xA0, 0xF4,
+0x3B, 0xDB, 0x6D, 0xE4, 0x3C, 0xAF, 0xBD, 0x74, 0x3D, 0xBB, 0x4F, 0xE4, 0x3E, 0x8F, 0x9F, 0x74,
+0x3F, 0x9B, 0x31, 0xE4, 0x40, 0x6F, 0x81, 0x74, 0x41, 0x84, 0x4E, 0x64, 0x42, 0x4F, 0x63, 0x74,
+0x43, 0x64, 0x30, 0x64, 0x44, 0x2F, 0x45, 0x74, 0x45, 0x44, 0x12, 0x64, 0x46, 0x0F, 0x27, 0x74,
+0x47, 0x23, 0xF4, 0x64, 0x47, 0xF8, 0x43, 0xF4, 0x49, 0x03, 0xD6, 0x64, 0x49, 0xD8, 0x25, 0xF4,
+0x4A, 0xE3, 0xB8, 0x64, 0x4B, 0xB8, 0x07, 0xF4, 0x4C, 0xCC, 0xD4, 0xE4, 0x4D, 0x97, 0xE9, 0xF4,
+0x4E, 0xAC, 0xB6, 0xE4, 0x4F, 0x77, 0xCB, 0xF4, 0x50, 0x8C, 0x98, 0xE4, 0x51, 0x60, 0xE8, 0x74,
+0x52, 0x6C, 0x7A, 0xE4, 0x53, 0x40, 0xCA, 0x74, 0x54, 0x4C, 0x5C, 0xE4, 0x55, 0x20, 0xAC, 0x74,
+0x56, 0x2C, 0x3E, 0xE4, 0x57, 0x00, 0x8E, 0x74, 0x58, 0x15, 0x5B, 0x64, 0x58, 0xE0, 0x70, 0x74,
+0x59, 0xF5, 0x3D, 0x64, 0x5A, 0xC0, 0x52, 0x74, 0x5B, 0xD5, 0x1F, 0x64, 0x5C, 0xA9, 0x6E, 0xF4,
+0x5D, 0xB5, 0x01, 0x64, 0x5E, 0x89, 0x50, 0xF4, 0x5F, 0x94, 0xE3, 0x64, 0x60, 0x69, 0x32, 0xF4,
+0x61, 0x7D, 0xFF, 0xE4, 0x62, 0x49, 0x14, 0xF4, 0x63, 0x5D, 0xE1, 0xE4, 0x64, 0x28, 0xF6, 0xF4,
+0x65, 0x3D, 0xC3, 0xE4, 0x66, 0x12, 0x13, 0x74, 0x67, 0x1D, 0xA5, 0xE4, 0x67, 0xF1, 0xF5, 0x74,
+0x68, 0xFD, 0x87, 0xE4, 0x69, 0xD1, 0xD7, 0x74, 0x6A, 0xDD, 0x69, 0xE4, 0x6B, 0xB1, 0xB9, 0x74,
+0x6C, 0xC6, 0x86, 0x64, 0x6D, 0x91, 0x9B, 0x74, 0x6E, 0xA6, 0x68, 0x64, 0x6F, 0x71, 0x7D, 0x74,
+0x70, 0x86, 0x4A, 0x64, 0x71, 0x5A, 0x99, 0xF4, 0x72, 0x66, 0x2C, 0x64, 0x73, 0x3A, 0x7B, 0xF4,
+0x74, 0x46, 0x0E, 0x64, 0x75, 0x1A, 0x5D, 0xF4, 0x76, 0x2F, 0x2A, 0xE4, 0x76, 0xFA, 0x3F, 0xF4,
+0x78, 0x0F, 0x0C, 0xE4, 0x78, 0xDA, 0x21, 0xF4, 0x79, 0xEE, 0xEE, 0xE4, 0x7A, 0xBA, 0x03, 0xF4,
+0x7B, 0xCE, 0xD0, 0xE4, 0x7C, 0xA3, 0x20, 0x74, 0x7D, 0xAE, 0xB2, 0xE4, 0x7E, 0x83, 0x02, 0x74,
+0x7F, 0x8E, 0x94, 0xE4, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x06, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0xFF, 0xFF, 0xDC, 0xA4, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0x94, 0x00, 0x04, 0xFF, 0xFF,
+0xDC, 0xD8, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x04, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x08,
+0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x0C, 0xFF, 0xFF, 0xEA, 0xE8, 0x01, 0x10, 0x4E, 0x44, 0x54, 0x00,
+0x4E, 0x53, 0x54, 0x00, 0x4E, 0x50, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, 0x44, 0x44, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* America/St_Kitts */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x34, 0xCC,
+0x01, 0xFF, 0xFF, 0xC5, 0x34, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/St_Lucia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0xC7, 0xB0,
+0x01, 0xFF, 0xFF, 0xC6, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x43, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/St_Thomas */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60,
+0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/St_Vincent */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0xC7, 0xE8,
+0x01, 0xFF, 0xFF, 0xC6, 0x98, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4B, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Swift_Current */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x96, 0x18,
+0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x61, 0x18, 0x00, 0xD3, 0x76, 0x01, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10,
+0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10,
+0xD9, 0xE0, 0xA0, 0x00, 0xE8, 0x27, 0x2C, 0x10, 0xE9, 0x17, 0x0F, 0x00, 0xEB, 0xE6, 0xF0, 0x10,
+0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10, 0xEE, 0x91, 0xCB, 0x00, 0xEF, 0xAF, 0xEE, 0x90,
+0xF0, 0x71, 0xAD, 0x00, 0x04, 0x61, 0x19, 0x90, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0xFF,
+0xFF, 0x9A, 0xE8, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00,
+0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB,
+0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D,
+0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* America/Tegucigalpa */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA4, 0x4C, 0x4B, 0x44,
+0x20, 0x9A, 0xDC, 0xE0, 0x21, 0x5C, 0x9B, 0x50, 0x22, 0x7A, 0xBE, 0xE0, 0x23, 0x3C, 0x7D, 0x50,
+0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xAE, 0x3C, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43,
+0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Thule */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9B, 0x80, 0x77, 0xFC,
+0x27, 0xF5, 0x7A, 0xE0, 0x28, 0xE5, 0x5D, 0xD0, 0x29, 0xD5, 0x5C, 0xE0, 0x2A, 0xC5, 0x3F, 0xD0,
+0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x28, 0x50,
+0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xEC, 0x50,
+0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0, 0x36, 0x32, 0xB0, 0x50,
+0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0, 0x39, 0xFB, 0xAE, 0xD0,
+0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60, 0x3D, 0xBB, 0x72, 0xD0,
+0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60, 0x41, 0x84, 0x71, 0x50,
+0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60, 0x45, 0x44, 0x35, 0x50,
+0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50, 0x47, 0xF8, 0x66, 0xE0, 0x49, 0x03, 0xF9, 0x50,
+0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xB8, 0x2A, 0xE0, 0x4C, 0xCC, 0xF7, 0xD0,
+0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x77, 0xEE, 0xE0, 0x50, 0x8C, 0xBB, 0xD0,
+0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x40, 0xED, 0x60, 0x54, 0x4C, 0x7F, 0xD0,
+0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0, 0x57, 0x00, 0xB1, 0x60, 0x58, 0x15, 0x7E, 0x50,
+0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xC0, 0x75, 0x60, 0x5B, 0xD5, 0x42, 0x50,
+0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x89, 0x73, 0xE0, 0x5F, 0x95, 0x06, 0x50,
+0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x49, 0x37, 0xE0, 0x63, 0x5E, 0x04, 0xD0,
+0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0, 0x66, 0x12, 0x36, 0x60, 0x67, 0x1D, 0xC8, 0xD0,
+0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xD1, 0xFA, 0x60, 0x6A, 0xDD, 0x8C, 0xD0,
+0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x91, 0xBE, 0x60, 0x6E, 0xA6, 0x8B, 0x50,
+0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x5A, 0xBC, 0xE0, 0x72, 0x66, 0x4F, 0x50,
+0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50, 0x75, 0x1A, 0x80, 0xE0, 0x76, 0x2F, 0x4D, 0xD0,
+0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xDA, 0x44, 0xE0, 0x79, 0xEF, 0x11, 0xD0,
+0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0xA3, 0x43, 0x60, 0x7D, 0xAE, 0xD5, 0xD0,
+0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBF, 0x84, 0x00, 0x00, 0xFF, 0xFF, 0xD5,
+0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x44, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Thunder_Bay */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x8F, 0x24, 0x7B, 0xE0,
+0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0x00, 0x97, 0xFE, 0xF0,
+0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70,
+0x05, 0x50, 0xE0, 0x60, 0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70,
+0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70,
+0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0,
+0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0,
+0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0,
+0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70,
+0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0,
+0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0,
+0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70,
+0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70,
+0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70,
+0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0,
+0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0,
+0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0,
+0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70,
+0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70,
+0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70,
+0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0, 0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0,
+0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0, 0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0,
+0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0, 0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70,
+0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70, 0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70,
+0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70, 0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70,
+0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70, 0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0,
+0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0, 0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0,
+0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0, 0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0,
+0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70, 0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70,
+0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70, 0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70,
+0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70, 0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70,
+0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0, 0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0,
+0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0, 0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0,
+0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0, 0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0,
+0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70, 0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70,
+0x7F, 0x8E, 0xC5, 0xE0, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01,
+0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF,
+0xAB, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08,
+0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x10, 0x43, 0x53, 0x54, 0x00,
+0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* America/Tijuana */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xF6, 0x80,
+0xA9, 0x79, 0x4F, 0x70, 0xAF, 0xF2, 0x7C, 0xF0, 0xB6, 0x66, 0x64, 0x70, 0xB7, 0x1B, 0x10, 0x00,
+0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x99, 0xBA, 0x70, 0xD7, 0x1B, 0x59, 0x00,
+0xD8, 0x91, 0xB4, 0xF0, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0,
+0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20,
+0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20,
+0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0x0B, 0xE0, 0xAF, 0xA0,
+0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, 0x0F, 0xA9, 0xAE, 0x20,
+0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, 0x13, 0x69, 0x72, 0x20,
+0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20,
+0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0,
+0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0,
+0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20,
+0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20,
+0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0,
+0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0,
+0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20,
+0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20,
+0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20,
+0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0,
+0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0,
+0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0,
+0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20,
+0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20,
+0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20,
+0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0,
+0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0,
+0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0,
+0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20,
+0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20,
+0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0,
+0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0,
+0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0,
+0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20,
+0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20,
+0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20,
+0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0,
+0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, 0x01, 0x02, 0x01, 0x02,
+0x03, 0x02, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0xFF, 0xFF, 0x92, 0x4C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0x8F, 0x80,
+0x00, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, 0x4C, 0x4D,
+0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Toronto */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70,
+0x9F, 0xC0, 0x31, 0x60, 0xA0, 0x87, 0x2E, 0xC8, 0xA1, 0x9A, 0xB1, 0x40, 0xA2, 0x94, 0x06, 0xF0,
+0xA3, 0x55, 0xA9, 0x40, 0xA4, 0x86, 0x5D, 0xF0, 0xA5, 0x28, 0x78, 0x60, 0xA6, 0x66, 0x3F, 0xF0,
+0xA7, 0x0C, 0x4E, 0xE0, 0xA8, 0x46, 0x21, 0xF0, 0xA8, 0xEC, 0x30, 0xE0, 0xAA, 0x1C, 0xC9, 0x70,
+0xAA, 0xD5, 0x4D, 0x60, 0xAB, 0xFC, 0xAB, 0x70, 0xAC, 0xB5, 0x2F, 0x60, 0xAD, 0xDC, 0x8D, 0x70,
+0xAE, 0x95, 0x11, 0x60, 0xAF, 0xBC, 0x6F, 0x70, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70,
+0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70,
+0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x25, 0x13, 0xF0,
+0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xE4, 0xD7, 0xF0,
+0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0,
+0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0,
+0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70,
+0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0,
+0xD4, 0x40, 0xDD, 0xE0, 0xD5, 0x55, 0xAA, 0xD0, 0xD6, 0x20, 0xA3, 0xC0, 0xD7, 0x35, 0x8C, 0xD0,
+0xD8, 0x00, 0x85, 0xC0, 0xD9, 0x15, 0x6E, 0xD0, 0xDA, 0x33, 0x76, 0x40, 0xDA, 0xFE, 0xA7, 0x70,
+0xDC, 0x13, 0x74, 0x60, 0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70,
+0xDF, 0x89, 0x64, 0x60, 0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70,
+0xE3, 0x49, 0x28, 0x60, 0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x29, 0x0A, 0x60, 0xE6, 0x47, 0x2D, 0xF0,
+0xE7, 0x12, 0x26, 0xE0, 0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0,
+0xEA, 0xF6, 0xD4, 0xE0, 0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0,
+0xEE, 0xBF, 0xD3, 0x60, 0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70,
+0xF2, 0x7F, 0x97, 0x60, 0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70,
+0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70,
+0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0,
+0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0,
+0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70,
+0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x08, 0x20, 0xC1, 0x70,
+0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70,
+0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0,
+0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0,
+0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0,
+0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70,
+0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70,
+0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0,
+0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0,
+0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70,
+0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70,
+0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0,
+0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0,
+0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0,
+0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70,
+0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70,
+0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70,
+0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0,
+0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0,
+0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0,
+0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70,
+0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70,
+0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70,
+0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0,
+0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0,
+0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70,
+0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70,
+0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70,
+0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0,
+0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0,
+0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0,
+0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70,
+0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04,
+0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00,
+0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x00, 0x00, 0x00, 0x01,
+
+/* America/Tortola */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x14,
+0x01, 0xFF, 0xFF, 0xC3, 0x6C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Vancouver */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0xBD, 0xA0,
+0x9F, 0xC0, 0x5B, 0x90, 0xCB, 0x89, 0x1A, 0xA0, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10,
+0xD3, 0x76, 0x0F, 0x20, 0xD4, 0x53, 0x7D, 0x10, 0xD5, 0x55, 0xF1, 0x20, 0xD6, 0x20, 0xEA, 0x10,
+0xD7, 0x35, 0xD3, 0x20, 0xD8, 0x00, 0xCC, 0x10, 0xD9, 0x15, 0xB5, 0x20, 0xD9, 0xE0, 0xAE, 0x10,
+0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90,
+0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90,
+0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90,
+0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10,
+0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10,
+0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10,
+0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90,
+0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10,
+0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10,
+0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10,
+0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90,
+0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90,
+0x08, 0x20, 0xEB, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x0A, 0x00, 0xCD, 0xA0, 0x0A, 0xF0, 0xB0, 0x90,
+0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10,
+0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10,
+0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10,
+0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90,
+0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90,
+0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90,
+0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10,
+0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10,
+0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90,
+0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90,
+0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90,
+0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10,
+0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10,
+0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10,
+0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90,
+0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90,
+0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90,
+0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10,
+0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10,
+0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10,
+0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90,
+0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90,
+0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10,
+0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10,
+0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10,
+0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90,
+0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90,
+0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90,
+0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10,
+0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10,
+0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10,
+0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D,
+0x90, 0x01, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF,
+0xFF, 0x9D, 0x90, 0x01, 0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54,
+0x00, 0x50, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* America/Virgin */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60,
+0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* America/Whitehorse */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xCB, 0xB0,
+0x9F, 0xBB, 0x23, 0xA0, 0xA0, 0xD0, 0x0C, 0xB0, 0xA1, 0xA2, 0xD2, 0x80, 0xCB, 0x89, 0x28, 0xB0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0xA2, 0x10,
+0xF9, 0x69, 0x1A, 0xB0, 0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20,
+0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20,
+0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0,
+0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20,
+0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20,
+0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0,
+0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0,
+0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0,
+0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20,
+0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20,
+0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20,
+0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0,
+0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0,
+0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0,
+0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20,
+0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20,
+0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0,
+0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0,
+0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0,
+0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20,
+0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20,
+0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20,
+0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0,
+0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0,
+0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0,
+0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20,
+0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20,
+0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20,
+0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0,
+0x7F, 0x8E, 0xF0, 0x10, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0xFF, 0xFF,
+0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10,
+0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x15, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x19, 0x59, 0x44, 0x54, 0x00,
+0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, 0x54, 0x00, 0x59, 0x44, 0x44, 0x54,
+0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+
+/* America/Winnipeg */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x01, 0xFB, 0xE0,
+0x9B, 0xC3, 0xBA, 0x50, 0x9E, 0xB8, 0xA1, 0x80, 0x9F, 0xC0, 0x3F, 0x70, 0xC2, 0xA0, 0x3B, 0x80,
+0xC3, 0x4F, 0x84, 0xF0, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0,
+0xD3, 0x88, 0x68, 0x00, 0xD4, 0x53, 0x60, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0,
+0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0,
+0xDB, 0x00, 0x07, 0x00, 0xDB, 0xC8, 0x5C, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70,
+0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0,
+0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x31, 0x62, 0xF0,
+0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0,
+0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0,
+0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70,
+0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70,
+0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x0A, 0x00, 0xB1, 0x80, 0x0A, 0xF0, 0x94, 0x70,
+0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0,
+0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0,
+0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0,
+0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70,
+0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70,
+0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x70, 0x80,
+0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x34, 0x80,
+0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xBB, 0x00,
+0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x41, 0x80,
+0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE4, 0x05, 0x80,
+0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAD, 0x04, 0x00,
+0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xC8, 0x00,
+0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x8C, 0x00,
+0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x8A, 0x80,
+0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x4E, 0x80,
+0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x4D, 0x00,
+0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x11, 0x00,
+0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xD5, 0x00,
+0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xD3, 0x80,
+0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x97, 0x80,
+0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x5B, 0x80,
+0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x5A, 0x00,
+0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x1E, 0x00,
+0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xE2, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF,
+0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43,
+0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01,
+0x00,
+
+/* America/Yakutat */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1A, 0xCB, 0x89, 0x28, 0xB0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xFE, 0xB8, 0x55, 0x30, 0xFF, 0xA8, 0x38, 0x20,
+0x00, 0x98, 0x37, 0x30, 0x01, 0x88, 0x1A, 0x20, 0x02, 0x78, 0x19, 0x30, 0x03, 0x71, 0x36, 0xA0,
+0x04, 0x61, 0x35, 0xB0, 0x05, 0x51, 0x18, 0xA0, 0x06, 0x41, 0x17, 0xB0, 0x07, 0x30, 0xFA, 0xA0,
+0x07, 0x8D, 0x51, 0xB0, 0x09, 0x10, 0xDC, 0xA0, 0x09, 0xAD, 0xCD, 0x30, 0x0A, 0xF0, 0xBE, 0xA0,
+0x0B, 0xE0, 0xBD, 0xB0, 0x0C, 0xD9, 0xDB, 0x20, 0x0D, 0xC0, 0x9F, 0xB0, 0x0E, 0xB9, 0xBD, 0x20,
+0x0F, 0xA9, 0xBC, 0x30, 0x10, 0x99, 0x9F, 0x20, 0x11, 0x89, 0x9E, 0x30, 0x12, 0x79, 0x81, 0x20,
+0x13, 0x69, 0x80, 0x30, 0x14, 0x59, 0x63, 0x20, 0x15, 0x49, 0x62, 0x30, 0x16, 0x39, 0x45, 0x20,
+0x17, 0x29, 0x44, 0x30, 0x18, 0x22, 0x61, 0xA0, 0x19, 0x09, 0x26, 0x30, 0x1A, 0x02, 0x43, 0xA0,
+0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, 0x1C, 0xD2, 0x24, 0xB0,
+0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, 0x20, 0x76, 0x39, 0x30,
+0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, 0x24, 0x35, 0xFD, 0x30,
+0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, 0x27, 0xFE, 0xFB, 0xB0,
+0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, 0x2B, 0xBE, 0xBF, 0xB0,
+0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, 0x2F, 0x7E, 0x83, 0xB0,
+0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, 0x33, 0x47, 0x82, 0x30,
+0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, 0x37, 0x07, 0x46, 0x30,
+0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, 0x3A, 0xC7, 0x0A, 0x30,
+0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, 0x3E, 0x90, 0x08, 0xB0,
+0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, 0x42, 0x4F, 0xCC, 0xB0,
+0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, 0x45, 0xF3, 0xE1, 0x30,
+0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, 0x49, 0xB3, 0xA5, 0x30,
+0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, 0x4D, 0x7C, 0xA3, 0xB0,
+0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, 0x51, 0x3C, 0x67, 0xB0,
+0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, 0x54, 0xFC, 0x2B, 0xB0,
+0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, 0x58, 0xC5, 0x2A, 0x30,
+0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, 0x5C, 0x84, 0xEE, 0x30,
+0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, 0x60, 0x4D, 0xEC, 0xB0,
+0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, 0x64, 0x0D, 0xB0, 0xB0,
+0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, 0x67, 0xCD, 0x74, 0xB0,
+0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, 0x6B, 0x96, 0x73, 0x30,
+0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, 0x6F, 0x56, 0x37, 0x30,
+0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, 0x73, 0x15, 0xFB, 0x30,
+0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, 0x76, 0xDE, 0xF9, 0xB0,
+0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, 0x7A, 0x9E, 0xBD, 0xB0,
+0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, 0x7E, 0x5E, 0x81, 0xB0,
+0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
+0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
+0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x04, 0xFF, 0xFF,
+0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x10,
+0xFF, 0xFF, 0x81, 0x70, 0x00, 0x15, 0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50,
+0x54, 0x00, 0x59, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00,
+0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+
+/* America/Yellowknife */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x9E, 0xB8, 0xAF, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0xCF, 0xF0, 0x90, 0xA1, 0xA2, 0xB6, 0x60, 0xCB, 0x89, 0x0C, 0x90,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x85, 0xF0,
+0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80,
+0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00,
+0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, 0x47, 0x24, 0x41, 0x80,
+0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, 0x4A, 0xE4, 0x05, 0x80,
+0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, 0x4E, 0xAD, 0x04, 0x00,
+0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, 0x52, 0x6C, 0xC8, 0x00,
+0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, 0x56, 0x2C, 0x8C, 0x00,
+0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, 0x59, 0xF5, 0x8A, 0x80,
+0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, 0x5D, 0xB5, 0x4E, 0x80,
+0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, 0x61, 0x7E, 0x4D, 0x00,
+0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, 0x65, 0x3E, 0x11, 0x00,
+0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, 0x68, 0xFD, 0xD5, 0x00,
+0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, 0x6C, 0xC6, 0xD3, 0x80,
+0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, 0x70, 0x86, 0x97, 0x80,
+0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, 0x74, 0x46, 0x5B, 0x80,
+0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, 0x78, 0x0F, 0x5A, 0x00,
+0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, 0x7B, 0xCF, 0x1E, 0x00,
+0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, 0x7F, 0x8E, 0xE2, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB,
+0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF,
+0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x10, 0x4D, 0x44, 0x54, 0x00, 0x4D,
+0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x4D, 0x44, 0x44, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* Antarctica/Casey */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xFE, 0x1E, 0xCC, 0x80,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x7A, 0x7A, 0x7A,
+0x00, 0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Antarctica/Davis */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE7, 0x9C, 0x40, 0x00,
+0xF6, 0x47, 0xDF, 0x10, 0xFE, 0x47, 0xAB, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x7A, 0x7A, 0x7A, 0x00, 0x44, 0x41, 0x56, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Antarctica/DumontDUrville */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xD4, 0xBC, 0x76, 0x80,
+0xDE, 0x34, 0x60, 0x60, 0xE7, 0x3C, 0x02, 0x80, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x08, 0x7A, 0x7A, 0x7A,
+0x00, 0x50, 0x4D, 0x54, 0x00, 0x44, 0x44, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Antarctica/Mawson */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE2, 0x20, 0x32, 0x80,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x7A, 0x7A, 0x7A,
+0x00, 0x4D, 0x41, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Antarctica/McMurdo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00,
+0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0,
+0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0,
+0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0,
+0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60,
+0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60,
+0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60,
+0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0,
+0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0,
+0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0,
+0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60,
+0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60,
+0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60,
+0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0,
+0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0,
+0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60,
+0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60,
+0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60,
+0x48, 0xE7, 0x76, 0xE0, 0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0,
+0x4C, 0xA7, 0x3A, 0xE0, 0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0,
+0x50, 0x70, 0x39, 0x60, 0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0,
+0x54, 0x2F, 0xFD, 0x60, 0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60,
+0x57, 0xEF, 0xC1, 0x60, 0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60,
+0x5B, 0xB8, 0xBF, 0xE0, 0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60,
+0x5F, 0x78, 0x83, 0xE0, 0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0,
+0x63, 0x38, 0x47, 0xE0, 0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0,
+0x67, 0x01, 0x46, 0x60, 0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0,
+0x6A, 0xC1, 0x0A, 0x60, 0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60,
+0x6E, 0x80, 0xCE, 0x60, 0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60,
+0x72, 0x49, 0xCC, 0xE0, 0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0,
+0x76, 0x09, 0x90, 0xE0, 0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0,
+0x79, 0xC9, 0x54, 0xE0, 0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0,
+0x7D, 0x92, 0x53, 0x60, 0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x03, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00,
+0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53,
+0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Antarctica/Palmer */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0xF6, 0x98, 0xAD, 0x00,
+0xF6, 0xE6, 0x9F, 0xB0, 0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40,
+0xFA, 0xD1, 0xE5, 0x30, 0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40,
+0xFE, 0x9C, 0x35, 0x30, 0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0,
+0x08, 0xF4, 0xCA, 0xB0, 0x09, 0xE4, 0xAD, 0xA0, 0x0A, 0xD4, 0xAC, 0xB0, 0x0B, 0xC4, 0x8F, 0xA0,
+0x0C, 0xB4, 0x8E, 0xB0, 0x0D, 0xA4, 0x71, 0xA0, 0x17, 0x30, 0xBC, 0xB0, 0x18, 0x06, 0x5D, 0xC0,
+0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40,
+0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40,
+0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40,
+0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0,
+0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0, 0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0,
+0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0, 0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0,
+0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40, 0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40,
+0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40, 0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40,
+0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40, 0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0,
+0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0,
+0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0, 0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0,
+0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0, 0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40,
+0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40, 0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40,
+0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40, 0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40,
+0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40, 0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0,
+0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0, 0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0,
+0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0, 0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0,
+0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40,
+0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40, 0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40,
+0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40, 0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40,
+0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0,
+0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0, 0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0,
+0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0, 0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40,
+0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40, 0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40,
+0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40, 0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40,
+0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40, 0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0,
+0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0, 0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0,
+0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3,
+0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0D, 0xFF,
+0xFF, 0xC7, 0xC0, 0x00, 0x12, 0x7A, 0x7A, 0x7A, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53,
+0x54, 0x00, 0x43, 0x4C, 0x53, 0x54, 0x00, 0x43, 0x4C, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Antarctica/Rothera */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x0D, 0x02, 0x2D, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0x7A, 0x7A, 0x7A,
+0x00, 0x52, 0x4F, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Antarctica/South_Pole */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00,
+0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0,
+0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0,
+0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0,
+0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60,
+0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60,
+0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60,
+0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0,
+0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0,
+0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0,
+0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60,
+0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60,
+0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60,
+0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0,
+0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0,
+0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60,
+0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60,
+0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60,
+0x48, 0xE7, 0x76, 0xE0, 0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0,
+0x4C, 0xA7, 0x3A, 0xE0, 0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0,
+0x50, 0x70, 0x39, 0x60, 0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0,
+0x54, 0x2F, 0xFD, 0x60, 0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60,
+0x57, 0xEF, 0xC1, 0x60, 0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60,
+0x5B, 0xB8, 0xBF, 0xE0, 0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60,
+0x5F, 0x78, 0x83, 0xE0, 0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0,
+0x63, 0x38, 0x47, 0xE0, 0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0,
+0x67, 0x01, 0x46, 0x60, 0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0,
+0x6A, 0xC1, 0x0A, 0x60, 0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60,
+0x6E, 0x80, 0xCE, 0x60, 0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60,
+0x72, 0x49, 0xCC, 0xE0, 0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0,
+0x76, 0x09, 0x90, 0xE0, 0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0,
+0x79, 0xC9, 0x54, 0xE0, 0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0,
+0x7D, 0x92, 0x53, 0x60, 0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x03, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00,
+0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53,
+0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Antarctica/Syowa */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE7, 0xB1, 0x58, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x7A, 0x7A, 0x7A,
+0x00, 0x53, 0x59, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Antarctica/Vostok */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE9, 0x58, 0x89, 0x80,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x7A, 0x7A, 0x7A,
+0x00, 0x56, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Arctic/Longyearbyen */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x27, 0xE3, 0x00,
+0x9B, 0xD4, 0x7B, 0x60, 0xC8, 0xB7, 0x4D, 0x60, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10,
+0xD2, 0x62, 0x07, 0x10, 0xEB, 0xAF, 0x20, 0x90, 0xEC, 0xA8, 0x4C, 0x10, 0xED, 0x98, 0x3D, 0x10,
+0xEE, 0x88, 0x2E, 0x10, 0xEF, 0x78, 0x1F, 0x10, 0xF0, 0x68, 0x10, 0x10, 0xF1, 0x58, 0x01, 0x10,
+0xF2, 0x47, 0xF2, 0x10, 0xF3, 0x37, 0xE3, 0x10, 0xF4, 0x27, 0xD4, 0x10, 0xF5, 0x17, 0xC5, 0x10,
+0xF6, 0x10, 0xF0, 0x90, 0xF7, 0x2F, 0x06, 0x10, 0xF7, 0xF0, 0xD2, 0x90, 0x12, 0xCE, 0x97, 0xF0,
+0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00,
+0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Asia/Aden */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x38, 0x20,
+0x01, 0x00, 0x00, 0x2A, 0x60, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Almaty */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xAA, 0x19, 0x7B, 0xDC,
+0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0,
+0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0,
+0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0,
+0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0,
+0x27, 0x04, 0xFD, 0x40, 0x27, 0x7F, 0x7C, 0xA0, 0x29, 0xD4, 0xA6, 0x10, 0x2A, 0xC4, 0x89, 0x00,
+0x2B, 0xB4, 0xB2, 0x40, 0x2C, 0xA4, 0xA3, 0x40, 0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40,
+0x2F, 0x74, 0x76, 0x40, 0x30, 0x64, 0x67, 0x40, 0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0,
+0x33, 0x3D, 0x74, 0xC0, 0x34, 0x52, 0x4F, 0xC0, 0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0,
+0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x4E, 0x40, 0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40,
+0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x12, 0x40, 0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40,
+0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xD6, 0x40, 0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0,
+0x42, 0x35, 0xD1, 0x20, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x03, 0x02, 0x03, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x03, 0x00, 0x00, 0x48, 0x24, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50,
+0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00,
+0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4C,
+0x4D, 0x54, 0x00, 0x41, 0x4C, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Amman */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0,
+0x06, 0x72, 0x79, 0xE0, 0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0,
+0x0A, 0x05, 0x6A, 0xE0, 0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xDA, 0x75, 0xD0,
+0x0D, 0xC9, 0x23, 0x60, 0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0,
+0x1C, 0xAD, 0xD5, 0x60, 0x1D, 0x9F, 0x09, 0xD0, 0x1E, 0x92, 0xFD, 0x60, 0x1F, 0x82, 0xE0, 0x50,
+0x20, 0x72, 0xDF, 0x60, 0x21, 0x62, 0xC2, 0x50, 0x22, 0x52, 0xC1, 0x60, 0x23, 0x4B, 0xDE, 0xD0,
+0x24, 0x64, 0xBC, 0x60, 0x25, 0x2B, 0xC0, 0xD0, 0x26, 0x37, 0x6F, 0x60, 0x27, 0x0B, 0xA2, 0xD0,
+0x28, 0x0B, 0x73, 0xE0, 0x28, 0xE2, 0x4A, 0x50, 0x29, 0xE4, 0xBE, 0x60, 0x2A, 0xCB, 0x66, 0xD0,
+0x2B, 0xBB, 0x65, 0xE0, 0x2C, 0xAB, 0x48, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x78, 0xB5, 0xD0,
+0x2F, 0x84, 0x64, 0x60, 0x30, 0x58, 0xA5, 0xE0, 0x31, 0x64, 0x46, 0x60, 0x32, 0x41, 0xC2, 0x60,
+0x33, 0x44, 0x28, 0x60, 0x34, 0x21, 0xA4, 0x60, 0x35, 0x24, 0x0A, 0x60, 0x36, 0x01, 0x86, 0x60,
+0x37, 0x7A, 0x93, 0x60, 0x37, 0xF2, 0x8B, 0xE0, 0x38, 0xE2, 0x7C, 0xE0, 0x39, 0xD2, 0x6D, 0xE0,
+0x3A, 0xC2, 0x5E, 0xE0, 0x3B, 0xB2, 0x4F, 0xE0, 0x3C, 0xA2, 0x40, 0xE0, 0x3D, 0x92, 0x31, 0xE0,
+0x3E, 0x82, 0x22, 0xE0, 0x3F, 0x72, 0x13, 0xE0, 0x40, 0x62, 0x04, 0xE0, 0x41, 0x5B, 0x30, 0x60,
+0x42, 0x4B, 0x21, 0x60, 0x43, 0x3B, 0x12, 0x60, 0x44, 0x2B, 0x03, 0x60, 0x45, 0x1A, 0xF4, 0x60,
+0x46, 0x0A, 0xE5, 0x60, 0x46, 0xFA, 0xD6, 0x60, 0x47, 0xEA, 0xC7, 0x60, 0x48, 0xDA, 0xB8, 0x60,
+0x49, 0xCA, 0xA9, 0x60, 0x4A, 0xBA, 0x9A, 0x60, 0x4B, 0xAA, 0x8B, 0x60, 0x4C, 0xA3, 0xB6, 0xE0,
+0x4D, 0x93, 0xA7, 0xE0, 0x4E, 0x83, 0x98, 0xE0, 0x4F, 0x73, 0x89, 0xE0, 0x50, 0x63, 0x7A, 0xE0,
+0x51, 0x53, 0x6B, 0xE0, 0x52, 0x43, 0x5C, 0xE0, 0x53, 0x33, 0x4D, 0xE0, 0x54, 0x23, 0x3E, 0xE0,
+0x55, 0x13, 0x2F, 0xE0, 0x56, 0x03, 0x20, 0xE0, 0x56, 0xFC, 0x4C, 0x60, 0x57, 0xEC, 0x3D, 0x60,
+0x58, 0xDC, 0x2E, 0x60, 0x59, 0xCC, 0x1F, 0x60, 0x5A, 0xBC, 0x10, 0x60, 0x5B, 0xAC, 0x01, 0x60,
+0x5C, 0x9B, 0xF2, 0x60, 0x5D, 0x8B, 0xE3, 0x60, 0x5E, 0x7B, 0xD4, 0x60, 0x5F, 0x6B, 0xC5, 0x60,
+0x60, 0x5B, 0xB6, 0x60, 0x61, 0x54, 0xE1, 0xE0, 0x62, 0x44, 0xD2, 0xE0, 0x63, 0x34, 0xC3, 0xE0,
+0x64, 0x24, 0xB4, 0xE0, 0x65, 0x14, 0xA5, 0xE0, 0x66, 0x04, 0x96, 0xE0, 0x66, 0xF4, 0x87, 0xE0,
+0x67, 0xE4, 0x78, 0xE0, 0x68, 0xD4, 0x69, 0xE0, 0x69, 0xC4, 0x5A, 0xE0, 0x6A, 0xB4, 0x4B, 0xE0,
+0x6B, 0xA4, 0x3C, 0xE0, 0x6C, 0x9D, 0x68, 0x60, 0x6D, 0x8D, 0x59, 0x60, 0x6E, 0x7D, 0x4A, 0x60,
+0x6F, 0x6D, 0x3B, 0x60, 0x70, 0x5D, 0x2C, 0x60, 0x71, 0x4D, 0x1D, 0x60, 0x72, 0x3D, 0x0E, 0x60,
+0x73, 0x2C, 0xFF, 0x60, 0x74, 0x1C, 0xF0, 0x60, 0x75, 0x0C, 0xE1, 0x60, 0x76, 0x06, 0x0C, 0xE0,
+0x76, 0xF5, 0xFD, 0xE0, 0x77, 0xE5, 0xEE, 0xE0, 0x78, 0xD5, 0xDF, 0xE0, 0x79, 0xC5, 0xD0, 0xE0,
+0x7A, 0xB5, 0xC1, 0xE0, 0x7B, 0xA5, 0xB2, 0xE0, 0x7C, 0x95, 0xA3, 0xE0, 0x7D, 0x85, 0x94, 0xE0,
+0x7E, 0x75, 0x85, 0xE0, 0x7F, 0x65, 0x76, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00,
+0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00,
+0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Anadyr */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xAA, 0x19, 0x1D, 0x9C,
+0xB5, 0xA3, 0x8C, 0xC0, 0x15, 0x27, 0x1B, 0x30, 0x16, 0x18, 0x4F, 0xA0, 0x17, 0x08, 0x4E, 0xB0,
+0x17, 0xF9, 0x91, 0x30, 0x18, 0xE9, 0x90, 0x40, 0x19, 0xDA, 0xC4, 0xB0, 0x1A, 0xCC, 0x15, 0x40,
+0x1B, 0xBC, 0x22, 0x60, 0x1C, 0xAC, 0x13, 0x60, 0x1D, 0x9C, 0x04, 0x60, 0x1E, 0x8B, 0xF5, 0x60,
+0x1F, 0x7B, 0xE6, 0x60, 0x20, 0x6B, 0xD7, 0x60, 0x21, 0x5B, 0xC8, 0x60, 0x22, 0x4B, 0xB9, 0x60,
+0x23, 0x3B, 0xAA, 0x60, 0x24, 0x2B, 0x9B, 0x60, 0x25, 0x1B, 0x8C, 0x60, 0x26, 0x0B, 0x7D, 0x60,
+0x27, 0x04, 0xA8, 0xE0, 0x27, 0xF4, 0x99, 0xE0, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0x78, 0x40, 0xF0,
+0x29, 0xD4, 0x51, 0xB0, 0x2A, 0xC4, 0x34, 0xA0, 0x2B, 0xB4, 0x5D, 0xE0, 0x2C, 0xA4, 0x4E, 0xE0,
+0x2D, 0x94, 0x3F, 0xE0, 0x2E, 0x84, 0x30, 0xE0, 0x2F, 0x74, 0x21, 0xE0, 0x30, 0x64, 0x12, 0xE0,
+0x31, 0x5D, 0x3E, 0x60, 0x32, 0x72, 0x19, 0x60, 0x33, 0x3D, 0x20, 0x60, 0x34, 0x51, 0xFB, 0x60,
+0x35, 0x1D, 0x02, 0x60, 0x36, 0x31, 0xDD, 0x60, 0x36, 0xFC, 0xE4, 0x60, 0x38, 0x1A, 0xF9, 0xE0,
+0x38, 0xDC, 0xC6, 0x60, 0x39, 0xFA, 0xDB, 0xE0, 0x3A, 0xBC, 0xA8, 0x60, 0x3B, 0xDA, 0xBD, 0xE0,
+0x3C, 0xA5, 0xC4, 0xE0, 0x3D, 0xBA, 0x9F, 0xE0, 0x3E, 0x85, 0xA6, 0xE0, 0x3F, 0x9A, 0x81, 0xE0,
+0x40, 0x65, 0x88, 0xE0, 0x41, 0x83, 0x9E, 0x60, 0x42, 0x45, 0x6A, 0xE0, 0x43, 0x63, 0x80, 0x60,
+0x44, 0x25, 0x4C, 0xE0, 0x45, 0x43, 0x62, 0x60, 0x46, 0x05, 0x2E, 0xE0, 0x47, 0x23, 0x44, 0x60,
+0x47, 0xEE, 0x4B, 0x60, 0x49, 0x03, 0x26, 0x60, 0x49, 0xCE, 0x2D, 0x60, 0x4A, 0xE3, 0x08, 0x60,
+0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xCC, 0x24, 0xE0, 0x4D, 0x8D, 0xF1, 0x60, 0x4E, 0xAC, 0x06, 0xE0,
+0x4F, 0x6D, 0xD3, 0x60, 0x50, 0x8B, 0xE8, 0xE0, 0x51, 0x56, 0xEF, 0xE0, 0x52, 0x6B, 0xCA, 0xE0,
+0x53, 0x36, 0xD1, 0xE0, 0x54, 0x4B, 0xAC, 0xE0, 0x55, 0x16, 0xB3, 0xE0, 0x56, 0x2B, 0x8E, 0xE0,
+0x56, 0xF6, 0x95, 0xE0, 0x58, 0x14, 0xAB, 0x60, 0x58, 0xD6, 0x77, 0xE0, 0x59, 0xF4, 0x8D, 0x60,
+0x5A, 0xB6, 0x59, 0xE0, 0x5B, 0xD4, 0x6F, 0x60, 0x5C, 0x9F, 0x76, 0x60, 0x5D, 0xB4, 0x51, 0x60,
+0x5E, 0x7F, 0x58, 0x60, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x5F, 0x3A, 0x60, 0x61, 0x7D, 0x4F, 0xE0,
+0x62, 0x3F, 0x1C, 0x60, 0x63, 0x5D, 0x31, 0xE0, 0x64, 0x1E, 0xFE, 0x60, 0x65, 0x3D, 0x13, 0xE0,
+0x66, 0x08, 0x1A, 0xE0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0xE7, 0xFC, 0xE0, 0x68, 0xFC, 0xD7, 0xE0,
+0x69, 0xC7, 0xDE, 0xE0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0xA7, 0xC0, 0xE0, 0x6C, 0xC5, 0xD6, 0x60,
+0x6D, 0x87, 0xA2, 0xE0, 0x6E, 0xA5, 0xB8, 0x60, 0x6F, 0x67, 0x84, 0xE0, 0x70, 0x85, 0x9A, 0x60,
+0x71, 0x50, 0xA1, 0x60, 0x72, 0x65, 0x7C, 0x60, 0x73, 0x30, 0x83, 0x60, 0x74, 0x45, 0x5E, 0x60,
+0x75, 0x10, 0x65, 0x60, 0x76, 0x2E, 0x7A, 0xE0, 0x76, 0xF0, 0x47, 0x60, 0x78, 0x0E, 0x5C, 0xE0,
+0x78, 0xD0, 0x29, 0x60, 0x79, 0xEE, 0x3E, 0xE0, 0x7A, 0xB0, 0x0B, 0x60, 0x7B, 0xCE, 0x20, 0xE0,
+0x7C, 0x99, 0x27, 0xE0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x79, 0x09, 0xE0, 0x7F, 0x8D, 0xE4, 0xE0,
+0x01, 0x03, 0x02, 0x03, 0x04, 0x01, 0x04, 0x01, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x05, 0x04, 0x01, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x00, 0x00, 0xA6, 0x64, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00,
+0x04, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x09, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x04, 0x00, 0x00, 0xB6,
+0xD0, 0x01, 0x09, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x04, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x09, 0x00,
+0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41,
+0x4E, 0x41, 0x54, 0x00, 0x41, 0x4E, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Aqtau */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x1F, 0xAA, 0x19, 0x94, 0xE0,
+0xB5, 0xA3, 0xFD, 0x40, 0xF2, 0xD4, 0xAE, 0x30, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0,
+0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0,
+0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0,
+0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0,
+0x27, 0x05, 0x0B, 0x50, 0x27, 0x7F, 0x8A, 0xB0, 0x29, 0x4B, 0xA6, 0x30, 0x29, 0xD4, 0xB4, 0x20,
+0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xA2, 0x50,
+0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x83, 0x60, 0x31, 0x5D, 0xAE, 0xE0,
+0x32, 0x72, 0x89, 0xE0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0,
+0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0,
+0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60,
+0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60,
+0x41, 0x84, 0x0E, 0xE0, 0x42, 0x35, 0xED, 0x40, 0x01, 0x02, 0x03, 0x04, 0x05, 0x03, 0x05, 0x03,
+0x05, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x03, 0x09,
+0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D,
+0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x09, 0x00, 0x00, 0x2F, 0x20, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46,
+0x50, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0E, 0x00,
+0x00, 0x46, 0x50, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0E, 0x00, 0x00, 0x54, 0x60, 0x01,
+0x14, 0x00, 0x00, 0x46, 0x50, 0x00, 0x1A, 0x00, 0x00, 0x54, 0x60, 0x01, 0x14, 0x00, 0x00, 0x46,
+0x50, 0x00, 0x1A, 0x00, 0x00, 0x46, 0x50, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, 0x00, 0x1A, 0x00,
+0x00, 0x38, 0x40, 0x00, 0x1A, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4F, 0x52, 0x54, 0x00, 0x53, 0x48,
+0x45, 0x54, 0x00, 0x53, 0x48, 0x45, 0x53, 0x54, 0x00, 0x41, 0x51, 0x54, 0x53, 0x54, 0x00, 0x41,
+0x51, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* Asia/Aqtobe */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x19, 0x8E, 0x68,
+0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0,
+0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0,
+0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0,
+0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0,
+0x27, 0x05, 0x0B, 0x50, 0x27, 0x7F, 0x8A, 0xB0, 0x29, 0x4B, 0xA6, 0x30, 0x29, 0xD4, 0xB4, 0x20,
+0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xA2, 0x50,
+0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xA0, 0xD0,
+0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x5D, 0xD0, 0x35, 0x1D, 0x64, 0xD0,
+0x36, 0x32, 0x3F, 0xD0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x5C, 0x50, 0x38, 0xDD, 0x28, 0xD0,
+0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x0A, 0xD0, 0x3B, 0xDB, 0x20, 0x50, 0x3C, 0xA6, 0x27, 0x50,
+0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x09, 0x50, 0x3F, 0x9A, 0xE4, 0x50, 0x40, 0x65, 0xEB, 0x50,
+0x41, 0x84, 0x00, 0xD0, 0x42, 0x35, 0xDF, 0x30, 0x01, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x02, 0x08,
+0x07, 0x08, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A,
+0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x08, 0x00, 0x00, 0x35, 0x98, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54,
+0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00,
+0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00,
+0x15, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x4B, 0x54, 0x54, 0x00, 0x41, 0x4B, 0x54, 0x53, 0x54, 0x00, 0x41, 0x51, 0x54, 0x53,
+0x54, 0x00, 0x41, 0x51, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Ashgabat */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x13, 0xAA, 0x19, 0x8D, 0x44,
+0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30,
+0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0,
+0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0,
+0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0,
+0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0,
+0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x09, 0xC9, 0x40,
+0x29, 0x78, 0xA3, 0x60, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00,
+0x36, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09,
+0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60,
+0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00,
+0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53,
+0x48, 0x54, 0x00, 0x41, 0x53, 0x48, 0x53, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* Asia/Ashkhabad */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x13, 0xAA, 0x19, 0x8D, 0x44,
+0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30,
+0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0,
+0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0,
+0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0,
+0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0,
+0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x09, 0xC9, 0x40,
+0x29, 0x78, 0xA3, 0x60, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00,
+0x36, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09,
+0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60,
+0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00,
+0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53,
+0x48, 0x54, 0x00, 0x41, 0x53, 0x48, 0x53, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* Asia/Baghdad */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0x30, 0x3C, 0xE0,
+0x17, 0x30, 0x68, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xE8, 0xBD, 0x50, 0x19, 0xDB, 0x43, 0x40,
+0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBD, 0xC8, 0x40, 0x1C, 0xAD, 0xC7, 0x50, 0x1D, 0x9C, 0x74, 0xE0,
+0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0,
+0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0,
+0x26, 0x0B, 0xED, 0xE0, 0x27, 0x05, 0x19, 0x60, 0x27, 0xF6, 0x78, 0x00, 0x28, 0xE7, 0xBA, 0x80,
+0x29, 0xD8, 0xFD, 0x00, 0x2A, 0xCA, 0x3F, 0x80, 0x2B, 0xBA, 0x30, 0x80, 0x2C, 0xAB, 0x73, 0x00,
+0x2D, 0x9B, 0x64, 0x00, 0x2E, 0x8C, 0xA6, 0x80, 0x2F, 0x7C, 0x97, 0x80, 0x30, 0x6D, 0xDA, 0x00,
+0x31, 0x5F, 0x1C, 0x80, 0x32, 0x50, 0x5F, 0x00, 0x33, 0x40, 0x50, 0x00, 0x34, 0x31, 0x92, 0x80,
+0x35, 0x21, 0x83, 0x80, 0x36, 0x12, 0xC6, 0x00, 0x37, 0x02, 0xB7, 0x00, 0x37, 0xF3, 0xF9, 0x80,
+0x38, 0xE5, 0x3C, 0x00, 0x39, 0xD6, 0x7E, 0x80, 0x3A, 0xC6, 0x6F, 0x80, 0x3B, 0xB7, 0xB2, 0x00,
+0x3C, 0xA7, 0xA3, 0x00, 0x3D, 0x98, 0xE5, 0x80, 0x3E, 0x88, 0xD6, 0x80, 0x3F, 0x7A, 0x19, 0x00,
+0x40, 0x6B, 0x5B, 0x80, 0x41, 0x5C, 0x9E, 0x00, 0x42, 0x4C, 0x8F, 0x00, 0x43, 0x3D, 0xD1, 0x80,
+0x44, 0x2D, 0xC2, 0x80, 0x45, 0x1F, 0x05, 0x00, 0x46, 0x0E, 0xF6, 0x00, 0x47, 0x00, 0x38, 0x80,
+0x47, 0xF1, 0x7B, 0x00, 0x48, 0xE2, 0xBD, 0x80, 0x49, 0xD2, 0xAE, 0x80, 0x4A, 0xC3, 0xF1, 0x00,
+0x4B, 0xB3, 0xE2, 0x00, 0x4C, 0xA5, 0x24, 0x80, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x86, 0x58, 0x00,
+0x4F, 0x77, 0x9A, 0x80, 0x50, 0x68, 0xDD, 0x00, 0x51, 0x58, 0xCE, 0x00, 0x52, 0x4A, 0x10, 0x80,
+0x53, 0x3A, 0x01, 0x80, 0x54, 0x2B, 0x44, 0x00, 0x55, 0x1B, 0x35, 0x00, 0x56, 0x0C, 0x77, 0x80,
+0x56, 0xFD, 0xBA, 0x00, 0x57, 0xEE, 0xFC, 0x80, 0x58, 0xDE, 0xED, 0x80, 0x59, 0xD0, 0x30, 0x00,
+0x5A, 0xC0, 0x21, 0x00, 0x5B, 0xB1, 0x63, 0x80, 0x5C, 0xA1, 0x54, 0x80, 0x5D, 0x92, 0x97, 0x00,
+0x5E, 0x83, 0xD9, 0x80, 0x5F, 0x75, 0x1C, 0x00, 0x60, 0x65, 0x0D, 0x00, 0x61, 0x56, 0x4F, 0x80,
+0x62, 0x46, 0x40, 0x80, 0x63, 0x37, 0x83, 0x00, 0x64, 0x27, 0x74, 0x00, 0x65, 0x18, 0xB6, 0x80,
+0x66, 0x09, 0xF9, 0x00, 0x66, 0xFB, 0x3B, 0x80, 0x67, 0xEB, 0x2C, 0x80, 0x68, 0xDC, 0x6F, 0x00,
+0x69, 0xCC, 0x60, 0x00, 0x6A, 0xBD, 0xA2, 0x80, 0x6B, 0xAD, 0x93, 0x80, 0x6C, 0x9E, 0xD6, 0x00,
+0x6D, 0x90, 0x18, 0x80, 0x6E, 0x81, 0x5B, 0x00, 0x6F, 0x71, 0x4C, 0x00, 0x70, 0x62, 0x8E, 0x80,
+0x71, 0x52, 0x7F, 0x80, 0x72, 0x43, 0xC2, 0x00, 0x73, 0x33, 0xB3, 0x00, 0x74, 0x24, 0xF5, 0x80,
+0x75, 0x16, 0x38, 0x00, 0x76, 0x07, 0x7A, 0x80, 0x76, 0xF7, 0x6B, 0x80, 0x77, 0xE8, 0xAE, 0x00,
+0x78, 0xD8, 0x9F, 0x00, 0x79, 0xC9, 0xE1, 0x80, 0x7A, 0xB9, 0xD2, 0x80, 0x7B, 0xAB, 0x15, 0x00,
+0x7C, 0x9C, 0x57, 0x80, 0x7D, 0x8D, 0x9A, 0x00, 0x7E, 0x7D, 0x8B, 0x00, 0x7F, 0x6E, 0xCD, 0x80,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x00, 0x00, 0x29, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38,
+0x40, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x42,
+0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Bahrain */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA1, 0xF2, 0x9E, 0x14,
+0x04, 0x8A, 0x92, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x2F, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40,
+0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x53, 0x54, 0x00,
+0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Baku */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x95, 0x44,
+0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40,
+0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0,
+0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0,
+0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0,
+0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0,
+0x27, 0x05, 0x19, 0x60, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xBD, 0x52, 0x40, 0x28, 0xE5, 0x09, 0x70,
+0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x30, 0xE6, 0xEB, 0xC0, 0x31, 0x5D, 0xD9, 0x10,
+0x32, 0x72, 0xB4, 0x10, 0x32, 0xC9, 0x70, 0xC0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x4F, 0xC0,
+0x35, 0x1D, 0x64, 0xD0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x4E, 0x40,
+0x38, 0xDD, 0x28, 0xD0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBD, 0x0A, 0xD0, 0x3B, 0xDB, 0x12, 0x40,
+0x3C, 0xA6, 0x27, 0x50, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x86, 0x09, 0x50, 0x3F, 0x9A, 0xD6, 0x40,
+0x40, 0x65, 0xEB, 0x50, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x45, 0xCD, 0x50, 0x43, 0x63, 0xD4, 0xC0,
+0x44, 0x25, 0xAF, 0x50, 0x45, 0x43, 0xB6, 0xC0, 0x46, 0x05, 0x91, 0x50, 0x47, 0x23, 0x98, 0xC0,
+0x47, 0xEE, 0xAD, 0xD0, 0x49, 0x03, 0x7A, 0xC0, 0x49, 0xCE, 0x8F, 0xD0, 0x4A, 0xE3, 0x5C, 0xC0,
+0x4B, 0xAE, 0x71, 0xD0, 0x4C, 0xCC, 0x79, 0x40, 0x4D, 0x8E, 0x53, 0xD0, 0x4E, 0xAC, 0x5B, 0x40,
+0x4F, 0x6E, 0x35, 0xD0, 0x50, 0x8C, 0x3D, 0x40, 0x51, 0x57, 0x52, 0x50, 0x52, 0x6C, 0x1F, 0x40,
+0x53, 0x37, 0x34, 0x50, 0x54, 0x4C, 0x01, 0x40, 0x55, 0x17, 0x16, 0x50, 0x56, 0x2B, 0xE3, 0x40,
+0x56, 0xF6, 0xF8, 0x50, 0x58, 0x14, 0xFF, 0xC0, 0x58, 0xD6, 0xDA, 0x50, 0x59, 0xF4, 0xE1, 0xC0,
+0x5A, 0xB6, 0xBC, 0x50, 0x5B, 0xD4, 0xC3, 0xC0, 0x5C, 0x9F, 0xD8, 0xD0, 0x5D, 0xB4, 0xA5, 0xC0,
+0x5E, 0x7F, 0xBA, 0xD0, 0x5F, 0x94, 0x87, 0xC0, 0x60, 0x5F, 0x9C, 0xD0, 0x61, 0x7D, 0xA4, 0x40,
+0x62, 0x3F, 0x7E, 0xD0, 0x63, 0x5D, 0x86, 0x40, 0x64, 0x1F, 0x60, 0xD0, 0x65, 0x3D, 0x68, 0x40,
+0x66, 0x08, 0x7D, 0x50, 0x67, 0x1D, 0x4A, 0x40, 0x67, 0xE8, 0x5F, 0x50, 0x68, 0xFD, 0x2C, 0x40,
+0x69, 0xC8, 0x41, 0x50, 0x6A, 0xDD, 0x0E, 0x40, 0x6B, 0xA8, 0x23, 0x50, 0x6C, 0xC6, 0x2A, 0xC0,
+0x6D, 0x88, 0x05, 0x50, 0x6E, 0xA6, 0x0C, 0xC0, 0x6F, 0x67, 0xE7, 0x50, 0x70, 0x85, 0xEE, 0xC0,
+0x71, 0x51, 0x03, 0xD0, 0x72, 0x65, 0xD0, 0xC0, 0x73, 0x30, 0xE5, 0xD0, 0x74, 0x45, 0xB2, 0xC0,
+0x75, 0x10, 0xC7, 0xD0, 0x76, 0x2E, 0xCF, 0x40, 0x76, 0xF0, 0xA9, 0xD0, 0x78, 0x0E, 0xB1, 0x40,
+0x78, 0xD0, 0x8B, 0xD0, 0x79, 0xEE, 0x93, 0x40, 0x7A, 0xB0, 0x6D, 0xD0, 0x7B, 0xCE, 0x75, 0x40,
+0x7C, 0x99, 0x8A, 0x50, 0x7D, 0xAE, 0x57, 0x40, 0x7E, 0x79, 0x6C, 0x50, 0x7F, 0x8E, 0x39, 0x40,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x08, 0x07, 0x08, 0x09, 0x0C, 0x0A, 0x0B, 0x09, 0x0C,
+0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C,
+0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C,
+0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C,
+0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C,
+0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C,
+0x09, 0x00, 0x00, 0x2E, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x46,
+0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00,
+0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00,
+0x0F, 0x00, 0x00, 0x38, 0x40, 0x01, 0x13, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46,
+0x50, 0x01, 0x13, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x01, 0x13, 0x4C,
+0x4D, 0x54, 0x00, 0x42, 0x41, 0x4B, 0x54, 0x00, 0x42, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x41, 0x5A,
+0x54, 0x00, 0x41, 0x5A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+0x00,
+
+/* Asia/Bangkok */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA2, 0x6A, 0x67, 0xC4,
+0x01, 0x00, 0x00, 0x5E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x42, 0x4D, 0x54,
+0x00, 0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Beirut */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xA2, 0x65, 0x63, 0xE0,
+0xA3, 0x7B, 0x82, 0x50, 0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0,
+0xA7, 0x27, 0x7F, 0xD0, 0xA8, 0x29, 0xF3, 0xE0, 0xA8, 0xEB, 0xB2, 0x50, 0xE8, 0x2A, 0x85, 0xE0,
+0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, 0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xEC, 0xE0,
+0xEC, 0xB6, 0x94, 0x50, 0xED, 0xCF, 0x71, 0xE0, 0xEE, 0x99, 0x19, 0x50, 0xEF, 0xB0, 0xA5, 0x60,
+0xF0, 0x7A, 0x4C, 0xD0, 0x04, 0xA6, 0x5E, 0x60, 0x05, 0x2B, 0x77, 0xD0, 0x06, 0x43, 0x03, 0xE0,
+0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0, 0x0A, 0x05, 0x6A, 0xE0,
+0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xB1, 0x97, 0x50, 0x0D, 0xC9, 0x23, 0x60,
+0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0, 0x1A, 0xF4, 0x2E, 0xE0,
+0x1B, 0xD1, 0x9C, 0xD0, 0x1C, 0xD5, 0x62, 0x60, 0x1D, 0xB2, 0xD0, 0x50, 0x1E, 0xB6, 0x95, 0xE0,
+0x1F, 0x94, 0x03, 0xD0, 0x20, 0x97, 0xC9, 0x60, 0x21, 0x75, 0x37, 0x50, 0x22, 0xA3, 0x2C, 0xE0,
+0x23, 0x57, 0xBC, 0x50, 0x24, 0x67, 0x5F, 0x60, 0x25, 0x38, 0xEF, 0xD0, 0x26, 0x3C, 0xB5, 0x60,
+0x27, 0x1A, 0x23, 0x50, 0x28, 0x1D, 0xE8, 0xE0, 0x28, 0xFB, 0x56, 0xD0, 0x2A, 0x00, 0x6D, 0xE0,
+0x2A, 0xCE, 0x09, 0xD0, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60,
+0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0,
+0x32, 0x4D, 0x91, 0xD0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x2D, 0x73, 0xD0, 0x35, 0x1D, 0x72, 0xE0,
+0x36, 0x0D, 0x55, 0xD0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x5C, 0x50, 0x38, 0xDD, 0x36, 0xE0,
+0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x20, 0x50, 0x3C, 0xA6, 0x35, 0x60,
+0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xE4, 0x50, 0x40, 0x65, 0xF9, 0x60,
+0x41, 0x84, 0x00, 0xD0, 0x42, 0x45, 0xDB, 0x60, 0x43, 0x63, 0xE2, 0xD0, 0x44, 0x25, 0xBD, 0x60,
+0x45, 0x43, 0xC4, 0xD0, 0x46, 0x05, 0x9F, 0x60, 0x47, 0x23, 0xA6, 0xD0, 0x47, 0xEE, 0xBB, 0xE0,
+0x49, 0x03, 0x88, 0xD0, 0x49, 0xCE, 0x9D, 0xE0, 0x4A, 0xE3, 0x6A, 0xD0, 0x4B, 0xAE, 0x7F, 0xE0,
+0x4C, 0xCC, 0x87, 0x50, 0x4D, 0x8E, 0x61, 0xE0, 0x4E, 0xAC, 0x69, 0x50, 0x4F, 0x6E, 0x43, 0xE0,
+0x50, 0x8C, 0x4B, 0x50, 0x51, 0x57, 0x60, 0x60, 0x52, 0x6C, 0x2D, 0x50, 0x53, 0x37, 0x42, 0x60,
+0x54, 0x4C, 0x0F, 0x50, 0x55, 0x17, 0x24, 0x60, 0x56, 0x2B, 0xF1, 0x50, 0x56, 0xF7, 0x06, 0x60,
+0x58, 0x15, 0x0D, 0xD0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xEF, 0xD0, 0x5A, 0xB6, 0xCA, 0x60,
+0x5B, 0xD4, 0xD1, 0xD0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xB3, 0xD0, 0x5E, 0x7F, 0xC8, 0xE0,
+0x5F, 0x94, 0x95, 0xD0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xB2, 0x50, 0x62, 0x3F, 0x8C, 0xE0,
+0x63, 0x5D, 0x94, 0x50, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x76, 0x50, 0x66, 0x08, 0x8B, 0x60,
+0x67, 0x1D, 0x58, 0x50, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x3A, 0x50, 0x69, 0xC8, 0x4F, 0x60,
+0x6A, 0xDD, 0x1C, 0x50, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x38, 0xD0, 0x6D, 0x88, 0x13, 0x60,
+0x6E, 0xA6, 0x1A, 0xD0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x85, 0xFC, 0xD0, 0x71, 0x51, 0x11, 0xE0,
+0x72, 0x65, 0xDE, 0xD0, 0x73, 0x30, 0xF3, 0xE0, 0x74, 0x45, 0xC0, 0xD0, 0x75, 0x10, 0xD5, 0xE0,
+0x76, 0x2E, 0xDD, 0x50, 0x76, 0xF0, 0xB7, 0xE0, 0x78, 0x0E, 0xBF, 0x50, 0x78, 0xD0, 0x99, 0xE0,
+0x79, 0xEE, 0xA1, 0x50, 0x7A, 0xB0, 0x7B, 0xE0, 0x7B, 0xCE, 0x83, 0x50, 0x7C, 0x99, 0x98, 0x60,
+0x7D, 0xAE, 0x65, 0x50, 0x7E, 0x79, 0x7A, 0x60, 0x7F, 0x8E, 0x47, 0x50, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00,
+0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* Asia/Bishkek */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x7E, 0x10,
+0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0,
+0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0,
+0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0,
+0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0,
+0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xBE, 0xA3, 0xC0, 0x29, 0xE7, 0x37, 0x30,
+0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xC7, 0x19, 0x30, 0x2C, 0xA4, 0x87, 0x20, 0x2D, 0xA6, 0xFB, 0x30,
+0x2E, 0x84, 0x69, 0x20, 0x2F, 0x86, 0xDD, 0x30, 0x30, 0x64, 0x4B, 0x20, 0x31, 0x66, 0xBF, 0x30,
+0x32, 0x4D, 0x67, 0xA0, 0x33, 0x3D, 0x89, 0xD8, 0x34, 0x52, 0x56, 0xC8, 0x35, 0x1D, 0x6B, 0xD8,
+0x36, 0x32, 0x38, 0xC8, 0x36, 0xFD, 0x4D, 0xD8, 0x38, 0x1B, 0x55, 0x48, 0x38, 0xDD, 0x2F, 0xD8,
+0x39, 0xFB, 0x37, 0x48, 0x3A, 0xBD, 0x11, 0xD8, 0x3B, 0xDB, 0x19, 0x48, 0x3C, 0xA6, 0x2E, 0x58,
+0x3D, 0xBA, 0xFB, 0x48, 0x3E, 0x86, 0x10, 0x58, 0x3F, 0x9A, 0xDD, 0x48, 0x40, 0x65, 0xF2, 0x58,
+0x41, 0x83, 0xF9, 0xC8, 0x42, 0x45, 0xD4, 0x58, 0x42, 0xFB, 0x92, 0x20, 0x01, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x06, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x0A,
+0x00, 0x00, 0x45, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70,
+0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00,
+0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F,
+0x00, 0x00, 0x46, 0x50, 0x00, 0x14, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60,
+0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x52, 0x55, 0x54, 0x00, 0x46, 0x52, 0x55, 0x53, 0x54,
+0x00, 0x4B, 0x47, 0x53, 0x54, 0x00, 0x4B, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Asia/Brunei */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0xAD, 0x8A, 0x02, 0x44,
+0xBA, 0x67, 0x47, 0x88, 0x01, 0x02, 0x00, 0x00, 0x6B, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x69, 0x78,
+0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x4E, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Calcutta */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xCA, 0xDB, 0x86, 0xB0,
+0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xD2, 0x74, 0x12, 0x98, 0x01, 0x02, 0x03, 0x02,
+0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x04, 0x00, 0x00, 0x4D, 0x58,
+0x00, 0x09, 0x00, 0x00, 0x5B, 0x68, 0x01, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54,
+0x00, 0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Choibalsan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x86, 0xD3, 0xE7, 0x28,
+0x0F, 0x0B, 0xDC, 0x90, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xEE, 0xE0, 0x1A, 0xCC, 0x3F, 0x70,
+0x1B, 0xBC, 0x4C, 0x90, 0x1C, 0xAC, 0x3D, 0x90, 0x1D, 0x9C, 0x2E, 0x90, 0x1E, 0x8C, 0x1F, 0x90,
+0x1F, 0x7C, 0x10, 0x90, 0x20, 0x6C, 0x01, 0x90, 0x21, 0x5B, 0xF2, 0x90, 0x22, 0x4B, 0xE3, 0x90,
+0x23, 0x3B, 0xD4, 0x90, 0x24, 0x2B, 0xC5, 0x90, 0x25, 0x1B, 0xB6, 0x90, 0x26, 0x0B, 0xA7, 0x90,
+0x27, 0x04, 0xD3, 0x10, 0x27, 0xF4, 0xC4, 0x10, 0x28, 0xE4, 0xB5, 0x10, 0x29, 0xD4, 0xA6, 0x10,
+0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0x88, 0x10, 0x2C, 0xA4, 0x79, 0x10, 0x2D, 0x94, 0x6A, 0x10,
+0x2E, 0x84, 0x5B, 0x10, 0x2F, 0x74, 0x4C, 0x10, 0x30, 0x64, 0x3D, 0x10, 0x31, 0x5D, 0x68, 0x90,
+0x32, 0x4D, 0x59, 0x90, 0x33, 0x3D, 0x4A, 0x90, 0x34, 0x2D, 0x3B, 0x90, 0x35, 0x1D, 0x2C, 0x90,
+0x36, 0x0D, 0x1D, 0x90, 0x3A, 0xE9, 0xA5, 0x90, 0x3B, 0xB4, 0x9E, 0x80, 0x3C, 0xA4, 0x9D, 0x90,
+0x3D, 0x94, 0x80, 0x80, 0x3E, 0x84, 0x7F, 0x90, 0x3F, 0x74, 0x62, 0x80, 0x40, 0x64, 0x61, 0x90,
+0x41, 0x54, 0x44, 0x80, 0x42, 0x44, 0x43, 0x90, 0x43, 0x34, 0x26, 0x80, 0x44, 0x24, 0x25, 0x90,
+0x45, 0x1D, 0x43, 0x00, 0x46, 0x0D, 0x42, 0x10, 0x46, 0xFD, 0x25, 0x00, 0x47, 0xED, 0x24, 0x10,
+0x48, 0xDD, 0x07, 0x00, 0x49, 0xCD, 0x06, 0x10, 0x4A, 0xBC, 0xE9, 0x00, 0x4B, 0xAC, 0xE8, 0x10,
+0x4C, 0x9C, 0xCB, 0x00, 0x4D, 0x8C, 0xCA, 0x10, 0x4E, 0x7C, 0xAD, 0x00, 0x4F, 0x75, 0xE6, 0x90,
+0x50, 0x65, 0xC9, 0x80, 0x51, 0x55, 0xC8, 0x90, 0x52, 0x45, 0xAB, 0x80, 0x53, 0x35, 0xAA, 0x90,
+0x54, 0x25, 0x8D, 0x80, 0x55, 0x15, 0x8C, 0x90, 0x56, 0x05, 0x6F, 0x80, 0x56, 0xF5, 0x6E, 0x90,
+0x57, 0xE5, 0x51, 0x80, 0x58, 0xD5, 0x50, 0x90, 0x59, 0xCE, 0x6E, 0x00, 0x5A, 0xBE, 0x6D, 0x10,
+0x5B, 0xAE, 0x50, 0x00, 0x5C, 0x9E, 0x4F, 0x10, 0x5D, 0x8E, 0x32, 0x00, 0x5E, 0x7E, 0x31, 0x10,
+0x5F, 0x6E, 0x14, 0x00, 0x60, 0x5E, 0x13, 0x10, 0x61, 0x4D, 0xF6, 0x00, 0x62, 0x3D, 0xF5, 0x10,
+0x63, 0x2D, 0xD8, 0x00, 0x64, 0x1D, 0xD7, 0x10, 0x65, 0x16, 0xF4, 0x80, 0x66, 0x06, 0xF3, 0x90,
+0x66, 0xF6, 0xD6, 0x80, 0x67, 0xE6, 0xD5, 0x90, 0x68, 0xD6, 0xB8, 0x80, 0x69, 0xC6, 0xB7, 0x90,
+0x6A, 0xB6, 0x9A, 0x80, 0x6B, 0xA6, 0x99, 0x90, 0x6C, 0x96, 0x7C, 0x80, 0x6D, 0x86, 0x7B, 0x90,
+0x6E, 0x7F, 0x99, 0x00, 0x6F, 0x6F, 0x98, 0x10, 0x70, 0x5F, 0x7B, 0x00, 0x71, 0x4F, 0x7A, 0x10,
+0x72, 0x3F, 0x5D, 0x00, 0x73, 0x2F, 0x5C, 0x10, 0x74, 0x1F, 0x3F, 0x00, 0x75, 0x0F, 0x3E, 0x10,
+0x75, 0xFF, 0x21, 0x00, 0x76, 0xEF, 0x20, 0x10, 0x77, 0xDF, 0x03, 0x00, 0x78, 0xCF, 0x02, 0x10,
+0x79, 0xC8, 0x1F, 0x80, 0x7A, 0xB8, 0x1E, 0x90, 0x7B, 0xA8, 0x01, 0x80, 0x7C, 0x98, 0x00, 0x90,
+0x7D, 0x87, 0xE3, 0x80, 0x7E, 0x77, 0xE2, 0x90, 0x7F, 0x67, 0xC5, 0x80, 0x01, 0x02, 0x04, 0x03,
+0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x6B, 0x58, 0x00, 0x00, 0x00, 0x00,
+0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x09,
+0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0E, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x8C, 0xA0,
+0x01, 0x0E, 0x4C, 0x4D, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x54, 0x00, 0x43, 0x48, 0x4F, 0x54, 0x00,
+0x43, 0x48, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Chongqing */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xA8, 0x94,
+0x13, 0x6D, 0xC9, 0x10, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80,
+0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00,
+0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00,
+0x28, 0xD2, 0x23, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00,
+0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4C, 0x4F,
+0x4E, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Asia/Chungking */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xA8, 0x94,
+0x13, 0x6D, 0xC9, 0x10, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80,
+0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00,
+0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00,
+0x28, 0xD2, 0x23, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00,
+0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4C, 0x4F,
+0x4E, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Asia/Colombo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x87, 0x9D, 0xBD, 0x1C,
+0xCB, 0x5A, 0x1C, 0x28, 0xCC, 0x95, 0x2B, 0xA0, 0xD2, 0x75, 0x80, 0x38, 0x31, 0xA6, 0x00, 0x28,
+0x32, 0x71, 0x00, 0x20, 0x01, 0x02, 0x03, 0x01, 0x04, 0x05, 0x00, 0x00, 0x4A, 0xE4, 0x00, 0x00,
+0x00, 0x00, 0x4D, 0x58, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x08, 0x00, 0x00, 0x5B, 0x68,
+0x01, 0x04, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x0D, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x4D, 0x4D,
+0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x48, 0x53, 0x54, 0x00, 0x4C, 0x4B, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Dacca */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0xCA, 0xDB, 0x86, 0xB0,
+0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xDD, 0xA8, 0xD2, 0x98, 0x02, 0x4F, 0x9D, 0x20,
+0x01, 0x02, 0x01, 0x03, 0x04, 0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00,
+0x04, 0x00, 0x00, 0x4D, 0x58, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x00, 0x00, 0x54,
+0x60, 0x00, 0x12, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00,
+0x44, 0x41, 0x43, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Asia/Damascus */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xA1, 0xF2, 0xAB, 0x78,
+0xA2, 0x81, 0x2F, 0x80, 0xA3, 0x5E, 0x9D, 0x70, 0xA4, 0x61, 0x11, 0x80, 0xA5, 0x3E, 0x7F, 0x70,
+0xA6, 0x40, 0xF3, 0x80, 0xA7, 0x1E, 0x61, 0x70, 0xA8, 0x20, 0xD5, 0x80, 0xA9, 0x07, 0x7D, 0xF0,
+0xF1, 0x8F, 0x52, 0x00, 0xF2, 0x5B, 0x9C, 0x70, 0xF3, 0x73, 0x28, 0x80, 0xF4, 0x3B, 0x7E, 0x70,
+0xF5, 0x55, 0xAD, 0x80, 0xF6, 0x1F, 0x54, 0xF0, 0xF7, 0x36, 0xE1, 0x00, 0xF7, 0xFF, 0x36, 0xF0,
+0xF9, 0x0E, 0xDA, 0x00, 0xF9, 0xE1, 0xBB, 0xF0, 0xFA, 0xF9, 0x48, 0x00, 0xFB, 0xC2, 0xEF, 0x70,
+0xFC, 0xDB, 0xCD, 0x00, 0xFD, 0xA5, 0x74, 0x70, 0xFE, 0xBD, 0x00, 0x80, 0xFF, 0x86, 0xA7, 0xF0,
+0x00, 0x9E, 0x34, 0x00, 0x01, 0x67, 0xDB, 0x70, 0x02, 0x7F, 0x67, 0x80, 0x03, 0x49, 0x0E, 0xF0,
+0x04, 0x61, 0xEC, 0x80, 0x05, 0x2B, 0x93, 0xF0, 0x06, 0x43, 0x20, 0x00, 0x07, 0x0C, 0xC7, 0x70,
+0x08, 0x24, 0x53, 0x80, 0x08, 0xED, 0xFA, 0xF0, 0x0A, 0x05, 0x87, 0x00, 0x0A, 0xCF, 0x2E, 0x70,
+0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0xB1, 0xB3, 0x70, 0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x6B, 0x59, 0xF0,
+0x0F, 0xAA, 0x73, 0x00, 0x10, 0x4C, 0x8D, 0x70, 0x18, 0xF4, 0xC5, 0x00, 0x19, 0xDB, 0x6D, 0x70,
+0x1A, 0xD7, 0x4A, 0x00, 0x1B, 0xBD, 0xF2, 0x70, 0x1E, 0x55, 0x23, 0x00, 0x1F, 0x8A, 0xE5, 0x70,
+0x20, 0x47, 0x7A, 0x00, 0x21, 0x89, 0x19, 0xF0, 0x22, 0x3C, 0x74, 0x00, 0x23, 0x6B, 0x9E, 0xF0,
+0x24, 0x32, 0xBF, 0x80, 0x25, 0x25, 0x45, 0x70, 0x26, 0x15, 0x44, 0x80, 0x27, 0x05, 0x27, 0x70,
+0x27, 0xF6, 0x5B, 0xE0, 0x28, 0xE7, 0x90, 0x50, 0x29, 0xE2, 0x1B, 0x60, 0x2A, 0xCA, 0x15, 0x50,
+0x2B, 0xB2, 0x2B, 0x60, 0x2C, 0xA3, 0x5F, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x8C, 0x7C, 0x50,
+0x2F, 0x7C, 0x7B, 0x60, 0x30, 0x6D, 0xAF, 0xD0, 0x31, 0x5F, 0x00, 0x60, 0x32, 0x50, 0x34, 0xD0,
+0x33, 0x3E, 0xE2, 0x60, 0x34, 0x31, 0x68, 0x50, 0x35, 0x1E, 0xC4, 0x60, 0x36, 0x12, 0x9B, 0xD0,
+0x37, 0x02, 0x9A, 0xE0, 0x37, 0xF3, 0xCF, 0x50, 0x38, 0xE5, 0x1F, 0xE0, 0x39, 0xD6, 0x54, 0x50,
+0x3A, 0xC6, 0x53, 0x60, 0x3B, 0xB7, 0x87, 0xD0, 0x3C, 0xA7, 0x86, 0xE0, 0x3D, 0x98, 0xBB, 0x50,
+0x3E, 0x88, 0xBA, 0x60, 0x3F, 0x79, 0xEE, 0xD0, 0x40, 0x6B, 0x3F, 0x60, 0x41, 0x5C, 0x73, 0xD0,
+0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3D, 0xA7, 0x50, 0x44, 0x2D, 0xA6, 0x60, 0x45, 0x1E, 0xDA, 0xD0,
+0x46, 0x0E, 0xD9, 0xE0, 0x47, 0x00, 0x0E, 0x50, 0x47, 0xF1, 0x5E, 0xE0, 0x48, 0xE2, 0x93, 0x50,
+0x49, 0xD2, 0x92, 0x60, 0x4A, 0xC3, 0xC6, 0xD0, 0x4B, 0xB3, 0xC5, 0xE0, 0x4C, 0xA4, 0xFA, 0x50,
+0x4D, 0x94, 0xF9, 0x60, 0x4E, 0x86, 0x2D, 0xD0, 0x4F, 0x77, 0x7E, 0x60, 0x50, 0x68, 0xB2, 0xD0,
+0x51, 0x58, 0xB1, 0xE0, 0x52, 0x49, 0xE6, 0x50, 0x53, 0x39, 0xE5, 0x60, 0x54, 0x2B, 0x19, 0xD0,
+0x55, 0x1B, 0x18, 0xE0, 0x56, 0x0C, 0x4D, 0x50, 0x56, 0xFD, 0x9D, 0xE0, 0x57, 0xEE, 0xD2, 0x50,
+0x58, 0xDE, 0xD1, 0x60, 0x59, 0xD0, 0x05, 0xD0, 0x5A, 0xC0, 0x04, 0xE0, 0x5B, 0xB1, 0x39, 0x50,
+0x5C, 0xA1, 0x38, 0x60, 0x5D, 0x92, 0x6C, 0xD0, 0x5E, 0x83, 0xBD, 0x60, 0x5F, 0x74, 0xF1, 0xD0,
+0x60, 0x64, 0xF0, 0xE0, 0x61, 0x56, 0x25, 0x50, 0x62, 0x46, 0x24, 0x60, 0x63, 0x37, 0x58, 0xD0,
+0x64, 0x27, 0x57, 0xE0, 0x65, 0x18, 0x8C, 0x50, 0x66, 0x09, 0xDC, 0xE0, 0x66, 0xFB, 0x11, 0x50,
+0x67, 0xEB, 0x10, 0x60, 0x68, 0xDC, 0x44, 0xD0, 0x69, 0xCC, 0x43, 0xE0, 0x6A, 0xBD, 0x78, 0x50,
+0x6B, 0xAD, 0x77, 0x60, 0x6C, 0x9E, 0xAB, 0xD0, 0x6D, 0x8F, 0xFC, 0x60, 0x6E, 0x81, 0x30, 0xD0,
+0x6F, 0x71, 0x2F, 0xE0, 0x70, 0x62, 0x64, 0x50, 0x71, 0x52, 0x63, 0x60, 0x72, 0x43, 0x97, 0xD0,
+0x73, 0x33, 0x96, 0xE0, 0x74, 0x24, 0xCB, 0x50, 0x75, 0x16, 0x1B, 0xE0, 0x76, 0x07, 0x50, 0x50,
+0x76, 0xF7, 0x4F, 0x60, 0x77, 0xE8, 0x83, 0xD0, 0x78, 0xD8, 0x82, 0xE0, 0x79, 0xC9, 0xB7, 0x50,
+0x7A, 0xB9, 0xB6, 0x60, 0x7B, 0xAA, 0xEA, 0xD0, 0x7C, 0x9C, 0x3B, 0x60, 0x7D, 0x8D, 0x6F, 0xD0,
+0x7E, 0x7D, 0x6E, 0xE0, 0x7F, 0x6E, 0xA3, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00,
+0x00, 0x22, 0x08, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00,
+0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Dhaka */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0xCA, 0xDB, 0x86, 0xB0,
+0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xDD, 0xA8, 0xD2, 0x98, 0x02, 0x4F, 0x9D, 0x20,
+0x01, 0x02, 0x01, 0x03, 0x04, 0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00,
+0x04, 0x00, 0x00, 0x4D, 0x58, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x00, 0x00, 0x54,
+0x60, 0x00, 0x12, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00,
+0x44, 0x41, 0x43, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Asia/Dili */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x92, 0xE6, 0x18, 0xC4,
+0xCB, 0x99, 0x32, 0xF0, 0xD2, 0x11, 0x0E, 0xF0, 0x0B, 0xEA, 0x30, 0x70, 0x39, 0xC3, 0x99, 0x00,
+0x01, 0x02, 0x03, 0x04, 0x03, 0x00, 0x00, 0x75, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00,
+0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x70,
+0x80, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4C, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43,
+0x49, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Dubai */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0xF2, 0x99, 0xA8,
+0x01, 0x00, 0x00, 0x33, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Dushanbe */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x13, 0xAA, 0x19, 0x83, 0x80,
+0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0,
+0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0,
+0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0,
+0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0,
+0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xCA, 0x8F, 0x50, 0x01, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x06, 0x07, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04,
+0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60,
+0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00,
+0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x44, 0x55, 0x53, 0x54, 0x00, 0x44, 0x55, 0x53,
+0x53, 0x54, 0x00, 0x54, 0x4A, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Gaza */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xC8, 0x59, 0xB2, 0xE0,
+0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0,
+0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, 0xD3, 0x65, 0xB0, 0x80,
+0xD4, 0x6B, 0xE0, 0xD0, 0xE8, 0x36, 0x63, 0x60, 0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60,
+0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xFA, 0xF0, 0xEC, 0xB5, 0x6D, 0x00, 0xED, 0xCF, 0x7F, 0xF0,
+0xEE, 0x97, 0xF2, 0x00, 0xEF, 0xB0, 0xB3, 0x70, 0xF0, 0x79, 0x25, 0x80, 0xF1, 0x91, 0xE6, 0xF0,
+0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x73, 0x1A, 0x70, 0xF4, 0x3B, 0x8C, 0x80, 0xF5, 0x55, 0x9F, 0x70,
+0xF6, 0x1E, 0x11, 0x80, 0xF7, 0x36, 0xD2, 0xF0, 0xF7, 0xFF, 0x45, 0x00, 0xF9, 0x18, 0x06, 0x70,
+0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0, 0xFB, 0x27, 0x42, 0x50, 0x08, 0x7C, 0x8B, 0xE0,
+0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0,
+0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60,
+0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60,
+0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0,
+0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0,
+0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0,
+0x30, 0x48, 0xC5, 0xD0, 0x30, 0xE7, 0x07, 0xE0, 0x31, 0x64, 0x46, 0x60, 0x32, 0x41, 0xC2, 0x60,
+0x33, 0x44, 0x28, 0x60, 0x34, 0x21, 0xA4, 0x60, 0x35, 0x24, 0x0A, 0x60, 0x36, 0x01, 0x86, 0x60,
+0x36, 0x8B, 0xF3, 0xE0, 0x37, 0x16, 0x61, 0x60, 0x38, 0x06, 0x44, 0x50, 0x38, 0xFF, 0x7D, 0xE0,
+0x39, 0xEF, 0x60, 0xD0, 0x3A, 0xDF, 0x5F, 0xE0, 0x3B, 0xCF, 0x42, 0xD0, 0x3C, 0xBF, 0x41, 0xE0,
+0x3D, 0xAF, 0x24, 0xD0, 0x3E, 0x9F, 0x23, 0xE0, 0x3F, 0x8F, 0x06, 0xD0, 0x40, 0x7F, 0x05, 0xE0,
+0x41, 0x6E, 0xE8, 0xD0, 0x42, 0x5E, 0xE7, 0xE0, 0x43, 0x58, 0x05, 0x50, 0x44, 0x48, 0x04, 0x60,
+0x45, 0x37, 0xE7, 0x50, 0x46, 0x27, 0xE6, 0x60, 0x47, 0x17, 0xC9, 0x50, 0x48, 0x07, 0xC8, 0x60,
+0x48, 0xF7, 0xAB, 0x50, 0x49, 0xE7, 0xAA, 0x60, 0x4A, 0xD7, 0x8D, 0x50, 0x4B, 0xC7, 0x8C, 0x60,
+0x4C, 0xB7, 0x6F, 0x50, 0x4D, 0xA7, 0x6E, 0x60, 0x4E, 0xA0, 0x8B, 0xD0, 0x4F, 0x90, 0x8A, 0xE0,
+0x50, 0x80, 0x6D, 0xD0, 0x51, 0x70, 0x6C, 0xE0, 0x52, 0x60, 0x4F, 0xD0, 0x53, 0x50, 0x4E, 0xE0,
+0x54, 0x40, 0x31, 0xD0, 0x55, 0x30, 0x30, 0xE0, 0x56, 0x20, 0x13, 0xD0, 0x57, 0x10, 0x12, 0xE0,
+0x58, 0x09, 0x30, 0x50, 0x58, 0xF9, 0x2F, 0x60, 0x59, 0xE9, 0x12, 0x50, 0x5A, 0xD9, 0x11, 0x60,
+0x5B, 0xC8, 0xF4, 0x50, 0x5C, 0xB8, 0xF3, 0x60, 0x5D, 0xA8, 0xD6, 0x50, 0x5E, 0x98, 0xD5, 0x60,
+0x5F, 0x88, 0xB8, 0x50, 0x60, 0x78, 0xB7, 0x60, 0x61, 0x68, 0x9A, 0x50, 0x62, 0x58, 0x99, 0x60,
+0x63, 0x51, 0xB6, 0xD0, 0x64, 0x41, 0xB5, 0xE0, 0x65, 0x31, 0x98, 0xD0, 0x66, 0x21, 0x97, 0xE0,
+0x67, 0x11, 0x7A, 0xD0, 0x68, 0x01, 0x79, 0xE0, 0x68, 0xF1, 0x5C, 0xD0, 0x69, 0xE1, 0x5B, 0xE0,
+0x6A, 0xD1, 0x3E, 0xD0, 0x6B, 0xC1, 0x3D, 0xE0, 0x6C, 0xB1, 0x20, 0xD0, 0x6D, 0xAA, 0x5A, 0x60,
+0x6E, 0x9A, 0x3D, 0x50, 0x6F, 0x8A, 0x3C, 0x60, 0x70, 0x7A, 0x1F, 0x50, 0x71, 0x6A, 0x1E, 0x60,
+0x72, 0x5A, 0x01, 0x50, 0x73, 0x4A, 0x00, 0x60, 0x74, 0x39, 0xE3, 0x50, 0x75, 0x29, 0xE2, 0x60,
+0x76, 0x19, 0xC5, 0x50, 0x77, 0x09, 0xC4, 0x60, 0x78, 0x02, 0xE1, 0xD0, 0x78, 0xF2, 0xE0, 0xE0,
+0x79, 0xE2, 0xC3, 0xD0, 0x7A, 0xD2, 0xC2, 0xE0, 0x7B, 0xC2, 0xA5, 0xD0, 0x7C, 0xB2, 0xA4, 0xE0,
+0x7D, 0xA2, 0x87, 0xD0, 0x7E, 0x92, 0x86, 0xE0, 0x7F, 0x82, 0x69, 0xD0, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x2A, 0x30,
+0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00,
+0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00,
+0x45, 0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Harbin */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0x95, 0xBC,
+0xB8, 0xD3, 0xCE, 0x78, 0xC7, 0x90, 0xFA, 0x80, 0xF9, 0x17, 0x95, 0xF0, 0x13, 0x6D, 0xB3, 0xF8,
+0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70,
+0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0,
+0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0,
+0x01, 0x02, 0x03, 0x01, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04,
+0x02, 0x00, 0x00, 0x76, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x70,
+0x80, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D, 0x4C,
+0x4D, 0x54, 0x00, 0x43, 0x48, 0x41, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Hong_Kong */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x69, 0x5A, 0xFC,
+0xD3, 0x6A, 0xB7, 0x38, 0xD4, 0x93, 0x4A, 0xA8, 0xD5, 0x42, 0xB0, 0x38, 0xD6, 0x9A, 0xB9, 0xA8,
+0xD7, 0x3E, 0x41, 0xB8, 0xD8, 0x2E, 0x24, 0xA8, 0xD8, 0xF9, 0x39, 0xB8, 0xDA, 0x0E, 0x06, 0xA8,
+0xDA, 0xD9, 0x1B, 0xB8, 0xDB, 0xED, 0xE8, 0xA8, 0xDC, 0xB8, 0xFD, 0xB8, 0xDD, 0xCD, 0xCA, 0xA8,
+0xDE, 0xA2, 0x1A, 0x38, 0xDF, 0xAD, 0xAC, 0xA8, 0xE0, 0x81, 0xFC, 0x38, 0xE1, 0x96, 0xC9, 0x28,
+0xE2, 0x4F, 0x69, 0x38, 0xE3, 0x76, 0xAB, 0x28, 0xE4, 0x2F, 0x4B, 0x38, 0xE5, 0x5F, 0xC7, 0xA8,
+0xE6, 0x0F, 0x2D, 0x38, 0xE7, 0x3F, 0xA9, 0xA8, 0xE7, 0xF8, 0x49, 0xB8, 0xE9, 0x1F, 0x8B, 0xA8,
+0xE9, 0xD8, 0x2B, 0xB8, 0xEA, 0xFF, 0x6D, 0xA8, 0xEB, 0xB8, 0x0D, 0xB8, 0xEC, 0xDF, 0x4F, 0xA8,
+0xED, 0x97, 0xEF, 0xB8, 0xEE, 0xC8, 0x6C, 0x28, 0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28,
+0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, 0xF3, 0x40, 0xD0, 0x38, 0xF4, 0x68, 0x12, 0x28,
+0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, 0xF7, 0x25, 0x7E, 0x38, 0xF8, 0x15, 0x61, 0x28,
+0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, 0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8,
+0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, 0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8,
+0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, 0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8,
+0x04, 0x4D, 0xE6, 0xB8, 0x05, 0x47, 0x04, 0x28, 0x06, 0x37, 0x03, 0x38, 0x07, 0x26, 0xE6, 0x28,
+0x08, 0x16, 0xE5, 0x38, 0x09, 0x06, 0xC8, 0x28, 0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28,
+0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, 0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28,
+0x11, 0x9B, 0x39, 0x38, 0x12, 0x6F, 0x6C, 0xA8, 0x13, 0x7B, 0x1B, 0x38, 0x14, 0x4F, 0x4E, 0xA8,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x6B, 0x04, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01,
+0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x48, 0x4B, 0x53, 0x54, 0x00,
+0x48, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Hovd */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0x86, 0xD3, 0xFC, 0x94,
+0x0F, 0x0B, 0xEA, 0xA0, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90,
+0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0,
+0x1F, 0x7C, 0x2C, 0xB0, 0x20, 0x6C, 0x1D, 0xB0, 0x21, 0x5C, 0x0E, 0xB0, 0x22, 0x4B, 0xFF, 0xB0,
+0x23, 0x3B, 0xF0, 0xB0, 0x24, 0x2B, 0xE1, 0xB0, 0x25, 0x1B, 0xD2, 0xB0, 0x26, 0x0B, 0xC3, 0xB0,
+0x27, 0x04, 0xEF, 0x30, 0x27, 0xF4, 0xE0, 0x30, 0x28, 0xE4, 0xD1, 0x30, 0x29, 0xD4, 0xC2, 0x30,
+0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xA4, 0x30, 0x2C, 0xA4, 0x95, 0x30, 0x2D, 0x94, 0x86, 0x30,
+0x2E, 0x84, 0x77, 0x30, 0x2F, 0x74, 0x68, 0x30, 0x30, 0x64, 0x59, 0x30, 0x31, 0x5D, 0x84, 0xB0,
+0x32, 0x4D, 0x75, 0xB0, 0x33, 0x3D, 0x66, 0xB0, 0x34, 0x2D, 0x57, 0xB0, 0x35, 0x1D, 0x48, 0xB0,
+0x36, 0x0D, 0x39, 0xB0, 0x3A, 0xE9, 0xC1, 0xB0, 0x3B, 0xB4, 0xBA, 0xA0, 0x3C, 0xA4, 0xB9, 0xB0,
+0x3D, 0x94, 0x9C, 0xA0, 0x3E, 0x84, 0x9B, 0xB0, 0x3F, 0x74, 0x7E, 0xA0, 0x40, 0x64, 0x7D, 0xB0,
+0x41, 0x54, 0x60, 0xA0, 0x42, 0x44, 0x5F, 0xB0, 0x43, 0x34, 0x42, 0xA0, 0x44, 0x24, 0x41, 0xB0,
+0x45, 0x1D, 0x5F, 0x20, 0x46, 0x0D, 0x5E, 0x30, 0x46, 0xFD, 0x41, 0x20, 0x47, 0xED, 0x40, 0x30,
+0x48, 0xDD, 0x23, 0x20, 0x49, 0xCD, 0x22, 0x30, 0x4A, 0xBD, 0x05, 0x20, 0x4B, 0xAD, 0x04, 0x30,
+0x4C, 0x9C, 0xE7, 0x20, 0x4D, 0x8C, 0xE6, 0x30, 0x4E, 0x7C, 0xC9, 0x20, 0x4F, 0x76, 0x02, 0xB0,
+0x50, 0x65, 0xE5, 0xA0, 0x51, 0x55, 0xE4, 0xB0, 0x52, 0x45, 0xC7, 0xA0, 0x53, 0x35, 0xC6, 0xB0,
+0x54, 0x25, 0xA9, 0xA0, 0x55, 0x15, 0xA8, 0xB0, 0x56, 0x05, 0x8B, 0xA0, 0x56, 0xF5, 0x8A, 0xB0,
+0x57, 0xE5, 0x6D, 0xA0, 0x58, 0xD5, 0x6C, 0xB0, 0x59, 0xCE, 0x8A, 0x20, 0x5A, 0xBE, 0x89, 0x30,
+0x5B, 0xAE, 0x6C, 0x20, 0x5C, 0x9E, 0x6B, 0x30, 0x5D, 0x8E, 0x4E, 0x20, 0x5E, 0x7E, 0x4D, 0x30,
+0x5F, 0x6E, 0x30, 0x20, 0x60, 0x5E, 0x2F, 0x30, 0x61, 0x4E, 0x12, 0x20, 0x62, 0x3E, 0x11, 0x30,
+0x63, 0x2D, 0xF4, 0x20, 0x64, 0x1D, 0xF3, 0x30, 0x65, 0x17, 0x10, 0xA0, 0x66, 0x07, 0x0F, 0xB0,
+0x66, 0xF6, 0xF2, 0xA0, 0x67, 0xE6, 0xF1, 0xB0, 0x68, 0xD6, 0xD4, 0xA0, 0x69, 0xC6, 0xD3, 0xB0,
+0x6A, 0xB6, 0xB6, 0xA0, 0x6B, 0xA6, 0xB5, 0xB0, 0x6C, 0x96, 0x98, 0xA0, 0x6D, 0x86, 0x97, 0xB0,
+0x6E, 0x7F, 0xB5, 0x20, 0x6F, 0x6F, 0xB4, 0x30, 0x70, 0x5F, 0x97, 0x20, 0x71, 0x4F, 0x96, 0x30,
+0x72, 0x3F, 0x79, 0x20, 0x73, 0x2F, 0x78, 0x30, 0x74, 0x1F, 0x5B, 0x20, 0x75, 0x0F, 0x5A, 0x30,
+0x75, 0xFF, 0x3D, 0x20, 0x76, 0xEF, 0x3C, 0x30, 0x77, 0xDF, 0x1F, 0x20, 0x78, 0xCF, 0x1E, 0x30,
+0x79, 0xC8, 0x3B, 0xA0, 0x7A, 0xB8, 0x3A, 0xB0, 0x7B, 0xA8, 0x1D, 0xA0, 0x7C, 0x98, 0x1C, 0xB0,
+0x7D, 0x87, 0xFF, 0xA0, 0x7E, 0x77, 0xFE, 0xB0, 0x7F, 0x67, 0xE1, 0xA0, 0x01, 0x03, 0x02, 0x03,
+0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x55, 0xEC, 0x00, 0x00, 0x00, 0x00,
+0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04,
+0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x4C, 0x4D, 0x54, 0x00,
+0x48, 0x4F, 0x56, 0x54, 0x00, 0x48, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Irkutsk */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA2, 0x12, 0x0F, 0xB0,
+0xB5, 0xA3, 0xD3, 0x10, 0x15, 0x27, 0x61, 0x80, 0x16, 0x18, 0x95, 0xF0, 0x17, 0x08, 0x95, 0x00,
+0x17, 0xF9, 0xC9, 0x70, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80,
+0x1B, 0xBC, 0x5A, 0xA0, 0x1C, 0xAC, 0x4B, 0xA0, 0x1D, 0x9C, 0x3C, 0xA0, 0x1E, 0x8C, 0x2D, 0xA0,
+0x1F, 0x7C, 0x1E, 0xA0, 0x20, 0x6C, 0x0F, 0xA0, 0x21, 0x5C, 0x00, 0xA0, 0x22, 0x4B, 0xF1, 0xA0,
+0x23, 0x3B, 0xE2, 0xA0, 0x24, 0x2B, 0xD3, 0xA0, 0x25, 0x1B, 0xC4, 0xA0, 0x26, 0x0B, 0xB5, 0xA0,
+0x27, 0x04, 0xE1, 0x20, 0x27, 0xF4, 0xD2, 0x20, 0x28, 0xE4, 0xD1, 0x30, 0x29, 0x78, 0x79, 0x30,
+0x29, 0xD4, 0x89, 0xF0, 0x2A, 0xC4, 0x6C, 0xE0, 0x2B, 0xB4, 0x96, 0x20, 0x2C, 0xA4, 0x87, 0x20,
+0x2D, 0x94, 0x78, 0x20, 0x2E, 0x84, 0x69, 0x20, 0x2F, 0x74, 0x5A, 0x20, 0x30, 0x64, 0x4B, 0x20,
+0x31, 0x5D, 0x76, 0xA0, 0x32, 0x72, 0x51, 0xA0, 0x33, 0x3D, 0x58, 0xA0, 0x34, 0x52, 0x33, 0xA0,
+0x35, 0x1D, 0x3A, 0xA0, 0x36, 0x32, 0x15, 0xA0, 0x36, 0xFD, 0x1C, 0xA0, 0x38, 0x1B, 0x32, 0x20,
+0x38, 0xDC, 0xFE, 0xA0, 0x39, 0xFB, 0x14, 0x20, 0x3A, 0xBC, 0xE0, 0xA0, 0x3B, 0xDA, 0xF6, 0x20,
+0x3C, 0xA5, 0xFD, 0x20, 0x3D, 0xBA, 0xD8, 0x20, 0x3E, 0x85, 0xDF, 0x20, 0x3F, 0x9A, 0xBA, 0x20,
+0x40, 0x65, 0xC1, 0x20, 0x41, 0x83, 0xD6, 0xA0, 0x42, 0x45, 0xA3, 0x20, 0x43, 0x63, 0xB8, 0xA0,
+0x44, 0x25, 0x85, 0x20, 0x45, 0x43, 0x9A, 0xA0, 0x46, 0x05, 0x67, 0x20, 0x47, 0x23, 0x7C, 0xA0,
+0x47, 0xEE, 0x83, 0xA0, 0x49, 0x03, 0x5E, 0xA0, 0x49, 0xCE, 0x65, 0xA0, 0x4A, 0xE3, 0x40, 0xA0,
+0x4B, 0xAE, 0x47, 0xA0, 0x4C, 0xCC, 0x5D, 0x20, 0x4D, 0x8E, 0x29, 0xA0, 0x4E, 0xAC, 0x3F, 0x20,
+0x4F, 0x6E, 0x0B, 0xA0, 0x50, 0x8C, 0x21, 0x20, 0x51, 0x57, 0x28, 0x20, 0x52, 0x6C, 0x03, 0x20,
+0x53, 0x37, 0x0A, 0x20, 0x54, 0x4B, 0xE5, 0x20, 0x55, 0x16, 0xEC, 0x20, 0x56, 0x2B, 0xC7, 0x20,
+0x56, 0xF6, 0xCE, 0x20, 0x58, 0x14, 0xE3, 0xA0, 0x58, 0xD6, 0xB0, 0x20, 0x59, 0xF4, 0xC5, 0xA0,
+0x5A, 0xB6, 0x92, 0x20, 0x5B, 0xD4, 0xA7, 0xA0, 0x5C, 0x9F, 0xAE, 0xA0, 0x5D, 0xB4, 0x89, 0xA0,
+0x5E, 0x7F, 0x90, 0xA0, 0x5F, 0x94, 0x6B, 0xA0, 0x60, 0x5F, 0x72, 0xA0, 0x61, 0x7D, 0x88, 0x20,
+0x62, 0x3F, 0x54, 0xA0, 0x63, 0x5D, 0x6A, 0x20, 0x64, 0x1F, 0x36, 0xA0, 0x65, 0x3D, 0x4C, 0x20,
+0x66, 0x08, 0x53, 0x20, 0x67, 0x1D, 0x2E, 0x20, 0x67, 0xE8, 0x35, 0x20, 0x68, 0xFD, 0x10, 0x20,
+0x69, 0xC8, 0x17, 0x20, 0x6A, 0xDC, 0xF2, 0x20, 0x6B, 0xA7, 0xF9, 0x20, 0x6C, 0xC6, 0x0E, 0xA0,
+0x6D, 0x87, 0xDB, 0x20, 0x6E, 0xA5, 0xF0, 0xA0, 0x6F, 0x67, 0xBD, 0x20, 0x70, 0x85, 0xD2, 0xA0,
+0x71, 0x50, 0xD9, 0xA0, 0x72, 0x65, 0xB4, 0xA0, 0x73, 0x30, 0xBB, 0xA0, 0x74, 0x45, 0x96, 0xA0,
+0x75, 0x10, 0x9D, 0xA0, 0x76, 0x2E, 0xB3, 0x20, 0x76, 0xF0, 0x7F, 0xA0, 0x78, 0x0E, 0x95, 0x20,
+0x78, 0xD0, 0x61, 0xA0, 0x79, 0xEE, 0x77, 0x20, 0x7A, 0xB0, 0x43, 0xA0, 0x7B, 0xCE, 0x59, 0x20,
+0x7C, 0x99, 0x60, 0x20, 0x7D, 0xAE, 0x3B, 0x20, 0x7E, 0x79, 0x42, 0x20, 0x7F, 0x8E, 0x1D, 0x20,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x61, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00,
+0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x70,
+0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00,
+0x00, 0x62, 0x70, 0x00, 0x04, 0x49, 0x4D, 0x54, 0x00, 0x49, 0x52, 0x4B, 0x54, 0x00, 0x49, 0x52,
+0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Istanbul */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x90, 0x8B, 0xF5, 0x98,
+0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xBE, 0xD0, 0xA2, 0x65, 0x63, 0xE0, 0xA3, 0x7B, 0x82, 0x50,
+0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, 0xA7, 0x27, 0x7F, 0xD0,
+0xAA, 0x28, 0x28, 0x60, 0xAA, 0xE1, 0xFD, 0xD0, 0xAB, 0xF9, 0x89, 0xE0, 0xAC, 0xC3, 0x31, 0x50,
+0xC8, 0x7F, 0xEE, 0x60, 0xC8, 0xFF, 0xC1, 0xD0, 0xC9, 0x4A, 0xF5, 0x60, 0xCA, 0xCE, 0x80, 0x50,
+0xCB, 0xCB, 0xAE, 0x60, 0xCC, 0xE5, 0xC1, 0x50, 0xD1, 0x71, 0xEB, 0xE0, 0xD2, 0x6B, 0x09, 0x50,
+0xD3, 0xA2, 0x39, 0x60, 0xD4, 0x43, 0x02, 0x50, 0xD5, 0x4C, 0x0D, 0xE0, 0xD6, 0x29, 0x7B, 0xD0,
+0xD7, 0x2B, 0xEF, 0xE0, 0xD8, 0x09, 0x5D, 0xD0, 0xD9, 0x02, 0x97, 0x60, 0xD9, 0xE9, 0x3F, 0xD0,
+0xDA, 0xEF, 0xA8, 0x60, 0xDB, 0xD2, 0x5C, 0x50, 0xDC, 0xD4, 0xD0, 0x60, 0xDD, 0xB3, 0x8F, 0xD0,
+0xF1, 0xF4, 0xB9, 0x60, 0xF2, 0x64, 0xBA, 0xD0, 0xF5, 0x68, 0x06, 0x60, 0xF6, 0x1F, 0x38, 0xD0,
+0x00, 0xA0, 0xBA, 0xE0, 0x01, 0x6B, 0xB3, 0xD0, 0x02, 0x80, 0x9C, 0xE0, 0x03, 0x4B, 0x95, 0xD0,
+0x04, 0x69, 0xB9, 0x60, 0x05, 0x34, 0xB2, 0x50, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x39, 0xA8, 0x80,
+0x07, 0xFB, 0x75, 0x00, 0x09, 0x19, 0xA6, 0xA0, 0x09, 0xDB, 0x3A, 0xE0, 0x0A, 0xF0, 0x07, 0xD0,
+0x0C, 0x10, 0xCE, 0x60, 0x0C, 0xD9, 0x24, 0x50, 0x0D, 0xA4, 0x39, 0x60, 0x0E, 0xA6, 0x91, 0x50,
+0x0F, 0x84, 0x1B, 0x60, 0x10, 0x86, 0x73, 0x50, 0x12, 0x67, 0x98, 0xC0, 0x13, 0x4D, 0x36, 0x00,
+0x14, 0x47, 0x7A, 0xC0, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x27, 0x5C, 0xC0, 0x17, 0x03, 0xBF, 0x80,
+0x18, 0x07, 0x3E, 0xC0, 0x19, 0x89, 0x94, 0x50, 0x19, 0xDC, 0x94, 0xC0, 0x1C, 0xC6, 0xD3, 0xD0,
+0x1D, 0x9B, 0x15, 0x50, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00,
+0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00,
+0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0x7F, 0xB4, 0xE0,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x00, 0x00, 0x1B, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00,
+0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00,
+0x12, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A,
+0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x49, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53,
+0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x54, 0x52, 0x53, 0x54, 0x00, 0x54, 0x52, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01,
+
+/* Asia/Jakarta */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xA9, 0x78, 0x85, 0xE0,
+0xBA, 0x16, 0xDE, 0x60, 0xCB, 0xBF, 0x83, 0x88, 0xD2, 0x11, 0x0E, 0xF0, 0xD7, 0x3C, 0xC6, 0x08,
+0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x01, 0x02, 0x03, 0x02, 0x04, 0x02, 0x05, 0x00,
+0x00, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00,
+0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x00, 0x00, 0x62,
+0x70, 0x00, 0x09, 0x4A, 0x4D, 0x54, 0x00, 0x4A, 0x41, 0x56, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00,
+0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Asia/Jayapura */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xBA, 0x16, 0xC1, 0x98,
+0xCF, 0x17, 0x0B, 0xF0, 0xF4, 0xB5, 0xA2, 0x68, 0x01, 0x02, 0x01, 0x00, 0x00, 0x83, 0xE8, 0x00,
+0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x00, 0x08, 0x4C, 0x4D, 0x54,
+0x00, 0x45, 0x49, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Jerusalem */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x9E, 0x30, 0x45, 0x88,
+0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0,
+0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70,
+0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xD7, 0x5A, 0x14, 0x60, 0xD7, 0xDF, 0x1F, 0xC0,
+0xD8, 0x2F, 0xB5, 0x70, 0xD9, 0x1E, 0x46, 0xE0, 0xDA, 0x10, 0xE8, 0xF0, 0xDA, 0xEB, 0xB3, 0xE0,
+0xDB, 0xB4, 0x34, 0x00, 0xDC, 0xB9, 0x20, 0xE0, 0xDD, 0xE0, 0x8D, 0x00, 0xDE, 0xB4, 0xCE, 0x80,
+0xDF, 0xA4, 0xBF, 0x80, 0xE0, 0x8B, 0x76, 0x00, 0xE1, 0x56, 0x7D, 0x00, 0xE2, 0xBE, 0x4A, 0x60,
+0xE3, 0x36, 0x34, 0xD0, 0xE4, 0x9C, 0xF7, 0x00, 0xE5, 0x16, 0x16, 0xD0, 0xE6, 0x74, 0xD3, 0xE0,
+0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0,
+0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0,
+0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60,
+0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60,
+0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0,
+0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0,
+0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0,
+0x30, 0x48, 0xC5, 0xD0, 0x31, 0x48, 0x96, 0xE0, 0x32, 0x3C, 0x6E, 0x50, 0x33, 0x31, 0xB3, 0x60,
+0x34, 0x1A, 0xFE, 0xD0, 0x35, 0x11, 0x95, 0x60, 0x35, 0xF1, 0xA6, 0x50, 0x37, 0x04, 0x08, 0x80,
+0x37, 0xCF, 0x01, 0x70, 0x38, 0xF6, 0x5F, 0x80, 0x39, 0xDC, 0xF9, 0xE0, 0x3A, 0xD0, 0xED, 0x70,
+0x3B, 0xAE, 0x5B, 0x60, 0x3C, 0xA3, 0xA0, 0x70, 0x3D, 0xA0, 0xB2, 0x60, 0x3E, 0x83, 0x82, 0x70,
+0x3F, 0x7C, 0x9F, 0xE0, 0x40, 0x73, 0x36, 0x70, 0x41, 0x50, 0xA4, 0x60, 0x42, 0x4C, 0x8F, 0x00,
+0x43, 0x48, 0x4F, 0x70, 0x44, 0x2C, 0x71, 0x00, 0x45, 0x1E, 0xF6, 0xF0, 0x46, 0x0C, 0x53, 0x00,
+0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00,
+0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80,
+0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80,
+0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80,
+0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00,
+0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00,
+0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00,
+0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80,
+0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80,
+0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80,
+0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00,
+0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00,
+0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80,
+0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80,
+0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80,
+0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00,
+0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44,
+0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Asia/Kabul */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0xD0, 0xF9, 0xD7, 0x40,
+0x01, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x48, 0x00, 0x00, 0x41, 0x46, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Kamchatka */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA7, 0x52, 0x96, 0xC4,
+0xB5, 0xA3, 0x9A, 0xD0, 0x15, 0x27, 0x29, 0x40, 0x16, 0x18, 0x5D, 0xB0, 0x17, 0x08, 0x5C, 0xC0,
+0x17, 0xF9, 0x91, 0x30, 0x18, 0xE9, 0x90, 0x40, 0x19, 0xDA, 0xC4, 0xB0, 0x1A, 0xCC, 0x15, 0x40,
+0x1B, 0xBC, 0x22, 0x60, 0x1C, 0xAC, 0x13, 0x60, 0x1D, 0x9C, 0x04, 0x60, 0x1E, 0x8B, 0xF5, 0x60,
+0x1F, 0x7B, 0xE6, 0x60, 0x20, 0x6B, 0xD7, 0x60, 0x21, 0x5B, 0xC8, 0x60, 0x22, 0x4B, 0xB9, 0x60,
+0x23, 0x3B, 0xAA, 0x60, 0x24, 0x2B, 0x9B, 0x60, 0x25, 0x1B, 0x8C, 0x60, 0x26, 0x0B, 0x7D, 0x60,
+0x27, 0x04, 0xA8, 0xE0, 0x27, 0xF4, 0x99, 0xE0, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0x78, 0x40, 0xF0,
+0x29, 0xD4, 0x51, 0xB0, 0x2A, 0xC4, 0x34, 0xA0, 0x2B, 0xB4, 0x5D, 0xE0, 0x2C, 0xA4, 0x4E, 0xE0,
+0x2D, 0x94, 0x3F, 0xE0, 0x2E, 0x84, 0x30, 0xE0, 0x2F, 0x74, 0x21, 0xE0, 0x30, 0x64, 0x12, 0xE0,
+0x31, 0x5D, 0x3E, 0x60, 0x32, 0x72, 0x19, 0x60, 0x33, 0x3D, 0x20, 0x60, 0x34, 0x51, 0xFB, 0x60,
+0x35, 0x1D, 0x02, 0x60, 0x36, 0x31, 0xDD, 0x60, 0x36, 0xFC, 0xE4, 0x60, 0x38, 0x1A, 0xF9, 0xE0,
+0x38, 0xDC, 0xC6, 0x60, 0x39, 0xFA, 0xDB, 0xE0, 0x3A, 0xBC, 0xA8, 0x60, 0x3B, 0xDA, 0xBD, 0xE0,
+0x3C, 0xA5, 0xC4, 0xE0, 0x3D, 0xBA, 0x9F, 0xE0, 0x3E, 0x85, 0xA6, 0xE0, 0x3F, 0x9A, 0x81, 0xE0,
+0x40, 0x65, 0x88, 0xE0, 0x41, 0x83, 0x9E, 0x60, 0x42, 0x45, 0x6A, 0xE0, 0x43, 0x63, 0x80, 0x60,
+0x44, 0x25, 0x4C, 0xE0, 0x45, 0x43, 0x62, 0x60, 0x46, 0x05, 0x2E, 0xE0, 0x47, 0x23, 0x44, 0x60,
+0x47, 0xEE, 0x4B, 0x60, 0x49, 0x03, 0x26, 0x60, 0x49, 0xCE, 0x2D, 0x60, 0x4A, 0xE3, 0x08, 0x60,
+0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xCC, 0x24, 0xE0, 0x4D, 0x8D, 0xF1, 0x60, 0x4E, 0xAC, 0x06, 0xE0,
+0x4F, 0x6D, 0xD3, 0x60, 0x50, 0x8B, 0xE8, 0xE0, 0x51, 0x56, 0xEF, 0xE0, 0x52, 0x6B, 0xCA, 0xE0,
+0x53, 0x36, 0xD1, 0xE0, 0x54, 0x4B, 0xAC, 0xE0, 0x55, 0x16, 0xB3, 0xE0, 0x56, 0x2B, 0x8E, 0xE0,
+0x56, 0xF6, 0x95, 0xE0, 0x58, 0x14, 0xAB, 0x60, 0x58, 0xD6, 0x77, 0xE0, 0x59, 0xF4, 0x8D, 0x60,
+0x5A, 0xB6, 0x59, 0xE0, 0x5B, 0xD4, 0x6F, 0x60, 0x5C, 0x9F, 0x76, 0x60, 0x5D, 0xB4, 0x51, 0x60,
+0x5E, 0x7F, 0x58, 0x60, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x5F, 0x3A, 0x60, 0x61, 0x7D, 0x4F, 0xE0,
+0x62, 0x3F, 0x1C, 0x60, 0x63, 0x5D, 0x31, 0xE0, 0x64, 0x1E, 0xFE, 0x60, 0x65, 0x3D, 0x13, 0xE0,
+0x66, 0x08, 0x1A, 0xE0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0xE7, 0xFC, 0xE0, 0x68, 0xFC, 0xD7, 0xE0,
+0x69, 0xC7, 0xDE, 0xE0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0xA7, 0xC0, 0xE0, 0x6C, 0xC5, 0xD6, 0x60,
+0x6D, 0x87, 0xA2, 0xE0, 0x6E, 0xA5, 0xB8, 0x60, 0x6F, 0x67, 0x84, 0xE0, 0x70, 0x85, 0x9A, 0x60,
+0x71, 0x50, 0xA1, 0x60, 0x72, 0x65, 0x7C, 0x60, 0x73, 0x30, 0x83, 0x60, 0x74, 0x45, 0x5E, 0x60,
+0x75, 0x10, 0x65, 0x60, 0x76, 0x2E, 0x7A, 0xE0, 0x76, 0xF0, 0x47, 0x60, 0x78, 0x0E, 0x5C, 0xE0,
+0x78, 0xD0, 0x29, 0x60, 0x79, 0xEE, 0x3E, 0xE0, 0x7A, 0xB0, 0x0B, 0x60, 0x7B, 0xCE, 0x20, 0xE0,
+0x7C, 0x99, 0x27, 0xE0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x79, 0x09, 0xE0, 0x7F, 0x8D, 0xE4, 0xE0,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x94, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00,
+0x04, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x09, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x04, 0x00, 0x00, 0xA8,
+0xC0, 0x00, 0x04, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x09, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00,
+0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x45, 0x54, 0x54, 0x00, 0x50, 0x45,
+0x54, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Karachi */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x89, 0x7E, 0xFC, 0xA4,
+0xCC, 0x95, 0x32, 0xA8, 0xD2, 0x74, 0x12, 0x98, 0xDD, 0xA8, 0xE0, 0xA8, 0x02, 0x4F, 0xAB, 0x30,
+0x3C, 0xAF, 0x45, 0xEC, 0x3D, 0x9F, 0x28, 0xDC, 0x01, 0x02, 0x01, 0x03, 0x05, 0x04, 0x05, 0x00,
+0x00, 0x3E, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58, 0x00, 0x04, 0x00, 0x00, 0x5B, 0x68, 0x01,
+0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x08, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0D, 0x00, 0x00, 0x46,
+0x50, 0x00, 0x12, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x4B, 0x41, 0x52, 0x54, 0x00,
+0x50, 0x4B, 0x53, 0x54, 0x00, 0x50, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Kashgar */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xC5, 0x44,
+0xC7, 0x91, 0x1D, 0xA8, 0x13, 0x6D, 0xE5, 0x30, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70,
+0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70,
+0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0,
+0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x47, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x4D,
+0x58, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00,
+0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x41, 0x53, 0x54, 0x00, 0x43, 0x44,
+0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Asia/Katmandu */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA1, 0xF2, 0x7D, 0x84,
+0x1E, 0x18, 0x30, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x4F, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58,
+0x00, 0x04, 0x00, 0x00, 0x50, 0xDC, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00,
+0x4E, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Krasnoyarsk */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xF9, 0x0D, 0xF8,
+0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10,
+0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90,
+0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0,
+0x1F, 0x7C, 0x2C, 0xB0, 0x20, 0x6C, 0x1D, 0xB0, 0x21, 0x5C, 0x0E, 0xB0, 0x22, 0x4B, 0xFF, 0xB0,
+0x23, 0x3B, 0xF0, 0xB0, 0x24, 0x2B, 0xE1, 0xB0, 0x25, 0x1B, 0xD2, 0xB0, 0x26, 0x0B, 0xC3, 0xB0,
+0x27, 0x04, 0xEF, 0x30, 0x27, 0xF4, 0xE0, 0x30, 0x28, 0xE4, 0xDF, 0x40, 0x29, 0x78, 0x87, 0x40,
+0x29, 0xD4, 0x98, 0x00, 0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0xA4, 0x30, 0x2C, 0xA4, 0x95, 0x30,
+0x2D, 0x94, 0x86, 0x30, 0x2E, 0x84, 0x77, 0x30, 0x2F, 0x74, 0x68, 0x30, 0x30, 0x64, 0x59, 0x30,
+0x31, 0x5D, 0x84, 0xB0, 0x32, 0x72, 0x5F, 0xB0, 0x33, 0x3D, 0x66, 0xB0, 0x34, 0x52, 0x41, 0xB0,
+0x35, 0x1D, 0x48, 0xB0, 0x36, 0x32, 0x23, 0xB0, 0x36, 0xFD, 0x2A, 0xB0, 0x38, 0x1B, 0x40, 0x30,
+0x38, 0xDD, 0x0C, 0xB0, 0x39, 0xFB, 0x22, 0x30, 0x3A, 0xBC, 0xEE, 0xB0, 0x3B, 0xDB, 0x04, 0x30,
+0x3C, 0xA6, 0x0B, 0x30, 0x3D, 0xBA, 0xE6, 0x30, 0x3E, 0x85, 0xED, 0x30, 0x3F, 0x9A, 0xC8, 0x30,
+0x40, 0x65, 0xCF, 0x30, 0x41, 0x83, 0xE4, 0xB0, 0x42, 0x45, 0xB1, 0x30, 0x43, 0x63, 0xC6, 0xB0,
+0x44, 0x25, 0x93, 0x30, 0x45, 0x43, 0xA8, 0xB0, 0x46, 0x05, 0x75, 0x30, 0x47, 0x23, 0x8A, 0xB0,
+0x47, 0xEE, 0x91, 0xB0, 0x49, 0x03, 0x6C, 0xB0, 0x49, 0xCE, 0x73, 0xB0, 0x4A, 0xE3, 0x4E, 0xB0,
+0x4B, 0xAE, 0x55, 0xB0, 0x4C, 0xCC, 0x6B, 0x30, 0x4D, 0x8E, 0x37, 0xB0, 0x4E, 0xAC, 0x4D, 0x30,
+0x4F, 0x6E, 0x19, 0xB0, 0x50, 0x8C, 0x2F, 0x30, 0x51, 0x57, 0x36, 0x30, 0x52, 0x6C, 0x11, 0x30,
+0x53, 0x37, 0x18, 0x30, 0x54, 0x4B, 0xF3, 0x30, 0x55, 0x16, 0xFA, 0x30, 0x56, 0x2B, 0xD5, 0x30,
+0x56, 0xF6, 0xDC, 0x30, 0x58, 0x14, 0xF1, 0xB0, 0x58, 0xD6, 0xBE, 0x30, 0x59, 0xF4, 0xD3, 0xB0,
+0x5A, 0xB6, 0xA0, 0x30, 0x5B, 0xD4, 0xB5, 0xB0, 0x5C, 0x9F, 0xBC, 0xB0, 0x5D, 0xB4, 0x97, 0xB0,
+0x5E, 0x7F, 0x9E, 0xB0, 0x5F, 0x94, 0x79, 0xB0, 0x60, 0x5F, 0x80, 0xB0, 0x61, 0x7D, 0x96, 0x30,
+0x62, 0x3F, 0x62, 0xB0, 0x63, 0x5D, 0x78, 0x30, 0x64, 0x1F, 0x44, 0xB0, 0x65, 0x3D, 0x5A, 0x30,
+0x66, 0x08, 0x61, 0x30, 0x67, 0x1D, 0x3C, 0x30, 0x67, 0xE8, 0x43, 0x30, 0x68, 0xFD, 0x1E, 0x30,
+0x69, 0xC8, 0x25, 0x30, 0x6A, 0xDD, 0x00, 0x30, 0x6B, 0xA8, 0x07, 0x30, 0x6C, 0xC6, 0x1C, 0xB0,
+0x6D, 0x87, 0xE9, 0x30, 0x6E, 0xA5, 0xFE, 0xB0, 0x6F, 0x67, 0xCB, 0x30, 0x70, 0x85, 0xE0, 0xB0,
+0x71, 0x50, 0xE7, 0xB0, 0x72, 0x65, 0xC2, 0xB0, 0x73, 0x30, 0xC9, 0xB0, 0x74, 0x45, 0xA4, 0xB0,
+0x75, 0x10, 0xAB, 0xB0, 0x76, 0x2E, 0xC1, 0x30, 0x76, 0xF0, 0x8D, 0xB0, 0x78, 0x0E, 0xA3, 0x30,
+0x78, 0xD0, 0x6F, 0xB0, 0x79, 0xEE, 0x85, 0x30, 0x7A, 0xB0, 0x51, 0xB0, 0x7B, 0xCE, 0x67, 0x30,
+0x7C, 0x99, 0x6E, 0x30, 0x7D, 0xAE, 0x49, 0x30, 0x7E, 0x79, 0x50, 0x30, 0x7F, 0x8E, 0x2B, 0x30,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x57, 0x08, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00,
+0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x62,
+0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00,
+0x00, 0x54, 0x60, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52,
+0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Kuala_Lumpur */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x86, 0x83, 0x85, 0xA3,
+0xBA, 0x67, 0x4E, 0x90, 0xC0, 0x0A, 0xE4, 0x60, 0xCA, 0xB3, 0xE5, 0x60, 0xCB, 0x91, 0x5F, 0x08,
+0xD2, 0x48, 0x6D, 0xF0, 0x16, 0x91, 0xF5, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x06, 0x00,
+0x00, 0x61, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x67, 0x20, 0x01,
+0x09, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00, 0x04, 0x00, 0x00, 0x7E,
+0x90, 0x00, 0x0F, 0x00, 0x00, 0x70, 0x80, 0x00, 0x13, 0x53, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x4C,
+0x54, 0x00, 0x4D, 0x41, 0x4C, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4D, 0x59, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Kuching */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0xAD, 0x8A, 0x06, 0x90,
+0xBA, 0x67, 0x47, 0x88, 0xBF, 0x7B, 0x27, 0x80, 0xBF, 0xF3, 0x1B, 0x50, 0xC1, 0x5D, 0xAC, 0x80,
+0xC1, 0xD5, 0xA0, 0x50, 0xC3, 0x3E, 0xE0, 0x00, 0xC3, 0xB6, 0xD3, 0xD0, 0xC5, 0x20, 0x13, 0x80,
+0xC5, 0x98, 0x07, 0x50, 0xC7, 0x01, 0x47, 0x00, 0xC7, 0x79, 0x3A, 0xD0, 0xC8, 0xE3, 0xCC, 0x00,
+0xC9, 0x5B, 0xBF, 0xD0, 0xCA, 0xC4, 0xFF, 0x80, 0xCB, 0x3C, 0xF3, 0x50, 0xCB, 0x91, 0x58, 0x00,
+0xD2, 0x48, 0x6D, 0xF0, 0x16, 0x91, 0xEE, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x04, 0x03, 0x05, 0x00, 0x00, 0x67, 0x70, 0x00,
+0x00, 0x00, 0x00, 0x69, 0x78, 0x00, 0x04, 0x00, 0x00, 0x75, 0x30, 0x01, 0x09, 0x00, 0x00, 0x70,
+0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x10, 0x00, 0x00, 0x70, 0x80, 0x00, 0x14, 0x4C,
+0x4D, 0x54, 0x00, 0x42, 0x4F, 0x52, 0x54, 0x00, 0x42, 0x4F, 0x52, 0x54, 0x53, 0x54, 0x00, 0x4A,
+0x53, 0x54, 0x00, 0x4D, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Asia/Kuwait */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x35, 0x84,
+0x01, 0x00, 0x00, 0x2C, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Macao */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x92, 0xE6, 0x24, 0x04,
+0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, 0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28,
+0xF3, 0x37, 0x64, 0x80, 0xF4, 0x68, 0x12, 0x28, 0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28,
+0xF7, 0x00, 0x63, 0x00, 0xF8, 0x27, 0xA4, 0xF0, 0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28,
+0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, 0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8,
+0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, 0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8,
+0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, 0x04, 0x4D, 0xB5, 0x80, 0x05, 0x3D, 0x98, 0x70,
+0x06, 0x2D, 0x97, 0x80, 0x07, 0x26, 0xB4, 0xF0, 0x08, 0x16, 0xB4, 0x00, 0x09, 0x06, 0xC8, 0x28,
+0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, 0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28,
+0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, 0x0F, 0x96, 0x3C, 0x00, 0x10, 0x86, 0x1E, 0xF0,
+0x11, 0x76, 0x1E, 0x00, 0x12, 0x6F, 0x3B, 0x70, 0x13, 0x5F, 0x3A, 0x80, 0x14, 0x4F, 0x1D, 0x70,
+0x38, 0x5D, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00,
+0x6A, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09,
+0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4F, 0x53, 0x54, 0x00, 0x4D,
+0x4F, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Macau */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x92, 0xE6, 0x24, 0x04,
+0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, 0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28,
+0xF3, 0x37, 0x64, 0x80, 0xF4, 0x68, 0x12, 0x28, 0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28,
+0xF7, 0x00, 0x63, 0x00, 0xF8, 0x27, 0xA4, 0xF0, 0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28,
+0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, 0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8,
+0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, 0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8,
+0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, 0x04, 0x4D, 0xB5, 0x80, 0x05, 0x3D, 0x98, 0x70,
+0x06, 0x2D, 0x97, 0x80, 0x07, 0x26, 0xB4, 0xF0, 0x08, 0x16, 0xB4, 0x00, 0x09, 0x06, 0xC8, 0x28,
+0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, 0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28,
+0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, 0x0F, 0x96, 0x3C, 0x00, 0x10, 0x86, 0x1E, 0xF0,
+0x11, 0x76, 0x1E, 0x00, 0x12, 0x6F, 0x3B, 0x70, 0x13, 0x5F, 0x3A, 0x80, 0x14, 0x4F, 0x1D, 0x70,
+0x38, 0x5D, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00,
+0x6A, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09,
+0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4F, 0x53, 0x54, 0x00, 0x4D,
+0x4F, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Magadan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xAA, 0x19, 0x36, 0xA0,
+0xB5, 0xA3, 0xA8, 0xE0, 0x15, 0x27, 0x37, 0x50, 0x16, 0x18, 0x6B, 0xC0, 0x17, 0x08, 0x6A, 0xD0,
+0x17, 0xF9, 0x9F, 0x40, 0x18, 0xE9, 0x9E, 0x50, 0x19, 0xDA, 0xD2, 0xC0, 0x1A, 0xCC, 0x23, 0x50,
+0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x21, 0x70, 0x1D, 0x9C, 0x12, 0x70, 0x1E, 0x8C, 0x03, 0x70,
+0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xE5, 0x70, 0x21, 0x5B, 0xD6, 0x70, 0x22, 0x4B, 0xC7, 0x70,
+0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xA9, 0x70, 0x25, 0x1B, 0x9A, 0x70, 0x26, 0x0B, 0x8B, 0x70,
+0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xA7, 0xF0, 0x28, 0xE4, 0xA7, 0x00, 0x29, 0x78, 0x4F, 0x00,
+0x29, 0xD4, 0x5F, 0xC0, 0x2A, 0xC4, 0x42, 0xB0, 0x2B, 0xB4, 0x6B, 0xF0, 0x2C, 0xA4, 0x5C, 0xF0,
+0x2D, 0x94, 0x4D, 0xF0, 0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x2F, 0xF0, 0x30, 0x64, 0x20, 0xF0,
+0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x27, 0x70, 0x33, 0x3D, 0x2E, 0x70, 0x34, 0x52, 0x09, 0x70,
+0x35, 0x1D, 0x10, 0x70, 0x36, 0x31, 0xEB, 0x70, 0x36, 0xFC, 0xF2, 0x70, 0x38, 0x1B, 0x07, 0xF0,
+0x38, 0xDC, 0xD4, 0x70, 0x39, 0xFA, 0xE9, 0xF0, 0x3A, 0xBC, 0xB6, 0x70, 0x3B, 0xDA, 0xCB, 0xF0,
+0x3C, 0xA5, 0xD2, 0xF0, 0x3D, 0xBA, 0xAD, 0xF0, 0x3E, 0x85, 0xB4, 0xF0, 0x3F, 0x9A, 0x8F, 0xF0,
+0x40, 0x65, 0x96, 0xF0, 0x41, 0x83, 0xAC, 0x70, 0x42, 0x45, 0x78, 0xF0, 0x43, 0x63, 0x8E, 0x70,
+0x44, 0x25, 0x5A, 0xF0, 0x45, 0x43, 0x70, 0x70, 0x46, 0x05, 0x3C, 0xF0, 0x47, 0x23, 0x52, 0x70,
+0x47, 0xEE, 0x59, 0x70, 0x49, 0x03, 0x34, 0x70, 0x49, 0xCE, 0x3B, 0x70, 0x4A, 0xE3, 0x16, 0x70,
+0x4B, 0xAE, 0x1D, 0x70, 0x4C, 0xCC, 0x32, 0xF0, 0x4D, 0x8D, 0xFF, 0x70, 0x4E, 0xAC, 0x14, 0xF0,
+0x4F, 0x6D, 0xE1, 0x70, 0x50, 0x8B, 0xF6, 0xF0, 0x51, 0x56, 0xFD, 0xF0, 0x52, 0x6B, 0xD8, 0xF0,
+0x53, 0x36, 0xDF, 0xF0, 0x54, 0x4B, 0xBA, 0xF0, 0x55, 0x16, 0xC1, 0xF0, 0x56, 0x2B, 0x9C, 0xF0,
+0x56, 0xF6, 0xA3, 0xF0, 0x58, 0x14, 0xB9, 0x70, 0x58, 0xD6, 0x85, 0xF0, 0x59, 0xF4, 0x9B, 0x70,
+0x5A, 0xB6, 0x67, 0xF0, 0x5B, 0xD4, 0x7D, 0x70, 0x5C, 0x9F, 0x84, 0x70, 0x5D, 0xB4, 0x5F, 0x70,
+0x5E, 0x7F, 0x66, 0x70, 0x5F, 0x94, 0x41, 0x70, 0x60, 0x5F, 0x48, 0x70, 0x61, 0x7D, 0x5D, 0xF0,
+0x62, 0x3F, 0x2A, 0x70, 0x63, 0x5D, 0x3F, 0xF0, 0x64, 0x1F, 0x0C, 0x70, 0x65, 0x3D, 0x21, 0xF0,
+0x66, 0x08, 0x28, 0xF0, 0x67, 0x1D, 0x03, 0xF0, 0x67, 0xE8, 0x0A, 0xF0, 0x68, 0xFC, 0xE5, 0xF0,
+0x69, 0xC7, 0xEC, 0xF0, 0x6A, 0xDC, 0xC7, 0xF0, 0x6B, 0xA7, 0xCE, 0xF0, 0x6C, 0xC5, 0xE4, 0x70,
+0x6D, 0x87, 0xB0, 0xF0, 0x6E, 0xA5, 0xC6, 0x70, 0x6F, 0x67, 0x92, 0xF0, 0x70, 0x85, 0xA8, 0x70,
+0x71, 0x50, 0xAF, 0x70, 0x72, 0x65, 0x8A, 0x70, 0x73, 0x30, 0x91, 0x70, 0x74, 0x45, 0x6C, 0x70,
+0x75, 0x10, 0x73, 0x70, 0x76, 0x2E, 0x88, 0xF0, 0x76, 0xF0, 0x55, 0x70, 0x78, 0x0E, 0x6A, 0xF0,
+0x78, 0xD0, 0x37, 0x70, 0x79, 0xEE, 0x4C, 0xF0, 0x7A, 0xB0, 0x19, 0x70, 0x7B, 0xCE, 0x2E, 0xF0,
+0x7C, 0x99, 0x35, 0xF0, 0x7D, 0xAE, 0x10, 0xF0, 0x7E, 0x79, 0x17, 0xF0, 0x7F, 0x8D, 0xF2, 0xF0,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x8D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00,
+0x04, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x00, 0x00, 0x9A,
+0xB0, 0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00,
+0x00, 0x8C, 0xA0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x47, 0x54, 0x00, 0x4D, 0x41,
+0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Makassar */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA1, 0xF2, 0x5D, 0x90,
+0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x11, 0x0E, 0xF0, 0x01, 0x02, 0x03, 0x02,
+0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80,
+0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00,
+0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Asia/Manila */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xC1, 0x9C, 0xF4, 0x80,
+0xC2, 0x16, 0x30, 0x70, 0xCB, 0xF2, 0xE7, 0x00, 0xD0, 0xA9, 0x25, 0x70, 0xE2, 0x6C, 0x39, 0x00,
+0xE2, 0xD5, 0xA2, 0xF0, 0x0F, 0x75, 0x46, 0x80, 0x10, 0x66, 0x7A, 0xF0, 0x00, 0x01, 0x02, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x05,
+0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, 0x50, 0x48, 0x53, 0x54, 0x00, 0x50, 0x48, 0x54, 0x00, 0x4A,
+0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Muscat */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0xF2, 0x96, 0x94,
+0x01, 0x00, 0x00, 0x36, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Nicosia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA5, 0x77, 0x1E, 0xB8,
+0x09, 0xED, 0xAF, 0xE0, 0x0A, 0xDD, 0x92, 0xD0, 0x0B, 0xFA, 0x64, 0xE0, 0x0C, 0xBE, 0xC6, 0x50,
+0x0D, 0xA4, 0x39, 0x60, 0x0E, 0x8A, 0xE1, 0xD0, 0x0F, 0x84, 0x1B, 0x60, 0x10, 0x75, 0x4F, 0xD0,
+0x11, 0x63, 0xFD, 0x60, 0x12, 0x53, 0xE0, 0x50, 0x13, 0x4D, 0x19, 0xE0, 0x14, 0x33, 0xC2, 0x50,
+0x15, 0x23, 0xC1, 0x60, 0x16, 0x13, 0xA4, 0x50, 0x17, 0x03, 0xA3, 0x60, 0x17, 0xF3, 0x86, 0x50,
+0x18, 0xE3, 0x85, 0x60, 0x19, 0xD3, 0x68, 0x50, 0x1A, 0xC3, 0x67, 0x60, 0x1B, 0xBC, 0x84, 0xD0,
+0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x48, 0xD0,
+0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x0C, 0xD0,
+0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xED, 0xE0, 0x27, 0x05, 0x0B, 0x50,
+0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xED, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50,
+0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50,
+0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x4D, 0x91, 0xD0,
+0x33, 0x3D, 0x90, 0xE0, 0x34, 0x2D, 0x73, 0xD0, 0x35, 0x1D, 0x72, 0xE0, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x1F, 0x48, 0x00, 0x00, 0x00, 0x00, 0x2A,
+0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Asia/Novosibirsk */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xDB, 0x19, 0x24,
+0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10,
+0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90,
+0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0,
+0x1F, 0x7C, 0x2C, 0xB0, 0x20, 0x6C, 0x1D, 0xB0, 0x21, 0x5C, 0x0E, 0xB0, 0x22, 0x4B, 0xFF, 0xB0,
+0x23, 0x3B, 0xF0, 0xB0, 0x24, 0x2B, 0xE1, 0xB0, 0x25, 0x1B, 0xD2, 0xB0, 0x26, 0x0B, 0xC3, 0xB0,
+0x27, 0x04, 0xEF, 0x30, 0x27, 0xF4, 0xE0, 0x30, 0x28, 0xE4, 0xDF, 0x40, 0x29, 0x78, 0x87, 0x40,
+0x29, 0xD4, 0x98, 0x00, 0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0xA4, 0x30, 0x2B, 0xFE, 0x4E, 0x00,
+0x2C, 0xA4, 0xA3, 0x40, 0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40,
+0x30, 0x64, 0x67, 0x40, 0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, 0x33, 0x3D, 0x74, 0xC0,
+0x34, 0x52, 0x4F, 0xC0, 0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x38, 0xC0,
+0x38, 0x1B, 0x4E, 0x40, 0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBC, 0xFC, 0xC0,
+0x3B, 0xDB, 0x12, 0x40, 0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x85, 0xFB, 0x40,
+0x3F, 0x9A, 0xD6, 0x40, 0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x45, 0xBF, 0x40,
+0x43, 0x63, 0xD4, 0xC0, 0x44, 0x25, 0xA1, 0x40, 0x45, 0x43, 0xB6, 0xC0, 0x46, 0x05, 0x83, 0x40,
+0x47, 0x23, 0x98, 0xC0, 0x47, 0xEE, 0x9F, 0xC0, 0x49, 0x03, 0x7A, 0xC0, 0x49, 0xCE, 0x81, 0xC0,
+0x4A, 0xE3, 0x5C, 0xC0, 0x4B, 0xAE, 0x63, 0xC0, 0x4C, 0xCC, 0x79, 0x40, 0x4D, 0x8E, 0x45, 0xC0,
+0x4E, 0xAC, 0x5B, 0x40, 0x4F, 0x6E, 0x27, 0xC0, 0x50, 0x8C, 0x3D, 0x40, 0x51, 0x57, 0x44, 0x40,
+0x52, 0x6C, 0x1F, 0x40, 0x53, 0x37, 0x26, 0x40, 0x54, 0x4C, 0x01, 0x40, 0x55, 0x17, 0x08, 0x40,
+0x56, 0x2B, 0xE3, 0x40, 0x56, 0xF6, 0xEA, 0x40, 0x58, 0x14, 0xFF, 0xC0, 0x58, 0xD6, 0xCC, 0x40,
+0x59, 0xF4, 0xE1, 0xC0, 0x5A, 0xB6, 0xAE, 0x40, 0x5B, 0xD4, 0xC3, 0xC0, 0x5C, 0x9F, 0xCA, 0xC0,
+0x5D, 0xB4, 0xA5, 0xC0, 0x5E, 0x7F, 0xAC, 0xC0, 0x5F, 0x94, 0x87, 0xC0, 0x60, 0x5F, 0x8E, 0xC0,
+0x61, 0x7D, 0xA4, 0x40, 0x62, 0x3F, 0x70, 0xC0, 0x63, 0x5D, 0x86, 0x40, 0x64, 0x1F, 0x52, 0xC0,
+0x65, 0x3D, 0x68, 0x40, 0x66, 0x08, 0x6F, 0x40, 0x67, 0x1D, 0x4A, 0x40, 0x67, 0xE8, 0x51, 0x40,
+0x68, 0xFD, 0x2C, 0x40, 0x69, 0xC8, 0x33, 0x40, 0x6A, 0xDD, 0x0E, 0x40, 0x6B, 0xA8, 0x15, 0x40,
+0x6C, 0xC6, 0x2A, 0xC0, 0x6D, 0x87, 0xF7, 0x40, 0x6E, 0xA6, 0x0C, 0xC0, 0x6F, 0x67, 0xD9, 0x40,
+0x70, 0x85, 0xEE, 0xC0, 0x71, 0x50, 0xF5, 0xC0, 0x72, 0x65, 0xD0, 0xC0, 0x73, 0x30, 0xD7, 0xC0,
+0x74, 0x45, 0xB2, 0xC0, 0x75, 0x10, 0xB9, 0xC0, 0x76, 0x2E, 0xCF, 0x40, 0x76, 0xF0, 0x9B, 0xC0,
+0x78, 0x0E, 0xB1, 0x40, 0x78, 0xD0, 0x7D, 0xC0, 0x79, 0xEE, 0x93, 0x40, 0x7A, 0xB0, 0x5F, 0xC0,
+0x7B, 0xCE, 0x75, 0x40, 0x7C, 0x99, 0x7C, 0x40, 0x7D, 0xAE, 0x57, 0x40, 0x7E, 0x79, 0x5E, 0x40,
+0x7F, 0x8E, 0x39, 0x40, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05,
+0x08, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x4D, 0xBC, 0x00, 0x00,
+0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70,
+0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00,
+0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09,
+0x4C, 0x4D, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* Asia/Omsk */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xB3, 0x40, 0xB0,
+0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0,
+0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0,
+0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0,
+0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0,
+0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xE4, 0xED, 0x50, 0x29, 0x78, 0x95, 0x50,
+0x29, 0xD4, 0xA6, 0x10, 0x2A, 0xC4, 0x89, 0x00, 0x2B, 0xB4, 0xB2, 0x40, 0x2C, 0xA4, 0xA3, 0x40,
+0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, 0x30, 0x64, 0x67, 0x40,
+0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, 0x33, 0x3D, 0x74, 0xC0, 0x34, 0x52, 0x4F, 0xC0,
+0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x4E, 0x40,
+0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x12, 0x40,
+0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xD6, 0x40,
+0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x45, 0xBF, 0x40, 0x43, 0x63, 0xD4, 0xC0,
+0x44, 0x25, 0xA1, 0x40, 0x45, 0x43, 0xB6, 0xC0, 0x46, 0x05, 0x83, 0x40, 0x47, 0x23, 0x98, 0xC0,
+0x47, 0xEE, 0x9F, 0xC0, 0x49, 0x03, 0x7A, 0xC0, 0x49, 0xCE, 0x81, 0xC0, 0x4A, 0xE3, 0x5C, 0xC0,
+0x4B, 0xAE, 0x63, 0xC0, 0x4C, 0xCC, 0x79, 0x40, 0x4D, 0x8E, 0x45, 0xC0, 0x4E, 0xAC, 0x5B, 0x40,
+0x4F, 0x6E, 0x27, 0xC0, 0x50, 0x8C, 0x3D, 0x40, 0x51, 0x57, 0x44, 0x40, 0x52, 0x6C, 0x1F, 0x40,
+0x53, 0x37, 0x26, 0x40, 0x54, 0x4C, 0x01, 0x40, 0x55, 0x17, 0x08, 0x40, 0x56, 0x2B, 0xE3, 0x40,
+0x56, 0xF6, 0xEA, 0x40, 0x58, 0x14, 0xFF, 0xC0, 0x58, 0xD6, 0xCC, 0x40, 0x59, 0xF4, 0xE1, 0xC0,
+0x5A, 0xB6, 0xAE, 0x40, 0x5B, 0xD4, 0xC3, 0xC0, 0x5C, 0x9F, 0xCA, 0xC0, 0x5D, 0xB4, 0xA5, 0xC0,
+0x5E, 0x7F, 0xAC, 0xC0, 0x5F, 0x94, 0x87, 0xC0, 0x60, 0x5F, 0x8E, 0xC0, 0x61, 0x7D, 0xA4, 0x40,
+0x62, 0x3F, 0x70, 0xC0, 0x63, 0x5D, 0x86, 0x40, 0x64, 0x1F, 0x52, 0xC0, 0x65, 0x3D, 0x68, 0x40,
+0x66, 0x08, 0x6F, 0x40, 0x67, 0x1D, 0x4A, 0x40, 0x67, 0xE8, 0x51, 0x40, 0x68, 0xFD, 0x2C, 0x40,
+0x69, 0xC8, 0x33, 0x40, 0x6A, 0xDD, 0x0E, 0x40, 0x6B, 0xA8, 0x15, 0x40, 0x6C, 0xC6, 0x2A, 0xC0,
+0x6D, 0x87, 0xF7, 0x40, 0x6E, 0xA6, 0x0C, 0xC0, 0x6F, 0x67, 0xD9, 0x40, 0x70, 0x85, 0xEE, 0xC0,
+0x71, 0x50, 0xF5, 0xC0, 0x72, 0x65, 0xD0, 0xC0, 0x73, 0x30, 0xD7, 0xC0, 0x74, 0x45, 0xB2, 0xC0,
+0x75, 0x10, 0xB9, 0xC0, 0x76, 0x2E, 0xCF, 0x40, 0x76, 0xF0, 0x9B, 0xC0, 0x78, 0x0E, 0xB1, 0x40,
+0x78, 0xD0, 0x7D, 0xC0, 0x79, 0xEE, 0x93, 0x40, 0x7A, 0xB0, 0x5F, 0xC0, 0x7B, 0xCE, 0x75, 0x40,
+0x7C, 0x99, 0x7C, 0x40, 0x7D, 0xAE, 0x57, 0x40, 0x7E, 0x79, 0x5E, 0x40, 0x7F, 0x8E, 0x39, 0x40,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x44, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00,
+0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54,
+0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00,
+0x00, 0x46, 0x50, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4F, 0x4D, 0x53, 0x54, 0x00, 0x4F, 0x4D,
+0x53, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Oral */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x19, 0x93, 0xDC,
+0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0,
+0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0,
+0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0,
+0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0,
+0x27, 0x05, 0x19, 0x60, 0x27, 0x7F, 0x98, 0xC0, 0x29, 0x4B, 0xB4, 0x40, 0x29, 0xD4, 0xC2, 0x30,
+0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xBF, 0x60, 0x2D, 0x94, 0xB0, 0x60,
+0x2E, 0x84, 0xA1, 0x60, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x83, 0x60, 0x31, 0x5D, 0xAE, 0xE0,
+0x32, 0x72, 0x89, 0xE0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0,
+0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0,
+0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60,
+0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60,
+0x41, 0x84, 0x0E, 0xE0, 0x42, 0x35, 0xED, 0x40, 0x01, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x01, 0x0A,
+0x09, 0x0A, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C,
+0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0D, 0x00, 0x00, 0x30, 0x24, 0x00,
+0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54,
+0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00,
+0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00,
+0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x00, 0x00, 0x46,
+0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x4C,
+0x4D, 0x54, 0x00, 0x55, 0x52, 0x41, 0x54, 0x00, 0x55, 0x52, 0x41, 0x53, 0x54, 0x00, 0x4F, 0x52,
+0x41, 0x53, 0x54, 0x00, 0x4F, 0x52, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Phnom_Penh */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x44, 0x24,
+0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02,
+0x00, 0x00, 0x62, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70,
+0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00,
+0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Pontianak */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x8B, 0xFF, 0x8E, 0x00,
+0xBA, 0x16, 0xDF, 0x00, 0xCB, 0x79, 0xA4, 0x08, 0xD2, 0x11, 0x0E, 0xF0, 0xD7, 0x3C, 0xC6, 0x08,
+0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x21, 0xDA, 0x74, 0x80, 0x01, 0x02, 0x03, 0x02,
+0x04, 0x02, 0x05, 0x06, 0x00, 0x00, 0x66, 0x80, 0x00, 0x00, 0x00, 0x00, 0x66, 0x80, 0x00, 0x04,
+0x00, 0x00, 0x69, 0x78, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x00, 0x00, 0x70, 0x80,
+0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x10, 0x00, 0x00, 0x62, 0x70, 0x00, 0x08, 0x4C, 0x4D,
+0x54, 0x00, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43, 0x49,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Asia/Pyongyang */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x85, 0x93, 0x7E, 0x78,
+0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xE2, 0x4F, 0x29, 0xF0, 0xF0, 0x35, 0x78, 0x80,
+0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00,
+0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* Asia/Qatar */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA1, 0xF2, 0x9D, 0x30,
+0x04, 0x8A, 0x92, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x30, 0x50, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40,
+0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x53, 0x54, 0x00,
+0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Qyzylorda */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x19, 0x86, 0xA0,
+0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0,
+0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0,
+0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0,
+0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0,
+0x27, 0x05, 0x0B, 0x50, 0x27, 0x7F, 0x8A, 0xB0, 0x29, 0x4B, 0xA6, 0x30, 0x29, 0x78, 0x95, 0x50,
+0x29, 0xD4, 0xA6, 0x10, 0x2A, 0xC4, 0x89, 0x00, 0x2B, 0xB4, 0xB2, 0x40, 0x2C, 0xA4, 0xA3, 0x40,
+0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, 0x30, 0x64, 0x67, 0x40,
+0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, 0x33, 0x3D, 0x74, 0xC0, 0x34, 0x52, 0x4F, 0xC0,
+0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x4E, 0x40,
+0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x12, 0x40,
+0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xD6, 0x40,
+0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x35, 0xD1, 0x20, 0x01, 0x02, 0x03, 0x04,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x02, 0x07, 0x09, 0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x09,
+0x00, 0x00, 0x3D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50,
+0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00,
+0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F,
+0x00, 0x00, 0x62, 0x70, 0x01, 0x14, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0F, 0x00, 0x00, 0x62, 0x70,
+0x01, 0x14, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x49, 0x5A, 0x54,
+0x00, 0x4B, 0x49, 0x5A, 0x53, 0x54, 0x00, 0x51, 0x59, 0x5A, 0x54, 0x00, 0x51, 0x59, 0x5A, 0x53,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Rangoon */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0x73, 0x5C,
+0xCB, 0xF2, 0xFC, 0x18, 0xD1, 0x9A, 0x67, 0xF0, 0x01, 0x02, 0x03, 0x00, 0x00, 0x5A, 0x24, 0x00,
+0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x5B,
+0x68, 0x00, 0x0D, 0x52, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00,
+0x4D, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Riyadh */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x36, 0xB4,
+0x01, 0x00, 0x00, 0x2B, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Saigon */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80,
+0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02,
+0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70,
+0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00,
+0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Sakhalin */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x17, 0x86, 0xF0, 0xCD, 0xB8,
+0xC3, 0xCE, 0x85, 0x70, 0xD2, 0x30, 0xB2, 0xF0, 0x15, 0x27, 0x37, 0x50, 0x16, 0x18, 0x6B, 0xC0,
+0x17, 0x08, 0x6A, 0xD0, 0x17, 0xF9, 0x9F, 0x40, 0x18, 0xE9, 0x9E, 0x50, 0x19, 0xDA, 0xD2, 0xC0,
+0x1A, 0xCC, 0x23, 0x50, 0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x21, 0x70, 0x1D, 0x9C, 0x12, 0x70,
+0x1E, 0x8C, 0x03, 0x70, 0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xE5, 0x70, 0x21, 0x5B, 0xD6, 0x70,
+0x22, 0x4B, 0xC7, 0x70, 0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xA9, 0x70, 0x25, 0x1B, 0x9A, 0x70,
+0x26, 0x0B, 0x8B, 0x70, 0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xA7, 0xF0, 0x28, 0xE4, 0xA7, 0x00,
+0x29, 0x78, 0x4F, 0x00, 0x29, 0xD4, 0x5F, 0xC0, 0x2A, 0xC4, 0x42, 0xB0, 0x2B, 0xB4, 0x6B, 0xF0,
+0x2C, 0xA4, 0x5C, 0xF0, 0x2D, 0x94, 0x4D, 0xF0, 0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x2F, 0xF0,
+0x30, 0x64, 0x20, 0xF0, 0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x27, 0x70, 0x33, 0x3D, 0x2E, 0x70,
+0x34, 0x52, 0x17, 0x80, 0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80,
+0x38, 0x1B, 0x16, 0x00, 0x38, 0xDC, 0xE2, 0x80, 0x39, 0xFA, 0xF8, 0x00, 0x3A, 0xBC, 0xC4, 0x80,
+0x3B, 0xDA, 0xDA, 0x00, 0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00,
+0x3F, 0x9A, 0x9E, 0x00, 0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00,
+0x43, 0x63, 0x9C, 0x80, 0x44, 0x25, 0x69, 0x00, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00,
+0x47, 0x23, 0x60, 0x80, 0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80,
+0x4A, 0xE3, 0x24, 0x80, 0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80,
+0x4E, 0xAC, 0x23, 0x00, 0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00,
+0x52, 0x6B, 0xE7, 0x00, 0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00,
+0x56, 0x2B, 0xAB, 0x00, 0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00,
+0x59, 0xF4, 0xA9, 0x80, 0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80,
+0x5D, 0xB4, 0x6D, 0x80, 0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80,
+0x61, 0x7D, 0x6C, 0x00, 0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80,
+0x65, 0x3D, 0x30, 0x00, 0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00,
+0x68, 0xFC, 0xF4, 0x00, 0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00,
+0x6C, 0xC5, 0xF2, 0x80, 0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00,
+0x70, 0x85, 0xB6, 0x80, 0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80,
+0x74, 0x45, 0x7A, 0x80, 0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80,
+0x78, 0x0E, 0x79, 0x00, 0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80,
+0x7B, 0xCE, 0x3D, 0x00, 0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00,
+0x7F, 0x8E, 0x01, 0x00, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x05, 0x03, 0x04,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08,
+0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08,
+0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08,
+0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08,
+0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08,
+0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x00, 0x00, 0x85, 0xC8, 0x00, 0x00,
+0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0xA8, 0xC0,
+0x01, 0x0C, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x12, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x12, 0x00, 0x00,
+0xA8, 0xC0, 0x01, 0x0C, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x0C, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x12,
+0x4C, 0x4D, 0x54, 0x00, 0x43, 0x4A, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x53, 0x41, 0x4B, 0x53,
+0x54, 0x00, 0x53, 0x41, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Samarkand */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x23, 0xAA, 0x19, 0x85, 0x60,
+0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0,
+0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0,
+0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0,
+0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0,
+0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xBF, 0xD9, 0x20, 0x28, 0xE4, 0xED, 0x50,
+0x29, 0x60, 0xBE, 0x30, 0x29, 0xD4, 0xB4, 0x20, 0x2A, 0xC4, 0x97, 0x10, 0x01, 0x02, 0x03, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x08, 0x0B, 0x0A, 0x0C, 0x0B, 0x0C, 0x00, 0x00, 0x3E, 0xA0, 0x00, 0x00, 0x00, 0x00,
+0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09,
+0x00, 0x00, 0x62, 0x70, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, 0x00, 0x15, 0x00, 0x00, 0x54, 0x60,
+0x00, 0x15, 0x00, 0x00, 0x62, 0x70, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00,
+0x46, 0x50, 0x00, 0x15, 0x00, 0x00, 0x46, 0x50, 0x00, 0x1A, 0x00, 0x00, 0x54, 0x60, 0x01, 0x1E,
+0x00, 0x00, 0x46, 0x50, 0x00, 0x1A, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x53,
+0x41, 0x4D, 0x53, 0x54, 0x00, 0x54, 0x41, 0x53, 0x53, 0x54, 0x00, 0x54, 0x41, 0x53, 0x54, 0x00,
+0x55, 0x5A, 0x54, 0x00, 0x55, 0x5A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Asia/Seoul */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x85, 0x93, 0x7E, 0x78,
+0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80,
+0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70,
+0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, 0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x03,
+0x02, 0x03, 0x00, 0x01, 0x04, 0x01, 0x04, 0x01, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00,
+0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00,
+0x00, 0x00, 0x8C, 0xA0, 0x01, 0x04, 0x4B, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Shanghai */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xB0, 0xFE, 0x9A, 0xA0,
+0xC8, 0x5C, 0x01, 0x80, 0xC8, 0xFA, 0x27, 0x70, 0xC9, 0xD5, 0x0E, 0x80, 0xCA, 0xDB, 0x5A, 0xF0,
+0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70,
+0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0,
+0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x00, 0x00, 0x71, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70,
+0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Singapore */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x86, 0x83, 0x85, 0xA3,
+0xBA, 0x67, 0x4E, 0x90, 0xC0, 0x0A, 0xE4, 0x60, 0xCA, 0xB3, 0xE5, 0x60, 0xCB, 0x91, 0x5F, 0x08,
+0xD2, 0x48, 0x6D, 0xF0, 0xF7, 0xBA, 0x4D, 0x88, 0x16, 0x91, 0xF5, 0x08, 0x01, 0x02, 0x03, 0x04,
+0x05, 0x04, 0x06, 0x07, 0x00, 0x00, 0x61, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04,
+0x00, 0x00, 0x67, 0x20, 0x01, 0x09, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78,
+0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0F, 0x00, 0x00, 0x69, 0x78, 0x00, 0x13, 0x00, 0x00,
+0x70, 0x80, 0x00, 0x13, 0x53, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x4C, 0x54, 0x00, 0x4D, 0x41, 0x4C,
+0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x53, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Taipei */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xD1, 0x97, 0xD3, 0x00,
+0xD2, 0x61, 0x7A, 0x70, 0xD3, 0x79, 0x06, 0x80, 0xD4, 0x42, 0xAD, 0xF0, 0xD5, 0x5A, 0x3A, 0x00,
+0xD6, 0x23, 0xE1, 0x70, 0xD7, 0x3C, 0xBF, 0x00, 0xD8, 0x06, 0x66, 0x70, 0xD9, 0x1D, 0xF2, 0x80,
+0xD9, 0xE7, 0x99, 0xF0, 0xDA, 0xFF, 0x26, 0x00, 0xDB, 0xC8, 0xCD, 0x70, 0xDC, 0xE0, 0x59, 0x80,
+0xDD, 0xAA, 0x00, 0xF0, 0xDE, 0x72, 0x73, 0x00, 0xDF, 0xB5, 0x64, 0x70, 0xE0, 0x7C, 0x85, 0x00,
+0xE1, 0x96, 0x97, 0xF0, 0xE2, 0x5D, 0xB8, 0x80, 0xE3, 0x77, 0xCB, 0x70, 0xE4, 0x3E, 0xEC, 0x00,
+0xE5, 0x30, 0x20, 0x70, 0xE6, 0x21, 0x71, 0x00, 0xE7, 0x12, 0xA5, 0x70, 0xE8, 0x02, 0xA4, 0x80,
+0xE8, 0xF3, 0xD8, 0xF0, 0xE9, 0xE3, 0xD8, 0x00, 0xEA, 0xD5, 0x0C, 0x70, 0xEB, 0xC5, 0x0B, 0x80,
+0xEC, 0xB6, 0x3F, 0xF0, 0xED, 0xF7, 0xFC, 0x00, 0xEE, 0x98, 0xC4, 0xF0, 0xEF, 0xD9, 0x2F, 0x80,
+0xF0, 0x79, 0xF8, 0x70, 0x07, 0xFC, 0x56, 0x00, 0x08, 0xED, 0x8A, 0x70, 0x09, 0xDD, 0x89, 0x80,
+0x0A, 0xCE, 0xBD, 0xF0, 0x13, 0xBC, 0xD5, 0x00, 0x14, 0x36, 0x10, 0xF0, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04,
+0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Tashkent */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x83, 0x08,
+0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20,
+0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0,
+0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0,
+0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0,
+0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0,
+0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xBF, 0xD9, 0x20, 0x28, 0xE4, 0xED, 0x50,
+0x29, 0x60, 0xBE, 0x30, 0x29, 0xD4, 0xB4, 0x20, 0x2A, 0xC4, 0x97, 0x10, 0x01, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x06, 0x09, 0x08, 0x0A, 0x09, 0x0A, 0x00, 0x00, 0x40, 0xF8, 0x00, 0x00, 0x00, 0x00,
+0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04,
+0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60,
+0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x00, 0x00,
+0x54, 0x60, 0x01, 0x13, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x41,
+0x53, 0x54, 0x00, 0x54, 0x41, 0x53, 0x53, 0x54, 0x00, 0x55, 0x5A, 0x54, 0x00, 0x55, 0x5A, 0x53,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Tbilisi */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x19, 0xAA, 0x19, 0x99, 0xFC,
+0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40,
+0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0,
+0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0,
+0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0,
+0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0,
+0x27, 0x05, 0x19, 0x60, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0x00, 0xCB, 0xC0, 0x28, 0xE5, 0x09, 0x70,
+0x29, 0x60, 0xDA, 0x50, 0x29, 0xD4, 0xDE, 0x50, 0x2A, 0xC4, 0xC1, 0x40, 0x2B, 0xB4, 0xC0, 0x50,
+0x2C, 0xA4, 0xA3, 0x40, 0x2D, 0x94, 0xA2, 0x50, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40,
+0x30, 0x64, 0x59, 0x30, 0x31, 0x5D, 0x92, 0xC0, 0x33, 0x3D, 0x66, 0xB0, 0x34, 0x52, 0x41, 0xB0,
+0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x23, 0xB0, 0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x40, 0x30,
+0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x22, 0x30, 0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x04, 0x30,
+0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xE6, 0x30, 0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xC8, 0x30,
+0x40, 0x65, 0xDD, 0x40, 0x40, 0xDD, 0xC7, 0xB0, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70,
+0x43, 0x63, 0xFE, 0xF0, 0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70,
+0x47, 0x23, 0xC2, 0xF0, 0x47, 0xEE, 0xC9, 0xF0, 0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0,
+0x4A, 0xE3, 0x86, 0xF0, 0x4B, 0xAE, 0x8D, 0xF0, 0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0,
+0x4E, 0xAC, 0x85, 0x70, 0x4F, 0x6E, 0x51, 0xF0, 0x50, 0x8C, 0x67, 0x70, 0x51, 0x57, 0x6E, 0x70,
+0x52, 0x6C, 0x49, 0x70, 0x53, 0x37, 0x50, 0x70, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x17, 0x32, 0x70,
+0x56, 0x2C, 0x0D, 0x70, 0x56, 0xF7, 0x14, 0x70, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD6, 0xF6, 0x70,
+0x59, 0xF5, 0x0B, 0xF0, 0x5A, 0xB6, 0xD8, 0x70, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9F, 0xF4, 0xF0,
+0x5D, 0xB4, 0xCF, 0xF0, 0x5E, 0x7F, 0xD6, 0xF0, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5F, 0xB8, 0xF0,
+0x61, 0x7D, 0xCE, 0x70, 0x62, 0x3F, 0x9A, 0xF0, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1F, 0x7C, 0xF0,
+0x65, 0x3D, 0x92, 0x70, 0x66, 0x08, 0x99, 0x70, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE8, 0x7B, 0x70,
+0x68, 0xFD, 0x56, 0x70, 0x69, 0xC8, 0x5D, 0x70, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA8, 0x3F, 0x70,
+0x6C, 0xC6, 0x54, 0xF0, 0x6D, 0x88, 0x21, 0x70, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x68, 0x03, 0x70,
+0x70, 0x86, 0x18, 0xF0, 0x71, 0x51, 0x1F, 0xF0, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x31, 0x01, 0xF0,
+0x74, 0x45, 0xDC, 0xF0, 0x75, 0x10, 0xE3, 0xF0, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xF0, 0xC5, 0xF0,
+0x78, 0x0E, 0xDB, 0x70, 0x78, 0xD0, 0xA7, 0xF0, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xB0, 0x89, 0xF0,
+0x7B, 0xCE, 0x9F, 0x70, 0x7C, 0x99, 0xA6, 0x70, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x79, 0x88, 0x70,
+0x7F, 0x8E, 0x63, 0x70, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x08, 0x07, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x0B, 0x0A, 0x0B, 0x0A, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x08, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07,
+0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07,
+0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07,
+0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07,
+0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x0C, 0x07, 0x00, 0x00, 0x2A, 0x04, 0x00, 0x00,
+0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0A, 0x00, 0x00, 0x38, 0x40,
+0x00, 0x05, 0x00, 0x00, 0x38, 0x40, 0x00, 0x05, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0A, 0x00, 0x00,
+0x38, 0x40, 0x01, 0x0A, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x14,
+0x00, 0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x46, 0x50, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40,
+0x00, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x14, 0x54, 0x42, 0x4D, 0x54, 0x00, 0x54, 0x42, 0x49,
+0x54, 0x00, 0x54, 0x42, 0x49, 0x53, 0x54, 0x00, 0x47, 0x45, 0x54, 0x00, 0x47, 0x45, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Tehran */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x9A, 0x6C, 0x7D, 0xC8,
+0xD2, 0xDB, 0x12, 0xC8, 0x0E, 0xBB, 0xA2, 0x48, 0x0F, 0x74, 0x2D, 0x40, 0x10, 0x8E, 0x40, 0x30,
+0x10, 0xED, 0x3A, 0x40, 0x11, 0x55, 0x67, 0xC8, 0x12, 0x45, 0x4A, 0xB8, 0x13, 0x37, 0xEC, 0xC8,
+0x14, 0x2D, 0x15, 0xB8, 0x28, 0x20, 0x76, 0xC8, 0x28, 0xDB, 0x9D, 0xB8, 0x29, 0xCB, 0x9C, 0xC8,
+0x2A, 0xBE, 0x22, 0xB8, 0x2B, 0xAC, 0xD0, 0x48, 0x2C, 0x9F, 0x56, 0x38, 0x2D, 0x8E, 0x03, 0xC8,
+0x2E, 0x80, 0x89, 0xB8, 0x2F, 0x6F, 0x37, 0x48, 0x30, 0x61, 0xBD, 0x38, 0x31, 0x50, 0x6A, 0xC8,
+0x32, 0x42, 0xF0, 0xB8, 0x33, 0x32, 0xEF, 0xC8, 0x34, 0x25, 0x75, 0xB8, 0x35, 0x14, 0x23, 0x48,
+0x36, 0x06, 0xA9, 0x38, 0x36, 0xF5, 0x56, 0xC8, 0x37, 0xE7, 0xDC, 0xB8, 0x38, 0xD6, 0x8A, 0x48,
+0x39, 0xC9, 0x10, 0x38, 0x3A, 0xB9, 0x0F, 0x48, 0x3B, 0xAB, 0x95, 0x38, 0x3C, 0x9A, 0x42, 0xC8,
+0x3D, 0x8C, 0xC8, 0xB8, 0x3E, 0x7B, 0x76, 0x48, 0x3F, 0x6D, 0xFC, 0x38, 0x40, 0x5C, 0xA9, 0xC8,
+0x41, 0x4F, 0x2F, 0xB8, 0x42, 0x3F, 0x2E, 0xC8, 0x43, 0x31, 0xB4, 0xB8, 0x44, 0x20, 0x62, 0x48,
+0x45, 0x12, 0xE8, 0x38, 0x46, 0x01, 0x95, 0xC8, 0x46, 0xF4, 0x1B, 0xB8, 0x47, 0xE2, 0xC9, 0x48,
+0x48, 0xD5, 0x4F, 0x38, 0x49, 0xC5, 0x4E, 0x48, 0x4A, 0xB7, 0xD4, 0x38, 0x4B, 0xA6, 0x81, 0xC8,
+0x4C, 0x99, 0x07, 0xB8, 0x4D, 0x87, 0xB5, 0x48, 0x4E, 0x7A, 0x3B, 0x38, 0x4F, 0x68, 0xE8, 0xC8,
+0x50, 0x5B, 0x6E, 0xB8, 0x51, 0x4B, 0x6D, 0xC8, 0x52, 0x3D, 0xF3, 0xB8, 0x53, 0x2C, 0xA1, 0x48,
+0x54, 0x1F, 0x27, 0x38, 0x55, 0x0D, 0xD4, 0xC8, 0x56, 0x00, 0x5A, 0xB8, 0x56, 0xEF, 0x08, 0x48,
+0x57, 0xE1, 0x8E, 0x38, 0x58, 0xD1, 0x8D, 0x48, 0x59, 0xC4, 0x13, 0x38, 0x5A, 0xB2, 0xC0, 0xC8,
+0x5B, 0xA5, 0x46, 0xB8, 0x5C, 0x93, 0xF4, 0x48, 0x5D, 0x86, 0x7A, 0x38, 0x5E, 0x75, 0x27, 0xC8,
+0x5F, 0x67, 0xAD, 0xB8, 0x60, 0x57, 0xAC, 0xC8, 0x61, 0x4A, 0x32, 0xB8, 0x62, 0x38, 0xE0, 0x48,
+0x63, 0x2B, 0x66, 0x38, 0x64, 0x1A, 0x13, 0xC8, 0x65, 0x0C, 0x99, 0xB8, 0x65, 0xFB, 0x47, 0x48,
+0x66, 0xED, 0xCD, 0x38, 0x67, 0xDD, 0xCC, 0x48, 0x68, 0xD0, 0x52, 0x38, 0x69, 0xBE, 0xFF, 0xC8,
+0x6A, 0xB1, 0x85, 0xB8, 0x6B, 0xA0, 0x33, 0x48, 0x6C, 0x92, 0xB9, 0x38, 0x6D, 0x81, 0x66, 0xC8,
+0x6E, 0x73, 0xEC, 0xB8, 0x6F, 0x62, 0x9A, 0x48, 0x70, 0x55, 0x20, 0x38, 0x71, 0x45, 0x1F, 0x48,
+0x72, 0x37, 0xA5, 0x38, 0x73, 0x26, 0x52, 0xC8, 0x74, 0x18, 0xD8, 0xB8, 0x75, 0x07, 0x86, 0x48,
+0x75, 0xFA, 0x0C, 0x38, 0x76, 0xE8, 0xB9, 0xC8, 0x77, 0xDB, 0x3F, 0xB8, 0x78, 0xCB, 0x3E, 0xC8,
+0x79, 0xBD, 0xC4, 0xB8, 0x7A, 0xAC, 0x72, 0x48, 0x7B, 0x9E, 0xF8, 0x38, 0x7C, 0x8D, 0xA5, 0xC8,
+0x7D, 0x80, 0x2B, 0xB8, 0x7E, 0x6E, 0xD9, 0x48, 0x7F, 0x61, 0x5F, 0x38, 0x01, 0x02, 0x04, 0x03,
+0x04, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x00, 0x00, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x00, 0x04,
+0x00, 0x00, 0x31, 0x38, 0x00, 0x08, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0D, 0x00, 0x00, 0x38, 0x40,
+0x00, 0x08, 0x00, 0x00, 0x3F, 0x48, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00,
+0x49, 0x52, 0x53, 0x54, 0x00, 0x49, 0x52, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Tel_Aviv */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x9E, 0x30, 0x45, 0x88,
+0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0,
+0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70,
+0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xD7, 0x5A, 0x14, 0x60, 0xD7, 0xDF, 0x1F, 0xC0,
+0xD8, 0x2F, 0xB5, 0x70, 0xD9, 0x1E, 0x46, 0xE0, 0xDA, 0x10, 0xE8, 0xF0, 0xDA, 0xEB, 0xB3, 0xE0,
+0xDB, 0xB4, 0x34, 0x00, 0xDC, 0xB9, 0x20, 0xE0, 0xDD, 0xE0, 0x8D, 0x00, 0xDE, 0xB4, 0xCE, 0x80,
+0xDF, 0xA4, 0xBF, 0x80, 0xE0, 0x8B, 0x76, 0x00, 0xE1, 0x56, 0x7D, 0x00, 0xE2, 0xBE, 0x4A, 0x60,
+0xE3, 0x36, 0x34, 0xD0, 0xE4, 0x9C, 0xF7, 0x00, 0xE5, 0x16, 0x16, 0xD0, 0xE6, 0x74, 0xD3, 0xE0,
+0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0,
+0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0,
+0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60,
+0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60,
+0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0,
+0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0,
+0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0,
+0x30, 0x48, 0xC5, 0xD0, 0x31, 0x48, 0x96, 0xE0, 0x32, 0x3C, 0x6E, 0x50, 0x33, 0x31, 0xB3, 0x60,
+0x34, 0x1A, 0xFE, 0xD0, 0x35, 0x11, 0x95, 0x60, 0x35, 0xF1, 0xA6, 0x50, 0x37, 0x04, 0x08, 0x80,
+0x37, 0xCF, 0x01, 0x70, 0x38, 0xF6, 0x5F, 0x80, 0x39, 0xDC, 0xF9, 0xE0, 0x3A, 0xD0, 0xED, 0x70,
+0x3B, 0xAE, 0x5B, 0x60, 0x3C, 0xA3, 0xA0, 0x70, 0x3D, 0xA0, 0xB2, 0x60, 0x3E, 0x83, 0x82, 0x70,
+0x3F, 0x7C, 0x9F, 0xE0, 0x40, 0x73, 0x36, 0x70, 0x41, 0x50, 0xA4, 0x60, 0x42, 0x4C, 0x8F, 0x00,
+0x43, 0x48, 0x4F, 0x70, 0x44, 0x2C, 0x71, 0x00, 0x45, 0x1E, 0xF6, 0xF0, 0x46, 0x0C, 0x53, 0x00,
+0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00,
+0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80,
+0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80,
+0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80,
+0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00,
+0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00,
+0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00,
+0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80,
+0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80,
+0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80,
+0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00,
+0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00,
+0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80,
+0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80,
+0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80,
+0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00,
+0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44,
+0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Asia/Thimbu */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xD5, 0xE6, 0x15, 0x74,
+0x21, 0x61, 0x4D, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x54, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58,
+0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00,
+0x42, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Thimphu */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xD5, 0xE6, 0x15, 0x74,
+0x21, 0x61, 0x4D, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x54, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58,
+0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00,
+0x42, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Tokyo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xC3, 0xCE, 0x85, 0x70,
+0xD7, 0x3E, 0x1E, 0x90, 0xD7, 0xEC, 0x16, 0x80, 0xD8, 0xF9, 0x16, 0x90, 0xD9, 0xCB, 0xF8, 0x80,
+0xDB, 0x07, 0x1D, 0x10, 0xDB, 0xAB, 0xDA, 0x80, 0xDC, 0xE6, 0xFF, 0x10, 0xDD, 0x8B, 0xBC, 0x80,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00,
+0x00, 0x8C, 0xA0, 0x01, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x43, 0x4A, 0x54, 0x00, 0x4A,
+0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Ujung_Pandang */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA1, 0xF2, 0x5D, 0x90,
+0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x11, 0x0E, 0xF0, 0x01, 0x02, 0x03, 0x02,
+0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80,
+0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00,
+0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Asia/Ulaanbaatar */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0x86, 0xD3, 0xEE, 0x4C,
+0x0F, 0x0B, 0xDC, 0x90, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80,
+0x1B, 0xBC, 0x5A, 0xA0, 0x1C, 0xAC, 0x4B, 0xA0, 0x1D, 0x9C, 0x3C, 0xA0, 0x1E, 0x8C, 0x2D, 0xA0,
+0x1F, 0x7C, 0x1E, 0xA0, 0x20, 0x6C, 0x0F, 0xA0, 0x21, 0x5C, 0x00, 0xA0, 0x22, 0x4B, 0xF1, 0xA0,
+0x23, 0x3B, 0xE2, 0xA0, 0x24, 0x2B, 0xD3, 0xA0, 0x25, 0x1B, 0xC4, 0xA0, 0x26, 0x0B, 0xB5, 0xA0,
+0x27, 0x04, 0xE1, 0x20, 0x27, 0xF4, 0xD2, 0x20, 0x28, 0xE4, 0xC3, 0x20, 0x29, 0xD4, 0xB4, 0x20,
+0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0x96, 0x20, 0x2C, 0xA4, 0x87, 0x20, 0x2D, 0x94, 0x78, 0x20,
+0x2E, 0x84, 0x69, 0x20, 0x2F, 0x74, 0x5A, 0x20, 0x30, 0x64, 0x4B, 0x20, 0x31, 0x5D, 0x76, 0xA0,
+0x32, 0x4D, 0x67, 0xA0, 0x33, 0x3D, 0x58, 0xA0, 0x34, 0x2D, 0x49, 0xA0, 0x35, 0x1D, 0x3A, 0xA0,
+0x36, 0x0D, 0x2B, 0xA0, 0x3A, 0xE9, 0xB3, 0xA0, 0x3B, 0xB4, 0xAC, 0x90, 0x3C, 0xA4, 0xAB, 0xA0,
+0x3D, 0x94, 0x8E, 0x90, 0x3E, 0x84, 0x8D, 0xA0, 0x3F, 0x74, 0x70, 0x90, 0x40, 0x64, 0x6F, 0xA0,
+0x41, 0x54, 0x52, 0x90, 0x42, 0x44, 0x51, 0xA0, 0x43, 0x34, 0x34, 0x90, 0x44, 0x24, 0x33, 0xA0,
+0x45, 0x1D, 0x51, 0x10, 0x46, 0x0D, 0x50, 0x20, 0x46, 0xFD, 0x33, 0x10, 0x47, 0xED, 0x32, 0x20,
+0x48, 0xDD, 0x15, 0x10, 0x49, 0xCD, 0x14, 0x20, 0x4A, 0xBC, 0xF7, 0x10, 0x4B, 0xAC, 0xF6, 0x20,
+0x4C, 0x9C, 0xD9, 0x10, 0x4D, 0x8C, 0xD8, 0x20, 0x4E, 0x7C, 0xBB, 0x10, 0x4F, 0x75, 0xF4, 0xA0,
+0x50, 0x65, 0xD7, 0x90, 0x51, 0x55, 0xD6, 0xA0, 0x52, 0x45, 0xB9, 0x90, 0x53, 0x35, 0xB8, 0xA0,
+0x54, 0x25, 0x9B, 0x90, 0x55, 0x15, 0x9A, 0xA0, 0x56, 0x05, 0x7D, 0x90, 0x56, 0xF5, 0x7C, 0xA0,
+0x57, 0xE5, 0x5F, 0x90, 0x58, 0xD5, 0x5E, 0xA0, 0x59, 0xCE, 0x7C, 0x10, 0x5A, 0xBE, 0x7B, 0x20,
+0x5B, 0xAE, 0x5E, 0x10, 0x5C, 0x9E, 0x5D, 0x20, 0x5D, 0x8E, 0x40, 0x10, 0x5E, 0x7E, 0x3F, 0x20,
+0x5F, 0x6E, 0x22, 0x10, 0x60, 0x5E, 0x21, 0x20, 0x61, 0x4E, 0x04, 0x10, 0x62, 0x3E, 0x03, 0x20,
+0x63, 0x2D, 0xE6, 0x10, 0x64, 0x1D, 0xE5, 0x20, 0x65, 0x17, 0x02, 0x90, 0x66, 0x07, 0x01, 0xA0,
+0x66, 0xF6, 0xE4, 0x90, 0x67, 0xE6, 0xE3, 0xA0, 0x68, 0xD6, 0xC6, 0x90, 0x69, 0xC6, 0xC5, 0xA0,
+0x6A, 0xB6, 0xA8, 0x90, 0x6B, 0xA6, 0xA7, 0xA0, 0x6C, 0x96, 0x8A, 0x90, 0x6D, 0x86, 0x89, 0xA0,
+0x6E, 0x7F, 0xA7, 0x10, 0x6F, 0x6F, 0xA6, 0x20, 0x70, 0x5F, 0x89, 0x10, 0x71, 0x4F, 0x88, 0x20,
+0x72, 0x3F, 0x6B, 0x10, 0x73, 0x2F, 0x6A, 0x20, 0x74, 0x1F, 0x4D, 0x10, 0x75, 0x0F, 0x4C, 0x20,
+0x75, 0xFF, 0x2F, 0x10, 0x76, 0xEF, 0x2E, 0x20, 0x77, 0xDF, 0x11, 0x10, 0x78, 0xCF, 0x10, 0x20,
+0x79, 0xC8, 0x2D, 0x90, 0x7A, 0xB8, 0x2C, 0xA0, 0x7B, 0xA8, 0x0F, 0x90, 0x7C, 0x98, 0x0E, 0xA0,
+0x7D, 0x87, 0xF1, 0x90, 0x7E, 0x77, 0xF0, 0xA0, 0x7F, 0x67, 0xD3, 0x90, 0x01, 0x03, 0x02, 0x03,
+0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x64, 0x34, 0x00, 0x00, 0x00, 0x00,
+0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04,
+0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x4C, 0x4D, 0x54, 0x00,
+0x55, 0x4C, 0x41, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Ulan_Bator */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0x86, 0xD3, 0xEE, 0x4C,
+0x0F, 0x0B, 0xDC, 0x90, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80,
+0x1B, 0xBC, 0x5A, 0xA0, 0x1C, 0xAC, 0x4B, 0xA0, 0x1D, 0x9C, 0x3C, 0xA0, 0x1E, 0x8C, 0x2D, 0xA0,
+0x1F, 0x7C, 0x1E, 0xA0, 0x20, 0x6C, 0x0F, 0xA0, 0x21, 0x5C, 0x00, 0xA0, 0x22, 0x4B, 0xF1, 0xA0,
+0x23, 0x3B, 0xE2, 0xA0, 0x24, 0x2B, 0xD3, 0xA0, 0x25, 0x1B, 0xC4, 0xA0, 0x26, 0x0B, 0xB5, 0xA0,
+0x27, 0x04, 0xE1, 0x20, 0x27, 0xF4, 0xD2, 0x20, 0x28, 0xE4, 0xC3, 0x20, 0x29, 0xD4, 0xB4, 0x20,
+0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0x96, 0x20, 0x2C, 0xA4, 0x87, 0x20, 0x2D, 0x94, 0x78, 0x20,
+0x2E, 0x84, 0x69, 0x20, 0x2F, 0x74, 0x5A, 0x20, 0x30, 0x64, 0x4B, 0x20, 0x31, 0x5D, 0x76, 0xA0,
+0x32, 0x4D, 0x67, 0xA0, 0x33, 0x3D, 0x58, 0xA0, 0x34, 0x2D, 0x49, 0xA0, 0x35, 0x1D, 0x3A, 0xA0,
+0x36, 0x0D, 0x2B, 0xA0, 0x3A, 0xE9, 0xB3, 0xA0, 0x3B, 0xB4, 0xAC, 0x90, 0x3C, 0xA4, 0xAB, 0xA0,
+0x3D, 0x94, 0x8E, 0x90, 0x3E, 0x84, 0x8D, 0xA0, 0x3F, 0x74, 0x70, 0x90, 0x40, 0x64, 0x6F, 0xA0,
+0x41, 0x54, 0x52, 0x90, 0x42, 0x44, 0x51, 0xA0, 0x43, 0x34, 0x34, 0x90, 0x44, 0x24, 0x33, 0xA0,
+0x45, 0x1D, 0x51, 0x10, 0x46, 0x0D, 0x50, 0x20, 0x46, 0xFD, 0x33, 0x10, 0x47, 0xED, 0x32, 0x20,
+0x48, 0xDD, 0x15, 0x10, 0x49, 0xCD, 0x14, 0x20, 0x4A, 0xBC, 0xF7, 0x10, 0x4B, 0xAC, 0xF6, 0x20,
+0x4C, 0x9C, 0xD9, 0x10, 0x4D, 0x8C, 0xD8, 0x20, 0x4E, 0x7C, 0xBB, 0x10, 0x4F, 0x75, 0xF4, 0xA0,
+0x50, 0x65, 0xD7, 0x90, 0x51, 0x55, 0xD6, 0xA0, 0x52, 0x45, 0xB9, 0x90, 0x53, 0x35, 0xB8, 0xA0,
+0x54, 0x25, 0x9B, 0x90, 0x55, 0x15, 0x9A, 0xA0, 0x56, 0x05, 0x7D, 0x90, 0x56, 0xF5, 0x7C, 0xA0,
+0x57, 0xE5, 0x5F, 0x90, 0x58, 0xD5, 0x5E, 0xA0, 0x59, 0xCE, 0x7C, 0x10, 0x5A, 0xBE, 0x7B, 0x20,
+0x5B, 0xAE, 0x5E, 0x10, 0x5C, 0x9E, 0x5D, 0x20, 0x5D, 0x8E, 0x40, 0x10, 0x5E, 0x7E, 0x3F, 0x20,
+0x5F, 0x6E, 0x22, 0x10, 0x60, 0x5E, 0x21, 0x20, 0x61, 0x4E, 0x04, 0x10, 0x62, 0x3E, 0x03, 0x20,
+0x63, 0x2D, 0xE6, 0x10, 0x64, 0x1D, 0xE5, 0x20, 0x65, 0x17, 0x02, 0x90, 0x66, 0x07, 0x01, 0xA0,
+0x66, 0xF6, 0xE4, 0x90, 0x67, 0xE6, 0xE3, 0xA0, 0x68, 0xD6, 0xC6, 0x90, 0x69, 0xC6, 0xC5, 0xA0,
+0x6A, 0xB6, 0xA8, 0x90, 0x6B, 0xA6, 0xA7, 0xA0, 0x6C, 0x96, 0x8A, 0x90, 0x6D, 0x86, 0x89, 0xA0,
+0x6E, 0x7F, 0xA7, 0x10, 0x6F, 0x6F, 0xA6, 0x20, 0x70, 0x5F, 0x89, 0x10, 0x71, 0x4F, 0x88, 0x20,
+0x72, 0x3F, 0x6B, 0x10, 0x73, 0x2F, 0x6A, 0x20, 0x74, 0x1F, 0x4D, 0x10, 0x75, 0x0F, 0x4C, 0x20,
+0x75, 0xFF, 0x2F, 0x10, 0x76, 0xEF, 0x2E, 0x20, 0x77, 0xDF, 0x11, 0x10, 0x78, 0xCF, 0x10, 0x20,
+0x79, 0xC8, 0x2D, 0x90, 0x7A, 0xB8, 0x2C, 0xA0, 0x7B, 0xA8, 0x0F, 0x90, 0x7C, 0x98, 0x0E, 0xA0,
+0x7D, 0x87, 0xF1, 0x90, 0x7E, 0x77, 0xF0, 0xA0, 0x7F, 0x67, 0xD3, 0x90, 0x01, 0x03, 0x02, 0x03,
+0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x64, 0x34, 0x00, 0x00, 0x00, 0x00,
+0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04,
+0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x4C, 0x4D, 0x54, 0x00,
+0x55, 0x4C, 0x41, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Urumqi */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xBA, 0x64,
+0x13, 0x6D, 0xD7, 0x20, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80,
+0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00,
+0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00,
+0x28, 0xD2, 0x23, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x00, 0x00, 0x52, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00,
+0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x55, 0x52,
+0x55, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Asia/Vientiane */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x46, 0x50,
+0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02,
+0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70,
+0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00,
+0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Vladivostok */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x16, 0xA7, 0x59, 0x47, 0x50,
+0xB5, 0xA3, 0xB6, 0xF0, 0x15, 0x27, 0x45, 0x60, 0x16, 0x18, 0x79, 0xD0, 0x17, 0x08, 0x78, 0xE0,
+0x17, 0xF9, 0xAD, 0x50, 0x18, 0xE9, 0xAC, 0x60, 0x19, 0xDA, 0xE0, 0xD0, 0x1A, 0xCC, 0x31, 0x60,
+0x1B, 0xBC, 0x3E, 0x80, 0x1C, 0xAC, 0x2F, 0x80, 0x1D, 0x9C, 0x20, 0x80, 0x1E, 0x8C, 0x11, 0x80,
+0x1F, 0x7C, 0x02, 0x80, 0x20, 0x6B, 0xF3, 0x80, 0x21, 0x5B, 0xE4, 0x80, 0x22, 0x4B, 0xD5, 0x80,
+0x23, 0x3B, 0xC6, 0x80, 0x24, 0x2B, 0xB7, 0x80, 0x25, 0x1B, 0xA8, 0x80, 0x26, 0x0B, 0x99, 0x80,
+0x27, 0x04, 0xC5, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xE4, 0xB5, 0x10, 0x29, 0x78, 0x5D, 0x10,
+0x29, 0xD4, 0x6D, 0xD0, 0x2A, 0xC4, 0x50, 0xC0, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xA4, 0x6B, 0x00,
+0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x84, 0x4D, 0x00, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x64, 0x2F, 0x00,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xFA, 0xF8, 0x00, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80,
+0x44, 0x25, 0x69, 0x00, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80,
+0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00,
+0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x7B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00,
+0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x00, 0x00, 0x8C,
+0xA0, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0F, 0x00,
+0x00, 0x7E, 0x90, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x56, 0x4C, 0x41, 0x54, 0x00, 0x56, 0x4C,
+0x41, 0x53, 0x54, 0x00, 0x56, 0x4C, 0x41, 0x53, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Yakutsk */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xDB, 0xEA, 0x70,
+0xB5, 0xA3, 0xC5, 0x00, 0x15, 0x27, 0x53, 0x70, 0x16, 0x18, 0x87, 0xE0, 0x17, 0x08, 0x86, 0xF0,
+0x17, 0xF9, 0xBB, 0x60, 0x18, 0xE9, 0xBA, 0x70, 0x19, 0xDA, 0xEE, 0xE0, 0x1A, 0xCC, 0x3F, 0x70,
+0x1B, 0xBC, 0x4C, 0x90, 0x1C, 0xAC, 0x3D, 0x90, 0x1D, 0x9C, 0x2E, 0x90, 0x1E, 0x8C, 0x1F, 0x90,
+0x1F, 0x7C, 0x10, 0x90, 0x20, 0x6C, 0x01, 0x90, 0x21, 0x5B, 0xF2, 0x90, 0x22, 0x4B, 0xE3, 0x90,
+0x23, 0x3B, 0xD4, 0x90, 0x24, 0x2B, 0xC5, 0x90, 0x25, 0x1B, 0xB6, 0x90, 0x26, 0x0B, 0xA7, 0x90,
+0x27, 0x04, 0xD3, 0x10, 0x27, 0xF4, 0xC4, 0x10, 0x28, 0xE4, 0xC3, 0x20, 0x29, 0x78, 0x6B, 0x20,
+0x29, 0xD4, 0x7B, 0xE0, 0x2A, 0xC4, 0x5E, 0xD0, 0x2B, 0xB4, 0x88, 0x10, 0x2C, 0xA4, 0x79, 0x10,
+0x2D, 0x94, 0x6A, 0x10, 0x2E, 0x84, 0x5B, 0x10, 0x2F, 0x74, 0x4C, 0x10, 0x30, 0x64, 0x3D, 0x10,
+0x31, 0x5D, 0x68, 0x90, 0x32, 0x72, 0x43, 0x90, 0x33, 0x3D, 0x4A, 0x90, 0x34, 0x52, 0x25, 0x90,
+0x35, 0x1D, 0x2C, 0x90, 0x36, 0x32, 0x07, 0x90, 0x36, 0xFD, 0x0E, 0x90, 0x38, 0x1B, 0x24, 0x10,
+0x38, 0xDC, 0xF0, 0x90, 0x39, 0xFB, 0x06, 0x10, 0x3A, 0xBC, 0xD2, 0x90, 0x3B, 0xDA, 0xE8, 0x10,
+0x3C, 0xA5, 0xEF, 0x10, 0x3D, 0xBA, 0xCA, 0x10, 0x3E, 0x85, 0xD1, 0x10, 0x3F, 0x9A, 0xAC, 0x10,
+0x40, 0x65, 0xB3, 0x10, 0x41, 0x83, 0xC8, 0x90, 0x42, 0x45, 0x95, 0x10, 0x43, 0x63, 0xAA, 0x90,
+0x44, 0x25, 0x77, 0x10, 0x45, 0x43, 0x8C, 0x90, 0x46, 0x05, 0x59, 0x10, 0x47, 0x23, 0x6E, 0x90,
+0x47, 0xEE, 0x75, 0x90, 0x49, 0x03, 0x50, 0x90, 0x49, 0xCE, 0x57, 0x90, 0x4A, 0xE3, 0x32, 0x90,
+0x4B, 0xAE, 0x39, 0x90, 0x4C, 0xCC, 0x4F, 0x10, 0x4D, 0x8E, 0x1B, 0x90, 0x4E, 0xAC, 0x31, 0x10,
+0x4F, 0x6D, 0xFD, 0x90, 0x50, 0x8C, 0x13, 0x10, 0x51, 0x57, 0x1A, 0x10, 0x52, 0x6B, 0xF5, 0x10,
+0x53, 0x36, 0xFC, 0x10, 0x54, 0x4B, 0xD7, 0x10, 0x55, 0x16, 0xDE, 0x10, 0x56, 0x2B, 0xB9, 0x10,
+0x56, 0xF6, 0xC0, 0x10, 0x58, 0x14, 0xD5, 0x90, 0x58, 0xD6, 0xA2, 0x10, 0x59, 0xF4, 0xB7, 0x90,
+0x5A, 0xB6, 0x84, 0x10, 0x5B, 0xD4, 0x99, 0x90, 0x5C, 0x9F, 0xA0, 0x90, 0x5D, 0xB4, 0x7B, 0x90,
+0x5E, 0x7F, 0x82, 0x90, 0x5F, 0x94, 0x5D, 0x90, 0x60, 0x5F, 0x64, 0x90, 0x61, 0x7D, 0x7A, 0x10,
+0x62, 0x3F, 0x46, 0x90, 0x63, 0x5D, 0x5C, 0x10, 0x64, 0x1F, 0x28, 0x90, 0x65, 0x3D, 0x3E, 0x10,
+0x66, 0x08, 0x45, 0x10, 0x67, 0x1D, 0x20, 0x10, 0x67, 0xE8, 0x27, 0x10, 0x68, 0xFD, 0x02, 0x10,
+0x69, 0xC8, 0x09, 0x10, 0x6A, 0xDC, 0xE4, 0x10, 0x6B, 0xA7, 0xEB, 0x10, 0x6C, 0xC6, 0x00, 0x90,
+0x6D, 0x87, 0xCD, 0x10, 0x6E, 0xA5, 0xE2, 0x90, 0x6F, 0x67, 0xAF, 0x10, 0x70, 0x85, 0xC4, 0x90,
+0x71, 0x50, 0xCB, 0x90, 0x72, 0x65, 0xA6, 0x90, 0x73, 0x30, 0xAD, 0x90, 0x74, 0x45, 0x88, 0x90,
+0x75, 0x10, 0x8F, 0x90, 0x76, 0x2E, 0xA5, 0x10, 0x76, 0xF0, 0x71, 0x90, 0x78, 0x0E, 0x87, 0x10,
+0x78, 0xD0, 0x53, 0x90, 0x79, 0xEE, 0x69, 0x10, 0x7A, 0xB0, 0x35, 0x90, 0x7B, 0xCE, 0x4B, 0x10,
+0x7C, 0x99, 0x52, 0x10, 0x7D, 0xAE, 0x2D, 0x10, 0x7E, 0x79, 0x34, 0x10, 0x7F, 0x8E, 0x0F, 0x10,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x79, 0x90, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00,
+0x04, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E,
+0x90, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00,
+0x00, 0x70, 0x80, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x59, 0x41, 0x4B, 0x54, 0x00, 0x59, 0x41,
+0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Yekaterinburg */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0x12, 0xAD, 0xF0,
+0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30,
+0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0,
+0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0,
+0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0,
+0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0,
+0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x78, 0xA3, 0x60,
+0x29, 0xD4, 0xB4, 0x20, 0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50,
+0x2D, 0x94, 0xA2, 0x50, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x75, 0x50,
+0x31, 0x5D, 0xA0, 0xD0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x5D, 0xD0,
+0x35, 0x1D, 0x64, 0xD0, 0x36, 0x32, 0x3F, 0xD0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x5C, 0x50,
+0x38, 0xDD, 0x28, 0xD0, 0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x0A, 0xD0, 0x3B, 0xDB, 0x20, 0x50,
+0x3C, 0xA6, 0x27, 0x50, 0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x09, 0x50, 0x3F, 0x9A, 0xE4, 0x50,
+0x40, 0x65, 0xEB, 0x50, 0x41, 0x84, 0x00, 0xD0, 0x42, 0x45, 0xCD, 0x50, 0x43, 0x63, 0xE2, 0xD0,
+0x44, 0x25, 0xAF, 0x50, 0x45, 0x43, 0xC4, 0xD0, 0x46, 0x05, 0x91, 0x50, 0x47, 0x23, 0xA6, 0xD0,
+0x47, 0xEE, 0xAD, 0xD0, 0x49, 0x03, 0x88, 0xD0, 0x49, 0xCE, 0x8F, 0xD0, 0x4A, 0xE3, 0x6A, 0xD0,
+0x4B, 0xAE, 0x71, 0xD0, 0x4C, 0xCC, 0x87, 0x50, 0x4D, 0x8E, 0x53, 0xD0, 0x4E, 0xAC, 0x69, 0x50,
+0x4F, 0x6E, 0x35, 0xD0, 0x50, 0x8C, 0x4B, 0x50, 0x51, 0x57, 0x52, 0x50, 0x52, 0x6C, 0x2D, 0x50,
+0x53, 0x37, 0x34, 0x50, 0x54, 0x4C, 0x0F, 0x50, 0x55, 0x17, 0x16, 0x50, 0x56, 0x2B, 0xF1, 0x50,
+0x56, 0xF6, 0xF8, 0x50, 0x58, 0x15, 0x0D, 0xD0, 0x58, 0xD6, 0xDA, 0x50, 0x59, 0xF4, 0xEF, 0xD0,
+0x5A, 0xB6, 0xBC, 0x50, 0x5B, 0xD4, 0xD1, 0xD0, 0x5C, 0x9F, 0xD8, 0xD0, 0x5D, 0xB4, 0xB3, 0xD0,
+0x5E, 0x7F, 0xBA, 0xD0, 0x5F, 0x94, 0x95, 0xD0, 0x60, 0x5F, 0x9C, 0xD0, 0x61, 0x7D, 0xB2, 0x50,
+0x62, 0x3F, 0x7E, 0xD0, 0x63, 0x5D, 0x94, 0x50, 0x64, 0x1F, 0x60, 0xD0, 0x65, 0x3D, 0x76, 0x50,
+0x66, 0x08, 0x7D, 0x50, 0x67, 0x1D, 0x58, 0x50, 0x67, 0xE8, 0x5F, 0x50, 0x68, 0xFD, 0x3A, 0x50,
+0x69, 0xC8, 0x41, 0x50, 0x6A, 0xDD, 0x1C, 0x50, 0x6B, 0xA8, 0x23, 0x50, 0x6C, 0xC6, 0x38, 0xD0,
+0x6D, 0x88, 0x05, 0x50, 0x6E, 0xA6, 0x1A, 0xD0, 0x6F, 0x67, 0xE7, 0x50, 0x70, 0x85, 0xFC, 0xD0,
+0x71, 0x51, 0x03, 0xD0, 0x72, 0x65, 0xDE, 0xD0, 0x73, 0x30, 0xE5, 0xD0, 0x74, 0x45, 0xC0, 0xD0,
+0x75, 0x10, 0xC7, 0xD0, 0x76, 0x2E, 0xDD, 0x50, 0x76, 0xF0, 0xA9, 0xD0, 0x78, 0x0E, 0xBF, 0x50,
+0x78, 0xD0, 0x8B, 0xD0, 0x79, 0xEE, 0xA1, 0x50, 0x7A, 0xB0, 0x6D, 0xD0, 0x7B, 0xCE, 0x83, 0x50,
+0x7C, 0x99, 0x8A, 0x50, 0x7D, 0xAE, 0x65, 0x50, 0x7E, 0x79, 0x6C, 0x50, 0x7F, 0x8E, 0x47, 0x50,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x0B, 0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x38, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00,
+0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46,
+0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00,
+0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00,
+0x15, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x4C, 0x4D, 0x54,
+0x00, 0x53, 0x56, 0x45, 0x54, 0x00, 0x53, 0x56, 0x45, 0x53, 0x54, 0x00, 0x59, 0x45, 0x4B, 0x53,
+0x54, 0x00, 0x59, 0x45, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Asia/Yerevan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x9A, 0x48,
+0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40,
+0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0,
+0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0,
+0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0,
+0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0,
+0x27, 0x05, 0x19, 0x60, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xDC, 0xF6, 0x40, 0x28, 0xE5, 0x09, 0x70,
+0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70,
+0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70,
+0x32, 0xC9, 0x70, 0xC0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0,
+0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0,
+0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60,
+0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60,
+0x41, 0x84, 0x0E, 0xE0, 0x42, 0x45, 0xDB, 0x60, 0x43, 0x63, 0xF0, 0xE0, 0x44, 0x25, 0xBD, 0x60,
+0x45, 0x43, 0xD2, 0xE0, 0x46, 0x05, 0x9F, 0x60, 0x47, 0x23, 0xB4, 0xE0, 0x47, 0xEE, 0xBB, 0xE0,
+0x49, 0x03, 0x96, 0xE0, 0x49, 0xCE, 0x9D, 0xE0, 0x4A, 0xE3, 0x78, 0xE0, 0x4B, 0xAE, 0x7F, 0xE0,
+0x4C, 0xCC, 0x95, 0x60, 0x4D, 0x8E, 0x61, 0xE0, 0x4E, 0xAC, 0x77, 0x60, 0x4F, 0x6E, 0x43, 0xE0,
+0x50, 0x8C, 0x59, 0x60, 0x51, 0x57, 0x60, 0x60, 0x52, 0x6C, 0x3B, 0x60, 0x53, 0x37, 0x42, 0x60,
+0x54, 0x4C, 0x1D, 0x60, 0x55, 0x17, 0x24, 0x60, 0x56, 0x2B, 0xFF, 0x60, 0x56, 0xF7, 0x06, 0x60,
+0x58, 0x15, 0x1B, 0xE0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xFD, 0xE0, 0x5A, 0xB6, 0xCA, 0x60,
+0x5B, 0xD4, 0xDF, 0xE0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xC1, 0xE0, 0x5E, 0x7F, 0xC8, 0xE0,
+0x5F, 0x94, 0xA3, 0xE0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xC0, 0x60, 0x62, 0x3F, 0x8C, 0xE0,
+0x63, 0x5D, 0xA2, 0x60, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x84, 0x60, 0x66, 0x08, 0x8B, 0x60,
+0x67, 0x1D, 0x66, 0x60, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x48, 0x60, 0x69, 0xC8, 0x4F, 0x60,
+0x6A, 0xDD, 0x2A, 0x60, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x46, 0xE0, 0x6D, 0x88, 0x13, 0x60,
+0x6E, 0xA6, 0x28, 0xE0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x86, 0x0A, 0xE0, 0x71, 0x51, 0x11, 0xE0,
+0x72, 0x65, 0xEC, 0xE0, 0x73, 0x30, 0xF3, 0xE0, 0x74, 0x45, 0xCE, 0xE0, 0x75, 0x10, 0xD5, 0xE0,
+0x76, 0x2E, 0xEB, 0x60, 0x76, 0xF0, 0xB7, 0xE0, 0x78, 0x0E, 0xCD, 0x60, 0x78, 0xD0, 0x99, 0xE0,
+0x79, 0xEE, 0xAF, 0x60, 0x7A, 0xB0, 0x7B, 0xE0, 0x7B, 0xCE, 0x91, 0x60, 0x7C, 0x99, 0x98, 0x60,
+0x7D, 0xAE, 0x73, 0x60, 0x7E, 0x79, 0x7A, 0x60, 0x7F, 0x8E, 0x55, 0x60, 0x01, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x06, 0x08, 0x07, 0x08, 0x09, 0x0A, 0x07, 0x0A, 0x07, 0x0A, 0x0B, 0x0D, 0x0C, 0x0B,
+0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B,
+0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B,
+0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B,
+0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B,
+0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B,
+0x00, 0x00, 0x29, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50,
+0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00,
+0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0F,
+0x00, 0x00, 0x38, 0x40, 0x01, 0x13, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0F, 0x00, 0x00, 0x38, 0x40,
+0x01, 0x13, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x01, 0x13, 0x00, 0x00,
+0x38, 0x40, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x59, 0x45, 0x52, 0x54, 0x00, 0x59, 0x45, 0x52,
+0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Atlantic/Azores */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x19, 0x91, 0xC1, 0xFC, 0x58,
+0x9B, 0x4B, 0x89, 0x90, 0x9B, 0xFE, 0xE3, 0xA0, 0x9C, 0x9D, 0x09, 0x90, 0x9D, 0xC9, 0x9F, 0x90,
+0x9E, 0x7F, 0x8E, 0x90, 0x9F, 0xAA, 0xD3, 0x10, 0xA0, 0x5F, 0x70, 0x90, 0xA1, 0x8C, 0x06, 0x90,
+0xA2, 0x41, 0xF5, 0x90, 0xA3, 0x6E, 0x8B, 0x90, 0xA4, 0x23, 0x29, 0x10, 0xA5, 0x4F, 0xBF, 0x10,
+0xAA, 0x06, 0x0B, 0x90, 0xAA, 0xF4, 0xAB, 0x10, 0xAD, 0xC9, 0xC4, 0x10, 0xAE, 0xA7, 0x40, 0x10,
+0xAF, 0xA0, 0x6B, 0x90, 0xB0, 0x87, 0x22, 0x10, 0xB1, 0x89, 0x88, 0x10, 0xB2, 0x70, 0x3E, 0x90,
+0xB3, 0x72, 0xA4, 0x90, 0xB4, 0x50, 0x20, 0x90, 0xB7, 0x32, 0x68, 0x90, 0xB8, 0x0F, 0xE4, 0x90,
+0xB8, 0xFF, 0xD5, 0x90, 0xB9, 0xEF, 0xC6, 0x90, 0xBC, 0xC8, 0xD4, 0x10, 0xBD, 0xB8, 0xC5, 0x10,
+0xBE, 0x9F, 0x7B, 0x90, 0xBF, 0x98, 0xA7, 0x10, 0xC0, 0x9B, 0x0D, 0x10, 0xC1, 0x78, 0x89, 0x10,
+0xC2, 0x68, 0x7A, 0x10, 0xC3, 0x58, 0x6B, 0x10, 0xC4, 0x3F, 0x21, 0x90, 0xC5, 0x38, 0x4D, 0x10,
+0xC6, 0x3A, 0xB3, 0x10, 0xC7, 0x58, 0xC8, 0x90, 0xC7, 0xD9, 0xFB, 0x90, 0xC9, 0x01, 0x4B, 0x90,
+0xC9, 0xF1, 0x3C, 0x90, 0xCA, 0xE2, 0x7F, 0x10, 0xCB, 0xB5, 0x6F, 0x10, 0xCB, 0xEC, 0xC0, 0x00,
+0xCC, 0x80, 0x68, 0x00, 0xCC, 0xDC, 0xBF, 0x10, 0xCD, 0x95, 0x51, 0x10, 0xCD, 0xC3, 0x67, 0x80,
+0xCE, 0x72, 0xBF, 0x00, 0xCE, 0xC5, 0xDB, 0x90, 0xCF, 0x75, 0x33, 0x10, 0xCF, 0xAC, 0x84, 0x00,
+0xD0, 0x52, 0xA1, 0x00, 0xD0, 0xA5, 0xBD, 0x90, 0xD1, 0x55, 0x15, 0x10, 0xD1, 0x8C, 0x66, 0x00,
+0xD2, 0x32, 0x83, 0x00, 0xD2, 0x85, 0x9F, 0x90, 0xD3, 0x59, 0xE1, 0x10, 0xD4, 0x49, 0xD2, 0x10,
+0xD5, 0x39, 0xED, 0x40, 0xD6, 0x29, 0xDE, 0x40, 0xD7, 0x19, 0xCF, 0x40, 0xD8, 0x09, 0xC0, 0x40,
+0xD8, 0xF9, 0xB1, 0x40, 0xD9, 0xE9, 0xA2, 0x40, 0xDC, 0xB9, 0x75, 0x40, 0xDD, 0xB2, 0xA0, 0xC0,
+0xDE, 0xA2, 0x91, 0xC0, 0xDF, 0x92, 0x82, 0xC0, 0xE0, 0x82, 0x73, 0xC0, 0xE1, 0x72, 0x64, 0xC0,
+0xE2, 0x62, 0x55, 0xC0, 0xE3, 0x52, 0x46, 0xC0, 0xE4, 0x42, 0x37, 0xC0, 0xE5, 0x32, 0x28, 0xC0,
+0xE6, 0x22, 0x19, 0xC0, 0xE7, 0x1B, 0x45, 0x40, 0xE8, 0x0B, 0x36, 0x40, 0xE8, 0xFB, 0x27, 0x40,
+0xE9, 0xEB, 0x18, 0x40, 0xEA, 0xDB, 0x09, 0x40, 0xEB, 0xCA, 0xFA, 0x40, 0xEC, 0xBA, 0xEB, 0x40,
+0xED, 0xAA, 0xDC, 0x40, 0xEE, 0x9A, 0xCD, 0x40, 0xEF, 0x8A, 0xBE, 0x40, 0xF0, 0x7A, 0xAF, 0x40,
+0xF1, 0x6A, 0xA0, 0x40, 0xF2, 0x63, 0xCB, 0xC0, 0xF3, 0x53, 0xBC, 0xC0, 0xF4, 0x43, 0xAD, 0xC0,
+0xF5, 0x33, 0x9E, 0xC0, 0xF6, 0x23, 0x8F, 0xC0, 0xF7, 0x13, 0x80, 0xC0, 0xF8, 0x03, 0x71, 0xC0,
+0xF8, 0xF3, 0x62, 0xC0, 0x0D, 0x9B, 0x29, 0x10, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90,
+0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x26, 0xA0, 0x13, 0x44, 0x09, 0x90,
+0x14, 0x34, 0x08, 0xA0, 0x15, 0x23, 0xF9, 0xA0, 0x16, 0x13, 0xEA, 0xA0, 0x17, 0x03, 0xDB, 0xA0,
+0x17, 0xF3, 0xCC, 0xA0, 0x18, 0xE3, 0xCB, 0xB0, 0x19, 0xD3, 0xAE, 0xA0, 0x1A, 0xC3, 0x9F, 0xA0,
+0x1B, 0xBC, 0xCB, 0x20, 0x1C, 0xAC, 0xBC, 0x20, 0x1D, 0x9C, 0xAD, 0x20, 0x1E, 0x8C, 0x9E, 0x20,
+0x1F, 0x7C, 0x8F, 0x20, 0x20, 0x6C, 0x80, 0x20, 0x21, 0x5C, 0x71, 0x20, 0x22, 0x4C, 0x62, 0x20,
+0x23, 0x3C, 0x53, 0x20, 0x24, 0x2C, 0x44, 0x20, 0x25, 0x1C, 0x35, 0x20, 0x26, 0x0C, 0x26, 0x20,
+0x27, 0x05, 0x51, 0xA0, 0x27, 0xF5, 0x42, 0xA0, 0x28, 0xE5, 0x33, 0xA0, 0x29, 0xD5, 0x24, 0xA0,
+0x2A, 0xC5, 0x15, 0xA0, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10,
+0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03,
+0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x08, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x09, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0xFF, 0xFF, 0xE5, 0x28, 0x00, 0x00, 0xFF, 0xFF,
+0xF1, 0xF0, 0x01, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x0A, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x04,
+0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A,
+0x48, 0x4D, 0x54, 0x00, 0x41, 0x5A, 0x4F, 0x53, 0x54, 0x00, 0x41, 0x5A, 0x4F, 0x54, 0x00, 0x41,
+0x5A, 0x4F, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01,
+
+/* Atlantic/Bermuda */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xB4, 0xC3, 0x1D, 0xD8,
+0x08, 0x20, 0xB3, 0x60, 0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50,
+0x0B, 0xE0, 0x77, 0x60, 0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0,
+0x0F, 0xA9, 0x75, 0xE0, 0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0,
+0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0,
+0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50,
+0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50,
+0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50,
+0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0,
+0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0,
+0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50,
+0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50,
+0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50,
+0x35, 0x27, 0x1D, 0xE0, 0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0,
+0x38, 0xE6, 0xE1, 0xE0, 0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0,
+0x3C, 0xAF, 0xE0, 0x60, 0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0,
+0x40, 0x6F, 0xA4, 0x60, 0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50,
+0x44, 0x2F, 0x68, 0x60, 0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50,
+0x47, 0xF8, 0x66, 0xE0, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50,
+0x4B, 0xB8, 0x2A, 0xE0, 0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0,
+0x4F, 0x77, 0xEE, 0xE0, 0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0,
+0x53, 0x40, 0xED, 0x60, 0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0,
+0x57, 0x00, 0xB1, 0x60, 0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50,
+0x5A, 0xC0, 0x75, 0x60, 0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50,
+0x5E, 0x89, 0x73, 0xE0, 0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0,
+0x62, 0x49, 0x37, 0xE0, 0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0,
+0x66, 0x12, 0x36, 0x60, 0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0,
+0x69, 0xD1, 0xFA, 0x60, 0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50,
+0x6D, 0x91, 0xBE, 0x60, 0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50,
+0x71, 0x5A, 0xBC, 0xE0, 0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50,
+0x75, 0x1A, 0x80, 0xE0, 0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0,
+0x78, 0xDA, 0x44, 0xE0, 0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0,
+0x7C, 0xA3, 0x43, 0x60, 0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0xFF, 0xFF, 0xC3, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5,
+0xD0, 0x01, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Atlantic/Canary */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA6, 0x04, 0x5C, 0xF0,
+0xD4, 0x41, 0xF7, 0x20, 0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xF1, 0x90, 0x00, 0x00,
+0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10,
+0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x4C, 0x4D,
+0x54, 0x00, 0x43, 0x41, 0x4E, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Atlantic/Cape_Verde */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x89, 0x7F, 0x51, 0x8C,
+0xCC, 0x95, 0x9C, 0x20, 0xD2, 0x74, 0x7C, 0x10, 0x0B, 0x17, 0xF7, 0x40, 0x01, 0x02, 0x01, 0x03,
+0xFF, 0xFF, 0xE9, 0xF4, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0,
+0x01, 0x08, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x56, 0x54, 0x00,
+0x43, 0x56, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Atlantic/Faeroe */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x8B, 0x6D, 0xA4, 0x58,
+0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90,
+0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0xFF, 0xFF, 0xF9, 0xA8, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01,
+
+/* Atlantic/Jan_Mayen */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x27, 0xE3, 0x00,
+0x9B, 0xD4, 0x7B, 0x60, 0xC8, 0xB7, 0x4D, 0x60, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10,
+0xD2, 0x62, 0x07, 0x10, 0xEB, 0xAF, 0x20, 0x90, 0xEC, 0xA8, 0x4C, 0x10, 0xED, 0x98, 0x3D, 0x10,
+0xEE, 0x88, 0x2E, 0x10, 0xEF, 0x78, 0x1F, 0x10, 0xF0, 0x68, 0x10, 0x10, 0xF1, 0x58, 0x01, 0x10,
+0xF2, 0x47, 0xF2, 0x10, 0xF3, 0x37, 0xE3, 0x10, 0xF4, 0x27, 0xD4, 0x10, 0xF5, 0x17, 0xC5, 0x10,
+0xF6, 0x10, 0xF0, 0x90, 0xF7, 0x2F, 0x06, 0x10, 0xF7, 0xF0, 0xD2, 0x90, 0x12, 0xCE, 0x97, 0xF0,
+0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00,
+0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Atlantic/Madeira */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0x91, 0xC1, 0xF1, 0x58,
+0x9B, 0x4B, 0x7B, 0x80, 0x9B, 0xFE, 0xD5, 0x90, 0x9C, 0x9C, 0xFB, 0x80, 0x9D, 0xC9, 0x91, 0x80,
+0x9E, 0x7F, 0x80, 0x80, 0x9F, 0xAA, 0xC5, 0x00, 0xA0, 0x5F, 0x62, 0x80, 0xA1, 0x8B, 0xF8, 0x80,
+0xA2, 0x41, 0xE7, 0x80, 0xA3, 0x6E, 0x7D, 0x80, 0xA4, 0x23, 0x1B, 0x00, 0xA5, 0x4F, 0xB1, 0x00,
+0xAA, 0x05, 0xFD, 0x80, 0xAA, 0xF4, 0x9D, 0x00, 0xAD, 0xC9, 0xB6, 0x00, 0xAE, 0xA7, 0x32, 0x00,
+0xAF, 0xA0, 0x5D, 0x80, 0xB0, 0x87, 0x14, 0x00, 0xB1, 0x89, 0x7A, 0x00, 0xB2, 0x70, 0x30, 0x80,
+0xB3, 0x72, 0x96, 0x80, 0xB4, 0x50, 0x12, 0x80, 0xB7, 0x32, 0x5A, 0x80, 0xB8, 0x0F, 0xD6, 0x80,
+0xB8, 0xFF, 0xC7, 0x80, 0xB9, 0xEF, 0xB8, 0x80, 0xBC, 0xC8, 0xC6, 0x00, 0xBD, 0xB8, 0xB7, 0x00,
+0xBE, 0x9F, 0x6D, 0x80, 0xBF, 0x98, 0x99, 0x00, 0xC0, 0x9A, 0xFF, 0x00, 0xC1, 0x78, 0x7B, 0x00,
+0xC2, 0x68, 0x6C, 0x00, 0xC3, 0x58, 0x5D, 0x00, 0xC4, 0x3F, 0x13, 0x80, 0xC5, 0x38, 0x3F, 0x00,
+0xC6, 0x3A, 0xA5, 0x00, 0xC7, 0x58, 0xBA, 0x80, 0xC7, 0xD9, 0xED, 0x80, 0xC9, 0x01, 0x3D, 0x80,
+0xC9, 0xF1, 0x2E, 0x80, 0xCA, 0xE2, 0x71, 0x00, 0xCB, 0xB5, 0x61, 0x00, 0xCB, 0xEC, 0xB1, 0xF0,
+0xCC, 0x80, 0x59, 0xF0, 0xCC, 0xDC, 0xB1, 0x00, 0xCD, 0x95, 0x43, 0x00, 0xCD, 0xC3, 0x59, 0x70,
+0xCE, 0x72, 0xB0, 0xF0, 0xCE, 0xC5, 0xCD, 0x80, 0xCF, 0x75, 0x25, 0x00, 0xCF, 0xAC, 0x75, 0xF0,
+0xD0, 0x52, 0x92, 0xF0, 0xD0, 0xA5, 0xAF, 0x80, 0xD1, 0x55, 0x07, 0x00, 0xD1, 0x8C, 0x57, 0xF0,
+0xD2, 0x32, 0x74, 0xF0, 0xD2, 0x85, 0x91, 0x80, 0xD3, 0x59, 0xD3, 0x00, 0xD4, 0x49, 0xC4, 0x00,
+0xD5, 0x39, 0xDF, 0x30, 0xD6, 0x29, 0xD0, 0x30, 0xD7, 0x19, 0xC1, 0x30, 0xD8, 0x09, 0xB2, 0x30,
+0xD8, 0xF9, 0xA3, 0x30, 0xD9, 0xE9, 0x94, 0x30, 0xDC, 0xB9, 0x67, 0x30, 0xDD, 0xB2, 0x92, 0xB0,
+0xDE, 0xA2, 0x83, 0xB0, 0xDF, 0x92, 0x74, 0xB0, 0xE0, 0x82, 0x65, 0xB0, 0xE1, 0x72, 0x56, 0xB0,
+0xE2, 0x62, 0x47, 0xB0, 0xE3, 0x52, 0x38, 0xB0, 0xE4, 0x42, 0x29, 0xB0, 0xE5, 0x32, 0x1A, 0xB0,
+0xE6, 0x22, 0x0B, 0xB0, 0xE7, 0x1B, 0x37, 0x30, 0xE8, 0x0B, 0x28, 0x30, 0xE8, 0xFB, 0x19, 0x30,
+0xE9, 0xEB, 0x0A, 0x30, 0xEA, 0xDA, 0xFB, 0x30, 0xEB, 0xCA, 0xEC, 0x30, 0xEC, 0xBA, 0xDD, 0x30,
+0xED, 0xAA, 0xCE, 0x30, 0xEE, 0x9A, 0xBF, 0x30, 0xEF, 0x8A, 0xB0, 0x30, 0xF0, 0x7A, 0xA1, 0x30,
+0xF1, 0x6A, 0x92, 0x30, 0xF2, 0x63, 0xBD, 0xB0, 0xF3, 0x53, 0xAE, 0xB0, 0xF4, 0x43, 0x9F, 0xB0,
+0xF5, 0x33, 0x90, 0xB0, 0xF6, 0x23, 0x81, 0xB0, 0xF7, 0x13, 0x72, 0xB0, 0xF8, 0x03, 0x63, 0xB0,
+0xF8, 0xF3, 0x54, 0xB0, 0x0D, 0x9B, 0x1B, 0x00, 0x0E, 0x8B, 0x0C, 0x00, 0x0F, 0x84, 0x37, 0x80,
+0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x18, 0x90, 0x13, 0x43, 0xFB, 0x80,
+0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90,
+0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xBD, 0xA0, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90,
+0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10,
+0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10,
+0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10,
+0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90,
+0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10,
+0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03,
+0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x08, 0x06, 0x07,
+0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0xFF, 0xFF, 0xF0, 0x28, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04,
+0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0F, 0x00, 0x00, 0x0E, 0x10,
+0x01, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x15, 0x46, 0x4D, 0x54, 0x00, 0x4D, 0x41,
+0x44, 0x53, 0x54, 0x00, 0x4D, 0x41, 0x44, 0x54, 0x00, 0x4D, 0x41, 0x44, 0x4D, 0x54, 0x00, 0x57,
+0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Atlantic/Reykjavik */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x8B, 0x60, 0x83, 0x94,
+0x9C, 0x91, 0x1E, 0x00, 0x9D, 0xD1, 0x88, 0x90, 0x9E, 0x72, 0x51, 0x80, 0x9F, 0xD5, 0x03, 0x10,
+0xC6, 0x4D, 0x1A, 0x00, 0xC7, 0x66, 0x05, 0xA0, 0xC7, 0xDA, 0x17, 0xB0, 0xC9, 0x26, 0x43, 0xA0,
+0xC9, 0xC3, 0x26, 0x20, 0xCB, 0x06, 0x25, 0xA0, 0xCB, 0xAC, 0x42, 0xA0, 0xCC, 0xDC, 0xCD, 0x20,
+0xCD, 0x8C, 0x24, 0xA0, 0xCE, 0xBC, 0xAF, 0x20, 0xCF, 0x6C, 0x06, 0xA0, 0xD0, 0x9C, 0x91, 0x20,
+0xD1, 0x4B, 0xE8, 0xA0, 0xD2, 0x85, 0xAD, 0xA0, 0xD3, 0x2B, 0xCA, 0xA0, 0xD4, 0x65, 0x8F, 0xA0,
+0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x45, 0x71, 0xA0, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x25, 0x53, 0xA0,
+0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xD9, 0x77, 0x20, 0xDB, 0xE5, 0x17, 0xA0,
+0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xCE, 0x34, 0x20, 0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0xAE, 0x16, 0x20,
+0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x8D, 0xF8, 0x20, 0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x6D, 0xDA, 0x20,
+0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x4D, 0xBC, 0x20, 0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x36, 0xD8, 0xA0,
+0xE8, 0x0B, 0x1A, 0x20, 0xE9, 0x16, 0xBA, 0xA0, 0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xF6, 0x9C, 0xA0,
+0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xD6, 0x7E, 0xA0, 0xED, 0xAA, 0xC0, 0x20, 0xEE, 0xB6, 0x60, 0xA0,
+0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x96, 0x42, 0xA0, 0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x7F, 0x5F, 0x20,
+0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x3F, 0x23, 0x20,
+0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xF3, 0x46, 0xA0, 0xF9, 0xFE, 0xE7, 0x20,
+0xFA, 0xD3, 0x28, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0xBC, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0xFF, 0xFF, 0xEB, 0x6C,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D,
+0x52, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x53, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Atlantic/South_Georgia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xE3, 0xE0,
+0x00, 0x00, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00,
+
+/* Atlantic/Stanley */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x93, 0x44, 0x5F, 0x3C,
+0xC3, 0x4F, 0x5A, 0xC0, 0xC4, 0x36, 0x03, 0x30, 0xC5, 0x2F, 0x3C, 0xC0, 0xC6, 0x15, 0xE5, 0x30,
+0xC7, 0x18, 0x59, 0x40, 0xC7, 0xFF, 0x01, 0xB0, 0xC8, 0xF8, 0x3B, 0x40, 0xC9, 0xDE, 0xE3, 0xB0,
+0xCA, 0xD8, 0x1D, 0x40, 0xCB, 0xBE, 0xC5, 0xB0, 0xCC, 0xB7, 0xFF, 0x40, 0xCD, 0x36, 0x81, 0x30,
+0x19, 0x11, 0xFE, 0x40, 0x19, 0xD3, 0xBC, 0xB0, 0x1A, 0xF1, 0xC4, 0x20, 0x1B, 0xAA, 0x64, 0x30,
+0x1C, 0xD1, 0xA6, 0x20, 0x1D, 0x8A, 0x46, 0x30, 0x1E, 0xA8, 0x5B, 0xB0, 0x1F, 0x6A, 0x36, 0x40,
+0x20, 0x88, 0x3D, 0xB0, 0x21, 0x4A, 0x18, 0x40, 0x22, 0x68, 0x1F, 0xB0, 0x23, 0x29, 0xFA, 0x40,
+0x24, 0x48, 0x01, 0xB0, 0x25, 0x09, 0xDC, 0x40, 0x26, 0x31, 0x1E, 0x30, 0x26, 0xE9, 0xBE, 0x40,
+0x28, 0x11, 0x00, 0x30, 0x28, 0xD2, 0xDA, 0xC0, 0x29, 0xF0, 0xE2, 0x30, 0x2A, 0xB2, 0xBC, 0xC0,
+0x2B, 0xD0, 0xC4, 0x30, 0x2C, 0x92, 0x9E, 0xC0, 0x2D, 0xB0, 0xA6, 0x30, 0x2E, 0x72, 0x80, 0xC0,
+0x2F, 0x90, 0x88, 0x30, 0x30, 0x52, 0x62, 0xC0, 0x31, 0x79, 0xA4, 0xB0, 0x32, 0x3B, 0x7F, 0x40,
+0x33, 0x59, 0x86, 0xB0, 0x34, 0x1B, 0x61, 0x40, 0x35, 0x39, 0x68, 0xB0, 0x35, 0xFB, 0x43, 0x40,
+0x37, 0x19, 0x4A, 0xB0, 0x37, 0xDB, 0x25, 0x40, 0x38, 0xF9, 0x2C, 0xB0, 0x39, 0xBB, 0x07, 0x40,
+0x3A, 0xD9, 0x2A, 0xD0, 0x3B, 0x91, 0xCA, 0xE0, 0x3C, 0xC2, 0x47, 0x50, 0x3D, 0x71, 0xAC, 0xE0,
+0x3E, 0xA2, 0x29, 0x50, 0x3F, 0x5A, 0xC9, 0x60, 0x40, 0x82, 0x0B, 0x50, 0x41, 0x3A, 0xAB, 0x60,
+0x42, 0x61, 0xED, 0x50, 0x43, 0x1A, 0x8D, 0x60, 0x44, 0x41, 0xCF, 0x50, 0x44, 0xFA, 0x6F, 0x60,
+0x46, 0x21, 0xB1, 0x50, 0x46, 0xDA, 0x51, 0x60, 0x48, 0x0A, 0xCD, 0xD0, 0x48, 0xC3, 0x6D, 0xE0,
+0x49, 0xEA, 0xAF, 0xD0, 0x4A, 0xA3, 0x4F, 0xE0, 0x4B, 0xCA, 0x91, 0xD0, 0x4C, 0x83, 0x31, 0xE0,
+0x4D, 0xAA, 0x73, 0xD0, 0x4E, 0x63, 0x13, 0xE0, 0x4F, 0x8A, 0x55, 0xD0, 0x50, 0x42, 0xF5, 0xE0,
+0x51, 0x73, 0x72, 0x50, 0x52, 0x22, 0xD7, 0xE0, 0x53, 0x53, 0x54, 0x50, 0x54, 0x0B, 0xF4, 0x60,
+0x55, 0x33, 0x36, 0x50, 0x55, 0xEB, 0xD6, 0x60, 0x57, 0x13, 0x18, 0x50, 0x57, 0xCB, 0xB8, 0x60,
+0x58, 0xF2, 0xFA, 0x50, 0x59, 0xAB, 0x9A, 0x60, 0x5A, 0xD2, 0xDC, 0x50, 0x5B, 0x8B, 0x7C, 0x60,
+0x5C, 0xBB, 0xF8, 0xD0, 0x5D, 0x6B, 0x5E, 0x60, 0x5E, 0x9B, 0xDA, 0xD0, 0x5F, 0x54, 0x7A, 0xE0,
+0x60, 0x7B, 0xBC, 0xD0, 0x61, 0x34, 0x5C, 0xE0, 0x62, 0x5B, 0x9E, 0xD0, 0x63, 0x14, 0x3E, 0xE0,
+0x64, 0x3B, 0x80, 0xD0, 0x64, 0xF4, 0x20, 0xE0, 0x66, 0x24, 0x9D, 0x50, 0x66, 0xD4, 0x02, 0xE0,
+0x68, 0x04, 0x7F, 0x50, 0x68, 0xBD, 0x1F, 0x60, 0x69, 0xE4, 0x61, 0x50, 0x6A, 0x9D, 0x01, 0x60,
+0x6B, 0xC4, 0x43, 0x50, 0x6C, 0x7C, 0xE3, 0x60, 0x6D, 0xA4, 0x25, 0x50, 0x6E, 0x5C, 0xC5, 0x60,
+0x6F, 0x84, 0x07, 0x50, 0x70, 0x3C, 0xA7, 0x60, 0x71, 0x6D, 0x23, 0xD0, 0x72, 0x1C, 0x89, 0x60,
+0x73, 0x4D, 0x05, 0xD0, 0x74, 0x05, 0xA5, 0xE0, 0x75, 0x2C, 0xE7, 0xD0, 0x75, 0xE5, 0x87, 0xE0,
+0x77, 0x0C, 0xC9, 0xD0, 0x77, 0xC5, 0x69, 0xE0, 0x78, 0xEC, 0xAB, 0xD0, 0x79, 0xA5, 0x4B, 0xE0,
+0x7A, 0xCC, 0x8D, 0xD0, 0x7B, 0x85, 0x2D, 0xE0, 0x7C, 0xB5, 0xAA, 0x50, 0x7D, 0x6E, 0x4A, 0x60,
+0x7E, 0x95, 0x8C, 0x50, 0x7F, 0x4E, 0x2C, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0xFF, 0xFF, 0xC9, 0xC4, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF,
+0xFF, 0xC7, 0xC0, 0x00, 0x09, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00,
+0x09, 0x53, 0x4D, 0x54, 0x00, 0x46, 0x4B, 0x53, 0x54, 0x00, 0x46, 0x4B, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Atlantic/St_Helena */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDC, 0x42, 0x9B, 0x58,
+0x01, 0xFF, 0xFF, 0xFA, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4A, 0x4D, 0x54,
+0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/ACT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80,
+0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80,
+0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00,
+0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00,
+0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00,
+0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80,
+0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80,
+0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80,
+0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00,
+0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00,
+0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80,
+0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80,
+0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80,
+0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00,
+0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A,
+0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00,
+0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00,
+
+/* Australia/Adelaide */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4,
+0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88,
+0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88,
+0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88,
+0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88,
+0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08,
+0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08,
+0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08,
+0x16, 0xE7, 0xA6, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88,
+0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88,
+0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88,
+0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08,
+0x26, 0x02, 0x66, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08,
+0x29, 0xCB, 0x64, 0x88, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88,
+0x2D, 0x8B, 0x28, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x74, 0x45, 0x08, 0x30, 0x92, 0x5A, 0x88,
+0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88,
+0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08,
+0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, 0x3B, 0xDA, 0xE1, 0x08,
+0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, 0x3F, 0x9A, 0xA5, 0x08,
+0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, 0x43, 0x63, 0xA3, 0x88,
+0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, 0x47, 0x23, 0x67, 0x88,
+0x47, 0xEE, 0x6E, 0x88, 0x49, 0x03, 0x49, 0x88, 0x49, 0xCE, 0x50, 0x88, 0x4A, 0xE3, 0x2B, 0x88,
+0x4B, 0xAE, 0x32, 0x88, 0x4C, 0xCC, 0x48, 0x08, 0x4D, 0x8E, 0x14, 0x88, 0x4E, 0xAC, 0x2A, 0x08,
+0x4F, 0x6D, 0xF6, 0x88, 0x50, 0x8C, 0x0C, 0x08, 0x51, 0x57, 0x13, 0x08, 0x52, 0x6B, 0xEE, 0x08,
+0x53, 0x36, 0xF5, 0x08, 0x54, 0x4B, 0xD0, 0x08, 0x55, 0x16, 0xD7, 0x08, 0x56, 0x2B, 0xB2, 0x08,
+0x56, 0xF6, 0xB9, 0x08, 0x58, 0x14, 0xCE, 0x88, 0x58, 0xD6, 0x9B, 0x08, 0x59, 0xF4, 0xB0, 0x88,
+0x5A, 0xB6, 0x7D, 0x08, 0x5B, 0xD4, 0x92, 0x88, 0x5C, 0x9F, 0x99, 0x88, 0x5D, 0xB4, 0x74, 0x88,
+0x5E, 0x7F, 0x7B, 0x88, 0x5F, 0x94, 0x56, 0x88, 0x60, 0x5F, 0x5D, 0x88, 0x61, 0x7D, 0x73, 0x08,
+0x62, 0x3F, 0x3F, 0x88, 0x63, 0x5D, 0x55, 0x08, 0x64, 0x1F, 0x21, 0x88, 0x65, 0x3D, 0x37, 0x08,
+0x66, 0x08, 0x3E, 0x08, 0x67, 0x1D, 0x19, 0x08, 0x67, 0xE8, 0x20, 0x08, 0x68, 0xFC, 0xFB, 0x08,
+0x69, 0xC8, 0x02, 0x08, 0x6A, 0xDC, 0xDD, 0x08, 0x6B, 0xA7, 0xE4, 0x08, 0x6C, 0xC5, 0xF9, 0x88,
+0x6D, 0x87, 0xC6, 0x08, 0x6E, 0xA5, 0xDB, 0x88, 0x6F, 0x67, 0xA8, 0x08, 0x70, 0x85, 0xBD, 0x88,
+0x71, 0x50, 0xC4, 0x88, 0x72, 0x65, 0x9F, 0x88, 0x73, 0x30, 0xA6, 0x88, 0x74, 0x45, 0x81, 0x88,
+0x75, 0x10, 0x88, 0x88, 0x76, 0x2E, 0x9E, 0x08, 0x76, 0xF0, 0x6A, 0x88, 0x78, 0x0E, 0x80, 0x08,
+0x78, 0xD0, 0x4C, 0x88, 0x79, 0xEE, 0x62, 0x08, 0x7A, 0xB0, 0x2E, 0x88, 0x7B, 0xCE, 0x44, 0x08,
+0x7C, 0x99, 0x4B, 0x08, 0x7D, 0xAE, 0x26, 0x08, 0x7E, 0x79, 0x2D, 0x08, 0x7F, 0x8E, 0x08, 0x08,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x93,
+0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00,
+0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00,
+
+/* Australia/Brisbane */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x25, 0x49, 0xCD, 0x00, 0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00,
+0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, 0x29, 0xAF, 0xAE, 0x00, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x9A, 0xB0,
+0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00,
+0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Australia/Broken_Hill */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4,
+0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88,
+0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88,
+0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88,
+0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88,
+0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08,
+0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08,
+0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08,
+0x17, 0x0C, 0x90, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88,
+0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88,
+0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88,
+0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08,
+0x25, 0xEF, 0xF1, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08,
+0x29, 0xAF, 0xB5, 0x08, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88,
+0x2D, 0x78, 0xB3, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x58, 0x95, 0x88, 0x30, 0x92, 0x5A, 0x88,
+0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88,
+0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08,
+0x38, 0x6C, 0xAF, 0xD8, 0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88,
+0x3B, 0xDA, 0xE1, 0x08, 0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08,
+0x3F, 0x9A, 0xA5, 0x08, 0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08,
+0x43, 0x63, 0xA3, 0x88, 0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08,
+0x47, 0x23, 0x67, 0x88, 0x47, 0xEE, 0x6E, 0x88, 0x49, 0x03, 0x49, 0x88, 0x49, 0xCE, 0x50, 0x88,
+0x4A, 0xE3, 0x2B, 0x88, 0x4B, 0xAE, 0x32, 0x88, 0x4C, 0xCC, 0x48, 0x08, 0x4D, 0x8E, 0x14, 0x88,
+0x4E, 0xAC, 0x2A, 0x08, 0x4F, 0x6D, 0xF6, 0x88, 0x50, 0x8C, 0x0C, 0x08, 0x51, 0x57, 0x13, 0x08,
+0x52, 0x6B, 0xEE, 0x08, 0x53, 0x36, 0xF5, 0x08, 0x54, 0x4B, 0xD0, 0x08, 0x55, 0x16, 0xD7, 0x08,
+0x56, 0x2B, 0xB2, 0x08, 0x56, 0xF6, 0xB9, 0x08, 0x58, 0x14, 0xCE, 0x88, 0x58, 0xD6, 0x9B, 0x08,
+0x59, 0xF4, 0xB0, 0x88, 0x5A, 0xB6, 0x7D, 0x08, 0x5B, 0xD4, 0x92, 0x88, 0x5C, 0x9F, 0x99, 0x88,
+0x5D, 0xB4, 0x74, 0x88, 0x5E, 0x7F, 0x7B, 0x88, 0x5F, 0x94, 0x56, 0x88, 0x60, 0x5F, 0x5D, 0x88,
+0x61, 0x7D, 0x73, 0x08, 0x62, 0x3F, 0x3F, 0x88, 0x63, 0x5D, 0x55, 0x08, 0x64, 0x1F, 0x21, 0x88,
+0x65, 0x3D, 0x37, 0x08, 0x66, 0x08, 0x3E, 0x08, 0x67, 0x1D, 0x19, 0x08, 0x67, 0xE8, 0x20, 0x08,
+0x68, 0xFC, 0xFB, 0x08, 0x69, 0xC8, 0x02, 0x08, 0x6A, 0xDC, 0xDD, 0x08, 0x6B, 0xA7, 0xE4, 0x08,
+0x6C, 0xC5, 0xF9, 0x88, 0x6D, 0x87, 0xC6, 0x08, 0x6E, 0xA5, 0xDB, 0x88, 0x6F, 0x67, 0xA8, 0x08,
+0x70, 0x85, 0xBD, 0x88, 0x71, 0x50, 0xC4, 0x88, 0x72, 0x65, 0x9F, 0x88, 0x73, 0x30, 0xA6, 0x88,
+0x74, 0x45, 0x81, 0x88, 0x75, 0x10, 0x88, 0x88, 0x76, 0x2E, 0x9E, 0x08, 0x76, 0xF0, 0x6A, 0x88,
+0x78, 0x0E, 0x80, 0x08, 0x78, 0xD0, 0x4C, 0x88, 0x79, 0xEE, 0x62, 0x08, 0x7A, 0xB0, 0x2E, 0x88,
+0x7B, 0xCE, 0x44, 0x08, 0x7C, 0x99, 0x4B, 0x08, 0x7D, 0xAE, 0x26, 0x08, 0x7E, 0x79, 0x2D, 0x08,
+0x7F, 0x8E, 0x08, 0x08, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00,
+0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/Canberra */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80,
+0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80,
+0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00,
+0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00,
+0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00,
+0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80,
+0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80,
+0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80,
+0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00,
+0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00,
+0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80,
+0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80,
+0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80,
+0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00,
+0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A,
+0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00,
+0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00,
+
+/* Australia/Currie */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9B, 0xD5, 0x78, 0x80,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80,
+0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80,
+0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00,
+0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00,
+0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00,
+0x17, 0x03, 0x4F, 0x00, 0x18, 0x21, 0x64, 0x80, 0x18, 0xE3, 0x31, 0x00, 0x1A, 0x01, 0x46, 0x80,
+0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80,
+0x1E, 0x67, 0x27, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80,
+0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00,
+0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xED, 0xE1, 0x80,
+0x29, 0xD4, 0x98, 0x00, 0x2A, 0xCD, 0xC3, 0x80, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xAD, 0xA5, 0x80,
+0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x8D, 0x87, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x6D, 0x69, 0x80,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x56, 0x86, 0x00, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x36, 0x68, 0x00,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x16, 0x4A, 0x00, 0x36, 0xFD, 0x00, 0x80, 0x37, 0xF6, 0x2C, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xBF, 0x2A, 0x80,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0x9F, 0x0C, 0x80, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x7E, 0xEE, 0x80,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x5E, 0xD0, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x3E, 0xB2, 0x80,
+0x44, 0x2E, 0xA3, 0x80, 0x45, 0x1E, 0x94, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x07, 0xB1, 0x00,
+0x47, 0xEE, 0x67, 0x80, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xC7, 0x75, 0x00,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0x87, 0x39, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x70, 0x55, 0x80, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x50, 0x37, 0x80,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x30, 0x19, 0x80, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x0F, 0xFB, 0x80,
+0x56, 0xF6, 0xB2, 0x00, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xCF, 0xBF, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0x98, 0xBE, 0x00,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x58, 0x82, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x38, 0x64, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x18, 0x46, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x01, 0x62, 0x80, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xE1, 0x44, 0x80,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xA1, 0x08, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x6A, 0x07, 0x00,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x29, 0xCB, 0x00,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x77, 0xE9, 0x8F, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xB2, 0x8D, 0x80,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x72, 0x51, 0x80,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x8C,
+0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00,
+0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00,
+
+/* Australia/Darwin */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4,
+0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88,
+0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00,
+0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/Hobart */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9B, 0xD5, 0x78, 0x80,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0xFB, 0xC2, 0x8D, 0x00,
+0xFC, 0xB2, 0x7E, 0x00, 0xFD, 0xC7, 0x59, 0x00, 0xFE, 0x76, 0xB0, 0x80, 0xFF, 0xA7, 0x3B, 0x00,
+0x00, 0x56, 0x92, 0x80, 0x01, 0x87, 0x1D, 0x00, 0x02, 0x3F, 0xAF, 0x00, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80,
+0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80,
+0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00,
+0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00,
+0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00,
+0x17, 0x03, 0x4F, 0x00, 0x18, 0x21, 0x64, 0x80, 0x18, 0xE3, 0x31, 0x00, 0x1A, 0x01, 0x46, 0x80,
+0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80,
+0x1E, 0x67, 0x27, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80,
+0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00,
+0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xED, 0xE1, 0x80,
+0x29, 0xD4, 0x98, 0x00, 0x2A, 0xCD, 0xC3, 0x80, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xAD, 0xA5, 0x80,
+0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x8D, 0x87, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x6D, 0x69, 0x80,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x56, 0x86, 0x00, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x36, 0x68, 0x00,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x16, 0x4A, 0x00, 0x36, 0xFD, 0x00, 0x80, 0x37, 0xF6, 0x2C, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xBF, 0x2A, 0x80,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0x9F, 0x0C, 0x80, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x7E, 0xEE, 0x80,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x5E, 0xD0, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x3E, 0xB2, 0x80,
+0x44, 0x2E, 0xA3, 0x80, 0x45, 0x1E, 0x94, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x07, 0xB1, 0x00,
+0x47, 0xEE, 0x67, 0x80, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xC7, 0x75, 0x00,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0x87, 0x39, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x70, 0x55, 0x80, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x50, 0x37, 0x80,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x30, 0x19, 0x80, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x0F, 0xFB, 0x80,
+0x56, 0xF6, 0xB2, 0x00, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xCF, 0xBF, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0x98, 0xBE, 0x00,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x58, 0x82, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x38, 0x64, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x18, 0x46, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x01, 0x62, 0x80, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xE1, 0x44, 0x80,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xA1, 0x08, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x6A, 0x07, 0x00,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x29, 0xCB, 0x00,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x77, 0xE9, 0x8F, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xB2, 0x8D, 0x80,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x72, 0x51, 0x80,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01,
+0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/LHI */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x14, 0xFE, 0x66, 0xE0,
+0x16, 0x38, 0x40, 0xF8, 0x16, 0xE7, 0x8A, 0x68, 0x18, 0x21, 0x5D, 0x78, 0x18, 0xC7, 0x6C, 0x68,
+0x1A, 0x01, 0x3F, 0x78, 0x1A, 0xA7, 0x4E, 0x68, 0x1B, 0xE1, 0x21, 0x78, 0x1C, 0x87, 0x30, 0x68,
+0x1D, 0xC1, 0x03, 0x78, 0x1E, 0x79, 0x8E, 0x70, 0x1F, 0x97, 0xAA, 0xF8, 0x20, 0x59, 0x70, 0x70,
+0x21, 0x80, 0xC7, 0x78, 0x22, 0x42, 0x8C, 0xF0, 0x23, 0x69, 0xE3, 0xF8, 0x24, 0x22, 0x6E, 0xF0,
+0x25, 0x49, 0xC5, 0xF8, 0x25, 0xEF, 0xDB, 0xF0, 0x27, 0x29, 0xA7, 0xF8, 0x27, 0xCF, 0xBD, 0xF0,
+0x29, 0x09, 0x89, 0xF8, 0x29, 0xAF, 0x9F, 0xF0, 0x2A, 0xE9, 0x6B, 0xF8, 0x2B, 0x98, 0xBC, 0x70,
+0x2C, 0xD2, 0x88, 0x78, 0x2D, 0x78, 0x9E, 0x70, 0x2E, 0xB2, 0x6A, 0x78, 0x2F, 0x58, 0x80, 0x70,
+0x30, 0x92, 0x4C, 0x78, 0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x2E, 0x78, 0x33, 0x3D, 0x2E, 0x70,
+0x34, 0x52, 0x10, 0x78, 0x35, 0x1D, 0x10, 0x70, 0x36, 0x31, 0xF2, 0x78, 0x36, 0xFC, 0xF2, 0x70,
+0x38, 0x1B, 0x0E, 0xF8, 0x38, 0xDC, 0xD4, 0x70, 0x39, 0xA7, 0xE2, 0x78, 0x3A, 0xBC, 0xB6, 0x70,
+0x3B, 0xDA, 0xD2, 0xF8, 0x3C, 0xA5, 0xD2, 0xF0, 0x3D, 0xBA, 0xB4, 0xF8, 0x3E, 0x85, 0xB4, 0xF0,
+0x3F, 0x9A, 0x96, 0xF8, 0x40, 0x65, 0x96, 0xF0, 0x41, 0x83, 0xB3, 0x78, 0x42, 0x45, 0x78, 0xF0,
+0x43, 0x63, 0x95, 0x78, 0x44, 0x2E, 0x95, 0x70, 0x45, 0x43, 0x77, 0x78, 0x46, 0x05, 0x3C, 0xF0,
+0x47, 0x23, 0x59, 0x78, 0x47, 0xEE, 0x59, 0x70, 0x49, 0x03, 0x3B, 0x78, 0x49, 0xCE, 0x3B, 0x70,
+0x4A, 0xE3, 0x1D, 0x78, 0x4B, 0xAE, 0x1D, 0x70, 0x4C, 0xCC, 0x39, 0xF8, 0x4D, 0x8D, 0xFF, 0x70,
+0x4E, 0xAC, 0x1B, 0xF8, 0x4F, 0x6D, 0xE1, 0x70, 0x50, 0x8B, 0xFD, 0xF8, 0x51, 0x56, 0xFD, 0xF0,
+0x52, 0x6B, 0xDF, 0xF8, 0x53, 0x36, 0xDF, 0xF0, 0x54, 0x4B, 0xC1, 0xF8, 0x55, 0x16, 0xC1, 0xF0,
+0x56, 0x2B, 0xA3, 0xF8, 0x56, 0xF6, 0xA3, 0xF0, 0x58, 0x14, 0xC0, 0x78, 0x58, 0xD6, 0x85, 0xF0,
+0x59, 0xF4, 0xA2, 0x78, 0x5A, 0xB6, 0x67, 0xF0, 0x5B, 0xD4, 0x84, 0x78, 0x5C, 0x9F, 0x84, 0x70,
+0x5D, 0xB4, 0x66, 0x78, 0x5E, 0x7F, 0x66, 0x70, 0x5F, 0x94, 0x48, 0x78, 0x60, 0x5F, 0x48, 0x70,
+0x61, 0x7D, 0x64, 0xF8, 0x62, 0x3F, 0x2A, 0x70, 0x63, 0x5D, 0x46, 0xF8, 0x64, 0x1F, 0x0C, 0x70,
+0x65, 0x3D, 0x28, 0xF8, 0x66, 0x08, 0x28, 0xF0, 0x67, 0x1D, 0x0A, 0xF8, 0x67, 0xE8, 0x0A, 0xF0,
+0x68, 0xFC, 0xEC, 0xF8, 0x69, 0xC7, 0xEC, 0xF0, 0x6A, 0xDC, 0xCE, 0xF8, 0x6B, 0xA7, 0xCE, 0xF0,
+0x6C, 0xC5, 0xEB, 0x78, 0x6D, 0x87, 0xB0, 0xF0, 0x6E, 0xA5, 0xCD, 0x78, 0x6F, 0x67, 0x92, 0xF0,
+0x70, 0x85, 0xAF, 0x78, 0x71, 0x50, 0xAF, 0x70, 0x72, 0x65, 0x91, 0x78, 0x73, 0x30, 0x91, 0x70,
+0x74, 0x45, 0x73, 0x78, 0x75, 0x10, 0x73, 0x70, 0x76, 0x2E, 0x8F, 0xF8, 0x76, 0xF0, 0x55, 0x70,
+0x78, 0x0E, 0x71, 0xF8, 0x78, 0xD0, 0x37, 0x70, 0x79, 0xEE, 0x53, 0xF8, 0x7A, 0xB0, 0x19, 0x70,
+0x7B, 0xCE, 0x35, 0xF8, 0x7C, 0x99, 0x35, 0xF0, 0x7D, 0xAE, 0x17, 0xF8, 0x7E, 0x79, 0x17, 0xF0,
+0x7F, 0x8D, 0xF9, 0xF8, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8,
+0x01, 0x04, 0x00, 0x00, 0x93, 0xA8, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x04, 0x45, 0x53,
+0x54, 0x00, 0x4C, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/Lindeman */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x25, 0x49, 0xCD, 0x00, 0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00,
+0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, 0x29, 0xAF, 0xAE, 0x00, 0x2A, 0x50, 0x68, 0xE0,
+0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, 0x2D, 0x78, 0xAC, 0x80,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x01, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00,
+0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/Lord_Howe */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x14, 0xFE, 0x66, 0xE0,
+0x16, 0x38, 0x40, 0xF8, 0x16, 0xE7, 0x8A, 0x68, 0x18, 0x21, 0x5D, 0x78, 0x18, 0xC7, 0x6C, 0x68,
+0x1A, 0x01, 0x3F, 0x78, 0x1A, 0xA7, 0x4E, 0x68, 0x1B, 0xE1, 0x21, 0x78, 0x1C, 0x87, 0x30, 0x68,
+0x1D, 0xC1, 0x03, 0x78, 0x1E, 0x79, 0x8E, 0x70, 0x1F, 0x97, 0xAA, 0xF8, 0x20, 0x59, 0x70, 0x70,
+0x21, 0x80, 0xC7, 0x78, 0x22, 0x42, 0x8C, 0xF0, 0x23, 0x69, 0xE3, 0xF8, 0x24, 0x22, 0x6E, 0xF0,
+0x25, 0x49, 0xC5, 0xF8, 0x25, 0xEF, 0xDB, 0xF0, 0x27, 0x29, 0xA7, 0xF8, 0x27, 0xCF, 0xBD, 0xF0,
+0x29, 0x09, 0x89, 0xF8, 0x29, 0xAF, 0x9F, 0xF0, 0x2A, 0xE9, 0x6B, 0xF8, 0x2B, 0x98, 0xBC, 0x70,
+0x2C, 0xD2, 0x88, 0x78, 0x2D, 0x78, 0x9E, 0x70, 0x2E, 0xB2, 0x6A, 0x78, 0x2F, 0x58, 0x80, 0x70,
+0x30, 0x92, 0x4C, 0x78, 0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x2E, 0x78, 0x33, 0x3D, 0x2E, 0x70,
+0x34, 0x52, 0x10, 0x78, 0x35, 0x1D, 0x10, 0x70, 0x36, 0x31, 0xF2, 0x78, 0x36, 0xFC, 0xF2, 0x70,
+0x38, 0x1B, 0x0E, 0xF8, 0x38, 0xDC, 0xD4, 0x70, 0x39, 0xA7, 0xE2, 0x78, 0x3A, 0xBC, 0xB6, 0x70,
+0x3B, 0xDA, 0xD2, 0xF8, 0x3C, 0xA5, 0xD2, 0xF0, 0x3D, 0xBA, 0xB4, 0xF8, 0x3E, 0x85, 0xB4, 0xF0,
+0x3F, 0x9A, 0x96, 0xF8, 0x40, 0x65, 0x96, 0xF0, 0x41, 0x83, 0xB3, 0x78, 0x42, 0x45, 0x78, 0xF0,
+0x43, 0x63, 0x95, 0x78, 0x44, 0x2E, 0x95, 0x70, 0x45, 0x43, 0x77, 0x78, 0x46, 0x05, 0x3C, 0xF0,
+0x47, 0x23, 0x59, 0x78, 0x47, 0xEE, 0x59, 0x70, 0x49, 0x03, 0x3B, 0x78, 0x49, 0xCE, 0x3B, 0x70,
+0x4A, 0xE3, 0x1D, 0x78, 0x4B, 0xAE, 0x1D, 0x70, 0x4C, 0xCC, 0x39, 0xF8, 0x4D, 0x8D, 0xFF, 0x70,
+0x4E, 0xAC, 0x1B, 0xF8, 0x4F, 0x6D, 0xE1, 0x70, 0x50, 0x8B, 0xFD, 0xF8, 0x51, 0x56, 0xFD, 0xF0,
+0x52, 0x6B, 0xDF, 0xF8, 0x53, 0x36, 0xDF, 0xF0, 0x54, 0x4B, 0xC1, 0xF8, 0x55, 0x16, 0xC1, 0xF0,
+0x56, 0x2B, 0xA3, 0xF8, 0x56, 0xF6, 0xA3, 0xF0, 0x58, 0x14, 0xC0, 0x78, 0x58, 0xD6, 0x85, 0xF0,
+0x59, 0xF4, 0xA2, 0x78, 0x5A, 0xB6, 0x67, 0xF0, 0x5B, 0xD4, 0x84, 0x78, 0x5C, 0x9F, 0x84, 0x70,
+0x5D, 0xB4, 0x66, 0x78, 0x5E, 0x7F, 0x66, 0x70, 0x5F, 0x94, 0x48, 0x78, 0x60, 0x5F, 0x48, 0x70,
+0x61, 0x7D, 0x64, 0xF8, 0x62, 0x3F, 0x2A, 0x70, 0x63, 0x5D, 0x46, 0xF8, 0x64, 0x1F, 0x0C, 0x70,
+0x65, 0x3D, 0x28, 0xF8, 0x66, 0x08, 0x28, 0xF0, 0x67, 0x1D, 0x0A, 0xF8, 0x67, 0xE8, 0x0A, 0xF0,
+0x68, 0xFC, 0xEC, 0xF8, 0x69, 0xC7, 0xEC, 0xF0, 0x6A, 0xDC, 0xCE, 0xF8, 0x6B, 0xA7, 0xCE, 0xF0,
+0x6C, 0xC5, 0xEB, 0x78, 0x6D, 0x87, 0xB0, 0xF0, 0x6E, 0xA5, 0xCD, 0x78, 0x6F, 0x67, 0x92, 0xF0,
+0x70, 0x85, 0xAF, 0x78, 0x71, 0x50, 0xAF, 0x70, 0x72, 0x65, 0x91, 0x78, 0x73, 0x30, 0x91, 0x70,
+0x74, 0x45, 0x73, 0x78, 0x75, 0x10, 0x73, 0x70, 0x76, 0x2E, 0x8F, 0xF8, 0x76, 0xF0, 0x55, 0x70,
+0x78, 0x0E, 0x71, 0xF8, 0x78, 0xD0, 0x37, 0x70, 0x79, 0xEE, 0x53, 0xF8, 0x7A, 0xB0, 0x19, 0x70,
+0x7B, 0xCE, 0x35, 0xF8, 0x7C, 0x99, 0x35, 0xF0, 0x7D, 0xAE, 0x17, 0xF8, 0x7E, 0x79, 0x17, 0xF0,
+0x7F, 0x8D, 0xF9, 0xF8, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8,
+0x01, 0x04, 0x00, 0x00, 0x93, 0xA8, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x04, 0x45, 0x53,
+0x54, 0x00, 0x4C, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/Melbourne */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80,
+0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80,
+0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00,
+0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00,
+0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00,
+0x16, 0xE7, 0x9F, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80,
+0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80,
+0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x77, 0x94, 0x00,
+0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00,
+0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00,
+0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80,
+0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x92, 0x53, 0x80,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80,
+0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80,
+0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00,
+0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A,
+0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00,
+0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00,
+
+/* Australia/North */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4,
+0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88,
+0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00,
+0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/NSW */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80,
+0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80,
+0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00,
+0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00,
+0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00,
+0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80,
+0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80,
+0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80,
+0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00,
+0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00,
+0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80,
+0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80,
+0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80,
+0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00,
+0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A,
+0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00,
+0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00,
+
+/* Australia/Perth */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xC2, 0xBC,
+0x9C, 0xBC, 0x3D, 0x10, 0xCB, 0x54, 0xCF, 0x20, 0xCB, 0xC7, 0x73, 0x90, 0xCC, 0xB7, 0x72, 0xA0,
+0xCD, 0xA7, 0x55, 0x90, 0x09, 0x0F, 0xFB, 0xA0, 0x09, 0xB6, 0x18, 0xA0, 0x1A, 0x01, 0x62, 0xA0,
+0x1A, 0xA7, 0x7F, 0xA0, 0x29, 0x25, 0x5C, 0xA0, 0x29, 0xAF, 0xCA, 0x20, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00,
+0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00,
+0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/Queensland */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x25, 0x49, 0xCD, 0x00, 0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00,
+0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, 0x29, 0xAF, 0xAE, 0x00, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x9A, 0xB0,
+0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00,
+0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Australia/South */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4,
+0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88,
+0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88,
+0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88,
+0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88,
+0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08,
+0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08,
+0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08,
+0x16, 0xE7, 0xA6, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88,
+0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88,
+0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88,
+0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08,
+0x26, 0x02, 0x66, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08,
+0x29, 0xCB, 0x64, 0x88, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88,
+0x2D, 0x8B, 0x28, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x74, 0x45, 0x08, 0x30, 0x92, 0x5A, 0x88,
+0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88,
+0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08,
+0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, 0x3B, 0xDA, 0xE1, 0x08,
+0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, 0x3F, 0x9A, 0xA5, 0x08,
+0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, 0x43, 0x63, 0xA3, 0x88,
+0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, 0x47, 0x23, 0x67, 0x88,
+0x47, 0xEE, 0x6E, 0x88, 0x49, 0x03, 0x49, 0x88, 0x49, 0xCE, 0x50, 0x88, 0x4A, 0xE3, 0x2B, 0x88,
+0x4B, 0xAE, 0x32, 0x88, 0x4C, 0xCC, 0x48, 0x08, 0x4D, 0x8E, 0x14, 0x88, 0x4E, 0xAC, 0x2A, 0x08,
+0x4F, 0x6D, 0xF6, 0x88, 0x50, 0x8C, 0x0C, 0x08, 0x51, 0x57, 0x13, 0x08, 0x52, 0x6B, 0xEE, 0x08,
+0x53, 0x36, 0xF5, 0x08, 0x54, 0x4B, 0xD0, 0x08, 0x55, 0x16, 0xD7, 0x08, 0x56, 0x2B, 0xB2, 0x08,
+0x56, 0xF6, 0xB9, 0x08, 0x58, 0x14, 0xCE, 0x88, 0x58, 0xD6, 0x9B, 0x08, 0x59, 0xF4, 0xB0, 0x88,
+0x5A, 0xB6, 0x7D, 0x08, 0x5B, 0xD4, 0x92, 0x88, 0x5C, 0x9F, 0x99, 0x88, 0x5D, 0xB4, 0x74, 0x88,
+0x5E, 0x7F, 0x7B, 0x88, 0x5F, 0x94, 0x56, 0x88, 0x60, 0x5F, 0x5D, 0x88, 0x61, 0x7D, 0x73, 0x08,
+0x62, 0x3F, 0x3F, 0x88, 0x63, 0x5D, 0x55, 0x08, 0x64, 0x1F, 0x21, 0x88, 0x65, 0x3D, 0x37, 0x08,
+0x66, 0x08, 0x3E, 0x08, 0x67, 0x1D, 0x19, 0x08, 0x67, 0xE8, 0x20, 0x08, 0x68, 0xFC, 0xFB, 0x08,
+0x69, 0xC8, 0x02, 0x08, 0x6A, 0xDC, 0xDD, 0x08, 0x6B, 0xA7, 0xE4, 0x08, 0x6C, 0xC5, 0xF9, 0x88,
+0x6D, 0x87, 0xC6, 0x08, 0x6E, 0xA5, 0xDB, 0x88, 0x6F, 0x67, 0xA8, 0x08, 0x70, 0x85, 0xBD, 0x88,
+0x71, 0x50, 0xC4, 0x88, 0x72, 0x65, 0x9F, 0x88, 0x73, 0x30, 0xA6, 0x88, 0x74, 0x45, 0x81, 0x88,
+0x75, 0x10, 0x88, 0x88, 0x76, 0x2E, 0x9E, 0x08, 0x76, 0xF0, 0x6A, 0x88, 0x78, 0x0E, 0x80, 0x08,
+0x78, 0xD0, 0x4C, 0x88, 0x79, 0xEE, 0x62, 0x08, 0x7A, 0xB0, 0x2E, 0x88, 0x7B, 0xCE, 0x44, 0x08,
+0x7C, 0x99, 0x4B, 0x08, 0x7D, 0xAE, 0x26, 0x08, 0x7E, 0x79, 0x2D, 0x08, 0x7F, 0x8E, 0x08, 0x08,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x93,
+0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00,
+0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00,
+
+/* Australia/Sydney */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80,
+0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80,
+0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00,
+0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00,
+0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00,
+0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80,
+0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80,
+0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80,
+0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00,
+0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00,
+0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80,
+0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80,
+0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80,
+0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00,
+0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A,
+0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00,
+0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00,
+
+/* Australia/Tasmania */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9B, 0xD5, 0x78, 0x80,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0xFB, 0xC2, 0x8D, 0x00,
+0xFC, 0xB2, 0x7E, 0x00, 0xFD, 0xC7, 0x59, 0x00, 0xFE, 0x76, 0xB0, 0x80, 0xFF, 0xA7, 0x3B, 0x00,
+0x00, 0x56, 0x92, 0x80, 0x01, 0x87, 0x1D, 0x00, 0x02, 0x3F, 0xAF, 0x00, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80,
+0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80,
+0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00,
+0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00,
+0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00,
+0x17, 0x03, 0x4F, 0x00, 0x18, 0x21, 0x64, 0x80, 0x18, 0xE3, 0x31, 0x00, 0x1A, 0x01, 0x46, 0x80,
+0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80,
+0x1E, 0x67, 0x27, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80,
+0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00,
+0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xED, 0xE1, 0x80,
+0x29, 0xD4, 0x98, 0x00, 0x2A, 0xCD, 0xC3, 0x80, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xAD, 0xA5, 0x80,
+0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x8D, 0x87, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x6D, 0x69, 0x80,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x56, 0x86, 0x00, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x36, 0x68, 0x00,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x16, 0x4A, 0x00, 0x36, 0xFD, 0x00, 0x80, 0x37, 0xF6, 0x2C, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xBF, 0x2A, 0x80,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0x9F, 0x0C, 0x80, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x7E, 0xEE, 0x80,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x5E, 0xD0, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x3E, 0xB2, 0x80,
+0x44, 0x2E, 0xA3, 0x80, 0x45, 0x1E, 0x94, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x07, 0xB1, 0x00,
+0x47, 0xEE, 0x67, 0x80, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xC7, 0x75, 0x00,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0x87, 0x39, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x70, 0x55, 0x80, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x50, 0x37, 0x80,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x30, 0x19, 0x80, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x0F, 0xFB, 0x80,
+0x56, 0xF6, 0xB2, 0x00, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xCF, 0xBF, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0x98, 0xBE, 0x00,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x58, 0x82, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x38, 0x64, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x18, 0x46, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x01, 0x62, 0x80, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xE1, 0x44, 0x80,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xA1, 0x08, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x6A, 0x07, 0x00,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x29, 0xCB, 0x00,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x77, 0xE9, 0x8F, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xB2, 0x8D, 0x80,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x72, 0x51, 0x80,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01,
+0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/Victoria */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C,
+0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80,
+0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80,
+0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80,
+0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80,
+0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00,
+0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00,
+0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00,
+0x16, 0xE7, 0x9F, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80,
+0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80,
+0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x77, 0x94, 0x00,
+0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00,
+0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00,
+0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80,
+0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x92, 0x53, 0x80,
+0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80,
+0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00,
+0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00,
+0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00,
+0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80,
+0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80,
+0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80,
+0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00,
+0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00,
+0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00,
+0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80,
+0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80,
+0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00,
+0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00,
+0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00,
+0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80,
+0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80,
+0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80,
+0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00,
+0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00,
+0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A,
+0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00,
+0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00,
+
+/* Australia/West */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xC2, 0xBC,
+0x9C, 0xBC, 0x3D, 0x10, 0xCB, 0x54, 0xCF, 0x20, 0xCB, 0xC7, 0x73, 0x90, 0xCC, 0xB7, 0x72, 0xA0,
+0xCD, 0xA7, 0x55, 0x90, 0x09, 0x0F, 0xFB, 0xA0, 0x09, 0xB6, 0x18, 0xA0, 0x1A, 0x01, 0x62, 0xA0,
+0x1A, 0xA7, 0x7F, 0xA0, 0x29, 0x25, 0x5C, 0xA0, 0x29, 0xAF, 0xCA, 0x20, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00,
+0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00,
+0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Australia/Yancowinna */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4,
+0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88,
+0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88,
+0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88,
+0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88,
+0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08,
+0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08,
+0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08,
+0x17, 0x0C, 0x90, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88,
+0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88,
+0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88,
+0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08,
+0x25, 0xEF, 0xF1, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08,
+0x29, 0xAF, 0xB5, 0x08, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88,
+0x2D, 0x78, 0xB3, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x58, 0x95, 0x88, 0x30, 0x92, 0x5A, 0x88,
+0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88,
+0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08,
+0x38, 0x6C, 0xAF, 0xD8, 0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88,
+0x3B, 0xDA, 0xE1, 0x08, 0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08,
+0x3F, 0x9A, 0xA5, 0x08, 0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08,
+0x43, 0x63, 0xA3, 0x88, 0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08,
+0x47, 0x23, 0x67, 0x88, 0x47, 0xEE, 0x6E, 0x88, 0x49, 0x03, 0x49, 0x88, 0x49, 0xCE, 0x50, 0x88,
+0x4A, 0xE3, 0x2B, 0x88, 0x4B, 0xAE, 0x32, 0x88, 0x4C, 0xCC, 0x48, 0x08, 0x4D, 0x8E, 0x14, 0x88,
+0x4E, 0xAC, 0x2A, 0x08, 0x4F, 0x6D, 0xF6, 0x88, 0x50, 0x8C, 0x0C, 0x08, 0x51, 0x57, 0x13, 0x08,
+0x52, 0x6B, 0xEE, 0x08, 0x53, 0x36, 0xF5, 0x08, 0x54, 0x4B, 0xD0, 0x08, 0x55, 0x16, 0xD7, 0x08,
+0x56, 0x2B, 0xB2, 0x08, 0x56, 0xF6, 0xB9, 0x08, 0x58, 0x14, 0xCE, 0x88, 0x58, 0xD6, 0x9B, 0x08,
+0x59, 0xF4, 0xB0, 0x88, 0x5A, 0xB6, 0x7D, 0x08, 0x5B, 0xD4, 0x92, 0x88, 0x5C, 0x9F, 0x99, 0x88,
+0x5D, 0xB4, 0x74, 0x88, 0x5E, 0x7F, 0x7B, 0x88, 0x5F, 0x94, 0x56, 0x88, 0x60, 0x5F, 0x5D, 0x88,
+0x61, 0x7D, 0x73, 0x08, 0x62, 0x3F, 0x3F, 0x88, 0x63, 0x5D, 0x55, 0x08, 0x64, 0x1F, 0x21, 0x88,
+0x65, 0x3D, 0x37, 0x08, 0x66, 0x08, 0x3E, 0x08, 0x67, 0x1D, 0x19, 0x08, 0x67, 0xE8, 0x20, 0x08,
+0x68, 0xFC, 0xFB, 0x08, 0x69, 0xC8, 0x02, 0x08, 0x6A, 0xDC, 0xDD, 0x08, 0x6B, 0xA7, 0xE4, 0x08,
+0x6C, 0xC5, 0xF9, 0x88, 0x6D, 0x87, 0xC6, 0x08, 0x6E, 0xA5, 0xDB, 0x88, 0x6F, 0x67, 0xA8, 0x08,
+0x70, 0x85, 0xBD, 0x88, 0x71, 0x50, 0xC4, 0x88, 0x72, 0x65, 0x9F, 0x88, 0x73, 0x30, 0xA6, 0x88,
+0x74, 0x45, 0x81, 0x88, 0x75, 0x10, 0x88, 0x88, 0x76, 0x2E, 0x9E, 0x08, 0x76, 0xF0, 0x6A, 0x88,
+0x78, 0x0E, 0x80, 0x08, 0x78, 0xD0, 0x4C, 0x88, 0x79, 0xEE, 0x62, 0x08, 0x7A, 0xB0, 0x2E, 0x88,
+0x7B, 0xCE, 0x44, 0x08, 0x7C, 0x99, 0x4B, 0x08, 0x7D, 0xAE, 0x26, 0x08, 0x7E, 0x79, 0x2D, 0x08,
+0x7F, 0x8E, 0x08, 0x08, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00,
+0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Brazil/Acre */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x86, 0x90,
+0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40,
+0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40,
+0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40,
+0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0,
+0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0,
+0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0,
+0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC0,
+0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C,
+0x4D, 0x54, 0x00, 0x41, 0x43, 0x53, 0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* Brazil/DeNoronha */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x65, 0x64,
+0xB8, 0x0F, 0x3B, 0xD0, 0xB8, 0xFD, 0x32, 0x90, 0xB9, 0xF1, 0x26, 0x20, 0xBA, 0xDE, 0x66, 0x10,
+0xDA, 0x38, 0xA0, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDC, 0x19, 0xD3, 0xA0, 0xDC, 0xB9, 0x4B, 0x10,
+0xDD, 0xFB, 0x07, 0x20, 0xDE, 0x9B, 0xD0, 0x10, 0xDF, 0xDD, 0x8C, 0x20, 0xE0, 0x54, 0x25, 0x10,
+0xF4, 0x97, 0xF1, 0xA0, 0xF5, 0x05, 0x50, 0x10, 0xF6, 0xC0, 0x56, 0x20, 0xF7, 0x0E, 0x10, 0x90,
+0xF8, 0x51, 0x1E, 0x20, 0xF8, 0xC7, 0xB7, 0x10, 0xFA, 0x0A, 0xC4, 0xA0, 0xFA, 0xA8, 0xEA, 0x90,
+0xFB, 0xEB, 0xF8, 0x20, 0xFC, 0x8B, 0x6F, 0x90, 0x1D, 0xC9, 0x80, 0x20, 0x1E, 0x78, 0xC9, 0x90,
+0x1F, 0xA0, 0x27, 0xA0, 0x20, 0x33, 0xC1, 0x90, 0x21, 0x81, 0x5B, 0x20, 0x22, 0x0B, 0xBA, 0x90,
+0x23, 0x58, 0x02, 0xA0, 0x23, 0xE2, 0x62, 0x10, 0x25, 0x37, 0xE4, 0xA0, 0x25, 0xD4, 0xB9, 0x10,
+0x37, 0xF6, 0xB8, 0xA0, 0x38, 0xB8, 0x77, 0x10, 0x39, 0xDF, 0xD5, 0x20, 0x39, 0xE9, 0x01, 0x90,
+0x3B, 0xC8, 0xF1, 0xA0, 0x3C, 0x6F, 0x00, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF,
+0xFF, 0xE1, 0x9C, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x00,
+0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4E, 0x53, 0x54, 0x00, 0x46, 0x4E, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Brazil/East */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x72, 0xB4,
+0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20,
+0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20,
+0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20,
+0xF4, 0x5A, 0x09, 0x30, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0,
+0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0,
+0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0,
+0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0,
+0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20,
+0x27, 0x21, 0x0F, 0x30, 0x27, 0xBD, 0xE3, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0x94, 0x8B, 0x20,
+0x2A, 0xEA, 0x0D, 0xB0, 0x2B, 0x6B, 0x32, 0xA0, 0x2C, 0xC0, 0xB5, 0x30, 0x2D, 0x66, 0xC4, 0x20,
+0x2E, 0xA0, 0x97, 0x30, 0x2F, 0x46, 0xA6, 0x20, 0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0,
+0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20,
+0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20,
+0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0,
+0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x3F, 0x91, 0xFE, 0x30, 0x40, 0x2E, 0xD2, 0xA0,
+0x41, 0x86, 0xF8, 0x30, 0x42, 0x17, 0xEF, 0x20, 0x43, 0x51, 0xC2, 0x30, 0x43, 0xF7, 0xD1, 0x20,
+0x45, 0x31, 0xA4, 0x30, 0x45, 0xD7, 0xB3, 0x20, 0x47, 0x1A, 0xC0, 0xB0, 0x47, 0xB7, 0x95, 0x20,
+0x48, 0xFA, 0xA2, 0xB0, 0x49, 0x97, 0x77, 0x20, 0x4A, 0xDA, 0x84, 0xB0, 0x4B, 0x80, 0x93, 0xA0,
+0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x60, 0x75, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, 0x4F, 0x40, 0x57, 0xA0,
+0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0,
+0x54, 0x43, 0x29, 0x30, 0x54, 0xDF, 0xFD, 0xA0, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20,
+0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20,
+0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20,
+0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0,
+0x63, 0x4B, 0x73, 0xB0, 0x63, 0xF1, 0x82, 0xA0, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0,
+0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x91, 0x28, 0xA0,
+0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20,
+0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20,
+0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20,
+0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xA2, 0xAD, 0xA0,
+0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0,
+0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x42, 0x53, 0xA0, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xD4, 0x4C,
+0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D,
+0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* Brazil/West */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7F, 0x44,
+0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30,
+0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30,
+0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30,
+0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0,
+0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0,
+0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0,
+0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0,
+0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC7, 0xBC, 0x00, 0x00, 0xFF, 0xFF, 0xD5,
+0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53,
+0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Canada/Atlantic */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xAB, 0xA0,
+0x9A, 0xE4, 0xDE, 0xC0, 0x9B, 0xD6, 0x13, 0x30, 0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50,
+0xA2, 0x9D, 0x17, 0x40, 0xA3, 0x30, 0xB1, 0x30, 0xA4, 0x7A, 0x56, 0x40, 0xA5, 0x1B, 0x1F, 0x30,
+0xA6, 0x53, 0xA0, 0xC0, 0xA6, 0xFC, 0x52, 0xB0, 0xA8, 0x3C, 0xBD, 0x40, 0xA8, 0xDC, 0x34, 0xB0,
+0xAA, 0x1C, 0x9F, 0x40, 0xAA, 0xCD, 0x3A, 0x30, 0xAB, 0xFC, 0x81, 0x40, 0xAC, 0xBF, 0x91, 0x30,
+0xAD, 0xEE, 0xD8, 0x40, 0xAE, 0x8C, 0xFE, 0x30, 0xAF, 0xBC, 0x45, 0x40, 0xB0, 0x7F, 0x55, 0x30,
+0xB1, 0xAE, 0x9C, 0x40, 0xB2, 0x4B, 0x70, 0xB0, 0xB3, 0x8E, 0x7E, 0x40, 0xB4, 0x24, 0xBB, 0x30,
+0xB5, 0x6E, 0x60, 0x40, 0xB6, 0x15, 0xC0, 0xB0, 0xB7, 0x4E, 0x42, 0x40, 0xB8, 0x08, 0x17, 0xB0,
+0xB9, 0x24, 0xE9, 0xC0, 0xB9, 0xE7, 0xF9, 0xB0, 0xBB, 0x04, 0xCB, 0xC0, 0xBB, 0xD1, 0x16, 0x30,
+0xBD, 0x00, 0x5D, 0x40, 0xBD, 0x9D, 0x31, 0xB0, 0xBE, 0xF2, 0xB4, 0x40, 0xBF, 0x90, 0xDA, 0x30,
+0xC0, 0xD3, 0xE7, 0xC0, 0xC1, 0x5E, 0x47, 0x30, 0xC2, 0x8D, 0x8E, 0x40, 0xC3, 0x50, 0x9E, 0x30,
+0xC4, 0x6D, 0x70, 0x40, 0xC5, 0x30, 0x80, 0x30, 0xC6, 0x72, 0x3C, 0x40, 0xC7, 0x10, 0x62, 0x30,
+0xC8, 0x36, 0x6E, 0xC0, 0xC8, 0xF9, 0x7E, 0xB0, 0xCA, 0x16, 0x50, 0xC0, 0xCA, 0xD9, 0x60, 0xB0,
+0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xD3, 0x75, 0xD6, 0xE0,
+0xD4, 0x40, 0xCF, 0xD0, 0xD5, 0x55, 0xB8, 0xE0, 0xD6, 0x20, 0xB1, 0xD0, 0xD7, 0x35, 0x9A, 0xE0,
+0xD8, 0x00, 0x93, 0xD0, 0xD9, 0x15, 0x7C, 0xE0, 0xD9, 0xE0, 0x75, 0xD0, 0xDC, 0xDE, 0x7B, 0x60,
+0xDD, 0xA9, 0x74, 0x50, 0xDE, 0xBE, 0x5D, 0x60, 0xDF, 0x89, 0x56, 0x50, 0xE0, 0x9E, 0x3F, 0x60,
+0xE1, 0x69, 0x38, 0x50, 0xE2, 0x7E, 0x21, 0x60, 0xE3, 0x49, 0x1A, 0x50, 0xE6, 0x47, 0x1F, 0xE0,
+0xE7, 0x12, 0x18, 0xD0, 0xE8, 0x27, 0x01, 0xE0, 0xE8, 0xF1, 0xFA, 0xD0, 0xEA, 0x06, 0xE3, 0xE0,
+0xEA, 0xD1, 0xDC, 0xD0, 0xEB, 0xE6, 0xC5, 0xE0, 0xEC, 0xB1, 0xBE, 0xD0, 0xF1, 0x8F, 0xA6, 0x60,
+0xF2, 0x7F, 0x89, 0x50, 0xF3, 0x6F, 0x88, 0x60, 0xF4, 0x5F, 0x6B, 0x50, 0xF5, 0x4F, 0x6A, 0x60,
+0xF6, 0x3F, 0x4D, 0x50, 0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x69, 0xD0, 0xF9, 0x0F, 0x2E, 0x60,
+0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0,
+0xFD, 0xC8, 0x0F, 0xD0, 0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0,
+0x01, 0x87, 0xD3, 0xD0, 0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60,
+0x05, 0x50, 0xD2, 0x50, 0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60,
+0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60,
+0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0,
+0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0,
+0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0,
+0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60,
+0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60,
+0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0,
+0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0,
+0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60,
+0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60,
+0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0,
+0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0,
+0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0,
+0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60,
+0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60,
+0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60,
+0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x4A, 0x60, 0x47, 0x24, 0x17, 0x50, 0x47, 0xF8, 0x66, 0xE0,
+0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x48, 0xE0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xB8, 0x2A, 0xE0,
+0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x98, 0x0C, 0xE0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x77, 0xEE, 0xE0,
+0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x61, 0x0B, 0x60, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x40, 0xED, 0x60,
+0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xCF, 0x60, 0x56, 0x2C, 0x61, 0xD0, 0x57, 0x00, 0xB1, 0x60,
+0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x93, 0x60, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xC0, 0x75, 0x60,
+0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x91, 0xE0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x89, 0x73, 0xE0,
+0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x55, 0xE0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x49, 0x37, 0xE0,
+0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x19, 0xE0, 0x65, 0x3D, 0xE6, 0xD0, 0x66, 0x12, 0x36, 0x60,
+0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x18, 0x60, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xD1, 0xFA, 0x60,
+0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xDC, 0x60, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x91, 0xBE, 0x60,
+0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0xA0, 0x60, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x5A, 0xBC, 0xE0,
+0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x9E, 0xE0, 0x74, 0x46, 0x31, 0x50, 0x75, 0x1A, 0x80, 0xE0,
+0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x62, 0xE0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xDA, 0x44, 0xE0,
+0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x26, 0xE0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0xA3, 0x43, 0x60,
+0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x25, 0x60, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0xFF, 0xFF, 0xC4, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0x4C, 0x4D,
+0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
+
+/* Canada/Central */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x01, 0xFB, 0xE0,
+0x9B, 0xC3, 0xBA, 0x50, 0x9E, 0xB8, 0xA1, 0x80, 0x9F, 0xC0, 0x3F, 0x70, 0xC2, 0xA0, 0x3B, 0x80,
+0xC3, 0x4F, 0x84, 0xF0, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0,
+0xD3, 0x88, 0x68, 0x00, 0xD4, 0x53, 0x60, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0,
+0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0,
+0xDB, 0x00, 0x07, 0x00, 0xDB, 0xC8, 0x5C, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70,
+0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0,
+0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x31, 0x62, 0xF0,
+0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0,
+0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0,
+0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70,
+0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70,
+0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x0A, 0x00, 0xB1, 0x80, 0x0A, 0xF0, 0x94, 0x70,
+0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0,
+0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0,
+0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0,
+0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70,
+0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70,
+0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x70, 0x80,
+0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x34, 0x80,
+0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xBB, 0x00,
+0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x41, 0x80,
+0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE4, 0x05, 0x80,
+0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAD, 0x04, 0x00,
+0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xC8, 0x00,
+0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x8C, 0x00,
+0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x8A, 0x80,
+0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x4E, 0x80,
+0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x4D, 0x00,
+0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x11, 0x00,
+0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xD5, 0x00,
+0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xD3, 0x80,
+0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x97, 0x80,
+0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x5B, 0x80,
+0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x5A, 0x00,
+0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x1E, 0x00,
+0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xE2, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF,
+0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43,
+0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01,
+0x00,
+
+/* Canada/Eastern */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70,
+0x9F, 0xC0, 0x31, 0x60, 0xA0, 0x87, 0x2E, 0xC8, 0xA1, 0x9A, 0xB1, 0x40, 0xA2, 0x94, 0x06, 0xF0,
+0xA3, 0x55, 0xA9, 0x40, 0xA4, 0x86, 0x5D, 0xF0, 0xA5, 0x28, 0x78, 0x60, 0xA6, 0x66, 0x3F, 0xF0,
+0xA7, 0x0C, 0x4E, 0xE0, 0xA8, 0x46, 0x21, 0xF0, 0xA8, 0xEC, 0x30, 0xE0, 0xAA, 0x1C, 0xC9, 0x70,
+0xAA, 0xD5, 0x4D, 0x60, 0xAB, 0xFC, 0xAB, 0x70, 0xAC, 0xB5, 0x2F, 0x60, 0xAD, 0xDC, 0x8D, 0x70,
+0xAE, 0x95, 0x11, 0x60, 0xAF, 0xBC, 0x6F, 0x70, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70,
+0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70,
+0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x25, 0x13, 0xF0,
+0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xE4, 0xD7, 0xF0,
+0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0,
+0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0,
+0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70,
+0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0,
+0xD4, 0x40, 0xDD, 0xE0, 0xD5, 0x55, 0xAA, 0xD0, 0xD6, 0x20, 0xA3, 0xC0, 0xD7, 0x35, 0x8C, 0xD0,
+0xD8, 0x00, 0x85, 0xC0, 0xD9, 0x15, 0x6E, 0xD0, 0xDA, 0x33, 0x76, 0x40, 0xDA, 0xFE, 0xA7, 0x70,
+0xDC, 0x13, 0x74, 0x60, 0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70,
+0xDF, 0x89, 0x64, 0x60, 0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70,
+0xE3, 0x49, 0x28, 0x60, 0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x29, 0x0A, 0x60, 0xE6, 0x47, 0x2D, 0xF0,
+0xE7, 0x12, 0x26, 0xE0, 0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0,
+0xEA, 0xF6, 0xD4, 0xE0, 0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0,
+0xEE, 0xBF, 0xD3, 0x60, 0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70,
+0xF2, 0x7F, 0x97, 0x60, 0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70,
+0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70,
+0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0,
+0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0,
+0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70,
+0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x08, 0x20, 0xC1, 0x70,
+0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70,
+0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0,
+0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0,
+0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0,
+0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70,
+0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70,
+0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0,
+0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0,
+0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70,
+0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70,
+0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0,
+0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0,
+0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0,
+0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70,
+0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70,
+0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70,
+0x45, 0x44, 0x43, 0x60, 0x46, 0x0F, 0x58, 0x70, 0x47, 0x24, 0x25, 0x60, 0x47, 0xF8, 0x74, 0xF0,
+0x49, 0x04, 0x07, 0x60, 0x49, 0xD8, 0x56, 0xF0, 0x4A, 0xE3, 0xE9, 0x60, 0x4B, 0xB8, 0x38, 0xF0,
+0x4C, 0xCD, 0x05, 0xE0, 0x4D, 0x98, 0x1A, 0xF0, 0x4E, 0xAC, 0xE7, 0xE0, 0x4F, 0x77, 0xFC, 0xF0,
+0x50, 0x8C, 0xC9, 0xE0, 0x51, 0x61, 0x19, 0x70, 0x52, 0x6C, 0xAB, 0xE0, 0x53, 0x40, 0xFB, 0x70,
+0x54, 0x4C, 0x8D, 0xE0, 0x55, 0x20, 0xDD, 0x70, 0x56, 0x2C, 0x6F, 0xE0, 0x57, 0x00, 0xBF, 0x70,
+0x58, 0x15, 0x8C, 0x60, 0x58, 0xE0, 0xA1, 0x70, 0x59, 0xF5, 0x6E, 0x60, 0x5A, 0xC0, 0x83, 0x70,
+0x5B, 0xD5, 0x50, 0x60, 0x5C, 0xA9, 0x9F, 0xF0, 0x5D, 0xB5, 0x32, 0x60, 0x5E, 0x89, 0x81, 0xF0,
+0x5F, 0x95, 0x14, 0x60, 0x60, 0x69, 0x63, 0xF0, 0x61, 0x7E, 0x30, 0xE0, 0x62, 0x49, 0x45, 0xF0,
+0x63, 0x5E, 0x12, 0xE0, 0x64, 0x29, 0x27, 0xF0, 0x65, 0x3D, 0xF4, 0xE0, 0x66, 0x12, 0x44, 0x70,
+0x67, 0x1D, 0xD6, 0xE0, 0x67, 0xF2, 0x26, 0x70, 0x68, 0xFD, 0xB8, 0xE0, 0x69, 0xD2, 0x08, 0x70,
+0x6A, 0xDD, 0x9A, 0xE0, 0x6B, 0xB1, 0xEA, 0x70, 0x6C, 0xC6, 0xB7, 0x60, 0x6D, 0x91, 0xCC, 0x70,
+0x6E, 0xA6, 0x99, 0x60, 0x6F, 0x71, 0xAE, 0x70, 0x70, 0x86, 0x7B, 0x60, 0x71, 0x5A, 0xCA, 0xF0,
+0x72, 0x66, 0x5D, 0x60, 0x73, 0x3A, 0xAC, 0xF0, 0x74, 0x46, 0x3F, 0x60, 0x75, 0x1A, 0x8E, 0xF0,
+0x76, 0x2F, 0x5B, 0xE0, 0x76, 0xFA, 0x70, 0xF0, 0x78, 0x0F, 0x3D, 0xE0, 0x78, 0xDA, 0x52, 0xF0,
+0x79, 0xEF, 0x1F, 0xE0, 0x7A, 0xBA, 0x34, 0xF0, 0x7B, 0xCF, 0x01, 0xE0, 0x7C, 0xA3, 0x51, 0x70,
+0x7D, 0xAE, 0xE3, 0xE0, 0x7E, 0x83, 0x33, 0x70, 0x7F, 0x8E, 0xC5, 0xE0, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04,
+0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00,
+0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x00, 0x00, 0x00, 0x01,
+
+/* Canada/East-Saskatchewan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x93, 0x1C,
+0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xB5, 0x65, 0x4F, 0xF0, 0xB6, 0x30, 0x48, 0xE0,
+0xB7, 0x45, 0x31, 0xF0, 0xB8, 0x10, 0x2A, 0xE0, 0xB9, 0x25, 0x13, 0xF0, 0xB9, 0xF0, 0x0C, 0xE0,
+0xBB, 0x0E, 0x30, 0x70, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xEE, 0x12, 0x70, 0xBD, 0xB9, 0x0B, 0x60,
+0xC2, 0x72, 0x08, 0xF0, 0xC3, 0x61, 0xEB, 0xE0, 0xC4, 0x51, 0xEA, 0xF0, 0xC5, 0x38, 0x93, 0x60,
+0xC6, 0x31, 0xCC, 0xF0, 0xC7, 0x21, 0xAF, 0xE0, 0xC8, 0x1A, 0xE9, 0x70, 0xC9, 0x0A, 0xCC, 0x60,
+0xC9, 0xFA, 0xCB, 0x70, 0xCA, 0xEA, 0xAE, 0x60, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x61, 0x18, 0x00, 0xD3, 0x63, 0x8C, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10,
+0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10,
+0xD9, 0xE0, 0xA0, 0x00, 0xDA, 0xFE, 0xC3, 0x90, 0xDB, 0xC0, 0x82, 0x00, 0xDC, 0xDE, 0xA5, 0x90,
+0xDD, 0xA9, 0x9E, 0x80, 0xDE, 0xBE, 0x87, 0x90, 0xDF, 0x89, 0x80, 0x80, 0xE0, 0x9E, 0x69, 0x90,
+0xE1, 0x69, 0x62, 0x80, 0xE2, 0x7E, 0x4B, 0x90, 0xE3, 0x49, 0x44, 0x80, 0xE4, 0x5E, 0x2D, 0x90,
+0xE5, 0x29, 0x26, 0x80, 0xE6, 0x47, 0x4A, 0x10, 0xE7, 0x12, 0x43, 0x00, 0xE8, 0x27, 0x2C, 0x10,
+0xE8, 0xF2, 0x25, 0x00, 0xEB, 0xE6, 0xF0, 0x10, 0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, 0xFF, 0x9D, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01,
+0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB,
+0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54,
+0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* Canada/Mountain */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x88, 0xDE, 0xCE, 0xE0,
+0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xA0, 0x98, 0x91, 0x90, 0xA0, 0xD2, 0x85, 0x80,
+0xA2, 0x8A, 0xE8, 0x90, 0xA3, 0x84, 0x06, 0x00, 0xA4, 0x6A, 0xCA, 0x90, 0xA5, 0x35, 0xC3, 0x80,
+0xA6, 0x53, 0xE7, 0x10, 0xA7, 0x15, 0xA5, 0x80, 0xA8, 0x33, 0xC9, 0x10, 0xA8, 0xFE, 0xC2, 0x00,
+0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xD5, 0x55, 0xE3, 0x10,
+0xD6, 0x20, 0xDC, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, 0xFE, 0xB8, 0x39, 0x10,
+0xFF, 0xA8, 0x1C, 0x00, 0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90,
+0x07, 0x30, 0xDE, 0x80, 0x08, 0x20, 0xDD, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xBF, 0x90,
+0x0A, 0xF0, 0xA2, 0x80, 0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90,
+0x0E, 0xB9, 0xA1, 0x00, 0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10,
+0x12, 0x79, 0x65, 0x00, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10,
+0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10,
+0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90,
+0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10,
+0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10,
+0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90,
+0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90,
+0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90,
+0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10,
+0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10,
+0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10,
+0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90,
+0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90,
+0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90,
+0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10,
+0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10,
+0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90,
+0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90,
+0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90,
+0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10,
+0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10,
+0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10,
+0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90,
+0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90,
+0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90,
+0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10,
+0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10,
+0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10,
+0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90,
+0x7F, 0x8E, 0xE2, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF,
+0x95, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08,
+0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00,
+0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
+
+/* Canada/Newfoundland */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xEE, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x9C, 0xCF, 0x62, 0x0C,
+0x9D, 0xA4, 0xE6, 0xFC, 0x9E, 0xB8, 0x7E, 0x8C, 0x9F, 0xC0, 0x1C, 0x7C, 0xA0, 0xB6, 0x88, 0xDC,
+0xA1, 0x38, 0xFF, 0x4C, 0xA2, 0x95, 0x19, 0x5C, 0xA3, 0x84, 0xFC, 0x4C, 0xA4, 0x74, 0xFB, 0x5C,
+0xA5, 0x64, 0xDE, 0x4C, 0xA6, 0x5E, 0x17, 0xDC, 0xA7, 0x44, 0xC0, 0x4C, 0xA8, 0x3D, 0xF9, 0xDC,
+0xA9, 0x24, 0xA2, 0x4C, 0xAA, 0x1D, 0xDB, 0xDC, 0xAB, 0x04, 0x84, 0x4C, 0xAB, 0xFD, 0xBD, 0xDC,
+0xAC, 0xE4, 0x66, 0x4C, 0xAD, 0xDD, 0x9F, 0xDC, 0xAE, 0xCD, 0x82, 0xCC, 0xAF, 0xBD, 0x81, 0xDC,
+0xB0, 0xAD, 0x64, 0xCC, 0xB1, 0xA6, 0x9E, 0x5C, 0xB2, 0x8D, 0x46, 0xCC, 0xB3, 0x86, 0x80, 0x5C,
+0xB4, 0x6D, 0x28, 0xCC, 0xB5, 0x66, 0x62, 0x5C, 0xB6, 0x4D, 0x0A, 0xCC, 0xB7, 0x46, 0x44, 0x5C,
+0xB8, 0x2C, 0xEC, 0xCC, 0xB9, 0x26, 0x26, 0x5C, 0xBA, 0x16, 0x09, 0x4C, 0xBB, 0x0F, 0x42, 0xDC,
+0xBB, 0xF5, 0xEB, 0x4C, 0xBC, 0xEF, 0x24, 0xDC, 0xBD, 0xD5, 0xCD, 0x4C, 0xBE, 0x9E, 0x4D, 0x6C,
+0xBE, 0xCF, 0x06, 0xA8, 0xBF, 0xB5, 0xAF, 0x18, 0xC0, 0xB8, 0x31, 0x38, 0xC1, 0x79, 0xEF, 0xA8,
+0xC2, 0x98, 0x13, 0x38, 0xC3, 0x59, 0xD1, 0xA8, 0xC4, 0x77, 0xF5, 0x38, 0xC5, 0x39, 0xB3, 0xA8,
+0xC6, 0x61, 0x11, 0xB8, 0xC7, 0x19, 0x95, 0xA8, 0xC8, 0x40, 0xF3, 0xB8, 0xC9, 0x02, 0xB2, 0x28,
+0xCA, 0x20, 0xD5, 0xB8, 0xCA, 0xE2, 0x94, 0x28, 0xCC, 0x00, 0xB7, 0xB8, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x60, 0xE6, 0xC8, 0xD3, 0x88, 0x44, 0xD8, 0xD4, 0x4A, 0x03, 0x48, 0xD5, 0x68, 0x26, 0xD8,
+0xD6, 0x29, 0xE5, 0x48, 0xD7, 0x48, 0x08, 0xD8, 0xD8, 0x09, 0xC7, 0x48, 0xD9, 0x27, 0xEA, 0xD8,
+0xD9, 0xE9, 0xA9, 0x48, 0xDB, 0x11, 0x07, 0x58, 0xDB, 0xD2, 0xC5, 0xC8, 0xDC, 0xDE, 0x74, 0x58,
+0xDD, 0xA9, 0x6D, 0x48, 0xDE, 0xBE, 0x56, 0x58, 0xDF, 0x89, 0x4F, 0x48, 0xE0, 0x9E, 0x38, 0x58,
+0xE1, 0x69, 0x31, 0x48, 0xE2, 0x7E, 0x1A, 0x58, 0xE3, 0x49, 0x13, 0x48, 0xE4, 0x5D, 0xFC, 0x58,
+0xE5, 0x28, 0xF5, 0x48, 0xE6, 0x47, 0x18, 0xD8, 0xE7, 0x12, 0x11, 0xC8, 0xE8, 0x26, 0xFA, 0xD8,
+0xE8, 0xF1, 0xF3, 0xC8, 0xEA, 0x06, 0xDC, 0xD8, 0xEA, 0xD1, 0xD5, 0xC8, 0xEB, 0xE6, 0xBE, 0xD8,
+0xEC, 0xB1, 0xB7, 0xC8, 0xED, 0xC6, 0xA0, 0xD8, 0xEE, 0xBF, 0xBE, 0x48, 0xEF, 0xAF, 0xBD, 0x58,
+0xF0, 0x9F, 0xA0, 0x48, 0xF1, 0x8F, 0x9F, 0x58, 0xF2, 0x7F, 0x82, 0x48, 0xF3, 0x6F, 0x81, 0x58,
+0xF4, 0x5F, 0x64, 0x48, 0xF5, 0x4F, 0x63, 0x58, 0xF6, 0x3F, 0x46, 0x48, 0xF7, 0x2F, 0x45, 0x58,
+0xF8, 0x28, 0x62, 0xC8, 0xF9, 0x0F, 0x27, 0x58, 0xFA, 0x08, 0x44, 0xC8, 0xFA, 0xF8, 0x43, 0xD8,
+0xFB, 0xE8, 0x26, 0xC8, 0xFC, 0xD8, 0x25, 0xD8, 0xFD, 0xC8, 0x08, 0xC8, 0xFE, 0xB8, 0x07, 0xD8,
+0xFF, 0xA7, 0xEA, 0xC8, 0x00, 0x97, 0xE9, 0xD8, 0x01, 0x87, 0xCC, 0xC8, 0x02, 0x77, 0xCB, 0xD8,
+0x03, 0x70, 0xE9, 0x48, 0x04, 0x60, 0xE8, 0x58, 0x05, 0x50, 0xCB, 0x48, 0x06, 0x40, 0xCA, 0x58,
+0x07, 0x30, 0xAD, 0x48, 0x08, 0x20, 0xAC, 0x58, 0x09, 0x10, 0x8F, 0x48, 0x0A, 0x00, 0x8E, 0x58,
+0x0A, 0xF0, 0x71, 0x48, 0x0B, 0xE0, 0x70, 0x58, 0x0C, 0xD9, 0x8D, 0xC8, 0x0D, 0xC0, 0x52, 0x58,
+0x0E, 0xB9, 0x6F, 0xC8, 0x0F, 0xA9, 0x6E, 0xD8, 0x10, 0x99, 0x51, 0xC8, 0x11, 0x89, 0x50, 0xD8,
+0x12, 0x79, 0x33, 0xC8, 0x13, 0x69, 0x32, 0xD8, 0x14, 0x59, 0x15, 0xC8, 0x15, 0x49, 0x14, 0xD8,
+0x16, 0x38, 0xF7, 0xC8, 0x17, 0x28, 0xF6, 0xD8, 0x18, 0x22, 0x14, 0x48, 0x19, 0x08, 0xD8, 0xD8,
+0x1A, 0x01, 0xF6, 0x48, 0x1A, 0xF1, 0xF5, 0x58, 0x1B, 0xE1, 0xD8, 0x48, 0x1C, 0xD1, 0xD7, 0x58,
+0x1D, 0xC1, 0xBA, 0x48, 0x1E, 0xB1, 0xB9, 0x58, 0x1F, 0xA1, 0x9C, 0x48, 0x20, 0x75, 0xCF, 0xF4,
+0x21, 0x81, 0x62, 0x64, 0x22, 0x55, 0xB1, 0xF4, 0x23, 0x6A, 0x70, 0xD4, 0x24, 0x35, 0x93, 0xF4,
+0x25, 0x4A, 0x60, 0xE4, 0x26, 0x15, 0x75, 0xF4, 0x27, 0x2A, 0x42, 0xE4, 0x27, 0xFE, 0x92, 0x74,
+0x29, 0x0A, 0x24, 0xE4, 0x29, 0xDE, 0x74, 0x74, 0x2A, 0xEA, 0x06, 0xE4, 0x2B, 0xBE, 0x56, 0x74,
+0x2C, 0xD3, 0x23, 0x64, 0x2D, 0x9E, 0x38, 0x74, 0x2E, 0xB3, 0x05, 0x64, 0x2F, 0x7E, 0x1A, 0x74,
+0x30, 0x92, 0xE7, 0x64, 0x31, 0x67, 0x36, 0xF4, 0x32, 0x72, 0xC9, 0x64, 0x33, 0x47, 0x18, 0xF4,
+0x34, 0x52, 0xAB, 0x64, 0x35, 0x26, 0xFA, 0xF4, 0x36, 0x32, 0x8D, 0x64, 0x37, 0x06, 0xDC, 0xF4,
+0x38, 0x1B, 0xA9, 0xE4, 0x38, 0xE6, 0xBE, 0xF4, 0x39, 0xFB, 0x8B, 0xE4, 0x3A, 0xC6, 0xA0, 0xF4,
+0x3B, 0xDB, 0x6D, 0xE4, 0x3C, 0xAF, 0xBD, 0x74, 0x3D, 0xBB, 0x4F, 0xE4, 0x3E, 0x8F, 0x9F, 0x74,
+0x3F, 0x9B, 0x31, 0xE4, 0x40, 0x6F, 0x81, 0x74, 0x41, 0x84, 0x4E, 0x64, 0x42, 0x4F, 0x63, 0x74,
+0x43, 0x64, 0x30, 0x64, 0x44, 0x2F, 0x45, 0x74, 0x45, 0x44, 0x12, 0x64, 0x46, 0x0F, 0x27, 0x74,
+0x47, 0x23, 0xF4, 0x64, 0x47, 0xF8, 0x43, 0xF4, 0x49, 0x03, 0xD6, 0x64, 0x49, 0xD8, 0x25, 0xF4,
+0x4A, 0xE3, 0xB8, 0x64, 0x4B, 0xB8, 0x07, 0xF4, 0x4C, 0xCC, 0xD4, 0xE4, 0x4D, 0x97, 0xE9, 0xF4,
+0x4E, 0xAC, 0xB6, 0xE4, 0x4F, 0x77, 0xCB, 0xF4, 0x50, 0x8C, 0x98, 0xE4, 0x51, 0x60, 0xE8, 0x74,
+0x52, 0x6C, 0x7A, 0xE4, 0x53, 0x40, 0xCA, 0x74, 0x54, 0x4C, 0x5C, 0xE4, 0x55, 0x20, 0xAC, 0x74,
+0x56, 0x2C, 0x3E, 0xE4, 0x57, 0x00, 0x8E, 0x74, 0x58, 0x15, 0x5B, 0x64, 0x58, 0xE0, 0x70, 0x74,
+0x59, 0xF5, 0x3D, 0x64, 0x5A, 0xC0, 0x52, 0x74, 0x5B, 0xD5, 0x1F, 0x64, 0x5C, 0xA9, 0x6E, 0xF4,
+0x5D, 0xB5, 0x01, 0x64, 0x5E, 0x89, 0x50, 0xF4, 0x5F, 0x94, 0xE3, 0x64, 0x60, 0x69, 0x32, 0xF4,
+0x61, 0x7D, 0xFF, 0xE4, 0x62, 0x49, 0x14, 0xF4, 0x63, 0x5D, 0xE1, 0xE4, 0x64, 0x28, 0xF6, 0xF4,
+0x65, 0x3D, 0xC3, 0xE4, 0x66, 0x12, 0x13, 0x74, 0x67, 0x1D, 0xA5, 0xE4, 0x67, 0xF1, 0xF5, 0x74,
+0x68, 0xFD, 0x87, 0xE4, 0x69, 0xD1, 0xD7, 0x74, 0x6A, 0xDD, 0x69, 0xE4, 0x6B, 0xB1, 0xB9, 0x74,
+0x6C, 0xC6, 0x86, 0x64, 0x6D, 0x91, 0x9B, 0x74, 0x6E, 0xA6, 0x68, 0x64, 0x6F, 0x71, 0x7D, 0x74,
+0x70, 0x86, 0x4A, 0x64, 0x71, 0x5A, 0x99, 0xF4, 0x72, 0x66, 0x2C, 0x64, 0x73, 0x3A, 0x7B, 0xF4,
+0x74, 0x46, 0x0E, 0x64, 0x75, 0x1A, 0x5D, 0xF4, 0x76, 0x2F, 0x2A, 0xE4, 0x76, 0xFA, 0x3F, 0xF4,
+0x78, 0x0F, 0x0C, 0xE4, 0x78, 0xDA, 0x21, 0xF4, 0x79, 0xEE, 0xEE, 0xE4, 0x7A, 0xBA, 0x03, 0xF4,
+0x7B, 0xCE, 0xD0, 0xE4, 0x7C, 0xA3, 0x20, 0x74, 0x7D, 0xAE, 0xB2, 0xE4, 0x7E, 0x83, 0x02, 0x74,
+0x7F, 0x8E, 0x94, 0xE4, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x06, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0xFF, 0xFF, 0xDC, 0xA4, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0x94, 0x00, 0x04, 0xFF, 0xFF,
+0xDC, 0xD8, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x04, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x08,
+0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x0C, 0xFF, 0xFF, 0xEA, 0xE8, 0x01, 0x10, 0x4E, 0x44, 0x54, 0x00,
+0x4E, 0x53, 0x54, 0x00, 0x4E, 0x50, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, 0x44, 0x44, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* Canada/Pacific */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0xBD, 0xA0,
+0x9F, 0xC0, 0x5B, 0x90, 0xCB, 0x89, 0x1A, 0xA0, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10,
+0xD3, 0x76, 0x0F, 0x20, 0xD4, 0x53, 0x7D, 0x10, 0xD5, 0x55, 0xF1, 0x20, 0xD6, 0x20, 0xEA, 0x10,
+0xD7, 0x35, 0xD3, 0x20, 0xD8, 0x00, 0xCC, 0x10, 0xD9, 0x15, 0xB5, 0x20, 0xD9, 0xE0, 0xAE, 0x10,
+0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90,
+0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90,
+0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90,
+0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10,
+0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10,
+0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10,
+0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90,
+0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10,
+0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10,
+0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10,
+0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90,
+0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90,
+0x08, 0x20, 0xEB, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x0A, 0x00, 0xCD, 0xA0, 0x0A, 0xF0, 0xB0, 0x90,
+0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10,
+0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10,
+0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10,
+0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90,
+0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90,
+0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90,
+0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10,
+0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10,
+0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90,
+0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90,
+0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90,
+0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10,
+0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10,
+0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10,
+0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90,
+0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90,
+0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90,
+0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10,
+0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10,
+0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10,
+0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90,
+0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90,
+0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10,
+0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10,
+0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10,
+0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90,
+0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90,
+0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90,
+0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10,
+0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10,
+0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10,
+0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D,
+0x90, 0x01, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF,
+0xFF, 0x9D, 0x90, 0x01, 0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54,
+0x00, 0x50, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* Canada/Saskatchewan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x93, 0x1C,
+0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xB5, 0x65, 0x4F, 0xF0, 0xB6, 0x30, 0x48, 0xE0,
+0xB7, 0x45, 0x31, 0xF0, 0xB8, 0x10, 0x2A, 0xE0, 0xB9, 0x25, 0x13, 0xF0, 0xB9, 0xF0, 0x0C, 0xE0,
+0xBB, 0x0E, 0x30, 0x70, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xEE, 0x12, 0x70, 0xBD, 0xB9, 0x0B, 0x60,
+0xC2, 0x72, 0x08, 0xF0, 0xC3, 0x61, 0xEB, 0xE0, 0xC4, 0x51, 0xEA, 0xF0, 0xC5, 0x38, 0x93, 0x60,
+0xC6, 0x31, 0xCC, 0xF0, 0xC7, 0x21, 0xAF, 0xE0, 0xC8, 0x1A, 0xE9, 0x70, 0xC9, 0x0A, 0xCC, 0x60,
+0xC9, 0xFA, 0xCB, 0x70, 0xCA, 0xEA, 0xAE, 0x60, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x61, 0x18, 0x00, 0xD3, 0x63, 0x8C, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10,
+0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10,
+0xD9, 0xE0, 0xA0, 0x00, 0xDA, 0xFE, 0xC3, 0x90, 0xDB, 0xC0, 0x82, 0x00, 0xDC, 0xDE, 0xA5, 0x90,
+0xDD, 0xA9, 0x9E, 0x80, 0xDE, 0xBE, 0x87, 0x90, 0xDF, 0x89, 0x80, 0x80, 0xE0, 0x9E, 0x69, 0x90,
+0xE1, 0x69, 0x62, 0x80, 0xE2, 0x7E, 0x4B, 0x90, 0xE3, 0x49, 0x44, 0x80, 0xE4, 0x5E, 0x2D, 0x90,
+0xE5, 0x29, 0x26, 0x80, 0xE6, 0x47, 0x4A, 0x10, 0xE7, 0x12, 0x43, 0x00, 0xE8, 0x27, 0x2C, 0x10,
+0xE8, 0xF2, 0x25, 0x00, 0xEB, 0xE6, 0xF0, 0x10, 0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, 0xFF, 0x9D, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01,
+0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB,
+0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54,
+0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* Canada/Yukon */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xCB, 0xB0,
+0x9F, 0xBB, 0x23, 0xA0, 0xA0, 0xD0, 0x0C, 0xB0, 0xA1, 0xA2, 0xD2, 0x80, 0xCB, 0x89, 0x28, 0xB0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0xA2, 0x10,
+0xF9, 0x69, 0x1A, 0xB0, 0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20,
+0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20,
+0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0,
+0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20,
+0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20,
+0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0,
+0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0,
+0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0,
+0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20,
+0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20,
+0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20,
+0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0,
+0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0,
+0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0,
+0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20,
+0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20,
+0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0,
+0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0,
+0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0,
+0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20,
+0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20,
+0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20,
+0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0,
+0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0,
+0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0,
+0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20,
+0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20,
+0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20,
+0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0,
+0x7F, 0x8E, 0xF0, 0x10, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0xFF, 0xFF,
+0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10,
+0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x15, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x19, 0x59, 0x44, 0x54, 0x00,
+0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, 0x54, 0x00, 0x59, 0x44, 0x44, 0x54,
+0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+
+/* CET */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90,
+0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0x0D, 0xA4, 0x63, 0x90,
+0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90,
+0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00,
+0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x00, 0x00, 0x00,
+
+/* Chile/Continental */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0D, 0x8F, 0x24, 0x69, 0xC0,
+0x9F, 0x71, 0x09, 0x50, 0xA1, 0x01, 0xC3, 0x40, 0xB0, 0x5E, 0x7B, 0xD0, 0xB1, 0x77, 0x3D, 0x40,
+0xB2, 0x41, 0x00, 0xD0, 0xB3, 0x58, 0x70, 0xC0, 0xB4, 0x22, 0x34, 0x50, 0xB5, 0x39, 0xA4, 0x40,
+0xB6, 0x03, 0x67, 0xD0, 0xB7, 0x1A, 0xD7, 0xC0, 0xB7, 0xE4, 0x9B, 0x50, 0xB8, 0xFD, 0x5C, 0xC0,
+0xB9, 0xC7, 0x20, 0x50, 0xF9, 0xEC, 0x8E, 0x40, 0xFA, 0xB7, 0x87, 0x30, 0xFB, 0xD5, 0xAA, 0xC0,
+0xFC, 0x97, 0x69, 0x30, 0xFD, 0xB5, 0x8C, 0xC0, 0xFE, 0x77, 0x4B, 0x30, 0xFF, 0x95, 0x6E, 0xC0,
+0x00, 0x60, 0x67, 0xB0, 0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0,
+0x04, 0x20, 0x2B, 0xB0, 0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, 0x07, 0x1E, 0x31, 0x40,
+0x07, 0xDF, 0xEF, 0xB0, 0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40,
+0x0B, 0xA8, 0xEE, 0x30, 0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40,
+0x0F, 0x68, 0xB2, 0x30, 0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0,
+0x13, 0x28, 0x76, 0x30, 0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0,
+0x16, 0xF1, 0x74, 0xB0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0,
+0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40,
+0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40,
+0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40, 0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0,
+0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0, 0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0,
+0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0,
+0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40,
+0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40,
+0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40,
+0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0,
+0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0,
+0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0,
+0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40,
+0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40,
+0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40,
+0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0,
+0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0,
+0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40,
+0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40,
+0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40,
+0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0,
+0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0,
+0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0,
+0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40,
+0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40,
+0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40,
+0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0,
+0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xBD,
+0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF,
+0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00,
+0x09, 0x53, 0x4D, 0x54, 0x00, 0x43, 0x4C, 0x53, 0x54, 0x00, 0x43, 0x4C, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+
+/* Chile/EasterIsland */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0F, 0xB9, 0xC7, 0x40, 0x88,
+0xF9, 0xEC, 0x8E, 0x40, 0xFA, 0xB7, 0x87, 0x30, 0xFB, 0xD5, 0xAA, 0xC0, 0xFC, 0x97, 0x69, 0x30,
+0xFD, 0xB5, 0x8C, 0xC0, 0xFE, 0x77, 0x4B, 0x30, 0xFF, 0x95, 0x6E, 0xC0, 0x00, 0x60, 0x67, 0xB0,
+0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0, 0x04, 0x20, 0x2B, 0xB0,
+0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, 0x07, 0x1E, 0x31, 0x40, 0x07, 0xDF, 0xEF, 0xB0,
+0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40, 0x0B, 0xA8, 0xEE, 0x30,
+0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40, 0x0F, 0x68, 0xB2, 0x30,
+0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x28, 0x76, 0x30,
+0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0, 0x16, 0xF1, 0x74, 0xB0,
+0x16, 0xF1, 0xAC, 0xF0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0,
+0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40,
+0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40,
+0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40, 0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0,
+0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0, 0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0,
+0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0,
+0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40,
+0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40,
+0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40,
+0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0,
+0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0,
+0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0,
+0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40,
+0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40,
+0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40,
+0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0,
+0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0,
+0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40,
+0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40,
+0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40,
+0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0,
+0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0,
+0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0,
+0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40,
+0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40,
+0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40,
+0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0,
+0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0,
+0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0xFF, 0xFF, 0x99, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D,
+0x90, 0x00, 0x0A, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x0A, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x04, 0xFF,
+0xFF, 0xAB, 0xA0, 0x00, 0x0A, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x0A, 0x4D, 0x4D, 0x54, 0x00, 0x45,
+0x41, 0x53, 0x53, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00,
+
+/* CST6CDT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA2, 0xCB, 0x74, 0x00,
+0xA3, 0x83, 0xF7, 0xF0, 0xA4, 0x45, 0xD2, 0x80, 0xA5, 0x63, 0xD9, 0xF0, 0xA6, 0x53, 0xD9, 0x00,
+0xA7, 0x15, 0x97, 0x70, 0xA8, 0x33, 0xBB, 0x00, 0xA8, 0xFE, 0xB3, 0xF0, 0xAA, 0x13, 0x9D, 0x00,
+0xAA, 0xDE, 0x95, 0xF0, 0xAB, 0xF3, 0x7F, 0x00, 0xAC, 0xBE, 0x77, 0xF0, 0xAD, 0xD3, 0x61, 0x00,
+0xAE, 0x9E, 0x59, 0xF0, 0xAF, 0xB3, 0x43, 0x00, 0xB0, 0x7E, 0x3B, 0xF0, 0xB1, 0x9C, 0x5F, 0x80,
+0xB2, 0x67, 0x58, 0x70, 0xB3, 0x7C, 0x41, 0x80, 0xB4, 0x47, 0x3A, 0x70, 0xB5, 0x5C, 0x23, 0x80,
+0xB6, 0x27, 0x1C, 0x70, 0xB7, 0x3C, 0x05, 0x80, 0xB8, 0x06, 0xFE, 0x70, 0xB9, 0x1B, 0xE7, 0x80,
+0xB9, 0xE6, 0xE0, 0x70, 0xBB, 0x05, 0x04, 0x00, 0xBB, 0xC6, 0xC2, 0x70, 0xBC, 0xE4, 0xE6, 0x00,
+0xBD, 0xAF, 0xDE, 0xF0, 0xBE, 0xC4, 0xC8, 0x00, 0xBF, 0x8F, 0xC0, 0xF0, 0xC0, 0x5A, 0xD6, 0x00,
+0xC1, 0xB0, 0x3C, 0x70, 0xC2, 0x84, 0x8C, 0x00, 0xC3, 0x4F, 0x84, 0xF0, 0xC4, 0x64, 0x6E, 0x00,
+0xC5, 0x2F, 0x66, 0xF0, 0xC6, 0x4D, 0x8A, 0x80, 0xC7, 0x0F, 0x48, 0xF0, 0xC8, 0x2D, 0x6C, 0x80,
+0xC8, 0xF8, 0x65, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0,
+0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, 0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0,
+0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, 0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0,
+0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, 0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70,
+0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70,
+0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0,
+0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0,
+0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70,
+0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70,
+0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xF6, 0x3F, 0x69, 0x70,
+0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x85, 0xF0, 0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0,
+0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0,
+0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0,
+0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70,
+0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70,
+0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0,
+0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0,
+0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0,
+0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70,
+0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70,
+0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70,
+0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0,
+0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0,
+0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0,
+0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70,
+0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70,
+0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70,
+0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0,
+0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0,
+0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70,
+0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70,
+0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0,
+0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70,
+0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70,
+0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70,
+0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0,
+0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0,
+0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0,
+0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70,
+0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70,
+0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70,
+0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0,
+0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0,
+0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70,
+0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70,
+0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70,
+0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF,
+0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54,
+0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
+
+/* Cuba */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0xAC, 0x62, 0xC2, 0x80,
+0xB1, 0xD3, 0x94, 0x50, 0xB2, 0x74, 0x5D, 0x40, 0xC8, 0x5B, 0x66, 0xD0, 0xC8, 0xD3, 0x51, 0x40,
+0xCA, 0x3B, 0x48, 0xD0, 0xCA, 0xBC, 0x6D, 0xC0, 0xCC, 0x24, 0x65, 0x50, 0xCC, 0x9C, 0x4F, 0xC0,
+0xD1, 0xC4, 0x0B, 0x50, 0xD2, 0x3B, 0xF5, 0xC0, 0xD3, 0xA3, 0xED, 0x50, 0xD4, 0x1B, 0xD7, 0xC0,
+0xF7, 0x60, 0x05, 0xD0, 0xF7, 0xFF, 0x7D, 0x40, 0xF9, 0x3D, 0x44, 0xD0, 0xF9, 0xE3, 0x53, 0xC0,
+0xFA, 0xDB, 0x3B, 0xD0, 0xFB, 0xA7, 0x86, 0x40, 0xFC, 0xC5, 0xA9, 0xD0, 0xFD, 0x87, 0x68, 0x40,
+0xFE, 0xB8, 0x00, 0xD0, 0xFF, 0xA7, 0xE3, 0xC0, 0x00, 0x97, 0xE2, 0xD0, 0x01, 0x87, 0xC5, 0xC0,
+0x02, 0x77, 0xC4, 0xD0, 0x03, 0x70, 0xE2, 0x40, 0x04, 0x60, 0xE1, 0x50, 0x05, 0x35, 0x14, 0xC0,
+0x06, 0x40, 0xC3, 0x50, 0x07, 0x16, 0x48, 0x40, 0x08, 0x20, 0xA5, 0x50, 0x08, 0xF7, 0x7B, 0xC0,
+0x0A, 0x00, 0x87, 0x50, 0x0A, 0xF0, 0x6A, 0x40, 0x0B, 0xE0, 0x69, 0x50, 0x0C, 0xD9, 0x86, 0xC0,
+0x0D, 0xC0, 0x4B, 0x50, 0x0E, 0xB9, 0x68, 0xC0, 0x0F, 0xB2, 0xA2, 0x50, 0x10, 0x7D, 0x9B, 0x40,
+0x11, 0x51, 0xEA, 0xD0, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x31, 0xCC, 0xD0, 0x14, 0x46, 0x99, 0xC0,
+0x15, 0x5B, 0x82, 0xD0, 0x16, 0x26, 0x7B, 0xC0, 0x17, 0x3B, 0x64, 0xD0, 0x18, 0x06, 0x5D, 0xC0,
+0x19, 0x1B, 0x46, 0xD0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xFB, 0x28, 0xD0, 0x1B, 0xCF, 0x5C, 0x40,
+0x1C, 0xDB, 0x0A, 0xD0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x7A, 0x53, 0x50, 0x1F, 0x8F, 0x20, 0x40,
+0x20, 0x5A, 0x35, 0x50, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x43, 0x51, 0xD0, 0x23, 0x4E, 0xE4, 0x40,
+0x24, 0x23, 0x33, 0xD0, 0x25, 0x2E, 0xC6, 0x40, 0x26, 0x15, 0x8A, 0xD0, 0x27, 0x17, 0xE2, 0xC0,
+0x27, 0xFE, 0xA7, 0x50, 0x28, 0xF7, 0xD2, 0xD0, 0x29, 0xDE, 0x89, 0x50, 0x2A, 0xD7, 0xB4, 0xD0,
+0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xB7, 0x96, 0xD0, 0x2D, 0x9E, 0x4D, 0x50, 0x2E, 0x97, 0x78, 0xD0,
+0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x77, 0x5A, 0xD0, 0x31, 0x67, 0x4B, 0xD0, 0x32, 0x57, 0x3C, 0xD0,
+0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50,
+0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0,
+0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0,
+0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x43, 0x64, 0x53, 0x50,
+0x44, 0x2F, 0x5A, 0x50, 0x45, 0x44, 0x35, 0x50, 0x46, 0x0F, 0x3C, 0x50, 0x47, 0x24, 0x17, 0x50,
+0x47, 0xF8, 0x58, 0xD0, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xD8, 0x3A, 0xD0, 0x4A, 0xE3, 0xDB, 0x50,
+0x4B, 0xB8, 0x1C, 0xD0, 0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x97, 0xFE, 0xD0, 0x4E, 0xAC, 0xD9, 0xD0,
+0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x8C, 0xBB, 0xD0, 0x51, 0x60, 0xFD, 0x50, 0x52, 0x6C, 0x9D, 0xD0,
+0x53, 0x40, 0xDF, 0x50, 0x54, 0x4C, 0x7F, 0xD0, 0x55, 0x20, 0xC1, 0x50, 0x56, 0x2C, 0x61, 0xD0,
+0x57, 0x00, 0xA3, 0x50, 0x58, 0x15, 0x7E, 0x50, 0x58, 0xE0, 0x85, 0x50, 0x59, 0xF5, 0x60, 0x50,
+0x5A, 0xC0, 0x67, 0x50, 0x5B, 0xD5, 0x42, 0x50, 0x5C, 0xA9, 0x83, 0xD0, 0x5D, 0xB5, 0x24, 0x50,
+0x5E, 0x89, 0x65, 0xD0, 0x5F, 0x95, 0x06, 0x50, 0x60, 0x69, 0x47, 0xD0, 0x61, 0x7E, 0x22, 0xD0,
+0x62, 0x49, 0x29, 0xD0, 0x63, 0x5E, 0x04, 0xD0, 0x64, 0x29, 0x0B, 0xD0, 0x65, 0x3D, 0xE6, 0xD0,
+0x66, 0x12, 0x28, 0x50, 0x67, 0x1D, 0xC8, 0xD0, 0x67, 0xF2, 0x0A, 0x50, 0x68, 0xFD, 0xAA, 0xD0,
+0x69, 0xD1, 0xEC, 0x50, 0x6A, 0xDD, 0x8C, 0xD0, 0x6B, 0xB1, 0xCE, 0x50, 0x6C, 0xC6, 0xA9, 0x50,
+0x6D, 0x91, 0xB0, 0x50, 0x6E, 0xA6, 0x8B, 0x50, 0x6F, 0x71, 0x92, 0x50, 0x70, 0x86, 0x6D, 0x50,
+0x71, 0x5A, 0xAE, 0xD0, 0x72, 0x66, 0x4F, 0x50, 0x73, 0x3A, 0x90, 0xD0, 0x74, 0x46, 0x31, 0x50,
+0x75, 0x1A, 0x72, 0xD0, 0x76, 0x2F, 0x4D, 0xD0, 0x76, 0xFA, 0x54, 0xD0, 0x78, 0x0F, 0x2F, 0xD0,
+0x78, 0xDA, 0x36, 0xD0, 0x79, 0xEF, 0x11, 0xD0, 0x7A, 0xBA, 0x18, 0xD0, 0x7B, 0xCE, 0xF3, 0xD0,
+0x7C, 0xA3, 0x35, 0x50, 0x7D, 0xAE, 0xD5, 0xD0, 0x7E, 0x83, 0x17, 0x50, 0x7F, 0x8E, 0xB7, 0xD0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xB2,
+0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF,
+0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0x48, 0x4D, 0x54, 0x00, 0x43,
+0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00,
+
+/* EET */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x0D, 0xA4, 0x63, 0x90,
+0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90,
+0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
+0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45,
+0x45, 0x54, 0x00, 0x01, 0x01, 0x01, 0x01,
+
+/* Egypt */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xC8, 0x93, 0xB4, 0xE0,
+0xC8, 0xFA, 0x7B, 0xD0, 0xC9, 0xFC, 0xEF, 0xE0, 0xCA, 0xC7, 0xE8, 0xD0, 0xCB, 0xCB, 0xAE, 0x60,
+0xCC, 0xDF, 0x29, 0xD0, 0xCD, 0xAC, 0xE1, 0xE0, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0,
+0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xAD, 0x50, 0xE8, 0x36, 0x63, 0x60,
+0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, 0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xFA, 0xF0,
+0xEC, 0xB5, 0x6D, 0x00, 0xED, 0xCF, 0x7F, 0xF0, 0xEE, 0x97, 0xF2, 0x00, 0xEF, 0xB0, 0xB3, 0x70,
+0xF0, 0x79, 0x25, 0x80, 0xF1, 0x91, 0xE6, 0xF0, 0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x73, 0x1A, 0x70,
+0xF4, 0x3B, 0x8C, 0x80, 0xF5, 0x55, 0x9F, 0x70, 0xF6, 0x1E, 0x11, 0x80, 0xF7, 0x36, 0xD2, 0xF0,
+0xF7, 0xFF, 0x45, 0x00, 0xF9, 0x18, 0x06, 0x70, 0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0,
+0xFB, 0xC2, 0xFD, 0x80, 0xFC, 0xDB, 0xBE, 0xF0, 0xFD, 0xA5, 0x82, 0x80, 0xFE, 0xBC, 0xF2, 0x70,
+0xFF, 0x86, 0xB6, 0x00, 0x00, 0x9E, 0x25, 0xF0, 0x01, 0x67, 0xE9, 0x80, 0x02, 0x7F, 0x59, 0x70,
+0x03, 0x49, 0x1D, 0x00, 0x04, 0x61, 0xDE, 0x70, 0x05, 0x2B, 0xA2, 0x00, 0x06, 0x43, 0x11, 0xF0,
+0x07, 0x0C, 0xD5, 0x80, 0x08, 0x24, 0x45, 0x70, 0x08, 0xEE, 0x09, 0x00, 0x0A, 0x05, 0x78, 0xF0,
+0x0A, 0xCF, 0x3C, 0x80, 0x0B, 0xE7, 0xFD, 0xF0, 0x0C, 0xB1, 0xC1, 0x80, 0x0D, 0xC9, 0x31, 0x70,
+0x0E, 0x92, 0xF5, 0x00, 0x0F, 0xAA, 0x64, 0xF0, 0x10, 0x74, 0x28, 0x80, 0x11, 0x8B, 0x98, 0x70,
+0x12, 0x55, 0x5C, 0x00, 0x13, 0x6E, 0x1D, 0x70, 0x14, 0x37, 0xE1, 0x00, 0x15, 0x4F, 0x50, 0xF0,
+0x16, 0x19, 0x14, 0x80, 0x17, 0xA0, 0x93, 0xF0, 0x17, 0xFA, 0x48, 0x00, 0x19, 0x70, 0xA3, 0xF0,
+0x19, 0xDB, 0x7B, 0x80, 0x1A, 0xF4, 0x3C, 0xF0, 0x1B, 0xBE, 0x00, 0x80, 0x1C, 0xD5, 0x70, 0x70,
+0x1D, 0x9F, 0x34, 0x00, 0x1E, 0xB6, 0xA3, 0xF0, 0x1F, 0x80, 0x67, 0x80, 0x20, 0x97, 0xD7, 0x70,
+0x21, 0x61, 0x9B, 0x00, 0x22, 0x7A, 0x5C, 0x70, 0x23, 0x44, 0x20, 0x00, 0x24, 0x62, 0x27, 0x70,
+0x25, 0x25, 0x53, 0x80, 0x26, 0x3C, 0xC3, 0x70, 0x27, 0x06, 0x87, 0x00, 0x28, 0x1D, 0xF6, 0xF0,
+0x28, 0xE7, 0xBA, 0x80, 0x2A, 0x00, 0x7B, 0xF0, 0x2A, 0xCA, 0x3F, 0x80, 0x2B, 0xE1, 0xAF, 0x70,
+0x2C, 0xAB, 0x73, 0x00, 0x2D, 0xC2, 0xE2, 0xF0, 0x2E, 0x8C, 0xA6, 0x80, 0x2F, 0xA0, 0x13, 0xE0,
+0x30, 0x6B, 0x0C, 0xD0, 0x31, 0x7F, 0xF5, 0xE0, 0x32, 0x4A, 0xEE, 0xD0, 0x33, 0x5F, 0xD7, 0xE0,
+0x34, 0x2A, 0xD0, 0xD0, 0x35, 0x3F, 0xB9, 0xE0, 0x36, 0x0A, 0xB2, 0xD0, 0x37, 0x28, 0xD6, 0x60,
+0x37, 0xF3, 0xCF, 0x50, 0x39, 0x08, 0xB8, 0x60, 0x39, 0xD3, 0xB1, 0x50, 0x3A, 0xE8, 0x9A, 0x60,
+0x3B, 0xB3, 0x93, 0x50, 0x3C, 0xC8, 0x7C, 0x60, 0x3D, 0x93, 0x75, 0x50, 0x3E, 0xA8, 0x5E, 0x60,
+0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0,
+0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x1C, 0x37, 0xD0, 0x46, 0x31, 0x20, 0xE0,
+0x46, 0xFC, 0x19, 0xD0, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xDB, 0xFB, 0xD0, 0x49, 0xF0, 0xE4, 0xE0,
+0x4A, 0xBB, 0xDD, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60,
+0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60,
+0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60, 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60,
+0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xED, 0x80, 0xD0, 0x59, 0x02, 0x69, 0xE0,
+0x59, 0xCD, 0x62, 0xD0, 0x5A, 0xE2, 0x4B, 0xE0, 0x5B, 0xAD, 0x44, 0xD0, 0x5C, 0xC2, 0x2D, 0xE0,
+0x5D, 0x8D, 0x26, 0xD0, 0x5E, 0xA2, 0x0F, 0xE0, 0x5F, 0x6D, 0x08, 0xD0, 0x60, 0x8B, 0x2C, 0x60,
+0x61, 0x56, 0x25, 0x50, 0x62, 0x6B, 0x0E, 0x60, 0x63, 0x36, 0x07, 0x50, 0x64, 0x4A, 0xF0, 0x60,
+0x65, 0x15, 0xE9, 0x50, 0x66, 0x2A, 0xD2, 0x60, 0x66, 0xF5, 0xCB, 0x50, 0x68, 0x0A, 0xB4, 0x60,
+0x68, 0xD5, 0xAD, 0x50, 0x69, 0xEA, 0x96, 0x60, 0x6A, 0xB5, 0x8F, 0x50, 0x6B, 0xD3, 0xB2, 0xE0,
+0x6C, 0x9E, 0xAB, 0xD0, 0x6D, 0xB3, 0x94, 0xE0, 0x6E, 0x7E, 0x8D, 0xD0, 0x6F, 0x93, 0x76, 0xE0,
+0x70, 0x5E, 0x6F, 0xD0, 0x71, 0x73, 0x58, 0xE0, 0x72, 0x3E, 0x51, 0xD0, 0x73, 0x53, 0x3A, 0xE0,
+0x74, 0x1E, 0x33, 0xD0, 0x75, 0x3C, 0x57, 0x60, 0x76, 0x07, 0x50, 0x50, 0x77, 0x1C, 0x39, 0x60,
+0x77, 0xE7, 0x32, 0x50, 0x78, 0xFC, 0x1B, 0x60, 0x79, 0xC7, 0x14, 0x50, 0x7A, 0xDB, 0xFD, 0x60,
+0x7B, 0xA6, 0xF6, 0x50, 0x7C, 0xBB, 0xDF, 0x60, 0x7D, 0x86, 0xD8, 0x50, 0x7E, 0x9B, 0xC1, 0x60,
+0x7F, 0x66, 0xBA, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00,
+0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45,
+0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Eire */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xE5, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x26, 0xB3, 0x91,
+0x9B, 0xD6, 0x0B, 0x11, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0,
+0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20,
+0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA5, 0x94, 0x3F, 0x00,
+0xA6, 0x25, 0x60, 0x20, 0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0,
+0xAA, 0x00, 0xD3, 0xA0, 0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20,
+0xAD, 0xC9, 0xD2, 0x20, 0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20,
+0xB1, 0x92, 0xD0, 0xA0, 0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0,
+0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0,
+0xB9, 0x12, 0x58, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20,
+0xBC, 0xDB, 0x57, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20,
+0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20,
+0xC4, 0x51, 0xA4, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0,
+0xC7, 0xDA, 0x09, 0xA0, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x1E, 0x21, 0xA0, 0xD6, 0x4E, 0x9E, 0x10,
+0xD7, 0x2C, 0x28, 0x20, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20,
+0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, 0xDD, 0xC4, 0xF9, 0xA0,
+0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, 0xE1, 0x72, 0x48, 0xA0,
+0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, 0xE5, 0x32, 0x0C, 0xA0,
+0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, 0xE8, 0xFB, 0x0B, 0x20,
+0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, 0xEC, 0xBA, 0xCF, 0x20,
+0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, 0xF0, 0x9F, 0x7D, 0x20,
+0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, 0xF4, 0x5F, 0x41, 0x20,
+0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, 0xF8, 0x1F, 0x05, 0x20,
+0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, 0xFB, 0xE8, 0x03, 0xA0,
+0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, 0x04, 0x29, 0x58, 0x20,
+0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, 0x07, 0xE9, 0x1C, 0x20,
+0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, 0x0B, 0xB2, 0x1A, 0xA0,
+0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, 0x0F, 0x71, 0xDE, 0xA0,
+0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, 0x13, 0x31, 0xA2, 0xA0,
+0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, 0x17, 0x03, 0xCD, 0x90,
+0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, 0x1A, 0xC3, 0x91, 0x90,
+0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, 0x1E, 0x8C, 0x90, 0x10,
+0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, 0x22, 0x4C, 0x54, 0x10,
+0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, 0x26, 0x0C, 0x18, 0x10,
+0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, 0x29, 0xD5, 0x16, 0x90,
+0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, 0x30, 0xE7, 0x24, 0x00,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x06, 0x05, 0x06, 0x05, 0x06, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x07, 0x09,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0xFF, 0xFF, 0xFA, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1F, 0x01,
+0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E,
+0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x0C, 0x44, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* EST */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x8B, 0xF4, 0x61, 0xE8,
+0x01, 0xFF, 0xFF, 0xB5, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x43, 0x4D, 0x54,
+0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* EST5EDT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x1E, 0x70,
+0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x86, 0x00, 0x70, 0xA1, 0x9A, 0xCD, 0x60, 0xA2, 0x65, 0xE2, 0x70,
+0xA3, 0x83, 0xE9, 0xE0, 0xA4, 0x6A, 0xAE, 0x70, 0xA5, 0x35, 0xA7, 0x60, 0xA6, 0x53, 0xCA, 0xF0,
+0xA7, 0x15, 0x89, 0x60, 0xA8, 0x33, 0xAC, 0xF0, 0xA8, 0xFE, 0xA5, 0xE0, 0xAA, 0x13, 0x8E, 0xF0,
+0xAA, 0xDE, 0x87, 0xE0, 0xAB, 0xF3, 0x70, 0xF0, 0xAC, 0xBE, 0x69, 0xE0, 0xAD, 0xD3, 0x52, 0xF0,
+0xAE, 0x9E, 0x4B, 0xE0, 0xAF, 0xB3, 0x34, 0xF0, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70,
+0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70,
+0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x1B, 0xD9, 0x70,
+0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xC6, 0xB4, 0x60, 0xBC, 0xE4, 0xD7, 0xF0,
+0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0,
+0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0,
+0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70,
+0xC8, 0xF8, 0x57, 0x60, 0xCA, 0x0D, 0x40, 0x70, 0xCA, 0xD8, 0x39, 0x60, 0xCB, 0x88, 0xF0, 0x70,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, 0xD4, 0x40, 0xDD, 0xE0,
+0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0,
+0xD9, 0x15, 0x8A, 0xF0, 0xD9, 0xE0, 0x83, 0xE0, 0xDA, 0xFE, 0xA7, 0x70, 0xDB, 0xC0, 0x65, 0xE0,
+0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, 0xDF, 0x89, 0x64, 0x60,
+0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, 0xE3, 0x49, 0x28, 0x60,
+0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x57, 0x2E, 0xE0, 0xE6, 0x47, 0x2D, 0xF0, 0xE7, 0x37, 0x10, 0xE0,
+0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, 0xEA, 0xF6, 0xD4, 0xE0,
+0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, 0xEE, 0xBF, 0xD3, 0x60,
+0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, 0xF2, 0x7F, 0x97, 0x60,
+0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60,
+0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0,
+0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0,
+0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0,
+0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60,
+0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60,
+0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0,
+0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0,
+0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0,
+0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60,
+0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60,
+0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60,
+0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0,
+0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0,
+0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0,
+0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60,
+0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60,
+0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60,
+0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0,
+0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0,
+0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60,
+0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60,
+0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0,
+0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60,
+0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60,
+0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60,
+0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0,
+0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0,
+0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0,
+0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60,
+0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60,
+0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60,
+0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0,
+0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0,
+0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60,
+0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60,
+0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60,
+0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF,
+0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00, 0x00, 0x01,
+
+/* Etc/GMT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* Etc/GMT0 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-0 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+0 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-1 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+1 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xF1, 0xF0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-10 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x8C, 0xA0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x30, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+10 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x73, 0x60,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x30, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-11 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x9A, 0xB0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x31, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+11 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x65, 0x50,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x31, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-12 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xA8, 0xC0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x32, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+12 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x57, 0x40,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x32, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-13 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xB6, 0xD0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x33, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-14 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xC4, 0xE0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x34, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-2 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x1C, 0x20,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x32, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+2 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xE3, 0xE0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x32, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-3 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x2A, 0x30,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x33, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+3 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xD5, 0xD0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x33, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-4 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x38, 0x40,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x34, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+4 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xC7, 0xC0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x34, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-5 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x46, 0x50,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x35, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+5 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xB9, 0xB0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x35, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-6 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x54, 0x60,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x36, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+6 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xAB, 0xA0,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x36, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-7 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x62, 0x70,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x37, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+7 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x9D, 0x90,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x37, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-8 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x70, 0x80,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x38, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+8 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x8F, 0x80,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x38, 0x00, 0x00, 0x00,
+
+/* Etc/GMT-9 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x7E, 0x90,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x39, 0x00, 0x00, 0x00,
+
+/* Etc/GMT+9 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x81, 0x70,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x39, 0x00, 0x00, 0x00,
+
+/* Etc/Greenwich */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* Etc/UCT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x55, 0x43, 0x54, 0x00, 0x00, 0x00,
+
+/* Etc/Universal */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00,
+
+/* Etc/UTC */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00,
+
+/* Etc/Zulu */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00,
+
+/* Europe/Amsterdam */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x1A, 0x9B, 0x0C, 0x2E, 0xEC,
+0x9B, 0xD5, 0xD6, 0x5C, 0x9C, 0xD9, 0xB8, 0x0C, 0x9D, 0xA4, 0xBF, 0x0C, 0x9E, 0xA7, 0x25, 0x0C,
+0x9F, 0x97, 0x16, 0x0C, 0xA0, 0x90, 0x41, 0x8C, 0xA1, 0x76, 0xF8, 0x0C, 0xA2, 0x70, 0x23, 0x8C,
+0xA3, 0x56, 0xDA, 0x0C, 0xA4, 0x50, 0x05, 0x8C, 0xA5, 0x36, 0xBC, 0x0C, 0xA6, 0x25, 0x5B, 0x8C,
+0xA7, 0x27, 0xC1, 0x8C, 0xA8, 0x5E, 0xE3, 0x8C, 0xA9, 0x07, 0xA3, 0x8C, 0xA9, 0xEE, 0x5A, 0x0C,
+0xAA, 0xE7, 0x85, 0x8C, 0xAC, 0x27, 0xE2, 0x0C, 0xAC, 0xC7, 0x67, 0x8C, 0xAD, 0xED, 0x66, 0x0C,
+0xAE, 0xA7, 0x49, 0x8C, 0xAF, 0xCE, 0x99, 0x8C, 0xB0, 0x87, 0x2B, 0x8C, 0xB1, 0xB1, 0x1E, 0x8C,
+0xB2, 0x70, 0x48, 0x0C, 0xB3, 0x92, 0x52, 0x0C, 0xB4, 0x50, 0x2A, 0x0C, 0xB5, 0x73, 0x85, 0x8C,
+0xB6, 0x30, 0x0C, 0x0C, 0xB7, 0x54, 0xB9, 0x0C, 0xB8, 0x0F, 0xEE, 0x0C, 0xB9, 0x40, 0x78, 0x8C,
+0xB9, 0xEF, 0xD0, 0x0C, 0xBB, 0x18, 0x71, 0x8C, 0xBB, 0xD8, 0xEC, 0x8C, 0xBC, 0xF9, 0xA5, 0x0C,
+0xBD, 0xB8, 0xCE, 0x8C, 0xBE, 0xDA, 0xD8, 0x8C, 0xBF, 0x98, 0xB0, 0x8C, 0xC0, 0xBD, 0x5D, 0x8C,
+0xC1, 0x78, 0x92, 0x8C, 0xC2, 0xA7, 0xCB, 0x8C, 0xC2, 0xDC, 0x5D, 0x5C, 0xC3, 0x58, 0x74, 0x70,
+0xC4, 0x7F, 0xC4, 0x70, 0xC5, 0x38, 0x56, 0x70, 0xC6, 0x60, 0xF7, 0xF0, 0xC7, 0x21, 0x72, 0xF0,
+0xC8, 0x44, 0xB2, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10,
+0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90,
+0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90,
+0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10,
+0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90,
+0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90,
+0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10,
+0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10,
+0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10,
+0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90,
+0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10,
+0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x09, 0x07, 0x08,
+0x07, 0x08, 0x07, 0x08, 0x07, 0x0C, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x00, 0x00, 0x12, 0xA4, 0x01, 0x00, 0x00, 0x00, 0x04, 0x94, 0x00, 0x04, 0x00, 0x00, 0x12, 0xA4,
+0x01, 0x00, 0x00, 0x00, 0x04, 0x94, 0x00, 0x04, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x08, 0x00, 0x00,
+0x12, 0xC0, 0x01, 0x0C, 0x00, 0x00, 0x12, 0xC0, 0x01, 0x0C, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x11,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20,
+0x01, 0x15, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x11, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x11, 0x4E, 0x53,
+0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x45, 0x54, 0x00, 0x4E, 0x45, 0x53, 0x54, 0x00, 0x43,
+0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01,
+0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x00,
+
+/* Europe/Andorra */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xD4, 0x41, 0xDB, 0x00,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00,
+0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x57, 0x45, 0x54, 0x00, 0x43,
+0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01,
+
+
+/* Europe/Athens */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x80, 0x21, 0x80,
+0xB9, 0x7C, 0xE9, 0xE0, 0xB9, 0xC6, 0xAF, 0xD0, 0xC9, 0xF2, 0x63, 0xE0, 0xCA, 0x10, 0xA8, 0x50,
+0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xAA, 0x4C, 0xF0, 0xCE, 0xA2, 0x18, 0xE0, 0xCF, 0x93, 0x69, 0x70,
+0xDF, 0x13, 0x9E, 0x60, 0xDF, 0xB7, 0x0A, 0x50, 0x09, 0xEC, 0x5E, 0x60, 0x0B, 0x18, 0xF4, 0x60,
+0x0B, 0xCD, 0xAE, 0x00, 0x0C, 0xBD, 0x9F, 0x00, 0x0D, 0xA4, 0x55, 0x80, 0x0E, 0x8C, 0x5D, 0x80,
+0x0F, 0x84, 0x37, 0x80, 0x10, 0x6A, 0xFC, 0x10, 0x11, 0x64, 0x7B, 0xF0, 0x12, 0x52, 0xAA, 0xF0,
+0x13, 0x46, 0x82, 0x60, 0x14, 0x33, 0xC2, 0x50, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x02, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x02, 0x01, 0x02, 0x01, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x00, 0x00, 0x16, 0x3C, 0x00, 0x00, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x11, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C,
+0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x41,
+0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00,
+0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Belfast */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0,
+0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0,
+0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20,
+0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20,
+0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0,
+0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20,
+0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0,
+0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20,
+0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0,
+0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20,
+0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20,
+0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0,
+0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0,
+0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90,
+0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90,
+0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0,
+0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10,
+0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20,
+0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20,
+0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0,
+0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0,
+0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0,
+0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20,
+0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0,
+0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20,
+0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0,
+0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0,
+0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20,
+0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20,
+0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20,
+0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20,
+0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0,
+0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90,
+0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03,
+0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00,
+0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+
+/* Europe/Belgrade */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0,
+0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10,
+0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70,
+0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Berlin */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0E, 0x9B, 0x0C, 0x17, 0x60,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90,
+0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10,
+0xD1, 0xB6, 0x96, 0x00, 0xD2, 0x58, 0xBE, 0x80, 0xD2, 0xA1, 0x4F, 0x10, 0xD3, 0x63, 0x1B, 0x90,
+0xD4, 0x4B, 0x23, 0x90, 0xD5, 0x39, 0xC3, 0x10, 0xD5, 0x67, 0xE7, 0x90, 0xD5, 0xA8, 0x73, 0x00,
+0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x02, 0xC1, 0x90,
+0xD9, 0xE9, 0x78, 0x10, 0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90,
+0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90,
+0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x00, 0x03, 0x02, 0x03, 0x02, 0x05, 0x00, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x01, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00,
+0x43, 0x45, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Bratislava */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90,
+0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x6E, 0x5E, 0x90, 0xD1, 0x79, 0xFF, 0x10,
+0xD2, 0xA1, 0x4F, 0x10, 0xD3, 0x80, 0x1C, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x4C, 0x38, 0x10,
+0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x01, 0x70, 0x10,
+0xD9, 0xE9, 0x78, 0x10, 0x10, 0xED, 0x64, 0x70, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90,
+0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Brussels */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x12, 0x98, 0x44, 0x49, 0x80,
+0x9B, 0x0C, 0x25, 0x70, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90,
+0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0x9F, 0xCE, 0xF8, 0x30, 0xA0, 0x60, 0xA5, 0xF0,
+0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0,
+0xA5, 0x5E, 0x23, 0x70, 0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0x9B, 0xF0, 0xA8, 0x2A, 0x01, 0xF0,
+0xA9, 0x07, 0x7D, 0xF0, 0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAB, 0xD7, 0x50, 0xF0,
+0xAC, 0xC7, 0x41, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70,
+0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0,
+0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0,
+0xB8, 0x0F, 0xF2, 0xA0, 0xB8, 0xFF, 0xE3, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xD6, 0x8B, 0x20,
+0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xC8, 0xE2, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0x9F, 0x89, 0xA0,
+0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x68, 0x88, 0x20,
+0xC3, 0x58, 0x79, 0x20, 0xC4, 0x3F, 0x2F, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20,
+0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, 0xC8, 0x4A, 0x19, 0x20, 0xCC, 0xE7, 0x4B, 0x10,
+0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x5B, 0xBF, 0x60,
+0xD0, 0x6E, 0x5E, 0x90, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0xD3, 0x91, 0x40, 0x10,
+0xD4, 0x4B, 0x23, 0x90, 0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10,
+0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90,
+0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x04, 0x01, 0x02, 0x03, 0x02, 0x03, 0x07, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x04, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53,
+0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
+
+/* Europe/Bucharest */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0xB7, 0xB0, 0xD2, 0x08,
+0xB9, 0x3E, 0xF3, 0x60, 0xB9, 0xEF, 0x9C, 0x60, 0xBA, 0xDF, 0x8D, 0x60, 0xBB, 0xCF, 0x7E, 0x60,
+0xBC, 0xC8, 0xA9, 0xE0, 0xBD, 0xB8, 0x9A, 0xE0, 0xBE, 0xA8, 0x8B, 0xE0, 0xBF, 0x98, 0x7C, 0xE0,
+0xC0, 0x88, 0x6D, 0xE0, 0xC1, 0x78, 0x5E, 0xE0, 0xC2, 0x68, 0x4F, 0xE0, 0xC3, 0x58, 0x40, 0xE0,
+0xC4, 0x48, 0x31, 0xE0, 0xC5, 0x38, 0x22, 0xE0, 0xC6, 0x28, 0x13, 0xE0, 0xC7, 0x18, 0x04, 0xE0,
+0x11, 0xAD, 0xD1, 0x60, 0x12, 0x53, 0xE0, 0x50, 0x13, 0x4D, 0x0B, 0xD0, 0x14, 0x33, 0xD0, 0x60,
+0x15, 0x23, 0xDD, 0x80, 0x16, 0x13, 0xCE, 0x80, 0x17, 0x03, 0xBF, 0x80, 0x17, 0xF3, 0xB0, 0x80,
+0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80, 0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00,
+0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00,
+0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00,
+0x24, 0x2C, 0x28, 0x00, 0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80,
+0x27, 0x7F, 0xB4, 0xE0, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0xD4, 0xEC, 0x60,
+0x2A, 0xC4, 0xDD, 0x60, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xBF, 0x60, 0x2D, 0x24, 0xA0, 0xE0,
+0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50,
+0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x00, 0x00, 0x18, 0x78, 0x00, 0x00, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C,
+0x20, 0x00, 0x09, 0x42, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Budapest */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0x30, 0x58, 0x70,
+0x9E, 0xA7, 0x29, 0xA0, 0x9F, 0x95, 0xBB, 0x10, 0xA0, 0x9A, 0xD2, 0x20, 0xA1, 0x64, 0x79, 0x90,
+0xA2, 0x70, 0x28, 0x20, 0xA3, 0x5A, 0xC5, 0x10, 0xC9, 0xF1, 0x3C, 0x90, 0xCC, 0xE7, 0x4B, 0x10,
+0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10,
+0xD1, 0x99, 0x78, 0xE0, 0xD2, 0x8D, 0x5E, 0x60, 0xD3, 0x50, 0xA6, 0x90, 0xD4, 0x49, 0xD2, 0x10,
+0xD5, 0x39, 0xC3, 0x10, 0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x19, 0xA5, 0x10, 0xD8, 0x09, 0x96, 0x10,
+0xD9, 0x02, 0xC1, 0x90, 0xD9, 0xE9, 0x78, 0x10, 0xDA, 0xED, 0x2F, 0x90, 0xDB, 0xE6, 0x5B, 0x10,
+0xE2, 0xA2, 0xA8, 0xF0, 0xE3, 0x51, 0xF2, 0x60, 0xE4, 0x83, 0xDC, 0x70, 0xE5, 0x33, 0x25, 0xE0,
+0xE6, 0x74, 0xE1, 0xF0, 0xE7, 0x11, 0xB6, 0x60, 0xE8, 0x54, 0xD2, 0x00, 0xE8, 0xF1, 0xC2, 0x90,
+0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x43, 0x45, 0x53,
+0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01,
+
+/* Europe/Chisinau */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x22, 0x9E, 0x6B, 0x9F, 0x0C,
+0xB7, 0xB0, 0xD2, 0x08, 0xB9, 0x3E, 0xF3, 0x60, 0xB9, 0xEF, 0x9C, 0x60, 0xBA, 0xDF, 0x8D, 0x60,
+0xBB, 0xCF, 0x7E, 0x60, 0xBC, 0xC8, 0xA9, 0xE0, 0xBD, 0xB8, 0x9A, 0xE0, 0xBE, 0xA8, 0x8B, 0xE0,
+0xBF, 0x98, 0x7C, 0xE0, 0xC0, 0x88, 0x6D, 0xE0, 0xC1, 0x78, 0x5E, 0xE0, 0xC2, 0x68, 0x4F, 0xE0,
+0xC3, 0x58, 0x40, 0xE0, 0xC4, 0x48, 0x31, 0xE0, 0xC5, 0x38, 0x22, 0xE0, 0xC6, 0x28, 0x13, 0xE0,
+0xC7, 0x18, 0x04, 0xE0, 0xC8, 0xBC, 0x93, 0x60, 0xCA, 0x77, 0x7D, 0x50, 0xCC, 0xE7, 0x4B, 0x10,
+0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x4E, 0x90, 0x60,
+0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0,
+0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0,
+0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0,
+0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0,
+0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x43, 0x3E, 0xD0,
+0x27, 0xF5, 0x26, 0x80, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x60, 0xE8, 0x60, 0x29, 0xD4, 0xEC, 0x60,
+0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60,
+0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0,
+0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x04, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x08,
+0x06, 0x07, 0x06, 0x07, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0B, 0x0C, 0x0B, 0x0C,
+0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0A, 0x04, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x00, 0x00, 0x1A, 0xF4, 0x00, 0x00, 0x00, 0x00,
+0x18, 0x78, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D,
+0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00,
+0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E,
+0x00, 0x00, 0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20,
+0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45,
+0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00,
+0x4D, 0x53, 0x4B, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01,
+
+/* Europe/Copenhagen */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x1E, 0x8C, 0x60,
+0x9B, 0xD5, 0xBE, 0xD0, 0xC8, 0x43, 0x57, 0x70, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10,
+0xD2, 0x24, 0x10, 0x90, 0xD3, 0x79, 0x85, 0x10, 0xD4, 0x1B, 0xAD, 0x90, 0xD5, 0x5E, 0xAD, 0x10,
+0xD5, 0xDF, 0xE0, 0x10, 0xD7, 0x47, 0xC9, 0x90, 0xD7, 0xBF, 0xC2, 0x10, 0x12, 0xCE, 0x97, 0xF0,
+0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45,
+0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Dublin */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xE5, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x26, 0xB3, 0x91,
+0x9B, 0xD6, 0x0B, 0x11, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0,
+0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20,
+0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA5, 0x94, 0x3F, 0x00,
+0xA6, 0x25, 0x60, 0x20, 0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0,
+0xAA, 0x00, 0xD3, 0xA0, 0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20,
+0xAD, 0xC9, 0xD2, 0x20, 0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20,
+0xB1, 0x92, 0xD0, 0xA0, 0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0,
+0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0,
+0xB9, 0x12, 0x58, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20,
+0xBC, 0xDB, 0x57, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20,
+0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20,
+0xC4, 0x51, 0xA4, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0,
+0xC7, 0xDA, 0x09, 0xA0, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x1E, 0x21, 0xA0, 0xD6, 0x4E, 0x9E, 0x10,
+0xD7, 0x2C, 0x28, 0x20, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20,
+0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, 0xDD, 0xC4, 0xF9, 0xA0,
+0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, 0xE1, 0x72, 0x48, 0xA0,
+0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, 0xE5, 0x32, 0x0C, 0xA0,
+0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, 0xE8, 0xFB, 0x0B, 0x20,
+0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, 0xEC, 0xBA, 0xCF, 0x20,
+0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, 0xF0, 0x9F, 0x7D, 0x20,
+0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, 0xF4, 0x5F, 0x41, 0x20,
+0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, 0xF8, 0x1F, 0x05, 0x20,
+0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, 0xFB, 0xE8, 0x03, 0xA0,
+0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, 0x04, 0x29, 0x58, 0x20,
+0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, 0x07, 0xE9, 0x1C, 0x20,
+0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, 0x0B, 0xB2, 0x1A, 0xA0,
+0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, 0x0F, 0x71, 0xDE, 0xA0,
+0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, 0x13, 0x31, 0xA2, 0xA0,
+0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, 0x17, 0x03, 0xCD, 0x90,
+0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, 0x1A, 0xC3, 0x91, 0x90,
+0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, 0x1E, 0x8C, 0x90, 0x10,
+0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, 0x22, 0x4C, 0x54, 0x10,
+0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, 0x26, 0x0C, 0x18, 0x10,
+0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, 0x29, 0xD5, 0x16, 0x90,
+0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, 0x30, 0xE7, 0x24, 0x00,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x06, 0x05, 0x06, 0x05, 0x06, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x07, 0x09,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0xFF, 0xFF, 0xFA, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1F, 0x01,
+0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E,
+0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x0C, 0x44, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Gibraltar */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xC5, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x26, 0xAD, 0xA0,
+0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0,
+0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20,
+0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20,
+0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0,
+0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20,
+0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0,
+0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20,
+0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0,
+0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20,
+0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20,
+0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0,
+0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0,
+0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90,
+0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90,
+0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0,
+0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10,
+0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20,
+0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20,
+0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0,
+0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0,
+0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x11, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54,
+0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x01,
+0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Helsinki */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA4, 0x73, 0x6F, 0x18,
+0xCB, 0xCE, 0x51, 0x60, 0xCC, 0xBF, 0x85, 0xD0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x17, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C,
+0x20, 0x00, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Istanbul */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x90, 0x8B, 0xF5, 0x98,
+0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xBE, 0xD0, 0xA2, 0x65, 0x63, 0xE0, 0xA3, 0x7B, 0x82, 0x50,
+0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, 0xA7, 0x27, 0x7F, 0xD0,
+0xAA, 0x28, 0x28, 0x60, 0xAA, 0xE1, 0xFD, 0xD0, 0xAB, 0xF9, 0x89, 0xE0, 0xAC, 0xC3, 0x31, 0x50,
+0xC8, 0x7F, 0xEE, 0x60, 0xC8, 0xFF, 0xC1, 0xD0, 0xC9, 0x4A, 0xF5, 0x60, 0xCA, 0xCE, 0x80, 0x50,
+0xCB, 0xCB, 0xAE, 0x60, 0xCC, 0xE5, 0xC1, 0x50, 0xD1, 0x71, 0xEB, 0xE0, 0xD2, 0x6B, 0x09, 0x50,
+0xD3, 0xA2, 0x39, 0x60, 0xD4, 0x43, 0x02, 0x50, 0xD5, 0x4C, 0x0D, 0xE0, 0xD6, 0x29, 0x7B, 0xD0,
+0xD7, 0x2B, 0xEF, 0xE0, 0xD8, 0x09, 0x5D, 0xD0, 0xD9, 0x02, 0x97, 0x60, 0xD9, 0xE9, 0x3F, 0xD0,
+0xDA, 0xEF, 0xA8, 0x60, 0xDB, 0xD2, 0x5C, 0x50, 0xDC, 0xD4, 0xD0, 0x60, 0xDD, 0xB3, 0x8F, 0xD0,
+0xF1, 0xF4, 0xB9, 0x60, 0xF2, 0x64, 0xBA, 0xD0, 0xF5, 0x68, 0x06, 0x60, 0xF6, 0x1F, 0x38, 0xD0,
+0x00, 0xA0, 0xBA, 0xE0, 0x01, 0x6B, 0xB3, 0xD0, 0x02, 0x80, 0x9C, 0xE0, 0x03, 0x4B, 0x95, 0xD0,
+0x04, 0x69, 0xB9, 0x60, 0x05, 0x34, 0xB2, 0x50, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x39, 0xA8, 0x80,
+0x07, 0xFB, 0x75, 0x00, 0x09, 0x19, 0xA6, 0xA0, 0x09, 0xDB, 0x3A, 0xE0, 0x0A, 0xF0, 0x07, 0xD0,
+0x0C, 0x10, 0xCE, 0x60, 0x0C, 0xD9, 0x24, 0x50, 0x0D, 0xA4, 0x39, 0x60, 0x0E, 0xA6, 0x91, 0x50,
+0x0F, 0x84, 0x1B, 0x60, 0x10, 0x86, 0x73, 0x50, 0x12, 0x67, 0x98, 0xC0, 0x13, 0x4D, 0x36, 0x00,
+0x14, 0x47, 0x7A, 0xC0, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x27, 0x5C, 0xC0, 0x17, 0x03, 0xBF, 0x80,
+0x18, 0x07, 0x3E, 0xC0, 0x19, 0x89, 0x94, 0x50, 0x19, 0xDC, 0x94, 0xC0, 0x1C, 0xC6, 0xD3, 0xD0,
+0x1D, 0x9B, 0x15, 0x50, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00,
+0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00,
+0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0x7F, 0xB4, 0xE0,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x00, 0x00, 0x1B, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00,
+0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00,
+0x12, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A,
+0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x49, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53,
+0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x54, 0x52, 0x53, 0x54, 0x00, 0x54, 0x52, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01,
+
+/* Europe/Kaliningrad */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0x9B, 0x0C, 0x17, 0x60,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90,
+0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD0, 0xFA, 0x01, 0x70,
+0xD1, 0x95, 0x84, 0x60, 0xD2, 0x8A, 0xAD, 0x50, 0xD2, 0xDB, 0x26, 0xE0, 0x15, 0x27, 0xA7, 0xD0,
+0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0,
+0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0,
+0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0,
+0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0,
+0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70,
+0x28, 0xE5, 0x17, 0x80, 0x29, 0xD4, 0xDE, 0x50, 0x2A, 0xC4, 0xC1, 0x40, 0x2B, 0xB4, 0xEA, 0x80,
+0x2C, 0xA4, 0xDB, 0x80, 0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80,
+0x30, 0x64, 0x9F, 0x80, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00,
+0x34, 0x52, 0x88, 0x00, 0x35, 0x1D, 0x8F, 0x00, 0x36, 0x32, 0x6A, 0x00, 0x36, 0xFD, 0x71, 0x00,
+0x38, 0x1B, 0x86, 0x80, 0x38, 0xDD, 0x53, 0x00, 0x39, 0xFB, 0x68, 0x80, 0x3A, 0xBD, 0x35, 0x00,
+0x3B, 0xDB, 0x4A, 0x80, 0x3C, 0xA6, 0x51, 0x80, 0x3D, 0xBB, 0x2C, 0x80, 0x3E, 0x86, 0x33, 0x80,
+0x3F, 0x9B, 0x0E, 0x80, 0x40, 0x66, 0x15, 0x80, 0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80,
+0x43, 0x64, 0x0D, 0x00, 0x44, 0x25, 0xD9, 0x80, 0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80,
+0x47, 0x23, 0xD1, 0x00, 0x47, 0xEE, 0xD8, 0x00, 0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00,
+0x4A, 0xE3, 0x95, 0x00, 0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00,
+0x4E, 0xAC, 0x93, 0x80, 0x4F, 0x6E, 0x60, 0x00, 0x50, 0x8C, 0x75, 0x80, 0x51, 0x57, 0x7C, 0x80,
+0x52, 0x6C, 0x57, 0x80, 0x53, 0x37, 0x5E, 0x80, 0x54, 0x4C, 0x39, 0x80, 0x55, 0x17, 0x40, 0x80,
+0x56, 0x2C, 0x1B, 0x80, 0x56, 0xF7, 0x22, 0x80, 0x58, 0x15, 0x38, 0x00, 0x58, 0xD7, 0x04, 0x80,
+0x59, 0xF5, 0x1A, 0x00, 0x5A, 0xB6, 0xE6, 0x80, 0x5B, 0xD4, 0xFC, 0x00, 0x5C, 0xA0, 0x03, 0x00,
+0x5D, 0xB4, 0xDE, 0x00, 0x5E, 0x7F, 0xE5, 0x00, 0x5F, 0x94, 0xC0, 0x00, 0x60, 0x5F, 0xC7, 0x00,
+0x61, 0x7D, 0xDC, 0x80, 0x62, 0x3F, 0xA9, 0x00, 0x63, 0x5D, 0xBE, 0x80, 0x64, 0x1F, 0x8B, 0x00,
+0x65, 0x3D, 0xA0, 0x80, 0x66, 0x08, 0xA7, 0x80, 0x67, 0x1D, 0x82, 0x80, 0x67, 0xE8, 0x89, 0x80,
+0x68, 0xFD, 0x64, 0x80, 0x69, 0xC8, 0x6B, 0x80, 0x6A, 0xDD, 0x46, 0x80, 0x6B, 0xA8, 0x4D, 0x80,
+0x6C, 0xC6, 0x63, 0x00, 0x6D, 0x88, 0x2F, 0x80, 0x6E, 0xA6, 0x45, 0x00, 0x6F, 0x68, 0x11, 0x80,
+0x70, 0x86, 0x27, 0x00, 0x71, 0x51, 0x2E, 0x00, 0x72, 0x66, 0x09, 0x00, 0x73, 0x31, 0x10, 0x00,
+0x74, 0x45, 0xEB, 0x00, 0x75, 0x10, 0xF2, 0x00, 0x76, 0x2F, 0x07, 0x80, 0x76, 0xF0, 0xD4, 0x00,
+0x78, 0x0E, 0xE9, 0x80, 0x78, 0xD0, 0xB6, 0x00, 0x79, 0xEE, 0xCB, 0x80, 0x7A, 0xB0, 0x98, 0x00,
+0x7B, 0xCE, 0xAD, 0x80, 0x7C, 0x99, 0xB4, 0x80, 0x7D, 0xAE, 0x8F, 0x80, 0x7E, 0x79, 0x96, 0x80,
+0x7F, 0x8E, 0x71, 0x80, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x05, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0C, 0x0D, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00,
+0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09,
+0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40,
+0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x16, 0x00, 0x00,
+0x2A, 0x30, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x16, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43,
+0x45, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00,
+0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Europe/Kiev */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA7, 0x64,
+0xB5, 0xA4, 0x19, 0x60, 0xCA, 0xCD, 0x2E, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCE, 0xCD, 0xA8, 0x70, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40,
+0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40,
+0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0,
+0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0,
+0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0,
+0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50,
+0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x02, 0x06,
+0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08,
+0x07, 0x02, 0x01, 0x09, 0x01, 0x09, 0x01, 0x09, 0x01, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00,
+0x00, 0x1C, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00,
+0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00,
+0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D,
+0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00,
+0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Lisbon */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x10,
+0x9B, 0x4B, 0x6D, 0x70, 0x9B, 0xFE, 0xC7, 0x80, 0x9C, 0x9C, 0xED, 0x70, 0x9D, 0xC9, 0x83, 0x70,
+0x9E, 0x7F, 0x72, 0x70, 0x9F, 0xAA, 0xB6, 0xF0, 0xA0, 0x5F, 0x54, 0x70, 0xA1, 0x8B, 0xEA, 0x70,
+0xA2, 0x41, 0xD9, 0x70, 0xA3, 0x6E, 0x6F, 0x70, 0xA4, 0x23, 0x0C, 0xF0, 0xA5, 0x4F, 0xA2, 0xF0,
+0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xF4, 0x8E, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0,
+0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70,
+0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70,
+0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0,
+0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, 0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0,
+0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, 0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0,
+0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xDF, 0x70, 0xC9, 0x01, 0x2F, 0x70,
+0xC9, 0xF1, 0x20, 0x70, 0xCA, 0xE2, 0x62, 0xF0, 0xCB, 0xB5, 0x52, 0xF0, 0xCB, 0xEC, 0xA3, 0xE0,
+0xCC, 0x80, 0x4B, 0xE0, 0xCC, 0xDC, 0xA2, 0xF0, 0xCD, 0x95, 0x34, 0xF0, 0xCD, 0xC3, 0x4B, 0x60,
+0xCE, 0x72, 0xA2, 0xE0, 0xCE, 0xC5, 0xBF, 0x70, 0xCF, 0x75, 0x16, 0xF0, 0xCF, 0xAC, 0x67, 0xE0,
+0xD0, 0x52, 0x84, 0xE0, 0xD0, 0xA5, 0xA1, 0x70, 0xD1, 0x54, 0xF8, 0xF0, 0xD1, 0x8C, 0x49, 0xE0,
+0xD2, 0x32, 0x66, 0xE0, 0xD2, 0x85, 0x83, 0x70, 0xD3, 0x59, 0xC4, 0xF0, 0xD4, 0x49, 0xB5, 0xF0,
+0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x29, 0xC2, 0x20, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x09, 0xA4, 0x20,
+0xD8, 0xF9, 0x95, 0x20, 0xD9, 0xE9, 0x86, 0x20, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xB2, 0x84, 0xA0,
+0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0x92, 0x66, 0xA0, 0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x72, 0x48, 0xA0,
+0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x32, 0x0C, 0xA0,
+0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x0B, 0x1A, 0x20, 0xE8, 0xFB, 0x0B, 0x20,
+0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xBA, 0xCF, 0x20,
+0xED, 0xAA, 0xC0, 0x20, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x7A, 0x93, 0x20,
+0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x63, 0xAF, 0xA0, 0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x43, 0x91, 0xA0,
+0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x23, 0x73, 0xA0, 0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x03, 0x55, 0xA0,
+0xF8, 0xF3, 0x46, 0xA0, 0x0C, 0xAB, 0x2A, 0x00, 0x0D, 0x9B, 0x1B, 0x00, 0x0E, 0x8B, 0x0C, 0x00,
+0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x18, 0x90,
+0x13, 0x43, 0xFB, 0x80, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xBD, 0xA0, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03,
+0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x06, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0xFF, 0xFF, 0xF7,
+0x70, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
+0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C,
+0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, 0x54,
+0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+
+
+/* Europe/Ljubljana */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0,
+0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10,
+0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70,
+0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/London */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0,
+0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0,
+0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20,
+0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20,
+0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0,
+0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20,
+0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0,
+0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20,
+0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0,
+0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20,
+0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20,
+0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0,
+0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0,
+0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90,
+0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90,
+0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0,
+0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10,
+0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20,
+0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20,
+0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0,
+0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0,
+0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0,
+0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20,
+0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0,
+0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20,
+0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0,
+0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0,
+0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20,
+0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20,
+0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20,
+0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20,
+0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0,
+0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90,
+0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03,
+0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00,
+0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+
+/* Europe/Luxembourg */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x16, 0x84, 0xA2, 0xAD, 0xBC,
+0x9B, 0x1E, 0x8C, 0x60, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xEA, 0xA7, 0xE0, 0x9D, 0xA4, 0x99, 0x70,
+0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0x9F, 0xE0, 0xC4, 0x70, 0xA0, 0x60, 0xA5, 0xF0,
+0xA1, 0x7E, 0xE5, 0xA0, 0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x69, 0x10, 0xA4, 0x35, 0x81, 0xF0,
+0xA5, 0x5E, 0x3F, 0x90, 0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0xAA, 0x00, 0xA8, 0x2A, 0x01, 0xF0,
+0xA9, 0x07, 0x9A, 0x10, 0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x6E, 0x00, 0xAB, 0xD8, 0xA2, 0x70,
+0xAC, 0xC7, 0x50, 0x00, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x32, 0x00, 0xAF, 0xA0, 0x4F, 0x70,
+0xB0, 0x87, 0x14, 0x00, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x30, 0x80, 0xB3, 0x72, 0x88, 0x70,
+0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0,
+0xB8, 0x0F, 0xF2, 0xA0, 0xB8, 0xFF, 0xE3, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xD6, 0x8B, 0x20,
+0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xC8, 0xE2, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0x9F, 0x89, 0xA0,
+0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x68, 0x88, 0x20,
+0xC3, 0x58, 0x79, 0x20, 0xC4, 0x3F, 0x2F, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20,
+0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, 0xC8, 0x42, 0x30, 0x20, 0xCC, 0xE7, 0x4B, 0x10,
+0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x6F, 0xB0, 0x10,
+0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0xD3, 0x91, 0x40, 0x10, 0xD4, 0x4B, 0x23, 0x90,
+0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90,
+0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10,
+0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90,
+0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90,
+0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10,
+0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10,
+0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10,
+0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90,
+0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10,
+0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x03, 0x04, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x0B,
+0x09, 0x0A, 0x09, 0x0A, 0x02, 0x03, 0x04, 0x03, 0x04, 0x02, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D,
+0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D,
+0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D,
+0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D,
+0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D,
+0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D,
+0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D,
+0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D,
+0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x05, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04,
+0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20,
+0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54,
+0x00, 0x43, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Madrid */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xA3, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x9C, 0xF3, 0xF0, 0x70,
+0x9D, 0xBE, 0xF7, 0x70, 0x9E, 0xBA, 0xC5, 0xF0, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x8E, 0xCA, 0x70,
+0xA1, 0x81, 0x5E, 0x70, 0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0,
+0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0,
+0xB2, 0x70, 0x22, 0x70, 0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, 0xC2, 0xA8, 0xF7, 0x70,
+0xC3, 0x58, 0x4E, 0xF0, 0xC4, 0x39, 0xBF, 0x70, 0xC5, 0x38, 0x30, 0xF0, 0xC6, 0x3A, 0x96, 0xF0,
+0xC7, 0x21, 0x4D, 0x70, 0xC7, 0xF5, 0x8E, 0xF0, 0xCB, 0xF5, 0xDE, 0x60, 0xCC, 0x96, 0xB5, 0x60,
+0xCD, 0xC3, 0x4B, 0x60, 0xCE, 0xA2, 0x18, 0xE0, 0xCF, 0xA3, 0x2D, 0x60, 0xD0, 0x8D, 0xD8, 0x60,
+0xD1, 0x83, 0x0F, 0x60, 0xD2, 0x60, 0x99, 0x70, 0xD3, 0x62, 0xF1, 0x60, 0xD4, 0x41, 0xBE, 0xE0,
+0xD9, 0x1E, 0x46, 0xE0, 0xD9, 0xE6, 0xB8, 0xF0, 0x08, 0x0D, 0xCD, 0xE0, 0x08, 0xF4, 0x92, 0x70,
+0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xD4, 0x74, 0x70, 0x0B, 0xBB, 0x1C, 0xE0, 0x0C, 0xAB, 0x1B, 0xF0,
+0x0D, 0xA4, 0x39, 0x60, 0x0E, 0x8A, 0xFD, 0xF0, 0x0F, 0x85, 0x6C, 0xE0, 0x10, 0x74, 0x1A, 0x70,
+0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90,
+0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90,
+0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02,
+0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x03, 0x02, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x0E, 0x10, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x09, 0x00, 0x00, 0x0E,
+0x10, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x0E, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x13, 0x00,
+0x00, 0x1C, 0x20, 0x01, 0x0E, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x13, 0x57, 0x45, 0x53, 0x54, 0x00,
+0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45,
+0x54, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01,
+
+/* Europe/Malta */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xA8, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70,
+0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70,
+0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10,
+0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x1D, 0xF7, 0x70,
+0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10, 0xF9, 0x33, 0xB5, 0xF0,
+0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0, 0xFC, 0xFC, 0xB4, 0x70,
+0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60, 0x00, 0xC5, 0xB2, 0xF0,
+0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70, 0x04, 0x85, 0x76, 0xF0,
+0x05, 0x2B, 0x85, 0xE0, 0x06, 0x1A, 0x33, 0x70, 0x07, 0x0A, 0x24, 0x70, 0x08, 0x17, 0x16, 0x70,
+0x08, 0xDA, 0x34, 0x70, 0x09, 0xF7, 0x14, 0x90, 0x0A, 0xC2, 0x0D, 0x80, 0x0B, 0xD6, 0xF6, 0x90,
+0x0C, 0xA1, 0xEF, 0x80, 0x0D, 0xB6, 0xD8, 0x90, 0x0E, 0x81, 0xD1, 0x80, 0x0F, 0x96, 0xBA, 0x90,
+0x10, 0x61, 0xB3, 0x80, 0x11, 0x76, 0x9C, 0x90, 0x12, 0x41, 0x95, 0x80, 0x13, 0x45, 0x5B, 0x10,
+0x14, 0x2A, 0xB2, 0x00, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90,
+0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90,
+0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10,
+0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10,
+0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10,
+0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90,
+0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10,
+0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20,
+0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Mariehamn */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA4, 0x73, 0x6F, 0x18,
+0xCB, 0xCE, 0x51, 0x60, 0xCC, 0xBF, 0x85, 0xD0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x17, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C,
+0x20, 0x00, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Minsk */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xAA, 0x38,
+0xB5, 0xA4, 0x19, 0x60, 0xCA, 0x5E, 0x70, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x0A, 0x02, 0x60, 0x15, 0x27, 0xA7, 0xD0,
+0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0,
+0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0,
+0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0,
+0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0,
+0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80,
+0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xDD, 0x60, 0x2B, 0xB4, 0xEA, 0x80, 0x2C, 0xA4, 0xDB, 0x80,
+0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, 0x30, 0x64, 0x9F, 0x80,
+0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, 0x34, 0x52, 0x88, 0x00,
+0x35, 0x1D, 0x8F, 0x00, 0x36, 0x32, 0x6A, 0x00, 0x36, 0xFD, 0x71, 0x00, 0x38, 0x1B, 0x86, 0x80,
+0x38, 0xDD, 0x53, 0x00, 0x39, 0xFB, 0x68, 0x80, 0x3A, 0xBD, 0x35, 0x00, 0x3B, 0xDB, 0x4A, 0x80,
+0x3C, 0xA6, 0x51, 0x80, 0x3D, 0xBB, 0x2C, 0x80, 0x3E, 0x86, 0x33, 0x80, 0x3F, 0x9B, 0x0E, 0x80,
+0x40, 0x66, 0x15, 0x80, 0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80, 0x43, 0x64, 0x0D, 0x00,
+0x44, 0x25, 0xD9, 0x80, 0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80, 0x47, 0x23, 0xD1, 0x00,
+0x47, 0xEE, 0xD8, 0x00, 0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00, 0x4A, 0xE3, 0x95, 0x00,
+0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x4E, 0xAC, 0x93, 0x80,
+0x4F, 0x6E, 0x60, 0x00, 0x50, 0x8C, 0x75, 0x80, 0x51, 0x57, 0x7C, 0x80, 0x52, 0x6C, 0x57, 0x80,
+0x53, 0x37, 0x5E, 0x80, 0x54, 0x4C, 0x39, 0x80, 0x55, 0x17, 0x40, 0x80, 0x56, 0x2C, 0x1B, 0x80,
+0x56, 0xF7, 0x22, 0x80, 0x58, 0x15, 0x38, 0x00, 0x58, 0xD7, 0x04, 0x80, 0x59, 0xF5, 0x1A, 0x00,
+0x5A, 0xB6, 0xE6, 0x80, 0x5B, 0xD4, 0xFC, 0x00, 0x5C, 0xA0, 0x03, 0x00, 0x5D, 0xB4, 0xDE, 0x00,
+0x5E, 0x7F, 0xE5, 0x00, 0x5F, 0x94, 0xC0, 0x00, 0x60, 0x5F, 0xC7, 0x00, 0x61, 0x7D, 0xDC, 0x80,
+0x62, 0x3F, 0xA9, 0x00, 0x63, 0x5D, 0xBE, 0x80, 0x64, 0x1F, 0x8B, 0x00, 0x65, 0x3D, 0xA0, 0x80,
+0x66, 0x08, 0xA7, 0x80, 0x67, 0x1D, 0x82, 0x80, 0x67, 0xE8, 0x89, 0x80, 0x68, 0xFD, 0x64, 0x80,
+0x69, 0xC8, 0x6B, 0x80, 0x6A, 0xDD, 0x46, 0x80, 0x6B, 0xA8, 0x4D, 0x80, 0x6C, 0xC6, 0x63, 0x00,
+0x6D, 0x88, 0x2F, 0x80, 0x6E, 0xA6, 0x45, 0x00, 0x6F, 0x68, 0x11, 0x80, 0x70, 0x86, 0x27, 0x00,
+0x71, 0x51, 0x2E, 0x00, 0x72, 0x66, 0x09, 0x00, 0x73, 0x31, 0x10, 0x00, 0x74, 0x45, 0xEB, 0x00,
+0x75, 0x10, 0xF2, 0x00, 0x76, 0x2F, 0x07, 0x80, 0x76, 0xF0, 0xD4, 0x00, 0x78, 0x0E, 0xE9, 0x80,
+0x78, 0xD0, 0xB6, 0x00, 0x79, 0xEE, 0xCB, 0x80, 0x7A, 0xB0, 0x98, 0x00, 0x7B, 0xCE, 0xAD, 0x80,
+0x7C, 0x99, 0xB4, 0x80, 0x7D, 0xAE, 0x8F, 0x80, 0x7E, 0x79, 0x96, 0x80, 0x7F, 0x8E, 0x71, 0x80,
+0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x02, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x00, 0x00, 0x19, 0xC8, 0x00, 0x00, 0x00,
+0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38,
+0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4D, 0x4D, 0x54, 0x00, 0x45,
+0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00,
+0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Europe/Monaco */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x1B, 0x91, 0x60, 0x50, 0x4F,
+0x9B, 0x47, 0x78, 0xF0, 0x9B, 0xD7, 0x2C, 0x70, 0x9C, 0xBC, 0x91, 0x70, 0x9D, 0xC0, 0x48, 0xF0,
+0x9E, 0x89, 0xFE, 0x70, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x80, 0x0C, 0xF0,
+0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, 0xA5, 0x5E, 0x23, 0x70,
+0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0x9B, 0xF0, 0xA8, 0x58, 0x26, 0x70, 0xA9, 0x07, 0x7D, 0xF0,
+0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAB, 0xD7, 0x50, 0xF0, 0xAC, 0xC7, 0x41, 0xF0,
+0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0,
+0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, 0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70,
+0xB5, 0x49, 0x2F, 0xF0, 0xB6, 0x2F, 0xE6, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70,
+0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBA, 0xD6, 0x60, 0xF0, 0xBB, 0xD8, 0xC6, 0xF0,
+0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, 0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0,
+0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, 0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0,
+0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, 0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70,
+0xC7, 0xDA, 0x09, 0xA0, 0xCA, 0x17, 0x5B, 0xF0, 0xCA, 0xE2, 0x54, 0xE0, 0xCB, 0xAD, 0x69, 0xF0,
+0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10,
+0xD0, 0x89, 0xF1, 0xF0, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x0B, 0xBB, 0x39, 0x00,
+0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90,
+0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10,
+0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90,
+0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90,
+0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10,
+0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10,
+0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10,
+0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90,
+0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10,
+0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x05, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x07, 0x06, 0x07, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20,
+0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x12, 0x00, 0x00,
+0x0E, 0x10, 0x00, 0x17, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x17,
+0x50, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D,
+0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Moscow */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0x9B, 0x5F, 0x1E, 0xD8,
+0x9D, 0x3E, 0xF2, 0x98, 0x9E, 0x2A, 0xEF, 0x18, 0x9E, 0xF7, 0x39, 0x88, 0x9F, 0x84, 0x58, 0x18,
+0xA0, 0xD8, 0x6D, 0x08, 0xA1, 0x00, 0x16, 0x28, 0xA1, 0x3C, 0xA6, 0x40, 0xA4, 0x10, 0x6D, 0xC0,
+0xA4, 0x3D, 0x32, 0xB0, 0xA5, 0x15, 0x68, 0xB0, 0xA5, 0x3D, 0x03, 0xC0, 0xA7, 0x1E, 0x45, 0x50,
+0xB5, 0xA4, 0x19, 0x60, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50,
+0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0,
+0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0,
+0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0,
+0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0,
+0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x78, 0xBF, 0x80,
+0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70,
+0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70,
+0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, 0x34, 0x52, 0x79, 0xF0,
+0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, 0x38, 0x1B, 0x78, 0x70,
+0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, 0x3B, 0xDB, 0x3C, 0x70,
+0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, 0x3F, 0x9B, 0x00, 0x70,
+0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, 0x43, 0x63, 0xFE, 0xF0,
+0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70, 0x47, 0x23, 0xC2, 0xF0,
+0x47, 0xEE, 0xC9, 0xF0, 0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0, 0x4A, 0xE3, 0x86, 0xF0,
+0x4B, 0xAE, 0x8D, 0xF0, 0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0, 0x4E, 0xAC, 0x85, 0x70,
+0x4F, 0x6E, 0x51, 0xF0, 0x50, 0x8C, 0x67, 0x70, 0x51, 0x57, 0x6E, 0x70, 0x52, 0x6C, 0x49, 0x70,
+0x53, 0x37, 0x50, 0x70, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x17, 0x32, 0x70, 0x56, 0x2C, 0x0D, 0x70,
+0x56, 0xF7, 0x14, 0x70, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD6, 0xF6, 0x70, 0x59, 0xF5, 0x0B, 0xF0,
+0x5A, 0xB6, 0xD8, 0x70, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9F, 0xF4, 0xF0, 0x5D, 0xB4, 0xCF, 0xF0,
+0x5E, 0x7F, 0xD6, 0xF0, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5F, 0xB8, 0xF0, 0x61, 0x7D, 0xCE, 0x70,
+0x62, 0x3F, 0x9A, 0xF0, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1F, 0x7C, 0xF0, 0x65, 0x3D, 0x92, 0x70,
+0x66, 0x08, 0x99, 0x70, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE8, 0x7B, 0x70, 0x68, 0xFD, 0x56, 0x70,
+0x69, 0xC8, 0x5D, 0x70, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA8, 0x3F, 0x70, 0x6C, 0xC6, 0x54, 0xF0,
+0x6D, 0x88, 0x21, 0x70, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x68, 0x03, 0x70, 0x70, 0x86, 0x18, 0xF0,
+0x71, 0x51, 0x1F, 0xF0, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x31, 0x01, 0xF0, 0x74, 0x45, 0xDC, 0xF0,
+0x75, 0x10, 0xE3, 0xF0, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xF0, 0xC5, 0xF0, 0x78, 0x0E, 0xDB, 0x70,
+0x78, 0xD0, 0xA7, 0xF0, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xB0, 0x89, 0xF0, 0x7B, 0xCE, 0x9F, 0x70,
+0x7C, 0x99, 0xA6, 0x70, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x79, 0x88, 0x70, 0x7F, 0x8E, 0x63, 0x70,
+0x02, 0x01, 0x02, 0x03, 0x01, 0x03, 0x05, 0x04, 0x05, 0x06, 0x05, 0x04, 0x07, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x0A, 0x0B, 0x08, 0x05, 0x04, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x00, 0x00, 0x23, 0x28, 0x00, 0x00, 0x00, 0x00, 0x31, 0x68, 0x01, 0x04, 0x00, 0x00, 0x23,
+0x58, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x78, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00,
+0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x46, 0x50, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00,
+0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x2A,
+0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x15, 0x4D, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54,
+0x00, 0x4D, 0x44, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45,
+0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Europe/Nicosia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA5, 0x77, 0x1E, 0xB8,
+0x09, 0xED, 0xAF, 0xE0, 0x0A, 0xDD, 0x92, 0xD0, 0x0B, 0xFA, 0x64, 0xE0, 0x0C, 0xBE, 0xC6, 0x50,
+0x0D, 0xA4, 0x39, 0x60, 0x0E, 0x8A, 0xE1, 0xD0, 0x0F, 0x84, 0x1B, 0x60, 0x10, 0x75, 0x4F, 0xD0,
+0x11, 0x63, 0xFD, 0x60, 0x12, 0x53, 0xE0, 0x50, 0x13, 0x4D, 0x19, 0xE0, 0x14, 0x33, 0xC2, 0x50,
+0x15, 0x23, 0xC1, 0x60, 0x16, 0x13, 0xA4, 0x50, 0x17, 0x03, 0xA3, 0x60, 0x17, 0xF3, 0x86, 0x50,
+0x18, 0xE3, 0x85, 0x60, 0x19, 0xD3, 0x68, 0x50, 0x1A, 0xC3, 0x67, 0x60, 0x1B, 0xBC, 0x84, 0xD0,
+0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x48, 0xD0,
+0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x0C, 0xD0,
+0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xED, 0xE0, 0x27, 0x05, 0x0B, 0x50,
+0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xED, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50,
+0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50,
+0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x4D, 0x91, 0xD0,
+0x33, 0x3D, 0x90, 0xE0, 0x34, 0x2D, 0x73, 0xD0, 0x35, 0x1D, 0x72, 0xE0, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x1F, 0x48, 0x00, 0x00, 0x00, 0x00, 0x2A,
+0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Oslo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x27, 0xE3, 0x00,
+0x9B, 0xD4, 0x7B, 0x60, 0xC8, 0xB7, 0x4D, 0x60, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10,
+0xD2, 0x62, 0x07, 0x10, 0xEB, 0xAF, 0x20, 0x90, 0xEC, 0xA8, 0x4C, 0x10, 0xED, 0x98, 0x3D, 0x10,
+0xEE, 0x88, 0x2E, 0x10, 0xEF, 0x78, 0x1F, 0x10, 0xF0, 0x68, 0x10, 0x10, 0xF1, 0x58, 0x01, 0x10,
+0xF2, 0x47, 0xF2, 0x10, 0xF3, 0x37, 0xE3, 0x10, 0xF4, 0x27, 0xD4, 0x10, 0xF5, 0x17, 0xC5, 0x10,
+0xF6, 0x10, 0xF0, 0x90, 0xF7, 0x2F, 0x06, 0x10, 0xF7, 0xF0, 0xD2, 0x90, 0x12, 0xCE, 0x97, 0xF0,
+0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00,
+0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Paris */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1B, 0x91, 0x60, 0x50, 0x8B,
+0x9B, 0x47, 0x78, 0xF0, 0x9B, 0xD7, 0x2C, 0x70, 0x9C, 0xBC, 0x91, 0x70, 0x9D, 0xC0, 0x48, 0xF0,
+0x9E, 0x89, 0xFE, 0x70, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x80, 0x0C, 0xF0,
+0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, 0xA5, 0x5E, 0x23, 0x70,
+0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0x9B, 0xF0, 0xA8, 0x58, 0x26, 0x70, 0xA9, 0x07, 0x7D, 0xF0,
+0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAB, 0xD7, 0x50, 0xF0, 0xAC, 0xC7, 0x41, 0xF0,
+0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0,
+0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, 0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70,
+0xB5, 0x49, 0x2F, 0xF0, 0xB6, 0x2F, 0xE6, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70,
+0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBA, 0xD6, 0x60, 0xF0, 0xBB, 0xD8, 0xC6, 0xF0,
+0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, 0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0,
+0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, 0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0,
+0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, 0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70,
+0xC7, 0xDA, 0x09, 0xA0, 0xC8, 0x6C, 0x27, 0xE0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x4F, 0xE1, 0xE0, 0xD0, 0x89, 0xF1, 0xF0,
+0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x0B, 0xBB, 0x39, 0x00, 0x0C, 0xAB, 0x1B, 0xF0,
+0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90,
+0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90,
+0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90,
+0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x07, 0x05, 0x06, 0x05, 0x06, 0x08,
+0x03, 0x08, 0x09, 0x07, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00,
+0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x11, 0x00,
+0x00, 0x1C, 0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x11, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00,
+0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x4D,
+0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Prague */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90,
+0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x6E, 0x5E, 0x90, 0xD1, 0x79, 0xFF, 0x10,
+0xD2, 0xA1, 0x4F, 0x10, 0xD3, 0x80, 0x1C, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x4C, 0x38, 0x10,
+0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x01, 0x70, 0x10,
+0xD9, 0xE9, 0x78, 0x10, 0x10, 0xED, 0x64, 0x70, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90,
+0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Riga */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x22, 0x9E, 0xB9, 0x88, 0x08,
+0x9F, 0x84, 0x8F, 0x08, 0xA0, 0x88, 0x46, 0x88, 0xA0, 0xCB, 0x83, 0x08, 0xAD, 0xE7, 0xF1, 0xE8,
+0xC8, 0xAF, 0x64, 0x60, 0xCA, 0x62, 0x65, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD0, 0x90, 0x89, 0x70,
+0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0,
+0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0,
+0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0,
+0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0,
+0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80,
+0x27, 0xF5, 0x26, 0x80, 0x28, 0xE5, 0x17, 0x80, 0x29, 0xD5, 0x08, 0x80, 0x2A, 0xC4, 0xF9, 0x80,
+0x2B, 0xB4, 0xEA, 0x80, 0x2C, 0xA4, 0xDB, 0x80, 0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80,
+0x2F, 0x74, 0xAE, 0x80, 0x30, 0x64, 0x9F, 0x80, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x4D, 0xBC, 0x00,
+0x32, 0xE3, 0xEA, 0xE0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xBA, 0xEF, 0xE0,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x06, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x03, 0x07, 0x03, 0x07, 0x03, 0x07, 0x03, 0x07, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x02, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x02, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x16, 0x98, 0x00, 0x00, 0x00, 0x00, 0x24,
+0xA8, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0C, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x14, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0C, 0x00, 0x00, 0x38,
+0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x52, 0x4D, 0x54, 0x00, 0x4C,
+0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43,
+0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Rome */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70,
+0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70,
+0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x07, 0x5F, 0x60, 0xD0, 0x6E, 0x42, 0x70,
+0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10,
+0xD5, 0x1D, 0xF7, 0x70, 0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10,
+0xF9, 0x33, 0xB5, 0xF0, 0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0,
+0xFC, 0xFC, 0xB4, 0x70, 0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60,
+0x00, 0xC5, 0xB2, 0xF0, 0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70,
+0x04, 0x85, 0x76, 0xF0, 0x05, 0x2B, 0x85, 0xE0, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x0B, 0x67, 0xE0,
+0x08, 0x45, 0x3A, 0xF0, 0x08, 0xEB, 0x49, 0xE0, 0x0A, 0x2E, 0x57, 0x70, 0x0A, 0xCB, 0x39, 0xF0,
+0x0C, 0x0E, 0x39, 0x70, 0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xE4, 0xE0, 0xF0, 0x0E, 0x8A, 0xFD, 0xF0,
+0x0F, 0xCD, 0xFD, 0x70, 0x10, 0x74, 0x1A, 0x70, 0x11, 0xAD, 0xDF, 0x70, 0x12, 0x53, 0xFC, 0x70,
+0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00,
+0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00,
+0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Samara */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0x00, 0x26, 0x9C,
+0xB5, 0xA4, 0x0B, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40,
+0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0,
+0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0,
+0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0,
+0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0,
+0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x00, 0xC7, 0x00,
+0x29, 0xD4, 0xC2, 0x30, 0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xBF, 0x60,
+0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0xA1, 0x60, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x83, 0x60,
+0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x72, 0x89, 0xE0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0,
+0x35, 0x1D, 0x72, 0xE0, 0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60,
+0x38, 0xDD, 0x36, 0xE0, 0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60,
+0x3C, 0xA6, 0x35, 0x60, 0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60,
+0x40, 0x65, 0xF9, 0x60, 0x41, 0x84, 0x0E, 0xE0, 0x42, 0x45, 0xDB, 0x60, 0x43, 0x63, 0xF0, 0xE0,
+0x44, 0x25, 0xBD, 0x60, 0x45, 0x43, 0xD2, 0xE0, 0x46, 0x05, 0x9F, 0x60, 0x47, 0x23, 0xB4, 0xE0,
+0x47, 0xEE, 0xBB, 0xE0, 0x49, 0x03, 0x96, 0xE0, 0x49, 0xCE, 0x9D, 0xE0, 0x4A, 0xE3, 0x78, 0xE0,
+0x4B, 0xAE, 0x7F, 0xE0, 0x4C, 0xCC, 0x95, 0x60, 0x4D, 0x8E, 0x61, 0xE0, 0x4E, 0xAC, 0x77, 0x60,
+0x4F, 0x6E, 0x43, 0xE0, 0x50, 0x8C, 0x59, 0x60, 0x51, 0x57, 0x60, 0x60, 0x52, 0x6C, 0x3B, 0x60,
+0x53, 0x37, 0x42, 0x60, 0x54, 0x4C, 0x1D, 0x60, 0x55, 0x17, 0x24, 0x60, 0x56, 0x2B, 0xFF, 0x60,
+0x56, 0xF7, 0x06, 0x60, 0x58, 0x15, 0x1B, 0xE0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xFD, 0xE0,
+0x5A, 0xB6, 0xCA, 0x60, 0x5B, 0xD4, 0xDF, 0xE0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xC1, 0xE0,
+0x5E, 0x7F, 0xC8, 0xE0, 0x5F, 0x94, 0xA3, 0xE0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xC0, 0x60,
+0x62, 0x3F, 0x8C, 0xE0, 0x63, 0x5D, 0xA2, 0x60, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x84, 0x60,
+0x66, 0x08, 0x8B, 0x60, 0x67, 0x1D, 0x66, 0x60, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x48, 0x60,
+0x69, 0xC8, 0x4F, 0x60, 0x6A, 0xDD, 0x2A, 0x60, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x46, 0xE0,
+0x6D, 0x88, 0x13, 0x60, 0x6E, 0xA6, 0x28, 0xE0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x86, 0x0A, 0xE0,
+0x71, 0x51, 0x11, 0xE0, 0x72, 0x65, 0xEC, 0xE0, 0x73, 0x30, 0xF3, 0xE0, 0x74, 0x45, 0xCE, 0xE0,
+0x75, 0x10, 0xD5, 0xE0, 0x76, 0x2E, 0xEB, 0x60, 0x76, 0xF0, 0xB7, 0xE0, 0x78, 0x0E, 0xCD, 0x60,
+0x78, 0xD0, 0x99, 0xE0, 0x79, 0xEE, 0xAF, 0x60, 0x7A, 0xB0, 0x7B, 0xE0, 0x7B, 0xCE, 0x91, 0x60,
+0x7C, 0x99, 0x98, 0x60, 0x7D, 0xAE, 0x73, 0x60, 0x7E, 0x79, 0x7A, 0x60, 0x7F, 0x8E, 0x55, 0x60,
+0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x06, 0x07, 0x06, 0x07, 0x08, 0x07, 0x0B, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x2F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00,
+0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x38,
+0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00,
+0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00,
+0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x00, 0x00, 0x46,
+0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x55, 0x59,
+0x54, 0x00, 0x4B, 0x55, 0x59, 0x53, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x53, 0x41,
+0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Europe/San_Marino */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70,
+0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70,
+0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x07, 0x5F, 0x60, 0xD0, 0x6E, 0x42, 0x70,
+0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10,
+0xD5, 0x1D, 0xF7, 0x70, 0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10,
+0xF9, 0x33, 0xB5, 0xF0, 0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0,
+0xFC, 0xFC, 0xB4, 0x70, 0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60,
+0x00, 0xC5, 0xB2, 0xF0, 0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70,
+0x04, 0x85, 0x76, 0xF0, 0x05, 0x2B, 0x85, 0xE0, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x0B, 0x67, 0xE0,
+0x08, 0x45, 0x3A, 0xF0, 0x08, 0xEB, 0x49, 0xE0, 0x0A, 0x2E, 0x57, 0x70, 0x0A, 0xCB, 0x39, 0xF0,
+0x0C, 0x0E, 0x39, 0x70, 0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xE4, 0xE0, 0xF0, 0x0E, 0x8A, 0xFD, 0xF0,
+0x0F, 0xCD, 0xFD, 0x70, 0x10, 0x74, 0x1A, 0x70, 0x11, 0xAD, 0xDF, 0x70, 0x12, 0x53, 0xFC, 0x70,
+0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00,
+0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00,
+0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Sarajevo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0,
+0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10,
+0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70,
+0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Simferopol */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA4, 0x20,
+0xB5, 0xA4, 0x19, 0x60, 0xCB, 0x04, 0x8D, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xCF, 0x9F, 0x38, 0xE0, 0x15, 0x27, 0xA7, 0xD0,
+0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0,
+0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0,
+0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0,
+0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0,
+0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x29, 0xD4, 0xEC, 0x60,
+0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60,
+0x2D, 0xC2, 0xC6, 0xD0, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x67, 0x40,
+0x31, 0x5D, 0xA0, 0xD0, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x32, 0xC9, 0x7E, 0xD0,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02,
+0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x02, 0x01, 0x09, 0x01, 0x09, 0x01, 0x09, 0x06, 0x02, 0x06, 0x02, 0x06, 0x08, 0x07,
+0x02, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00,
+0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A,
+0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x53, 0x4D, 0x54, 0x00, 0x45,
+0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00,
+0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01,
+
+/* Europe/Skopje */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0,
+0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10,
+0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70,
+0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Sofia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x12, 0xCC, 0xE7, 0x4B, 0x10,
+0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10,
+0xD1, 0x72, 0x24, 0x20, 0x11, 0x63, 0xEF, 0x50, 0x12, 0x55, 0x3F, 0xE0, 0x13, 0x4D, 0x0B, 0xD0,
+0x14, 0x35, 0x21, 0xE0, 0x15, 0x2C, 0xED, 0xD0, 0x16, 0x13, 0xC0, 0x70, 0x17, 0x0C, 0xCF, 0xD0,
+0x17, 0xF3, 0xB0, 0x80, 0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80, 0x1A, 0xC3, 0x83, 0x80,
+0x1B, 0xBC, 0xAF, 0x00, 0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00, 0x1E, 0x8C, 0x82, 0x00,
+0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00,
+0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00, 0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00,
+0x27, 0x05, 0x35, 0x80, 0x27, 0x7F, 0xB4, 0xE0, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xED, 0x50,
+0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50,
+0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50,
+0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x03,
+0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x1C,
+0x20, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x45, 0x45, 0x54,
+0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Stockholm */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x1E, 0x8C, 0x60,
+0x9B, 0xD5, 0xDA, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x00, 0x01, 0x01,
+
+/* Europe/Tallinn */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x1E, 0x9E, 0x59, 0x2D, 0xCC,
+0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0xA1, 0x00, 0x2B, 0x70, 0xA4, 0x73, 0x6F, 0x4C,
+0xC8, 0xB0, 0xB5, 0xE0, 0xCA, 0xC6, 0x97, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x74, 0xCB, 0xE0, 0x15, 0x27, 0xA7, 0xD0,
+0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0,
+0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0,
+0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0,
+0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0,
+0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0xF5, 0x26, 0x80,
+0x28, 0xE5, 0x17, 0x80, 0x29, 0xD5, 0x08, 0x80, 0x2A, 0xC4, 0xF9, 0x80, 0x2B, 0xB4, 0xEA, 0x80,
+0x2C, 0xA4, 0xDB, 0x80, 0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80,
+0x30, 0x64, 0x9F, 0x80, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00,
+0x34, 0x52, 0x88, 0x00, 0x35, 0x1D, 0x8F, 0x00, 0x36, 0x06, 0xBE, 0x50, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0x1C, 0xBB, 0xE0, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x00,
+0x04, 0x05, 0x06, 0x02, 0x01, 0x02, 0x01, 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B,
+0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0E, 0x0C, 0x0D, 0x0C, 0x04,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C,
+0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x00, 0x00, 0x17, 0x34, 0x00, 0x00, 0x00, 0x00,
+0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09,
+0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x11, 0x00, 0x00, 0x1C, 0x20,
+0x01, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x11, 0x00, 0x00,
+0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D,
+0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30,
+0x01, 0x19, 0x54, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x45,
+0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+
+/* Europe/Tirane */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x34, 0x68,
+0xC8, 0x6D, 0x87, 0x70, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCD, 0xB8, 0xE9, 0x90,
+0x08, 0x28, 0x39, 0xF0, 0x08, 0xEF, 0x3E, 0x60, 0x0A, 0x05, 0x78, 0xF0, 0x0A, 0xD0, 0x71, 0xE0,
+0x0B, 0xE9, 0x4F, 0x70, 0x0C, 0xB4, 0x48, 0x60, 0x0D, 0xD2, 0x6B, 0xF0, 0x0E, 0x94, 0x2A, 0x60,
+0x0F, 0xB0, 0xFC, 0x70, 0x10, 0x74, 0x0C, 0x60, 0x11, 0x90, 0xDE, 0x70, 0x12, 0x53, 0xEE, 0x60,
+0x13, 0x70, 0xC0, 0x70, 0x14, 0x3B, 0xB9, 0x60, 0x15, 0x48, 0xB9, 0x70, 0x16, 0x13, 0xB2, 0x60,
+0x17, 0x31, 0xD5, 0xF0, 0x17, 0xFC, 0xCE, 0xE0, 0x19, 0x00, 0x94, 0x70, 0x19, 0xDB, 0x5F, 0x60,
+0x1A, 0xCC, 0xAF, 0xF0, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x12, 0x98, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Tiraspol */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x22, 0x9E, 0x6B, 0x9F, 0x0C,
+0xB7, 0xB0, 0xD2, 0x08, 0xB9, 0x3E, 0xF3, 0x60, 0xB9, 0xEF, 0x9C, 0x60, 0xBA, 0xDF, 0x8D, 0x60,
+0xBB, 0xCF, 0x7E, 0x60, 0xBC, 0xC8, 0xA9, 0xE0, 0xBD, 0xB8, 0x9A, 0xE0, 0xBE, 0xA8, 0x8B, 0xE0,
+0xBF, 0x98, 0x7C, 0xE0, 0xC0, 0x88, 0x6D, 0xE0, 0xC1, 0x78, 0x5E, 0xE0, 0xC2, 0x68, 0x4F, 0xE0,
+0xC3, 0x58, 0x40, 0xE0, 0xC4, 0x48, 0x31, 0xE0, 0xC5, 0x38, 0x22, 0xE0, 0xC6, 0x28, 0x13, 0xE0,
+0xC7, 0x18, 0x04, 0xE0, 0xC8, 0xBC, 0x93, 0x60, 0xCA, 0x77, 0x7D, 0x50, 0xCC, 0xE7, 0x4B, 0x10,
+0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x4E, 0x90, 0x60,
+0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0,
+0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0,
+0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0,
+0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0,
+0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x43, 0x3E, 0xD0,
+0x27, 0xF5, 0x26, 0x80, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x60, 0xE8, 0x60, 0x29, 0xD4, 0xEC, 0x60,
+0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60,
+0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0,
+0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x04, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x08,
+0x06, 0x07, 0x06, 0x07, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0B, 0x0C, 0x0B, 0x0C,
+0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0A, 0x04, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E,
+0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x00, 0x00, 0x1A, 0xF4, 0x00, 0x00, 0x00, 0x00,
+0x18, 0x78, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D,
+0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00,
+0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E,
+0x00, 0x00, 0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20,
+0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45,
+0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00,
+0x4D, 0x53, 0x4B, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01,
+
+/* Europe/Uzhgorod */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1A, 0xC8, 0x09, 0x71, 0x90,
+0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10,
+0xD0, 0x80, 0xA9, 0x60, 0xD0, 0xA1, 0x9E, 0xE0, 0xD1, 0xE5, 0xFD, 0xF0, 0x15, 0x27, 0xA7, 0xD0,
+0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0,
+0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0,
+0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0,
+0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0,
+0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x27, 0xF5, 0x42, 0xA0,
+0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50,
+0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x00, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x05, 0x00, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00,
+0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x2A,
+0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x11, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x00,
+0x11, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x4D, 0x53,
+0x4B, 0x00, 0x45, 0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01,
+
+/* Europe/Vaduz */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20,
+0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01,
+
+/* Europe/Vatican */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70,
+0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70,
+0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x07, 0x5F, 0x60, 0xD0, 0x6E, 0x42, 0x70,
+0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10,
+0xD5, 0x1D, 0xF7, 0x70, 0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10,
+0xF9, 0x33, 0xB5, 0xF0, 0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0,
+0xFC, 0xFC, 0xB4, 0x70, 0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60,
+0x00, 0xC5, 0xB2, 0xF0, 0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70,
+0x04, 0x85, 0x76, 0xF0, 0x05, 0x2B, 0x85, 0xE0, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x0B, 0x67, 0xE0,
+0x08, 0x45, 0x3A, 0xF0, 0x08, 0xEB, 0x49, 0xE0, 0x0A, 0x2E, 0x57, 0x70, 0x0A, 0xCB, 0x39, 0xF0,
+0x0C, 0x0E, 0x39, 0x70, 0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xE4, 0xE0, 0xF0, 0x0E, 0x8A, 0xFD, 0xF0,
+0x0F, 0xCD, 0xFD, 0x70, 0x10, 0x74, 0x1A, 0x70, 0x11, 0xAD, 0xDF, 0x70, 0x12, 0x53, 0xFC, 0x70,
+0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00,
+0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00,
+0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Vienna */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90,
+0x9F, 0x84, 0x97, 0x90, 0xA1, 0xF2, 0xBF, 0x70, 0xA2, 0x70, 0x1A, 0x10, 0xA3, 0x44, 0x5B, 0x90,
+0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10,
+0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, 0xD1, 0x7F, 0x45, 0x10,
+0xD2, 0xDB, 0x34, 0xF0, 0xD3, 0x63, 0x1B, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x39, 0xC3, 0x10,
+0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0x13, 0x4D, 0x27, 0xF0,
+0x14, 0x33, 0xD0, 0x60, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90,
+0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90,
+0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10,
+0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10,
+0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10,
+0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90,
+0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10,
+0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03,
+0x02, 0x03, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00,
+0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54,
+0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01,
+
+/* Europe/Vilnius */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x22, 0x9C, 0x4F, 0x1F, 0x50,
+0xA1, 0x85, 0x4A, 0x98, 0xA2, 0xF1, 0x30, 0xF0, 0xA3, 0x66, 0x78, 0x60, 0xC8, 0xAC, 0xCF, 0x70,
+0xCA, 0x59, 0x2A, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10,
+0xCF, 0x92, 0x34, 0x10, 0xD0, 0x30, 0x3D, 0xE0, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40,
+0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40,
+0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0,
+0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0,
+0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0,
+0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80,
+0x29, 0xD5, 0x08, 0x80, 0x2A, 0xC4, 0xF9, 0x80, 0x2B, 0xB4, 0xEA, 0x80, 0x2C, 0xA4, 0xDB, 0x80,
+0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, 0x30, 0x64, 0x9F, 0x80,
+0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, 0x34, 0x52, 0x88, 0x00,
+0x34, 0xAA, 0xC0, 0x60, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x3E, 0x12, 0x13, 0x60, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x02, 0x03, 0x02, 0x04, 0x07, 0x05, 0x06, 0x05, 0x06, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08,
+0x04, 0x08, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0B,
+0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x03, 0x0D, 0x0E,
+0x0D, 0x0F, 0x03, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10,
+0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10,
+0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10,
+0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10,
+0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x00, 0x00, 0x13, 0xB0, 0x00, 0x00, 0x00,
+0x00, 0x16, 0x68, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00,
+0x0C, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x14, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00,
+0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0C, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x1D, 0x57,
+0x4D, 0x54, 0x00, 0x4B, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D,
+0x53, 0x4B, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x01,
+
+/* Europe/Warsaw */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xA6, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x16, 0x99, 0xA8, 0x2A, 0xD0,
+0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90,
+0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0xA0, 0x9A, 0xB6, 0x00, 0xA1, 0x65, 0xBD, 0x00,
+0xA6, 0x7D, 0x7C, 0x60, 0xC8, 0x76, 0xDE, 0x10, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x80, 0xA9, 0x60, 0xD1, 0x95, 0x92, 0x70,
+0xD2, 0x8A, 0xBB, 0x60, 0xD3, 0x62, 0xFF, 0x70, 0xD4, 0x4B, 0x23, 0x90, 0xD5, 0x5E, 0xAD, 0x10,
+0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x02, 0xC1, 0x90,
+0xD9, 0xE9, 0x78, 0x10, 0xE8, 0x54, 0xD2, 0x00, 0xE8, 0xF1, 0xB4, 0x80, 0xE9, 0xE1, 0xA5, 0x80,
+0xEA, 0xD1, 0x96, 0x80, 0xEC, 0x14, 0x96, 0x00, 0xEC, 0xBA, 0xB3, 0x00, 0xED, 0xAA, 0xA4, 0x00,
+0xEE, 0x9A, 0x95, 0x00, 0xEF, 0xD4, 0x5A, 0x00, 0xF0, 0x7A, 0x77, 0x00, 0xF1, 0xB4, 0x3C, 0x00,
+0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x94, 0x1E, 0x00, 0xF4, 0x3A, 0x3B, 0x00, 0xF5, 0x7D, 0x3A, 0x80,
+0xF6, 0x1A, 0x1D, 0x00, 0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x55, 0x80, 0x0E, 0x8B, 0x0C, 0x00,
+0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x0A, 0x80,
+0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xEC, 0x80, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x13, 0xCE, 0x80,
+0x17, 0x03, 0xBF, 0x80, 0x17, 0xF3, 0xB0, 0x80, 0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80,
+0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00, 0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00,
+0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00,
+0x21, 0xDA, 0xD6, 0xF0, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x07, 0x05, 0x06, 0x02, 0x01, 0x04,
+0x03, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x13, 0xB0, 0x00, 0x00,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20,
+0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00,
+0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04,
+0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x57, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43,
+0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+
+/* Europe/Zagreb */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0,
+0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10,
+0xD0, 0x82, 0x25, 0x10, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x18, 0x45, 0x5F, 0x70,
+0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10,
+0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10,
+0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10,
+0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00,
+0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E,
+0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Zaporozhye */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA3, 0x30,
+0xB5, 0xA4, 0x19, 0x60, 0xCA, 0xAA, 0xE7, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCE, 0xBD, 0xD6, 0x70, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40,
+0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40,
+0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0,
+0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0,
+0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0,
+0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE4, 0xED, 0x50,
+0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50,
+0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08,
+0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x09, 0x01, 0x09, 0x01, 0x09,
+0x01, 0x09, 0x01, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A,
+0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00,
+0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00,
+0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38,
+0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00,
+0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00,
+0x04, 0x43, 0x55, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54,
+0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+/* Europe/Zurich */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xC9, 0x24, 0xC7, 0xF0,
+0xC9, 0x72, 0x82, 0x60, 0xCA, 0x16, 0x26, 0x90, 0xCA, 0xE1, 0x03, 0x60, 0xCB, 0xF6, 0x08, 0x90,
+0xCC, 0xC0, 0xE5, 0x60, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90,
+0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90,
+0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10,
+0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10,
+0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10,
+0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90,
+0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90,
+0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10,
+0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10,
+0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10,
+0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90,
+0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90,
+0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90,
+0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10,
+0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10,
+0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10,
+0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90,
+0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90,
+0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90,
+0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10,
+0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10,
+0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90,
+0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90,
+0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90,
+0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10,
+0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10,
+0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10,
+0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90,
+0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54,
+0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01,
+
+/* Factory */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x4C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x74, 0x69, 0x6D, 0x65, 0x20, 0x7A, 0x6F, 0x6E,
+0x65, 0x20, 0x6D, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x74, 0x2D, 0x2D, 0x73,
+0x65, 0x65, 0x20, 0x7A, 0x69, 0x63, 0x20, 0x6D, 0x61, 0x6E, 0x75, 0x61, 0x6C, 0x20, 0x70, 0x61,
+0x67, 0x65, 0x00, 0x00, 0x00,
+
+/* GB */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0,
+0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0,
+0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20,
+0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20,
+0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0,
+0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20,
+0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0,
+0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20,
+0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0,
+0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20,
+0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20,
+0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0,
+0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0,
+0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90,
+0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90,
+0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0,
+0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10,
+0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20,
+0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20,
+0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0,
+0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0,
+0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0,
+0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20,
+0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0,
+0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20,
+0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0,
+0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0,
+0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20,
+0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20,
+0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20,
+0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20,
+0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0,
+0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90,
+0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03,
+0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00,
+0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+
+/* GB-Eire */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0,
+0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0,
+0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20,
+0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20,
+0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0,
+0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20,
+0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0,
+0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20,
+0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0,
+0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20,
+0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20,
+0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0,
+0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0,
+0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90,
+0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90,
+0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0,
+0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10,
+0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20,
+0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20,
+0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0,
+0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0,
+0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0,
+0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20,
+0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0,
+0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20,
+0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0,
+0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0,
+0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20,
+0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20,
+0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20,
+0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20,
+0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0,
+0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90,
+0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03,
+0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00,
+0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+
+/* GMT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* GMT0 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* GMT-0 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* GMT+0 */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* Greenwich */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00,
+
+/* Hongkong */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x69, 0x5A, 0xFC,
+0xD3, 0x6A, 0xB7, 0x38, 0xD4, 0x93, 0x4A, 0xA8, 0xD5, 0x42, 0xB0, 0x38, 0xD6, 0x9A, 0xB9, 0xA8,
+0xD7, 0x3E, 0x41, 0xB8, 0xD8, 0x2E, 0x24, 0xA8, 0xD8, 0xF9, 0x39, 0xB8, 0xDA, 0x0E, 0x06, 0xA8,
+0xDA, 0xD9, 0x1B, 0xB8, 0xDB, 0xED, 0xE8, 0xA8, 0xDC, 0xB8, 0xFD, 0xB8, 0xDD, 0xCD, 0xCA, 0xA8,
+0xDE, 0xA2, 0x1A, 0x38, 0xDF, 0xAD, 0xAC, 0xA8, 0xE0, 0x81, 0xFC, 0x38, 0xE1, 0x96, 0xC9, 0x28,
+0xE2, 0x4F, 0x69, 0x38, 0xE3, 0x76, 0xAB, 0x28, 0xE4, 0x2F, 0x4B, 0x38, 0xE5, 0x5F, 0xC7, 0xA8,
+0xE6, 0x0F, 0x2D, 0x38, 0xE7, 0x3F, 0xA9, 0xA8, 0xE7, 0xF8, 0x49, 0xB8, 0xE9, 0x1F, 0x8B, 0xA8,
+0xE9, 0xD8, 0x2B, 0xB8, 0xEA, 0xFF, 0x6D, 0xA8, 0xEB, 0xB8, 0x0D, 0xB8, 0xEC, 0xDF, 0x4F, 0xA8,
+0xED, 0x97, 0xEF, 0xB8, 0xEE, 0xC8, 0x6C, 0x28, 0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28,
+0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, 0xF3, 0x40, 0xD0, 0x38, 0xF4, 0x68, 0x12, 0x28,
+0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, 0xF7, 0x25, 0x7E, 0x38, 0xF8, 0x15, 0x61, 0x28,
+0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, 0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8,
+0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, 0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8,
+0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, 0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8,
+0x04, 0x4D, 0xE6, 0xB8, 0x05, 0x47, 0x04, 0x28, 0x06, 0x37, 0x03, 0x38, 0x07, 0x26, 0xE6, 0x28,
+0x08, 0x16, 0xE5, 0x38, 0x09, 0x06, 0xC8, 0x28, 0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28,
+0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, 0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28,
+0x11, 0x9B, 0x39, 0x38, 0x12, 0x6F, 0x6C, 0xA8, 0x13, 0x7B, 0x1B, 0x38, 0x14, 0x4F, 0x4E, 0xA8,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x6B, 0x04, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01,
+0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x48, 0x4B, 0x53, 0x54, 0x00,
+0x48, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* HST */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0xBB, 0x05, 0x43, 0x48,
+0xBB, 0x20, 0xE4, 0xB8, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x49, 0x38,
+0xD5, 0x8D, 0x73, 0x48, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00,
+0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x08, 0xFF, 0xFF, 0x7A, 0x68,
+0x01, 0x0C, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00,
+0x48, 0x57, 0x54, 0x00, 0x48, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00,
+
+/* Iceland */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x8B, 0x60, 0x83, 0x94,
+0x9C, 0x91, 0x1E, 0x00, 0x9D, 0xD1, 0x88, 0x90, 0x9E, 0x72, 0x51, 0x80, 0x9F, 0xD5, 0x03, 0x10,
+0xC6, 0x4D, 0x1A, 0x00, 0xC7, 0x66, 0x05, 0xA0, 0xC7, 0xDA, 0x17, 0xB0, 0xC9, 0x26, 0x43, 0xA0,
+0xC9, 0xC3, 0x26, 0x20, 0xCB, 0x06, 0x25, 0xA0, 0xCB, 0xAC, 0x42, 0xA0, 0xCC, 0xDC, 0xCD, 0x20,
+0xCD, 0x8C, 0x24, 0xA0, 0xCE, 0xBC, 0xAF, 0x20, 0xCF, 0x6C, 0x06, 0xA0, 0xD0, 0x9C, 0x91, 0x20,
+0xD1, 0x4B, 0xE8, 0xA0, 0xD2, 0x85, 0xAD, 0xA0, 0xD3, 0x2B, 0xCA, 0xA0, 0xD4, 0x65, 0x8F, 0xA0,
+0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x45, 0x71, 0xA0, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x25, 0x53, 0xA0,
+0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xD9, 0x77, 0x20, 0xDB, 0xE5, 0x17, 0xA0,
+0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xCE, 0x34, 0x20, 0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0xAE, 0x16, 0x20,
+0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x8D, 0xF8, 0x20, 0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x6D, 0xDA, 0x20,
+0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x4D, 0xBC, 0x20, 0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x36, 0xD8, 0xA0,
+0xE8, 0x0B, 0x1A, 0x20, 0xE9, 0x16, 0xBA, 0xA0, 0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xF6, 0x9C, 0xA0,
+0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xD6, 0x7E, 0xA0, 0xED, 0xAA, 0xC0, 0x20, 0xEE, 0xB6, 0x60, 0xA0,
+0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x96, 0x42, 0xA0, 0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x7F, 0x5F, 0x20,
+0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x3F, 0x23, 0x20,
+0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xF3, 0x46, 0xA0, 0xF9, 0xFE, 0xE7, 0x20,
+0xFA, 0xD3, 0x28, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0xBC, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0xFF, 0xFF, 0xEB, 0x6C,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D,
+0x52, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x53, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Indian/Antananarivo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xF3, 0xCD, 0xF4,
+0xE2, 0x33, 0xC0, 0xC0, 0xE2, 0xAB, 0xB9, 0x40, 0x01, 0x02, 0x03, 0x00, 0x00, 0x2C, 0x8C, 0x00,
+0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x00, 0x00, 0x2A,
+0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+
+/* Indian/Chagos */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x89, 0x7E, 0xF7, 0x9C,
+0x30, 0xE6, 0xDD, 0xB0, 0x01, 0x02, 0x00, 0x00, 0x43, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50,
+0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x4F, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Indian/Christmas */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70,
+0x00, 0x00, 0x43, 0x58, 0x54, 0x00, 0x00, 0x00,
+
+/* Indian/Cocos */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x5B, 0x68,
+0x00, 0x00, 0x43, 0x43, 0x54, 0x00, 0x00, 0x00,
+
+/* Indian/Comoro */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD1, 0xF0,
+0x01, 0x00, 0x00, 0x28, 0x90, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Indian/Kerguelen */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x62, 0x80,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x7A, 0x7A, 0x7A,
+0x00, 0x54, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Indian/Mahe */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x88, 0x64, 0xE6, 0x84,
+0x01, 0x00, 0x00, 0x33, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x53, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Indian/Maldives */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xED, 0x2F, 0xC3, 0x98,
+0x01, 0x00, 0x00, 0x44, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x4D, 0x4D, 0x54,
+0x00, 0x4D, 0x56, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Indian/Mauritius */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x89, 0x7F, 0x05, 0x98,
+0x01, 0x00, 0x00, 0x35, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x4D, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Indian/Mayotte */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD0, 0x18,
+0x01, 0x00, 0x00, 0x2A, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Indian/Reunion */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xCC, 0x39, 0x80,
+0x01, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x52, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Iran */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x9A, 0x6C, 0x7D, 0xC8,
+0xD2, 0xDB, 0x12, 0xC8, 0x0E, 0xBB, 0xA2, 0x48, 0x0F, 0x74, 0x2D, 0x40, 0x10, 0x8E, 0x40, 0x30,
+0x10, 0xED, 0x3A, 0x40, 0x11, 0x55, 0x67, 0xC8, 0x12, 0x45, 0x4A, 0xB8, 0x13, 0x37, 0xEC, 0xC8,
+0x14, 0x2D, 0x15, 0xB8, 0x28, 0x20, 0x76, 0xC8, 0x28, 0xDB, 0x9D, 0xB8, 0x29, 0xCB, 0x9C, 0xC8,
+0x2A, 0xBE, 0x22, 0xB8, 0x2B, 0xAC, 0xD0, 0x48, 0x2C, 0x9F, 0x56, 0x38, 0x2D, 0x8E, 0x03, 0xC8,
+0x2E, 0x80, 0x89, 0xB8, 0x2F, 0x6F, 0x37, 0x48, 0x30, 0x61, 0xBD, 0x38, 0x31, 0x50, 0x6A, 0xC8,
+0x32, 0x42, 0xF0, 0xB8, 0x33, 0x32, 0xEF, 0xC8, 0x34, 0x25, 0x75, 0xB8, 0x35, 0x14, 0x23, 0x48,
+0x36, 0x06, 0xA9, 0x38, 0x36, 0xF5, 0x56, 0xC8, 0x37, 0xE7, 0xDC, 0xB8, 0x38, 0xD6, 0x8A, 0x48,
+0x39, 0xC9, 0x10, 0x38, 0x3A, 0xB9, 0x0F, 0x48, 0x3B, 0xAB, 0x95, 0x38, 0x3C, 0x9A, 0x42, 0xC8,
+0x3D, 0x8C, 0xC8, 0xB8, 0x3E, 0x7B, 0x76, 0x48, 0x3F, 0x6D, 0xFC, 0x38, 0x40, 0x5C, 0xA9, 0xC8,
+0x41, 0x4F, 0x2F, 0xB8, 0x42, 0x3F, 0x2E, 0xC8, 0x43, 0x31, 0xB4, 0xB8, 0x44, 0x20, 0x62, 0x48,
+0x45, 0x12, 0xE8, 0x38, 0x46, 0x01, 0x95, 0xC8, 0x46, 0xF4, 0x1B, 0xB8, 0x47, 0xE2, 0xC9, 0x48,
+0x48, 0xD5, 0x4F, 0x38, 0x49, 0xC5, 0x4E, 0x48, 0x4A, 0xB7, 0xD4, 0x38, 0x4B, 0xA6, 0x81, 0xC8,
+0x4C, 0x99, 0x07, 0xB8, 0x4D, 0x87, 0xB5, 0x48, 0x4E, 0x7A, 0x3B, 0x38, 0x4F, 0x68, 0xE8, 0xC8,
+0x50, 0x5B, 0x6E, 0xB8, 0x51, 0x4B, 0x6D, 0xC8, 0x52, 0x3D, 0xF3, 0xB8, 0x53, 0x2C, 0xA1, 0x48,
+0x54, 0x1F, 0x27, 0x38, 0x55, 0x0D, 0xD4, 0xC8, 0x56, 0x00, 0x5A, 0xB8, 0x56, 0xEF, 0x08, 0x48,
+0x57, 0xE1, 0x8E, 0x38, 0x58, 0xD1, 0x8D, 0x48, 0x59, 0xC4, 0x13, 0x38, 0x5A, 0xB2, 0xC0, 0xC8,
+0x5B, 0xA5, 0x46, 0xB8, 0x5C, 0x93, 0xF4, 0x48, 0x5D, 0x86, 0x7A, 0x38, 0x5E, 0x75, 0x27, 0xC8,
+0x5F, 0x67, 0xAD, 0xB8, 0x60, 0x57, 0xAC, 0xC8, 0x61, 0x4A, 0x32, 0xB8, 0x62, 0x38, 0xE0, 0x48,
+0x63, 0x2B, 0x66, 0x38, 0x64, 0x1A, 0x13, 0xC8, 0x65, 0x0C, 0x99, 0xB8, 0x65, 0xFB, 0x47, 0x48,
+0x66, 0xED, 0xCD, 0x38, 0x67, 0xDD, 0xCC, 0x48, 0x68, 0xD0, 0x52, 0x38, 0x69, 0xBE, 0xFF, 0xC8,
+0x6A, 0xB1, 0x85, 0xB8, 0x6B, 0xA0, 0x33, 0x48, 0x6C, 0x92, 0xB9, 0x38, 0x6D, 0x81, 0x66, 0xC8,
+0x6E, 0x73, 0xEC, 0xB8, 0x6F, 0x62, 0x9A, 0x48, 0x70, 0x55, 0x20, 0x38, 0x71, 0x45, 0x1F, 0x48,
+0x72, 0x37, 0xA5, 0x38, 0x73, 0x26, 0x52, 0xC8, 0x74, 0x18, 0xD8, 0xB8, 0x75, 0x07, 0x86, 0x48,
+0x75, 0xFA, 0x0C, 0x38, 0x76, 0xE8, 0xB9, 0xC8, 0x77, 0xDB, 0x3F, 0xB8, 0x78, 0xCB, 0x3E, 0xC8,
+0x79, 0xBD, 0xC4, 0xB8, 0x7A, 0xAC, 0x72, 0x48, 0x7B, 0x9E, 0xF8, 0x38, 0x7C, 0x8D, 0xA5, 0xC8,
+0x7D, 0x80, 0x2B, 0xB8, 0x7E, 0x6E, 0xD9, 0x48, 0x7F, 0x61, 0x5F, 0x38, 0x01, 0x02, 0x04, 0x03,
+0x04, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02,
+0x05, 0x02, 0x05, 0x02, 0x00, 0x00, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x00, 0x04,
+0x00, 0x00, 0x31, 0x38, 0x00, 0x08, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0D, 0x00, 0x00, 0x38, 0x40,
+0x00, 0x08, 0x00, 0x00, 0x3F, 0x48, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00,
+0x49, 0x52, 0x53, 0x54, 0x00, 0x49, 0x52, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Israel */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x9E, 0x30, 0x45, 0x88,
+0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0,
+0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70,
+0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xD7, 0x5A, 0x14, 0x60, 0xD7, 0xDF, 0x1F, 0xC0,
+0xD8, 0x2F, 0xB5, 0x70, 0xD9, 0x1E, 0x46, 0xE0, 0xDA, 0x10, 0xE8, 0xF0, 0xDA, 0xEB, 0xB3, 0xE0,
+0xDB, 0xB4, 0x34, 0x00, 0xDC, 0xB9, 0x20, 0xE0, 0xDD, 0xE0, 0x8D, 0x00, 0xDE, 0xB4, 0xCE, 0x80,
+0xDF, 0xA4, 0xBF, 0x80, 0xE0, 0x8B, 0x76, 0x00, 0xE1, 0x56, 0x7D, 0x00, 0xE2, 0xBE, 0x4A, 0x60,
+0xE3, 0x36, 0x34, 0xD0, 0xE4, 0x9C, 0xF7, 0x00, 0xE5, 0x16, 0x16, 0xD0, 0xE6, 0x74, 0xD3, 0xE0,
+0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0,
+0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0,
+0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60,
+0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60,
+0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0,
+0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0,
+0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0,
+0x30, 0x48, 0xC5, 0xD0, 0x31, 0x48, 0x96, 0xE0, 0x32, 0x3C, 0x6E, 0x50, 0x33, 0x31, 0xB3, 0x60,
+0x34, 0x1A, 0xFE, 0xD0, 0x35, 0x11, 0x95, 0x60, 0x35, 0xF1, 0xA6, 0x50, 0x37, 0x04, 0x08, 0x80,
+0x37, 0xCF, 0x01, 0x70, 0x38, 0xF6, 0x5F, 0x80, 0x39, 0xDC, 0xF9, 0xE0, 0x3A, 0xD0, 0xED, 0x70,
+0x3B, 0xAE, 0x5B, 0x60, 0x3C, 0xA3, 0xA0, 0x70, 0x3D, 0xA0, 0xB2, 0x60, 0x3E, 0x83, 0x82, 0x70,
+0x3F, 0x7C, 0x9F, 0xE0, 0x40, 0x73, 0x36, 0x70, 0x41, 0x50, 0xA4, 0x60, 0x42, 0x4C, 0x8F, 0x00,
+0x43, 0x48, 0x4F, 0x70, 0x44, 0x2C, 0x71, 0x00, 0x45, 0x1E, 0xF6, 0xF0, 0x46, 0x0C, 0x53, 0x00,
+0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00,
+0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80,
+0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80,
+0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80,
+0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00,
+0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00,
+0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00,
+0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80,
+0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80,
+0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80,
+0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00,
+0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00,
+0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80,
+0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80,
+0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80,
+0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00,
+0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44,
+0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Jamaica */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00,
+0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60,
+0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0,
+0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0,
+0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0,
+0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00,
+0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45,
+0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Japan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xC3, 0xCE, 0x85, 0x70,
+0xD7, 0x3E, 0x1E, 0x90, 0xD7, 0xEC, 0x16, 0x80, 0xD8, 0xF9, 0x16, 0x90, 0xD9, 0xCB, 0xF8, 0x80,
+0xDB, 0x07, 0x1D, 0x10, 0xDB, 0xAB, 0xDA, 0x80, 0xDC, 0xE6, 0xFF, 0x10, 0xDD, 0x8B, 0xBC, 0x80,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00,
+0x00, 0x8C, 0xA0, 0x01, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x43, 0x4A, 0x54, 0x00, 0x4A,
+0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Kwajalein */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xFF, 0x86, 0x1B, 0x50,
+0x2C, 0x74, 0xBC, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0xFF, 0xFF, 0x57, 0x40,
+0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4D, 0x48, 0x54, 0x00, 0x4B, 0x57, 0x41, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Libya */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0xC1, 0x24,
+0xDD, 0xBB, 0xB1, 0x10, 0xDE, 0x23, 0xAD, 0x60, 0xE1, 0x78, 0xD2, 0x10, 0xE1, 0xE7, 0x65, 0xE0,
+0xE5, 0x2F, 0x3F, 0x70, 0xE5, 0xA9, 0xCC, 0xE0, 0xEB, 0x4E, 0xC6, 0xF0, 0x16, 0x92, 0x42, 0x60,
+0x17, 0x08, 0xF7, 0x70, 0x17, 0xFA, 0x2B, 0xE0, 0x18, 0xEA, 0x2A, 0xF0, 0x19, 0xDB, 0x5F, 0x60,
+0x1A, 0xCC, 0xAF, 0xF0, 0x1B, 0xBD, 0xE4, 0x60, 0x1C, 0xB4, 0x7A, 0xF0, 0x1D, 0x9F, 0x17, 0xE0,
+0x1E, 0x93, 0x0B, 0x70, 0x1F, 0x82, 0xEE, 0x60, 0x20, 0x70, 0x4A, 0x70, 0x21, 0x61, 0x7E, 0xE0,
+0x22, 0x52, 0xCF, 0x70, 0x23, 0x44, 0x03, 0xE0, 0x24, 0x34, 0x02, 0xF0, 0x25, 0x25, 0x37, 0x60,
+0x26, 0x40, 0xB7, 0xF0, 0x32, 0x4E, 0xF1, 0x60, 0x33, 0x44, 0x36, 0x70, 0x34, 0x35, 0x6A, 0xE0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x03, 0x00, 0x00, 0x0C,
+0x5C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00,
+0x00, 0x1C, 0x20, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45,
+0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* MET */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60,
+0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90,
+0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0x0D, 0xA4, 0x63, 0x90,
+0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90,
+0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00,
+0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10,
+0x00, 0x05, 0x4D, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x00, 0x00, 0x00,
+
+/* Mexico/BajaNorte */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xF6, 0x80,
+0xA9, 0x79, 0x4F, 0x70, 0xAF, 0xF2, 0x7C, 0xF0, 0xB6, 0x66, 0x64, 0x70, 0xB7, 0x1B, 0x10, 0x00,
+0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x99, 0xBA, 0x70, 0xD7, 0x1B, 0x59, 0x00,
+0xD8, 0x91, 0xB4, 0xF0, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0,
+0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20,
+0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20,
+0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0x0B, 0xE0, 0xAF, 0xA0,
+0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, 0x0F, 0xA9, 0xAE, 0x20,
+0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, 0x13, 0x69, 0x72, 0x20,
+0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20,
+0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0,
+0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0,
+0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20,
+0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20,
+0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0,
+0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0,
+0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20,
+0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20,
+0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20,
+0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0,
+0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0,
+0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0,
+0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, 0x47, 0xF8, 0x9F, 0x20,
+0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, 0x4B, 0xB8, 0x63, 0x20,
+0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, 0x4F, 0x78, 0x27, 0x20,
+0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, 0x53, 0x41, 0x25, 0xA0,
+0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, 0x57, 0x00, 0xE9, 0xA0,
+0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, 0x5A, 0xC0, 0xAD, 0xA0,
+0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, 0x5E, 0x89, 0xAC, 0x20,
+0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, 0x62, 0x49, 0x70, 0x20,
+0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, 0x66, 0x12, 0x6E, 0xA0,
+0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, 0x69, 0xD2, 0x32, 0xA0,
+0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, 0x6D, 0x91, 0xF6, 0xA0,
+0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, 0x71, 0x5A, 0xF5, 0x20,
+0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, 0x75, 0x1A, 0xB9, 0x20,
+0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, 0x78, 0xDA, 0x7D, 0x20,
+0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, 0x7C, 0xA3, 0x7B, 0xA0,
+0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, 0x01, 0x02, 0x01, 0x02,
+0x03, 0x02, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0xFF, 0xFF, 0x92, 0x4C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0x8F, 0x80,
+0x00, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, 0x4C, 0x4D,
+0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Mexico/BajaSur */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70,
+0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60,
+0xB8, 0xFD, 0x86, 0xF0, 0xCB, 0xEA, 0x71, 0x60, 0xD8, 0x91, 0xB4, 0xF0, 0x00, 0x00, 0x70, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xF5, 0x12, 0x90, 0x3B, 0xB6, 0xD1, 0x00,
+0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, 0x47, 0x24, 0x41, 0x80,
+0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, 0x4A, 0xE4, 0x05, 0x80,
+0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, 0x4E, 0xAD, 0x04, 0x00,
+0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, 0x52, 0x6C, 0xC8, 0x00,
+0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, 0x56, 0x2C, 0x8C, 0x00,
+0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, 0x59, 0xF5, 0x8A, 0x80,
+0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, 0x5D, 0xB5, 0x4E, 0x80,
+0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, 0x61, 0x7E, 0x4D, 0x00,
+0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, 0x65, 0x3E, 0x11, 0x00,
+0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, 0x68, 0xFD, 0xD5, 0x00,
+0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, 0x6C, 0xC6, 0xD3, 0x80,
+0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, 0x70, 0x86, 0x97, 0x80,
+0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, 0x74, 0x46, 0x5B, 0x80,
+0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, 0x78, 0x0F, 0x5A, 0x00,
+0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, 0x7B, 0xCF, 0x1E, 0x00,
+0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, 0x7F, 0x8E, 0xE2, 0x00,
+0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
+0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, 0x9C,
+0x3C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF,
+0xFF, 0x8F, 0x80, 0x00, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D,
+0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Mexico/General */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70,
+0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60,
+0xB8, 0xFD, 0x86, 0xF0, 0xC5, 0xDE, 0xB0, 0x60, 0xC6, 0x97, 0x34, 0x50, 0xC9, 0x55, 0xF1, 0xE0,
+0xC9, 0xEA, 0xDD, 0x50, 0xCF, 0x02, 0xC6, 0xE0, 0xCF, 0xB7, 0x56, 0x50, 0xDA, 0x99, 0x15, 0xE0,
+0xDB, 0x76, 0x83, 0xD0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00,
+0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00,
+0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xF5, 0x04, 0x80,
+0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80,
+0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80,
+0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80,
+0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00,
+0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00,
+0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80,
+0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80,
+0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80,
+0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00,
+0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00,
+0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00,
+0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80,
+0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80,
+0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80,
+0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00,
+0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00,
+0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00,
+0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80,
+0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02,
+0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xA3, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90,
+0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF,
+0xB9, 0xB0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00,
+0x43, 0x44, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* MST */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0xA6, 0x3A, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90,
+0xCF, 0x17, 0xDF, 0x1C, 0xCF, 0x8F, 0xE5, 0xAC, 0xD0, 0x81, 0x1A, 0x1C, 0xFA, 0xF8, 0x75, 0x10,
+0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF,
+0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08,
+0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* MST7MDT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90,
+0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00,
+0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00,
+0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00,
+0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80,
+0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80,
+0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80,
+0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00,
+0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00,
+0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80,
+0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00,
+0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00,
+0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00,
+0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80,
+0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80,
+0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80,
+0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00,
+0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00,
+0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80,
+0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80,
+0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80,
+0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00,
+0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00,
+0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00,
+0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80,
+0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80,
+0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB,
+0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF,
+0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54,
+0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* Navajo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90,
+0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00,
+0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00,
+0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00,
+0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80,
+0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80,
+0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80,
+0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00,
+0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00,
+0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80,
+0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00,
+0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00,
+0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00,
+0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80,
+0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80,
+0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80,
+0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00,
+0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00,
+0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80,
+0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80,
+0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80,
+0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00,
+0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00,
+0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00,
+0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80,
+0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80,
+0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB,
+0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF,
+0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54,
+0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* NZ */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8,
+0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68,
+0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68,
+0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68,
+0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8,
+0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8,
+0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8,
+0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0,
+0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0,
+0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0,
+0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0,
+0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60,
+0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60,
+0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60,
+0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0,
+0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60,
+0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60,
+0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60,
+0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0,
+0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0,
+0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0,
+0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60,
+0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60,
+0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60,
+0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60, 0x48, 0xE7, 0x76, 0xE0,
+0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0, 0x4C, 0xA7, 0x3A, 0xE0,
+0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0, 0x50, 0x70, 0x39, 0x60,
+0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0, 0x54, 0x2F, 0xFD, 0x60,
+0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60, 0x57, 0xEF, 0xC1, 0x60,
+0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60, 0x5B, 0xB8, 0xBF, 0xE0,
+0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60, 0x5F, 0x78, 0x83, 0xE0,
+0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0, 0x63, 0x38, 0x47, 0xE0,
+0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0, 0x67, 0x01, 0x46, 0x60,
+0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0, 0x6A, 0xC1, 0x0A, 0x60,
+0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60, 0x6E, 0x80, 0xCE, 0x60,
+0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60, 0x72, 0x49, 0xCC, 0xE0,
+0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0, 0x76, 0x09, 0x90, 0xE0,
+0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0, 0x79, 0xC9, 0x54, 0xE0,
+0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0, 0x7D, 0x92, 0x53, 0x60,
+0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00,
+0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00,
+0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54,
+0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* NZ-CHAT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xE7, 0x8B, 0xC2, 0x04,
+0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0,
+0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0,
+0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0,
+0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60,
+0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60,
+0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60,
+0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0,
+0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0,
+0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0,
+0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60,
+0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60,
+0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60,
+0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0,
+0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0,
+0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60,
+0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60,
+0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60,
+0x48, 0xE7, 0x76, 0xE0, 0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0,
+0x4C, 0xA7, 0x3A, 0xE0, 0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0,
+0x50, 0x70, 0x39, 0x60, 0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0,
+0x54, 0x2F, 0xFD, 0x60, 0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60,
+0x57, 0xEF, 0xC1, 0x60, 0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60,
+0x5B, 0xB8, 0xBF, 0xE0, 0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60,
+0x5F, 0x78, 0x83, 0xE0, 0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0,
+0x63, 0x38, 0x47, 0xE0, 0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0,
+0x67, 0x01, 0x46, 0x60, 0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0,
+0x6A, 0xC1, 0x0A, 0x60, 0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60,
+0x6E, 0x80, 0xCE, 0x60, 0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60,
+0x72, 0x49, 0xCC, 0xE0, 0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0,
+0x76, 0x09, 0x90, 0xE0, 0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0,
+0x79, 0xC9, 0x54, 0xE0, 0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0,
+0x7D, 0x92, 0x53, 0x60, 0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x03, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0xAB, 0xFC,
+0x00, 0x00, 0x00, 0x00, 0xC1, 0x5C, 0x01, 0x04, 0x00, 0x00, 0xB3, 0x4C, 0x00, 0x0A, 0x00, 0x00,
+0xB3, 0x4C, 0x00, 0x0A, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x48, 0x41, 0x44, 0x54, 0x00, 0x43, 0x48,
+0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Apia */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x91, 0x05, 0xFC, 0x00,
+0xDA, 0x62, 0x04, 0x38, 0x01, 0x02, 0xFF, 0xFF, 0x5F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48,
+0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x54,
+0x00, 0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Auckland */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8,
+0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68,
+0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68,
+0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68,
+0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8,
+0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8,
+0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8,
+0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0,
+0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0,
+0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0,
+0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0,
+0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60,
+0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60,
+0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60,
+0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0,
+0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60,
+0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60,
+0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60,
+0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0,
+0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0,
+0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0,
+0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60,
+0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60,
+0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60,
+0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60, 0x48, 0xE7, 0x76, 0xE0,
+0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0, 0x4C, 0xA7, 0x3A, 0xE0,
+0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0, 0x50, 0x70, 0x39, 0x60,
+0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0, 0x54, 0x2F, 0xFD, 0x60,
+0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60, 0x57, 0xEF, 0xC1, 0x60,
+0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60, 0x5B, 0xB8, 0xBF, 0xE0,
+0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60, 0x5F, 0x78, 0x83, 0xE0,
+0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0, 0x63, 0x38, 0x47, 0xE0,
+0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0, 0x67, 0x01, 0x46, 0x60,
+0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0, 0x6A, 0xC1, 0x0A, 0x60,
+0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60, 0x6E, 0x80, 0xCE, 0x60,
+0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60, 0x72, 0x49, 0xCC, 0xE0,
+0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0, 0x76, 0x09, 0x90, 0xE0,
+0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0, 0x79, 0xC9, 0x54, 0xE0,
+0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0, 0x7D, 0x92, 0x53, 0x60,
+0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00,
+0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00,
+0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54,
+0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* Pacific/Chatham */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xE7, 0x8B, 0xC2, 0x04,
+0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0,
+0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0,
+0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0,
+0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60,
+0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60,
+0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60,
+0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0,
+0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0,
+0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0,
+0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60,
+0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60,
+0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60,
+0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0,
+0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0,
+0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60,
+0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60,
+0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x47, 0x07, 0x94, 0xE0, 0x47, 0xDB, 0xD6, 0x60,
+0x48, 0xE7, 0x76, 0xE0, 0x49, 0xBB, 0xB8, 0x60, 0x4A, 0xC7, 0x58, 0xE0, 0x4B, 0xA4, 0xD4, 0xE0,
+0x4C, 0xA7, 0x3A, 0xE0, 0x4D, 0x84, 0xB6, 0xE0, 0x4E, 0x87, 0x1C, 0xE0, 0x4F, 0x64, 0x98, 0xE0,
+0x50, 0x70, 0x39, 0x60, 0x51, 0x44, 0x7A, 0xE0, 0x52, 0x50, 0x1B, 0x60, 0x53, 0x24, 0x5C, 0xE0,
+0x54, 0x2F, 0xFD, 0x60, 0x55, 0x04, 0x3E, 0xE0, 0x56, 0x0F, 0xDF, 0x60, 0x56, 0xED, 0x5B, 0x60,
+0x57, 0xEF, 0xC1, 0x60, 0x58, 0xCD, 0x3D, 0x60, 0x59, 0xCF, 0xA3, 0x60, 0x5A, 0xAD, 0x1F, 0x60,
+0x5B, 0xB8, 0xBF, 0xE0, 0x5C, 0x8D, 0x01, 0x60, 0x5D, 0x98, 0xA1, 0xE0, 0x5E, 0x6C, 0xE3, 0x60,
+0x5F, 0x78, 0x83, 0xE0, 0x60, 0x55, 0xFF, 0xE0, 0x61, 0x58, 0x65, 0xE0, 0x62, 0x35, 0xE1, 0xE0,
+0x63, 0x38, 0x47, 0xE0, 0x64, 0x15, 0xC3, 0xE0, 0x65, 0x18, 0x29, 0xE0, 0x65, 0xF5, 0xA5, 0xE0,
+0x67, 0x01, 0x46, 0x60, 0x67, 0xD5, 0x87, 0xE0, 0x68, 0xE1, 0x28, 0x60, 0x69, 0xB5, 0x69, 0xE0,
+0x6A, 0xC1, 0x0A, 0x60, 0x6B, 0x9E, 0x86, 0x60, 0x6C, 0xA0, 0xEC, 0x60, 0x6D, 0x7E, 0x68, 0x60,
+0x6E, 0x80, 0xCE, 0x60, 0x6F, 0x5E, 0x4A, 0x60, 0x70, 0x69, 0xEA, 0xE0, 0x71, 0x3E, 0x2C, 0x60,
+0x72, 0x49, 0xCC, 0xE0, 0x73, 0x1E, 0x0E, 0x60, 0x74, 0x29, 0xAE, 0xE0, 0x75, 0x07, 0x2A, 0xE0,
+0x76, 0x09, 0x90, 0xE0, 0x76, 0xE7, 0x0C, 0xE0, 0x77, 0xE9, 0x72, 0xE0, 0x78, 0xC6, 0xEE, 0xE0,
+0x79, 0xC9, 0x54, 0xE0, 0x7A, 0xA6, 0xD0, 0xE0, 0x7B, 0xB2, 0x71, 0x60, 0x7C, 0x86, 0xB2, 0xE0,
+0x7D, 0x92, 0x53, 0x60, 0x7E, 0x66, 0x94, 0xE0, 0x7F, 0x72, 0x35, 0x60, 0x03, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0xAB, 0xFC,
+0x00, 0x00, 0x00, 0x00, 0xC1, 0x5C, 0x01, 0x04, 0x00, 0x00, 0xB3, 0x4C, 0x00, 0x0A, 0x00, 0x00,
+0xB3, 0x4C, 0x00, 0x0A, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x48, 0x41, 0x44, 0x54, 0x00, 0x43, 0x48,
+0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Easter */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0F, 0xB9, 0xC7, 0x40, 0x88,
+0xF9, 0xEC, 0x8E, 0x40, 0xFA, 0xB7, 0x87, 0x30, 0xFB, 0xD5, 0xAA, 0xC0, 0xFC, 0x97, 0x69, 0x30,
+0xFD, 0xB5, 0x8C, 0xC0, 0xFE, 0x77, 0x4B, 0x30, 0xFF, 0x95, 0x6E, 0xC0, 0x00, 0x60, 0x67, 0xB0,
+0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0, 0x04, 0x20, 0x2B, 0xB0,
+0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, 0x07, 0x1E, 0x31, 0x40, 0x07, 0xDF, 0xEF, 0xB0,
+0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40, 0x0B, 0xA8, 0xEE, 0x30,
+0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40, 0x0F, 0x68, 0xB2, 0x30,
+0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x28, 0x76, 0x30,
+0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0, 0x16, 0xF1, 0x74, 0xB0,
+0x16, 0xF1, 0xAC, 0xF0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0,
+0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40,
+0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x5A, 0x19, 0x30, 0x21, 0x6F, 0x02, 0x40,
+0x22, 0x39, 0xFB, 0x30, 0x23, 0x4E, 0xE4, 0x40, 0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0,
+0x25, 0xF9, 0xBF, 0x30, 0x27, 0x17, 0xE2, 0xC0, 0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0,
+0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0,
+0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40,
+0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x22, 0x27, 0xB0, 0x34, 0x40, 0x4B, 0x40,
+0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40,
+0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0,
+0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0,
+0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0,
+0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40,
+0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40,
+0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40,
+0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0,
+0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0,
+0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40,
+0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40,
+0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40,
+0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0,
+0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0,
+0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0,
+0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40,
+0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40,
+0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40,
+0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0,
+0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0,
+0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0xFF, 0xFF, 0x99, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D,
+0x90, 0x00, 0x0A, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x0A, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x04, 0xFF,
+0xFF, 0xAB, 0xA0, 0x00, 0x0A, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x0A, 0x4D, 0x4D, 0x54, 0x00, 0x45,
+0x41, 0x53, 0x53, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00,
+
+/* Pacific/Efate */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x92, 0xF5, 0xC2, 0xB4,
+0x19, 0xD2, 0xF7, 0xD0, 0x1A, 0xC2, 0xDA, 0xC0, 0x1B, 0xDA, 0x66, 0xD0, 0x1C, 0xA2, 0xBC, 0xC0,
+0x1D, 0x9B, 0xF6, 0x50, 0x1E, 0x82, 0x9E, 0xC0, 0x1F, 0x7B, 0xD8, 0x50, 0x20, 0x6B, 0xBB, 0x40,
+0x21, 0x5B, 0xBA, 0x50, 0x22, 0x4B, 0x9D, 0x40, 0x23, 0x3B, 0x9C, 0x50, 0x24, 0x2B, 0x7F, 0x40,
+0x25, 0x1B, 0x7E, 0x50, 0x26, 0x0B, 0x61, 0x40, 0x26, 0xFB, 0x60, 0x50, 0x27, 0xEB, 0x43, 0x40,
+0x28, 0xE4, 0x7C, 0xD0, 0x29, 0x81, 0x51, 0x40, 0x2A, 0xE9, 0x48, 0xD0, 0x2B, 0x61, 0x33, 0x40,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x9D, 0xCC, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x01,
+0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x56, 0x55, 0x53, 0x54, 0x00,
+0x56, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Enderbury */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x12, 0x56, 0x04, 0xC0,
+0x2F, 0x06, 0x8B, 0x30, 0x01, 0x02, 0xFF, 0xFF, 0x57, 0x40, 0x00, 0x00, 0xFF, 0xFF, 0x65, 0x50,
+0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x50, 0x48, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Pacific/Fakaofo */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x73, 0x60,
+0x00, 0x00, 0x54, 0x4B, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Fiji */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x9A, 0x13, 0xB2, 0x3C,
+0x36, 0x3B, 0x17, 0xE0, 0x36, 0xD7, 0xFA, 0x60, 0x38, 0x24, 0x34, 0x60, 0x38, 0xB7, 0xDC, 0x60,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0xA7, 0x44, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01,
+0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4A, 0x53, 0x54, 0x00,
+0x46, 0x4A, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Funafuti */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0,
+0x00, 0x00, 0x54, 0x56, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Galapagos */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA4, 0x4C, 0x80,
+0x1E, 0x18, 0xC4, 0x50, 0x01, 0x02, 0xFF, 0xFF, 0xAC, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0,
+0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x43, 0x54, 0x00,
+0x47, 0x41, 0x4C, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Gambier */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x94, 0x50, 0x48, 0x04,
+0x01, 0xFF, 0xFF, 0x81, 0x7C, 0x00, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x47, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Guadalcanal */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x94, 0x4F, 0x33, 0x8C,
+0x01, 0x00, 0x00, 0x95, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x53, 0x42, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Guam */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x3A, 0x43, 0x5E, 0x60,
+0x01, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x47, 0x53, 0x54,
+0x00, 0x43, 0x68, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Honolulu */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0xBB, 0x05, 0x43, 0x48,
+0xBB, 0x20, 0xE4, 0xB8, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x49, 0x38,
+0xD5, 0x8D, 0x73, 0x48, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00,
+0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x08, 0xFF, 0xFF, 0x7A, 0x68,
+0x01, 0x0C, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00,
+0x48, 0x57, 0x54, 0x00, 0x48, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00,
+
+/* Pacific/Johnston */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x73, 0x60,
+0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Kiritimati */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x12, 0x55, 0xF2, 0x00,
+0x2F, 0x06, 0x7D, 0x20, 0x01, 0x02, 0xFF, 0xFF, 0x6A, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60,
+0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x00, 0x00, 0x4C, 0x49, 0x4E, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,
+
+/* Pacific/Kosrae */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0xFF, 0x86, 0x1B, 0x50,
+0x36, 0x8B, 0x67, 0x40, 0x01, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0,
+0x00, 0x00, 0x4B, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Kwajalein */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xFF, 0x86, 0x1B, 0x50,
+0x2C, 0x74, 0xBC, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0xFF, 0xFF, 0x57, 0x40,
+0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4D, 0x48, 0x54, 0x00, 0x4B, 0x57, 0x41, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Majuro */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0xFF, 0x86, 0x1B, 0x50,
+0x01, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4D, 0x48, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Marquesas */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x94, 0x50, 0x4C, 0x48,
+0x01, 0xFF, 0xFF, 0x7D, 0x38, 0x00, 0x00, 0xFF, 0xFF, 0x7A, 0x68, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x4D, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Midway */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xE6, 0x75, 0x8A, 0xB0,
+0xE6, 0xED, 0x75, 0x20, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x00, 0x02, 0x03,
+0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x04, 0xFF, 0xFF, 0x65, 0x50,
+0x00, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x44, 0x54, 0x00,
+0x42, 0x53, 0x54, 0x00, 0x53, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Pacific/Nauru */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0xA3, 0xE7, 0x2B, 0x04,
+0xCB, 0xB4, 0xBF, 0x48, 0xD0, 0x42, 0x50, 0x70, 0x11, 0x8B, 0x04, 0xC8, 0x01, 0x02, 0x01, 0x03,
+0x00, 0x00, 0x9C, 0x7C, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90,
+0x00, 0x08, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4E, 0x52, 0x54, 0x00,
+0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Niue */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0xDC, 0x43, 0x35, 0x60,
+0x10, 0x74, 0xCA, 0x38, 0x01, 0x02, 0xFF, 0xFF, 0x60, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48,
+0x00, 0x00, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0x4E, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* Pacific/Norfolk */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDC, 0x41, 0xF8, 0x80,
+0x01, 0x00, 0x00, 0x9D, 0x80, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x04, 0x4E, 0x4D, 0x54,
+0x00, 0x4E, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Noumea */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x92, 0xF5, 0xC4, 0x74,
+0x0E, 0xE6, 0xBA, 0x50, 0x0F, 0x56, 0xBB, 0xC0, 0x10, 0xC6, 0x9C, 0x50, 0x11, 0x37, 0xEF, 0x40,
+0x32, 0xA0, 0x4B, 0xF0, 0x33, 0x18, 0x44, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x00,
+0x00, 0x9C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00,
+0x09, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54,
+0x00, 0x4E, 0x43, 0x53, 0x54, 0x00, 0x4E, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Pago_Pago */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x91, 0x05, 0xFB, 0x08,
+0xDA, 0x62, 0x04, 0x38, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x02, 0x03, 0x04,
+0xFF, 0xFF, 0x5F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50,
+0x00, 0x09, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0D, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x11, 0x4C, 0x4D,
+0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x53,
+0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Palau */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90,
+0x00, 0x00, 0x50, 0x57, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Pitcairn */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x35, 0x44, 0x42, 0x08,
+0x01, 0xFF, 0xFF, 0x88, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0x50, 0x4E, 0x54,
+0x00, 0x50, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Ponape */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x9A, 0xB0,
+0x00, 0x00, 0x50, 0x4F, 0x4E, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Port_Moresby */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0,
+0x00, 0x00, 0x50, 0x47, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Rarotonga */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0A, 0x10, 0xAC, 0x1B, 0x28,
+0x11, 0x3F, 0xB5, 0x18, 0x12, 0x79, 0x81, 0x20, 0x13, 0x1F, 0x97, 0x18, 0x14, 0x59, 0x63, 0x20,
+0x14, 0xFF, 0x79, 0x18, 0x16, 0x39, 0x45, 0x20, 0x16, 0xE8, 0x95, 0x98, 0x18, 0x22, 0x61, 0xA0,
+0x18, 0xC8, 0x77, 0x98, 0x1A, 0x02, 0x43, 0xA0, 0x1A, 0xA8, 0x59, 0x98, 0x1B, 0xE2, 0x25, 0xA0,
+0x1C, 0x88, 0x3B, 0x98, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0x68, 0x1D, 0x98, 0x1F, 0xA1, 0xE9, 0xA0,
+0x20, 0x47, 0xFF, 0x98, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x31, 0x1C, 0x18, 0x23, 0x6A, 0xE8, 0x20,
+0x24, 0x10, 0xFE, 0x18, 0x25, 0x4A, 0xCA, 0x20, 0x25, 0xF0, 0xE0, 0x18, 0x27, 0x2A, 0xAC, 0x20,
+0x27, 0xD0, 0xC2, 0x18, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF,
+0x6C, 0x58, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04,
+0x43, 0x4B, 0x54, 0x00, 0x43, 0x4B, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Pacific/Saipan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xFF, 0x86, 0x37, 0x70,
+0x3A, 0x43, 0x5E, 0x60, 0x01, 0x02, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0,
+0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x68, 0x53, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Samoa */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x91, 0x05, 0xFB, 0x08,
+0xDA, 0x62, 0x04, 0x38, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x02, 0x03, 0x04,
+0xFF, 0xFF, 0x5F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50,
+0x00, 0x09, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0D, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x11, 0x4C, 0x4D,
+0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x53,
+0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Tahiti */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x94, 0x50, 0x55, 0xB8,
+0x01, 0xFF, 0xFF, 0x73, 0xC8, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x54, 0x41, 0x48, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Pacific/Tarawa */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xA8, 0xC0,
+0x00, 0x00, 0x47, 0x49, 0x4C, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Tongatapu */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x09, 0xC9, 0x73, 0x42, 0x90,
+0x37, 0xFB, 0x47, 0xD0, 0x38, 0xD3, 0x7D, 0xD0, 0x3A, 0x04, 0x08, 0x50, 0x3A, 0x72, 0xB8, 0x40,
+0x3B, 0xE3, 0xEA, 0x50, 0x3C, 0x52, 0x9A, 0x40, 0x01, 0x02, 0x03, 0x04, 0x01, 0x04, 0x01, 0x00,
+0x00, 0xAD, 0x70, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x01,
+0x04, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x04, 0x54, 0x4F, 0x54,
+0x00, 0x54, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+
+/* Pacific/Truk */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x8C, 0xA0,
+0x00, 0x00, 0x54, 0x52, 0x55, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Wake */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xA8, 0xC0,
+0x00, 0x00, 0x57, 0x41, 0x4B, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Wallis */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0,
+0x00, 0x00, 0x57, 0x46, 0x54, 0x00, 0x00, 0x00,
+
+/* Pacific/Yap */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x8C, 0xA0,
+0x00, 0x00, 0x54, 0x52, 0x55, 0x54, 0x00, 0x00, 0x00,
+
+/* Poland */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xA6, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x16, 0x99, 0xA8, 0x2A, 0xD0,
+0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90,
+0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0xA0, 0x9A, 0xB6, 0x00, 0xA1, 0x65, 0xBD, 0x00,
+0xA6, 0x7D, 0x7C, 0x60, 0xC8, 0x76, 0xDE, 0x10, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x80, 0xA9, 0x60, 0xD1, 0x95, 0x92, 0x70,
+0xD2, 0x8A, 0xBB, 0x60, 0xD3, 0x62, 0xFF, 0x70, 0xD4, 0x4B, 0x23, 0x90, 0xD5, 0x5E, 0xAD, 0x10,
+0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x02, 0xC1, 0x90,
+0xD9, 0xE9, 0x78, 0x10, 0xE8, 0x54, 0xD2, 0x00, 0xE8, 0xF1, 0xB4, 0x80, 0xE9, 0xE1, 0xA5, 0x80,
+0xEA, 0xD1, 0x96, 0x80, 0xEC, 0x14, 0x96, 0x00, 0xEC, 0xBA, 0xB3, 0x00, 0xED, 0xAA, 0xA4, 0x00,
+0xEE, 0x9A, 0x95, 0x00, 0xEF, 0xD4, 0x5A, 0x00, 0xF0, 0x7A, 0x77, 0x00, 0xF1, 0xB4, 0x3C, 0x00,
+0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x94, 0x1E, 0x00, 0xF4, 0x3A, 0x3B, 0x00, 0xF5, 0x7D, 0x3A, 0x80,
+0xF6, 0x1A, 0x1D, 0x00, 0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x55, 0x80, 0x0E, 0x8B, 0x0C, 0x00,
+0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x0A, 0x80,
+0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xEC, 0x80, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x13, 0xCE, 0x80,
+0x17, 0x03, 0xBF, 0x80, 0x17, 0xF3, 0xB0, 0x80, 0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80,
+0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00, 0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00,
+0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00,
+0x21, 0xDA, 0xD6, 0xF0, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x07, 0x05, 0x06, 0x02, 0x01, 0x04,
+0x03, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x13, 0xB0, 0x00, 0x00,
+0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20,
+0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00,
+0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04,
+0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x57, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43,
+0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+
+
+/* Portugal */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x10,
+0x9B, 0x4B, 0x6D, 0x70, 0x9B, 0xFE, 0xC7, 0x80, 0x9C, 0x9C, 0xED, 0x70, 0x9D, 0xC9, 0x83, 0x70,
+0x9E, 0x7F, 0x72, 0x70, 0x9F, 0xAA, 0xB6, 0xF0, 0xA0, 0x5F, 0x54, 0x70, 0xA1, 0x8B, 0xEA, 0x70,
+0xA2, 0x41, 0xD9, 0x70, 0xA3, 0x6E, 0x6F, 0x70, 0xA4, 0x23, 0x0C, 0xF0, 0xA5, 0x4F, 0xA2, 0xF0,
+0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xF4, 0x8E, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0,
+0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70,
+0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70,
+0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0,
+0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, 0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0,
+0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, 0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0,
+0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xDF, 0x70, 0xC9, 0x01, 0x2F, 0x70,
+0xC9, 0xF1, 0x20, 0x70, 0xCA, 0xE2, 0x62, 0xF0, 0xCB, 0xB5, 0x52, 0xF0, 0xCB, 0xEC, 0xA3, 0xE0,
+0xCC, 0x80, 0x4B, 0xE0, 0xCC, 0xDC, 0xA2, 0xF0, 0xCD, 0x95, 0x34, 0xF0, 0xCD, 0xC3, 0x4B, 0x60,
+0xCE, 0x72, 0xA2, 0xE0, 0xCE, 0xC5, 0xBF, 0x70, 0xCF, 0x75, 0x16, 0xF0, 0xCF, 0xAC, 0x67, 0xE0,
+0xD0, 0x52, 0x84, 0xE0, 0xD0, 0xA5, 0xA1, 0x70, 0xD1, 0x54, 0xF8, 0xF0, 0xD1, 0x8C, 0x49, 0xE0,
+0xD2, 0x32, 0x66, 0xE0, 0xD2, 0x85, 0x83, 0x70, 0xD3, 0x59, 0xC4, 0xF0, 0xD4, 0x49, 0xB5, 0xF0,
+0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x29, 0xC2, 0x20, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x09, 0xA4, 0x20,
+0xD8, 0xF9, 0x95, 0x20, 0xD9, 0xE9, 0x86, 0x20, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xB2, 0x84, 0xA0,
+0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0x92, 0x66, 0xA0, 0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x72, 0x48, 0xA0,
+0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x32, 0x0C, 0xA0,
+0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x0B, 0x1A, 0x20, 0xE8, 0xFB, 0x0B, 0x20,
+0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xBA, 0xCF, 0x20,
+0xED, 0xAA, 0xC0, 0x20, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x7A, 0x93, 0x20,
+0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x63, 0xAF, 0xA0, 0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x43, 0x91, 0xA0,
+0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x23, 0x73, 0xA0, 0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x03, 0x55, 0xA0,
+0xF8, 0xF3, 0x46, 0xA0, 0x0C, 0xAB, 0x2A, 0x00, 0x0D, 0x9B, 0x1B, 0x00, 0x0E, 0x8B, 0x0C, 0x00,
+0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x18, 0x90,
+0x13, 0x43, 0xFB, 0x80, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90,
+0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xBD, 0xA0, 0x19, 0xD3, 0xA0, 0x90,
+0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10,
+0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10,
+0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10,
+0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90,
+0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90,
+0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90,
+0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10,
+0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90,
+0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90,
+0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90,
+0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10,
+0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10,
+0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10,
+0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90,
+0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90,
+0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90,
+0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10,
+0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10,
+0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90,
+0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90,
+0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90,
+0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10,
+0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10,
+0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10,
+0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90,
+0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90,
+0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90,
+0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03,
+0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x06, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0xFF, 0xFF, 0xF7,
+0x70, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
+0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01,
+0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C,
+0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, 0x54,
+0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+
+
+/* PRC */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xB0, 0xFE, 0x9A, 0xA0,
+0xC8, 0x5C, 0x01, 0x80, 0xC8, 0xFA, 0x27, 0x70, 0xC9, 0xD5, 0x0E, 0x80, 0xCA, 0xDB, 0x5A, 0xF0,
+0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70,
+0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0,
+0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x00, 0x00, 0x71, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70,
+0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* PST8PDT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0,
+0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90,
+0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90,
+0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90,
+0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90,
+0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10,
+0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10,
+0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10,
+0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90,
+0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10,
+0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10,
+0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10,
+0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90,
+0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90,
+0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90,
+0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10,
+0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10,
+0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10,
+0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90,
+0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90,
+0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90,
+0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10,
+0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10,
+0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90,
+0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90,
+0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90,
+0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10,
+0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10,
+0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10,
+0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90,
+0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10,
+0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10,
+0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90,
+0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90,
+0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90,
+0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10,
+0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10,
+0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90,
+0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90,
+0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90,
+0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10,
+0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10,
+0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10,
+0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90,
+0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90,
+0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF,
+0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01,
+0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* ROC */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xD1, 0x97, 0xD3, 0x00,
+0xD2, 0x61, 0x7A, 0x70, 0xD3, 0x79, 0x06, 0x80, 0xD4, 0x42, 0xAD, 0xF0, 0xD5, 0x5A, 0x3A, 0x00,
+0xD6, 0x23, 0xE1, 0x70, 0xD7, 0x3C, 0xBF, 0x00, 0xD8, 0x06, 0x66, 0x70, 0xD9, 0x1D, 0xF2, 0x80,
+0xD9, 0xE7, 0x99, 0xF0, 0xDA, 0xFF, 0x26, 0x00, 0xDB, 0xC8, 0xCD, 0x70, 0xDC, 0xE0, 0x59, 0x80,
+0xDD, 0xAA, 0x00, 0xF0, 0xDE, 0x72, 0x73, 0x00, 0xDF, 0xB5, 0x64, 0x70, 0xE0, 0x7C, 0x85, 0x00,
+0xE1, 0x96, 0x97, 0xF0, 0xE2, 0x5D, 0xB8, 0x80, 0xE3, 0x77, 0xCB, 0x70, 0xE4, 0x3E, 0xEC, 0x00,
+0xE5, 0x30, 0x20, 0x70, 0xE6, 0x21, 0x71, 0x00, 0xE7, 0x12, 0xA5, 0x70, 0xE8, 0x02, 0xA4, 0x80,
+0xE8, 0xF3, 0xD8, 0xF0, 0xE9, 0xE3, 0xD8, 0x00, 0xEA, 0xD5, 0x0C, 0x70, 0xEB, 0xC5, 0x0B, 0x80,
+0xEC, 0xB6, 0x3F, 0xF0, 0xED, 0xF7, 0xFC, 0x00, 0xEE, 0x98, 0xC4, 0xF0, 0xEF, 0xD9, 0x2F, 0x80,
+0xF0, 0x79, 0xF8, 0x70, 0x07, 0xFC, 0x56, 0x00, 0x08, 0xED, 0x8A, 0x70, 0x09, 0xDD, 0x89, 0x80,
+0x0A, 0xCE, 0xBD, 0xF0, 0x13, 0xBC, 0xD5, 0x00, 0x14, 0x36, 0x10, 0xF0, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04,
+0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* ROK */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x85, 0x93, 0x7E, 0x78,
+0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80,
+0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70,
+0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, 0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x03,
+0x02, 0x03, 0x00, 0x01, 0x04, 0x01, 0x04, 0x01, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00,
+0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00,
+0x00, 0x00, 0x8C, 0xA0, 0x01, 0x04, 0x4B, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Singapore */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x86, 0x83, 0x85, 0xA3,
+0xBA, 0x67, 0x4E, 0x90, 0xC0, 0x0A, 0xE4, 0x60, 0xCA, 0xB3, 0xE5, 0x60, 0xCB, 0x91, 0x5F, 0x08,
+0xD2, 0x48, 0x6D, 0xF0, 0xF7, 0xBA, 0x4D, 0x88, 0x16, 0x91, 0xF5, 0x08, 0x01, 0x02, 0x03, 0x04,
+0x05, 0x04, 0x06, 0x07, 0x00, 0x00, 0x61, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04,
+0x00, 0x00, 0x67, 0x20, 0x01, 0x09, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78,
+0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0F, 0x00, 0x00, 0x69, 0x78, 0x00, 0x13, 0x00, 0x00,
+0x70, 0x80, 0x00, 0x13, 0x53, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x4C, 0x54, 0x00, 0x4D, 0x41, 0x4C,
+0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x53, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Turkey */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x90, 0x8B, 0xF5, 0x98,
+0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xBE, 0xD0, 0xA2, 0x65, 0x63, 0xE0, 0xA3, 0x7B, 0x82, 0x50,
+0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, 0xA7, 0x27, 0x7F, 0xD0,
+0xAA, 0x28, 0x28, 0x60, 0xAA, 0xE1, 0xFD, 0xD0, 0xAB, 0xF9, 0x89, 0xE0, 0xAC, 0xC3, 0x31, 0x50,
+0xC8, 0x7F, 0xEE, 0x60, 0xC8, 0xFF, 0xC1, 0xD0, 0xC9, 0x4A, 0xF5, 0x60, 0xCA, 0xCE, 0x80, 0x50,
+0xCB, 0xCB, 0xAE, 0x60, 0xCC, 0xE5, 0xC1, 0x50, 0xD1, 0x71, 0xEB, 0xE0, 0xD2, 0x6B, 0x09, 0x50,
+0xD3, 0xA2, 0x39, 0x60, 0xD4, 0x43, 0x02, 0x50, 0xD5, 0x4C, 0x0D, 0xE0, 0xD6, 0x29, 0x7B, 0xD0,
+0xD7, 0x2B, 0xEF, 0xE0, 0xD8, 0x09, 0x5D, 0xD0, 0xD9, 0x02, 0x97, 0x60, 0xD9, 0xE9, 0x3F, 0xD0,
+0xDA, 0xEF, 0xA8, 0x60, 0xDB, 0xD2, 0x5C, 0x50, 0xDC, 0xD4, 0xD0, 0x60, 0xDD, 0xB3, 0x8F, 0xD0,
+0xF1, 0xF4, 0xB9, 0x60, 0xF2, 0x64, 0xBA, 0xD0, 0xF5, 0x68, 0x06, 0x60, 0xF6, 0x1F, 0x38, 0xD0,
+0x00, 0xA0, 0xBA, 0xE0, 0x01, 0x6B, 0xB3, 0xD0, 0x02, 0x80, 0x9C, 0xE0, 0x03, 0x4B, 0x95, 0xD0,
+0x04, 0x69, 0xB9, 0x60, 0x05, 0x34, 0xB2, 0x50, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x39, 0xA8, 0x80,
+0x07, 0xFB, 0x75, 0x00, 0x09, 0x19, 0xA6, 0xA0, 0x09, 0xDB, 0x3A, 0xE0, 0x0A, 0xF0, 0x07, 0xD0,
+0x0C, 0x10, 0xCE, 0x60, 0x0C, 0xD9, 0x24, 0x50, 0x0D, 0xA4, 0x39, 0x60, 0x0E, 0xA6, 0x91, 0x50,
+0x0F, 0x84, 0x1B, 0x60, 0x10, 0x86, 0x73, 0x50, 0x12, 0x67, 0x98, 0xC0, 0x13, 0x4D, 0x36, 0x00,
+0x14, 0x47, 0x7A, 0xC0, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x27, 0x5C, 0xC0, 0x17, 0x03, 0xBF, 0x80,
+0x18, 0x07, 0x3E, 0xC0, 0x19, 0x89, 0x94, 0x50, 0x19, 0xDC, 0x94, 0xC0, 0x1C, 0xC6, 0xD3, 0xD0,
+0x1D, 0x9B, 0x15, 0x50, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00,
+0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00,
+0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0x7F, 0xB4, 0xE0,
+0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90,
+0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90,
+0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10,
+0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90,
+0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90,
+0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10,
+0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10,
+0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10,
+0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90,
+0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90,
+0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90,
+0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10,
+0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10,
+0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10,
+0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90,
+0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90,
+0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90,
+0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10,
+0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10,
+0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90,
+0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90,
+0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90,
+0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04,
+0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07,
+0x08, 0x07, 0x08, 0x00, 0x00, 0x1B, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00,
+0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00,
+0x12, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A,
+0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x49, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53,
+0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x54, 0x52, 0x53, 0x54, 0x00, 0x54, 0x52, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01,
+
+/* UCT */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x55, 0x43, 0x54, 0x00, 0x00, 0x00,
+
+/* Universal */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00,
+
+/* US/Alaska */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0xCB, 0x89, 0x36, 0xC0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x42, 0x30, 0xFA, 0xD2, 0x47, 0xA0, 0xFE, 0xB8, 0x63, 0x40,
+0xFF, 0xA8, 0x46, 0x30, 0x00, 0x98, 0x45, 0x40, 0x01, 0x88, 0x28, 0x30, 0x02, 0x78, 0x27, 0x40,
+0x03, 0x71, 0x44, 0xB0, 0x04, 0x61, 0x43, 0xC0, 0x05, 0x51, 0x26, 0xB0, 0x06, 0x41, 0x25, 0xC0,
+0x07, 0x31, 0x08, 0xB0, 0x07, 0x8D, 0x5F, 0xC0, 0x09, 0x10, 0xEA, 0xB0, 0x09, 0xAD, 0xDB, 0x40,
+0x0A, 0xF0, 0xCC, 0xB0, 0x0B, 0xE0, 0xCB, 0xC0, 0x0C, 0xD9, 0xE9, 0x30, 0x0D, 0xC0, 0xAD, 0xC0,
+0x0E, 0xB9, 0xCB, 0x30, 0x0F, 0xA9, 0xCA, 0x40, 0x10, 0x99, 0xAD, 0x30, 0x11, 0x89, 0xAC, 0x40,
+0x12, 0x79, 0x8F, 0x30, 0x13, 0x69, 0x8E, 0x40, 0x14, 0x59, 0x71, 0x30, 0x15, 0x49, 0x70, 0x40,
+0x16, 0x39, 0x53, 0x30, 0x17, 0x29, 0x52, 0x40, 0x18, 0x22, 0x6F, 0xB0, 0x19, 0x09, 0x34, 0x40,
+0x1A, 0x02, 0x51, 0xB0, 0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0,
+0x1C, 0xD2, 0x24, 0xB0, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0,
+0x20, 0x76, 0x39, 0x30, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20,
+0x24, 0x35, 0xFD, 0x30, 0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20,
+0x27, 0xFE, 0xFB, 0xB0, 0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20,
+0x2B, 0xBE, 0xBF, 0xB0, 0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0,
+0x2F, 0x7E, 0x83, 0xB0, 0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0,
+0x33, 0x47, 0x82, 0x30, 0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0,
+0x37, 0x07, 0x46, 0x30, 0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20,
+0x3A, 0xC7, 0x0A, 0x30, 0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20,
+0x3E, 0x90, 0x08, 0xB0, 0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0,
+0x42, 0x4F, 0xCC, 0xB0, 0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0,
+0x45, 0xF3, 0xE1, 0x30, 0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20,
+0x49, 0xB3, 0xA5, 0x30, 0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0,
+0x4D, 0x7C, 0xA3, 0xB0, 0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0,
+0x51, 0x3C, 0x67, 0xB0, 0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0,
+0x54, 0xFC, 0x2B, 0xB0, 0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20,
+0x58, 0xC5, 0x2A, 0x30, 0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20,
+0x5C, 0x84, 0xEE, 0x30, 0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20,
+0x60, 0x4D, 0xEC, 0xB0, 0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0,
+0x64, 0x0D, 0xB0, 0xB0, 0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0,
+0x67, 0xCD, 0x74, 0xB0, 0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0,
+0x6B, 0x96, 0x73, 0x30, 0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20,
+0x6F, 0x56, 0x37, 0x30, 0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20,
+0x73, 0x15, 0xFB, 0x30, 0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0,
+0x76, 0xDE, 0xF9, 0xB0, 0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0,
+0x7A, 0x9E, 0xBD, 0xB0, 0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0,
+0x7E, 0x5E, 0x81, 0xB0, 0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0x81,
+0x70, 0x01, 0x04, 0xFF, 0xFF, 0x81, 0x70, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x09, 0xFF,
+0xFF, 0x81, 0x70, 0x01, 0x0E, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x13, 0xFF, 0xFF, 0x8F, 0x80, 0x01,
+0x17, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x1C, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x57, 0x54, 0x00,
+0x41, 0x48, 0x53, 0x54, 0x00, 0x41, 0x48, 0x44, 0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x41, 0x4B,
+0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* US/Aleutian */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0xCB, 0x89, 0x44, 0xD0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50,
+0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50,
+0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0,
+0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50,
+0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0,
+0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50,
+0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50,
+0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50,
+0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x22, 0x20, 0x1A, 0xF2, 0x50, 0xC0, 0x1B, 0xE2, 0x33, 0xB0,
+0x1C, 0xD2, 0x32, 0xC0, 0x1D, 0xC2, 0x15, 0xB0, 0x1E, 0xB2, 0x14, 0xC0, 0x1F, 0xA1, 0xF7, 0xB0,
+0x20, 0x76, 0x47, 0x40, 0x21, 0x81, 0xD9, 0xB0, 0x22, 0x56, 0x29, 0x40, 0x23, 0x6A, 0xF6, 0x30,
+0x24, 0x36, 0x0B, 0x40, 0x25, 0x4A, 0xD8, 0x30, 0x26, 0x15, 0xED, 0x40, 0x27, 0x2A, 0xBA, 0x30,
+0x27, 0xFF, 0x09, 0xC0, 0x29, 0x0A, 0x9C, 0x30, 0x29, 0xDE, 0xEB, 0xC0, 0x2A, 0xEA, 0x7E, 0x30,
+0x2B, 0xBE, 0xCD, 0xC0, 0x2C, 0xD3, 0x9A, 0xB0, 0x2D, 0x9E, 0xAF, 0xC0, 0x2E, 0xB3, 0x7C, 0xB0,
+0x2F, 0x7E, 0x91, 0xC0, 0x30, 0x93, 0x5E, 0xB0, 0x31, 0x67, 0xAE, 0x40, 0x32, 0x73, 0x40, 0xB0,
+0x33, 0x47, 0x90, 0x40, 0x34, 0x53, 0x22, 0xB0, 0x35, 0x27, 0x72, 0x40, 0x36, 0x33, 0x04, 0xB0,
+0x37, 0x07, 0x54, 0x40, 0x38, 0x1C, 0x21, 0x30, 0x38, 0xE7, 0x36, 0x40, 0x39, 0xFC, 0x03, 0x30,
+0x3A, 0xC7, 0x18, 0x40, 0x3B, 0xDB, 0xE5, 0x30, 0x3C, 0xB0, 0x34, 0xC0, 0x3D, 0xBB, 0xC7, 0x30,
+0x3E, 0x90, 0x16, 0xC0, 0x3F, 0x9B, 0xA9, 0x30, 0x40, 0x6F, 0xF8, 0xC0, 0x41, 0x84, 0xC5, 0xB0,
+0x42, 0x4F, 0xDA, 0xC0, 0x43, 0x64, 0xA7, 0xB0, 0x44, 0x2F, 0xBC, 0xC0, 0x45, 0x44, 0x89, 0xB0,
+0x45, 0xF3, 0xEF, 0x40, 0x47, 0x2D, 0xA6, 0x30, 0x47, 0xD3, 0xD1, 0x40, 0x49, 0x0D, 0x88, 0x30,
+0x49, 0xB3, 0xB3, 0x40, 0x4A, 0xED, 0x6A, 0x30, 0x4B, 0x9C, 0xCF, 0xC0, 0x4C, 0xD6, 0x86, 0xB0,
+0x4D, 0x7C, 0xB1, 0xC0, 0x4E, 0xB6, 0x68, 0xB0, 0x4F, 0x5C, 0x93, 0xC0, 0x50, 0x96, 0x4A, 0xB0,
+0x51, 0x3C, 0x75, 0xC0, 0x52, 0x76, 0x2C, 0xB0, 0x53, 0x1C, 0x57, 0xC0, 0x54, 0x56, 0x0E, 0xB0,
+0x54, 0xFC, 0x39, 0xC0, 0x56, 0x35, 0xF0, 0xB0, 0x56, 0xE5, 0x56, 0x40, 0x58, 0x1F, 0x0D, 0x30,
+0x58, 0xC5, 0x38, 0x40, 0x59, 0xFE, 0xEF, 0x30, 0x5A, 0xA5, 0x1A, 0x40, 0x5B, 0xDE, 0xD1, 0x30,
+0x5C, 0x84, 0xFC, 0x40, 0x5D, 0xBE, 0xB3, 0x30, 0x5E, 0x64, 0xDE, 0x40, 0x5F, 0x9E, 0x95, 0x30,
+0x60, 0x4D, 0xFA, 0xC0, 0x61, 0x87, 0xB1, 0xB0, 0x62, 0x2D, 0xDC, 0xC0, 0x63, 0x67, 0x93, 0xB0,
+0x64, 0x0D, 0xBE, 0xC0, 0x65, 0x47, 0x75, 0xB0, 0x65, 0xED, 0xA0, 0xC0, 0x67, 0x27, 0x57, 0xB0,
+0x67, 0xCD, 0x82, 0xC0, 0x69, 0x07, 0x39, 0xB0, 0x69, 0xAD, 0x64, 0xC0, 0x6A, 0xE7, 0x1B, 0xB0,
+0x6B, 0x96, 0x81, 0x40, 0x6C, 0xD0, 0x38, 0x30, 0x6D, 0x76, 0x63, 0x40, 0x6E, 0xB0, 0x1A, 0x30,
+0x6F, 0x56, 0x45, 0x40, 0x70, 0x8F, 0xFC, 0x30, 0x71, 0x36, 0x27, 0x40, 0x72, 0x6F, 0xDE, 0x30,
+0x73, 0x16, 0x09, 0x40, 0x74, 0x4F, 0xC0, 0x30, 0x74, 0xFF, 0x25, 0xC0, 0x76, 0x38, 0xDC, 0xB0,
+0x76, 0xDF, 0x07, 0xC0, 0x78, 0x18, 0xBE, 0xB0, 0x78, 0xBE, 0xE9, 0xC0, 0x79, 0xF8, 0xA0, 0xB0,
+0x7A, 0x9E, 0xCB, 0xC0, 0x7B, 0xD8, 0x82, 0xB0, 0x7C, 0x7E, 0xAD, 0xC0, 0x7D, 0xB8, 0x64, 0xB0,
+0x7E, 0x5E, 0x8F, 0xC0, 0x7F, 0x98, 0x46, 0xB0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
+0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73,
+0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF,
+0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x14, 0xFF, 0xFF, 0x81, 0x70, 0x01,
+0x19, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x1E, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E,
+0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00,
+0x48, 0x41, 0x44, 0x54, 0x00, 0x48, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* US/Arizona */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0xA6, 0x3A, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90,
+0xCF, 0x17, 0xDF, 0x1C, 0xCF, 0x8F, 0xE5, 0xAC, 0xD0, 0x81, 0x1A, 0x1C, 0xFA, 0xF8, 0x75, 0x10,
+0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF,
+0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08,
+0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00,
+
+/* US/Central */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA2, 0xCB, 0x74, 0x00,
+0xA3, 0x83, 0xF7, 0xF0, 0xA4, 0x45, 0xD2, 0x80, 0xA5, 0x63, 0xD9, 0xF0, 0xA6, 0x53, 0xD9, 0x00,
+0xA7, 0x15, 0x97, 0x70, 0xA8, 0x33, 0xBB, 0x00, 0xA8, 0xFE, 0xB3, 0xF0, 0xAA, 0x13, 0x9D, 0x00,
+0xAA, 0xDE, 0x95, 0xF0, 0xAB, 0xF3, 0x7F, 0x00, 0xAC, 0xBE, 0x77, 0xF0, 0xAD, 0xD3, 0x61, 0x00,
+0xAE, 0x9E, 0x59, 0xF0, 0xAF, 0xB3, 0x43, 0x00, 0xB0, 0x7E, 0x3B, 0xF0, 0xB1, 0x9C, 0x5F, 0x80,
+0xB2, 0x67, 0x58, 0x70, 0xB3, 0x7C, 0x41, 0x80, 0xB4, 0x47, 0x3A, 0x70, 0xB5, 0x5C, 0x23, 0x80,
+0xB6, 0x27, 0x1C, 0x70, 0xB7, 0x3C, 0x05, 0x80, 0xB8, 0x06, 0xFE, 0x70, 0xB9, 0x1B, 0xE7, 0x80,
+0xB9, 0xE6, 0xE0, 0x70, 0xBB, 0x05, 0x04, 0x00, 0xBB, 0xC6, 0xC2, 0x70, 0xBC, 0xE4, 0xE6, 0x00,
+0xBD, 0xAF, 0xDE, 0xF0, 0xBE, 0xC4, 0xC8, 0x00, 0xBF, 0x8F, 0xC0, 0xF0, 0xC0, 0x5A, 0xD6, 0x00,
+0xC1, 0xB0, 0x3C, 0x70, 0xC2, 0x84, 0x8C, 0x00, 0xC3, 0x4F, 0x84, 0xF0, 0xC4, 0x64, 0x6E, 0x00,
+0xC5, 0x2F, 0x66, 0xF0, 0xC6, 0x4D, 0x8A, 0x80, 0xC7, 0x0F, 0x48, 0xF0, 0xC8, 0x2D, 0x6C, 0x80,
+0xC8, 0xF8, 0x65, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0,
+0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, 0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0,
+0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, 0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0,
+0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, 0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70,
+0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70,
+0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0,
+0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0,
+0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70,
+0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70,
+0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xF6, 0x3F, 0x69, 0x70,
+0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x85, 0xF0, 0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0,
+0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0,
+0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0,
+0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70,
+0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70,
+0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0,
+0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0,
+0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0,
+0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70,
+0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70,
+0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70,
+0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0,
+0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0,
+0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0,
+0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70,
+0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70,
+0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70,
+0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0,
+0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0,
+0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70,
+0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70,
+0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0,
+0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70,
+0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70,
+0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70,
+0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0,
+0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0,
+0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0,
+0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70,
+0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70,
+0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70,
+0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0,
+0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0,
+0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70,
+0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70,
+0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70,
+0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF,
+0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54,
+0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
+
+/* US/Eastern */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x1E, 0x70,
+0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x86, 0x00, 0x70, 0xA1, 0x9A, 0xCD, 0x60, 0xA2, 0x65, 0xE2, 0x70,
+0xA3, 0x83, 0xE9, 0xE0, 0xA4, 0x6A, 0xAE, 0x70, 0xA5, 0x35, 0xA7, 0x60, 0xA6, 0x53, 0xCA, 0xF0,
+0xA7, 0x15, 0x89, 0x60, 0xA8, 0x33, 0xAC, 0xF0, 0xA8, 0xFE, 0xA5, 0xE0, 0xAA, 0x13, 0x8E, 0xF0,
+0xAA, 0xDE, 0x87, 0xE0, 0xAB, 0xF3, 0x70, 0xF0, 0xAC, 0xBE, 0x69, 0xE0, 0xAD, 0xD3, 0x52, 0xF0,
+0xAE, 0x9E, 0x4B, 0xE0, 0xAF, 0xB3, 0x34, 0xF0, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70,
+0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70,
+0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x1B, 0xD9, 0x70,
+0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xC6, 0xB4, 0x60, 0xBC, 0xE4, 0xD7, 0xF0,
+0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0,
+0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0,
+0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70,
+0xC8, 0xF8, 0x57, 0x60, 0xCA, 0x0D, 0x40, 0x70, 0xCA, 0xD8, 0x39, 0x60, 0xCB, 0x88, 0xF0, 0x70,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, 0xD4, 0x40, 0xDD, 0xE0,
+0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0,
+0xD9, 0x15, 0x8A, 0xF0, 0xD9, 0xE0, 0x83, 0xE0, 0xDA, 0xFE, 0xA7, 0x70, 0xDB, 0xC0, 0x65, 0xE0,
+0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, 0xDF, 0x89, 0x64, 0x60,
+0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, 0xE3, 0x49, 0x28, 0x60,
+0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x57, 0x2E, 0xE0, 0xE6, 0x47, 0x2D, 0xF0, 0xE7, 0x37, 0x10, 0xE0,
+0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, 0xEA, 0xF6, 0xD4, 0xE0,
+0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, 0xEE, 0xBF, 0xD3, 0x60,
+0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, 0xF2, 0x7F, 0x97, 0x60,
+0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60,
+0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0,
+0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0,
+0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0,
+0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60,
+0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60,
+0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0,
+0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0,
+0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0,
+0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60,
+0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60,
+0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60,
+0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0,
+0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0,
+0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0,
+0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60,
+0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60,
+0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60,
+0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0,
+0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0,
+0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60,
+0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60,
+0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0,
+0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60,
+0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60,
+0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60,
+0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0,
+0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0,
+0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0,
+0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60,
+0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60,
+0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60,
+0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0,
+0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0,
+0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60,
+0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60,
+0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60,
+0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF,
+0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00, 0x00, 0x01,
+
+/* US/East-Indiana */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80,
+0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0,
+0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0,
+0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0,
+0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0,
+0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0,
+0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0,
+0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70,
+0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70,
+0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70,
+0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0,
+0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0,
+0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70,
+0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70,
+0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70,
+0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0,
+0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0,
+0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0,
+0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70,
+0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70,
+0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70,
+0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04,
+0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0,
+0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF,
+0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53,
+0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+
+/* US/Hawaii */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0xBB, 0x05, 0x43, 0x48,
+0xBB, 0x20, 0xE4, 0xB8, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x49, 0x38,
+0xD5, 0x8D, 0x73, 0x48, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00,
+0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x08, 0xFF, 0xFF, 0x7A, 0x68,
+0x01, 0x0C, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00,
+0x48, 0x57, 0x54, 0x00, 0x48, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00,
+
+/* US/Indiana-Starke */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80,
+0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0,
+0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0,
+0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70,
+0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70,
+0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0,
+0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0,
+0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0,
+0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70,
+0xF1, 0x8F, 0xC2, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0,
+0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0,
+0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70,
+0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70,
+0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70,
+0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0,
+0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0,
+0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0,
+0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70,
+0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70,
+0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70,
+0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0,
+0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0,
+0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0,
+0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0,
+0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60,
+0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60,
+0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60,
+0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0,
+0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0,
+0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60,
+0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60,
+0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60,
+0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0,
+0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0,
+0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0,
+0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60,
+0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60,
+0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF,
+0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01,
+0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54,
+0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54,
+0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+0x00,
+
+/* US/Michigan */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x8B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x85, 0xBD, 0x22, 0x5B,
+0x99, 0x3C, 0x94, 0x00, 0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0,
+0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, 0xFB, 0x33, 0xAC, 0x70, 0xFB, 0xE8, 0x3B, 0xE0,
+0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60,
+0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0,
+0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0,
+0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0,
+0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60,
+0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60,
+0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60,
+0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0,
+0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0,
+0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0,
+0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60,
+0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60,
+0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60,
+0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0,
+0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0,
+0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60,
+0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60,
+0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0,
+0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60,
+0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60,
+0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60,
+0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0,
+0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0,
+0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0,
+0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60,
+0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60,
+0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60,
+0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0,
+0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0,
+0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60,
+0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60,
+0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60,
+0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x01, 0x02, 0x03, 0x04, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05,
+0x02, 0x05, 0x02, 0xFF, 0xFF, 0xB2, 0x25, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF,
+0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01,
+0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+
+/* US/Mountain */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90,
+0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90,
+0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00,
+0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00,
+0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00,
+0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80,
+0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80,
+0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80,
+0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00,
+0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00,
+0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80,
+0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00,
+0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00,
+0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80,
+0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80,
+0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80,
+0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00,
+0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00,
+0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00,
+0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80,
+0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00,
+0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00,
+0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80,
+0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80,
+0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80,
+0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00,
+0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00,
+0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80,
+0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80,
+0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80,
+0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00,
+0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00,
+0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00,
+0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80,
+0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80,
+0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB,
+0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF,
+0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54,
+0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* US/Pacific */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0,
+0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90,
+0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90,
+0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90,
+0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90,
+0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10,
+0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10,
+0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10,
+0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90,
+0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10,
+0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10,
+0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10,
+0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90,
+0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90,
+0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90,
+0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10,
+0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10,
+0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10,
+0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90,
+0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90,
+0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90,
+0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10,
+0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10,
+0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90,
+0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90,
+0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90,
+0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10,
+0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10,
+0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10,
+0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90,
+0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10,
+0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10,
+0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90,
+0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90,
+0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90,
+0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10,
+0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10,
+0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90,
+0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90,
+0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90,
+0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10,
+0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10,
+0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10,
+0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90,
+0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90,
+0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF,
+0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01,
+0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* US/Pacific-New */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0,
+0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90,
+0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90,
+0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90,
+0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90,
+0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10,
+0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10,
+0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10,
+0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90,
+0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10,
+0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10,
+0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10,
+0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90,
+0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90,
+0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90,
+0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10,
+0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10,
+0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10,
+0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90,
+0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90,
+0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90,
+0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10,
+0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10,
+0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90,
+0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90,
+0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90,
+0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10,
+0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10,
+0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10,
+0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90,
+0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10,
+0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10,
+0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90,
+0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90,
+0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90,
+0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10,
+0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10,
+0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90,
+0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90,
+0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90,
+0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10,
+0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10,
+0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10,
+0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90,
+0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90,
+0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90,
+0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF,
+0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01,
+0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+
+/* US/Samoa */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x91, 0x05, 0xFB, 0x08,
+0xDA, 0x62, 0x04, 0x38, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x02, 0x03, 0x04,
+0xFF, 0xFF, 0x5F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50,
+0x00, 0x09, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0D, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x11, 0x4C, 0x4D,
+0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x53,
+0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* UTC */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00,
+
+/* WET */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x0D, 0xA4, 0x63, 0x90,
+0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90,
+0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90,
+0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90,
+0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10,
+0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10,
+0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10,
+0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90,
+0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90,
+0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90,
+0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10,
+0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10,
+0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10,
+0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90,
+0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90,
+0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90,
+0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10,
+0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10,
+0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90,
+0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90,
+0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90,
+0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10,
+0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10,
+0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10,
+0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90,
+0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90,
+0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90,
+0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10,
+0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10,
+0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10,
+0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90,
+0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
+0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57,
+0x45, 0x54, 0x00, 0x01, 0x01, 0x01, 0x01,
+
+/* W-SU */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0x9B, 0x5F, 0x1E, 0xD8,
+0x9D, 0x3E, 0xF2, 0x98, 0x9E, 0x2A, 0xEF, 0x18, 0x9E, 0xF7, 0x39, 0x88, 0x9F, 0x84, 0x58, 0x18,
+0xA0, 0xD8, 0x6D, 0x08, 0xA1, 0x00, 0x16, 0x28, 0xA1, 0x3C, 0xA6, 0x40, 0xA4, 0x10, 0x6D, 0xC0,
+0xA4, 0x3D, 0x32, 0xB0, 0xA5, 0x15, 0x68, 0xB0, 0xA5, 0x3D, 0x03, 0xC0, 0xA7, 0x1E, 0x45, 0x50,
+0xB5, 0xA4, 0x19, 0x60, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50,
+0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0,
+0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0,
+0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0,
+0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0,
+0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x78, 0xBF, 0x80,
+0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70,
+0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70,
+0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, 0x34, 0x52, 0x79, 0xF0,
+0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, 0x38, 0x1B, 0x78, 0x70,
+0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, 0x3B, 0xDB, 0x3C, 0x70,
+0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, 0x3F, 0x9B, 0x00, 0x70,
+0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, 0x43, 0x63, 0xFE, 0xF0,
+0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70, 0x47, 0x23, 0xC2, 0xF0,
+0x47, 0xEE, 0xC9, 0xF0, 0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0, 0x4A, 0xE3, 0x86, 0xF0,
+0x4B, 0xAE, 0x8D, 0xF0, 0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0, 0x4E, 0xAC, 0x85, 0x70,
+0x4F, 0x6E, 0x51, 0xF0, 0x50, 0x8C, 0x67, 0x70, 0x51, 0x57, 0x6E, 0x70, 0x52, 0x6C, 0x49, 0x70,
+0x53, 0x37, 0x50, 0x70, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x17, 0x32, 0x70, 0x56, 0x2C, 0x0D, 0x70,
+0x56, 0xF7, 0x14, 0x70, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD6, 0xF6, 0x70, 0x59, 0xF5, 0x0B, 0xF0,
+0x5A, 0xB6, 0xD8, 0x70, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9F, 0xF4, 0xF0, 0x5D, 0xB4, 0xCF, 0xF0,
+0x5E, 0x7F, 0xD6, 0xF0, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5F, 0xB8, 0xF0, 0x61, 0x7D, 0xCE, 0x70,
+0x62, 0x3F, 0x9A, 0xF0, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1F, 0x7C, 0xF0, 0x65, 0x3D, 0x92, 0x70,
+0x66, 0x08, 0x99, 0x70, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE8, 0x7B, 0x70, 0x68, 0xFD, 0x56, 0x70,
+0x69, 0xC8, 0x5D, 0x70, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA8, 0x3F, 0x70, 0x6C, 0xC6, 0x54, 0xF0,
+0x6D, 0x88, 0x21, 0x70, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x68, 0x03, 0x70, 0x70, 0x86, 0x18, 0xF0,
+0x71, 0x51, 0x1F, 0xF0, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x31, 0x01, 0xF0, 0x74, 0x45, 0xDC, 0xF0,
+0x75, 0x10, 0xE3, 0xF0, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xF0, 0xC5, 0xF0, 0x78, 0x0E, 0xDB, 0x70,
+0x78, 0xD0, 0xA7, 0xF0, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xB0, 0x89, 0xF0, 0x7B, 0xCE, 0x9F, 0x70,
+0x7C, 0x99, 0xA6, 0x70, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x79, 0x88, 0x70, 0x7F, 0x8E, 0x63, 0x70,
+0x02, 0x01, 0x02, 0x03, 0x01, 0x03, 0x05, 0x04, 0x05, 0x06, 0x05, 0x04, 0x07, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x0A, 0x0B, 0x08, 0x05, 0x04, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09,
+0x08, 0x00, 0x00, 0x23, 0x28, 0x00, 0x00, 0x00, 0x00, 0x31, 0x68, 0x01, 0x04, 0x00, 0x00, 0x23,
+0x58, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x78, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00,
+0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x46, 0x50, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00,
+0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x2A,
+0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x15, 0x4D, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54,
+0x00, 0x4D, 0x44, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45,
+0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+/* Zulu */
+0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, };
+
+timelib_tzdb timezonedb_builtin = { "2005.14", 535, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
diff --git a/ext/date/lib/timezonemap.h b/ext/date/lib/timezonemap.h
new file mode 100644
index 000000000..00a66d637
--- /dev/null
+++ b/ext/date/lib/timezonemap.h
@@ -0,0 +1,1631 @@
+ { "acst", 1, -14400, "America/Porto_Acre" },
+ { "acst", 1, -14400, "America/Eirunepe" },
+ { "acst", 1, -14400, "America/Rio_Branco" },
+ { "acst", 1, -14400, "Brazil/Acre" },
+ { "act", 0, -18000, "America/Porto_Acre" },
+ { "act", 0, -18000, "America/Eirunepe" },
+ { "act", 0, -18000, "America/Rio_Branco" },
+ { "act", 0, -18000, "Brazil/Acre" },
+ { "addt", 1, -7200, "America/Goose_Bay" },
+ { "addt", 1, -7200, "America/Pangnirtung" },
+ { "adt", 1, -10800, "America/Halifax" },
+ { "adt", 1, -10800, "America/Barbados" },
+ { "adt", 1, -10800, "America/Glace_Bay" },
+ { "adt", 1, -10800, "America/Goose_Bay" },
+ { "adt", 1, -10800, "America/Martinique" },
+ { "adt", 1, -10800, "America/Pangnirtung" },
+ { "adt", 1, -10800, "America/Thule" },
+ { "adt", 1, -10800, "Atlantic/Bermuda" },
+ { "adt", 1, -10800, "Canada/Atlantic" },
+ { "adt", 1, 14400, "Asia/Baghdad" },
+ { "aft", 0, 16200, "Asia/Kabul" },
+ { "ahdt", 1, -32400, "America/Anchorage" },
+ { "ahdt", 1, -32400, "US/Alaska" },
+ { "ahst", 0, -36000, "America/Anchorage" },
+ { "ahst", 0, -36000, "America/Adak" },
+ { "ahst", 0, -36000, "America/Atka" },
+ { "ahst", 0, -36000, "US/Alaska" },
+ { "ahst", 0, -36000, "US/Aleutian" },
+ { "akdt", 1, -28800, "America/Anchorage" },
+ { "akdt", 1, -28800, "America/Juneau" },
+ { "akdt", 1, -28800, "America/Nome" },
+ { "akdt", 1, -28800, "America/Yakutat" },
+ { "akdt", 1, -28800, "US/Alaska" },
+ { "akst", 0, -32400, "America/Anchorage" },
+ { "akst", 0, -32400, "America/Juneau" },
+ { "akst", 0, -32400, "America/Nome" },
+ { "akst", 0, -32400, "America/Yakutat" },
+ { "akst", 0, -32400, "US/Alaska" },
+ { "aktst", 1, 21600, "Asia/Aqtobe" },
+ { "aktt", 0, 14400, "Asia/Aqtobe" },
+ { "aktt", 0, 18000, "Asia/Aqtobe" },
+ { "aktt", 0, 21600, "Asia/Aqtobe" },
+ { "almst", 1, 25200, "Asia/Almaty" },
+ { "almt", 0, 18000, "Asia/Almaty" },
+ { "almt", 0, 21600, "Asia/Almaty" },
+ { "amst", 1, 14400, "Asia/Yerevan" },
+ { "amst", 1, 18000, "Asia/Yerevan" },
+ { "amst", 1, -10800, "America/Boa_Vista" },
+ { "amst", 1, -10800, "America/Campo_Grande" },
+ { "amst", 1, -10800, "America/Cuiaba" },
+ { "amst", 1, -10800, "America/Manaus" },
+ { "amst", 1, -10800, "America/Porto_Velho" },
+ { "amst", 1, -10800, "Brazil/West" },
+ { "amt", 0, 10800, "Asia/Yerevan" },
+ { "amt", 0, 14400, "Asia/Yerevan" },
+ { "amt", 0, -14400, "America/Boa_Vista" },
+ { "amt", 0, -14400, "America/Campo_Grande" },
+ { "amt", 0, -14400, "America/Cuiaba" },
+ { "amt", 0, -14400, "America/Manaus" },
+ { "amt", 0, -14400, "America/Porto_Velho" },
+ { "amt", 0, -14400, "Brazil/West" },
+ { "amt", 0, 1172, "Europe/Amsterdam" },
+ { "anast", 1, 43200, "Asia/Anadyr" },
+ { "anast", 1, 46800, "Asia/Anadyr" },
+ { "anast", 1, 50400, "Asia/Anadyr" },
+ { "anat", 0, 39600, "Asia/Anadyr" },
+ { "anat", 0, 43200, "Asia/Anadyr" },
+ { "anat", 0, 46800, "Asia/Anadyr" },
+ { "ant", 0, -16200, "America/Curacao" },
+ { "ant", 0, -16200, "America/Aruba" },
+ { "apt", 1, -10800, "America/Halifax" },
+ { "apt", 1, -10800, "America/Glace_Bay" },
+ { "apt", 1, -10800, "America/Pangnirtung" },
+ { "apt", 1, -10800, "Canada/Atlantic" },
+ { "aqtst", 1, 18000, "Asia/Aqtau" },
+ { "aqtst", 1, 21600, "Asia/Aqtau" },
+ { "aqtst", 1, 21600, "Asia/Aqtobe" },
+ { "aqtt", 0, 14400, "Asia/Aqtau" },
+ { "aqtt", 0, 18000, "Asia/Aqtau" },
+ { "aqtt", 0, 18000, "Asia/Aqtobe" },
+ { "arst", 1, -10800, "America/Buenos_Aires" },
+ { "arst", 1, -7200, "America/Buenos_Aires" },
+ { "arst", 1, -10800, "America/Argentina/Buenos_Aires" },
+ { "arst", 1, -10800, "America/Argentina/Catamarca" },
+ { "arst", 1, -10800, "America/Argentina/ComodRivadavia" },
+ { "arst", 1, -10800, "America/Argentina/Cordoba" },
+ { "arst", 1, -10800, "America/Argentina/Jujuy" },
+ { "arst", 1, -10800, "America/Argentina/La_Rioja" },
+ { "arst", 1, -10800, "America/Argentina/Mendoza" },
+ { "arst", 1, -10800, "America/Argentina/Rio_Gallegos" },
+ { "arst", 1, -10800, "America/Argentina/San_Juan" },
+ { "arst", 1, -10800, "America/Argentina/Tucuman" },
+ { "arst", 1, -10800, "America/Argentina/Ushuaia" },
+ { "arst", 1, -10800, "America/Catamarca" },
+ { "arst", 1, -10800, "America/Cordoba" },
+ { "arst", 1, -10800, "America/Jujuy" },
+ { "arst", 1, -10800, "America/Mendoza" },
+ { "arst", 1, -10800, "America/Rosario" },
+ { "arst", 1, -10800, "Antarctica/Palmer" },
+ { "arst", 1, -7200, "America/Argentina/Buenos_Aires" },
+ { "arst", 1, -7200, "America/Argentina/Catamarca" },
+ { "arst", 1, -7200, "America/Argentina/ComodRivadavia" },
+ { "arst", 1, -7200, "America/Argentina/Cordoba" },
+ { "arst", 1, -7200, "America/Argentina/Jujuy" },
+ { "arst", 1, -7200, "America/Argentina/La_Rioja" },
+ { "arst", 1, -7200, "America/Argentina/Mendoza" },
+ { "arst", 1, -7200, "America/Argentina/Rio_Gallegos" },
+ { "arst", 1, -7200, "America/Argentina/San_Juan" },
+ { "arst", 1, -7200, "America/Argentina/Tucuman" },
+ { "arst", 1, -7200, "America/Argentina/Ushuaia" },
+ { "arst", 1, -7200, "America/Catamarca" },
+ { "arst", 1, -7200, "America/Cordoba" },
+ { "arst", 1, -7200, "America/Jujuy" },
+ { "arst", 1, -7200, "America/Mendoza" },
+ { "arst", 1, -7200, "America/Rosario" },
+ { "arst", 1, -7200, "Antarctica/Palmer" },
+ { "art", 0, -10800, "America/Buenos_Aires" },
+ { "art", 0, -14400, "America/Buenos_Aires" },
+ { "art", 0, -10800, "America/Argentina/Buenos_Aires" },
+ { "art", 0, -10800, "America/Argentina/Catamarca" },
+ { "art", 0, -10800, "America/Argentina/ComodRivadavia" },
+ { "art", 0, -10800, "America/Argentina/Cordoba" },
+ { "art", 0, -10800, "America/Argentina/Jujuy" },
+ { "art", 0, -10800, "America/Argentina/La_Rioja" },
+ { "art", 0, -10800, "America/Argentina/Mendoza" },
+ { "art", 0, -10800, "America/Argentina/Rio_Gallegos" },
+ { "art", 0, -10800, "America/Argentina/San_Juan" },
+ { "art", 0, -10800, "America/Argentina/Tucuman" },
+ { "art", 0, -10800, "America/Argentina/Ushuaia" },
+ { "art", 0, -10800, "America/Catamarca" },
+ { "art", 0, -10800, "America/Cordoba" },
+ { "art", 0, -10800, "America/Jujuy" },
+ { "art", 0, -10800, "America/Mendoza" },
+ { "art", 0, -10800, "America/Rosario" },
+ { "art", 0, -10800, "Antarctica/Palmer" },
+ { "art", 0, -14400, "America/Argentina/Buenos_Aires" },
+ { "art", 0, -14400, "America/Argentina/Catamarca" },
+ { "art", 0, -14400, "America/Argentina/ComodRivadavia" },
+ { "art", 0, -14400, "America/Argentina/Cordoba" },
+ { "art", 0, -14400, "America/Argentina/Jujuy" },
+ { "art", 0, -14400, "America/Argentina/La_Rioja" },
+ { "art", 0, -14400, "America/Argentina/Mendoza" },
+ { "art", 0, -14400, "America/Argentina/Rio_Gallegos" },
+ { "art", 0, -14400, "America/Argentina/San_Juan" },
+ { "art", 0, -14400, "America/Argentina/Tucuman" },
+ { "art", 0, -14400, "America/Argentina/Ushuaia" },
+ { "art", 0, -14400, "America/Catamarca" },
+ { "art", 0, -14400, "America/Cordoba" },
+ { "art", 0, -14400, "America/Jujuy" },
+ { "art", 0, -14400, "America/Mendoza" },
+ { "art", 0, -14400, "America/Rosario" },
+ { "art", 0, -14400, "Antarctica/Palmer" },
+ { "ashst", 1, 18000, "Asia/Ashkhabad" },
+ { "ashst", 1, 21600, "Asia/Ashkhabad" },
+ { "ashst", 1, 18000, "Asia/Ashgabat" },
+ { "ashst", 1, 21600, "Asia/Ashgabat" },
+ { "asht", 0, 14400, "Asia/Ashkhabad" },
+ { "asht", 0, 18000, "Asia/Ashkhabad" },
+ { "asht", 0, 14400, "Asia/Ashgabat" },
+ { "asht", 0, 18000, "Asia/Ashgabat" },
+ { "ast", 0, 10800, "Asia/Riyadh" },
+ { "ast", 0, -14400, "America/Anguilla" },
+ { "ast", 0, -14400, "America/Antigua" },
+ { "ast", 0, -14400, "America/Aruba" },
+ { "ast", 0, -14400, "America/Barbados" },
+ { "ast", 0, -14400, "America/Curacao" },
+ { "ast", 0, -14400, "America/Dominica" },
+ { "ast", 0, -14400, "America/Glace_Bay" },
+ { "ast", 0, -14400, "America/Goose_Bay" },
+ { "ast", 0, -14400, "America/Grenada" },
+ { "ast", 0, -14400, "America/Guadeloupe" },
+ { "ast", 0, -14400, "America/Halifax" },
+ { "ast", 0, -14400, "America/Martinique" },
+ { "ast", 0, -14400, "America/Miquelon" },
+ { "ast", 0, -14400, "America/Montserrat" },
+ { "ast", 0, -14400, "America/Pangnirtung" },
+ { "ast", 0, -14400, "America/Port_of_Spain" },
+ { "ast", 0, -14400, "America/Puerto_Rico" },
+ { "ast", 0, -14400, "America/Santo_Domingo" },
+ { "ast", 0, -14400, "America/St_Kitts" },
+ { "ast", 0, -14400, "America/St_Lucia" },
+ { "ast", 0, -14400, "America/St_Thomas" },
+ { "ast", 0, -14400, "America/St_Vincent" },
+ { "ast", 0, -14400, "America/Thule" },
+ { "ast", 0, -14400, "America/Tortola" },
+ { "ast", 0, -14400, "America/Virgin" },
+ { "ast", 0, -14400, "Atlantic/Bermuda" },
+ { "ast", 0, -14400, "Canada/Atlantic" },
+ { "ast", 0, 10800, "Asia/Aden" },
+ { "ast", 0, 10800, "Asia/Baghdad" },
+ { "ast", 0, 10800, "Asia/Bahrain" },
+ { "ast", 0, 10800, "Asia/Kuwait" },
+ { "ast", 0, 10800, "Asia/Qatar" },
+ { "awt", 1, -10800, "America/Halifax" },
+ { "awt", 1, -10800, "America/Glace_Bay" },
+ { "awt", 1, -10800, "America/Pangnirtung" },
+ { "awt", 1, -10800, "America/Puerto_Rico" },
+ { "awt", 1, -10800, "Canada/Atlantic" },
+ { "azomt", 1, 0, "Atlantic/Azores" },
+ { "azost", 1, -3600, "Atlantic/Azores" },
+ { "azost", 1, 0, "Atlantic/Azores" },
+ { "azot", 0, -3600, "Atlantic/Azores" },
+ { "azot", 0, -7200, "Atlantic/Azores" },
+ { "azst", 1, 14400, "Asia/Baku" },
+ { "azst", 1, 18000, "Asia/Baku" },
+ { "azt", 0, 10800, "Asia/Baku" },
+ { "azt", 0, 14400, "Asia/Baku" },
+ { "bakst", 1, 14400, "Asia/Baku" },
+ { "bakst", 1, 18000, "Asia/Baku" },
+ { "bakt", 0, 10800, "Asia/Baku" },
+ { "bakt", 0, 14400, "Asia/Baku" },
+ { "bdst", 1, 7200, "Europe/London" },
+ { "bdst", 1, 7200, "Europe/Belfast" },
+ { "bdst", 1, 7200, "Europe/Gibraltar" },
+ { "bdst", 1, 7200, "GB" },
+ { "bdst", 1, 7200, "GB-Eire" },
+ { "bdt", 1, -36000, "America/Adak" },
+ { "bdt", 1, -36000, "America/Atka" },
+ { "bdt", 1, -36000, "America/Nome" },
+ { "bdt", 1, -36000, "US/Aleutian" },
+ { "bdt", 0, 21600, "Asia/Dacca" },
+ { "bdt", 0, 21600, "Asia/Dhaka" },
+ { "beat", 0, 9000, "Africa/Mogadishu" },
+ { "beat", 0, 9000, "Africa/Kampala" },
+ { "beat", 0, 9000, "Africa/Nairobi" },
+ { "beaut", 0, 9885, "Africa/Nairobi" },
+ { "beaut", 0, 9885, "Africa/Dar_es_Salaam" },
+ { "beaut", 0, 9885, "Africa/Kampala" },
+ { "bmt", 0, -14308, "America/Barbados" },
+ { "bmt", 0, -3996, "Africa/Banjul" },
+ { "bmt", 0, 6264, "Europe/Tiraspol" },
+ { "bmt", 0, 6264, "Europe/Chisinau" },
+ { "bnt", 0, 27000, "Asia/Brunei" },
+ { "bnt", 0, 28800, "Asia/Brunei" },
+ { "bortst", 1, 30000, "Asia/Kuching" },
+ { "bort", 0, 27000, "Asia/Kuching" },
+ { "bort", 0, 28800, "Asia/Kuching" },
+ { "bost", 1, -12756, "America/La_Paz" },
+ { "bot", 0, -14400, "America/La_Paz" },
+ { "brst", 1, -7200, "America/Sao_Paulo" },
+ { "brst", 1, -7200, "America/Araguaina" },
+ { "brst", 1, -7200, "America/Bahia" },
+ { "brst", 1, -7200, "America/Belem" },
+ { "brst", 1, -7200, "America/Fortaleza" },
+ { "brst", 1, -7200, "America/Maceio" },
+ { "brst", 1, -7200, "America/Recife" },
+ { "brst", 1, -7200, "Brazil/East" },
+ { "brt", 0, -10800, "America/Sao_Paulo" },
+ { "brt", 0, -10800, "America/Araguaina" },
+ { "brt", 0, -10800, "America/Bahia" },
+ { "brt", 0, -10800, "America/Belem" },
+ { "brt", 0, -10800, "America/Fortaleza" },
+ { "brt", 0, -10800, "America/Maceio" },
+ { "brt", 0, -10800, "America/Recife" },
+ { "brt", 0, -10800, "Brazil/East" },
+ { "bst", 0, 3600, "Europe/London" },
+ { "bst", 1, 3600, "Europe/London" },
+ { "bst", 0, -39600, "America/Adak" },
+ { "bst", 0, -39600, "America/Atka" },
+ { "bst", 0, -39600, "America/Nome" },
+ { "bst", 0, -39600, "Pacific/Midway" },
+ { "bst", 0, -39600, "Pacific/Pago_Pago" },
+ { "bst", 0, -39600, "Pacific/Samoa" },
+ { "bst", 0, -39600, "US/Aleutian" },
+ { "bst", 0, -39600, "US/Samoa" },
+ { "bst", 0, 3600, "Europe/Belfast" },
+ { "bst", 0, 3600, "GB" },
+ { "bst", 0, 3600, "GB-Eire" },
+ { "bst", 1, 3600, "Eire" },
+ { "bst", 1, 3600, "Europe/Belfast" },
+ { "bst", 1, 3600, "Europe/Dublin" },
+ { "bst", 1, 3600, "Europe/Gibraltar" },
+ { "bst", 1, 3600, "GB" },
+ { "bst", 1, 3600, "GB-Eire" },
+ { "btt", 0, 21600, "Asia/Thimbu" },
+ { "btt", 0, 21600, "Asia/Thimphu" },
+ { "burt", 0, 23400, "Asia/Calcutta" },
+ { "burt", 0, 23400, "Asia/Dacca" },
+ { "burt", 0, 23400, "Asia/Dhaka" },
+ { "burt", 0, 23400, "Asia/Rangoon" },
+ { "cant", 0, -3600, "Atlantic/Canary" },
+ { "cast", 0, 34200, "Australia/Adelaide" },
+ { "cast", 1, 10800, "Africa/Gaborone" },
+ { "cast", 1, 10800, "Africa/Khartoum" },
+ { "cat", 0, -36000, "America/Anchorage" },
+ { "cat", 0, -36000, "US/Alaska" },
+ { "cat", 0, 7200, "Africa/Khartoum" },
+ { "cat", 0, 7200, "Africa/Blantyre" },
+ { "cat", 0, 7200, "Africa/Gaborone" },
+ { "cat", 0, 7200, "Africa/Harare" },
+ { "cat", 0, 7200, "Africa/Kigali" },
+ { "cat", 0, 7200, "Africa/Lusaka" },
+ { "cat", 0, 7200, "Africa/Maputo" },
+ { "cat", 0, 7200, "Africa/Windhoek" },
+ { "cawt", 1, -32400, "America/Anchorage" },
+ { "cawt", 1, -32400, "US/Alaska" },
+ { "cddt", 1, -14400, "America/Rankin_Inlet" },
+ { "cdt", 1, -18000, "America/Chicago" },
+ { "cdt", 1, -14400, "America/Havana" },
+ { "cdt", 1, -14400, "Cuba" },
+ { "cdt", 1, -18000, "America/Belize" },
+ { "cdt", 1, -18000, "America/Cambridge_Bay" },
+ { "cdt", 1, -18000, "America/Cancun" },
+ { "cdt", 1, -18000, "America/Chihuahua" },
+ { "cdt", 1, -18000, "America/Costa_Rica" },
+ { "cdt", 1, -18000, "America/El_Salvador" },
+ { "cdt", 1, -18000, "America/Fort_Wayne" },
+ { "cdt", 1, -18000, "America/Guatemala" },
+ { "cdt", 1, -18000, "America/Indiana/Indianapolis" },
+ { "cdt", 1, -18000, "America/Indiana/Knox" },
+ { "cdt", 1, -18000, "America/Indiana/Marengo" },
+ { "cdt", 1, -18000, "America/Indiana/Vevay" },
+ { "cdt", 1, -18000, "America/Indianapolis" },
+ { "cdt", 1, -18000, "America/Iqaluit" },
+ { "cdt", 1, -18000, "America/Kentucky/Louisville" },
+ { "cdt", 1, -18000, "America/Kentucky/Monticello" },
+ { "cdt", 1, -18000, "America/Knox_IN" },
+ { "cdt", 1, -18000, "America/Louisville" },
+ { "cdt", 1, -18000, "America/Managua" },
+ { "cdt", 1, -18000, "America/Menominee" },
+ { "cdt", 1, -18000, "America/Merida" },
+ { "cdt", 1, -18000, "America/Mexico_City" },
+ { "cdt", 1, -18000, "America/Monterrey" },
+ { "cdt", 1, -18000, "America/North_Dakota/Center" },
+ { "cdt", 1, -18000, "America/Pangnirtung" },
+ { "cdt", 1, -18000, "America/Rainy_River" },
+ { "cdt", 1, -18000, "America/Rankin_Inlet" },
+ { "cdt", 1, -18000, "America/Tegucigalpa" },
+ { "cdt", 1, -18000, "America/Winnipeg" },
+ { "cdt", 1, -18000, "Canada/Central" },
+ { "cdt", 1, -18000, "CST6CDT" },
+ { "cdt", 1, -18000, "Mexico/General" },
+ { "cdt", 1, -18000, "US/Central" },
+ { "cdt", 1, -18000, "US/East-Indiana" },
+ { "cdt", 1, -18000, "US/Indiana-Starke" },
+ { "cdt", 1, 32400, "Asia/Shanghai" },
+ { "cdt", 1, 32400, "Asia/Chongqing" },
+ { "cdt", 1, 32400, "Asia/Chungking" },
+ { "cdt", 1, 32400, "Asia/Harbin" },
+ { "cdt", 1, 32400, "Asia/Kashgar" },
+ { "cdt", 1, 32400, "Asia/Taipei" },
+ { "cdt", 1, 32400, "Asia/Urumqi" },
+ { "cdt", 1, 32400, "PRC" },
+ { "cdt", 1, 32400, "ROC" },
+ { "cemt", 1, 10800, "Europe/Berlin" },
+ { "cemt", 1, 10800, "CET" },
+ { "cest", 1, 7200, "Europe/Berlin" },
+ { "cest", 1, 10800, "Europe/Kaliningrad" },
+ { "cest", 1, 7200, "Africa/Algiers" },
+ { "cest", 1, 7200, "Africa/Ceuta" },
+ { "cest", 1, 7200, "Africa/Tripoli" },
+ { "cest", 1, 7200, "Africa/Tunis" },
+ { "cest", 1, 7200, "Arctic/Longyearbyen" },
+ { "cest", 1, 7200, "Atlantic/Jan_Mayen" },
+ { "cest", 1, 7200, "CET" },
+ { "cest", 1, 7200, "Europe/Amsterdam" },
+ { "cest", 1, 7200, "Europe/Andorra" },
+ { "cest", 1, 7200, "Europe/Athens" },
+ { "cest", 1, 7200, "Europe/Belgrade" },
+ { "cest", 1, 7200, "Europe/Bratislava" },
+ { "cest", 1, 7200, "Europe/Brussels" },
+ { "cest", 1, 7200, "Europe/Budapest" },
+ { "cest", 1, 7200, "Europe/Chisinau" },
+ { "cest", 1, 7200, "Europe/Copenhagen" },
+ { "cest", 1, 7200, "Europe/Gibraltar" },
+ { "cest", 1, 7200, "Europe/Kaliningrad" },
+ { "cest", 1, 7200, "Europe/Kiev" },
+ { "cest", 1, 7200, "Europe/Lisbon" },
+ { "cest", 1, 7200, "Europe/Ljubljana" },
+ { "cest", 1, 7200, "Europe/Luxembourg" },
+ { "cest", 1, 7200, "Europe/Madrid" },
+ { "cest", 1, 7200, "Europe/Malta" },
+ { "cest", 1, 7200, "Europe/Minsk" },
+ { "cest", 1, 7200, "Europe/Monaco" },
+ { "cest", 1, 7200, "Europe/Oslo" },
+ { "cest", 1, 7200, "Europe/Paris" },
+ { "cest", 1, 7200, "Europe/Prague" },
+ { "cest", 1, 7200, "Europe/Riga" },
+ { "cest", 1, 7200, "Europe/Rome" },
+ { "cest", 1, 7200, "Europe/San_Marino" },
+ { "cest", 1, 7200, "Europe/Sarajevo" },
+ { "cest", 1, 7200, "Europe/Simferopol" },
+ { "cest", 1, 7200, "Europe/Skopje" },
+ { "cest", 1, 7200, "Europe/Sofia" },
+ { "cest", 1, 7200, "Europe/Stockholm" },
+ { "cest", 1, 7200, "Europe/Tallinn" },
+ { "cest", 1, 7200, "Europe/Tirane" },
+ { "cest", 1, 7200, "Europe/Tiraspol" },
+ { "cest", 1, 7200, "Europe/Uzhgorod" },
+ { "cest", 1, 7200, "Europe/Vaduz" },
+ { "cest", 1, 7200, "Europe/Vatican" },
+ { "cest", 1, 7200, "Europe/Vienna" },
+ { "cest", 1, 7200, "Europe/Vilnius" },
+ { "cest", 1, 7200, "Europe/Warsaw" },
+ { "cest", 1, 7200, "Europe/Zagreb" },
+ { "cest", 1, 7200, "Europe/Zaporozhye" },
+ { "cest", 1, 7200, "Europe/Zurich" },
+ { "cest", 1, 7200, "Libya" },
+ { "cest", 1, 7200, "Poland" },
+ { "cest", 1, 7200, "Portugal" },
+ { "cest", 1, 7200, "WET" },
+ { "cet", 0, 3600, "Europe/Berlin" },
+ { "cet", 0, 3600, "Africa/Algiers" },
+ { "cet", 0, 3600, "Africa/Casablanca" },
+ { "cet", 0, 3600, "Africa/Ceuta" },
+ { "cet", 0, 3600, "Africa/Tripoli" },
+ { "cet", 0, 3600, "Africa/Tunis" },
+ { "cet", 0, 3600, "Arctic/Longyearbyen" },
+ { "cet", 0, 3600, "Atlantic/Jan_Mayen" },
+ { "cet", 0, 3600, "CET" },
+ { "cet", 0, 3600, "Europe/Amsterdam" },
+ { "cet", 0, 3600, "Europe/Andorra" },
+ { "cet", 0, 3600, "Europe/Athens" },
+ { "cet", 0, 3600, "Europe/Belgrade" },
+ { "cet", 0, 3600, "Europe/Bratislava" },
+ { "cet", 0, 3600, "Europe/Brussels" },
+ { "cet", 0, 3600, "Europe/Budapest" },
+ { "cet", 0, 3600, "Europe/Chisinau" },
+ { "cet", 0, 3600, "Europe/Copenhagen" },
+ { "cet", 0, 3600, "Europe/Gibraltar" },
+ { "cet", 0, 3600, "Europe/Kaliningrad" },
+ { "cet", 0, 3600, "Europe/Kiev" },
+ { "cet", 0, 3600, "Europe/Lisbon" },
+ { "cet", 0, 3600, "Europe/Ljubljana" },
+ { "cet", 0, 3600, "Europe/Luxembourg" },
+ { "cet", 0, 3600, "Europe/Madrid" },
+ { "cet", 0, 3600, "Europe/Malta" },
+ { "cet", 0, 3600, "Europe/Minsk" },
+ { "cet", 0, 3600, "Europe/Monaco" },
+ { "cet", 0, 3600, "Europe/Oslo" },
+ { "cet", 0, 3600, "Europe/Paris" },
+ { "cet", 0, 3600, "Europe/Prague" },
+ { "cet", 0, 3600, "Europe/Riga" },
+ { "cet", 0, 3600, "Europe/Rome" },
+ { "cet", 0, 3600, "Europe/San_Marino" },
+ { "cet", 0, 3600, "Europe/Sarajevo" },
+ { "cet", 0, 3600, "Europe/Simferopol" },
+ { "cet", 0, 3600, "Europe/Skopje" },
+ { "cet", 0, 3600, "Europe/Sofia" },
+ { "cet", 0, 3600, "Europe/Stockholm" },
+ { "cet", 0, 3600, "Europe/Tallinn" },
+ { "cet", 0, 3600, "Europe/Tirane" },
+ { "cet", 0, 3600, "Europe/Tiraspol" },
+ { "cet", 0, 3600, "Europe/Uzhgorod" },
+ { "cet", 0, 3600, "Europe/Vaduz" },
+ { "cet", 0, 3600, "Europe/Vatican" },
+ { "cet", 0, 3600, "Europe/Vienna" },
+ { "cet", 0, 3600, "Europe/Vilnius" },
+ { "cet", 0, 3600, "Europe/Warsaw" },
+ { "cet", 0, 3600, "Europe/Zagreb" },
+ { "cet", 0, 3600, "Europe/Zaporozhye" },
+ { "cet", 0, 3600, "Europe/Zurich" },
+ { "cet", 0, 3600, "Libya" },
+ { "cet", 0, 3600, "Poland" },
+ { "cet", 0, 3600, "Portugal" },
+ { "cet", 0, 3600, "WET" },
+ { "cet", 0, 7200, "Europe/Kaliningrad" },
+ { "cgst", 1, -3600, "America/Scoresbysund" },
+ { "cgt", 0, -7200, "America/Scoresbysund" },
+ { "chadt", 1, 49500, "Pacific/Chatham" },
+ { "chadt", 1, 49500, "NZ-CHAT" },
+ { "chast", 0, 45900, "Pacific/Chatham" },
+ { "chast", 0, 45900, "NZ-CHAT" },
+ { "chat", 0, 30600, "Asia/Harbin" },
+ { "chat", 0, 32400, "Asia/Harbin" },
+ { "chdt", 1, -19800, "America/Belize" },
+ { "chost", 1, 36000, "Asia/Choibalsan" },
+ { "chot", 0, 32400, "Asia/Choibalsan" },
+ { "cit", 0, 28800, "Asia/Dili" },
+ { "cit", 0, 28800, "Asia/Makassar" },
+ { "cit", 0, 28800, "Asia/Pontianak" },
+ { "cit", 0, 28800, "Asia/Ujung_Pandang" },
+ { "cjt", 0, 32400, "Asia/Sakhalin" },
+ { "ckhst", 1, -34200, "Pacific/Rarotonga" },
+ { "ckt", 0, -36000, "Pacific/Rarotonga" },
+ { "clst", 1, -10800, "America/Santiago" },
+ { "clst", 1, -14400, "America/Santiago" },
+ { "clst", 1, -10800, "Antarctica/Palmer" },
+ { "clst", 1, -10800, "Chile/Continental" },
+ { "clst", 1, -14400, "Chile/Continental" },
+ { "clt", 0, -14400, "America/Santiago" },
+ { "clt", 0, -18000, "America/Santiago" },
+ { "clt", 0, -14400, "Antarctica/Palmer" },
+ { "clt", 0, -14400, "Chile/Continental" },
+ { "clt", 0, -18000, "Chile/Continental" },
+ { "cost", 1, -14400, "America/Bogota" },
+ { "cot", 0, -18000, "America/Bogota" },
+ { "cpt", 1, -18000, "America/Chicago" },
+ { "cpt", 1, -18000, "America/Fort_Wayne" },
+ { "cpt", 1, -18000, "America/Indiana/Indianapolis" },
+ { "cpt", 1, -18000, "America/Indiana/Knox" },
+ { "cpt", 1, -18000, "America/Indiana/Marengo" },
+ { "cpt", 1, -18000, "America/Indiana/Vevay" },
+ { "cpt", 1, -18000, "America/Indianapolis" },
+ { "cpt", 1, -18000, "America/Kentucky/Louisville" },
+ { "cpt", 1, -18000, "America/Kentucky/Monticello" },
+ { "cpt", 1, -18000, "America/Knox_IN" },
+ { "cpt", 1, -18000, "America/Louisville" },
+ { "cpt", 1, -18000, "America/Menominee" },
+ { "cpt", 1, -18000, "America/Rainy_River" },
+ { "cpt", 1, -18000, "America/Rankin_Inlet" },
+ { "cpt", 1, -18000, "America/Winnipeg" },
+ { "cpt", 1, -18000, "Canada/Central" },
+ { "cpt", 1, -18000, "CST6CDT" },
+ { "cpt", 1, -18000, "US/Central" },
+ { "cpt", 1, -18000, "US/East-Indiana" },
+ { "cpt", 1, -18000, "US/Indiana-Starke" },
+ { "cst", 0, -21600, "America/Chicago" },
+ { "cst", 0, -18000, "America/Havana" },
+ { "cst", 0, -18000, "Cuba" },
+ { "cst", 0, -21600, "America/Belize" },
+ { "cst", 0, -21600, "America/Cambridge_Bay" },
+ { "cst", 0, -21600, "America/Cancun" },
+ { "cst", 0, -21600, "America/Chihuahua" },
+ { "cst", 0, -21600, "America/Costa_Rica" },
+ { "cst", 0, -21600, "America/Detroit" },
+ { "cst", 0, -21600, "America/El_Salvador" },
+ { "cst", 0, -21600, "America/Fort_Wayne" },
+ { "cst", 0, -21600, "America/Guatemala" },
+ { "cst", 0, -21600, "America/Hermosillo" },
+ { "cst", 0, -21600, "America/Indiana/Indianapolis" },
+ { "cst", 0, -21600, "America/Indiana/Knox" },
+ { "cst", 0, -21600, "America/Indiana/Marengo" },
+ { "cst", 0, -21600, "America/Indiana/Vevay" },
+ { "cst", 0, -21600, "America/Indianapolis" },
+ { "cst", 0, -21600, "America/Iqaluit" },
+ { "cst", 0, -21600, "America/Kentucky/Louisville" },
+ { "cst", 0, -21600, "America/Kentucky/Monticello" },
+ { "cst", 0, -21600, "America/Knox_IN" },
+ { "cst", 0, -21600, "America/Louisville" },
+ { "cst", 0, -21600, "America/Managua" },
+ { "cst", 0, -21600, "America/Mazatlan" },
+ { "cst", 0, -21600, "America/Menominee" },
+ { "cst", 0, -21600, "America/Merida" },
+ { "cst", 0, -21600, "America/Mexico_City" },
+ { "cst", 0, -21600, "America/Monterrey" },
+ { "cst", 0, -21600, "America/North_Dakota/Center" },
+ { "cst", 0, -21600, "America/Pangnirtung" },
+ { "cst", 0, -21600, "America/Rainy_River" },
+ { "cst", 0, -21600, "America/Rankin_Inlet" },
+ { "cst", 0, -21600, "America/Regina" },
+ { "cst", 0, -21600, "America/Swift_Current" },
+ { "cst", 0, -21600, "America/Tegucigalpa" },
+ { "cst", 0, -21600, "America/Winnipeg" },
+ { "cst", 0, -21600, "Canada/Central" },
+ { "cst", 0, -21600, "Canada/East-Saskatchewan" },
+ { "cst", 0, -21600, "Canada/Saskatchewan" },
+ { "cst", 0, -21600, "CST6CDT" },
+ { "cst", 0, -21600, "Mexico/BajaSur" },
+ { "cst", 0, -21600, "Mexico/General" },
+ { "cst", 0, -21600, "US/Central" },
+ { "cst", 0, -21600, "US/East-Indiana" },
+ { "cst", 0, -21600, "US/Indiana-Starke" },
+ { "cst", 0, -21600, "US/Michigan" },
+ { "cst", 0, 28800, "Asia/Chongqing" },
+ { "cst", 0, 28800, "Asia/Chungking" },
+ { "cst", 0, 28800, "Asia/Harbin" },
+ { "cst", 0, 28800, "Asia/Kashgar" },
+ { "cst", 0, 28800, "Asia/Macao" },
+ { "cst", 0, 28800, "Asia/Macau" },
+ { "cst", 0, 28800, "Asia/Shanghai" },
+ { "cst", 0, 28800, "Asia/Taipei" },
+ { "cst", 0, 28800, "Asia/Urumqi" },
+ { "cst", 0, 28800, "PRC" },
+ { "cst", 0, 28800, "ROC" },
+ { "cst", 0, 34200, "Asia/Jayapura" },
+ { "cst", 0, 34200, "Australia/Adelaide" },
+ { "cst", 0, 34200, "Australia/Broken_Hill" },
+ { "cst", 0, 34200, "Australia/Darwin" },
+ { "cst", 0, 34200, "Australia/North" },
+ { "cst", 0, 34200, "Australia/South" },
+ { "cst", 0, 34200, "Australia/Yancowinna" },
+ { "cst", 1, 37800, "Australia/Adelaide" },
+ { "cst", 1, 37800, "Australia/Broken_Hill" },
+ { "cst", 1, 37800, "Australia/Darwin" },
+ { "cst", 1, 37800, "Australia/North" },
+ { "cst", 1, 37800, "Australia/South" },
+ { "cst", 1, 37800, "Australia/Yancowinna" },
+ { "cvst", 1, -3600, "Atlantic/Cape_Verde" },
+ { "cvt", 0, -3600, "Atlantic/Cape_Verde" },
+ { "cvt", 0, -7200, "Atlantic/Cape_Verde" },
+ { "cwt", 1, -18000, "America/Chicago" },
+ { "cwt", 1, -18000, "America/Fort_Wayne" },
+ { "cwt", 1, -18000, "America/Indiana/Indianapolis" },
+ { "cwt", 1, -18000, "America/Indiana/Knox" },
+ { "cwt", 1, -18000, "America/Indiana/Marengo" },
+ { "cwt", 1, -18000, "America/Indiana/Vevay" },
+ { "cwt", 1, -18000, "America/Indianapolis" },
+ { "cwt", 1, -18000, "America/Kentucky/Louisville" },
+ { "cwt", 1, -18000, "America/Kentucky/Monticello" },
+ { "cwt", 1, -18000, "America/Knox_IN" },
+ { "cwt", 1, -18000, "America/Louisville" },
+ { "cwt", 1, -18000, "America/Menominee" },
+ { "cwt", 1, -18000, "America/Mexico_City" },
+ { "cwt", 1, -18000, "America/Rainy_River" },
+ { "cwt", 1, -18000, "America/Rankin_Inlet" },
+ { "cwt", 1, -18000, "America/Winnipeg" },
+ { "cwt", 1, -18000, "Canada/Central" },
+ { "cwt", 1, -18000, "CST6CDT" },
+ { "cwt", 1, -18000, "Mexico/General" },
+ { "cwt", 1, -18000, "US/Central" },
+ { "cwt", 1, -18000, "US/East-Indiana" },
+ { "cwt", 1, -18000, "US/Indiana-Starke" },
+ { "chst", 0, 36000, "Pacific/Guam" },
+ { "chst", 0, 36000, "Pacific/Saipan" },
+ { "dact", 0, 21600, "Asia/Dacca" },
+ { "dact", 0, 21600, "Asia/Dhaka" },
+ { "davt", 0, 25200, "Antarctica/Davis" },
+ { "ddut", 0, 36000, "Antarctica/DumontDUrville" },
+ { "dusst", 1, 21600, "Asia/Dushanbe" },
+ { "dusst", 1, 25200, "Asia/Dushanbe" },
+ { "dust", 0, 18000, "Asia/Dushanbe" },
+ { "dust", 0, 21600, "Asia/Dushanbe" },
+ { "easst", 1, -18000, "Chile/EasterIsland" },
+ { "easst", 1, -21600, "Chile/EasterIsland" },
+ { "easst", 1, -18000, "Pacific/Easter" },
+ { "easst", 1, -21600, "Pacific/Easter" },
+ { "east", 0, -21600, "Chile/EasterIsland" },
+ { "east", 0, -25200, "Chile/EasterIsland" },
+ { "east", 0, -21600, "Pacific/Easter" },
+ { "east", 0, -25200, "Pacific/Easter" },
+ { "east", 1, 14400, "Indian/Antananarivo" },
+ { "eat", 0, 10800, "Africa/Khartoum" },
+ { "eat", 0, 10800, "Africa/Addis_Ababa" },
+ { "eat", 0, 10800, "Africa/Asmera" },
+ { "eat", 0, 10800, "Africa/Dar_es_Salaam" },
+ { "eat", 0, 10800, "Africa/Djibouti" },
+ { "eat", 0, 10800, "Africa/Kampala" },
+ { "eat", 0, 10800, "Africa/Mogadishu" },
+ { "eat", 0, 10800, "Africa/Nairobi" },
+ { "eat", 0, 10800, "Indian/Antananarivo" },
+ { "eat", 0, 10800, "Indian/Comoro" },
+ { "eat", 0, 10800, "Indian/Mayotte" },
+ { "ect", 0, -18000, "America/Guayaquil" },
+ { "ect", 0, -18000, "Pacific/Galapagos" },
+ { "eddt", 1, -10800, "America/Iqaluit" },
+ { "edt", 1, -14400, "America/New_York" },
+ { "edt", 1, -14400, "America/Cancun" },
+ { "edt", 1, -14400, "America/Coral_Harbour" },
+ { "edt", 1, -14400, "America/Detroit" },
+ { "edt", 1, -14400, "America/Fort_Wayne" },
+ { "edt", 1, -14400, "America/Grand_Turk" },
+ { "edt", 1, -14400, "America/Indiana/Indianapolis" },
+ { "edt", 1, -14400, "America/Indiana/Knox" },
+ { "edt", 1, -14400, "America/Indiana/Marengo" },
+ { "edt", 1, -14400, "America/Indiana/Vevay" },
+ { "edt", 1, -14400, "America/Indianapolis" },
+ { "edt", 1, -14400, "America/Iqaluit" },
+ { "edt", 1, -14400, "America/Jamaica" },
+ { "edt", 1, -14400, "America/Kentucky/Louisville" },
+ { "edt", 1, -14400, "America/Kentucky/Monticello" },
+ { "edt", 1, -14400, "America/Knox_IN" },
+ { "edt", 1, -14400, "America/Louisville" },
+ { "edt", 1, -14400, "America/Montreal" },
+ { "edt", 1, -14400, "America/Nassau" },
+ { "edt", 1, -14400, "America/Nipigon" },
+ { "edt", 1, -14400, "America/Pangnirtung" },
+ { "edt", 1, -14400, "America/Port-au-Prince" },
+ { "edt", 1, -14400, "America/Santo_Domingo" },
+ { "edt", 1, -14400, "America/Thunder_Bay" },
+ { "edt", 1, -14400, "America/Toronto" },
+ { "edt", 1, -14400, "Canada/Eastern" },
+ { "edt", 1, -14400, "EST" },
+ { "edt", 1, -14400, "EST5EDT" },
+ { "edt", 1, -14400, "Jamaica" },
+ { "edt", 1, -14400, "US/East-Indiana" },
+ { "edt", 1, -14400, "US/Eastern" },
+ { "edt", 1, -14400, "US/Indiana-Starke" },
+ { "edt", 1, -14400, "US/Michigan" },
+ { "eest", 1, 10800, "Europe/Helsinki" },
+ { "eest", 1, 10800, "Africa/Cairo" },
+ { "eest", 1, 10800, "Asia/Amman" },
+ { "eest", 1, 10800, "Asia/Beirut" },
+ { "eest", 1, 10800, "Asia/Damascus" },
+ { "eest", 1, 10800, "Asia/Gaza" },
+ { "eest", 1, 10800, "Asia/Istanbul" },
+ { "eest", 1, 10800, "Asia/Nicosia" },
+ { "eest", 1, 10800, "EET" },
+ { "eest", 1, 10800, "Egypt" },
+ { "eest", 1, 10800, "Europe/Athens" },
+ { "eest", 1, 10800, "Europe/Bucharest" },
+ { "eest", 1, 10800, "Europe/Chisinau" },
+ { "eest", 1, 10800, "Europe/Istanbul" },
+ { "eest", 1, 10800, "Europe/Kaliningrad" },
+ { "eest", 1, 10800, "Europe/Kiev" },
+ { "eest", 1, 10800, "Europe/Mariehamn" },
+ { "eest", 1, 10800, "Europe/Minsk" },
+ { "eest", 1, 10800, "Europe/Moscow" },
+ { "eest", 1, 10800, "Europe/Nicosia" },
+ { "eest", 1, 10800, "Europe/Riga" },
+ { "eest", 1, 10800, "Europe/Simferopol" },
+ { "eest", 1, 10800, "Europe/Sofia" },
+ { "eest", 1, 10800, "Europe/Tallinn" },
+ { "eest", 1, 10800, "Europe/Tiraspol" },
+ { "eest", 1, 10800, "Europe/Uzhgorod" },
+ { "eest", 1, 10800, "Europe/Vilnius" },
+ { "eest", 1, 10800, "Europe/Warsaw" },
+ { "eest", 1, 10800, "Europe/Zaporozhye" },
+ { "eest", 1, 10800, "Poland" },
+ { "eest", 1, 10800, "Turkey" },
+ { "eest", 1, 10800, "W-SU" },
+ { "eet", 0, 7200, "Europe/Helsinki" },
+ { "eet", 1, 10800, "Asia/Gaza" },
+ { "eet", 0, 7200, "Africa/Cairo" },
+ { "eet", 0, 7200, "Africa/Tripoli" },
+ { "eet", 0, 7200, "Asia/Amman" },
+ { "eet", 0, 7200, "Asia/Beirut" },
+ { "eet", 0, 7200, "Asia/Damascus" },
+ { "eet", 0, 7200, "Asia/Gaza" },
+ { "eet", 0, 7200, "Asia/Istanbul" },
+ { "eet", 0, 7200, "Asia/Nicosia" },
+ { "eet", 0, 7200, "EET" },
+ { "eet", 0, 7200, "Egypt" },
+ { "eet", 0, 7200, "Europe/Athens" },
+ { "eet", 0, 7200, "Europe/Bucharest" },
+ { "eet", 0, 7200, "Europe/Chisinau" },
+ { "eet", 0, 7200, "Europe/Istanbul" },
+ { "eet", 0, 7200, "Europe/Kaliningrad" },
+ { "eet", 0, 7200, "Europe/Kiev" },
+ { "eet", 0, 7200, "Europe/Mariehamn" },
+ { "eet", 0, 7200, "Europe/Minsk" },
+ { "eet", 0, 7200, "Europe/Moscow" },
+ { "eet", 0, 7200, "Europe/Nicosia" },
+ { "eet", 0, 7200, "Europe/Riga" },
+ { "eet", 0, 7200, "Europe/Simferopol" },
+ { "eet", 0, 7200, "Europe/Sofia" },
+ { "eet", 0, 7200, "Europe/Tallinn" },
+ { "eet", 0, 7200, "Europe/Tiraspol" },
+ { "eet", 0, 7200, "Europe/Uzhgorod" },
+ { "eet", 0, 7200, "Europe/Vilnius" },
+ { "eet", 0, 7200, "Europe/Warsaw" },
+ { "eet", 0, 7200, "Europe/Zaporozhye" },
+ { "eet", 0, 7200, "Libya" },
+ { "eet", 0, 7200, "Poland" },
+ { "eet", 0, 7200, "Turkey" },
+ { "eet", 0, 7200, "W-SU" },
+ { "egst", 1, 0, "America/Scoresbysund" },
+ { "egt", 0, -3600, "America/Scoresbysund" },
+ { "ehdt", 1, -16200, "America/Santo_Domingo" },
+ { "eit", 0, 32400, "Asia/Jayapura" },
+ { "ept", 1, -14400, "America/New_York" },
+ { "ept", 1, -14400, "America/Coral_Harbour" },
+ { "ept", 1, -14400, "America/Detroit" },
+ { "ept", 1, -14400, "America/Iqaluit" },
+ { "ept", 1, -14400, "America/Montreal" },
+ { "ept", 1, -14400, "America/Nipigon" },
+ { "ept", 1, -14400, "America/Thunder_Bay" },
+ { "ept", 1, -14400, "America/Toronto" },
+ { "ept", 1, -14400, "Canada/Eastern" },
+ { "ept", 1, -14400, "EST" },
+ { "ept", 1, -14400, "EST5EDT" },
+ { "ept", 1, -14400, "US/Eastern" },
+ { "ept", 1, -14400, "US/Michigan" },
+ { "est", 0, -18000, "America/New_York" },
+ { "est", 0, -18000, "America/Antigua" },
+ { "est", 0, -18000, "America/Cambridge_Bay" },
+ { "est", 0, -18000, "America/Cancun" },
+ { "est", 0, -18000, "America/Cayman" },
+ { "est", 0, -18000, "America/Chicago" },
+ { "est", 0, -18000, "America/Coral_Harbour" },
+ { "est", 0, -18000, "America/Detroit" },
+ { "est", 0, -18000, "America/Fort_Wayne" },
+ { "est", 0, -18000, "America/Grand_Turk" },
+ { "est", 0, -18000, "America/Indiana/Indianapolis" },
+ { "est", 0, -18000, "America/Indiana/Knox" },
+ { "est", 0, -18000, "America/Indiana/Marengo" },
+ { "est", 0, -18000, "America/Indiana/Vevay" },
+ { "est", 0, -18000, "America/Indianapolis" },
+ { "est", 0, -18000, "America/Iqaluit" },
+ { "est", 0, -18000, "America/Jamaica" },
+ { "est", 0, -18000, "America/Kentucky/Louisville" },
+ { "est", 0, -18000, "America/Kentucky/Monticello" },
+ { "est", 0, -18000, "America/Knox_IN" },
+ { "est", 0, -18000, "America/Louisville" },
+ { "est", 0, -18000, "America/Managua" },
+ { "est", 0, -18000, "America/Menominee" },
+ { "est", 0, -18000, "America/Merida" },
+ { "est", 0, -18000, "America/Montreal" },
+ { "est", 0, -18000, "America/Nassau" },
+ { "est", 0, -18000, "America/Nipigon" },
+ { "est", 0, -18000, "America/Panama" },
+ { "est", 0, -18000, "America/Pangnirtung" },
+ { "est", 0, -18000, "America/Port-au-Prince" },
+ { "est", 0, -18000, "America/Rankin_Inlet" },
+ { "est", 0, -18000, "America/Santo_Domingo" },
+ { "est", 0, -18000, "America/Thunder_Bay" },
+ { "est", 0, -18000, "America/Toronto" },
+ { "est", 0, -18000, "Canada/Eastern" },
+ { "est", 0, -18000, "CST6CDT" },
+ { "est", 0, -18000, "EST" },
+ { "est", 0, -18000, "EST5EDT" },
+ { "est", 0, -18000, "Jamaica" },
+ { "est", 0, -18000, "US/Central" },
+ { "est", 0, -18000, "US/East-Indiana" },
+ { "est", 0, -18000, "US/Eastern" },
+ { "est", 0, -18000, "US/Indiana-Starke" },
+ { "est", 0, -18000, "US/Michigan" },
+ { "est", 0, 36000, "Australia/ACT" },
+ { "est", 0, 36000, "Australia/Brisbane" },
+ { "est", 0, 36000, "Australia/Canberra" },
+ { "est", 0, 36000, "Australia/Currie" },
+ { "est", 0, 36000, "Australia/Hobart" },
+ { "est", 0, 36000, "Australia/Lindeman" },
+ { "est", 0, 36000, "Australia/Melbourne" },
+ { "est", 0, 36000, "Australia/NSW" },
+ { "est", 0, 36000, "Australia/Queensland" },
+ { "est", 0, 36000, "Australia/Sydney" },
+ { "est", 0, 36000, "Australia/Tasmania" },
+ { "est", 0, 36000, "Australia/Victoria" },
+ { "est", 1, 39600, "Australia/Melbourne" },
+ { "est", 1, 39600, "Australia/ACT" },
+ { "est", 1, 39600, "Australia/Brisbane" },
+ { "est", 1, 39600, "Australia/Canberra" },
+ { "est", 1, 39600, "Australia/Currie" },
+ { "est", 1, 39600, "Australia/Hobart" },
+ { "est", 1, 39600, "Australia/Lindeman" },
+ { "est", 1, 39600, "Australia/NSW" },
+ { "est", 1, 39600, "Australia/Queensland" },
+ { "est", 1, 39600, "Australia/Sydney" },
+ { "est", 1, 39600, "Australia/Tasmania" },
+ { "est", 1, 39600, "Australia/Victoria" },
+ { "ewt", 1, -14400, "America/New_York" },
+ { "ewt", 1, -14400, "America/Coral_Harbour" },
+ { "ewt", 1, -14400, "America/Detroit" },
+ { "ewt", 1, -14400, "America/Iqaluit" },
+ { "ewt", 1, -14400, "America/Montreal" },
+ { "ewt", 1, -14400, "America/Nipigon" },
+ { "ewt", 1, -14400, "America/Thunder_Bay" },
+ { "ewt", 1, -14400, "America/Toronto" },
+ { "ewt", 1, -14400, "Canada/Eastern" },
+ { "ewt", 1, -14400, "EST" },
+ { "ewt", 1, -14400, "EST5EDT" },
+ { "ewt", 1, -14400, "US/Eastern" },
+ { "ewt", 1, -14400, "US/Michigan" },
+ { "fjst", 1, 46800, "Pacific/Fiji" },
+ { "fjt", 0, 43200, "Pacific/Fiji" },
+ { "fkst", 1, -10800, "Atlantic/Stanley" },
+ { "fkst", 1, -7200, "Atlantic/Stanley" },
+ { "fkt", 0, -10800, "Atlantic/Stanley" },
+ { "fkt", 0, -14400, "Atlantic/Stanley" },
+ { "fnst", 1, -3600, "America/Noronha" },
+ { "fnst", 1, -3600, "Brazil/DeNoronha" },
+ { "fnt", 0, -7200, "America/Noronha" },
+ { "fnt", 0, -7200, "Brazil/DeNoronha" },
+ { "fort", 0, 14400, "Asia/Aqtau" },
+ { "fort", 0, 18000, "Asia/Aqtau" },
+ { "frust", 1, 21600, "Asia/Bishkek" },
+ { "frust", 1, 25200, "Asia/Bishkek" },
+ { "frut", 0, 18000, "Asia/Bishkek" },
+ { "frut", 0, 21600, "Asia/Bishkek" },
+ { "galt", 0, -21600, "Pacific/Galapagos" },
+ { "gamt", 0, -32400, "Pacific/Gambier" },
+ { "gbgt", 0, -13500, "America/Guyana" },
+ { "gest", 1, 14400, "Asia/Tbilisi" },
+ { "gest", 1, 18000, "Asia/Tbilisi" },
+ { "get", 0, 10800, "Asia/Tbilisi" },
+ { "get", 0, 14400, "Asia/Tbilisi" },
+ { "gft", 0, -10800, "America/Cayenne" },
+ { "gft", 0, -14400, "America/Cayenne" },
+ { "ghst", 1, 1200, "Africa/Accra" },
+ { "gmt", 0, 0, "Africa/Abidjan" },
+ { "gmt", 0, 0, "Africa/Accra" },
+ { "gmt", 0, 0, "Africa/Bamako" },
+ { "gmt", 0, 0, "Africa/Banjul" },
+ { "gmt", 0, 0, "Africa/Bissau" },
+ { "gmt", 0, 0, "Africa/Conakry" },
+ { "gmt", 0, 0, "Africa/Dakar" },
+ { "gmt", 0, 0, "Africa/Freetown" },
+ { "gmt", 0, 0, "Africa/Malabo" },
+ { "gmt", 0, 0, "Africa/Monrovia" },
+ { "gmt", 0, 0, "Africa/Niamey" },
+ { "gmt", 0, 0, "Africa/Nouakchott" },
+ { "gmt", 0, 0, "Africa/Ouagadougou" },
+ { "gmt", 0, 0, "Africa/Porto-Novo" },
+ { "gmt", 0, 0, "Africa/Sao_Tome" },
+ { "gmt", 0, 0, "Africa/Timbuktu" },
+ { "gmt", 0, 0, "America/Danmarkshavn" },
+ { "gmt", 0, 0, "Atlantic/Reykjavik" },
+ { "gmt", 0, 0, "Atlantic/St_Helena" },
+ { "gmt", 0, 0, "Eire" },
+ { "gmt", 0, 0, "Europe/Belfast" },
+ { "gmt", 0, 0, "Europe/Dublin" },
+ { "gmt", 0, 0, "Europe/Gibraltar" },
+ { "gmt", 0, 0, "Europe/London" },
+ { "gmt", 0, 0, "GB" },
+ { "gmt", 0, 0, "GB-Eire" },
+ { "gmt", 0, 0, "GMT" },
+ { "gmt", 0, 0, "Iceland" },
+ { "gst", 0, 14400, "Asia/Dubai" },
+ { "gst", 0, 14400, "Asia/Bahrain" },
+ { "gst", 0, 14400, "Asia/Muscat" },
+ { "gst", 0, 14400, "Asia/Qatar" },
+ { "gyt", 0, -10800, "America/Guyana" },
+ { "gyt", 0, -13500, "America/Guyana" },
+ { "gyt", 0, -14400, "America/Guyana" },
+ { "hadt", 1, -32400, "America/Adak" },
+ { "hadt", 1, -32400, "America/Atka" },
+ { "hadt", 1, -32400, "US/Aleutian" },
+ { "hast", 0, -36000, "America/Adak" },
+ { "hast", 0, -36000, "America/Atka" },
+ { "hast", 0, -36000, "US/Aleutian" },
+ { "hdt", 1, -34200, "Pacific/Honolulu" },
+ { "hdt", 1, -34200, "HST" },
+ { "hdt", 1, -34200, "US/Hawaii" },
+ { "hkst", 1, 32400, "Asia/Hong_Kong" },
+ { "hkst", 1, 32400, "Hongkong" },
+ { "hkt", 0, 28800, "Asia/Hong_Kong" },
+ { "hkt", 0, 28800, "Hongkong" },
+ { "hovst", 1, 28800, "Asia/Hovd" },
+ { "hovt", 0, 21600, "Asia/Hovd" },
+ { "hovt", 0, 25200, "Asia/Hovd" },
+ { "hpt", 1, -34200, "Pacific/Honolulu" },
+ { "hpt", 1, -34200, "HST" },
+ { "hpt", 1, -34200, "US/Hawaii" },
+ { "hst", 0, -36000, "Pacific/Honolulu" },
+ { "hst", 0, -37800, "Pacific/Honolulu" },
+ { "hst", 0, -36000, "HST" },
+ { "hst", 0, -36000, "US/Hawaii" },
+ { "hst", 0, -37800, "HST" },
+ { "hst", 0, -37800, "US/Hawaii" },
+ { "hwt", 1, -34200, "Pacific/Honolulu" },
+ { "hwt", 1, -34200, "HST" },
+ { "hwt", 1, -34200, "US/Hawaii" },
+ { "ict", 0, 25200, "Asia/Bangkok" },
+ { "ict", 0, 25200, "Asia/Phnom_Penh" },
+ { "ict", 0, 25200, "Asia/Saigon" },
+ { "ict", 0, 25200, "Asia/Vientiane" },
+ { "ict", 0, 28800, "Asia/Phnom_Penh" },
+ { "ict", 0, 28800, "Asia/Saigon" },
+ { "ict", 0, 28800, "Asia/Vientiane" },
+ { "iddt", 1, 14400, "Asia/Jerusalem" },
+ { "iddt", 1, 14400, "Asia/Tel_Aviv" },
+ { "iddt", 1, 14400, "Israel" },
+ { "idt", 1, 10800, "Asia/Jerusalem" },
+ { "idt", 1, 10800, "Asia/Gaza" },
+ { "idt", 1, 10800, "Asia/Tel_Aviv" },
+ { "idt", 1, 10800, "Israel" },
+ { "ihst", 1, 21600, "Asia/Colombo" },
+ { "iot", 0, 18000, "Indian/Chagos" },
+ { "iot", 0, 21600, "Indian/Chagos" },
+ { "irdt", 1, 16200, "Asia/Tehran" },
+ { "irdt", 1, 18000, "Asia/Tehran" },
+ { "irdt", 1, 16200, "Iran" },
+ { "irdt", 1, 18000, "Iran" },
+ { "irkst", 1, 28800, "Asia/Irkutsk" },
+ { "irkst", 1, 32400, "Asia/Irkutsk" },
+ { "irkt", 0, 25200, "Asia/Irkutsk" },
+ { "irkt", 0, 28800, "Asia/Irkutsk" },
+ { "irst", 0, 12600, "Asia/Tehran" },
+ { "irst", 0, 14400, "Asia/Tehran" },
+ { "irst", 0, 12600, "Iran" },
+ { "irst", 0, 14400, "Iran" },
+ { "isst", 1, 0, "Atlantic/Reykjavik" },
+ { "isst", 1, 0, "Iceland" },
+ { "ist", 0, 7200, "Asia/Jerusalem" },
+ { "ist", 0, -3600, "Atlantic/Reykjavik" },
+ { "ist", 0, -3600, "Iceland" },
+ { "ist", 0, 19800, "Asia/Calcutta" },
+ { "ist", 0, 19800, "Asia/Colombo" },
+ { "ist", 0, 19800, "Asia/Dacca" },
+ { "ist", 0, 19800, "Asia/Dhaka" },
+ { "ist", 0, 19800, "Asia/Karachi" },
+ { "ist", 0, 19800, "Asia/Katmandu" },
+ { "ist", 0, 19800, "Asia/Thimbu" },
+ { "ist", 0, 19800, "Asia/Thimphu" },
+ { "ist", 1, 2079, "Eire" },
+ { "ist", 1, 2079, "Europe/Dublin" },
+ { "ist", 1, 23400, "Asia/Calcutta" },
+ { "ist", 1, 23400, "Asia/Colombo" },
+ { "ist", 1, 23400, "Asia/Karachi" },
+ { "ist", 0, 3600, "Eire" },
+ { "ist", 0, 3600, "Europe/Dublin" },
+ { "ist", 1, 3600, "Eire" },
+ { "ist", 1, 3600, "Europe/Dublin" },
+ { "ist", 0, 7200, "Asia/Gaza" },
+ { "ist", 0, 7200, "Asia/Tel_Aviv" },
+ { "ist", 0, 7200, "Israel" },
+ { "javt", 0, 26400, "Asia/Jakarta" },
+ { "jdt", 1, 36000, "Asia/Tokyo" },
+ { "jdt", 1, 36000, "Japan" },
+ { "jst", 0, 32400, "Asia/Tokyo" },
+ { "jst", 0, 32400, "Asia/Dili" },
+ { "jst", 0, 32400, "Asia/Jakarta" },
+ { "jst", 0, 32400, "Asia/Kuala_Lumpur" },
+ { "jst", 0, 32400, "Asia/Kuching" },
+ { "jst", 0, 32400, "Asia/Makassar" },
+ { "jst", 0, 32400, "Asia/Manila" },
+ { "jst", 0, 32400, "Asia/Pontianak" },
+ { "jst", 0, 32400, "Asia/Rangoon" },
+ { "jst", 0, 32400, "Asia/Sakhalin" },
+ { "jst", 0, 32400, "Asia/Singapore" },
+ { "jst", 0, 32400, "Asia/Ujung_Pandang" },
+ { "jst", 0, 32400, "Japan" },
+ { "jst", 0, 32400, "Pacific/Nauru" },
+ { "jst", 0, 32400, "Singapore" },
+ { "kart", 0, 18000, "Asia/Karachi" },
+ { "kast", 0, 18000, "Asia/Kashgar" },
+ { "kast", 0, 19800, "Asia/Kashgar" },
+ { "kdt", 1, 32400, "Asia/Seoul" },
+ { "kdt", 1, 36000, "Asia/Seoul" },
+ { "kdt", 1, 32400, "ROK" },
+ { "kdt", 1, 36000, "ROK" },
+ { "kgst", 1, 21600, "Asia/Bishkek" },
+ { "kgt", 0, 18000, "Asia/Bishkek" },
+ { "kgt", 0, 21600, "Asia/Bishkek" },
+ { "kizst", 1, 21600, "Asia/Qyzylorda" },
+ { "kizt", 0, 14400, "Asia/Qyzylorda" },
+ { "kizt", 0, 18000, "Asia/Qyzylorda" },
+ { "kizt", 0, 21600, "Asia/Qyzylorda" },
+ { "kmt", 0, 5736, "Europe/Vilnius" },
+ { "kost", 0, 39600, "Pacific/Kosrae" },
+ { "kost", 0, 43200, "Pacific/Kosrae" },
+ { "krast", 1, 25200, "Asia/Krasnoyarsk" },
+ { "krast", 1, 28800, "Asia/Krasnoyarsk" },
+ { "krat", 0, 21600, "Asia/Krasnoyarsk" },
+ { "krat", 0, 25200, "Asia/Krasnoyarsk" },
+ { "kst", 0, 28800, "Asia/Seoul" },
+ { "kst", 0, 30600, "Asia/Seoul" },
+ { "kst", 0, 32400, "Asia/Seoul" },
+ { "kst", 0, 28800, "Asia/Pyongyang" },
+ { "kst", 0, 28800, "ROK" },
+ { "kst", 0, 30600, "Asia/Pyongyang" },
+ { "kst", 0, 30600, "ROK" },
+ { "kst", 0, 32400, "Asia/Pyongyang" },
+ { "kst", 0, 32400, "ROK" },
+ { "kuyst", 1, 10800, "Europe/Samara" },
+ { "kuyst", 1, 14400, "Europe/Samara" },
+ { "kuyst", 1, 18000, "Europe/Samara" },
+ { "kuyt", 0, 10800, "Europe/Samara" },
+ { "kuyt", 0, 14400, "Europe/Samara" },
+ { "kwat", 0, -43200, "Pacific/Kwajalein" },
+ { "kwat", 0, -43200, "Kwajalein" },
+ { "lhst", 0, 37800, "Australia/Lord_Howe" },
+ { "lhst", 1, 39600, "Australia/Lord_Howe" },
+ { "lhst", 1, 41400, "Australia/Lord_Howe" },
+ { "lhst", 0, 37800, "Australia/LHI" },
+ { "lhst", 1, 39600, "Australia/LHI" },
+ { "lhst", 1, 41400, "Australia/LHI" },
+ { "lint", 0, -36000, "Pacific/Kiritimati" },
+ { "lint", 0, 50400, "Pacific/Kiritimati" },
+ { "lkt", 0, 21600, "Asia/Colombo" },
+ { "lkt", 0, 23400, "Asia/Colombo" },
+ { "lont", 0, 25200, "Asia/Chongqing" },
+ { "lont", 0, 25200, "Asia/Chungking" },
+ { "lrt", 0, -2670, "Africa/Monrovia" },
+ { "lst", 1, 9384, "Europe/Riga" },
+ { "madmt", 1, 3600, "Atlantic/Madeira" },
+ { "madst", 1, 0, "Atlantic/Madeira" },
+ { "madt", 0, -3600, "Atlantic/Madeira" },
+ { "magst", 1, 39600, "Asia/Magadan" },
+ { "magst", 1, 43200, "Asia/Magadan" },
+ { "magt", 0, 36000, "Asia/Magadan" },
+ { "magt", 0, 39600, "Asia/Magadan" },
+ { "malst", 1, 26400, "Asia/Singapore" },
+ { "malst", 1, 26400, "Asia/Kuala_Lumpur" },
+ { "malst", 1, 26400, "Singapore" },
+ { "malt", 0, 25200, "Asia/Singapore" },
+ { "malt", 0, 26400, "Asia/Singapore" },
+ { "malt", 0, 27000, "Asia/Singapore" },
+ { "malt", 0, 25200, "Asia/Kuala_Lumpur" },
+ { "malt", 0, 25200, "Singapore" },
+ { "malt", 0, 26400, "Asia/Kuala_Lumpur" },
+ { "malt", 0, 26400, "Singapore" },
+ { "malt", 0, 27000, "Asia/Kuala_Lumpur" },
+ { "malt", 0, 27000, "Singapore" },
+ { "mart", 0, -34200, "Pacific/Marquesas" },
+ { "mawt", 0, 21600, "Antarctica/Mawson" },
+ { "mddt", 1, -18000, "America/Cambridge_Bay" },
+ { "mddt", 1, -18000, "America/Yellowknife" },
+ { "mdst", 1, 16248, "Europe/Moscow" },
+ { "mdst", 1, 16248, "W-SU" },
+ { "mdt", 1, -21600, "America/Denver" },
+ { "mdt", 1, -21600, "America/Boise" },
+ { "mdt", 1, -21600, "America/Cambridge_Bay" },
+ { "mdt", 1, -21600, "America/Chihuahua" },
+ { "mdt", 1, -21600, "America/Edmonton" },
+ { "mdt", 1, -21600, "America/Hermosillo" },
+ { "mdt", 1, -21600, "America/Inuvik" },
+ { "mdt", 1, -21600, "America/Mazatlan" },
+ { "mdt", 1, -21600, "America/North_Dakota/Center" },
+ { "mdt", 1, -21600, "America/Phoenix" },
+ { "mdt", 1, -21600, "America/Regina" },
+ { "mdt", 1, -21600, "America/Shiprock" },
+ { "mdt", 1, -21600, "America/Swift_Current" },
+ { "mdt", 1, -21600, "America/Yellowknife" },
+ { "mdt", 1, -21600, "Canada/East-Saskatchewan" },
+ { "mdt", 1, -21600, "Canada/Mountain" },
+ { "mdt", 1, -21600, "Canada/Saskatchewan" },
+ { "mdt", 1, -21600, "Mexico/BajaSur" },
+ { "mdt", 1, -21600, "MST" },
+ { "mdt", 1, -21600, "MST7MDT" },
+ { "mdt", 1, -21600, "Navajo" },
+ { "mdt", 1, -21600, "US/Arizona" },
+ { "mdt", 1, -21600, "US/Mountain" },
+ { "mest", 1, 7200, "MET" },
+ { "met", 0, 3600, "MET" },
+ { "mht", 0, 43200, "Pacific/Kwajalein" },
+ { "mht", 0, 43200, "Kwajalein" },
+ { "mht", 0, 43200, "Pacific/Majuro" },
+ { "mmt", 0, 9048, "Europe/Moscow" },
+ { "mmt", 0, 23400, "Asia/Rangoon" },
+ { "mmt", 0, 28656, "Asia/Makassar" },
+ { "mmt", 0, 28656, "Asia/Ujung_Pandang" },
+ { "mmt", 0, 9048, "W-SU" },
+ { "most", 1, 32400, "Asia/Macao" },
+ { "most", 1, 32400, "Asia/Macau" },
+ { "mot", 0, 28800, "Asia/Macao" },
+ { "mot", 0, 28800, "Asia/Macau" },
+ { "mpt", 1, -21600, "America/Denver" },
+ { "mpt", 1, -21600, "America/Boise" },
+ { "mpt", 1, -21600, "America/Cambridge_Bay" },
+ { "mpt", 1, -21600, "America/Edmonton" },
+ { "mpt", 1, -21600, "America/North_Dakota/Center" },
+ { "mpt", 1, -21600, "America/Regina" },
+ { "mpt", 1, -21600, "America/Shiprock" },
+ { "mpt", 1, -21600, "America/Swift_Current" },
+ { "mpt", 1, -21600, "America/Yellowknife" },
+ { "mpt", 1, -21600, "Canada/East-Saskatchewan" },
+ { "mpt", 1, -21600, "Canada/Mountain" },
+ { "mpt", 1, -21600, "Canada/Saskatchewan" },
+ { "mpt", 1, -21600, "MST" },
+ { "mpt", 1, -21600, "MST7MDT" },
+ { "mpt", 1, -21600, "Navajo" },
+ { "mpt", 1, -21600, "US/Mountain" },
+ { "mpt", 0, 36000, "Pacific/Saipan" },
+ { "msd", 1, 14400, "Europe/Moscow" },
+ { "msd", 1, 18000, "Europe/Moscow" },
+ { "msd", 1, 14400, "Europe/Chisinau" },
+ { "msd", 1, 14400, "Europe/Kaliningrad" },
+ { "msd", 1, 14400, "Europe/Kiev" },
+ { "msd", 1, 14400, "Europe/Minsk" },
+ { "msd", 1, 14400, "Europe/Riga" },
+ { "msd", 1, 14400, "Europe/Simferopol" },
+ { "msd", 1, 14400, "Europe/Tallinn" },
+ { "msd", 1, 14400, "Europe/Tiraspol" },
+ { "msd", 1, 14400, "Europe/Uzhgorod" },
+ { "msd", 1, 14400, "Europe/Vilnius" },
+ { "msd", 1, 14400, "Europe/Zaporozhye" },
+ { "msd", 1, 14400, "W-SU" },
+ { "msd", 1, 18000, "W-SU" },
+ { "msk", 0, 10800, "Europe/Moscow" },
+ { "msk", 0, 10800, "Europe/Chisinau" },
+ { "msk", 0, 10800, "Europe/Kaliningrad" },
+ { "msk", 0, 10800, "Europe/Kiev" },
+ { "msk", 0, 10800, "Europe/Minsk" },
+ { "msk", 0, 10800, "Europe/Riga" },
+ { "msk", 0, 10800, "Europe/Simferopol" },
+ { "msk", 0, 10800, "Europe/Tallinn" },
+ { "msk", 0, 10800, "Europe/Tiraspol" },
+ { "msk", 0, 10800, "Europe/Uzhgorod" },
+ { "msk", 0, 10800, "Europe/Vilnius" },
+ { "msk", 0, 10800, "Europe/Zaporozhye" },
+ { "msk", 0, 10800, "W-SU" },
+ { "mst", 0, -25200, "America/Denver" },
+ { "mst", 0, -25200, "America/Boise" },
+ { "mst", 0, -25200, "America/Cambridge_Bay" },
+ { "mst", 0, -25200, "America/Chihuahua" },
+ { "mst", 0, -25200, "America/Dawson_Creek" },
+ { "mst", 0, -25200, "America/Edmonton" },
+ { "mst", 0, -25200, "America/Ensenada" },
+ { "mst", 0, -25200, "America/Hermosillo" },
+ { "mst", 0, -25200, "America/Inuvik" },
+ { "mst", 0, -25200, "America/Mazatlan" },
+ { "mst", 0, -25200, "America/Mexico_City" },
+ { "mst", 0, -25200, "America/North_Dakota/Center" },
+ { "mst", 0, -25200, "America/Phoenix" },
+ { "mst", 0, -25200, "America/Regina" },
+ { "mst", 0, -25200, "America/Shiprock" },
+ { "mst", 0, -25200, "America/Swift_Current" },
+ { "mst", 0, -25200, "America/Tijuana" },
+ { "mst", 0, -25200, "America/Yellowknife" },
+ { "mst", 0, -25200, "Canada/East-Saskatchewan" },
+ { "mst", 0, -25200, "Canada/Mountain" },
+ { "mst", 0, -25200, "Canada/Saskatchewan" },
+ { "mst", 0, -25200, "Mexico/BajaNorte" },
+ { "mst", 0, -25200, "Mexico/BajaSur" },
+ { "mst", 0, -25200, "Mexico/General" },
+ { "mst", 0, -25200, "MST" },
+ { "mst", 0, -25200, "MST7MDT" },
+ { "mst", 0, -25200, "Navajo" },
+ { "mst", 0, -25200, "US/Arizona" },
+ { "mst", 0, -25200, "US/Mountain" },
+ { "mst", 1, 12648, "Europe/Moscow" },
+ { "mst", 1, 12648, "W-SU" },
+ { "mut", 0, 14400, "Indian/Mauritius" },
+ { "mvt", 0, 18000, "Indian/Maldives" },
+ { "mwt", 1, -21600, "America/Denver" },
+ { "mwt", 1, -21600, "America/Boise" },
+ { "mwt", 1, -21600, "America/Cambridge_Bay" },
+ { "mwt", 1, -21600, "America/Edmonton" },
+ { "mwt", 1, -21600, "America/North_Dakota/Center" },
+ { "mwt", 1, -21600, "America/Phoenix" },
+ { "mwt", 1, -21600, "America/Regina" },
+ { "mwt", 1, -21600, "America/Shiprock" },
+ { "mwt", 1, -21600, "America/Swift_Current" },
+ { "mwt", 1, -21600, "America/Yellowknife" },
+ { "mwt", 1, -21600, "Canada/East-Saskatchewan" },
+ { "mwt", 1, -21600, "Canada/Mountain" },
+ { "mwt", 1, -21600, "Canada/Saskatchewan" },
+ { "mwt", 1, -21600, "MST" },
+ { "mwt", 1, -21600, "MST7MDT" },
+ { "mwt", 1, -21600, "Navajo" },
+ { "mwt", 1, -21600, "US/Arizona" },
+ { "mwt", 1, -21600, "US/Mountain" },
+ { "myt", 0, 28800, "Asia/Kuala_Lumpur" },
+ { "myt", 0, 28800, "Asia/Kuching" },
+ { "ncst", 1, 43200, "Pacific/Noumea" },
+ { "nct", 0, 39600, "Pacific/Noumea" },
+ { "nddt", 1, -5400, "America/St_Johns" },
+ { "nddt", 1, -5400, "Canada/Newfoundland" },
+ { "ndt", 1, -9000, "America/St_Johns" },
+ { "ndt", 1, -9052, "America/St_Johns" },
+ { "ndt", 1, -36000, "Pacific/Midway" },
+ { "ndt", 1, -9000, "America/Goose_Bay" },
+ { "ndt", 1, -9000, "Canada/Newfoundland" },
+ { "ndt", 1, -9052, "America/Goose_Bay" },
+ { "ndt", 1, -9052, "Canada/Newfoundland" },
+ { "negt", 0, -12600, "America/Paramaribo" },
+ { "nest", 1, 4800, "Europe/Amsterdam" },
+ { "net", 0, 1200, "Europe/Amsterdam" },
+ { "nft", 0, 41400, "Pacific/Norfolk" },
+ { "novst", 1, 25200, "Asia/Novosibirsk" },
+ { "novst", 1, 28800, "Asia/Novosibirsk" },
+ { "novt", 0, 21600, "Asia/Novosibirsk" },
+ { "novt", 0, 25200, "Asia/Novosibirsk" },
+ { "npt", 1, -9000, "America/St_Johns" },
+ { "npt", 1, -36000, "America/Adak" },
+ { "npt", 1, -36000, "America/Atka" },
+ { "npt", 1, -36000, "America/Nome" },
+ { "npt", 1, -36000, "US/Aleutian" },
+ { "npt", 1, -9000, "America/Goose_Bay" },
+ { "npt", 1, -9000, "Canada/Newfoundland" },
+ { "npt", 0, 20700, "Asia/Katmandu" },
+ { "nrt", 0, 41400, "Pacific/Nauru" },
+ { "nrt", 0, 43200, "Pacific/Nauru" },
+ { "nst", 0, -12600, "America/St_Johns" },
+ { "nst", 0, -12652, "America/St_Johns" },
+ { "nst", 0, -12600, "America/Goose_Bay" },
+ { "nst", 0, -12600, "Canada/Newfoundland" },
+ { "nst", 0, -12652, "America/Goose_Bay" },
+ { "nst", 0, -12652, "Canada/Newfoundland" },
+ { "nst", 0, -39600, "America/Adak" },
+ { "nst", 0, -39600, "America/Atka" },
+ { "nst", 0, -39600, "America/Nome" },
+ { "nst", 0, -39600, "Pacific/Midway" },
+ { "nst", 0, -39600, "Pacific/Pago_Pago" },
+ { "nst", 0, -39600, "Pacific/Samoa" },
+ { "nst", 0, -39600, "US/Aleutian" },
+ { "nst", 0, -39600, "US/Samoa" },
+ { "nst", 1, 4772, "Europe/Amsterdam" },
+ { "nut", 0, -39600, "Pacific/Niue" },
+ { "nut", 0, -41400, "Pacific/Niue" },
+ { "nwt", 1, -9000, "America/St_Johns" },
+ { "nwt", 1, -36000, "America/Adak" },
+ { "nwt", 1, -36000, "America/Atka" },
+ { "nwt", 1, -36000, "America/Nome" },
+ { "nwt", 1, -36000, "US/Aleutian" },
+ { "nwt", 1, -9000, "America/Goose_Bay" },
+ { "nwt", 1, -9000, "Canada/Newfoundland" },
+ { "nzdt", 1, 46800, "Pacific/Auckland" },
+ { "nzdt", 1, 46800, "Antarctica/McMurdo" },
+ { "nzdt", 1, 46800, "Antarctica/South_Pole" },
+ { "nzdt", 1, 46800, "NZ" },
+ { "nzmt", 0, 41400, "Pacific/Auckland" },
+ { "nzmt", 0, 41400, "NZ" },
+ { "nzst", 0, 43200, "Pacific/Auckland" },
+ { "nzst", 1, 43200, "Pacific/Auckland" },
+ { "nzst", 1, 45000, "Pacific/Auckland" },
+ { "nzst", 0, 43200, "Antarctica/McMurdo" },
+ { "nzst", 0, 43200, "Antarctica/South_Pole" },
+ { "nzst", 0, 43200, "NZ" },
+ { "nzst", 1, 43200, "NZ" },
+ { "nzst", 1, 45000, "NZ" },
+ { "omsst", 1, 21600, "Asia/Omsk" },
+ { "omsst", 1, 25200, "Asia/Omsk" },
+ { "omst", 0, 18000, "Asia/Omsk" },
+ { "omst", 0, 21600, "Asia/Omsk" },
+ { "orast", 1, 18000, "Asia/Oral" },
+ { "orat", 0, 14400, "Asia/Oral" },
+ { "orat", 0, 18000, "Asia/Oral" },
+ { "pddt", 1, -21600, "America/Inuvik" },
+ { "pdt", 1, -25200, "America/Los_Angeles" },
+ { "pdt", 1, -25200, "America/Boise" },
+ { "pdt", 1, -25200, "America/Dawson" },
+ { "pdt", 1, -25200, "America/Dawson_Creek" },
+ { "pdt", 1, -25200, "America/Ensenada" },
+ { "pdt", 1, -25200, "America/Inuvik" },
+ { "pdt", 1, -25200, "America/Juneau" },
+ { "pdt", 1, -25200, "America/Tijuana" },
+ { "pdt", 1, -25200, "America/Vancouver" },
+ { "pdt", 1, -25200, "America/Whitehorse" },
+ { "pdt", 1, -25200, "Canada/Pacific" },
+ { "pdt", 1, -25200, "Canada/Yukon" },
+ { "pdt", 1, -25200, "Mexico/BajaNorte" },
+ { "pdt", 1, -25200, "PST8PDT" },
+ { "pdt", 1, -25200, "US/Pacific" },
+ { "pdt", 1, -25200, "US/Pacific-New" },
+ { "pest", 1, -14400, "America/Lima" },
+ { "petst", 1, 43200, "Asia/Kamchatka" },
+ { "petst", 1, 46800, "Asia/Kamchatka" },
+ { "pett", 0, 39600, "Asia/Kamchatka" },
+ { "pett", 0, 43200, "Asia/Kamchatka" },
+ { "pet", 0, -18000, "America/Lima" },
+ { "phot", 0, -39600, "Pacific/Enderbury" },
+ { "phot", 0, 46800, "Pacific/Enderbury" },
+ { "phst", 1, 32400, "Asia/Manila" },
+ { "pht", 0, 28800, "Asia/Manila" },
+ { "pkst", 1, 21600, "Asia/Karachi" },
+ { "pkt", 0, 18000, "Asia/Karachi" },
+ { "pmdt", 1, -7200, "America/Miquelon" },
+ { "pmst", 0, -10800, "America/Miquelon" },
+ { "pmt", 0, -13236, "America/Paramaribo" },
+ { "pmt", 0, -13252, "America/Paramaribo" },
+ { "pmt", 0, 26240, "Asia/Pontianak" },
+ { "pmt", 0, 36000, "Antarctica/DumontDUrville" },
+ { "ppt", 1, -25200, "America/Los_Angeles" },
+ { "ppt", 1, -25200, "America/Dawson_Creek" },
+ { "ppt", 1, -25200, "America/Inuvik" },
+ { "ppt", 1, -25200, "America/Juneau" },
+ { "ppt", 1, -25200, "America/Vancouver" },
+ { "ppt", 1, -25200, "Canada/Pacific" },
+ { "ppt", 1, -25200, "PST8PDT" },
+ { "ppt", 1, -25200, "US/Pacific" },
+ { "ppt", 1, -25200, "US/Pacific-New" },
+ { "pst", 0, -28800, "America/Los_Angeles" },
+ { "pst", 0, -28800, "America/Boise" },
+ { "pst", 0, -28800, "America/Dawson" },
+ { "pst", 0, -28800, "America/Dawson_Creek" },
+ { "pst", 0, -28800, "America/Ensenada" },
+ { "pst", 0, -28800, "America/Hermosillo" },
+ { "pst", 0, -28800, "America/Inuvik" },
+ { "pst", 0, -28800, "America/Juneau" },
+ { "pst", 0, -28800, "America/Mazatlan" },
+ { "pst", 0, -28800, "America/Tijuana" },
+ { "pst", 0, -28800, "America/Vancouver" },
+ { "pst", 0, -28800, "America/Whitehorse" },
+ { "pst", 0, -28800, "Canada/Pacific" },
+ { "pst", 0, -28800, "Canada/Yukon" },
+ { "pst", 0, -28800, "Mexico/BajaNorte" },
+ { "pst", 0, -28800, "Mexico/BajaSur" },
+ { "pst", 0, -28800, "Pacific/Pitcairn" },
+ { "pst", 0, -28800, "PST8PDT" },
+ { "pst", 0, -28800, "US/Pacific" },
+ { "pst", 0, -28800, "US/Pacific-New" },
+ { "pwt", 1, -25200, "America/Los_Angeles" },
+ { "pwt", 1, -25200, "America/Dawson_Creek" },
+ { "pwt", 1, -25200, "America/Ensenada" },
+ { "pwt", 1, -25200, "America/Inuvik" },
+ { "pwt", 1, -25200, "America/Juneau" },
+ { "pwt", 1, -25200, "America/Tijuana" },
+ { "pwt", 1, -25200, "America/Vancouver" },
+ { "pwt", 1, -25200, "Canada/Pacific" },
+ { "pwt", 1, -25200, "Mexico/BajaNorte" },
+ { "pwt", 1, -25200, "PST8PDT" },
+ { "pwt", 1, -25200, "US/Pacific" },
+ { "pwt", 1, -25200, "US/Pacific-New" },
+ { "pyst", 1, -10800, "America/Asuncion" },
+ { "pyt", 0, -10800, "America/Asuncion" },
+ { "pyt", 0, -14400, "America/Asuncion" },
+ { "qyzst", 1, 25200, "Asia/Qyzylorda" },
+ { "qyzt", 0, 18000, "Asia/Qyzylorda" },
+ { "qyzt", 0, 21600, "Asia/Qyzylorda" },
+ { "ret", 0, 14400, "Indian/Reunion" },
+ { "rmt", 0, 5784, "Europe/Riga" },
+ { "rott", 0, -10800, "Antarctica/Rothera" },
+ { "sakst", 1, 39600, "Asia/Sakhalin" },
+ { "sakst", 1, 43200, "Asia/Sakhalin" },
+ { "sakt", 0, 36000, "Asia/Sakhalin" },
+ { "sakt", 0, 39600, "Asia/Sakhalin" },
+ { "samst", 1, 21600, "Asia/Samarkand" },
+ { "samst", 1, 18000, "Europe/Samara" },
+ { "samt", 0, 14400, "Asia/Samarkand" },
+ { "samt", 0, 18000, "Asia/Samarkand" },
+ { "samt", 0, -41400, "Pacific/Apia" },
+ { "samt", 0, -41400, "Pacific/Pago_Pago" },
+ { "samt", 0, -41400, "Pacific/Samoa" },
+ { "samt", 0, -41400, "US/Samoa" },
+ { "samt", 0, 14400, "Europe/Samara" },
+ { "sast", 1, 10800, "Africa/Johannesburg" },
+ { "sast", 0, 7200, "Africa/Johannesburg" },
+ { "sast", 1, 10800, "Africa/Maseru" },
+ { "sast", 1, 10800, "Africa/Windhoek" },
+ { "sast", 0, 7200, "Africa/Maseru" },
+ { "sast", 0, 7200, "Africa/Mbabane" },
+ { "sast", 0, 7200, "Africa/Windhoek" },
+ { "sbt", 0, 39600, "Pacific/Guadalcanal" },
+ { "sct", 0, 14400, "Indian/Mahe" },
+ { "sgt", 0, 27000, "Asia/Singapore" },
+ { "sgt", 0, 28800, "Asia/Singapore" },
+ { "sgt", 0, 27000, "Singapore" },
+ { "sgt", 0, 28800, "Singapore" },
+ { "shest", 1, 21600, "Asia/Aqtau" },
+ { "shet", 0, 18000, "Asia/Aqtau" },
+ { "shet", 0, 21600, "Asia/Aqtau" },
+ { "slst", 1, -1200, "Africa/Freetown" },
+ { "slst", 1, 3600, "Africa/Freetown" },
+ { "smt", 0, 25580, "Asia/Saigon" },
+ { "smt", 0, 25580, "Asia/Phnom_Penh" },
+ { "smt", 0, 25580, "Asia/Vientiane" },
+ { "srt", 0, -10800, "America/Paramaribo" },
+ { "srt", 0, -12600, "America/Paramaribo" },
+ { "sst", 0, -39600, "Pacific/Samoa" },
+ { "sst", 0, -39600, "Pacific/Midway" },
+ { "sst", 0, -39600, "Pacific/Pago_Pago" },
+ { "sst", 0, -39600, "US/Samoa" },
+ { "svest", 1, 18000, "Asia/Yekaterinburg" },
+ { "svest", 1, 21600, "Asia/Yekaterinburg" },
+ { "svet", 0, 14400, "Asia/Yekaterinburg" },
+ { "svet", 0, 18000, "Asia/Yekaterinburg" },
+ { "syot", 0, 10800, "Antarctica/Syowa" },
+ { "taht", 0, -36000, "Pacific/Tahiti" },
+ { "tasst", 1, 21600, "Asia/Samarkand" },
+ { "tasst", 1, 25200, "Asia/Samarkand" },
+ { "tasst", 1, 21600, "Asia/Tashkent" },
+ { "tasst", 1, 25200, "Asia/Tashkent" },
+ { "tast", 0, 21600, "Asia/Samarkand" },
+ { "tast", 0, 18000, "Asia/Tashkent" },
+ { "tast", 0, 21600, "Asia/Tashkent" },
+ { "tbist", 1, 14400, "Asia/Tbilisi" },
+ { "tbist", 1, 18000, "Asia/Tbilisi" },
+ { "tbit", 0, 10800, "Asia/Tbilisi" },
+ { "tbit", 0, 14400, "Asia/Tbilisi" },
+ { "tft", 0, 18000, "Indian/Kerguelen" },
+ { "tjt", 0, 18000, "Asia/Dushanbe" },
+ { "tlt", 0, 28800, "Asia/Dili" },
+ { "tlt", 0, 32400, "Asia/Dili" },
+ { "tmt", 0, 12344, "Asia/Tehran" },
+ { "tmt", 0, 12344, "Iran" },
+ { "tmt", 0, 14400, "Asia/Ashgabat" },
+ { "tmt", 0, 14400, "Asia/Ashkhabad" },
+ { "tmt", 0, 18000, "Asia/Ashgabat" },
+ { "tmt", 0, 18000, "Asia/Ashkhabad" },
+ { "tmt", 0, 5940, "Europe/Tallinn" },
+ { "tost", 1, 50400, "Pacific/Tongatapu" },
+ { "tot", 0, 46800, "Pacific/Tongatapu" },
+ { "trst", 1, 14400, "Europe/Istanbul" },
+ { "trst", 1, 14400, "Asia/Istanbul" },
+ { "trst", 1, 14400, "Turkey" },
+ { "trt", 0, 10800, "Europe/Istanbul" },
+ { "trt", 0, 10800, "Asia/Istanbul" },
+ { "trt", 0, 10800, "Turkey" },
+ { "ulast", 1, 32400, "Asia/Ulaanbaatar" },
+ { "ulast", 1, 32400, "Asia/Ulan_Bator" },
+ { "ulat", 0, 25200, "Asia/Ulaanbaatar" },
+ { "ulat", 0, 28800, "Asia/Ulaanbaatar" },
+ { "ulat", 0, 25200, "Asia/Choibalsan" },
+ { "ulat", 0, 25200, "Asia/Ulan_Bator" },
+ { "ulat", 0, 28800, "Asia/Choibalsan" },
+ { "ulat", 0, 28800, "Asia/Ulan_Bator" },
+ { "urast", 1, 18000, "Asia/Oral" },
+ { "urast", 1, 21600, "Asia/Oral" },
+ { "urat", 0, 14400, "Asia/Oral" },
+ { "urat", 0, 18000, "Asia/Oral" },
+ { "urat", 0, 21600, "Asia/Oral" },
+ { "urut", 0, 21600, "Asia/Urumqi" },
+ { "uyhst", 1, -10800, "America/Montevideo" },
+ { "uyhst", 1, -9000, "America/Montevideo" },
+ { "uyst", 1, -7200, "America/Montevideo" },
+ { "uyt", 0, -10800, "America/Montevideo" },
+ { "uyt", 0, -12600, "America/Montevideo" },
+ { "uzst", 1, 21600, "Asia/Samarkand" },
+ { "uzst", 1, 21600, "Asia/Tashkent" },
+ { "uzt", 0, 18000, "Asia/Samarkand" },
+ { "uzt", 0, 18000, "Asia/Tashkent" },
+ { "vet", 0, -14400, "America/Caracas" },
+ { "vet", 0, -16200, "America/Caracas" },
+ { "vlasst", 1, 36000, "Asia/Vladivostok" },
+ { "vlast", 0, 32400, "Asia/Vladivostok" },
+ { "vlast", 1, 39600, "Asia/Vladivostok" },
+ { "vlat", 0, 32400, "Asia/Vladivostok" },
+ { "vlat", 0, 36000, "Asia/Vladivostok" },
+ { "vost", 0, 21600, "Antarctica/Vostok" },
+ { "vust", 1, 43200, "Pacific/Efate" },
+ { "vut", 0, 39600, "Pacific/Efate" },
+ { "warst", 1, -10800, "America/Mendoza" },
+ { "warst", 1, -10800, "America/Argentina/Jujuy" },
+ { "warst", 1, -10800, "America/Argentina/Mendoza" },
+ { "warst", 1, -10800, "America/Jujuy" },
+ { "wart", 0, -14400, "America/Mendoza" },
+ { "wart", 0, -14400, "America/Argentina/Catamarca" },
+ { "wart", 0, -14400, "America/Argentina/ComodRivadavia" },
+ { "wart", 0, -14400, "America/Argentina/Cordoba" },
+ { "wart", 0, -14400, "America/Argentina/Jujuy" },
+ { "wart", 0, -14400, "America/Argentina/La_Rioja" },
+ { "wart", 0, -14400, "America/Argentina/Mendoza" },
+ { "wart", 0, -14400, "America/Argentina/Rio_Gallegos" },
+ { "wart", 0, -14400, "America/Argentina/San_Juan" },
+ { "wart", 0, -14400, "America/Argentina/Tucuman" },
+ { "wart", 0, -14400, "America/Argentina/Ushuaia" },
+ { "wart", 0, -14400, "America/Catamarca" },
+ { "wart", 0, -14400, "America/Cordoba" },
+ { "wart", 0, -14400, "America/Jujuy" },
+ { "wart", 0, -14400, "America/Rosario" },
+ { "wast", 1, 7200, "Africa/Windhoek" },
+ { "wast", 1, 7200, "Africa/Ndjamena" },
+ { "wat", 0, -3600, "Africa/Dakar" },
+ { "wat", 0, -3600, "Africa/Bamako" },
+ { "wat", 0, -3600, "Africa/Banjul" },
+ { "wat", 0, -3600, "Africa/Bissau" },
+ { "wat", 0, -3600, "Africa/Conakry" },
+ { "wat", 0, -3600, "Africa/El_Aaiun" },
+ { "wat", 0, -3600, "Africa/Freetown" },
+ { "wat", 0, -3600, "Africa/Niamey" },
+ { "wat", 0, -3600, "Africa/Nouakchott" },
+ { "wat", 0, -3600, "Africa/Timbuktu" },
+ { "wat", 0, 0, "Africa/Freetown" },
+ { "wat", 0, 3600, "Africa/Brazzaville" },
+ { "wat", 0, 3600, "Africa/Bangui" },
+ { "wat", 0, 3600, "Africa/Douala" },
+ { "wat", 0, 3600, "Africa/Lagos" },
+ { "wat", 0, 3600, "Africa/Libreville" },
+ { "wat", 0, 3600, "Africa/Luanda" },
+ { "wat", 0, 3600, "Africa/Malabo" },
+ { "wat", 0, 3600, "Africa/Ndjamena" },
+ { "wat", 0, 3600, "Africa/Niamey" },
+ { "wat", 0, 3600, "Africa/Porto-Novo" },
+ { "wat", 0, 3600, "Africa/Windhoek" },
+ { "wemt", 1, 7200, "Europe/Lisbon" },
+ { "wemt", 1, 7200, "Europe/Madrid" },
+ { "wemt", 1, 7200, "Europe/Monaco" },
+ { "wemt", 1, 7200, "Europe/Paris" },
+ { "wemt", 1, 7200, "Portugal" },
+ { "wemt", 1, 7200, "WET" },
+ { "west", 1, 3600, "Europe/Paris" },
+ { "west", 1, 3600, "Africa/Algiers" },
+ { "west", 1, 3600, "Africa/Casablanca" },
+ { "west", 1, 3600, "Africa/Ceuta" },
+ { "west", 1, 3600, "Atlantic/Canary" },
+ { "west", 1, 3600, "Atlantic/Faeroe" },
+ { "west", 1, 3600, "Atlantic/Madeira" },
+ { "west", 1, 3600, "Europe/Brussels" },
+ { "west", 1, 3600, "Europe/Lisbon" },
+ { "west", 1, 3600, "Europe/Luxembourg" },
+ { "west", 1, 3600, "Europe/Madrid" },
+ { "west", 1, 3600, "Europe/Monaco" },
+ { "west", 1, 3600, "Portugal" },
+ { "west", 1, 3600, "WET" },
+ { "west", 1, 7200, "Europe/Luxembourg" },
+ { "wet", 0, 0, "Europe/Paris" },
+ { "wet", 0, 0, "Africa/Algiers" },
+ { "wet", 0, 0, "Africa/Casablanca" },
+ { "wet", 0, 0, "Africa/Ceuta" },
+ { "wet", 0, 0, "Africa/El_Aaiun" },
+ { "wet", 0, 0, "Atlantic/Azores" },
+ { "wet", 0, 0, "Atlantic/Canary" },
+ { "wet", 0, 0, "Atlantic/Faeroe" },
+ { "wet", 0, 0, "Atlantic/Madeira" },
+ { "wet", 0, 0, "Europe/Brussels" },
+ { "wet", 0, 0, "Europe/Lisbon" },
+ { "wet", 0, 0, "Europe/Luxembourg" },
+ { "wet", 0, 0, "Europe/Madrid" },
+ { "wet", 0, 0, "Europe/Monaco" },
+ { "wet", 0, 0, "Portugal" },
+ { "wet", 0, 0, "WET" },
+ { "wet", 0, 3600, "Europe/Luxembourg" },
+ { "wgst", 1, -7200, "America/Godthab" },
+ { "wgst", 1, -7200, "America/Danmarkshavn" },
+ { "wgt", 0, -10800, "America/Godthab" },
+ { "wgt", 0, -10800, "America/Danmarkshavn" },
+ { "wit", 0, 25200, "Asia/Jakarta" },
+ { "wit", 0, 27000, "Asia/Jakarta" },
+ { "wit", 0, 28800, "Asia/Jakarta" },
+ { "wit", 0, 25200, "Asia/Pontianak" },
+ { "wit", 0, 27000, "Asia/Pontianak" },
+ { "wit", 0, 28800, "Asia/Pontianak" },
+ { "wst", 0, 28800, "Australia/Perth" },
+ { "wst", 1, 32400, "Australia/Perth" },
+ { "wst", 0, -39600, "Pacific/Apia" },
+ { "wst", 0, 28800, "Antarctica/Casey" },
+ { "wst", 0, 28800, "Australia/West" },
+ { "wst", 1, 32400, "Australia/West" },
+ { "yakst", 1, 32400, "Asia/Yakutsk" },
+ { "yakst", 1, 36000, "Asia/Yakutsk" },
+ { "yakt", 0, 28800, "Asia/Yakutsk" },
+ { "yakt", 0, 32400, "Asia/Yakutsk" },
+ { "yddt", 1, -25200, "America/Dawson" },
+ { "yddt", 1, -25200, "America/Whitehorse" },
+ { "yddt", 1, -25200, "Canada/Yukon" },
+ { "ydt", 1, -28800, "America/Dawson" },
+ { "ydt", 1, -28800, "America/Whitehorse" },
+ { "ydt", 1, -28800, "America/Yakutat" },
+ { "ydt", 1, -28800, "Canada/Yukon" },
+ { "yekst", 1, 21600, "Asia/Yekaterinburg" },
+ { "yekt", 0, 18000, "Asia/Yekaterinburg" },
+ { "yerst", 1, 14400, "Asia/Yerevan" },
+ { "yerst", 1, 18000, "Asia/Yerevan" },
+ { "yert", 0, 10800, "Asia/Yerevan" },
+ { "yert", 0, 14400, "Asia/Yerevan" },
+ { "ypt", 1, -28800, "America/Dawson" },
+ { "ypt", 1, -28800, "America/Whitehorse" },
+ { "ypt", 1, -28800, "America/Yakutat" },
+ { "ypt", 1, -28800, "Canada/Yukon" },
+ { "yst", 0, -32400, "America/Anchorage" },
+ { "yst", 0, -32400, "America/Dawson" },
+ { "yst", 0, -32400, "America/Juneau" },
+ { "yst", 0, -32400, "America/Nome" },
+ { "yst", 0, -32400, "America/Whitehorse" },
+ { "yst", 0, -32400, "America/Yakutat" },
+ { "yst", 0, -32400, "Canada/Yukon" },
+ { "yst", 0, -32400, "US/Alaska" },
+ { "ywt", 1, -28800, "America/Dawson" },
+ { "ywt", 1, -28800, "America/Whitehorse" },
+ { "ywt", 1, -28800, "America/Yakutat" },
+ { "ywt", 1, -28800, "Canada/Yukon" },
+ { "a", 0, 3600, NULL },
+ { "b", 0, 7200, NULL },
+ { "c", 0, 10800, NULL },
+ { "d", 0, 14400, NULL },
+ { "e", 0, 18000, NULL },
+ { "f", 0, 21600, NULL },
+ { "g", 0, 25200, NULL },
+ { "h", 0, 28800, NULL },
+ { "i", 0, 32400, NULL },
+ { "k", 0, 36000, NULL },
+ { "l", 0, 39600, NULL },
+ { "m", 0, 43200, NULL },
+ { "n", 0, -3600, NULL },
+ { "o", 0, -7200, NULL },
+ { "p", 0, -10800, NULL },
+ { "q", 0, -14400, NULL },
+ { "r", 0, -18000, NULL },
+ { "s", 0, -21600, NULL },
+ { "t", 0, -25200, NULL },
+ { "u", 0, -28800, NULL },
+ { "v", 0, -32400, NULL },
+ { "w", 0, -36000, NULL },
+ { "x", 0, -39600, NULL },
+ { "y", 0, -43200, NULL },
+ { "zzz", 0, 0, "Antarctica/Davis" },
+ { "zzz", 0, 0, "Antarctica/DumontDUrville" },
+ { "z", 0, 0, NULL },
diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c
new file mode 100644
index 000000000..126d14497
--- /dev/null
+++ b/ext/date/lib/tm2unixtime.c
@@ -0,0 +1,276 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: tm2unixtime.c,v 1.13.2.1 2005/10/19 21:08:32 derick Exp $ */
+
+#include "timelib.h"
+
+/* jan feb mrt apr may jun jul aug sep oct nov dec */
+static int month_tab_leap[12] = { -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+
+/* dec jan feb mrt apr may jun jul aug sep oct nov dec */
+static int days_in_month_leap[13] = { 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+static int days_in_month[13] = { 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+
+static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b)
+{
+ if (*a < start) {
+ *a += adj;
+ (*b)--;
+ return 1;
+ }
+ if (*a >= end) {
+ if (start == 0) {
+ (*b) += (*a / end);
+ (*a) -= (end * (*a / end));
+ return 0;
+ }
+
+ *a -= adj;
+ (*b)++;
+ return 1;
+ }
+ return 0;
+}
+
+static int do_range_limit_days(timelib_sll *y, timelib_sll *m, timelib_sll *d)
+{
+ timelib_sll leapyear;
+ timelib_sll days_this_month;
+ timelib_sll last_month, last_year;
+ timelib_sll days_last_month;
+
+ do_range_limit(1, 13, 12, m, y);
+
+ leapyear = timelib_is_leap(*y);
+ days_this_month = leapyear ? days_in_month_leap[*m] : days_in_month[*m];
+ last_month = (*m) - 1;
+
+ if (last_month < 1) {
+ last_month += 12;
+ last_year = (*y) - 1;
+ } else {
+ last_year = (*y);
+ }
+ leapyear = timelib_is_leap(last_year);
+ days_last_month = leapyear ? days_in_month_leap[last_month] : days_in_month[last_month];
+
+ if (*d <= 0) {
+ *d += days_last_month;
+ (*m)--;
+ return 1;
+ }
+ if (*d > days_this_month) {
+ *d -= days_this_month;
+ (*m)++;
+ return 1;
+ }
+ return 0;
+}
+
+static void do_adjust_for_weekday(timelib_time* time)
+{
+ timelib_sll current_dow, difference;
+
+ current_dow = timelib_day_of_week(time->y, time->m, time->d);
+ difference = time->relative.weekday - current_dow;
+ if ((time->relative.d < 0 && difference < 0) || (time->relative.d >= 0 && difference <= -time->relative.weekday_behavior)) {
+ difference += 7;
+ }
+ if (time->relative.weekday >= 0) {
+ time->d += difference;
+ } else {
+ time->d -= (7 - (abs(time->relative.weekday) - current_dow));
+ }
+}
+
+static void do_normalize(timelib_time* time)
+{
+ do {} while (do_range_limit(0, 60, 60, &time->s, &time->i));
+ do {} while (do_range_limit(0, 60, 60, &time->i, &time->h));
+ do {} while (do_range_limit(0, 24, 24, &time->h, &time->d));
+ do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
+
+ do {} while (do_range_limit_days(&time->y, &time->m, &time->d));
+ do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
+}
+
+static void do_adjust_relative(timelib_time* time)
+{
+ if (time->have_relative) {
+ time->s += time->relative.s;
+ time->i += time->relative.i;
+ time->h += time->relative.h;
+
+ time->d += time->relative.d;
+ time->m += time->relative.m;
+ time->y += time->relative.y;
+ }
+ do_normalize(time);
+
+ if (time->have_weekday_relative) {
+ do_adjust_for_weekday(time);
+ }
+ do_normalize(time);
+ memset(&(time->relative), 0, sizeof(time->relative));
+}
+
+static timelib_sll do_years(timelib_sll year)
+{
+ timelib_sll i;
+ timelib_sll res = 0;
+
+ if (year >= 1970) {
+ for (i = year - 1; i >= 1970; i--) {
+ if (timelib_is_leap(i)) {
+ res += (DAYS_PER_LYEAR * SECS_PER_DAY);
+ } else {
+ res += (DAYS_PER_YEAR * SECS_PER_DAY);
+ }
+ }
+ } else {
+ for (i = 1969; i >= year; i--) {
+ if (timelib_is_leap(i)) {
+ res -= (DAYS_PER_LYEAR * SECS_PER_DAY);
+ } else {
+ res -= (DAYS_PER_YEAR * SECS_PER_DAY);
+ }
+ }
+ }
+ return res;
+}
+
+static timelib_sll do_months(timelib_ull month, timelib_ull year)
+{
+ if (timelib_is_leap(year)) {
+ return ((month_tab_leap[month - 1] + 1) * SECS_PER_DAY);
+ } else {
+ return ((month_tab[month - 1]) * SECS_PER_DAY);
+ }
+}
+
+static timelib_sll do_days(timelib_ull day)
+{
+ return ((day - 1) * SECS_PER_DAY);
+}
+
+static timelib_sll do_time(timelib_ull hour, timelib_ull minute, timelib_ull second)
+{
+ timelib_sll res = 0;
+
+ res += hour * 3600;
+ res += minute * 60;
+ res += second;
+ return res;
+}
+
+static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi)
+{
+ switch (tz->zone_type) {
+ case TIMELIB_ZONETYPE_OFFSET:
+
+ tz->is_localtime = 1;
+ return tz->z * 60;
+ break;
+
+ case TIMELIB_ZONETYPE_ABBR: {
+ timelib_sll tmp;
+
+ tz->is_localtime = 1;
+ tmp = tz->z;
+ tmp -= tz->dst * 60;
+ tmp *= 60;
+ return tmp;
+ }
+ break;
+
+ case TIMELIB_ZONETYPE_ID:
+ tzi = tz->tz_info;
+ /* Break intentionally missing */
+
+ default:
+ /* No timezone in struct, fallback to reference if possible */
+ if (tzi) {
+ timelib_time_offset *before, *after;
+ timelib_sll tmp;
+ int in_transistion;
+
+ tz->is_localtime = 1;
+ before = timelib_get_time_zone_info(tz->sse, tzi);
+ after = timelib_get_time_zone_info(tz->sse - before->offset, tzi);
+ timelib_set_timezone(tz, tzi);
+
+ in_transistion = (
+ ((tz->sse - after->offset) >= (after->transistion_time + (before->offset - after->offset))) &&
+ ((tz->sse - after->offset) < after->transistion_time)
+ );
+
+ if ((before->offset != after->offset) && !in_transistion) {
+ tmp = -after->offset;
+ } else {
+ tmp = -tz->z;
+ }
+ timelib_time_offset_dtor(before);
+ timelib_time_offset_dtor(after);
+
+ return tmp;
+ }
+ }
+ return 0;
+}
+
+void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi)
+{
+ timelib_sll res = 0;
+
+ do_adjust_relative(time);
+ res += do_years(time->y);
+ res += do_months(time->m, time->y);
+ res += do_days(time->d);
+ res += do_time(time->h, time->i, time->s);
+ time->sse = res;
+
+ res += do_adjust_timezone(time, tzi);
+ time->sse = res;
+
+ time->sse_uptodate = 1;
+}
+
+#if 0
+int main(void)
+{
+ timelib_sll res;
+ timelib_time time;
+
+ time = timelib_strtotime("10 Feb 2005 06:07:03 PM CET"); /* 1108055223 */
+ printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d",
+ time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
+ if (time.have_relative) {
+ printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
+ time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s);
+ }
+ if (time.have_weekday_relative) {
+ printf (" / %d", time.relative.weekday);
+ }
+ res = time2unixtime(&time);
+ printf("%Ld\n", res);
+
+ return 0;
+}
+#endif
diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c
new file mode 100644
index 000000000..94dec51f5
--- /dev/null
+++ b/ext/date/lib/unixtime2tm.c
@@ -0,0 +1,236 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: unixtime2tm.c,v 1.12 2005/08/03 14:06:50 sniper Exp $ */
+
+#include "timelib.h"
+
+#include <stdio.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#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 };
+
+
+/* Converts a Unix timestamp value into broken down time, in GMT */
+void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts)
+{
+ timelib_sll days, remainder, tmp_days;
+ timelib_sll cur_year = 1970;
+ timelib_sll i;
+ timelib_sll hours, minutes, seconds;
+ int *months;
+
+ days = ts / SECS_PER_DAY;
+ remainder = ts - (days * SECS_PER_DAY);
+ if (ts < 0 && remainder == 0) {
+ days++;
+ remainder -= SECS_PER_DAY;
+ }
+ DEBUG(printf("days=%lld, rem=%lld\n", days, remainder););
+
+ if (ts >= 0) {
+ tmp_days = days + 1;
+ while (tmp_days >= DAYS_PER_LYEAR) {
+ cur_year++;
+ if (timelib_is_leap(cur_year)) {
+ tmp_days -= DAYS_PER_LYEAR;
+ } else {
+ tmp_days -= DAYS_PER_YEAR;
+ }
+ }
+ } else {
+ tmp_days = days;
+
+ /* Guess why this might be for, it has to do with a pope ;-). It's also
+ * only valid for Great Brittain and it's colonies. It needs fixing for
+ * other locales. *sigh*, why is this crap so complex! */
+ if (ts <= TIMELIB_LL_CONST(-6857352000)) {
+ tmp_days -= 11;
+ }
+
+ while (tmp_days <= 0) {
+ cur_year--;
+ DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year););
+ if (timelib_is_leap(cur_year)) {
+ tmp_days += DAYS_PER_LYEAR;
+ } else {
+ tmp_days += DAYS_PER_YEAR;
+ }
+ }
+ remainder += SECS_PER_DAY;
+ }
+ DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year););
+
+ months = timelib_is_leap(cur_year) ? month_tab_leap : month_tab;
+ i = 11;
+ while (i > 0) {
+ DEBUG(printf("month=%lld (%d)\n", i, months[i]););
+ if (tmp_days > months[i]) {
+ break;
+ }
+ i--;
+ }
+ DEBUG(printf("A: ts=%lld, year=%lld, month=%lld, day=%lld,", ts, cur_year, i + 1, tmp_days - months[i]););
+
+ /* That was the date, now we do the tiiiime */
+ hours = remainder / 3600;
+ minutes = (remainder - hours * 3600) / 60;
+ seconds = remainder % 60;
+ DEBUG(printf(" hour=%lld, minute=%lld, second=%lld\n", hours, minutes, seconds););
+
+ tm->y = cur_year;
+ tm->m = i + 1;
+ tm->d = tmp_days - months[i];
+ tm->h = hours;
+ tm->i = minutes;
+ tm->s = seconds;
+ tm->z = 0;
+ tm->dst = 0;
+ tm->sse = ts;
+ tm->sse_uptodate = 1;
+ tm->tim_uptodate = 1;
+ tm->is_localtime = 0;
+ tm->have_zone = 0;
+}
+
+void timelib_update_from_sse(timelib_time *tm)
+{
+ timelib_sll sse;
+
+ sse = tm->sse;
+
+ switch (tm->zone_type) {
+ case TIMELIB_ZONETYPE_ABBR:
+ case TIMELIB_ZONETYPE_OFFSET: {
+ int z = tm->z;
+ signed int dst = tm->dst;
+
+ timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60));
+
+ tm->is_localtime = 1;
+ tm->have_zone = 1;
+ tm->z = z;
+ tm->dst = dst;
+ goto cleanup;
+ }
+
+ case TIMELIB_ZONETYPE_ID: {
+ timelib_time_offset *gmt_offset;
+
+ gmt_offset = timelib_get_time_zone_info(tm->sse, tm->tz_info);
+ timelib_unixtime2gmt(tm, tm->sse + gmt_offset->offset);
+ timelib_time_offset_dtor(gmt_offset);
+
+ goto cleanup;
+ }
+
+ default:
+ timelib_unixtime2gmt(tm, tm->sse);
+ goto cleanup;
+ }
+cleanup:
+ tm->sse = sse;
+ tm->is_localtime = 1;
+ tm->have_zone = 1;
+}
+
+void timelib_unixtime2local(timelib_time *tm, timelib_sll ts, timelib_tzinfo* tz)
+{
+ timelib_time_offset *gmt_offset;
+
+ gmt_offset = timelib_get_time_zone_info(ts, tz);
+ timelib_unixtime2gmt(tm, ts + gmt_offset->offset);
+
+ /* we need to reset the sse here as unixtime2gmt modifies it */
+ tm->sse = ts;
+ tm->dst = gmt_offset->is_dst;
+ tm->z = gmt_offset->offset;
+ tm->tz_info = tz;
+
+ timelib_time_tz_abbr_update(tm, gmt_offset->abbr);
+ timelib_time_offset_dtor(gmt_offset);
+
+ tm->is_localtime = 1;
+ tm->have_zone = 1;
+ tm->zone_type = TIMELIB_ZONETYPE_ID;
+}
+
+void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz)
+{
+ timelib_time_offset *gmt_offset;
+
+ gmt_offset = timelib_get_time_zone_info(t->sse, tz);
+ t->z = gmt_offset->offset;
+/*
+ if (t->dst != gmt_offset->is_dst) {
+ printf("ERROR (%d, %d)\n", t->dst, gmt_offset->is_dst);
+ exit(1);
+ }
+*/
+ t->dst = gmt_offset->is_dst;
+ t->tz_info = tz;
+ if (t->tz_abbr) {
+ free(t->tz_abbr);
+ }
+ t->tz_abbr = strdup(gmt_offset->abbr);
+ timelib_time_offset_dtor(gmt_offset);
+
+ t->have_zone = 1;
+ t->zone_type = TIMELIB_ZONETYPE_ID;
+}
+
+/* Converts the time stored in the struct to localtime if localtime = true,
+ * otherwise it converts it to gmttime. This is only done when necessary
+ * ofcourse. */
+int timelib_apply_localtime(timelib_time *t, unsigned int localtime)
+{
+ if (localtime) {
+ /* Converting from GMT time to local time */
+ DEBUG(printf("Converting from GMT time to local time\n"););
+
+ /* Check if TZ is set */
+ if (!t->tz_info) {
+ DEBUG(printf("E: No timezone configured, can't switch to local time\n"););
+ return -1;
+ }
+
+ timelib_unixtime2local(t, t->sse, t->tz_info);
+ } else {
+ /* Converting from local time to GMT time */
+ DEBUG(printf("Converting from local time to GMT time\n"););
+
+ timelib_unixtime2gmt(t, t->sse);
+ }
+ return 0;
+}
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
new file mode 100644
index 000000000..2a54bb895
--- /dev/null
+++ b/ext/date/php_date.c
@@ -0,0 +1,1510 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: php_date.c,v 1.43.2.25 2005/11/27 06:51:40 iliaa Exp $ */
+
+#include "php.h"
+#include "php_streams.h"
+#include "php_main.h"
+#include "php_globals.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "ext/standard/php_versioning.h"
+#include "php_date.h"
+#include "lib/timelib.h"
+#include <time.h>
+
+/* {{{ Function table */
+function_entry date_functions[] = {
+ PHP_FE(strtotime, NULL)
+ PHP_FE(date, NULL)
+ PHP_FE(gmdate, NULL)
+ PHP_FE(mktime, NULL)
+ PHP_FE(gmmktime, NULL)
+ PHP_FE(checkdate, NULL)
+
+#ifdef HAVE_STRFTIME
+ PHP_FE(strftime, NULL)
+ PHP_FE(gmstrftime, NULL)
+#endif
+
+ PHP_FE(time, NULL)
+ PHP_FE(localtime, NULL)
+ PHP_FE(getdate, NULL)
+
+#ifdef EXPERIMENTAL_DATE_SUPPORT
+ /* Advanced Interface */
+ PHP_FE(date_create, NULL)
+ PHP_FE(date_format, NULL)
+ PHP_FE(date_modify, NULL)
+ PHP_FE(date_timezone_get, NULL)
+ PHP_FE(date_timezone_set, NULL)
+ PHP_FE(date_offset_get, NULL)
+
+ PHP_FE(date_time_set, NULL)
+ PHP_FE(date_date_set, NULL)
+ PHP_FE(date_isodate_set, NULL)
+
+ PHP_FE(timezone_open, NULL)
+ PHP_FE(timezone_name_get, NULL)
+ PHP_FE(timezone_offset_get, NULL)
+ PHP_FE(timezone_transistions_get, NULL)
+ PHP_FE(timezone_identifiers_list, NULL)
+ PHP_FE(timezone_abbreviations_list, NULL)
+#endif
+
+ /* Options and Configuration */
+ PHP_FE(date_default_timezone_set, NULL)
+ PHP_FE(date_default_timezone_get, NULL)
+ {NULL, NULL, NULL}
+};
+
+#ifdef EXPERIMENTAL_DATE_SUPPORT
+function_entry date_funcs_date[] = {
+ ZEND_NAMED_FE(format, ZEND_FN(date_format), NULL)
+ ZEND_NAMED_FE(modify, ZEND_FN(date_modify), NULL)
+ ZEND_NAMED_FE(getTimezone, ZEND_FN(date_timezone_get), NULL)
+ ZEND_NAMED_FE(setTimezone, ZEND_FN(date_timezone_set), NULL)
+ ZEND_NAMED_FE(getOffset, ZEND_FN(date_offset_get), NULL)
+ ZEND_NAMED_FE(setTime, ZEND_FN(date_time_set), NULL)
+ ZEND_NAMED_FE(setDate, ZEND_FN(date_date_set), NULL)
+ ZEND_NAMED_FE(setISODate, ZEND_FN(date_isodate_set), NULL)
+ {NULL, NULL, NULL}
+};
+
+function_entry date_funcs_timezone[] = {
+ ZEND_NAMED_FE(getName, ZEND_FN(timezone_name_get), NULL)
+ ZEND_NAMED_FE(getOffset, ZEND_FN(timezone_offset_get), NULL)
+ ZEND_NAMED_FE(getTransistions, ZEND_FN(timezone_transistions_get), NULL)
+ ZEND_MALIAS(timezone, listAbbreviations, abbreviations_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ ZEND_MALIAS(timezone, listIdentifiers, identifiers_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ {NULL, NULL, NULL}
+};
+
+static void date_register_classes(TSRMLS_D);
+#endif
+static char* guess_timezone(TSRMLS_D);
+/* }}} */
+
+ZEND_DECLARE_MODULE_GLOBALS(date)
+
+/* True global */
+timelib_tzdb *php_date_global_timezone_db;
+int php_date_global_timezone_db_enabled;
+
+/* {{{ INI Settings */
+PHP_INI_BEGIN()
+ STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdateString, default_timezone, zend_date_globals, date_globals)
+PHP_INI_END()
+/* }}} */
+
+#ifdef EXPERIMENTAL_DATE_SUPPORT
+zend_class_entry *date_ce_date, *date_ce_timezone;
+
+static zend_object_handlers date_object_handlers_date;
+static zend_object_handlers date_object_handlers_timezone;
+
+typedef struct _php_date_obj php_date_obj;
+typedef struct _php_timezone_obj php_timezone_obj;
+
+struct _php_date_obj {
+ zend_object std;
+ timelib_time *time;
+};
+
+struct _php_timezone_obj {
+ zend_object std;
+ timelib_tzinfo *tz;
+};
+
+#define DATE_SET_CONTEXT \
+ zval *object; \
+ object = getThis(); \
+
+#define DATE_FETCH_OBJECT \
+ php_date_obj *obj; \
+ DATE_SET_CONTEXT; \
+ if (object) { \
+ if (ZEND_NUM_ARGS()) { \
+ WRONG_PARAM_COUNT; \
+ } \
+ } else { \
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, date_ce_date) == FAILURE) { \
+ RETURN_FALSE; \
+ } \
+ } \
+ obj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); \
+
+static 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
+
+/* {{{ Module struct */
+zend_module_entry date_module_entry = {
+ STANDARD_MODULE_HEADER,
+ "date", /* extension name */
+ date_functions, /* function list */
+ PHP_MINIT(date), /* process startup */
+ PHP_MSHUTDOWN(date), /* process shutdown */
+ PHP_RINIT(date), /* request startup */
+ PHP_RSHUTDOWN(date), /* request shutdown */
+ PHP_MINFO(date), /* extension info */
+ PHP_VERSION, /* extension version */
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+
+/* {{{ php_date_init_globals */
+static void php_date_init_globals(zend_date_globals *date_globals)
+{
+ date_globals->default_timezone = NULL;
+ date_globals->timezone = NULL;
+}
+/* }}} */
+
+
+static void _php_date_tzinfo_dtor(void *tzinfo)
+{
+ timelib_tzinfo **tzi = (timelib_tzinfo **)tzinfo;
+
+ timelib_tzinfo_dtor(*tzi);
+}
+
+/* {{{ PHP_RINIT_FUNCTION */
+PHP_RINIT_FUNCTION(date)
+{
+ if (DATEG(timezone)) {
+ efree(DATEG(timezone));
+ }
+ DATEG(timezone) = NULL;
+ zend_hash_init(&DATEG(tzcache), 4, NULL, _php_date_tzinfo_dtor, 0);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_RSHUTDOWN_FUNCTION */
+PHP_RSHUTDOWN_FUNCTION(date)
+{
+ if (DATEG(timezone)) {
+ efree(DATEG(timezone));
+ }
+ DATEG(timezone) = NULL;
+ zend_hash_destroy(&DATEG(tzcache));
+
+ return SUCCESS;
+}
+/* }}} */
+
+#define DATE_TIMEZONEDB php_date_global_timezone_db ? php_date_global_timezone_db : timelib_builtin_db()
+
+#define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sO"
+#define DATE_FORMAT_RFC1036 "l, d-M-y H:i:s T"
+#define DATE_FORMAT_RFC1123 "D, d M Y H:i:s T"
+#define DATE_FORMAT_RFC2822 "D, d M Y H:i:s O"
+
+#define DATE_TZ_ERRMSG \
+ "It is not safe to rely on the system's timezone settings. Please use " \
+ "the date.timezone setting, the TZ environment variable or the " \
+ "date_default_timezone_set() function. "
+
+/* {{{ PHP_MINIT_FUNCTION */
+PHP_MINIT_FUNCTION(date)
+{
+ ZEND_INIT_MODULE_GLOBALS(date, php_date_init_globals, NULL);
+ REGISTER_INI_ENTRIES();
+#ifdef EXPERIMENTAL_DATE_SUPPORT
+ date_register_classes(TSRMLS_C);
+#endif
+ REGISTER_STRING_CONSTANT("DATE_ATOM", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_RFC1036", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_RFC1123", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_RFC2822", DATE_FORMAT_RFC2822, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_W3C", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT);
+
+ php_date_global_timezone_db = NULL;
+ php_date_global_timezone_db_enabled = 0;
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION */
+PHP_MSHUTDOWN_FUNCTION(date)
+{
+ UNREGISTER_INI_ENTRIES();
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION */
+PHP_MINFO_FUNCTION(date)
+{
+ timelib_tzdb *tzdb = DATE_TIMEZONEDB;
+
+ php_info_print_table_start();
+ php_info_print_table_row(2, "date/time support", "enabled");
+ php_info_print_table_row(2, "Timezone Database Version", tzdb->version);
+ php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal");
+ php_info_print_table_row(2, "Default timezone", guess_timezone(TSRMLS_C));
+ php_info_print_table_end();
+
+ DISPLAY_INI_ENTRIES();
+}
+/* }}} */
+
+/* {{{ Timezone Cache functions */
+static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, timelib_tzdb *tzdb TSRMLS_DC)
+{
+ timelib_tzinfo *tzi, **ptzi;
+
+ if (zend_hash_find(&DATEG(tzcache), formal_tzname, strlen(formal_tzname) + 1, (void **) &ptzi) == SUCCESS) {
+ return *ptzi;
+ }
+
+ tzi = timelib_parse_tzfile(formal_tzname, tzdb);
+ if (tzi) {
+ zend_hash_add(&DATEG(tzcache), formal_tzname, strlen(formal_tzname) + 1, (void *) &tzi, sizeof(timelib_tzinfo*), NULL);
+ }
+ return tzi;
+}
+/* }}} */
+
+/* {{{ Helper functions */
+static char* guess_timezone(TSRMLS_D)
+{
+ char *env;
+
+ /* Checking configure timezone */
+ if (DATEG(timezone) && (strlen(DATEG(timezone)) > 0)) {
+ return DATEG(timezone);
+ }
+ /* Check environment variable */
+ env = getenv("TZ");
+ if (env && *env) {
+ return env;
+ }
+ /* Check config setting for default timezone */
+ if (DATEG(default_timezone) && (strlen(DATEG(default_timezone)) > 0)) {
+ return DATEG(default_timezone);
+ }
+#if HAVE_TM_ZONE
+ /* Try to guess timezone from system information */
+ {
+ struct tm *ta, tmbuf;
+ time_t the_time;
+ char *tzid;
+
+ the_time = time(NULL);
+ ta = php_localtime_r(&the_time, &tmbuf);
+ tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst);
+ if (! tzid) {
+ tzid = "UTC";
+ }
+
+ php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%s/%.1f/%s' instead", tzid, ta->tm_zone, (float) (ta->tm_gmtoff / 3600), ta->tm_isdst ? "DST" : "no DST");
+ return tzid;
+ }
+#endif
+#ifdef PHP_WIN32
+ {
+ char *tzid;
+ TIME_ZONE_INFORMATION tzi;
+
+ switch (GetTimeZoneInformation(&tzi))
+ {
+ /* no DST or not in effect */
+ case TIME_ZONE_ID_UNKNOWN:
+ case TIME_ZONE_ID_STANDARD:
+php_win_std_time:
+ tzid = timelib_timezone_id_from_abbr("", (tzi.Bias + tzi.StandardBias) * -60, 0);
+ if (! tzid) {
+ tzid = "UTC";
+ }
+ php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/no DST' instead", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0));
+ break;
+
+ /* DST in effect */
+ case TIME_ZONE_ID_DAYLIGHT:
+ /* If user has disabled DST in the control panel, Windows returns 0 here */
+ if (tzi.DaylightBias == 0) {
+ goto php_win_std_time;
+ }
+
+ tzid = timelib_timezone_id_from_abbr("", (tzi.Bias + tzi.DaylightBias) * -60, 1);
+ if (! tzid) {
+ tzid = "UTC";
+ }
+ php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/DST' instead", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0));
+ break;
+ }
+ return tzid;
+ }
+#endif
+ /* Fallback to UTC */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm");
+ return "UTC";
+}
+
+PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D)
+{
+ char *tz;
+ timelib_tzinfo *tzi;
+
+ tz = guess_timezone(TSRMLS_C);
+ tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC);
+ if (! tzi) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone");
+ tzi = php_date_parse_tzfile("UTC", DATE_TIMEZONEDB TSRMLS_CC);
+
+ if (! tzi) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone database is corrupt - this should *never* happen!");
+ }
+ }
+ return tzi;
+}
+/* }}} */
+
+
+/* {{{ date() and gmdate() data */
+#include "ext/standard/php_smart_str.h"
+
+static char *mon_full_names[] = {
+ "January", "February", "March", "April",
+ "May", "June", "July", "August",
+ "September", "October", "November", "December"
+};
+
+static char *mon_short_names[] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
+
+static char *day_full_names[] = {
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
+};
+
+static char *day_short_names[] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
+
+static char *english_suffix(timelib_sll number)
+{
+ if (number >= 10 && number <= 19) {
+ return "th";
+ } else {
+ switch (number % 10) {
+ case 1: return "st";
+ case 2: return "nd";
+ case 3: return "rd";
+ }
+ }
+ return "th";
+}
+/* }}} */
+
+/* {{{ date_format - (gm)date helper */
+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_sll isoweek, isoyear;
+
+ if (!format_len) {
+ return estrdup("");
+ }
+
+ if (localtime) {
+ if (t->zone_type == TIMELIB_ZONETYPE_ABBR) {
+ offset = timelib_time_offset_ctor();
+ offset->offset = (t->z - (t->dst * 60)) * -60;
+ offset->leap_secs = 0;
+ offset->is_dst = t->dst;
+ offset->abbr = strdup(t->tz_abbr);
+ } else if (t->zone_type == TIMELIB_ZONETYPE_OFFSET) {
+ offset = timelib_time_offset_ctor();
+ offset->offset = (t->z - (t->dst * 60)) * -60;
+ offset->leap_secs = 0;
+ offset->is_dst = t->dst;
+ offset->abbr = malloc(9); /* GMT±xxxx\0 */
+ snprintf(offset->abbr, 9, "GMT%c%02d%02d",
+ localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
+ localtime ? abs(offset->offset / 3600) : 0,
+ localtime ? abs((offset->offset % 3600) / 60) : 0 );
+ } else {
+ offset = timelib_get_time_zone_info(t->sse, t->tz_info);
+ }
+ }
+ buffer[32] = '\0';
+ timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear);
+
+ for (i = 0; i < format_len; i++) {
+ 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 '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 '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;
+ case 'z': snprintf(buffer, 32, "%d", (int) timelib_day_of_year(t->y, t->m, t->d)); break;
+
+ /* week */
+ case 'W': snprintf(buffer, 32, "%02d", (int) isoweek); break; /* iso weeknr */
+ case 'o': snprintf(buffer, 32, "%d", (int) isoyear); break; /* iso year */
+
+ /* month */
+ case 'F': snprintf(buffer, 32, "%s", mon_full_names[t->m - 1]); break;
+ case 'm': snprintf(buffer, 32, "%02d", (int) t->m); break;
+ case 'M': snprintf(buffer, 32, "%s", mon_short_names[t->m - 1]); break;
+ case 'n': snprintf(buffer, 32, "%d", (int) t->m); break;
+ case 't': snprintf(buffer, 32, "%d", (int) timelib_days_in_month(t->y, t->m)); break;
+
+ /* year */
+ case 'L': snprintf(buffer, 32, "%d", timelib_is_leap((int) t->y)); break;
+ case 'y': snprintf(buffer, 32, "%02d", (int) t->y % 100); break;
+ case 'Y': snprintf(buffer, 32, "%04d", (int) t->y); break;
+
+ /* time */
+ case 'a': snprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
+ case 'A': snprintf(buffer, 32, "%s", t->h >= 12 ? "PM" : "AM"); break;
+ case 'B': snprintf(buffer, 32, "[B unimplemented]"); break;
+ case 'g': snprintf(buffer, 32, "%d", (t->h % 12) ? (int) t->h % 12 : 12); break;
+ case 'G': snprintf(buffer, 32, "%d", (int) t->h); break;
+ case 'h': snprintf(buffer, 32, "%02d", (t->h % 12) ? (int) t->h % 12 : 12); break;
+ case 'H': snprintf(buffer, 32, "%02d", (int) t->h); break;
+ case 'i': snprintf(buffer, 32, "%02d", (int) t->i); break;
+ case 's': snprintf(buffer, 32, "%02d", (int) t->s); break;
+
+ /* timezone */
+ case 'I': snprintf(buffer, 32, "%d", localtime ? offset->is_dst : 0); break;
+ case 'O': snprintf(buffer, 32, "%c%02d%02d",
+ localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
+ localtime ? abs(offset->offset / 3600) : 0,
+ localtime ? abs((offset->offset % 3600) / 60) : 0
+ );
+ break;
+ case 'T': snprintf(buffer, 32, "%s", localtime ? offset->abbr : "GMT"); break;
+ case 'e': snprintf(buffer, 32, "%s", localtime ? t->tz_info->name : "UTC"); break;
+ case 'Z': snprintf(buffer, 32, "%d", localtime ? offset->offset : 0); break;
+
+ /* full date/time */
+ case 'c': snprintf(buffer, 32, "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
+ (int) t->y, (int) t->m, (int) t->d,
+ (int) t->h, (int) t->i, (int) t->s,
+ localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
+ localtime ? abs(offset->offset / 3600) : 0,
+ localtime ? abs((offset->offset % 3600) / 60) : 0
+ );
+ break;
+ case 'r': 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)],
+ (int) t->d, mon_short_names[t->m - 1],
+ (int) t->y, (int) t->h, (int) t->i, (int) t->s,
+ localtime ? ((offset->offset < 0) ? '-' : '+') : '+',
+ localtime ? abs(offset->offset / 3600) : 0,
+ localtime ? abs((offset->offset % 3600) / 60) : 0
+ );
+ break;
+ case 'U': snprintf(buffer, 32, "%lld", (timelib_sll) t->sse); break;
+
+ case '\\': if (i < format_len) i++; buffer[0] = format[i]; buffer[1] = '\0'; break;
+
+ default: buffer[0] = format[i]; buffer[1] = '\0';
+ }
+ smart_str_appends(&string, buffer);
+ buffer[0] = '\0';
+ }
+
+ smart_str_0(&string);
+
+ if (localtime) {
+ timelib_time_offset_dtor(offset);
+ }
+
+ return string.c;
+}
+
+static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime)
+{
+ char *format;
+ int format_len;
+ time_t ts;
+ char *string;
+
+ if (ZEND_NUM_ARGS() == 1) {
+ ts = time(NULL);
+ }
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ string = php_format_date(format, format_len, ts, localtime TSRMLS_CC);
+
+ RETVAL_STRING(string, 0);
+}
+/* }}} */
+
+PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */
+{
+ timelib_time *t;
+ timelib_tzinfo *tzi;
+ char *string;
+
+ t = timelib_time_ctor();
+
+ if (localtime) {
+ tzi = get_timezone_info(TSRMLS_C);
+ timelib_unixtime2local(t, ts, tzi);
+ } else {
+ tzi = NULL;
+ timelib_unixtime2gmt(t, ts);
+ }
+
+ string = date_format(format, format_len, t, localtime);
+
+ timelib_time_dtor(t);
+ return string;
+}
+/* }}} */
+
+/* {{{ proto string date(string format [, long timestamp])
+ Format a local date/time */
+PHP_FUNCTION(date)
+{
+ php_date(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+/* }}} */
+
+/* {{{ proto string gmdate(string format [, long timestamp])
+ Format a GMT date/time */
+PHP_FUNCTION(gmdate)
+{
+ php_date(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+
+/* {{{ php_date_set_tzdb - NOT THREADSAFE */
+PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb)
+{
+ timelib_tzdb *builtin = timelib_builtin_db();
+
+ if (php_version_compare(tzdb->version, builtin->version) > 0) {
+ php_date_global_timezone_db = tzdb;
+ php_date_global_timezone_db_enabled = 1;
+ }
+}
+/* }}} */
+
+/* {{{ php_parse_date: Backwards compability function */
+signed long php_parse_date(char *string, signed long *now)
+{
+ timelib_time *parsed_time;
+ int error1, error2;
+ signed long retval;
+
+ parsed_time = timelib_strtotime(string, &error1, DATE_TIMEZONEDB);
+ timelib_update_ts(parsed_time, NULL);
+ retval = timelib_date_to_int(parsed_time, &error2);
+ timelib_time_dtor(parsed_time);
+ if (error1 || error2) {
+ return -1;
+ }
+ return retval;
+}
+/* }}} */
+
+
+/* {{{ proto int strtotime(string time, int now)
+ Convert string representation of date and time to a timestamp */
+PHP_FUNCTION(strtotime)
+{
+ char *times, *initial_ts;
+ int time_len, error1, error2;
+ long preset_ts, ts;
+
+ timelib_time *t, *now;
+ timelib_tzinfo *tzi;
+
+ tzi = get_timezone_info(TSRMLS_C);
+
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sl", &times, &time_len, &preset_ts) != FAILURE) {
+ /* We have an initial timestamp */
+ now = timelib_time_ctor();
+
+ initial_ts = emalloc(25);
+ snprintf(initial_ts, 24, "@%lu", preset_ts);
+ t = timelib_strtotime(initial_ts, &error1, DATE_TIMEZONEDB); /* we ignore the error here, as this should never fail */
+ timelib_update_ts(t, tzi);
+ timelib_unixtime2local(now, t->sse, tzi);
+ timelib_time_dtor(t);
+ efree(initial_ts);
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &times, &time_len) != FAILURE) {
+ /* We have no initial timestamp */
+ now = timelib_time_ctor();
+ timelib_unixtime2local(now, (timelib_sll) time(NULL), tzi);
+ } else {
+ RETURN_FALSE;
+ }
+
+ t = timelib_strtotime(times, &error1, DATE_TIMEZONEDB);
+ timelib_fill_holes(t, now, 0);
+ timelib_update_ts(t, tzi);
+ ts = timelib_date_to_int(t, &error2);
+
+ /* if tz_info is not a copy, avoid double free */
+ if (now->tz_info != tzi) {
+ timelib_tzinfo_dtor(now->tz_info);
+ }
+ if (t->tz_info != tzi) {
+ timelib_tzinfo_dtor(t->tz_info);
+ }
+
+ timelib_time_dtor(now);
+ timelib_time_dtor(t);
+
+ if (error1 || error2) {
+ RETURN_FALSE;
+ } else {
+ RETURN_LONG(ts);
+ }
+}
+/* }}} */
+
+
+/* {{{ php_mktime - (gm)mktime helper */
+PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
+{
+ long hou, min, sec, mon, day, yea, dst = -1;
+ timelib_time *now;
+ timelib_tzinfo *tzi;
+ long ts, adjust_seconds = 0;
+ int error;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) {
+ RETURN_FALSE;
+ }
+ /* Initialize structure with current time */
+ now = timelib_time_ctor();
+ if (gmt) {
+ timelib_unixtime2gmt(now, (timelib_sll) time(NULL));
+ } else {
+ tzi = get_timezone_info(TSRMLS_C);
+ timelib_unixtime2local(now, (timelib_sll) time(NULL), tzi);
+ }
+ /* Fill in the new data */
+ switch (ZEND_NUM_ARGS()) {
+ case 7:
+ /* break intentionally missing */
+ case 6:
+ if (yea >= 0 && yea < 70) {
+ yea += 2000;
+ } else if (yea >= 70 && yea <= 100) {
+ yea += 1900;
+ }
+ now->y = yea;
+ /* break intentionally missing again */
+ case 5:
+ now->d = day;
+ /* break missing intentionally here too */
+ case 4:
+ now->m = mon;
+ /* and here */
+ case 3:
+ now->s = sec;
+ /* yup, this break isn't here on purpose too */
+ case 2:
+ now->i = min;
+ /* last intentionally missing break */
+ case 1:
+ now->h = hou;
+ break;
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead");
+ }
+ /* Update the timestamp */
+ if (gmt) {
+ timelib_update_ts(now, NULL);
+ } else {
+ timelib_update_ts(now, tzi);
+ }
+ /* Support for the deprecated is_dst parameter */
+ if (dst != -1) {
+ php_error_docref(NULL TSRMLS_CC, E_STRICT, "The is_dst parameter is deprecated");
+ if (gmt) {
+ /* GMT never uses DST */
+ if (dst == 1) {
+ adjust_seconds = -3600;
+ }
+ } else {
+ /* Figure out is_dst for current TS */
+ timelib_time_offset *tmp_offset;
+ tmp_offset = timelib_get_time_zone_info(now->sse, tzi);
+ if (dst == 1 && tmp_offset->is_dst == 0) {
+ adjust_seconds = -3600;
+ }
+ if (dst == 0 && tmp_offset->is_dst == 1) {
+ adjust_seconds = +3600;
+ }
+ timelib_time_offset_dtor(tmp_offset);
+ }
+ }
+ /* Clean up and return */
+ ts = timelib_date_to_int(now, &error);
+ ts += adjust_seconds;
+ timelib_time_dtor(now);
+
+ if (error) {
+ RETURN_FALSE;
+ } else {
+ RETURN_LONG(ts);
+ }
+}
+/* }}} */
+
+/* {{{ proto int mktime(int hour, int min, int sec, int mon, int day, int year)
+ Get UNIX timestamp for a date */
+PHP_FUNCTION(mktime)
+{
+ php_mktime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+
+/* {{{ proto int gmmktime(int hour, int min, int sec, int mon, int day, int year)
+ Get UNIX timestamp for a GMT date */
+PHP_FUNCTION(gmmktime)
+{
+ php_mktime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+/* }}} */
+
+
+/* {{{ proto bool checkdate(int month, int day, int year)
+ Returns true(1) if it is a valid date in gregorian calendar */
+PHP_FUNCTION(checkdate)
+{
+ long m, d, y;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &m, &d, &y) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if (y < 1 || y > 32767 || m < 1 || m > 12 || d < 1 || d > timelib_days_in_month(y, m)) {
+ RETURN_FALSE;
+ }
+ RETURN_TRUE; /* True : This month, day, year arguments are valid */
+}
+/* }}} */
+
+#ifdef HAVE_STRFTIME
+/* {{{ php_strftime - (gm)strftime helper */
+PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
+{
+ char *format, *buf;
+ int format_len;
+ long timestamp;
+ struct tm ta;
+ int max_reallocs = 5;
+ size_t buf_len = 64, real_len;
+ timelib_time *ts;
+ timelib_tzinfo *tzi;
+ timelib_time_offset *offset;
+
+ timestamp = (long) time(NULL);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &timestamp) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if (format_len == 0) {
+ RETURN_FALSE;
+ }
+
+ ts = timelib_time_ctor();
+ if (gmt) {
+ tzi = NULL;
+ timelib_unixtime2gmt(ts, (timelib_sll) timestamp);
+ } else {
+ tzi = get_timezone_info(TSRMLS_C);
+ timelib_unixtime2local(ts, (timelib_sll) timestamp, tzi);
+ }
+ ta.tm_sec = ts->s;
+ ta.tm_min = ts->i;
+ ta.tm_hour = ts->h;
+ ta.tm_mday = ts->d;
+ ta.tm_mon = ts->m - 1;
+ ta.tm_year = ts->y - 1900;
+ ta.tm_wday = timelib_day_of_week(ts->y, ts->m, ts->d);
+ ta.tm_yday = timelib_day_of_year(ts->y, ts->m, ts->d);
+ if (gmt) {
+ ta.tm_isdst = 0;
+#if HAVE_TM_GMTOFF
+ ta.tm_gmtoff = 0;
+#endif
+#if HAVE_TM_ZONE
+ ta.tm_zone = "GMT";
+#endif
+ } else {
+ offset = timelib_get_time_zone_info(timestamp, tzi);
+
+ ta.tm_isdst = offset->is_dst;
+#if HAVE_TM_GMTOFF
+ ta.tm_gmtoff = offset->offset;
+#endif
+#if HAVE_TM_ZONE
+ ta.tm_zone = offset->abbr;
+#endif
+ }
+
+ buf = (char *) emalloc(buf_len);
+ while ((real_len=strftime(buf, buf_len, format, &ta))==buf_len || real_len==0) {
+ buf_len *= 2;
+ buf = (char *) erealloc(buf, buf_len);
+ if (!--max_reallocs) {
+ break;
+ }
+ }
+
+ timelib_time_dtor(ts);
+ if (!gmt) {
+ timelib_time_offset_dtor(offset);
+ }
+
+ if (real_len && real_len != buf_len) {
+ buf = (char *) erealloc(buf, real_len + 1);
+ RETURN_STRINGL(buf, real_len, 0);
+ }
+ efree(buf);
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto string strftime(string format [, int timestamp])
+ Format a local time/date according to locale settings */
+PHP_FUNCTION(strftime)
+{
+ php_strftime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+
+/* {{{ proto string gmstrftime(string format [, int timestamp])
+ Format a GMT/UCT time/date according to locale settings */
+PHP_FUNCTION(gmstrftime)
+{
+ php_strftime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+/* }}} */
+#endif
+
+/* {{{ proto int time(void)
+ Return current UNIX timestamp */
+PHP_FUNCTION(time)
+{
+ RETURN_LONG((long)time(NULL));
+}
+/* }}} */
+
+/* {{{ proto array localtime([int timestamp [, bool associative_array]])
+ Returns the results of the C system call localtime as an associative array if the associative_array argument is set to 1 other wise it is a regular array */
+PHP_FUNCTION(localtime)
+{
+ long timestamp = (long)time(NULL);
+ int associative = 0;
+ timelib_tzinfo *tzi;
+ timelib_time *ts;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lb", &timestamp, &associative) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ tzi = get_timezone_info(TSRMLS_C);
+ ts = timelib_time_ctor();
+ timelib_unixtime2local(ts, (timelib_sll) timestamp, tzi);
+
+ array_init(return_value);
+
+ if (associative) {
+ add_assoc_long(return_value, "tm_sec", ts->s);
+ add_assoc_long(return_value, "tm_min", ts->i);
+ add_assoc_long(return_value, "tm_hour", ts->h);
+ add_assoc_long(return_value, "tm_mday", ts->d);
+ add_assoc_long(return_value, "tm_mon", ts->m - 1);
+ add_assoc_long(return_value, "tm_year", ts->y - 1900);
+ add_assoc_long(return_value, "tm_wday", timelib_day_of_week(ts->y, ts->m, ts->d));
+ add_assoc_long(return_value, "tm_yday", timelib_day_of_year(ts->y, ts->m, ts->d));
+ add_assoc_long(return_value, "tm_isdst", ts->dst);
+ } else {
+ add_next_index_long(return_value, ts->s);
+ add_next_index_long(return_value, ts->i);
+ add_next_index_long(return_value, ts->h);
+ add_next_index_long(return_value, ts->d);
+ add_next_index_long(return_value, ts->m - 1);
+ add_next_index_long(return_value, ts->y- 1900);
+ add_next_index_long(return_value, timelib_day_of_week(ts->y, ts->m, ts->d));
+ add_next_index_long(return_value, timelib_day_of_year(ts->y, ts->m, ts->d));
+ add_next_index_long(return_value, ts->dst);
+ }
+
+ timelib_time_dtor(ts);
+}
+/* }}} */
+
+/* {{{ proto array getdate([int timestamp])
+ Get date/time information */
+PHP_FUNCTION(getdate)
+{
+ long timestamp = (long)time(NULL);
+ timelib_tzinfo *tzi;
+ timelib_time *ts;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &timestamp) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ tzi = get_timezone_info(TSRMLS_C);
+ ts = timelib_time_ctor();
+ timelib_unixtime2local(ts, (timelib_sll) timestamp, tzi);
+
+ array_init(return_value);
+
+ add_assoc_long(return_value, "seconds", ts->s);
+ add_assoc_long(return_value, "minutes", ts->i);
+ add_assoc_long(return_value, "hours", ts->h);
+ add_assoc_long(return_value, "mday", ts->d);
+ add_assoc_long(return_value, "wday", timelib_day_of_week(ts->y, ts->m, ts->d));
+ add_assoc_long(return_value, "mon", ts->m);
+ add_assoc_long(return_value, "year", ts->y);
+ add_assoc_long(return_value, "yday", timelib_day_of_year(ts->y, ts->m, ts->d));
+ add_assoc_string(return_value, "weekday", day_full_names[timelib_day_of_week(ts->y, ts->m, ts->d)], 1);
+ add_assoc_string(return_value, "month", mon_full_names[ts->m - 1], 1);
+ add_index_long(return_value, 0, timestamp);
+
+ timelib_time_dtor(ts);
+}
+/* }}} */
+
+#ifdef EXPERIMENTAL_DATE_SUPPORT
+static void date_register_classes(TSRMLS_D)
+{
+ zend_class_entry ce_date, ce_timezone;
+
+ INIT_CLASS_ENTRY(ce_date, "date", date_funcs_date);
+ ce_date.create_object = date_object_new_date;
+ date_ce_date = zend_register_internal_class_ex(&ce_date, NULL, NULL TSRMLS_CC);
+ memcpy(&date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ date_object_handlers_date.clone_obj = NULL;
+
+#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_ISO8601);
+ REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC1123);
+ 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("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("RSS", DATE_FORMAT_RFC1123);
+ REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_ISO8601);
+
+
+ INIT_CLASS_ENTRY(ce_timezone, "timezone", date_funcs_timezone);
+ ce_timezone.create_object = date_object_new_timezone;
+ date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL, NULL TSRMLS_CC);
+ memcpy(&date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ date_object_handlers_timezone.clone_obj = NULL;
+}
+
+static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC)
+{
+ php_date_obj *intern;
+ zend_object_value retval;
+ zval *tmp;
+
+ intern = emalloc(sizeof(php_date_obj));
+ memset(intern, 0, sizeof(php_date_obj));
+ intern->std.ce = class_type;
+
+ ALLOC_HASHTABLE(intern->std.properties);
+ zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_date, NULL TSRMLS_CC);
+ retval.handlers = &date_object_handlers_date;
+
+ return retval;
+}
+
+static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC)
+{
+ php_timezone_obj *intern;
+ zend_object_value retval;
+ zval *tmp;
+
+ intern = emalloc(sizeof(php_timezone_obj));
+ memset(intern, 0, sizeof(php_timezone_obj));
+ intern->std.ce = class_type;
+
+ ALLOC_HASHTABLE(intern->std.properties);
+ zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL TSRMLS_CC);
+ retval.handlers = &date_object_handlers_timezone;
+
+ return retval;
+}
+
+static void date_object_free_storage_date(void *object TSRMLS_DC)
+{
+ php_date_obj *intern = (php_date_obj *)object;
+
+ if (intern->time) {
+ if (intern->time->tz_info) {
+ timelib_tzinfo_dtor(intern->time->tz_info);
+ }
+ timelib_time_dtor(intern->time);
+ }
+
+ if (intern->std.properties) {
+ zend_hash_destroy(intern->std.properties);
+ efree(intern->std.properties);
+ intern->std.properties = NULL;
+ }
+
+ efree(object);
+}
+
+static void date_object_free_storage_timezone(void *object TSRMLS_DC)
+{
+ php_date_obj *intern = (php_date_obj *)object;
+
+ if (intern->std.properties) {
+ zend_hash_destroy(intern->std.properties);
+ efree(intern->std.properties);
+ intern->std.properties = NULL;
+ }
+
+ efree(object);
+}
+
+/* Advanced Interface */
+static zval * date_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC)
+{
+ if (!object) {
+ ALLOC_ZVAL(object);
+ }
+
+ Z_TYPE_P(object) = IS_OBJECT;
+ object_init_ex(object, pce);
+ object->refcount = 1;
+ object->is_ref = 1;
+ return object;
+}
+
+PHP_FUNCTION(date_create)
+{
+ php_date_obj *dateobj;
+ zval *timezone_object = NULL;
+ int error;
+ timelib_time *now;
+ timelib_tzinfo *tzi;
+ char *time_str;
+ int time_str_len = 0, free_tzi = 0;;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ date_instanciate(date_ce_date, return_value TSRMLS_CC);
+ dateobj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
+ dateobj->time = timelib_strtotime(time_str_len ? time_str : "now", &error, DATE_TIMEZONEDB);
+
+ if (timezone_object) {
+ php_timezone_obj *tzobj;
+
+ tzobj = (php_timezone_obj *) zend_object_store_get_object(timezone_object TSRMLS_CC);
+ tzi = timelib_tzinfo_clone(tzobj->tz);
+ free_tzi = 1;
+ } else if (dateobj->time->tz_info) {
+ tzi = timelib_tzinfo_clone(dateobj->time->tz_info);
+ free_tzi = 1;
+ } else {
+ tzi = get_timezone_info(TSRMLS_C);
+ }
+
+ now = timelib_time_ctor();
+ timelib_unixtime2local(now, (timelib_sll) time(NULL), tzi);
+
+ timelib_fill_holes(dateobj->time, now, 0);
+ timelib_update_ts(dateobj->time, tzi);
+
+ if (now->tz_info != tzi) {
+ timelib_tzinfo_dtor(now->tz_info);
+ }
+ if (free_tzi) {
+ timelib_tzinfo_dtor(tzi);
+ }
+ timelib_time_dtor(now);
+}
+
+PHP_FUNCTION(date_format)
+{
+ zval *object;
+ php_date_obj *dateobj;
+ char *format;
+ int format_len;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &format, &format_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ RETURN_STRING(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime), 0);
+}
+
+PHP_FUNCTION(date_modify)
+{
+ zval *object;
+ php_date_obj *dateobj;
+ char *modify;
+ int modify_len;
+ int error;
+ timelib_time *tmp_time;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &modify, &modify_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+
+ tmp_time = timelib_strtotime(modify, &error, DATE_TIMEZONEDB);
+ dateobj->time->relative.y = tmp_time->relative.y;
+ dateobj->time->relative.m = tmp_time->relative.m;
+ dateobj->time->relative.d = tmp_time->relative.d;
+ dateobj->time->relative.h = tmp_time->relative.h;
+ dateobj->time->relative.i = tmp_time->relative.i;
+ dateobj->time->relative.s = tmp_time->relative.s;
+ dateobj->time->relative.weekday = tmp_time->relative.weekday;
+ dateobj->time->have_relative = tmp_time->have_relative;
+ dateobj->time->have_weekday_relative = tmp_time->have_weekday_relative;
+ dateobj->time->sse_uptodate = 0;
+ timelib_time_dtor(tmp_time);
+
+ timelib_update_ts(dateobj->time, NULL);
+ timelib_update_from_sse(dateobj->time);
+}
+
+PHP_FUNCTION(date_timezone_get)
+{
+ zval *object;
+ php_date_obj *dateobj;
+ php_timezone_obj *tzobj;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_date) == FAILURE) {
+ RETURN_FALSE;
+ }
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ if (dateobj->time->is_localtime && dateobj->time->tz_info) {
+ date_instanciate(date_ce_timezone, return_value TSRMLS_CC);
+ tzobj = (php_timezone_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
+ tzobj->tz = timelib_tzinfo_clone(dateobj->time->tz_info);
+ } else {
+ RETURN_FALSE;
+ }
+}
+
+PHP_FUNCTION(date_timezone_set)
+{
+ zval *object;
+ zval *timezone_object;
+ php_date_obj *dateobj;
+ php_timezone_obj *tzobj;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) {
+ RETURN_FALSE;
+ }
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ tzobj = (php_timezone_obj *) zend_object_store_get_object(timezone_object TSRMLS_CC);
+ if (dateobj->time->tz_info) {
+ timelib_tzinfo_dtor(dateobj->time->tz_info);
+ }
+ timelib_set_timezone(dateobj->time, timelib_tzinfo_clone(tzobj->tz));
+ timelib_unixtime2local(dateobj->time, dateobj->time->sse, dateobj->time->tz_info);
+}
+
+PHP_FUNCTION(date_offset_get)
+{
+ zval *object;
+ php_date_obj *dateobj;
+ timelib_time_offset *offset;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_date) == FAILURE) {
+ RETURN_FALSE;
+ }
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ if (dateobj->time->is_localtime && dateobj->time->tz_info) {
+ offset = timelib_get_time_zone_info(dateobj->time->sse, dateobj->time->tz_info);
+ RETVAL_LONG(offset->offset);
+ timelib_time_offset_dtor(offset);
+ return;
+ } else {
+ RETURN_LONG(0);
+ }
+}
+
+PHP_FUNCTION(date_time_set)
+{
+ zval *object;
+ php_date_obj *dateobj;
+ long h, i, s = 0;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &h, &i, &s) == FAILURE) {
+ RETURN_FALSE;
+ }
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ dateobj->time->h = h;
+ dateobj->time->i = i;
+ dateobj->time->s = s;
+ timelib_update_ts(dateobj->time, NULL);
+}
+
+PHP_FUNCTION(date_date_set)
+{
+ zval *object;
+ php_date_obj *dateobj;
+ long y, m, d;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olll", &object, date_ce_date, &y, &m, &d) == FAILURE) {
+ RETURN_FALSE;
+ }
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ dateobj->time->y = y;
+ dateobj->time->m = m;
+ dateobj->time->d = d;
+ timelib_update_ts(dateobj->time, NULL);
+}
+
+PHP_FUNCTION(date_isodate_set)
+{
+ zval *object;
+ php_date_obj *dateobj;
+ long y, w, d = 1;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &y, &w, &d) == FAILURE) {
+ RETURN_FALSE;
+ }
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ dateobj->time->y = y;
+ dateobj->time->m = 1;
+ dateobj->time->d = 1;
+ dateobj->time->relative.d = timelib_daynr_from_weeknr(y, w, d);
+ dateobj->time->have_relative = 1;
+
+ timelib_update_ts(dateobj->time, NULL);
+}
+
+
+PHP_FUNCTION(timezone_open)
+{
+ php_timezone_obj *tzobj;
+ char *tz;
+ int tz_len;
+ timelib_tzinfo *tzi = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+ /* Try finding the tz information as "Timezone Abbreviation" */
+ if (!tzi) {
+ char *tzid;
+
+ tzid = timelib_timezone_id_from_abbr(tz, -1, 0);
+ if (tzid) {
+ tzi = php_date_parse_tzfile(tzid, DATE_TIMEZONEDB TSRMLS_CC);
+ }
+ }
+ /* Try finding the tz information as "Timezone Identifier" */
+ if (!tzi) {
+ tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC);
+ }
+ /* If we find it we instantiate the object otherwise, well, we don't and return false */
+ if (tzi) {
+ date_instanciate(date_ce_timezone, return_value TSRMLS_CC);
+ tzobj = (php_timezone_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
+ tzobj->tz = tzi;
+ } else {
+ RETURN_FALSE;
+ }
+}
+
+PHP_FUNCTION(timezone_name_get)
+{
+ zval *object;
+ php_timezone_obj *tzobj;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) {
+ RETURN_FALSE;
+ }
+ tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC);
+
+ RETURN_STRING(tzobj->tz->name, 1);
+}
+
+PHP_FUNCTION(timezone_offset_get)
+{
+ zval *object, *dateobject;
+ php_timezone_obj *tzobj;
+ php_date_obj *dateobj;
+ timelib_time_offset *offset;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_date) == FAILURE) {
+ RETURN_FALSE;
+ }
+ tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC);
+
+ offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tz);
+ RETVAL_LONG(offset->offset);
+ timelib_time_offset_dtor(offset);
+}
+
+PHP_FUNCTION(timezone_transistions_get)
+{
+ zval *object, *element;
+ php_timezone_obj *tzobj;
+ int i;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) {
+ RETURN_FALSE;
+ }
+ tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC);
+
+ array_init(return_value);
+ for (i = 0; i < tzobj->tz->timecnt; ++i) {
+ MAKE_STD_ZVAL(element);
+ array_init(element);
+ add_assoc_long(element, "ts", tzobj->tz->trans[i]);
+ add_assoc_string(element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, tzobj->tz->trans[i], 0 TSRMLS_CC), 0);
+ add_assoc_long(element, "offset", tzobj->tz->type[tzobj->tz->trans_idx[i]].offset);
+ add_assoc_bool(element, "isdst", tzobj->tz->type[tzobj->tz->trans_idx[i]].isdst);
+ add_assoc_string(element, "abbr", &tzobj->tz->timezone_abbr[tzobj->tz->type[tzobj->tz->trans_idx[i]].abbr_idx], 1);
+
+ add_next_index_zval(return_value, element);
+ }
+}
+
+PHP_FUNCTION(timezone_identifiers_list)
+{
+ timelib_tzdb *tzdb;
+ timelib_tzdb_index_entry *table;
+ int i, item_count;
+
+ tzdb = DATE_TIMEZONEDB;
+ item_count = tzdb->index_size;
+ table = tzdb->index;
+
+ array_init(return_value);
+
+ for (i = 0; i < item_count; ++i) {
+ add_next_index_string(return_value, table[i].id, 1);
+ };
+}
+
+PHP_FUNCTION(timezone_abbreviations_list)
+{
+ timelib_tz_lookup_table *table, *entry;
+ zval *element, **abbr_array_pp, *abbr_array;
+
+ table = timelib_timezone_abbreviations_list();
+ array_init(return_value);
+ entry = table;
+
+ do {
+ MAKE_STD_ZVAL(element);
+ array_init(element);
+ add_assoc_bool(element, "dst", entry->type);
+ add_assoc_long(element, "offset", entry->gmtoffset);
+ if (entry->full_tz_name) {
+ add_assoc_string(element, "timezone_id", entry->full_tz_name, 1);
+ } else {
+ add_assoc_null(element, "timezone_id");
+ }
+
+ if (zend_hash_find(HASH_OF(return_value), entry->name, strlen(entry->name) + 1, (void **) &abbr_array_pp) == FAILURE) {
+ MAKE_STD_ZVAL(abbr_array);
+ array_init(abbr_array);
+ add_assoc_zval(return_value, entry->name, abbr_array);
+ } else {
+ abbr_array = *abbr_array_pp;
+ }
+ add_next_index_zval(abbr_array, element);
+ entry++;
+ } while (entry->name);
+}
+#endif
+
+
+/* {{{ proto bool date_default_timezone_set(string timezone_identifier)
+ Sets the default timezone used by all date/time functions in a script */
+PHP_FUNCTION(date_default_timezone_set)
+{
+ char *zone;
+ int zone_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &zone, &zone_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+ if (DATEG(timezone)) {
+ efree(DATEG(timezone));
+ DATEG(timezone) = NULL;
+ }
+ DATEG(timezone) = estrndup(zone, zone_len);
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto string date_default_timezone_get()
+ Gets the default timezone used by all date/time functions in a script */
+PHP_FUNCTION(date_default_timezone_get)
+{
+ timelib_tzinfo *default_tz;
+
+ default_tz = get_timezone_info(TSRMLS_C);
+ RETVAL_STRING(default_tz->name, 1);
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: fdm=marker
+ * vim: noet sw=4 ts=4
+ */
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
new file mode 100644
index 000000000..5c2dc352a
--- /dev/null
+++ b/ext/date/php_date.h
@@ -0,0 +1,104 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable 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@derickrethans.nl> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_date.h,v 1.17.2.5 2005/11/20 20:14:24 derick Exp $ */
+
+#ifndef PHP_DATE_H
+#define PHP_DATE_H
+
+#include "lib/timelib.h"
+#include "Zend/zend_hash.h"
+
+extern zend_module_entry date_module_entry;
+#define phpext_date_ptr &date_module_entry
+
+PHP_FUNCTION(date);
+PHP_FUNCTION(gmdate);
+PHP_FUNCTION(strtotime);
+
+PHP_FUNCTION(mktime);
+PHP_FUNCTION(gmmktime);
+
+PHP_FUNCTION(checkdate);
+
+#ifdef HAVE_STRFTIME
+PHP_FUNCTION(strftime);
+PHP_FUNCTION(gmstrftime);
+#endif
+
+PHP_FUNCTION(time);
+PHP_FUNCTION(localtime);
+PHP_FUNCTION(getdate);
+
+#ifdef EXPERIMENTAL_DATE_SUPPORT
+/* Advanced Interface */
+PHP_FUNCTION(date_create);
+PHP_FUNCTION(date_format);
+PHP_FUNCTION(date_modify);
+PHP_FUNCTION(date_timezone_get);
+PHP_FUNCTION(date_timezone_set);
+PHP_FUNCTION(date_offset_get);
+
+PHP_FUNCTION(date_time_set);
+PHP_FUNCTION(date_date_set);
+PHP_FUNCTION(date_isodate_set);
+
+PHP_FUNCTION(timezone_open);
+PHP_FUNCTION(timezone_name_get);
+PHP_FUNCTION(timezone_offset_get);
+PHP_FUNCTION(timezone_transistions_get);
+PHP_FUNCTION(timezone_identifiers_list);
+PHP_FUNCTION(timezone_abbreviations_list);
+#endif
+
+/* Options and Configuration */
+PHP_FUNCTION(date_default_timezone_set);
+PHP_FUNCTION(date_default_timezone_get);
+
+PHP_RINIT_FUNCTION(date);
+PHP_RSHUTDOWN_FUNCTION(date);
+PHP_MINIT_FUNCTION(date);
+PHP_MSHUTDOWN_FUNCTION(date);
+PHP_MINFO_FUNCTION(date);
+
+ZEND_BEGIN_MODULE_GLOBALS(date)
+ char *default_timezone;
+ char *timezone;
+ HashTable tzcache;
+ZEND_END_MODULE_GLOBALS(date)
+
+#ifdef ZTS
+#define DATEG(v) TSRMG(date_globals_id, zend_date_globals *, v)
+#else
+#define DATEG(v) (date_globals.v)
+#endif
+
+/* Backwards compability wrapper */
+signed long php_parse_date(char *string, signed long *now);
+PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
+#if HAVE_STRFTIME
+#define _php_strftime php_strftime
+PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);
+#endif
+PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC);
+
+/* Mechanism to set new TZ database */
+PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb);
+PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D);
+
+#endif /* PHP_DATE_H */
diff --git a/ext/standard/tests/time/002.phpt b/ext/date/tests/002.phpt
index 78cfad9fb..7384b7424 100644
--- a/ext/standard/tests/time/002.phpt
+++ b/ext/date/tests/002.phpt
@@ -2,9 +2,6 @@
strtotime() function
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip Windows does not support dates prior to midnight (00:00:00), January 1, 1970');
-}
if (!@putenv("TZ=EST5") || getenv("TZ") != 'EST5') {
die("skip unable to change TZ enviroment variable\n");
}
@@ -51,7 +48,7 @@ if (!@putenv("TZ=EST5") || getenv("TZ") != 'EST5') {
echo date ("Y-m-d H:i:s\n", strtotime ($date));
}
?>
---EXPECT--
+--EXPECTF--
*** GMT0
1999-10-13 00:00:00
1999-10-13 00:00:00
@@ -61,7 +58,7 @@ if (!@putenv("TZ=EST5") || getenv("TZ") != 'EST5') {
2001-12-21 00:00:00
2001-12-21 12:16:00
2001-12-21 12:16:00
-1969-12-31 23:59:59
+%d-12-21 12:16:00
2001-10-22 21:19:58
2001-10-22 23:19:58
2001-10-22 23:32:58
@@ -82,7 +79,7 @@ if (!@putenv("TZ=EST5") || getenv("TZ") != 'EST5') {
2001-12-21 00:00:00
2001-12-21 12:16:00
2001-12-21 12:16:00
-1969-12-31 18:59:59
+%d-12-21 12:16:00
2001-10-22 21:19:58
2001-10-22 19:19:58
2001-10-22 19:32:58
diff --git a/ext/standard/tests/time/bug13142.phpt b/ext/date/tests/bug13142.phpt
index 25bf11589..5e54263c5 100644
--- a/ext/standard/tests/time/bug13142.phpt
+++ b/ext/date/tests/bug13142.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #13142 strtotime handling of "M d H:i:s Y" format
+Bug #13142 (strtotime handling of "M d H:i:s Y" format)
--SKIPIF--
<?php
if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
diff --git a/ext/date/tests/bug14561.phpt b/ext/date/tests/bug14561.phpt
new file mode 100644
index 000000000..e2b6ef098
--- /dev/null
+++ b/ext/date/tests/bug14561.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #14561 (strtotime() bug)
+--FILE--
+<?php
+putenv("TZ=GMT");
+echo strtotime("19:30 Dec 17"), "\n";
+echo strtotime("Dec 17 19:30"), "\n";
+?>
+--EXPECT--
+1134847800
+1134847800
diff --git a/ext/standard/tests/time/bug17988.phpt b/ext/date/tests/bug17988.phpt
index 5fbc3c845..259fa7dc2 100644
--- a/ext/standard/tests/time/bug17988.phpt
+++ b/ext/date/tests/bug17988.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #17988 strtotime handling of postgresql timestamps
+Bug #17988 (strtotime handling of postgresql timestamps)
--FILE--
<?php
putenv("TZ=GMT");
diff --git a/ext/standard/tests/time/bug20382.phpt b/ext/date/tests/bug20382-1.phpt
index 4da8c2110..a259d934a 100644
--- a/ext/standard/tests/time/bug20382.phpt
+++ b/ext/date/tests/bug20382-1.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #20382 (strtotime ("Monday", $date) produces wrong result on DST changeover)
+Bug #20382 [1] (strtotime ("Monday", $date) produces wrong result on DST changeover)
--FILE--
<?php
putenv("TZ=Europe/Amsterdam");
diff --git a/ext/date/tests/bug20382-2.phpt b/ext/date/tests/bug20382-2.phpt
new file mode 100644
index 000000000..6e6a1ba6f
--- /dev/null
+++ b/ext/date/tests/bug20382-2.phpt
@@ -0,0 +1,170 @@
+--TEST--
+Bug #20382 [2] (strtotime ("Monday", $date) produces wrong result on DST changeover)
+--FILE--
+<?php
+
+$tests = array(
+ array("Europe/Andorra", 17, 17, 17, 1, 24764, 1970),
+ array("Asia/Dubai", 17, 17, 17, 1, 1, 1970),
+ array("Asia/Kabul", 17, 17, 17, 1, 1, 1970),
+ array("America/Antigua", 17, 17, 17, 1, 1, 1970),
+ array("America/Anguilla", 17, 17, 17, 1, 1, 1970),
+ array("Europe/Tirane", 17, 17, 17, 1, 4849, 1970),
+ array("Asia/Yerevan", 17, 17, 17, 1, 24764, 1970),
+ array("America/Curacao", 17, 17, 17, 1, 1, 1970),
+ array("Africa/Luanda", 17, 17, 17, 1, 1, 1970),
+ array("Antarctica/McMurdo", 17, 17, 17, 1, 24743, 1970),
+ array("Australia/Adelaide", 17, 17, 17, 1, 1, 1971),
+ array("Australia/Darwin", 17, 17, 17, 1, 88, 1971),
+ array("Australia/Perth", 17, 17, 17, 1, 1, 1971),
+ array("America/Aruba", 17, 17, 17, 1, 88, 1971),
+ array("Asia/Baku", 17, 17, 17, 1, 1, 1971),
+ array("Europe/Sarajevo", 17, 17, 17, 1, 1, 1971),
+ array("America/Barbados", 17, 17, 17, 1, 1, 1971),
+ array("Asia/Dacca", 17, 17, 17, 1, 1, 1971),
+ array("Europe/Brussels", 17, 17, 17, 1, 1, 1971),
+ array("Africa/Ouagadougou", 17, 17, 17, 1, 88, 1971),
+ array("Europe/Tirane", 17, 17, 17, 1, 4849, 1970),
+ array("America/Buenos_Aires", 17, 17, 17, 1, 1734, 1970),
+ array("America/Rosario", 17, 17, 17, 1, 1734, 1970),
+ array("Europe/Vienna", 17, 17, 17, 1, 3743, 1970),
+ array("Asia/Baku", 17, 17, 17, 1, 9490, 1970),
+);
+
+foreach ($tests as $test) {
+ putenv("TZ={$test[0]}");
+ print "{$test[0]}\n";
+ array_shift($test);
+ $timestamp = call_user_func_array('mktime', $test);
+
+ print "ts = ". date("l Y-m-d H:i:s T", $timestamp). "\n";
+ $strtotime_tstamp = strtotime("first monday", $timestamp);
+ print "result = ".date("l Y-m-d H:i:s T", $strtotime_tstamp)."\n";
+ print "wanted = Monday 00:00:00\n\n";
+}
+?>
+--EXPECT--
+Europe/Andorra
+ts = Monday 2037-10-19 17:17:17 CEST
+result = Monday 2037-10-26 00:00:00 CET
+wanted = Monday 00:00:00
+
+Asia/Dubai
+ts = Thursday 1970-01-01 17:17:17 GST
+result = Monday 1970-01-05 00:00:00 GST
+wanted = Monday 00:00:00
+
+Asia/Kabul
+ts = Thursday 1970-01-01 17:17:17 AFT
+result = Monday 1970-01-05 00:00:00 AFT
+wanted = Monday 00:00:00
+
+America/Antigua
+ts = Thursday 1970-01-01 17:17:17 AST
+result = Monday 1970-01-05 00:00:00 AST
+wanted = Monday 00:00:00
+
+America/Anguilla
+ts = Thursday 1970-01-01 17:17:17 AST
+result = Monday 1970-01-05 00:00:00 AST
+wanted = Monday 00:00:00
+
+Europe/Tirane
+ts = Monday 1983-04-11 17:17:17 CET
+result = Monday 1983-04-18 01:00:00 CEST
+wanted = Monday 00:00:00
+
+Asia/Yerevan
+ts = Monday 2037-10-19 17:17:17 AMST
+result = Monday 2037-10-26 00:00:00 AMT
+wanted = Monday 00:00:00
+
+America/Curacao
+ts = Thursday 1970-01-01 17:17:17 AST
+result = Monday 1970-01-05 00:00:00 AST
+wanted = Monday 00:00:00
+
+Africa/Luanda
+ts = Thursday 1970-01-01 17:17:17 WAT
+result = Monday 1970-01-05 00:00:00 WAT
+wanted = Monday 00:00:00
+
+Antarctica/McMurdo
+ts = Monday 2037-09-28 17:17:17 NZST
+result = Monday 2037-10-05 00:00:00 NZDT
+wanted = Monday 00:00:00
+
+Australia/Adelaide
+ts = Friday 1971-01-01 17:17:17 CST
+result = Monday 1971-01-04 00:00:00 CST
+wanted = Monday 00:00:00
+
+Australia/Darwin
+ts = Monday 1971-03-29 17:17:17 CST
+result = Monday 1971-04-05 00:00:00 CST
+wanted = Monday 00:00:00
+
+Australia/Perth
+ts = Friday 1971-01-01 17:17:17 WST
+result = Monday 1971-01-04 00:00:00 WST
+wanted = Monday 00:00:00
+
+America/Aruba
+ts = Monday 1971-03-29 17:17:17 AST
+result = Monday 1971-04-05 00:00:00 AST
+wanted = Monday 00:00:00
+
+Asia/Baku
+ts = Friday 1971-01-01 17:17:17 BAKT
+result = Monday 1971-01-04 00:00:00 BAKT
+wanted = Monday 00:00:00
+
+Europe/Sarajevo
+ts = Friday 1971-01-01 17:17:17 CET
+result = Monday 1971-01-04 00:00:00 CET
+wanted = Monday 00:00:00
+
+America/Barbados
+ts = Friday 1971-01-01 17:17:17 AST
+result = Monday 1971-01-04 00:00:00 AST
+wanted = Monday 00:00:00
+
+Asia/Dacca
+ts = Friday 1971-01-01 17:17:17 DACT
+result = Monday 1971-01-04 00:00:00 DACT
+wanted = Monday 00:00:00
+
+Europe/Brussels
+ts = Friday 1971-01-01 17:17:17 CET
+result = Monday 1971-01-04 00:00:00 CET
+wanted = Monday 00:00:00
+
+Africa/Ouagadougou
+ts = Monday 1971-03-29 17:17:17 GMT
+result = Monday 1971-04-05 00:00:00 GMT
+wanted = Monday 00:00:00
+
+Europe/Tirane
+ts = Monday 1983-04-11 17:17:17 CET
+result = Monday 1983-04-18 01:00:00 CEST
+wanted = Monday 00:00:00
+
+America/Buenos_Aires
+ts = Monday 1974-09-30 17:17:17 ART
+result = Monday 1974-10-07 00:00:00 ART
+wanted = Monday 00:00:00
+
+America/Rosario
+ts = Monday 1974-09-30 17:17:17 ART
+result = Monday 1974-10-07 00:00:00 ART
+wanted = Monday 00:00:00
+
+Europe/Vienna
+ts = Monday 1980-03-31 17:17:17 CET
+result = Monday 1980-04-07 00:00:00 CEST
+wanted = Monday 00:00:00
+
+Asia/Baku
+ts = Monday 1995-12-25 17:17:17 AZT
+result = Monday 1996-01-01 01:00:00 AZST
+wanted = Monday 00:00:00
diff --git a/ext/date/tests/bug21399.phpt b/ext/date/tests/bug21399.phpt
new file mode 100644
index 000000000..08040bec5
--- /dev/null
+++ b/ext/date/tests/bug21399.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #21399 (strtotime() request for "YYYYMMDDhhmmss [ZZZ]")
+--FILE--
+<?php
+ putenv("TZ=GMT");
+ echo gmdate("Y-m-d H:i:s", strtotime("20050620091407 GMT"));
+?>
+--EXPECT--
+2005-06-20 09:14:07
diff --git a/ext/standard/tests/time/bug21966.phpt b/ext/date/tests/bug21966.phpt
index 31f592fa9..31f592fa9 100644
--- a/ext/standard/tests/time/bug21966.phpt
+++ b/ext/date/tests/bug21966.phpt
diff --git a/ext/date/tests/bug26090.phpt b/ext/date/tests/bug26090.phpt
new file mode 100644
index 000000000..03a90352c
--- /dev/null
+++ b/ext/date/tests/bug26090.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #26090 (allow colons in time zone offset to strtotime())
+--FILE--
+<?php
+putenv("TZ=America/New_York");
+$t = '2003-10-28 10:20:30-0800';
+echo date('Y-m-d H:i:s T', strtotime($t)) . "\n";
+
+$t = '2003-10-28 10:20:30-08:00';
+echo date('Y-m-d H:i:s T', strtotime($t)) . "\n";
+?>
+--EXPECT--
+2003-10-28 13:20:30 EST
+2003-10-28 13:20:30 EST
diff --git a/ext/date/tests/bug26198.phpt b/ext/date/tests/bug26198.phpt
new file mode 100644
index 000000000..c957bfcf7
--- /dev/null
+++ b/ext/date/tests/bug26198.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #26198 (strtotime handling of "M Y" and "Y M" format)
+--FILE--
+<?php
+ date_default_timezone_set("GMT");
+ echo gmdate("F Y (Y-m-d H:i:s T)\n", strtotime("Oct 2001"));
+ echo gmdate("M Y (Y-m-d H:i:s T)\n", strtotime("2001 Oct"));
+?>
+--EXPECT--
+October 2001 (2001-10-01 00:00:00 GMT)
+Oct 2001 (2001-10-01 00:00:00 GMT)
diff --git a/ext/standard/tests/time/bug26317.phpt b/ext/date/tests/bug26317.phpt
index c889666dc..c889666dc 100644
--- a/ext/standard/tests/time/bug26317.phpt
+++ b/ext/date/tests/bug26317.phpt
diff --git a/ext/standard/tests/time/bug26320.phpt b/ext/date/tests/bug26320.phpt
index b57712009..b57712009 100644
--- a/ext/standard/tests/time/bug26320.phpt
+++ b/ext/date/tests/bug26320.phpt
diff --git a/ext/date/tests/bug26694.phpt b/ext/date/tests/bug26694.phpt
new file mode 100644
index 000000000..a709d1666
--- /dev/null
+++ b/ext/date/tests/bug26694.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #26694 (strtotime() request for "Sun, 21 Dec 2003 20:38:33 +0000 GMT")
+--FILE--
+<?php
+ putenv("TZ=GMT");
+ echo gmdate("Y-m-d H:i:s", strtotime("Sun, 21 Dec 2003 20:38:33 +0000 GMT"));
+?>
+--EXPECT--
+2003-12-21 20:38:33
diff --git a/ext/standard/tests/time/bug27719.phpt b/ext/date/tests/bug27719.phpt
index 5841af79b..63cdc6139 100644
--- a/ext/standard/tests/time/bug27719.phpt
+++ b/ext/date/tests/bug27719.phpt
@@ -1,7 +1,9 @@
--TEST--
-Bug #27719: mktime returns incorrect timestamp for dst days
+Bug #27719 (mktime returns incorrect timestamp for dst days)
+--INI--
+error_reporting=2047
--FILE--
-<?php /* $Id: bug27719.phpt,v 1.4 2004/03/31 01:00:55 abies Exp $ */
+<?php /* $Id: bug27719.phpt,v 1.1 2005/07/03 14:36:59 derick Exp $ */
putenv("TZ=EST"); // No DST
$a = mktime(0, 0, 0, 4, 4, 2004, 0);
$b = mktime(0, 0, 0, 4, 4, 2004, 1);
@@ -10,7 +12,7 @@ Bug #27719: mktime returns incorrect timestamp for dst days
echo "$b ".date("m/d/y h:i:s\n",$b);
echo "$c ".date("m/d/y h:i:s\n",$c);
echo "\n";
- putenv("TZ=EST5DST"); // DST not in effect
+ putenv("TZ=EST5EDT"); // DST not in effect
$a = mktime(0, 0, 0, 2, 4, 2004, 0);
$b = mktime(0, 0, 0, 2, 4, 2004, 1);
$c = mktime(0, 0, 0, 2, 4, 2004, -1);
@@ -18,7 +20,7 @@ Bug #27719: mktime returns incorrect timestamp for dst days
echo "$b ".date("m/d/y h:i:s\n",$b);
echo "$c ".date("m/d/y h:i:s\n",$c);
echo "\n";
- putenv("TZ=EST5DST"); // Just before DST changeover
+ putenv("TZ=EST5EDT"); // Just before DST changeover
$a = mktime(0, 0, 0, 4, 4, 2004, 0);
$b = mktime(0, 0, 0, 4, 4, 2004, 1);
$c = mktime(0, 0, 0, 4, 4, 2004, -1);
@@ -26,7 +28,7 @@ Bug #27719: mktime returns incorrect timestamp for dst days
echo "$b ".date("m/d/y h:i:s\n",$b);
echo "$c ".date("m/d/y h:i:s\n",$c);
echo "\n";
- putenv("TZ=EST5DST"); // Just after DST changeover
+ putenv("TZ=EST5EDT"); // Just after DST changeover
$a = mktime(3, 0, 0, 4, 4, 2004, 0);
$b = mktime(3, 0, 0, 4, 4, 2004, 1);
$c = mktime(3, 0, 0, 4, 4, 2004, -1);
@@ -34,7 +36,7 @@ Bug #27719: mktime returns incorrect timestamp for dst days
echo "$b ".date("m/d/y h:i:s\n",$b);
echo "$c ".date("m/d/y h:i:s\n",$c);
echo "\n";
- putenv("TZ=EST5DST"); // DST in effect
+ putenv("TZ=EST5EDT"); // DST in effect
$a = mktime(0, 0, 0, 6, 4, 2004, 0);
$b = mktime(0, 0, 0, 6, 4, 2004, 1);
$c = mktime(0, 0, 0, 6, 4, 2004, -1);
diff --git a/ext/standard/tests/time/bug27780.phpt b/ext/date/tests/bug27780.phpt
index 1c10340d4..f1e6eb67b 100644
--- a/ext/standard/tests/time/bug27780.phpt
+++ b/ext/date/tests/bug27780.phpt
@@ -99,8 +99,8 @@ Asia/Singapore
America/Sao_Paulo
1076810399 [2004-02-14 23:59:59 BRST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
-1076810400 [2004-02-14 23:00:00 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
-1076810401 [2004-02-14 23:00:01 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
+1076814000 [2004-02-15 00:00:00 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
+1076814001 [2004-02-15 00:00:01 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079492400 [2004-03-17 00:00:00 BRT] [2004-04-07 00:00:00 -21 days]
1080356400 [2004-03-27 00:00:00 BRT] [2004-04-07 00:00:00 11 days ago]
1080450000 [2004-03-28 02:00:00 BRT] [2004-04-07 00:00:00 -10 day +2 hours]
diff --git a/ext/date/tests/bug28024.phpt b/ext/date/tests/bug28024.phpt
new file mode 100644
index 000000000..3e0399adb
--- /dev/null
+++ b/ext/date/tests/bug28024.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #28024 (Changed behavior of strtotime())
+--FILE--
+<?php
+ putenv("TZ=Europe/Berlin");
+ echo strtotime("17:00 2004-01-01"), "\n";
+ echo date("Y-m-d H:i:s T", strtotime("17:00 2004-01-01"));
+?>
+--EXPECT--
+1072972800
+2004-01-01 17:00:00 CET
diff --git a/ext/date/tests/bug28088.phpt b/ext/date/tests/bug28088.phpt
new file mode 100644
index 000000000..95866e00b
--- /dev/null
+++ b/ext/date/tests/bug28088.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #28088 (strtotime() cannot convert 00 hours")
+--FILE--
+<?php
+putenv("TZ=GMT");
+
+echo "The following line rightly shows the correct date time:\n";
+echo gmdate("m/d/y Hi", strtotime("04/04/04 2345")), "\n";
+
+echo "But the following line fails to show the correct date time:\n";
+echo gmdate("m/d/y Hi", strtotime("04/04/04 0045"))."\r\n";
+?>
+--EXPECT--
+The following line rightly shows the correct date time:
+04/04/04 2345
+But the following line fails to show the correct date time:
+04/04/04 0045
diff --git a/ext/standard/tests/time/bug28599.phpt b/ext/date/tests/bug28599.phpt
index 79ac9c84b..fcd17b469 100644
--- a/ext/standard/tests/time/bug28599.phpt
+++ b/ext/date/tests/bug28599.phpt
@@ -2,6 +2,7 @@
Bug #28599 (strtotime fails with zero base time)
--FILE--
<?php
+date_default_timezone_set("Europe/Amsterdam");
print gmdate("d-m-Y H:i:s", strtotime("+30 minutes", 1100535573));
?>
--EXPECT--
diff --git a/ext/date/tests/bug29150.phpt b/ext/date/tests/bug29150.phpt
new file mode 100644
index 000000000..274584d05
--- /dev/null
+++ b/ext/date/tests/bug29150.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #29150 (Roman number format for months)
+--FILE--
+<?php
+ putenv("TZ=GMT");
+ echo gmdate("Y-m-d H:i:s", strtotime("20 VI. 2005"));
+?>
+--EXPECT--
+2005-06-20 00:00:00
diff --git a/ext/date/tests/bug29585.phpt b/ext/date/tests/bug29585.phpt
new file mode 100644
index 000000000..394569924
--- /dev/null
+++ b/ext/date/tests/bug29585.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #29585 (Support week numbers in strtotime())
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+echo gmdate("Y-m-d H:i:s", strtotime("2004W30"));
+?>
+--EXPECT--
+2004-07-19 00:00:00
diff --git a/ext/date/tests/bug29595.phpt b/ext/date/tests/bug29595.phpt
new file mode 100644
index 000000000..285ade140
--- /dev/null
+++ b/ext/date/tests/bug29595.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #29595 (Roman number format for months)
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+$from_postgres = '2004-08-09 14:48:27.304809+10';
+
+echo strtotime($from_postgres);
+?>
+--EXPECT--
+1092026907
diff --git a/ext/date/tests/bug30096.phpt b/ext/date/tests/bug30096.phpt
new file mode 100644
index 000000000..fa4f716ee
--- /dev/null
+++ b/ext/date/tests/bug30096.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Bug #30096 (gmmktime does not return the corrent time)
+--INI--
+error_reporting=2047
+--FILE--
+<?php
+echo "no dst --> dst\n";
+$ts = -1;
+gm_date_check(01,00,00,03,27,2005);
+gm_date_check(02,00,00,03,27,2005);
+gm_date_check(03,00,00,03,27,2005);
+gm_date_check(04,00,00,03,27,2005);
+
+echo "\ndst --> no dst\n";
+$ts = -1;
+gm_date_check(01,00,00,10,30,2005);
+gm_date_check(02,00,00,10,30,2005);
+gm_date_check(03,00,00,10,30,2005);
+gm_date_check(04,00,00,10,30,2005);
+
+function gm_date_check($hour, $minute, $second, $month, $day, $year) {
+ global $ts, $tsold;
+
+ echo "gmmktime($hour,$minute,$second,$month,$day,$year): ";
+
+ $tsold = $ts;
+ $ts = gmmktime($hour, $minute, $second, $month, $day, $year);
+
+ echo $ts, " | gmdate('r', $ts):", gmdate('r', $ts);
+ if ($tsold > 0) {
+ echo " | Diff: " . ($ts - $tsold);
+ }
+ echo "\n";
+}
+
+?>
+--EXPECT--
+no dst --> dst
+gmmktime(1,0,0,3,27,2005): 1111885200 | gmdate('r', 1111885200):Sun, 27 Mar 2005 01:00:00 +0000
+gmmktime(2,0,0,3,27,2005): 1111888800 | gmdate('r', 1111888800):Sun, 27 Mar 2005 02:00:00 +0000 | Diff: 3600
+gmmktime(3,0,0,3,27,2005): 1111892400 | gmdate('r', 1111892400):Sun, 27 Mar 2005 03:00:00 +0000 | Diff: 3600
+gmmktime(4,0,0,3,27,2005): 1111896000 | gmdate('r', 1111896000):Sun, 27 Mar 2005 04:00:00 +0000 | Diff: 3600
+
+dst --> no dst
+gmmktime(1,0,0,10,30,2005): 1130634000 | gmdate('r', 1130634000):Sun, 30 Oct 2005 01:00:00 +0000
+gmmktime(2,0,0,10,30,2005): 1130637600 | gmdate('r', 1130637600):Sun, 30 Oct 2005 02:00:00 +0000 | Diff: 3600
+gmmktime(3,0,0,10,30,2005): 1130641200 | gmdate('r', 1130641200):Sun, 30 Oct 2005 03:00:00 +0000 | Diff: 3600
+gmmktime(4,0,0,10,30,2005): 1130644800 | gmdate('r', 1130644800):Sun, 30 Oct 2005 04:00:00 +0000 | Diff: 3600
diff --git a/ext/date/tests/bug30532.phpt b/ext/date/tests/bug30532.phpt
new file mode 100644
index 000000000..faee0b316
--- /dev/null
+++ b/ext/date/tests/bug30532.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #30532 (strtotime - crossing daylight savings time)
+--FILE--
+<?php
+putenv("TZ=America/New_York");
+echo date('Y-m-d H:i:s T', strtotime('2004-10-31 EDT +1 hour'))."\n";
+echo date('Y-m-d H:i:s T', strtotime('2004-10-31 EDT +2 hours'))."\n";
+echo date('Y-m-d H:i:s T', strtotime('2004-10-31 EDT +3 hours'))."\n";
+
+echo "\n";
+
+echo date('Y-m-d H:i:s T', strtotime('2004-10-31 +1 hour'))."\n";
+echo date('Y-m-d H:i:s T', strtotime('2004-10-31 +2 hours'))."\n";
+echo date('Y-m-d H:i:s T', strtotime('2004-10-31 +3 hours'))."\n";
+?>
+--EXPECT--
+2004-10-31 01:00:00 EDT
+2004-10-31 01:00:00 EST
+2004-10-31 02:00:00 EST
+
+2004-10-31 01:00:00 EDT
+2004-10-31 02:00:00 EST
+2004-10-31 03:00:00 EST
diff --git a/ext/date/tests/bug32086.phpt b/ext/date/tests/bug32086.phpt
new file mode 100644
index 000000000..2799164cb
--- /dev/null
+++ b/ext/date/tests/bug32086.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Bug #32086 (strtotime don't work in DST)
+--FILE--
+<?php
+putenv("TZ=America/Sao_Paulo");
+echo $g = strtotime("2004-11-01"), "\n";
+echo $i = strtotime("2004-11-01 +1 day"), "\n";
+echo $j = strtotime("+1 day", $g), "\n";
+echo $k = strtotime("2004-11-02"), "\n";
+echo $l = strtotime("2004-11-03"), "\n";
+echo date("Y-m-d H:i:s T\n", $g);
+echo date("Y-m-d H:i:s T\n", $i);
+echo date("Y-m-d H:i:s T\n", $j);
+echo date("Y-m-d H:i:s T\n", $k);
+echo date("Y-m-d H:i:s T\n", $l);
+
+echo $g = strtotime("2005-02-19"), "\n";
+echo $i = strtotime("2005-02-19 +1 day"), "\n";
+echo $j = strtotime("+1 day", $g), "\n";
+echo $k = strtotime("2005-02-20"), "\n";
+echo $l = strtotime("2005-02-21"), "\n";
+echo date("Y-m-d H:i:s T\n", $g);
+echo date("Y-m-d H:i:s T\n", $i);
+echo date("Y-m-d H:i:s T\n", $j);
+echo date("Y-m-d H:i:s T\n", $k);
+echo date("Y-m-d H:i:s T\n", $l);
+
+?>
+--EXPECT--
+1099278000
+1099364400
+1099364400
+1099364400
+1099447200
+2004-11-01 00:00:00 BRT
+2004-11-02 01:00:00 BRST
+2004-11-02 01:00:00 BRST
+2004-11-02 01:00:00 BRST
+2004-11-03 00:00:00 BRST
+1108778400
+1108868400
+1108868400
+1108868400
+1108954800
+2005-02-19 00:00:00 BRST
+2005-02-20 00:00:00 BRT
+2005-02-20 00:00:00 BRT
+2005-02-20 00:00:00 BRT
+2005-02-21 00:00:00 BRT
diff --git a/ext/date/tests/bug32270.phpt b/ext/date/tests/bug32270.phpt
new file mode 100644
index 000000000..2c5ff4754
--- /dev/null
+++ b/ext/date/tests/bug32270.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #32270 (strtotime/date behavior)
+--FILE--
+<?php
+putenv("TZ=America/Los_Angeles");
+
+echo date("m/d/Y H:i:s T", -2145888000)."\n";
+
+echo strtotime("Jan 1 1902")."\n";
+
+echo date("m/d/Y H:i:s T", -631123200)."\n";
+
+echo strtotime("Jan 1 1950")."\n";
+
+echo date("m/d/Y H:i:s T", 946713600)."\n";
+
+echo strtotime("Jan 1 2000")."\n";
+?>
+--EXPECT--
+01/01/1902 00:00:00 PST
+-2145888000
+01/01/1950 00:00:00 PST
+-631123200
+01/01/2000 00:00:00 PST
+946713600
diff --git a/ext/date/tests/bug32555.phpt b/ext/date/tests/bug32555.phpt
new file mode 100644
index 000000000..3ef513b5e
--- /dev/null
+++ b/ext/date/tests/bug32555.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #32555 (strtotime("tomorrow") can return false)
+--FILE--
+<?php
+putenv("TZ=US/Eastern");
+
+$stamp = 1112427000;
+print strftime('%c %Z',strtotime('now',$stamp)) ."\n";
+print strftime('%c %Z',strtotime('tomorrow',$stamp)) ."\n";
+print strftime('%c %Z',strtotime('+1 day',$stamp)) ."\n";
+print strftime('%c %Z',strtotime('+2 day',$stamp)) ."\n";
+?>
+--EXPECT--
+Sat Apr 2 02:30:00 2005 EST
+Sun Apr 3 00:00:00 2005 EST
+Sun Apr 3 03:30:00 2005 EDT
+Mon Apr 4 02:30:00 2005 EDT
diff --git a/ext/date/tests/bug32588.phpt b/ext/date/tests/bug32588.phpt
new file mode 100644
index 000000000..6cf5ac92f
--- /dev/null
+++ b/ext/date/tests/bug32588.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #32588 (strtotime() error for 'last xxx' DST problem)
+--FILE--
+<?php
+putenv("TZ=America/New_York");
+
+echo date('D Y/m/d/H:i:s', strtotime('last saturday', 1112703348)). "\n";
+echo date('D Y/m/d/H:i:s', strtotime("last sunday", 1112703348)). "\n";
+echo date('D Y/m/d/H:i:s', strtotime('last monday', 1112703348)). "\n";
+--EXPECT--
+Sat 2005/04/02/00:00:00
+Sun 2005/04/03/00:00:00
+Mon 2005/04/04/00:00:00
diff --git a/ext/date/tests/bug33056.phpt b/ext/date/tests/bug33056.phpt
new file mode 100644
index 000000000..441acc571
--- /dev/null
+++ b/ext/date/tests/bug33056.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #33056 (strtotime() does not parse 20050518t090000Z)
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+echo strtotime('20050518t090000Z')."\n";
+echo strtotime('20050518t091234Z')."\n";
+echo strtotime('20050518t191234Z')."\n";
+?>
+--EXPECT--
+1116406800
+1116407554
+1116443554
diff --git a/ext/date/tests/bug33414-1.phpt b/ext/date/tests/bug33414-1.phpt
new file mode 100644
index 000000000..7b15228cf
--- /dev/null
+++ b/ext/date/tests/bug33414-1.phpt
@@ -0,0 +1,320 @@
+--TEST--
+Bug #33414 [1] (Comprehensive list of incorrect days returned after strotime() / date() tests)
+--FILE--
+<?php
+
+print "TZ=America/Mendoza - wrong day.\n";
+putenv("TZ=America/Mendoza");
+$tStamp = mktime (17, 17, 17, 1, 8327, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 00:00:00\n\n";
+
+print "TZ=America/Catamarca - wrong day.\n";
+putenv("TZ=America/Catamarca");
+$tStamp = mktime (17, 17, 17, 1, 7599, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 00:00:00\n\n";
+
+print "TZ=America/Cordoba - wrong day.\n";
+putenv("TZ=America/Cordoba");
+$tStamp = mktime (17, 17, 17, 1, 7599, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 00:00:00\n\n";
+
+print "TZ=America/Rosario - wrong day.\n";
+putenv("TZ=America/Rosario");
+$tStamp = mktime (17, 17, 17, 1, 7958, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:00:00\n\n";
+
+print "TZ=Europe/Vienna - wrong day - giving unexpected results, at
+least on my system :-)\n";
+putenv("TZ=Europe/Vienna");
+$tStamp = mktime (17, 17, 17, 1, 3746, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:00:00\n\n";
+
+print "TZ=Asia/Baku - wrong day.\n";
+putenv("TZ=Asia/Baku");
+$tStamp = mktime (17, 17, 17, 1, 8299, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 00:00:00\n\n";
+
+print "TZ=America/Noronha - wrong day.\n";
+putenv("TZ=America/Noronha");
+$tStamp = mktime (17, 17, 17, 1, 10866, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Friday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Friday 00:00:00\n\n";
+
+print "TZ=America/Havana - wrong day.\n";
+putenv("TZ=America/Havana");
+$tStamp = mktime (17, 17, 17, 1, 12720, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:00:00\n\n";
+
+print "TZ=Europe/Tallinn - wrong day.\n";
+putenv("TZ=Europe/Tallinn");
+$tStamp = mktime (17, 17, 17, 1, 11777, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Saturday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Saturday 00:00:00\n\n";
+
+print "TZ=Asia/Jerusalem - wrong day.\n";
+putenv("TZ=Asia/Jerusalem");
+$tStamp = mktime (17, 17, 17, 1, 13056, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:00:00\n\n";
+
+print "TZ=Europe/Vilnius - wrong day.\n";
+putenv("TZ=Europe/Vilnius");
+$tStamp = mktime (17, 17, 17, 1, 12140, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Friday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Friday 00:00:00\n\n";
+
+print "TZ=Pacific/Kwajalein - wrong day.\n";
+putenv("TZ=Pacific/Kwajalein");
+$tStamp = mktime (17, 17, 17, 1, 8626, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Friday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Friday 00:00:00\n\n";
+
+print "TZ=Asia/Ulan_Bator - wrong day.\n";
+putenv("TZ=Asia/Ulan_Bator");
+$tStamp = mktime (17, 17, 17, 1, 11588, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Saturday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Saturday 00:00:00\n\n";
+
+print "TZ=America/Cancun - wrong day.\n";
+putenv("TZ=America/Cancun");
+$tStamp = mktime (17, 17, 17, 1, 11785, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 00:00:00\n\n";
+
+print "TZ=America/Mexico_City - wrong day.\n";
+putenv("TZ=America/Mexico_City");
+$tStamp = mktime (17, 17, 17, 1, 11781, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Wednesday 00:00:00\n\n";
+
+print "TZ=America/Mazatlan - wrong day.\n";
+putenv("TZ=America/Mazatlan");
+$tStamp = mktime (17, 17, 17, 1, 11780, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:00:00\n\n";
+
+print "TZ=America/Chihuahua - wrong day.\n";
+putenv("TZ=America/Chihuahua");
+$tStamp = mktime (17, 17, 17, 1, 11782, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:00:00\n\n";
+
+print "TZ=Asia/Kuala_Lumpur - wrong day.\n";
+putenv("TZ=Asia/Kuala_Lumpur");
+$tStamp = mktime (17, 17, 17, 1, 4380, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:00:00\n\n";
+
+print "TZ=Pacific/Chatham - wrong day.\n";
+putenv("TZ=Pacific/Chatham");
+$tStamp = mktime (17, 17, 17, 1, 1762, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:00:00\n\n";
+
+print "TZ=America/Lima - wrong day.\n";
+putenv("TZ=America/Lima");
+$tStamp = mktime (17, 17, 17, 1, 5839, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:00:00\n\n";
+
+print "TZ=Asia/Karachi - wrong day.\n";
+putenv("TZ=Asia/Karachi");
+$tStamp = mktime (17, 17, 17, 1, 11783, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Friday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Friday 00:00:00\n\n";
+
+print "TZ=America/Asuncion - wrong day.\n";
+putenv("TZ=America/Asuncion");
+$tStamp = mktime (17, 17, 17, 1, 11746, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Wednesday 00:00:00\n\n";
+
+print "TZ=Asia/Singapore - wrong day.\n";
+putenv("TZ=Asia/Singapore");
+$tStamp = mktime (17, 17, 17, 1, 4383, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:00:00\n\n";
+
+print "TZ=America/Montevideo - wrong day.\n";
+putenv("TZ=America/Montevideo");
+$tStamp = mktime (17, 17, 17, 1, 12678, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:00:00\n\n";
+
+?>
+--EXPECT--
+TZ=America/Mendoza - wrong day.
+tStamp=Sunday 1992-10-18 17:17:17 ARST 1
+result=Sunday 1992-10-25 00:00:00 ARST 1
+wanted=Sunday 00:00:00
+
+TZ=America/Catamarca - wrong day.
+tStamp=Sunday 1990-10-21 17:17:17 ARST 1
+result=Sunday 1990-10-28 00:00:00 ARST 1
+wanted=Sunday 00:00:00
+
+TZ=America/Cordoba - wrong day.
+tStamp=Sunday 1990-10-21 17:17:17 ARST 1
+result=Sunday 1990-10-28 00:00:00 ARST 1
+wanted=Sunday 00:00:00
+
+TZ=America/Rosario - wrong day.
+tStamp=Tuesday 1991-10-15 17:17:17 WART 0
+result=Tuesday 1991-10-22 00:00:00 ARST 1
+wanted=Tuesday 00:00:00
+
+TZ=Europe/Vienna - wrong day - giving unexpected results, at
+least on my system :-)
+tStamp=Thursday 1980-04-03 17:17:17 CET 0
+result=Thursday 1980-04-10 00:00:00 CEST 1
+wanted=Thursday 00:00:00
+
+TZ=Asia/Baku - wrong day.
+tStamp=Sunday 1992-09-20 17:17:17 AZST 1
+result=Sunday 1992-09-27 00:00:00 AZT 0
+wanted=Sunday 00:00:00
+
+TZ=America/Noronha - wrong day.
+tStamp=Friday 1999-10-01 17:17:17 FNT 0
+result=Friday 1999-10-08 00:00:00 FNST 1
+wanted=Friday 00:00:00
+
+TZ=America/Havana - wrong day.
+tStamp=Thursday 2004-10-28 17:17:17 CDT 1
+result=Thursday 2004-11-04 00:00:00 CDT 1
+wanted=Thursday 00:00:00
+
+TZ=Europe/Tallinn - wrong day.
+tStamp=Saturday 2002-03-30 17:17:17 EET 0
+result=Saturday 2002-04-06 00:00:00 EEST 1
+wanted=Saturday 00:00:00
+
+TZ=Asia/Jerusalem - wrong day.
+tStamp=Thursday 2005-09-29 17:17:17 IDT 1
+result=Thursday 2005-10-06 00:00:00 IDT 1
+wanted=Thursday 00:00:00
+
+TZ=Europe/Vilnius - wrong day.
+tStamp=Friday 2003-03-28 17:17:17 EET 0
+result=Friday 2003-04-04 00:00:00 EEST 1
+wanted=Friday 00:00:00
+
+TZ=Pacific/Kwajalein - wrong day.
+tStamp=Friday 1993-08-13 17:17:17 KWAT 0
+result=Saturday 1993-08-21 00:00:00 MHT 0
+wanted=Friday 00:00:00
+
+TZ=Asia/Ulan_Bator - wrong day.
+tStamp=Saturday 2001-09-22 17:17:17 ULAST 1
+result=Saturday 2001-09-29 00:00:00 ULAST 1
+wanted=Saturday 00:00:00
+
+TZ=America/Cancun - wrong day.
+tStamp=Sunday 2002-04-07 17:17:17 CDT 1
+result=Sunday 2002-04-14 00:00:00 CDT 1
+wanted=Sunday 00:00:00
+
+TZ=America/Mexico_City - wrong day.
+tStamp=Wednesday 2002-04-03 17:17:17 CST 0
+result=Wednesday 2002-04-10 00:00:00 CDT 1
+wanted=Wednesday 00:00:00
+
+TZ=America/Mazatlan - wrong day.
+tStamp=Tuesday 2002-04-02 17:17:17 MST 0
+result=Tuesday 2002-04-09 00:00:00 MDT 1
+wanted=Tuesday 00:00:00
+
+TZ=America/Chihuahua - wrong day.
+tStamp=Thursday 2002-04-04 17:17:17 MST 0
+result=Thursday 2002-04-11 00:00:00 MDT 1
+wanted=Thursday 00:00:00
+
+TZ=Asia/Kuala_Lumpur - wrong day.
+tStamp=Monday 1981-12-28 17:17:17 MALT 0
+result=Monday 1982-01-04 00:00:00 MYT 0
+wanted=Monday 00:00:00
+
+TZ=Pacific/Chatham - wrong day.
+tStamp=Monday 1974-10-28 17:17:17 CHAST 0
+result=Monday 1974-11-04 00:00:00 CHADT 1
+wanted=Monday 00:00:00
+
+TZ=America/Lima - wrong day.
+tStamp=Thursday 1985-12-26 17:17:17 PET 0
+result=Thursday 1986-01-02 00:00:00 PEST 1
+wanted=Thursday 00:00:00
+
+TZ=Asia/Karachi - wrong day.
+tStamp=Friday 2002-04-05 17:17:17 PKT 0
+result=Friday 2002-04-12 00:00:00 PKST 1
+wanted=Friday 00:00:00
+
+TZ=America/Asuncion - wrong day.
+tStamp=Wednesday 2002-02-27 17:17:17 PYST 1
+result=Wednesday 2002-03-06 00:00:00 PYST 1
+wanted=Wednesday 00:00:00
+
+TZ=Asia/Singapore - wrong day.
+tStamp=Thursday 1981-12-31 17:17:17 SGT 0
+result=Thursday 1982-01-07 00:00:00 SGT 0
+wanted=Thursday 00:00:00
+
+TZ=America/Montevideo - wrong day.
+tStamp=Thursday 2004-09-16 17:17:17 UYT 0
+result=Thursday 2004-09-23 00:00:00 UYST 1
+wanted=Thursday 00:00:00
diff --git a/ext/date/tests/bug33414-2.phpt b/ext/date/tests/bug33414-2.phpt
new file mode 100644
index 000000000..8eb2a3569
--- /dev/null
+++ b/ext/date/tests/bug33414-2.phpt
@@ -0,0 +1,121 @@
+--TEST--
+Bug #33414 [2] (Comprehensive list of incorrect days returned after strotime() / date() tests)
+--FILE--
+<?php
+print "TZ=Pacific/Rarotonga - wrong day.\n";
+putenv("TZ=Pacific/Rarotonga");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:00:00\n\n";
+
+print "TZ=Atlantic/South_Georgia - wrong day.\n";
+putenv("TZ=Atlantic/South_Georgia");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:00:00\n\n";
+
+print "TZ=America/Port-au-Prince - wrong day.\n";
+putenv("TZ=America/Port-au-Prince");
+$tStamp = mktime (17, 17, 17, 1, 12871, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:00:00\n\n";
+
+print "TZ=Pacific/Enderbury - wrong day, off by 2 days.\n";
+putenv("TZ=Pacific/Enderbury");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:00:00\n\n";
+
+print "TZ=Pacific/Kiritimati - wrong day, off by 2 days.\n";
+putenv("TZ=Pacific/Kiritimati");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:00:00\n\n";
+
+print "TZ=America/Managua - wrong day.\n";
+putenv("TZ=America/Managua");
+$tStamp = mktime (17, 17, 17, 1, 12879, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:00:00\n\n";
+
+print "TZ=Pacific/Pitcairn - wrong day.\n";
+putenv("TZ=Pacific/Pitcairn");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Wednesday 00:00:00\n\n";
+
+print "TZ=Pacific/Fakaofo - wrong day.\n";
+putenv("TZ=Pacific/Fakaofo");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Saturday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Saturday 00:00:00\n\n";
+
+print "TZ=Pacific/Johnston - wrong day.\n";
+putenv("TZ=Pacific/Johnston");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Friday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Friday 00:00:00\n\n";
+?>
+--EXPECT--
+TZ=Pacific/Rarotonga - wrong day.
+tStamp=Thursday 1970-01-01 17:17:17 CKT 0
+result=Tuesday 1970-01-06 00:00:00 CKT 0
+wanted=Tuesday 00:00:00
+
+TZ=Atlantic/South_Georgia - wrong day.
+tStamp=Thursday 1970-01-01 17:17:17 GST 0
+result=Tuesday 1970-01-06 00:00:00 GST 0
+wanted=Tuesday 00:00:00
+
+TZ=America/Port-au-Prince - wrong day.
+tStamp=Monday 2005-03-28 17:17:17 EST 0
+result=Monday 2005-04-04 00:00:00 EDT 1
+wanted=Monday 00:00:00
+
+TZ=Pacific/Enderbury - wrong day, off by 2 days.
+tStamp=Thursday 1970-01-01 17:17:17 PHOT 0
+result=Monday 1970-01-05 00:00:00 PHOT 0
+wanted=Monday 00:00:00
+
+TZ=Pacific/Kiritimati - wrong day, off by 2 days.
+tStamp=Thursday 1970-01-01 17:17:17 LINT 0
+result=Monday 1970-01-05 00:00:00 LINT 0
+wanted=Monday 00:00:00
+
+TZ=America/Managua - wrong day.
+tStamp=Tuesday 2005-04-05 17:17:17 CST 0
+result=Tuesday 2005-04-12 00:00:00 CDT 1
+wanted=Tuesday 00:00:00
+
+TZ=Pacific/Pitcairn - wrong day.
+tStamp=Thursday 1970-01-01 17:17:17 PNT 0
+result=Wednesday 1970-01-07 00:00:00 PNT 0
+wanted=Wednesday 00:00:00
+
+TZ=Pacific/Fakaofo - wrong day.
+tStamp=Thursday 1970-01-01 17:17:17 TKT 0
+result=Saturday 1970-01-03 00:00:00 TKT 0
+wanted=Saturday 00:00:00
+
+TZ=Pacific/Johnston - wrong day.
+tStamp=Thursday 1970-01-01 17:17:17 HST 0
+result=Friday 1970-01-02 00:00:00 HST 0
+wanted=Friday 00:00:00
diff --git a/ext/date/tests/bug33415-1.phpt b/ext/date/tests/bug33415-1.phpt
new file mode 100644
index 000000000..3d36af8a5
--- /dev/null
+++ b/ext/date/tests/bug33415-1.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Bug #33415 [1] (Possibly invalid non-one-hour DST or timezone shifts)
+--FILE--
+<?php
+
+print "TZ=America/Jujuy - Is it OK for this to be 2 AM, rather than 1
+AM as per most DST transitions?\n";
+putenv("TZ=America/Jujuy");
+$tStamp = mktime (17, 17, 17, 1, 7593, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:00:00\n\n";
+
+print "TZ=Asia/Tbilisi - Is it OK for this to be 2 AM?\n";
+putenv("TZ=Asia/Tbilisi");
+$tStamp = mktime (17, 17, 17, 1, 12863, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 00:00:00\n\n";
+?>
+--EXPECT--
+TZ=America/Jujuy - Is it OK for this to be 2 AM, rather than 1
+AM as per most DST transitions?
+tStamp=Monday 1990-10-15 17:17:17 WART 0
+result=Monday 1990-10-22 00:00:00 WART 0
+wanted=Monday 00:00:00
+
+TZ=Asia/Tbilisi - Is it OK for this to be 2 AM?
+tStamp=Sunday 2005-03-20 17:17:17 GET 0
+result=Sunday 2005-03-27 00:00:00 GET 0
+wanted=Sunday 00:00:00
diff --git a/ext/date/tests/bug33415-2.phpt b/ext/date/tests/bug33415-2.phpt
new file mode 100644
index 000000000..a1e5930b5
--- /dev/null
+++ b/ext/date/tests/bug33415-2.phpt
@@ -0,0 +1,342 @@
+--TEST--
+Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts)
+--FILE--
+<?php
+
+print "TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
+have a DST or timezone transition.\n";
+putenv("TZ=Africa/Bujumbura");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Wednesday 00:00:00\n\n";
+
+print "TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes\n";
+putenv("TZ=Asia/Thimbu");
+$tStamp = mktime (17, 17, 17, 1, 6476, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:30:00\n\n";
+
+print "TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
+appear to have a DST or timezone transition.\n";
+putenv("TZ=Indian/Cocos");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:00:00\n\n";
+
+print "TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
+not appear to have a DST or timezone transition.\n";
+putenv("TZ=Africa/Lubumbashi");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Saturday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Saturday 00:00:00\n\n";
+
+print "TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes\n";
+putenv("TZ=Asia/Kashgar");
+$tStamp = mktime (17, 17, 17, 1, 3767, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 03:00:00\n\n";
+
+print "TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does
+not appear to have a DST or timezone transition.\n";
+putenv("TZ=Indian/Christmas");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 00:00:00\n\n";
+
+print "TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes\n";
+putenv("TZ=America/Santo_Domingo");
+$tStamp = mktime (17, 17, 17, 1, 291, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 00:30:00\n\n";
+
+print "TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not
+appear to have a DST or timezone transition.\n";
+putenv("TZ=Pacific/Truk");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:00:00\n\n";
+
+print "TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does
+not appear to have a DST or timezone transition.\n";
+putenv("TZ=Pacific/Ponape");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:00:00\n\n";
+
+print "TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes\n";
+putenv("TZ=America/Scoresbysund");
+$tStamp = mktime (17, 17, 17, 1, 4099, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 02:00:00\n\n";
+
+print "TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes\n";
+putenv("TZ=America/Guyana");
+$tStamp = mktime (17, 17, 17, 1, 2031, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:45:00\n\n";
+
+print "TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes\n";
+putenv("TZ=Asia/Tehran");
+$tStamp = mktime (17, 17, 17, 1, 2855, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:30:00\n\n";
+
+print "TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
+not appear to have a DST or timezone transition.\n";
+putenv("TZ=Pacific/Tarawa");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:00:00\n\n";
+
+print "TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes\n";
+putenv("TZ=Africa/Monrovia");
+$tStamp = mktime (17, 17, 17, 1, 845, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:44:30\n\n";
+
+print "TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes\n";
+putenv("TZ=Asia/Katmandu");
+$tStamp = mktime (17, 17, 17, 1, 5838, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Wednesday 00:15:00\n\n";
+
+print "TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes\n";
+putenv("TZ=Pacific/Nauru");
+$tStamp = mktime (17, 17, 17, 1, 3401, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:30:00\n\n";
+
+print "TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes\n";
+putenv("TZ=Pacific/Niue");
+$tStamp = mktime (17, 17, 17, 1, 3189, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Sunday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Sunday 00:30:00\n\n";
+
+print "TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
+or timezone transition.\n";
+putenv("TZ=Pacific/Port_Moresby");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 00:00:00\n\n";
+
+print "TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes\n";
+putenv("TZ=America/Miquelon");
+$tStamp = mktime (17, 17, 17, 1, 3767, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Thursday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Thursday 01:00:00\n\n";
+
+print "TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
+timezone transition.\n";
+putenv("TZ=Pacific/Palau");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Saturday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Saturday 00:00:00\n\n";
+
+print "TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does
+not appear to have a DST or timezone transition.\n";
+putenv("TZ=Pacific/Funafuti");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Wednesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Wednesday 00:00:00\n\n";
+
+print "TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not
+appear to have a DST or timezone transition.\n";
+putenv("TZ=Pacific/Wake");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:00:00\n\n";
+
+print "TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does
+not appear to have a DST or timezone transition.\n";
+putenv("TZ=Pacific/Wallis");
+$tStamp = mktime (17, 17, 17, 1, 1, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Tuesday 00:00:00\n\n";
+
+print "TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes\n";
+putenv("TZ=America/Paramaribo");
+$tStamp = mktime (17, 17, 17, 1, 5381, 1970);
+print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
+$strtotime_tstamp = strtotime("next Monday", $tStamp);
+print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
+print "wanted=Monday 00:30:00\n\n";
+
+?>
+--EXPECT--
+TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
+have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 CAT 0
+result=Wednesday 1970-01-07 00:00:00 CAT 0
+wanted=Wednesday 00:00:00
+
+TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes
+tStamp=Thursday 1987-09-24 17:17:17 IST 0
+result=Thursday 1987-10-01 00:30:00 BTT 0
+wanted=Thursday 00:30:00
+
+TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
+appear to have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 CCT 0
+result=Thursday 1970-01-08 00:00:00 CCT 0
+wanted=Thursday 00:00:00
+
+TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
+not appear to have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 CAT 0
+result=Saturday 1970-01-03 00:00:00 CAT 0
+wanted=Saturday 00:00:00
+
+TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes
+tStamp=Thursday 1980-04-24 17:17:17 KAST 0
+result=Thursday 1980-05-01 03:00:00 CST 0
+wanted=Thursday 03:00:00
+
+TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does
+not appear to have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 CXT 0
+result=Sunday 1970-01-04 00:00:00 CXT 0
+wanted=Sunday 00:00:00
+
+TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes
+tStamp=Sunday 1970-10-18 17:17:17 EST 0
+result=Sunday 1970-10-25 00:30:00 EHDT 1
+wanted=Sunday 00:30:00
+
+TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not
+appear to have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 TRUT 0
+result=Tuesday 1970-01-06 00:00:00 TRUT 0
+wanted=Tuesday 00:00:00
+
+TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does
+not appear to have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 PONT 0
+result=Monday 1970-01-05 00:00:00 PONT 0
+wanted=Monday 00:00:00
+
+TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes
+tStamp=Sunday 1981-03-22 17:17:17 CGT 0
+result=Sunday 1981-03-29 02:00:00 EGST 1
+wanted=Sunday 02:00:00
+
+TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes
+tStamp=Thursday 1975-07-24 17:17:17 GYT 0
+result=Thursday 1975-07-31 00:45:00 GYT 0
+wanted=Thursday 00:45:00
+
+TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes
+tStamp=Tuesday 1977-10-25 17:17:17 IRST 0
+result=Tuesday 1977-11-01 00:30:00 IRST 0
+wanted=Tuesday 00:30:00
+
+TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
+not appear to have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 GILT 0
+result=Monday 1970-01-05 00:00:00 GILT 0
+wanted=Monday 00:00:00
+
+TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes
+tStamp=Monday 1972-04-24 17:17:17 LRT 0
+result=Monday 1972-05-01 00:44:30 GMT 0
+wanted=Monday 00:44:30
+
+TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes
+tStamp=Wednesday 1985-12-25 17:17:17 IST 0
+result=Wednesday 1986-01-01 00:15:00 NPT 0
+wanted=Wednesday 00:15:00
+
+TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes
+tStamp=Tuesday 1979-04-24 17:17:17 NRT 0
+result=Tuesday 1979-05-01 00:30:00 NRT 0
+wanted=Tuesday 00:30:00
+
+TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes
+tStamp=Sunday 1978-09-24 17:17:17 NUT 0
+result=Sunday 1978-10-01 00:30:00 NUT 0
+wanted=Sunday 00:30:00
+
+TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
+or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 PGT 0
+result=Thursday 1970-01-08 00:00:00 PGT 0
+wanted=Thursday 00:00:00
+
+TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes
+tStamp=Thursday 1980-04-24 17:17:17 AST 0
+result=Thursday 1980-05-01 01:00:00 PMST 0
+wanted=Thursday 01:00:00
+
+TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
+timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 PWT 0
+result=Saturday 1970-01-03 00:00:00 PWT 0
+wanted=Saturday 00:00:00
+
+TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does
+not appear to have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 TVT 0
+result=Wednesday 1970-01-07 00:00:00 TVT 0
+wanted=Wednesday 00:00:00
+
+TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not
+appear to have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 WAKT 0
+result=Tuesday 1970-01-06 00:00:00 WAKT 0
+wanted=Tuesday 00:00:00
+
+TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does
+not appear to have a DST or timezone transition.
+tStamp=Thursday 1970-01-01 17:17:17 WFT 0
+result=Tuesday 1970-01-06 00:00:00 WFT 0
+wanted=Tuesday 00:00:00
+
+TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes
+tStamp=Monday 1984-09-24 17:17:17 SRT 0
+result=Monday 1984-10-01 00:30:00 SRT 0
+wanted=Monday 00:30:00
diff --git a/ext/date/tests/bug33452.phpt b/ext/date/tests/bug33452.phpt
new file mode 100644
index 000000000..e5abebf3c
--- /dev/null
+++ b/ext/date/tests/bug33452.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #33452 (Support for year accompanying ISO week nr)
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+echo date('Y-W', strtotime('2005-1-1')), "\n";
+echo date('o-W', strtotime('2005-1-1')), "\n";
+?>
+--EXPECT--
+2005-53
+2004-53
diff --git a/ext/date/tests/bug33532.phpt b/ext/date/tests/bug33532.phpt
new file mode 100644
index 000000000..2a8da0341
--- /dev/null
+++ b/ext/date/tests/bug33532.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Bug #33532 (Different output for strftime() and date())
+--INI--
+error_reporting=2047
+date.timezone=UTC
+--FILE--
+<?php
+putenv("TZ=");
+setlocale(LC_ALL, 'C');
+
+print "TZ has NOT been set\n";
+print "Should strftime==datestr? Strftime seems to assume GMT tStamp.\n";
+$input = "10:00:00 AM July 1 2005";
+print "input " . $input . "\n";
+$tStamp = strtotime($input);
+print "strftime " . strftime("%r %B%e %Y %Z %z", $tStamp) . "\n";
+print "datestr " . date ("H:i:s A F j Y T", $tStamp) . "\n";
+
+print "\nSetting TZ\n";
+putenv("TZ=Australia/Sydney");
+$input = "10:00:00 AM July 1 2005";
+print "input " . $input . "\n";
+$tStamp = strtotime($input);
+print "strftime " . strftime("%r %B%e %Y %Z %z", $tStamp) . "\n";
+print "datestr " . date ("H:i:s A F j Y T", $tStamp) . "\n";
+
+?>
+--EXPECT--
+TZ has NOT been set
+Should strftime==datestr? Strftime seems to assume GMT tStamp.
+input 10:00:00 AM July 1 2005
+strftime 10:00:00 AM July 1 2005 UTC +0000
+datestr 10:00:00 AM July 1 2005 UTC
+
+Setting TZ
+input 10:00:00 AM July 1 2005
+strftime 10:00:00 AM July 1 2005 EST +1000
+datestr 10:00:00 AM July 1 2005 EST
diff --git a/ext/date/tests/bug33536.phpt b/ext/date/tests/bug33536.phpt
new file mode 100644
index 000000000..aa5f5ddb3
--- /dev/null
+++ b/ext/date/tests/bug33536.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #33456 (strtotime defaults to now even on non time string)
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+var_dump(strtotime("monkey"));
+print date("Y-m-d", strtotime("monkey")) ."\n";
+print date("Y-m-d", false) ."\n";
+?>
+--EXPECT--
+bool(false)
+1970-01-01
+1970-01-01
diff --git a/ext/date/tests/bug33562.phpt b/ext/date/tests/bug33562.phpt
new file mode 100644
index 000000000..8383a79ab
--- /dev/null
+++ b/ext/date/tests/bug33562.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #33562 (date("") crashes)
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+echo "[", date(""), "]\n";
+echo "done";
+?>
+--EXPECT--
+[]
+done
diff --git a/ext/date/tests/bug33563.phpt b/ext/date/tests/bug33563.phpt
new file mode 100644
index 000000000..9f4eb7b4d
--- /dev/null
+++ b/ext/date/tests/bug33563.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #33563 (strtotime('+1 month',$abc) cant get right time)
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+$strCurrDate = date('Y-m-d H:i:s',strtotime('2005-06-30 21:04:23'));
+$strMonAfter = date('Y-m-d H:i:s',strtotime('+1 month',strtotime($strCurrDate)));
+
+echo "strCurrDate:$strCurrDate strMonAfter:$strMonAfter";
+?>
+--EXPECT--
+strCurrDate:2005-06-30 21:04:23 strMonAfter:2005-07-30 21:04:23
diff --git a/ext/date/tests/bug33578.phpt b/ext/date/tests/bug33578.phpt
new file mode 100644
index 000000000..4ba6df859
--- /dev/null
+++ b/ext/date/tests/bug33578.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #33578 (strtotime() doesn't parse "11 Oct" format")
+--FILE--
+<?php
+ date_default_timezone_set("UTC");
+ echo date('m/d/Y', strtotime('Oct 11')), "\n";
+ echo date('m/d/Y', strtotime('11 Oct')), "\n";
+ echo date('m/d/Y', strtotime('11 Oct 2005')), "\n";
+ echo date('m/d/Y', strtotime('Oct11')), "\n";
+ echo date('m/d/Y', strtotime('11Oct')), "\n";
+ echo date('m/d/Y', strtotime('11Oct 2005')), "\n";
+ echo date('m/d/Y', strtotime('11Oct2005')), "\n";
+?>
+--EXPECTF--
+10/11/%d
+10/11/%d
+10/11/2005
+10/11/%d
+10/11/%d
+10/11/2005
+10/11/2005
diff --git a/ext/date/tests/bug33869.phpt b/ext/date/tests/bug33869.phpt
new file mode 100644
index 000000000..6957a6b7e
--- /dev/null
+++ b/ext/date/tests/bug33869.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #33869 (strtotime() doesn't parse "+1days" format)
+--FILE--
+<?php
+ date_default_timezone_set("UTC");
+ $tm = strtotime("2005-01-01 01:01:01");
+ echo date(DATE_ISO8601, strtotime('+5days', $tm));
+ echo "\n";
+ echo date(DATE_ISO8601, strtotime('+1month', $tm));
+ echo "\n";
+ echo date(DATE_ISO8601, strtotime('+1year', $tm));
+ echo "\n";
+ echo date(DATE_ISO8601, strtotime('+5 days', $tm));
+ echo "\n";
+ echo date(DATE_ISO8601, strtotime('+1 month', $tm));
+ echo "\n";
+ echo date(DATE_ISO8601, strtotime('+1 year', $tm));
+ echo "\n";
+?>
+--EXPECT--
+2005-01-06T01:01:01+0000
+2005-02-01T01:01:01+0000
+2006-01-01T01:01:01+0000
+2005-01-06T01:01:01+0000
+2005-02-01T01:01:01+0000
+2006-01-01T01:01:01+0000
diff --git a/ext/date/tests/bug33957.phpt b/ext/date/tests/bug33957.phpt
new file mode 100644
index 000000000..43f14ee31
--- /dev/null
+++ b/ext/date/tests/bug33957.phpt
@@ -0,0 +1,103 @@
+--TEST--
+Bug #33957 (gmdate('W')/date('W') sometimes returns wrong week number)
+--FILE--
+<?php
+date_default_timezone_set("UTC");
+
+for ($i = 14; $i <= 31; $i++) {
+ echo "1992-12-$i ", date("W", strtotime("1992-12-$i")), "\n";
+}
+for ($i = 1; $i <= 8; $i++) {
+ echo "1993-01-$i ", date("W", strtotime("1993-01-$i")), "\n";
+}
+echo "----\n";
+echo " ";
+foreach (range(1992, 2019) as $year) {
+ echo "$year ";
+}
+echo "\n";
+
+for ($i = 14; $i <= 31; $i++) {
+ echo " (12-$i) ";
+ foreach (range(1992, 2019) as $year) {
+ echo sprintf(" %02d-", date("W", strtotime("$year-12-$i")));
+ echo sprintf("%04d ", date("o", strtotime("$year-12-$i")));
+ }
+ echo "\n";
+}
+for ($i = 1; $i <= 18; $i++) {
+ printf("+1 (01-%02d) ", $i);
+ foreach (range(1993, 2020) as $year) {
+ echo sprintf(" %02d-", date("W", strtotime("$year-1-$i")));
+ echo sprintf("%04d ", date("o", strtotime("$year-1-$i")));
+ }
+ echo "\n";
+}
+echo "----\n";
+?>
+--EXPECT--
+1992-12-14 51
+1992-12-15 51
+1992-12-16 51
+1992-12-17 51
+1992-12-18 51
+1992-12-19 51
+1992-12-20 51
+1992-12-21 52
+1992-12-22 52
+1992-12-23 52
+1992-12-24 52
+1992-12-25 52
+1992-12-26 52
+1992-12-27 52
+1992-12-28 53
+1992-12-29 53
+1992-12-30 53
+1992-12-31 53
+1993-01-1 53
+1993-01-2 53
+1993-01-3 53
+1993-01-4 01
+1993-01-5 01
+1993-01-6 01
+1993-01-7 01
+1993-01-8 01
+----
+ 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
+ (12-14) 51-1992 50-1993 50-1994 50-1995 50-1996 50-1997 51-1998 50-1999 50-2000 50-2001 50-2002 50-2003 51-2004 50-2005 50-2006 50-2007 50-2008 51-2009 50-2010 50-2011 50-2012 50-2013 50-2014 51-2015 50-2016 50-2017 50-2018 50-2019
+ (12-15) 51-1992 50-1993 50-1994 50-1995 50-1996 51-1997 51-1998 50-1999 50-2000 50-2001 50-2002 51-2003 51-2004 50-2005 50-2006 50-2007 51-2008 51-2009 50-2010 50-2011 50-2012 50-2013 51-2014 51-2015 50-2016 50-2017 50-2018 50-2019
+ (12-16) 51-1992 50-1993 50-1994 50-1995 51-1996 51-1997 51-1998 50-1999 50-2000 50-2001 51-2002 51-2003 51-2004 50-2005 50-2006 50-2007 51-2008 51-2009 50-2010 50-2011 50-2012 51-2013 51-2014 51-2015 50-2016 50-2017 50-2018 51-2019
+ (12-17) 51-1992 50-1993 50-1994 50-1995 51-1996 51-1997 51-1998 50-1999 50-2000 51-2001 51-2002 51-2003 51-2004 50-2005 50-2006 51-2007 51-2008 51-2009 50-2010 50-2011 51-2012 51-2013 51-2014 51-2015 50-2016 50-2017 51-2018 51-2019
+ (12-18) 51-1992 50-1993 50-1994 51-1995 51-1996 51-1997 51-1998 50-1999 51-2000 51-2001 51-2002 51-2003 51-2004 50-2005 51-2006 51-2007 51-2008 51-2009 50-2010 50-2011 51-2012 51-2013 51-2014 51-2015 50-2016 51-2017 51-2018 51-2019
+ (12-19) 51-1992 50-1993 51-1994 51-1995 51-1996 51-1997 51-1998 50-1999 51-2000 51-2001 51-2002 51-2003 51-2004 51-2005 51-2006 51-2007 51-2008 51-2009 50-2010 51-2011 51-2012 51-2013 51-2014 51-2015 51-2016 51-2017 51-2018 51-2019
+ (12-20) 51-1992 51-1993 51-1994 51-1995 51-1996 51-1997 51-1998 51-1999 51-2000 51-2001 51-2002 51-2003 52-2004 51-2005 51-2006 51-2007 51-2008 51-2009 51-2010 51-2011 51-2012 51-2013 51-2014 51-2015 51-2016 51-2017 51-2018 51-2019
+ (12-21) 52-1992 51-1993 51-1994 51-1995 51-1996 51-1997 52-1998 51-1999 51-2000 51-2001 51-2002 51-2003 52-2004 51-2005 51-2006 51-2007 51-2008 52-2009 51-2010 51-2011 51-2012 51-2013 51-2014 52-2015 51-2016 51-2017 51-2018 51-2019
+ (12-22) 52-1992 51-1993 51-1994 51-1995 51-1996 52-1997 52-1998 51-1999 51-2000 51-2001 51-2002 52-2003 52-2004 51-2005 51-2006 51-2007 52-2008 52-2009 51-2010 51-2011 51-2012 51-2013 52-2014 52-2015 51-2016 51-2017 51-2018 51-2019
+ (12-23) 52-1992 51-1993 51-1994 51-1995 52-1996 52-1997 52-1998 51-1999 51-2000 51-2001 52-2002 52-2003 52-2004 51-2005 51-2006 51-2007 52-2008 52-2009 51-2010 51-2011 51-2012 52-2013 52-2014 52-2015 51-2016 51-2017 51-2018 52-2019
+ (12-24) 52-1992 51-1993 51-1994 51-1995 52-1996 52-1997 52-1998 51-1999 51-2000 52-2001 52-2002 52-2003 52-2004 51-2005 51-2006 52-2007 52-2008 52-2009 51-2010 51-2011 52-2012 52-2013 52-2014 52-2015 51-2016 51-2017 52-2018 52-2019
+ (12-25) 52-1992 51-1993 51-1994 52-1995 52-1996 52-1997 52-1998 51-1999 52-2000 52-2001 52-2002 52-2003 52-2004 51-2005 52-2006 52-2007 52-2008 52-2009 51-2010 51-2011 52-2012 52-2013 52-2014 52-2015 51-2016 52-2017 52-2018 52-2019
+ (12-26) 52-1992 51-1993 52-1994 52-1995 52-1996 52-1997 52-1998 51-1999 52-2000 52-2001 52-2002 52-2003 52-2004 52-2005 52-2006 52-2007 52-2008 52-2009 51-2010 52-2011 52-2012 52-2013 52-2014 52-2015 52-2016 52-2017 52-2018 52-2019
+ (12-27) 52-1992 52-1993 52-1994 52-1995 52-1996 52-1997 52-1998 52-1999 52-2000 52-2001 52-2002 52-2003 53-2004 52-2005 52-2006 52-2007 52-2008 52-2009 52-2010 52-2011 52-2012 52-2013 52-2014 52-2015 52-2016 52-2017 52-2018 52-2019
+ (12-28) 53-1992 52-1993 52-1994 52-1995 52-1996 52-1997 53-1998 52-1999 52-2000 52-2001 52-2002 52-2003 53-2004 52-2005 52-2006 52-2007 52-2008 53-2009 52-2010 52-2011 52-2012 52-2013 52-2014 53-2015 52-2016 52-2017 52-2018 52-2019
+ (12-29) 53-1992 52-1993 52-1994 52-1995 52-1996 01-1998 53-1998 52-1999 52-2000 52-2001 52-2002 01-2004 53-2004 52-2005 52-2006 52-2007 01-2009 53-2009 52-2010 52-2011 52-2012 52-2013 01-2015 53-2015 52-2016 52-2017 52-2018 52-2019
+ (12-30) 53-1992 52-1993 52-1994 52-1995 01-1997 01-1998 53-1998 52-1999 52-2000 52-2001 01-2003 01-2004 53-2004 52-2005 52-2006 52-2007 01-2009 53-2009 52-2010 52-2011 52-2012 01-2014 01-2015 53-2015 52-2016 52-2017 52-2018 01-2020
+ (12-31) 53-1992 52-1993 52-1994 52-1995 01-1997 01-1998 53-1998 52-1999 52-2000 01-2002 01-2003 01-2004 53-2004 52-2005 52-2006 01-2008 01-2009 53-2009 52-2010 52-2011 01-2013 01-2014 01-2015 53-2015 52-2016 52-2017 01-2019 01-2020
++1 (01-01) 53-1992 52-1993 52-1994 01-1996 01-1997 01-1998 53-1998 52-1999 01-2001 01-2002 01-2003 01-2004 53-2004 52-2005 01-2007 01-2008 01-2009 53-2009 52-2010 52-2011 01-2013 01-2014 01-2015 53-2015 52-2016 01-2018 01-2019 01-2020
++1 (01-02) 53-1992 52-1993 01-1995 01-1996 01-1997 01-1998 53-1998 52-1999 01-2001 01-2002 01-2003 01-2004 53-2004 01-2006 01-2007 01-2008 01-2009 53-2009 52-2010 01-2012 01-2013 01-2014 01-2015 53-2015 01-2017 01-2018 01-2019 01-2020
++1 (01-03) 53-1992 01-1994 01-1995 01-1996 01-1997 01-1998 53-1998 01-2000 01-2001 01-2002 01-2003 01-2004 01-2005 01-2006 01-2007 01-2008 01-2009 53-2009 01-2011 01-2012 01-2013 01-2014 01-2015 53-2015 01-2017 01-2018 01-2019 01-2020
++1 (01-04) 01-1993 01-1994 01-1995 01-1996 01-1997 01-1998 01-1999 01-2000 01-2001 01-2002 01-2003 01-2004 01-2005 01-2006 01-2007 01-2008 01-2009 01-2010 01-2011 01-2012 01-2013 01-2014 01-2015 01-2016 01-2017 01-2018 01-2019 01-2020
++1 (01-05) 01-1993 01-1994 01-1995 01-1996 01-1997 02-1998 01-1999 01-2000 01-2001 01-2002 01-2003 02-2004 01-2005 01-2006 01-2007 01-2008 02-2009 01-2010 01-2011 01-2012 01-2013 01-2014 02-2015 01-2016 01-2017 01-2018 01-2019 01-2020
++1 (01-06) 01-1993 01-1994 01-1995 01-1996 02-1997 02-1998 01-1999 01-2000 01-2001 01-2002 02-2003 02-2004 01-2005 01-2006 01-2007 01-2008 02-2009 01-2010 01-2011 01-2012 01-2013 02-2014 02-2015 01-2016 01-2017 01-2018 01-2019 02-2020
++1 (01-07) 01-1993 01-1994 01-1995 01-1996 02-1997 02-1998 01-1999 01-2000 01-2001 02-2002 02-2003 02-2004 01-2005 01-2006 01-2007 02-2008 02-2009 01-2010 01-2011 01-2012 02-2013 02-2014 02-2015 01-2016 01-2017 01-2018 02-2019 02-2020
++1 (01-08) 01-1993 01-1994 01-1995 02-1996 02-1997 02-1998 01-1999 01-2000 02-2001 02-2002 02-2003 02-2004 01-2005 01-2006 02-2007 02-2008 02-2009 01-2010 01-2011 01-2012 02-2013 02-2014 02-2015 01-2016 01-2017 02-2018 02-2019 02-2020
++1 (01-09) 01-1993 01-1994 02-1995 02-1996 02-1997 02-1998 01-1999 01-2000 02-2001 02-2002 02-2003 02-2004 01-2005 02-2006 02-2007 02-2008 02-2009 01-2010 01-2011 02-2012 02-2013 02-2014 02-2015 01-2016 02-2017 02-2018 02-2019 02-2020
++1 (01-10) 01-1993 02-1994 02-1995 02-1996 02-1997 02-1998 01-1999 02-2000 02-2001 02-2002 02-2003 02-2004 02-2005 02-2006 02-2007 02-2008 02-2009 01-2010 02-2011 02-2012 02-2013 02-2014 02-2015 01-2016 02-2017 02-2018 02-2019 02-2020
++1 (01-11) 02-1993 02-1994 02-1995 02-1996 02-1997 02-1998 02-1999 02-2000 02-2001 02-2002 02-2003 02-2004 02-2005 02-2006 02-2007 02-2008 02-2009 02-2010 02-2011 02-2012 02-2013 02-2014 02-2015 02-2016 02-2017 02-2018 02-2019 02-2020
++1 (01-12) 02-1993 02-1994 02-1995 02-1996 02-1997 03-1998 02-1999 02-2000 02-2001 02-2002 02-2003 03-2004 02-2005 02-2006 02-2007 02-2008 03-2009 02-2010 02-2011 02-2012 02-2013 02-2014 03-2015 02-2016 02-2017 02-2018 02-2019 02-2020
++1 (01-13) 02-1993 02-1994 02-1995 02-1996 03-1997 03-1998 02-1999 02-2000 02-2001 02-2002 03-2003 03-2004 02-2005 02-2006 02-2007 02-2008 03-2009 02-2010 02-2011 02-2012 02-2013 03-2014 03-2015 02-2016 02-2017 02-2018 02-2019 03-2020
++1 (01-14) 02-1993 02-1994 02-1995 02-1996 03-1997 03-1998 02-1999 02-2000 02-2001 03-2002 03-2003 03-2004 02-2005 02-2006 02-2007 03-2008 03-2009 02-2010 02-2011 02-2012 03-2013 03-2014 03-2015 02-2016 02-2017 02-2018 03-2019 03-2020
++1 (01-15) 02-1993 02-1994 02-1995 03-1996 03-1997 03-1998 02-1999 02-2000 03-2001 03-2002 03-2003 03-2004 02-2005 02-2006 03-2007 03-2008 03-2009 02-2010 02-2011 02-2012 03-2013 03-2014 03-2015 02-2016 02-2017 03-2018 03-2019 03-2020
++1 (01-16) 02-1993 02-1994 03-1995 03-1996 03-1997 03-1998 02-1999 02-2000 03-2001 03-2002 03-2003 03-2004 02-2005 03-2006 03-2007 03-2008 03-2009 02-2010 02-2011 03-2012 03-2013 03-2014 03-2015 02-2016 03-2017 03-2018 03-2019 03-2020
++1 (01-17) 02-1993 03-1994 03-1995 03-1996 03-1997 03-1998 02-1999 03-2000 03-2001 03-2002 03-2003 03-2004 03-2005 03-2006 03-2007 03-2008 03-2009 02-2010 03-2011 03-2012 03-2013 03-2014 03-2015 02-2016 03-2017 03-2018 03-2019 03-2020
++1 (01-18) 03-1993 03-1994 03-1995 03-1996 03-1997 03-1998 03-1999 03-2000 03-2001 03-2002 03-2003 03-2004 03-2005 03-2006 03-2007 03-2008 03-2009 03-2010 03-2011 03-2012 03-2013 03-2014 03-2015 03-2016 03-2017 03-2018 03-2019 03-2020
+----
diff --git a/ext/date/tests/bug34087.phpt b/ext/date/tests/bug34087.phpt
new file mode 100644
index 000000000..3fa388548
--- /dev/null
+++ b/ext/date/tests/bug34087.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #34087 (strtotime() does not work with date format "Y/m/d")
+--FILE--
+<?php
+date_default_timezone_set("UTC");
+echo "Y/m/d: ", strtotime("2005/8/12"), "\n";
+echo "Y-m-d: ", strtotime("2005-8-12"), "\n";
+
+echo date(DATE_ISO8601, strtotime("2005/1/2")), "\n";
+echo date(DATE_ISO8601, strtotime("2005/01/02")), "\n";
+echo date(DATE_ISO8601, strtotime("2005/01/2")), "\n";
+echo date(DATE_ISO8601, strtotime("2005/1/02")), "\n";
+?>
+--EXPECT--
+Y/m/d: 1123804800
+Y-m-d: 1123804800
+2005-01-02T00:00:00+0000
+2005-01-02T00:00:00+0000
+2005-01-02T00:00:00+0000
+2005-01-02T00:00:00+0000
diff --git a/ext/date/tests/bug34304.phpt b/ext/date/tests/bug34304.phpt
new file mode 100644
index 000000000..a2b26a14c
--- /dev/null
+++ b/ext/date/tests/bug34304.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #34304 ()
+--FILE--
+<?php
+date_default_timezone_set("UTC");
+echo date('o\-\WW\-N', strtotime('2 January 2005')), "\n";
+echo date('o\-\WW\-N', strtotime('9 January 2005')), "\n";
+?>
+--EXPECT--
+2004-W53-7
+2005-W01-7
diff --git a/ext/date/tests/bug34676.phpt b/ext/date/tests/bug34676.phpt
new file mode 100644
index 000000000..6f616feb4
--- /dev/null
+++ b/ext/date/tests/bug34676.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #34676 (missing support for strtotime("midnight") and strtotime("noon"))
+--FILE--
+<?php
+date_default_timezone_set("UTC");
+
+$tests = array(
+ 'noon', 'midnight'
+);
+
+foreach ($tests as $test) {
+ $t = strtotime("2005-12-22 ". $test);
+ printf("%-10s => %s\n", $test, date(DATE_ISO8601, $t));
+}
+
+?>
+--EXPECT--
+noon => 2005-12-22T12:00:00+0000
+midnight => 2005-12-22T00:00:00+0000
diff --git a/ext/date/tests/bug34771.phpt b/ext/date/tests/bug34771.phpt
new file mode 100644
index 000000000..a27d085a1
--- /dev/null
+++ b/ext/date/tests/bug34771.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug #34771 (strtotime() fails with 1-12am/pm)
+--FILE--
+<?php
+date_default_timezone_set("UTC");
+
+$tests = array(
+ '12am', '1am', '1pm',
+ '12a.m.', '1a.m.', '1p.m.',
+ '12:00am', '1:00am', '1:00pm',
+ '12:00a.m.', '1:00a.m.', '1:00p.m.'
+);
+
+foreach ($tests as $test) {
+ $t = strtotime("2005-12-22 ". $test);
+ printf("%-10s => %s\n", $test, date(DATE_ISO8601, $t));
+}
+
+?>
+--EXPECT--
+12am => 2005-12-22T00:00:00+0000
+1am => 2005-12-22T01:00:00+0000
+1pm => 2005-12-22T13:00:00+0000
+12a.m. => 2005-12-22T00:00:00+0000
+1a.m. => 2005-12-22T01:00:00+0000
+1p.m. => 2005-12-22T13:00:00+0000
+12:00am => 2005-12-22T00:00:00+0000
+1:00am => 2005-12-22T01:00:00+0000
+1:00pm => 2005-12-22T13:00:00+0000
+12:00a.m. => 2005-12-22T00:00:00+0000
+1:00a.m. => 2005-12-22T01:00:00+0000
+1:00p.m. => 2005-12-22T13:00:00+0000
diff --git a/ext/date/tests/bug35143.phpt b/ext/date/tests/bug35143.phpt
new file mode 100644
index 000000000..02b007271
--- /dev/null
+++ b/ext/date/tests/bug35143.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #35143 (gettimeofday() ignores current time zone)
+--FILE--
+<?php
+date_default_timezone_set("UTC");
+
+var_dump(date_default_timezone_get());
+var_dump(gettimeofday());
+?>
+--EXPECTF--
+string(3) "UTC"
+array(4) {
+ ["sec"]=>
+ int(%d)
+ ["usec"]=>
+ int(%d)
+ ["minuteswest"]=>
+ int(0)
+ ["dsttime"]=>
+ int(0)
+}
diff --git a/ext/date/tests/bug35218.phpt b/ext/date/tests/bug35218.phpt
new file mode 100644
index 000000000..725f03c4a
--- /dev/null
+++ b/ext/date/tests/bug35218.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #35218 (strtotime no longer ignores timezone comments like "(PST)")
+--FILE--
+<?php
+date_default_timezone_set("UTC");
+$date = 'Sun, 13 Nov 2005 22:56:10 -0800 (PST)';
+$date_fixed = 'Sun, 13 Nov 2005 22:56:10 -0800';
+
+var_dump(strtotime($date));
+var_dump(strtotime($date_fixed));
+?>
+--EXPECT--
+int(1131951370)
+int(1131951370)
diff --git a/ext/standard/tests/time/date.phpt b/ext/date/tests/date.phpt
index 87cae0b31..ccdb3cda9 100644
--- a/ext/standard/tests/time/date.phpt
+++ b/ext/date/tests/date.phpt
@@ -6,13 +6,13 @@ $tmp = "cr";
putenv ("TZ=GMT0");
for($a = 0;$a < strlen($tmp); $a++){
- echo $tmp{$a}, ': ', date($tmp{$a}, 1043324459)."\n";
+ echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n";
}
putenv ("TZ=MET");
for($a = 0;$a < strlen($tmp); $a++){
- echo $tmp{$a}, ': ', date($tmp{$a}, 1043324459)."\n";
+ echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n";
}
?>
--EXPECT--
diff --git a/ext/date/tests/date_create-1.phpt b/ext/date/tests/date_create-1.phpt
new file mode 100644
index 000000000..c66bb6fd3
--- /dev/null
+++ b/ext/date/tests/date_create-1.phpt
@@ -0,0 +1,48 @@
+--TEST--
+date_create() function [1]
+--SKIPIF--
+<?php if (!function_exists('date_create')) echo "SKIP"; ?>
+--FILE--
+<?php
+date_default_timezone_set('Europe/Oslo');
+$tz1 = timezone_open("GMT");
+$tz2 = timezone_open("Europe/London");
+$tz3 = timezone_open("America/Los_Angeles");
+$d = array();
+$d[] = date_create("2005-07-14 22:30:41");
+$d[] = date_create("2005-07-14 22:30:41 GMT");
+$d[] = date_create("2005-07-14 22:30:41 CET");
+$d[] = date_create("2005-07-14 22:30:41 CEST");
+$d[] = date_create("2005-07-14 22:30:41 Europe/Oslo");
+$d[] = date_create("2005-07-14 22:30:41 America/Los_Angeles");
+
+$d[] = date_create("2005-07-14 22:30:41", $tz1);
+$d[] = date_create("2005-07-14 22:30:41", $tz2);
+$d[] = date_create("2005-07-14 22:30:41", $tz3);
+
+$d[] = date_create("2005-07-14 22:30:41 GMT", $tz1);
+$d[] = date_create("2005-07-14 22:30:41 GMT", $tz2);
+$d[] = date_create("2005-07-14 22:30:41 GMT", $tz3);
+
+$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";
+}
+?>
+--EXPECT--
+2005-07-14T22:30:41+0200
+2005-07-14T22:30:41+0000
+2005-07-14T22:30:41+0100
+2005-07-14T22:30:41+0200
+2005-07-14T22:30:41+0200
+2005-07-14T22:30:41-0700
+2005-07-14T22:30:41+0000
+2005-07-14T22:30:41+0100
+2005-07-14T22:30:41-0700
+2005-07-14T22:30:41+0000
+2005-07-14T22:30:41+0000
+2005-07-14T22:30:41+0000
+2005-07-14T22:30:41+0200
+2005-07-14T22:30:41-0700
diff --git a/ext/date/tests/date_create-2.phpt b/ext/date/tests/date_create-2.phpt
new file mode 100644
index 000000000..d7c785e22
--- /dev/null
+++ b/ext/date/tests/date_create-2.phpt
@@ -0,0 +1,12 @@
+--TEST--
+date_create() function [2]
+--SKIPIF--
+<?php if (!function_exists('date_create')) echo "SKIP"; ?>
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+$d = date_create("2005-07-18 22:10:00 +0400");
+echo $d->format(date::RFC822), "\n";
+?>
+--EXPECT--
+Mon, 18 Jul 2005 22:10:00 GMT+0400
diff --git a/ext/date/tests/date_default_timezone_get-1.phpt b/ext/date/tests/date_default_timezone_get-1.phpt
new file mode 100644
index 000000000..e6319bab5
--- /dev/null
+++ b/ext/date/tests/date_default_timezone_get-1.phpt
@@ -0,0 +1,16 @@
+--TEST--
+date_default_timezone_get() function [1]
+--INI--
+date.timezone=
+--FILE--
+<?php
+ putenv('TZ=');
+ echo date_default_timezone_get(), "\n";
+ echo date('e'), "\n";
+?>
+--EXPECTF--
+Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 3
+Europe/London
+
+Strict Standards: date(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 4
+Europe/London
diff --git a/ext/date/tests/date_default_timezone_get-2.phpt b/ext/date/tests/date_default_timezone_get-2.phpt
new file mode 100644
index 000000000..3fef09788
--- /dev/null
+++ b/ext/date/tests/date_default_timezone_get-2.phpt
@@ -0,0 +1,12 @@
+--TEST--
+date_default_timezone_get() function [2]
+--INI--
+date.timezone=CEST
+--FILE--
+<?php
+ putenv('TZ=');
+ echo date_default_timezone_get(), "\n";
+?>
+--EXPECTF--
+Notice: date_default_timezone_get(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in %sdate_default_timezone_get-2.php on line 3
+UTC
diff --git a/ext/date/tests/date_default_timezone_get-3.phpt b/ext/date/tests/date_default_timezone_get-3.phpt
new file mode 100644
index 000000000..0e2e3c53e
--- /dev/null
+++ b/ext/date/tests/date_default_timezone_get-3.phpt
@@ -0,0 +1,15 @@
+--TEST--
+date_default_timezone_get() function [3]
+--INI--
+date.timezone=
+--FILE--
+<?php
+ putenv('TZ=Europe/Rome');
+ echo date_default_timezone_get(), "\n";
+
+ date_default_timezone_set("America/Chicago");
+ echo date_default_timezone_get(), "\n";
+?>
+--EXPECT--
+Europe/Rome
+America/Chicago
diff --git a/ext/date/tests/date_default_timezone_set-1.phpt b/ext/date/tests/date_default_timezone_set-1.phpt
new file mode 100644
index 000000000..90916e923
--- /dev/null
+++ b/ext/date/tests/date_default_timezone_set-1.phpt
@@ -0,0 +1,28 @@
+--TEST--
+date_default_timezone_set() function [1]
+--INI--
+date.timezone=
+--FILE--
+<?php
+ putenv("TZ=");
+ $date1 = strtotime("2005-01-12 08:00:00");
+ $date2 = strtotime("2005-07-12 08:00:00");
+ date_default_timezone_set("America/Indiana/Knox");
+ $date3 = strtotime("2005-01-12 08:00:00");
+ $date4 = strtotime("2005-07-12 08:00:00");
+
+ echo date_default_timezone_get(), "\n";
+ echo date(DATE_ISO8601, $date1), "\n";
+ echo date(DATE_ISO8601, $date2), "\n";
+ echo date(DATE_ISO8601, $date3), "\n";
+ echo date(DATE_ISO8601, $date4), "\n";
+?>
+--EXPECTF--
+Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3
+
+Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 4
+America/Indiana/Knox
+2005-01-12T03:00:00-0500
+2005-07-12T02:00:00-0500
+2005-01-12T08:00:00-0500
+2005-07-12T08:00:00-0500
diff --git a/ext/date/tests/date_modify-1.phpt b/ext/date/tests/date_modify-1.phpt
new file mode 100644
index 000000000..dc03f5ff9
--- /dev/null
+++ b/ext/date/tests/date_modify-1.phpt
@@ -0,0 +1,30 @@
+--TEST--
+date_modify() function [1]
+--SKIPIF--
+<?php if (!function_exists('date_create')) echo "SKIP"; ?>
+--FILE--
+<?php
+date_default_timezone_set("Pacific/Kwajalein");
+$ts = date_create("Thu Aug 19 1993 23:59:59");
+echo date_format($ts, date::RFC822), "\n";
+$ts->modify("+1 second");
+echo date_format($ts, date::RFC822), "\n";
+
+date_default_timezone_set("Europe/Amsterdam");
+$ts = date_create("Sun Mar 27 01:59:59 2005");
+echo date_format($ts, date::RFC822), "\n";
+$ts->modify("+1 second");
+echo date_format($ts, date::RFC822), "\n";
+
+$ts = date_create("Sun Oct 30 01:59:59 2005");
+echo date_format($ts, date::RFC822), "\n";
+$ts->modify("+ 1 hour 1 second");
+echo date_format($ts, date::RFC822), "\n";
+?>
+--EXPECT--
+Thu, 19 Aug 1993 23:59:59 KWAT
+Sat, 21 Aug 1993 00:00:00 MHT
+Sun, 27 Mar 2005 01:59:59 CET
+Sun, 27 Mar 2005 03:00:00 CEST
+Sun, 30 Oct 2005 01:59:59 CEST
+Sun, 30 Oct 2005 03:00:00 CET
diff --git a/ext/date/tests/date_modify-2.phpt b/ext/date/tests/date_modify-2.phpt
new file mode 100644
index 000000000..9bf7a5d2d
--- /dev/null
+++ b/ext/date/tests/date_modify-2.phpt
@@ -0,0 +1,15 @@
+--TEST--
+date_modify() function [2]
+--SKIPIF--
+<?php if (!function_exists('date_create')) echo "SKIP"; ?>
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+$d = date_create("2005-07-18 22:10:00 +0400");
+echo date_format($d, date::RFC822), "\n";
+date_modify($d, "+1 hour");
+echo date_format($d, date::RFC822), "\n";
+?>
+--EXPECT--
+Mon, 18 Jul 2005 22:10:00 GMT+0400
+Mon, 18 Jul 2005 23:10:00 GMT+0400
diff --git a/ext/date/tests/default-timezone-1.phpt b/ext/date/tests/default-timezone-1.phpt
new file mode 100644
index 000000000..ea5f2e6b8
--- /dev/null
+++ b/ext/date/tests/default-timezone-1.phpt
@@ -0,0 +1,11 @@
+--TEST--
+date.timezone setting [1]
+--INI--
+date.timezone=GMT
+--FILE--
+<?php
+ putenv('TZ='); // clean TZ so that it doesn't bypass the ini option
+ echo strtotime("2005-06-18 22:15:44");
+?>
+--EXPECT--
+1119132944
diff --git a/ext/date/tests/default-timezone-2.phpt b/ext/date/tests/default-timezone-2.phpt
new file mode 100644
index 000000000..c9a404bcc
--- /dev/null
+++ b/ext/date/tests/default-timezone-2.phpt
@@ -0,0 +1,11 @@
+--TEST--
+date.timezone setting [2]
+--INI--
+date.timezone=Europe/Oslo
+--FILE--
+<?php
+ putenv('TZ='); // clean TZ so that it doesn't bypass the ini option
+ echo strtotime("2005-06-18 22:15:44");
+?>
+--EXPECT--
+1119125744
diff --git a/ext/date/tests/format-negative-timestamp.phpt b/ext/date/tests/format-negative-timestamp.phpt
new file mode 100644
index 000000000..5fd6a6589
--- /dev/null
+++ b/ext/date/tests/format-negative-timestamp.phpt
@@ -0,0 +1,24 @@
+--TEST--
+strtotime() - Format: @timestamps
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+
+$i = 5;
+$max = getrandmax();
+$max_2 = $max / 2;
+
+while($i--) {
+ $new_tm = rand(1, $max);
+ if ($new_tm > $max_2)
+ $new_tm *= -1;
+
+ if (strtotime("@$new_tm") != $new_tm) {
+ echo "Error when parsing: @$new_tm\n";
+ }
+}
+
+echo "done!";
+?>
+--EXPECT--
+done!
diff --git a/ext/standard/tests/time/003.phpt b/ext/date/tests/mktime-1.phpt
index 0bf1c84e3..87fc0df68 100644
--- a/ext/standard/tests/time/003.phpt
+++ b/ext/date/tests/mktime-1.phpt
@@ -1,7 +1,10 @@
--TEST--
Check for mktime with out-of-range parameters
+--INI--
+error_reporting=2047
--FILE--
<?php
+ date_default_timezone_set("Europe/Amsterdam");
# MacOS/X libc implementation doesn't treat out-of-range values
# the same way other unices do (Bug# 10686) so some extra code
# was added to datetime.c to take care of this
diff --git a/ext/standard/tests/time/mktime.phpt b/ext/date/tests/mktime-2.phpt
index 74beeadce..2b6e61867 100644
--- a/ext/standard/tests/time/mktime.phpt
+++ b/ext/date/tests/mktime-2.phpt
@@ -1,7 +1,9 @@
--TEST--
-mktime()
+mktime() [2]
+--INI--
+error_reporting=2047
--FILE--
-<?php /* $Id: mktime.phpt,v 1.5 2004/03/31 01:00:55 abies Exp $ */
+<?php /* $Id: mktime-2.phpt,v 1.1.2.1 2005/08/09 21:10:22 derick Exp $ */
$timezones = array(
'GMT0',
'Europe/London'
diff --git a/ext/date/tests/mktime-3.phpt b/ext/date/tests/mktime-3.phpt
new file mode 100644
index 000000000..d4ccfbabe
--- /dev/null
+++ b/ext/date/tests/mktime-3.phpt
@@ -0,0 +1,52 @@
+--TEST--
+mktime() [3]
+--INI--
+error_reporting=2047
+--FILE--
+<?php
+$tzs = array("America/Toronto", "Europe/Oslo");
+$years = array(0, 69, 70, 71, 99, 100, 1900, 1901, 1902, 1999, 2000, 2001);
+
+foreach ($tzs as $tz) {
+ echo $tz, "\n";
+ date_default_timezone_set($tz);
+ foreach ($years as $year) {
+ printf("Y: %4d - ", $year);
+ $ret = mktime(1, 1, 1, 1, 1, $year);
+ if ($ret == FALSE) {
+ echo "out of range\n";
+ } else {
+ echo date("F ".DATE_ISO8601, $ret), "\n";
+ }
+ }
+ echo "\n";
+}
+?>
+--EXPECT--
+America/Toronto
+Y: 0 - January 2000-01-01T01:01:01-0500
+Y: 69 - out of range
+Y: 70 - January 1970-01-01T01:01:01-0500
+Y: 71 - January 1971-01-01T01:01:01-0500
+Y: 99 - January 1999-01-01T01:01:01-0500
+Y: 100 - January 2000-01-01T01:01:01-0500
+Y: 1900 - out of range
+Y: 1901 - out of range
+Y: 1902 - January 1902-01-01T01:01:01-0500
+Y: 1999 - January 1999-01-01T01:01:01-0500
+Y: 2000 - January 2000-01-01T01:01:01-0500
+Y: 2001 - January 2001-01-01T01:01:01-0500
+
+Europe/Oslo
+Y: 0 - January 2000-01-01T01:01:01+0100
+Y: 69 - out of range
+Y: 70 - January 1970-01-01T01:01:01+0100
+Y: 71 - January 1971-01-01T01:01:01+0100
+Y: 99 - January 1999-01-01T01:01:01+0100
+Y: 100 - January 2000-01-01T01:01:01+0100
+Y: 1900 - out of range
+Y: 1901 - out of range
+Y: 1902 - January 1902-01-01T01:01:01+0100
+Y: 1999 - January 1999-01-01T01:01:01+0100
+Y: 2000 - January 2000-01-01T01:01:01+0100
+Y: 2001 - January 2001-01-01T01:01:01+0100
diff --git a/ext/date/tests/strtotime.phpt b/ext/date/tests/strtotime.phpt
new file mode 100644
index 000000000..6560d7f1f
--- /dev/null
+++ b/ext/date/tests/strtotime.phpt
@@ -0,0 +1,16 @@
+--TEST--
+strtotime() function
+--FILE--
+<?php
+date_default_timezone_set('Europe/Oslo');
+$d = array();
+$d[] = strtotime("2005-07-14 22:30:41");
+$d[] = strtotime("2005-07-14 22:30:41 GMT");
+
+foreach($d as $date) {
+ echo date(DATE_ISO8601, $date), "\n";
+}
+?>
+--EXPECT--
+2005-07-14T22:30:41+0200
+2005-07-15T00:30:41+0200
diff --git a/ext/date/tests/timezone-configuration.phpt b/ext/date/tests/timezone-configuration.phpt
new file mode 100644
index 000000000..147b10a82
--- /dev/null
+++ b/ext/date/tests/timezone-configuration.phpt
@@ -0,0 +1,19 @@
+--TEST--
+timezone configuration [1]
+--INI--
+date.timezone=GMT
+--FILE--
+<?php
+ putenv('TZ=Europe/Oslo');
+ echo strtotime("2005-06-18 22:15:44"), "\n";
+
+ putenv('TZ=Europe/London');
+ echo strtotime("2005-06-18 22:15:44"), "\n";
+
+ date_default_timezone_set('Europe/Oslo');
+ echo strtotime("2005-06-18 22:15:44"), "\n";
+?>
+--EXPECT--
+1119125744
+1119129344
+1119125744
diff --git a/ext/dba/config.m4 b/ext/dba/config.m4
index 10202e0db..32412cf7a 100644
--- a/ext/dba/config.m4
+++ b/ext/dba/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.60.2.4 2005/08/22 19:59:36 iliaa Exp $
+dnl $Id: config.m4,v 1.70.2.1 2005/08/22 19:59:28 iliaa Exp $
dnl
dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -21,7 +21,7 @@ AC_DEFUN([PHP_TEMP_LDFLAGS],[
dnl Assign INCLUDE/LFLAGS from PREFIX
AC_DEFUN([PHP_DBA_STD_ASSIGN],[
if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
- THIS_LFLAGS=$THIS_PREFIX/lib
+ THIS_LFLAGS=$THIS_PREFIX/$PHP_LIBDIR
fi
])
@@ -66,7 +66,8 @@ AC_DEFUN([AC_DBA_STD_RESULT],[
])
PHP_ARG_ENABLE(dba,whether to enable DBA,
-[ --enable-dba Build DBA with builtin modules])
+[ --enable-dba Build DBA with builtin modules. To build shared DBA
+ extension use --enable-dba=shared])
AC_ARG_WITH(qdbm,
[ --with-qdbm[=DIR] DBA: Include QDBM support],[
@@ -86,7 +87,7 @@ AC_ARG_WITH(qdbm,
AC_DEFINE_UNQUOTED(QDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_QDBM, 1, [ ])
THIS_LIBS=$LIB
- ], [], [-L$THIS_PREFIX/lib])
+ ], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
if test -n "$THIS_LIBS"; then
break
fi
@@ -120,7 +121,7 @@ AC_ARG_WITH(gdbm,
AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_GDBM, 1, [ ])
THIS_LIBS=gdbm
- ], [], [-L$THIS_PREFIX/lib])
+ ], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
fi
PHP_DBA_STD_ASSIGN
@@ -152,7 +153,7 @@ AC_ARG_WITH(ndbm,
AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_NDBM, 1, [ ])
THIS_LIBS=$LIB
- ], [], [-L$THIS_PREFIX/lib])
+ ], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
if test -n "$THIS_LIBS"; then
break
fi
@@ -170,8 +171,8 @@ dnl Berkeley specific (library and version test)
dnl parameters(version, library list, function)
AC_DEFUN([PHP_DBA_DB_CHECK],[
for LIB in $2; do
- if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f $THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then
- PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib, -l$LIB,[
+ if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a -o -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then
+ PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$LIB,[
AC_TRY_LINK([
#include "$THIS_INCLUDE"
],[
@@ -191,7 +192,7 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
fi
done
if test -z "$THIS_LIBS"; then
- AC_MSG_CHECKING(for db$1 major version)
+ AC_MSG_CHECKING(for db$1 major version)
AC_MSG_ERROR(Header contains different version)
fi
if test "$1" = "4"; then
@@ -226,6 +227,9 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
AC_DEFINE_UNQUOTED(DB$1_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
fi
fi
+ DB$1_LIBS=$THIS_LIBS
+ DB$1_PREFIX=$THIS_PREFIX
+ DB$1_INCLUDE=$THIS_INCLUDE
PHP_DBA_STD_ASSIGN
PHP_DBA_STD_CHECK
PHP_DBA_STD_ATTACH
@@ -333,6 +337,75 @@ AC_ARG_WITH(db2,
])
AC_DBA_STD_RESULT(db2,Berkeley DB2)
+AC_ARG_WITH(db1,
+[ --with-db1[=DIR] DBA: Include Berkeley DB1 support/emulation],[
+ if test "$withval" != "no"; then
+ PHP_DBA_STD_BEGIN
+ AC_MSG_CHECKING(for DB1 in library)
+ if test "$HAVE_DB4" = "1"; then
+ THIS_VERSION=4
+ THIS_LIBS=$DB4_LIBS
+ THIS_PREFIX=$DB4_PREFIX
+ elif test "$HAVE_DB3" = "1"; then
+ THIS_LIBS=$DB3_LIBS
+ THIS_PREFIX=$DB3_PREFIX
+ elif test "$HAVE_DB2" = "1"; then
+ THIS_VERSION=2
+ THIS_LIBS=$DB2_LIBS
+ THIS_PREFIX=$DB2_PREFIX
+ fi
+ if test "$HAVE_DB4" = "1" -o "$HAVE_DB3" = "1" -o "$HAVE_DB2" = "1"; then
+ AC_DEFINE_UNQUOTED(DB1_VERSION, "Berkeley DB 1.85 emulation in DB$THIS_VERSION", [ ])
+ for i in db$THIS_VERSION/db_185.h include/db$THIS_VERSION/db_185.h include/db/db_185.h; do
+ if test -f "$THIS_PREFIX/$i"; then
+ THIS_INCLUDE=$THIS_PREFIX/$i
+ break
+ fi
+ done
+ else
+ AC_DEFINE_UNQUOTED(DB1_VERSION, "Unknown DB1", [ ])
+ for i in $withval /usr/local /usr; do
+ if test -f "$i/db1/db.h"; then
+ THIS_PREFIX=$i
+ THIS_INCLUDE=$i/db1/db.h
+ break
+ elif test -f "$i/include/db1/db.h"; then
+ THIS_PREFIX=$i
+ THIS_INCLUDE=$i/include/db1/db.h
+ break
+ elif test -f "$i/include/db.h"; then
+ THIS_PREFIX=$i
+ THIS_INCLUDE=$i/include/db.h
+ break
+ fi
+ done
+ THIS_LIBS=db
+ fi
+ AC_MSG_RESULT($THIS_LIBS)
+ AC_MSG_CHECKING(for DB1 in header)
+ AC_MSG_RESULT($THIS_INCLUDE)
+ if test -n "$THIS_INCLUDE"; then
+ PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$THIS_LIBS,[
+ AC_TRY_LINK([
+#include "$THIS_INCLUDE"
+ ],[
+ DB * dbp = dbopen("", 0, 0, DB_HASH, 0);
+ ],[
+ AC_DEFINE_UNQUOTED(DB1_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
+ AC_DEFINE(DBA_DB1, 1, [ ])
+ THIS_RESULT=yes
+ ],[
+ THIS_RESULT=no
+ ])
+ ])
+ fi
+ PHP_DBA_STD_ASSIGN
+ PHP_DBA_STD_CHECK
+ PHP_DBA_STD_ATTACH
+ fi
+])
+AC_DBA_STD_RESULT(db1,DB1)
+
AC_ARG_WITH(dbm,
[ --with-dbm[=DIR] DBA: Include DBM support],[
if test "$withval" != "no"; then
@@ -366,7 +439,7 @@ AC_ARG_WITH(dbm,
fi
AC_DEFINE(DBA_DBM, 1, [ ])
THIS_LIBS=$LIB
- ], [], [-L$THIS_PREFIX/lib])
+ ], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
if test -n "$THIS_LIBS"; then
break
fi
@@ -408,7 +481,7 @@ AC_ARG_WITH(cdb,
AC_DEFINE_UNQUOTED(CDB_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_CDB, 1, [ ])
THIS_LIBS=$LIB
- ], [], [-L$THIS_PREFIX/lib])
+ ], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
if test -n "$THIS_LIBS"; then
break
fi
@@ -469,7 +542,7 @@ AC_MSG_CHECKING(whether to enable DBA interface)
if test "$HAVE_DBA" = "1"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBA, 1, [ ])
- PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources, $ext_shared)
+ PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources, $ext_shared)
PHP_ADD_BUILD_DIR($ext_builddir/libinifile)
PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
diff --git a/ext/dba/config.w32 b/ext/dba/config.w32
index ef18259f9..2239009dc 100644
--- a/ext/dba/config.w32
+++ b/ext/dba/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.2 2003/12/23 14:05:33 wez Exp $
+// $Id: config.w32,v 1.3 2005/02/26 01:05:33 helly Exp $
// vim:ft=javascript
ARG_WITH("dba", "DBA support", "no");
@@ -6,12 +6,12 @@ ARG_WITH("dba", "DBA support", "no");
if (PHP_DBA != "no") {
if (CHECK_LIB("libdb31s.lib", "dba", PHP_DBA) &&
CHECK_HEADER_ADD_INCLUDE("db.h", "CFLAGS_DBA")) {
- EXTENSION("dba", "dba.c dba_cdb.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c dba_inifile.c");
+ EXTENSION("dba", "dba.c dba_cdb.c dba_db1.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c dba_inifile.c");
ADD_SOURCES("ext/dba/libcdb", "cdb.c cdb_make.c uint32.c", "dba");
ADD_SOURCES("ext/dba/libflatfile", "flatfile.c", "dba");
ADD_SOURCES("ext/dba/libinifile", "inifile.c", "dba");
AC_DEFINE('HAVE_DBA', 1, 'DBA support');
- ADD_FLAG("CFLAGS_DBA", "/D DBA_DB3=1 /D DB3_INCLUDE_FILE=\"\\\"db.h\\\"\" /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1");
+ ADD_FLAG("CFLAGS_DBA", "/D DBA_DB1=0 /D DB1_VERSION=\"\\\"Berkeley DB 1.85 emulation in DB3\\\"\" /D DB1_INCLUDE_FILE=\"\\\"db_185.h\\\"\" /D DBA_DB3=1 /D DB3_INCLUDE_FILE=\"\\\"db.h\\\"\" /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1");
} else {
WARNING("dba not enabled; libraries and headers not found");
}
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index a1293c2a0..44be08c94 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba.c,v 1.109 2004/01/08 08:14:39 andi Exp $ */
+/* $Id: dba.c,v 1.111 2005/08/03 14:06:53 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -43,6 +43,7 @@
#include "php_ndbm.h"
#include "php_dbm.h"
#include "php_cdb.h"
+#include "php_db1.h"
#include "php_db2.h"
#include "php_db3.h"
#include "php_db4.h"
@@ -239,6 +240,9 @@ static dba_handler handler[] = {
#if DBA_CDB_BUILTIN
DBA_NAMED_HND(cdb_make, cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */
#endif
+#if DBA_DB1
+ DBA_HND(db1, DBA_LOCK_ALL) /* No lock in lib */
+#endif
#if DBA_DB2
DBA_HND(db2, DBA_LOCK_ALL) /* No lock in lib */
#endif
@@ -268,6 +272,8 @@ static dba_handler handler[] = {
#define DBA_DEFAULT "db3"
#elif DBA_DB2
#define DBA_DEFAULT "db2"
+#elif DBA_DB1
+#define DBA_DEFAULT "db1"
#elif DBA_GDBM
#define DBA_DEFAULT "gdbm"
#elif DBA_NBBM
diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c
index b2c4ad5cd..db54a6da8 100644
--- a/ext/dba/dba_cdb.c
+++ b/ext/dba/dba_cdb.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_cdb.c,v 1.31 2004/01/08 08:14:39 andi Exp $ */
+/* $Id: dba_cdb.c,v 1.32 2005/08/03 14:06:53 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/dba_db1.c b/ext/dba/dba_db1.c
new file mode 100755
index 000000000..87e645cf3
--- /dev/null
+++ b/ext/dba/dba_db1.c
@@ -0,0 +1,197 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Shen Cheng-Da <cdsheen@gmail.com> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: dba_db1.c,v 1.3 2005/08/03 14:06:53 sniper Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+
+#if DBA_DB1
+#include "php_db1.h"
+
+#ifdef DB1_INCLUDE_FILE
+#include DB1_INCLUDE_FILE
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define DB1_DATA dba_db1_data *dba = info->dbf
+#define DB1_GKEY DBT gkey; gkey.data = (char *) key; gkey.size = keylen
+
+typedef struct {
+ DB *dbp;
+} dba_db1_data;
+
+DBA_OPEN_FUNC(db1)
+{
+ dba_db1_data *dba;
+ DB *db;
+
+ int gmode;
+ int filemode = 0644;
+
+ if (info->argc > 0) {
+ convert_to_long_ex(info->argv[0]);
+ filemode = Z_LVAL_PP(info->argv[0]);
+ }
+
+ gmode = 0;
+ switch (info->mode) {
+ case DBA_READER:
+ gmode = O_RDONLY;
+ break;
+ case DBA_WRITER:
+ gmode = O_RDWR;
+ break;
+ case DBA_CREAT:
+ gmode = O_RDWR | O_CREAT;
+ break;
+ case DBA_TRUNC:
+ gmode = O_RDWR | O_CREAT | O_TRUNC;
+ break;
+ default:
+ return FAILURE; /* not possible */
+ }
+
+ db = dbopen((char *)info->path, gmode, filemode, DB_HASH, NULL);
+
+ if (db == NULL) {
+ return FAILURE;
+ }
+
+ dba = pemalloc(sizeof(*dba), info->flags&DBA_PERSISTENT);
+ dba->dbp = db;
+
+ info->dbf = dba;
+
+ return SUCCESS;
+}
+
+DBA_CLOSE_FUNC(db1)
+{
+ DB1_DATA;
+ dba->dbp->close(dba->dbp);
+ pefree(info->dbf, info->flags&DBA_PERSISTENT);
+}
+
+DBA_FETCH_FUNC(db1)
+{
+ DBT gval;
+ DB1_DATA;
+ DB1_GKEY;
+
+ memset(&gval, 0, sizeof(gval));
+ if (dba->dbp->get(dba->dbp, &gkey, &gval, 0) == RET_SUCCESS) {
+ if (newlen) *newlen = gval.size;
+ return estrndup(gval.data, gval.size);
+ }
+ return NULL;
+}
+
+DBA_UPDATE_FUNC(db1)
+{
+ DBT gval;
+ DB1_DATA;
+ DB1_GKEY;
+
+ gval.data = (char *) val;
+ gval.size = vallen;
+
+ return dba->dbp->put(dba->dbp, &gkey, &gval, mode == 1 ? R_NOOVERWRITE : 0) != RET_SUCCESS ? FAILURE : SUCCESS;
+}
+
+DBA_EXISTS_FUNC(db1)
+{
+ DBT gval;
+ DB1_DATA;
+ DB1_GKEY;
+
+ return dba->dbp->get(dba->dbp, &gkey, &gval, 0) != RET_SUCCESS ? FAILURE : SUCCESS;
+}
+
+DBA_DELETE_FUNC(db1)
+{
+ DB1_DATA;
+ DB1_GKEY;
+
+ return dba->dbp->del(dba->dbp, &gkey, 0) != RET_SUCCESS ? FAILURE : SUCCESS;
+}
+
+DBA_FIRSTKEY_FUNC(db1)
+{
+ DBT gkey;
+ DBT gval;
+ DB1_DATA;
+
+ memset(&gkey, 0, sizeof(gkey));
+ memset(&gval, 0, sizeof(gval));
+
+ if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_FIRST) == RET_SUCCESS) {
+ if (newlen) *newlen = gkey.size;
+ return estrndup(gkey.data, gkey.size);
+ }
+ return NULL;
+}
+
+DBA_NEXTKEY_FUNC(db1)
+{
+ DBT gkey;
+ DBT gval;
+ DB1_DATA;
+
+ memset(&gkey, 0, sizeof(gkey));
+ memset(&gval, 0, sizeof(gval));
+
+ if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_NEXT) == RET_SUCCESS) {
+ if (newlen) *newlen = gkey.size;
+ return estrndup(gkey.data, gkey.size);
+ }
+ return NULL;
+}
+
+DBA_OPTIMIZE_FUNC(db1)
+{
+ /* dummy */
+ return SUCCESS;
+}
+
+DBA_SYNC_FUNC(db1)
+{
+ return SUCCESS;
+}
+
+DBA_INFO_FUNC(db1)
+{
+ return estrdup(DB1_VERSION);
+}
+
+#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: sw=4 ts=4 fdm=marker
+ * vim<600: sw=4 ts=4
+ */
diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c
index ef98f7f78..d55a688da 100644
--- a/ext/dba/dba_db2.c
+++ b/ext/dba/dba_db2.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dba_db2.c,v 1.38 2004/05/10 01:42:43 helly Exp $ */
+/* $Id: dba_db2.c,v 1.39 2005/08/03 14:06:53 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c
index f9277b672..7515e71c6 100644
--- a/ext/dba/dba_db3.c
+++ b/ext/dba/dba_db3.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dba_db3.c,v 1.32 2004/05/10 01:42:43 helly Exp $ */
+/* $Id: dba_db3.c,v 1.33 2005/08/03 14:06:54 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c
index ae7f4f9a7..d86c83cee 100644
--- a/ext/dba/dba_db4.c
+++ b/ext/dba/dba_db4.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_db4.c,v 1.14 2004/05/10 01:42:43 helly Exp $ */
+/* $Id: dba_db4.c,v 1.15 2005/08/03 14:06:54 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c
index 2d3e82912..8403bcd87 100644
--- a/ext/dba/dba_dbm.c
+++ b/ext/dba/dba_dbm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dba_dbm.c,v 1.28 2004/01/08 08:14:39 andi Exp $ */
+/* $Id: dba_dbm.c,v 1.29 2005/08/03 14:06:54 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c
index 61f73149c..6778dbf05 100644
--- a/ext/dba/dba_flatfile.c
+++ b/ext/dba/dba_flatfile.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dba_flatfile.c,v 1.18 2004/01/08 08:14:39 andi Exp $ */
+/* $Id: dba_flatfile.c,v 1.19 2005/08/03 14:06:54 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c
index b39c3e208..e7ad94fb9 100644
--- a/ext/dba/dba_gdbm.c
+++ b/ext/dba/dba_gdbm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dba_gdbm.c,v 1.22 2004/01/08 08:14:39 andi Exp $ */
+/* $Id: dba_gdbm.c,v 1.23 2005/08/03 14:06:55 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c
index 3dd435026..92cb07acd 100644
--- a/ext/dba/dba_inifile.c
+++ b/ext/dba/dba_inifile.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dba_inifile.c,v 1.4 2004/01/08 08:14:39 andi Exp $ */
+/* $Id: dba_inifile.c,v 1.5 2005/08/03 14:06:55 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c
index cd099e2c7..a90340ead 100644
--- a/ext/dba/dba_ndbm.c
+++ b/ext/dba/dba_ndbm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dba_ndbm.c,v 1.18 2004/01/08 08:14:39 andi Exp $ */
+/* $Id: dba_ndbm.c,v 1.19 2005/08/03 14:06:55 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c
index b8e638c78..099aed88f 100755
--- a/ext/dba/dba_qdbm.c
+++ b/ext/dba/dba_qdbm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dba_qdbm.c,v 1.3 2004/01/08 16:47:18 sniper Exp $ */
+/* $Id: dba_qdbm.c,v 1.4 2005/08/03 14:06:55 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c
index 1d9300a3f..33752ccbd 100644
--- a/ext/dba/libcdb/cdb.c
+++ b/ext/dba/libcdb/cdb.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: cdb.c,v 1.9 2004/01/08 08:14:50 andi Exp $ */
+/* $Id: cdb.c,v 1.10 2005/08/03 14:06:56 sniper Exp $ */
/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/
@@ -188,6 +188,6 @@ int cdb_find(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
/* {{{ cdb_version */
char *cdb_version()
{
- return "0.75, $Revision: 1.9 $";
+ return "0.75, $Revision: 1.10 $";
}
/* }}} */
diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h
index 678327ad2..63076b86b 100644
--- a/ext/dba/libcdb/cdb.h
+++ b/ext/dba/libcdb/cdb.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: cdb.h,v 1.6 2004/01/08 17:31:56 sniper Exp $ */
+/* $Id: cdb.h,v 1.7 2005/08/03 14:06:56 sniper Exp $ */
/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/
diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c
index 79a6d1276..1bb147aa2 100644
--- a/ext/dba/libcdb/cdb_make.c
+++ b/ext/dba/libcdb/cdb_make.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: cdb_make.c,v 1.8 2004/01/08 08:14:50 andi Exp $ */
+/* $Id: cdb_make.c,v 1.9 2005/08/03 14:06:56 sniper Exp $ */
/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/
@@ -240,5 +240,5 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
/* {{{ cdb_make_version */
char *cdb_make_version()
{
- return "0.75, $Revision: 1.8 $";
+ return "0.75, $Revision: 1.9 $";
}
diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h
index 5a231a8f4..e2183830b 100644
--- a/ext/dba/libcdb/cdb_make.h
+++ b/ext/dba/libcdb/cdb_make.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: cdb_make.h,v 1.6 2004/01/08 17:31:56 sniper Exp $ */
+/* $Id: cdb_make.h,v 1.7 2005/08/03 14:06:56 sniper Exp $ */
/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/
diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c
index 29981ef7e..4fb8e6869 100644
--- a/ext/dba/libcdb/uint32.c
+++ b/ext/dba/libcdb/uint32.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: uint32.c,v 1.5 2004/01/08 08:14:50 andi Exp $ */
+/* $Id: uint32.c,v 1.6 2005/08/03 14:06:56 sniper Exp $ */
/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/
diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h
index 2ecbe1335..894ca29b7 100644
--- a/ext/dba/libcdb/uint32.h
+++ b/ext/dba/libcdb/uint32.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: uint32.h,v 1.5 2004/01/08 17:31:56 sniper Exp $ */
+/* $Id: uint32.h,v 1.6 2005/08/03 14:06:56 sniper Exp $ */
/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/
diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c
index 26ba98fa1..6b5eb19bf 100644
--- a/ext/dba/libflatfile/flatfile.c
+++ b/ext/dba/libflatfile/flatfile.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: flatfile.c,v 1.13 2004/01/08 08:14:51 andi Exp $ */
+/* $Id: flatfile.c,v 1.14 2005/08/03 14:06:56 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -307,7 +307,7 @@ datum flatfile_nextkey(flatfile *dba TSRMLS_DC) {
/* {{{ flatfile_version */
char *flatfile_version()
{
- return "1.0, $Revision: 1.13 $";
+ return "1.0, $Revision: 1.14 $";
}
/* }}} */
diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h
index 281f9011a..755048e17 100644
--- a/ext/dba/libflatfile/flatfile.h
+++ b/ext/dba/libflatfile/flatfile.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: flatfile.h,v 1.10 2004/01/08 17:31:57 sniper Exp $ */
+/* $Id: flatfile.h,v 1.11 2005/08/03 14:06:57 sniper Exp $ */
#ifndef PHP_LIB_FLATFILE_H
#define PHP_LIB_FLATFILE_H
diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c
index 95b9d3a8f..bd9c460dc 100644
--- a/ext/dba/libinifile/inifile.c
+++ b/ext/dba/libinifile/inifile.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: inifile.c,v 1.13 2004/01/08 08:14:53 andi Exp $ */
+/* $Id: inifile.c,v 1.14 2005/08/03 14:06:57 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -43,7 +43,7 @@
/* {{{ inifile_version */
char *inifile_version()
{
- return "1.0, $Revision: 1.13 $";
+ return "1.0, $Revision: 1.14 $";
}
/* }}} */
diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h
index 6d2ddbf03..bc4f6fd9a 100644
--- a/ext/dba/libinifile/inifile.h
+++ b/ext/dba/libinifile/inifile.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: inifile.h,v 1.4 2004/01/08 17:31:59 sniper Exp $ */
+/* $Id: inifile.h,v 1.5 2005/08/03 14:06:57 sniper Exp $ */
#ifndef PHP_LIB_INIFILE_H
#define PHP_LIB_INIFILE_H
diff --git a/ext/dba/php_db1.h b/ext/dba/php_db1.h
new file mode 100755
index 000000000..c0bb5f08b
--- /dev/null
+++ b/ext/dba/php_db1.h
@@ -0,0 +1,12 @@
+#ifndef PHP_DB1_H
+#define PHP_DB1_H
+
+#if DBA_DB1
+
+#include "php_dba.h"
+
+DBA_FUNCS(db1);
+
+#endif
+
+#endif
diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h
index 7fd8b0e36..1b06e8a04 100644
--- a/ext/dba/php_dba.h
+++ b/ext/dba/php_dba.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_dba.h,v 1.28 2004/01/08 17:31:55 sniper Exp $ */
+/* $Id: php_dba.h,v 1.29 2005/08/03 14:06:55 sniper Exp $ */
#ifndef PHP_DBA_H
#define PHP_DBA_H
diff --git a/ext/dba/tests/dba_db1.phpt b/ext/dba/tests/dba_db1.phpt
new file mode 100755
index 000000000..983954b50
--- /dev/null
+++ b/ext/dba/tests/dba_db1.phpt
@@ -0,0 +1,46 @@
+--TEST--
+DBA DB1 handler test
+--SKIPIF--
+<?php
+ $handler = 'db1';
+ require_once('skipif.inc');
+?>
+--FILE--
+<?php
+ $handler = 'db1';
+ require_once('test.inc');
+ require_once('dba_handler.inc');
+?>
+===DONE===
+--EXPECT--
+database handler: db1
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+ ["key number 6"]=>
+ string(13) "The 6th value"
+ ["key2"]=>
+ string(27) "Content 2 replaced 2nd time"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+ ["key number 6"]=>
+ string(13) "The 6th value"
+ ["key2"]=>
+ string(27) "Content 2 replaced 2nd time"
+ ["key5"]=>
+ string(23) "The last content string"
+}
+===DONE===
diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc
index 9a25316f2..c1e3c49c7 100644
--- a/ext/dba/tests/dba_handler.inc
+++ b/ext/dba/tests/dba_handler.inc
@@ -74,6 +74,9 @@ do {
dba_close($dba_reader);
}
if (($db_file = dba_popen($db_filename, 'r'.($handler!='gdbm'?'-':''), $handler))!==FALSE) {
+ if ($handler == 'dbm') {
+ dba_close($db_file);
+ }
}
if ($lock_flag == '') {
diff --git a/ext/dbase/config.m4 b/ext/dbase/config.m4
index 495dc6f38..8f65475ea 100644
--- a/ext/dbase/config.m4
+++ b/ext/dbase/config.m4
@@ -1,9 +1,7 @@
dnl
-dnl $Id: config.m4,v 1.7 2002/03/12 16:13:43 sas Exp $
+dnl $Id: config.m4,v 1.8 2005/05/29 23:16:40 sniper Exp $
dnl
-AC_ARG_WITH(dbase,[],[enable_dbase=$withval])
-
PHP_ARG_ENABLE(dbase,whether to enable dbase support,
[ --enable-dbase Enable the bundled dbase library])
diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c
index 3dae75b8d..54d6c5f01 100644
--- a/ext/dbase/dbase.c
+++ b/ext/dbase/dbase.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dbase.c,v 1.72.2.1 2005/02/04 14:29:05 derick Exp $ */
+/* $Id: dbase.c,v 1.74 2005/08/03 14:06:57 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dbase/php_dbase.h b/ext/dbase/php_dbase.h
index 3fe1c2043..3b62f7dd7 100644
--- a/ext/dbase/php_dbase.h
+++ b/ext/dbase/php_dbase.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_dbase.h,v 1.14 2004/01/08 17:32:00 sniper Exp $ */
+/* $Id: php_dbase.h,v 1.15 2005/08/03 14:06:58 sniper Exp $ */
#ifndef PHP_DBASE_H
#define PHP_DBASE_H
diff --git a/ext/dbx/CREDITS b/ext/dbx/CREDITS
deleted file mode 100644
index efc04660a..000000000
--- a/ext/dbx/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-dbx (database abstraction)
-Marc Boeren, Rui Hirokawa, Frank M. Kromann
diff --git a/ext/dbx/INSTALL b/ext/dbx/INSTALL
deleted file mode 100644
index d98e33a42..000000000
--- a/ext/dbx/INSTALL
+++ /dev/null
@@ -1,25 +0,0 @@
-
-If you downloaded this separately, you can place the dbx folder
-in the php-source-folders under the ext/ folder. Be sure to
-use buildconf to rebuild the configure script.
-
-Linux:
-
-Compile php with the --enable-dbx switch
-
-Windows:
-
-This should set all includepaths to the right
-relative folders. Open the .dsp and compile. You could also
-add this project to the php_modules project.
-It generates a php_dbx.dll in your extensions folder, and you
-must enable it in your php.ini file.
-
-
-When you run phpinfo(), dbx-support should be visible in the
-resulting table.
-
-Good luck and enjoy!
-
-Marc Boeren
-march 16th, 2001
diff --git a/ext/dbx/config.m4 b/ext/dbx/config.m4
deleted file mode 100644
index 424c2b734..000000000
--- a/ext/dbx/config.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-dnl
-dnl $Id: config.m4,v 1.4 2003/07/09 16:31:40 mboeren Exp $
-dnl
-
-PHP_ARG_ENABLE(dbx,whether to enable dbx support,
-[ --enable-dbx Enable dbx])
-
-if test "$PHP_DBX" != "no"; then
- PHP_NEW_EXTENSION(dbx, dbx.c dbx_mysql.c dbx_odbc.c dbx_pgsql.c dbx_mssql.c dbx_fbsql.c dbx_oci8.c dbx_sybasect.c dbx_sqlite.c, $ext_shared)
-fi
diff --git a/ext/dbx/config.w32 b/ext/dbx/config.w32
deleted file mode 100644
index fdd1e20df..000000000
--- a/ext/dbx/config.w32
+++ /dev/null
@@ -1,10 +0,0 @@
-// $Id: config.w32,v 1.1 2003/12/07 00:23:18 edink Exp $
-// vim:ft=javascript
-
-ARG_ENABLE("dbx", "Enable the bundled dbx library", "no");
-
-if (PHP_DBX != "no") {
- EXTENSION("dbx", "dbx.c dbx_fbsql.c dbx_mssql.c dbx_mysql.c dbx_oci8.c dbx_odbc.c dbx_pgsql.c dbx_sqlite.c dbx_sybasect.c");
- AC_DEFINE('HAVE_DBX', 1, 'dbx support');
- ADD_FLAG("CFLAGS_DBX", "/D HAVE_LIBINTL=1");
-}
diff --git a/ext/dbx/dbx.c b/ext/dbx/dbx.c
deleted file mode 100644
index 02b76d08c..000000000
--- a/ext/dbx/dbx.c
+++ /dev/null
@@ -1,995 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx.c,v 1.57 2004/01/08 08:15:09 andi Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "php_dbx.h"
-#include "ext/standard/info.h"
-
-/* defines for supported databases */
-#define DBX_UNKNOWN 0
-#define DBX_MYSQL 1
-#define DBX_ODBC 2
-#define DBX_PGSQL 3
-#define DBX_MSSQL 4
-#define DBX_FBSQL 5
-#define DBX_OCI8 6
-#define DBX_SYBASECT 7
-#define DBX_SQLITE 8
-/* includes for supported databases */
-#include "dbx.h"
-#include "dbx_mysql.h"
-#include "dbx_odbc.h"
-#include "dbx_pgsql.h"
-#include "dbx_mssql.h"
-#include "dbx_fbsql.h"
-#include "dbx_oci8.h"
-#include "dbx_sybasect.h"
-#include "dbx_sqlite.h"
-
-/* support routines */
-int module_exists(char *module_name)
-{
- zend_module_entry *zme;
- int r;
- r = zend_hash_find(&module_registry, module_name, strlen(module_name)+1, (void **) &zme);
- return r==0?1:0;
-}
-
-int module_identifier_exists(long module_identifier)
-{
- switch (module_identifier) {
- case DBX_MYSQL: return module_exists("mysql");
- case DBX_ODBC: return module_exists("odbc");
- case DBX_PGSQL: return module_exists("pgsql");
- case DBX_MSSQL: return module_exists("mssql");
- case DBX_FBSQL: return module_exists("fbsql");
- case DBX_OCI8: return module_exists("oci8");
- case DBX_SYBASECT: return module_exists("sybase_ct");
- case DBX_SQLITE: return module_exists("sqlite");
- }
- return 0;
-}
-
-int get_module_identifier(char *module_name)
-{
- if (!strcmp("mysql", module_name)) return DBX_MYSQL;
- if (!strcmp("odbc", module_name)) return DBX_ODBC;
- if (!strcmp("pgsql", module_name)) return DBX_PGSQL;
- if (!strcmp("mssql", module_name)) return DBX_MSSQL;
- if (!strcmp("fbsql", module_name)) return DBX_FBSQL;
- if (!strcmp("oci8", module_name)) return DBX_OCI8;
- if (!strcmp("sybase_ct", module_name)) return DBX_SYBASECT;
- if (!strcmp("sqlite", module_name)) return DBX_SQLITE;
- return DBX_UNKNOWN;
-}
-
-int split_dbx_handle_object(zval **dbx_object, zval ***pdbx_handle, zval ***pdbx_module, zval ***pdbx_database TSRMLS_DC)
-{
- convert_to_object_ex(dbx_object);
- if (zend_hash_find(Z_OBJPROP_PP(dbx_object), "handle", 7, (void **) pdbx_handle)==FAILURE
- || zend_hash_find(Z_OBJPROP_PP(dbx_object), "module", 7, (void **) pdbx_module)==FAILURE
- || zend_hash_find(Z_OBJPROP_PP(dbx_object), "database", 9, (void **) pdbx_database)==FAILURE) {
- return 0;
- }
- return 1;
-}
-
-int split_dbx_result_object(zval **dbx_result, zval ***pdbx_link, zval ***pdbx_handle, zval ***pdbx_flags, zval ***pdbx_info, zval ***pdbx_cols , zval ***pdbx_rows TSRMLS_DC)
-{
- convert_to_object_ex(dbx_result);
- if (zend_hash_find(Z_OBJPROP_PP(dbx_result), "link", 5, (void **) pdbx_link)==FAILURE
- || zend_hash_find(Z_OBJPROP_PP(dbx_result), "handle", 7, (void **) pdbx_handle)==FAILURE
- || zend_hash_find(Z_OBJPROP_PP(dbx_result), "flags", 6, (void **) pdbx_flags)==FAILURE
- || zend_hash_find(Z_OBJPROP_PP(dbx_result), "info", 5, (void **) pdbx_info)==FAILURE
- || zend_hash_find(Z_OBJPROP_PP(dbx_result), "cols", 5, (void **) pdbx_cols)==FAILURE
- || zend_hash_find(Z_OBJPROP_PP(dbx_result), "rows", 5, (void **) pdbx_rows)==FAILURE) {
- return 0;
- }
- return 1;
-}
-
-/* from dbx.h, to be used in support-files (dbx_mysql.c etc...) */
-void dbx_call_any_function(INTERNAL_FUNCTION_PARAMETERS, char *function_name, zval **returnvalue, int number_of_arguments, zval ***params)
-{
- zval *zval_function_name;
-
- MAKE_STD_ZVAL(zval_function_name);
- ZVAL_STRING(zval_function_name, function_name, 1);
- if (call_user_function_ex(EG(function_table), NULL, zval_function_name, returnvalue, number_of_arguments, params, 0, NULL TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "function '%s' not found", Z_STRVAL_P(zval_function_name));
- }
- zval_dtor(zval_function_name); /* to free stringvalue memory */
- FREE_ZVAL(zval_function_name);
-}
-
-/* switch_dbx functions declarations
- * each must be supported in the dbx_module files as dbx_module_function,
- * e.g. switch_dbx_connect expects a dbx_mysql_connect in de dbx_mysql files
- * all params except the dbx_module param are passed on
- * each must return the expected zval *'s in the rv parameter, which are passed on unmodified
- * do NOT use the return_value parameter from INTERNAL_FUNCTION_PARAMETERS
- * you can additionally return 0 or 1 for failure or success which will also be returned by the switches
- */
-int switch_dbx_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns connection handle as resource on success or 0 as long on failure */
-int switch_dbx_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns persistent connection handle as resource on success or 0 as long on failure */
-int switch_dbx_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns 1 as long on success or 0 as long on failure */
-int switch_dbx_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns 1 as long or result identifier as resource on success or 0 as long on failure */
-int switch_dbx_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns column-count as long on success or 0 as long on failure */
-int switch_dbx_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns column-name as string on success or 0 as long on failure */
-int switch_dbx_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns column-type as string on success or 0 as long on failure */
-int switch_dbx_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
-int switch_dbx_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns string */
-int switch_dbx_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module);
- /* returns escaped string */
-
-/* Every user visible function must have an entry in dbx_functions[].
-*/
-function_entry dbx_functions[] = {
- ZEND_FE(dbx_connect, NULL)
- ZEND_FE(dbx_close, NULL)
- ZEND_FE(dbx_query, NULL)
- ZEND_FE(dbx_fetch_row, NULL)
- ZEND_FE(dbx_error, NULL)
- ZEND_FE(dbx_escape_string, NULL)
-
- ZEND_FE(dbx_sort, NULL)
- ZEND_FE(dbx_compare, NULL)
-
- {NULL, NULL, NULL} /* Must be the last line in dbx_functions[] */
-};
-
-zend_module_entry dbx_module_entry = {
- STANDARD_MODULE_HEADER,
- "dbx",
- dbx_functions,
- ZEND_MINIT(dbx),
- ZEND_MSHUTDOWN(dbx),
- NULL, /*ZEND_RINIT(dbx), Replace with NULL if there's nothing to do at request start */
- NULL, /*ZEND_RSHUTDOWN(dbx), Replace with NULL if there's nothing to do at request end */
- ZEND_MINFO(dbx),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_DBX
-ZEND_GET_MODULE(dbx)
-#endif
-
-ZEND_INI_BEGIN()
- ZEND_INI_ENTRY("dbx.colnames_case", "unchanged", ZEND_INI_SYSTEM, NULL)
-ZEND_INI_END()
-
-ZEND_MINIT_FUNCTION(dbx)
-{
- REGISTER_INI_ENTRIES();
-
- REGISTER_LONG_CONSTANT("DBX_MYSQL", DBX_MYSQL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_ODBC", DBX_ODBC, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_PGSQL", DBX_PGSQL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_MSSQL", DBX_MSSQL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_FBSQL", DBX_FBSQL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_OCI8", DBX_OCI8, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_SYBASECT", DBX_SYBASECT, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_SQLITE", DBX_SQLITE, CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("DBX_PERSISTENT", DBX_PERSISTENT, CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("DBX_RESULT_INFO", DBX_RESULT_INFO, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_RESULT_INDEX", DBX_RESULT_INDEX, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_RESULT_ASSOC", DBX_RESULT_ASSOC, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_RESULT_UNBUFFERED", DBX_RESULT_UNBUFFERED, CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("DBX_COLNAMES_UNCHANGED", DBX_COLNAMES_UNCHANGED, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_COLNAMES_UPPERCASE", DBX_COLNAMES_UPPERCASE, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_COLNAMES_LOWERCASE", DBX_COLNAMES_LOWERCASE, CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("DBX_CMP_NATIVE", DBX_CMP_NATIVE, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_CMP_TEXT", DBX_CMP_TEXT, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_CMP_NUMBER", DBX_CMP_NUMBER, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_CMP_ASC", DBX_CMP_ASC, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_CMP_DESC", DBX_CMP_DESC, CONST_CS | CONST_PERSISTENT);
-
- return SUCCESS;
-}
-
-ZEND_MSHUTDOWN_FUNCTION(dbx)
-{
- UNREGISTER_INI_ENTRIES();
- return SUCCESS;
-}
-
-/* Remove if there's nothing to do at request start */
-/*ZEND_RINIT_FUNCTION(dbx)
-{ return SUCCESS;
-}*/
-
-/* Remove if there's nothing to do at request end */
-/*ZEND_RSHUTDOWN_FUNCTION(dbx)
-{ return SUCCESS;
-}*/
-
-ZEND_MINFO_FUNCTION(dbx)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "dbx support", "enabled");
- php_info_print_table_row(2, "dbx version", "1.1.0");
- php_info_print_table_row(2, "supported databases", "MySQL\nODBC\nPostgreSQL\nMicrosoft SQL Server\nFrontBase\nOracle 8 (oci8)\nSybase-CT\nSQLite");
- php_info_print_table_end();
- DISPLAY_INI_ENTRIES();
-}
-
-/*
-
- actual implementation of the dbx functions
-
-*/
-
-/* {{{ proto dbx_link_object dbx_connect(string module_name, string host, string db, string username, string password [, bool persistent])
- Returns a dbx_link_object on success and returns 0 on failure */
-ZEND_FUNCTION(dbx_connect)
-{
- int number_of_arguments=5;
- zval **arguments[6];
-
- int result;
- long module_identifier;
- zval *dbx_module;
- zval *db_name;
- zval *rv_dbx_handle;
- int persistent=0;
-
- if ( !(ZEND_NUM_ARGS()==number_of_arguments+1 || ZEND_NUM_ARGS()==number_of_arguments) || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- if (ZEND_NUM_ARGS()==number_of_arguments+1) {
- convert_to_long_ex(arguments[5]);
- if (Z_LVAL_PP(arguments[5])!=0) persistent=1;
- }
-
- if (Z_TYPE_PP(arguments[0]) == IS_LONG) {
- if (!module_identifier_exists(Z_LVAL_PP(arguments[0]))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbx: module '%ld' not loaded or not supported.", Z_LVAL_PP(arguments[0]));
- return;
- }
- module_identifier = Z_LVAL_PP(arguments[0]);
- } else {
- convert_to_string_ex(arguments[0]);
- if (!module_exists(Z_STRVAL_PP(arguments[0]))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbx: module '%s' not loaded.", Z_STRVAL_PP(arguments[0]));
- return;
- }
- module_identifier=get_module_identifier(Z_STRVAL_PP(arguments[0]));
- if (!module_identifier) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbx: unsupported module '%s'.", Z_STRVAL_PP(arguments[0]));
- return;
- }
- }
-
- MAKE_STD_ZVAL(dbx_module);
- ZVAL_LONG(dbx_module, module_identifier);
- MAKE_STD_ZVAL(rv_dbx_handle);
- ZVAL_LONG(rv_dbx_handle, 0);
- convert_to_string_ex(arguments[1]);
- convert_to_string_ex(arguments[2]);
- convert_to_string_ex(arguments[3]);
- convert_to_string_ex(arguments[4]);
- MAKE_STD_ZVAL(db_name);
- ZVAL_STRING(db_name, Z_STRVAL_PP(arguments[2]), 1);
- if (persistent) {
- result = switch_dbx_pconnect(&rv_dbx_handle, arguments[1], arguments[2], arguments[3], arguments[4], INTERNAL_FUNCTION_PARAM_PASSTHRU, &dbx_module);
- } else {
- result = switch_dbx_connect(&rv_dbx_handle, arguments[1], arguments[2], arguments[3], arguments[4], INTERNAL_FUNCTION_PARAM_PASSTHRU, &dbx_module);
- }
- if (!result) {
- FREE_ZVAL(dbx_module);
- zval_dtor(db_name); /* to free stringvalue memory */
- FREE_ZVAL(db_name);
- FREE_ZVAL(rv_dbx_handle);
- RETURN_LONG(0);
- }
-
- object_init(return_value);
-
- zend_hash_update(Z_OBJPROP_P(return_value), "handle", 7, (void *)&(rv_dbx_handle), sizeof(zval *), NULL);
- zend_hash_update(Z_OBJPROP_P(return_value), "module", 7, (void *)&(dbx_module), sizeof(zval *), NULL);
- zend_hash_update(Z_OBJPROP_P(return_value), "database", 9, (void *)&(db_name), sizeof(zval *), NULL);
-}
-/* }}} */
-
-/* {{{ proto int dbx_close(dbx_link_object dbx_link)
- Returns success or failure
-*/
-ZEND_FUNCTION(dbx_close)
-{
- int number_of_arguments=1;
- zval **arguments[1];
-
- int result;
- zval **dbx_handle;
- zval **dbx_module;
- zval **dbx_database;
- zval *rv_success;
-
- if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
- RETURN_LONG(0);
- }
-
- MAKE_STD_ZVAL(rv_success);
- ZVAL_LONG(rv_success, 0);
-
- result = switch_dbx_close(&rv_success, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
-
- result = (result && Z_LVAL_P(rv_success))?1:0;
- FREE_ZVAL(rv_success);
-
- RETURN_LONG(result?1:0);
-}
-/* }}} */
-
-/* {{{ proto dbx_result_object dbx_query(dbx_link_object dbx_link, string sql_statement [, int flags])
- Returns a dbx_link_object on success and returns 0 on failure */
-ZEND_FUNCTION(dbx_query)
-{
- int min_number_of_arguments=2;
- int number_of_arguments=3;
- zval **arguments[3];
-
- int result;
- zval **dbx_handle;
- zval **dbx_module;
- zval **dbx_database;
- zval *rv_result_handle;
- zval *rv_column_count;
- long col_index;
- long row_count;
- zval *info;
- long query_flags;
- long result_flags;
- zval *data;
- zval **row_ptr;
- zval **inforow_ptr;
- /* default values for colname-case */
- char * colnames_case = INI_STR("dbx.colnames_case");
- long colcase = DBX_COLNAMES_UNCHANGED;
- if (!strcmp(colnames_case, "uppercase")) {
- colcase = DBX_COLNAMES_UPPERCASE;
- }
- if (!strcmp(colnames_case, "lowercase")) {
- colcase = DBX_COLNAMES_LOWERCASE;
- }
-
- if (ZEND_NUM_ARGS()<min_number_of_arguments || ZEND_NUM_ARGS()>number_of_arguments || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
- RETURN_LONG(0);
- }
- /* default values */
- result_flags = DBX_RESULT_INFO | DBX_RESULT_INDEX | DBX_RESULT_ASSOC;
- /* parameter overrides */
- if (ZEND_NUM_ARGS()>2) {
- convert_to_long_ex(arguments[2]);
- query_flags = Z_LVAL_PP(arguments[2]);
- /* fieldnames are needed for association! */
- result_flags = (query_flags & DBX_RESULT_INFO) | (query_flags & DBX_RESULT_INDEX) | (query_flags & DBX_RESULT_ASSOC) | (query_flags & DBX_RESULT_UNBUFFERED);
- if (result_flags & DBX_RESULT_ASSOC) {
- result_flags |= DBX_RESULT_INFO;
- }
- if (!result_flags) result_flags = DBX_RESULT_INFO | DBX_RESULT_INDEX | DBX_RESULT_ASSOC;
- if (result_flags == DBX_RESULT_UNBUFFERED) result_flags |= DBX_RESULT_INFO | DBX_RESULT_INDEX | DBX_RESULT_ASSOC;
- /* override ini-setting for colcase */
- if (query_flags & DBX_COLNAMES_UNCHANGED) {
- colcase = DBX_COLNAMES_UNCHANGED;
- }
- if (query_flags & DBX_COLNAMES_UPPERCASE) {
- colcase = DBX_COLNAMES_UPPERCASE;
- }
- if (query_flags & DBX_COLNAMES_LOWERCASE) {
- colcase = DBX_COLNAMES_LOWERCASE;
- }
- }
- MAKE_STD_ZVAL(rv_result_handle);
- ZVAL_LONG(rv_result_handle, 0);
- convert_to_string_ex(arguments[1]);
- result = switch_dbx_query(&rv_result_handle, dbx_handle, dbx_database, arguments[1], INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
- /* boolean return value means either failure for any query or success for queries that don't return anything */
- if (!result || (rv_result_handle && Z_TYPE_P(rv_result_handle)==IS_BOOL)) {
- result = (result && Z_LVAL_P(rv_result_handle))?1:0;
- FREE_ZVAL(rv_result_handle);
- RETURN_LONG(result?1:0);
- }
- /* if you get here, the query succeeded and returned results, so we'll return them
- * rv_result_handle holds a resource
- */
- /* init return_value as object (of rows) */
- object_init(return_value);
-
- zend_hash_update(Z_OBJPROP_P(return_value), "link", 5, (void *)(arguments[0]), sizeof(zval *), NULL);
- /* need extra refcount here otherwise the link object is destroyed when the
- * query resultobject is destroyed (or not assigned!)
- */
- zval_add_ref(arguments[0]);
- /* add result_handle property to return_value */
- zend_hash_update(Z_OBJPROP_P(return_value), "handle", 7, (void *)&(rv_result_handle), sizeof(zval *), NULL);
- /* add flags property to return_value */
- add_property_long(return_value, "flags", result_flags | colcase);
- /* init info property as array and add to return_value as a property */
- if (result_flags & DBX_RESULT_INFO) {
- MAKE_STD_ZVAL(info);
- array_init(info);
- zend_hash_update(Z_OBJPROP_P(return_value), "info", 5, (void *)&(info), sizeof(zval *), NULL);
- }
- /* init data property as array and add to return_value as a property */
- if (!(result_flags & DBX_RESULT_UNBUFFERED)) {
- MAKE_STD_ZVAL(data);
- array_init(data);
- zend_hash_update(Z_OBJPROP_P(return_value), "data", 5, (void *)&(data), sizeof(zval *), NULL);
- }
- /* get columncount and add to returnvalue as property */
- MAKE_STD_ZVAL(rv_column_count);
- ZVAL_LONG(rv_column_count, 0);
- result = switch_dbx_getcolumncount(&rv_column_count, &rv_result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
- if (!result) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "get column_count failed...");
- FREE_ZVAL(rv_column_count);
- RETURN_LONG(0);
- }
- zend_hash_update(Z_OBJPROP_P(return_value), "cols", 5, (void *)&(rv_column_count), sizeof(zval *), NULL);
- /* fill the info array with columnnames and types (indexed and assoc) */
- if (result_flags & DBX_RESULT_INFO) {
- zval *info_row_name;
- zval *info_row_type;
- MAKE_STD_ZVAL(info_row_name);
- MAKE_STD_ZVAL(info_row_type);
- array_init(info_row_name);
- array_init(info_row_type);
- for (col_index=0; col_index<Z_LVAL_P(rv_column_count); ++col_index) {
- zval *rv_column_name;
- zval *rv_column_type;
- /* get name */
- MAKE_STD_ZVAL(rv_column_name);
- ZVAL_LONG(rv_column_name, 0);
- result = switch_dbx_getcolumnname(&rv_column_name, &rv_result_handle, col_index, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
- /* modify case if requested */
- if (colcase==DBX_COLNAMES_UPPERCASE) {
- php_strtoupper(Z_STRVAL_P(rv_column_name), Z_STRLEN_P(rv_column_name));
- }
- if (colcase==DBX_COLNAMES_LOWERCASE) {
- php_strtolower(Z_STRVAL_P(rv_column_name), Z_STRLEN_P(rv_column_name));
- }
- if (result) {
- zend_hash_index_update(Z_ARRVAL_P(info_row_name), col_index, (void *)&(rv_column_name), sizeof(zval *), NULL);
- } else {
- FREE_ZVAL(rv_column_name);
- }
- /* get type */
- MAKE_STD_ZVAL(rv_column_type);
- ZVAL_LONG(rv_column_type, 0);
- result = switch_dbx_getcolumntype(&rv_column_type, &rv_result_handle, col_index, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
- if (result) {
- zend_hash_index_update(Z_ARRVAL_P(info_row_type), col_index, (void *)&(rv_column_type), sizeof(zval *), NULL);
- } else {
- FREE_ZVAL(rv_column_type);
- }
- }
- zend_hash_update(Z_ARRVAL_P(info), "name", 5, (void *) &info_row_name, sizeof(zval *), (void **) &inforow_ptr);
- zend_hash_update(Z_ARRVAL_P(info), "type", 5, (void *) &info_row_type, sizeof(zval *), NULL);
- }
- /* fill each row array with fieldvalues (indexed (and assoc)) */
- if (!(result_flags & DBX_RESULT_UNBUFFERED)) {
- row_count=0;
- result=1;
- while (result) {
- zval *rv_row;
- MAKE_STD_ZVAL(rv_row);
- ZVAL_LONG(rv_row, 0);
- result = switch_dbx_getrow(&rv_row, &rv_result_handle, row_count, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
- if (result) {
- zend_hash_index_update(Z_ARRVAL_P(data), row_count, (void *)&(rv_row), sizeof(zval *), (void **) &row_ptr);
- /* associate results with fieldnames */
- if (result_flags & DBX_RESULT_ASSOC) {
- zval **columnname_ptr, **actual_ptr;
- for (col_index=0; col_index<Z_LVAL_P(rv_column_count); ++col_index) {
- zend_hash_index_find(Z_ARRVAL_PP(inforow_ptr), col_index, (void **) &columnname_ptr);
- zend_hash_index_find(Z_ARRVAL_PP(row_ptr), col_index, (void **) &actual_ptr);
- (*actual_ptr)->refcount+=1;
- (*actual_ptr)->is_ref=1;
- zend_hash_update(Z_ARRVAL_PP(row_ptr), Z_STRVAL_PP(columnname_ptr), Z_STRLEN_PP(columnname_ptr) + 1, actual_ptr, sizeof(zval *), NULL);
- }
- }
- ++row_count;
- } else {
- FREE_ZVAL(rv_row);
- }
- }
- /* add row_count property */
- add_property_long(return_value, "rows", row_count);
- }
- else {
- add_property_long(return_value, "rows", 0);
- }
-}
-/* }}} */
-
-/* {{{ proto dbx_row dbx_fetch_row(dbx_query_object dbx_q)
- Returns a row (index and assoc based on query) on success and returns 0 on failure or no more rows */
-ZEND_FUNCTION(dbx_fetch_row)
-{
- int number_of_arguments=1;
- zval **arguments[1];
-
- zval **dbx_result_link;
- zval **dbx_result_handle;
- zval **dbx_result_flags;
- zval **dbx_result_info;
- zval **dbx_result_cols;
- zval **dbx_result_rows;
-
- zval **dbx_handle;
- zval **dbx_module;
- zval **dbx_database;
-
- int result;
- long col_index;
- long col_count;
- long row_count;
- long result_flags;
- zval **inforow_ptr;
-
- if (ZEND_NUM_ARGS()!=number_of_arguments || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- if (!split_dbx_result_object(arguments[0], &dbx_result_link, &dbx_result_handle, &dbx_result_flags, &dbx_result_info, &dbx_result_cols, &dbx_result_rows TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_result-object...");
- RETURN_LONG(0);
- }
- if (!split_dbx_handle_object(dbx_result_link, &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
- RETURN_LONG(0);
- }
-
- /* default values */
- result_flags = Z_LVAL_PP(dbx_result_flags);
- col_count = Z_LVAL_PP(dbx_result_cols);
- row_count = Z_LVAL_PP(dbx_result_rows);
-
- /* find fieldnames (for assoc) */
- if (result_flags & DBX_RESULT_ASSOC) {
- zend_hash_find(Z_ARRVAL_PP(dbx_result_info), "name", 5, (void **) &inforow_ptr);
- }
-
- result = switch_dbx_getrow(&return_value, dbx_result_handle, row_count, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
- if (result) {
- /* associate results with fieldnames */
- if (result_flags & DBX_RESULT_ASSOC) {
- zval **columnname_ptr, **actual_ptr;
- for (col_index=0; col_index<col_count; ++col_index) {
- zend_hash_index_find(Z_ARRVAL_PP(inforow_ptr), col_index, (void **) &columnname_ptr);
- zend_hash_index_find(Z_ARRVAL_P(return_value), col_index, (void **) &actual_ptr);
- (*actual_ptr)->refcount+=1;
- (*actual_ptr)->is_ref=1;
- zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(columnname_ptr), Z_STRLEN_PP(columnname_ptr) + 1, actual_ptr, sizeof(zval *), NULL);
- }
- }
- ++row_count;
- add_property_long(*arguments[0], "rows", row_count);
- }
-}
-/* }}} */
-
-
-/* {{{ proto string dbx_error(dbx_link_object dbx_link)
- Returns success or failure
-*/
-ZEND_FUNCTION(dbx_error)
-{
- int number_of_arguments=1;
- zval **arguments[1];
-
- int result;
- zval **dbx_handle;
- zval **dbx_module;
- zval **dbx_database;
- zval *rv_errormsg;
-
- if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
- RETURN_LONG(0);
- }
-
- MAKE_STD_ZVAL(rv_errormsg);
- ZVAL_LONG(rv_errormsg, 0);
- result = switch_dbx_error(&rv_errormsg, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
- if (!result) {
- FREE_ZVAL(rv_errormsg);
- RETURN_STRING("", 1);
- }
- MOVE_RETURNED_TO_RV(&return_value, rv_errormsg);
-}
-/* }}} */
-
-/* {{{ proto string dbx_escape_string(dbx_link_object dbx_link, string sz)
- Returns escaped string or NULL on error
-*/
-ZEND_FUNCTION(dbx_escape_string)
-{
- int number_of_arguments=2;
- zval **arguments[2];
-
- int result;
- zval **dbx_handle;
- zval **dbx_module;
- zval **dbx_database;
- zval *rv;
-
- if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
- RETURN_NULL();
- }
- convert_to_string_ex(arguments[1]);
-
- MAKE_STD_ZVAL(rv);
- ZVAL_LONG(rv, 0);
- result = switch_dbx_esc(&rv, dbx_handle, arguments[1], INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
- if (!result) { /* this will probably never happen */
- FREE_ZVAL(rv);
- RETURN_NULL();
- }
- MOVE_RETURNED_TO_RV(&return_value, rv);
-}
-/* }}} */
-
-/*
- * dbx functions that are database independent... like sorting result_objects!
- */
-
-/* {{{ proto int dbx_compare(array row_x, array row_y, string columnname [, int flags])
- Returns row_y[columnname] - row_x[columnname], converted to -1, 0 or 1 */
-ZEND_FUNCTION(dbx_compare)
-{
- int min_number_of_arguments=3;
- int max_number_of_arguments=4;
- int number_of_arguments=-1;
- long comparison_direction=DBX_CMP_ASC;
- long comparison_type=DBX_CMP_NATIVE;
- double dtemp;
- long ltemp;
- zval **arguments[4];
- zval **zv_a;
- zval **zv_b;
- int result=0;
- number_of_arguments=ZEND_NUM_ARGS();
- if (number_of_arguments<min_number_of_arguments || number_of_arguments>max_number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (Z_TYPE_PP(arguments[0]) != IS_ARRAY
- || Z_TYPE_PP(arguments[1]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong argument type for compare");
- RETURN_LONG(0);
- }
- convert_to_string_ex(arguments[2]); /* field name */
- comparison_type = DBX_CMP_NATIVE;
- comparison_direction = DBX_CMP_ASC;
- if (number_of_arguments>3) {
- convert_to_long_ex(arguments[3]); /* comparison type and direction*/
- /* direction */
- if (Z_LVAL_PP(arguments[3]) & DBX_CMP_DESC) {
- comparison_direction=DBX_CMP_DESC;
- }
- if (Z_LVAL_PP(arguments[3]) & DBX_CMP_ASC) {
- comparison_direction=DBX_CMP_ASC;
- }
- /* type */
- if (Z_LVAL_PP(arguments[3]) & DBX_CMP_NUMBER) {
- comparison_type=DBX_CMP_NUMBER;
- }
- if (Z_LVAL_PP(arguments[3]) & DBX_CMP_TEXT) {
- comparison_type=DBX_CMP_TEXT;
- }
- if (Z_LVAL_PP(arguments[3]) & DBX_CMP_NATIVE) {
- comparison_type=DBX_CMP_NATIVE;
- }
- }
-
- if (zend_hash_find(Z_ARRVAL_PP(arguments[0]), Z_STRVAL_PP(arguments[2]), Z_STRLEN_PP(arguments[2])+1, (void **) &zv_a)==FAILURE
- || zend_hash_find(Z_ARRVAL_PP(arguments[1]), Z_STRVAL_PP(arguments[2]), Z_STRLEN_PP(arguments[2])+1, (void **) &zv_b)==FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field '%s' not available in result-object", Z_STRVAL_PP(arguments[2]));
- RETURN_LONG(0);
- }
-
- switch (comparison_type) {
- case DBX_CMP_TEXT:
- convert_to_string_ex(zv_a);
- convert_to_string_ex(zv_b);
- break;
- case DBX_CMP_NUMBER:
- convert_to_double_ex(zv_a);
- convert_to_double_ex(zv_b);
- break;
- }
- switch (Z_TYPE_PP(zv_a)) {
- case IS_NULL:
- result=0;
- break;
- case IS_BOOL:
- case IS_LONG:
- case IS_CONSTANT:
- ltemp = Z_LVAL_PP(zv_a) - Z_LVAL_PP(zv_b);
- result = (ltemp==0?0: (ltemp>0?1:-1));
- break;
- case IS_DOUBLE:
- dtemp = (Z_DVAL_PP(zv_a) - Z_DVAL_PP(zv_b));
- result = (dtemp==0?0: (dtemp>0?1:-1));
- break;
- case IS_STRING:
- ltemp = strcmp(Z_STRVAL_PP(zv_a), Z_STRVAL_PP(zv_b));
- result = (ltemp==0?0: (ltemp>0?1:-1));
- break;
- default: result=0;
- }
-
- if (comparison_direction==DBX_CMP_DESC) RETURN_LONG(-result);
- RETURN_LONG(result);
-}
-/* }}} */
-
-/* {{{ proto int dbx_sort(object dbx_result, string compare_function_name)
- Returns 0 on failure, 1 on success */
-ZEND_FUNCTION(dbx_sort)
-{
- int number_of_arguments=2;
- zval **arguments[2];
- zval **zval_data;
- zval *returned_zval;
- if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (Z_TYPE_PP(arguments[0]) != IS_OBJECT
- || Z_TYPE_PP(arguments[1]) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong argument type for sort");
- RETURN_LONG(0);
- }
-
- if (zend_hash_find(Z_OBJPROP_PP(arguments[0]), "data", 5, (void **) &zval_data)==FAILURE
- || Z_TYPE_PP(zval_data) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong argument type for sort");
- RETURN_LONG(0);
- }
-
- arguments[0] = zval_data;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "usort", &returned_zval, number_of_arguments, arguments);
- zval_ptr_dtor(&returned_zval);
-
- RETURN_LONG(1);
-}
-/* }}} */
-
-/***********************************/
-
-/*
- * switch_dbx functions
- */
-int switch_dbx_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_OCI8: return dbx_oci8_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SYBASECT: return dbx_sybasect_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-int switch_dbx_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns persistent connection handle as resource on success or 0 as long on failure */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_OCI8: return dbx_oci8_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SYBASECT: return dbx_sybasect_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-int switch_dbx_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns 1 as long on success or 0 as long on failure */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_OCI8: return dbx_oci8_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SYBASECT: return dbx_sybasect_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-int switch_dbx_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns 1 as long or result identifier as resource on success or 0 as long on failure */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_OCI8: return dbx_oci8_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SYBASECT: return dbx_sybasect_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-int switch_dbx_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns column-count as long on success or 0 as long on failure */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_OCI8: return dbx_oci8_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SYBASECT: return dbx_sybasect_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-int switch_dbx_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns column-name as string on success or 0 as long on failure */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_OCI8: return dbx_oci8_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SYBASECT: return dbx_sybasect_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-int switch_dbx_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns column-type as string on success or 0 as long on failure */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_OCI8: return dbx_oci8_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SYBASECT: return dbx_sybasect_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-int switch_dbx_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_OCI8: return dbx_oci8_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SYBASECT: return dbx_sybasect_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-int switch_dbx_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns string */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- /* case DBX_OCI8: return dbx_oci8_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); */
- case DBX_SYBASECT: return dbx_sybasect_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-int switch_dbx_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module)
-{
- /* returns escaped string */
- switch (Z_LVAL_PP(dbx_module)) {
- case DBX_MYSQL: return dbx_mysql_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_PGSQL: return dbx_pgsql_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_MSSQL: return dbx_mssql_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_FBSQL: return dbx_fbsql_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_OCI8: return dbx_oci8_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SYBASECT: return dbx_sybasect_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_SQLITE: return dbx_sqlite_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not supported in this module");
- return 0;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx.dsp b/ext/dbx/dbx.dsp
deleted file mode 100644
index 9cc264a25..000000000
--- a/ext/dbx/dbx.dsp
+++ /dev/null
@@ -1,181 +0,0 @@
-# Microsoft Developer Studio Project File - Name="dbx" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=dbx - 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 "dbx.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 "dbx.mak" CFG="dbx - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "dbx - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "dbx - 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)" == "dbx - 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_dbx" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "DBX_EXPORTS" /D "COMPILE_DL_DBX" /D ZTS=1 /D HAVE_LIBINTL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dbx.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dbx.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "dbx - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_dbx" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DBX_EXPORTS" /D "COMPILE_DL_DBX" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"../../Debug_TS/php_dbx.dll" /libpath:"..\..\Debug_TS"
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"../../Debug_TS/php_dbx.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "dbx - Win32 Release_TS"
-# Name "dbx - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\dbx.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_fbsql.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_mssql.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_mysql.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_oci8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_odbc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_pgsql.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_sqlite.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_sybasect.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\dbx.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_fbsql.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_mssql.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_mysql.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_oci8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_odbc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_pgsql.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_sqlite.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dbx_sybasect.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_dbx.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/dbx/dbx.h b/ext/dbx/dbx.h
deleted file mode 100644
index 8b62932dc..000000000
--- a/ext/dbx/dbx.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx.h,v 1.17 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_DBX_H
-#define ZEND_DBX_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-#include "php.h"
-#include "ext/standard/php_string.h"
-
-#define DBX_PERSISTENT (1<<0)
-
-#define DBX_RESULT_INFO (1<<0)
-#define DBX_RESULT_INDEX (1<<1)
-#define DBX_RESULT_ASSOC (1<<2)
-#define DBX_COLNAMES_UNCHANGED (1<<3)
-#define DBX_COLNAMES_UPPERCASE (1<<4)
-#define DBX_COLNAMES_LOWERCASE (1<<5)
-#define DBX_RESULT_UNBUFFERED (1<<6)
-
-#define DBX_CMP_NATIVE (1<<0)
-#define DBX_CMP_TEXT (1<<1)
-#define DBX_CMP_NUMBER (1<<2)
-#define DBX_CMP_ASC (1<<3)
-#define DBX_CMP_DESC (1<<4)
-
-#define MOVE_RETURNED_TO_RV(rv, returned_zval) { **rv = *returned_zval; zval_copy_ctor(*rv); zval_ptr_dtor(&returned_zval); }
-
-void dbx_call_any_function(INTERNAL_FUNCTION_PARAMETERS, char *function_name, zval **returnvalue, int number_of_arguments, zval ***params);
-
-#endif /* ZEND_DBX_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_fbsql.c b/ext/dbx/dbx_fbsql.c
deleted file mode 100644
index 08240f9e3..000000000
--- a/ext/dbx/dbx_fbsql.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- | Frank M. Kromann <frank@kromann.info> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_fbsql.c,v 1.14 2004/01/08 08:15:09 andi Exp $ */
-
-#include "dbx.h"
-#include "dbx_fbsql.h"
-
-#define FBSQL_ASSOC 1<<0
-#define FBSQL_NUM 1<<1
-
-int dbx_fbsql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- arguments[0]=host;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_connect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- number_of_arguments=2;
- arguments[0]=db;
- arguments[1]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_select_db", &select_db_zval, number_of_arguments, arguments);
- if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) {
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- /* also close connection */
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- zend_list_addref(Z_LVAL_P(returned_zval));
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_close", &select_db_zval, number_of_arguments, arguments);
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- zval_ptr_dtor(&select_db_zval);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_fbsql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns persistent connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- arguments[0]=host;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_pconnect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- number_of_arguments=2;
- arguments[0]=db;
- arguments[1]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_select_db", &select_db_zval, number_of_arguments, arguments);
- if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) {
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- /* also close connection */
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- zend_list_addref(Z_LVAL_P(returned_zval));
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_close", &select_db_zval, number_of_arguments, arguments);
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- zval_ptr_dtor(&select_db_zval);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_fbsql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_close", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_fbsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
-
- arguments[0]=db_name;
- arguments[1]=sql_statement;
- arguments[2]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_db_query", &returned_zval, number_of_arguments, arguments);
- /* fbsql_query returns a bool for success or failure, or a result_identifier for select statements */
- if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_fbsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-count as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_num_fields", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_fbsql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-name as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_field_name", &returned_zval, number_of_arguments, arguments);
- /* fbsql_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_fbsql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-type as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_field_type", &returned_zval, number_of_arguments, arguments);
- /* fbsql_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_fbsql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_resulttype=NULL;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_resulttype);
- ZVAL_LONG(zval_resulttype, FBSQL_NUM);
- arguments[0]=result_handle;
- arguments[1]=&zval_resulttype;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_fetch_array", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_resulttype);
- return 0;
- }
- FREE_ZVAL(zval_resulttype);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_fbsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns string */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- if (!dbx_handle) number_of_arguments=0;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_error", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_fbsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns escaped string */
- /* replace \ with \\ */
- /* ' with '' */
- char * str;
- int len;
- char * tmpstr;
- int tmplen;
-
- if (Z_STRLEN_PP(string) == 0) {
- ZVAL_EMPTY_STRING(*rv);
- return 1;
- }
- tmpstr = estrdup(Z_STRVAL_PP(string));
- tmplen = Z_STRLEN_PP(string);
- /* php_str_to_str uses a smart_str that allocates memory */
- /* this memory must be freed or passed on to rv */
- str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len);
- efree(tmpstr);
-
- ZVAL_STRINGL(*rv, str, len, 0);
-
- return 1;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_fbsql.h b/ext/dbx/dbx_fbsql.h
deleted file mode 100644
index daa3c00af..000000000
--- a/ext/dbx/dbx_fbsql.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- | Frank M. Kromann <frank@kromann.info> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_fbsql.h,v 1.11 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_DBX_FBSQL_H
-#define ZEND_DBX_FBSQL_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-#include "php.h"
-
-int dbx_fbsql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns connection handle as resource on success or 0 as long on failure */
-int dbx_fbsql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns persistent connection handle as resource on success or 0 as long on failure */
-int dbx_fbsql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long on success or 0 as long on failure */
-int dbx_fbsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
-int dbx_fbsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-count as long on success or 0 as long on failure */
-int dbx_fbsql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-name as string on success or 0 as long on failure */
-int dbx_fbsql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-type as string on success or 0 as long on failure */
-int dbx_fbsql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS);
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
-int dbx_fbsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns string */
-int dbx_fbsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS);
- /* returns escaped string */
-
-#endif /* ZEND_DBX_FBSQL_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_mssql.c b/ext/dbx/dbx_mssql.c
deleted file mode 100644
index b3bf84993..000000000
--- a/ext/dbx/dbx_mssql.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_mssql.c,v 1.16 2004/01/08 08:15:09 andi Exp $ */
-
-#include "dbx.h"
-#include "dbx_mssql.h"
-
-#define MSSQL_ASSOC 1<<0
-#define MSSQL_NUM 1<<1
-
-int dbx_mssql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- arguments[0]=host;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_connect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- number_of_arguments=2;
- arguments[0]=db;
- arguments[1]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_select_db", &select_db_zval, number_of_arguments, arguments);
- if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) {
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- /* also close connection */
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- zend_list_addref(Z_LVAL_P(returned_zval));
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_close", &select_db_zval, number_of_arguments, arguments);
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- zval_ptr_dtor(&select_db_zval);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mssql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns persistent connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- arguments[0]=host;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_pconnect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- number_of_arguments=2;
- arguments[0]=db;
- arguments[1]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_select_db", &select_db_zval, number_of_arguments, arguments);
- if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) {
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- /* also close connection */
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- zend_list_addref(Z_LVAL_P(returned_zval));
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_close", &select_db_zval, number_of_arguments, arguments);
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- zval_ptr_dtor(&select_db_zval);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mssql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_close", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mssql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- number_of_arguments=2;
- arguments[0]=db_name;
- arguments[1]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_select_db", &select_db_zval, number_of_arguments, arguments);
- zval_ptr_dtor(&select_db_zval);
-
- number_of_arguments=2;
- arguments[0]=sql_statement;
- arguments[1]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_query", &returned_zval, number_of_arguments, arguments);
- /* mssql_query returns a bool for success or failure, or a result_identifier for select statements */
- if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mssql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-count as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_num_fields", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mssql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-name as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_field_name", &returned_zval, number_of_arguments, arguments);
- /* mssql_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mssql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-type as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_field_type", &returned_zval, number_of_arguments, arguments);
- /* mssql_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mssql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_fetch_row", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mssql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns string */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- if (!dbx_handle) number_of_arguments=0;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_get_last_message", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mssql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns escaped string */
- /* replace ' with '' */
- char * str;
- int len;
- char * tmpstr;
- int tmplen;
-
- if (Z_STRLEN_PP(string) == 0) {
- ZVAL_EMPTY_STRING(*rv);
- return 1;
- }
- tmpstr = estrdup(Z_STRVAL_PP(string));
- tmplen = Z_STRLEN_PP(string);
- /* php_str_to_str uses a smart_str that allocates memory */
- /* this memory must be freed or passed on to rv */
- str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len);
- efree(tmpstr);
-
- ZVAL_STRINGL(*rv, str, len, 0);
-
- return 1;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_mssql.h b/ext/dbx/dbx_mssql.h
deleted file mode 100644
index 41115c209..000000000
--- a/ext/dbx/dbx_mssql.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_mssql.h,v 1.12 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_DBX_MSSQL_H
-#define ZEND_DBX_MSSQL_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-#include "php.h"
-
-int dbx_mssql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns connection handle as resource on success or 0 as long on failure */
-int dbx_mssql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns persistent connection handle as resource on success or 0 as long on failure */
-int dbx_mssql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long on success or 0 as long on failure */
-int dbx_mssql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
-int dbx_mssql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-count as long on success or 0 as long on failure */
-int dbx_mssql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-name as string on success or 0 as long on failure */
-int dbx_mssql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-type as string on success or 0 as long on failure */
-int dbx_mssql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS);
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
-int dbx_mssql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns string */
-int dbx_mssql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS);
- /* returns escaped string */
-
-#endif /* ZEND_DBX_MSSQL_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_mysql.c b/ext/dbx/dbx_mysql.c
deleted file mode 100644
index dce3afdd3..000000000
--- a/ext/dbx/dbx_mysql.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_mysql.c,v 1.21 2004/01/08 08:15:09 andi Exp $ */
-
-#include "dbx.h"
-#include "dbx_mysql.h"
-
-#define MYSQL_ASSOC 1<<0
-#define MYSQL_NUM 1<<1
-
-int dbx_mysql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- arguments[0]=host;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_connect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- number_of_arguments=2;
- arguments[0]=db;
- arguments[1]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_select_db", &select_db_zval, number_of_arguments, arguments);
- if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) {
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- /* also close connection */
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- zend_list_addref(Z_LVAL_P(returned_zval));
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_close", &select_db_zval, number_of_arguments, arguments);
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- zval_ptr_dtor(&select_db_zval);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mysql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns persistent connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- arguments[0]=host;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_pconnect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- number_of_arguments=2;
- arguments[0]=db;
- arguments[1]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_select_db", &select_db_zval, number_of_arguments, arguments);
- if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) {
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- /* also close connection */
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- zend_list_addref(Z_LVAL_P(returned_zval));
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_close", &select_db_zval, number_of_arguments, arguments);
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- zval_ptr_dtor(&select_db_zval);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mysql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_close", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mysql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- number_of_arguments=2;
- arguments[0]=db_name;
- arguments[1]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_select_db", &select_db_zval, number_of_arguments, arguments);
- zval_ptr_dtor(&select_db_zval);
-
- number_of_arguments=2;
- arguments[0]=sql_statement;
- arguments[1]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_query", &returned_zval, number_of_arguments, arguments);
- /* mysql_query returns a bool for success or failure, or a result_identifier for select statements */
- if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mysql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-count as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_num_fields", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mysql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-name as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_field_name", &returned_zval, number_of_arguments, arguments);
- /* mysql_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mysql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-type as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_field_type", &returned_zval, number_of_arguments, arguments);
- /* mysql_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mysql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_resulttype=NULL;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_resulttype);
- ZVAL_LONG(zval_resulttype, MYSQL_NUM);
- arguments[0]=result_handle;
- arguments[1]=&zval_resulttype;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_fetch_array", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_resulttype);
- return 0;
- }
- FREE_ZVAL(zval_resulttype);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mysql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns string */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- if (!dbx_handle) number_of_arguments=0;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_error", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_mysql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns escaped string */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *returned_zval=NULL;
- char * str;
- int len;
- char * tmpstr;
- int tmplen;
-
- if (Z_STRLEN_PP(string) == 0) {
- ZVAL_EMPTY_STRING(*rv);
- return 1;
- }
- arguments[0]=string;
- arguments[1]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_real_escape_string", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- /* mysql_real_escape_string failed, just do my own escaping then */
- /* replace \ with \\ */
- /* ' with '' */
-
- tmpstr = estrdup(Z_STRVAL_PP(string));
- tmplen = Z_STRLEN_PP(string);
- /* php_str_to_str uses a smart_str that allocates memory */
- /* this memory must be freed or passed on to rv */
- str = php_str_to_str(tmpstr, tmplen, "\\", 1, "\\\\", 2, &len);
- efree(tmpstr);
- tmpstr=str; tmplen=len;
- str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len);
- efree(tmpstr);
-
- ZVAL_STRINGL(*rv, str, len, 0);
- return 1;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_mysql.h b/ext/dbx/dbx_mysql.h
deleted file mode 100644
index d6cf5c8af..000000000
--- a/ext/dbx/dbx_mysql.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_mysql.h,v 1.16 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_DBX_MYSQL_H
-#define ZEND_DBX_MYSQL_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-#include "php.h"
-
-int dbx_mysql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns connection handle as resource on success or 0 as long on failure */
-int dbx_mysql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns persistent connection handle as resource on success or 0 as long on failure */
-int dbx_mysql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long on success or 0 as long on failure */
-int dbx_mysql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
-int dbx_mysql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-count as long on success or 0 as long on failure */
-int dbx_mysql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-name as string on success or 0 as long on failure */
-int dbx_mysql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-type as string on success or 0 as long on failure */
-int dbx_mysql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS);
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
-int dbx_mysql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns string */
-int dbx_mysql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS);
- /* returns escaped string */
-
-#endif /* ZEND_DBX_MYSQL_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_oci8.c b/ext/dbx/dbx_oci8.c
deleted file mode 100644
index a260e16df..000000000
--- a/ext/dbx/dbx_oci8.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_oci8.c,v 1.18 2004/05/06 12:22:14 mboeren Exp $ */
-
-#include "dbx.h"
-#include "dbx_oci8.h"
-
-#define OCI_ASSOC 1<<0
-#define OCI_NUM 1<<1
-#define OCI_RETURN_NULLS 1<<2
-#define OCI_RETURN_LOBS 1<<3
-
-int dbx_oci8_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
-
- arguments[0]=username;
- arguments[1]=password;
- arguments[2]=db;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_connect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_oci8_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
-
- arguments[0]=username;
- arguments[1]=password;
- arguments[2]=db;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_pconnect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_oci8_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long on success or 0 as long on failure */
- /* actually, oci_close officially does nothing, so what should I return? */
- /* I will just return NULL right now and change the test accordingly */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_close", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_oci8_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *returned_zval=NULL;
- zval *execute_zval=NULL;
- zval *statementtype_zval=NULL;
-
- arguments[0]=dbx_handle;
- arguments[1]=sql_statement;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_parse", &returned_zval, number_of_arguments, arguments);
- /* oci_parse returns a bool for failure, or a statement_identifier for valid sql_statements */
- if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_execute", &execute_zval, number_of_arguments, arguments);
- /* oci_execute returns a bool for success or failure */
- if (!execute_zval || Z_TYPE_P(execute_zval)!=IS_BOOL || Z_BVAL_P(execute_zval)==0) {
- if (execute_zval) zval_ptr_dtor(&execute_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_statement_type", &statementtype_zval, number_of_arguments, arguments);
- /* oci_statement_type returns a string. 'SELECT' means there are results */
- if (!statementtype_zval || Z_TYPE_P(statementtype_zval)!=IS_STRING) {
- if (statementtype_zval) zval_ptr_dtor(&statementtype_zval);
- if (execute_zval) zval_ptr_dtor(&execute_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- if (!zend_binary_strcmp(Z_STRVAL_P(statementtype_zval), Z_STRLEN_P(statementtype_zval), "SELECT", sizeof("SELECT")-sizeof(""))) {
- /* it is a select, so results are returned */
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- } else {
- /* it is not a select, so just return success */
- zval_ptr_dtor(&returned_zval);
- MAKE_STD_ZVAL(returned_zval);
- ZVAL_BOOL(returned_zval, 1);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- }
- if (statementtype_zval) zval_ptr_dtor(&statementtype_zval);
- if (execute_zval) zval_ptr_dtor(&execute_zval);
-
- return 1;
-}
-
-int dbx_oci8_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-count as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_num_fields", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_oci8_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-name as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- /* dbx uses 0-based column-indices, oci8 uses 1-based indices... */
- ZVAL_LONG(zval_column_index, column_index+1);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_field_name", &returned_zval, number_of_arguments, arguments);
- /* oci_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_oci8_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-type as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- /* dbx uses 0-based column-indices, oci8 uses 1-based indices... */
- ZVAL_LONG(zval_column_index, column_index+1);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_field_type", &returned_zval, number_of_arguments, arguments);
- /* oci_field_type returns a string??? */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_oci8_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_resulttype=NULL;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_resulttype);
- ZVAL_LONG(zval_resulttype, OCI_NUM | OCI_RETURN_NULLS | OCI_RETURN_LOBS); /* no ASSOC, dbx handles that part */
- arguments[0]=result_handle;
- arguments[1]=&zval_resulttype;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_fetch_array", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_resulttype);
- return 0;
- }
- FREE_ZVAL(zval_resulttype);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_oci8_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns string */
- /* OCIError needs a statement handle most of the times, and I can only provide */
- /* a db-handle which is only needed some of the time. For now, I have disabled */
- /* the dbx_error for the oci8 extension */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
- zval *returned_message_zval=NULL;
- arguments[0]=dbx_handle;
- if (!dbx_handle) number_of_arguments=0;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_error", &returned_zval, number_of_arguments, arguments);
- /* oci_error should returns an assoc array containing code & message, dbx needs the message */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- /* get the messagestring here */
- if (zend_hash_find(Z_ARRVAL_P(returned_zval), "message", strlen("message")+1, (void **) &returned_message_zval)==FAILURE) {
- /* oops! no msg? */
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_message_zval);
- zval_ptr_dtor(&returned_zval);
- return 1;
-}
-
-int dbx_oci8_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns escaped string */
- /* replace ' with '' */
- char * str;
- int len;
- char * tmpstr;
- int tmplen;
-
- if (Z_STRLEN_PP(string) == 0) {
- ZVAL_EMPTY_STRING(*rv);
- return 1;
- }
- tmpstr = estrdup(Z_STRVAL_PP(string));
- tmplen = Z_STRLEN_PP(string);
- /* php_str_to_str uses a smart_str that allocates memory */
- /* this memory must be freed or passed on to rv */
- str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len);
- efree(tmpstr);
-
- ZVAL_STRINGL(*rv, str, len, 0);
-
- return 1;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_oci8.h b/ext/dbx/dbx_oci8.h
deleted file mode 100644
index 182d05a56..000000000
--- a/ext/dbx/dbx_oci8.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_oci8.h,v 1.9 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_DBX_OCI8_H
-#define ZEND_DBX_OCI8_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-#include "php.h"
-
-int dbx_oci8_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns connection handle as resource on success or 0 as long on failure */
-int dbx_oci8_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns persistent connection handle as resource on success or 0 as long on failure */
-int dbx_oci8_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long on success or 0 as long on failure */
-int dbx_oci8_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
-int dbx_oci8_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-count as long on success or 0 as long on failure */
-int dbx_oci8_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-name as string on success or 0 as long on failure */
-int dbx_oci8_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-type as string on success or 0 as long on failure */
-int dbx_oci8_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS);
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
-int dbx_oci8_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns string */
-int dbx_oci8_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS);
- /* returns escaped string */
-
-#endif /* ZEND_DBX_OCI8_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_odbc.c b/ext/dbx/dbx_odbc.c
deleted file mode 100644
index 1e63d07b9..000000000
--- a/ext/dbx/dbx_odbc.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_odbc.c,v 1.24 2004/01/08 08:15:09 andi Exp $ */
-
-#include "dbx.h"
-#include "dbx_odbc.h"
-
-#define ODBC_ASSOC 1
-#define ODBC_NUM 2
-
-int dbx_odbc_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
-
- arguments[0]=db;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_connect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_odbc_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
-
- arguments[0]=db;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_pconnect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_odbc_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- int actual_resource_type;
- void *resource;
- resource = zend_list_find(Z_LVAL_PP(dbx_handle), &actual_resource_type);
- if (!resource) {
- return 0;
- }
-
- arguments[0]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_close", &returned_zval, number_of_arguments, arguments);
-
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_NULL) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- convert_to_long_ex(&returned_zval);
- Z_LVAL_P(returned_zval)=1;
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_odbc_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *queryresult_zval=NULL;
- zval *num_fields_zval=NULL;
-
- /* db_name is not used in this function */
- arguments[0]=dbx_handle;
- arguments[1]=sql_statement;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_exec", &queryresult_zval, number_of_arguments, arguments);
- /* odbc_query returns a bool for failure, or a result_identifier for success */
- if (!queryresult_zval || Z_TYPE_P(queryresult_zval)!=IS_RESOURCE) {
- if (queryresult_zval) zval_ptr_dtor(&queryresult_zval);
- return 0;
- }
- MAKE_STD_ZVAL(num_fields_zval);
- ZVAL_LONG(num_fields_zval, 0);
- if (!dbx_odbc_getcolumncount(&num_fields_zval, &queryresult_zval, INTERNAL_FUNCTION_PARAM_PASSTHRU)) {
- FREE_ZVAL(num_fields_zval);
- if (queryresult_zval) zval_ptr_dtor(&queryresult_zval);
- return 0;
- }
- if (Z_LVAL_P(num_fields_zval)==0) {
- Z_TYPE_PP(rv)=IS_BOOL;
- Z_LVAL_PP(rv)=1; /* success, but no data */
- FREE_ZVAL(num_fields_zval);
- if (queryresult_zval) zval_ptr_dtor(&queryresult_zval);
- return 1;
- }
- FREE_ZVAL(num_fields_zval);
- MOVE_RETURNED_TO_RV(rv, queryresult_zval);
- return 1;
-}
-
-int dbx_odbc_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-count as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_num_fields", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG || Z_LVAL_P(returned_zval)<0) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_odbc_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-name as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index+1);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_field_name", &returned_zval, number_of_arguments, arguments);
- /* odbc_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_odbc_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-type as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index+1);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_field_type", &returned_zval, number_of_arguments, arguments);
- /* odbc_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_odbc_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
- int number_of_arguments;
- zval **arguments[2];
- zval *num_fields_zval=NULL;
- zval *fetch_row_result_zval=NULL;
- zval *field_result_zval=NULL;
- zval *field_index_zval;
- zval *returned_zval=NULL;
- long field_index;
- long field_count=-1;
-
- /* get # fields */
- MAKE_STD_ZVAL(num_fields_zval);
- ZVAL_LONG(num_fields_zval, 0);
- if (!dbx_odbc_getcolumncount(&num_fields_zval, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU)) {
- return 0;
- }
- field_count=Z_LVAL_P(num_fields_zval);
- FREE_ZVAL(num_fields_zval);
- /* fetch row */
- number_of_arguments=1;
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_fetch_row", &fetch_row_result_zval, number_of_arguments, arguments);
- if (!fetch_row_result_zval || Z_TYPE_P(fetch_row_result_zval)!=IS_BOOL) {
- if (fetch_row_result_zval) zval_ptr_dtor(&fetch_row_result_zval);
- return 0;
- }
- if (Z_LVAL_P(fetch_row_result_zval)==0) {
- Z_TYPE_PP(rv)=IS_LONG;
- Z_LVAL_PP(rv)=0; /* ok, no more rows */
- zval_ptr_dtor(&fetch_row_result_zval);
- return 0;
- }
- zval_ptr_dtor(&fetch_row_result_zval);
- /* fill array with field results... */
- MAKE_STD_ZVAL(returned_zval);
- array_init(returned_zval);
- MAKE_STD_ZVAL(field_index_zval);
- ZVAL_LONG(field_index_zval, 0);
- number_of_arguments=2;
- for (field_index=0; field_index<field_count; ++field_index) {
- ZVAL_LONG(field_index_zval, field_index+1);
- arguments[0]=result_handle;
- arguments[1]=&field_index_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_result", &field_result_zval, number_of_arguments, arguments);
- zend_hash_index_update(Z_ARRVAL_P(returned_zval), field_index, (void *)&(field_result_zval), sizeof(zval *), NULL);
- }
- FREE_ZVAL(field_index_zval);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_odbc_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns string */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- if (!dbx_handle) number_of_arguments=0;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_errormsg", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_odbc_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns escaped string */
- /* replace ' with '' */
- char * str;
- int len;
- char * tmpstr;
- int tmplen;
-
- if (Z_STRLEN_PP(string) == 0) {
- ZVAL_EMPTY_STRING(*rv);
- return 1;
- }
- tmpstr = estrdup(Z_STRVAL_PP(string));
- tmplen = Z_STRLEN_PP(string);
- /* php_str_to_str uses a smart_str that allocates memory */
- /* this memory must be freed or passed on to rv */
- str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len);
- efree(tmpstr);
-
- ZVAL_STRINGL(*rv, str, len, 0);
-
- return 1;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_odbc.h b/ext/dbx/dbx_odbc.h
deleted file mode 100644
index d23eeb109..000000000
--- a/ext/dbx/dbx_odbc.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_odbc.h,v 1.16 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_DBX_ODBC_H
-#define ZEND_DBX_ODBC_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-#include "php.h"
-
-int dbx_odbc_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns connection handle as resource on success or 0 as long on failure */
-int dbx_odbc_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns persisten connection handle as resource on success or 0 as long on failure */
-int dbx_odbc_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long on success or 0 as long on failure */
-int dbx_odbc_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
-int dbx_odbc_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-count as long on success or 0 as long on failure */
-int dbx_odbc_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-name as string on success or 0 as long on failure */
-int dbx_odbc_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-type as string on success or 0 as long on failure */
-int dbx_odbc_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS);
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
-int dbx_odbc_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns string */
-int dbx_odbc_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS);
- /* returns escaped string */
-
-#endif /* ZEND_DBX_ODBC_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_pgsql.c b/ext/dbx/dbx_pgsql.c
deleted file mode 100644
index 8b026956f..000000000
--- a/ext/dbx/dbx_pgsql.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Rui Hirokawa <hirokawa@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: dbx_pgsql.c,v 1.25 2004/05/06 12:22:14 mboeren Exp $ */
-
-#include "dbx.h"
-#include "php_dbx.h"
-#include "dbx_pgsql.h"
-#include <string.h>
-
-#define PGSQL_ASSOC 1<<0
-#define PGSQL_NUM 1<<1
-
-int dbx_pgsql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int nargs=5;
- char *port="5432", *connstring=NULL;
- zval **args[5], *rarg = NULL;
- zval *conn_zval = NULL;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(conn_zval);
- ZVAL_LONG(conn_zval, 0);
-
- if (Z_STRLEN_PP(username)>0) {
- int len;
-
- len = Z_STRLEN_PP(host)+Z_STRLEN_PP(db)+strlen(port);
- len += Z_STRLEN_PP(username)+Z_STRLEN_PP(password)+45;
- connstring = (char *)emalloc(len+1);
- sprintf(connstring, "host='%s' port='%s' dbname='%s' user='%s' password='%s'",
- Z_STRVAL_PP(host), port, Z_STRVAL_PP(db),
- Z_STRVAL_PP(username), Z_STRVAL_PP(password));
- ZVAL_STRING(conn_zval, connstring, 0);
- args[0] = &conn_zval;
- nargs = 1;
- } else {
- int k;
-
- args[0] = host;
- for (k=1;k<4;k++){
- MAKE_STD_ZVAL(rarg);
- ZVAL_EMPTY_STRING(rarg);
- args[k] = &rarg;
- }
- args[4] = db;
- }
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_connect", &returned_zval, nargs, args);
- zval_dtor(conn_zval);
- FREE_ZVAL(conn_zval);
-
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_pgsql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns persistent connection handle as resource on success or 0 as long on failure */
- int nargs=5;
- char *port="5432", *connstring=NULL;
- zval **args[5], *rarg = NULL;
- zval *conn_zval = NULL;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(conn_zval);
- ZVAL_LONG(conn_zval, 0);
-
- if (Z_STRLEN_PP(username)>0) {
- int len;
-
- len = Z_STRLEN_PP(host)+Z_STRLEN_PP(db)+strlen(port);
- len += Z_STRLEN_PP(username)+Z_STRLEN_PP(password)+45;
- connstring = (char *)emalloc(len+1);
- sprintf(connstring, "host='%s' port='%s' dbname='%s' user='%s' password='%s'",
- Z_STRVAL_PP(host), port, Z_STRVAL_PP(db),
- Z_STRVAL_PP(username), Z_STRVAL_PP(password));
- ZVAL_STRING(conn_zval, connstring, 0);
- args[0] = &conn_zval;
- nargs = 1;
- } else {
- int k;
-
- args[0] = host;
- for (k=1;k<4;k++){
- MAKE_STD_ZVAL(rarg);
- ZVAL_EMPTY_STRING(rarg);
- args[k] = &rarg;
- }
- args[4] = db;
- }
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_pconnect", &returned_zval, nargs, args);
- zval_dtor(conn_zval);
- FREE_ZVAL(conn_zval);
-
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_pgsql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_close", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_pgsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long or a result identifier as resource on success
- or 0 as long on failure */
- int nargs=2;
- zval **args[2];
- zval *returned_zval=NULL;
-
- /* db_name is not used in this function */
- args[0]=dbx_handle;
- args[1]=sql_statement;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_query", &returned_zval, nargs, args);
- /* pg_query returns a bool for success or failure,
- or a result_identifier for select statements */
- if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_pgsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-count as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_num_fields", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_pgsql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-name as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_field_name", &returned_zval, number_of_arguments, arguments);
- /* pg_fieldname returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_pgsql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-type as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_field_type", &returned_zval, number_of_arguments, arguments);
- /* pg_fieldtype returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_pgsql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
-
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fetch_array", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_pgsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns string */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- if (!dbx_handle) number_of_arguments=0;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_last_error", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_pgsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns escaped string */
- /* replace \ with \\ */
- /* ' with '' */
- char * str;
- int len;
- char * tmpstr;
- int tmplen;
-
- if (Z_STRLEN_PP(string) == 0) {
- ZVAL_EMPTY_STRING(*rv);
- return 1;
- }
- tmpstr = estrdup(Z_STRVAL_PP(string));
- tmplen = Z_STRLEN_PP(string);
- /* php_str_to_str uses a smart_str that allocates memory */
- /* this memory must be freed or passed on to rv */
- str = php_str_to_str(tmpstr, tmplen, "\\", 1, "\\\\", 2, &len);
- efree(tmpstr);
- tmpstr=str; tmplen=len;
- str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len);
- efree(tmpstr);
-
- ZVAL_STRINGL(*rv, str, len, 0);
- return 1;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_pgsql.h b/ext/dbx/dbx_pgsql.h
deleted file mode 100644
index 258cd24db..000000000
--- a/ext/dbx/dbx_pgsql.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Rui Hirokawa <hirokawa@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: dbx_pgsql.h,v 1.14 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_DBX_PGSQL_H
-#define ZEND_DBX_PGSQL_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-#include "php.h"
-
-int dbx_pgsql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns connection handle as resource on success or 0 as long on failure */
-int dbx_pgsql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns persistent connection handle as resource on success or 0 as long on failure */
-int dbx_pgsql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long on success or 0 as long on failure */
-int dbx_pgsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
-int dbx_pgsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-count as long on success or 0 as long on failure */
-int dbx_pgsql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-name as string on success or 0 as long on failure */
-int dbx_pgsql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-type as string on success or 0 as long on failure */
-int dbx_pgsql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS);
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
-int dbx_pgsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns string */
-int dbx_pgsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS);
- /* returns escaped string */
-
-#endif /* ZEND_DBX_PGSQL_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_sqlite.c b/ext/dbx/dbx_sqlite.c
deleted file mode 100644
index 2c32fe2f9..000000000
--- a/ext/dbx/dbx_sqlite.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_sqlite.c,v 1.3 2004/01/08 08:15:10 andi Exp $ */
-
-#include "dbx.h"
-#include "dbx_sqlite.h"
-
-#define SQLITE_ASSOC 1
-#define SQLITE_NUM 2
-#define SQLITE_BOTH 3
-
-int dbx_sqlite_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=db;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_open", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sqlite_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns persistent connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=db;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_popen", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sqlite_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_close", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sqlite_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *returned_zval=NULL;
-
- number_of_arguments=2;
- arguments[0]=dbx_handle;
- arguments[1]=sql_statement;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_query", &returned_zval, number_of_arguments, arguments);
- /* sqlite_query returns a bool for success or failure, or a result_identifier for select statements */
- if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sqlite_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-count as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_num_fields", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sqlite_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-name as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_field_name", &returned_zval, number_of_arguments, arguments);
- /* sqlite_field_name returns a string */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sqlite_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-type as string on success or 0 as long on failure */
- /*int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- */
- zval *returned_zval=NULL;
-
- /*
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_field_type", &returned_zval, number_of_arguments, arguments);
- */
- /* sqlite_field_type returns a string */
- /*
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- FREE_ZVAL(zval_column_index);
- */
- MAKE_STD_ZVAL(returned_zval);
- ZVAL_STRING(returned_zval, "string", 1); /* fake field type */
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sqlite_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_resulttype=NULL;
- zval *returned_zval=NULL;
-
- MAKE_STD_ZVAL(zval_resulttype);
- ZVAL_LONG(zval_resulttype, SQLITE_NUM);
- arguments[0]=result_handle;
- arguments[1]=&zval_resulttype;
- /* optional boolean third parameter 'decode_binary' skipped */
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_fetch_array", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_resulttype);
- return 0;
- }
- FREE_ZVAL(zval_resulttype);
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sqlite_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns string */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval_errcode=NULL;
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- if (!dbx_handle) number_of_arguments=0;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_last_error", &returned_zval_errcode, number_of_arguments, arguments);
- if (!returned_zval_errcode || Z_TYPE_P(returned_zval_errcode)!=IS_LONG) {
- if (returned_zval_errcode) zval_ptr_dtor(&returned_zval_errcode);
- return 0;
- }
- if (Z_LVAL_P(returned_zval_errcode) == 0) {
- zval_ptr_dtor(&returned_zval_errcode);
- ZVAL_EMPTY_STRING(*rv);
- return 1;
- }
- arguments[0]=&returned_zval_errcode;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_error_string", &returned_zval, number_of_arguments, arguments);
- zval_ptr_dtor(&returned_zval_errcode);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sqlite_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns escaped string */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
- char * str;
- int len;
- char * tmpstr;
- int tmplen;
-
- if (Z_STRLEN_PP(string) == 0) {
- ZVAL_EMPTY_STRING(*rv);
- return 1;
- }
- arguments[0]=string;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sqlite_escape_string", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- /* sqlite_escape_string failed, just do my own escaping then */
- /* replace ' with '' */
- tmpstr = estrdup(Z_STRVAL_PP(string));
- tmplen = Z_STRLEN_PP(string);
- /* php_str_to_str uses a smart_str that allocates memory */
- /* this memory must be freed or passed on to rv */
- str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len);
- efree(tmpstr);
-
- ZVAL_STRINGL(*rv, str, len, 0);
- return 1;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_sqlite.h b/ext/dbx/dbx_sqlite.h
deleted file mode 100644
index bc6a4f4f5..000000000
--- a/ext/dbx/dbx_sqlite.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_sqlite.h,v 1.3 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_DBX_SQLITE_H
-#define ZEND_DBX_SQLITE_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-#include "php.h"
-
-int dbx_sqlite_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns connection handle as resource on success or 0 as long on failure */
-int dbx_sqlite_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns persistent connection handle as resource on success or 0 as long on failure */
-int dbx_sqlite_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long on success or 0 as long on failure */
-int dbx_sqlite_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
-int dbx_sqlite_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-count as long on success or 0 as long on failure */
-int dbx_sqlite_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-name as string on success or 0 as long on failure */
-int dbx_sqlite_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-type as string on success or 0 as long on failure */
-int dbx_sqlite_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS);
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
-int dbx_sqlite_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns string */
-int dbx_sqlite_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS);
- /* returns escaped string */
-
-#endif /* ZEND_DBX_SQLITE_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_sybasect.c b/ext/dbx/dbx_sybasect.c
deleted file mode 100644
index 87ccd0282..000000000
--- a/ext/dbx/dbx_sybasect.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_sybasect.c,v 1.10 2004/01/08 08:15:10 andi Exp $ */
-
-#include "dbx.h"
-#include "dbx_sybasect.h"
-
-#define MYSQL_ASSOC 1<<0
-#define MYSQL_NUM 1<<1
-
-int dbx_sybasect_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- arguments[0]=host;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_connect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- number_of_arguments=2;
- arguments[0]=db;
- arguments[1]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_select_db", &select_db_zval, number_of_arguments, arguments);
- if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) {
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- /* also close connection */
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- zend_list_addref(Z_LVAL_P(returned_zval));
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_close", &select_db_zval, number_of_arguments, arguments);
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- zval_ptr_dtor(&select_db_zval);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sybasect_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns persistent connection handle as resource on success or 0 as long on failure */
- int number_of_arguments=3;
- zval **arguments[3];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- arguments[0]=host;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_pconnect", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
-
- number_of_arguments=2;
- arguments[0]=db;
- arguments[1]=&returned_zval;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_select_db", &select_db_zval, number_of_arguments, arguments);
- if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) {
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- /* also close connection */
- number_of_arguments=1;
- arguments[0]=&returned_zval;
- zend_list_addref(Z_LVAL_P(returned_zval));
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_close", &select_db_zval, number_of_arguments, arguments);
- if (select_db_zval) zval_ptr_dtor(&select_db_zval);
- zval_ptr_dtor(&returned_zval);
- return 0;
- }
- zval_ptr_dtor(&select_db_zval);
-
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sybasect_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_close", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sybasect_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *returned_zval=NULL;
- zval *select_db_zval=NULL;
-
- number_of_arguments=2;
- arguments[0]=db_name;
- arguments[1]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_select_db", &select_db_zval, number_of_arguments, arguments);
- zval_ptr_dtor(&select_db_zval);
-
- number_of_arguments=2;
- arguments[0]=sql_statement;
- arguments[1]=dbx_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_query", &returned_zval, number_of_arguments, arguments);
- /* sybase_query returns a bool for success or failure, or a result_identifier for select statements */
- if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sybasect_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-count as long on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_num_fields", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sybasect_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-name as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
- zval **zv_name=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_fetch_field", &returned_zval, number_of_arguments, arguments);
- /* sybase_fetch_field returns an object */
- /* we need only the 'name' member here */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_OBJECT) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- if (zend_hash_find(Z_OBJPROP_P(returned_zval), "name", 5, (void **) &zv_name)==FAILURE) {
- zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
-
- **rv = **zv_name;
- zval_copy_ctor(*rv);
- zval_ptr_dtor(&returned_zval);
- zval_ptr_dtor(zv_name);
-
- FREE_ZVAL(zval_column_index);
-/* MOVE_RETURNED_TO_RV(rv, returned_zval); */
- return 1;
-}
-
-int dbx_sybasect_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns column-type as string on success or 0 as long on failure */
- int number_of_arguments=2;
- zval **arguments[2];
- zval *zval_column_index;
- zval *returned_zval=NULL;
- zval **zv_type=NULL;
-
- MAKE_STD_ZVAL(zval_column_index);
- ZVAL_LONG(zval_column_index, column_index);
- arguments[0]=result_handle;
- arguments[1]=&zval_column_index;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_fetch_field", &returned_zval, number_of_arguments, arguments);
- /* sybase_fetch_field returns an object */
- /* we need only the 'type' member here */
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_OBJECT) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
- if (zend_hash_find(Z_OBJPROP_P(returned_zval), "type", 5, (void **) &zv_type)==FAILURE) {
- zval_ptr_dtor(&returned_zval);
- FREE_ZVAL(zval_column_index);
- return 0;
- }
-
- **rv = **zv_type;
- zval_copy_ctor(*rv);
- zval_ptr_dtor(&returned_zval);
- zval_ptr_dtor(zv_type);
-
- FREE_ZVAL(zval_column_index);
-/* MOVE_RETURNED_TO_RV(rv, returned_zval); */
- return 1;
-}
-
-int dbx_sybasect_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=result_handle;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_fetch_row", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sybasect_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns string */
- int number_of_arguments=1;
- zval **arguments[1];
- zval *returned_zval=NULL;
-
- arguments[0]=dbx_handle;
- if (!dbx_handle) number_of_arguments=0;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_get_last_message", &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
- return 1;
-}
-
-int dbx_sybasect_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS)
-{
- /* returns escaped string */
- /* replace ' with '' */
- char * str;
- int len;
- char * tmpstr;
- int tmplen;
-
- if (Z_STRLEN_PP(string) == 0) {
- ZVAL_EMPTY_STRING(*rv);
- return 1;
- }
- tmpstr = estrdup(Z_STRVAL_PP(string));
- tmplen = Z_STRLEN_PP(string);
- /* php_str_to_str uses a smart_str that allocates memory */
- /* this memory must be freed or passed on to rv */
- str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len);
- efree(tmpstr);
-
- ZVAL_STRINGL(*rv, str, len, 0);
-
- return 1;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/dbx_sybasect.h b/ext/dbx/dbx_sybasect.h
deleted file mode 100644
index 7c8249dc2..000000000
--- a/ext/dbx/dbx_sybasect.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: dbx_sybasect.h,v 1.7 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_DBX_SYBASECT_H
-#define ZEND_DBX_SYBASECT_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-#include "php.h"
-
-int dbx_sybasect_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns connection handle as resource on success or 0 as long on failure */
-int dbx_sybasect_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
- /* returns persistent connection handle as resource on success or 0 as long on failure */
-int dbx_sybasect_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long on success or 0 as long on failure */
-int dbx_sybasect_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS);
- /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */
-int dbx_sybasect_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-count as long on success or 0 as long on failure */
-int dbx_sybasect_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-name as string on success or 0 as long on failure */
-int dbx_sybasect_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
- /* returns column-type as string on success or 0 as long on failure */
-int dbx_sybasect_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS);
- /* returns array[0..columncount-1] as strings on success or 0 as long on failure */
-int dbx_sybasect_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
- /* returns string */
-int dbx_sybasect_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS);
- /* returns escaped string */
-
-#endif /* ZEND_DBX_SYBASECT_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/howto_extend_dbx.html b/ext/dbx/howto_extend_dbx.html
deleted file mode 100644
index 3d4c6229f..000000000
--- a/ext/dbx/howto_extend_dbx.html
+++ /dev/null
@@ -1,316 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
-<html>
-<head>
-<title>HOWTO extend dbx</title>
-
-</head>
-
-<body marginwidth="0" marginheight="0">
-<style type="text/css">
-<!--
-
-body, p, td, input, select, a, h1, h2, h3, h4, h5, h6, marquee, blink
- { font-family: Verdana,sans-serif; font-size: 10pt; color: #000000; }
-h1 { font-size: 16pt; font-weight: bold; }
-h2 { font-size: 14pt; font-weight: bold; }
-h3 { font-size: 12pt; font-weight: bold; }
-h4 { font-size: 10pt; font-weight: bold; }
-h5 { font-size: 8pt;}
-h6 { font-size: 6pt;}
-
-body { background-color: #F0F0F0; }
-a { color: #000088; }
-
-.title { font-size: 14pt; font-weight: bold; }
-.fn-title { font-size: 12pt; font-weight: bold; }
-.fn-phpversion { font-size: 10pt; font-weight: normal; }
-.fn-def { margin-top: 8px; margin-bottom: 8px; background-color: #99BBDD; }
-.fn-defname { font-weight: bold; }
-.fn-name { font-size: 12pt; font-weight: bold; }
-.fn-param { font-weight: bold; }
-.example { margin-top: 12px; font-weight: bold; }
-.text { margin: 8px; }
-.code { margin: 16px; font-family: Courier; background-color: #CCCCCC; }
-.bold { font-weight: bold; }
-
-.indent { margin-left: 16px; }
-.newpage { border-top: 2px solid #000088; margin-bottom: 8px; }
-.tab { margin-left: 16px; }
-
-
--->
-</style>
-
-
-
-
-
-<a name="top"></a>
-<div class="title">
-How-to code support for another database<br>
-</div>
-<div class="text">
-Every supported database module must be loaded by PHP before it can be used. Every supported database module must be added to the dbx-module before it can be used. Currently there is support for MySQL, PostgreSQL, Microsoft SQL Server, Frontbase, Sybase-CT, Oracle (oci8) and ODBC. It is not difficult to add support for more databases.<br>
-<br>
-The dbx module is found in de PHP ext/dbx folder. The support-code is found in the same folder <br>
-<br>
-To add support for module 'blabla' the following steps must be taken: <br>
-1. the dbx.c source file must be extended to recognize module 'blabla' and switch to the 'blabla' functions.<br>
-2. the files dbx_blabla.h and dbx_blabla.c must be created and edited to produce the required response.<br>
-3. add the files from step 2 to the project.<br>
-4. compile.<br>
-5. enjoy.<br>
-<br>
-You may need a bit of help for step 1 and 2. If you need help for step 3 or 4, you shouldn't try to attempt this probably :-). If you need help with step 5 you're in big trouble ;o)<br>
-Help for step 1 and 2 is given below, bold text in code indicate the important bits.<br>
-</div>
-<p>
-<a href="index.html">home</a><br>
-<div class="newpage"></div>
-
-<div class="fn-title"><a name="step1"></a>
-1. the dbx.c source file must be extended<br>
-</div>
-<div class="text">
-Define a module identifier and assign it a unique number. Include your header file here as well.<br>
-<pre class="code">
-// defines for supported databases
-#define DBX_UNKNOWN 0
-#define DBX_MYSQL 1
-#define DBX_ODBC 2
-<span class="bold">#define DBX_BLABLA 3</span>
-// includes for supported databases
-#include "dbx.h"
-#include "dbx_mysql.h"
-#include "dbx_odbc.h"
-<span class="bold">#include "dbx_blabla.h"</span>
-</pre>
-Add code to the module_identifier_exists function so DBX_BLABLA will be recognized:<br>
-<pre class="code">
-int module_identifier_exists(long module_identifier) {
- switch (module_identifier) {
- case DBX_MYSQL: return module_exists("mysql");
- case DBX_ODBC: return module_exists("odbc");
- <span class="bold">case DBX_BLABLA: return module_exists("blabla");</span>
- }
- return 0;
- }
-</pre>
-Add code to the get_module_identifier function so your extension will be recognized:<br>
-<pre class="code">
-int get_module_identifier(char * module_name) {
- if (!strcmp("mysql", module_name)) return DBX_MYSQL;
- if (!strcmp("odbc", module_name)) return DBX_ODBC;
- <span class="bold">if (!strcmp("blabla", module_name)) return DBX_BLABLA;</span>
- return DBX_UNKNOWN;
- }
-</pre>
-Add code for exposing the DBX_BLABLA constant to the world:<br>
-<pre class="code">
-ZEND_MINIT_FUNCTION(dbx)
-{
-/*/ REGISTER_INI_ENTRIES(); /*/
-
- REGISTER_LONG_CONSTANT("DBX_MYSQL", DBX_MYSQL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("DBX_ODBC", DBX_ODBC, CONST_CS | CONST_PERSISTENT);
- <span class="bold">REGISTER_LONG_CONSTANT("DBX_BLABLA", DBX_BLABLA CONST_CS | CONST_PERSISTENT);</span>
-
- [...]
-
- return SUCCESS;
- }
-</pre>
-Add code for inclusion in the phpinfo() function (optional, but recommended):<br>
-<pre class="code">
-ZEND_MINFO_FUNCTION(dbx)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "dbx support", "enabled");
- php_info_print_table_row(2, "dbx support for MySQL", "enabled");
- php_info_print_table_row(2, "dbx support for ODBC", "enabled");
- <span class="bold">php_info_print_table_row(2, "dbx support for BlaBla", "enabled");</span>
- php_info_print_table_end();
- DISPLAY_INI_ENTRIES();
-}
-</pre>
-Finally, for the implementation of all switch_dbx_XXXXX functions, copy a 'case'-line for every function that you support (should be all functions!). Here is an example for only the switch_dbx_connect function:<br>
-<pre class="code">
-int switch_dbx_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) {
- // returns connection handle as resource on success or 0 as long on failure
- switch ((*dbx_module)-&gt;value.lval) {
- case DBX_MYSQL: return dbx_mysql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- case DBX_ODBC: return dbx_odbc_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
- <span class="bold">case DBX_BLABLA: return dbx_blabla_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);</span>
- }
- zend_error(E_WARNING, "dbx_connect: not supported in this module");
- return 0;
- }
-</pre>
-This should be done for all switch_dbx_XXXXX functions. They are listed below:<br>
-<pre class="code">
-int <a href="#connect">switch_dbx_connect(...)</a>;
-int <a href="#pconnect">switch_dbx_pconnect(...)</a>;
-int <a href="#close">switch_dbx_close(...)</a>;
-int <a href="#query">switch_dbx_query(...)</a>;
-int <a href="#getcolumncount">switch_dbx_getcolumncount(...)</a>;
-int <a href="#getcolumnname">switch_dbx_getcolumnname(...)</a>;
-int <a href="#getcolumntype">switch_dbx_getcolumntype(...)</a>;
-int <a href="#getrow">switch_dbx_getrow(...)</a>;
-int <a href="#error">switch_dbx_error(...)</a>;
-</pre>
-This concludes the changes for the dbx.c file. All that is needed now is to actually code the dbx_blabla_connect and other functions, which we will see in the following step.<br>
-</div>
-<p>
-<a href="#top">top</a><br>
-<div class="newpage"></div>
-
-<div class="fn-title"><a name="step1"></a>
-2. the files dbx_blabla.h and dbx_blabla.c<br>
-</div>
-<div class="text">
-The dbx_blabla.h and dbx_blabla.c file are created in the folder /ext/dbx.<br>
-The easiest method is to just copy dbx_mysql.h en dbx_mysql.c, open both files, and do a search and replace ('blabla' for 'mysql' and 'BLABLA' for 'MYSQL'). Yes, case-sensitive.<br>
-For the .h file, that's all. <br>
-For the .c file, the fun has just started :-)<br>
-In the .c is the actual realization of the database abstraction, where a call to a standard function is translated into one or more database-specific calls. For mysql, a dbx_connect translates to a mysql_connect followed by a mysql_select_db. Refer to the dbx_mysql.c and dbx_odbc.c files regularly for examples!<br>
-In dbx.h one macro and one function are defined to make the calling of external module functions and returning of the results easier: dbx_call_any_function and MOVE_RETURNED_TO_RV.<br>
-<p>
- The details of what each of the functions do, what parameters they get, and what parameters they should return are discussed below. But first, the dbx_mysql_connect function is presented and explained, so you get an idea of how things work.<br>
-<pre class="code">
-int dbx_mysql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) {
- // returns connection handle as resource on success or 0 as long on
- // failure
- int number_of_arguments;
- zval **arguments[3];
- zval * returned_zval=NULL;
- zval * select_db_zval=NULL;
-
- number_of_arguments=3;
- arguments[0]=host;
- arguments[1]=username;
- arguments[2]=password;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, <span class="bold">"mysql_connect"</span>, &returned_zval, number_of_arguments, arguments);
- if (!returned_zval || returned_zval-&gt;type!=IS_RESOURCE) {
- if (returned_zval) zval_ptr_dtor(&returned_zval);
- return 0;
- }
- MOVE_RETURNED_TO_RV(rv, returned_zval);
-
- number_of_arguments=2;
- arguments[0]=db;
- arguments[1]=rv;
- dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, <span class="bold">"mysql_select_db"</span>, &select_db_zval, number_of_arguments, arguments);
- zval_ptr_dtor(&select_db_zval);
-
- return 1;
- }
-</pre>
-First of all, all functions return 0 on failure and 1 on success. These values are used in the dbx-routines, they are never actually given back to the PHP-script writer that calls the dbx_connect function.<br>
-The actual value that is of interest to the caller is returned in the <span class="bold">rv</span> parameter. In this case it is a connection handle (or link identifier, in mysql-speak), that is also returned if the database selection doesn't succeed. <br>
-The parameters that are of interest to the function are located between the <span class="bold">rv</span> and <span class="bold">INTERNAL_FUNCTION_PARAMETERS</span> parameters, in this case it is a <span class="bold">host</span> name, a <span class="bold">db</span> name, a <span class="bold">username</span> and a <span class="bold">password</span>. These are the values that the user specifies if he calls dbx_connect(); These parameters are used in the calls to the mysql-database functions. The user actually also specifies a module-name, that decides which connect-function should be called. Here, he specified 'mysql'.<br>
-To actually call a mysql module function, you can use <span class="bold">dbx_call_any_function</span> where you specify the function name (it is used twice in dbx_mysql_connect, see <span class="bold">'mysql_connect'</span> and <span class="bold">'mysql_select_db'</span>, they are printed bold in the code). The value that is returned from the function will be stored in the next argument, a zval * (e.g. <span class="bold">returned_zval</span>) parameter that you must declare locally. To actually return such a parameter, use the <span class="bold">MOVE_RETURNED_TO_RV(rv, returned_zval)</span> macro, which copies the values to <span class="bold">rv</span> and frees anything that may be left in <span class="bold">returned_zval</span>. Parameters that must be passed to the mysql-function are stored in the <span class="bold">arguments</span> array, which must be large enough to hold all parameters to the function-call that requires the most parameters (in this case, mysql_connect expects 3 parameters, mysql_select_db expects two parameters, so the <span class="bold">arguments</span> array is defined 'zval **arguments[<span class="bold">3</span>]'). The <span class="bold">number_of_arguments</span> parameter is set to the actual number of arguments that the function-call requires. As you can see it is initialized to 3, for the first call to mysql_connect. Then it is set to 2, for the call to mysql_select_db. If you call a function that retrieves a value, and you don't return it with MOVE_RETURNED_TO_RV, then you must free the value using <span class="bold">zval_ptr_dtor</span>, as can be seen right after the call to mysql_select_db. This can also be seen directly after the call to mysql_connect, if somehow this function failed or didn't return a resource (on a successful connect mysql_connect returns a resource) the returned value is freed as well (and 0 is returned because the connection failed).<br>
-<p>
-OK, now the description of all functions that you should implement, and what is expected of them...<br>
-<a name="connect"></a><pre class="code">
-int <span class="fn-name">dbx_blabla_connect</span>(zval **rv, zval **<span class="fn-param">host</span>, zval **<span class="fn-param">db</span>, zval **<span class="fn-param">username</span>, zval **<span class="fn-param">password</span>, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on connect-failure and 1 on success
-// rv: connection handle as resource on success or nothing on failure
-</pre>
-dbx_blabla_connect creates a connection to a database on a specified host, using username and password for authentication. This may be done by connecting to a server and selecting a database (as mysql does), or connecting to a specific database directly (as in ODBC). <br>
-What must be returned (in <span class="bold">rv</span>) is the link identifier that is returned from the blabla_connect function, in it's native form so the end-user can use $db-&gt;handle to call other blabla_* functions that expect this parameter.<br>
-What must be returned from the function is a 1 on success and a 0 on failure. Remember that a failed database selection can still return a 1 because the connection succeeded!<br>
-The host (string) is the name of the machine the server is run on, but it may be empty if a database name is enough to establish a connection.<br>
-The db (string) is the name of the database to select, or, for e.g. ODBC, the identifier that is needed to actually select the database.<br>
-The username (string) and password (string) are used for authentication.<br>
-<a name="pconnect"></a><pre class="code">
-int <span class="fn-name">dbx_blabla_pconnect</span>(zval **rv, zval **<span class="fn-param">host</span>, zval **<span class="fn-param">db</span>, zval **<span class="fn-param">username</span>, zval **<span class="fn-param">password</span>, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on pconnect-failure and 1 on success
-// rv: persistent connection handle as resource on success or nothing
-// on failure
-</pre>
-dbx_blabla_pconnect is identical to dbx_blabla_connect except that it will create a persistent connection.<br>
-<a name="close"></a><pre class="code">
-int <span class="fn-name">dbx_blabla_close</span>(zval **rv, zval **<span class="fn-param">dbx_handle</span>, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on close-failure and 1 on success
-// rv: 1 as bool on success or nothing on failure
-</pre>
-dbx_blabla_close closes an open connection, whether it was created persistently or not.<br>
-What must be returned (in <span class="bold">rv</span>) is a boolean true that indicates when the connection was closed successfully. If it wasn't, no value is returned in <span class="bold">rv</span>.<br>
-What must be returned from the function is a 1 on success and a 0 on failure. Note that an unsuccessful close is still a succeeded function call.<br>
-The dbx_handle is the same value that you returned from dbx_blabla_connect or dbx_blabla_pconnect.<br>
-<a name="query"></a><pre class="code">
-int <span class="fn-name">dbx_blabla_query</span>(zval **rv, zval **<span class="fn-param">dbx_handle</span>, zval **<span class="fn-param">sql_statement</span>, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on query-failure and 1 on success
-// rv: 1 as bool or a result identifier as resource on success
-// or nothing on failure
-</pre>
-dbx_blabla_query executes an SQL statement over the connection.<br>
-What must be returned (in <span class="bold">rv</span>) is a nothing on failure, on success it must return either a boolean 1 for queries that don't return data (like INSERT INTO) or a native result-handle for queries that do return data (SELECT). The native result handle ($q-&gt;handle) can be used by the end-user to call other blabla_* functions that expect this parameter.<br>
-What must be returned from the function is a 1 on success and a 0 on failure. Note that a failed query execution can still return a 1 because the query function succeeded!<br>
-The dbx_handle is the same value that you returned from dbx_blabla_connect or dbx_blabla_pconnect.<br>
-The sql_statement (string) can have any value.<br>
-<a name="getcolumncount"></a><pre class="code">
-int <span class="fn-name">dbx_blabla_getcolumncount</span>(zval **rv, zval **<span class="fn-param">result_handle</span>, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on query-failure and 1 on success
-// returns column-count as long on success or nothing on failure
-</pre>
-dbx_blabla_getcolumncount gets the number of fields that the query-result contains.<br>
-What must be returned (in <span class="bold">rv</span>) is the number of fields as long from the query result specified by the result_handle.<br>
-What must be returned from the function is a 1 on success and a 0 on failure. <br>
-The result_handle is the same value that you returned from dbx_query.<br>
-<a name="getcolumnname"></a><pre class="code">
-int <span class="fn-name">dbx_blabla_getcolumnname</span>(zval **rv, zval **<span class="fn-param">result_handle</span>, long <span class="fn-param">column_index</span>, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on failure and 1 on success
-// returns column-name as string on success or nothing on failure
-</pre>
-dbx_blabla_getcolumnname gets the fieldname of the specified column.<br>
-What must be returned (in <span class="bold">rv</span>) is the fieldname as string of the given column.<br>
-What must be returned from the function is a 1 on success and a 0 on failure. <br>
-The result_handle is the same value that you returned from dbx_query.<br>
-The column_index is a long that ranges from 0 to the value you returned from dbx_blabla_getcolumncount minus 1 [0..columncount-1].<br>
-<a name="getcolumntype"></a><pre class="code">
-int <span class="fn-name">dbx_blabla_getcolumntype</span>(zval **rv, zval **<span class="fn-param">result_handle</span>, long <span class="fn-param">column_index</span>, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on failure and 1 on success
-// returns column-type as string on success or nothing on failure
-</pre>
-dbx_blabla_getcolumnname gets the field type of the specified column.<br>
-What must be returned (in <span class="bold">rv</span>) is the field type as string of the given column.<br>
-What must be returned from the function is a 1 on success and a 0 on failure. <br>
-The result_handle is the same value that you returned from dbx_query.<br>
-The column_index is a long that ranges from 0 to the value you returned from dbx_blabla_getcolumncount minus 1 [0..columncount-1].<br>
-<a name="getrow"></a><pre class="code">
-int <span class="fn-name">dbx_blabla_getrow</span>(zval **rv, zval **<span class="fn-param">result_handle</span>, long <span class="fn-param">row_number</span>, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on failure and 1 on success
-// returns array[0..columncount-1] as strings on success or 0 as long
-// on failure
-</pre>
-dbx_blabla_getrow gets the next row from the query-results.<br>
-In some cases (PostgreSQL) the rownumber is needed to actually fetch the row. This will be provided (it will be indexed starting at 0) by the dbx_query function. In other cases it is not needed and thus not used.<br>
-What must be returned (in <span class="bold">rv</span>) is an indexed array[0..columncount-1] of strings, containing the data from the row (for mysql this is easy since it already performs this way, for ODBC the array has to be constructed inside this function from a loop that fetches the data for each column).<br>
-What must be returned from the function is a 1 on success and a 0 on failure (function failed or there are no more rows available). <br>
-The result_handle is the same value that you returned from dbx_query.<br>
-<a name="error"></a><pre class="code">
-int <span class="fn-name">dbx_blabla_error</span>(zval **rv, zval **<span class="fn-param">dbx_handle</span>, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on failure and 1 on success
-// returns error message as string
-</pre>
-dbx_blabla_error gets the error message from the last database call.<br>
-What must be returned (in <span class="bold">rv</span>) is the error message as a string.<br>
-What must be returned from the function is a 1 on success and a 0 on failure. <br>
-The dbx_handle is the same value that you returned from dbx_blabla_connect or dbx_blabla_pconnect.<br>
-</div>
-<p>
-<a href="#top">top</a><br>
-<div class="newpage"></div>
-<p>
-<div class="text">
-For specifics or the finer details you can always refer to dbx_mysql.c and dbx_odbc.c to see everything in action. <br>
-More Zend API documentation can be found at <a href="http://www.zend.com/apidoc">http://www.zend.com/apidoc</a>.<br>
-This document can be found at <a href="http://www.guidance.nl/php/dbx">http://www.guidance.nl/php/dbx</a>.<br>
-</div>
-<p>
-<a href="#top">top</a><br>
-<div class="newpage"></div>
-
-</body>
-</html>
diff --git a/ext/dbx/package.xml b/ext/dbx/package.xml
deleted file mode 100644
index 6bed9181a..000000000
--- a/ext/dbx/package.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>dbx</name>
- <summary>Database abstraction functions</summary>
- <maintainers>
- <maintainer>
- <user>mboeren</user>
- <name>Marc Boeren</name>
- <email>marc@guidance.nl</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>hirokawa</user>
- <name>Rui Hirokawa</name>
- <email>hirokawa@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>???</user>
- <name>Frank M. Kromann</name>
- <email>frank@kromann.info</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-The dbx module is a database abstraction layer (db 'X', where 'X'
-is a supported database). The dbx functions allow you to access all
-supported databases using a single calling convention. The
-dbx-functions themselves do not interface directly to the databases,
-but interface to the modules that are used to support these 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="doc" name="INSTALL"/>
- <file role="doc" name="howto_extend_dbx.html"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="dbx.dsp"/>
- <file role="src" name="dbx.c"/>
- <file role="src" name="dbx.h"/>
- <file role="src" name="dbx_fbsql.c"/>
- <file role="src" name="dbx_fbsql.h"/>
- <file role="src" name="dbx_mssql.c"/>
- <file role="src" name="dbx_mssql.h"/>
- <file role="src" name="dbx_mysql.c"/>
- <file role="src" name="dbx_mysql.h"/>
- <file role="src" name="dbx_oci8.c"/>
- <file role="src" name="dbx_oci8.h"/>
- <file role="src" name="dbx_odbc.c"/>
- <file role="src" name="dbx_odbc.h"/>
- <file role="src" name="dbx_pgsql.c"/>
- <file role="src" name="dbx_pgsql.h"/>
- <file role="src" name="dbx_sybasect.c"/>
- <file role="src" name="dbx_sybasect.h"/>
- <file role="src" name="php_dbx.h"/>
- <file role="src" name="dbx_sqlite.c"/>
- <file role="src" name="dbx_sqlite.h"/>
- <file role="test" name="tests/001.phpt"/>
- <file role="test" name="tests/002.phpt"/>
- <file role="test" name="tests/003.phpt"/>
- <file role="test" name="tests/004.phpt"/>
- <file role="test" name="tests/005.phpt"/>
- <file role="test" name="tests/006.phpt"/>
- <file role="test" name="tests/007.phpt"/>
- <file role="test" name="tests/008.phpt"/>
- <file role="test" name="tests/009.phpt"/>
- <file role="test" name="tests/dbx_test.p"/>
- <file role="test" name="tests/dbx_test.pgsql.script"/>
- <file role="test" name="tests/dbx_test.script"/>
- <file role="test" name="tests/skipif.inc"/>
- <file role="test" name="tests/010.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/dbx/php_dbx.h b/ext/dbx/php_dbx.h
deleted file mode 100644
index b53aa538b..000000000
--- a/ext/dbx/php_dbx.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | dbx module version 1.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 2001-2003 Guidance Rotterdam BV |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author : Marc Boeren <marc@guidance.nl> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: php_dbx.h,v 1.19 2004/01/08 17:32:01 sniper Exp $ */
-
-#ifndef ZEND_PHP_DBX_H
-#define ZEND_PHP_DBX_H
-
-#ifndef INIT_FUNC_ARGS
-#include "zend_modules.h"
-#endif
-
-extern zend_module_entry dbx_module_entry;
-#define phpext_dbx_ptr &dbx_module_entry
-
-#ifdef ZEND_WIN32
-#define ZEND_DBX_API __declspec(dllexport)
-#else
-#define ZEND_DBX_API
-#endif
-
-ZEND_MINIT_FUNCTION(dbx);
-ZEND_MSHUTDOWN_FUNCTION(dbx);
-/* ZEND_RINIT_FUNCTION(dbx); */
-/* ZEND_RSHUTDOWN_FUNCTION(dbx); */
-
-ZEND_MINFO_FUNCTION(dbx);
-
-ZEND_FUNCTION(dbx_connect);
-ZEND_FUNCTION(dbx_close);
-ZEND_FUNCTION(dbx_query);
-ZEND_FUNCTION(dbx_fetch_row);
-ZEND_FUNCTION(dbx_error);
-ZEND_FUNCTION(dbx_escape_string);
-
-ZEND_FUNCTION(dbx_sort);
-ZEND_FUNCTION(dbx_compare);
-
-/*
- Declare any global variables you may need between the BEGIN
- and END macros here:
-*/
-
-/*
-ZEND_BEGIN_MODULE_GLOBALS(dbx)
-ZEND_END_MODULE_GLOBALS(dbx)
-*/
-
-/* In every function that needs to use variables in php_dbx_globals,
- do call dbxLS_FETCH(); after declaring other variables used by
- that function, and always refer to them as dbxG(variable).
- You are encouraged to rename these macros something shorter, see
- examples in any other php module directory.
-*/
-
-#ifdef ZTS
-#define DBXG(v) TSRMG(dbx_globals_id, zend_dbx_globals *, v)
-#else
-#define DBXG(v) (dbx_globals.v)
-#endif
-
-#endif /* ZEND_PHP_DBX_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/dbx/tests/001.phpt b/ext/dbx/tests/001.phpt
deleted file mode 100644
index e8f30f7c1..000000000
--- a/ext/dbx/tests/001.phpt
+++ /dev/null
@@ -1,10 +0,0 @@
---TEST--
-Check for dbx presence
---SKIPIF--
-<?php if (!extension_loaded("dbx")) print("skip"); ?>
---FILE--
-<?php
-print("dbx extension is available");
-?>
---EXPECT--
-dbx extension is available \ No newline at end of file
diff --git a/ext/dbx/tests/002.phpt b/ext/dbx/tests/002.phpt
deleted file mode 100644
index b708b66ac..000000000
--- a/ext/dbx/tests/002.phpt
+++ /dev/null
@@ -1,31 +0,0 @@
---TEST--
-DBX_CONSTANTS
---SKIPIF--
-<?php if (!extension_loaded("dbx")) print("skip"); ?>
---FILE--
-<?php
-if (DBX_MYSQL=="DBX_MYSQL") print('!DBX_MYSQL');
-if (DBX_ODBC=="DBX_ODBC") print('!DBX_ODBC');
-if (DBX_PGSQL=="DBX_PGSQL") print('!DBX_PGSQL');
-if (DBX_MSSQL=="DBX_MSSQL") print('!DBX_MSSQL');
-if (DBX_FBSQL=="DBX_FBSQL") print('!DBX_FBSQL');
-if (DBX_OCI8=="DBX_OCI8") print('!DBX_OCI8');
-if (DBX_SYBASECT=="DBX_SYBASECT") print('!DBX_SYBASECT');
-if (DBX_SQLITE=="DBX_SQLITE") print('!DBX_SQLITE');
-if (DBX_PERSISTENT=="DBX_PERSISTENT") print('!DBX_PERSISTENT');
-if (DBX_RESULT_INFO=="DBX_RESULT_INFO") print('!DBX_RESULT_INFO');
-if (DBX_RESULT_INDEX=="DBX_RESULT_INDEX") print('!DBX_RESULT_INDEX');
-if (DBX_RESULT_ASSOC=="DBX_RESULT_ASSOC") print('!DBX_RESULT_ASSOC');
-if (DBX_RESULT_UNBUFFERED=="DBX_RESULT_UNBUFFERED") print('!DBX_RESULT_UNBUFFERED');
-if (DBX_COLNAMES_UNCHANGED=="DBX_COLNAMES_UNCHANGED") print('!DBX_COLNAMES_UNCHANGED');
-if (DBX_COLNAMES_UPPERCASE=="DBX_COLNAMES_UPPERCASE") print('!DBX_COLNAMES_UPPERCASE');
-if (DBX_COLNAMES_LOWERCASE=="DBX_COLNAMES_LOWERCASE") print('!DBX_COLNAMES_LOWERCASE');
-if (DBX_CMP_NATIVE=="DBX_CMP_NATIVE") print('!DBX_CMP_NATIVE');
-if (DBX_CMP_TEXT=="DBX_CMP_TEXT") print('!DBX_CMP_TEXT');
-if (DBX_CMP_NUMBER=="DBX_CMP_NUMBER") print('!DBX_CMP_NUMBER');
-if (DBX_CMP_ASC=="DBX_CMP_ASC") print('!DBX_CMP_ASC');
-if (DBX_CMP_DESC=="DBX_CMP_DESC") print('!DBX_CMP_DESC');
-print('ok');
-?>
---EXPECT--
-ok \ No newline at end of file
diff --git a/ext/dbx/tests/003.phpt b/ext/dbx/tests/003.phpt
deleted file mode 100644
index 9c0c3b0e8..000000000
--- a/ext/dbx/tests/003.phpt
+++ /dev/null
@@ -1,139 +0,0 @@
---TEST--
-dbx_connect
---SKIPIF--
-<?php
-include_once("skipif.inc");
-?>
---FILE--
-<?php
-include_once("dbx_test.p");
-$nonexisting_database="nonexisting_database";
-$nonexisting_username="nonexisting_username";
-$nonexisting_password="nonexisting_password";
-$dlo = dbx_connect($module_name, $host, $database, $username, $password);
-if ($dlo!=0) {
- print('connect using string ok'."\n");
- dbx_close($dlo);
- }
-$dlo = dbx_connect($module, $host, $database, $username, $password);
-if ($dlo!=0) {
- print('connect using constant ok'."\n");
- dbx_close($dlo);
- }
-// sqlite is a special case as it will just create a db if it isn't found
-if ($module == DBX_SQLITE) {
- print('connect to non-existing database failed, so it\'s ok'."\n");
- }
-else {
- $dlo = @dbx_connect($module, $host, $nonexisting_database, $username, $password);
- if ($dlo==0) {
- print('connect to non-existing database failed, so it\'s ok'."\n");
- }
- else {
- print_r($dlo);
- dbx_close($dlo);
- }
- }
-// sqlite is a special case as it doesn't use user/password restrictions
-if ($module == DBX_SQLITE) {
- print('connect with false username/password combi failed, so it\'s ok'."\n");
- }
-else {
- $dlo = @dbx_connect($module, $host, $database, $nonexisting_username, $nonexisting_password);
- if ($dlo==0) {
- print('connect with false username/password combi failed, so it\'s ok'."\n");
- }
- else {
- print_r($dlo);
- dbx_close($dlo);
- }
- }
-
-$dlo = dbx_connect($module_name, $host, $database, $username, $password, DBX_PERSISTENT);
-if ($dlo!=0) {
- print('persistent connect using string ok'."\n");
- dbx_close($dlo);
- }
-$dlo = dbx_connect($module, $host, $database, $username, $password, DBX_PERSISTENT);
-if ($dlo!=0) {
- print('persistent connect using constant ok'."\n");
- dbx_close($dlo);
- }
-// sqlite is a special case as it will just create a db if it isn't found
-if ($module == DBX_SQLITE) {
- print('persistent connect to non-existing database failed, so it\'s ok'."\n");
- }
-else {
- $dlo = @dbx_connect($module, $host, $nonexisting_database, $username, $password, DBX_PERSISTENT);
- if ($dlo==0) {
- print('persistent connect to non-existing database failed, so it\'s ok'."\n");
- }
- else {
- print_r($dlo);
- dbx_close($dlo);
- }
- }
-// sqlite is a special case as it doesn't use user/password restrictions
-if ($module == DBX_SQLITE) {
- print('persistent connect with false username/password combi failed, so it\'s ok'."\n");
- }
-else {
- $dlo = @dbx_connect($module, $host, $database, $nonexisting_username, $nonexisting_password, DBX_PERSISTENT);
- if ($dlo==0) {
- print('persistent connect with false username/password combi failed, so it\'s ok'."\n");
- }
- else {
- print_r($dlo);
- dbx_close($dlo);
- }
- }
-
-$dlo = @dbx_connect($module, $host, $database, $username, $password, DBX_PERSISTENT, "12many");
-if ($dlo==0) {
- print('too many parameters: connect failure works ok'."\n");
- }
-else {
- print_r($dlo);
- dbx_close($dlo);
- }
-$dlo = @dbx_connect($module, $host, $database, $username);
-if ($dlo==0) {
- print('too few parameters: connect failure works ok'."\n");
- }
-else {
- print_r($dlo);
- dbx_close($dlo);
- }
-$dlo1 = dbx_connect($module, $host, $database, $username, $password);
-$dlo2 = dbx_connect($module, $host, $database, $username, $password);
-if ($dlo1!=0 && $dlo2!=0) {
- print('multiple connects ok'."\n");
- dbx_close($dlo1);
- dbx_close($dlo2);
- }
-// sqlite is a special case as it will just create a db if it isn't found
-if ($module == DBX_SQLITE) {
- print('multiple connects (2nd fails on database-name) ok'."\n");
- }
-else {
- $dlo1 = dbx_connect($module, $host, $database, $username, $password);
- $dlo2 = @dbx_connect($module, $host, $nonexisting_database, $username, $password);
- if ($dlo1!=0 && $dlo2==0) {
- print('multiple connects (2nd fails on database-name) ok'."\n");
- dbx_close($dlo1);
- }
- }
-?>
---EXPECT--
-connect using string ok
-connect using constant ok
-connect to non-existing database failed, so it's ok
-connect with false username/password combi failed, so it's ok
-persistent connect using string ok
-persistent connect using constant ok
-persistent connect to non-existing database failed, so it's ok
-persistent connect with false username/password combi failed, so it's ok
-too many parameters: connect failure works ok
-too few parameters: connect failure works ok
-multiple connects ok
-multiple connects (2nd fails on database-name) ok \ No newline at end of file
diff --git a/ext/dbx/tests/004.phpt b/ext/dbx/tests/004.phpt
deleted file mode 100644
index 233bf49be..000000000
--- a/ext/dbx/tests/004.phpt
+++ /dev/null
@@ -1,35 +0,0 @@
---TEST--
-dbx_close
---SKIPIF--
-<?php
-include_once("skipif.inc");
-?>
---FILE--
-<?php
-include_once("dbx_test.p");
-$dlo = dbx_connect($module, $host, $database, $username, $password);
-if ($module===DBX_OCI8 || $module===DBX_SQLITE) { // close for oci8 and sqlite always return NULL since it doesn't do anything
- print('close works ok'."\n");
- }
-else {
- if ($dlo!=0) {
- if (dbx_close($dlo)) {
- print('close works ok'."\n");
- }
- }
- }
-if (!@dbx_close($dlo)) {
- print('close failure works ok'."\n");
- }
-if (!@dbx_close($dlo, "12many")) {
- print('too many parameters: close failure works ok'."\n");
- }
-if (!@dbx_close()) {
- print('too few parameters: close failure works ok'."\n");
- }
-?>
---EXPECT--
-close works ok
-close failure works ok
-too many parameters: close failure works ok
-too few parameters: close failure works ok \ No newline at end of file
diff --git a/ext/dbx/tests/005.phpt b/ext/dbx/tests/005.phpt
deleted file mode 100644
index 354d7ec56..000000000
--- a/ext/dbx/tests/005.phpt
+++ /dev/null
@@ -1,113 +0,0 @@
---TEST--
-dbx_query
---SKIPIF--
-<?php
-include_once("skipif.inc");
-?>
---INI--
-magic_quotes_runtime=0
---FILE--
-<?php
-include_once("dbx_test.p");
-$sql_statement = "select * from tbl order by id";
-$invalid_sql_statement = "invalid select * from tbl";
-$sql_select_statement = "select * from tbl where id=999999 and parentid=999999";
-$sql_insert_statement = "insert into tbl (id, parentid, description) values (999999, 999999, 'temporary_record')";
-$sql_update_statement = "update tbl set field2 = 'bla''bla\"bla' where id=999999 and parentid=999999";
-$sql_delete_statement = "delete from tbl where id=999999 and parentid=999999";
-$dlo = dbx_connect($module, $host, $database, $username, $password);
-if (!$dlo) {
- print('this won\'t work'."\n");
- }
-else {
- // especially for sybase I need to set the textsize to >64 k, as one of the test-fields
- // requires this (shouldn't this be a php.ini-entry??)
- if ($connection === DBX_SYBASECT) @dbx_query($dlo, "set textsize 100000");
- // select query
- if ($dro=dbx_query($dlo, $sql_statement)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description'].".".$dro->data[$i]['field1'].".".strlen($dro->data[$i]['field2'])."\n");
- }
- $dro->data[0]['id']='changed_value';
- print($dro->data[0][0]."\n");
- }
- // insert query
- if (dbx_query($dlo, $sql_insert_statement)) {
- print('insert-query: dbx_query works ok'."\n");
- if ($dro=dbx_query($dlo, $sql_select_statement)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description'].".".strlen($dro->data[$i]['field2'])."\n");
- }
- }
- }
- // update query
- if (dbx_query($dlo, $sql_update_statement)) {
- print('update-query: dbx_query works ok'."\n");
- if ($dro=dbx_query($dlo, $sql_select_statement)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description'].".".strlen($dro->data[$i]['field2'])."\n");
- }
- }
- }
- // delete query
- if (dbx_query($dlo, $sql_delete_statement)) {
- print('delete-query: dbx_query works ok'."\n");
- if ($dro=dbx_query($dlo, $sql_select_statement)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description'].".".strlen($dro->data[$i]['field2'])."\n");
- }
- }
- }
- // DBX_RESULT_UNBUFFERED
- if ($dro=dbx_query($dlo, $sql_statement, DBX_RESULT_UNBUFFERED)) {
- $properties = get_object_vars($dro);
- if (array_key_exists('data', $properties)) {
- print("data property not expected with DBX_RESULT_UNBUFFERED flag.");
- }
- }
- // colnames_case flags
- if ($dro=dbx_query($dlo, $sql_statement, DBX_COLNAMES_LOWERCASE)) {
- print('column name lowercased: ');
- print($dro->info["name"][0].".".$dro->data[0]['id'].".".$dro->data[0]['description']."\n");
- }
- if ($dro=dbx_query($dlo, $sql_statement, DBX_COLNAMES_UPPERCASE)) {
- print('column name uppercased: ');
- print($dro->info["name"][0].".".$dro->data[0]['ID'].".".$dro->data[0]['DESCRIPTION']."\n");
- }
-
- // generate errors
- if (!@dbx_query(0, $sql_statement)) {
- print('wrong dbx_link_object: query failure works ok'."\n");
- }
- if (!@dbx_query($dlo, $invalid_sql_statement)) {
- print('wrong sql-statement: query failure works ok'."\n");
- }
- if (!@dbx_query($dlo, $sql_statement, DBX_RESULT_INDEX, "12many")) {
- print('too many parameters: query failure works ok'."\n");
- }
- if (!@dbx_query($dlo)) {
- print('too few parameters: query failure works ok'."\n");
- }
- dbx_close($dlo);
- }
-?>
---EXPECT--
-1.root.empty fields.0
-10.abc.field2 contains single quote.3
-20.cba.field2 contains double quote.3
-30.bac.field2 contains >4k text.4591
-40.100.field2 contains >64k text.70051
-50.20.empty fields.0
-60.20.empty fields.0
-changed_value
-insert-query: dbx_query works ok
-999999.temporary_record.0
-update-query: dbx_query works ok
-999999.temporary_record.11
-delete-query: dbx_query works ok
-column name lowercased: id.1.root
-column name uppercased: ID.1.root
-wrong dbx_link_object: query failure works ok
-wrong sql-statement: query failure works ok
-too many parameters: query failure works ok
-too few parameters: query failure works ok
diff --git a/ext/dbx/tests/006.phpt b/ext/dbx/tests/006.phpt
deleted file mode 100644
index e5aa925a9..000000000
--- a/ext/dbx/tests/006.phpt
+++ /dev/null
@@ -1,57 +0,0 @@
---TEST--
-dbx_error
---SKIPIF--
-<?php
-include_once("skipif.inc");
-?>
---FILE--
-<?php
-include_once("dbx_test.p");
-if ($module==DBX_ODBC || $module==DBX_OCI8) {
- // ODBC module doesn't have an error-message-function (yet?)
- // OCI8 module needs the query-handle instead of the db-handle (now what?)
- print('query generated an error: dbx_error works ok'."\n");
- print('query is valid: dbx_error works ok'."\n");
- print('wrong dbx_link_object: dbx_error failure works ok'."\n");
- print('too many parameters: dbx_error failure works ok'."\n");
- print('too few parameters: dbx_error failure works ok'."\n");
- }
-else {
-
-$sql_statement = "select * from tbl";
-$invalid_sql_statement = "invalid select * from tbl";
-$dlo = dbx_connect($module, $host, $database, $username, $password);
-if (!$dlo) {
- print('this won\'t work'."\n");
- }
-else {
- @dbx_query($dlo, "select nonexistingfield from tbl");
- if ((($module==DBX_MSSQL || $module==DBX_SYBASECT) && dbx_error($dlo)!="Changed database context to '".$database."'.".($module==DBX_SYBASECT?"\n":""))
- || strlen(dbx_error($dlo))) {
- print('query generated an error: dbx_error works ok'."\n");
- }
- dbx_query($dlo, "select description from tbl");
- if (!strlen(dbx_error($dlo)) || (($module==DBX_MSSQL || $module==DBX_SYBASECT) && dbx_error($dlo)=="Changed database context to '".$database."'.".($module==DBX_SYBASECT?"\n":""))) {
- print('query is valid: dbx_error works ok'."\n");
- }
- else print(dbx_error($dlo));
- if (!@dbx_error(0)) {
- print('wrong dbx_link_object: dbx_error failure works ok'."\n");
- }
- if (!@dbx_error($dlo, "12many")) {
- print('too many parameters: dbx_error failure works ok'."\n");
- }
- if (!@dbx_error()) {
- print('too few parameters: dbx_error failure works ok'."\n");
- }
- dbx_close($dlo);
- }
-
- }
-?>
---EXPECT--
-query generated an error: dbx_error works ok
-query is valid: dbx_error works ok
-wrong dbx_link_object: dbx_error failure works ok
-too many parameters: dbx_error failure works ok
-too few parameters: dbx_error failure works ok
diff --git a/ext/dbx/tests/007.phpt b/ext/dbx/tests/007.phpt
deleted file mode 100644
index cc049782f..000000000
--- a/ext/dbx/tests/007.phpt
+++ /dev/null
@@ -1,74 +0,0 @@
---TEST--
-dbx_sort
---SKIPIF--
-<?php
-include_once("skipif.inc");
-?>
---FILE--
-<?php
-include_once("dbx_test.p");
-$sql_statement = "select id, description from tbl where parentid=1 order by id";
-$compare_function = "cmp";
-$invalid_compare_function = "invalid_cmp";
-$nonexisting_compare_function = "nonexisting_cmp";
-$dlo = dbx_connect($module, $host, $database, $username, $password);
-function invalid_cmp() {
- return "blabla";
- }
-function cmp($a, $b) {
- $rv = dbx_compare($a, $b, "description");
- if (!$rv) $rv = dbx_compare($a, $b, "id");
- return $rv;
- }
-if (!$dlo) {
- print('this won\'t work'."\n");
- }
-else {
- $dro = dbx_query($dlo, $sql_statement);
- if (!$dro) {
- print('this won\'t work'."\n");
- }
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n");
- }
- if (dbx_sort($dro, $compare_function)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n");
- }
- }
- if (!@dbx_sort(0, $compare_function)) {
- print('wrong dbx_result_object: dbx_sort failure works ok'."\n");
- }
- if (dbx_sort($dro, $nonexisting_compare_function)) {
- print('nonexisting compare function: dbx_sort will NOT complain'."\n");
- }
- if (dbx_sort($dro, $invalid_compare_function)) {
- print('invalid compare function: dbx_sort will NOT complain'."\n");
- }
- if (!@dbx_sort($dro, $compare_function, "12many")) {
- print('too many parameters: dbx_sort failure works ok'."\n");
- }
- if (!@dbx_sort($dro)) {
- print('too few parameters: dbx_sort failure works ok'."\n");
- }
- dbx_close($dlo);
- }
-?>
---EXPECT--
-10.abc
-20.cba
-30.bac
-40.100
-50.20
-60.20
-40.100
-50.20
-60.20
-10.abc
-30.bac
-20.cba
-wrong dbx_result_object: dbx_sort failure works ok
-nonexisting compare function: dbx_sort will NOT complain
-invalid compare function: dbx_sort will NOT complain
-too many parameters: dbx_sort failure works ok
-too few parameters: dbx_sort failure works ok \ No newline at end of file
diff --git a/ext/dbx/tests/008.phpt b/ext/dbx/tests/008.phpt
deleted file mode 100644
index 92533bba5..000000000
--- a/ext/dbx/tests/008.phpt
+++ /dev/null
@@ -1,146 +0,0 @@
---TEST--
-dbx_compare
---SKIPIF--
-<?php
-include_once("skipif.inc");
-?>
---FILE--
-<?php
-include_once("dbx_test.p");
-$sql_statement = "select id, description from tbl where parentid=1 order by id";
-$compare_function_1 = "cmp_description_id";
-$compare_function_2 = "cmp_description_desc_id";
-$compare_function_3 = "cmp_description_id_desc";
-$compare_function_4 = "cmp_description_desc_id_desc";
-$compare_function_5 = "cmp_description_txt_id";
-$compare_function_6 = "cmp_description_number_id";
-$dlo = dbx_connect($module, $host, $database, $username, $password);
-function cmp_description_id($a, $b) {
- $rv = dbx_compare($a, $b, "description");
- if (!$rv) $rv = dbx_compare($a, $b, "id");
- return $rv;
- }
-function cmp_description_desc_id($a, $b) {
- $rv = dbx_compare($a, $b, "description", DBX_CMP_DESC);
- if (!$rv) $rv = dbx_compare($a, $b, "id");
- return $rv;
- }
-function cmp_description_id_desc($a, $b) {
- $rv = dbx_compare($a, $b, "description");
- if (!$rv) $rv = dbx_compare($a, $b, "id", DBX_CMP_DESC);
- return $rv;
- }
-function cmp_description_desc_id_desc($a, $b) {
- $rv = dbx_compare($a, $b, "description", DBX_CMP_DESC);
- if (!$rv) $rv = dbx_compare($a, $b, "id", DBX_CMP_DESC);
- return $rv;
- }
-function cmp_description_txt_id($a, $b) {
- $rv = dbx_compare($a, $b, "description", DBX_CMP_TEXT);
- if (!$rv) $rv = dbx_compare($a, $b, "id");
- return $rv;
- }
-function cmp_description_number_id($a, $b) {
- $rv = dbx_compare($a, $b, "description", DBX_CMP_NUMBER);
- if (!$rv) $rv = dbx_compare($a, $b, "id");
- return $rv;
- }
-if (!$dlo) {
- print('this won\'t work'."\n");
- }
-else {
- $dro = dbx_query($dlo, $sql_statement);
- if (!$dro) {
- print('this won\'t work'."\n");
- }
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n");
- }
- if (dbx_sort($dro, $compare_function_1)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n");
- }
- }
- if (dbx_sort($dro, $compare_function_2)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n");
- }
- }
- if (dbx_sort($dro, $compare_function_3)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n");
- }
- }
- if (dbx_sort($dro, $compare_function_4)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n");
- }
- }
- if (dbx_sort($dro, $compare_function_5)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n");
- }
- }
- if (dbx_sort($dro, $compare_function_6)) {
- for ($i=0; $i<$dro->rows; ++$i) {
- print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n");
- }
- }
- if (!@dbx_compare($a, $b, "fieldname")) {
- print('wrong parameters: dbx_compare failure works ok'."\n");
- }
- if (!@dbx_compare($a, $b, "fieldname", DBX_CMP_NATIVE, "12many")) {
- print('too many parameters: dbx_compare failure works ok'."\n");
- }
- if (!@dbx_compare($a, $b)) {
- print('too few parameters: dbx_compare failure works ok'."\n");
- }
- dbx_close($dlo);
- }
-?>
---EXPECT--
-10.abc
-20.cba
-30.bac
-40.100
-50.20
-60.20
-40.100
-50.20
-60.20
-10.abc
-30.bac
-20.cba
-20.cba
-30.bac
-10.abc
-50.20
-60.20
-40.100
-40.100
-60.20
-50.20
-10.abc
-30.bac
-20.cba
-20.cba
-30.bac
-10.abc
-60.20
-50.20
-40.100
-40.100
-50.20
-60.20
-10.abc
-30.bac
-20.cba
-10.0
-20.0
-30.0
-50.20
-60.20
-40.100
-wrong parameters: dbx_compare failure works ok
-too many parameters: dbx_compare failure works ok
-too few parameters: dbx_compare failure works ok \ No newline at end of file
diff --git a/ext/dbx/tests/009.phpt b/ext/dbx/tests/009.phpt
deleted file mode 100644
index f363de46b..000000000
--- a/ext/dbx/tests/009.phpt
+++ /dev/null
@@ -1,65 +0,0 @@
---TEST--
-dbx_escape_string
---SKIPIF--
-<?php
-include_once("skipif.inc");
-?>
---INI--
-magic_quotes_runtime=0
---FILE--
-<?php
-include_once("dbx_test.p");
-$sql_select_statement = "select * from tbl where id=999999 and parentid=999999";
-$sql_insert_statement = "insert into tbl (id, parentid, description) values (999999, 999999, 'temporary_record')";
-$sql_update_statement = "update tbl set field2 = '%s' where id=999999 and parentid=999999";
-$sql_delete_statement = "delete from tbl where id=999999 and parentid=999999";
-$dlo = dbx_connect($module, $host, $database, $username, $password);
-if (!$dlo) {
- print('this won\'t work'."\n");
- }
-else {
- // insert query
- dbx_query($dlo, $sql_insert_statement);
- // dbx_escape_string should make sure that an escaped string
- // is neatly passed through to the database, and on readout
- // it should be returned exactly the same as it went in
- function test_dbx_escape_string($txt)
- {
- $sql = sprintf($GLOBALS['sql_update_statement'], dbx_escape_string($GLOBALS['dlo'], $txt));
- if (dbx_query($GLOBALS['dlo'], $sql)) {
- if ($dro=dbx_query($GLOBALS['dlo'], $GLOBALS['sql_select_statement'])) {
- print(($dro->data[0]['field2']===$txt?'ok':'fail ('.$dro->data[0]['field2'].')').': '.$txt."\n");
- }
- }
- }
- test_dbx_escape_string('no special characters');
- test_dbx_escape_string('quote \' string');
- test_dbx_escape_string('doublequote " string');
- test_dbx_escape_string('backslash \\ string');
- test_dbx_escape_string('backslash and quote \\ \' string');
- test_dbx_escape_string('ampersand & string');
- // delete query
- dbx_query($dlo, $sql_delete_statement);
- // generate errors
- if (!@dbx_escape_string(0, "any_text")) {
- print('wrong dbx_link_object: escape_string failure works ok'."\n");
- }
- if (!@dbx_escape_string($dlo, "any_text", "12many")) {
- print('too many parameters: escape_string failure works ok'."\n");
- }
- if (!@dbx_escape_string($dlo)) {
- print('too few parameters: escape_string failure works ok'."\n");
- }
- dbx_close($dlo);
- }
-?>
---EXPECT--
-ok: no special characters
-ok: quote ' string
-ok: doublequote " string
-ok: backslash \ string
-ok: backslash and quote \ ' string
-ok: ampersand & string
-wrong dbx_link_object: escape_string failure works ok
-too many parameters: escape_string failure works ok
-too few parameters: escape_string failure works ok
diff --git a/ext/dbx/tests/010.phpt b/ext/dbx/tests/010.phpt
deleted file mode 100644
index 66f423de2..000000000
--- a/ext/dbx/tests/010.phpt
+++ /dev/null
@@ -1,52 +0,0 @@
---TEST--
-dbx_fetch_row
---SKIPIF--
-<?php
-include_once("skipif.inc");
-?>
---INI--
-magic_quotes_runtime=0
---FILE--
-<?php
-include_once("dbx_test.p");
-$sql_statement = "select * from tbl order by id";
-
-$dlo = dbx_connect($module, $host, $database, $username, $password);
-if (!$dlo) {
- print('this won\'t work'."\n");
- }
-else {
- // especially for sybase I need to set the textsize to >64 k, as one of the test-fields
- // requires this (shouldn't this be a php.ini-entry??)
- if ($connection === DBX_SYBASECT) @dbx_query($dlo, "set textsize 100000");
- // select query
- if ($dro=dbx_query($dlo, $sql_statement, DBX_RESULT_UNBUFFERED)) {
- while ($row = dbx_fetch_row($dro)) {
- print($dro->rows.".".$row['id'].".".$row['description'].".".$row['field1'].".".strlen($row['field2'])."\n");
- }
- }
- // generate errors
- $invalid_result_object = 'invalid';
- if (!@dbx_fetch_row($invalid_result_object)) {
- print('wrong dbx_result_object: fetch_row failure works ok'."\n");
- }
- if (!@dbx_fetch_row($dro, "12many")) {
- print('too many parameters: fetch_row failure works ok'."\n");
- }
- if (!@dbx_fetch_row()) {
- print('too few parameters: fetch_row failure works ok'."\n");
- }
- dbx_close($dlo);
- }
-?>
---EXPECT--
-1.1.root.empty fields.0
-2.10.abc.field2 contains single quote.3
-3.20.cba.field2 contains double quote.3
-4.30.bac.field2 contains >4k text.4591
-5.40.100.field2 contains >64k text.70051
-6.50.20.empty fields.0
-7.60.20.empty fields.0
-wrong dbx_result_object: fetch_row failure works ok
-too many parameters: fetch_row failure works ok
-too few parameters: fetch_row failure works ok
diff --git a/ext/dbx/tests/dbx_test.p b/ext/dbx/tests/dbx_test.p
deleted file mode 100644
index 5c98ca6dd..000000000
--- a/ext/dbx/tests/dbx_test.p
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-// set the $connection to match your test-database setup
-// (possibly change the rest of the settings too)
-// e.g. $connection = DBX_MYSQL;
-$connection = NULL;
-switch ($connection) {
- case DBX_MYSQL:
- $module=DBX_MYSQL;
- $host="";
- $database="dbx_test";
- $username="dbx_testuser";
- $password="dbx_testpassword";
- $module_name="mysql";
- break;
- case DBX_MSSQL:
- $module=DBX_MSSQL;
- $host="HOLLY";
- $database="dbx_test";
- $username="";
- $password="";
- $module_name="mssql";
- break;
- case DBX_ODBC:
- $module=DBX_ODBC;
- $host="localhost";
- $database="dbx_test_mysql"; // "dbx_test_access";
- $username="dbx_testuser";
- $password="dbx_testpassword";
- $module_name="odbc";
- break;
- case DBX_PGSQL:
- $module=DBX_PGSQL;
- $host="";
- $database="dbx_test";
- $username="dbx_testuser";
- $password="dbx_testpassword";
- $module_name="pgsql";
- break;
- case DBX_FBSQL:
- $module=DBX_FBSQL;
- $host="";
- $database="dbx_test";
- $username="dbx_testuser";
- $password="dbx_testpassword";
- $module_name="fbsql";
- break;
- case DBX_OCI8:
- $module=DBX_OCI8;
- $host="";
- $database="dbx_test";
- $username="dbx_testuser";
- $password="dbx_testpassword";
- $module_name="oci8";
- break;
- case DBX_SYBASECT:
- $module=DBX_SYBASECT;
- $host="threesyb";
- $database="dbx_test";
- $username="dbx_testuser";
- $password="dbx_testpassword";
- $module_name="sybase_ct";
- break;
- case DBX_SQLITE:
- $module=DBX_SQLITE;
- $host="";
- $database="dbx_test.sqlite.db";
- $username="";
- $password="";
- $module_name="sqlite";
- break;
- }
-
-?> \ No newline at end of file
diff --git a/ext/dbx/tests/dbx_test.pgsql.script b/ext/dbx/tests/dbx_test.pgsql.script
deleted file mode 100644
index 316349df9..000000000
--- a/ext/dbx/tests/dbx_test.pgsql.script
+++ /dev/null
@@ -1,37 +0,0 @@
-create database dbx_test;
-\cdbx_test
-
-create table tbl (
- id int NOT NULL default 0,
- parentid int NOT NULL default 0,
- description varchar(255) NULL,
- field1 text NULL,
- field2 text NULL,
- field3 text NULL,
- field4 text NULL,
- field5 text NULL,
- creation_date int8 NULL,
- PRIMARY KEY (id)
-);
-
-create index parentid on tbl (parentid);
-create index description on tbl (description);
-create index creation_date on tbl (creation_date);
-
-insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values
- (1, 0, 'root', 'empty fields', '', '', '', '', 20010605110724 );
-insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values
- (10, 1, 'abc', 'field2 contains single quote', 'x''x', '', '', '', 20010605110724);
-insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values
- (20, 1, 'cba', 'field2 contains double quote', 'x"x', '', '', '', 20010605110724);
-insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values
- (30, 1, 'bac', 'field2 contains >4k text', 'asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl', '', '', '', 20010605110724);
-insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values
- (40, 1, '100', 'field2 contains >64k text', 'asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl', '', '', '', 20010605110724);
-insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values
- (50, 1, '20', 'empty fields', '', '', '', '', 20010605110724);
-insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values
- (60, 1, '20', 'empty fields', '', '', '', '', 20010605110724);
-
-create user dbx_testuser with password 'dbx_testpassword';
-grant SELECT,INSERT,UPDATE,DELETE on tbl to dbx_testuser;
diff --git a/ext/dbx/tests/dbx_test.script b/ext/dbx/tests/dbx_test.script
deleted file mode 100644
index 1bad104fb..000000000
--- a/ext/dbx/tests/dbx_test.script
+++ /dev/null
@@ -1,38 +0,0 @@
-
-create database if not exists dbx_test;
-use dbx_test;
-
-grant SELECT,INSERT,UPDATE,DELETE on dbx_test.* to dbx_testuser@localhost identified by 'dbx_testpassword';
-
-# info tables
-
-drop table if exists tbl;
-create table tbl (
- id int(10) NOT NULL default 0,
- parentid int(10) NOT NULL default 0,
- description varchar(255) NULL,
- field1 mediumtext NULL,
- field2 mediumtext NULL,
- field3 mediumtext NULL,
- field4 mediumtext NULL,
- field5 mediumtext NULL,
- creation_date timestamp NULL,
- PRIMARY KEY (id),
- KEY parentid (parentid),
- KEY description (description),
- KEY creation_date (creation_date)
- );
-
-insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values
- (1, 0, 'root', 'empty fields', '', '', '', '', 20010605110724),
- (10, 1, 'abc', 'field2 contains single quote', 'x''x', '', '', '', 20010605110724),
- (20, 1, 'cba', 'field2 contains double quote', 'x"x', '', '', '', 20010605110724),
- (30, 1, 'bac', 'field2 contains >4k text',
- 'asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl',
- '', '', '', 20010605110724),
- (40, 1, '100', 'field2 contains >64k text',
- 'asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl',
- '', '', '', 20010605110724),
- (50, 1, '20', 'empty fields', '', '', '', '', 20010605110724),
- (60, 1, '20', 'empty fields', '', '', '', '', 20010605110724)
- ; \ No newline at end of file
diff --git a/ext/dbx/tests/skipif.inc b/ext/dbx/tests/skipif.inc
deleted file mode 100644
index 1dffdc6d2..000000000
--- a/ext/dbx/tests/skipif.inc
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
- if (!extension_loaded("dbx")) die("skip");
- include_once("dbx_test.p");
- if ($connection===NULL) die("skip connection not specified");
- die("info using $module_name");
-?> \ No newline at end of file
diff --git a/ext/dio/config.m4 b/ext/dio/config.m4
deleted file mode 100644
index a8bacba0e..000000000
--- a/ext/dio/config.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-dnl
-dnl $Id: config.m4,v 1.3 2002/03/12 16:16:02 sas Exp $
-dnl
-
-PHP_ARG_ENABLE(dio, whether to enable direct I/O support,
-[ --enable-dio Enable direct I/O support])
-
-if test "$PHP_DIO" != "no"; then
- PHP_NEW_EXTENSION(dio, dio.c, $ext_shared)
-fi
diff --git a/ext/dio/config.w32 b/ext/dio/config.w32
deleted file mode 100644
index 9a89d1b29..000000000
--- a/ext/dio/config.w32
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id: config.w32,v 1.1 2004/06/09 19:27:36 fmk Exp $
-// vim:ft=javascript
-
-ARG_ENABLE("dio", "Enable the direct I/O support", "no");
-
-if (PHP_DIO != "no") {
- EXTENSION("dio", "dio.c");
- AC_DEFINE('HAVE_DIO', 1, 'dio support');
-}
diff --git a/ext/dio/dio.c b/ext/dio/dio.c
deleted file mode 100644
index 0435957f0..000000000
--- a/ext/dio/dio.c
+++ /dev/null
@@ -1,654 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Sterling Hughes <sterling@php.net> |
- +----------------------------------------------------------------------+
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_dio.h"
-
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <fcntl.h>
-#ifndef PHP_WIN32
-#include <termios.h>
-#endif
-
-/* e.g. IRIX does not have CRTSCTS */
-#ifndef CRTSCTS
-# ifdef CNEW_RTSCTS
-# define CRTSCTS CNEW_RTSCTS
-# else
-# define CRTSCTS 0
-# endif /* CNEW_RTSCTS */
-#endif /* !CRTSCTS */
-
-#define le_fd_name "Direct I/O File Descriptor"
-static int le_fd;
-
-function_entry dio_functions[] = {
- PHP_FE(dio_open, NULL)
-#ifndef PHP_WIN32
- PHP_FE(dio_truncate, NULL)
-#endif
- PHP_FE(dio_stat, NULL)
- PHP_FE(dio_seek, NULL)
-#ifndef PHP_WIN32
- PHP_FE(dio_fcntl, NULL)
-#endif
- PHP_FE(dio_read, NULL)
- PHP_FE(dio_write, NULL)
- PHP_FE(dio_close, NULL)
-#ifndef PHP_WIN32
- PHP_FE(dio_tcsetattr, NULL)
-#endif
- {NULL, NULL, NULL}
-};
-
-zend_module_entry dio_module_entry = {
- STANDARD_MODULE_HEADER,
- "dio",
- dio_functions,
- PHP_MINIT(dio),
- NULL,
- NULL,
- NULL,
- PHP_MINFO(dio),
- "0.1",
- STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_DIO
-ZEND_GET_MODULE(dio)
-#endif
-
-static void _dio_close_fd(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- php_fd_t *f = (php_fd_t *) rsrc->ptr;
- if (f) {
- close(f->fd);
- free(f);
- }
-}
-
-#define RDIOC(c) REGISTER_LONG_CONSTANT(#c, c, CONST_CS | CONST_PERSISTENT)
-#define DIO_UNDEF_CONST -1
-
-PHP_MINIT_FUNCTION(dio)
-{
- le_fd = zend_register_list_destructors_ex(_dio_close_fd, NULL, le_fd_name, module_number);
-
- RDIOC(O_RDONLY);
- RDIOC(O_WRONLY);
- RDIOC(O_RDWR);
- RDIOC(O_CREAT);
- RDIOC(O_EXCL);
- RDIOC(O_TRUNC);
- RDIOC(O_APPEND);
-#ifdef O_NONBLOCK
- RDIOC(O_NONBLOCK);
-#endif
-#ifdef O_NDELAY
- RDIOC(O_NDELAY);
-#endif
-#ifdef O_SYNC
- RDIOC(O_SYNC);
-#endif
-#ifdef O_ASYNC
- RDIOC(O_ASYNC);
-#endif
-#ifdef O_NOCTTY
- RDIOC(O_NOCTTY);
-#endif
-#ifndef PHP_WIN32
- RDIOC(S_IRWXU);
- RDIOC(S_IRUSR);
- RDIOC(S_IWUSR);
- RDIOC(S_IXUSR);
- RDIOC(S_IRWXG);
- RDIOC(S_IRGRP);
- RDIOC(S_IWGRP);
- RDIOC(S_IXGRP);
- RDIOC(S_IRWXO);
- RDIOC(S_IROTH);
- RDIOC(S_IWOTH);
- RDIOC(S_IXOTH);
- RDIOC(F_DUPFD);
- RDIOC(F_GETFD);
- RDIOC(F_GETFL);
- RDIOC(F_SETFL);
- RDIOC(F_GETLK);
- RDIOC(F_SETLK);
- RDIOC(F_SETLKW);
- RDIOC(F_SETOWN);
- RDIOC(F_GETOWN);
- RDIOC(F_UNLCK);
- RDIOC(F_RDLCK);
- RDIOC(F_WRLCK);
-#endif
-
- return SUCCESS;
-}
-
-PHP_MINFO_FUNCTION(dio)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "dio support", "enabled");
- php_info_print_table_end();
-}
-
-static int new_php_fd(php_fd_t **f, int fd)
-{
- if (!(*f = malloc(sizeof(php_fd_t)))) {
- return 0;
- }
- (*f)->fd = fd;
- return 1;
-}
-
-/* {{{ proto resource dio_open(string filename, int flags[, int mode])
- Open a new filename with specified permissions of flags and creation permissions of mode */
-PHP_FUNCTION(dio_open)
-{
- php_fd_t *f;
- char *file_name;
- int file_name_length;
- long flags;
- long mode = 0;
- int fd;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", &file_name, &file_name_length, &flags, &mode) == FAILURE) {
- return;
- }
-
- if (php_check_open_basedir(file_name TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(file_name, "wb+", CHECKUID_CHECK_MODE_PARAM))) {
- RETURN_FALSE;
- }
-
- if (ZEND_NUM_ARGS() == 3) {
- fd = open(file_name, flags, mode);
- } else {
- fd = open(file_name, flags);
- }
-
- if (fd == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open file %s with flags %ld and permissions %ld: %s", file_name, flags, mode, strerror(errno));
- RETURN_FALSE;
- }
-
-
- if (!new_php_fd(&f, fd)) {
- RETURN_FALSE;
- }
- ZEND_REGISTER_RESOURCE(return_value, f, le_fd);
-}
-/* }}} */
-
-/* {{{ proto string dio_read(resource fd[, int n])
- Read n bytes from fd and return them, if n is not specified, read 1k */
-PHP_FUNCTION(dio_read)
-{
- zval *r_fd;
- php_fd_t *f;
- char *data;
- long bytes = 1024;
- ssize_t res;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &r_fd, &bytes) == FAILURE) {
- return;
- }
-
- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-
- if (bytes <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
- RETURN_FALSE;
- }
-
- data = emalloc(bytes + 1);
- res = read(f->fd, data, bytes);
- if (res <= 0) {
- efree(data);
- RETURN_NULL();
- }
-
- data = erealloc(data, res + 1);
- data[res] = 0;
-
- RETURN_STRINGL(data, res, 0);
-}
-/* }}} */
-
-/* {{{ proto int dio_write(resource fd, string data[, int len])
- Write data to fd with optional truncation at length */
-PHP_FUNCTION(dio_write)
-{
- zval *r_fd;
- php_fd_t *f;
- char *data;
- int data_len;
- long trunc_len = 0;
- ssize_t res;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &r_fd, &data, &data_len, &trunc_len) == FAILURE) {
- return;
- }
-
- if (trunc_len < 0 || trunc_len > data_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater or equal to zero and less then the length of the specified string.");
- RETURN_FALSE;
- }
-
- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-
- res = write(f->fd, data, trunc_len ? trunc_len : data_len);
- if (res == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write data to file descriptor %d, %s", f->fd, strerror(errno));
- }
-
- RETURN_LONG(res);
-}
-/* }}} */
-
-#ifndef PHP_WIN32
-/* {{{ proto bool dio_truncate(resource fd, int offset)
- Truncate file descriptor fd to offset bytes */
-PHP_FUNCTION(dio_truncate)
-{
- zval *r_fd;
- php_fd_t *f;
- long offset;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &r_fd, &offset) == FAILURE) {
- return;
- }
-
- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-
- if (ftruncate(f->fd, offset) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %ld bytes: %s", f->fd, offset, strerror(errno));
- RETURN_FALSE;
- }
-
- RETURN_TRUE;
-}
-/* }}} */
-#endif
-
-#define ADD_FIELD(f, v) add_assoc_long_ex(return_value, (f), sizeof(f), v);
-
-/* {{{ proto array dio_stat(resource fd)
- Get stat information about the file descriptor fd */
-PHP_FUNCTION(dio_stat)
-{
- zval *r_fd;
- php_fd_t *f;
- struct stat s;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) {
- return;
- }
-
- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-
- if (fstat(f->fd, &s) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot stat %d: %s", f->fd, strerror(errno));
- RETURN_FALSE;
- }
-
- array_init(return_value);
- ADD_FIELD("device", s.st_dev);
- ADD_FIELD("inode", s.st_ino);
- ADD_FIELD("mode", s.st_mode);
- ADD_FIELD("nlink", s.st_nlink);
- ADD_FIELD("uid", s.st_uid);
- ADD_FIELD("gid", s.st_gid);
- ADD_FIELD("device_type", s.st_rdev);
- ADD_FIELD("size", s.st_size);
-#ifndef PHP_WIN32
- ADD_FIELD("block_size", s.st_blksize);
- ADD_FIELD("blocks", s.st_blocks);
-#endif
- ADD_FIELD("atime", s.st_atime);
- ADD_FIELD("mtime", s.st_mtime);
- ADD_FIELD("ctime", s.st_ctime);
-}
-/* }}} */
-
-/* {{{ proto int dio_seek(resource fd, int pos, int whence)
- Seek to pos on fd from whence */
-PHP_FUNCTION(dio_seek)
-{
- zval *r_fd;
- php_fd_t *f;
- long offset;
- long whence = SEEK_SET;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &r_fd, &offset, &whence) == FAILURE) {
- return;
- }
-
- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-
- RETURN_LONG(lseek(f->fd, offset, whence));
-}
-/* }}} */
-
-#ifndef PHP_WIN32
-/* {{{ proto mixed dio_fcntl(resource fd, int cmd[, mixed arg])
- Perform a c library fcntl on fd */
-PHP_FUNCTION(dio_fcntl)
-{
- zval *r_fd;
- zval *arg = NULL;
- php_fd_t *f;
- long cmd;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &r_fd, &cmd, &arg) == FAILURE) {
- return;
- }
-
- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-
- switch (cmd) {
- case F_SETLK:
- case F_SETLKW: {
- zval **element;
- struct flock lk = {0};
- HashTable *fh;
-
- if (!arg) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be array or int, none given");
- RETURN_FALSE;
- }
- if (Z_TYPE_P(arg) == IS_ARRAY) {
- fh = HASH_OF(arg);
- if (zend_hash_find(fh, "start", sizeof("start"), (void **) &element) == FAILURE) {
- lk.l_start = 0;
- } else {
- lk.l_start = Z_LVAL_PP(element);
- }
-
- if (zend_hash_find(fh, "length", sizeof("length"), (void **) &element) == FAILURE) {
- lk.l_len = 0;
- } else {
- lk.l_len = Z_LVAL_PP(element);
- }
-
- if (zend_hash_find(fh, "whence", sizeof("whence"), (void **) &element) == FAILURE) {
- lk.l_whence = 0;
- } else {
- lk.l_whence = Z_LVAL_PP(element);
- }
-
- if (zend_hash_find(fh, "type", sizeof("type"), (void **) &element) == FAILURE) {
- lk.l_type = 0;
- } else {
- lk.l_type = Z_LVAL_PP(element);
- }
- } else if (Z_TYPE_P(arg) == IS_LONG) {
- lk.l_start = 0;
- lk.l_len = 0;
- lk.l_whence = SEEK_SET;
- lk.l_type = Z_LVAL_P(arg);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be array or int, %s given", zend_zval_type_name(arg));
- RETURN_FALSE;
- }
-
- RETURN_LONG(fcntl(f->fd, cmd, &lk));
- break;
- }
- case F_GETLK: {
- struct flock lk = {0};
-
- fcntl(f->fd, cmd, &lk);
-
- array_init(return_value);
- add_assoc_long(return_value, "type", lk.l_type);
- add_assoc_long(return_value, "whence", lk.l_whence);
- add_assoc_long(return_value, "start", lk.l_start);
- add_assoc_long(return_value, "length", lk.l_len);
- add_assoc_long(return_value, "pid", lk.l_pid);
-
- break;
- }
- case F_DUPFD: {
- php_fd_t *new_f;
-
- if (!arg || Z_TYPE_P(arg) != IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be int");
- RETURN_FALSE;
- }
-
- if (!new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg)))) {
- RETURN_FALSE;
- }
- ZEND_REGISTER_RESOURCE(return_value, new_f, le_fd);
- break;
- }
- default:
- if (!arg || Z_TYPE_P(arg) != IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be int");
- RETURN_FALSE;
- }
-
- RETURN_LONG(fcntl(f->fd, cmd, Z_LVAL_P(arg)));
- }
-}
-/* }}} */
-#endif
-
-#ifndef PHP_WIN32
-/* {{{ proto mixed dio_tcsetattr(resource fd, array args )
- Perform a c library tcsetattr on fd */
-PHP_FUNCTION(dio_tcsetattr)
-{
- zval *r_fd;
- zval *arg = NULL;
- php_fd_t *f;
- struct termios newtio;
- int Baud_Rate, Data_Bits=8, Stop_Bits=1, Parity=0;
- long BAUD,DATABITS,STOPBITS,PARITYON,PARITY;
- HashTable *fh;
- zval **element;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &r_fd, &arg) == FAILURE) {
- return;
- }
-
- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-
- if (Z_TYPE_P(arg) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"tcsetattr, third argument should be an associative array");
- return;
- }
-
- fh = HASH_OF(arg);
-
- if (zend_hash_find(fh, "baud", sizeof("baud"), (void **) &element) == FAILURE) {
- Baud_Rate = 9600;
- } else {
- Baud_Rate = Z_LVAL_PP(element);
- }
-
- if (zend_hash_find(fh, "bits", sizeof("bits"), (void **) &element) == FAILURE) {
- Data_Bits = 8;
- } else {
- Data_Bits = Z_LVAL_PP(element);
- }
-
- if (zend_hash_find(fh, "stop", sizeof("stop"), (void **) &element) == FAILURE) {
- Stop_Bits = 1;
- } else {
- Stop_Bits = Z_LVAL_PP(element);
- }
-
- if (zend_hash_find(fh, "parity", sizeof("parity"), (void **) &element) == FAILURE) {
- Parity = 0;
- } else {
- Parity = Z_LVAL_PP(element);
- }
-
- /* assign to correct values... */
- switch (Baud_Rate) {
- case 38400:
- BAUD = B38400;
- break;
- case 19200:
- BAUD = B19200;
- break;
- case 9600:
- BAUD = B9600;
- break;
- case 4800:
- BAUD = B4800;
- break;
- case 2400:
- BAUD = B2400;
- break;
- case 1800:
- BAUD = B1800;
- break;
- case 1200:
- BAUD = B1200;
- break;
- case 600:
- BAUD = B600;
- break;
- case 300:
- BAUD = B300;
- break;
- case 200:
- BAUD = B200;
- break;
- case 150:
- BAUD = B150;
- break;
- case 134:
- BAUD = B134;
- break;
- case 110:
- BAUD = B110;
- break;
- case 75:
- BAUD = B75;
- break;
- case 50:
- BAUD = B50;
- break;
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid baud rate %d", Baud_Rate);
- RETURN_FALSE;
- }
- switch (Data_Bits) {
- case 8:
- DATABITS = CS8;
- break;
- case 7:
- DATABITS = CS7;
- break;
- case 6:
- DATABITS = CS6;
- break;
- case 5:
- DATABITS = CS5;
- break;
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data bits %d", Data_Bits);
- RETURN_FALSE;
- }
- switch (Stop_Bits) {
- case 1:
- STOPBITS = 0;
- break;
- case 2:
- STOPBITS = CSTOPB;
- break;
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop bits %d", Stop_Bits);
- RETURN_FALSE;
- }
-
- switch (Parity) {
- case 0:
- PARITYON = 0;
- PARITY = 0;
- break;
- case 1:
- PARITYON = PARENB;
- PARITY = PARODD;
- break;
- case 2:
- PARITYON = PARENB;
- PARITY = 0;
- break;
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity %d", Parity);
- RETURN_FALSE;
- }
-
- memset(&newtio, 0, sizeof(newtio));
- tcgetattr(f->fd, &newtio);
- newtio.c_cflag = BAUD | CRTSCTS | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD;
- newtio.c_iflag = IGNPAR;
- newtio.c_oflag = 0;
- newtio.c_lflag = 0; /* ICANON; */
- newtio.c_cc[VMIN] = 1;
- newtio.c_cc[VTIME] = 0;
- tcflush(f->fd, TCIFLUSH);
- tcsetattr(f->fd,TCSANOW,&newtio);
-
- RETURN_TRUE;
-}
-/* }}} */
-#endif
-
-/* {{{ proto void dio_close(resource fd)
- Close the file descriptor given by fd */
-PHP_FUNCTION(dio_close)
-{
- zval *r_fd;
- php_fd_t *f;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) {
- return;
- }
-
- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-
- zend_list_delete(Z_LVAL_P(r_fd));
-}
-/* }}} */
-
-/*
- * Local variables:
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- * vim600: fdm=marker
- * vim: sw=4 ts=4 noet
- */
diff --git a/ext/dio/package.xml b/ext/dio/package.xml
deleted file mode 100644
index 90a18fd79..000000000
--- a/ext/dio/package.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>dio</name>
- <summary>Direct I/O functions</summary>
- <maintainers>
- <maintainer>
- <user>sterling</user>
- <name>Sterling Hughes</name>
- <email>sterling@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-PHP supports the direct io functions as described in the
-Posix Standard (Section 6) for performing I/O functions at
-a lower level than the C-Language stream I/O functions
-(fopen(), fread(),..). The use of the DIO functions should
-be considered only when direct control of a device is needed.
-In all other cases, the standard filesystem functions are
-more than adequate.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support intallation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="dio.c"/>
- <file role="src" name="php_dio.h"/>
- <file role="test" name="tests/001.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="unix" /> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/dio/php_dio.h b/ext/dio/php_dio.h
deleted file mode 100644
index 25a47149e..000000000
--- a/ext/dio/php_dio.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- */
-
-#ifndef PHP_DIO_H
-#define PHP_DIO_H
-
-extern zend_module_entry dio_module_entry;
-#define phpext_dio_ptr &dio_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_DIO_API __declspec(dllexport)
-#else
-#define PHP_DIO_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-PHP_MINIT_FUNCTION(dio);
-PHP_MSHUTDOWN_FUNCTION(dio);
-PHP_RINIT_FUNCTION(dio);
-PHP_RSHUTDOWN_FUNCTION(dio);
-PHP_MINFO_FUNCTION(dio);
-
-PHP_FUNCTION(dio_open);
-PHP_FUNCTION(dio_truncate);
-PHP_FUNCTION(dio_stat);
-PHP_FUNCTION(dio_seek);
-PHP_FUNCTION(dio_read);
-PHP_FUNCTION(dio_write);
-PHP_FUNCTION(dio_fcntl);
-PHP_FUNCTION(dio_close);
-PHP_FUNCTION(dio_tcsetattr);
-
-typedef struct {
- int fd;
-} php_fd_t;
-
-#endif
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * indent-tabs-mode: t
- * End:
- */
diff --git a/ext/dio/tests/001.phpt b/ext/dio/tests/001.phpt
deleted file mode 100644
index 0d8a660ba..000000000
--- a/ext/dio/tests/001.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-Check for dio presence
---SKIPIF--
-<?php if (!extension_loaded("dio")) print "skip"; ?>
---FILE--
-<?php
-echo "dio extension is available";
-/*
- you can add regression tests for your extension here
-
- the output of your test code has to be equal to the
- text in the --EXPECT-- section below for the tests
- to pass, differences between the output and the
- expected text are interpreted as failure
-
- see php5/tests/README for further information on
- writing regression tests
-*/
-?>
---EXPECT--
-dio extension is available \ No newline at end of file
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index 530c99f24..129da423d 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: attr.c,v 1.15.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: attr.c,v 1.18 2005/08/03 14:06:58 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -225,7 +225,7 @@ int dom_attr_owner_element_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c
index 0429e7638..2410dbc57 100644
--- a/ext/dom/cdatasection.c
+++ b/ext/dom/cdatasection.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cdatasection.c,v 1.10 2004/05/31 12:50:28 rrichards Exp $ */
+/* $Id: cdatasection.c,v 1.11 2005/08/03 14:06:59 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c
index 8ebec1c06..afb46e302 100644
--- a/ext/dom/characterdata.c
+++ b/ext/dom/characterdata.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: characterdata.c,v 1.13.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: characterdata.c,v 1.15 2005/08/03 14:06:59 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/comment.c b/ext/dom/comment.c
index c3ba1cb97..884527be6 100644
--- a/ext/dom/comment.c
+++ b/ext/dom/comment.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: comment.c,v 1.10 2004/05/31 12:50:28 rrichards Exp $ */
+/* $Id: comment.c,v 1.11 2005/08/03 14:06:59 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/config.m4 b/ext/dom/config.m4
index 3be333ef6..74af8d037 100644
--- a/ext/dom/config.m4
+++ b/ext/dom/config.m4
@@ -1,13 +1,13 @@
dnl
-dnl $Id: config.m4,v 1.15.2.1 2005/04/27 13:13:37 sniper Exp $
+dnl $Id: config.m4,v 1.20 2005/05/29 23:16:40 sniper Exp $
dnl
PHP_ARG_ENABLE(dom, whether to enable DOM support,
-[ --disable-dom Disable new DOM support.], yes)
+[ --disable-dom Disable new DOM support], yes)
if test -z "$PHP_LIBXML_DIR"; then
PHP_ARG_WITH(libxml-dir, libxml2 install dir,
- [ --with-libxml-dir[=DIR] DOM: libxml2 install prefix.], no, no)
+ [ --with-libxml-dir[=DIR] DOM: libxml2 install prefix], no, no)
fi
if test "$PHP_DOM" != "no"; then
@@ -30,6 +30,8 @@ if test "$PHP_DOM" != "no"; then
typeinfo.c domerror.c domlocator.c namednodemap.c userdatahandler.c],
$ext_shared)
PHP_SUBST(DOM_SHARED_LIBADD)
+ PHP_INSTALL_HEADERS([ext/dom/xml_common.h])
+ PHP_ADD_EXTENSION_DEP(dom, libxml)
], [
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
])
diff --git a/ext/dom/document.c b/ext/dom/document.c
index aa81e16ce..42b6e3f1e 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: document.c,v 1.55.2.3 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: document.c,v 1.68.2.2 2005/09/08 10:39:30 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -113,7 +113,7 @@ int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object((xmlNodePtr) dtdptr, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
@@ -165,7 +165,7 @@ int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object(root, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
@@ -173,28 +173,6 @@ int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC)
/* }}} */
-
-/* {{{ actualEncoding string
-readonly=no
-URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-actualEncoding
-Since: DOM Level 3
-*/
-/* READ ONLY FOR NOW USING ENCODING PROPERTY
-int dom_document_actual_encoding_read(dom_object *obj, zval **retval TSRMLS_DC)
-{
- ALLOC_ZVAL(*retval);
- ZVAL_NULL(*retval);
- return SUCCESS;
-}
-
-int dom_document_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
-{
- return SUCCESS;
-}
-*/
-
-/* }}} */
-
/* {{{ encoding string
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-encoding
Since: DOM Level 3
@@ -614,6 +592,48 @@ int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_
}
/* }}} */
+/* {{{ recover boolean
+readonly=no
+*/
+int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC)
+{
+ dom_doc_props *doc_prop;
+
+ ALLOC_ZVAL(*retval);
+ if (obj->document) {
+ doc_prop = dom_get_doc_props(obj->document);
+ ZVAL_BOOL(*retval, doc_prop->recover);
+ } else {
+ ZVAL_FALSE(*retval);
+ }
+ return SUCCESS;
+}
+
+int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
+{
+ zval value_copy;
+ dom_doc_props *doc_prop;
+
+ if(newval->refcount > 1) {
+ value_copy = *newval;
+ zval_copy_ctor(&value_copy);
+ newval = &value_copy;
+ }
+ convert_to_boolean(newval);
+
+ if (obj->document) {
+ doc_prop = dom_get_doc_props(obj->document);
+ doc_prop->recover = Z_LVAL_P(newval);
+ }
+
+ if (newval == &value_copy) {
+ zval_dtor(newval);
+ }
+
+ return SUCCESS;
+}
+/* }}} */
+
/* {{{ substituteEntities boolean
readonly=no
@@ -1056,6 +1076,7 @@ PHP_FUNCTION(dom_document_import_node)
if (!retnodep) {
RETURN_FALSE;
}
+
}
DOM_RET_OBJ(rv, (xmlNodePtr) retnodep, &ret, intern);
@@ -1386,14 +1407,15 @@ 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 TSRMLS_DC) {
+static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int options TSRMLS_DC) {
xmlDocPtr ret;
xmlParserCtxtPtr ctxt = NULL;
dom_doc_props *doc_props;
dom_object *intern;
php_libxml_ref_obj *document = NULL;
- int validate, resolve_externals, keep_blanks, substitute_ent;
+ int validate, recover, resolve_externals, keep_blanks, substitute_ent;
int resolved_path_len;
+ int old_error_reporting;
char *directory=NULL, resolved_path[MAXPATHLEN];
if (id != NULL) {
@@ -1406,6 +1428,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source TSRMLS_DC)
resolve_externals = doc_props->resolveexternals;
keep_blanks = doc_props->preservewhitespace;
substitute_ent = doc_props->substituteentities;
+ recover = doc_props->recover;
if (document == NULL) {
efree(doc_props);
@@ -1413,7 +1436,9 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source TSRMLS_DC)
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);
@@ -1425,11 +1450,13 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source TSRMLS_DC)
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);
@@ -1455,11 +1482,6 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source TSRMLS_DC)
}
}
- ctxt->recovery = 0;
- ctxt->validate = validate;
- ctxt->loadsubset = (resolve_externals * XML_COMPLETE_ATTRS);
- ctxt->replaceEntities = substitute_ent;
-
ctxt->vctxt.error = php_libxml_ctx_error;
ctxt->vctxt.warning = php_libxml_ctx_warning;
@@ -1468,10 +1490,40 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source TSRMLS_DC)
ctxt->sax->warning = php_libxml_ctx_warning;
}
+#if LIBXML_VERSION >= 20600
+ if (validate && ! (options & XML_PARSE_DTDVALID)) {
+ options |= XML_PARSE_DTDVALID;
+ }
+ if (resolve_externals && ! (options & XML_PARSE_DTDATTR)) {
+ options |= XML_PARSE_DTDATTR;
+ }
+ if (substitute_ent && ! (options & XML_PARSE_NOENT)) {
+ options |= XML_PARSE_NOENT;
+ }
+ if (keep_blanks == 0 && ! (options & XML_PARSE_NOBLANKS)) {
+ options |= XML_PARSE_NOBLANKS;
+ }
+
+ xmlCtxtUseOptions(ctxt, options);
+#else
+ ctxt->validate = validate;
+ ctxt->loadsubset = (resolve_externals * XML_COMPLETE_ATTRS);
+ ctxt->replaceEntities = substitute_ent;
+#endif
+
+ ctxt->recovery = recover;
+ if (recover) {
+ old_error_reporting = EG(error_reporting);
+ EG(error_reporting) = old_error_reporting | E_WARNING;
+ }
+
xmlParseDocument(ctxt);
- if (ctxt->wellFormed) {
+ if (ctxt->wellFormed || recover) {
ret = ctxt->myDoc;
+ if (ctxt->recovery) {
+ EG(error_reporting) = old_error_reporting;
+ }
/* If loading from memory, set the base reference uri for the document */
if (ret->URL == NULL && ctxt->directory != NULL) {
ret->URL = xmlStrdup(ctxt->directory);
@@ -1496,13 +1548,14 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
dom_object *intern;
char *source;
int source_len, refcount, ret;
+ long options = 0;
id = getThis();
if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), dom_document_class_entry TSRMLS_CC)) {
id = 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|l", &source, &source_len, &options) == FAILURE) {
return;
}
@@ -1511,7 +1564,7 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
RETURN_FALSE;
}
- newdoc = dom_document_parser(id, mode, source TSRMLS_CC);
+ newdoc = dom_document_parser(id, mode, source, options TSRMLS_CC);
if (!newdoc)
RETURN_FALSE;
@@ -1544,7 +1597,7 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
}
/* }}} end dom_parser_document */
-/* {{{ proto DOMNode dom_document_load(string source);
+/* {{{ proto DOMNode dom_document_load(string source [, int options]);
URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-load
Since: DOM Level 3
*/
@@ -1554,7 +1607,7 @@ PHP_METHOD(domdocument, load)
}
/* }}} end dom_document_load */
-/* {{{ proto DOMNode dom_document_loadxml(string source);
+/* {{{ proto DOMNode dom_document_loadxml(string source [, int options]);
URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-loadXML
Since: DOM Level 3
*/
@@ -1571,17 +1624,18 @@ PHP_FUNCTION(dom_document_save)
{
zval *id;
xmlDoc *docp;
- int file_len = 0, bytes, format;
+ int file_len = 0, bytes, format, saveempty;
dom_object *intern;
dom_doc_props *doc_props;
char *file;
+ long options = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
return;
}
if (file_len == 0) {
- php_error(E_WARNING, "Invalid Filename");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename");
RETURN_FALSE;
}
@@ -1591,8 +1645,14 @@ PHP_FUNCTION(dom_document_save)
doc_props = dom_get_doc_props(intern->document);
format = doc_props->formatoutput;
+ if (options & LIBXML_SAVE_NOEMPTYTAG) {
+ saveempty = xmlSaveNoEmptyTags;
+ xmlSaveNoEmptyTags = 1;
+ }
bytes = xmlSaveFormatFileEnc(file, docp, NULL, format);
-
+ if (options & LIBXML_SAVE_NOEMPTYTAG) {
+ xmlSaveNoEmptyTags = saveempty;
+ }
if (bytes == -1) {
RETURN_FALSE;
}
@@ -1613,9 +1673,10 @@ PHP_FUNCTION(dom_document_savexml)
xmlChar *mem;
dom_object *intern, *nodeobj;
dom_doc_props *doc_props;
- int size, format;
+ int size, format, saveempty;
+ long options = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O", &id, dom_document_class_entry, &nodep, dom_node_class_entry) == FAILURE) {
+ 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) {
return;
}
@@ -1633,21 +1694,34 @@ PHP_FUNCTION(dom_document_savexml)
}
buf = xmlBufferCreate();
if (!buf) {
- php_error(E_WARNING, "Could not fetch buffer");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
-
+ if (options & LIBXML_SAVE_NOEMPTYTAG) {
+ saveempty = xmlSaveNoEmptyTags;
+ xmlSaveNoEmptyTags = 1;
+ }
xmlNodeDump(buf, docp, node, 0, format);
+ if (options & LIBXML_SAVE_NOEMPTYTAG) {
+ xmlSaveNoEmptyTags = saveempty;
+ }
mem = (xmlChar*) xmlBufferContent(buf);
if (!mem) {
xmlBufferFree(buf);
RETURN_FALSE;
}
- RETVAL_STRING(mem, 1);
+ RETVAL_STRING(mem, 1);
xmlBufferFree(buf);
} else {
+ if (options & LIBXML_SAVE_NOEMPTYTAG) {
+ saveempty = xmlSaveNoEmptyTags;
+ xmlSaveNoEmptyTags = 1;
+ }
/* Encoding is handled from the encoding property set on the document */
xmlDocDumpFormatMemory(docp, &mem, &size, format);
+ if (options & LIBXML_SAVE_NOEMPTYTAG) {
+ xmlSaveNoEmptyTags = saveempty;
+ }
if (!size) {
RETURN_FALSE;
}
@@ -1690,23 +1764,28 @@ static void php_dom_remove_xinclude_nodes(xmlNodePtr cur TSRMLS_DC) {
}
}
-/* {{{ proto int dom_document_xinclude()
+/* {{{ proto int dom_document_xinclude([int options])
Substitutues xincludes in a DomDocument */
PHP_FUNCTION(dom_document_xinclude)
{
zval *id;
xmlDoc *docp;
xmlNodePtr root;
- int err;
+ long flags = 0;
+ int err;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_document_class_entry, &flags) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
+#if LIBXML_VERSION >= 20607
+ err = xmlXIncludeProcessFlags(docp, flags);
+#else
err = xmlXIncludeProcess (docp);
+#endif
/* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these
are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
@@ -1786,7 +1865,7 @@ _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
}
if (source_len == 0) {
- php_error(E_WARNING, "Invalid Schema source");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source");
RETURN_FALSE;
}
@@ -1796,7 +1875,7 @@ _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
case DOM_LOAD_FILE:
valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
if (!valid_file) {
- php_error(E_WARNING, "Invalid Schema file source");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema file source");
RETURN_FALSE;
}
parser = xmlSchemaNewParserCtxt(valid_file);
@@ -1817,7 +1896,7 @@ _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
sptr = xmlSchemaParse(parser);
xmlSchemaFreeParserCtxt(parser);
if (!sptr) {
- php_error(E_WARNING, "Invalid Schema");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema");
RETURN_FALSE;
}
@@ -1876,7 +1955,7 @@ _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
}
if (source_len == 0) {
- php_error(E_WARNING, "Invalid Schema source");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source");
RETURN_FALSE;
}
@@ -1886,7 +1965,7 @@ _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
case DOM_LOAD_FILE:
valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
if (!valid_file) {
- php_error(E_WARNING, "Invalid RelaxNG file source");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG file source");
RETURN_FALSE;
}
parser = xmlRelaxNGNewParserCtxt(valid_file);
@@ -1907,7 +1986,7 @@ _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
sptr = xmlRelaxNGParse(parser);
xmlRelaxNGFreeParserCtxt(parser);
if (!sptr) {
- php_error(E_WARNING, "Invalid RelaxNG");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG");
RETURN_FALSE;
}
@@ -2057,7 +2136,7 @@ PHP_FUNCTION(dom_document_save_html_file)
}
if (file_len == 0) {
- php_error(E_WARNING, "Invalid Filename");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename");
RETURN_FALSE;
}
diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c
index b7ce96890..4c57c69f1 100644
--- a/ext/dom/documentfragment.c
+++ b/ext/dom/documentfragment.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: documentfragment.c,v 1.11 2004/05/31 12:50:28 rrichards Exp $ */
+/* $Id: documentfragment.c,v 1.15 2005/08/03 14:07:00 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -37,6 +37,7 @@
zend_function_entry php_dom_documentfragment_class_functions[] = {
PHP_ME(domdocumentfragment, __construct, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(domdocumentfragment, appendXML, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
@@ -73,4 +74,74 @@ PHP_METHOD(domdocumentfragment, __construct)
}
}
/* }}} end DOMDocumentFragment::__construct */
+
+/* php_dom_xmlSetTreeDoc is a custom implementation of xmlSetTreeDoc
+ needed for hack in appendXML due to libxml bug - no need to share this function */
+static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) {
+ xmlAttrPtr prop;
+ xmlNodePtr cur;
+
+ if (tree) {
+ if(tree->type == XML_ELEMENT_NODE) {
+ prop = tree->properties;
+ while (prop != NULL) {
+ prop->doc = doc;
+ if (prop->children) {
+ cur = prop->children;
+ while (cur != NULL) {
+ php_dom_xmlSetTreeDoc(cur, doc);
+ cur = cur->next;
+ }
+ }
+ prop = prop->next;
+ }
+ }
+ if (tree->children != NULL) {
+ cur = tree->children;
+ while (cur != NULL) {
+ php_dom_xmlSetTreeDoc(cur, doc);
+ cur = cur->next;
+ }
+ }
+ tree->doc = doc;
+ }
+}
+
+/* {{{ proto void DOMDocumentFragment::appendXML(string data); */
+PHP_METHOD(domdocumentfragment, appendXML) {
+ zval *id;
+ xmlNode *nodep;
+ dom_object *intern;
+ char *data = NULL;
+ int data_len = 0;
+ int err;
+ xmlNodePtr lst;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_documentfragment_class_entry, &data, &data_len) == FAILURE) {
+ return;
+ }
+
+ DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
+
+ if (dom_node_is_read_only(nodep) == SUCCESS) {
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
+ if (data) {
+ err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, data, &lst);
+ if (err != 0) {
+ RETURN_FALSE;
+ }
+ /* Following needed due to bug in libxml2 <= 2.6.14
+ ifdef after next libxml release as bug is fixed in their cvs */
+ php_dom_xmlSetTreeDoc(lst, nodep->doc);
+ /* End stupid hack */
+
+ xmlAddChildList(nodep,lst);
+ }
+
+ RETURN_TRUE;
+}
+
#endif
diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
index 8363cb950..51b4453c4 100644
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: documenttype.c,v 1.12.2.2 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: documenttype.c,v 1.15 2005/08/03 14:07:00 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/dom_ce.h b/ext/dom/dom_ce.h
index 2d3e93e26..6af4b19b4 100644
--- a/ext/dom/dom_ce.h
+++ b/ext/dom/dom_ce.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dom_ce.h,v 1.6.2.1 2005/06/22 19:58:33 rrichards Exp $ */
+/* $Id: dom_ce.h,v 1.8 2005/08/03 14:07:01 sniper Exp $ */
#ifndef DOM_CE_H
#define DOM_CE_H
diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h
index 8ee8204cc..7d62b638a 100644
--- a/ext/dom/dom_fe.h
+++ b/ext/dom/dom_fe.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dom_fe.h,v 1.11 2004/05/16 10:30:16 rrichards Exp $ */
+/* $Id: dom_fe.h,v 1.14 2005/08/03 14:07:01 sniper Exp $ */
#ifndef DOM_FE_H
#define DOM_FE_H
@@ -102,6 +102,7 @@ PHP_METHOD(domimplementation, getFeature);
/* domdocumentfragment methods */
PHP_METHOD(domdocumentfragment, __construct);
+PHP_METHOD(domdocumentfragment, appendXML);
/* domdocument methods */
PHP_FUNCTION(dom_document_create_element);
@@ -258,6 +259,7 @@ PHP_FUNCTION(dom_string_extend_find_offset32);
PHP_METHOD(domxpath, __construct);
PHP_FUNCTION(dom_xpath_register_ns);
PHP_FUNCTION(dom_xpath_query);
+PHP_FUNCTION(dom_xpath_evaluate);
#endif
#endif /* DOM_FE_H */
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index 596f7dfd3..694392e99 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dom_iterators.c,v 1.8 2004/03/08 21:15:39 helly Exp $ */
+/* $Id: dom_iterators.c,v 1.9 2005/08/03 14:07:01 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h
index 8af5a8b0e..d0fbcd159 100644
--- a/ext/dom/dom_properties.h
+++ b/ext/dom/dom_properties.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dom_properties.h,v 1.5 2004/01/08 17:32:03 sniper Exp $ */
+/* $Id: dom_properties.h,v 1.7 2005/08/03 14:07:01 sniper Exp $ */
#ifndef DOM_PROPERTIES_H
#define DOM_PROPERTIES_H
@@ -59,6 +59,8 @@ int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC
int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC);
int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC);
int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC);
+int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC);
+int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC);
int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC);
int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC);
diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c
index 1c80aa804..7a4bd7f04 100644
--- a/ext/dom/domconfiguration.c
+++ b/ext/dom/domconfiguration.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domconfiguration.c,v 1.4 2004/01/08 08:15:16 andi Exp $ */
+/* $Id: domconfiguration.c,v 1.5 2005/08/03 14:07:02 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c
index c4fd80b61..57c62d788 100644
--- a/ext/dom/domerror.c
+++ b/ext/dom/domerror.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domerror.c,v 1.4.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: domerror.c,v 1.6 2005/08/03 14:07:02 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c
index f2a84013f..d670d6ed9 100644
--- a/ext/dom/domerrorhandler.c
+++ b/ext/dom/domerrorhandler.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domerrorhandler.c,v 1.4 2004/01/08 08:15:16 andi Exp $ */
+/* $Id: domerrorhandler.c,v 1.5 2005/08/03 14:07:02 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c
index 7e5b8c6bf..a48953d39 100644
--- a/ext/dom/domexception.c
+++ b/ext/dom/domexception.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domexception.c,v 1.9 2004/05/31 12:50:28 rrichards Exp $ */
+/* $Id: domexception.c,v 1.11 2005/08/03 14:07:02 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -41,6 +41,16 @@ zend_function_entry php_dom_domexception_class_functions[] = {
{NULL, NULL, NULL}
};
+/* {{{ php_dom_throw_error_with_message */
+void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC)
+{
+ if (strict_error == 1) {
+ zend_throw_exception(dom_domexception_class_entry, error_message, error_code TSRMLS_CC);
+ } else {
+ php_libxml_issue_error(E_WARNING, error_message TSRMLS_CC);
+ }
+}
+
/* {{{ php_dom_throw_error */
void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC)
{
@@ -100,11 +110,7 @@ void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC)
error_message = "Unhandled Error";
}
- if (strict_error == 1) {
- zend_throw_exception(dom_domexception_class_entry, error_message, error_code TSRMLS_CC);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", error_message);
- }
+ php_dom_throw_error_with_message(error_code, error_message, strict_error TSRMLS_CC);
}
/* }}} end php_dom_throw_error */
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c
index 7c01b77af..970c5e5a9 100644
--- a/ext/dom/domimplementation.c
+++ b/ext/dom/domimplementation.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domimplementation.c,v 1.13 2004/05/31 12:50:28 rrichards Exp $ */
+/* $Id: domimplementation.c,v 1.15 2005/08/03 14:07:02 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -201,7 +201,7 @@ PHP_METHOD(domimplementation, createDocument)
xmlFreeDoc(docp);
xmlFree(localname);
/* Need some type of error here */
- php_error(E_WARNING, "Unexpected Error");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected Error");
RETURN_FALSE;
}
diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c
index 6463216c3..f0c25f9cb 100644
--- a/ext/dom/domimplementationlist.c
+++ b/ext/dom/domimplementationlist.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domimplementationlist.c,v 1.4.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: domimplementationlist.c,v 1.6 2005/08/03 14:07:03 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c
index 1db0e41bd..bdd3cc34f 100644
--- a/ext/dom/domimplementationsource.c
+++ b/ext/dom/domimplementationsource.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domimplementationsource.c,v 1.4 2004/01/08 08:15:16 andi Exp $ */
+/* $Id: domimplementationsource.c,v 1.5 2005/08/03 14:07:03 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c
index b6779d4e1..8793ac443 100644
--- a/ext/dom/domlocator.c
+++ b/ext/dom/domlocator.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domlocator.c,v 1.4.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: domlocator.c,v 1.6 2005/08/03 14:07:03 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c
index 158e8a34a..a8c2b23f0 100644
--- a/ext/dom/domstringlist.c
+++ b/ext/dom/domstringlist.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domstringlist.c,v 1.4.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: domstringlist.c,v 1.6 2005/08/03 14:07:03 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/element.c b/ext/dom/element.c
index 3a43a32a7..d2a06c7d5 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: element.c,v 1.30.2.4 2005/05/20 15:02:48 rrichards Exp $ */
+/* $Id: element.c,v 1.36.2.2 2005/10/27 23:51:22 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -368,6 +368,11 @@ PHP_FUNCTION(dom_element_set_attribute_node)
RETURN_FALSE;
}
+ if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) {
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
existattrp = xmlHasProp(nodep, attrp->name);
if (existattrp != NULL && existattrp->type != XML_ATTRIBUTE_DECL) {
if ((oldobj = php_dom_object_get_data((xmlNodePtr) existattrp)) != NULL &&
@@ -501,6 +506,42 @@ PHP_FUNCTION(dom_element_get_attribute_ns)
}
/* }}} end dom_element_get_attribute_ns */
+static xmlNsPtr _dom_new_reconNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) {
+ xmlNsPtr def;
+ xmlChar prefix[50];
+ int counter = 1;
+
+ if ((tree == NULL) || (ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) {
+ return NULL;
+ }
+
+ /* Code taken from libxml2 (2.6.20) xmlNewReconciliedNs
+ *
+ * Find a close prefix which is not already in use.
+ * Let's strip namespace prefixes longer than 20 chars !
+ */
+ if (ns->prefix == NULL)
+ snprintf((char *) prefix, sizeof(prefix), "default");
+ else
+ snprintf((char *) prefix, sizeof(prefix), "%.20s", (char *)ns->prefix);
+
+ def = xmlSearchNs(doc, tree, prefix);
+ while (def != NULL) {
+ if (counter > 1000) return(NULL);
+ if (ns->prefix == NULL)
+ snprintf((char *) prefix, sizeof(prefix), "default%d", counter++);
+ else
+ snprintf((char *) prefix, sizeof(prefix), "%.20s%d",
+ (char *)ns->prefix, counter++);
+ def = xmlSearchNs(doc, tree, prefix);
+ }
+
+ /*
+ * OK, now we are ready to create a new one.
+ */
+ def = xmlNewNs(tree, ns->href, prefix);
+ return(def);
+}
/* {{{ proto void dom_element_set_attribute_ns(string namespaceURI, string qualifiedName, string value);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAttrNS
@@ -550,8 +591,21 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
nsptr = dom_get_nsdecl(elemp, localname);
} else {
nsptr = xmlSearchNsByHref(elemp->doc, elemp, uri);
- while (nsptr && nsptr->prefix == NULL) {
- nsptr = nsptr->next;
+ if (nsptr && nsptr->prefix == NULL) {
+ xmlNsPtr tmpnsptr;
+
+ tmpnsptr = nsptr->next;
+ while (tmpnsptr) {
+ if ((tmpnsptr->prefix != NULL) && (tmpnsptr->href != NULL) &&
+ (xmlStrEqual(tmpnsptr->href, (xmlChar *) uri))) {
+ nsptr = tmpnsptr;
+ break;
+ }
+ tmpnsptr = tmpnsptr->next;
+ }
+ if (tmpnsptr == NULL) {
+ nsptr = _dom_new_reconNs(elemp->doc, elemp, nsptr);
+ }
}
}
@@ -671,7 +725,7 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
int uri_len, name_len, ret;
char *uri, *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ 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;
}
@@ -720,6 +774,11 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
RETURN_FALSE;
}
+ if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) {
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
nsp = attrp->ns;
if (nsp != NULL) {
existattrp = xmlHasNsProp(nodep, nsp->href, attrp->name);
diff --git a/ext/dom/entity.c b/ext/dom/entity.c
index bc625a2c0..74be14930 100644
--- a/ext/dom/entity.c
+++ b/ext/dom/entity.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: entity.c,v 1.7.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: entity.c,v 1.9 2005/08/03 14:07:03 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c
index 1d19470d1..7ac0c8b8f 100644
--- a/ext/dom/entityreference.c
+++ b/ext/dom/entityreference.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: entityreference.c,v 1.11 2004/05/31 12:50:28 rrichards Exp $ */
+/* $Id: entityreference.c,v 1.12 2005/08/03 14:07:04 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c
index 0754e3fb2..8e11042d6 100644
--- a/ext/dom/namednodemap.c
+++ b/ext/dom/namednodemap.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: namednodemap.c,v 1.12.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: namednodemap.c,v 1.15 2005/08/03 14:07:04 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -167,7 +167,8 @@ Since:
PHP_FUNCTION(dom_namednodemap_item)
{
zval *id, *rv = NULL;
- int index, ret;
+ long index;
+ int ret;
dom_object *intern;
xmlNodePtr itemnode = NULL;
diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c
index 5698401ed..897065b89 100644
--- a/ext/dom/namelist.c
+++ b/ext/dom/namelist.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: namelist.c,v 1.5.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: namelist.c,v 1.7 2005/08/03 14:07:04 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 154067db4..fa8df8520 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: node.c,v 1.29.2.6 2005/05/20 15:02:48 rrichards Exp $ */
+/* $Id: node.c,v 1.37 2005/08/03 14:07:04 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -317,7 +317,7 @@ int dom_node_parent_node_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
@@ -389,7 +389,7 @@ int dom_node_first_child_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object(first, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
@@ -427,7 +427,7 @@ int dom_node_last_child_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object(last, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
@@ -462,7 +462,7 @@ int dom_node_previous_sibling_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object(prevsib, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
@@ -497,7 +497,7 @@ int dom_node_next_sibling_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object(nextsib, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
@@ -573,7 +573,7 @@ int dom_node_owner_document_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
@@ -1299,7 +1299,7 @@ PHP_FUNCTION(dom_node_append_child)
if (new_child == NULL) {
new_child = xmlAddChild(nodep, child);
if (new_child == NULL) {
- php_error(E_WARNING, "Couldn't append node");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't append node");
RETURN_FALSE;
}
}
diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c
index 457774a3b..7ba7da012 100644
--- a/ext/dom/nodelist.c
+++ b/ext/dom/nodelist.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: nodelist.c,v 1.14.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: nodelist.c,v 1.17 2005/08/03 14:07:04 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -100,7 +100,8 @@ Since:
PHP_FUNCTION(dom_nodelist_item)
{
zval *id, *rv = NULL;
- int index, ret;
+ long index;
+ int ret;
dom_object *intern;
xmlNodePtr itemnode = NULL;
diff --git a/ext/dom/notation.c b/ext/dom/notation.c
index ae2c57302..ce502c858 100644
--- a/ext/dom/notation.c
+++ b/ext/dom/notation.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: notation.c,v 1.7.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: notation.c,v 1.9 2005/08/03 14:07:05 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 95a7f7602..fec631871 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_dom.c,v 1.60.2.8 2005/06/22 19:58:33 rrichards Exp $ */
+/* $Id: php_dom.c,v 1.73.2.6 2005/11/23 03:12:45 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -161,6 +161,7 @@ dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document)
doc_props->preservewhitespace = 1;
doc_props->substituteentities = 0;
doc_props->stricterror = 1;
+ doc_props->recover = 0;
if (document) {
document->doc_props = doc_props;
}
@@ -294,6 +295,7 @@ zval *dom_read_property(zval *object, zval *member, int type TSRMLS_DC)
if (ret == SUCCESS) {
/* ensure we're creating a temporary variable */
retval->refcount = 0;
+ retval->is_ref = 0;
} else {
retval = EG(uninitialized_zval_ptr);
}
@@ -344,6 +346,41 @@ void dom_write_property(zval *object, zval *member, zval *value TSRMLS_DC)
}
/* }}} */
+/* {{{ dom_property_exists */
+static int dom_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+{
+ dom_object *obj;
+ zval tmp_member;
+ dom_prop_handler *hnd;
+ zend_object_handlers *std_hnd;
+ int ret, retval=0;
+
+ if (member->type != IS_STRING) {
+ tmp_member = *member;
+ zval_copy_ctor(&tmp_member);
+ convert_to_string(&tmp_member);
+ member = &tmp_member;
+ }
+
+ ret = FAILURE;
+ obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC);
+
+ if (obj->prop_handler != NULL) {
+ ret = zend_hash_find((HashTable *)obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd);
+ }
+ if (ret == SUCCESS) {
+ retval = 1;
+ } else {
+ std_hnd = zend_get_std_object_handlers();
+ retval = std_hnd->has_property(object, member, check_empty TSRMLS_CC);
+ }
+
+ if (member == &tmp_member) {
+ zval_dtor(member);
+ }
+ return retval;
+}
+/* }}} */
void *php_dom_export_node(zval *object TSRMLS_DC)
{
@@ -362,7 +399,6 @@ void *php_dom_export_node(zval *object TSRMLS_DC)
Get a simplexml_element object from dom to allow for processing */
PHP_FUNCTION(dom_import_simplexml)
{
-#ifdef HAVE_SIMPLEXML
zval *rv = NULL;
zval *node;
xmlNodePtr nodep = NULL;
@@ -379,13 +415,9 @@ PHP_FUNCTION(dom_import_simplexml)
if (nodep && nodeobj && (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE)) {
DOM_RET_OBJ(rv, (xmlNodePtr) nodep, &ret, (dom_object *)nodeobj);
} else {
- php_error(E_WARNING, "Invalid Nodetype to import");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Nodetype to import");
RETURN_NULL();
}
-#else
- php_error(E_WARNING, "SimpleXML support is not enabled");
- return;
-#endif
}
/* }}} */
@@ -437,8 +469,15 @@ static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) {
}
}
+static zend_module_dep dom_deps[] = {
+ ZEND_MOD_REQUIRED("libxml")
+ ZEND_MOD_CONFLICTS("domxml")
+ {NULL, NULL, NULL}
+};
+
zend_module_entry dom_module_entry = {
- STANDARD_MODULE_HEADER,
+ STANDARD_MODULE_HEADER_EX, NULL,
+ dom_deps,
"dom",
dom_functions,
PHP_MINIT(dom),
@@ -464,12 +503,14 @@ PHP_MINIT_FUNCTION(dom)
dom_object_handlers.write_property = dom_write_property;
dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr;
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
+ dom_object_handlers.has_property = dom_property_exists;
memcpy(&dom_ze1_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
dom_ze1_object_handlers.read_property = dom_read_property;
dom_ze1_object_handlers.write_property = dom_write_property;
dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr;
dom_ze1_object_handlers.clone_obj = dom_objects_ze1_clone_obj;
+ dom_ze1_object_handlers.has_property = dom_property_exists;
zend_hash_init(&classes, 0, NULL, NULL, 1);
@@ -541,12 +582,13 @@ PHP_MINIT_FUNCTION(dom)
dom_register_prop_handler(&dom_document_prop_handlers, "doctype", dom_document_doctype_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "implementation", dom_document_implementation_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "documentElement", dom_document_document_element_read, NULL TSRMLS_CC);
-/* actualEncoding currently set as read only alias to encoding
- dom_register_prop_handler(&dom_document_prop_handlers, "actualEncoding", dom_document_actual_encoding_read, dom_document_actual_encoding_write TSRMLS_CC); */
dom_register_prop_handler(&dom_document_prop_handlers, "actualEncoding", dom_document_encoding_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "encoding", dom_document_encoding_read, dom_document_encoding_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_document_prop_handlers, "xmlEncoding", dom_document_encoding_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "standalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_document_prop_handlers, "xmlStandalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "version", dom_document_version_read, dom_document_version_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_document_prop_handlers, "xmlVersion", dom_document_version_read, dom_document_version_write TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "strictErrorChecking", dom_document_strict_error_checking_read, dom_document_strict_error_checking_write TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "documentURI", dom_document_document_uri_read, dom_document_document_uri_write TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "config", dom_document_config_read, NULL TSRMLS_CC);
@@ -554,6 +596,7 @@ PHP_MINIT_FUNCTION(dom)
dom_register_prop_handler(&dom_document_prop_handlers, "validateOnParse", dom_document_validate_on_parse_read, dom_document_validate_on_parse_write TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "resolveExternals", dom_document_resolve_externals_read, dom_document_resolve_externals_write TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "preserveWhiteSpace", dom_document_preserve_whitespace_read, dom_document_preserve_whitespace_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_document_prop_handlers, "recover", dom_document_recover_read, dom_document_recover_write TSRMLS_CC);
dom_register_prop_handler(&dom_document_prop_handlers, "substituteEntities", dom_document_substitue_entities_read, dom_document_substitue_entities_write TSRMLS_CC);
zend_hash_merge(&dom_document_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0);
@@ -928,8 +971,7 @@ static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool
intern = emalloc(sizeof(dom_object));
intern->std.ce = class_type;
- intern->std.in_get = 0;
- intern->std.in_set = 0;
+ intern->std.guards = NULL;
intern->ptr = NULL;
intern->prop_handler = NULL;
intern->document = NULL;
@@ -988,7 +1030,7 @@ zend_object_value dom_objects_new(zend_class_entry *class_type TSRMLS_DC)
intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
- retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t)dom_objects_free_storage, dom_objects_clone TSRMLS_CC);
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)dom_objects_free_storage, dom_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
retval.handlers = dom_get_obj_handlers(TSRMLS_C);
@@ -1005,7 +1047,7 @@ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC)
intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
- retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, dom_objects_clone TSRMLS_CC);
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, dom_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
retval.handlers = dom_get_obj_handlers(TSRMLS_C);
@@ -1186,7 +1228,7 @@ zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *wrapper_in, zval *
break;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported node type: %d\n", Z_TYPE_P(obj));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported node type: %d", Z_TYPE_P(obj));
ZVAL_NULL(wrapper);
return wrapper;
}
diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h
index c78a7c3c3..47c3147c3 100644
--- a/ext/dom/php_dom.h
+++ b/ext/dom/php_dom.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_dom.h,v 1.24.2.1 2004/08/30 15:09:07 rrichards Exp $ */
+/* $Id: php_dom.h,v 1.28 2005/08/03 14:07:05 sniper Exp $ */
#ifndef PHP_DOM_H
#define PHP_DOM_H
@@ -91,6 +91,7 @@ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC);
#endif
int dom_get_strict_error(php_libxml_ref_obj *document);
void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC);
+void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC);
void node_list_unlink(xmlNodePtr node TSRMLS_DC);
int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len);
xmlNsPtr dom_get_ns(xmlNodePtr node, char *uri, int *errorcode, char *prefix);
@@ -118,7 +119,7 @@ entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC);
#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \
__intern = (dom_object *)zend_object_store_get_object(__id TSRMLS_CC); \
if (__intern->ptr == NULL || !(__ptr = (__prtype)((php_libxml_node_ptr *)__intern->ptr)->node)) { \
- php_error(E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
RETURN_NULL();\
} \
}
diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c
index e7975d48b..69794f373 100644
--- a/ext/dom/processinginstruction.c
+++ b/ext/dom/processinginstruction.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: processinginstruction.c,v 1.15.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: processinginstruction.c,v 1.17 2005/08/03 14:07:05 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c
index e79ebbec6..fb91b64a1 100644
--- a/ext/dom/string_extend.c
+++ b/ext/dom/string_extend.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string_extend.c,v 1.4 2004/01/08 08:15:17 andi Exp $ */
+/* $Id: string_extend.c,v 1.5 2005/08/03 14:07:06 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/tests/bug34276.phpt b/ext/dom/tests/bug34276.phpt
new file mode 100644
index 000000000..e1083364a
--- /dev/null
+++ b/ext/dom/tests/bug34276.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug # 34276: setAttributeNS and default namespace
+--SKIPIF--
+<?php require_once('skipif.php'); ?>
+--FILE--
+<?php
+$xml = <<<HERE
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<foo xmlns="http://www.example.com/ns/foo"
+ xmlns:fubar="http://www.example.com/ns/fubar" attra="attra" />
+HERE;
+
+function dump($elems) {
+ foreach ($elems as $elem) {
+ var_dump($elem->nodeName);
+ dump($elem->childNodes);
+ }
+}
+
+$dom = new DOMDocument();
+$dom->loadXML($xml);
+$foo = $dom->documentElement;
+var_dump($foo->hasAttributeNS('http://www.example.com/ns/foo', 'attra'));
+var_dump($foo->getAttributeNS('http://www.example.com/ns/foo', 'attra'));
+
+$foo->setAttributeNS('http://www.example.com/ns/foo', 'attra', 'attranew');
+$foo->setAttributeNS('http://www.example.com/ns/fubar', 'attrb', 'attrbnew');
+$foo->setAttributeNS('http://www.example.com/ns/foo', 'attrc', 'attrc');
+
+var_dump($foo->getAttributeNS('http://www.example.com/ns/foo', 'attra'));
+var_dump($foo->getAttributeNS('http://www.example.com/ns/fubar', 'attrb'));
+var_dump($foo->getAttributeNS('http://www.example.com/ns/foo', 'attrc'));
+
+print $dom->saveXML();
+?>
+--EXPECT--
+bool(false)
+string(0) ""
+string(8) "attranew"
+string(8) "attrbnew"
+string(5) "attrc"
+<?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:default="http://www.example.com/ns/foo" attra="attra" default:attra="attranew" fubar:attrb="attrbnew" default:attrc="attrc"/>
diff --git a/ext/dom/tests/bug35342.phpt b/ext/dom/tests/bug35342.phpt
new file mode 100644
index 000000000..2aab3852b
--- /dev/null
+++ b/ext/dom/tests/bug35342.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug # 35342: isset(DOMNodeList->length) returns false
+--SKIPIF--
+<?php require_once('skipif.php'); ?>
+--FILE--
+<?php
+$dom = new DOMDocument();
+$dom->loadXML("<root><foo>foobar</foo><foo>foobar#2</foo></root>");
+
+$nodelist = $dom->getElementsByTagName("foo");
+
+var_dump($nodelist->length, isset($nodelist->length), isset($nodelist->foo));
+?>
+--EXPECT--
+int(2)
+bool(true)
+bool(false)
diff --git a/ext/dom/tests/dom002.phpt b/ext/dom/tests/dom002.phpt
index 3343a1774..2bc0717d6 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.inc'); ?>
+<?php require_once('skipif.php'); ?>
--FILE--
<?php
$xml = <<<HERE
diff --git a/ext/dom/tests/dom003.phpt b/ext/dom/tests/dom003.phpt
index 3c4e243c4..1eb6d4a4f 100644
--- a/ext/dom/tests/dom003.phpt
+++ b/ext/dom/tests/dom003.phpt
@@ -59,6 +59,6 @@ object(DOMException)#%d (6) {
Fatal error: Uncaught exception 'DOMException' with message 'Hierarchy Request Error' in %sdom003.php:%d
Stack trace:
-#0 %sdom003.php(%d): DOMNode->appendChild(Object(DOMElement))
+#0 %sdom003.php(13): DOMNode->appendChild(Object(DOMElement))
#1 {main}
thrown in %sdom003.php on line %d
diff --git a/ext/dom/tests/dom005.phpt b/ext/dom/tests/dom005.phpt
index c0f4bb714..249869eff 100644
--- a/ext/dom/tests/dom005.phpt
+++ b/ext/dom/tests/dom005.phpt
@@ -14,23 +14,23 @@ print "--- save as HTML\n";
print adjustDoctype($dom->saveHTML());
function adjustDoctype($xml) {
- return str_replace("DOCTYPE HTML","DOCTYPE html",$xml);
+ return str_replace(array("DOCTYPE HTML",'<p>','</p>'),array("DOCTYPE html",'',''),$xml);
}
--EXPECT--
--- save as XML
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
-<html><head><title>Hello world</title></head><body><p>
+<html><head><title>Hello world</title></head><body>
This is a not well-formed<br/>
html files with undeclared entities&#xA0;
-</p></body></html>
+</body></html>
--- save as HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head><title>Hello world</title></head>
-<body><p>
+<body>
This is a not well-formed<br>
html files with undeclared entities&nbsp;
-</p></body>
+</body>
</html>
diff --git a/ext/dom/tests/dom_set_attr_node.phpt b/ext/dom/tests/dom_set_attr_node.phpt
new file mode 100644
index 000000000..e87a96011
--- /dev/null
+++ b/ext/dom/tests/dom_set_attr_node.phpt
@@ -0,0 +1,67 @@
+--TEST--
+Test: setAttributeNode()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$xml = <<<HERE
+<?xml version="1.0" ?>
+<root a="b" />
+HERE;
+
+$xml2 = <<<HERE
+<?xml version="1.0" ?>
+<doc2 />
+HERE;
+
+$dom = new DOMDocument();
+$dom->loadXML($xml);
+$root = $dom->documentElement;
+$attr = $root->getAttributeNode('a');
+
+$dom2 = new DOMDocument();
+$dom2->loadXML($xml2);
+$root2 = $dom2->documentElement;
+try {
+ $root2->setAttributeNode($attr);
+} catch (domexception $e) {
+ var_dump($e);
+}
+
+?>
+--EXPECTF--
+object(DOMException)#%d (6) {
+ ["message:protected"]=>
+ string(20) "Wrong Document Error"
+ ["string:private"]=>
+ string(0) ""
+ ["file:protected"]=>
+ string(%d) "%sdom_set_attr_node.php"
+ ["line:protected"]=>
+ int(22)
+ ["trace:private"]=>
+ array(1) {
+ [0]=>
+ array(6) {
+ ["file"]=>
+ string(%d) "%sdom_set_attr_node.php"
+ ["line"]=>
+ int(22)
+ ["function"]=>
+ string(16) "setAttributeNode"
+ ["class"]=>
+ string(10) "DOMElement"
+ ["type"]=>
+ string(2) "->"
+ ["args"]=>
+ array(1) {
+ [0]=>
+ object(DOMAttr)#%d (0) {
+ }
+ }
+ }
+ }
+ ["code"]=>
+ int(4)
+} \ No newline at end of file
diff --git a/ext/dom/tests/dom_xinclude.phpt b/ext/dom/tests/dom_xinclude.phpt
index 92df048bc..f9a3dd761 100644
--- a/ext/dom/tests/dom_xinclude.phpt
+++ b/ext/dom/tests/dom_xinclude.phpt
@@ -8,20 +8,25 @@ array_search('compress.zlib', stream_get_wrappers()) or die('skip compress.zlib
--FILE--
<?php
$dom = new domdocument;
-$dom->load(dirname(__FILE__)."/xinclude.xml");
+
+$data = file_get_contents(dirname(__FILE__)."/xinclude.xml");
+$data = str_replace('compress.zlib://ext/dom/tests/','compress.zlib://'.dirname(__FILE__).'/', $data);
+
+$dom->loadXML($data);
+
$dom->xinclude();
print $dom->saveXML()."\n";
foreach ($dom->documentElement->childNodes as $node) {
print $node->nodeName."\n";
}
-
---EXPECT--
+?>
+--EXPECTF--
<?xml version="1.0"?>
<foo xmlns:xi="http://www.w3.org/2001/XInclude">
- <book xml:base="compress.zlib://ext/dom/tests/book.xml">
+ <book xml:base="compress.zlib://%sext/dom/tests/book.xml">
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
- </book><book xml:base="compress.zlib://ext/dom/tests/book.xml">
+ </book><book xml:base="compress.zlib://%sext/dom/tests/book.xml">
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
diff --git a/ext/dom/text.c b/ext/dom/text.c
index 1fb4aeaf0..fb1a05e52 100644
--- a/ext/dom/text.c
+++ b/ext/dom/text.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: text.c,v 1.20.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: text.c,v 1.23 2005/08/03 14:07:06 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -38,6 +38,7 @@
zend_function_entry php_dom_text_class_functions[] = {
PHP_FALIAS(splitText, dom_text_split_text, NULL)
PHP_FALIAS(isWhitespaceInElementContent, dom_text_is_whitespace_in_element_content, NULL)
+ PHP_FALIAS(isElementContentWhitespace, dom_text_is_whitespace_in_element_content, NULL)
PHP_FALIAS(replaceWholeText, dom_text_replace_whole_text, NULL)
PHP_ME(domtext, __construct, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c
index b9d6b5d1b..58a90f132 100644
--- a/ext/dom/typeinfo.c
+++ b/ext/dom/typeinfo.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: typeinfo.c,v 1.4.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: typeinfo.c,v 1.6 2005/08/03 14:07:06 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/userdatahandler.c b/ext/dom/userdatahandler.c
index be5172d68..343cbcd6e 100644
--- a/ext/dom/userdatahandler.c
+++ b/ext/dom/userdatahandler.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: userdatahandler.c,v 1.4.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: userdatahandler.c,v 1.6 2005/08/03 14:07:06 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h
index eb5b569e1..39aad7b1a 100644
--- a/ext/dom/xml_common.h
+++ b/ext/dom/xml_common.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xml_common.h,v 1.19.2.1 2005/06/22 19:58:33 rrichards Exp $ */
+/* $Id: xml_common.h,v 1.23 2005/08/03 14:07:06 sniper Exp $ */
#ifndef PHP_XML_COMMON_H
#define PHP_XML_COMMON_H
@@ -31,6 +31,7 @@ typedef struct _dom_doc_props {
int preservewhitespace;
int substituteentities;
int stricterror;
+ int recover;
} dom_doc_props;
typedef dom_doc_props *dom_doc_propsptr;
@@ -67,7 +68,7 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
#define NODE_GET_OBJ(__ptr, __id, __prtype, __intern) { \
__intern = (php_libxml_node_object *)zend_object_store_get_object(__id TSRMLS_CC); \
if (__intern->node == NULL || !(__ptr = (__prtype)__intern->node->node)) { \
- php_error(E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
RETURN_NULL();\
} \
}
@@ -76,7 +77,7 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
__intern = (php_libxml_node_object *)zend_object_store_get_object(__id TSRMLS_CC); \
if (__intern->document != NULL) { \
if (!(__ptr = (__prtype)__intern->document->ptr)) { \
- php_error(E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
RETURN_NULL();\
} \
} \
@@ -84,13 +85,13 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
#define DOM_RET_OBJ(zval, obj, ret, domobject) \
if (NULL == (zval = php_dom_create_object(obj, ret, zval, return_value, domobject TSRMLS_CC))) { \
- php_error(E_WARNING, "Cannot create required DOM object"); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \
RETURN_FALSE; \
}
#define DOM_GET_THIS(zval) \
if (NULL == (zval = getThis())) { \
- php_error(E_WARNING, "Underlying object missing"); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Underlying object missing"); \
RETURN_FALSE; \
}
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index ed45d3688..af56201c7 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xpath.c,v 1.22.2.1 2004/11/18 19:55:00 rrichards Exp $ */
+/* $Id: xpath.c,v 1.26 2005/08/03 14:07:06 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -27,6 +27,8 @@
#if HAVE_LIBXML && HAVE_DOM
#include "php_dom.h"
+#define PHP_DOM_XPATH_QUERY 0
+#define PHP_DOM_XPATH_EVALUATE 1
/*
* class DOMXPath
@@ -38,6 +40,7 @@ zend_function_entry php_dom_xpath_class_functions[] = {
PHP_ME(domxpath, __construct, NULL, ZEND_ACC_PUBLIC)
PHP_FALIAS(registerNamespace, dom_xpath_register_ns, NULL)
PHP_FALIAS(query, dom_xpath_query, NULL)
+ PHP_FALIAS(evaluate, dom_xpath_evaluate, NULL)
{NULL, NULL, NULL}
};
@@ -93,7 +96,7 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
ALLOC_ZVAL(*retval);
if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) {
- php_error(E_WARNING, "Cannot create required DOM object");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
return SUCCESS;
@@ -116,7 +119,7 @@ PHP_FUNCTION(dom_xpath_register_ns)
ctxp = (xmlXPathContextPtr) intern->ptr;
if (ctxp == NULL) {
- php_error(E_WARNING, "Invalid XPath Context");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context");
RETURN_FALSE;
}
@@ -136,14 +139,12 @@ static void dom_xpath_iter(zval *baseobj, dom_object *intern)
}
-/* {{{ proto DOMNodeList dom_xpath_query(string expr [,DOMNode context]); */
-PHP_FUNCTION(dom_xpath_query)
-{
+static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) {
zval *id, *retval, *context = NULL;
xmlXPathContextPtr ctxp;
xmlNodePtr nodep = NULL;
xmlXPathObjectPtr xpathobjp;
- int expr_len, ret, nsnbr = 0;
+ int expr_len, ret, nsnbr = 0, xpath_type;
dom_object *intern, *nodeobj;
char *expr;
xmlDoc *docp = NULL;
@@ -158,13 +159,13 @@ PHP_FUNCTION(dom_xpath_query)
ctxp = (xmlXPathContextPtr) intern->ptr;
if (ctxp == NULL) {
- php_error(E_WARNING, "Invalid XPath Context");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context");
RETURN_FALSE;
}
docp = (xmlDocPtr) ctxp->doc;
if (docp == NULL) {
- php_error(E_WARNING, "Invalid XPath Document Pointer");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Document Pointer");
RETURN_FALSE;
}
@@ -177,7 +178,7 @@ PHP_FUNCTION(dom_xpath_query)
}
if (nodep && docp != nodep->doc) {
- php_error(E_WARNING, "Node From Wrong Document");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node From Wrong Document");
RETURN_FALSE;
}
@@ -208,54 +209,92 @@ PHP_FUNCTION(dom_xpath_query)
RETURN_FALSE;
}
+ if (type == PHP_DOM_XPATH_QUERY) {
+ xpath_type = XPATH_NODESET;
+ } else {
+ xpath_type = xpathobjp->type;
+ }
- MAKE_STD_ZVAL(retval);
- array_init(retval);
-
- if (xpathobjp->type == XPATH_NODESET) {
- int i;
- xmlNodeSetPtr nodesetp;
-
- if (NULL != (nodesetp = xpathobjp->nodesetval)) {
-
- for (i = 0; i < nodesetp->nodeNr; i++) {
- xmlNodePtr node = nodesetp->nodeTab[i];
- zval *child;
-
- MAKE_STD_ZVAL(child);
-
- if (node->type == XML_NAMESPACE_DECL) {
- xmlNsPtr curns;
- xmlNodePtr nsparent;
-
- nsparent = node->_private;
- curns = xmlNewNs(NULL, node->name, NULL);
- if (node->children) {
- curns->prefix = xmlStrdup((char *) node->children);
+ switch (xpath_type) {
+
+ case XPATH_NODESET:
+ {
+ int i;
+ xmlNodeSetPtr nodesetp;
+
+ MAKE_STD_ZVAL(retval);
+ array_init(retval);
+
+ if (xpathobjp->type == XPATH_NODESET && NULL != (nodesetp = xpathobjp->nodesetval)) {
+
+ for (i = 0; i < nodesetp->nodeNr; i++) {
+ xmlNodePtr node = nodesetp->nodeTab[i];
+ zval *child;
+
+ MAKE_STD_ZVAL(child);
+
+ if (node->type == XML_NAMESPACE_DECL) {
+ xmlNsPtr curns;
+ xmlNodePtr nsparent;
+
+ nsparent = node->_private;
+ curns = xmlNewNs(NULL, node->name, NULL);
+ if (node->children) {
+ curns->prefix = xmlStrdup((char *) node->children);
+ }
+ if (node->children) {
+ node = xmlNewDocNode(docp, NULL, (char *) node->children, node->name);
+ } else {
+ node = xmlNewDocNode(docp, NULL, "xmlns", node->name);
+ }
+ node->type = XML_NAMESPACE_DECL;
+ node->parent = nsparent;
+ node->ns = curns;
}
- if (node->children) {
- node = xmlNewDocNode(docp, NULL, (char *) node->children, node->name);
- } else {
- node = xmlNewDocNode(docp, NULL, "xmlns", node->name);
- }
- node->type = XML_NAMESPACE_DECL;
- node->parent = nsparent;
- node->ns = curns;
+ child = php_dom_create_object(node, &ret, NULL, child, intern TSRMLS_CC);
+ add_next_index_zval(retval, child);
}
- child = php_dom_create_object(node, &ret, NULL, child, intern TSRMLS_CC);
- add_next_index_zval(retval, child);
}
+ php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ intern = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC);
+ dom_xpath_iter(retval, intern);
+ break;
}
- }
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
- intern = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC);
- dom_xpath_iter(retval, intern);
+ case XPATH_BOOLEAN:
+ RETVAL_BOOL(xpathobjp->boolval);
+ break;
+
+ case XPATH_NUMBER:
+ RETVAL_DOUBLE(xpathobjp->floatval)
+ break;
+
+ case XPATH_STRING:
+ RETVAL_STRING(xpathobjp->stringval, 1);
+ break;
+
+ default:
+ RETVAL_NULL();
+ break;
+ }
xmlXPathFreeObject(xpathobjp);
}
+
+/* {{{ proto DOMNodeList dom_xpath_query(string expr [,DOMNode context]); */
+PHP_FUNCTION(dom_xpath_query)
+{
+ php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_QUERY);
+}
/* }}} end dom_xpath_query */
+/* {{{ proto mixed dom_xpath_evaluate(string expr [,DOMNode context]); */
+PHP_FUNCTION(dom_xpath_evaluate)
+{
+ php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_EVALUATE);
+}
+/* }}} end dom_xpath_evaluate */
+
#endif /* LIBXML_XPATH_ENABLED */
/* }}} */
diff --git a/ext/exif/config.w32 b/ext/exif/config.w32
index 0b701104a..de8154e17 100644
--- a/ext/exif/config.w32
+++ b/ext/exif/config.w32
@@ -1,7 +1,7 @@
-// $Id: config.w32,v 1.2 2003/12/22 13:16:39 wez Exp $
+// $Id: config.w32,v 1.3 2005/02/25 01:17:45 helly Exp $
// vim:ft=javascript
-ARG_WITH("exif", "exif", "no");
+ARG_ENABLE("exif", "exif", "no");
if (PHP_EXIF == "yes") {
EXTENSION("exif", "exif.c");
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 64568ee86..334df048a 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: exif.c,v 1.162.2.9 2005/08/05 14:00:47 hyanantha Exp $ */
+/* $Id: exif.c,v 1.173.2.2 2005/10/10 06:09:25 helly Exp $ */
/* ToDos
*
@@ -115,7 +115,7 @@ function_entry exif_functions[] = {
};
/* }}} */
-#define EXIF_VERSION "1.4 $Id: exif.c,v 1.162.2.9 2005/08/05 14:00:47 hyanantha Exp $"
+#define EXIF_VERSION "1.4 $Id: exif.c,v 1.173.2.2 2005/10/10 06:09:25 helly Exp $"
/* {{{ PHP_MINFO_FUNCTION
*/
@@ -3032,6 +3032,12 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
}
}
/*
+ * Ignore IFD2 if it purportedly exists
+ */
+ if (section_index == SECTION_THUMBNAIL) {
+ return TRUE;
+ }
+ /*
* Hack to make it process IDF1 I hope
* There are 2 IDFs, the second one holds the keys (0x0201 and 0x0202) to the thumbnail
*/
diff --git a/ext/exif/php_exif.h b/ext/exif/php_exif.h
index 0d9f897dd..dac62e64d 100644
--- a/ext/exif/php_exif.h
+++ b/ext/exif/php_exif.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_exif.h,v 1.13 2004/01/08 17:32:04 sniper Exp $ */
+/* $Id: php_exif.h,v 1.14 2005/08/03 14:07:08 sniper Exp $ */
#if HAVE_EXIF
extern zend_module_entry exif_module_entry;
diff --git a/ext/exif/tests/bug34704.jpg b/ext/exif/tests/bug34704.jpg
new file mode 100755
index 000000000..42b14c190
--- /dev/null
+++ b/ext/exif/tests/bug34704.jpg
Binary files differ
diff --git a/ext/exif/tests/bug34704.phpt b/ext/exif/tests/bug34704.phpt
new file mode 100755
index 000000000..b6b26de78
--- /dev/null
+++ b/ext/exif/tests/bug34704.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #34704 (Infinite recursion due to corrupt JPEG)
+--SKIPIF--
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
+--INI--
+magic_quotes_runtime=0
+output_handler=
+zlib.output_compression=0
+--FILE--
+<?php
+$infile = dirname(__FILE__).'/bug34704.jpg';
+var_dump(exif_read_data($infile));
+?>
+===DONE===
+--EXPECTF--
+array(7) {
+ ["FileName"]=>
+ string(12) "bug34704.jpg"
+ ["FileDateTime"]=>
+ int(%d)
+ ["FileSize"]=>
+ int(9976)
+ ["FileType"]=>
+ int(2)
+ ["MimeType"]=>
+ string(10) "image/jpeg"
+ ["SectionsFound"]=>
+ string(4) "IFD0"
+ ["COMPUTED"]=>
+ array(5) {
+ ["html"]=>
+ string(24) "width="386" height="488""
+ ["Height"]=>
+ int(488)
+ ["Width"]=>
+ int(386)
+ ["IsColor"]=>
+ int(1)
+ ["ByteOrderMotorola"]=>
+ int(0)
+ }
+}
+===DONE===
diff --git a/ext/fam/CREDITS b/ext/fam/CREDITS
deleted file mode 100644
index 60e3234a4..000000000
--- a/ext/fam/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-fam
-Sascha Schumann
diff --git a/ext/fam/config.m4 b/ext/fam/config.m4
deleted file mode 100644
index 6622e564c..000000000
--- a/ext/fam/config.m4
+++ /dev/null
@@ -1,56 +0,0 @@
-dnl $Id: config.m4,v 1.2 2002/12/10 20:09:35 helly Exp $
-dnl config.m4 for extension fam
-
-dnl Comments in this file start with the string 'dnl'.
-dnl Remove where necessary. This file will not work
-dnl without editing.
-
-dnl If your extension references something external, use with:
-
-PHP_ARG_WITH(fam, for fam support,
-[ --with-fam Include fam support])
-
-if test "$PHP_FAM" != "no"; then
- dnl Write more examples of tests here...
-
- dnl # --with-fam -> check with-path
-SEARCH_PATH="/usr/local /usr" # you might want to change this
-SEARCH_FOR="/include/fam.h" # you most likely want to change this
-if test -r $PHP_FAM/$SEARCH_FOR; then # path given as parameter
- FAM_DIR=$PHP_FAM
-else # search default path list
- AC_MSG_CHECKING([for fam files in default path])
- for i in $SEARCH_PATH ; do
- if test -r $i/$SEARCH_FOR; then
- FAM_DIR=$i
- AC_MSG_RESULT(found in $i)
- fi
- done
-fi
-
-if test -z "$FAM_DIR"; then
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([Please reinstall the fam distribution])
-fi
-
-# --with-fam -> add include path
-PHP_ADD_INCLUDE($FAM_DIR/include)
-
-# --with-fam -> chech for lib and symbol presence
-LIBNAME=fam # you may want to change this
-LIBSYMBOL=FAMOpen # you most likely want to change this
-
-PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
-[
- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $FAM_DIR/lib, FAM_SHARED_LIBADD)
- AC_DEFINE(HAVE_FAMLIB,1,[ ])
-],[
- AC_MSG_ERROR([wrong fam lib version or lib not found])
-],[
- -L$FAM_DIR/lib -lm -ldl
-])
-
-PHP_SUBST(FAM_SHARED_LIBADD)
-
- PHP_NEW_EXTENSION(fam, fam.c, $ext_shared)
-fi
diff --git a/ext/fam/fam.c b/ext/fam/fam.c
deleted file mode 100644
index 160049bd7..000000000
--- a/ext/fam/fam.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Sascha Schumann <sascha@schumann.cx> |
- +----------------------------------------------------------------------+
-
- $Id: fam.c,v 1.8.2.1 2005/02/08 05:38:04 rasmus Exp $
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_fam.h"
-
-#include <fam.h>
-
-/* If you declare any globals in php_fam.h uncomment this:
-ZEND_DECLARE_MODULE_GLOBALS(fam)
-*/
-
-/* True global resources - no need for thread safety here */
-static int le_fam, le_fam_r;
-
-/* {{{ fam_functions[]
- *
- * Every user visible function must have an entry in fam_functions[].
- */
-function_entry fam_functions[] = {
- PHP_FE(fam_open, NULL)
- PHP_FE(fam_close, NULL)
- PHP_FE(fam_monitor_directory, NULL)
- PHP_FE(fam_monitor_file, NULL)
- PHP_FE(fam_monitor_collection, NULL)
- PHP_FE(fam_suspend_monitor, NULL)
- PHP_FE(fam_resume_monitor, NULL)
- PHP_FE(fam_cancel_monitor, NULL)
- PHP_FE(fam_pending, NULL)
- PHP_FE(fam_next_event, NULL)
- {NULL, NULL, NULL} /* Must be the last line in fam_functions[] */
-};
-/* }}} */
-
-/* {{{ fam_module_entry
- */
-zend_module_entry fam_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
- STANDARD_MODULE_HEADER,
-#endif
- "fam",
- fam_functions,
- PHP_MINIT(fam),
- NULL,
- NULL,
- NULL,
- PHP_MINFO(fam),
-#if ZEND_MODULE_API_NO >= 20010901
- "0.1", /* Replace with version number for your extension */
-#endif
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-#ifdef COMPILE_DL_FAM
-ZEND_GET_MODULE(fam)
-#endif
-
-/* {{{ php_fam_init_globals
- */
-/* Uncomment this function if you have INI entries
-static void php_fam_init_globals(zend_fam_globals *fam_globals)
-{
- fam_globals->global_value = 0;
- fam_globals->global_string = NULL;
-}
-*/
-/* }}} */
-
-static void rsrc_close_fam(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- FAMConnection *fc = (FAMConnection *) rsrc->ptr;
- FAMClose(fc);
- efree(fc);
-}
-
-static void rsrc_close_fam_r(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- /* No need to close */
- efree(rsrc->ptr);
-}
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(fam)
-{
- le_fam = zend_register_list_destructors_ex(rsrc_close_fam, NULL, "fam connections", module_number);
- le_fam_r = zend_register_list_destructors_ex(rsrc_close_fam_r, NULL, "fam requests", module_number);
- /* If you have INI entries, uncomment these lines
- ZEND_INIT_MODULE_GLOBALS(fam, php_fam_init_globals, NULL);
- REGISTER_INI_ENTRIES();
- */
-
-
- REGISTER_LONG_CONSTANT("FAMChanged", FAMChanged, CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FAMDeleted", FAMDeleted, CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FAMStartExecuting", FAMStartExecuting, CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FAMStopExecuting", FAMStopExecuting, CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FAMCreated", FAMCreated, CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FAMMoved", FAMMoved, CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FAMAcknowledge", FAMAcknowledge, CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FAMExists", FAMExists, CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FAMEndExist", FAMEndExist, CONST_PERSISTENT);
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(fam)
-{
- php_info_print_table_start();
- php_info_print_table_header(2, "fam support", "enabled");
- php_info_print_table_end();
-
- /* Remove comments if you have entries in php.ini
- DISPLAY_INI_ENTRIES();
- */
-}
-/* }}} */
-
-
-/* {{{ proto resource fam_open([string appname])
- Open FAM connection */
-PHP_FUNCTION(fam_open)
-{
- char *appname = NULL;
- int argc = ZEND_NUM_ARGS();
- int appname_len;
- FAMConnection *fc;
- int r;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "|s", &appname, &appname_len) == FAILURE)
- return;
-
- fc = emalloc(sizeof *fc);
- r = FAMOpen2(fc, appname);
-
- if (r < 0) {
- efree(fc);
- RETURN_FALSE;
- }
-
- ZEND_REGISTER_RESOURCE(return_value, fc, le_fam);
-}
-/* }}} */
-
-/* {{{ proto void fam_close(resource id)
- Close FAM connection */
-PHP_FUNCTION(fam_close)
-{
- int argc = ZEND_NUM_ARGS();
- zval *id;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "r", &id) == FAILURE)
- return;
-
- zend_list_delete(Z_RESVAL_P(id));
-}
-/* }}} */
-
-/* {{{ proto resource fam_monitor_directory(resource id, string dirname)
- Monitor a directory for changes */
-PHP_FUNCTION(fam_monitor_directory)
-{
- char *dirname = NULL;
- int argc = ZEND_NUM_ARGS();
- int dirname_len;
- zval *id;
- FAMRequest *fr;
- FAMConnection *fc;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "rs", &id, &dirname, &dirname_len) == FAILURE)
- return;
-
- ZEND_FETCH_RESOURCE(fc, FAMConnection *, &id, -1, "fam", le_fam);
- ZEND_VERIFY_RESOURCE(fc);
-
- fr = emalloc(sizeof *fr);
-
- if (FAMMonitorDirectory(fc, dirname, fr, NULL) < 0) {
- efree(fr);
- RETURN_FALSE;
- }
-
- ZEND_REGISTER_RESOURCE(return_value, fr, le_fam_r);
-}
-/* }}} */
-
-/* {{{ proto resource fam_monitor_file(resource id, string filename)
- Monitor a regular file for changes */
-PHP_FUNCTION(fam_monitor_file)
-{
- char *filename = NULL;
- int argc = ZEND_NUM_ARGS();
- int filename_len;
- zval *id;
- FAMRequest *fr;
- FAMConnection *fc;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "rs", &id, &filename, &filename_len) == FAILURE)
- return;
-
- ZEND_FETCH_RESOURCE(fc, FAMConnection *, &id, -1, "fam", le_fam);
- ZEND_VERIFY_RESOURCE(fc);
-
- fr = emalloc(sizeof *fr);
-
- if (FAMMonitorFile(fc, filename, fr, NULL) < 0) {
- efree(fr);
- RETURN_FALSE;
- }
-
- ZEND_REGISTER_RESOURCE(return_value, fr, le_fam_r);
-}
-/* }}} */
-
-/* {{{ proto resource fam_monitor_collection(resource id, string dirname, int depth, string mask)
- Monitor a collection of files in a directory for changes */
-PHP_FUNCTION(fam_monitor_collection)
-{
- char *dirname = NULL;
- char *mask = NULL;
- int argc = ZEND_NUM_ARGS();
- int dirname_len;
- int mask_len;
- zval *id;
- long depth;
- FAMRequest *fr;
- FAMConnection *fc;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "rsls", &id, &dirname, &dirname_len, &depth, &mask, &mask_len) == FAILURE)
- return;
-
- ZEND_FETCH_RESOURCE(fc, FAMConnection *, &id, -1, "fam", le_fam);
- ZEND_VERIFY_RESOURCE(fc);
-
- fr = emalloc(sizeof *fr);
-
- if (FAMMonitorCollection(fc, dirname, fr, NULL, depth, mask) < 0) {
- efree(fr);
- RETURN_FALSE;
- }
-
- ZEND_REGISTER_RESOURCE(return_value, fr, le_fam_r);
-
-}
-/* }}} */
-
-/* {{{ proto bool fam_suspend_monitor(resource id, resource monitor_id)
- Temporary suspend monitoring */
-PHP_FUNCTION(fam_suspend_monitor)
-{
- int argc = ZEND_NUM_ARGS();
- zval *id;
- zval *monitor_id;
- FAMRequest *fr;
- FAMConnection *fc;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "rr", &id, &monitor_id) == FAILURE)
- return;
-
- ZEND_FETCH_RESOURCE(fc, FAMConnection *, &id, -1, "fam", le_fam);
- ZEND_VERIFY_RESOURCE(fc);
- ZEND_FETCH_RESOURCE(fr, FAMRequest *, &monitor_id, -1, "fam", le_fam_r);
- ZEND_VERIFY_RESOURCE(fr);
-
- if (FAMSuspendMonitor(fc, fr) < 0)
- RETURN_FALSE;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool fam_resume_monitor(resource id, resource monitor_id)
- Resume suspended monitoring */
-PHP_FUNCTION(fam_resume_monitor)
-{
- int argc = ZEND_NUM_ARGS();
- zval *id;
- zval *monitor_id;
- FAMRequest *fr;
- FAMConnection *fc;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "rr", &id, &monitor_id) == FAILURE)
- return;
-
- ZEND_FETCH_RESOURCE(fc, FAMConnection *, &id, -1, "fam", le_fam);
- ZEND_VERIFY_RESOURCE(fc);
- ZEND_FETCH_RESOURCE(fr, FAMRequest *, &monitor_id, -1, "fam", le_fam_r);
- ZEND_VERIFY_RESOURCE(fr);
-
- if (FAMResumeMonitor(fc, fr) < 0)
- RETURN_FALSE;
- RETURN_TRUE;
-
-}
-/* }}} */
-
-/* {{{ proto bool fam_cancel_monitor(resource id, resource monitor_id)
- Terminate monitoring */
-PHP_FUNCTION(fam_cancel_monitor)
-{
- int argc = ZEND_NUM_ARGS();
- zval *id;
- zval *monitor_id;
- FAMRequest *fr;
- FAMConnection *fc;
- int r;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "rr", &id, &monitor_id) == FAILURE)
- return;
-
- ZEND_FETCH_RESOURCE(fc, FAMConnection *, &id, -1, "fam", le_fam);
- ZEND_VERIFY_RESOURCE(fc);
- ZEND_FETCH_RESOURCE(fr, FAMRequest *, &monitor_id, -1, "fam", le_fam_r);
- ZEND_VERIFY_RESOURCE(fr);
-
- r = FAMCancelMonitor(fc, fr);
-
- zend_list_delete(Z_RESVAL_P(monitor_id));
-
- if (r < 0)
- RETURN_FALSE;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int fam_pending(resource id)
- Check for pending FAM events */
-PHP_FUNCTION(fam_pending)
-{
- int argc = ZEND_NUM_ARGS();
- zval *id;
- FAMConnection *fc;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "r", &id) == FAILURE)
- return;
-
- ZEND_FETCH_RESOURCE(fc, FAMConnection *, &id, -1, "fam", le_fam);
- ZEND_VERIFY_RESOURCE(fc);
-
- RETVAL_LONG(FAMPending(fc));
-}
-/* }}} */
-
-/* {{{ proto array fam_next_event(resource id)
- Get next pending FAM event */
-PHP_FUNCTION(fam_next_event)
-{
- int argc = ZEND_NUM_ARGS();
- zval *id;
- FAMConnection *fc;
- FAMEvent fe;
-
- if (zend_parse_parameters(argc TSRMLS_CC, "r", &id) == FAILURE)
- return;
-
- ZEND_FETCH_RESOURCE(fc, FAMConnection *, &id, -1, "fam", le_fam);
- ZEND_VERIFY_RESOURCE(fc);
-
- if (FAMNextEvent(fc, &fe) < 0)
- RETURN_FALSE;
-
- array_init(return_value);
- if (fe.hostname)
- add_assoc_string(return_value, "hostname", fe.hostname, 1);
- add_assoc_string(return_value, "filename", fe.filename, 1);
- add_assoc_long(return_value, "code", fe.code);
-}
-/* }}} */
-
-
-/*
- * 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/fam/package.xml b/ext/fam/package.xml
deleted file mode 100644
index 41f46b8a6..000000000
--- a/ext/fam/package.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>fam</name>
- <summary>File Alteration Monitor Functions</summary>
- <maintainers>
- <maintainer>
- <user>sas</user>
- <name>Sascha Schumann</name>
- <email>sascha@schumann.cx</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-FAM monitors files and directories, notifying interested
-applications of changes.
-A PHP script may specify a list of files for FAM to monitor
-using the functions provided by this extension.
-The FAM process is started when the first connection from
-any application to it is opened. It exits after all
-connections to it have been closed.
- </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="fam.c"/>
- <file role="src" name="php_fam.h"/>
- </filelist>
- <configureoptions>
- <configureoption name="with-fam" default="autodetect" prompt="path to fam installation?"/>
- </configureoptions>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/fbsql/config.m4 b/ext/fbsql/config.m4
index 3d4db92be..3db7cad65 100644
--- a/ext/fbsql/config.m4
+++ b/ext/fbsql/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.13 2003/10/01 02:53:04 sniper Exp $
+dnl $Id: config.m4,v 1.14 2005/05/29 23:16:40 sniper Exp $
dnl
PHP_ARG_WITH(fbsql, for FrontBase SQL92 (fbsql) support,
-[ --with-fbsql[=DIR] Include FrontBase support. DIR is the FrontBase base directory.])
+[ --with-fbsql[=DIR] Include FrontBase support. DIR is the FrontBase base directory])
if test "$PHP_FBSQL" != "no"; then
diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c
index 773cdef23..2fc299426 100644
--- a/ext/fbsql/php_fbsql.c
+++ b/ext/fbsql/php_fbsql.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_fbsql.c,v 1.105.2.5 2005/02/09 19:32:45 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.114 2005/08/03 14:07:08 sniper Exp $ */
/* TODO:
*
@@ -184,72 +184,74 @@ char *DigestPassword(char *user, char *password)
/* {{{ fbsql_functions[]
*/
function_entry fbsql_functions[] = {
- PHP_FE(fbsql_connect, NULL)
- PHP_FE(fbsql_pconnect, NULL)
- PHP_FE(fbsql_close, NULL)
- PHP_FE(fbsql_select_db, NULL)
- PHP_FE(fbsql_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_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, NULL)
+ PHP_FE(fbsql_pconnect, NULL)
+ PHP_FE(fbsql_close, NULL)
+ PHP_FE(fbsql_select_db, NULL)
+ PHP_FE(fbsql_set_characterset, NULL)
+ PHP_FE(fbsql_create_db, NULL)
+ PHP_FE(fbsql_drop_db, NULL)
+ PHP_FE(fbsql_start_db, NULL)
+ PHP_FE(fbsql_stop_db, NULL)
+ PHP_FE(fbsql_db_status, NULL)
+ PHP_FE(fbsql_query, NULL)
+ PHP_FE(fbsql_db_query, NULL)
+ PHP_FE(fbsql_list_dbs, NULL)
+ PHP_FE(fbsql_list_tables, NULL)
+ PHP_FE(fbsql_list_fields, NULL)
+ PHP_FE(fbsql_error, NULL)
+ PHP_FE(fbsql_errno, NULL)
+ PHP_FE(fbsql_affected_rows, NULL)
+ PHP_FE(fbsql_rows_fetched, NULL)
+ PHP_FE(fbsql_insert_id, NULL)
+ PHP_FE(fbsql_result, NULL)
+ PHP_FE(fbsql_next_result, NULL)
+ PHP_FE(fbsql_num_rows, NULL)
+ PHP_FE(fbsql_num_fields, NULL)
+ PHP_FE(fbsql_fetch_row, NULL)
+ PHP_FE(fbsql_fetch_array, NULL)
+ PHP_FE(fbsql_fetch_assoc, NULL)
+ PHP_FE(fbsql_fetch_object, NULL)
+ PHP_FE(fbsql_data_seek, NULL)
+ PHP_FE(fbsql_fetch_lengths, NULL)
+ PHP_FE(fbsql_fetch_field, NULL)
+ PHP_FE(fbsql_field_seek, NULL)
+ PHP_FE(fbsql_free_result, NULL)
+ PHP_FE(fbsql_field_name, NULL)
+ PHP_FE(fbsql_field_table, NULL)
+ PHP_FE(fbsql_field_len, NULL)
+ PHP_FE(fbsql_field_type, NULL)
+ PHP_FE(fbsql_field_flags, NULL)
+ PHP_FE(fbsql_table_name, NULL)
/* Fontbase additions: */
PHP_FE(fbsql_set_transaction, NULL)
- PHP_FE(fbsql_autocommit, NULL)
- PHP_FE(fbsql_commit, NULL)
- PHP_FE(fbsql_rollback, NULL)
-
- PHP_FE(fbsql_create_blob, NULL)
- PHP_FE(fbsql_create_clob, NULL)
- PHP_FE(fbsql_set_lob_mode, NULL)
- PHP_FE(fbsql_read_blob, NULL)
- PHP_FE(fbsql_read_clob, NULL)
- PHP_FE(fbsql_blob_size, NULL)
- PHP_FE(fbsql_clob_size, NULL)
-
- PHP_FE(fbsql_hostname, NULL)
- PHP_FE(fbsql_database, NULL)
+ PHP_FE(fbsql_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_username, NULL)
+ PHP_FE(fbsql_password, NULL)
+ PHP_FE(fbsql_warnings, NULL)
PHP_FE(fbsql_set_password, NULL)
PHP_FE(fbsql_get_autostart_info, NULL)
/* PHP_FE(fbsql_set_autostart_info, NULL) */
/* Aliases: */
- PHP_FALIAS(fbsql, fbsql_db_query, NULL)
- PHP_FALIAS(fbsql_tablename, fbsql_table_name, NULL)
+ PHP_FALIAS(fbsql, fbsql_db_query, NULL)
+ PHP_FALIAS(fbsql_tablename, fbsql_table_name, NULL)
{NULL, NULL, NULL}
};
@@ -297,9 +299,9 @@ static void phpfbReleaseResult(zend_rsrc_list_entry *rsrc TSRMLS_DC)
fbcmdRelease(md);
}
if (result->rowHandler) fbcrhRelease(result->rowHandler);
- if (result->ResultmetaData) fbcmdRelease(result->ResultmetaData);
if (result->list) fbcplRelease(result->list);
if (result->array) fbaRelease(result->array);
+ if (result->ResultmetaData) fbcmdRelease(result->ResultmetaData);
efree(result);
}
}
@@ -369,7 +371,7 @@ static int php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
}
-static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link);
+static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link, long batch_size);
/* {{{ PHP_INI
*/
@@ -381,7 +383,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY_EX ("fbsql.max_links", "128", PHP_INI_SYSTEM, OnUpdateLong, maxLinks, zend_fbsql_globals, fbsql_globals, display_link_numbers)
STD_PHP_INI_ENTRY_EX ("fbsql.max_connections", "128", PHP_INI_SYSTEM, OnUpdateLong, maxConnections, zend_fbsql_globals, fbsql_globals, display_link_numbers)
STD_PHP_INI_ENTRY_EX ("fbsql.max_results", "128", PHP_INI_SYSTEM, OnUpdateLong, maxResults, zend_fbsql_globals, fbsql_globals, display_link_numbers)
- STD_PHP_INI_ENTRY_EX ("fbsql.batchSize", "1000", PHP_INI_SYSTEM, OnUpdateLong, batchSize, zend_fbsql_globals, fbsql_globals, display_link_numbers)
+ STD_PHP_INI_ENTRY_EX ("fbsql.batchsize", "1000", PHP_INI_ALL, OnUpdateLong, batchSize, zend_fbsql_globals, fbsql_globals, display_link_numbers)
STD_PHP_INI_ENTRY ("fbsql.default_host", NULL, PHP_INI_SYSTEM, OnUpdateString, hostName, zend_fbsql_globals, fbsql_globals)
STD_PHP_INI_ENTRY ("fbsql.default_user", "_SYSTEM", PHP_INI_SYSTEM, OnUpdateString, userName, zend_fbsql_globals, fbsql_globals)
STD_PHP_INI_ENTRY ("fbsql.default_password", "", PHP_INI_SYSTEM, OnUpdateString, userPassword, zend_fbsql_globals, fbsql_globals)
@@ -434,6 +436,9 @@ PHP_MINIT_FUNCTION(fbsql)
REGISTER_LONG_CONSTANT("FBSQL_ISO_SERIALIZABLE", FBSQL_ISO_SERIALIZABLE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FBSQL_ISO_VERSIONED", FBSQL_ISO_VERSIONED, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FBSQL_UTF8", 0, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FBSQL_ISO8859_1", FBC_ISO8859_1, CONST_CS | CONST_PERSISTENT);
+
/* Register Status constants */
REGISTER_LONG_CONSTANT("FBSQL_UNKNOWN", FBUnknownStatus, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FBSQL_STOPPED", FBStopped, CONST_CS | CONST_PERSISTENT);
@@ -652,8 +657,9 @@ int phpfbFetchRow(PHPFBResult* result, unsigned int row)
if (result->rowHandler == NULL)
{
void *rawData = fbcdcFetch(result->link->connection, result->batchSize, result->fetchHandle);
- if (rawData == NULL)
+ if (rawData == NULL) {
result->rowCount = 0;
+ }
else
result->rowHandler = fbcrhInitWith(rawData, result->metaData);
}
@@ -769,7 +775,7 @@ static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message");
}
link->errorText = strdup(emg);
- link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);;
+ link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);
free(emg);
fbcemdRelease(emd);
fbcmdRelease(md);
@@ -1245,7 +1251,12 @@ PHP_FUNCTION(fbsql_database)
if (phpLink->databaseName) free(phpLink->databaseName);
phpLink->databaseName = strdup(Z_STRVAL_PP(dbname));
}
- RETURN_STRING(phpLink->databaseName, 1);
+ if (phpLink->databaseName) {
+ RETURN_STRING(phpLink->databaseName, 1);
+ }
+ else {
+ RETURN_FALSE;
+ }
}
/* }}} */
@@ -1438,6 +1449,43 @@ PHP_FUNCTION(fbsql_select_db)
}
/* }}} */
+/* {{{ proto void fbsql_set_characterset(resource link_identifier, long charcterset [, long in_out_both]])
+ Change input/output character set */
+PHP_FUNCTION(fbsql_set_characterset)
+{
+ PHPFBLink* phpLink = NULL;
+ zval **fbsql_link_index, **zcharset, **zin_out;
+ int id = -1;
+ int charset = -1, in_out_both = 3;
+
+ switch (ZEND_NUM_ARGS()) {
+ case 2:
+ if (zend_get_parameters_ex(2, &fbsql_link_index, &zcharset)==FAILURE) {
+ RETURN_FALSE;
+ }
+ break;
+ case 3:
+ if (zend_get_parameters_ex(3, &fbsql_link_index, &zcharset, &zin_out)==FAILURE) {
+ RETURN_FALSE;
+ }
+ in_out_both = Z_LVAL_PP(zin_out);
+ break;
+ default:
+ WRONG_PARAM_COUNT;
+ break;
+ }
+ ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink);
+
+ charset = Z_LVAL_PP(zcharset);
+
+ if (in_out_both & 1) {
+ fbcdcSetInputCharacterSet(phpLink->connection, charset);
+ }
+ if (in_out_both & 2) {
+ fbcdcSetOutputCharacterSet(phpLink->connection, charset);
+ }
+}
+
/* {{{ proto int fbsql_change_user(string user, string password [, string database [, resource link_identifier]])
Change the user for a session */
PHP_FUNCTION(fbsql_change_user)
@@ -1490,7 +1538,7 @@ PHP_FUNCTION(fbsql_change_user)
RETURN_FALSE;
}
- phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, buffer, phpLink);
+ phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, buffer, phpLink, 0);
if (Z_LVAL_P(return_value))
{
free(phpLink->userName);
@@ -1504,10 +1552,10 @@ PHP_FUNCTION(fbsql_change_user)
PHP_FUNCTION(fbsql_create_db)
{
PHPFBLink* phpLink = NULL;
- zval **fbsql_link_index = NULL, **database_name;
+ zval **fbsql_link_index = NULL, **database_name, **database_options = NULL;
int id;
int i, status;
- char *databaseName;
+ char *databaseName, *databaseOptions = NULL;
switch (ZEND_NUM_ARGS()) {
case 1:
@@ -1523,6 +1571,14 @@ PHP_FUNCTION(fbsql_create_db)
}
id = -1;
break;
+ case 3:
+ if (zend_get_parameters_ex(3, &database_name, &fbsql_link_index, &database_options)==FAILURE) {
+ RETURN_FALSE;
+ }
+ id = -1;
+ convert_to_string_ex(database_options);
+ databaseOptions = Z_STRVAL_PP(database_options);
+ break;
default:
WRONG_PARAM_COUNT;
break;
@@ -1546,7 +1602,7 @@ PHP_FUNCTION(fbsql_create_db)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create %s@%s, database is %s", databaseName, phpLink->hostName, txt);
RETURN_FALSE;
}
- if (!fbcehCreateDatabaseNamedWithOptions(phpLink->execHandler, databaseName, ""))
+ if (!fbcehCreateDatabaseNamedWithOptions(phpLink->execHandler, databaseName, databaseOptions))
{
char* error = fbechErrorMessage(phpLink->execHandler);
if (FB_SQL_G(generateWarnings))
@@ -1648,15 +1704,15 @@ PHP_FUNCTION(fbsql_drop_db)
}
/* }}} */
-/* {{{ proto bool fbsql_start_db(string database_name [, resource link_identifier])
+/* {{{ proto bool fbsql_start_db(string database_name [, resource link_identifier [, string database_options]])
Start a database on the server */
PHP_FUNCTION(fbsql_start_db)
{
PHPFBLink* phpLink = NULL;
- zval **fbsql_link_index = NULL, **database_name;
+ zval **fbsql_link_index = NULL, **database_name, **database_options;
int id;
int i, status;
- char *databaseName;
+ char *databaseName, *databaseOptions = NULL;
switch (ZEND_NUM_ARGS()) {
case 1:
@@ -1672,6 +1728,14 @@ PHP_FUNCTION(fbsql_start_db)
}
id = -1;
break;
+ case 3:
+ if (zend_get_parameters_ex(3, &database_name, &fbsql_link_index, &database_options)==FAILURE) {
+ RETURN_FALSE;
+ }
+ id = -1;
+ convert_to_string_ex(database_options);
+ databaseOptions = Z_STRVAL_PP(database_options);
+ break;
default:
WRONG_PARAM_COUNT;
break;
@@ -1698,7 +1762,16 @@ PHP_FUNCTION(fbsql_start_db)
if (status == FBStopped)
{
- if (!fbcehStartDatabaseNamed (phpLink->execHandler, databaseName))
+ int dbstarted;
+ if (databaseOptions != NULL)
+ {
+ dbstarted = fbcehStartDatabaseNamedWithOptions(phpLink->execHandler, databaseName, databaseOptions);
+ }
+ else
+ {
+ dbstarted = fbcehStartDatabaseNamed(phpLink->execHandler, databaseName);
+ }
+ if (!dbstarted)
{
char* error = fbechErrorMessage(phpLink->execHandler);
if (FB_SQL_G(generateWarnings))
@@ -1862,7 +1935,7 @@ int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message");
}
link->errorText = strdup(emg);
- link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);;
+ link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);
free(emg);
fbcemdRelease(emd);
result = 0;
@@ -1885,20 +1958,18 @@ int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql)
result = 1;
}
return result;
- return result;
}
/* }}} */
-static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link)
+static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link, long batch_size)
{
PHPFBResult* result = NULL;
FBCMetaData* md, *meta;
char* tp;
- char* fh;
+ char* fh = NULL;
unsigned int sR = 1, cR = 0;
meta = fbcdcExecuteDirectSQL(link->connection, sql);
-
if (!mdOk(link, meta, sql))
{
fbcmdRelease(meta);
@@ -1918,19 +1989,19 @@ static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link)
ZVAL_BOOL(return_value, 1)
}
else if ((tp[0] == 'C') || (tp[0] == 'R'))
- {
+ {
if (sR == 1 && md) fbcmdRelease(md);
ZVAL_BOOL(return_value, 1)
}
else if ((fh = fbcmdFetchHandle(md)) || tp[0] == 'E' || (tp[0] == 'U' && fh))
{
- result = emalloc(sizeof(PHPFBResult));
+ result = (PHPFBResult *)emalloc(sizeof(PHPFBResult));
result->link = link;
- result->fetchHandle = fh;
+ result->rowHandler = NULL;
+ result->fetchHandle = NULL;
result->ResultmetaData = meta;
result->metaData = md;
- result->rowHandler = NULL;
- result->batchSize = FB_SQL_G(batchSize);
+ result->batchSize = batch_size > 0 ? batch_size : FB_SQL_G(batchSize);
result->rowCount = 0x7fffffff;
result->columnCount = 0;
result->rowIndex = 0;
@@ -1946,7 +2017,6 @@ static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link)
{
result->columnCount = fbcmdColumnCount(md);
result->fetchHandle = fh;
- result->batchSize = FB_SQL_G(batchSize);
}
else
{
@@ -1975,13 +2045,13 @@ static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link)
}
}
-/* {{{ proto resource fbsql_query(string query [, resource link_identifier])
+/* {{{ proto resource fbsql_query(string query [, resource link_identifier [, long batch_size]])
Send one or more SQL statements to the server and execute them */
PHP_FUNCTION(fbsql_query)
{
PHPFBLink* phpLink = NULL;
- zval **fbsql_link_index = NULL, **query;
- int id;
+ zval **fbsql_link_index = NULL, **query, **batch_size;
+ int id, bs = 0;
switch (ZEND_NUM_ARGS()) {
case 1:
@@ -1997,6 +2067,14 @@ PHP_FUNCTION(fbsql_query)
}
id = -1;
break;
+ case 3:
+ if (zend_get_parameters_ex(3, &query, &fbsql_link_index, &batch_size)==FAILURE) {
+ RETURN_FALSE;
+ }
+ id = -1;
+ convert_to_long_ex(batch_size);
+ bs = Z_LVAL_PP(batch_size);
+ break;
default:
WRONG_PARAM_COUNT;
break;
@@ -2004,8 +2082,7 @@ PHP_FUNCTION(fbsql_query)
ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink);
convert_to_string_ex(query);
-
- phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink);
+ phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink, bs);
}
/* }}} */
@@ -2041,7 +2118,7 @@ PHP_FUNCTION(fbsql_db_query)
convert_to_string_ex(dbname);
if (php_fbsql_select_db(Z_STRVAL_PP(dbname), phpLink TSRMLS_CC)) {
- phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink);
+ phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink, 0);
} else {
RETURN_FALSE;
}
@@ -2133,7 +2210,7 @@ PHP_FUNCTION(fbsql_list_tables)
php_fbsql_select_db(databaseName, phpLink TSRMLS_CC);
}
- phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink);
+ phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink, 0);
}
/* }}} */
@@ -2180,7 +2257,7 @@ PHP_FUNCTION(fbsql_list_fields)
RETURN_FALSE;
}
- phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink);
+ phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink, 0);
}
/* }}} */
@@ -2294,6 +2371,36 @@ PHP_FUNCTION(fbsql_affected_rows)
}
/* }}} */
+/* {{{ proto int fbsql_affected_rows([resource link_identifier])
+ Get the number of rows affected by the last statement */
+PHP_FUNCTION(fbsql_rows_fetched)
+{
+ PHPFBResult* phpResult = NULL;
+ zval **result = NULL;
+ int id;
+
+ switch (ZEND_NUM_ARGS()) {
+ case 1:
+ if (zend_get_parameters_ex(1, &result)==FAILURE) {
+ RETURN_FALSE;
+ }
+ id = -1;
+ break;
+ default:
+ WRONG_PARAM_COUNT;
+ break;
+ }
+ ZEND_FETCH_RESOURCE(phpResult, PHPFBResult *, result, id, "FrontBase-Result", le_result);
+
+ if (!phpResult->rowHandler) {
+ RETURN_FALSE;
+ }
+ else {
+ RETURN_LONG(fbcrhRowCount(phpResult->rowHandler));
+ }
+}
+/* }}} */
+
/* {{{ proto int fbsql_insert_id([resource link_identifier])
Get the internal index for the last insert statement */
PHP_FUNCTION(fbsql_insert_id)
diff --git a/ext/fbsql/php_fbsql.h b/ext/fbsql/php_fbsql.h
index bffb8b2fd..bee9bd96b 100644
--- a/ext/fbsql/php_fbsql.h
+++ b/ext/fbsql/php_fbsql.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_fbsql.h,v 1.28 2004/02/26 20:31:14 fmk Exp $ */
+/* $Id: php_fbsql.h,v 1.31 2005/08/03 14:07:09 sniper Exp $ */
#define HAVE_FBSQL 1
@@ -43,6 +43,7 @@ PHP_FUNCTION(fbsql_connect);
PHP_FUNCTION(fbsql_pconnect);
PHP_FUNCTION(fbsql_close);
PHP_FUNCTION(fbsql_select_db);
+PHP_FUNCTION(fbsql_set_characterset);
PHP_FUNCTION(fbsql_change_user);
PHP_FUNCTION(fbsql_create_db);
PHP_FUNCTION(fbsql_drop_db);
@@ -57,6 +58,7 @@ PHP_FUNCTION(fbsql_list_fields);
PHP_FUNCTION(fbsql_error);
PHP_FUNCTION(fbsql_errno);
PHP_FUNCTION(fbsql_affected_rows);
+PHP_FUNCTION(fbsql_rows_fetched);
PHP_FUNCTION(fbsql_insert_id);
PHP_FUNCTION(fbsql_result);
PHP_FUNCTION(fbsql_next_result);
diff --git a/ext/fdf/config.m4 b/ext/fdf/config.m4
index 4e2c4d3a1..b6abd48d5 100644
--- a/ext/fdf/config.m4
+++ b/ext/fdf/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.24 2003/10/01 02:53:05 sniper Exp $
+dnl $Id: config.m4,v 1.25 2005/05/29 23:16:40 sniper Exp $
dnl
PHP_ARG_WITH(fdftk, for FDF support,
-[ --with-fdftk[=DIR] Include FDF support.])
+[ --with-fdftk[=DIR] Include FDF support])
if test "$PHP_FDFTK" != "no"; then
diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c
index 606a708e5..4c3f58cfe 100644
--- a/ext/fdf/fdf.c
+++ b/ext/fdf/fdf.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fdf.c,v 1.86.2.1 2004/11/08 04:54:58 iliaa Exp $ */
+/* $Id: fdf.c,v 1.89 2005/08/03 14:07:09 sniper Exp $ */
/* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from
http://beta1.adobe.com/ada/acrosdk/forms.html. */
@@ -145,7 +145,7 @@ PHP_MINIT_FUNCTION(fdf)
le_fdf = zend_register_list_destructors_ex(phpi_FDFClose, NULL, "fdf", module_number);
/* add handler for Acrobat FDF form post requests */
- sapi_register_post_entry(&php_fdf_post_entry);
+ sapi_register_post_entry(&php_fdf_post_entry TSRMLS_CC);
/* Constants used by fdf_set_opt() */
@@ -215,7 +215,7 @@ PHP_MINFO_FUNCTION(fdf)
PHP_MSHUTDOWN_FUNCTION(fdf)
{
/* remove handler for Acrobat FDF form post requests */
- sapi_unregister_post_entry(&php_fdf_post_entry);
+ sapi_unregister_post_entry(&php_fdf_post_entry TSRMLS_CC);
#ifdef PHP_WIN32
return SUCCESS;
diff --git a/ext/fdf/php_fdf.h b/ext/fdf/php_fdf.h
index b3fbd0b3a..fd5a8a013 100644
--- a/ext/fdf/php_fdf.h
+++ b/ext/fdf/php_fdf.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_fdf.h,v 1.21 2004/01/08 17:32:06 sniper Exp $ */
+/* $Id: php_fdf.h,v 1.22 2005/08/03 14:07:10 sniper Exp $ */
#ifndef PHP_FDF_H
#define PHP_FDF_H
diff --git a/ext/filepro/config.m4 b/ext/filepro/config.m4
index ecde3bcaf..bad7cee1d 100644
--- a/ext/filepro/config.m4
+++ b/ext/filepro/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.7 2003/10/03 05:24:21 sniper Exp $
+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.])
+[ --enable-filepro Enable the bundled read-only filePro support])
if test "$PHP_FILEPRO" = "yes"; then
AC_DEFINE(HAVE_FILEPRO, 1, [ ])
diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c
index 322b75a22..a9f13272b 100644
--- a/ext/filepro/filepro.c
+++ b/ext/filepro/filepro.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: filepro.c,v 1.55.2.1 2005/02/07 13:31:42 tony2001 Exp $ */
+/* $Id: filepro.c,v 1.57 2005/08/03 14:07:10 sniper Exp $ */
/*
filePro 4.x support developed by Chad Robinson, chadr@brttech.com
diff --git a/ext/filepro/package.xml b/ext/filepro/package.xml
index b1d342fc9..cb118b054 100644
--- a/ext/filepro/package.xml
+++ b/ext/filepro/package.xml
@@ -2,7 +2,7 @@
<!DOCTYPE package SYSTEM "../pear/package.dtd">
<package>
<name>filepro</name>
- <summary>filePor database access functions/summary>
+ <summary>filePro database access functions</summary>
<maintainers>
<maintainer>
<user>???</user>
diff --git a/ext/filepro/php_filepro.h b/ext/filepro/php_filepro.h
index 632f7d9f6..71085730c 100644
--- a/ext/filepro/php_filepro.h
+++ b/ext/filepro/php_filepro.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_filepro.h,v 1.12.2.1 2005/02/07 13:31:42 tony2001 Exp $ */
+/* $Id: php_filepro.h,v 1.14 2005/08/03 14:07:10 sniper Exp $ */
/*
filePro 4.x support developed by Chad Robinson, chadr@brttech.com
diff --git a/ext/ftp/config.m4 b/ext/ftp/config.m4
index 1e600a14f..3a7bf0794 100644
--- a/ext/ftp/config.m4
+++ b/ext/ftp/config.m4
@@ -1,11 +1,22 @@
dnl
-dnl $Id: config.m4,v 1.7 2002/03/12 16:18:33 sas Exp $
+dnl $Id: config.m4,v 1.7.20.3 2005/11/01 00:32:21 bfrance Exp $
dnl
PHP_ARG_ENABLE(ftp,whether to enable FTP support,
[ --enable-ftp Enable FTP support])
+PHP_ARG_WITH(openssl-dir,OpenSSL dir for FTP,
+[ --with-openssl-dir[=DIR] FTP: openssl install prefix], no, no)
+
if test "$PHP_FTP" = "yes"; then
AC_DEFINE(HAVE_FTP,1,[Whether you want FTP support])
PHP_NEW_EXTENSION(ftp, php_ftp.c ftp.c, $ext_shared)
+
+ dnl Empty variable means 'no'
+ test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
+
+ if test "$PHP_OPENSSL" != "no" || test "$PHP_OPENSSL_DIR" != "no"; then
+ PHP_SETUP_OPENSSL(FTP_SHARED_LIBADD)
+ PHP_SUBST(FTP_SHARED_LIBADD)
+ fi
fi
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 1c4511543..903aa8ba0 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ftp.c,v 1.103.2.7 2005/03/17 17:16:49 iliaa Exp $ */
+/* $Id: ftp.c,v 1.112.2.2 2005/11/05 22:02:15 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -136,7 +136,7 @@ ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC)
ftp->fd = php_network_connect_socket_to_host(host,
(unsigned short) (port ? port : 21), SOCK_STREAM,
- 0, &tv, NULL, NULL TSRMLS_CC);
+ 0, &tv, NULL, NULL, NULL, 0 TSRMLS_CC);
if (ftp->fd == -1) {
goto bail;
}
@@ -148,7 +148,7 @@ ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC)
size = sizeof(ftp->localaddr);
memset(&ftp->localaddr, 0, size);
if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname failed: %s (%d)\n", strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -280,7 +280,9 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL context");
return 0;
}
-
+
+ SSL_CTX_set_options(ctx, SSL_OP_ALL);
+
ftp->ssl_handle = SSL_new(ctx);
if (ftp->ssl_handle == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL handle");
@@ -808,7 +810,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
if (resumepos > 0) {
if (resumepos > 2147483647) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater then 2147483647 bytes.\n");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater then 2147483647 bytes.");
goto bail;
}
sprintf(arg, "%u", resumepos);
@@ -905,7 +907,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, i
if (startpos > 0) {
if (startpos > 2147483647) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater then 2147483647 bytes.\n");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater then 2147483647 bytes.");
goto bail;
}
sprintf(arg, "%u", startpos);
@@ -1384,7 +1386,7 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
sa = (struct sockaddr *) &ftp->localaddr;
/* bind/listen */
if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "socket() failed: %s (%d)\n", strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "socket() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -1399,7 +1401,7 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
tv.tv_sec = ftp->timeout_sec;
tv.tv_usec = 0;
if (php_connect_nonb(fd, (struct sockaddr*) &ftp->pasvaddr, size, &tv) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_connect_nonb() failed: %s (%d)\n", strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_connect_nonb() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -1417,17 +1419,17 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
size = php_sockaddr_size(&addr);
if (bind(fd, (struct sockaddr*) &addr, size) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "bind() failed: %s (%d)\n", strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "bind() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
if (getsockname(fd, (struct sockaddr*) &addr, &size) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname() failed: %s (%d)\n", strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
if (listen(fd, 5) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "listen() failed: %s (%d)\n", strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "listen() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -1513,7 +1515,9 @@ data_accepted:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL context");
return 0;
}
-
+
+ SSL_CTX_set_options(ctx, SSL_OP_ALL);
+
data->ssl_handle = SSL_new(ctx);
if (data->ssl_handle == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL handle");
@@ -1702,7 +1706,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
* since php is 32 bit by design, we bail out with warning
*/
if (resumepos > 2147483647) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater then 2147483648 bytes.\n");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater then 2147483648 bytes.");
goto bail;
}
sprintf(arg, "%u", resumepos);
@@ -1820,7 +1824,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
}
if (startpos > 0) {
if (startpos > 2147483647) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater then 2147483647 bytes.\n");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater then 2147483647 bytes.");
goto bail;
}
sprintf(arg, "%u", startpos);
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index f0a5c3f5a..69033c892 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ftp.h,v 1.42 2004/01/08 17:32:08 sniper Exp $ */
+/* $Id: ftp.h,v 1.43 2005/08/03 14:07:11 sniper Exp $ */
#ifndef FTP_H
#define FTP_H
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index c0a01bfbe..6c8b8ebdd 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ftp.c,v 1.100.2.2 2005/03/10 23:38:01 iliaa Exp $ */
+/* $Id: php_ftp.c,v 1.103 2005/08/03 14:07:11 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h
index 7fa43d3fd..f41f62494 100644
--- a/ext/ftp/php_ftp.h
+++ b/ext/ftp/php_ftp.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ftp.h,v 1.28 2004/01/08 17:32:08 sniper Exp $ */
+/* $Id: php_ftp.h,v 1.29 2005/08/03 14:07:12 sniper Exp $ */
#ifndef _INCLUDED_FTP_H
#define _INCLUDED_FTP_H
diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
index 928e4bf88..5cb6d4324 100644
--- a/ext/gd/config.m4
+++ b/ext/gd/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.144.2.6 2005/05/17 12:23:02 tony2001 Exp $
+dnl $Id: config.m4,v 1.154 2005/05/29 23:16:41 sniper Exp $
dnl
dnl
@@ -8,40 +8,40 @@ dnl
PHP_ARG_WITH(gd, for GD support,
[ --with-gd[=DIR] Include GD support where DIR is GD install prefix.
- If DIR is not set, the bundled GD library will be used.])
+ If DIR is not set, the bundled GD library will be used])
if test -z "$PHP_JPEG_DIR"; then
PHP_ARG_WITH(jpeg-dir, for the location of libjpeg,
- [ --with-jpeg-dir[=DIR] GD: Set the path to libjpeg install prefix.], no, no)
+ [ --with-jpeg-dir[=DIR] GD: Set the path to libjpeg install prefix], no, no)
fi
if test -z "$PHP_PNG_DIR"; then
PHP_ARG_WITH(png-dir, for the location of libpng,
- [ --with-png-dir[=DIR] GD: Set the path to libpng install prefix.], no, no)
+ [ --with-png-dir[=DIR] GD: Set the path to libpng install prefix], no, no)
fi
if test -z "$PHP_ZLIB_DIR"; then
PHP_ARG_WITH(zlib-dir, for the location of libz,
- [ --with-zlib-dir[=DIR] GD: Set the path to libz install prefix.], no, no)
+ [ --with-zlib-dir[=DIR] GD: Set the path to libz install prefix], no, no)
fi
PHP_ARG_WITH(xpm-dir, for the location of libXpm,
-[ --with-xpm-dir[=DIR] GD: Set the path to libXpm install prefix.], no, no)
+[ --with-xpm-dir[=DIR] GD: Set the path to libXpm install prefix], no, no)
PHP_ARG_WITH(ttf, for FreeType 1.x support,
[ --with-ttf[=DIR] GD: Include FreeType 1.x support], no, no)
PHP_ARG_WITH(freetype-dir, for FreeType 2,
-[ --with-freetype-dir[=DIR] GD: Set the path to FreeType 2 install prefix.], no, no)
+[ --with-freetype-dir[=DIR] GD: Set the path to FreeType 2 install prefix], no, no)
PHP_ARG_WITH(t1lib, for T1lib support,
[ --with-t1lib[=DIR] GD: Include T1lib support. T1lib version >= 5.0.0 required], no, no)
PHP_ARG_ENABLE(gd-native-ttf, whether to enable truetype string function in GD,
-[ --enable-gd-native-ttf GD: Enable TrueType string function.], no, no)
+[ --enable-gd-native-ttf GD: Enable TrueType string function], no, no)
PHP_ARG_ENABLE(gd-jis-conv, whether to enable JIS-mapped Japanese font support in GD,
-[ --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support.], no, no)
+[ --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support], no, no)
dnl
dnl Checks for the configure options
@@ -51,7 +51,7 @@ AC_DEFUN([PHP_GD_JPEG],[
if test "$PHP_JPEG_DIR" != "no"; then
for i in $PHP_JPEG_DIR /usr/local /usr; do
- test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i && break
+ test -f $i/$PHP_LIBDIR/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/$PHP_LIBDIR/libjpeg.a && GD_JPEG_DIR=$i && break
done
if test -z "$GD_JPEG_DIR"; then
@@ -61,11 +61,11 @@ AC_DEFUN([PHP_GD_JPEG],[
PHP_CHECK_LIBRARY(jpeg,jpeg_read_header,
[
PHP_ADD_INCLUDE($GD_JPEG_DIR/include)
- PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/lib, GD_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
],[
AC_MSG_ERROR([Problem with libjpeg.(a|so). Please check config.log for more information.])
],[
- -L$GD_JPEG_DIR/lib
+ -L$GD_JPEG_DIR/$PHP_LIBDIR
])
else
AC_MSG_RESULT([If configure fails try --with-jpeg-dir=<DIR>])
@@ -76,7 +76,7 @@ AC_DEFUN([PHP_GD_PNG],[
if test "$PHP_PNG_DIR" != "no"; then
for i in $PHP_PNG_DIR /usr/local /usr; do
- test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i && break
+ test -f $i/$PHP_LIBDIR/libpng.$SHLIB_SUFFIX_NAME -o -f $i/$PHP_LIBDIR/libpng.a && GD_PNG_DIR=$i && break
done
if test -z "$GD_PNG_DIR"; then
@@ -94,12 +94,12 @@ AC_DEFUN([PHP_GD_PNG],[
PHP_CHECK_LIBRARY(png,png_write_image,
[
PHP_ADD_INCLUDE($GD_PNG_DIR/include)
- PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, GD_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/lib, GD_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
],[
AC_MSG_ERROR([Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information.])
],[
- -L$PHP_ZLIB_DIR/lib -lz -L$GD_PNG_DIR/lib
+ -L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz -L$GD_PNG_DIR/$PHP_LIBDIR
])
else
@@ -111,7 +111,7 @@ AC_DEFUN([PHP_GD_XPM],[
if test "$PHP_XPM_DIR" != "no"; then
for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
- test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i && break
+ test -f $i/$PHP_LIBDIR/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/$PHP_LIBDIR/libXpm.a && GD_XPM_DIR=$i && break
done
if test -z "$GD_XPM_DIR"; then
@@ -129,12 +129,12 @@ AC_DEFUN([PHP_GD_XPM],[
PHP_CHECK_LIBRARY(Xpm,XpmFreeXpmImage,
[
PHP_ADD_INCLUDE($GD_XPM_INC)
- PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_DIR/lib, GD_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_DIR/lib, GD_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
],[
AC_MSG_ERROR([Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information.])
],[
- -L$GD_XPM_DIR/lib -lX11
+ -L$GD_XPM_DIR/$PHP_LIBDIR -lX11
])
else
AC_MSG_RESULT(If configure fails try --with-xpm-dir=<DIR>)
@@ -163,7 +163,7 @@ AC_DEFUN([PHP_GD_FREETYPE1],[
fi
if test -n "$TTF_DIR" ; then
AC_DEFINE(HAVE_LIBTTF,1,[ ])
- PHP_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib, GD_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
fi
if test -z "$TTF_INC_DIR"; then
TTF_INC_DIR=$TTF_DIR/include
@@ -188,7 +188,7 @@ AC_DEFUN([PHP_GD_FREETYPE2],[
done
if test -n "$FREETYPE2_DIR" ; then
- PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/lib, GD_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
PHP_ADD_INCLUDE($FREETYPE2_DIR/include)
PHP_ADD_INCLUDE($FREETYPE2_INC_DIR)
AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
@@ -216,11 +216,11 @@ AC_DEFUN([PHP_GD_T1LIB],[
[
AC_DEFINE(HAVE_LIBT1,1,[ ])
PHP_ADD_INCLUDE($GD_T1_DIR/include)
- PHP_ADD_LIBRARY_WITH_PATH(t1, $GD_T1_DIR/lib, GD_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(t1, $GD_T1_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
],[
AC_MSG_ERROR([Problem with libt1.(a|so). Please check config.log for more information.])
],[
- -L$GD_T1_DIR/lib
+ -L$GD_T1_DIR/$PHP_LIBDIR
])
fi
])
@@ -366,7 +366,7 @@ dnl Header path
done
dnl Library path
- for i in lib/gd1.3 lib/gd lib gd1.3 gd ""; do
+ for i in $PHP_LIBDIR/gd1.3 $PHP_LIBDIR/gd $PHP_LIBDIR gd1.3 gd ""; do
test -f "$PHP_GD/$i/libgd.$SHLIB_SUFFIX_NAME" -o -f "$PHP_GD/$i/libgd.a" && GD_LIB="$PHP_GD/$i"
done
@@ -411,7 +411,9 @@ if test "$PHP_GD" != "no"; then
if test "$GD_MODULE_TYPE" = "builtin"; then
GDLIB_CFLAGS="-I$ext_srcdir/libgd $GDLIB_CFLAGS"
PHP_ADD_BUILD_DIR($ext_builddir/libgd)
+ GD_HEADER_DIRS="ext/gd/ ext/gd/libgd/"
else
+ GD_HEADER_DIRS="ext/gd/"
GDLIB_CFLAGS="-I$GD_INCLUDE $GDLIB_CFLAGS"
PHP_ADD_INCLUDE($GD_INCLUDE)
@@ -420,6 +422,7 @@ if test "$PHP_GD" != "no"; then
], [ -L$GD_LIB $GD_SHARED_LIBADD ])
fi
+ PHP_INSTALL_HEADERS([$GD_HEADER_DIRS])
PHP_SUBST(GDLIB_CFLAGS)
PHP_SUBST(GD_SHARED_LIBADD)
fi
diff --git a/ext/gd/config.w32 b/ext/gd/config.w32
index c03947ebc..70faeb93c 100644
--- a/ext/gd/config.w32
+++ b/ext/gd/config.w32
@@ -1,19 +1,27 @@
-// $Id: config.w32,v 1.5.2.3 2005/09/03 21:33:05 edink Exp $
+// $Id: config.w32,v 1.10 2005/08/07 21:00:28 sniper Exp $
// vim:ft=javascript
ARG_WITH("gd", "Bundled GD support", "yes,shared");
+ARG_WITH("t1lib", "t1lib support", "yes");
if (PHP_GD != "no") {
if (CHECK_LIB("libjpeg.lib", "gd", PHP_GD) &&
CHECK_LIB("freetype2.lib", "gd", PHP_GD) &&
CHECK_LIB("libpng.lib", "gd", PHP_GD) &&
- CHECK_LIB("T1_StaticMD.lib", "gd", PHP_GD) &&
- CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd") &&
- CHECK_HEADER_ADD_INCLUDE("t1lib.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\t1lib")
+ CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd")
) {
+ if (PHP_T1LIB != "no") {
+ if (CHECK_LIB("T1_StaticMD.lib", "gd", PHP_GD) &&
+ CHECK_HEADER_ADD_INCLUDE("t1lib.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\t1lib")
+ ) {
+ ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBT1");
+ } else {
+ WARNING("t1lib not enabled; libraries and headers not found");
+ }
+ }
if (PHP_ZLIB == "no" || PHP_ZLIB_SHARED) {
- CHECK_LIB("zlib.lib", "gd", PHP_GD + ";..\\zlib;" + php_usual_lib_suspects);
+ CHECK_LIB("zlib.lib", "gd", PHP_GD);
}
EXTENSION("gd", "gd.c gdttf.c", null, "-Iext/gd/libgd", "php_gd2.dll");
@@ -24,6 +32,7 @@ if (PHP_GD != "no") {
gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c xbm.c", "gd");
AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
ADD_FLAG("CFLAGS_GD", " \
+/D HAVE_GD_DYNAMIC_CTX_EX=1 \
/D HAVE_GD_BUNDLED=1 \
/D HAVE_GD_GD2 \
/D HAVE_GD_GIF_READ=1 \
@@ -46,7 +55,6 @@ if (PHP_GD != "no") {
/D HAVE_LIBPNG \
/D USE_GD_IMGSTRTTF \
/D USE_GD_IOCTX \
-/D HAVE_LIBT1 \
/D MSWIN32 \
");
} else {
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index baa23488f..6bd6f95b1 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.294.2.12 2005/05/06 16:49:04 tony2001 Exp $ */
+/* $Id: gd.c,v 1.312.2.4 2005/11/01 17:05:09 sniper Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -324,6 +324,7 @@ function_entry gd_functions[] = {
/* gd filters */
#ifdef HAVE_GD_BUNDLED
PHP_FE(imagefilter, NULL)
+ PHP_FE(imageconvolution, NULL)
#endif
{NULL, NULL, NULL}
@@ -705,7 +706,7 @@ PHP_FUNCTION(imageloadfont)
convert_to_string_ex(file);
- stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS, NULL);
+ stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", ENFORCE_SAFE_MODE | IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS, NULL);
if (stream == NULL) {
RETURN_FALSE;
}
@@ -889,6 +890,10 @@ PHP_FUNCTION(imagetruecolortopalette)
convert_to_boolean_ex(dither);
convert_to_long_ex(ncolors);
+ if (Z_LVAL_PP(ncolors) <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors has to be greater than zero");
+ RETURN_FALSE;
+ }
gdImageTrueColorToPalette(im, Z_LVAL_PP(dither), Z_LVAL_PP(ncolors));
RETURN_TRUE;
@@ -1208,23 +1213,19 @@ PHP_FUNCTION(imagecopyresampled)
Rotate an image using a custom angle */
PHP_FUNCTION(imagerotate)
{
- zval **SIM, **ANGLE, **BGDCOLOR;
+ zval *SIM;
gdImagePtr im_dst, im_src;
double degrees;
long color;
+ long ignoretransparent = 0;
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &SIM, &ANGLE, &BGDCOLOR) == FAILURE) {
- ZEND_WRONG_PARAM_COUNT();
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdl|l", &SIM, &degrees, &color, &ignoretransparent) == FAILURE) {
+ RETURN_FALSE;
}
- ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd);
-
- convert_to_long_ex(BGDCOLOR);
- color = Z_LVAL_PP(BGDCOLOR);
+ ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd);
- convert_to_double_ex(ANGLE);
- degrees = Z_DVAL_PP(ANGLE);
- im_dst = gdImageRotate(im_src, degrees, color);
+ im_dst = gdImageRotate(im_src, degrees, color, ignoretransparent);
if (im_dst != NULL) {
ZEND_REGISTER_RESOURCE(return_value, im_dst, le_gd);
@@ -1518,7 +1519,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
fn = Z_STRVAL_PP(file);
- stream = php_stream_open_wrapper(fn, "rb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
+ stream = php_stream_open_wrapper(fn, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
if (stream == NULL) {
RETURN_FALSE;
}
@@ -1726,10 +1727,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
}
if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
- if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn);
- RETURN_FALSE;
- }
+ PHP_GD_CHECK_OPEN_BASEDIR(fn, "Invalid filename");
fp = VCWD_FOPEN(fn, "wb");
if (!fp) {
@@ -3109,7 +3107,8 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
{
zval *IM, *EXT = NULL;
gdImagePtr im=NULL;
- int col = -1, x = -1, y = -1, str_len, fontname_len, i, brect[8];
+ long col = -1, x = -1, y = -1;
+ int str_len, fontname_len, i, brect[8];
double ptsize, angle;
unsigned char *str = NULL, *fontname = NULL;
char *error = NULL;
@@ -3824,16 +3823,10 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
}
/* Check origin file */
- if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid origin filename '%s'", fn_org);
- RETURN_FALSE;
- }
+ PHP_GD_CHECK_OPEN_BASEDIR(fn_org, "Invalid origin filename");
/* Check destination file */
- if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid destination filename '%s'", fn_dest);
- RETURN_FALSE;
- }
+ PHP_GD_CHECK_OPEN_BASEDIR(fn_dest, "Invalid destination filename");
/* Open origin file */
org = VCWD_FOPEN(fn_org, "rb");
@@ -4191,6 +4184,59 @@ PHP_FUNCTION(imagefilter)
}
}
/* }}} */
+
+/* {{{ proto resource imageconvolution(resource src_im, array matrix3x3, double div, double offset)
+ Apply a 3x3 convolution matrix, using coefficient div and offset */
+PHP_FUNCTION(imageconvolution)
+{
+ zval *SIM, *hash_matrix;
+ pval **var = NULL, **var2 = NULL;
+ gdImagePtr im_src = NULL;
+ double div, offset;
+ int nelem, i, j, res;
+ float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "radd", &SIM, &hash_matrix, &div, &offset) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd);
+
+ nelem = zend_hash_num_elements(Z_ARRVAL_P(hash_matrix));
+ if (nelem != 3) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array");
+ RETURN_FALSE;
+ }
+
+ for (i=0; i<3; i++) {
+ if (zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i), (void **) &var) == SUCCESS) {
+ if (Z_TYPE_PP(var) != IS_ARRAY || zend_hash_num_elements(Z_ARRVAL_PP(var)) != 3 ) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array");
+ RETURN_FALSE;
+ }
+
+ for (j=0; j<3; j++) {
+ if (zend_hash_index_find(Z_ARRVAL_PP(var), (j), (void **) &var2) == SUCCESS) {
+ SEPARATE_ZVAL(var2);
+ convert_to_double(*var2);
+ matrix[i][j] = Z_DVAL_PP(var2);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have a 3x3 matrix");
+ RETURN_FALSE;
+ }
+ }
+ }
+ }
+ res = gdImageConvolution(im_src, matrix, div, offset);
+
+ if (res) {
+ RETURN_TRUE;
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
/* End section: Filters */
/* {{{ proto bool imageantialias(resource im, bool on)
diff --git a/ext/gd/gd.dsp b/ext/gd/gd.dsp
index 6a998e19a..d7207562f 100644
--- a/ext/gd/gd.dsp
+++ b/ext/gd/gd.dsp
@@ -213,7 +213,7 @@ SOURCE=.\libgd\gd_gd2.c
SOURCE=.\libgd\gd_gif_in.c
# End Source File
# Begin Source File
-
+
SOURCE=.\libgd\gd_gif_out.c
# End Source File
# Begin Source File
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 6393ebe1d..2edbc43ed 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: gd_ctx.c,v 1.20 2004/01/28 16:25:12 martin Exp $ */
+/* $Id: gd_ctx.c,v 1.22.2.2 2005/11/01 17:05:09 sniper Exp $ */
#include "php_gd.h"
@@ -82,10 +82,8 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
}
if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
- if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn);
- RETURN_FALSE;
- }
+
+ PHP_GD_CHECK_OPEN_BASEDIR(fn, "Invalid filename");
fp = VCWD_FOPEN(fn, "wb");
if (!fp) {
diff --git a/ext/gd/gdcache.c b/ext/gd/gdcache.c
index 02f63e709..a703f9f73 100644
--- a/ext/gd/gdcache.c
+++ b/ext/gd/gdcache.c
@@ -1,5 +1,5 @@
/*
- * $Id: gdcache.c,v 1.9.2.1 2005/01/09 21:05:16 sniper Exp $
+ * $Id: gdcache.c,v 1.10 2005/01/09 21:05:05 sniper Exp $
*
* Caches of pointers to user structs in which the least-recently-used
* element is replaced in the event of a cache miss after the cache has
diff --git a/ext/gd/gdttf.c b/ext/gd/gdttf.c
index 3c5eeb54d..7a3daa644 100644
--- a/ext/gd/gdttf.c
+++ b/ext/gd/gdttf.c
@@ -2,7 +2,7 @@
/* */
/* John Ellson ellson@lucent.com */
-/* $Id: gdttf.c,v 1.20.2.1 2005/01/09 21:05:16 sniper Exp $ */
+/* $Id: gdttf.c,v 1.21 2005/01/09 21:05:05 sniper Exp $ */
#include "php.h"
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 794ba3581..6a2e8fbcd 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -1,4 +1,4 @@
-#include <stdio.h>
+
#include <math.h>
#include <string.h>
#include <stdlib.h>
@@ -1877,13 +1877,14 @@ void gdImageFill(gdImagePtr im, int x, int y, int nc)
int l, x1, x2, dy;
int oc; /* old pixel value */
int wx2,wy2;
+
+ int alphablending_bak;
+
/* stack of filled segments */
/* struct seg stack[FILL_MAX],*sp = stack;; */
struct seg *stack;
struct seg *sp;
- int alphablending_bak;
-
alphablending_bak = im->alphaBlendingFlag;
im->alphaBlendingFlag = 0;
@@ -1895,7 +1896,6 @@ void gdImageFill(gdImagePtr im, int x, int y, int nc)
wx2=im->sx;wy2=im->sy;
oc = gdImageGetPixel(im, x, y);
-
if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) {
im->alphaBlendingFlag = alphablending_bak;
return;
@@ -1939,7 +1939,7 @@ skip: for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++);
} while (x<=x2);
}
efree(stack);
- im->alphaBlendingFlag = alphablending_bak;
+ im->alphaBlendingFlag = alphablending_bak;
}
void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
@@ -2024,6 +2024,7 @@ skip: for (x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, y)!=oc); x++);
}
+
void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
{
int x1h = x1, x1v = x1, y1h = y1, y1v = y1, x2h = x2, x2v = x2, y2h = y2, y2v = y2;
@@ -2095,7 +2096,6 @@ void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
}
}
-
void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
{
int x, y;
@@ -2240,7 +2240,7 @@ void gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int s
int tox, toy;
int ncR, ncG, ncB;
toy = dstY;
-
+
for (y = srcY; y < (srcY + h); y++) {
tox = dstX;
for (x = srcX; x < (srcX + w); x++) {
@@ -2287,11 +2287,13 @@ void gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
for (x = srcX; (x < (srcX + w)); x++) {
int nc;
c = gdImageGetPixel (src, x, y);
+
/* Added 7/24/95: support transparent copies */
if (gdImageGetTransparent(src) == c) {
tox++;
continue;
}
+
/*
* If it's the same image, mapping is NOT trivial since we
* merge with greyscale target, but if pct is 100, the grey
@@ -2303,9 +2305,10 @@ void gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
dc = gdImageGetPixel(dst, tox, toy);
g = (0.29900f * gdImageRed(dst, dc)) + (0.58700f * gdImageGreen(dst, dc)) + (0.11400f * gdImageBlue(dst, dc));
- ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + gdImageRed(dst, dc) * g * ((100 - pct) / 100.0f));
- ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + gdImageGreen(dst, dc) * g * ((100 - pct) / 100.0f));
- ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + gdImageBlue(dst, dc) * g * ((100 - pct) / 100.0f));
+ ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + g * ((100 - pct) / 100.0));
+ ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + g * ((100 - pct) / 100.0));
+ ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + g * ((100 - pct) / 100.0));
+
/* First look for an exact match */
nc = gdImageColorExact(dst, ncR, ncG, ncB);
@@ -2541,7 +2544,7 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
#endif /* ROTATE_PI */
#define ROTATE_DEG2RAD 3.1415926535897932384626433832795/180
-void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double dWeight, int clrBack)
+void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double dWeight, int clrBack, int ignoretransparent)
{
typedef int (*FuncPtr)(gdImagePtr, int, int);
int i, r, g, b, a, clrBackR, clrBackG, clrBackB, clrBackA;
@@ -2606,10 +2609,14 @@ void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double
a = 127;
}
- pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
+ if (ignoretransparent && pxlSrc == dst->transparent) {
+ pxlSrc = dst->transparent;
+ } else {
+ pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
- if (pxlSrc == -1) {
- pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a);
+ if (pxlSrc == -1) {
+ pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a);
+ }
}
if ((i + iOffset >= 0) && (i + iOffset < dst->sx)) {
@@ -2634,7 +2641,7 @@ void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double
}
}
-void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double dWeight, int clrBack)
+void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double dWeight, int clrBack, int ignoretransparent)
{
typedef int (*FuncPtr)(gdImagePtr, int, int);
int i, iYPos=0, r, g, b, a;
@@ -2693,10 +2700,14 @@ void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double
a = 127;
}
- pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
+ if (ignoretransparent && pxlSrc == dst->transparent) {
+ pxlSrc = dst->transparent;
+ } else {
+ pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
- if (pxlSrc == -1) {
- pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a);
+ if (pxlSrc == -1) {
+ pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a);
+ }
}
if ((iYPos >= 0) && (iYPos < dst->sy)) {
@@ -2718,7 +2729,7 @@ void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double
}
/* Rotates an image by 90 degrees (counter clockwise) */
-gdImagePtr gdImageRotate90 (gdImagePtr src)
+gdImagePtr gdImageRotate90 (gdImagePtr src, int ignoretransparent)
{
int uY, uX;
int c,r,g,b,a;
@@ -2732,6 +2743,7 @@ gdImagePtr gdImageRotate90 (gdImagePtr src)
f = gdImageGetPixel;
}
dst = gdImageCreateTrueColor(src->sy, src->sx);
+ dst->transparent = src->transparent;
if (dst != NULL) {
gdImagePaletteCopy (dst, src);
@@ -2746,7 +2758,11 @@ gdImagePtr gdImageRotate90 (gdImagePtr src)
a = gdImageAlpha(src,c);
c = gdTrueColorAlpha(r, g, b, a);
}
- gdImageSetPixel(dst, uY, (dst->sy - uX - 1), c);
+ if (ignoretransparent && c == dst->transparent) {
+ gdImageSetPixel(dst, uY, (dst->sy - uX - 1), dst->transparent);
+ } else {
+ gdImageSetPixel(dst, uY, (dst->sy - uX - 1), c);
+ }
}
}
}
@@ -2755,7 +2771,7 @@ gdImagePtr gdImageRotate90 (gdImagePtr src)
}
/* Rotates an image by 180 degrees (counter clockwise) */
-gdImagePtr gdImageRotate180 (gdImagePtr src)
+gdImagePtr gdImageRotate180 (gdImagePtr src, int ignoretransparent)
{
int uY, uX;
int c,r,g,b,a;
@@ -2769,6 +2785,7 @@ gdImagePtr gdImageRotate180 (gdImagePtr src)
f = gdImageGetPixel;
}
dst = gdImageCreateTrueColor(src->sx, src->sy);
+ dst->transparent = src->transparent;
if (dst != NULL) {
gdImagePaletteCopy (dst, src);
@@ -2783,7 +2800,12 @@ gdImagePtr gdImageRotate180 (gdImagePtr src)
a = gdImageAlpha(src,c);
c = gdTrueColorAlpha(r, g, b, a);
}
- gdImageSetPixel(dst, (dst->sx - uX - 1), (dst->sy - uY - 1), c);
+
+ if (ignoretransparent && c == dst->transparent) {
+ gdImageSetPixel(dst, (dst->sx - uX - 1), (dst->sy - uY - 1), dst->transparent);
+ } else {
+ gdImageSetPixel(dst, (dst->sx - uX - 1), (dst->sy - uY - 1), c);
+ }
}
}
}
@@ -2792,7 +2814,7 @@ gdImagePtr gdImageRotate180 (gdImagePtr src)
}
/* Rotates an image by 270 degrees (counter clockwise) */
-gdImagePtr gdImageRotate270 ( gdImagePtr src )
+gdImagePtr gdImageRotate270 (gdImagePtr src, int ignoretransparent)
{
int uY, uX;
int c,r,g,b,a;
@@ -2806,6 +2828,7 @@ gdImagePtr gdImageRotate270 ( gdImagePtr src )
f = gdImageGetPixel;
}
dst = gdImageCreateTrueColor (src->sy, src->sx);
+ dst->transparent = src->transparent;
if (dst != NULL) {
gdImagePaletteCopy (dst, src);
@@ -2820,7 +2843,12 @@ gdImagePtr gdImageRotate270 ( gdImagePtr src )
a = gdImageAlpha(src,c);
c = gdTrueColorAlpha(r, g, b, a);
}
- gdImageSetPixel(dst, (dst->sx - uY - 1), uX, c);
+
+ if (ignoretransparent && c == dst->transparent) {
+ gdImageSetPixel(dst, (dst->sx - uY - 1), uX, dst->transparent);
+ } else {
+ gdImageSetPixel(dst, (dst->sx - uY - 1), uX, c);
+ }
}
}
}
@@ -2828,7 +2856,7 @@ gdImagePtr gdImageRotate270 ( gdImagePtr src )
return dst;
}
-gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
+gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent)
{
typedef int (*FuncPtr)(gdImagePtr, int, int);
gdImagePtr dst1,dst2,dst3;
@@ -2868,6 +2896,15 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
gdImagePaletteCopy (dst1, src);
+ if (ignoretransparent) {
+ if (gdImageTrueColor(src)) {
+ dst1->transparent = src->transparent;
+ } else {
+
+ dst1->transparent = gdTrueColorAlpha(gdImageRed(src, src->transparent), gdImageBlue(src, src->transparent), gdImageGreen(src, src->transparent), 127);
+ }
+ }
+
dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
dSinE = sin (dRadAngle);
dTan = tan (dRadAngle / 2.0);
@@ -2880,7 +2917,7 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
}
iShear = (int)floor(dShear);
- gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack);
+ gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack, ignoretransparent);
}
/*
@@ -2916,10 +2953,13 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
return NULL;
}
dst2->alphaBlendingFlag = gdEffectReplace;
+ if (ignoretransparent) {
+ dst2->transparent = dst1->transparent;
+ }
for (u = 0; u < dst2->sx; u++, dOffset -= dSinE) {
iShear = (int)floor (dOffset);
- gdImageSkewY(dst2, dst1, u, iShear, (dOffset - (double)iShear), clrBack);
+ gdImageSkewY(dst2, dst1, u, iShear, (dOffset - (double)iShear), clrBack, ignoretransparent);
}
/* 3rd shear */
@@ -2938,6 +2978,12 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
gdImageDestroy(dst2);
return NULL;
}
+
+ dst3->alphaBlendingFlag = gdEffectReplace;
+ if (ignoretransparent) {
+ dst3->transparent = dst2->transparent;
+ }
+
if (dSinE >= 0.0) {
dOffset = (double)(src->sx - 1) * dSinE * -dTan;
} else {
@@ -2945,8 +2991,8 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
}
for (u = 0; u < dst3->sy; u++, dOffset += dTan) {
- int iShear = (int)floor(dOffset);
- gdImageSkewX(dst3, dst2, u, iShear, (dOffset - iShear), clrBack);
+ int iShear = (int)floor(dOffset);
+ gdImageSkewX(dst3, dst2, u, iShear, (dOffset - iShear), clrBack, ignoretransparent);
}
gdImageDestroy(dst2);
@@ -2954,7 +3000,7 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
return dst3;
}
-gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack)
+gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent)
{
gdImagePtr pMidImg;
gdImagePtr rotatedImg;
@@ -2976,33 +3022,33 @@ gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack)
}
if (dAngle == 90.00) {
- return gdImageRotate90(src);
+ return gdImageRotate90(src, ignoretransparent);
}
if (dAngle == 180.00) {
- return gdImageRotate180(src);
+ return gdImageRotate180(src, ignoretransparent);
}
if(dAngle == 270.00) {
- return gdImageRotate270 ( src);
+ return gdImageRotate270 (src, ignoretransparent);
}
if ((dAngle > 45.0) && (dAngle <= 135.0)) {
- pMidImg = gdImageRotate90 (src);
+ pMidImg = gdImageRotate90 (src, ignoretransparent);
dAngle -= 90.0;
} else if ((dAngle > 135.0) && (dAngle <= 225.0)) {
- pMidImg = gdImageRotate180 (src);
+ pMidImg = gdImageRotate180 (src, ignoretransparent);
dAngle -= 180.0;
} else if ((dAngle > 225.0) && (dAngle <= 315.0)) {
- pMidImg = gdImageRotate270 (src);
+ pMidImg = gdImageRotate270 (src, ignoretransparent);
dAngle -= 270.0;
} else {
- return gdImageRotate45 (src, dAngle, clrBack);
+ return gdImageRotate45 (src, dAngle, clrBack, ignoretransparent);
}
if (pMidImg == NULL) {
return NULL;
}
- rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack);
+ rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack, ignoretransparent);
gdImageDestroy(pMidImg);
return rotatedImg;
@@ -3842,9 +3888,14 @@ int gdImageGaussianBlur(gdImagePtr im)
int gdImageEmboss(gdImagePtr im)
{
+/*
float filter[3][3] = {{1.0,1.0,1.0},
{0.0,0.0,0.0},
{-1.0,-1.0,-1.0}};
+*/
+ float filter[3][3] = {{ 1.5, 0.0, 0.0},
+ { 0.0, 0.0, 0.0},
+ { 0.0, 0.0,-1.5}};
return gdImageConvolution(im, filter, 1, 127);
}
diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h
index c7e12ac63..19b69c1c5 100644
--- a/ext/gd/libgd/gd.h
+++ b/ext/gd/libgd/gd.h
@@ -5,6 +5,12 @@
extern "C" {
#endif
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php_compat.h"
+
#ifndef WIN32
/* default fontpath for unix systems */
#define DEFAULT_FONTPATH "/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/TrueType:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:."
@@ -534,11 +540,11 @@ void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
substituted automatically. */
void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH);
-gdImagePtr gdImageRotate90(gdImagePtr src);
-gdImagePtr gdImageRotate180(gdImagePtr src);
-gdImagePtr gdImageRotate270(gdImagePtr src);
-gdImagePtr gdImageRotate45(gdImagePtr src, double dAngle, int clrBack);
-gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack);
+gdImagePtr gdImageRotate90(gdImagePtr src, int ignoretransparent);
+gdImagePtr gdImageRotate180(gdImagePtr src, int ignoretransparent);
+gdImagePtr gdImageRotate270(gdImagePtr src, int ignoretransparent);
+gdImagePtr gdImageRotate45(gdImagePtr src, double dAngle, int clrBack, int ignoretransparent);
+gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent);
void gdImageSetBrush(gdImagePtr im, gdImagePtr brush);
void gdImageSetTile(gdImagePtr im, gdImagePtr tile);
diff --git a/ext/gd/libgd/gd_arc_f_buggy.c b/ext/gd/libgd/gd_arc_f_buggy.c
index f51d916e5..c26e42171 100644
--- a/ext/gd/libgd/gd_arc_f_buggy.c
+++ b/ext/gd/libgd/gd_arc_f_buggy.c
@@ -726,12 +726,12 @@ main (int argc, char *argv[])
out = fopen ("test/arctest.png", "wb");
if (!out)
{
- php_gd_error("Can't create test/arctest.png\n");
+ php_gd_error("Can't create test/arctest.png");
exit (1);
}
gdImagePng (im, out);
fclose (out);
- php_gd_error("Test image written to test/arctest.png\n");
+ php_gd_error("Test image written to test/arctest.png");
/* Destroy it */
gdImageDestroy (im);
diff --git a/ext/gd/libgd/gd_gd2.c b/ext/gd/libgd/gd_gd2.c
index 9c8b35312..1e739179e 100644
--- a/ext/gd/libgd/gd_gd2.c
+++ b/ext/gd/libgd/gd_gd2.c
@@ -60,7 +60,7 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
int sidx;
int nc;
- GD2_DBG(php_gd_error("Reading gd2 header info\n"));
+ GD2_DBG(php_gd_error("Reading gd2 header info"));
for (i = 0; i < 4; i++) {
ch = gdGetC(in);
@@ -71,11 +71,11 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
}
id[4] = 0;
- GD2_DBG(php_gd_error("Got file code: %s\n", id));
+ GD2_DBG(php_gd_error("Got file code: %s", id));
/* Equiv. of 'magick'. */
if (strcmp(id, GD2_ID) != 0) {
- GD2_DBG(php_gd_error("Not a valid gd2 file\n"));
+ GD2_DBG(php_gd_error("Not a valid gd2 file"));
goto fail1;
}
@@ -83,32 +83,32 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
if (gdGetWord(vers, in) != 1) {
goto fail1;
}
- GD2_DBG(php_gd_error("Version: %d\n", *vers));
+ GD2_DBG(php_gd_error("Version: %d", *vers));
if ((*vers != 1) && (*vers != 2)) {
- GD2_DBG(php_gd_error("Bad version: %d\n", *vers));
+ GD2_DBG(php_gd_error("Bad version: %d", *vers));
goto fail1;
}
/* Image Size */
if (!gdGetWord(sx, in)) {
- GD2_DBG(php_gd_error("Could not get x-size\n"));
+ GD2_DBG(php_gd_error("Could not get x-size"));
goto fail1;
}
if (!gdGetWord(sy, in)) {
- GD2_DBG(php_gd_error("Could not get y-size\n"));
+ GD2_DBG(php_gd_error("Could not get y-size"));
goto fail1;
}
- GD2_DBG(php_gd_error("Image is %dx%d\n", *sx, *sy));
+ GD2_DBG(php_gd_error("Image is %dx%d", *sx, *sy));
/* Chunk Size (pixels, not bytes!) */
if (gdGetWord(cs, in) != 1) {
goto fail1;
}
- GD2_DBG(php_gd_error("ChunkSize: %d\n", *cs));
+ GD2_DBG(php_gd_error("ChunkSize: %d", *cs));
if ((*cs < GD2_CHUNKSIZE_MIN) || (*cs > GD2_CHUNKSIZE_MAX)) {
- GD2_DBG(php_gd_error("Bad chunk size: %d\n", *cs));
+ GD2_DBG(php_gd_error("Bad chunk size: %d", *cs));
goto fail1;
}
@@ -116,10 +116,10 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
if (gdGetWord(fmt, in) != 1) {
goto fail1;
}
- GD2_DBG(php_gd_error("Format: %d\n", *fmt));
+ GD2_DBG(php_gd_error("Format: %d", *fmt));
if ((*fmt != GD2_FMT_RAW) && (*fmt != GD2_FMT_COMPRESSED) && (*fmt != GD2_FMT_TRUECOLOR_RAW) && (*fmt != GD2_FMT_TRUECOLOR_COMPRESSED)) {
- GD2_DBG(php_gd_error("Bad data format: %d\n", *fmt));
+ GD2_DBG(php_gd_error("Bad data format: %d", *fmt));
goto fail1;
}
@@ -127,17 +127,17 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
if (gdGetWord(ncx, in) != 1) {
goto fail1;
}
- GD2_DBG(php_gd_error("%d Chunks Wide\n", *ncx));
+ GD2_DBG(php_gd_error("%d Chunks Wide", *ncx));
/* # of chunks high */
if (gdGetWord(ncy, in) != 1) {
goto fail1;
}
- GD2_DBG(php_gd_error("%d Chunks vertically\n", *ncy));
+ GD2_DBG(php_gd_error("%d Chunks vertically", *ncy));
if (gd2_compressed(*fmt)) {
nc = (*ncx) * (*ncy);
- GD2_DBG(php_gd_error("Reading %d chunk index entries\n", nc));
+ GD2_DBG(php_gd_error("Reading %d chunk index entries", nc));
sidx = sizeof(t_chunk_info) * nc;
if (sidx <= 0) {
goto fail1;
@@ -154,7 +154,7 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
*chunkIdx = cidx;
}
- GD2_DBG(php_gd_error("gd2 header complete\n"));
+ GD2_DBG(php_gd_error("gd2 header complete"));
return 1;
@@ -167,7 +167,7 @@ static gdImagePtr _gd2CreateFromFile (gdIOCtxPtr in, int *sx, int *sy, int *cs,
gdImagePtr im;
if (_gd2GetHeader (in, sx, sy, cs, vers, fmt, ncx, ncy, cidx) != 1) {
- GD2_DBG(php_gd_error("Bad GD2 header\n"));
+ GD2_DBG(php_gd_error("Bad GD2 header"));
goto fail1;
}
@@ -177,15 +177,15 @@ static gdImagePtr _gd2CreateFromFile (gdIOCtxPtr in, int *sx, int *sy, int *cs,
im = gdImageCreate(*sx, *sy);
}
if (im == NULL) {
- GD2_DBG(php_gd_error("Could not create gdImage\n"));
+ GD2_DBG(php_gd_error("Could not create gdImage"));
goto fail1;
}
if (!_gdGetColors(in, im, (*vers) == 2)) {
- GD2_DBG(php_gd_error("Could not read color palette\n"));
+ GD2_DBG(php_gd_error("Could not read color palette"));
goto fail2;
}
- GD2_DBG(php_gd_error("Image palette completed: %d colours\n", im->colorsTotal));
+ GD2_DBG(php_gd_error("Image palette completed: %d colours", im->colorsTotal));
return im;
@@ -202,24 +202,24 @@ static int _gd2ReadChunk (int offset, char *compBuf, int compSize, char *chunkBu
int zerr;
if (gdTell(in) != offset) {
- GD2_DBG(php_gd_error("Positioning in file to %d\n", offset));
+ GD2_DBG(php_gd_error("Positioning in file to %d", offset));
gdSeek(in, offset);
} else {
- GD2_DBG(php_gd_error("Already Positioned in file to %d\n", offset));
+ GD2_DBG(php_gd_error("Already Positioned in file to %d", offset));
}
/* Read and uncompress an entire chunk. */
- GD2_DBG(php_gd_error("Reading file\n"));
+ GD2_DBG(php_gd_error("Reading file"));
if (gdGetBuf(compBuf, compSize, in) != compSize) {
return FALSE;
}
- GD2_DBG(php_gd_error("Got %d bytes. Uncompressing into buffer of %d bytes\n", compSize, (int)*chunkLen));
+ GD2_DBG(php_gd_error("Got %d bytes. Uncompressing into buffer of %d bytes", compSize, (int)*chunkLen));
zerr = uncompress((unsigned char *) chunkBuf, chunkLen, (unsigned char *) compBuf, compSize);
if (zerr != Z_OK) {
- GD2_DBG(php_gd_error("Error %d from uncompress\n", zerr));
+ GD2_DBG(php_gd_error("Error %d from uncompress", zerr));
return FALSE;
}
- GD2_DBG(php_gd_error("Got chunk\n"));
+ GD2_DBG(php_gd_error("Got chunk"));
return TRUE;
}
@@ -291,7 +291,7 @@ gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
chunkBuf = gdCalloc(chunkMax, 1);
compBuf = gdCalloc(compMax, 1);
- GD2_DBG(php_gd_error("Largest compressed chunk is %d bytes\n", compMax));
+ GD2_DBG(php_gd_error("Largest compressed chunk is %d bytes", compMax));
}
/* Read the data... */
@@ -303,13 +303,13 @@ gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
yhi = im->sy;
}
- GD2_DBG(php_gd_error("Processing Chunk %d (%d, %d), y from %d to %d\n", chunkNum, cx, cy, ylo, yhi));
+ GD2_DBG(php_gd_error("Processing Chunk %d (%d, %d), y from %d to %d", chunkNum, cx, cy, ylo, yhi));
if (gd2_compressed(fmt)) {
chunkLen = chunkMax;
if (!_gd2ReadChunk(chunkIdx[chunkNum].offset, compBuf, chunkIdx[chunkNum].size, (char *) chunkBuf, &chunkLen, in)) {
- GD2_DBG(php_gd_error("Error reading comproessed chunk\n"));
+ GD2_DBG(php_gd_error("Error reading comproessed chunk"));
goto fail2;
}
@@ -356,7 +356,7 @@ gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
}
}
- GD2_DBG(php_gd_error("Freeing memory\n"));
+ GD2_DBG(php_gd_error("Freeing memory"));
if (chunkBuf) {
gdFree(chunkBuf);
@@ -368,7 +368,7 @@ gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
gdFree(chunkIdx);
}
- GD2_DBG(php_gd_error("Done\n"));
+ GD2_DBG(php_gd_error("Done"));
return im;
@@ -438,7 +438,7 @@ gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w,
goto fail1;
}
- GD2_DBG(php_gd_error("File size is %dx%d\n", fsx, fsy));
+ GD2_DBG(php_gd_error("File size is %dx%d", fsx, fsy));
/* This is the difference - make a file based on size of chunks. */
if (gd2_truecolor(fmt)) {
@@ -453,7 +453,7 @@ gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w,
if (!_gdGetColors(in, im, vers == 2)) {
goto fail2;
}
- GD2_DBG(php_gd_error("Image palette completed: %d colours\n", im->colorsTotal));
+ GD2_DBG(php_gd_error("Image palette completed: %d colours", im->colorsTotal));
/* Process the header info */
nc = ncx * ncy;
@@ -502,7 +502,7 @@ gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w,
/* Remember file position of image data. */
dstart = gdTell(in);
- GD2_DBG(php_gd_error("Data starts at %d\n", dstart));
+ GD2_DBG(php_gd_error("Data starts at %d", dstart));
/* Loop through the chunks. */
for (cy = scy; (cy <= ecy); cy++) {
@@ -520,10 +520,10 @@ gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w,
xhi = fsx;
}
- GD2_DBG(php_gd_error("Processing Chunk (%d, %d), from %d to %d\n", cx, cy, ylo, yhi));
+ GD2_DBG(php_gd_error("Processing Chunk (%d, %d), from %d to %d", cx, cy, ylo, yhi));
if (!gd2_compressed(fmt)) {
- GD2_DBG(php_gd_error("Using raw format data\n"));
+ GD2_DBG(php_gd_error("Using raw format data"));
if (im->trueColor) {
dpos = (cy * (cs * fsx) * 4 + cx * cs * (yhi - ylo) * 4) + dstart;
} else {
@@ -532,23 +532,23 @@ gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w,
/* gd 2.0.11: gdSeek returns TRUE on success, not 0. Longstanding bug. 01/16/03 */
if (!gdSeek(in, dpos)) {
- php_gd_error_ex(E_WARNING, "Error from seek: %d\n", errno);
+ php_gd_error_ex(E_WARNING, "Error from seek: %d", errno);
goto fail2;
}
- GD2_DBG(php_gd_error("Reading (%d, %d) from position %d\n", cx, cy, dpos - dstart));
+ GD2_DBG(php_gd_error("Reading (%d, %d) from position %d", cx, cy, dpos - dstart));
} else {
chunkNum = cx + cy * ncx;
chunkLen = chunkMax;
if (!_gd2ReadChunk (chunkIdx[chunkNum].offset, compBuf, chunkIdx[chunkNum].size, chunkBuf, &chunkLen, in)) {
- php_gd_error("Error reading comproessed chunk\n");
+ php_gd_error("Error reading comproessed chunk");
goto fail2;
}
chunkPos = 0;
- GD2_DBG(php_gd_error("Reading (%d, %d) from chunk %d\n", cx, cy, chunkNum));
+ GD2_DBG(php_gd_error("Reading (%d, %d) from chunk %d", cx, cy, chunkNum));
}
- GD2_DBG(php_gd_error(" into (%d, %d) - (%d, %d)\n", xlo, ylo, xhi, yhi));
+ GD2_DBG(php_gd_error(" into (%d, %d) - (%d, %d)", xlo, ylo, xhi, yhi));
for (y = ylo; (y < yhi); y++) {
for (x = xlo; x < xhi; x++) {
@@ -701,7 +701,7 @@ static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
*/
idxPos = gdTell(out);
idxSize = ncx * ncy * sizeof(t_chunk_info);
- GD2_DBG(php_gd_error("Index size is %d\n", idxSize));
+ GD2_DBG(php_gd_error("Index size is %d", idxSize));
gdSeek(out, idxPos + idxSize);
chunkIdx = safe_emalloc(idxSize, sizeof(t_chunk_info), 0);
@@ -710,8 +710,8 @@ static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
_gdPutColors (im, out);
- GD2_DBG(php_gd_error("Size: %dx%d\n", im->sx, im->sy));
- GD2_DBG(php_gd_error("Chunks: %dx%d\n", ncx, ncy));
+ GD2_DBG(php_gd_error("Size: %dx%d", im->sx, im->sy));
+ GD2_DBG(php_gd_error("Chunks: %dx%d", ncx, ncy));
for (cy = 0; (cy < ncy); cy++) {
for (cx = 0; (cx < ncx); cx++) {
@@ -721,7 +721,7 @@ static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
yhi = im->sy;
}
- GD2_DBG(php_gd_error("Processing Chunk (%dx%d), y from %d to %d\n", cx, cy, ylo, yhi));
+ GD2_DBG(php_gd_error("Processing Chunk (%dx%d), y from %d to %d", cx, cy, ylo, yhi));
chunkLen = 0;
for (y = ylo; (y < yhi); y++) {
GD2_DBG(php_gd_error("y=%d: ",y));
@@ -755,21 +755,21 @@ static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
}
}
}
- GD2_DBG(php_gd_error("y=%d done.\n",y));
+ GD2_DBG(php_gd_error("y=%d done.",y));
}
if (gd2_compressed(fmt)) {
compLen = compMax;
if (compress((unsigned char *) &compData[0], &compLen, (unsigned char *) &chunkData[0], chunkLen) != Z_OK) {
- php_gd_error("Error from compressing\n");
+ php_gd_error("Error from compressing");
} else {
chunkIdx[chunkNum].offset = gdTell(out);
chunkIdx[chunkNum++].size = compLen;
- GD2_DBG(php_gd_error("Chunk %d size %d offset %d\n", chunkNum, chunkIdx[chunkNum - 1].size, chunkIdx[chunkNum - 1].offset));
+ GD2_DBG(php_gd_error("Chunk %d size %d offset %d", chunkNum, chunkIdx[chunkNum - 1].size, chunkIdx[chunkNum - 1].offset));
if (gdPutBuf (compData, compLen, out) <= 0) {
/* Any alternate suggestions for handling this? */
- php_gd_error_ex(E_WARNING, "Error %d on write\n", errno);
+ php_gd_error_ex(E_WARNING, "Error %d on write", errno);
}
}
}
@@ -778,19 +778,19 @@ static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
if (gd2_compressed(fmt)) {
/* Save the position, write the index, restore position (paranoia). */
- GD2_DBG(php_gd_error("Seeking %d to write index\n", idxPos));
+ GD2_DBG(php_gd_error("Seeking %d to write index", idxPos));
posSave = gdTell(out);
gdSeek(out, idxPos);
- GD2_DBG(php_gd_error("Writing index\n"));
+ GD2_DBG(php_gd_error("Writing index"));
for (x = 0; x < chunkNum; x++) {
- GD2_DBG(php_gd_error("Chunk %d size %d offset %d\n", x, chunkIdx[x].size, chunkIdx[x].offset));
+ GD2_DBG(php_gd_error("Chunk %d size %d offset %d", x, chunkIdx[x].size, chunkIdx[x].offset));
gdPutInt(chunkIdx[x].offset, out);
gdPutInt(chunkIdx[x].size, out);
}
gdSeek(out, posSave);
}
fail:
- GD2_DBG(php_gd_error("Freeing memory\n"));
+ GD2_DBG(php_gd_error("Freeing memory"));
if (chunkData) {
gdFree(chunkData);
}
@@ -800,7 +800,7 @@ fail:
if (chunkIdx) {
gdFree(chunkIdx);
}
- GD2_DBG(php_gd_error("Done\n"));
+ GD2_DBG(php_gd_error("Done"));
}
void gdImageGd2 (gdImagePtr im, FILE * outFile, int cs, int fmt)
diff --git a/ext/gd/libgd/gd_gif_in.c b/ext/gd/libgd/gd_gif_in.c
index 724511b17..1733a646f 100644
--- a/ext/gd/libgd/gd_gif_in.c
+++ b/ext/gd/libgd/gd_gif_in.c
@@ -259,13 +259,13 @@ DoExtension(gdIOCtx *fd, int label, int *Transparent)
if ((buf[0] & 0x1) != 0)
*Transparent = buf[3];
- while (GetDataBlock(fd, (unsigned char*) buf) != 0)
+ while (GetDataBlock(fd, (unsigned char*) buf) > 0)
;
return FALSE;
default:
break;
}
- while (GetDataBlock(fd, (unsigned char*) buf) != 0)
+ while (GetDataBlock(fd, (unsigned char*) buf) > 0)
;
return FALSE;
@@ -337,7 +337,7 @@ GetCode_(gdIOCtx *fd, int code_size, int flag)
buf[0] = buf[last_byte-2];
buf[1] = buf[last_byte-1];
- if ((count = GetDataBlock(fd, &buf[2])) == 0)
+ if ((count = GetDataBlock(fd, &buf[2])) <= 0)
done = TRUE;
last_byte = 2 + count;
@@ -359,7 +359,7 @@ GetCode(gdIOCtx *fd, int code_size, int flag)
int rv;
rv = GetCode_(fd,code_size,flag);
- if (VERBOSE) php_gd_error_ex(E_NOTICE, "[GetCode(,%d,%d) returning %d]\n",code_size,flag,rv);
+ if (VERBOSE) php_gd_error_ex(E_NOTICE, "[GetCode(,%d,%d) returning %d]",code_size,flag,rv);
return(rv);
}
@@ -491,7 +491,7 @@ LWZReadByte(gdIOCtx *fd, int flag, int input_code_size)
int rv;
rv = LWZReadByte_(fd,flag,input_code_size);
- if (VERBOSE) php_gd_error_ex(E_NOTICE, "[LWZReadByte(,%d,%d) returning %d]\n",flag,input_code_size,rv);
+ if (VERBOSE) php_gd_error_ex(E_NOTICE, "[LWZReadByte(,%d,%d) returning %d]",flag,input_code_size,rv);
return(rv);
}
diff --git a/ext/gd/libgd/gd_io.c b/ext/gd/libgd/gd_io.c
index 6a39e16eb..ab807149f 100644
--- a/ext/gd/libgd/gd_io.c
+++ b/ext/gd/libgd/gd_io.c
@@ -52,20 +52,20 @@ void gdPutC (const unsigned char c, gdIOCtx * ctx)
void gdPutWord (int w, gdIOCtx * ctx)
{
- IO_DBG (php_gd_error("Putting word...\n"));
+ IO_DBG (php_gd_error("Putting word..."));
(ctx->putC) (ctx, (unsigned char) (w >> 8));
(ctx->putC) (ctx, (unsigned char) (w & 0xFF));
- IO_DBG (php_gd_error("put.\n"));
+ IO_DBG (php_gd_error("put."));
}
void gdPutInt (int w, gdIOCtx * ctx)
{
- IO_DBG (php_gd_error("Putting int...\n"));
+ IO_DBG (php_gd_error("Putting int..."));
(ctx->putC) (ctx, (unsigned char) (w >> 24));
(ctx->putC) (ctx, (unsigned char) ((w >> 16) & 0xFF));
(ctx->putC) (ctx, (unsigned char) ((w >> 8) & 0xFF));
(ctx->putC) (ctx, (unsigned char) (w & 0xFF));
- IO_DBG (php_gd_error("put.\n"));
+ IO_DBG (php_gd_error("put."));
}
int gdGetC (gdIOCtx * ctx)
@@ -121,9 +121,9 @@ int gdGetInt (int *result, gdIOCtx * ctx)
int gdPutBuf (const void *buf, int size, gdIOCtx * ctx)
{
- IO_DBG (php_gd_error("Putting buf...\n"));
+ IO_DBG (php_gd_error("Putting buf..."));
return (ctx->putBuf) (ctx, buf, size);
- IO_DBG (php_gd_error("put.\n"));
+ IO_DBG (php_gd_error("put."));
}
int gdGetBuf (void *buf, int size, gdIOCtx * ctx)
@@ -133,14 +133,14 @@ int gdGetBuf (void *buf, int size, gdIOCtx * ctx)
int gdSeek (gdIOCtx * ctx, const int pos)
{
- IO_DBG (php_gd_error("Seeking...\n"));
+ IO_DBG (php_gd_error("Seeking..."));
return ((ctx->seek) (ctx, pos));
- IO_DBG (php_gd_error("Done.\n"));
+ IO_DBG (php_gd_error("Done."));
}
long gdTell (gdIOCtx * ctx)
{
- IO_DBG (php_gd_error("Telling...\n"));
+ IO_DBG (php_gd_error("Telling..."));
return ((ctx->tell) (ctx));
- IO_DBG (php_gd_error ("told.\n"));
+ IO_DBG (php_gd_error ("told."));
}
diff --git a/ext/gd/libgd/gd_jpeg.c b/ext/gd/libgd/gd_jpeg.c
index 26332279a..a276fe853 100644
--- a/ext/gd/libgd/gd_jpeg.c
+++ b/ext/gd/libgd/gd_jpeg.c
@@ -170,7 +170,7 @@ void gdImageJpegCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
nlines = jpeg_write_scanlines (&cinfo, rowptr, 1);
if (nlines != 1) {
- php_gd_error_ex(E_WARNING, "gd_jpeg: warning: jpeg_write_scanlines returns %u -- expected 1\n", nlines);
+ php_gd_error_ex(E_WARNING, "gd_jpeg: warning: jpeg_write_scanlines returns %u -- expected 1", nlines);
}
}
} else {
@@ -197,7 +197,7 @@ void gdImageJpegCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
nlines = jpeg_write_scanlines (&cinfo, rowptr, 1);
if (nlines != 1) {
- php_gd_error_ex(E_WARNING, "gd_jpeg: warning: jpeg_write_scanlines returns %u -- expected 1\n", nlines);
+ php_gd_error_ex(E_WARNING, "gd_jpeg: warning: jpeg_write_scanlines returns %u -- expected 1", nlines);
}
}
}
diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c
index 1576fafa3..f57f7c4b2 100644
--- a/ext/gd/libgd/gd_png.c
+++ b/ext/gd/libgd/gd_png.c
@@ -58,11 +58,11 @@ static void gdPngErrorHandler (png_structp png_ptr, png_const_charp msg)
* been defined.
*/
- php_gd_error_ex(E_ERROR, "gd-png: fatal libpng error: %s\n", msg);
+ php_gd_error_ex(E_ERROR, "gd-png: fatal libpng error: %s", msg);
jmpbuf_ptr = png_get_error_ptr (png_ptr);
if (jmpbuf_ptr == NULL) { /* we are completely hosed now */
- php_gd_error_ex(E_ERROR, "gd-png: EXTREMELY fatal error: jmpbuf unrecoverable; terminating.\n");
+ php_gd_error_ex(E_ERROR, "gd-png: EXTREMELY fatal error: jmpbuf unrecoverable; terminating.");
}
longjmp (jmpbuf_ptr->jmpbuf, 1);
@@ -142,13 +142,13 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile)
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
#endif
if (png_ptr == NULL) {
- php_gd_error("gd-png error: cannot allocate libpng main struct\n");
+ php_gd_error("gd-png error: cannot allocate libpng main struct");
return NULL;
}
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
- php_gd_error("gd-png error: cannot allocate libpng info struct\n");
+ php_gd_error("gd-png error: cannot allocate libpng info struct");
png_destroy_read_struct (&png_ptr, NULL, NULL);
return NULL;
@@ -164,7 +164,7 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile)
*/
#ifndef PNG_SETJMP_NOT_SUPPORTED
if (setjmp(gdPngJmpbufStruct.jmpbuf)) {
- php_gd_error("gd-png error: setjmp returns error condition\n");
+ php_gd_error("gd-png error: setjmp returns error condition");
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
@@ -183,7 +183,7 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile)
im = gdImageCreate((int) width, (int) height);
}
if (im == NULL) {
- php_gd_error("gd-png error: cannot allocate gdImage struct\n");
+ php_gd_error("gd-png error: cannot allocate gdImage struct");
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
gdFree(image_data);
gdFree(row_pointers);
@@ -201,7 +201,7 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile)
case PNG_COLOR_TYPE_PALETTE:
png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette);
#ifdef DEBUG
- php_gd_error("gd-png color_type is palette, colors: %d\n", num_palette);
+ php_gd_error("gd-png color_type is palette, colors: %d", num_palette);
#endif /* DEBUG */
if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) {
/* gd 2.0: we support this rather thoroughly now. Grab the
@@ -225,7 +225,7 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile)
case PNG_COLOR_TYPE_GRAY_ALPHA:
/* create a fake palette and check for single-shade transparency */
if ((palette = (png_colorp) gdMalloc (256 * sizeof (png_color))) == NULL) {
- php_gd_error("gd-png error: cannot allocate gray palette\n");
+ php_gd_error("gd-png error: cannot allocate gray palette");
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
return NULL;
@@ -369,7 +369,7 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile)
if (!im->trueColor) {
for (i = num_palette; i < gdMaxColors; ++i) {
if (!open[i]) {
- php_gd_error("gd-png warning: image data references out-of-range color index (%d)\n", i);
+ php_gd_error("gd-png warning: image data references out-of-range color index (%d)", i);
}
}
}
@@ -450,13 +450,13 @@ void gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level)
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
#endif
if (png_ptr == NULL) {
- php_gd_error("gd-png error: cannot allocate libpng main struct\n");
+ php_gd_error("gd-png error: cannot allocate libpng main struct");
return;
}
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
- php_gd_error("gd-png error: cannot allocate libpng info struct\n");
+ php_gd_error("gd-png error: cannot allocate libpng info struct");
png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
return;
@@ -464,7 +464,7 @@ void gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level)
#ifndef PNG_SETJMP_NOT_SUPPORTED
if (setjmp (gdPngJmpbufStruct.jmpbuf)) {
- php_gd_error("gd-png error: setjmp returns error condition\n");
+ php_gd_error("gd-png error: setjmp returns error condition");
png_destroy_write_struct (&png_ptr, &info_ptr);
return;
diff --git a/ext/gd/libgd/gd_ss.c b/ext/gd/libgd/gd_ss.c
index 78f91df9c..08edea3ec 100644
--- a/ext/gd/libgd/gd_ss.c
+++ b/ext/gd/libgd/gd_ss.c
@@ -38,11 +38,11 @@ gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource)
#else /* no HAVE_LIBPNG */
void gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink)
{
- php_gd_error("PNG support is not available\n");
+ php_gd_error("PNG support is not available");
}
gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource)
{
- php_gd_error("PNG support is not available\n");
+ php_gd_error("PNG support is not available");
return NULL;
}
#endif /* HAVE_LIBPNG */
diff --git a/ext/gd/libgd/gd_wbmp.c b/ext/gd/libgd/gd_wbmp.c
index 5389695e2..b81eed80e 100644
--- a/ext/gd/libgd/gd_wbmp.c
+++ b/ext/gd/libgd/gd_wbmp.c
@@ -98,7 +98,7 @@ void gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out)
/* create the WBMP */
if ((wbmp = createwbmp (gdImageSX (image), gdImageSY (image), WBMP_WHITE)) == NULL) {
- php_gd_error("Could not create WBMP\n");
+ php_gd_error("Could not create WBMP");
}
/* fill up the WBMP structure */
@@ -114,7 +114,7 @@ void gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out)
/* write the WBMP to a gd file descriptor */
if (writewbmp (wbmp, &gd_putout, out)) {
- php_gd_error("Could not save WBMP\n");
+ php_gd_error("Could not save WBMP");
}
/* des submitted this bugfix: gdFree the memory. */
freewbmp(wbmp);
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index cf79fe312..a09bdcba6 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -919,6 +919,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
/* I do not know the significance of the constant 0xf000.
* It was determined by inspection of the character codes
* stored in Microsoft font symbol.
+ * Added by Pierre (pajoye@php.net):
+ * Convert to the Symbol glyph range only for a Symbol family member
*/
len = gdTcl_UtfToUniChar (next, &ch);
ch |= 0xf000;
diff --git a/ext/gd/libgd/gdtables.c b/ext/gd/libgd/gdtables.c
index 0e6e29718..1e81f3e9e 100644
--- a/ext/gd/libgd/gdtables.c
+++ b/ext/gd/libgd/gdtables.c
@@ -1,4 +1,10 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php_compat.h"
+
int gdCosT[] =
{
1024,
diff --git a/ext/gd/libgd/gdxpm.c b/ext/gd/libgd/gdxpm.c
index 5663837ae..785afb368 100644
--- a/ext/gd/libgd/gdxpm.c
+++ b/ext/gd/libgd/gdxpm.c
@@ -46,10 +46,10 @@ gdImagePtr gdImageCreateFromXpm (char *filename)
buf[0] = image.colorTable[i].c_color[1];
red = strtol(buf, NULL, 16);
- buf[0] = image.colorTable[i].c_color[3];
+ buf[0] = image.colorTable[i].c_color[2];
green = strtol(buf, NULL, 16);
- buf[0] = image.colorTable[i].c_color[5];
+ buf[0] = image.colorTable[i].c_color[3];
blue = strtol(buf, NULL, 16);
break;
@@ -117,7 +117,7 @@ gdImagePtr gdImageCreateFromXpm (char *filename)
colors[i] = gdImageColorResolve(im, red, green, blue);
if (colors[i] == -1) {
- php_gd_error("ARRRGH\n");
+ php_gd_error("ARRRGH");
}
}
diff --git a/ext/gd/libgd/wbmp.h b/ext/gd/libgd/wbmp.h
index 654a1c9db..89b64c7d1 100644
--- a/ext/gd/libgd/wbmp.h
+++ b/ext/gd/libgd/wbmp.h
@@ -12,6 +12,11 @@
#ifndef __WBMP_H
#define __WBMP_H 1
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php_compat.h"
/* WBMP struct
** -----------
diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c
index b7b0ac39d..4fb45abad 100644
--- a/ext/gd/libgd/xbm.c
+++ b/ext/gd/libgd/xbm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: xbm.c,v 1.6 2004/01/08 08:15:43 andi Exp $ */
+/* $Id: xbm.c,v 1.7.2.1 2005/08/18 12:54:44 sniper Exp $ */
#include <stdio.h>
#include <math.h>
@@ -147,7 +147,7 @@ gdImagePtr gdImageCreateFromXbm(FILE * fd)
}
}
- php_gd_error("EOF before image was complete\n");
+ php_gd_error("EOF before image was complete");
gdImageDestroy(im);
return 0;
}
diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h
index 0efac5461..086073441 100644
--- a/ext/gd/php_gd.h
+++ b/ext/gd/php_gd.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_gd.h,v 1.57 2004/01/08 17:32:08 sniper Exp $ */
+/* $Id: php_gd.h,v 1.59.2.2 2005/11/02 21:26:25 sniper Exp $ */
#ifndef PHP_GD_H
#define PHP_GD_H
@@ -30,6 +30,15 @@
#if HAVE_LIBGD
+/* open_basedir and safe_mode checks */
+#define PHP_GD_CHECK_OPEN_BASEDIR(filename, errormsg) \
+ if (!filename || php_check_open_basedir(filename TSRMLS_CC) || \
+ (PG(safe_mode) && !php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR)) \
+ ) { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, errormsg); \
+ RETURN_FALSE; \
+ }
+
#define PHP_GDIMG_TYPE_GIF 1
#define PHP_GDIMG_TYPE_PNG 2
#define PHP_GDIMG_TYPE_JPG 3
@@ -175,6 +184,7 @@ PHP_FUNCTION(image2wbmp);
PHP_FUNCTION(imagelayereffect);
PHP_FUNCTION(imagecolormatch);
PHP_FUNCTION(imagefilter);
+PHP_FUNCTION(imageconvolution);
PHP_FUNCTION(imagexbm);
#endif
diff --git a/ext/gd/tests/bug24155.phpt b/ext/gd/tests/bug24155.phpt
index 3bcc8974a..a7cf9ef73 100644
--- a/ext/gd/tests/bug24155.phpt
+++ b/ext/gd/tests/bug24155.phpt
@@ -19,8 +19,14 @@ Bug #24155 (gdImageRotate270 rotation problem).
$im = imagerotate($im, 270, 255);
imagepng($im, $dest);
- echo md5_file($dest) . "\n";
+ $im2 = imagecreatefrompng($dest);
+
+ // Uniform fill + n x 90degrees rotation , the color value does not change
+ $col = imagecolorat($im2, 20, 20);
+ // 16777215 - 255 = 16776960
+ echo "$col\n";
+
@unlink($dest);
?>
--EXPECT--
-cc867fd65c30883463ce58d0341f0997
+16776960
diff --git a/ext/gd/tests/bug27582_1.phpt b/ext/gd/tests/bug27582_1.phpt
index f6dbda0ce..b85f7457e 100644
--- a/ext/gd/tests/bug27582_1.phpt
+++ b/ext/gd/tests/bug27582_1.phpt
@@ -12,13 +12,17 @@ $dest = dirname(realpath(__FILE__)) . '/bug27582.png';
@unlink($dest);
$im = ImageCreateTrueColor(10, 10);
imagealphablending($im, true);
-imagesavealpha($im, false);
+imagesavealpha($im, true);
$bordercolor=ImageColorAllocateAlpha($im, 0, 0, 0, 2);
$color = ImageColorAllocateAlpha($im, 0, 0, 0, 1);
ImageFillToBorder($im, 5, 5, $bordercolor, $color);
imagepng($im, $dest);
-echo md5_file($dest) . "\n";
+
+$im2 = imagecreatefrompng($dest);
+$col = imagecolorat($im2, 5, 5);
+$color = imagecolorsforindex($im2, $col);
+echo $color['alpha'];
@unlink($dest);
?>
--EXPECT--
-08287f8f5d406946009df5f04ca83dc0
+1
diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4
index 34930f3a7..b439540dd 100644
--- a/ext/gettext/config.m4
+++ b/ext/gettext/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.13 2003/10/01 02:53:07 sniper Exp $
+dnl $Id: config.m4,v 1.15 2005/05/29 23:16:41 sniper Exp $
dnl
PHP_ARG_WITH(gettext,for GNU gettext support,
-[ --with-gettext[=DIR] Include GNU gettext support.])
+[ --with-gettext[=DIR] Include GNU gettext support])
if test "$PHP_GETTEXT" != "no"; then
for i in $PHP_GETTEXT /usr/local /usr; do
@@ -14,7 +14,7 @@ if test "$PHP_GETTEXT" != "no"; then
AC_MSG_ERROR(Cannot locate header file libintl.h)
fi
- GETTEXT_LIBDIR=$GETTEXT_DIR/lib
+ GETTEXT_LIBDIR=$GETTEXT_DIR/$PHP_LIBDIR
GETTEXT_INCDIR=$GETTEXT_DIR/include
O_LDFLAGS=$LDFLAGS
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index c8b54dea1..19d5473a5 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: gettext.c,v 1.44.2.1 2004/07/29 22:26:52 edink Exp $ */
+/* $Id: gettext.c,v 1.46 2005/08/03 14:07:14 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h
index 19ff6dbde..932f5e1e6 100644
--- a/ext/gettext/php_gettext.h
+++ b/ext/gettext/php_gettext.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_gettext.h,v 1.19 2004/01/08 17:32:09 sniper Exp $ */
+/* $Id: php_gettext.h,v 1.20 2005/08/03 14:07:14 sniper Exp $ */
#ifndef PHP_GETTEXT_H
#define PHP_GETTEXT_H
diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4
index 0ee914086..641d3d240 100644
--- a/ext/gmp/config.m4
+++ b/ext/gmp/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.10 2003/11/19 04:44:06 sniper Exp $
+dnl $Id: config.m4,v 1.11 2004/11/03 14:32:50 jorton Exp $
dnl
PHP_ARG_WITH(gmp, for GNU MP support,
@@ -21,13 +21,13 @@ if test "$PHP_GMP" != "no"; then
[],[
AC_MSG_ERROR([GNU MP Library version 4.1.2 or greater required.])
],[
- -L$GMP_DIR/lib
+ -L$GMP_DIR/$PHP_LIBDIR
])
],[
- -L$GMP_DIR/lib
+ -L$GMP_DIR/$PHP_LIBDIR
])
- PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/lib, GMP_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/$PHP_LIBDIR, GMP_SHARED_LIBADD)
PHP_ADD_INCLUDE($GMP_DIR/include)
PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared)
diff --git a/ext/gmp/config.w32 b/ext/gmp/config.w32
new file mode 100644
index 000000000..f2b747ab4
--- /dev/null
+++ b/ext/gmp/config.w32
@@ -0,0 +1,14 @@
+// $Id: config.w32,v 1.1 2005/01/04 22:39:29 fmk Exp $
+// vim:ft=javascript
+
+ARG_WITH("gmp", "Include GNU MP support.", "no");
+
+if (PHP_GMP != "no") {
+ if (CHECK_LIB("libgmp_a.lib", "gmp", PHP_GMP) &&
+ CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP)) {
+ EXTENSION("gmp", "gmp.c");
+ AC_DEFINE('HAVE_GMP', 1, 'GMP support');
+ } else {
+ WARNING("GMP not enabled; libraries and headers not found");
+ }
+}
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index d5653f2df..d72a2d982 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -924,7 +924,7 @@ ZEND_FUNCTION(gmp_sqrt)
INIT_GMP_NUM(gmpnum_result);
mpz_sqrt(*gmpnum_result, *gmpnum_a);
- ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp);
+ ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp);
}
/* }}} */
@@ -941,12 +941,12 @@ ZEND_FUNCTION(gmp_sqrtrem)
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg);
-
+
if (mpz_sgn(*gmpnum_a) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0");
RETURN_FALSE;
}
-
+
INIT_GMP_NUM(gmpnum_result1);
INIT_GMP_NUM(gmpnum_result2);
diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h
index 9268f0985..ecf19cc6a 100644
--- a/ext/gmp/php_gmp.h
+++ b/ext/gmp/php_gmp.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/gmp/tests/bug32773.phpt b/ext/gmp/tests/bug32773.phpt
index 0890362c7..feb9d8d75 100644
--- a/ext/gmp/tests/bug32773.phpt
+++ b/ext/gmp/tests/bug32773.phpt
@@ -2,10 +2,8 @@
Bug #32773 binary GMP functions returns unexpected value, when second parameter is int(0)
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
---POST--
---GET--
--FILE--
-<?
+<?php
echo '10 + 0 = ', gmp_strval(gmp_add(10, 0)), "\n";
echo '10 + "0" = ', gmp_strval(gmp_add(10, '0')), "\n";
diff --git a/ext/hwapi/hwapi.cpp b/ext/hwapi/hwapi.cpp
index 28cd778f2..468d58b06 100644
--- a/ext/hwapi/hwapi.cpp
+++ b/ext/hwapi/hwapi.cpp
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
- | PHP version 4.0 |
+ | PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: hwapi.cpp,v 1.10.2.1 2005/02/08 05:38:04 rasmus Exp $ */
+/* $Id: hwapi.cpp,v 1.12 2005/08/03 14:07:15 sniper Exp $ */
#include <stdlib.h>
#include <errno.h>
diff --git a/ext/hwapi/php_hwapi.h b/ext/hwapi/php_hwapi.h
index dae0ce5b1..64070cafe 100644
--- a/ext/hwapi/php_hwapi.h
+++ b/ext/hwapi/php_hwapi.h
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
- | PHP version 4.0 |
+ | PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_hwapi.h,v 1.2.2.1 2005/02/08 05:38:04 rasmus Exp $ */
+/* $Id: php_hwapi.h,v 1.4 2005/08/03 14:07:15 sniper Exp $ */
#ifndef PHP_HWAPI_H
#define PHP_HWAPI_H
diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
index 097c66263..7400c507f 100644
--- a/ext/iconv/config.m4
+++ b/ext/iconv/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.27.2.2 2005/01/10 21:37:59 tony2001 Exp $
+dnl $Id: config.m4,v 1.33.2.2 2005/10/13 19:28:58 sniper Exp $
dnl
PHP_ARG_WITH(iconv, for iconv support,
@@ -18,15 +18,23 @@ if test "$PHP_ICONV" != "no"; then
iconv_ldflags_save="$LDFLAGS"
if test -z "$ICONV_DIR"; then
- PHP_ICONV_PREFIX="/usr"
+ for i in /usr/local /usr; do
+ if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then
+ PHP_ICONV_PREFIX="$i"
+ break
+ fi
+ done
+ if test -z "$PHP_ICONV_PREFIX"; then
+ PHP_ICONV_PREFIX="/usr"
+ fi
else
PHP_ICONV_PREFIX="$ICONV_DIR"
fi
CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
- LDFLAGS="-L$PHP_ICONV_PREFIX/lib $LDFLAGS"
+ LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
- if test -r $PHP_ICONV_PREFIX/include/giconv.h; then
+ if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then
PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
else
PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
@@ -115,6 +123,10 @@ int main() {
AC_MSG_RESULT(no)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv])
AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
+ ],[
+ AC_MSG_RESULT(no, cross-compiling)
+ PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv])
+ AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
])
AC_MSG_CHECKING([if your cpp allows macro usage in include lines])
@@ -134,6 +146,7 @@ int main() {
PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-I\"$PHP_ICONV_PREFIX/include\"])
PHP_SUBST(ICONV_SHARED_LIBADD)
+ PHP_INSTALL_HEADERS([ext/iconv/])
else
AC_MSG_ERROR(Please reinstall the iconv library.)
fi
diff --git a/ext/iconv/config.w32 b/ext/iconv/config.w32
index b640dbef4..8822ffd29 100644
--- a/ext/iconv/config.w32
+++ b/ext/iconv/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.4.2.2 2004/11/23 12:07:25 edink Exp $
+// $Id: config.w32,v 1.6 2004/11/23 12:04:07 edink Exp $
// vim: ft=javascript
ARG_WITH("iconv", "iconv support", "yes");
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index bd5cc15b8..4710f34f3 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iconv.c,v 1.117.2.6 2005/06/08 23:51:05 iliaa Exp $ */
+/* $Id: iconv.c,v 1.124.2.2 2005/10/20 16:51:03 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -583,26 +583,38 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
size_t out_left;
unsigned int cnt;
-
+ unsigned int total_len;
+
+ err = _php_iconv_strlen(&total_len, str, nbytes, enc);
+ if (err != PHP_ICONV_ERR_SUCCESS) {
+ return err;
+ }
+
/* normalize the offset and the length */
- if (offset < 0 || len < 0) {
- unsigned int total_len;
- err = _php_iconv_strlen(&total_len, str, nbytes, enc);
- if (err != PHP_ICONV_ERR_SUCCESS) {
- return err;
- }
- if (offset < 0) {
- if ((offset += total_len) < 0) {
- offset = 0;
- }
+ if (offset < 0) {
+ if ((offset += total_len) < 0) {
+ offset = 0;
}
- if (len < 0) {
- if ((len += (total_len - offset)) < 0) {
- len = 0;
- }
+ }
+ if (len < 0) {
+ if ((len += (total_len - offset)) < 0) {
+ len = 0;
}
}
+ if (offset >= total_len) {
+ return PHP_ICONV_ERR_SUCCESS;
+ }
+
+ if ((offset + len) > total_len) {
+ /* trying to compute the length */
+ len = total_len - offset;
+ }
+
+ if (len == 0) {
+ return PHP_ICONV_ERR_SUCCESS;
+ }
+
cd1 = iconv_open(GENERIC_SUPERSET_NAME, enc);
if (cd1 == (iconv_t)(-1)) {
@@ -1230,7 +1242,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
const char *encoded_word = NULL;
const char *spaces = NULL;
- php_iconv_enc_scheme_t enc_scheme = 0;
+ php_iconv_enc_scheme_t enc_scheme = PHP_ICONV_ENC_SCHEME_BASE64;
if (next_pos != NULL) {
*next_pos = NULL;
@@ -1689,7 +1701,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
if (scan_stat == 1) {
_php_iconv_appendc(pretval, '=', cd_pl);
}
- err = 0;
+ err = PHP_ICONV_ERR_SUCCESS;
} else {
err = PHP_ICONV_ERR_MALFORMED;
goto out;
@@ -2064,7 +2076,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
int charset_len;
long mode = 0;
- php_iconv_err_t err = 0;
+ php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
charset = ICONVG(internal_encoding);
diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h
index 5a0f77c53..9310e3825 100644
--- a/ext/iconv/php_iconv.h
+++ b/ext/iconv/php_iconv.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Revision: 1.22.2.5 $ */
+/* $Revision: 1.28 $ */
#ifndef PHP_ICONV_H
#define PHP_ICONV_H
diff --git a/ext/iconv/tests/bug16069.phpt b/ext/iconv/tests/bug16069.phpt
index 0d58defe3..246b90c6c 100644
--- a/ext/iconv/tests/bug16069.phpt
+++ b/ext/iconv/tests/bug16069.phpt
@@ -2,9 +2,9 @@
Bug #16069
--SKIPIF--
<?php
-/* include( 'skipif.inc' ); */
+include( 'skipif.inc' );
if (@iconv('CP932', 'EUC-JP//TRANSLIT', "\x87\x6d")=='') {
- die("skip CP932 translit not available\n");
+ die("skip CP932 to EUC-JP translit not available\n");
}
?>
--INI--
diff --git a/ext/iconv/tests/eucjp2iso2022jp.phpt b/ext/iconv/tests/eucjp2iso2022jp.phpt
index 13dab43d4..9318c60de 100644
--- a/ext/iconv/tests/eucjp2iso2022jp.phpt
+++ b/ext/iconv/tests/eucjp2iso2022jp.phpt
@@ -1,7 +1,7 @@
--TEST--
EUC-JP to ISO-2022-JP
--SKIPIF--
-<?php /* include('skipif.inc'); */ ?>
+<?php include('skipif.inc'); ?>
--INI--
error_reporting=2039
--FILE--
diff --git a/ext/iconv/tests/eucjp2sjis.phpt b/ext/iconv/tests/eucjp2sjis.phpt
index c1cac62e8..a99512581 100644
--- a/ext/iconv/tests/eucjp2sjis.phpt
+++ b/ext/iconv/tests/eucjp2sjis.phpt
@@ -1,7 +1,7 @@
--TEST--
EUC-JP to SJIS
--SKIPIF--
-<?php /* include('skipif.inc'); */ ?>
+<?php include('skipif.inc'); ?>
--INI--
error_reporting=2039
--FILE--
diff --git a/ext/iconv/tests/eucjp2utf8.phpt b/ext/iconv/tests/eucjp2utf8.phpt
index 2100385cd..4ffcfef51 100644
--- a/ext/iconv/tests/eucjp2utf8.phpt
+++ b/ext/iconv/tests/eucjp2utf8.phpt
@@ -1,7 +1,7 @@
--TEST--
EUC-JP to UTF8
--SKIPIF--
-<?php /* include('skipif.inc'); */ ?>
+<?php include('skipif.inc'); ?>
--INI--
error_reporting=2039
--FILE--
diff --git a/ext/iconv/tests/iconv001.phpt b/ext/iconv/tests/iconv001.phpt
index d2c1f3ed6..3ef49246e 100644
--- a/ext/iconv/tests/iconv001.phpt
+++ b/ext/iconv/tests/iconv001.phpt
@@ -1,7 +1,7 @@
--TEST--
iconv() test 1
--SKIPIF--
-<?php /* include('skipif.inc'); */ ?>
+<?php include('skipif.inc'); ?>
--INI--
error_reporting=2039
--FILE--
diff --git a/ext/iconv/tests/iconv002.phpt b/ext/iconv/tests/iconv002.phpt
index 8aded5886..034b3761f 100644
--- a/ext/iconv/tests/iconv002.phpt
+++ b/ext/iconv/tests/iconv002.phpt
@@ -2,7 +2,7 @@
iconv() test 2 (UCS4BE to ASCII)
--SKIPIF--
<?php
-/* include('skipif.inc'); */
+include('skipif.inc');
if (@iconv("ascii","UCS-4LE", "abcd") == '') {
die("skip conversion to UCS-4LE not supported");
}
diff --git a/ext/iconv/tests/iconv_mime_encode.phpt b/ext/iconv/tests/iconv_mime_encode.phpt
index fd6cc6909..bd090e4d5 100644
--- a/ext/iconv/tests/iconv_mime_encode.phpt
+++ b/ext/iconv/tests/iconv_mime_encode.phpt
@@ -23,7 +23,7 @@ for ($line_len= 0; $line_len < 80; ++$line_len) {
$result = iconv_mime_encode("From", "¥µ¥ó¥×¥ëʸ»úÎó¥µ¥ó¥×¥ëʸ»úÎóÆüËܸì¥Æ¥­¥¹¥È", $preference);
var_dump($result);
if ($result !== false) {
- $max = max(array_map("strlen", explode("\n", $result)));
+ $max = max(array_map("strlen", explode("\n", $result)));
print "-------- ";
var_dump(($max <= $line_len));
} else {
diff --git a/ext/iconv/tests/iconv_substr.phpt b/ext/iconv/tests/iconv_substr.phpt
index efa746e6d..5ee01d488 100644
--- a/ext/iconv/tests/iconv_substr.phpt
+++ b/ext/iconv/tests/iconv_substr.phpt
@@ -9,7 +9,7 @@ iconv.internal_charset=ISO-8859-1
function hexdump($str) {
$len = strlen($str);
for ($i = 0; $i < $len; ++$i) {
- printf("%02x", ord($str{$i}));
+ printf("%02x", ord($str[$i]));
}
print "\n";
}
diff --git a/ext/iconv/tests/ob_iconv_handler.phpt b/ext/iconv/tests/ob_iconv_handler.phpt
index f26f87e97..20f916935 100644
--- a/ext/iconv/tests/ob_iconv_handler.phpt
+++ b/ext/iconv/tests/ob_iconv_handler.phpt
@@ -1,7 +1,7 @@
--TEST--
ob_iconv_handler()
--SKIPIF--
-<?php /* include('skipif.inc'); */ ?>
+<?php include('skipif.inc'); ?>
--INI--
error_reporting=2039
--FILE--
diff --git a/ext/iconv/tests/skipif.inc b/ext/iconv/tests/skipif.inc
index 6f7bbf2b8..70d006744 100644
--- a/ext/iconv/tests/skipif.inc
+++ b/ext/iconv/tests/skipif.inc
@@ -1,12 +1,5 @@
<?php
-// This script prints "skip" if condition does not meet.
-
-// Do not dl load extension
-//if (!extension_loaded("iconv") && ini_get("enable_dl")) {
-// $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so";
-// @dl("iconv$dlext");
-//}
if (!extension_loaded("iconv")) {
die("skip iconv extension not available\n");
}
-?> \ No newline at end of file
+?>
diff --git a/ext/iconv/tests/translit-failure.phpt b/ext/iconv/tests/translit-failure.phpt
index a97e29c02..d8b9fbff8 100644
--- a/ext/iconv/tests/translit-failure.phpt
+++ b/ext/iconv/tests/translit-failure.phpt
@@ -2,7 +2,7 @@
Translit failure
--SKIPIF--
<?php
-/* include('skipif.inc'); */
+include('skipif.inc');
( ICONV_IMPL != "libiconv" ) and die("skip ICONV_IMPL != \"libiconv\"");
?>
--INI--
diff --git a/ext/iconv/tests/translit-utf8.phpt b/ext/iconv/tests/translit-utf8.phpt
index 64991aab8..aa5131f2c 100644
--- a/ext/iconv/tests/translit-utf8.phpt
+++ b/ext/iconv/tests/translit-utf8.phpt
@@ -2,7 +2,7 @@
Translit UTF-8 quotes
--SKIPIF--
<?php
-/* include('skipif.inc'); */
+include('skipif.inc');
( ICONV_IMPL != "libiconv" ) and die("skip ICONV_IMPL != \"libiconv\"");
?>
--INI--
diff --git a/ext/imap/config.m4 b/ext/imap/config.m4
index bae0bf2d8..3fb2ba70b 100644
--- a/ext/imap/config.m4
+++ b/ext/imap/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.63.2.4 2005/01/11 04:56:44 sniper Exp $
+dnl $Id: config.m4,v 1.69 2005/05/29 23:16:41 sniper Exp $
dnl
AC_DEFUN([IMAP_INC_CHK],[if test -r "$i$1/c-client.h"; then
@@ -86,13 +86,13 @@ AC_DEFUN([PHP_IMAP_SSL_CHK], [
PHP_ARG_WITH(imap,for IMAP support,
-[ --with-imap[=DIR] Include IMAP support. DIR is the c-client install prefix.])
+[ --with-imap[=DIR] Include IMAP support. DIR is the c-client install prefix])
PHP_ARG_WITH(kerberos,for IMAP Kerberos support,
-[ --with-kerberos[=DIR] IMAP: Include Kerberos support. DIR is the Kerberos install prefix.], no, no)
+[ --with-kerberos[=DIR] IMAP: Include Kerberos support. DIR is the Kerberos install prefix], no, no)
PHP_ARG_WITH(imap-ssl,for IMAP SSL support,
-[ --with-imap-ssl[=DIR] IMAP: Include SSL support. DIR is the OpenSSL install prefix.], no, no)
+[ --with-imap-ssl[=DIR] IMAP: Include SSL support. DIR is the OpenSSL install prefix], no, no)
if test "$PHP_IMAP" != "no"; then
@@ -148,13 +148,13 @@ if test "$PHP_IMAP" != "no"; then
if test -r "$IMAP_DIR/c-client/c-client.a"; then
ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1
- elif test -r "$IMAP_DIR/lib/c-client.a"; then
- ln -s "$IMAP_DIR/lib/c-client.a" "$IMAP_DIR/lib/libc-client.a" >/dev/null 2>&1
+ elif test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then
+ ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1
fi
for lib in c-client4 c-client imap; do
IMAP_LIB=$lib
- IMAP_LIB_CHK(lib)
+ IMAP_LIB_CHK($PHP_LIBDIR)
IMAP_LIB_CHK(c-client)
done
diff --git a/ext/imap/config.w32 b/ext/imap/config.w32
index 2f905402a..447e1e67f 100644
--- a/ext/imap/config.w32
+++ b/ext/imap/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.3 2003/12/22 23:30:20 fmk Exp $
+// $Id: config.w32,v 1.4 2005/08/01 20:55:31 edink Exp $
// vim:ft=javascript
ARG_WITH("imap", "IMAP Support", "no");
@@ -13,7 +13,7 @@ if (PHP_IMAP == "yes") {
CHECK_LIB("crypt32.lib", "imap");
EXTENSION("imap", "php_imap.c");
- ADD_FLAG("CFLAGS_IMAP", "/D HAVE_IMAP2000=1");
+ ADD_FLAG("CFLAGS_IMAP", "/D HAVE_IMAP2000=1 /D HAVE_IMAP2004=1 /D HAVE_IMAP_SSL=1");
AC_DEFINE('HAVE_IMAP', 1, 'Have IMAP support', true);
} else {
WARNING("imap not enabled; libraries and headers not found");
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index bf261c2c8..50f4cf41d 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.184.2.20 2005/08/30 22:03:42 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.208.2.1 2005/08/30 22:03:28 iliaa Exp $ */
#define IMAP41
@@ -113,7 +113,7 @@ function_entry imap_functions[] = {
PHP_FE(imap_qprint, NULL)
PHP_FE(imap_8bit, NULL)
PHP_FE(imap_binary, NULL)
- PHP_FE(imap_utf8, NULL)
+ PHP_FE(imap_utf8, NULL)
PHP_FE(imap_status, NULL)
PHP_FE(imap_mailboxmsginfo, NULL)
PHP_FE(imap_setflag_full, NULL)
@@ -132,7 +132,7 @@ function_entry imap_functions[] = {
PHP_FE(imap_utf7_encode, NULL)
PHP_FE(imap_mime_header_decode, NULL)
PHP_FE(imap_thread, NULL)
- PHP_FE(imap_timeout, NULL)
+ PHP_FE(imap_timeout, NULL)
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
PHP_FE(imap_get_quota, NULL)
@@ -3135,6 +3135,12 @@ PHP_FUNCTION(imap_mail_compose)
goto done;
}
+ if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot generate multipart e-mail without components.");
+ RETVAL_FALSE;
+ goto done;
+ }
+
rfc822_encode_body_7bit(env, topbod);
rfc822_header (tmp, env, topbod);
@@ -3165,8 +3171,7 @@ PHP_FUNCTION(imap_mail_compose)
efree(tempstring);
} else {
- mystring = emalloc(strlen(tmp) + 1);
- strcpy(mystring, tmp);
+ mystring = estrdup(tmp);
}
bod = topbod;
@@ -3190,8 +3195,9 @@ PHP_FUNCTION(imap_mail_compose)
/* for each part */
do {
+ t=tmp;
/* build cookie */
- sprintf (t=tmp, "--%s%s", cookie, CRLF);
+ sprintf (t, "--%s%s", cookie, CRLF);
/* append mini-header */
rfc822_write_body_header(&t, &part->body);
@@ -3201,37 +3207,36 @@ PHP_FUNCTION(imap_mail_compose)
/* output cookie, mini-header, and contents */
tempstring=emalloc(strlen(mystring)+strlen(tmp)+1);
- strcpy(tempstring, mystring);
+ sprintf(tempstring, "%s%s", mystring, tmp);
efree(mystring);
mystring=tempstring;
- strcat(mystring, tmp);
bod=&part->body;
- tempstring = emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1);
+ tempstring=emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1);
sprintf(tempstring, "%s%s%s", mystring, bod->contents.text.data, CRLF);
efree(mystring);
- mystring = tempstring;
+ mystring=tempstring;
} while ((part = part->next)); /* until done */
/* output trailing cookie */
sprintf(tmp, "--%s--", cookie);
- tempstring = emalloc(strlen(tmp)+strlen(CRLF)+strlen(mystring)+1);
+ tempstring=emalloc(strlen(tmp)+strlen(CRLF)+strlen(mystring)+1);
sprintf(tempstring, "%s%s%s", mystring, tmp, CRLF);
efree(mystring);
- mystring = tempstring;
+ mystring=tempstring;
} else if (bod) {
tempstring = emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1);
sprintf(tempstring, "%s%s%s", mystring, bod->contents.text.data, CRLF);
efree(mystring);
- mystring = tempstring;
+ mystring=tempstring;
} else {
efree(mystring);
RETVAL_FALSE;
goto done;
}
- RETVAL_STRING(tempstring, 0);
+ RETVAL_STRING(tempstring, 0);
done:
mail_free_body(&topbod);
mail_free_envelope(&env);
@@ -3342,7 +3347,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
strcat(bufferHeader, headers);
}
- if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath) != SUCCESS) {
+ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath TSRMLS_CC) != SUCCESS) {
if (tsm_errmsg) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg);
efree(tsm_errmsg);
diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h
index 1ba5a427d..504620660 100644
--- a/ext/imap/php_imap.h
+++ b/ext/imap/php_imap.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.h,v 1.31 2004/01/08 17:32:12 sniper Exp $ */
+/* $Id: php_imap.h,v 1.32 2005/08/03 14:07:17 sniper Exp $ */
#ifndef PHP_IMAP_H
#define PHP_IMAP_H
diff --git a/ext/imap/tests/bug32589.phpt b/ext/imap/tests/bug32589.phpt
new file mode 100644
index 000000000..c5030e897
--- /dev/null
+++ b/ext/imap/tests/bug32589.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #32589 (crash inside imap_mail_compose() function)
+--SKIPIF--
+<?php
+ if (!extension_loaded("imap")) {
+ die("skip imap extension not available");
+ }
+?>
+--FILE--
+<?php
+$m_envelope["To"] = "mail@example.com";
+$m_part1["type"] = TYPEMULTIPART;
+$m_part1["subtype"] = "mixed";
+$m_part2["type"] = TYPETEXT;
+$m_part2["subtype"] = "plain";
+$m_part2["description"] = "text_message";
+
+$m_part2["charset"] = "ISO-8859-2";
+
+$m_part2["contents.data"] = "hello";
+$m_body[1] = $m_part1;
+$m_body[2] = $m_part2;
+echo imap_mail_compose($m_envelope, $m_body);
+?>
+--EXPECTF--
+MIME-Version: 1.0
+Content-Type: MULTIPART/mixed; BOUNDARY="%s"
+
+%s
+Content-Type: TEXT/plain; CHARSET=ISO-8859-2
+Content-Description: text_message
+
+hello
+%s
diff --git a/ext/informix/Makefile.frag b/ext/informix/Makefile.frag
index 2177182f0..be573572b 100644
--- a/ext/informix/Makefile.frag
+++ b/ext/informix/Makefile.frag
@@ -1,7 +1,7 @@
OVERALL_TARGET += $(srcdir)/ifx.c
-$(srcdir)/ifx.c: $(srcdir)/ifx.ec $(builddir)/libphpifx.a
+$(srcdir)/ifx.c: $(srcdir)/ifx.ec
(if test -d $(INFORMIXDIR); then \
THREADLIB=POSIX $(INFORMIXDIR)/bin/esql -e $(IFX_ESQL_FLAGS) $(srcdir)/ifx.ec; mv ifx.c $@; \
THREADLIB=POSIX $(INFORMIXDIR)/bin/esql -e $(IFX_ESQL_FLAGS) $(srcdir)/ifx.ec; \
@@ -10,5 +10,3 @@ $(srcdir)/ifx.c: $(srcdir)/ifx.ec $(builddir)/libphpifx.a
touch $@; \
fi)
-$(builddir)/libphpifx.a:
- $(LIBTOOL) --mode=link $(CC) $(IFX_LIBOBJS) -o $@
diff --git a/ext/informix/config.m4 b/ext/informix/config.m4
index bdcc585df..c76eaff10 100644
--- a/ext/informix/config.m4
+++ b/ext/informix/config.m4
@@ -1,10 +1,10 @@
dnl
-dnl $Id: config.m4,v 1.30 2003/02/25 05:33:27 nobbie Exp $
+dnl $Id: config.m4,v 1.34 2005/07/29 19:41:00 sniper Exp $
dnl
PHP_ARG_WITH(informix,for Informix support,
[ --with-informix[=DIR] Include Informix support. DIR is the Informix base
- install directory, defaults to ${INFORMIXDIR:-nothing}.])
+ install directory, defaults to ${INFORMIXDIR:-nothing}])
if test "$PHP_INFORMIX" != "no"; then
@@ -44,8 +44,20 @@ if test "$PHP_INFORMIX" != "no"; then
esac
AC_MSG_CHECKING([Informix version])
+ IFX_IBM_VERSION=[`$INFORMIXDIR/bin/esql -V | grep "IBM Informix-ESQL Version" | sed -ne '1 s/\(.*\)ESQL Version \([0-9]*\)\.\([0-9]*\).*/\2\3/p'`]
IFX_VERSION=[`$INFORMIXDIR/bin/esql -V | grep "ESQL Version" | sed -ne '1 s/\(.*\)ESQL Version \([0-9]*\)\.\([0-9]*\).*/\2\3/p'`]
- AC_MSG_RESULT($IFX_VERSION)
+
+ if test "$IFX_IBM_VERSION"; then
+ if test $IFX_IBM_VERSION -ge "290" && test $IFX_IBM_VERSION -lt "300"; then
+ IFX_VERSION=960
+ else
+ IFX_VERSION=$IFX_IBM_VERSION
+ fi
+ AC_MSG_RESULT([IBM: $IFX_VERSION])
+ else
+ AC_MSG_RESULT([$IFX_VERSION])
+ fi
+
AC_DEFINE_UNQUOTED(IFX_VERSION, $IFX_VERSION, [ ])
if test $IFX_VERSION -ge "900"; then
@@ -60,10 +72,8 @@ if test "$PHP_INFORMIX" != "no"; then
for i in $IFX_LIBS; do
case "$i" in
- *.o)
- IFX_LIBOBJS="$IFX_LIBOBJS $i"
- PHP_ADD_LIBPATH($ext_builddir, INFORMIX_SHARED_LIBADD)
- PHP_ADD_LIBRARY_DEFER(phpifx, 1, INFORMIX_SHARED_LIBADD)
+ *.o)
+ DLIBS="$DLIBS $i"
;;
-lm)
;;
@@ -90,7 +100,10 @@ if test "$PHP_INFORMIX" != "no"; then
PHP_SUBST(INFORMIX_SHARED_LIBADD)
PHP_SUBST(INFORMIXDIR)
- PHP_SUBST(IFX_LIBOBJS)
PHP_SUBST(IFX_ESQL_FLAGS)
AC_DEFINE(HAVE_IFX,1,[ ])
+
+ if test "$ext_shared" = "yes"; then
+ with_tags=
+ fi
fi
diff --git a/ext/informix/config.w32 b/ext/informix/config.w32
index cd8d03086..ca28cf0be 100644
--- a/ext/informix/config.w32
+++ b/ext/informix/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1.2.1 2004/07/29 21:12:41 edink Exp $
+// $Id: config.w32,v 1.2 2004/07/29 21:09:22 edink Exp $
// vim:ft=javascript
ARG_WITH("informix", "informix support", "no");
diff --git a/ext/informix/ifx.ec b/ext/informix/ifx.ec
index 9dda2297c..4d58abdd4 100644
--- a/ext/informix/ifx.ec
+++ b/ext/informix/ifx.ec
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ifx.ec,v 1.107.2.1 2004/12/16 12:35:41 sniper Exp $ */
+/* $Id: ifx.ec,v 1.109 2005/08/03 14:07:17 sniper Exp $ */
/* -------------------------------------------------------------------
* if you want a function reference : "grep '^\*\*' ifx.ec" will give
diff --git a/ext/informix/php_informix.h b/ext/informix/php_informix.h
index 7ae01d3c5..43eb8fab2 100644
--- a/ext/informix/php_informix.h
+++ b/ext/informix/php_informix.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_informix.h,v 1.22 2004/01/08 17:32:12 sniper Exp $ */
+/* $Id: php_informix.h,v 1.23 2005/08/03 14:07:19 sniper Exp $ */
#ifndef PHP_INFORMIX_H
#define PHP_INFORMIX_H
diff --git a/ext/informix/php_informix_includes.h b/ext/informix/php_informix_includes.h
index 1686ef9c7..bf061c4c4 100644
--- a/ext/informix/php_informix_includes.h
+++ b/ext/informix/php_informix_includes.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_informix_includes.h,v 1.6 2004/01/08 17:32:12 sniper Exp $ */
+/* $Id: php_informix_includes.h,v 1.7 2005/08/03 14:07:19 sniper Exp $ */
#ifndef PHP_INFORMIX_INCLUDES_H
#define PHP_INFORMIX_INCLUDES_H
diff --git a/ext/ingres_ii/CREDITS b/ext/ingres_ii/CREDITS
deleted file mode 100644
index f23fb1d63..000000000
--- a/ext/ingres_ii/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-Ingres II
-David Hénot
diff --git a/ext/ingres_ii/EXPERIMENTAL b/ext/ingres_ii/EXPERIMENTAL
deleted file mode 100644
index 6443e9964..000000000
--- a/ext/ingres_ii/EXPERIMENTAL
+++ /dev/null
@@ -1,5 +0,0 @@
-this extension is experimental,
-its functions may change their names
-or move to extension all together
-so do not rely to much on them
-you have been warned!
diff --git a/ext/ingres_ii/README b/ext/ingres_ii/README
deleted file mode 100644
index 422bec995..000000000
--- a/ext/ingres_ii/README
+++ /dev/null
@@ -1,13 +0,0 @@
-Ingres II extension for PHP
-===========================
-
-This extension provides access to Ingres II servers from PHP 4.0.
-It is still in development and has been only quickly tested on
-Linux (Mandrake 5.3 for Intel), so you should avoid using it with
-critical data.
-
-To enable the extension just add --with-ingres to your ./configure
-line. If the Ingres files are not found, use --with-ingres=DIR instead
-to specify your Ingres installation directory.
-
-Please report suggestions to henot@php.net.
diff --git a/ext/ingres_ii/config.m4 b/ext/ingres_ii/config.m4
deleted file mode 100644
index fa352287c..000000000
--- a/ext/ingres_ii/config.m4
+++ /dev/null
@@ -1,37 +0,0 @@
-dnl
-dnl $Id: config.m4,v 1.9.2.1 2005/05/20 16:13:26 grantc Exp $
-dnl
-
-PHP_ARG_WITH(ingres, for Ingres II support,
-[ --with-ingres[=DIR] Include Ingres II support. DIR is the Ingres
- base directory (default $II_SYSTEM/ingres)])
-
-if test "$PHP_INGRES" != "no"; then
- AC_DEFINE(HAVE_II, 1, [Whether you have Ingres II])
- PHP_NEW_EXTENSION(ingres_ii, ii.c, $ext_shared)
- PHP_SUBST(II_SHARED_LIBADD)
-
- if test "$PHP_INGRES" = "yes"; then
- II_DIR=$II_SYSTEM/ingres
- else
- II_DIR=$PHP_INGRES
- fi
-
- if test -r $II_DIR/files/iiapi.h; then
- II_INC_DIR=$II_DIR/files
- else
- AC_MSG_ERROR(Cannot find iiapi.h under $II_DIR/files)
- fi
-
- if test -r $II_DIR/lib/libiiapi.a; then
- II_LIB_DIR=$II_DIR/lib
- else
- AC_MSG_ERROR(Cannot find libiiapi.a under $II_DIR/lib)
- fi
-
- PHP_ADD_LIBRARY_WITH_PATH(iiapi.1, $II_LIB_DIR, II_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(q.1, $II_LIB_DIR, II_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(frame.1, $II_LIB_DIR, II_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(compat.1, $II_LIB_DIR, II_SHARED_LIBADD)
- PHP_ADD_INCLUDE($II_INC_DIR)
-fi
diff --git a/ext/ingres_ii/config.w32 b/ext/ingres_ii/config.w32
deleted file mode 100644
index e9568c783..000000000
--- a/ext/ingres_ii/config.w32
+++ /dev/null
@@ -1,36 +0,0 @@
-// $Id: config.w32,v 1.1.2.2 2005/03/18 23:25:29 sniper Exp $
-// vim:ft=javascript ts=4 sw=4
-
-ARG_WITH("ingres", "Ingres support", "no");
-
-if (PHP_INGRES != "no") {
- if (PHP_INGRES == "yes") {
- // no path was supplied to --with-ingres
- // Find Ingres header files and libaries through %II_SYSTEM%
- var ii_system=WshShell.Environment("Process").Item("II_SYSTEM");
-
- if (ii_system != "") {
- if (CHECK_HEADER_ADD_INCLUDE("iiapi.h", "CFLAGS_INGRES", ii_system + "\\ingres\\files;" + PHP_INGRES) &&
- CHECK_LIB("iilibapi.lib", "ingres", ii_system + "\\ingres\\lib;" + PHP_INGRES)) {
- AC_DEFINE('HAVE_II', 1);
- EXTENSION("ingres_ii","ii.c");
- } else {
- // ingres is missing files
- WARNING("Ingres not enabled; libraries and headers not found in " + ii_system);
- }
- } else {
- // %II_SYSTEM% is not set
- WARNING("Ingres not enabled; %II_SYSTEM% has not been defined");
- }
- } else {
- // path supplied to --with-ingres
- if (CHECK_HEADER_ADD_INCLUDE("iiapi.h", "CFLAGS_INGRES", PHP_INGRES + "\\ingres\\files;") &&
- CHECK_LIB("iilibapi.lib", "ingres", PHP_INGRES + "\\ingres\\lib;")) {
- AC_DEFINE('HAVE_II', 1);
- EXTENSION("ingres","ii.c");
- } else {
- // cannot find files in supplied path
- WARNING("Ingres not enabled; libraries and headers not found");
- }
- }
-}
diff --git a/ext/ingres_ii/ii.c b/ext/ingres_ii/ii.c
deleted file mode 100644
index 499370ea8..000000000
--- a/ext/ingres_ii/ii.c
+++ /dev/null
@@ -1,1545 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Contributed by ECL IP'S Software & Services |
- | http://www.eclips-software.com |
- | mailto://idev@eclips-software.com |
- | Author: David Hénot <henot@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: ii.c,v 1.41 2004/05/18 23:26:41 iliaa Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_globals.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_ii.h"
-#include "ii.h"
-#include "ext/standard/php_string.h"
-
-#if HAVE_II
-
-ZEND_DECLARE_MODULE_GLOBALS(ii)
-
-/* True globals, no need for thread safety */
-static int le_ii_link, le_ii_plink;
-
-#define SAFE_STRING(s) ((s)?(s):"")
-
-/* Every user visible function must have an entry in ii_functions[].
-*/
-function_entry ii_functions[] = {
- PHP_FE(ingres_connect, NULL)
- PHP_FE(ingres_pconnect, NULL)
- PHP_FE(ingres_close, NULL)
- PHP_FE(ingres_query, NULL)
- PHP_FE(ingres_num_rows, NULL)
- PHP_FE(ingres_num_fields, NULL)
- PHP_FE(ingres_field_name, NULL)
- PHP_FE(ingres_field_type, NULL)
- PHP_FE(ingres_field_nullable, NULL)
- PHP_FE(ingres_field_length, NULL)
- PHP_FE(ingres_field_precision, NULL)
- PHP_FE(ingres_field_scale, NULL)
- PHP_FE(ingres_fetch_array, NULL)
- PHP_FE(ingres_fetch_row, NULL)
- PHP_FE(ingres_fetch_object, NULL)
- PHP_FE(ingres_rollback, NULL)
- PHP_FE(ingres_commit, NULL)
- PHP_FE(ingres_autocommit, NULL)
- {NULL, NULL, NULL} /* Must be the last line in ii_functions[] */
-};
-
-zend_module_entry ingres_ii_module_entry = {
- STANDARD_MODULE_HEADER,
- "ingres_ii",
- ii_functions,
- PHP_MINIT(ii),
- PHP_MSHUTDOWN(ii),
- PHP_RINIT(ii),
- PHP_RSHUTDOWN(ii),
- PHP_MINFO(ii),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_INGRES_II
-ZEND_GET_MODULE(ingres_ii)
-#endif
-
-/* php.ini entries
-*/
-PHP_INI_BEGIN()
- STD_PHP_INI_BOOLEAN("ingres.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong, allow_persistent, zend_ii_globals, ii_globals)
- STD_PHP_INI_ENTRY_EX("ingres.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_ii_globals, ii_globals, display_link_numbers)
- STD_PHP_INI_ENTRY_EX("ingres.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_ii_globals, ii_globals, display_link_numbers)
- STD_PHP_INI_ENTRY("ingres.default_database", NULL, PHP_INI_ALL, OnUpdateString, default_database, zend_ii_globals, ii_globals)
- STD_PHP_INI_ENTRY("ingres.default_user", NULL, PHP_INI_ALL, OnUpdateString, default_user, zend_ii_globals, ii_globals)
- STD_PHP_INI_ENTRY("ingres.default_password", NULL, PHP_INI_ALL, OnUpdateString, default_password, zend_ii_globals, ii_globals)
-PHP_INI_END()
-
-/* closes statement in given link
-*/
-static int _close_statement(II_LINK *link)
-{
- IIAPI_CLOSEPARM closeParm;
-
- closeParm.cl_genParm.gp_callback = NULL;
- closeParm.cl_genParm.gp_closure = NULL;
- closeParm.cl_stmtHandle = link->stmtHandle;
-
- IIapi_close(&closeParm);
- ii_sync(&(closeParm.cl_genParm));
-
- if (ii_success(&(closeParm.cl_genParm)) == II_FAIL) {
- return 1;
- }
-
- link->stmtHandle = NULL;
- link->fieldCount = 0;
- link->descriptor = NULL;
- return 0;
-}
-
-/* rolls back transaction in given link
- after closing the active transaction (if any)
-*/
-static int _rollback_transaction(II_LINK *link TSRMLS_DC)
-{
- IIAPI_ROLLBACKPARM rollbackParm;
-
- if (link->stmtHandle && _close_statement(link)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to close statement !!");
- return 1;
- }
-
- rollbackParm.rb_genParm.gp_callback = NULL;
- rollbackParm.rb_genParm.gp_closure = NULL;
- rollbackParm.rb_tranHandle = link->tranHandle;
- rollbackParm.rb_savePointHandle = NULL;
-
- IIapi_rollback(&rollbackParm);
- ii_sync(&(rollbackParm.rb_genParm));
-
- if (ii_success(&(rollbackParm.rb_genParm)) == II_FAIL) {
- return 1;
- }
-
- link->tranHandle = NULL;
- return 0;
-}
-
-static void _close_ii_link(II_LINK *link TSRMLS_DC)
-{
- IIAPI_DISCONNPARM disconnParm;
-
- if (link->tranHandle && _rollback_transaction(link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to rollback transaction !!");
- }
-
- disconnParm.dc_genParm.gp_callback = NULL;
- disconnParm.dc_genParm.gp_closure = NULL;
- disconnParm.dc_connHandle = link->connHandle;
-
- IIapi_disconnect(&disconnParm);
-
- free(link);
-
- IIG(num_links)--;
-}
-
-/* closes the given link, actually disconnecting from server
- and releasing associated resources after rolling back the
- active transaction (if any)
-*/
-static void php_close_ii_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- II_LINK *link = (II_LINK *) rsrc->ptr;
-
- _close_ii_link(link TSRMLS_CC);
-}
-
-/* closes the given persistent link, see _close_ii_link
-*/
-static void _close_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- II_LINK *link = (II_LINK *) rsrc->ptr;
-
- _close_ii_link(link TSRMLS_CC);
- IIG(num_persistent)--;
-}
-
-/* cleans up the given persistent link.
- used when the request ends to 'refresh' the link for use
- by the next request
-*/
-static void _ai_clean_ii_plink(II_LINK *link TSRMLS_DC)
-{
- int ai_error = 0;
- IIAPI_DISCONNPARM disconnParm;
- IIAPI_AUTOPARM autoParm;
-
- /* if link as always been marked as broken do nothing */
- /* This because we call this function directly from close function */
- /* And it's called in the end of request */
- if (link->connHandle == NULL) {
- return;
- }
-
- if (link->stmtHandle && _close_statement(link)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to close statement !!");
- ai_error = 1;
- }
-
- if (link->autocommit) {
- autoParm.ac_genParm.gp_callback = NULL;
- autoParm.ac_genParm.gp_closure = NULL;
- autoParm.ac_connHandle = link->connHandle;
- autoParm.ac_tranHandle = link->tranHandle;
-
- IIapi_autocommit(&autoParm);
- ii_sync(&(autoParm.ac_genParm));
-
- if (ii_success(&(autoParm.ac_genParm)) == II_FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to disable autocommit");
- }
-
- link->autocommit = 0;
- link->tranHandle = NULL;
- }
-
- if (link->tranHandle && _rollback_transaction(link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to rollback transaction !!");
- }
-
- /* Assume link is broken, close it, and mark it as broken with conn Handle NULL */
- if (ai_error) {
- disconnParm.dc_genParm.gp_callback = NULL;
- disconnParm.dc_genParm.gp_closure = NULL;
- disconnParm.dc_connHandle = link->connHandle;
-
- IIapi_disconnect(&disconnParm);
- link->connHandle = NULL;
- }
-}
-
-static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- II_LINK *link = (II_LINK *)rsrc->ptr;
- _ai_clean_ii_plink(link TSRMLS_CC);
-}
-
-/* sets the default link
-*/
-static void php_ii_set_default_link(int id TSRMLS_DC)
-{
- if (IIG(default_link) != -1) {
- zend_list_delete(IIG(default_link));
- }
- IIG(default_link) = id;
- zend_list_addref(id);
-}
-
-/* gets the default link
- if none has been set, tries to open a new one with default
- parameters
-*/
-static int php_ii_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
-{
- if (IIG(default_link) == -1) { /* no link opened yet, implicitly open one */
- ht = 0;
- php_ii_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
- }
- return IIG(default_link);
-}
-
-static void php_ii_globals_init(zend_ii_globals *ii_globals)
-{
- ii_globals->num_persistent = 0;
-}
-
-/* Module initialization
-*/
-PHP_MINIT_FUNCTION(ii)
-{
- IIAPI_INITPARM initParm;
-
- ZEND_INIT_MODULE_GLOBALS(ii, php_ii_globals_init, NULL);
- REGISTER_INI_ENTRIES();
-
- le_ii_link = zend_register_list_destructors_ex(php_close_ii_link, NULL, "ingres", module_number);
- le_ii_plink = zend_register_list_destructors_ex(_clean_ii_plink, _close_ii_plink, "ingres persistent", module_number);
-
- /* Constants registration */
- REGISTER_LONG_CONSTANT("INGRES_ASSOC", II_ASSOC, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("INGRES_NUM", II_NUM, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("INGRES_BOTH", II_BOTH, CONST_CS | CONST_PERSISTENT);
-
- /* Ingres api initialization */
- initParm.in_timeout = -1; /* timeout in ms, -1 = no timeout */
- initParm.in_version = IIAPI_VERSION_1; /* api version used */
-
- IIapi_initialize(&initParm);
- if (initParm.in_status == IIAPI_ST_SUCCESS) {
- return SUCCESS;
- } else {
- return FAILURE;
- }
-}
-
-/* Module shutdown
-*/
-PHP_MSHUTDOWN_FUNCTION(ii)
-{
- IIAPI_TERMPARM termParm;
-
- UNREGISTER_INI_ENTRIES();
-
- /* Ingres api termination */
- IIapi_terminate(&termParm);
- if (termParm.tm_status == IIAPI_ST_SUCCESS) {
- return SUCCESS;
- } else {
- return FAILURE;
- }
-}
-
-/* New request initialization
-*/
-PHP_RINIT_FUNCTION(ii)
-{
- IIG(default_link) = -1;
- IIG(num_links) = IIG(num_persistent);
- return SUCCESS;
-}
-
-/* End of request
-*/
-PHP_RSHUTDOWN_FUNCTION(ii)
-{
- if (IIG(default_link) != -1) {
- zend_list_delete(IIG(default_link));
- IIG(default_link) = -1;
- }
- return SUCCESS;
-}
-
-/* Informations reported to phpinfo()
-*/
-PHP_MINFO_FUNCTION(ii)
-{
- char buf[32];
-
- php_info_print_table_start();
- php_info_print_table_header(2, "Ingres II Support", "enabled");
- sprintf(buf, "%ld", IIG(num_persistent));
- php_info_print_table_row(2, "Active Persistent Links", buf);
- sprintf(buf, "%ld", IIG(num_links));
- php_info_print_table_row(2, "Active Links", buf);
- php_info_print_table_end();
-
- DISPLAY_INI_ENTRIES();
-}
-
-/* Waits for completion of the last Ingres api call
- used because of the asynchronous design of this api
-*/
-static int ii_sync(IIAPI_GENPARM *genParm)
-{
- static IIAPI_WAITPARM waitParm = {
- -1, /* no timeout, we don't want asynchronous queries */
- 0 /* wt_status (output) */
- };
-
- while (genParm->gp_completed == FALSE) {
- IIapi_wait(&waitParm);
- }
-
- if (waitParm.wt_status != IIAPI_ST_SUCCESS) {
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unexpected failure of IIapi_wait()");
- return 0;
- }
- return 1;
-}
-
-/* Handles errors from Ingres api
-*/
-static int ii_success(IIAPI_GENPARM *genParm)
-{
- switch (genParm->gp_status) {
-
- case IIAPI_ST_SUCCESS:
- return II_OK;
-
- case IIAPI_ST_NO_DATA:
- return II_NO_DATA;
-
- default:
- if (genParm->gp_errorHandle == NULL) { /* no error message available */
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Server or API error - no error message available");
- } else {
- IIAPI_GETEINFOPARM getEInfoParm;
- TSRMLS_FETCH();
-
- getEInfoParm.ge_errorHandle = genParm->gp_errorHandle;
- IIapi_getErrorInfo(&getEInfoParm);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Server or API error : %s", getEInfoParm.ge_message);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: SQLSTATE : %s", getEInfoParm.ge_SQLSTATE);
- }
- return II_FAIL;
- }
-}
-
-/* Actually handles connection creation, either persistent or not
-*/
-static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
-{
- zval **database, **username, **password;
- char *db, *user, *pass;
- int argc;
- char *hashed_details;
- int hashed_details_length;
- IIAPI_CONNPARM connParm;
- II_LINK *link;
-
- /* Setting db, user and pass according to sql_safe_mode, parameters and/or default values */
- argc = ZEND_NUM_ARGS();
-
- if (PG(sql_safe_mode)) { /* sql_safe_mode */
-
- if (argc > 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information");
- }
-
- db = pass = NULL;
- user = php_get_current_user();
- hashed_details_length = strlen(user) + sizeof("ingres___") - 1;
- hashed_details = (char *) emalloc(hashed_details_length + 1);
- sprintf(hashed_details, "Ingres__%s_", user);
-
- } else { /* non-sql_safe_mode */
-
- db = IIG(default_database);
- user = IIG(default_user);
- pass = IIG(default_password);
-
- if (argc > 3 || zend_get_parameters_ex(argc, &database, &username, &password) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- switch (argc) {
-
- case 3:
- convert_to_string_ex(password);
- pass = Z_STRVAL_PP(password);
- /* Fall-through. */
-
- case 2:
- convert_to_string_ex(username);
- user = Z_STRVAL_PP(username);
- /* Fall-through. */
-
- case 1:
- convert_to_string_ex(database);
- db = Z_STRVAL_PP(database);
- /* Fall-through. */
-
- case 0:
- break;
- }
-
- hashed_details_length = sizeof("ingres___") - 1 +
- strlen(SAFE_STRING(db)) +
- strlen(SAFE_STRING(user)) +
- strlen(SAFE_STRING(pass));
-
- hashed_details = (char *) emalloc(hashed_details_length + 1);
- sprintf(hashed_details, "Ingres_%s_%s_%s", SAFE_STRING(db), SAFE_STRING(user), SAFE_STRING(pass));
- }
-
- /* if asked for unauthorized persistency, issue a warning
- and go for a non-persistent link */
- if (persistent && !IIG(allow_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Persistent links disabled !");
- persistent = 0;
- }
-
- if (persistent) {
- list_entry *le;
-
- /* is this link already in the persistent list ? */
- if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void **) &le) == FAILURE) { /* no, new persistent connection */
- list_entry new_le;
-
- if (IIG(max_links) != -1 && IIG(num_links) >= IIG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Too many open links (%d)", IIG(num_links));
- efree(hashed_details);
- RETURN_FALSE;
- }
- if (IIG(max_persistent) != -1 && IIG(num_persistent) >= IIG(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Too many open persistent links (%d)", IIG(num_persistent));
- efree(hashed_details);
- RETURN_FALSE;
- }
-
- /* create the link */
- connParm.co_genParm.gp_callback = NULL;
- connParm.co_genParm.gp_closure = NULL;
- connParm.co_target = db;
- connParm.co_username = user;
- connParm.co_password = pass;
- connParm.co_timeout = -1; /* -1 is no timeout */
- connParm.co_connHandle = NULL;
- connParm.co_tranHandle = NULL;
-
- IIapi_connect(&connParm);
-
- if (!ii_sync(&(connParm.co_genParm)) || ii_success(&(connParm.co_genParm)) == II_FAIL) {
- efree(hashed_details);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to connect to database (%s)", db);
- RETURN_FALSE;
- }
-
- link = (II_LINK *) malloc(sizeof(II_LINK));
- link->connHandle = connParm.co_connHandle;
- link->tranHandle = NULL;
- link->stmtHandle = NULL;
- link->fieldCount = 0;
- link->descriptor = NULL;
- link->autocommit = 0;
-
- /* hash it up */
- Z_TYPE(new_le) = le_ii_plink;
- new_le.ptr = link;
- if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void *) &new_le, sizeof(list_entry), NULL) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to hash (%s)", hashed_details);
- free(link);
- efree(hashed_details);
- RETURN_FALSE;
- }
- IIG(num_persistent)++;
- IIG(num_links)++;
-
- } else { /* already open persistent connection */
-
- if (Z_TYPE_P(le) != le_ii_plink) {
- efree(hashed_details);
- RETURN_FALSE;
- }
- /* here we should ensure that the link did not die */
- /* unable to figure out the right way to do this */
- /* maybe does the api handle the reconnection transparently ? */
- link = (II_LINK *) le->ptr;
-
- /* Unfortunetaly NO !!!*/
- /* Ingres api doesn't reconnect */
- /* Have to reconnect if cleaning function has flagged link as broken */
- if (link->connHandle == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Ingres II: Broken link (%s),reconnect", db);
-
- /* Recreate the link */
- connParm.co_genParm.gp_callback = NULL;
- connParm.co_genParm.gp_closure = NULL;
- connParm.co_target = db;
- connParm.co_username = user;
- connParm.co_password = pass;
- connParm.co_timeout = -1; /* no timeout */
- connParm.co_connHandle = NULL;
- connParm.co_tranHandle = NULL;
-
- IIapi_connect(&connParm);
-
- if (!ii_sync(&(connParm.co_genParm)) || ii_success(&(connParm.co_genParm)) == II_FAIL) {
- efree(hashed_details);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Ingres II: Unable to connect to database (%s)", db);
- RETURN_FALSE;
- }
-
- link->connHandle = connParm.co_connHandle;
- link->tranHandle = NULL;
- link->stmtHandle = NULL;
- link->fieldCount = 0;
- link->descriptor = NULL;
- link->autocommit = 0;
- }
- }
-
- ZEND_REGISTER_RESOURCE(return_value, link, le_ii_plink);
-
- } else { /* non persistent */
- list_entry *index_ptr, new_index_ptr;
-
- /* first we check the hash for the hashed_details key. if it exists,
- * it should point us to the right offset where the actual link sits.
- * if it doesn't, open a new link, add it to the resource list,
- * and add a pointer to it with hashed_details as the key.
- */
- if (zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length + 1, (void **) &index_ptr) == SUCCESS) {
- int type;
- void *ptr;
-
- if (Z_TYPE_P(index_ptr) != le_index_ptr) {
- RETURN_FALSE;
- }
- link = (II_LINK *) index_ptr->ptr;
- ptr = zend_list_find((int) link, &type); /* check if the link is still there */
- if (ptr && (type == le_ii_link || type == le_ii_plink)) {
- zend_list_addref((int) link);
- Z_LVAL_P(return_value) = (int) link;
-
- php_ii_set_default_link((int) link TSRMLS_CC);
-
- Z_TYPE_P(return_value) = IS_RESOURCE;
- efree(hashed_details);
- return;
- } else {
- zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length + 1);
- }
- }
- if (IIG(max_links) != -1 && IIG(num_links) >= IIG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Too many open links (%d)", IIG(num_links));
- efree(hashed_details);
- RETURN_FALSE;
- }
-
- /* create the link */
- connParm.co_genParm.gp_callback = NULL;
- connParm.co_genParm.gp_closure = NULL;
- connParm.co_target = db;
- connParm.co_username = user;
- connParm.co_password = pass;
- connParm.co_timeout = -1; /* -1 is no timeout */
- connParm.co_connHandle = NULL;
- connParm.co_tranHandle = NULL;
-
- IIapi_connect(&connParm);
-
- if (!ii_sync(&(connParm.co_genParm)) || ii_success(&(connParm.co_genParm)) == II_FAIL) {
- efree(hashed_details);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to connect to database (%s)", db);
- RETURN_FALSE;
- }
-
- link = (II_LINK *) malloc(sizeof(II_LINK));
- link->connHandle = connParm.co_connHandle;
- link->tranHandle = NULL;
- link->stmtHandle = NULL;
- link->fieldCount = 0;
- link->descriptor = NULL;
- link->autocommit = 0;
-
- /* add it to the list */
- ZEND_REGISTER_RESOURCE(return_value, link, le_ii_link);
-
- /* add it to the hash */
- new_index_ptr.ptr = (void *) Z_LVAL_P(return_value);
- Z_TYPE(new_index_ptr) = le_index_ptr;
- if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length + 1, (void *) &new_index_ptr, sizeof(list_entry), NULL) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to hash (%s)", hashed_details);
- free(link);
- efree(hashed_details);
- RETURN_FALSE;
- }
- IIG(num_links)++;
- }
-
- efree(hashed_details);
- php_ii_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC);
-}
-
-/* {{{ proto resource ingres_connect([string database [, string username [, string password]]])
- Open a connection to an Ingres II database the syntax of database is [node_id::]dbname[/svr_class] */
-PHP_FUNCTION(ingres_connect)
-{
- php_ii_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
-}
-/* }}} */
-
-/* {{{ proto resource ingres_pconnect([string database [, string username [, string password]]])
- Open a persistent connection to an Ingres II database the syntax of database is [node_id::]dbname[/svr_class] */
-PHP_FUNCTION(ingres_pconnect)
-{
- php_ii_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
-}
-/* }}} */
-
-/* {{{ proto bool ingres_close([resource link])
- Close an Ingres II database connection */
-PHP_FUNCTION(ingres_close)
-{
- zval **link = NULL;
- int link_id = -1;
- II_LINK *ii_link;
-
- switch (ZEND_NUM_ARGS()) {
- case 0:
- link_id = IIG(default_link);
- break;
-
- case 1:
- if (zend_get_parameters_ex(1, &link) == FAILURE) {
- RETURN_FALSE;
- }
- link_id = -1;
- break;
-
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- /* Call the clean function synchronously here */
- /* Otherwise we have to wait for request shutdown */
- /* This way we can reuse the link in the same script */
- _ai_clean_ii_plink(ii_link TSRMLS_CC);
-
- if (link_id == -1) { /* explicit resource number */
- zend_list_delete(Z_RESVAL_PP(link));
- }
-
- if (link_id != -1 || (link && Z_RESVAL_PP(link) == IIG(default_link))) {
- zend_list_delete(IIG(default_link));
- IIG(default_link) = -1;
- }
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ingres_query(string query [, resource link])
- Send a SQL query to Ingres II */
-/* This should go into the documentation */
-/* Unsupported query types:
- - close
- - commit
- - connect
- - disconnect
- - get dbevent
- - prepare to commit
- - rollback
- - savepoint
- - set autocommit
- - <all cursor related queries>
- (look for dedicated functions instead) */
-PHP_FUNCTION(ingres_query)
-{
- zval **query, **link;
- int argc;
- int link_id = -1;
- II_LINK *ii_link;
- IIAPI_QUERYPARM queryParm;
- IIAPI_GETDESCRPARM getDescrParm;
-
- argc = ZEND_NUM_ARGS();
- if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &query, &link) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc < 2) {
- link_id = php_ii_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- convert_to_string_ex(query);
-
- /* if there's already an active statement, close it */
- if (ii_link->stmtHandle && _close_statement(ii_link)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to close statement !!");
- RETURN_FALSE;
- }
-
- /* send the query */
- queryParm.qy_genParm.gp_callback = NULL;
- queryParm.qy_genParm.gp_closure = NULL;
- queryParm.qy_connHandle = ii_link->connHandle;
- queryParm.qy_tranHandle = ii_link->tranHandle;
- queryParm.qy_stmtHandle = NULL;
- queryParm.qy_queryType = IIAPI_QT_QUERY;
- queryParm.qy_parameters = FALSE;
- queryParm.qy_queryText = Z_STRVAL_PP(query);
-
- IIapi_query(&queryParm);
- ii_sync(&(queryParm.qy_genParm));
-
- if (ii_success(&(queryParm.qy_genParm)) == II_FAIL) {
- RETURN_FALSE;
- }
-
- /* store transaction and statement handles */
- ii_link->tranHandle = queryParm.qy_tranHandle;
- ii_link->stmtHandle = queryParm.qy_stmtHandle;
-
- /* get description of results */
- getDescrParm.gd_genParm.gp_callback = NULL;
- getDescrParm.gd_genParm.gp_closure = NULL;
- getDescrParm.gd_stmtHandle = ii_link->stmtHandle;
-
- IIapi_getDescriptor(&getDescrParm);
- ii_sync(&(getDescrParm.gd_genParm));
-
- if (ii_success(&(getDescrParm.gd_genParm)) == II_FAIL) {
- RETURN_FALSE;
- }
-
- /* store the results */
- ii_link->fieldCount = getDescrParm.gd_descriptorCount;
- ii_link->descriptor = getDescrParm.gd_descriptor;
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int ingres_num_rows([resource link])
- Return the number of rows affected/returned by the last query */
-
-/* Warning : don't call ingres_num_rows() before ingres_fetch_xx(),
- or ingres_fetch_xx() wouldn't find any data */
-PHP_FUNCTION(ingres_num_rows)
-{
- zval **link;
- int argc;
- int link_id = -1;
- II_LINK *ii_link;
- IIAPI_GETQINFOPARM getQInfoParm;
-
- argc = ZEND_NUM_ARGS();
- if (argc > 1 || zend_get_parameters_ex(argc, &link) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc < 1) {
- link_id = php_ii_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- /* get number of affected rows */
- getQInfoParm.gq_genParm.gp_callback = NULL;
- getQInfoParm.gq_genParm.gp_closure = NULL;
- getQInfoParm.gq_stmtHandle = ii_link->stmtHandle;
-
- IIapi_getQueryInfo(&getQInfoParm);
- ii_sync(&(getQInfoParm.gq_genParm));
-
- if (ii_success(&(getQInfoParm.gq_genParm)) == II_FAIL) {
- RETURN_FALSE;
- }
-
- /* return the result */
- if (getQInfoParm.gq_mask & IIAPI_GQ_ROW_COUNT) {
- RETURN_LONG(getQInfoParm.gq_rowCount);
- } else {
- RETURN_LONG(0);
- }
-}
-/* }}} */
-
-/* {{{ proto int ingres_num_fields([resource link])
- Return the number of fields returned by the last query */
-PHP_FUNCTION(ingres_num_fields)
-{
- zval **link;
- int argc;
- int link_id = -1;
- II_LINK *ii_link;
-
- argc = ZEND_NUM_ARGS();
- if (argc > 1 || zend_get_parameters_ex(argc, &link) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc < 1) {
- link_id = php_ii_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- RETURN_LONG(ii_link->fieldCount);
-}
-/* }}} */
-
-#define II_FIELD_INFO_NAME 1
-#define II_FIELD_INFO_TYPE 2
-#define II_FIELD_INFO_NULLABLE 3
-#define II_FIELD_INFO_LENGTH 4
-#define II_FIELD_INFO_PRECISION 5
-#define II_FIELD_INFO_SCALE 6
-
-/* Return information about a field in a query result
-*/
-static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type)
-{
- zval **idx, **link;
- int argc;
- int link_id = -1;
- char *name, *fun_name;
- int index;
- II_LINK *ii_link;
-
- argc = ZEND_NUM_ARGS();
- if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &idx, &link) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc < 2) {
- link_id = php_ii_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- convert_to_long_ex(idx);
- index = Z_LVAL_PP(idx);
-
- if (index < 1 || index > ii_link->fieldCount) {
- switch (info_type) {
-
- case II_FIELD_INFO_NAME:
- fun_name = "ii_field_name";
- break;
-
- case II_FIELD_INFO_TYPE:
- fun_name = "ii_field_type";
- break;
-
- case II_FIELD_INFO_NULLABLE:
- fun_name = "ii_field_nullable";
- break;
-
- case II_FIELD_INFO_LENGTH:
- fun_name = "ii_field_length";
- break;
-
- case II_FIELD_INFO_PRECISION:
- fun_name = "ii_field_precision";
- break;
-
- case II_FIELD_INFO_SCALE:
- fun_name = "ii_field_scale";
- break;
-
- default:
- fun_name = "foobar";
- break;
- }
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: %s() called with wrong index (%d)", fun_name, index);
- RETURN_FALSE;
- }
-
- switch (info_type) {
-
- case II_FIELD_INFO_NAME:
- name = php_ii_field_name(ii_link, index TSRMLS_CC);
- if (name == NULL) {
- RETURN_FALSE;
- }
- RETURN_STRING(name, 1);
- break;
-
- case II_FIELD_INFO_TYPE:
- switch ((ii_link->descriptor[index - 1]).ds_dataType) {
-
- case IIAPI_BYTE_TYPE:
- RETURN_STRING("IIAPI_BYTE_TYPE", 1);
-
- case IIAPI_CHA_TYPE:
- RETURN_STRING("IIAPI_CHA_TYPE", 1);
-
- case IIAPI_CHR_TYPE:
- RETURN_STRING("IIAPI_CHR_TYPE", 1);
-
- case IIAPI_DEC_TYPE:
- RETURN_STRING("IIAPI_DEC_TYPE", 1);
-
- case IIAPI_DTE_TYPE:
- RETURN_STRING("IIAPI_DTE_TYPE", 1);
-
- case IIAPI_FLT_TYPE:
- RETURN_STRING("IIAPI_FLT_TYPE", 1);
-
- case IIAPI_INT_TYPE:
- RETURN_STRING("IIAPI_INT_TYPE", 1);
-
- case IIAPI_LOGKEY_TYPE:
- RETURN_STRING("IIAPI_LOGKEY_TYPE", 1);
-
- case IIAPI_LBYTE_TYPE:
- RETURN_STRING("IIAPI_LBYTE_TYPE", 1);
-
- case IIAPI_LVCH_TYPE:
- RETURN_STRING("IIAPI_LVCH_TYPE", 1);
-
- case IIAPI_MNY_TYPE:
- RETURN_STRING("IIAPI_MNY_TYPE", 1);
-
- case IIAPI_TABKEY_TYPE:
- RETURN_STRING("IIAPI_TABKEY_TYPE", 1);
-
- case IIAPI_TXT_TYPE:
- RETURN_STRING("IIAPI_TXT_TYPE", 1);
-
- case IIAPI_VBYTE_TYPE:
- RETURN_STRING("IIAPI_VBYTE_TYPE", 1);
-
- case IIAPI_VCH_TYPE:
- RETURN_STRING("IIAPI_VCH_TYPE", 1);
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unknown Ingres data type");
- RETURN_FALSE;
- break;
- }
- break;
-
- case II_FIELD_INFO_NULLABLE:
- if ((ii_link->descriptor[index - 1]).ds_nullable) {
- RETURN_TRUE;
- } else {
- RETURN_FALSE;
- }
- break;
-
- case II_FIELD_INFO_LENGTH:
- RETURN_LONG((ii_link->descriptor[index - 1]).ds_length);
- break;
-
- case II_FIELD_INFO_PRECISION:
- RETURN_LONG((ii_link->descriptor[index - 1]).ds_precision);
- break;
-
- case II_FIELD_INFO_SCALE:
- RETURN_LONG((ii_link->descriptor[index - 1]).ds_scale);
- break;
-
- default:
- RETURN_FALSE;
- }
-}
-
-/* Return the name of a field in a query result
-*/
-static char *php_ii_field_name(II_LINK *ii_link, int index TSRMLS_DC)
-{
- if (index < 1 || index > ii_link->fieldCount) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: php_ii_field_name() called with wrong index (%d)", index);
- return NULL;
- }
-
- return (ii_link->descriptor[index - 1]).ds_columnName;
-}
-
-/* {{{ proto string ingres_field_name(int index [, resource link])
- Return the name of a field in a query result index must be >0 and <= ingres_num_fields() */
-PHP_FUNCTION(ingres_field_name)
-{
- php_ii_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, II_FIELD_INFO_NAME);
-}
-/* }}} */
-
-/* {{{ proto string ingres_field_type(int index [, resource link])
- Return the type of a field in a query result index must be >0 and <= ingres_num_fields() */
-PHP_FUNCTION(ingres_field_type)
-{
- php_ii_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, II_FIELD_INFO_TYPE);
-}
-/* }}} */
-
-/* {{{ proto string ingres_field_nullable(int index [, resource link])
- Return true if the field is nullable and false otherwise index must be >0 and <= ingres_num_fields() */
-PHP_FUNCTION(ingres_field_nullable)
-{
- php_ii_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, II_FIELD_INFO_NULLABLE);
-}
-/* }}} */
-
-/* {{{ proto string ingres_field_length(int index [, resource link])
- Return the length of a field in a query result index must be >0 and <= ingres_num_fields() */
-PHP_FUNCTION(ingres_field_length)
-{
- php_ii_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, II_FIELD_INFO_LENGTH);
-}
-/* }}} */
-
-/* {{{ proto string ingres_field_precision(int index [, resource link])
- Return the precision of a field in a query result index must be >0 and <= ingres_num_fields() */
-PHP_FUNCTION(ingres_field_precision)
-{
- php_ii_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, II_FIELD_INFO_PRECISION);
-}
-/* }}} */
-
-/* {{{ proto string ingres_field_scale(int index [, resource link])
- Return the scale of a field in a query result index must be >0 and <= ingres_num_fields() */
-PHP_FUNCTION(ingres_field_scale)
-{
- php_ii_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, II_FIELD_INFO_SCALE);
-}
-/* }}} */
-
-
-/* Convert complex Ingres data types to php-usable ones
-*/
-#define IIAPI_CONVERT(destType, destSize, precision) {\
- convertParm.cv_srcDesc.ds_dataType = (ii_link->descriptor[i+k-2]).ds_dataType;\
- convertParm.cv_srcDesc.ds_nullable = (ii_link->descriptor[i+k-2]).ds_nullable;\
- convertParm.cv_srcDesc.ds_length = (ii_link->descriptor[i+k-2]).ds_length;\
- convertParm.cv_srcDesc.ds_precision = (ii_link->descriptor[i+k-2]).ds_precision;\
- convertParm.cv_srcDesc.ds_scale = (ii_link->descriptor[i+k-2]).ds_scale;\
- convertParm.cv_srcDesc.ds_columnType = (ii_link->descriptor[i+k-2]).ds_columnType;\
- convertParm.cv_srcDesc.ds_columnName = (ii_link->descriptor[i+k-2]).ds_columnName;\
- convertParm.cv_srcValue.dv_null = columnData[k-1].dv_null;\
- convertParm.cv_srcValue.dv_length = columnData[k-1].dv_length;\
- convertParm.cv_srcValue.dv_value = columnData[k-1].dv_value;\
- convertParm.cv_dstDesc.ds_dataType = destType;\
- convertParm.cv_dstDesc.ds_nullable = FALSE;\
- convertParm.cv_dstDesc.ds_length = destSize;\
- convertParm.cv_dstDesc.ds_precision = precision;\
- convertParm.cv_dstDesc.ds_scale = 0;\
- convertParm.cv_dstDesc.ds_columnType = IIAPI_COL_TUPLE;\
- convertParm.cv_dstDesc.ds_columnName = NULL;\
- convertParm.cv_dstValue.dv_null = FALSE;\
- convertParm.cv_dstValue.dv_length = convertParm.cv_dstDesc.ds_length;\
- convertParm.cv_dstValue.dv_value = emalloc(convertParm.cv_dstDesc.ds_length+1);\
-\
- IIapi_convertData(&convertParm);\
-\
- if(ii_success(&(getColParm.gc_genParm))!=II_OK) {\
- RETURN_FALSE;\
- }\
-\
- columnData[k-1].dv_length = convertParm.cv_dstValue.dv_length;\
- columnData[k-1].dv_value = convertParm.cv_dstValue.dv_value;\
- efree(convertParm.cv_srcValue.dv_value);\
-}
-
-
-/* Fetch a row of result
-*/
-static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int result_type)
-{
- IIAPI_GETCOLPARM getColParm;
- IIAPI_DATAVALUE *columnData;
- IIAPI_CONVERTPARM convertParm;
- int i, j, k;
- int more;
- double value_double = 0;
- long value_long = 0;
- char *value_char_p;
- int len, should_copy, correct_length;
-
- /* array initialization */
- array_init(return_value);
-
- /* going through all fields */
- for (i = 1; i <= ii_link->fieldCount;) {
- j = 1;
-
- /* as long as there are no long byte or long varchar fields,
- Ingres is able to fetch many fields at a time, so try to find
- these types and stop if they're found.
- variable j will get number of fields to fetch */
- if ((ii_link->descriptor[i]).ds_dataType != IIAPI_LBYTE_TYPE &&
- (ii_link->descriptor[i]).ds_dataType != IIAPI_LVCH_TYPE) {
- while ( (ii_link->descriptor[i + j - 1]).ds_dataType != IIAPI_LBYTE_TYPE &&
- (ii_link->descriptor[i + j - 1]).ds_dataType != IIAPI_LVCH_TYPE &&
- i + j <= ii_link->fieldCount) {
- j++;
- }
- }
-
- /* allocate memory for j fields */
- columnData = (IIAPI_DATAVALUE *) safe_emalloc(j, sizeof(IIAPI_DATAVALUE), 0);
- for (k = 1; k <= j; k++) {
- columnData[k - 1].dv_value = (II_PTR) emalloc((ii_link->descriptor[i + k - 2]).ds_length);
- }
-
- more = 1; /* this is for multi segment LBYTE and LVCH elements */
-
- while (more) {
- getColParm.gc_genParm.gp_callback = NULL;
- getColParm.gc_genParm.gp_closure = NULL;
- getColParm.gc_rowCount = 1;
- getColParm.gc_columnCount = j;
- getColParm.gc_columnData = columnData;
- getColParm.gc_stmtHandle = ii_link->stmtHandle;
- getColParm.gc_moreSegments = 0;
-
- IIapi_getColumns(&getColParm);
- ii_sync(&(getColParm.gc_genParm));
-
- if (ii_success(&(getColParm.gc_genParm)) != II_OK) {
- RETURN_FALSE;
- }
-
- more = getColParm.gc_moreSegments;
-
- if (more) { /* more segments of LBYTE or LVCH element to come */
-
- /* Multi segment LBYTE and LVCH elements not supported yet */
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Ingres II: Multi segment LBYTE and LVCH elements not supported yet");
-
- } else {
-
- for (k = 1; k <= j; k++) {
- if (columnData[k - 1].dv_null) { /* NULL value ? */
-
- if (result_type & II_NUM) {
- add_index_null(return_value, i + k - 1);
- }
- if (result_type & II_ASSOC) {
- add_assoc_null(return_value, php_ii_field_name(ii_link, i + k - 1 TSRMLS_CC));
- }
-
- } else { /* non NULL value */
- correct_length = 0;
-
- switch ((ii_link->descriptor[i + k - 2]).ds_dataType) {
-
- case IIAPI_DEC_TYPE: /* decimal (fixed point number) */
- case IIAPI_MNY_TYPE: /* money */
- /* convert to floating point number */
- IIAPI_CONVERT(IIAPI_FLT_TYPE, sizeof(II_FLOAT8), 53);
- /* NO break */
-
- case IIAPI_FLT_TYPE: /* floating point number */
- switch (columnData[k - 1].dv_length) {
-
- case 4:
- value_double = (double) *((II_FLOAT4 *) columnData[k - 1].dv_value);
- break;
-
- case 8:
- value_double = (double) *((II_FLOAT8 *) columnData[k - 1].dv_value);
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Invalid size for IIAPI_FLT_TYPE data (%d)", columnData[k - 1].dv_length);
- break;
- }
-
- if (result_type & II_NUM) {
- add_index_double(return_value, i + k - 1, value_double);
- }
-
- if (result_type & II_ASSOC) {
- add_assoc_double(return_value, php_ii_field_name(ii_link, i + k - 1 TSRMLS_CC), value_double);
- }
- break;
-
- case IIAPI_INT_TYPE: /* integer */
- switch (columnData[k - 1].dv_length) {
-
- case 1:
- value_long = (long) *((II_INT1 *) columnData[k - 1].dv_value);
- break;
-
- case 2:
- value_long = (long) *((II_INT2 *) columnData[k - 1].dv_value);
- break;
-
- case 4:
- value_long = (long) *((II_INT4 *) columnData[k - 1].dv_value);
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Invalid size for IIAPI_INT_TYPE data (%d)", columnData[k - 1].dv_length);
- break;
- }
-
- if (result_type & II_NUM) {
- add_index_long(return_value, i + k - 1, value_long);
- }
-
- if (result_type & II_ASSOC) {
- add_assoc_long(return_value, php_ii_field_name(ii_link, i + k - 1 TSRMLS_CC), value_long);
- }
- break;
-
- case IIAPI_TXT_TYPE: /* variable length character string */
- case IIAPI_VBYTE_TYPE: /* variable length binary string */
- case IIAPI_VCH_TYPE: /* variable length character string */
- /* real length is stored in first 2 bytes of data, so adjust
- length variable and data pointer */
- columnData[k - 1].dv_length = *((II_INT2 *) columnData[k - 1].dv_value);
- ((II_INT2 *) columnData[k - 1].dv_value)++;
- correct_length = 1;
- /* NO break */
-
- case IIAPI_BYTE_TYPE: /* fixed length binary string */
- case IIAPI_CHA_TYPE: /* fixed length character string */
- case IIAPI_CHR_TYPE: /* fixed length character string */
- case IIAPI_LOGKEY_TYPE: /* value unique to database */
- case IIAPI_TABKEY_TYPE: /* value unique to table */
- case IIAPI_DTE_TYPE: /* date */
- /* eventualy convert date to string */
- if ((ii_link->descriptor[i + k - 2]).
- ds_dataType == IIAPI_DTE_TYPE) {
- IIAPI_CONVERT(IIAPI_CHA_TYPE, 32, 0);
- }
-
- /* use php_addslashes if asked to */
- if (PG(magic_quotes_runtime)) {
- value_char_p = php_addslashes((char *) columnData[k - 1].dv_value, columnData[k - 1].dv_length, &len, 0 TSRMLS_CC);
- should_copy = 0;
- } else {
- value_char_p = (char *) columnData[k - 1].dv_value;
- len = columnData[k - 1].dv_length;
- should_copy = 1;
- }
-
- if (result_type & II_NUM) {
- add_index_stringl(return_value, i + k - 1, value_char_p, len, should_copy);
- }
-
- if (result_type & II_ASSOC) {
- add_assoc_stringl(return_value, php_ii_field_name(ii_link, i + k - 1 TSRMLS_CC), value_char_p, len, should_copy);
- }
-
- /* eventualy restore data pointer state for
- variable length data types */
- if (correct_length) {
- ((II_INT2 *) columnData[k - 1].dv_value)--;
- }
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Invalid SQL data type in fetched field (%d -- length : %d)", (ii_link->descriptor[i + k - 2]).ds_dataType, columnData[k - 1].dv_length);
- break;
- }
- }
- }
- }
- }
-
- /* free the memory buffers */
- for (k = 1; k <= j; k++) {
- efree(columnData[k - 1].dv_value);
- }
- efree(columnData);
-
- /* increase field pointer by number of fetched fields */
- i += j;
- }
-}
-
-/* {{{ proto array ingres_fetch_array([int result_type [, resource link]])
- Fetch a row of result into an array result_type can be II_NUM for enumerated array, II_ASSOC for associative array, or II_BOTH (default) */
-PHP_FUNCTION(ingres_fetch_array)
-{
- zval **result_type, **link;
- int argc;
- int link_id = -1;
- II_LINK *ii_link;
-
- argc = ZEND_NUM_ARGS();
- if (argc > 2 || zend_get_parameters_ex(argc, &result_type, &link) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc != 2) {
- link_id = php_ii_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
-
- if (argc != 0) {
- convert_to_long_ex(result_type);
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type)));
-}
-/* }}} */
-
-/* {{{ proto array ingres_fetch_row([resource link])
- Fetch a row of result into an enumerated array */
-PHP_FUNCTION(ingres_fetch_row)
-{
- zval **link;
- int argc;
- int link_id = -1;
- II_LINK *ii_link;
-
- argc = ZEND_NUM_ARGS();
- if (argc > 1 || zend_get_parameters_ex(argc, &link) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc != 1) {
- link_id = php_ii_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, II_NUM);
-}
-/* }}} */
-
-/* {{{ proto array ingres_fetch_object([int result_type [, resource link]])
- Fetch a row of result into an object result_type can be II_NUM for enumerated object, II_ASSOC for associative object, or II_BOTH (default) */
-PHP_FUNCTION(ingres_fetch_object)
-{
- zval **result_type, **link;
- int argc;
- int link_id = -1;
- II_LINK *ii_link;
-
- argc = ZEND_NUM_ARGS();
- if (argc > 2 || zend_get_parameters_ex(argc, &result_type, &link) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc != 2) {
- link_id = php_ii_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
- }
-
- if (argc != 0) {
- convert_to_long_ex(result_type);
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type)));
-
- if (Z_TYPE_P(return_value) == IS_ARRAY) {
- convert_to_object(return_value);
- }
-}
-/* }}} */
-
-/* {{{ proto bool ingres_rollback([resource link])
- Roll back a transaction */
-PHP_FUNCTION(ingres_rollback)
-{
- zval **link;
- int argc;
- int link_id = -1;
- II_LINK *ii_link;
-
- argc = ZEND_NUM_ARGS();
- if (argc > 1 || (argc && zend_get_parameters_ex(argc, &link) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc == 0) {
- link_id = IIG(default_link);
- }
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- if (_rollback_transaction(ii_link TSRMLS_CC)) {
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ingres_commit([resource link])
- Commit a transaction */
-PHP_FUNCTION(ingres_commit)
-{
- zval **link;
- int argc;
- int link_id = -1;
- II_LINK *ii_link;
- IIAPI_COMMITPARM commitParm;
-
- argc = ZEND_NUM_ARGS();
- if (argc > 1 || (argc && zend_get_parameters_ex(argc, &link) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc == 0) {
- link_id = IIG(default_link);
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- if (ii_link->stmtHandle && _close_statement(ii_link)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to close statement !!");
- RETURN_FALSE;
- }
-
- commitParm.cm_genParm.gp_callback = NULL;
- commitParm.cm_genParm.gp_closure = NULL;
- commitParm.cm_tranHandle = ii_link->tranHandle;
-
- IIapi_commit(&commitParm);
- ii_sync(&(commitParm.cm_genParm));
-
- if (ii_success(&(commitParm.cm_genParm)) == II_FAIL) {
- RETURN_FALSE;
- }
-
- ii_link->tranHandle = NULL;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ingres_autocommit([resource link])
- Switch autocommit on or off */
-PHP_FUNCTION(ingres_autocommit)
-{
- zval **link;
- int argc;
- int link_id = -1;
- II_LINK *ii_link;
- IIAPI_AUTOPARM autoParm;
-
- argc = ZEND_NUM_ARGS();
- if (argc > 1 || (argc && zend_get_parameters_ex(argc, &link) == FAILURE)) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc == 0) {
- link_id = IIG(default_link);
- }
-
- ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
-
- autoParm.ac_genParm.gp_callback = NULL;
- autoParm.ac_genParm.gp_closure = NULL;
- autoParm.ac_connHandle = ii_link->connHandle;
- autoParm.ac_tranHandle = ii_link->tranHandle;
-
- IIapi_autocommit(&autoParm);
- ii_sync(&(autoParm.ac_genParm));
-
- if (ii_success(&(autoParm.ac_genParm)) == II_FAIL) {
- RETURN_FALSE;
- }
-
- ii_link->autocommit = (ii_link->autocommit ? 0 : 1);
- ii_link->tranHandle = autoParm.ac_tranHandle;
- RETURN_TRUE;
-}
-/* }}} */
-
-#endif /* HAVE_II */
-
-/*
- * 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/ingres_ii/ii.h b/ext/ingres_ii/ii.h
deleted file mode 100644
index 47f04332d..000000000
--- a/ext/ingres_ii/ii.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Contributed by ECL IP'S Software & Services |
- | http://www.eclips-software.com |
- | mailto://idev@eclips-software.com |
- | Author: David Hénot <henot@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: ii.h,v 1.15 2004/01/08 17:32:14 sniper Exp $ */
-
-#ifndef II_H
-#define II_H
-
-#if HAVE_II
-#include "php_ii.h"
-#include "iiapi.h"
-
-typedef struct _II_LINK {
- int autocommit;
- II_PTR connHandle;
- II_PTR tranHandle;
- II_PTR stmtHandle;
- II_LONG fieldCount;
- IIAPI_DESCRIPTOR *descriptor;
-} II_LINK;
-
-static int ii_sync(IIAPI_GENPARM *genParm);
-static int ii_success(IIAPI_GENPARM *genParm);
-#define II_FAIL 0
-#define II_OK 1
-#define II_NO_DATA 2
-static int _close_statement(II_LINK *link);
-static int _rollback_transaction(II_LINK *link TSRMLS_DC);
-static void _close_ii_link(II_LINK *link TSRMLS_DC);
-static void _close_ii_plink(zend_rsrc_list_entry *link TSRMLS_DC);
-static int php_ii_get_default_link(INTERNAL_FUNCTION_PARAMETERS);
-static void php_ii_set_default_link(int id TSRMLS_DC);
-static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent);
-static char *php_ii_field_name(II_LINK *ii_link, int index TSRMLS_DC);
-static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type);
-static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int result_type);
-
-#endif /* HAVE_II */
-#endif /* II_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/ingres_ii/ingres.dsp b/ext/ingres_ii/ingres.dsp
deleted file mode 100644
index d7b515eed..000000000
--- a/ext/ingres_ii/ingres.dsp
+++ /dev/null
@@ -1,111 +0,0 @@
-# Microsoft Developer Studio Project File - Name="ingres" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=ingres - 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 "ingres.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 "ingres.mak" CFG="ingres - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ingres - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ingres - 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)" == "ingres - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INGRES_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_INGRES_II" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_II=1 /D ZTS=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib oiapi.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_ingres.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "ingres - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INGRES_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_INGRES_II" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_II=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib oiapi.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_ingres.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "ingres - Win32 Release_TS"
-# Name "ingres - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\ii.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\ii.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_ii.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/ingres_ii/php_ii.h b/ext/ingres_ii/php_ii.h
deleted file mode 100644
index e0da021fe..000000000
--- a/ext/ingres_ii/php_ii.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Contributed by ECL IP'S Software & Services |
- | http://www.eclips-software.com |
- | mailto://idev@eclips-software.com |
- | Author: David Hénot <henot@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: php_ii.h,v 1.12 2004/01/08 17:32:14 sniper Exp $ */
-
-#ifndef PHP_II_H
-#define PHP_II_H
-
-#if HAVE_II
-
-extern zend_module_entry ingres_ii_module_entry;
-#define phpext_ingres_ii_ptr &ingres_ii_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_II_API __declspec(dllexport)
-#else
-#define PHP_II_API
-#endif
-
-PHP_MINIT_FUNCTION(ii);
-PHP_MSHUTDOWN_FUNCTION(ii);
-PHP_RINIT_FUNCTION(ii);
-PHP_RSHUTDOWN_FUNCTION(ii);
-PHP_MINFO_FUNCTION(ii);
-
-PHP_FUNCTION(ingres_connect);
-PHP_FUNCTION(ingres_pconnect);
-PHP_FUNCTION(ingres_close);
-PHP_FUNCTION(ingres_query);
-PHP_FUNCTION(ingres_num_rows);
-PHP_FUNCTION(ingres_num_fields);
-PHP_FUNCTION(ingres_field_name);
-PHP_FUNCTION(ingres_field_type);
-PHP_FUNCTION(ingres_field_nullable);
-PHP_FUNCTION(ingres_field_length);
-PHP_FUNCTION(ingres_field_precision);
-PHP_FUNCTION(ingres_field_scale);
-PHP_FUNCTION(ingres_fetch_array);
-PHP_FUNCTION(ingres_fetch_row);
-PHP_FUNCTION(ingres_fetch_object);
-PHP_FUNCTION(ingres_rollback);
-PHP_FUNCTION(ingres_commit);
-PHP_FUNCTION(ingres_autocommit);
-
-ZEND_BEGIN_MODULE_GLOBALS(ii)
- long allow_persistent;
- long max_persistent;
- long max_links;
- char *default_database;
- char *default_user;
- char *default_password;
-
- long num_persistent;
- long num_links;
- long default_link;
-ZEND_END_MODULE_GLOBALS(ii)
-
-#define II_ASSOC (1<<0)
-#define II_NUM (1<<1)
-#define II_BOTH (II_ASSOC|II_NUM)
-
-#ifdef ZTS
-#define IIG(v) TSRMG(ii_globals_id, zend_ii_globals *, v)
-#else
-#define IIG(v) (ii_globals.v)
-#endif
-
-#else
-
-#define phpext_ii_ptr NULL
-
-#endif
-
-#endif /* PHP_II_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/interbase/ibase_blobs.c b/ext/interbase/ibase_blobs.c
index 5ce3f11f9..6de200107 100644
--- a/ext/interbase/ibase_blobs.c
+++ b/ext/interbase/ibase_blobs.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: ibase_blobs.c,v 1.8 2004/06/03 12:00:23 abies Exp $ */
+/* $Id: ibase_blobs.c,v 1.9 2005/08/03 14:07:19 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c
index ee33d9c8e..beff8cec8 100644
--- a/ext/interbase/ibase_events.c
+++ b/ext/interbase/ibase_events.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: ibase_events.c,v 1.7 2004/04/19 14:13:41 edink Exp $ */
+/* $Id: ibase_events.c,v 1.8 2005/08/03 14:07:19 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c
index 28991d64d..e7518039d 100644
--- a/ext/interbase/ibase_query.c
+++ b/ext/interbase/ibase_query.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: ibase_query.c,v 1.21.2.1 2004/11/11 12:29:34 abies Exp $ */
+/* $Id: ibase_query.c,v 1.23 2005/08/03 14:07:19 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c
index 3be9471a8..289267945 100644
--- a/ext/interbase/ibase_service.c
+++ b/ext/interbase/ibase_service.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: ibase_service.c,v 1.10 2004/05/12 14:29:42 abies Exp $ */
+/* $Id: ibase_service.c,v 1.11.2.1 2005/10/13 12:58:48 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -210,7 +210,7 @@ PHP_FUNCTION(ibase_delete_user)
Connect to the service manager */
PHP_FUNCTION(ibase_service_attach)
{
- long hlen, ulen, plen, spb_len;
+ int hlen, ulen, plen, spb_len;
ibase_service *svm;
char buf[128], *host, *user, *pass, *loc;
isc_svc_handle handle = NULL;
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 935591bd6..6226e9db9 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: interbase.c,v 1.223.2.1 2005/02/25 13:44:26 abies Exp $ */
+/* $Id: interbase.c,v 1.225 2005/08/03 14:07:19 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/interbase/interbase.rc b/ext/interbase/interbase.rc
index 27d45d1d8..6063d2392 100644
--- a/ext/interbase/interbase.rc
+++ b/ext/interbase/interbase.rc
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: interbase.rc,v 1.6 2004/06/08 10:04:09 abies Exp $ */
+/* $Id: interbase.rc,v 1.7 2005/08/03 14:07:22 sniper Exp $ */
#ifdef APSTUDIO_INVOKED
#error This file cannot be opened from the Visual Studio IDE
diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h
index 15ade040b..953078ce6 100755
--- a/ext/interbase/php_ibase_includes.h
+++ b/ext/interbase/php_ibase_includes.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ibase_includes.h,v 1.15 2004/07/06 13:46:19 abies Exp $ */
+/* $Id: php_ibase_includes.h,v 1.16 2005/08/03 14:07:22 sniper Exp $ */
#ifndef PHP_IBASE_INCLUDES_H
#define PHP_IBASE_INCLUDES_H
diff --git a/ext/interbase/php_ibase_udf.c b/ext/interbase/php_ibase_udf.c
index e1c0bf479..5704fbd95 100644
--- a/ext/interbase/php_ibase_udf.c
+++ b/ext/interbase/php_ibase_udf.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_ibase_udf.c,v 1.7 2004/06/05 10:03:42 abies Exp $ */
+/* $Id: php_ibase_udf.c,v 1.9 2005/08/03 14:07:22 sniper Exp $ */
/**
* This UDF library adds the ability to call PHP functions from SQL
@@ -124,8 +124,8 @@ pthread_mutex_t mtx_res = PTHREAD_MUTEX_INITIALIZER;
#endif
#ifdef PHP_EMBED
-# include "php_main.h"
-# include "php_embed.h"
+# include "php_main.h"
+# include "sapi/embed/php_embed.h"
static void __attribute__((constructor)) init()
{
diff --git a/ext/interbase/php_interbase.h b/ext/interbase/php_interbase.h
index f46704a65..04dce3a93 100644
--- a/ext/interbase/php_interbase.h
+++ b/ext/interbase/php_interbase.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_interbase.h,v 1.70 2004/06/12 20:52:07 abies Exp $ */
+/* $Id: php_interbase.h,v 1.71 2005/08/03 14:07:22 sniper Exp $ */
#ifndef PHP_INTERBASE_H
#define PHP_INTERBASE_H
diff --git a/ext/ircg/CREDITS b/ext/ircg/CREDITS
deleted file mode 100644
index b83adcc40..000000000
--- a/ext/ircg/CREDITS
+++ /dev/null
@@ -1,3 +0,0 @@
-IRCG
-Sascha Schumann
-
diff --git a/ext/ircg/Makefile.frag b/ext/ircg/Makefile.frag
deleted file mode 100644
index f5fb0cdef..000000000
--- a/ext/ircg/Makefile.frag
+++ /dev/null
@@ -1,2 +0,0 @@
-$(srcdir)/ircg_scanner.c: $(srcdir)/ircg_scanner.re
- $(RE2C) $(srcdir)/ircg_scanner.re > $@
diff --git a/ext/ircg/README.txt b/ext/ircg/README.txt
deleted file mode 100644
index 27e92fc72..000000000
--- a/ext/ircg/README.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Check out IRCG 4 which works with Apache and other popular web servers.
-
- http://schumann.cx/ircg/
-
-Support for IRCG 2 has been terminated.
-
-About IRCG
-
-IRCG is a socket server for commodity web servers like Apache and thttpd,
-tieing into a vast network of IRC components.
diff --git a/ext/ircg/config.m4 b/ext/ircg/config.m4
deleted file mode 100644
index d5c72fac4..000000000
--- a/ext/ircg/config.m4
+++ /dev/null
@@ -1,47 +0,0 @@
-dnl
-dnl $Id: config.m4,v 1.23 2003/06/04 01:38:03 sas Exp $
-dnl
-
-PHP_ARG_WITH(ircg, for IRCG support,
-[ --with-ircg Include IRCG support])
-
-AC_ARG_WITH(ircg-config,
-[ --with-ircg-config=PATH IRCG: Path to the ircg-config script],
-[ IRCG_CONFIG=$withval ],
-[
-if test "$PHP_IRCG" != "yes" && test "$PHP_IRCG" != "no"; then
- IRCG_CONFIG=$PHP_IRCG/bin/ircg-config
-else
- IRCG_CONFIG=ircg-config
-fi
-])
-
-if test "$PHP_IRCG" != "no"; then
- IRCG_PREFIX=`$IRCG_CONFIG --prefix`
-
- if test -z "$IRCG_PREFIX"; then
- AC_MSG_ERROR([I cannot run the ircg-config script which should have been installed by IRCG. Please ensure that the script is in your PATH or point --with-ircg-config to the path of the script.])
- fi
-
- PHP_ADD_INCLUDE($IRCG_PREFIX/include)
- PHP_ADD_LIBRARY(ircg,yes,IRCG_SHARED_LIBADD)
- PHP_EVAL_LIBLINE(`$IRCG_CONFIG --ldflags`, IRCG_SHARED_LIBADD)
- PHP_EVAL_INCLINE(`$IRCG_CONFIG --cppflags`)
- PHP_ADD_LIBPATH($IRCG_PREFIX/lib, IRCG_SHARED_LIBADD)
- PHP_SUBST(IRCG_SHARED_LIBADD)
-
- ircg_src=ircg_common.c
- if test "$PHP_SAPI" = "thttpd"; then
- ircg_src=
- PHP_ADD_SOURCES(PHP_EXT_DIR(ircg),ircg_thttpd.c,[],sapi)
- PHP_ADD_SOURCES(PHP_EXT_DIR(ircg),ircg_common.c,[],cli)
- else
- PHP_ADD_LIBRARY(dl,yes,IRCG_SHARED_LIBADD)
- fi
- PHP_NEW_EXTENSION(ircg,[ ircg.c ircg_scanner.c php_ircg_cache.c $ircg_src \
- php_ircg_conversion.c php_ircg_error.c php_ircg_tokenizer.c],
- $ext_shared)
- unset ircg_src
- AC_DEFINE(HAVE_IRCG, 1, [Whether you want IRCG support])
- PHP_ADD_MAKEFILE_FRAGMENT
-fi
diff --git a/ext/ircg/ircg.c b/ext/ircg/ircg.c
deleted file mode 100644
index 8cc40bcbb..000000000
--- a/ext/ircg/ircg.c
+++ /dev/null
@@ -1,2764 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Sascha Schumann <sascha@schumann.cx> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: ircg.c,v 1.200 2004/01/08 08:15:52 andi Exp $ */
-
-/* {{{ includes */
-
-#include <time.h>
-
-#include <fcntl.h>
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "php_ircg.h"
-#include "ext/standard/html.h"
-
-#include "ext/standard/php_lcg.h"
-
-#include "ext/standard/info.h"
-#include "ext/standard/basic_functions.h"
-
-#ifdef PHP_WIN32
-#include "win32/time.h"
-#else
-#include <sys/time.h>
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-/* }}} */
-
-/* {{{ Definitions */
-
-#include "php_ircg_conversion.h"
-#include "php_ircg_cache.h"
-#include "php_ircg_alloc.h"
-#include "php_ircg_error.h"
-#include "php_ircg_tokenizer.h"
-
-#include "php_ircg_smart_str.h"
-#include "php_ircg_private.h"
-
-#ifdef USE_IRCONN_MANAGEMENT
-static HashTable h_irconn; /* Integer IDs to php_irconn_t * */
-static int irconn_id;
-#endif
-
-#ifdef USE_FD2IRCONN
-static HashTable h_fd2irconn; /* fd's to Integer IDs */
-#endif
-
-struct php_ircg_global *php_ircg;
-
-static void *php_ircg_cb_msg_handle;
-static void *php_ircg_cb_wbuf_handle;
-
-/* initialized in the IRCG control process, so that we can avoid locking */
-struct cache_entry *php_ircg_cache_entries;
-
-#define SEEN_FD(fd) do { if ((fd) > php_ircg->highest_fd) php_ircg->highest_fd = (fd); } while (0)
-
-/* }}} */
-
-/* {{{ ircg_functions[] */
-function_entry ircg_functions[] = {
-#ifdef IRCG_PENDING_URL
- PHP_FE(ircg_set_on_die, NULL)
- PHP_FE(ircg_set_on_read_data, NULL)
-#endif
- PHP_FE(ircg_pconnect, NULL)
- PHP_FE(ircg_set_current, NULL)
- PHP_FE(ircg_set_file, NULL)
- PHP_FE(ircg_join, NULL)
- PHP_FE(ircg_part, NULL)
- PHP_FE(ircg_msg, NULL)
- PHP_FE(ircg_notice, NULL)
- PHP_FE(ircg_nick, NULL)
- PHP_FE(ircg_topic, NULL)
- PHP_FE(ircg_channel_mode, NULL)
- PHP_FE(ircg_html_encode, NULL)
- PHP_FE(ircg_whois, NULL)
- PHP_FE(ircg_kick, NULL)
- PHP_FE(ircg_nickname_escape, NULL)
- PHP_FE(ircg_nickname_unescape, NULL)
- PHP_FE(ircg_ignore_add, NULL)
- PHP_FE(ircg_ignore_del, NULL)
- PHP_FE(ircg_disconnect, NULL)
- PHP_FE(ircg_fetch_error_msg, NULL)
- PHP_FE(ircg_is_conn_alive, NULL)
- PHP_FE(ircg_lookup_format_messages, NULL)
- PHP_FE(ircg_register_format_messages, NULL)
- PHP_FE(ircg_get_username, NULL)
- PHP_FE(ircg_eval_ecmascript_params, NULL)
- PHP_FE(ircg_names, NULL)
- PHP_FE(ircg_invite, NULL)
- PHP_FE(ircg_lusers, NULL)
- PHP_FE(ircg_oper, NULL)
- PHP_FE(ircg_who, NULL)
- PHP_FE(ircg_list, NULL)
- {NULL, NULL, NULL} /* Must be the last line in ircg_functions[] */
-};
-/* }}} */
-
-/* {{{ Structures, enumerations, definitions */
-
-#if IRCG_API_VERSION - 0 < 20010303
-# error "Please upgrade to at least IRCG 2.0b1"
-#endif
-
-typedef struct {
- irconn_t conn;
- smart_str buffer;
- time_t login;
- int fd;
- int irconn_id;
-#if 0
- struct sockaddr_in sin; /* address of stream conn */
-#endif
- php_fmt_msgs_t *fmt_msgs;
- irc_write_buf wb;
- ircg_hash_table ctcp_msgs;
-
-#ifdef IRCG_PENDING_URL
- char *od_data; /* On_Die */
- size_t od_len;
- struct in_addr od_ip;
- short od_port;
-
- struct in_addr read_data_ip;
- short read_data_port;
- smart_str read_data_req;
-#endif
-
- char bailout_on_trivial; /* Whether to handle trivial errors as fatal */
-
- char *ident; /* NOT available outside of ircg_pconnect or register_hooks */
- char *password; /* dito */
- char *realname; /* dito */
-} php_irconn_t;
-
-
-#define format_msg php_ircg_format_msg
-
-static void msg_send(php_irconn_t *conn, smart_str *msg);
-
-/* }}} */
-
-/* {{{ Default format messages */
-
-static char *fmt_msgs_default[] = {
- "%f@%6c: %m<br />",
- "%f: %m<br />",
- "To %t: %m<br />",
- "%f leaves %6c<br />",
- "%f joins %6c<br />",
- "%t was kicked by %f from %6c (%m)<br />",
- "%f changes topic on %6c to %m<br />",
- "Error: %m<br />",
- "Fatal Error: %m<br />",
- "",
- "",
- "%f changes nick to %t<br />",
- "%f quits (%m)<br />",
- "Welcome to channel %6c:",
- " %f",
- " are in the channel %6c<br />",
- "%f: user(%t) host(%c) real name(%m)<br />",
- "%f: server(%c) server info(%m)<br />",
- "%f has been idle for %m seconds<br />",
- "%f is on channel %6c<br />",
- "End of whois for %f<br />",
- "%f sets voice flag of %t to %m on %6c<br />",
- "%f sets channel operator flag of %t to %m on %6c<br />",
- "banned from %6c: %m<br />",
- "end of ban list for %6c<br />",
- "You have been disconnected<br />",
- "Channel %6c has %t users and the topic is '%m'<br />",
- "End of LIST<br />",
- "Nickname %t has ident %f, realname '%m', hostname %c, ",
- "is on server %t, has flag %f, hopcount %m, and channel %c.<br />",
- "End of WHO<br />",
- "%f has invited %t to %6c<br />",
- "[notice %6c] %f: %m<br />",
- "notice from %f: %m<br />",
- "notice to %t: %m<br />",
- "%t users, %f services, %r servers<br />",
- "%r operators<br />",
- "%r unknown connections<br />",
- "%r formed channels<br />",
- "I have %t clients and %r servers<br />",
-};
-
-ZEND_DECLARE_MODULE_GLOBALS(ircg);
-
-PHP_INI_BEGIN()
- STD_PHP_INI_ENTRY("ircg.work_dir", "/tmp/ircg", PHP_INI_ALL, OnUpdateString, work_dir, zend_ircg_globals, ircg_globals)
- STD_PHP_INI_ENTRY("ircg.shared_mem_size", "6000000", PHP_INI_ALL, OnUpdateInt, shared_mem_size, zend_ircg_globals, ircg_globals)
- STD_PHP_INI_ENTRY("ircg.keep_alive_interval", "60", PHP_INI_ALL, OnUpdateInt, ka_interval, zend_ircg_globals, ircg_globals)
- STD_PHP_INI_ENTRY("ircg.max_format_message_sets", "12", PHP_INI_ALL, OnUpdateInt, max_fmt_msg_sets, zend_ircg_globals, ircg_globals)
- STD_PHP_INI_ENTRY("ircg.control_user", "nobody", PHP_INI_ALL, OnUpdateString, control_user, zend_ircg_globals, ircg_globals)
-
-PHP_INI_END()
-
-/* }}} */
-
-/* {{{ Format-message accessor macros */
-
-#define format_msg_cache(fmt, cache, chan, to, from, msg, res) \
- format_msg(fmt, chan, to, from, msg, res)
-
-#define MSG(conn, type) \
- (conn->fmt_msgs->fmt_msgs[type])
-
-#define FORMAT_MSG(conn, type, chan, to, from, msg, res, u, ulen) { \
- format_msg(MSG(conn, type), chan, \
- to, from, msg, res, u, ulen, NULL); \
-}
-
-/* }}} */
-
-/* {{{ Helper-functions */
-
-static void fmt_msgs_dtor(void *dummy)
-{
- php_fmt_msgs_t *fmt_msgs = dummy;
- int i;
-
- for (i = 0; i < NO_FMTS; i++) {
- if (fmt_msgs->fmt_msgs[i])
- php_ircg_free_fmt_msg(fmt_msgs->fmt_msgs[i]);
- }
- php_ircg->fmt_sets_destroyed++;
- IRCG_SHARED_FREE(dummy);
-}
-
-static php_irconn_t *lookup_irconn(int id)
-{
-#ifdef USE_IRCONN_MANAGEMENT
- php_irconn_t **ret;
-
- if (ircg_hash_index_find(&h_irconn, id, (void **) &ret) == FAILURE)
- return NULL;
- return *ret;
-#else
- return ircg_resource_get(id);
-#endif
-}
-
-#ifdef USE_IRCONN_MANAGEMENT
-#define put_irconn(a) do {} while(0)
-#else
-static void put_irconn(php_irconn_t *c)
-{
- ircg_resource_put(c->irconn_id);
-}
-#endif
-
-static php_fmt_msgs_t *lookup_fmt_msgs(zval **id, int inc)
-{
- int *i;
- php_fmt_msgs_t *p;
-
- IRCG_LOCK_GET(php_ircg->fmt_msgs_lock);
- if (ircg_hash_find(&php_ircg->h_fmt_msgs, Z_STRVAL_PP(id), Z_STRLEN_PP(id),
- (void **) &i) == FAILURE) {
- IRCG_LOCK_PUT(php_ircg->fmt_msgs_lock);
- return NULL;
- }
- p = php_ircg->fmt_msgs[*i];
-
- assert(p != NULL);
- assert(p->dead == 0);
-
- if (inc) {
- p->rc++;
- }
- IRCG_LOCK_PUT(php_ircg->fmt_msgs_lock);
-
- return p;
-}
-
-static void fmt_msgs_drop_ref(php_fmt_msgs_t *p)
-{
- IRCG_LOCK_GET(php_ircg->fmt_msgs_lock);
-
- assert(p->rc > 0);
- if (--p->rc == 0 && p->dead) {
- fmt_msgs_dtor(p);
- }
-
- IRCG_LOCK_PUT(php_ircg->fmt_msgs_lock);
-}
-
-static void irconn_dtor(void *dummy)
-{
- php_irconn_t **conn = dummy;
-
- irc_disconnect(&(*conn)->conn, "Browser connection closed");
-}
-
-/* }}} */
-
-
-static int is_my_conn(php_irconn_t *conn)
-{
-#if 0
- struct sockaddr_in sin;
- socklen_t len = sizeof(sin);
-
- if (getpeername(conn->fd, &sin, &len)) {
- if (errno == EBADF || errno == ENOTSOCK || errno == ENOTCONN)
- return 0;
- else
- /* closing a connection is better than leaking fds */
- return 1;
- }
-
- if (sin.sin_addr.s_addr == conn->sin.sin_addr.s_addr
- && sin.sin_port == conn->sin.sin_port)
-#endif
- return 1;
- return 0;
-}
-
-/* {{{ quit_handler */
-
-static void quit_handler(irconn_t *c, void *dummy)
-{
- php_irconn_t *conn = dummy;
-
- php_ircg->irc_quit_handlers++;
-
-#ifdef USE_IRCONN_MANAGEMENT
- ircg_hash_index_del(&h_irconn, conn->irconn_id);
-#endif
-
- if (conn->fd > -1) {
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_DISCONNECTED, NULL, NULL, NULL, NULL,
- &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-
-#ifdef USE_FD2IRCONN
- ircg_hash_index_del(&h_fd2irconn, conn->fd);
- if (is_my_conn(conn))
- shutdown(conn->fd, 2);
-#endif
- conn->fd = -1;
- irc_write_buf_del(&conn->wb);
- }
-
- if (conn->fmt_msgs->rc > 0) {
- fmt_msgs_drop_ref(conn->fmt_msgs);
- }
-
- ircg_hash_destroy(&conn->ctcp_msgs);
- smart_str_free(&conn->read_data_req);
- smart_str_free_ex(&conn->buffer, 1);
-
-#ifdef IRCG_PENDING_URL
- if (conn->od_port) {
- irc_add_pending_url(conn->od_ip, conn->od_port, conn->od_data,
- conn->od_len);
- IRCG_SHARED_FREE(conn->od_data);
- }
-#endif
-
- memset(conn, 0xbb, sizeof *conn);
- IRCG_SHARED_FREE(conn);
-}
-/* }}} */
-
-
-
-/* {{{ HTTP-related */
-
-#include "SAPI.h"
-
-#define ADD_HEADER(a) sapi_add_header(a, sizeof(a) - 1, 1)
-
-#ifdef USE_FD2IRCONN
-static void http_closed_connection(int fd)
-{
- int *id, stored_id;
-
- if (ircg_hash_index_find(&h_fd2irconn, fd, (void **) &id) == FAILURE)
- return;
-
- stored_id = *id;
-
- ircg_hash_index_del(&h_fd2irconn, fd);
-#ifdef USE_IRCONN_MANAGEMENT
- ircg_hash_index_del(&h_irconn, stored_id);
-#endif
-}
-#endif
-
-/* }}} */
-
-time_t php_ircg_now(void)
-{
- struct timeval now;
-
-#if IRCG_API_VERSION >= 20010601
- now.tv_sec = ircg_now_time_t;
- if (now.tv_sec == (time_t) 0)
-#endif
- gettimeofday(&now, NULL);
-
- return now.tv_sec;
-}
-
-#define WINDOW_TIMEOUT (3 * 60)
-
-static const char timeout_message[] = "Timed out waiting for streaming window";
-
-/* {{{ Message-delivery */
-static void msg_accum_send(php_irconn_t *conn, smart_str *msg)
-{
- int n;
-
- if (msg->c == 0) return;
-
- switch (conn->fd) {
- case -1: /* No message window yet. Buffer */
- if ((php_ircg_now() - conn->login) > WINDOW_TIMEOUT) {
- irc_disconnect(&conn->conn, timeout_message);
- goto done;
- }
- smart_str_append_ex(&conn->buffer, msg, 1);
- goto done;
- default:
-#if IRCG_API_VERSION - 0 >= 20010601
- if ((n = irc_write_buf_append_ex(&conn->wb, msg, 0))) {
- const char *reason;
-
-#if IRCG_API_VERSION - 0 >= 20020308
- switch (n) {
- case D_OVERFLOW:
- reason = "Client is too slow, client-specific queue full";
- break;
- case D_POLL_ERROR:
- reason = "Poll failed. The connection is bad.";
- break;
- case D_CORRUPT_QUEUE:
- reason = "Internal failure: Corrupt queue";
- break;
- default:
- if (n < 0)
- reason = strerror(-n);
- else
-#else
- {
-#endif
- reason = "Write to HTTP client failed for no reason";
- }
-
- irc_disconnect(&conn->conn, reason);
- }
- return;
-#elif IRCG_API_VERSION - 0 >= 20010302
- irc_write_buf_append_ex(&conn->wb, msg, 0); /* no copy */
- return;
-#else
- irc_write_buf_append(&conn->wb, msg);
-#endif
- break;
- }
-
-
-done:
- smart_str_free_ex(msg, 1);
-}
-
-static void msg_send(php_irconn_t *conn, smart_str *msg)
-{
- msg_accum_send(conn, msg);
- if (conn->fd >= 0)
- irc_write_buf_flush(&conn->wb);
-}
-
-static void msg_replay_buffer(php_irconn_t *conn)
-{
- msg_accum_send(conn, &conn->buffer);
- conn->buffer.c = NULL;
- conn->buffer.len = conn->buffer.a = 0;
-}
-/* }}} */
-
-/* {{{ IRCG-handlers */
-static void handle_ctcp(php_irconn_t *conn, smart_str *chan, smart_str *from,
- smart_str *to, smart_str *msg, smart_str *result)
-{
- char *token;
- char *token_end;
- char *ctcp_arg;
- char *ctcp_arg_end;
- format_msg_t **fmt_msg_p;
- smart_str tmp = {0};
- int status = 0;
-
- token = msg->c + 1;
- token_end = strchr(token, 1);
-
- if (!token_end) return;
-
- *token_end = 0;
-
- ctcp_arg = strchr(token, ' ');
-
- if (ctcp_arg) {
- ctcp_arg_end = token_end;
- token_end = ctcp_arg;
- *token_end = 0;
- ctcp_arg++;
- smart_str_setl(&tmp, ctcp_arg, ctcp_arg_end - ctcp_arg);
- }
-
- if (ircg_hash_find(&conn->ctcp_msgs, token, token_end - token,
- (void **) &fmt_msg_p) != SUCCESS) {
- return;
- }
-
- format_msg(*fmt_msg_p, chan, to, from, &tmp, result,
- conn->conn.username, conn->conn.username_len, &status);
-
- if (status == 1) {
- irc_disconnect(&conn->conn, "Connection terminated by "
- "authenticated CTCP message");
- }
-}
-
-static void msg_handler(irconn_t *ircc, smart_str *chan, smart_str *from,
- smart_str *msg, void *conn_data, void *chan_data)
-{
- php_irconn_t *conn = conn_data;
- smart_str m = {0};
- smart_str s_username;
-
- smart_str_setl(&s_username, ircc->username, ircc->username_len);
-
- if (msg->c[0] == '\001') {
- handle_ctcp(conn, chan, from, chan?chan:&s_username, msg, &m);
- } else if (chan) {
- FORMAT_MSG(conn, FMT_MSG_CHAN, chan, &s_username, from, msg, &m, conn->conn.username, conn->conn.username_len);
- } else {
- FORMAT_MSG(conn, FMT_MSG_PRIV_TO_ME, NULL, &s_username, from,
- msg, &m, conn->conn.username, conn->conn.username_len);
- }
-
- msg_send(conn, &m);
-}
-
-static void notice_handler(irconn_t *ircc, smart_str *chan, smart_str *from,
- smart_str *msg, void *conn_data, void *chan_data)
-{
- php_irconn_t *conn = conn_data;
- smart_str m = {0};
- smart_str s_username;
-
- smart_str_setl(&s_username, ircc->username, ircc->username_len);
-
- if (msg->c[0] == '\001') {
- handle_ctcp(conn, chan, from, chan?chan:&s_username, msg, &m);
- } else if (chan) {
- FORMAT_MSG(conn, FMT_MSG_NOTICE_CHAN, chan, &s_username, from, msg, &m, conn->conn.username, conn->conn.username_len);
- } else {
- FORMAT_MSG(conn, FMT_MSG_NOTICE_TO_ME, NULL, &s_username, from,
- msg, &m, conn->conn.username, conn->conn.username_len);
- }
-
- msg_send(conn, &m);
-}
-
-static void nick_handler(irconn_t *c, smart_str *oldnick, smart_str *newnick,
- void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_NICK, NULL, newnick, oldnick, NULL,
- &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void whois_user_handler(irconn_t *c, smart_str *nick, smart_str *user,
- smart_str *host, smart_str *real_name, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_WHOIS_USER, host, user, nick,
- real_name, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-
-static void whois_server_handler(irconn_t *c, smart_str *nick,
- smart_str *server, smart_str *server_info, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_WHOIS_SERVER, server, NULL, nick,
- server_info, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-
-static void whois_idle_handler(irconn_t *c, smart_str *nick,
- smart_str *idletime, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_WHOIS_IDLE, NULL, NULL, nick,
- idletime, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void end_of_whois_handler(irconn_t *c, smart_str *nick, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_WHOIS_END, NULL, NULL, nick, NULL, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-
-static void whois_channels_handler(irconn_t *c, smart_str *nick,
- smart_str *channels, int nr, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
- int i;
-
- for (i = 0; i < nr; i++) {
- FORMAT_MSG(conn, FMT_MSG_WHOIS_CHANNEL, &channels[i], NULL,
- nick, NULL, &m, conn->conn.username, conn->conn.username_len);
- }
- msg_send(conn, &m);
-}
-
-static void list_handler(irconn_t *c, smart_str *channel, smart_str *visible,
- smart_str *topic, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_LIST, channel, visible, NULL, topic, &m,
- conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void listend_handler(irconn_t *c, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_LISTEND, NULL, NULL, NULL, NULL, &m,
- conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-#if IRCG_API_VERSION >= 20021115
-
-static void whoreply_handler(irconn_t *c, smart_str *chan, smart_str *user,
- smart_str *host, smart_str *server, smart_str *nick, smart_str *flag,
- smart_str *hopcount, smart_str *realname, void *dummy,
- void *chan_data)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_WHOREPLY1, host, nick, user, realname, &m,
- conn->conn.username, conn->conn.username_len);
-
- FORMAT_MSG(conn, FMT_MSG_WHOREPLY2, chan, server, flag, hopcount, &m,
- conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void endofwho_handler(irconn_t *c, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_ENDOFWHO, NULL, NULL, NULL, NULL, &m,
- conn->conn.username, conn->conn.username_len);
-
- msg_send(conn, &m);
-}
-
-#endif
-
-#if IRCG_API_VERSION >= 20021117
-
-static void invite_handler(irconn_t *c, smart_str *nick, smart_str *chan, int mode, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
- smart_str *from, *to, tmp = {0};
-
- smart_str_setl(&tmp, conn->conn.username, conn->conn.username_len);
- if (mode == 1) {
- from = &tmp;
- to = nick;
- } else {
- from = nick;
- to = &tmp;
- }
-
- FORMAT_MSG(conn, FMT_MSG_INVITE, chan, to, from, NULL, &m,
- conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-#endif
-
-static void luserclient_handler(irconn_t *c, smart_str *users, smart_str *services, smart_str *servers, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_LUSERCLIENT, NULL, users, services, servers, &m,
- conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void luserme_handler(irconn_t *c, smart_str *users, smart_str *servers, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_LUSERME, NULL, users, NULL, servers, &m,
- conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void luserop_handler(irconn_t *c, smart_str *str, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_LUSEROP, NULL, NULL, NULL, str, &m,
- conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void luserunknown_handler(irconn_t *c, smart_str *str, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_LUSERUNKNOWN, NULL, NULL, NULL, str, &m,
- conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void luserchannels_handler(irconn_t *c, smart_str *str, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_LUSERCHANNELS, NULL, NULL, NULL, str, &m,
- conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-/* }}} */
-
-static void error_handler(irconn_t *ircc, int id, int fatal, smart_str *msg, void *conn_data)
-{
- php_irconn_t *conn = conn_data;
- smart_str m = {0};
- smart_str s_username;
- smart_str tmp;
- int disconn = 0;
-
- if (conn->bailout_on_trivial) {
- if (id == 474 || id == 475) {
- fatal = disconn = 1;
- }
- }
-
- smart_str_setl(&tmp, "IRC SERVER", sizeof("IRC SERVER") - 1);
- smart_str_setl(&s_username, ircc->username, ircc->username_len);
- FORMAT_MSG(conn, fatal ? FMT_MSG_FATAL_ERROR : FMT_MSG_ERROR, NULL,
- &s_username, &tmp, msg, &m, conn->conn.username, conn->conn.username_len);
-
- if (fatal) {
- php_ircg_add_error_msg(msg, id, conn->irconn_id);
- }
-
- msg_send(conn, &m);
-
- /* Fatal messages from the IRCG layer automatically call irc_disconnect;
- if we simulate a fatal error, we need to do that manually */
- if (disconn)
- irc_disconnect(ircc, "A fatal error occured");
-}
-
-/* {{{ IRCG-handlers */
-static void banlist_handler(irconn_t *ircc, smart_str *channel, smart_str *mask, void *conn_data)
-{
- php_irconn_t *conn = conn_data;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_BANLIST, channel, NULL, NULL, mask, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void end_of_banlist_handler(irconn_t *ircc, smart_str *channel, void *conn_data)
-{
- php_irconn_t *conn = conn_data;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_BANLIST_END, channel, NULL, NULL, NULL, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void user_add_single(php_irconn_t *conn, smart_str *channel, smart_str *users)
-{
- smart_str m = {0};
- FORMAT_MSG(conn, FMT_MSG_JOIN, channel, NULL, &users[0],
- NULL, &m, conn->conn.username, conn->conn.username_len);
- FORMAT_MSG(conn, FMT_MSG_JOIN_LIST_END, channel, NULL, NULL,
- NULL, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void user_add_multiple(php_irconn_t *conn, smart_str *channel, smart_str *users, int nr)
-{
- int i;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_MASS_JOIN_BEGIN, channel, NULL, NULL,
- NULL, &m, conn->conn.username, conn->conn.username_len);
- for (i = 0; i < nr; i++) {
- FORMAT_MSG(conn, FMT_MSG_MASS_JOIN_ELEMENT, channel, NULL,
- &users[i], NULL, &m, conn->conn.username, conn->conn.username_len);
- }
-
- FORMAT_MSG(conn, FMT_MSG_MASS_JOIN_END, channel, NULL, NULL,
- NULL, &m, conn->conn.username, conn->conn.username_len);
-
-
- msg_send(conn, &m);
-}
-
-#if IRCG_API_VERSION >= 20021109
-
-static void user_add_ex(irconn_t *ircc, smart_str *channel, smart_str *users,
- int nr, int namelist, void *dummy)
-{
- if (namelist) {
- user_add_multiple(dummy, channel, users, nr);
- } else {
- user_add_single(dummy, channel, users);
- }
-}
-
-#else
-
-static void user_add(irconn_t *ircc, smart_str *channel, smart_str *users,
- int nr, void *dummy)
-{
- if (nr > 1) {
- user_add_multiple(dummy, channel, users, nr);
- } else {
- user_add_single(dummy, channel, users);
- }
-}
-
-#endif
-
-static void new_topic(irconn_t *ircc, smart_str *channel, smart_str *who, smart_str *topic, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_TOPIC, channel, NULL, who, topic, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void part_handler(irconn_t *ircc, smart_str *channel, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
- smart_str s_username;
-
- smart_str_setl(&s_username, ircc->username, ircc->username_len);
-
- FORMAT_MSG(conn, FMT_MSG_SELF_PART, channel, NULL, &s_username,
- NULL, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void user_leave(irconn_t *ircc, smart_str *channel, smart_str *user, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_LEAVE, channel, NULL, user, NULL, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void user_quit(irconn_t *ircc, smart_str *user, smart_str *msg, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- FORMAT_MSG(conn, FMT_MSG_QUIT, NULL, NULL, user, msg, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-static void idle_recv_queue(irconn_t *ircc, void *dummy)
-{
- php_irconn_t *conn = dummy;
-
-
- if (conn->fd >= 0) {
- smart_str tmp = {0};
-
- smart_str_setl(&tmp, " \n" , 2);
- irc_write_buf_append_ex(&conn->wb, &tmp, 1);
- irc_write_buf_flush(&conn->wb);
- } else if ((php_ircg_now() - conn->login) > WINDOW_TIMEOUT) {
- char buf[1024];
-
- sprintf(buf, "timeout after %ld seconds (%ld, %ld)",
- php_ircg_now()-conn->login,
- php_ircg_now(), conn->login);
- irc_disconnect(ircc, buf);
- }
-}
-
-static void user_kick(irconn_t *ircc, smart_str *channel, smart_str *who, smart_str *kicked_by, smart_str *reason, void *dummy)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
-
- if (conn->bailout_on_trivial && who->len == ircc->username_len && memcmp(who->c, ircc->username, who->len) == 0) {
- irc_disconnect(ircc, "Bailout on trivial: KICK");
- }
- FORMAT_MSG(conn, FMT_MSG_KICK, channel, who, kicked_by, reason, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
-}
-
-#if IRCG_API_VERSION >= 20010307
-static void mode_channel_handler(irconn_t *ircc, smart_str *nick,
- smart_str *channel, smart_str *who, int mode, int give, void *dummy,
- void *dummy2)
-{
- php_irconn_t *conn = dummy;
- smart_str m = {0};
- smart_str what;
-
- if (give)
- smart_str_setl(&what, "1", 1);
- else
- smart_str_setl(&what, "0", 1);
-
- if (mode & IRCG_MODE_VOICE) {
- FORMAT_MSG(conn, FMT_MSG_MODE_VOICE, channel, nick, who, &what,
- &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
- }
- if (mode & IRCG_MODE_OP) {
- FORMAT_MSG(conn, FMT_MSG_MODE_OP, channel, nick, who, &what, &m, conn->conn.username, conn->conn.username_len);
- msg_send(conn, &m);
- }
-}
-#endif
-/* }}} */
-
-/* {{{ proto bool ircg_set_on_read_data(int connection, string host, int port, string data)
- Set action to be executed when data is received from a HTTP client */
-PHP_FUNCTION(ircg_set_on_read_data)
-{
- zval **p1, **p2, **p3, **p4;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &p1, &p2, &p3, &p4) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- convert_to_string_ex(p2);
- convert_to_long_ex(p3);
- convert_to_string_ex(p4);
-
- if (inet_aton(Z_STRVAL_PP(p2), &conn->read_data_ip) != 0) {
- conn->read_data_port = Z_LVAL_PP(p3);
-
- smart_str_appendl(&conn->read_data_req, Z_STRVAL_PP(p4), Z_STRLEN_PP(p4));
- RETVAL_TRUE;
- } else {
- RETVAL_FALSE;
- }
-
- put_irconn(conn);
-}
-/* }}} */
-
-/* {{{ proto bool ircg_set_on_die(int connection, string host, int port, string data)
- Sets hostaction to be executed when connection dies */
-#ifdef IRCG_PENDING_URL
-PHP_FUNCTION(ircg_set_on_die)
-{
- zval **p1, **p2, **p3, **p4;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &p1, &p2, &p3, &p4) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- convert_to_string_ex(p2);
- convert_to_long_ex(p3);
- convert_to_string_ex(p4);
-
- if (inet_aton(Z_STRVAL_PP(p2), &conn->od_ip) != 0) {
- conn->od_port = Z_LVAL_PP(p3);
- conn->od_data = IRCG_SHARED_ALLOC(Z_STRLEN_PP(p4));
- memcpy(conn->od_data, Z_STRVAL_PP(p4), Z_STRLEN_PP(p4));
- conn->od_len = Z_STRLEN_PP(p4);
- RETVAL_TRUE;
- } else {
- RETVAL_FALSE;
- }
-
- put_irconn(conn);
-}
-#endif
-/* }}} */
-
-/* {{{ proto string ircg_get_username(int connection)
- Gets username for connection */
-PHP_FUNCTION(ircg_get_username)
-{
- zval **p1;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &p1) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- RETVAL_STRINGL((char *) conn->conn.username, conn->conn.username_len, 1);
-
- put_irconn(conn);
-}
-/* }}} */
-
-static void wbuf_hooks(irc_write_buf *p, void *data);
-
-/* {{{ proto bool ircg_set_file(int connection, string path)
- Sets logfile for connection */
-PHP_FUNCTION(ircg_set_file)
-{
- zval **p1, **p2;
- php_irconn_t *conn;
- int do_put = 1;
-
- if (IRCGG(flush_data)) {
- php_error(E_WARNING, "ircg_set_file/_current must not be called multiple times during one request");
- RETURN_FALSE;
- }
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &p1, &p2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- RETVAL_FALSE;
-
- if (!conn) return;
-
- if (conn->fd != -1) {
- php_error(E_WARNING, "ircg_set_file cannot be used together with "
- "ircg_set_current.");
- goto out;
- }
-
- conn->fd = open(Z_STRVAL_PP(p2), O_WRONLY|O_CREAT|O_TRUNC|O_APPEND, 0644);
- if (conn->fd == -1) {
- goto out;
- }
- SEEN_FD(conn->fd);
-
- if (fcntl(conn->fd, F_SETFD, 1)) {
- close(conn->fd);
- conn->fd = -1;
- goto out;
- }
-
- if (irc_write_buf_add_ex(&conn->wb, conn->fd, wbuf_hooks, conn) == 0) {
- ircg_resource_get(conn->irconn_id);
-
- IRCGG(flush_data) = conn;
- do_put = 0;
-
- RETVAL_TRUE;
- } else {
- close(conn->fd);
- conn->fd = -1;
- }
-
-out:
-
- if (do_put)
- put_irconn(conn);
-}
-/* }}} */
-
-static void wbuf_closed_conn(irc_write_buf *p, void *data)
-{
- php_ircg->irc_wbuf_destructs++;
- irc_disconnect(data, "Client connection terminated");
-}
-
-static void wbuf_add_complete(irc_write_buf *p, void *data)
-{
- put_irconn(data);
-}
-
-#include "ext/standard/url.h"
-
-static void wbuf_read_data(irc_write_buf *p, void *data, smart_str *s)
-{
- php_irconn_t *conn = (php_irconn_t *) data;
- smart_str enc = {0};
- smart_str req = {0};
-
- enc.c = php_url_encode(s->c, s->len, &enc.len);
-
- smart_str_append(&req, &conn->read_data_req);
- smart_str_appends(&req, "Connection: close\r\n"
- "Content-Type: "
- "application/x-www-form-urlencoded\r\n"
- "Content-Length: ");
- smart_str_append_long(&req, enc.len + 5);
- smart_str_appends(&req, "\r\n\r\ndata=");
- smart_str_append(&req, &enc);
-
- efree(enc.c);
-
- irc_add_pending_url(conn->read_data_ip, conn->read_data_port,
- req.c, req.len);
-
- smart_str_free(&req);
-}
-
-IRCG_CB_MAP_START(php_ircg_cb_wbuf)
- IRCG_CB_MAP_ENTRY(wbuf_closed_conn)
- IRCG_CB_MAP_ENTRY(wbuf_add_complete)
- IRCG_CB_MAP_ENTRY(wbuf_read_data)
-IRCG_CB_MAP_END()
-
-static void wbuf_hooks(irc_write_buf *p, void *data)
-{
- php_irconn_t *conn = (php_irconn_t *) data;
-
- irc_write_buf_reg(p, WB_MAP_HANDLE, (irc_hook) php_ircg_cb_wbuf_handle);
- irc_write_buf_reg(p, WB_CLOSED_CONN, wbuf_closed_conn);
- irc_write_buf_reg(p, WB_ADD_COMPLETE, wbuf_add_complete);
-
- if (conn->read_data_port)
- irc_write_buf_reg(p, WB_READ_DATA, wbuf_read_data);
-}
-
-#ifndef USE_FD2IRCONN
-#define php_ircg_register_closed_connection(a) (0)
-#endif
-
-/* {{{ proto bool ircg_set_current(int connection)
- Sets current connection for output */
-PHP_FUNCTION(ircg_set_current)
-{
- zval **p1;
- php_irconn_t *conn;
- int do_put = 1;
- int n;
-
- if (IRCGG(flush_data)) {
- php_error(E_WARNING, "ircg_set_file/_current must not be called multiple times during one request");
- RETURN_FALSE;
- }
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &p1) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
-
- RETVAL_FALSE;
-
- if (SG(headers_sent)) {
- char *output_start_filename = php_get_output_start_filename(TSRMLS_C);
- int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
-
- if (output_start_filename) {
- php_error(E_WARNING, "Please ensure that ircg_set_current is "
- "called before your script generates any output. "
- "(output started at %s:%d)",
- output_start_filename, output_start_lineno);
- } else {
- php_error(E_WARNING, "Please ensure that ircg_set_current is "
- "called before your script generates any output");
- }
- return;
- }
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) return;
-
- if (conn->fd >= 0) {
-#if WRITE_BUF_SUPPORTS_ASYNC_OPERATION_LIKE_WE_WOULD_NEED_IT
-#ifdef USE_FD2IRCONN
- /* There is a HTTP connection alive, kill it */
- ircg_hash_index_del(&h_fd2irconn, conn->fd);
-#endif
- irc_write_buf_del(&conn->wb);
- conn->fd = -1;
-#else
- php_error(E_WARNING, "You called ircg_set_current/_file for this connection before. This is not supported at this time. Ignoring this call.");
- goto out;
-#endif
- }
-
- if (php_ircg_register_with_sapi(&conn->fd TSRMLS_CC)
- || php_ircg_register_closed_connection(http_closed_connection)
- || fcntl(conn->fd, F_GETFL) == -1) {
-#ifdef USE_IRCONN_MANAGEMENT
- ircg_hash_index_del(&h_irconn, Z_LVAL_PP(p1));
-#endif
- php_error(E_WARNING, "Failed to obtain the socket of the current "
- "HTTP connection");
- goto out;
- }
-
- if (conn->fd == -1)
- goto out;
-
- SEEN_FD(conn->fd);
-
-#ifdef USE_FD2IRCONN
- ircg_hash_index_update(&h_fd2irconn, conn->fd, &Z_LVAL_PP(p1),
- sizeof(int), NULL);
-#endif
-
-#if IRCG_API_VERSION < 20021127
-#define ircg_resource_get(a) do {} while (0)
- irc_write_buf_add(&conn->wb, conn->fd);
- n = 0;
-#else
- n = irc_write_buf_add_ex(&conn->wb, conn->fd, wbuf_hooks, conn);
-#endif
-
- if (n == 0) {
- ircg_resource_get(conn->irconn_id);
- php_ircg->irc_set_currents++;
- IRCGG(flush_data) = conn;
-
- if (php_ircg->is_fastcgi)
- irc_write_buf_reg(&conn->wb, WB_FILTER_FUNC, irc_write_buf_filter_fastcgi);
-
- /* We maintain a reference to conn until rshutdown */
- do_put = 0;
- RETVAL_TRUE;
- } else {
- php_ircg->failed_set_currents++;
- conn->fd = -1;
- }
-
-out:
- if (do_put)
- put_irconn(conn);
-}
-/* }}} */
-
-/* {{{ proto string ircg_nickname_escape(string nick)
- Escapes special characters in nickname to be IRC-compliant */
-PHP_FUNCTION(ircg_nickname_escape)
-{
- zval **p1;
- smart_str in;
- smart_str out = {0};
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &p1) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_string_ex(p1);
-
- smart_str_setl(&in, Z_STRVAL_PP(p1), Z_STRLEN_PP(p1));
-
- php_ircg_nickname_escape(&in, &out);
- smart_str_0(&out);
-
- RETVAL_STRINGL(out.c, out.len, 1);
-
- smart_str_free_ex(&out, 1);
-}
-/* }}} */
-
-/* {{{ proto string ircg_nickname_unescape(string nick)
- Decodes encoded nickname */
-PHP_FUNCTION(ircg_nickname_unescape)
-{
- zval **p1;
- smart_str in;
- smart_str out = {0};
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &p1) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_string_ex(p1);
-
- smart_str_setl(&in, Z_STRVAL_PP(p1), Z_STRLEN_PP(p1));
-
- php_ircg_nickname_unescape(&in, &out);
- smart_str_0(&out);
-
- RETVAL_STRINGL(out.c, out.len, 1);
-
- smart_str_free_ex(&out, 1);
-}
-/* }}} */
-
-/* {{{ proto bool ircg_join(int connection, string channel [, string chan-key])
- Joins a channel on a connected server */
-PHP_FUNCTION(ircg_join)
-{
- zval **p1, **p2, **p3;
- php_irconn_t *conn;
- char *key = NULL;
-
- if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3
- || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
-
- if (ZEND_NUM_ARGS() > 2) {
- convert_to_string_ex(p3);
- key = Z_STRVAL_PP(p3);
- }
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_join(&conn->conn, Z_STRVAL_PP(p2), key, conn);
-
- put_irconn(conn);
-
- RETVAL_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ircg_oper(int connection, string name, string password)
- Elevates privileges to IRC OPER */
-PHP_FUNCTION(ircg_oper)
-{
- zval **p1, **p2, **p3;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 3
- || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
- convert_to_string_ex(p3);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "OPER", 2, Z_STRVAL_PP(p2), Z_STRVAL_PP(p3));
- put_irconn(conn);
- RETVAL_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ircg_whois( int connection, string nick)
- Queries user information for nick on server */
-#if IRCG_API_VERSION - 0 >= 20010227
-PHP_FUNCTION(ircg_whois)
-{
- zval **p1, **p2;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &p1, &p2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "WHOIS", 1, Z_STRVAL_PP(p2));
-
- put_irconn(conn);
- RETVAL_TRUE;
-}
-#endif
-/* }}} */
-
-/* {{{ proto bool ircg_ignore_add(resource connection, string nick)
- Adds a user to your ignore list on a server */
-#if IRCG_API_VERSION - 0 >= 20010402
-PHP_FUNCTION(ircg_ignore_add)
-{
- zval **args[2];
- php_irconn_t *conn;
- smart_str s;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(args[0]);
- convert_to_string_ex(args[1]);
-
- conn = lookup_irconn(Z_LVAL_PP(args[0]));
- if (!conn) RETURN_FALSE;
-
- smart_str_setl(&s, Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
- if (irc_ignore_check(&conn->conn, &s) == 0)
- irc_ignore_add(&conn->conn, &s, 1);
-
- put_irconn(conn);
-}
-#endif
-/* }}} */
-
-/* {{{ proto array ircg_fetch_error_msg(int connection)
- Returns the error from previous ircg operation */
-PHP_FUNCTION(ircg_fetch_error_msg)
-{
- zval **args[2];
- struct errormsg *m;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(args[0]);
-
- m = php_ircg_lookup_and_remove_error_msg(Z_LVAL_PP(args[0]));
-
- if (!m) RETURN_FALSE;
-
- array_init(return_value);
- add_index_long(return_value, 0, m->msgid);
- add_index_stringl(return_value, 1, m->msg.c, m->msg.len, 1);
- php_ircg_error_msg_dtor(m);
-}
-/* }}} */
-
-/* {{{ proto bool ircg_ignore_del(int connection, string nick)
- Removes a user from your ignore list */
-#if IRCG_API_VERSION - 0 >= 20010402
-PHP_FUNCTION(ircg_ignore_del)
-{
- zval **args[2];
- php_irconn_t *conn;
- smart_str s;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(args[0]);
- convert_to_string_ex(args[1]);
-
- conn = lookup_irconn(Z_LVAL_PP(args[0]));
- if (!conn) RETURN_FALSE;
-
- smart_str_setl(&s, Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
- if (irc_ignore_del(&conn->conn, &s)) {
- RETVAL_FALSE;
- } else {
- RETVAL_TRUE;
- }
- put_irconn(conn);
-}
-#endif
-/* }}} */
-
-/* {{{ proto bool ircg_channel_mode(int connection, string channel, string mode_spec, string nick)
- Sets channel mode flags for user */
-#if IRCG_API_VERSION - 0 >= 20010227
-PHP_FUNCTION(ircg_channel_mode)
-{
- zval **args[4];
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(args[0]);
- convert_to_string_ex(args[1]);
- convert_to_string_ex(args[2]);
- convert_to_string_ex(args[3]);
-
- conn = lookup_irconn(Z_LVAL_PP(args[0]));
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "MODE", Z_STRLEN_PP(args[3]) > 0 ? 3 : 2,
- Z_STRVAL_PP(args[1]),
- Z_STRVAL_PP(args[2]), Z_STRVAL_PP(args[3]));
- put_irconn(conn);
- RETVAL_TRUE;
-}
-#endif
-/* }}} */
-
-/* {{{ proto bool ircg_topic(int connection, string channel, string topic)
- Sets topic for channel */
-#if IRCG_API_VERSION - 0 >= 20010226
-PHP_FUNCTION(ircg_topic)
-{
- zval **p1, **p2, **p3;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &p1, &p2, &p3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
- convert_to_string_ex(p3);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "TOPIC", 2, Z_STRVAL_PP(p2), Z_STRVAL_PP(p3));
- put_irconn(conn);
- RETVAL_TRUE;
-}
-#endif
-/* }}} */
-
-/* {{{ proto string ircg_html_encode(string html_text)
- Encodes HTML preserving output */
-PHP_FUNCTION(ircg_html_encode)
-{
- zval **p1, **p2, **p3;
- smart_str res = {0};
- int auto_links = 1;
- int conv_br = 0;
-
- if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 3
- || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- switch (ZEND_NUM_ARGS()) {
- case 3:
- convert_to_boolean_ex(p3);
- conv_br = Z_LVAL_PP(p3);
- case 2:
- convert_to_boolean_ex(p2);
- auto_links = Z_LVAL_PP(p2);
- case 1:
- convert_to_string_ex(p1);
- }
-
- ircg_mirc_color(Z_STRVAL_PP(p1), &res, Z_STRLEN_PP(p1), auto_links, conv_br);
-
- RETVAL_STRINGL(res.c, res.len, 1);
-
- smart_str_free_ex(&res, 1);
-}
-/* }}} */
-
-/* {{{ proto bool ircg_who(int connection, string mask [, bool ops_only])
- Queries server for WHO information */
-#if IRCG_API_VERSION >= 20021115
-PHP_FUNCTION(ircg_who)
-{
- int ops = 0;
- zval **p1, **p2, **p3;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3
- || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
-
- if (ZEND_NUM_ARGS() > 2) {
- convert_to_boolean_ex(p3);
- ops = Z_BVAL_PP(p3);
- }
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "WHO", ops ? 2 : 1, Z_STRVAL_PP(p2), "o");
-
- put_irconn(conn);
-
- RETVAL_TRUE;
-}
-#endif
-/* }}} */
-
-/* {{{ proto bool ircg_invite(int connection, string channel, string nickname)
- INVITEs nickname to channel */
-#if IRCG_API_VERSION >= 20021117
-PHP_FUNCTION(ircg_invite)
-{
- zval **p1, **p2, **p3;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 3
- || zend_get_parameters_ex(3, &p1, &p2, &p3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
- convert_to_string_ex(p3);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "INVITE", 2, Z_STRVAL_PP(p3),
- Z_STRVAL_PP(p2));
- put_irconn(conn);
-
- RETVAL_TRUE;
-}
-#endif
-/* }}} */
-
-/* {{{ proto bool ircg_names( int connection, string channel [, string target])
- Queries visible usernames */
-PHP_FUNCTION(ircg_names)
-{
- zval **p1, **p2, **p3;
- php_irconn_t *conn;
- int ac = ZEND_NUM_ARGS();
-
- if (ac < 2 || ac > 3 || zend_get_parameters_ex(ac, &p1, &p2, &p3) == FAILURE)
-
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
-
- if (ac > 2) {
- convert_to_string_ex(p3);
- }
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "NAMES", ac > 2 ? 2 : 1, Z_STRVAL_PP(p2), ac > 2 ? Z_STRVAL_PP(p3) : NULL);
- put_irconn(conn);
- RETVAL_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ircg_kick(int connection, string channel, string nick, string reason)
- Kicks user from channel */
-#if IRCG_API_VERSION - 0 >= 20010226
-PHP_FUNCTION(ircg_kick)
-{
- zval **p1, **p2, **p3, **p4;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &p1, &p2, &p3, &p4) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
- convert_to_string_ex(p3);
- convert_to_string_ex(p4);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "KICK", 3, Z_STRVAL_PP(p2), Z_STRVAL_PP(p3), Z_STRVAL_PP(p4));
- put_irconn(conn);
- RETVAL_TRUE;
-}
-#endif
-/* }}} */
-
-/* {{{ proto bool ircg_lusers(int connection)
- IRC network statistics */
-PHP_FUNCTION(ircg_lusers)
-{
- zval **p1;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &p1) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "LUSERS", 0);
- put_irconn(conn);
- RETVAL_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ircg_part(int connection, string channel)
- Leaves a channel */
-PHP_FUNCTION(ircg_part)
-{
- zval **p1, **p2;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &p1, &p2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
- convert_to_string_ex(p2);
-
- conn = lookup_irconn(Z_LVAL_PP(p1));
-
- if (!conn) RETURN_FALSE;
-
- irc_part(&conn->conn, Z_STRVAL_PP(p2));
- put_irconn(conn);
- RETVAL_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ircg_is_conn_alive(int connection)
- Checks connection status */
-PHP_FUNCTION(ircg_is_conn_alive)
-{
- zval **p1;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 1
- || zend_get_parameters_ex(1, &p1) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(p1);
-
- if (!(conn = lookup_irconn(Z_LVAL_PP(p1))))
- RETURN_FALSE;
- put_irconn(conn);
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ircg_lookup_format_messages(string name)
- Selects a set of format strings for display of IRC messages */
-PHP_FUNCTION(ircg_lookup_format_messages)
-{
- zval **p1;
-
- if (ZEND_NUM_ARGS() != 1
- || zend_get_parameters_ex(1, &p1) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_string_ex(p1);
-
- if (lookup_fmt_msgs(p1, 0))
- RETURN_TRUE;
- RETVAL_FALSE;
-}
-/* }}} */
-
-static int delete_idx(void *dest, void *arg)
-{
- int *idx = dest;
-
- if (*idx == (int) arg) {
- php_ircg->fmt_sets_evicted++;
- return 1;
- }
- return 0;
-}
-
-/* {{{ proto bool ircg_register_format_messages(string name, array messages)
- Registers a set of format strings for display of IRC messages */
-PHP_FUNCTION(ircg_register_format_messages)
-{
- zval **p1, **p2;
- HashTable *h;
- int i;
- int *ip;
- php_fmt_msgs_t *fmt_msgs;
- zval **arg;
- php_fmt_msgs_t *old = NULL;
- int ret = SUCCESS;
-
- if (ZEND_NUM_ARGS() != 2
- || zend_get_parameters_ex(2, &p1, &p2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_string_ex(p1);
-
- if (Z_TYPE_PP(p2) != IS_ARRAY) {
- php_error(E_WARNING, "The second parameter should be an array");
- RETURN_FALSE;
- }
-
- h = HASH_OF(*p2);
-
- fmt_msgs = IRCG_SHARED_ALLOC(sizeof *fmt_msgs);
- php_ircg->fmt_sets_created++;
- fmt_msgs->rc = 0;
- fmt_msgs->dead = 0;
-
- for (i = 0; i < NO_FMTS; i++) {
- fmt_msgs->fmt_msgs[i] = 0;
- if (zend_hash_index_find(h, i, (void **) &arg) == SUCCESS) {
- convert_to_string_ex(arg);
- php_ircg_token_compiler(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &fmt_msgs->fmt_msgs[i]);
- } else
- php_ircg_token_compiler("", 0, &fmt_msgs->fmt_msgs[i]);
- }
-
- IRCG_LOCK_GET(php_ircg->fmt_msgs_lock);
-
- if (ircg_hash_find(&php_ircg->h_fmt_msgs, Z_STRVAL_PP(p1), Z_STRLEN_PP(p1),
- (void **) &ip) == SUCCESS) {
- i = *ip;
- old = php_ircg->fmt_msgs[i];
- php_ircg->fmt_msgs[i] = fmt_msgs;
- php_ircg->fmt_sets_updates++;
- } else {
- int lim = IRCGG(max_fmt_msg_sets);
-
- for (i = 0; i < lim; i++) {
- if (php_ircg->fmt_msgs[i] == 0
- || php_ircg->fmt_msgs[i]->rc == 0) {
- old = php_ircg->fmt_msgs[i];
- php_ircg->fmt_msgs[i] = fmt_msgs;
- break;
- }
- }
-
- if (old) {
- ircg_hash_apply_with_argument(&php_ircg->h_fmt_msgs,
- delete_idx, (void *) i);
- } else {
- php_ircg->fmt_sets_exist++;
- }
- if (i != lim) {
- ircg_hash_update(&php_ircg->h_fmt_msgs, Z_STRVAL_PP(p1),
- Z_STRLEN_PP(p1), &i, sizeof(i), NULL);
- } else {
- /* no available slot */
- php_ircg->fmt_sets_ignored++;
- fmt_msgs_dtor(fmt_msgs);
- ret = FAILURE;
- }
- }
-
- if (old) {
- if (old->rc) {
- old->dead = 1;
- } else {
- fmt_msgs_dtor(old);
- }
- }
-
- IRCG_LOCK_PUT(php_ircg->fmt_msgs_lock);
-
- if (ret == FAILURE)
- RETURN_FALSE;
- RETURN_TRUE;
-}
-/* }}} */
-
-IRCG_CB_MAP_START(php_ircg_cb_msg)
- IRCG_CB_MAP_ENTRY(msg_handler)
- IRCG_CB_MAP_ENTRY(quit_handler)
- IRCG_CB_MAP_ENTRY(error_handler)
- IRCG_CB_MAP_ENTRY(nick_handler)
- IRCG_CB_MAP_ENTRY(part_handler)
- IRCG_CB_MAP_ENTRY(user_leave)
- IRCG_CB_MAP_ENTRY(user_kick)
- IRCG_CB_MAP_ENTRY(user_quit)
- IRCG_CB_MAP_ENTRY(new_topic)
- IRCG_CB_MAP_ENTRY(whois_user_handler)
- IRCG_CB_MAP_ENTRY(whois_server_handler)
- IRCG_CB_MAP_ENTRY(whois_idle_handler)
- IRCG_CB_MAP_ENTRY(whois_channels_handler)
- IRCG_CB_MAP_ENTRY(end_of_whois_handler)
- IRCG_CB_MAP_ENTRY(mode_channel_handler)
- IRCG_CB_MAP_ENTRY(idle_recv_queue)
- IRCG_CB_MAP_ENTRY(banlist_handler)
- IRCG_CB_MAP_ENTRY(end_of_banlist_handler)
- IRCG_CB_MAP_ENTRY(list_handler)
- IRCG_CB_MAP_ENTRY(listend_handler)
-#if IRCG_API_VERSION >= 20021109
- IRCG_CB_MAP_ENTRY(user_add_ex)
-#else
- IRCG_CB_MAP_ENTRY(user_add)
-#endif
- IRCG_CB_MAP_ENTRY(whoreply_handler)
- IRCG_CB_MAP_ENTRY(endofwho_handler)
- IRCG_CB_MAP_ENTRY(invite_handler)
- IRCG_CB_MAP_ENTRY(notice_handler)
- IRCG_CB_MAP_ENTRY(luserclient_handler)
- IRCG_CB_MAP_ENTRY(luserme_handler)
- IRCG_CB_MAP_ENTRY(luserop_handler)
- IRCG_CB_MAP_ENTRY(luserunknown_handler)
- IRCG_CB_MAP_ENTRY(luserchannels_handler)
-IRCG_CB_MAP_END()
-
-/* {{{ register_hooks */
-static void register_hooks(irconn_t *conn, void *dummy)
-{
- php_irconn_t *irconn = dummy;
-
- if (irconn->ident) {
- smart_str m;
-
- smart_str_sets(&m, irconn->ident);
- irc_set_ident(conn, &m);
- }
-
- if (irconn->password) {
- smart_str m;
-
- smart_str_sets(&m, irconn->password);
- irc_set_password(conn, &m);
- }
-
-#if IRCG_API_VERSION - 0 >= 20010225
- if (irconn->realname) {
- smart_str m;
- smart_str_sets(&m, irconn->realname);
- irc_set_realname(conn, &m);
- }
-#endif
-
-#define MSG_NOT_EMPTY(n) (MSG(irconn,n) && MSG(irconn,n)->ntoken != 0)
-
-#define IFMSG(n, p, q) if (MSG_NOT_EMPTY(n)) irc_register_hook(conn, p, q)
-
- irc_register_hook(conn, IRCG_MSG, msg_handler);
- irc_register_hook(conn, IRCG_QUIT, quit_handler);
- irc_register_hook(conn, IRCG_ERROR, error_handler);
- IFMSG(FMT_MSG_NICK, IRCG_NICK, nick_handler);
-
- IFMSG(FMT_MSG_SELF_PART, IRCG_PART, part_handler);
- IFMSG(FMT_MSG_LEAVE, IRCG_USER_LEAVE, user_leave);
- IFMSG(FMT_MSG_KICK, IRCG_USER_KICK, user_kick);
- IFMSG(FMT_MSG_QUIT, IRCG_USER_QUIT, user_quit);
- IFMSG(FMT_MSG_TOPIC, IRCG_TOPIC, new_topic);
-
-#if IRCG_API_VERSION - 0 >= 20010227
- irc_register_hook(conn, IRCG_WHOISUSER, whois_user_handler);
- irc_register_hook(conn, IRCG_WHOISSERVER, whois_server_handler);
- irc_register_hook(conn, IRCG_WHOISIDLE, whois_idle_handler);
- irc_register_hook(conn, IRCG_WHOISCHANNELS, whois_channels_handler);
- irc_register_hook(conn, IRCG_ENDOFWHOIS, end_of_whois_handler);
-#endif
-
-#if IRCG_API_VERSION >= 20010307
- irc_register_hook(conn, IRCG_MODE_CHANNEL, mode_channel_handler);
-#endif
-
-#if IRCG_API_VERSION >= 20010310
- irc_register_hook(conn, IRCG_IDLE_RECV_QUEUE, idle_recv_queue);
-#endif
-
-#if IRCG_API_VERSION >= 20010416
- irc_register_hook(conn, IRCG_BANLIST, banlist_handler);
- irc_register_hook(conn, IRCG_ENDOFBANLIST, end_of_banlist_handler);
-#endif
-
-#if IRCG_API_VERSION >= 20020922
- /* RPL_LIST/RPL_LISTEND */
- irc_register_hook(conn, IRCG_LIST, list_handler);
- irc_register_hook(conn, IRCG_LISTEND, listend_handler);
-#endif
-
-#if IRCG_API_VERSION >= 20021109
- IFMSG(FMT_MSG_MASS_JOIN_ELEMENT, IRCG_USER_ADD_EX, user_add_ex);
-#else
- IFMSG(FMT_MSG_MASS_JOIN_ELEMENT, IRCG_USER_ADD, user_add);
-#endif
-
-#if IRCG_API_VERSION >= 20021115
- if (MSG_NOT_EMPTY(FMT_MSG_WHOREPLY1)
- || MSG_NOT_EMPTY(FMT_MSG_WHOREPLY2)) {
- irc_register_hook(conn, IRCG_WHOREPLY, whoreply_handler);
- }
- IFMSG(FMT_MSG_ENDOFWHO, IRCG_ENDOFWHO, endofwho_handler);
-#endif
-
-#if IRCG_API_VERSION >= 20021117
- IFMSG(FMT_MSG_INVITE, IRCG_INVITE, invite_handler);
-#endif
-
- irc_register_hook(conn, IRCG_NOTICE, notice_handler);
-
- IFMSG(FMT_MSG_LUSERCLIENT, IRCG_LUSERCLIENT, luserclient_handler);
- IFMSG(FMT_MSG_LUSERME, IRCG_LUSERME, luserme_handler);
- IFMSG(FMT_MSG_LUSEROP, IRCG_LUSEROP, luserop_handler);
- IFMSG(FMT_MSG_LUSERUNKNOWN, IRCG_LUSERUNKNOWN, luserunknown_handler);
- IFMSG(FMT_MSG_LUSERCHANNELS, IRCG_LUSERCHANNELS, luserchannels_handler);
-
- irc_set_map_handle(conn, php_ircg_cb_msg_handle);
-}
-/* }}} */
-
-static void ctcp_msgs_dtor(format_msg_t **fmt)
-{
- php_ircg_free_fmt_msg(*fmt);
-}
-
-/* {{{ ircg_copy_ctcp_msgs */
-static int ircg_copy_ctcp_msgs(zval **array, php_irconn_t *conn)
-{
- zval **val;
- char *str;
- ulong num;
- uint str_len;
- HashPosition pos;
- format_msg_t *fmt;
-
- zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(array), &pos);
-
- while (zend_hash_get_current_key_ex(Z_ARRVAL_PP(array), &str, &str_len, &num, 0, &pos) == HASH_KEY_IS_STRING) {
- zend_hash_get_current_data_ex(Z_ARRVAL_PP(array), (void **) &val, &pos);
- convert_to_string_ex(val);
- fmt = 0;
- php_ircg_token_compiler(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &fmt);
- ircg_hash_add(&conn->ctcp_msgs, str, str_len - 1, &fmt,
- sizeof(fmt), NULL);
-
- zend_hash_move_forward_ex(Z_ARRVAL_PP(array), &pos);
- }
-
- return 0;
-}
-/* }}} */
-
-/* {{{ proto int ircg_pconnect(string username [, string server [, int port [, string format-msg-set-name [, array ctcp-set [, array user-details [, bool bailout-on-trivial]]]]]])
- Create a persistent IRC connection */
-PHP_FUNCTION(ircg_pconnect)
-{
- int drop_ref = 0;
- /* This should become an array very soon */
- zval **p1, **p2, **p3, **p4 = NULL, **p5 = NULL, **p6, **p7;
- const char *username = 0;
- const char *server = "0";
- int port = 6667;
- php_fmt_msgs_t *fmt_msgs = NULL;
- php_irconn_t *conn;
- int bailout_on_trivial = 1;
- int concurrency;
-
- if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 7
- || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3, &p4, &p5, &p6, &p7) == FAILURE)
- WRONG_PARAM_COUNT;
-
- switch (ZEND_NUM_ARGS()) {
- case 7:
- convert_to_long_ex(p7);
- bailout_on_trivial = Z_LVAL_PP(p7);
- case 6:
- case 5:
- case 4:
- convert_to_string_ex(p4);
- if ((fmt_msgs = lookup_fmt_msgs(p4, 1)))
- drop_ref = 1;
- case 3:
- convert_to_long_ex(p3);
- port = Z_LVAL_PP(p3);
- case 2:
- convert_to_string_ex(p2);
- server = Z_STRVAL_PP(p2);
- case 1:
- convert_to_string_ex(p1);
- username = Z_STRVAL_PP(p1);
- }
-
- if (!fmt_msgs)
- fmt_msgs = &php_ircg->fmt_msgs_default_compiled;
-
- /*
- * conn must be able to live longer than the hash entry in h_irconn,
- * so we have to allocate it ourselves.
- */
- conn = IRCG_SHARED_ALLOC(sizeof *conn);
- memset(conn, 0, sizeof *conn);
- conn->fd = -1;
- if (ZEND_NUM_ARGS() > 5 && Z_TYPE_PP(p6) == IS_ARRAY) {
- zval **val;
-
- if (zend_hash_find(Z_ARRVAL_PP(p6), "ident", sizeof("ident"),
- (void **) &val) == SUCCESS) {
- convert_to_string_ex(val);
- conn->ident = Z_STRVAL_PP(val);
- }
-
- if (zend_hash_find(Z_ARRVAL_PP(p6), "password", sizeof("password"),
- (void **) &val) == SUCCESS) {
- convert_to_string_ex(val);
- conn->password = Z_STRVAL_PP(val);
- }
-
- if (zend_hash_find(Z_ARRVAL_PP(p6), "realname", sizeof("realname"),
- (void **) &val) == SUCCESS) {
- convert_to_string_ex(val);
- conn->realname = Z_STRVAL_PP(val);
- }
- }
-
- conn->fmt_msgs = fmt_msgs;
- if (irc_connect(username, register_hooks,
- conn, server, port, &conn->conn)) {
- if (drop_ref)
- fmt_msgs_drop_ref(fmt_msgs);
- IRCG_SHARED_FREE(conn);
- php_error(E_WARNING, "%s(): irc_connect() failed prematurely", get_active_function_name(TSRMLS_C));
- RETURN_FALSE;
- }
-
- concurrency = ++php_ircg->irc_connects - php_ircg->irc_quit_handlers;
-
- if (concurrency > php_ircg->max_concurrency)
- php_ircg->max_concurrency = concurrency;
-
- ircg_hash_init(&conn->ctcp_msgs, 10, NULL, (dtor_func_t) ctcp_msgs_dtor, 1);
- if (p5 && Z_TYPE_PP(p5) == IS_ARRAY) {
- ircg_copy_ctcp_msgs(p5, conn);
- }
-
-#ifdef USE_IRCONN_MANAGEMENT
- if (irconn_id == 0)
- irconn_id = 10000.0 * php_combined_lcg(TSRMLS_C);
- else
- irconn_id += 20.0 * (1.0 + php_combined_lcg(TSRMLS_C));
-
-
- while (ircg_hash_index_exists(&h_irconn, irconn_id)) {
- irconn_id++;
- }
-
- conn->irconn_id = irconn_id;
- ircg_hash_index_update(&h_irconn, irconn_id, &conn, sizeof(conn), NULL);
-#else
- conn->irconn_id = conn->conn.resid;
-#endif
-
- conn->login = php_ircg_now();
-
- /* XXX: we take chances by assuming that wordsize read/writes are atomic */
- if (conn->login >= php_ircg->next_gc)
- php_ircg_error_msg_gc(conn->login);
-
- RETVAL_LONG(conn->irconn_id);
-}
-/* }}} */
-
-/* {{{ proto bool ircg_disconnect(int connection, string reason)
- Terminate IRC connection */
-PHP_FUNCTION(ircg_disconnect)
-{
- zval **id, **reason;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &id, &reason) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(id);
- convert_to_string_ex(reason);
-
-#ifdef USE_IRCONN_MANAGEMENT
- ircg_hash_index_del(&h_irconn, Z_LVAL_PP(id));
-#else
- conn = lookup_irconn(Z_LVAL_PP(id));
-
- if (!conn) RETURN_FALSE;
-
- irc_disconnect(&conn->conn, Z_STRVAL_PP(reason));
-
- put_irconn(conn);
-#endif
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ircg_nick(int connection, string newnick)
- Changes the nickname */
-PHP_FUNCTION(ircg_nick)
-{
- zval **id, **newnick;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &id, &newnick) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(id);
- convert_to_string_ex(newnick);
-
- conn = lookup_irconn(Z_LVAL_PP(id));
-
- if (!conn) RETURN_FALSE;
-
- irc_nick(&conn->conn, Z_STRVAL_PP(newnick));
- put_irconn(conn);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ircg_list(int connection, string channel)
- List topic/user count of channel(s) */
-PHP_FUNCTION(ircg_list)
-{
- zval **id, **p2;
- php_irconn_t *conn;
- int ac = ZEND_NUM_ARGS();
-
- if (ac != 2 || zend_get_parameters_ex(ac, &id, &p2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(id);
- convert_to_string_ex(p2);
-
- conn = lookup_irconn(Z_LVAL_PP(id));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "LIST", 1, Z_STRVAL_PP(p2));
- put_irconn(conn);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-
-/* {{{ proto bool ircg_notice(int connection, string recipient, string message)
- Sends a one-way communication NOTICE to a target */
-PHP_FUNCTION(ircg_notice)
-{
- zval **id, **recipient, **msg;
- php_irconn_t *conn;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &id, &recipient, &msg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(id);
- convert_to_string_ex(recipient);
- convert_to_string_ex(msg);
-
- conn = lookup_irconn(Z_LVAL_PP(id));
-
- if (!conn) RETURN_FALSE;
-
- irc_handle_command(&conn->conn, "NOTICE", 2, Z_STRVAL_PP(recipient), Z_STRVAL_PP(msg));
- put_irconn(conn);
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto array ircg_eval_ecmascript_params(string params)
- Decodes a list of JS-encoded parameters into a native array */
-
-#define ADD_PARA() do { \
- if (para.len) smart_str_0(&para); \
- add_next_index_stringl(return_value, \
- para.len == 0 ? empty_string : para.c, \
- para.len, 0); \
- para.len = 0; \
- para.c = 0; \
-} while (0)
-
-PHP_FUNCTION(ircg_eval_ecmascript_params)
-{
- zval **str;
- int s;
- unsigned char *ptr, *ptre;
- unsigned char c;
- smart_str para = {0};
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_string_ex(str);
-
- array_init(return_value);
-
- ptr = Z_STRVAL_PP(str);
- ptre = ptr + Z_STRLEN_PP(str);
-
- s = 0;
-
- for (; ptr < ptre; ptr++) {
- c = *ptr;
- switch (s) {
-
- /*
- * State 0: Looking for ' or digit
- * State 1: Assembling parameter inside '..'
- * State 2: After escape sign: Copies single char verbatim, go to 1
- * State 3: Assembling numeric para, no quotation
- * State 4: Looking for ",", skipping whitespace
- */
-
- case 0:
- switch (c) {
- case '\'':
- s = 1;
- para.len = 0;
- break;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- s = 3;
- smart_str_appendc(&para, c);
- break;
-
- default: /* erroneous */
- return;
- }
- break;
-
- case 1:
- switch (c) {
- case '\\':
- s = 2;
- break;
-
- case '\'':
- s = 4;
- ADD_PARA();
- break;
-
- default:
- smart_str_appendc(&para, c);
- break;
- }
- break;
-
- case 2:
- smart_str_appendc(&para, c);
- s = 1;
- break;
-
- case 3:
- switch (c) {
- case ',':
- s = 0;
- ADD_PARA();
- break;
-
- default:
- smart_str_appendc(&para, c);
- break;
- }
- break;
-
- case 4:
- switch (c) {
- case ',':
- s = 0;
- break;
- }
- break;
- }
- }
-
- if (para.len != 0) {
- if (s == 3)
- ADD_PARA();
- else
- smart_str_free(&para);
- }
-}
-/* }}} */
-
-/* {{{ proto bool ircg_msg(int connection, string recipient, string message [,bool loop-suppress])
- Delivers a message to the IRC network */
-PHP_FUNCTION(ircg_msg)
-{
- zval **id, **recipient, **msg, **suppress;
- php_irconn_t *conn;
- smart_str l = {0};
- smart_str m = {0};
- smart_str tmp, tmp2;
- int o_suppress = 0;
-
- if (ZEND_NUM_ARGS() < 3 || ZEND_NUM_ARGS() > 4 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &id, &recipient, &msg, &suppress) == FAILURE)
- WRONG_PARAM_COUNT;
-
- switch (ZEND_NUM_ARGS()) {
- case 4:
- convert_to_long_ex(suppress);
- o_suppress = Z_LVAL_PP(suppress);
- case 3:
- convert_to_long_ex(id);
- convert_to_string_ex(recipient);
- convert_to_string_ex(msg);
- }
-
- conn = lookup_irconn(Z_LVAL_PP(id));
-
- if (!conn) RETURN_FALSE;
-
- irc_msg(&conn->conn, Z_STRVAL_PP(recipient), Z_STRVAL_PP(msg));
-
- if (!o_suppress) {
- smart_str_setl(&l, Z_STRVAL_PP(msg), Z_STRLEN_PP(msg));
-
- smart_str_setl(&tmp, Z_STRVAL_PP(recipient), Z_STRLEN_PP(recipient));
- smart_str_setl(&tmp2, conn->conn.username, conn->conn.username_len);
-
- switch (Z_STRVAL_PP(recipient)[0]) {
- case '#':
- case '&':
- if (l.c[0] == 1) {
- handle_ctcp(conn, &tmp, &tmp2, &tmp, &l, &m);
- } else {
- FORMAT_MSG(conn, FMT_MSG_CHAN, &tmp, NULL, &tmp2, &l, &m, conn->conn.username, conn->conn.username_len);
- }
- break;
- default:
- if (l.c[0] == 1) {
- handle_ctcp(conn, NULL, &tmp2, &tmp, &l, &m);
- } else {
- FORMAT_MSG(conn, FMT_MSG_PRIV_FROM_ME, NULL,
- &tmp, &tmp2, &l, &m, conn->conn.username, conn->conn.username_len);
- }
- }
-
- msg_send(conn, &m);
- }
-
- put_irconn(conn);
- RETURN_TRUE;
-}
-/* }}} */
-
-PHP_RINIT_FUNCTION(ircg)
-{
- IRCGG(flush_data) = 0;
- return SUCCESS;
-}
-
-/* {{{ PHP_RSHUTDOWN
- */
-PHP_RSHUTDOWN_FUNCTION(ircg)
-{
- if (IRCGG(flush_data)) {
- php_irconn_t *conn = IRCGG(flush_data);
-
-#if IRCG_API_VERSION >= 20021127
-
- /*
- * In a multi-process environment, IRCG will use sendmsg(2)
- * to send the socket to the control process. After that
- * system call, we can close the socket without any problem.
- *
- * Some web servers (e.g. Apache) will call shutdown(2) on
- * the socket, so that the control process could not send
- * any more data. This must be prevented, so we
- * relinquish this process's control of the socket.
- */
-
- if (irc_write_buf_close_conn()) {
- sapi_send_headers(TSRMLS_C);
- sapi_flush(TSRMLS_C);
- close(conn->fd);
- }
-#endif
-
- msg_replay_buffer(conn);
- irc_write_buf_flush(&conn->wb);
- put_irconn(conn);
- }
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ ircg_module_entry */
-zend_module_entry ircg_module_entry = {
- STANDARD_MODULE_HEADER,
- "ircg",
- ircg_functions,
- PHP_MINIT(ircg),
- PHP_MSHUTDOWN(ircg),
- PHP_RINIT(ircg),
- PHP_RSHUTDOWN(ircg),
- PHP_MINFO(ircg),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_IRCG
-ZEND_GET_MODULE(ircg)
-#endif
-/* }}} */
-
-static int init(void *p)
-{
- int i;
-
- IRCG_LOCK_INIT(php_ircg->fmt_msgs_lock);
- IRCG_LOCK_INIT(php_ircg->error_msgs_lock);
-
- for (i = 0; i < NO_FMTS; i++) {
- php_ircg_token_compiler(fmt_msgs_default[i], strlen(fmt_msgs_default[i]), &php_ircg->fmt_msgs_default_compiled.fmt_msgs[i]);
- }
- return 0;
-}
-
-static void setup(int stage);
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(ircg)
-{
- uid_t uid;
- gid_t gid;
- char *user;
- char buf[32];
-
-#if IRCG_API_VERSION >= 20010307
- if (irc_sizeof_irconn() != sizeof(irconn_t)) {
- printf("FATAL: The size of the irconn_t structure has changed "
- "since you compiled PHP. Please rebuild PHP against "
- "the correct IRCG header files.\n");
- exit(1);
- }
-
- if (irc_sizeof_write_buf() != sizeof(irc_write_buf)) {
- printf("FATAL: The size of the irc_write_buf structure has changed "
- "since you compiled PHP. Please rebuild PHP against "
- "the correct IRCG header files.\n");
- exit(1);
- }
-#endif
-
- REGISTER_INI_ENTRIES();
-
- php_ircg_init_compat();
-
-#if IRCG_API_VERSION >= 20021127
- if (php_ircg_get_target_data(&uid, &gid TSRMLS_CC)) {
- user = IRCGG(control_user);
- } else {
- sprintf(buf, "%u", uid);
- user = buf;
- }
-
- if (ircg_setup_global(IRCGG(work_dir), IRCGG(shared_mem_size), user, setup))
- return FAILURE;
-#else
- setup(0);
- setup(1);
-#endif
-
- ircg_hash_init(&php_ircg->h_fmt_msgs, 0, NULL, NULL, 1);
-#ifdef USE_FD2IRCONN
- ircg_hash_init(&h_fd2irconn, 0, NULL, NULL, 1);
-#endif
-#ifdef USE_IRCONN_MANAGEMENT
- ircg_hash_init(&h_irconn, 0, NULL, irconn_dtor, 1);
-#endif
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(ircg)
-{
-#ifdef USE_IRCONN_MANAGEMENT
- ircg_hash_destroy(&h_irconn);
-#endif
-#ifdef USE_FD2IRCONN
- ircg_hash_destroy(&h_fd2irconn);
-#endif
-
- return SUCCESS;
-}
-/* }}} */
-
-#if IRCG_API_VERSION >= 20021127
-#include <ircg_log.h>
-#endif
-
-static void php_ircg_print_table_row(const char *name, unsigned int d TSRMLS_DC)
-{
- char buf[32];
-
- PUTS("<tr><td class='e' style='background: #ccf'>");
- PUTS(name);
- PUTS("</td><td class='v' style='background: #ccc; text-align: right'>");
- PUTS(smart_str_print_unsigned(buf + sizeof(buf) - 1, d));
- PUTS("</td></tr>");
-}
-
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(ircg)
-{
-#if IRCG_API_VERSION >= 20021127
- int i;
- const char *name;
- ircg_log_int val;
-#endif
-
- php_info_print_table_start();
- php_info_print_table_header(2, "Property", "Value");
-
- php_ircg_print_table_row("Maximum number of open fds (system limit)",
- getdtablesize() TSRMLS_CC);
- php_ircg_print_table_row("Highest encountered fd",
- php_ircg->highest_fd TSRMLS_CC);
- php_ircg_print_table_row("Maximum concurrent IRC connections",
- php_ircg->max_concurrency TSRMLS_CC);
- php_ircg_print_table_row("Scanner result cache hits",
- php_ircg->cache_hits TSRMLS_CC);
- php_ircg_print_table_row("Scanner result cache misses",
- php_ircg->cache_misses TSRMLS_CC);
- php_ircg_print_table_row("Handled format messages",
- php_ircg->exec_fmt_msgs TSRMLS_CC);
- php_ircg_print_table_row("Tokenizer invocations",
- php_ircg->exec_token_compiler TSRMLS_CC);
- php_ircg_print_table_row("Initiated IRC connections",
- php_ircg->irc_connects TSRMLS_CC);
- php_ircg_print_table_row("Terminated IRC connections",
- php_ircg->irc_quit_handlers TSRMLS_CC);
- php_ircg_print_table_row("Persistent HTTP connections",
- php_ircg->irc_set_currents TSRMLS_CC);
- php_ircg_print_table_row("Failed persistent HTTP connections",
- php_ircg->failed_set_currents TSRMLS_CC);
- php_ircg_print_table_row("Write buffer destructs",
- php_ircg->irc_wbuf_destructs TSRMLS_CC);
- php_ircg_print_table_row("Format sets exist",
- php_ircg->fmt_sets_exist TSRMLS_CC);
- php_ircg_print_table_row("Format sets evicted",
- php_ircg->fmt_sets_evicted TSRMLS_CC);
- php_ircg_print_table_row("Format sets updates",
- php_ircg->fmt_sets_updates TSRMLS_CC);
- php_ircg_print_table_row("Format sets ignored",
- php_ircg->fmt_sets_ignored TSRMLS_CC);
- php_ircg_print_table_row("Format sets created",
- php_ircg->fmt_sets_created TSRMLS_CC);
- php_ircg_print_table_row("Format sets destroyed",
- php_ircg->fmt_sets_destroyed TSRMLS_CC);
-
-#if IRCG_API_VERSION >= 20021127
-
- php_info_print_table_end();
- php_info_print_table_start();
- php_info_print_table_header(2, "IRCG 4 Property", "Value");
-
- for (i = 0; i < IRCG_LOG_CNT_NR; i++) {
- ircg_log_get(i, &val, &name);
- php_ircg_print_table_row(name, val TSRMLS_CC);
- }
-
-#endif
- php_info_print_table_end();
-
-
- DISPLAY_INI_ENTRIES();
-}
-/* }}} */
-
-
-static void setup(int stage)
-{
- if (stage == 0) {
- ircg_fetch_area("php-ircg-main", (void **) &php_ircg, sizeof *php_ircg, init);
-
- ircg_register_relocation_map("php_ircg_msg_handler", php_ircg_cb_msg);
- ircg_register_relocation_map("php_ircg_wbuf_handler", php_ircg_cb_wbuf);
-
- } else if (stage == 1) {
- size_t sz;
- TSRMLS_FETCH();
-
- ircg_reader_keep_alive_interval(IRCGG(ka_interval));
- php_ircg_cache_entries = malloc(sizeof(struct cache_entry) * NR_CACHE_ENTRIES);
- memset(php_ircg_cache_entries, 0, sizeof(struct cache_entry) * NR_CACHE_ENTRIES);
-
- sz = sizeof(void *) * IRCGG(max_fmt_msg_sets);
- php_ircg->fmt_msgs = IRCG_SHARED_ALLOC(sz);
- memset(php_ircg->fmt_msgs, 0, sz);
-
- php_ircg->is_fastcgi = strcmp(sapi_module.name, "cgi-fcgi") == 0;
- } else if (stage == -1) {
- memset(php_ircg, 0x78, sizeof *php_ircg);
- IRCG_SHARED_FREE(php_ircg);
- php_ircg = NULL;
- }
-}
-
-/*
- * 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/ircg/ircg.php b/ext/ircg/ircg.php
deleted file mode 100644
index d93507a87..000000000
--- a/ext/ircg/ircg.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?
-$module = 'ircg';
-$function = 'confirm_' . $module . '_compiled';
-if (extension_loaded($module)) {
- $str = $function($module);
-} else {
- $str = "Module $module is not compiled into PHP";
-}
-echo "$str\n";
-?>
diff --git a/ext/ircg/ircg_common.c b/ext/ircg/ircg_common.c
deleted file mode 100644
index f041fbf08..000000000
--- a/ext/ircg/ircg_common.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Sascha Schumann <sascha@schumann.cx> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: ircg_common.c,v 1.14 2004/01/08 08:15:52 andi Exp $ */
-
-#if YOU_ARE_SANE
-
-Then better walk away from this file.
-
-#endif
-
-#include "php.h"
-
-int php_ircg_register_closed_connection(void (*http_closed_connection)(int))
-{
- return -1;
-}
-
-#define PHP_IRCG_COMPATIBLE
-
-#ifdef PHP_IRCG_COMPATIBLE
-
-#include <dlfcn.h>
-
-static int (*php_ircg_sapi_get_fd)(int *fd TSRMLS_DC);
-static int (*php_ircg_sapi_force_http_10)(TSRMLS_D);
-static int (*php_ircg_sapi_get_target_uid)(uid_t * TSRMLS_DC);
-static int (*php_ircg_sapi_get_target_gid)(gid_t * TSRMLS_DC);
-
-/* Apache 1.3 definitions */
-
-static int is_apache;
-
-static uid_t *php_ircg_ap_user_id;
-static gid_t *php_ircg_ap_group_id;
-
-
-typedef struct {
- unsigned long a;
- int fd;
-} ircg_APFD;
-
-typedef struct {
- int a;
- unsigned char *b;
- int c[3];
- void *d[2];
- int e;
- void (*f)(void);
- void *g;
- long int h;
- void *i;
-
- union {
- int fd;
- /* IBM HTTP Server adds another abstraction layer */
- ircg_APFD *apfd;
- } x;
-} ircg_BUFF;
-
-typedef struct {
- void *a[4];
- int b;
- ircg_BUFF *client;
-} ircg_conn_rec;
-
-typedef struct {
- void *a;
-
- ircg_conn_rec *connection;
-
- void *b[5];
- int c;
- enum { REALLY_NOTHING } d;
- int e;
- void *f;
-
- int proto_num;
-} ircg_request_rec;
-
-/* Apache 2.0 definitions */
-
-static int is_apache2;
-
-static void *php_ircg_apa2_core_module;
-static void *(*php_ircg_apa2_get_module_config)(void *, void *);
-
-typedef struct {
- void *a;
- uid_t user_id;
- gid_t group_id;
-} ircg_apa2_unixd_config_rec;
-
-static ircg_apa2_unixd_config_rec *php_ircg_apa2_unixd_config;
-
-typedef struct {
- void *a;
- int fd;
-} ircg_apr_unix_socket;
-
-typedef struct {
- void *a[8];
- unsigned b;
- enum { REALLY_NOTHING2 } c;
- signed int d;
- int e;
- void *f[2];
- long g;
-
- void *conn_config;
-} ircg_apa2_conn_rec;
-
-typedef struct {
- void *a;
- ircg_apa2_conn_rec *connection;
-
- void *b[5];
- int c[3];
- char *d;
-
- int proto_num;
-} ircg_apa2_request_rec;
-
-
-typedef struct {
- int a;
- ircg_apa2_request_rec *r;
-} ircg_apa2_php_struct;
-
-#include "main/SAPI.h"
-
-static int php_ircg_force_http_10(TSRMLS_D)
-{
- if (is_apache) {
- ircg_request_rec *r = SG(server_context);
-
- /* ensure that we are not accidentially hitting something else */
- if (r->proto_num == 9
- || (r->proto_num >= 1000 && r->proto_num <= 2000)) {
- r->proto_num = 1000;
- return SUCCESS;
- }
- } else if (is_apache2) {
- ircg_apa2_php_struct *p = SG(server_context);
-
- /* ensure that we are not accidentially hitting something else */
- if (p && p->r && (p->r->proto_num == 9
- || (p->r->proto_num >= 1000 && p->r->proto_num <= 2000))) {
- p->r->proto_num = 1000;
- return SUCCESS;
- }
- } else if (php_ircg_sapi_force_http_10) {
- return php_ircg_sapi_force_http_10(TSRMLS_C);
- }
- return FAILURE;
-}
-
-static int php_ircg_get_fd(int *nfd TSRMLS_DC)
-{
- int fd = -1;
-
- if (is_apache) {
- ircg_request_rec *r = SG(server_context);
-
- fd = r->connection->client->x.fd;
-
- if (fd < -1 && fd > 130000) {
- fd = r->connection->client->x.apfd->fd;
- }
-
- } else if (is_apache2) {
- ircg_apa2_php_struct *p = SG(server_context);
-
- if (p) {
- ircg_apr_unix_socket *s;
-
- s = php_ircg_apa2_get_module_config(p->r->connection->conn_config,
- php_ircg_apa2_core_module);
-
- if (s) {
- fd = s->fd;
- }
- }
- } else if (php_ircg_sapi_get_fd) {
- return php_ircg_sapi_get_fd(nfd TSRMLS_CC);
- }
-
- if (fd >= 0 && fd < 130000) {
- *nfd = fd;
- return SUCCESS;
- }
-
- return FAILURE;
-}
-
-static int php_ircg_get_target_uid(uid_t *obj TSRMLS_DC)
-{
- if (is_apache) {
- *obj = *php_ircg_ap_user_id;
- return SUCCESS;
- } else if (is_apache2) {
- *obj = php_ircg_apa2_unixd_config->user_id;
- return SUCCESS;
- }
- return FAILURE;
-}
-
-static int php_ircg_get_target_gid(gid_t *obj TSRMLS_DC)
-{
- if (is_apache) {
- *obj = *php_ircg_ap_group_id;
- return SUCCESS;
- } else if (is_apache2) {
- *obj = php_ircg_apa2_unixd_config->group_id;
- return SUCCESS;
- }
- return FAILURE;
-}
-
-#endif
-
-#ifndef RTLD_DEFAULT
-#define RTLD_DEFAULT NULL
-#endif
-
-void php_ircg_init_compat(TSRMLS_D)
-{
-#ifdef PHP_IRCG_COMPATIBLE
- void *p;
-
- if (strcmp(sapi_module.name, "apache") == 0) {
- is_apache = 1;
- php_ircg_ap_user_id = dlsym(RTLD_DEFAULT, "ap_user_id");
- php_ircg_ap_group_id = dlsym(RTLD_DEFAULT, "ap_group_id");
- } else if (strcmp(sapi_module.name, "apache2filter") == 0
- || strcmp(sapi_module.name, "apache2handler") == 0) {
- is_apache2 = 1;
-
- php_ircg_apa2_core_module = dlsym(RTLD_DEFAULT, "core_module");
- php_ircg_apa2_get_module_config = dlsym(RTLD_DEFAULT,
- "ap_get_module_config");
- php_ircg_apa2_unixd_config = dlsym(RTLD_DEFAULT, "unixd_config");
- }
-
-
- p = dlsym(RTLD_DEFAULT, "sapi_get_fd");
- php_ircg_sapi_get_fd = p ? p : php_ircg_get_fd;
-
- p = dlsym(RTLD_DEFAULT, "sapi_force_http_10");
- php_ircg_sapi_force_http_10 = p ? p : php_ircg_force_http_10;
-
- p = dlsym(RTLD_DEFAULT, "sapi_get_target_uid");
- php_ircg_sapi_get_target_uid = p ? p : php_ircg_get_target_uid;
-
- p = dlsym(RTLD_DEFAULT, "sapi_get_target_gid");
- php_ircg_sapi_get_target_gid = p ? p : php_ircg_get_target_gid;
-#endif
-}
-
-int php_ircg_get_target_data(uid_t *uid, gid_t *gid TSRMLS_DC)
-{
- return php_ircg_get_target_uid(uid TSRMLS_CC)
- || php_ircg_get_target_gid(gid TSRMLS_CC);
-}
-
-int php_ircg_register_with_sapi(int *fd TSRMLS_DC)
-{
-#ifdef PHP_IRCG_COMPATIBLE
- return php_ircg_force_http_10(TSRMLS_C)
- || php_ircg_get_fd(fd TSRMLS_CC);
-#else
- return sapi_force_http_10(TSRMLS_C)
- || sapi_get_fd(fd TSRMLS_CC);
-#endif
-}
diff --git a/ext/ircg/ircg_scanner.c b/ext/ircg/ircg_scanner.c
deleted file mode 100644
index b32750bf2..000000000
--- a/ext/ircg/ircg_scanner.c
+++ /dev/null
@@ -1,1208 +0,0 @@
-/* Generated by re2c 0.5 on Wed Jun 18 02:07:15 2003 */
-#line 1 "ircg_scanner.re"
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Sascha Schumann <sascha@schumann.cx> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: ircg_scanner.c,v 1.31 2004/01/08 08:15:53 andi Exp $ */
-
-
-#include <stdio.h>
-#include <string.h>
-
-#include "php_ircg_smart_str.h"
-#include "php_ircg_alloc.h"
-
-static const char *color_list[] = {
- "white",
- "black",
- "blue",
- "green",
- "red",
- "brown",
- "purple",
- "orange",
- "yellow",
- "lightgreen",
- "teal",
- "lightcyan",
- "lightblue",
- "#ff00ff",
- "#bebebe",
- "lightgrey"
-};
-
-
-typedef struct {
- int bg_code;
- int fg_code;
- int font_tag_open;
- int bold_tag_open;
- int underline_tag_open;
- int italic_tag_open;
- char fg_color[6];
- char bg_color[6];
-
- smart_str scheme;
- smart_str *result;
-} ircg_msg_scanner;
-
-#line 79
-
-
-#define YYFILL(n) do { } while (0)
-#define YYCTYPE unsigned char
-#define YYCURSOR xp
-#define YYLIMIT end
-#define YYMARKER q
-
-#define STD_PARA ircg_msg_scanner *ctx, const char *start, const char *YYCURSOR
-#define STD_ARGS ctx, start, YYCURSOR
-
-#define PASSTHRU() do { \
- smart_str_appendl_ex(mctx.result, start, xp-start, 1); \
-} while (0)
-
-static inline void handle_scheme(STD_PARA)
-{
- ctx->scheme.len = 0;
- smart_str_appendl_ex(&ctx->scheme, start, YYCURSOR - start, 1);
- smart_str_0(&ctx->scheme);
-}
-
-static inline void handle_url(STD_PARA)
-{
- smart_str_appends_ex(ctx->result, "<a target=blank href=\"", 1);
- smart_str_append_ex(ctx->result, &ctx->scheme, 1);
- smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
- smart_str_appends_ex(ctx->result, "\">", 1);
- smart_str_append_ex(ctx->result, &ctx->scheme, 1);
- smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
- smart_str_appends_ex(ctx->result, "</a>", 1);
-}
-
-static void handle_color_digit(STD_PARA, int mode)
-{
- int len;
- int nr;
-
- len = YYCURSOR - start;
- switch (len) {
- case 2:
- nr = (start[0] - '0') * 10 + (start[1] - '0');
- break;
- case 1:
- nr = start[0] - '0';
- break;
- }
-
- switch (mode) {
- case 0: ctx->fg_code = nr; break;
- case 1: ctx->bg_code = nr; break;
- }
-}
-
-static void handle_hex(STD_PARA, int mode)
-{
- memcpy(mode == 0 ? ctx->fg_color : ctx->bg_color, start, 6);
-}
-
-#define IS_VALID_CODE(n) (n >= 0 && n <= 15)
-
-static void finish_color_stuff(STD_PARA)
-{
- if (ctx->font_tag_open) {
- smart_str_appends_ex(ctx->result, "</font>", 1);
- ctx->font_tag_open = 0;
- }
-}
-
-static void handle_bold(STD_PARA, int final)
-{
- switch (ctx->bold_tag_open) {
- case 0:
- if (!final) smart_str_appends_ex(ctx->result, "<b>", 1);
- break;
- case 1:
- smart_str_appends_ex(ctx->result, "</b>", 1);
- break;
- }
-
- ctx->bold_tag_open = 1 - ctx->bold_tag_open;
-}
-
-static void handle_underline(STD_PARA, int final)
-{
- switch (ctx->underline_tag_open) {
- case 0:
- if (!final) smart_str_appends_ex(ctx->result, "<u>", 1);
- break;
- case 1:
- smart_str_appends_ex(ctx->result, "</u>", 1);
- break;
- }
-
- ctx->underline_tag_open = 1 - ctx->underline_tag_open;
-}
-
-static void handle_italic(STD_PARA, int final)
-{
- switch (ctx->italic_tag_open) {
- case 0:
- if (!final) smart_str_appends_ex(ctx->result, "<i>", 1);
- break;
- case 1:
- smart_str_appends_ex(ctx->result, "</i>", 1);
- break;
- }
-
- ctx->italic_tag_open = 1 - ctx->italic_tag_open;
-}
-
-static void commit_color_stuff(STD_PARA)
-{
- finish_color_stuff(STD_ARGS);
-
- if (IS_VALID_CODE(ctx->fg_code)) {
- smart_str_appends_ex(ctx->result, "<font color=\"", 1);
- smart_str_appends_ex(ctx->result, color_list[ctx->fg_code], 1);
- smart_str_appends_ex(ctx->result, "\">", 1);
- ctx->font_tag_open = 1;
- }
-}
-
-#define ADD_CONST(entity) do { \
- smart_str_appends_ex(result, entity, 1); \
-} while (0)
-
-static void commit_color_hex(STD_PARA)
-{
- finish_color_stuff(STD_ARGS);
-
- if (ctx->fg_color[0] != 0) {
- smart_str_appends_ex(ctx->result, "<font color=\"", 1);
- smart_str_appendl_ex(ctx->result, ctx->fg_color, 6, 1);
- smart_str_appends_ex(ctx->result, "\">", 1);
- ctx->font_tag_open = 1;
- }
-}
-
-static void do_reset(STD_PARA)
-{
- finish_color_stuff(STD_ARGS);
- handle_bold(STD_ARGS, 1);
- handle_underline(STD_ARGS, 1);
- handle_italic(STD_ARGS, 1);
-}
-
-void ircg_mirc_color(const char *msg, smart_str *result, size_t msg_len, int auto_links, int gen_br)
-{
- const char *end, *xp, *q, *start;
- ircg_msg_scanner mctx, *ctx = &mctx;
-
- mctx.result = result;
- mctx.scheme.c = NULL;
- mctx.italic_tag_open = mctx.font_tag_open = mctx.bold_tag_open = mctx.underline_tag_open = 0;
-
- if (msg_len == -1)
- msg_len = strlen(msg);
- end = msg + msg_len;
- xp = msg;
-
-
-state_plain:
- if (xp >= end) goto stop;
- start = YYCURSOR;
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy0;
-yy1: ++YYCURSOR;
-yy0:
- if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
- yych = *YYCURSOR;
- switch(yych){
- case '\000': goto yy2;
- case '\002': goto yy19;
- case '\003': goto yy5;
- case '\004': goto yy17;
- case '\017': goto yy25;
- case '\035': goto yy23;
- case '\036': goto yy15;
- case '\037': goto yy21;
- case '&': goto yy11;
- case '<': goto yy7;
- case '>': goto yy9;
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy3;
- case '\204': case '\223':
- case '\224': goto yy13;
- default: goto yy27;
- }
-yy2: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy4;
- }
-yy3: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy29;
- default: goto yy4;
- }
-yy4:
-#line 257
- { PASSTHRU(); goto state_plain; }
-yy5: yych = *++YYCURSOR;
-yy6:
-#line 246
- { mctx.fg_code = mctx.bg_code = -1; goto state_color_fg; }
-yy7: yych = *++YYCURSOR;
-yy8:
-#line 247
- { ADD_CONST("&lt;"); goto state_plain; }
-yy9: yych = *++YYCURSOR;
-yy10:
-#line 248
- { ADD_CONST("&gt;"); goto state_plain; }
-yy11: yych = *++YYCURSOR;
-yy12:
-#line 249
- { ADD_CONST("&amp;"); goto state_plain; }
-yy13: yych = *++YYCURSOR;
-yy14:
-#line 250
- { ADD_CONST("&quot;"); goto state_plain; }
-yy15: yych = *++YYCURSOR;
-yy16:
-#line 251
- { if (gen_br) ADD_CONST("<br>"); goto state_plain; }
-yy17: yych = *++YYCURSOR;
-yy18:
-#line 252
- { mctx.fg_color[0] = mctx.bg_color[0] = 0; goto state_color_hex; }
-yy19: yych = *++YYCURSOR;
-yy20:
-#line 253
- { handle_bold(STD_ARGS, 0); goto state_plain; }
-yy21: yych = *++YYCURSOR;
-yy22:
-#line 254
- { handle_underline(STD_ARGS, 0); goto state_plain; }
-yy23: yych = *++YYCURSOR;
-yy24:
-#line 255
- { handle_italic(STD_ARGS, 0); goto state_plain; }
-yy25: yych = *++YYCURSOR;
-yy26:
-#line 256
- { do_reset(STD_ARGS); goto state_plain; }
-yy27: yych = *++YYCURSOR;
- goto yy4;
-yy28: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
-yy29: switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': goto yy28;
- case ':': goto yy30;
- default: goto yy2;
- }
-yy30: yych = *++YYCURSOR;
- switch(yych){
- case '/': goto yy31;
- default: goto yy2;
- }
-yy31: yych = *++YYCURSOR;
- switch(yych){
- case '/': goto yy32;
- default: goto yy2;
- }
-yy32: yych = *++YYCURSOR;
-yy33:
-#line 245
- { if (auto_links) { handle_scheme(STD_ARGS); goto state_url; } else { PASSTHRU(); goto state_plain; } }
-}
-#line 258
-
-
-state_color_hex:
- start = YYCURSOR;
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy34;
-yy35: ++YYCURSOR;
-yy34:
- if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
- yych = *YYCURSOR;
- switch(yych){
- case ',': goto yy38;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy36;
- default: goto yy40;
- }
-yy36: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy41;
- default: goto yy37;
- }
-yy37:
-#line 265
- { finish_color_stuff(STD_ARGS); PASSTHRU(); goto state_plain; }
-yy38: yych = *++YYCURSOR;
-yy39:
-#line 264
- { goto state_color_hex_bg; }
-yy40: yych = *++YYCURSOR;
- goto yy37;
-yy41: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy43;
- default: goto yy42;
- }
-yy42: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy37;
- }
-yy43: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy44;
- default: goto yy42;
- }
-yy44: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy45;
- default: goto yy42;
- }
-yy45: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy46;
- default: goto yy42;
- }
-yy46: yych = *++YYCURSOR;
-yy47:
-#line 263
- { handle_hex(STD_ARGS, 0); goto state_color_hex_bg; }
-}
-#line 266
-
-
-
-state_color_hex_comma:
- start = YYCURSOR;
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy48;
-yy49: ++YYCURSOR;
-yy48:
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case ',': goto yy50;
- default: goto yy52;
- }
-yy50: yych = *++YYCURSOR;
-yy51:
-#line 272
- { goto state_color_hex_bg; }
-yy52: yych = *++YYCURSOR;
-yy53:
-#line 273
- { YYCURSOR--; commit_color_hex(STD_ARGS); goto state_plain; }
-}
-#line 274
-
-
-
-state_color_hex_bg:
- start = YYCURSOR;
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy54;
-yy55: ++YYCURSOR;
-yy54:
- if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
- yych = *YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy56;
- default: goto yy58;
- }
-yy56: yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy59;
- default: goto yy57;
- }
-yy57:
-#line 281
- { commit_color_hex(STD_ARGS); PASSTHRU(); goto state_plain; }
-yy58: yych = *++YYCURSOR;
- goto yy57;
-yy59: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy61;
- default: goto yy60;
- }
-yy60: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy57;
- }
-yy61: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy62;
- default: goto yy60;
- }
-yy62: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy63;
- default: goto yy60;
- }
-yy63: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f': goto yy64;
- default: goto yy60;
- }
-yy64: yych = *++YYCURSOR;
-yy65:
-#line 280
- { handle_hex(STD_ARGS, 1); commit_color_hex(STD_ARGS); goto state_plain; }
-}
-#line 282
-
-
-state_url:
- start = YYCURSOR;
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy66;
-yy67: ++YYCURSOR;
-yy66:
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- switch(yych){
- case '!': case '#':
- case '$':
- case '%':
- case '&':
- case '\'':
- case '(':
- case ')':
- case '*':
- case '+':
- case ',':
- case '-':
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case ';': case '=': case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': case '~': goto yy68;
- default: goto yy70;
- }
-yy68: yych = *++YYCURSOR;
- goto yy73;
-yy69:
-#line 287
- { handle_url(STD_ARGS); goto state_plain; }
-yy70: yych = *++YYCURSOR;
-yy71:
-#line 288
- { PASSTHRU(); goto state_plain; }
-yy72: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
-yy73: switch(yych){
- case '!': case '#':
- case '$':
- case '%':
- case '&':
- case '\'':
- case '(':
- case ')':
- case '*':
- case '+':
- case ',':
- case '-':
- case '.':
- case '/':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case ':':
- case ';': case '=': case '?':
- case '@':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'H':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z': case '_': case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z': case '~': goto yy72;
- default: goto yy69;
- }
-}
-#line 289
-
-
-
-state_color_fg:
- start = YYCURSOR;
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy74;
-yy75: ++YYCURSOR;
-yy74:
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- switch(yych){
- case ',': goto yy78;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy76;
- default: goto yy80;
- }
-yy76: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy82;
- default: goto yy77;
- }
-yy77:
-#line 295
- { handle_color_digit(STD_ARGS, 0); goto state_color_comma; }
-yy78: yych = *++YYCURSOR;
-yy79:
-#line 296
- { goto state_color_bg; }
-yy80: yych = *++YYCURSOR;
-yy81:
-#line 297
- { finish_color_stuff(STD_ARGS); PASSTHRU(); goto state_plain; }
-yy82: yych = *++YYCURSOR;
- goto yy77;
-}
-#line 298
-
-
-
-state_color_comma:
- start = YYCURSOR;
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy83;
-yy84: ++YYCURSOR;
-yy83:
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- switch(yych){
- case ',': goto yy85;
- default: goto yy87;
- }
-yy85: yych = *++YYCURSOR;
-yy86:
-#line 304
- { goto state_color_bg; }
-yy87: yych = *++YYCURSOR;
-yy88:
-#line 305
- { YYCURSOR--; commit_color_stuff(STD_ARGS); goto state_plain; }
-}
-#line 306
-
-
-
-state_color_bg:
- start = YYCURSOR;
-{
- YYCTYPE yych;
- unsigned int yyaccept;
- goto yy89;
-yy90: ++YYCURSOR;
-yy89:
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy91;
- default: goto yy93;
- }
-yy91: yych = *++YYCURSOR;
- switch(yych){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy95;
- default: goto yy92;
- }
-yy92:
-#line 312
- { handle_color_digit(STD_ARGS, 1); commit_color_stuff(STD_ARGS); goto state_plain; }
-yy93: yych = *++YYCURSOR;
-yy94:
-#line 313
- { commit_color_stuff(STD_ARGS); PASSTHRU(); goto state_plain; }
-yy95: yych = *++YYCURSOR;
- goto yy92;
-}
-#line 314
-
-
-stop:
- smart_str_free_ex(&mctx.scheme, 1);
-
- do_reset(STD_ARGS);
-}
diff --git a/ext/ircg/ircg_scanner.re b/ext/ircg/ircg_scanner.re
deleted file mode 100644
index d7ed79969..000000000
--- a/ext/ircg/ircg_scanner.re
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Sascha Schumann <sascha@schumann.cx> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: ircg_scanner.re,v 1.29 2004/01/08 17:32:18 sniper Exp $ */
-
-
-#include <stdio.h>
-#include <string.h>
-
-#include "php_ircg_smart_str.h"
-#include "php_ircg_alloc.h"
-
-static const char *color_list[] = {
- "white",
- "black",
- "blue",
- "green",
- "red",
- "brown",
- "purple",
- "orange",
- "yellow",
- "lightgreen",
- "teal",
- "lightcyan",
- "lightblue",
- "#ff00ff",
- "#bebebe",
- "lightgrey"
-};
-
-
-typedef struct {
- int bg_code;
- int fg_code;
- int font_tag_open;
- int bold_tag_open;
- int underline_tag_open;
- int italic_tag_open;
- char fg_color[6];
- char bg_color[6];
-
- smart_str scheme;
- smart_str *result;
-} ircg_msg_scanner;
-
-/*!re2c
-any = [\000-\377];
-anynoneof = [\001-\377];
-eof = [\000];
-alpha = [a-zA-Z];
-alnum = [a-zA-Z0-9];
-digit = [0-9];
-scheme = alpha alnum*;
-coloresc = "\003";
-colorhex = "\004";
-bold = "\002";
-underline = "\037";
-italic = "\035";
-ircnl = "\036";
-rst = "\017";
-winquotes = [\204\223\224];
-hex = [a-fA-F0-9];
-*/
-
-#define YYFILL(n) do { } while (0)
-#define YYCTYPE unsigned char
-#define YYCURSOR xp
-#define YYLIMIT end
-#define YYMARKER q
-
-#define STD_PARA ircg_msg_scanner *ctx, const char *start, const char *YYCURSOR
-#define STD_ARGS ctx, start, YYCURSOR
-
-#define PASSTHRU() do { \
- smart_str_appendl_ex(mctx.result, start, xp-start, 1); \
-} while (0)
-
-static inline void handle_scheme(STD_PARA)
-{
- ctx->scheme.len = 0;
- smart_str_appendl_ex(&ctx->scheme, start, YYCURSOR - start, 1);
- smart_str_0(&ctx->scheme);
-}
-
-static inline void handle_url(STD_PARA)
-{
- smart_str_appends_ex(ctx->result, "<a target=_blank href=\"", 1);
- smart_str_append_ex(ctx->result, &ctx->scheme, 1);
- smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
- smart_str_appends_ex(ctx->result, "\">", 1);
- smart_str_append_ex(ctx->result, &ctx->scheme, 1);
- smart_str_appendl_ex(ctx->result, start, YYCURSOR - start, 1);
- smart_str_appends_ex(ctx->result, "</a>", 1);
-}
-
-static void handle_color_digit(STD_PARA, int mode)
-{
- int len;
- int nr;
-
- len = YYCURSOR - start;
- switch (len) {
- case 2:
- nr = (start[0] - '0') * 10 + (start[1] - '0');
- break;
- case 1:
- nr = start[0] - '0';
- break;
- }
-
- switch (mode) {
- case 0: ctx->fg_code = nr; break;
- case 1: ctx->bg_code = nr; break;
- }
-}
-
-static void handle_hex(STD_PARA, int mode)
-{
- memcpy(mode == 0 ? ctx->fg_color : ctx->bg_color, start, 6);
-}
-
-#define IS_VALID_CODE(n) (n >= 0 && n <= 15)
-
-static void finish_color_stuff(STD_PARA)
-{
- if (ctx->font_tag_open) {
- smart_str_appends_ex(ctx->result, "</font>", 1);
- ctx->font_tag_open = 0;
- }
-}
-
-static void handle_bold(STD_PARA, int final)
-{
- switch (ctx->bold_tag_open) {
- case 0:
- if (!final) smart_str_appends_ex(ctx->result, "<b>", 1);
- break;
- case 1:
- smart_str_appends_ex(ctx->result, "</b>", 1);
- break;
- }
-
- ctx->bold_tag_open = 1 - ctx->bold_tag_open;
-}
-
-static void handle_underline(STD_PARA, int final)
-{
- switch (ctx->underline_tag_open) {
- case 0:
- if (!final) smart_str_appends_ex(ctx->result, "<u>", 1);
- break;
- case 1:
- smart_str_appends_ex(ctx->result, "</u>", 1);
- break;
- }
-
- ctx->underline_tag_open = 1 - ctx->underline_tag_open;
-}
-
-static void handle_italic(STD_PARA, int final)
-{
- switch (ctx->italic_tag_open) {
- case 0:
- if (!final) smart_str_appends_ex(ctx->result, "<i>", 1);
- break;
- case 1:
- smart_str_appends_ex(ctx->result, "</i>", 1);
- break;
- }
-
- ctx->italic_tag_open = 1 - ctx->italic_tag_open;
-}
-
-static void commit_color_stuff(STD_PARA)
-{
- finish_color_stuff(STD_ARGS);
-
- if (IS_VALID_CODE(ctx->fg_code)) {
- smart_str_appends_ex(ctx->result, "<font color=\"", 1);
- smart_str_appends_ex(ctx->result, color_list[ctx->fg_code], 1);
- smart_str_appends_ex(ctx->result, "\">", 1);
- ctx->font_tag_open = 1;
- }
-}
-
-#define ADD_CONST(entity) do { \
- smart_str_appends_ex(result, entity, 1); \
-} while (0)
-
-static void commit_color_hex(STD_PARA)
-{
- finish_color_stuff(STD_ARGS);
-
- if (ctx->fg_color[0] != 0) {
- smart_str_appends_ex(ctx->result, "<font color=\"", 1);
- smart_str_appendl_ex(ctx->result, ctx->fg_color, 6, 1);
- smart_str_appends_ex(ctx->result, "\">", 1);
- ctx->font_tag_open = 1;
- }
-}
-
-static void do_reset(STD_PARA)
-{
- finish_color_stuff(STD_ARGS);
- handle_bold(STD_ARGS, 1);
- handle_underline(STD_ARGS, 1);
- handle_italic(STD_ARGS, 1);
-}
-
-void ircg_mirc_color(const char *msg, smart_str *result, size_t msg_len, int auto_links, int gen_br)
-{
- const char *end, *xp, *q, *start;
- ircg_msg_scanner mctx, *ctx = &mctx;
-
- mctx.result = result;
- mctx.scheme.c = NULL;
- mctx.italic_tag_open = mctx.font_tag_open = mctx.bold_tag_open = mctx.underline_tag_open = 0;
-
- if (msg_len == -1)
- msg_len = strlen(msg);
- end = msg + msg_len;
- xp = msg;
-
-
-state_plain:
- if (xp >= end) goto stop;
- start = YYCURSOR;
-/*!re2c
- scheme "://" { if (auto_links) { handle_scheme(STD_ARGS); goto state_url; } else { PASSTHRU(); goto state_plain; } }
- coloresc { mctx.fg_code = mctx.bg_code = -1; goto state_color_fg; }
- "<" { ADD_CONST("&lt;"); goto state_plain; }
- ">" { ADD_CONST("&gt;"); goto state_plain; }
- "&" { ADD_CONST("&amp;"); goto state_plain; }
- winquotes { ADD_CONST("&quot;"); goto state_plain; }
- ircnl { if (gen_br) ADD_CONST("<br>"); goto state_plain; }
- colorhex { mctx.fg_color[0] = mctx.bg_color[0] = 0; goto state_color_hex; }
- bold { handle_bold(STD_ARGS, 0); goto state_plain; }
- underline { handle_underline(STD_ARGS, 0); goto state_plain; }
- italic { handle_italic(STD_ARGS, 0); goto state_plain; }
- rst { do_reset(STD_ARGS); goto state_plain; }
- anynoneof { PASSTHRU(); goto state_plain; }
-*/
-
-state_color_hex:
- start = YYCURSOR;
-/*!re2c
- hex hex hex hex hex hex { handle_hex(STD_ARGS, 0); goto state_color_hex_bg; }
- "," { goto state_color_hex_bg; }
- any { finish_color_stuff(STD_ARGS); PASSTHRU(); goto state_plain; }
-*/
-
-
-state_color_hex_comma:
- start = YYCURSOR;
-/*!re2c
- "," { goto state_color_hex_bg; }
- any { YYCURSOR--; commit_color_hex(STD_ARGS); goto state_plain; }
-*/
-
-
-state_color_hex_bg:
- start = YYCURSOR;
-/*!re2c
- hex hex hex hex hex hex { handle_hex(STD_ARGS, 1); commit_color_hex(STD_ARGS); goto state_plain; }
- any { commit_color_hex(STD_ARGS); PASSTHRU(); goto state_plain; }
-*/
-
-state_url:
- start = YYCURSOR;
-/*!re2c
- [-a-zA-Z0-9~_?=.@&+/#:;!*'()%,$]+ { handle_url(STD_ARGS); goto state_plain; }
- any { PASSTHRU(); goto state_plain; }
-*/
-
-
-state_color_fg:
- start = YYCURSOR;
-/*!re2c
- digit digit? { handle_color_digit(STD_ARGS, 0); goto state_color_comma; }
- "," { goto state_color_bg; }
- any { finish_color_stuff(STD_ARGS); PASSTHRU(); goto state_plain; }
-*/
-
-
-state_color_comma:
- start = YYCURSOR;
-/*!re2c
- "," { goto state_color_bg; }
- any { YYCURSOR--; commit_color_stuff(STD_ARGS); goto state_plain; }
-*/
-
-
-state_color_bg:
- start = YYCURSOR;
-/*!re2c
- digit digit? { handle_color_digit(STD_ARGS, 1); commit_color_stuff(STD_ARGS); goto state_plain; }
- any { commit_color_stuff(STD_ARGS); PASSTHRU(); goto state_plain; }
-*/
-
-stop:
- smart_str_free_ex(&mctx.scheme, 1);
-
- do_reset(STD_ARGS);
-}
diff --git a/ext/ircg/php_ircg.h b/ext/ircg/php_ircg.h
deleted file mode 100644
index dfa36ef9b..000000000
--- a/ext/ircg/php_ircg.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Sascha Schumann <sascha@schumann.cx> |
- +----------------------------------------------------------------------+
- */
-
-#ifndef PHP_IRCG_H
-#define PHP_IRCG_H
-
-extern zend_module_entry ircg_module_entry;
-#define phpext_ircg_ptr &ircg_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_IRCG_API __declspec(dllexport)
-#else
-#define PHP_IRCG_API
-#endif
-
-PHP_FUNCTION(ircg_set_on_read_data);
-PHP_FUNCTION(ircg_set_on_die);
-PHP_FUNCTION(ircg_pconnect);
-PHP_FUNCTION(ircg_join);
-PHP_FUNCTION(ircg_set_current);
-PHP_FUNCTION(ircg_set_file);
-PHP_FUNCTION(ircg_part);
-PHP_FUNCTION(ircg_register_current_conn);
-PHP_FUNCTION(ircg_whois);
-PHP_FUNCTION(ircg_msg);
-PHP_FUNCTION(ircg_notice);
-PHP_FUNCTION(ircg_nick);
-PHP_FUNCTION(ircg_html_encode);
-PHP_FUNCTION(ircg_ignore_add);
-PHP_FUNCTION(ircg_ignore_del);
-PHP_FUNCTION(ircg_kick);
-PHP_FUNCTION(ircg_fetch_error_msg);
-PHP_FUNCTION(ircg_topic);
-PHP_FUNCTION(ircg_channel_mode);
-PHP_FUNCTION(ircg_disconnect);
-PHP_FUNCTION(ircg_is_conn_alive);
-PHP_FUNCTION(ircg_lookup_format_messages);
-PHP_FUNCTION(ircg_register_format_messages);
-PHP_FUNCTION(ircg_nickname_escape);
-PHP_FUNCTION(ircg_nickname_unescape);
-PHP_FUNCTION(ircg_get_username);
-PHP_FUNCTION(ircg_eval_ecmascript_params);
-PHP_FUNCTION(ircg_list);
-PHP_FUNCTION(ircg_who);
-PHP_FUNCTION(ircg_invite);
-PHP_FUNCTION(ircg_names);
-PHP_FUNCTION(ircg_lusers);
-PHP_FUNCTION(ircg_oper);
-
-
-PHP_MINIT_FUNCTION(ircg);
-PHP_MSHUTDOWN_FUNCTION(ircg);
-PHP_RINIT_FUNCTION(ircg);
-PHP_RSHUTDOWN_FUNCTION(ircg);
-PHP_MINFO_FUNCTION(ircg);
-
-ZEND_BEGIN_MODULE_GLOBALS(ircg)
- void *flush_data;
- char *control_user;
- long shared_mem_size;
- long max_fmt_msg_sets;
- long ka_interval;
- char *work_dir;
-ZEND_END_MODULE_GLOBALS(ircg)
-
-#ifdef ZTS
-#define IRCGG(v) TSRMG(ircg_globals_id, zend_ircg_globals *, v)
-#else
-#define IRCGG(v) (ircg_globals.v)
-#endif
-
-#endif /* PHP_IRCG_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/ircg/php_ircg_alloc.h b/ext/ircg/php_ircg_alloc.h
deleted file mode 100644
index 2303c685f..000000000
--- a/ext/ircg/php_ircg_alloc.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef PHP_IRCG_ALLOC_H
-#define PHP_IRCG_ALLOC_H
-
-#include <if_irc.h>
-
-# if IRCG_API_VERSION < 20021127
-# define IRCG_SHARED_ALLOC(a) malloc((a))
-# define IRCG_SHARED_REALLOC(a,b) realloc((a),(b))
-# define IRCG_SHARED_FREE(a) free((a))
-# else
-
-/* for smart_strs */
-# define realloc(a,b) IRCG_SHARED_REALLOC(a,b)
-# define free(a) IRCG_SHARED_FREE(a)
-
-# include <ircg_alloc.h>
-
-# endif
-
-#endif
diff --git a/ext/ircg/php_ircg_cache.c b/ext/ircg/php_ircg_cache.c
deleted file mode 100644
index f65e34349..000000000
--- a/ext/ircg/php_ircg_cache.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* {{{ cache-related stuff */
-
-#include "php_ircg_private.h"
-#include "php_ircg_alloc.h"
-#include "php_ircg_cache.h"
-
-#include "php_ircg_smart_str.h"
-
-/* This is an expensive operation in terms of CPU time. We
- try to spend as little time in it by caching messages which
- are sent to channels (and hence used multiple times). */
-void ircg_mirc_color(const char *, smart_str *, size_t, int, int);
-
-
-#undef MIN
-#define MIN(a,b) (a<b?a:b)
-
-static inline php_uint32 ghash(smart_str *str, int auto_links, int gen_br)
-{
- php_uint32 h;
- const char *data = str->c, *e = str->c + MIN(3, str->len);
-
- for (h = 2166136261U; data < e; ) {
- h *= 16777619;
- h ^= *data++;
- }
- h *= 16777619;
- h ^= auto_links ? 1 : 2;
- h *= 16777619;
- h ^= gen_br ? 1 : 2;
-
- return h;
-}
-/* }}} */
-
-static int last_ce_write;
-
-#define NR_CACHE_ENTRIES 24
-
-
-/* {{{ ircg_mirc_color_cache */
-void ircg_mirc_color_cache(smart_str *src, smart_str *result,
- smart_str *channel, int auto_links, int gen_br)
-{
- /* We only cache messages in the context of a channel */
- if (channel && php_ircg_cache_entries) {
- int hash;
- int i;
- char mask = (auto_links ? 1 : 0) | (gen_br ? 2 : 0);
- struct cache_entry *ce = php_ircg_cache_entries + last_ce_write;
- struct cache_entry *cee = php_ircg_cache_entries + NR_CACHE_ENTRIES;
-
- hash = ghash(src, auto_links, gen_br);
-
- /* we search forward .. */
- for (i = 0; i < NR_CACHE_ENTRIES; i++) {
- if (ce->h == hash
- && ce->mask == mask
- && ce->src.len == src->len
- && memcmp(ce->src.c, src->c, src->len) == 0) {
- php_ircg->cache_hits++;
- goto found;
- }
- if (++ce >= cee)
- ce = php_ircg_cache_entries;
- }
-
- php_ircg->cache_misses++;
- /* .. and insert in the reverse direction */
-
- if (--last_ce_write < 0)
- last_ce_write = NR_CACHE_ENTRIES - 1;
-
- ce = php_ircg_cache_entries + last_ce_write;
- ce->h = hash;
- ce->mask = mask;
- ce->src.len = 0;
- ce->result.len = 0;
-
- smart_str_append_ex(&ce->src, src, 1);
- smart_str_0(&ce->src);
- ircg_mirc_color(ce->src.c, &ce->result, ce->src.len, auto_links, gen_br);
-
-found:
- smart_str_append_ex(result, &ce->result, 1);
- } else {
- /* No channel message, no caching */
- ircg_mirc_color(src->c, result, src->len, auto_links, gen_br);
- }
-}
-/* }}} */
diff --git a/ext/ircg/php_ircg_cache.h b/ext/ircg/php_ircg_cache.h
deleted file mode 100644
index 4d082055a..000000000
--- a/ext/ircg/php_ircg_cache.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef PHP_IRCG_CACHE_H
-#define PHP_IRCG_CACHE_H
-
-#include "php.h"
-#include "ext/standard/basic_functions.h"
-#include "ircg_smart_str_public.h"
-
-struct cache_entry {
- php_uint32 h;
- char mask;
- smart_str src;
- smart_str result;
-};
-
-extern struct cache_entry *php_ircg_cache_entries;
-extern int php_ircg_last_ce_write;
-
-void ircg_mirc_color_cache(smart_str *src, smart_str *result,
- smart_str *channel, int auto_links, int gen_br);
-
-#endif
diff --git a/ext/ircg/php_ircg_conversion.c b/ext/ircg/php_ircg_conversion.c
deleted file mode 100644
index acee0eb08..000000000
--- a/ext/ircg/php_ircg_conversion.c
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "php_ircg_smart_str.h"
-#include "php_ircg_alloc.h"
-
-/* {{{ Escape functions */
-void php_ircg_js_escape(smart_str *input, smart_str *output)
-{
- char *p;
- char *end;
-
- end = input->c + input->len;
-
- for(p = input->c; p < end; p++) {
- switch (*p) {
- case '"':
- case '\\':
- case '\'':
- smart_str_appendc_ex(output, '\\', 1);
- /* fall-through */
- default:
- smart_str_appendc_ex(output, *p, 1);
- }
- }
-}
-
-static const char hextab[] = "0123456789abcdef";
-
-#define NICKNAME_ESC_CHAR '|'
-
-void php_ircg_nickname_escape(smart_str *input, smart_str *output)
-{
- unsigned char *p;
- unsigned char *end;
- unsigned char c;
-
- p = (unsigned char *) input->c;
- end = p + input->len;
-
- while (p < end) {
- c = *p;
- if ((c >= 'a' && c <= 'z')
- || (c >= 'A' && c <= 'Z')
- || (c >= '0' && c <= '9'))
- smart_str_appendc_ex(output, c, 1);
- else {
- smart_str_appendc_ex(output, NICKNAME_ESC_CHAR, 1);
- smart_str_appendc_ex(output, hextab[c >> 4], 1);
- smart_str_appendc_ex(output, hextab[c & 15], 1);
- }
- p++;
- }
-}
-
-#define HEX_VALUE(c) ((c>='a'&&c<='f')?c-'a'+10:(c>='0'&&c<='9')?c-'0':0)
-
-void php_ircg_nickname_unescape(smart_str *input, smart_str *output)
-{
- char *p;
- char *end;
-
- end = input->c + input->len;
-
- for(p = input->c; p < end; p++) {
- switch (p[0]) {
- case NICKNAME_ESC_CHAR:
- if (p + 2 >= end) break;
- smart_str_appendc_ex(output, (HEX_VALUE(p[1]) << 4) + HEX_VALUE(p[2]), 1);
- p += 2;
- break;
- default:
- smart_str_appendc_ex(output, p[0], 1);
- }
- }
-}
-/* }}} */
diff --git a/ext/ircg/php_ircg_conversion.h b/ext/ircg/php_ircg_conversion.h
deleted file mode 100644
index c5d5beda8..000000000
--- a/ext/ircg/php_ircg_conversion.h
+++ /dev/null
@@ -1,4 +0,0 @@
-void php_ircg_js_escape(smart_str *input, smart_str *output);
-void php_ircg_nickname_escape(smart_str *input, smart_str *output);
-void php_ircg_nickname_unescape(smart_str *input, smart_str *output);
-
diff --git a/ext/ircg/php_ircg_error.c b/ext/ircg/php_ircg_error.c
deleted file mode 100644
index a98c0de06..000000000
--- a/ext/ircg/php_ircg_error.c
+++ /dev/null
@@ -1,106 +0,0 @@
-#include "php_ircg_private.h"
-#include "php_ircg_alloc.h"
-#include "php_ircg_error.h"
-#include "php_ircg_smart_str.h"
-#include <time.h>
-
-/* {{{ Post-connection error-storage */
-
-/*
- * This is an internal API which serves the purpose to store the reason
- * for terminating a connection. The termination will cause the
- * connection id to become invalid. A script can then use a
- * function to retrieve the last error message associated with that id
- * and will usually present a nicely formatted
- * error message to the end-user.
- *
- * We automatically garbage-collect every GC_INTVL seconds, so there is
- * no need for a separate gc thread.
- */
-
-#define GC_INTVL 60
-
-void php_ircg_error_msg_dtor(struct errormsg *m)
-{
- smart_str_free_ex(&m->msg, 1);
- IRCG_SHARED_FREE(m);
-}
-
-void php_ircg_error_msg_gc(time_t now)
-{
- struct errormsg *m, *prev = NULL, *next;
- time_t lim;
-
- IRCG_LOCK_GET(php_ircg->error_msgs_lock);
- lim = now - GC_INTVL;
- php_ircg->next_gc = now + GC_INTVL;
-
- for (m = php_ircg->error_msgs; m; prev = m, m = m->next) {
- if (m->when < lim) {
- struct errormsg *to;
- /* Check whether we have subsequent outdated records */
-
- for (to = m->next; to; to = next) {
- next = to->next;
- if (m->when >= lim) break;
- php_ircg_error_msg_dtor(to);
- }
-
- php_ircg_error_msg_dtor(m);
-
- if (prev)
- prev->next = to;
- else
- php_ircg->error_msgs = to;
-
- if (!to) break;
- m = to;
- }
- }
- IRCG_LOCK_PUT(php_ircg->error_msgs_lock);
-}
-
-void php_ircg_add_error_msg(smart_str *msg, int msgid, int connid)
-{
- struct errormsg *m;
-
- IRCG_LOCK_GET(php_ircg->error_msgs_lock);
- for (m = php_ircg->error_msgs; m; m = m->next) {
- if (m->id == connid) break;
- }
-
- if (!m) {
- m = IRCG_SHARED_ALLOC(sizeof(*m));
- m->msg.c = 0;
- m->id = connid;
- }
-
- m->when = php_ircg_now();
- m->msg.len = 0;
- smart_str_append_ex(&m->msg, msg, 1);
- m->msgid = msgid;
- m->next = php_ircg->error_msgs;
- php_ircg->error_msgs = m;
- IRCG_LOCK_PUT(php_ircg->error_msgs_lock);
-}
-
-struct errormsg *php_ircg_lookup_and_remove_error_msg(int id)
-{
- struct errormsg *m, *prev = NULL;
-
- IRCG_LOCK_GET(php_ircg->error_msgs_lock);
- for (m = php_ircg->error_msgs; m; prev = m, m = m->next) {
- if (m->id == id) {
- if (prev)
- prev->next = m->next;
- else
- php_ircg->error_msgs = m->next;
-
- break;
- }
- }
- IRCG_LOCK_PUT(php_ircg->error_msgs_lock);
- return m;
-}
-/* }}} */
-
diff --git a/ext/ircg/php_ircg_error.h b/ext/ircg/php_ircg_error.h
deleted file mode 100644
index 4f506d979..000000000
--- a/ext/ircg/php_ircg_error.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef PHP_IRCG_ERROR_H
-#define PHP_IRCG_ERROR_H
-
-struct errormsg {
- smart_str msg;
- int msgid;
- int id;
- time_t when;
- struct errormsg *next;
-};
-
-void php_ircg_error_msg_dtor(struct errormsg *m);
-void php_ircg_error_msg_gc(time_t now);
-void php_ircg_add_error_msg(smart_str *msg, int msgid, int connid);
-struct errormsg *php_ircg_lookup_and_remove_error_msg(int id);
-
-#endif
diff --git a/ext/ircg/php_ircg_formats.h b/ext/ircg/php_ircg_formats.h
deleted file mode 100644
index fd77414b8..000000000
--- a/ext/ircg/php_ircg_formats.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* {{{ Format string numbers */
-enum {
- FMT_MSG_CHAN = 0,
- FMT_MSG_PRIV_TO_ME,
- FMT_MSG_PRIV_FROM_ME,
- FMT_MSG_LEAVE,
- FMT_MSG_JOIN,
- FMT_MSG_KICK,
- FMT_MSG_TOPIC,
- FMT_MSG_ERROR,
- FMT_MSG_FATAL_ERROR,
- FMT_MSG_JOIN_LIST_END,
- FMT_MSG_SELF_PART,
- FMT_MSG_NICK,
- FMT_MSG_QUIT,
- FMT_MSG_MASS_JOIN_BEGIN,
- FMT_MSG_MASS_JOIN_ELEMENT,
- FMT_MSG_MASS_JOIN_END,
- FMT_MSG_WHOIS_USER,
- FMT_MSG_WHOIS_SERVER,
- FMT_MSG_WHOIS_IDLE,
- FMT_MSG_WHOIS_CHANNEL,
- FMT_MSG_WHOIS_END,
- FMT_MSG_MODE_VOICE,
- FMT_MSG_MODE_OP,
- FMT_MSG_BANLIST,
- FMT_MSG_BANLIST_END,
- FMT_MSG_DISCONNECTED,
- FMT_MSG_LIST,
- FMT_MSG_LISTEND,
- FMT_MSG_WHOREPLY1,
- FMT_MSG_WHOREPLY2,
- FMT_MSG_ENDOFWHO,
- FMT_MSG_INVITE,
- FMT_MSG_NOTICE_CHAN,
- FMT_MSG_NOTICE_TO_ME,
- FMT_MSG_NOTICE_FROM_ME,
- FMT_MSG_LUSERCLIENT,
- FMT_MSG_LUSEROP,
- FMT_MSG_LUSERUNKNOWN,
- FMT_MSG_LUSERCHANNELS,
- FMT_MSG_LUSERME,
- NO_FMTS
-};
-/* }}} */
-
diff --git a/ext/ircg/php_ircg_hash.h b/ext/ircg/php_ircg_hash.h
deleted file mode 100644
index 278a8a145..000000000
--- a/ext/ircg/php_ircg_hash.h
+++ /dev/null
@@ -1,15 +0,0 @@
-
-typedef HashTable ircg_hash_table;
-#define ircg_hash_index_find zend_hash_index_find
-#define ircg_hash_find zend_hash_find
-#define ircg_hash_index_del zend_hash_index_del
-#define ircg_hash_update zend_hash_update
-#define ircg_hash_internal_pointer_reset_ex zend_hash_internal_pointer_reset_ex
-#define ircg_hash_get_current_key_ex zend_hash_get_current_key_ex
-#define ircg_hash_get_current_data_ex zend_hash_get_current_data_ex
-#define ircg_hash_add zend_hash_add
-#define ircg_hash_move_forward_ex zend_hash_move_forward_ex
-#define ircg_hash_init zend_hash_init
-#define ircg_hash_destroy zend_hash_destroy
-#define ircg_hash_index_update zend_hash_index_update
-#define ircg_hash_index_exists zend_hash_index_exists
diff --git a/ext/ircg/php_ircg_lock.h b/ext/ircg/php_ircg_lock.h
deleted file mode 100644
index 5ce8c6ecc..000000000
--- a/ext/ircg/php_ircg_lock.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#define IRCG_LOCK(name) char dummy_ ## name
-#define IRCG_LOCK_INIT(name) do {} while (0)
-#define IRCG_LOCK_GET(name) do {} while (0)
-#define IRCG_LOCK_PUT(name) do {} while (0)
-#define IRCG_LOCK_DESTROY(name) do {} while (0)
diff --git a/ext/ircg/php_ircg_private.h b/ext/ircg/php_ircg_private.h
deleted file mode 100644
index 617b6b132..000000000
--- a/ext/ircg/php_ircg_private.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef PHP_IRCG_PRIVATE_H
-#define PHP_IRCG_PRIVATE_H
-
-#include "php.h"
-
-#include "if_irc.h"
-#include "irc_write_buffer.h"
-
-#if IRCG_API_VERSION < 20021127
-#define USE_IRCONN_MANAGEMENT
-#define USE_FD2IRCONN
-
-#define ircg_fetch_area(name, ptr, size, fn) do { *(ptr) = IRCG_SHARED_ALLOC((size)); memset(*(ptr), 0, (size)); (fn)(*(ptr)); } while (0)
-
-/* provide dummy definitions */
-#include "php_ircg_hash.h"
-#include "php_ircg_lock.h"
-
-#else
-#include <ircg_resource.h>
-#include <ircg_hash.h>
-#include <ircg_lock.h>
-#endif
-
-#include "php_ircg_error.h"
-
-#include "php_ircg_tokenizer.h"
-#include "php_ircg_formats.h"
-
-typedef struct {
- int rc; /* how many connections reference this struct */
- int dead;
- format_msg_t *fmt_msgs[NO_FMTS];
-} php_fmt_msgs_t;
-
-struct php_ircg_global {
-
- php_fmt_msgs_t **fmt_msgs;
- ircg_hash_table h_fmt_msgs;
- IRCG_LOCK(fmt_msgs_lock);
-
- /* these just serve statistical/entertainment purposes */
- unsigned long irc_connects, irc_set_currents, irc_quit_handlers,
- exec_fmt_msgs, exec_token_compiler,
- irc_wbuf_destructs, failed_set_currents, max_concurrency;
-
- unsigned long fmt_sets_exist, fmt_sets_evicted, fmt_sets_updates,
- fmt_sets_ignored, fmt_sets_created, fmt_sets_destroyed;
- unsigned long cache_hits, cache_misses;
- int highest_fd;
-
- time_t next_gc;
-
- struct errormsg *error_msgs;
- IRCG_LOCK(error_msgs_lock);
-
- php_fmt_msgs_t fmt_msgs_default_compiled;
-
- int is_fastcgi;
-};
-
-extern struct php_ircg_global *php_ircg;
-
-time_t php_ircg_now(void);
-
-int php_ircg_get_target_data(uid_t *uid, gid_t *gid TSRMLS_DC);
-
-#endif
diff --git a/ext/ircg/php_ircg_smart_str.h b/ext/ircg/php_ircg_smart_str.h
deleted file mode 100644
index ec35a7bf8..000000000
--- a/ext/ircg/php_ircg_smart_str.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef PHP_IRCG_SMART_STR_H
-#define PHP_IRCG_SMART_STR_H
-
-#include "ircg_smart_str.h"
-
-#define smart_str_free_ex(a,b) smart_str_free((a))
-#define smart_str_appendl_ex(a,b,c,d) smart_str_appendl((a),(b),(c))
-#define smart_str_appendc_ex(a,b,c) smart_str_appendc((a),(b))
-#define smart_str_append_ex(a,b,c) smart_str_append((a),(b))
-#define smart_str_appends_ex(a,b,c) smart_str_appends((a),(b))
-
-#endif
diff --git a/ext/ircg/php_ircg_tokenizer.c b/ext/ircg/php_ircg_tokenizer.c
deleted file mode 100644
index a226e2d49..000000000
--- a/ext/ircg/php_ircg_tokenizer.c
+++ /dev/null
@@ -1,228 +0,0 @@
-#define SMART_STR_PREALLOC 4
-
-#include "php_ircg_private.h"
-#include "php_ircg_alloc.h"
-#include "php_ircg_conversion.h"
-#include "php_ircg_smart_str.h"
-
-/* {{{ token_compiler */
-
-#include "php_ircg_tokenizer.h"
-
-#include "php_ircg_alloc.h"
-
-#define NEW_TOKEN(a, b) \
- if (n + 1 >= alloced) { \
- alloced += 10; \
- f = IRCG_SHARED_REALLOC(f, sizeof *f + alloced * sizeof(token_t)); \
- *fp = f; \
- } \
- f->t[n].code=a; \
- f->t[n++].para.b
-
-
-#define HANDLE_VERBATIM_STRING() \
- if (len <= INLINE_STRING_LEN) { \
- struct inline_string is; \
- \
- is.buf_len = len; \
- memcpy(is.buf, p, len); \
- NEW_TOKEN(C_STRING_INLINE, is) = is; \
- } else { \
- s.c = 0; \
- smart_str_appendl_ex(&s, p, len, 1); \
- NEW_TOKEN(C_STRING, s) = s; \
- }
-
-
-
-void php_ircg_token_compiler(const char *fmt, size_t fmtlen, format_msg_t **fp)
-{
- const char *p, *pe;
- const char *q;
- int n = 0;
- int alloced = 0;
- char mode;
- unsigned long len;
- char c;
- smart_str s;
- format_msg_t *f = *fp;
-
- php_ircg->exec_token_compiler++;
-
- if (fmt[0] == '\0') {
- *fp = NULL;
- return;
- }
-
- p = fmt;
- pe = fmt + fmtlen;
-
- do {
- q = p;
- while (*q != '%')
- if (++q >= pe) {
- len = pe - p;
- HANDLE_VERBATIM_STRING();
- goto leave_loop;
- }
- len = q - p;
-
- if (len > 0) {
- HANDLE_VERBATIM_STRING();
- }
- mode = 0;
-
-next:
- c = *++q; /* skip '%' and look at next char */
- switch (c) {
- case '1': mode |= P_JS; goto next;
- case '2': mode |= P_NICKNAME; goto next;
- case '3': mode |= P_NOAUTO_LINKS; goto next;
- case '4': mode |= P_CONV_BR; goto next;
- case '5': mode |= P_COND_STOP; goto next;
- case '6': mode |= P_HTML; goto next;
-
- /* associate mode bits with each command where applicable */
- case 'c': NEW_TOKEN(C_CHANNEL, v) = mode; break;
- case 'd': NEW_TOKEN(C_TERMINATE_1, v) = mode; break;
- case 't': NEW_TOKEN(C_TO, v) = mode; break;
- case 'f': NEW_TOKEN(C_FROM, v) = mode; break;
- case 'r': NEW_TOKEN(C_MESSAGE, v) = mode; break;
- case 'm': NEW_TOKEN(C_MESSAGE, v) = mode | P_HTML; break;
- case 'j': NEW_TOKEN(C_MESSAGE, v) = mode | P_HTML | P_JS; break;
-
- case '%': NEW_TOKEN(C_PERCENT, v) = 0; break;
-
- default: /* ignore invalid combinations */
- break;
- }
- p = q + 1; /* skip last format character */
- } while (p < pe);
-
-leave_loop:
-
- f->ntoken = n;
-}
-/* }}} */
-
-/* {{{ format_msg */
-void php_ircg_format_msg(const format_msg_t *fmt_msg, smart_str *channel,
- smart_str *to, smart_str *from, smart_str *msg, smart_str *result,
- const char *username, int username_len, int *status)
-{
- int i = 0;
- const token_t *t;
- int ntoken;
- smart_str tmp = {0};
-
- if (!fmt_msg) return;
-
- ntoken = fmt_msg->ntoken;
- t = fmt_msg->t;
-
-#define IRCG_APPEND(what, use_cache) \
- if (t[i].para.v & P_COND_STOP) { \
- if (username_len != what->len || memcmp(what->c, username, username_len) != 0) \
- goto stop; \
- continue; \
- } \
- switch (t[i].para.v & 7) { \
- case P_JS: \
- if (!what) break; \
- php_ircg_js_escape(what, result); \
- break; \
- case P_NICKNAME_JS: { \
- smart_str tmp = {0}; \
- if (!what) break; \
- php_ircg_nickname_unescape(what, &tmp); \
- php_ircg_js_escape(&tmp, result); \
- smart_str_free_ex(&tmp, 1); \
- break; \
- } \
- case P_NICKNAME: \
- if (!what) break; \
- php_ircg_nickname_unescape(what, result); \
- break; \
- case P_RAW: \
- if (!what) break; \
- smart_str_append_ex(result, what, 1); \
- break; \
- case P_HTML_JS: \
- if (!what) break; \
- if (use_cache) { \
- ircg_mirc_color_cache(msg, \
- &tmp, channel, \
- !(t[i].para.v & P_NOAUTO_LINKS), \
- t[i].para.v & P_CONV_BR); \
- } else { \
- ircg_mirc_color(what->c, &tmp, \
- what->len, \
- !(t[i].para.v & P_NOAUTO_LINKS), \
- t[i].para.v & P_CONV_BR); \
- } \
- php_ircg_js_escape(&tmp, result); \
- smart_str_free(&tmp); \
- break; \
- case P_HTML: \
- if (!what) break; \
- if (use_cache) { \
- ircg_mirc_color_cache(msg, \
- result, channel, \
- !(t[i].para.v & P_NOAUTO_LINKS), \
- t[i].para.v & P_CONV_BR); \
- } else { \
- ircg_mirc_color(what->c, result, \
- what->len, \
- !(t[i].para.v & P_NOAUTO_LINKS), \
- t[i].para.v & P_CONV_BR); \
- } \
- break; \
- }
-
- for (; ntoken-- > 0; i++) {
- switch (t[i].code) {
- case C_STRING_INLINE: smart_str_appendl_ex(result, t[i].para.is.buf,
- t[i].para.is.buf_len, 1); break;
- case C_STRING: smart_str_append_ex(result, &t[i].para.s, 1); break;
- case C_FROM: IRCG_APPEND(from, 0); break;
- case C_TO: IRCG_APPEND(to, 0); break;
- case C_CHANNEL: IRCG_APPEND(channel, 0); break;
- case C_MESSAGE: IRCG_APPEND(msg, 1); break;
- case C_PERCENT: smart_str_appendc_ex(result, '%', 1); break;
- case C_TERMINATE_1: /* auth by username */
- if (ntoken > 0 && t[i+1].code == C_STRING) {
- if (t[i+1].para.s.len == from->len
- && strncasecmp(t[i+1].para.s.c, from->c, from->len) == 0)
- *status = 1;
- } else
- *status = 1;
- }
- }
-
-stop:
-
- if (result->c)
- smart_str_0(result);
- php_ircg->exec_fmt_msgs++;
-}
-
-
-void php_ircg_free_fmt_msg(format_msg_t *f)
-{
- int i = 0;
-
- while (f->ntoken-- > 0) {
- switch (f->t[i].code) {
- case C_STRING:
- smart_str_free_ex(&f->t[i].para.s, 1);
- break;
- }
- i++;
- }
- IRCG_SHARED_FREE(f);
-}
-
-/* }}} */
-
-
diff --git a/ext/ircg/php_ircg_tokenizer.h b/ext/ircg/php_ircg_tokenizer.h
deleted file mode 100644
index 1af5916f9..000000000
--- a/ext/ircg/php_ircg_tokenizer.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef PHP_IRCG_TOKENIZER_H
-#define PHP_IRCG_TOKENIZER_H
-
-#include "ircg_smart_str_public.h"
-
-#define INLINE_STRING_LEN 15
-
-struct inline_string {
- char buf_len;
- char buf[INLINE_STRING_LEN];
-};
-
-typedef struct {
- unsigned char code;
- union {
- unsigned char v;
- void *ptr;
- smart_str s;
- struct inline_string is;
- } para;
-} token_t;
-
-typedef struct format_msg {
- int ntoken;
- token_t t[1];
-} format_msg_t;
-
-enum {
- C_CHANNEL = 1,
- C_FROM,
- C_TO,
- C_MESSAGE,
- C_STRING,
- C_STRING_INLINE,
- C_PERCENT,
- C_TERMINATE_1 /* auth by username */
-};
-
-enum {
- P_RAW = 0,
- P_JS = 1,
- P_NICKNAME = 2,
- P_NICKNAME_JS = 3,
- P_HTML = 4,
- P_HTML_JS = 5,
- P_NOAUTO_LINKS = 8, /* Don't automatically convert links */
- P_CONV_BR = 16, /* Convert a special character to <br> */
- P_COND_STOP = 32, /* If argument != username, stop */
-};
-
-#define NR_CACHE_ENTRIES 24
-
-void php_ircg_token_compiler(const char *fmt, size_t len, format_msg_t **fp);
-void php_ircg_format_msg(const format_msg_t *fmt_msg, smart_str *channel,
- smart_str *to, smart_str *from, smart_str *msg, smart_str *result,
- const char *username, int username_len, int *status);
-void php_ircg_fmt_msgs_dtor(void *dummy);
-void php_ircg_free_fmt_msg(format_msg_t *f);
-
-
-#endif
diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4
index d041a14d5..61d04f4da 100644
--- a/ext/ldap/config.m4
+++ b/ext/ldap/config.m4
@@ -1,20 +1,20 @@
dnl
-dnl $Id: config.m4,v 1.34.2.3 2005/05/08 15:59:18 sniper Exp $
+dnl $Id: config.m4,v 1.39.2.6 2005/11/21 19:06:04 sniper Exp $
dnl
AC_DEFUN([PHP_LDAP_CHECKS], [
if test -f $1/include/ldap.h; then
LDAP_DIR=$1
LDAP_INCDIR=$1/include
- LDAP_LIBDIR=$1/lib
+ LDAP_LIBDIR=$1/$PHP_LIBDIR
elif test -f $1/include/umich-ldap/ldap.h; then
LDAP_DIR=$1
LDAP_INCDIR=$1/include/umich-ldap
- LDAP_LIBDIR=$1/lib
+ LDAP_LIBDIR=$1/$PHP_LIBDIR
elif test -f $1/ldap/public/ldap.h; then
LDAP_DIR=$1
LDAP_INCDIR=$1/ldap/public
- LDAP_LIBDIR=$1/lib
+ LDAP_LIBDIR=$1/$PHP_LIBDIR
fi
])
@@ -39,7 +39,7 @@ AC_DEFUN([PHP_LDAP_SASL_CHECKS], [
if test "$LDAP_SASL_DIR"; then
LDAP_SASL_INCDIR=$LDAP_SASL_DIR/include
- LDAP_SASL_LIBDIR=$LDAP_SASL_DIR/lib
+ LDAP_SASL_LIBDIR=$LDAP_SASL_DIR/$PHP_LIBDIR
else
AC_MSG_ERROR([sasl.h not found!])
fi
@@ -63,10 +63,10 @@ AC_DEFUN([PHP_LDAP_SASL_CHECKS], [
])
PHP_ARG_WITH(ldap,for LDAP support,
-[ --with-ldap[=DIR] Include LDAP support.])
+[ --with-ldap[=DIR] Include LDAP support])
PHP_ARG_WITH(ldap-sasl,for LDAP Cyrus SASL support,
-[ --with-ldap-sasl[=DIR] LDAP: Include Cyrus SASL support.], no, no)
+[ --with-ldap-sasl[=DIR] LDAP: Include Cyrus SASL support], no, no)
if test "$PHP_LDAP" != "no"; then
@@ -95,11 +95,11 @@ if test "$PHP_LDAP" != "no"; then
LDAP_PTHREAD=
fi
- if test -f $LDAP_LIBDIR/liblber.a -o -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME; then
+ if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME; then
PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
- elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 -o -f $LDAP_LIBDIR/libldap.3.dylib; then
+ elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 || test -f $LDAP_LIBDIR/libldap.3.dylib; then
PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME; then
@@ -156,23 +156,24 @@ if test "$PHP_LDAP" != "no"; then
PHP_ADD_INCLUDE($LDAP_INCDIR)
PHP_SUBST(LDAP_SHARED_LIBADD)
AC_DEFINE(HAVE_LDAP,1,[ ])
-
- dnl Check for 3 arg ldap_set_rebind_proc
+
+ dnl Save original values
_SAVE_CPPFLAGS=$CPPFLAGS
_SAVE_LDFLAGS=$LDFLAGS
CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR"
+ LDFLAGS="$LDFLAGS $LDAP_SHARED_LIBADD"
+
+ dnl Check for 3 arg ldap_set_rebind_proc
AC_CACHE_CHECK([for 3 arg ldap_set_rebind_proc], ac_cv_3arg_setrebindproc,
[AC_TRY_COMPILE([#include <ldap.h>], [ldap_set_rebind_proc(0,0,0)],
ac_cv_3arg_setrebindproc=yes, ac_cv_3arg_setrebindproc=no)])
if test "$ac_cv_3arg_setrebindproc" = yes; then
AC_DEFINE(HAVE_3ARG_SETREBINDPROC,1,[Whether 3 arg set_rebind_proc()])
fi
- CPPFLAGS=$_SAVE_CPPFLAGS
dnl Solaris 2.8 claims to be 2004 API, but doesn't have
dnl ldap_parse_reference() nor ldap_start_tls_s()
AC_CHECK_FUNCS([ldap_parse_result ldap_parse_reference ldap_start_tls_s])
- LDFLAGS=$_SAVE_LDFLAGS
dnl
dnl SASL check
@@ -184,10 +185,11 @@ if test "$PHP_LDAP" != "no"; then
dnl
dnl Sanity check
dnl
- _SAVE_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS $LDAP_SHARED_LIBADD"
AC_CHECK_FUNC(ldap_bind_s, [], [
AC_MSG_ERROR([LDAP build check failed. Please check config.log for more information.])
])
+
+ dnl Restore original values
+ CPPFLAGS=$_SAVE_CPPFLAGS
LDFLAGS=$_SAVE_LDFLAGS
fi
diff --git a/ext/ldap/config.w32 b/ext/ldap/config.w32
index 8b3e9e5ca..e97481771 100644
--- a/ext/ldap/config.w32
+++ b/ext/ldap/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1.2.2 2005/04/17 16:26:30 sniper Exp $
+// $Id: config.w32,v 1.2 2004/10/23 23:03:52 hholzgra Exp $
// vim:ft=javascript
ARG_WITH("ldap", "LDAP support", "no");
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 54b61cb12..fed8557b6 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -22,7 +22,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ldap.c,v 1.154.2.7 2005/07/09 01:00:11 sniper Exp $ */
+/* $Id: ldap.c,v 1.161 2005/08/03 14:07:22 sniper Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
@@ -30,7 +30,7 @@
#endif
/* Additional headers for NetWare */
-#if defined(NETWARE)
+#if defined(NETWARE) && (NEW_LIBC)
#include <sys/select.h>
#include <sys/timeval.h>
#endif
@@ -314,7 +314,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.154.2.7 2005/07/09 01:00:11 sniper Exp $");
+ php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.161 2005/08/03 14:07:22 sniper Exp $");
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
diff --git a/ext/ldap/php_ldap.h b/ext/ldap/php_ldap.h
index d06209370..c4dea3d23 100644
--- a/ext/ldap/php_ldap.h
+++ b/ext/ldap/php_ldap.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ldap.h,v 1.30.2.1 2005/05/08 15:44:15 sniper Exp $ */
+/* $Id: php_ldap.h,v 1.32 2005/08/03 14:07:23 sniper Exp $ */
#ifndef PHP_LDAP_H
#define PHP_LDAP_H
diff --git a/ext/libxml/config.w32 b/ext/libxml/config.w32
index f8eb24cb4..963960364 100644
--- a/ext/libxml/config.w32
+++ b/ext/libxml/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.6.2.3 2004/08/04 19:22:12 fmk Exp $
+// $Id: config.w32,v 1.8 2005/02/25 22:59:26 fmk Exp $
// vim:ft=javascript
ARG_WITH("libxml", "LibXML support", "yes");
@@ -10,7 +10,6 @@ if (PHP_LIBXML == "yes") {
EXTENSION("libxml", "libxml.c", false /* never shared */);
AC_DEFINE("HAVE_LIBXML", 1, "LibXML support");
- ADD_FLAG("CFLAGS", "/D LIBXML_THREAD_ENABLED");
ADD_FLAG("CFLAGS_LIBXML", "/D LIBXML_STATIC ");
if (!PHP_LIBXML_SHARED) {
ADD_DEF_FILE("ext\\libxml\\php_libxml2.def");
diff --git a/ext/libxml/config0.m4 b/ext/libxml/config0.m4
index 58bd8ec75..b3f3c7944 100644
--- a/ext/libxml/config0.m4
+++ b/ext/libxml/config0.m4
@@ -1,13 +1,13 @@
dnl
-dnl $Id: config0.m4,v 1.1 2003/11/12 23:42:38 sniper Exp $
+dnl $Id: config0.m4,v 1.3 2005/05/29 23:16:41 sniper Exp $
dnl
PHP_ARG_ENABLE(libxml, whether to enable LIBXML support,
-[ --disable-libxml Disable new LIBXML support.], yes)
+[ --disable-libxml Disable new LIBXML support], yes)
if test -z "$PHP_LIBXML_DIR"; then
PHP_ARG_WITH(libxml-dir, libxml2 install dir,
- [ --with-libxml-dir[=DIR] libxml2 install prefix.], no, no)
+ [ --with-libxml-dir[=DIR] libxml2 install prefix], no, no)
fi
if test "$PHP_LIBXML" != "no"; then
@@ -18,6 +18,7 @@ if test "$PHP_LIBXML" != "no"; then
PHP_SETUP_LIBXML(LIBXML_SHARED_LIBADD, [
AC_DEFINE(HAVE_LIBXML,1,[ ])
PHP_NEW_EXTENSION(libxml, [libxml.c], $ext_shared)
+ PHP_INSTALL_HEADERS([ext/libxml/php_libxml.h])
], [
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
])
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index d33c67c2e..2d57931a1 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: libxml.c,v 1.18.2.6 2005/01/02 12:09:09 rrichards Exp $ */
+/* $Id: libxml.c,v 1.32.2.5 2005/11/17 21:56:04 rasmus Exp $ */
#define IS_EXT_MODULE
@@ -40,6 +40,7 @@
#include <libxml/tree.h>
#include <libxml/uri.h>
#include <libxml/xmlerror.h>
+#include <libxml/xmlsave.h>
#ifdef LIBXML_SCHEMAS_ENABLED
#include <libxml/relaxng.h>
#endif
@@ -65,6 +66,8 @@ int libxml_globals_id;
PHP_LIBXML_API php_libxml_globals libxml_globals;
#endif
+zend_class_entry *libxmlerror_class_entry;
+
/* {{{ dynamically loadable module stuff */
#ifdef COMPILE_DL_LIBXML
ZEND_GET_MODULE(libxml)
@@ -86,6 +89,10 @@ PHP_MINFO_FUNCTION(libxml);
/* {{{ extension definition structures */
function_entry libxml_functions[] = {
PHP_FE(libxml_set_streams_context, NULL)
+ PHP_FE(libxml_use_internal_errors, NULL)
+ PHP_FE(libxml_get_last_error, NULL)
+ PHP_FE(libxml_clear_errors, NULL)
+ PHP_FE(libxml_get_errors, NULL)
{NULL, NULL, NULL}
};
@@ -235,30 +242,13 @@ static void php_libxml_init_globals(php_libxml_globals *libxml_globals_p TSRMLS_
{
LIBXML(stream_context) = NULL;
LIBXML(error_buffer).c = NULL;
+ LIBXML(error_list) = NULL;
}
#endif
/* Channel libxml file io layer through the PHP streams subsystem.
* This allows use of ftps:// and https:// urls */
-int php_libxml_streams_IO_match_wrapper(const char *filename)
-{
- char *resolved_path;
- int retval;
-
- TSRMLS_FETCH();
-
- if (zend_is_executing(TSRMLS_C)) {
- resolved_path = xmlURIUnescapeString(filename, 0, NULL);
- retval = php_stream_locate_url_wrapper(resolved_path, NULL, 0 TSRMLS_CC) ? 1 : 0;
- if (resolved_path) {
- xmlFree(resolved_path);
- }
- return retval;
- }
- return 0;
-}
-
void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode, const int read_only)
{
php_stream_statbuf ssbuf;
@@ -266,9 +256,22 @@ void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode,
php_stream_wrapper *wrapper = NULL;
char *resolved_path, *path_to_open = NULL;
void *ret_val = NULL;
+ int isescaped=0;
+ xmlURI *uri;
TSRMLS_FETCH();
- resolved_path = xmlURIUnescapeString(filename, 0, NULL);
+
+ uri = xmlParseURI((xmlChar *)filename);
+ if (uri && (uri->scheme == NULL || (xmlStrncmp(uri->scheme, "file", 4) == 0))) {
+ resolved_path = xmlURIUnescapeString(filename, 0, NULL);
+ isescaped = 1;
+ } else {
+ resolved_path = (char *)filename;
+ }
+
+ if (uri) {
+ xmlFreeURI(uri);
+ }
if (resolved_path == NULL) {
return NULL;
@@ -283,7 +286,9 @@ void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode,
wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, ENFORCE_SAFE_MODE TSRMLS_CC);
if (wrapper && read_only && wrapper->wops->url_stat) {
if (wrapper->wops->url_stat(wrapper, path_to_open, PHP_STREAM_URL_STAT_QUIET, &ssbuf, NULL TSRMLS_CC) == -1) {
- xmlFree(resolved_path);
+ if (isescaped) {
+ xmlFree(resolved_path);
+ }
return NULL;
}
}
@@ -293,7 +298,9 @@ void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode,
}
ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, context);
- xmlFree(resolved_path);
+ if (isescaped) {
+ xmlFree(resolved_path);
+ }
return ret_val;
}
@@ -325,6 +332,117 @@ int php_libxml_streams_IO_close(void *context)
return php_stream_close((php_stream*)context);
}
+xmlParserInputBufferPtr
+php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
+{
+ xmlParserInputBufferPtr ret;
+ void *context = NULL;
+
+ if (URI == NULL)
+ return(NULL);
+
+ context = php_libxml_streams_IO_open_read_wrapper(URI);
+
+ if (context == NULL) {
+ return(NULL);
+ }
+
+ /* Allocate the Input buffer front-end. */
+ ret = xmlAllocParserInputBuffer(enc);
+ if (ret != NULL) {
+ ret->context = context;
+ ret->readcallback = php_libxml_streams_IO_read;
+ ret->closecallback = php_libxml_streams_IO_close;
+ } else
+ php_libxml_streams_IO_close(context);
+
+ return(ret);
+}
+
+xmlOutputBufferPtr
+php_libxml_output_buffer_create_filename(const char *URI,
+ xmlCharEncodingHandlerPtr encoder,
+ int compression ATTRIBUTE_UNUSED)
+{
+ xmlOutputBufferPtr ret;
+ xmlURIPtr puri;
+ void *context = NULL;
+ char *unescaped = NULL;
+
+ if (URI == NULL)
+ return(NULL);
+
+ puri = xmlParseURI(URI);
+ if (puri != NULL) {
+ if (puri->scheme != NULL)
+ unescaped = xmlURIUnescapeString(URI, 0, NULL);
+ xmlFreeURI(puri);
+ }
+
+ if (unescaped != NULL) {
+ context = php_libxml_streams_IO_open_write_wrapper(unescaped);
+ xmlFree(unescaped);
+ }
+
+ /* try with a non-escaped URI this may be a strange filename */
+ if (context == NULL) {
+ context = php_libxml_streams_IO_open_write_wrapper(URI);
+ }
+
+ if (context == NULL) {
+ return(NULL);
+ }
+
+ /* Allocate the Output buffer front-end. */
+ ret = xmlAllocOutputBuffer(encoder);
+ if (ret != NULL) {
+ ret->context = context;
+ ret->writecallback = php_libxml_streams_IO_write;
+ ret->closecallback = php_libxml_streams_IO_close;
+ }
+
+ return(ret);
+}
+
+static int _php_libxml_free_error(xmlErrorPtr error) {
+ /* This will free the libxml alloc'd memory */
+ xmlResetError(error);
+ return 1;
+}
+
+static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
+{
+ xmlError error_copy;
+ int ret;
+
+ TSRMLS_FETCH();
+
+ memset(&error_copy, 0, sizeof(xmlError));
+
+ if (error) {
+ ret = xmlCopyError(error, &error_copy);
+ } else {
+ error_copy.domain = 0;
+ error_copy.code = XML_ERR_INTERNAL_ERROR;
+ error_copy.level = XML_ERR_ERROR;
+ error_copy.line = 0;
+ error_copy.node = NULL;
+ error_copy.int1 = 0;
+ error_copy.int2 = 0;
+ error_copy.ctxt = NULL;
+ error_copy.message = xmlStrdup(msg);
+ error_copy.file = NULL;
+ error_copy.str1 = NULL;
+ error_copy.str2 = NULL;
+ error_copy.str3 = NULL;
+ ret = 0;
+ }
+
+ if (ret == 0) {
+ zend_llist_add_element(LIBXML(error_list), &error_copy);
+ }
+}
+
static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg TSRMLS_DC)
{
xmlParserCtxtPtr parser;
@@ -340,6 +458,15 @@ static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg TSR
}
}
+void php_libxml_issue_error(int level, const char *msg TSRMLS_DC)
+{
+ if (LIBXML(error_list)) {
+ _php_list_set_error_structure(NULL, msg);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, level, "%s", msg);
+ }
+}
+
static void php_libxml_internal_error_handler(int error_type, void *ctx, const char **msg, va_list ap)
{
char *buf;
@@ -361,15 +488,19 @@ static void php_libxml_internal_error_handler(int error_type, void *ctx, const c
efree(buf);
if (output == 1) {
- switch (error_type) {
- case PHP_LIBXML_CTX_ERROR:
- php_libxml_ctx_error_level(E_WARNING, ctx, LIBXML(error_buffer).c TSRMLS_CC);
- break;
- case PHP_LIBXML_CTX_WARNING:
- php_libxml_ctx_error_level(E_NOTICE, ctx, LIBXML(error_buffer).c TSRMLS_CC);
- break;
- default:
- php_error(E_WARNING, "%s", LIBXML(error_buffer).c);
+ if (LIBXML(error_list)) {
+ _php_list_set_error_structure(NULL, LIBXML(error_buffer).c);
+ } else {
+ switch (error_type) {
+ case PHP_LIBXML_CTX_ERROR:
+ php_libxml_ctx_error_level(E_WARNING, ctx, LIBXML(error_buffer).c TSRMLS_CC);
+ break;
+ case PHP_LIBXML_CTX_WARNING:
+ php_libxml_ctx_error_level(E_NOTICE, ctx, LIBXML(error_buffer).c TSRMLS_CC);
+ break;
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", LIBXML(error_buffer).c);
+ }
}
smart_str_free(&LIBXML(error_buffer));
}
@@ -391,6 +522,13 @@ void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
va_end(args);
}
+PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
+{
+ _php_list_set_error_structure(error, NULL);
+
+ return;
+}
+
PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...)
{
va_list args;
@@ -405,22 +543,6 @@ PHP_LIBXML_API void php_libxml_initialize() {
/* we should be the only one's to ever init!! */
xmlInitParser();
- /* Enable php stream/wrapper support for libxml
- we only use php streams, so we do not enable
- the default io handlers in libxml.
- */
- xmlRegisterInputCallbacks(
- php_libxml_streams_IO_match_wrapper,
- php_libxml_streams_IO_open_read_wrapper,
- php_libxml_streams_IO_read,
- php_libxml_streams_IO_close);
-
- xmlRegisterOutputCallbacks(
- php_libxml_streams_IO_match_wrapper,
- php_libxml_streams_IO_open_write_wrapper,
- php_libxml_streams_IO_write,
- php_libxml_streams_IO_close);
-
zend_hash_init(&php_libxml_exports, 0, NULL, NULL, 1);
_php_libxml_initialized = 1;
@@ -449,6 +571,8 @@ PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC) {
PHP_MINIT_FUNCTION(libxml)
{
+ zend_class_entry ce;
+
php_libxml_initialize();
#ifdef ZTS
@@ -456,7 +580,38 @@ PHP_MINIT_FUNCTION(libxml)
#else
LIBXML(stream_context) = NULL;
LIBXML(error_buffer).c = NULL;
+ LIBXML(error_list) = NULL;
+#endif
+
+ REGISTER_LONG_CONSTANT("LIBXML_VERSION", LIBXML_VERSION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("LIBXML_DOTTED_VERSION", LIBXML_DOTTED_VERSION, CONST_CS | CONST_PERSISTENT);
+
+ /* For use with loading xml */
+ REGISTER_LONG_CONSTANT("LIBXML_NOENT", XML_PARSE_NOENT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_DTDLOAD", XML_PARSE_DTDLOAD, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_DTDATTR", XML_PARSE_DTDATTR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_DTDVALID", XML_PARSE_DTDVALID, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_NOERROR", XML_PARSE_NOERROR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_NOWARNING", XML_PARSE_NOWARNING, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_NOBLANKS", XML_PARSE_NOBLANKS, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_XINCLUDE", XML_PARSE_XINCLUDE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_NSCLEAN", XML_PARSE_NSCLEAN, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_NOCDATA", XML_PARSE_NOCDATA, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_NONET", XML_PARSE_NONET, CONST_CS | CONST_PERSISTENT);
+#if LIBXML_VERSION >= 20621
+ REGISTER_LONG_CONSTANT("LIBXML_COMPACT", XML_PARSE_COMPACT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_NOXMLDECL", XML_SAVE_NO_DECL, CONST_CS | CONST_PERSISTENT);
#endif
+ REGISTER_LONG_CONSTANT("LIBXML_NOEMPTYTAG", LIBXML_SAVE_NOEMPTYTAG, CONST_CS | CONST_PERSISTENT);
+
+ /* Error levels */
+ REGISTER_LONG_CONSTANT("LIBXML_ERR_NONE", XML_ERR_NONE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_ERR_WARNING", XML_ERR_WARNING, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_ERR_ERROR", XML_ERR_ERROR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LIBXML_ERR_FATAL", XML_ERR_FATAL, CONST_CS | CONST_PERSISTENT);
+
+ INIT_CLASS_ENTRY(ce, "LibXMLError", NULL);
+ libxmlerror_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
return SUCCESS;
}
@@ -466,7 +621,8 @@ PHP_RINIT_FUNCTION(libxml)
{
/* report errors via handler rather than stderr */
xmlSetGenericErrorFunc(NULL, php_libxml_error_handler);
-
+ xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename);
+ xmlOutputBufferCreateFilenameDefault(php_libxml_output_buffer_create_filename);
return SUCCESS;
}
@@ -483,8 +639,18 @@ PHP_RSHUTDOWN_FUNCTION(libxml)
{
/* reset libxml generic error handling */
xmlSetGenericErrorFunc(NULL, NULL);
+ xmlSetStructuredErrorFunc(NULL, NULL);
+
+ xmlParserInputBufferCreateFilenameDefault(NULL);
+ xmlOutputBufferCreateFilenameDefault(NULL);
smart_str_free(&LIBXML(error_buffer));
+ if (LIBXML(error_list)) {
+ zend_llist_destroy(LIBXML(error_list));
+ efree(LIBXML(error_list));
+ LIBXML(error_list) = NULL;
+ }
+
return SUCCESS;
}
@@ -499,7 +665,6 @@ PHP_MINFO_FUNCTION(libxml)
}
/* }}} */
-
/* {{{ proto void libxml_set_streams_context(resource streams_context)
Set the streams context for the next libxml document load or write */
PHP_FUNCTION(libxml_set_streams_context)
@@ -518,6 +683,129 @@ PHP_FUNCTION(libxml_set_streams_context)
}
/* }}} */
+/* {{{ proto void libxml_use_internal_errors(boolean use_errors)
+ Disable libxml errors and allow user to fetch error information as needed */
+PHP_FUNCTION(libxml_use_internal_errors)
+{
+ xmlStructuredErrorFunc current_handler;
+ int use_errors=0, retval;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &use_errors) == FAILURE) {
+ return;
+ }
+
+ current_handler = xmlStructuredError;
+ if (current_handler && current_handler == php_libxml_structured_error_handler) {
+ retval = 1;
+ } else {
+ retval = 0;
+ }
+
+ if (ZEND_NUM_ARGS() == 0) {
+ RETURN_BOOL(retval);
+ }
+
+ if (use_errors == 0) {
+ xmlSetStructuredErrorFunc(NULL, NULL);
+ if (LIBXML(error_list)) {
+ zend_llist_destroy(LIBXML(error_list));
+ efree(LIBXML(error_list));
+ LIBXML(error_list) = NULL;
+ }
+ } else {
+ xmlSetStructuredErrorFunc(NULL, php_libxml_structured_error_handler);
+ if (LIBXML(error_list) == NULL) {
+ LIBXML(error_list) = (zend_llist *) emalloc(sizeof(zend_llist));
+ zend_llist_init(LIBXML(error_list), sizeof(xmlError), (llist_dtor_func_t) _php_libxml_free_error, 0);
+ }
+ }
+ RETURN_BOOL(retval);
+}
+/* }}} */
+
+/* {{{ proto object libxml_get_last_error()
+ Retrieve last error from libxml */
+PHP_FUNCTION(libxml_get_last_error)
+{
+ xmlErrorPtr error;
+
+ error = xmlGetLastError();
+
+ if (error) {
+ object_init_ex(return_value, libxmlerror_class_entry);
+ add_property_long(return_value, "level", error->level);
+ add_property_long(return_value, "code", error->code);
+ add_property_long(return_value, "column", error->int2);
+ if (error->message) {
+ add_property_string(return_value, "message", error->message, 1);
+ } else {
+ add_property_stringl(return_value, "message", "", 0, 1);
+ }
+ if (error->file) {
+ add_property_string(return_value, "file", error->file, 1);
+ } else {
+ add_property_stringl(return_value, "file", "", 0, 1);
+ }
+ add_property_long(return_value, "line", error->line);
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto object libxml_get_errors()
+ Retrieve array of errors */
+PHP_FUNCTION(libxml_get_errors)
+{
+
+ xmlErrorPtr error;
+
+ if (array_init(return_value) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if (LIBXML(error_list)) {
+
+ error = zend_llist_get_first(LIBXML(error_list));
+
+ while (error != NULL) {
+ zval *z_error;
+ MAKE_STD_ZVAL(z_error);
+
+ object_init_ex(z_error, libxmlerror_class_entry);
+ add_property_long(z_error, "level", error->level);
+ add_property_long(z_error, "code", error->code);
+ add_property_long(z_error, "column", error->int2);
+ if (error->message) {
+ add_property_string(z_error, "message", error->message, 1);
+ } else {
+ add_property_stringl(z_error, "message", "", 0, 1);
+ }
+ if (error->file) {
+ add_property_string(z_error, "file", error->file, 1);
+ } else {
+ add_property_stringl(z_error, "file", "", 0, 1);
+ }
+ add_property_long(z_error, "line", error->line);
+ add_next_index_zval(return_value, z_error);
+
+ error = zend_llist_get_next(LIBXML(error_list));
+ }
+ }
+}
+/* }}} */
+
+/* {{{ proto void libxml_clear_errors()
+ Clear last error from libxml */
+PHP_FUNCTION(libxml_clear_errors)
+{
+ xmlResetLastError();
+ if (LIBXML(error_list)) {
+ zend_llist_clean(LIBXML(error_list));
+ }
+}
+/* }}} */
+
/* {{{ Common functions shared by extensions */
int php_libxml_xmlCheckUTF8(const unsigned char *s)
{
diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h
index 7bc184d07..5accb2b24 100644
--- a/ext/libxml/php_libxml.h
+++ b/ext/libxml/php_libxml.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_libxml.h,v 1.8.2.4 2005/04/21 11:19:53 sniper Exp $ */
+/* $Id: php_libxml.h,v 1.15.2.1 2005/09/08 10:37:57 rrichards Exp $ */
#ifndef PHP_LIBXML_H
#define PHP_LIBXML_H
@@ -35,9 +35,12 @@ extern zend_module_entry libxml_module_entry;
#include "ext/standard/php_smart_str.h"
#include <libxml/tree.h>
+#define LIBXML_SAVE_NOEMPTYTAG 1<<2
+
typedef struct {
zval *stream_context;
smart_str error_buffer;
+ zend_llist *error_list;
} php_libxml_globals;
typedef struct _php_libxml_ref_obj {
@@ -62,11 +65,15 @@ typedef struct _php_libxml_node_object {
typedef void * (*php_libxml_export_node) (zval *object TSRMLS_DC);
PHP_FUNCTION(libxml_set_streams_context);
+PHP_FUNCTION(libxml_use_internal_errors);
+PHP_FUNCTION(libxml_get_last_error);
+PHP_FUNCTION(libxml_clear_errors);
+PHP_FUNCTION(libxml_get_errors);
int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC);
int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC);
-int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC);
-int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC);
+PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC);
+PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC);
PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC);
PHP_LIBXML_API int php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function);
/* When an explicit freeing of node and children is required */
@@ -78,6 +85,7 @@ void php_libxml_ctx_warning(void *ctx, const char *msg, ...);
void php_libxml_ctx_error(void *ctx, const char *msg, ...);
PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC);
+PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC);
/* Init/shutdown functions*/
PHP_LIBXML_API void php_libxml_initialize();
diff --git a/ext/mbstring/config.m4 b/ext/mbstring/config.m4
index 303b90f4a..b9980ed9c 100644
--- a/ext/mbstring/config.m4
+++ b/ext/mbstring/config.m4
@@ -1,11 +1,15 @@
dnl
-dnl $Id: config.m4,v 1.51.2.3 2005/02/20 23:02:48 moriyoshi Exp $
+dnl $Id: config.m4,v 1.58.2.2 2005/10/28 07:52:58 hyanantha Exp $
dnl
AC_DEFUN([PHP_MBSTRING_ADD_SOURCES], [
PHP_MBSTRING_SOURCES="$PHP_MBSTRING_SOURCES $1"
])
+AC_DEFUN([PHP_MBSTRING_ADD_BASE_SOURCES], [
+ PHP_MBSTRING_BASE_SOURCES="$PHP_MBSTRING_BASE_SOURCES $1"
+])
+
AC_DEFUN([PHP_MBSTRING_ADD_BUILD_DIR], [
PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS $1"
])
@@ -26,17 +30,20 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_SOURCES, $ext_shared,, $PHP_MBSTRING_CFLAGS)
PHP_SUBST(MBSTRING_SHARED_LIBADD)
+ for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do
+ PHP_ADD_BUILD_DIR([$ext_builddir/$dir], 1)
+ done
+
for dir in $PHP_MBSTRING_EXTRA_INCLUDES; do
PHP_ADD_INCLUDE([$ext_srcdir/$dir])
+ PHP_ADD_INCLUDE([$ext_builddir/$dir])
done
- for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do
- PHP_ADD_BUILD_DIR([$ext_builddir/$dir])
- done
-
if test "$ext_shared" = "no"; then
+ PHP_ADD_SOURCES(PHP_EXT_DIR(mbstring), $PHP_MBSTRING_BASE_SOURCES)
out="php_config.h"
else
+ PHP_ADD_SOURCES_X(PHP_EXT_DIR(mbstring),$PHP_MBSTRING_BASE_SOURCES,,shared_objects_mbstring,yes)
if test -f "$ext_builddir/config.h.in"; then
out="$abs_builddir/config.h"
else
@@ -45,17 +52,17 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
fi
for cfg in $PHP_MBSTRING_EXTRA_CONFIG_HEADERS; do
- cat > $ext_srcdir/$cfg <<EOF
+ cat > $ext_builddir/$cfg <<EOF
#include "$out"
EOF
done
-
])
AC_DEFUN([PHP_MBSTRING_SETUP_MBREGEX], [
if test "$PHP_MBREGEX" = "yes"; then
AC_CACHE_CHECK(for variable length prototypes and stdarg.h, cv_php_mbstring_stdarg, [
- AC_TRY_COMPILE([#include <stdarg.h>], [
+ AC_TRY_RUN([
+#include <stdarg.h>
int foo(int x, ...) {
va_list va;
va_start(va, x);
@@ -65,7 +72,19 @@ int foo(int x, ...) {
return 0;
}
int main() { return foo(10, "", 3.14); }
- ], [cv_php_mbstring_stdarg=yes], [cv_php_mbstring_stdarg=no])
+ ], [cv_php_mbstring_stdarg=yes], [cv_php_mbstring_stdarg=no],
+ [
+ dnl cross-compile needs something here
+case $host_alias in
+*netware*)
+cv_php_mbstring_stdarg=yes
+;;
+*)
+cv_php_mbstring_stdarg=no
+;;
+esac
+]
+)
])
AC_CHECK_HEADERS([stdlib.h string.h strings.h unistd.h sys/time.h sys/times.h])
@@ -88,8 +107,8 @@ int main() { return foo(10, "", 3.14); }
PHP_MBSTRING_ADD_INCLUDE([oniguruma])
PHP_MBSTRING_ADD_CONFIG_HEADER([oniguruma/config.h])
+ PHP_MBSTRING_ADD_BASE_SOURCES([php_mbregex.c])
PHP_MBSTRING_ADD_SOURCES([
- php_mbregex.c
oniguruma/regcomp.c
oniguruma/regerror.c
oniguruma/regexec.c
@@ -185,6 +204,7 @@ AC_DEFUN([PHP_MBSTRING_SETUP_LIBMBFL], [
libmbfl/filters/mbfilter_iso8859_9.c
libmbfl/filters/mbfilter_jis.c
libmbfl/filters/mbfilter_koi8r.c
+ libmbfl/filters/mbfilter_armscii8.c
libmbfl/filters/mbfilter_qprint.c
libmbfl/filters/mbfilter_sjis.c
libmbfl/filters/mbfilter_ucs2.c
@@ -216,6 +236,7 @@ AC_DEFUN([PHP_MBSTRING_SETUP_LIBMBFL], [
libmbfl/nls/nls_ru.c
libmbfl/nls/nls_uni.c
libmbfl/nls/nls_zh.c
+ libmbfl/nls/nls_hy.c
])
PHP_MBSTRING_ADD_CFLAG([-DHAVE_CONFIG_H])
else
@@ -236,11 +257,11 @@ AC_DEFUN([PHP_MBSTRING_SETUP_LIBMBFL], [
fi
PHP_CHECK_LIBRARY(mbfl, mbfl_buffer_converter_new, [
- PHP_ADD_LIBRARY_WITH_PATH(mbfl, $PHP_LIBMBFL/lib, MBSTRING_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(mbfl, $PHP_LIBMBFL/$PHP_LIBDIR, MBSTRING_SHARED_LIBADD)
],[
AC_MSG_ERROR([Problem with libmbfl. Please check config.log for more information.])
], [
- -LPHP_LIBMBFL/lib
+ -LPHP_LIBMBFL/$PHP_LIBDIR
])
fi
])
@@ -250,19 +271,19 @@ dnl Main config
dnl
PHP_ARG_ENABLE(mbstring, whether to enable multibyte string support,
-[ --enable-mbstring Enable multibyte string support.])
+[ --enable-mbstring Enable multibyte string support])
PHP_ARG_ENABLE([mbregex], [whether to enable multibyte regex support],
-[ --disable-mbregex MBSTRING: Disable multibyte regex support.], yes, no)
+[ --disable-mbregex MBSTRING: Disable multibyte regex support], yes, no)
PHP_ARG_WITH(libmbfl, [for external libmbfl],
[ --with-libmbfl[=DIR] MBSTRING: Use external libmbfl. DIR is the libmbfl install prefix.
- If DIR is not set, the bundled libmbfl will be used.], no, no)
+ If DIR is not set, the bundled libmbfl will be used], no, no)
if test "$PHP_MBSTRING" != "no"; then
AC_DEFINE([HAVE_MBSTRING],1,[whether to have multibyte string support])
- PHP_MBSTRING_ADD_SOURCES([mbstring.c php_unicode.c mb_gpc.c])
+ PHP_MBSTRING_ADD_BASE_SOURCES([mbstring.c php_unicode.c mb_gpc.c])
if test "$PHP_MBREGEX" != "no"; then
PHP_MBSTRING_SETUP_MBREGEX
@@ -271,6 +292,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])
fi
# vim600: sts=2 sw=2 et
diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32
index 58dfe9bac..6fc28084c 100644
--- a/ext/mbstring/config.w32
+++ b/ext/mbstring/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.8.2.1 2005/02/20 23:02:48 moriyoshi Exp $
+// $Id: config.w32,v 1.10 2005/03/22 22:22:08 moriyoshi Exp $
// vim:ft=javascript
ARG_ENABLE("mbstring", "multibyte string functions", "no");
@@ -31,15 +31,16 @@ if (PHP_MBSTRING == "yes") {
mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \
mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \
mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c \
- mbfilter_uuencode.c", "mbstring");
+ mbfilter_uuencode.c mbfilter_armscii8.c", "mbstring");
ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \
mbfilter_pass.c mbfilter_wchar.c mbfl_convert.c mbfl_encoding.c \
mbfl_filter_output.c mbfl_ident.c mbfl_language.c mbfl_memory_device.c \
mbfl_string.c mbfl_allocators.c", "mbstring");
- ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c nls_kr.c \
- nls_neutral.c nls_ru.c nls_uni.c nls_zh.c", "mbstring");
+ ADD_SOURCES("ext/mbstring/libmbfl/nls", "nls_de.c nls_en.c nls_ja.c \
+ nls_kr.c nls_neutral.c nls_ru.c nls_uni.c nls_zh.c nls_hy.c \
+ ", "mbstring");
AC_DEFINE('HAVE_MBSTRING', 1, 'Have mbstring support');
AC_DEFINE('HAVE_MBSTR_CN', 1, 'CN');
diff --git a/ext/mbstring/libmbfl/README b/ext/mbstring/libmbfl/README
index a12363b42..476a589aa 100644
--- a/ext/mbstring/libmbfl/README
+++ b/ext/mbstring/libmbfl/README
@@ -5,4 +5,4 @@ See LICENSE and DISCLAIMER for licensing information.
See the file INSTALL for building and installation instructions.
-# $Id: README,v 1.3.2.1 2005/02/20 23:02:50 moriyoshi Exp $
+# $Id: README,v 1.4 2005/02/20 22:18:07 moriyoshi Exp $
diff --git a/ext/mbstring/libmbfl/filters/Makefile.am b/ext/mbstring/libmbfl/filters/Makefile.am
index aab009b9d..0c71c8604 100644
--- a/ext/mbstring/libmbfl/filters/Makefile.am
+++ b/ext/mbstring/libmbfl/filters/Makefile.am
@@ -2,7 +2,7 @@ EXTRA_DIST=Makefile.bcc32 mk_sb_tbl.awk
noinst_LTLIBRARIES=libmbfl_filters.la
INCLUDES=-I../mbfl
libmbfl_filters_la_LDFLAGS=-version-info $(SHLIB_VERSION)
-libmbfl_filters_la_SOURCES=mbfilter_cp936.c mbfilter_hz.c mbfilter_euc_tw.c mbfilter_big5.c mbfilter_euc_jp.c mbfilter_jis.c mbfilter_iso8859_1.c mbfilter_iso8859_2.c mbfilter_cp1252.c mbfilter_cp1251.c mbfilter_ascii.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c mbfilter_htmlent.c mbfilter_byte2.c mbfilter_byte4.c mbfilter_uuencode.c mbfilter_base64.c mbfilter_sjis.c mbfilter_7bit.c mbfilter_qprint.c mbfilter_ucs4.c mbfilter_ucs2.c mbfilter_utf32.c mbfilter_utf16.c mbfilter_utf8.c mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_euc_jp_win.c mbfilter_cp932.c mbfilter_euc_cn.c mbfilter_euc_kr.c mbfilter_uhc.c mbfilter_iso2022_kr.c mbfilter_cp866.c mbfilter_koi8r.c html_entities.c cp932_table.h html_entities.h mbfilter_7bit.h mbfilter_ascii.h mbfilter_base64.h mbfilter_big5.h mbfilter_byte2.h mbfilter_byte4.h mbfilter_cp1251.h mbfilter_cp1252.h mbfilter_cp866.h mbfilter_cp932.h mbfilter_cp936.h mbfilter_euc_cn.h mbfilter_euc_jp.h mbfilter_euc_jp_win.h mbfilter_euc_kr.h mbfilter_euc_tw.h mbfilter_htmlent.h mbfilter_hz.h mbfilter_iso2022_kr.h mbfilter_iso8859_1.h mbfilter_iso8859_10.h mbfilter_iso8859_13.h mbfilter_iso8859_14.h mbfilter_iso8859_15.h mbfilter_iso8859_16.h mbfilter_iso8859_2.h mbfilter_iso8859_3.h mbfilter_iso8859_4.h mbfilter_iso8859_5.h mbfilter_iso8859_6.h mbfilter_iso8859_7.h mbfilter_iso8859_8.h mbfilter_iso8859_9.h mbfilter_jis.h mbfilter_koi8r.h mbfilter_qprint.h mbfilter_sjis.h mbfilter_ucs2.h mbfilter_ucs4.h mbfilter_uhc.h mbfilter_utf16.h mbfilter_utf32.h mbfilter_utf7.h mbfilter_utf7imap.h mbfilter_utf8.h mbfilter_uuencode.h unicode_prop.h unicode_table_big5.h unicode_table_cns11643.h unicode_table_cp1251.h unicode_table_cp1252.h unicode_table_cp866.h unicode_table_cp932_ext.h unicode_table_cp936.h unicode_table_iso8859_10.h unicode_table_iso8859_13.h unicode_table_iso8859_14.h unicode_table_iso8859_15.h unicode_table_iso8859_16.h unicode_table_iso8859_2.h unicode_table_iso8859_3.h unicode_table_iso8859_4.h unicode_table_iso8859_5.h unicode_table_iso8859_6.h unicode_table_iso8859_7.h unicode_table_iso8859_8.h unicode_table_iso8859_9.h unicode_table_jis.h unicode_table_koi8r.h unicode_table_uhc.h
+libmbfl_filters_la_SOURCES=mbfilter_cp936.c mbfilter_hz.c mbfilter_euc_tw.c mbfilter_big5.c mbfilter_euc_jp.c mbfilter_jis.c mbfilter_iso8859_1.c mbfilter_iso8859_2.c mbfilter_cp1252.c mbfilter_cp1251.c mbfilter_ascii.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_iso8859_10.c mbfilter_iso8859_13.c mbfilter_iso8859_14.c mbfilter_iso8859_15.c mbfilter_iso8859_16.c mbfilter_htmlent.c mbfilter_byte2.c mbfilter_byte4.c mbfilter_uuencode.c mbfilter_base64.c mbfilter_sjis.c mbfilter_7bit.c mbfilter_qprint.c mbfilter_ucs4.c mbfilter_ucs2.c mbfilter_utf32.c mbfilter_utf16.c mbfilter_utf8.c mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_euc_jp_win.c mbfilter_cp932.c mbfilter_euc_cn.c mbfilter_euc_kr.c mbfilter_uhc.c mbfilter_iso2022_kr.c mbfilter_cp866.c mbfilter_koi8r.c mbfilter_armscii8.c html_entities.c cp932_table.h html_entities.h mbfilter_7bit.h mbfilter_ascii.h mbfilter_base64.h mbfilter_big5.h mbfilter_byte2.h mbfilter_byte4.h mbfilter_cp1251.h mbfilter_cp1252.h mbfilter_cp866.h mbfilter_cp932.h mbfilter_cp936.h mbfilter_euc_cn.h mbfilter_euc_jp.h mbfilter_euc_jp_win.h mbfilter_euc_kr.h mbfilter_euc_tw.h mbfilter_htmlent.h mbfilter_hz.h mbfilter_iso2022_kr.h mbfilter_iso8859_1.h mbfilter_iso8859_10.h mbfilter_iso8859_13.h mbfilter_iso8859_14.h mbfilter_iso8859_15.h mbfilter_iso8859_16.h mbfilter_iso8859_2.h mbfilter_iso8859_3.h mbfilter_iso8859_4.h mbfilter_iso8859_5.h mbfilter_iso8859_6.h mbfilter_iso8859_7.h mbfilter_iso8859_8.h mbfilter_iso8859_9.h mbfilter_jis.h mbfilter_koi8r.h mbfilter_armscii8.h mbfilter_qprint.h mbfilter_sjis.h mbfilter_ucs2.h mbfilter_ucs4.h mbfilter_uhc.h mbfilter_utf16.h mbfilter_utf32.h mbfilter_utf7.h mbfilter_utf7imap.h mbfilter_utf8.h mbfilter_uuencode.h unicode_prop.h unicode_table_big5.h unicode_table_cns11643.h unicode_table_cp1251.h unicode_table_cp1252.h unicode_table_cp866.h unicode_table_cp932_ext.h unicode_table_cp936.h unicode_table_iso8859_10.h unicode_table_iso8859_13.h unicode_table_iso8859_14.h unicode_table_iso8859_15.h unicode_table_iso8859_16.h unicode_table_iso8859_2.h unicode_table_iso8859_3.h unicode_table_iso8859_4.h unicode_table_iso8859_5.h unicode_table_iso8859_6.h unicode_table_iso8859_7.h unicode_table_iso8859_8.h unicode_table_iso8859_9.h unicode_table_jis.h unicode_table_koi8r.h unicode_table_armscii8.h unicode_table_uhc.h
mbfilter_iso8859_2.c: unicode_table_iso8859_2.h
diff --git a/ext/mbstring/libmbfl/filters/Makefile.bcc32 b/ext/mbstring/libmbfl/filters/Makefile.bcc32
index 32bd16109..03e1d8802 100644
--- a/ext/mbstring/libmbfl/filters/Makefile.bcc32
+++ b/ext/mbstring/libmbfl/filters/Makefile.bcc32
@@ -1,6 +1,6 @@
!include ..\rules.mak.bcc32
INCLUDES=$(INCLUDES) -I../mbfl
-OBJS=mbfilter_cp936.obj mbfilter_hz.obj mbfilter_euc_tw.obj mbfilter_big5.obj mbfilter_euc_jp.obj mbfilter_jis.obj mbfilter_iso8859_1.obj mbfilter_iso8859_2.obj mbfilter_cp1252.obj mbfilter_cp1251.obj mbfilter_ascii.obj mbfilter_iso8859_3.obj mbfilter_iso8859_4.obj mbfilter_iso8859_5.obj mbfilter_iso8859_6.obj mbfilter_iso8859_7.obj mbfilter_iso8859_8.obj mbfilter_iso8859_9.obj mbfilter_iso8859_10.obj mbfilter_iso8859_13.obj mbfilter_iso8859_14.obj mbfilter_iso8859_15.obj mbfilter_iso8859_16.obj mbfilter_htmlent.obj mbfilter_byte2.obj mbfilter_byte4.obj mbfilter_uuencode.obj mbfilter_base64.obj mbfilter_sjis.obj mbfilter_7bit.obj mbfilter_qprint.obj mbfilter_ucs4.obj mbfilter_ucs2.obj mbfilter_utf32.obj mbfilter_utf16.obj mbfilter_utf8.obj mbfilter_utf7.obj mbfilter_utf7imap.obj mbfilter_euc_jp_win.obj mbfilter_cp932.obj mbfilter_euc_cn.obj mbfilter_euc_kr.obj mbfilter_uhc.obj mbfilter_iso2022_kr.obj mbfilter_cp866.obj mbfilter_koi8r.obj html_entities.obj
+OBJS=mbfilter_cp936.obj mbfilter_hz.obj mbfilter_euc_tw.obj mbfilter_big5.obj mbfilter_euc_jp.obj mbfilter_jis.obj mbfilter_iso8859_1.obj mbfilter_iso8859_2.obj mbfilter_cp1252.obj mbfilter_cp1251.obj mbfilter_ascii.obj mbfilter_iso8859_3.obj mbfilter_iso8859_4.obj mbfilter_iso8859_5.obj mbfilter_iso8859_6.obj mbfilter_iso8859_7.obj mbfilter_iso8859_8.obj mbfilter_iso8859_9.obj mbfilter_iso8859_10.obj mbfilter_iso8859_13.obj mbfilter_iso8859_14.obj mbfilter_iso8859_15.obj mbfilter_iso8859_16.obj mbfilter_htmlent.obj mbfilter_byte2.obj mbfilter_byte4.obj mbfilter_uuencode.obj mbfilter_base64.obj mbfilter_sjis.obj mbfilter_7bit.obj mbfilter_qprint.obj mbfilter_ucs4.obj mbfilter_ucs2.obj mbfilter_utf32.obj mbfilter_utf16.obj mbfilter_utf8.obj mbfilter_utf7.obj mbfilter_utf7imap.obj mbfilter_euc_jp_win.obj mbfilter_cp932.obj mbfilter_euc_cn.obj mbfilter_euc_kr.obj mbfilter_uhc.obj mbfilter_iso2022_kr.obj mbfilter_cp866.obj mbfilter_koi8r.obj html_entities.obj mbfilter_armscii8.obj
all: $(OBJS)
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c
new file mode 100644
index 000000000..2d1fc8d7b
--- /dev/null
+++ b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c
@@ -0,0 +1,149 @@
+/*
+ * "streamable kanji code filter and converter"
+ * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved.
+ *
+ * LICENSE NOTICES
+ *
+ * This file is part of "streamable kanji code filter and converter",
+ * which is distributed under the terms of GNU Lesser General Public
+ * License (version 2) as published by the Free Software Foundation.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with "streamable kanji code filter and converter";
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307 USA
+ *
+ * The author of this file: Hayk Chamyan <hamshen@gmail.com>
+ *
+ */
+
+/*
+ * "armenian code filter and converter"
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mbfilter.h"
+#include "mbfilter_armscii8.h"
+#include "unicode_table_armscii8.h"
+
+static int mbfl_filt_ident_armscii8(int c, mbfl_identify_filter *filter);
+
+static const char *mbfl_encoding_armscii8_aliases[] = {"ArmSCII-8", "ArmSCII8", "ARMSCII-8", "ARMSCII8", NULL};
+
+const mbfl_encoding mbfl_encoding_armscii8 = {
+ mbfl_no_encoding_armscii8,
+ "ArmSCII-8",
+ "ArmSCII-8",
+ (const char *(*)[])&mbfl_encoding_armscii8_aliases,
+ NULL,
+ MBFL_ENCTYPE_SBCS
+};
+
+const struct mbfl_identify_vtbl vtbl_identify_armscii8 = {
+ mbfl_no_encoding_armscii8,
+ mbfl_filt_ident_common_ctor,
+ mbfl_filt_ident_common_dtor,
+ mbfl_filt_ident_armscii8
+};
+
+const struct mbfl_convert_vtbl vtbl_wchar_armscii8 = {
+ mbfl_no_encoding_wchar,
+ mbfl_no_encoding_armscii8,
+ mbfl_filt_conv_common_ctor,
+ mbfl_filt_conv_common_dtor,
+ mbfl_filt_conv_wchar_armscii8,
+ mbfl_filt_conv_common_flush
+};
+
+const struct mbfl_convert_vtbl vtbl_armscii8_wchar = {
+ mbfl_no_encoding_armscii8,
+ mbfl_no_encoding_wchar,
+ mbfl_filt_conv_common_ctor,
+ mbfl_filt_conv_common_dtor,
+ mbfl_filt_conv_armscii8_wchar,
+ mbfl_filt_conv_common_flush
+};
+
+#define CK(statement) do { if ((statement) < 0) return (-1); } while (0)
+
+/*
+ * armscii8 => wchar
+ */
+int mbfl_filt_conv_armscii8_wchar(int c, mbfl_convert_filter *filter)
+{
+ int s;
+
+ if (c >= 0 && c < armscii8_ucs_table_min) {
+ s = c;
+ } else if (c >= armscii8_ucs_table_min && c < 0x100) {
+ s = armscii8_ucs_table[c - armscii8_ucs_table_min];
+ if (s <= 0) {
+ s = c;
+ s &= MBFL_WCSPLANE_MASK;
+ s |= MBFL_WCSPLANE_ARMSCII8;
+ }
+ } else {
+ s = c;
+ s &= MBFL_WCSGROUP_MASK;
+ s |= MBFL_WCSGROUP_THROUGH;
+ }
+
+ CK((*filter->output_function)(s, filter->data));
+
+ return c;
+}
+
+/*
+ * wchar => armscii8
+ */
+int mbfl_filt_conv_wchar_armscii8(int c, mbfl_convert_filter *filter)
+{
+
+ int s, n;
+
+ if (c >= 0x28 && c < 0x30) {
+ s = ucs_armscii8_table[c-0x28];
+ } else if (c < armscii8_ucs_table_min) {
+ s = c;
+ } else {
+ s = -1;
+ n = armscii8_ucs_table_len-1;
+ while (n >= 0) {
+ if (c == armscii8_ucs_table[n]) {
+ s = armscii8_ucs_table_min + n;
+ break;
+ }
+ n--;
+ }
+ if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_ARMSCII8) {
+ s = c & MBFL_WCSPLANE_MASK;
+ }
+ }
+
+ if (s >= 0) {
+ CK((*filter->output_function)(s, filter->data));
+ } else {
+ if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) {
+ CK(mbfl_filt_conv_illegal_output(c, filter));
+ }
+ }
+
+ return c;
+}
+
+static int mbfl_filt_ident_armscii8(int c, mbfl_identify_filter *filter)
+{
+ if (c >= armscii8_ucs_table_min && c <= 0xff)
+ filter->flag = 0;
+ else
+ filter->flag = 1; /* not it */
+ return c;
+}
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.h b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.h
new file mode 100644
index 000000000..fc8482756
--- /dev/null
+++ b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.h
@@ -0,0 +1,45 @@
+/*
+ * "streamable kanji code filter and converter"
+ * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved.
+ *
+ * LICENSE NOTICES
+ *
+ * This file is part of "streamable kanji code filter and converter",
+ * which is distributed under the terms of GNU Lesser General Public
+ * License (version 2) as published by the Free Software Foundation.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with "streamable kanji code filter and converter";
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307 USA
+ *
+ * The author of this file: Hayk Chamyan <hamshen@gmail.com>
+ *
+ */
+
+#ifndef MBFL_MBFILTER_ARMSCII8_H
+#define MBFL_MBFILTER_ARMSCII8_H
+
+#include "mbfilter.h"
+
+extern const mbfl_encoding mbfl_encoding_armscii8;
+extern const struct mbfl_identify_vtbl vtbl_identify_armscii8;
+extern const struct mbfl_convert_vtbl vtbl_wchar_armscii8;
+extern const struct mbfl_convert_vtbl vtbl_armscii8_wchar;
+
+int mbfl_filt_conv_armscii8_wchar(int c, mbfl_convert_filter *filter);
+int mbfl_filt_conv_wchar_armscii8(int c, mbfl_convert_filter *filter);
+
+#endif /* MBFL_MBFILTER_ARMSCII8_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk b/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk
index 04879f89a..6d49a9ea7 100755
--- a/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk
+++ b/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk
@@ -1,6 +1,6 @@
#!/usr/bin/awk -f
#
-# $Id: mk_sb_tbl.awk,v 1.1.2.2 2005/02/21 08:01:03 moriyoshi Exp $
+# $Id: mk_sb_tbl.awk,v 1.2 2005/02/21 07:57:08 moriyoshi Exp $
#
# Description: a script that generates a single byte code set to Unicode
# mapping table.
diff --git a/ext/mbstring/libmbfl/filters/unicode_table_armscii8.h b/ext/mbstring/libmbfl/filters/unicode_table_armscii8.h
new file mode 100644
index 000000000..174e95de7
--- /dev/null
+++ b/ext/mbstring/libmbfl/filters/unicode_table_armscii8.h
@@ -0,0 +1,54 @@
+/*
+ * "streamable kanji code filter and converter"
+ * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved.
+ *
+ * LICENSE NOTICES
+ *
+ * This file is part of "streamable kanji code filter and converter",
+ * which is distributed under the terms of GNU Lesser General Public
+ * License (version 2) as published by the Free Software Foundation.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with "streamable kanji code filter and converter";
+ * if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307 USA
+ *
+ * The author of this file: Hayk Chamyan <hamshen@gmail.com>
+ *
+ */
+
+#ifndef UNICODE_TABLE_ARMSCII8_H
+#define UNICODE_TABLE_ARMSCII8_H
+
+/* ArmSCII-8 to Unicode table */
+static const unsigned short armscii8_ucs_table[] = {
+/*0x00a0, 0x00a1, 0x0587, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab,*/
+0x00a0, 0xfffd, 0x0587, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab,
+0x2014, 0x002e, 0x055d, 0x002c, 0x002d, 0x058a, 0x2026, 0x055c,
+0x055b, 0x055e, 0x0531, 0x0561, 0x0532, 0x0562, 0x0533, 0x0563,
+0x0534, 0x0564, 0x0535, 0x0565, 0x0536, 0x0566, 0x0537, 0x0567,
+0x0538, 0x0568, 0x0539, 0x0569, 0x053a, 0x056a, 0x053b, 0x056b,
+0x053c, 0x056c, 0x053d, 0x056d, 0x053e, 0x056e, 0x053f, 0x056f,
+0x0540, 0x0570, 0x0541, 0x0571, 0x0542, 0x0572, 0x0543, 0x0573,
+0x0544, 0x0574, 0x0545, 0x0575, 0x0546, 0x0576, 0x0547, 0x0577,
+0x0548, 0x0578, 0x0549, 0x0579, 0x054a, 0x057a, 0x054b, 0x057b,
+0x054c, 0x057c, 0x054d, 0x057d, 0x054e, 0x057e, 0x054f, 0x057f,
+0x0550, 0x0580, 0x0551, 0x0581, 0x0552, 0x0582, 0x0553, 0x0583,
+/*0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x055a, 0x00ff*/
+0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x055a, 0xfffd
+};
+
+static const unsigned char ucs_armscii8_table[] = {
+0xa5, 0xa4, 0x2a, 0x2b, 0xab, 0xac, 0xa9, 0x2f
+};
+
+static const int armscii8_ucs_table_min = 0xa0;
+static const int armscii8_ucs_table_len = (sizeof (armscii8_ucs_table) / sizeof (unsigned short));
+static const int armscii8_ucs_table_max = 0xa0 + (sizeof (armscii8_ucs_table) / sizeof (unsigned short));
+
+#endif /* UNICODE_TABLE_ARMSCII8_H */
diff --git a/ext/mbstring/libmbfl/libmbfl.dsp b/ext/mbstring/libmbfl/libmbfl.dsp
index e041df02c..ddb4f9003 100644
--- a/ext/mbstring/libmbfl/libmbfl.dsp
+++ b/ext/mbstring/libmbfl/libmbfl.dsp
@@ -243,6 +243,10 @@ SOURCE=.\filters\mbfilter_koi8r.c
# End Source File
# Begin Source File
+SOURCE=.\filters\mbfilter_armscii8.c
+# End Source File
+# Begin Source File
+
SOURCE=.\mbfl\mbfilter_pass.c
# End Source File
# Begin Source File
@@ -339,6 +343,10 @@ SOURCE=.\nls\nls_ja.c
# End Source File
# Begin Source File
+SOURCE=.\nls\nls_hy.c
+# End Source File
+# Begin Source File
+
SOURCE=.\nls\nls_kr.c
# End Source File
# Begin Source File
@@ -548,6 +556,10 @@ SOURCE=.\filters\mbfilter_koi8r.h
# End Source File
# Begin Source File
+SOURCE=.\filters\mbfilter_armscii8.h
+# End Source File
+# Begin Source File
+
SOURCE=.\mbfl\mbfilter_pass.h
# End Source File
# Begin Source File
@@ -648,6 +660,10 @@ SOURCE=.\nls\nls_ja.h
# End Source File
# Begin Source File
+SOURCE=.\nls\nls_hy.h
+# End Source File
+# Begin Source File
+
SOURCE=.\nls\nls_kr.h
# End Source File
# Begin Source File
@@ -760,6 +776,10 @@ SOURCE=.\filters\unicode_table_koi8r.h
# End Source File
# Begin Source File
+SOURCE=.\filters\unicode_table_armscii8.h
+# End Source File
+# Begin Source File
+
SOURCE=.\filters\unicode_table_uhc.h
# End Source File
# End Group
diff --git a/ext/mbstring/libmbfl/mbfl.rc b/ext/mbstring/libmbfl/mbfl.rc
index aef07e38e..184d84981 100644
--- a/ext/mbstring/libmbfl/mbfl.rc
+++ b/ext/mbstring/libmbfl/mbfl.rc
@@ -1,4 +1,4 @@
-/* $Id: mbfl.rc,v 1.4.2.1 2005/02/20 23:02:50 moriyoshi Exp $ */
+/* $Id: mbfl.rc,v 1.5 2005/02/20 22:18:07 moriyoshi Exp $ */
1 VERSIONINFO
FILEVERSION 1,1,0,0
PRODUCTVERSION 1,1,0,0
diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter.c b/ext/mbstring/libmbfl/mbfl/mbfilter.c
index b99d8df8a..0e7072fda 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfilter.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfilter.c
@@ -1990,7 +1990,7 @@ mime_header_encoder_collector(int c, void *data)
break;
default: /* ASCII */
- if (!qp_table[(c & 0xff)]) { /* ordinary characters */
+ if (c <= 0x00ff && !qp_table[(c & 0xff)]) { /* ordinary characters */
mbfl_memory_device_output(c, &pe->tmpdev);
pe->status1 = 1;
} else if (pe->status1 == 0 && c == 0x20) { /* repeat SPACE */
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h b/ext/mbstring/libmbfl/mbfl/mbfl_consts.h
index d20b3ceea..f500766b4 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_consts.h
@@ -75,6 +75,7 @@
#define MBFL_WCSPLANE_CP866 0x70f80000
#define MBFL_WCSPLANE_KOI8R 0x70f90000
#define MBFL_WCSPLANE_8859_16 0x70fa0000 /* 00h - FFh */
+#define MBFL_WCSPLANE_ARMSCII8 0x70fb0000
#define MBFL_WCSGROUP_MASK 0xffffff
#define MBFL_WCSGROUP_UCS4MAX 0x70000000
#define MBFL_WCSGROUP_WCHARMAX 0x78000000
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_convert.c b/ext/mbstring/libmbfl/mbfl/mbfl_convert.c
index 9dd27ff59..981bba6af 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_convert.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_convert.c
@@ -88,6 +88,7 @@
#include "filters/mbfilter_ucs4.h"
#include "filters/mbfilter_ucs2.h"
#include "filters/mbfilter_htmlent.h"
+#include "filters/mbfilter_armscii8.h"
static void mbfl_convert_filter_reset_vtbl(mbfl_convert_filter *filter);
@@ -208,6 +209,8 @@ const struct mbfl_convert_vtbl *mbfl_convert_filter_list[] = {
&vtbl_wchar_byte2be,
&vtbl_byte2le_wchar,
&vtbl_wchar_byte2le,
+ &vtbl_armscii8_wchar,
+ &vtbl_wchar_armscii8,
&vtbl_pass,
NULL
};
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c
index 21fb6319d..64d8cb4e4 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c
@@ -95,6 +95,7 @@
#include "filters/mbfilter_ucs4.h"
#include "filters/mbfilter_ucs2.h"
#include "filters/mbfilter_htmlent.h"
+#include "filters/mbfilter_armscii8.h"
#ifndef HAVE_STRCASECMP
#ifdef HAVE_STRICMP
@@ -176,6 +177,7 @@ static const mbfl_encoding *mbfl_encoding_ptr_list[] = {
&mbfl_encoding_cp1251,
&mbfl_encoding_cp866,
&mbfl_encoding_koi8r,
+ &mbfl_encoding_armscii8,
NULL
};
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h
index c9b51dd36..d38b1d7d4 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h
@@ -98,6 +98,7 @@ enum mbfl_no_encoding {
mbfl_no_encoding_cp866,
mbfl_no_encoding_koi8r,
mbfl_no_encoding_8859_16,
+ mbfl_no_encoding_armscii8,
mbfl_no_encoding_charset_max
};
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_ident.c b/ext/mbstring/libmbfl/mbfl/mbfl_ident.c
index 619b9cfc1..72ccef68d 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_ident.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_ident.c
@@ -87,6 +87,7 @@
#include "filters/mbfilter_ucs4.h"
#include "filters/mbfilter_ucs2.h"
#include "filters/mbfilter_htmlent.h"
+#include "filters/mbfilter_armscii8.h"
static const struct mbfl_identify_vtbl vtbl_identify_false = {
mbfl_no_encoding_pass,
@@ -130,6 +131,7 @@ static const struct mbfl_identify_vtbl *mbfl_identify_filter_list[] = {
&vtbl_identify_8859_13,
&vtbl_identify_8859_14,
&vtbl_identify_8859_15,
+ &vtbl_identify_armscii8,
&vtbl_identify_false,
NULL
};
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_language.c b/ext/mbstring/libmbfl/mbfl/mbfl_language.c
index be1341ab8..c5dab6550 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_language.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_language.c
@@ -58,6 +58,7 @@
#include "nls/nls_de.h"
#include "nls/nls_ru.h"
#include "nls/nls_en.h"
+#include "nls/nls_hy.h"
#include "nls/nls_neutral.h"
#ifndef HAVE_STRCASECMP
@@ -75,6 +76,7 @@ static const mbfl_language *mbfl_language_ptr_table[] = {
&mbfl_language_english,
&mbfl_language_german,
&mbfl_language_russian,
+ &mbfl_language_armenian,
&mbfl_language_neutral,
NULL
};
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_language.h b/ext/mbstring/libmbfl/mbfl/mbfl_language.h
index 7a6dfde4b..f6b9ec208 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_language.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_language.h
@@ -57,6 +57,7 @@ enum mbfl_no_language {
mbfl_no_language_simplified_chinese, /* zh-cn */
mbfl_no_language_traditional_chinese, /* zh-tw */
mbfl_no_language_russian, /* ru */
+ mbfl_no_language_armenian, /* hy */
mbfl_no_language_max
};
diff --git a/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk b/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk
index 126ff0117..c9fdf7c5d 100644
--- a/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk
+++ b/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk
@@ -1,6 +1,6 @@
#!/usr/bin/awk -f
#
-# $Id: mk_eaw_tbl.awk,v 1.1.2.1 2004/10/08 14:45:47 moriyoshi Exp $
+# $Id: mk_eaw_tbl.awk,v 1.2 2005/02/20 22:18:08 moriyoshi Exp $
#
# Description: a script to generate east asian width table.
#
diff --git a/ext/mbstring/libmbfl/nls/Makefile.am b/ext/mbstring/libmbfl/nls/Makefile.am
index ab2ea9d3c..ca81f902c 100644
--- a/ext/mbstring/libmbfl/nls/Makefile.am
+++ b/ext/mbstring/libmbfl/nls/Makefile.am
@@ -2,4 +2,4 @@ EXTRA_DIST=Makefile.bcc32
noinst_LTLIBRARIES=libmbfl_nls.la
INCLUDES=-I../mbfl
libmbfl_nls_la_LDFLAGS=-version-info $(SHLIB_VERSION)
-libmbfl_nls_la_SOURCES=nls_ja.c nls_de.c nls_en.c nls_kr.c nls_ru.c nls_zh.c nls_uni.c nls_neutral.c nls_ja.h nls_de.h nls_en.h nls_kr.h nls_ru.h nls_zh.h nls_uni.h nls_neutral.h
+libmbfl_nls_la_SOURCES=nls_ja.c nls_de.c nls_en.c nls_hy.c nls_kr.c nls_ru.c nls_zh.c nls_uni.c nls_neutral.c nls_ja.h nls_de.h nls_en.h nls_hy.h nls_kr.h nls_ru.h nls_zh.h nls_uni.h nls_neutral.h
diff --git a/ext/mbstring/libmbfl/nls/Makefile.bcc32 b/ext/mbstring/libmbfl/nls/Makefile.bcc32
index 9dc641a45..444e88c52 100644
--- a/ext/mbstring/libmbfl/nls/Makefile.bcc32
+++ b/ext/mbstring/libmbfl/nls/Makefile.bcc32
@@ -1,6 +1,6 @@
!include ..\rules.mak.bcc32
INCLUDES=$(INCLUDES) -I..\mbfl
-OBJS=nls_ja.obj nls_de.obj nls_en.obj nls_kr.obj nls_ru.obj nls_zh.obj nls_uni.obj nls_neutral.obj
+OBJS=nls_ja.obj nls_de.obj nls_en.obj nls_hy.obj nls_kr.obj nls_ru.obj nls_zh.obj nls_uni.obj nls_neutral.obj
all: $(OBJS)
diff --git a/ext/mbstring/libmbfl/nls/nls_hy.c b/ext/mbstring/libmbfl/nls/nls_hy.c
new file mode 100644
index 000000000..a2511484c
--- /dev/null
+++ b/ext/mbstring/libmbfl/nls/nls_hy.c
@@ -0,0 +1,20 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
+#include "mbfilter.h"
+#include "nls_hy.h"
+
+const mbfl_language mbfl_language_armenian = {
+ mbfl_no_language_armenian ,
+ "Armenian ",
+ "hy",
+ NULL,
+ mbfl_no_encoding_armscii8,
+ mbfl_no_encoding_qprint,
+ mbfl_no_encoding_8bit
+};
diff --git a/ext/mbstring/libmbfl/nls/nls_hy.h b/ext/mbstring/libmbfl/nls/nls_hy.h
new file mode 100644
index 000000000..39fa246ea
--- /dev/null
+++ b/ext/mbstring/libmbfl/nls/nls_hy.h
@@ -0,0 +1,9 @@
+#ifndef MBFL_NLS_HY_H
+#define MBFL_NLS_HY_H
+
+#include "mbfilter.h"
+#include "nls_hy.h"
+
+extern const mbfl_language mbfl_language_armenian;
+
+#endif /* MBFL_NLS_HY_H */
diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c
index 632f497cc..781da2c2f 100644
--- a/ext/mbstring/mb_gpc.c
+++ b/ext/mbstring/mb_gpc.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mb_gpc.c,v 1.11.2.2 2005/03/04 00:35:23 iliaa Exp $ */
+/* $Id: mb_gpc.c,v 1.17 2005/08/03 14:07:24 sniper Exp $ */
/* {{{ includes */
#ifdef HAVE_CONFIG_H
@@ -48,49 +48,22 @@
ZEND_EXTERN_MODULE_GLOBALS(mbstring)
-/* {{{ static sapi_post_entry mbstr_post_entries[] */
-static sapi_post_entry mbstr_post_entries[] = {
- { DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_mb_post_handler },
- { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler },
- { NULL, 0, NULL, NULL }
-};
-/* }}} */
-
-/* {{{ static sapi_post_entry php_post_entries[] */
-static sapi_post_entry php_post_entries[] = {
- { DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_std_post_handler },
- { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler },
- { NULL, 0, NULL, NULL }
-};
-/* }}} */
-
-/* {{{ int _php_mb_enable_encoding_translation(int flag) */
-int _php_mb_enable_encoding_translation(int flag)
-{
- if (flag) {
- sapi_unregister_post_entry(php_post_entries);
- sapi_register_post_entries(mbstr_post_entries);
- sapi_register_treat_data(mbstr_treat_data);
- } else {
- sapi_unregister_post_entry(mbstr_post_entries);
- sapi_register_post_entries(php_post_entries);
- sapi_register_treat_data(php_default_treat_data);
- }
- return SUCCESS;
-}
-/* }}} */
-
/* {{{ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
* http input processing */
MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
{
char *res = NULL, *separator=NULL;
const char *c_var;
- pval *array_ptr;
+ zval *array_ptr;
int free_buffer=0;
enum mbfl_no_encoding detected;
php_mb_encoding_handler_info_t info;
+ if (!MBSTRG(encoding_translation)) {
+ php_default_treat_data(arg, str, destArray TSRMLS_CC);
+ return;
+ }
+
switch (arg) {
case PARSE_POST:
case PARSE_GET:
@@ -211,7 +184,7 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
}
/* }}} */
-/* {{{ enum mbfl_no_encoding _php_mb_encoding_handler_ex() */
+/* {{{ mbfl_no_encoding _php_mb_encoding_handler_ex() */
enum mbfl_no_encoding _php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res TSRMLS_DC)
{
char *var, *val;
diff --git a/ext/mbstring/mb_gpc.h b/ext/mbstring/mb_gpc.h
index 5723cc232..32bb3b551 100644
--- a/ext/mbstring/mb_gpc.h
+++ b/ext/mbstring/mb_gpc.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mb_gpc.h,v 1.4.2.1 2005/01/16 15:55:41 moriyoshi Exp $ */
+/* $Id: mb_gpc.h,v 1.5 2005/01/16 15:55:17 moriyoshi Exp $ */
/* {{{ includes */
#ifdef HAVE_CONFIG_H
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index a816f0467..6169888ee 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.214.2.4 2005/02/21 15:15:08 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.224.2.5 2005/11/25 21:55:25 hirokawa Exp $ */
/*
* PHP 4 Multibyte String module "mbstring"
@@ -55,6 +55,7 @@
#include "mbstring.h"
#include "ext/standard/php_string.h"
#include "ext/standard/php_mail.h"
+#include "ext/standard/exec.h"
#include "ext/standard/php_smart_str.h"
#include "ext/standard/url.h"
#include "main/php_output.h"
@@ -128,6 +129,12 @@ static const enum mbfl_no_encoding php_mb_default_identify_list_ru[] = {
mbfl_no_encoding_cp866
};
+static const enum mbfl_no_encoding php_mb_default_identify_list_hy[] = {
+ mbfl_no_encoding_ascii,
+ mbfl_no_encoding_utf8,
+ mbfl_no_encoding_armscii8
+};
+
static const enum mbfl_no_encoding php_mb_default_identify_list_neut[] = {
mbfl_no_encoding_ascii,
mbfl_no_encoding_utf8
@@ -140,6 +147,7 @@ static const php_mb_nls_ident_list php_mb_default_identify_list[] = {
{ mbfl_no_language_traditional_chinese, php_mb_default_identify_list_tw_hk, sizeof(php_mb_default_identify_list_tw_hk) / sizeof(php_mb_default_identify_list_tw_hk[0]) },
{ mbfl_no_language_simplified_chinese, php_mb_default_identify_list_cn, sizeof(php_mb_default_identify_list_cn) / sizeof(php_mb_default_identify_list_cn[0]) },
{ mbfl_no_language_russian, php_mb_default_identify_list_ru, sizeof(php_mb_default_identify_list_ru) / sizeof(php_mb_default_identify_list_ru[0]) },
+ { mbfl_no_language_armenian, php_mb_default_identify_list_hy, sizeof(php_mb_default_identify_list_hy) / sizeof(php_mb_default_identify_list_hy[0]) },
{ mbfl_no_language_neutral, php_mb_default_identify_list_neut, sizeof(php_mb_default_identify_list_neut) / sizeof(php_mb_default_identify_list_neut[0]) }
};
@@ -227,6 +235,14 @@ zend_module_entry mbstring_module_entry = {
};
/* }}} */
+/* {{{ static sapi_post_entry php_post_entries[] */
+static sapi_post_entry php_post_entries[] = {
+ { DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_std_post_handler },
+ { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler },
+ { NULL, 0, NULL, NULL }
+};
+/* }}} */
+
ZEND_DECLARE_MODULE_GLOBALS(mbstring)
#ifdef COMPILE_DL_MBSTRING
@@ -283,6 +299,14 @@ static mbfl_allocators _php_mb_allocators = {
};
/* }}} */
+/* {{{ static sapi_post_entry mbstr_post_entries[] */
+static sapi_post_entry mbstr_post_entries[] = {
+ { DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_mb_post_handler },
+ { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler },
+ { NULL, 0, NULL, NULL }
+};
+/* }}} */
+
/* {{{ static int php_mb_parse_encoding_list()
* Return 0 if input contains any illegal encoding, otherwise 1.
* Even if any illegal encoding is detected the result may contain a list
@@ -680,10 +704,13 @@ static PHP_INI_MH(OnUpdate_mbstring_encoding_translation)
OnUpdateBool(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
- if (MBSTRG(encoding_translation)){
- _php_mb_enable_encoding_translation(1);
+ if (MBSTRG(encoding_translation)) {
+ sapi_unregister_post_entry(php_post_entries TSRMLS_CC);
+ sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
+ sapi_register_treat_data(mbstr_treat_data);
} else {
- _php_mb_enable_encoding_translation(0);
+ sapi_unregister_post_entry(mbstr_post_entries TSRMLS_CC);
+ sapi_register_post_entries(php_post_entries TSRMLS_CC);
}
return SUCCESS;
@@ -774,7 +801,8 @@ PHP_MINIT_FUNCTION(mbstring)
REGISTER_INI_ENTRIES();
if (MBSTRG(encoding_translation)) {
- _php_mb_enable_encoding_translation(1);
+ sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
+ sapi_register_treat_data(mbstr_treat_data);
}
REGISTER_LONG_CONSTANT("MB_OVERLOAD_MAIL", MB_OVERLOAD_MAIL, CONST_CS | CONST_PERSISTENT);
@@ -809,10 +837,6 @@ PHP_MSHUTDOWN_FUNCTION(mbstring)
free(MBSTRG(detect_order_list));
}
- if (MBSTRG(encoding_translation)) {
- _php_mb_enable_encoding_translation(0);
- }
-
#if HAVE_MBREGEX
PHP_MSHUTDOWN(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
@@ -861,6 +885,9 @@ PHP_RINIT_FUNCTION(mbstring)
case mbfl_no_language_german:
default_enc = "ISO-8859-15";
break;
+ case mbfl_no_language_armenian:
+ default_enc = "ArmSCII-8";
+ break;
case mbfl_no_language_english:
default:
default_enc = "ISO-8859-1";
@@ -2267,7 +2294,7 @@ PHP_FUNCTION(mb_list_encodings)
}
/* }}} */
-/* {{{ proto string mb_encode_mimeheader(string str [, string charset [, string transfer-encoding [, string linefeed]]])
+/* {{{ 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)
{
@@ -2279,12 +2306,13 @@ PHP_FUNCTION(mb_encode_mimeheader)
int trans_enc_name_len;
char *linefeed = "\r\n";
int linefeed_len;
+ int indent = 0;
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_encoding = MBSTRG(current_internal_encoding);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sss", (char **)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sssl", (char **)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len, &indent) == FAILURE) {
return;
}
@@ -2314,7 +2342,7 @@ PHP_FUNCTION(mb_encode_mimeheader)
}
mbfl_string_init(&result);
- ret = mbfl_mime_header_encode(&string, &result, charset, transenc, linefeed, 0);
+ ret = mbfl_mime_header_encode(&string, &result, charset, transenc, linefeed, indent);
if (ret != NULL) {
RETVAL_STRINGL((char *)ret->val, ret->len, 0) /* the string is already strdup()'ed */
} else {
@@ -2770,6 +2798,15 @@ PHP_FUNCTION(mb_decode_numericentity)
*/
#if HAVE_SENDMAIL
+#define SKIP_LONG_HEADER_SEP_MBSTRING(str, pos) \
+ if (str[pos] == '\r' && str[pos + 1] == '\n' && (str[pos + 2] == ' ' || str[pos + 2] == '\t')) { \
+ pos += 3; \
+ while (str[pos] == ' ' || str[pos] == '\t') { \
+ pos++; \
+ } \
+ continue; \
+ }
+
#define APPEND_ONE_CHAR(ch) do { \
if (token.a > 0) { \
smart_str_appendc(&token, ch); \
@@ -2981,6 +3018,9 @@ PHP_FUNCTION(mb_send_mail)
int subject_len;
char *extra_cmd=NULL;
int extra_cmd_len;
+ int i;
+ char *to_r;
+ char *force_extra_parameters = INI_STR("mail.force_extra_parameters");
struct {
int cnt_type:1;
int cnt_trans_enc:1;
@@ -3086,7 +3126,30 @@ PHP_FUNCTION(mb_send_mail)
}
/* To: */
- if (to == NULL || to_len <= 0) {
+ if (to != NULL) {
+ if (to_len > 0) {
+ to_r = estrndup(to, to_len);
+ for (; to_len; to_len--) {
+ if (!isspace((unsigned char) to_r[to_len - 1])) {
+ break;
+ }
+ to_r[to_len - 1] = '\0';
+ }
+ for (i = 0; to_r[i]; i++) {
+ if (iscntrl((unsigned char) to_r[i])) {
+ /* According to RFC 822, section 3.1.1 long headers may be separated into
+ * parts using CRLF followed at least one linear-white-space character ('\t' or ' ').
+ * To prevent these separators from being replaced with a space, we use the
+ * SKIP_LONG_HEADER_SEP_MBSTRING to skip over them.
+ */
+ SKIP_LONG_HEADER_SEP_MBSTRING(to_r, i);
+ to_r[i] = ' ';
+ }
+ }
+ } else {
+ to_r = to;
+ }
+ } else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing To: field");
err = 1;
}
@@ -3182,12 +3245,24 @@ PHP_FUNCTION(mb_send_mail)
mbfl_memory_device_output('\0', &device);
headers = (char *)device.buffer;
- if (!err && php_mail(to, subject, message, headers, extra_cmd TSRMLS_CC)) {
+ if (force_extra_parameters) {
+ extra_cmd = estrdup(force_extra_parameters);
+ } else if (extra_cmd) {
+ extra_cmd = php_escape_shell_cmd(extra_cmd);
+ }
+
+ if (!err && php_mail(to_r, subject, message, headers, extra_cmd TSRMLS_CC)) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
}
+ if (extra_cmd) {
+ efree(extra_cmd);
+ }
+ if (to_r != to) {
+ efree(to_r);
+ }
if (subject_buf) {
efree((void *)subject_buf);
}
@@ -3198,6 +3273,7 @@ PHP_FUNCTION(mb_send_mail)
zend_hash_destroy(&ht_headers);
}
+#undef SKIP_LONG_HEADER_SEP_MBSTRING
#undef APPEND_ONE_CHAR
#undef SEPARATE_SMART_STR
#undef PHP_MBSTR_MAIL_MIME_HEADER1
diff --git a/ext/mbstring/mbstring.dsp b/ext/mbstring/mbstring.dsp
index 1b678cc2f..63a7fa656 100644
--- a/ext/mbstring/mbstring.dsp
+++ b/ext/mbstring/mbstring.dsp
@@ -366,6 +366,10 @@ SOURCE=.\libmbfl\filters\mbfilter_koi8r.c
# End Source File
# Begin Source File
+SOURCE=.\libmbfl\filters\mbfilter_armscii8.c
+# End Source File
+# Begin Source File
+
SOURCE=.\libmbfl\mbfl\mbfilter_pass.c
# End Source File
# Begin Source File
@@ -480,6 +484,10 @@ SOURCE=.\libmbfl\nls\nls_uni.c
SOURCE=.\libmbfl\nls\nls_zh.c
# End Source File
+# Begin Source File
+
+SOURCE=.\libmbfl\nls\nls_hy.c
+# End Source File
# End Group
# Begin Group "Header Files No. 1"
@@ -667,6 +675,10 @@ SOURCE=.\libmbfl\filters\mbfilter_koi8r.h
# End Source File
# Begin Source File
+SOURCE=.\libmbfl\filters\mbfilter_armscii8.h
+# End Source File
+# Begin Source File
+
SOURCE=.\libmbfl\mbfl\mbfilter_pass.h
# End Source File
# Begin Source File
@@ -791,6 +803,10 @@ SOURCE=.\libmbfl\nls\nls_zh.h
# End Source File
# Begin Source File
+SOURCE=.\libmbfl\nls\nls_hy.h
+# End Source File
+# Begin Source File
+
SOURCE=.\libmbfl\filters\unicode_prop.h
# End Source File
# Begin Source File
@@ -879,6 +895,10 @@ SOURCE=.\libmbfl\filters\unicode_table_koi8r.h
# End Source File
# Begin Source File
+SOURCE=.\libmbfl\filters\unicode_table_armscii8.h
+# End Source File
+# Begin Source File
+
SOURCE=.\libmbfl\filters\unicode_table_uhc.h
# End Source File
# End Group
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index 01ab2c7a6..f0eab49dc 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: mbstring.h,v 1.65 2004/03/08 22:18:03 derick Exp $ */
+/* $Id: mbstring.h,v 1.66 2005/08/03 14:07:24 sniper Exp $ */
/*
* PHP 4 Multibyte String module "mbstring" (currently only for Japanese)
diff --git a/ext/mbstring/oniguruma/HISTORY b/ext/mbstring/oniguruma/HISTORY
index 65ef03f50..c648c5455 100644
--- a/ext/mbstring/oniguruma/HISTORY
+++ b/ext/mbstring/oniguruma/HISTORY
@@ -1,5 +1,19 @@
History
+2005/03/07: Version 3.7.1
+
+2005/03/07: [test] success in ruby 1.9.0 (2005-03-07) [i686-linux].
+2005/03/07: [impl] (thanks Rui Hirokawa)
+ add ONIG_ESCAPE_UCHAR_COLLISION.
+ rename UChar to OnigUChar in oniguruma.h.
+2005/03/07: [impl] remove declarations for Ruby in oniggnu.h.
+2005/03/05: [bug] ANCHOR_ANYCHAR_STAR didn't work in onig_search().
+2005/03/01: [dist] remove oniggnu.h from MANIFEST-RUBY.
+ remove oniggnu.h from make 19.
+2005/03/01: [bug] (thanks matz) [ruby-dev:25778]
+ uninitialized member (OptEnv.backrefed_status)
+ was used.
+
2005/02/19: Version 3.7.0
2005/02/19: [test] success in ruby 1.9.0 (2005-02-19) [i386-cygwin].
diff --git a/ext/mbstring/oniguruma/index.html b/ext/mbstring/oniguruma/index.html
index 293ea442a..02e844c36 100755
--- a/ext/mbstring/oniguruma/index.html
+++ b/ext/mbstring/oniguruma/index.html
@@ -5,14 +5,18 @@
</head>
<body BGCOLOR="#ffffff" VLINK="#808040" TEXT="#696969">
-<h2>Oniguruma</h2>
-<p>
-2005/02/19 (C) K.Kosako
-</p>
-<p>
+<!--
<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
</p>
<p>
@@ -38,7 +42,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>Character types(\w, \s, \d and POSIX bracket) were supported in full code point range with the Version 4.0.1 of the <a href="http://www.unicode.org/ucd/">Unicode Standard</a>. (since Version 3.5.0)
+<li>released Version 3.7.1 (2005/03/07)
+<li>released Version 2.4.2 (2005/03/05)
</ul>
</dl>
@@ -49,7 +54,7 @@ ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16
<ul>
<li> (1) C library (supported APIs: GNU regex, POSIX and Oniguruma native)
<li> (2) Built-in regular expressions engine of <a href="http://www.ruby-lang.org/">Ruby</a> 1.6/1.8/1.9 <br>
- In Ruby 1.9, Oniguruma is already incorporated by Kazuo Saito.
+ In Ruby 1.9, Oniguruma is already integrated by Kazuo Saito.
</ul>
</dl>
@@ -70,12 +75,12 @@ It follows the BSD license in the case of the one except for it.
<dt><b>Download:</b>
<ul>
-<li> <a href="archive/onigd20050219.tar.gz">Latest release version 3.7.0</a> (2005/02/19) <a href="HISTORY_3X.txt">Change Log</a>
+<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/onigd20050119.tar.gz">3.5.4</a> (2005/01/19)
-<li> <a href="archive/onigd2_4_1.tar.gz">Latest release version 2.4.1</a> (2005/01/05) <a href="HISTORY_2X.txt">Change Log</a>
+<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/onigd2_3_3.tar.gz">2.3.3</a> (2004/10/30)
</ul>
<br>
@@ -86,7 +91,7 @@ It follows the BSD license in the case of the one except for it.
<br>
<br>
-<dt><b>Documents:</b> (version 3.7.0)
+<dt><b>Documents:</b> (version 3.7.1)
<ul>
<li> <a href="doc/RE.txt">Regular Expressions</a>
<a href="doc/RE.ja.txt">(Japanese: EUC-JP)</a>
@@ -162,7 +167,7 @@ and I'm thankful to Akinori MUSHA.
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.6.0 or 2.4.1.<br>
+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.
diff --git a/ext/mbstring/oniguruma/oniggnu.h b/ext/mbstring/oniguruma/oniggnu.h
index 4a6951546..b203f6c8a 100644
--- a/ext/mbstring/oniguruma/oniggnu.h
+++ b/ext/mbstring/oniguruma/oniggnu.h
@@ -56,47 +56,9 @@ extern "C" {
#define RE_OPTION_DONT_CAPTURE_GROUP ONIG_OPTION_DONT_CAPTURE_GROUP
#define RE_OPTION_CAPTURE_GROUP ONIG_OPTION_CAPTURE_GROUP
-#ifdef RUBY_PLATFORM
-#ifndef ONIG_RUBY_M17N
-
-ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
-
-#undef ismbchar
-#define ismbchar(c) (mbclen((c)) != 1)
-#define mbclen(c) \
- ONIGENC_MBC_ENC_LEN(OnigEncDefaultCharEncoding, (UChar* )(&c))
-
-#endif /* ifndef ONIG_RUBY_M17N */
-
-#define re_mbcinit ruby_re_mbcinit
-#define re_compile_pattern ruby_re_compile_pattern
-#define re_recompile_pattern ruby_re_recompile_pattern
-#define re_free_pattern ruby_re_free_pattern
-#define re_adjust_startpos ruby_re_adjust_startpos
-#define re_search ruby_re_search
-#define re_match ruby_re_match
-#define re_set_casetable ruby_re_set_casetable
-#define re_copy_registers ruby_re_copy_registers
-#define re_free_registers ruby_re_free_registers
-#define register_info_type ruby_register_info_type
-#define re_error_code_to_str ruby_error_code_to_str
-
-#define ruby_error_code_to_str onig_error_code_to_str
-#define ruby_re_copy_registers onig_region_copy
-#else
-#define re_error_code_to_str onig_error_code_to_str
-#define re_copy_registers onig_region_copy
-#endif
-
-#ifdef ONIG_RUBY_M17N
-ONIG_EXTERN
-void re_mbcinit P_((OnigEncoding));
-#else
ONIG_EXTERN
void re_mbcinit P_((int));
-#endif
-
ONIG_EXTERN
int re_compile_pattern P_((const char*, int, struct re_pattern_buffer*, char* err_buf));
ONIG_EXTERN
diff --git a/ext/mbstring/oniguruma/oniguruma.h b/ext/mbstring/oniguruma/oniguruma.h
index 2106774f7..279035610 100644
--- a/ext/mbstring/oniguruma/oniguruma.h
+++ b/ext/mbstring/oniguruma/oniguruma.h
@@ -38,7 +38,7 @@ extern "C" {
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 3
#define ONIGURUMA_VERSION_MINOR 7
-#define ONIGURUMA_VERSION_TEENY 0
+#define ONIGURUMA_VERSION_TEENY 1
#ifdef __cplusplus
# ifndef HAVE_PROTOTYPES
@@ -81,7 +81,11 @@ extern "C" {
/* PART: character encoding */
-typedef unsigned char UChar;
+#ifndef ONIG_ESCAPE_UCHAR_COLLISION
+#define UChar OnigUChar
+#endif
+
+typedef unsigned char OnigUChar;
typedef unsigned long OnigCodePoint;
typedef unsigned int OnigDistance;
@@ -151,24 +155,24 @@ typedef m17n_encoding* OnigEncoding;
#else
typedef struct {
- int (*mbc_enc_len)(const UChar* p);
+ int (*mbc_enc_len)(const OnigUChar* p);
const char* name;
int max_enc_len;
int min_enc_len;
OnigAmbigType support_ambig_flag;
OnigMetaCharTableType meta_char_table;
- int (*is_mbc_newline)(const UChar* p, const UChar* end);
- OnigCodePoint (*mbc_to_code)(const UChar* p, const UChar* end);
+ int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end);
+ OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end);
int (*code_to_mbclen)(OnigCodePoint code);
- int (*code_to_mbc)(OnigCodePoint code, UChar *buf);
- int (*mbc_to_normalize)(OnigAmbigType flag, const UChar** pp, const UChar* end, UChar* to);
- int (*is_mbc_ambiguous)(OnigAmbigType flag, const UChar** pp, const UChar* end);
+ int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf);
+ int (*mbc_to_normalize)(OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to);
+ int (*is_mbc_ambiguous)(OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end);
int (*get_all_pair_ambig_codes)(OnigAmbigType flag, OnigPairAmbigCodes** acs);
int (*get_all_comp_ambig_codes)(OnigAmbigType flag, OnigCompAmbigCodes** acs);
int (*is_code_ctype)(OnigCodePoint code, unsigned int ctype);
int (*get_ctype_code_range)(int ctype, OnigCodePoint* sb_range[], OnigCodePoint* mb_range[]);
- UChar* (*left_adjust_char_head)(const UChar* start, const UChar* p);
- int (*is_allowed_reverse_match)(const UChar* p, const UChar* end);
+ OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p);
+ int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end);
} OnigEncodingType;
typedef OnigEncodingType* OnigEncoding;
@@ -335,22 +339,22 @@ ONIG_EXTERN OnigEncodingType OnigEncodingBIG5;
ONIG_EXTERN
int onigenc_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, int ctype));
ONIG_EXTERN
-int onigenc_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
+int onigenc_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, OnigUChar *buf));
ONIG_EXTERN
-int onigenc_mbc_to_normalize P_((OnigEncoding enc, OnigAmbigType flag, const UChar** pp, const UChar* end, UChar* buf));
+int onigenc_mbc_to_normalize P_((OnigEncoding enc, OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* buf));
ONIG_EXTERN
-int onigenc_is_mbc_ambiguous P_((OnigEncoding enc, OnigAmbigType flag, const UChar** pp, const UChar* end));
+int onigenc_is_mbc_ambiguous P_((OnigEncoding enc, OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end));
ONIG_EXTERN
-int onigenc_is_allowed_reverse_match P_((OnigEncoding enc, const UChar* s, const UChar* end));
+int onigenc_is_allowed_reverse_match P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end));
#else /* ONIG_RUBY_M17N */
#define ONIGENC_NAME(enc) ((enc)->name)
#define ONIGENC_MBC_TO_NORMALIZE(enc,flag,pp,end,buf) \
- (enc)->mbc_to_normalize(flag,(const UChar** )pp,end,buf)
+ (enc)->mbc_to_normalize(flag,(const OnigUChar** )pp,end,buf)
#define ONIGENC_IS_MBC_AMBIGUOUS(enc,flag,pp,end) \
- (enc)->is_mbc_ambiguous(flag,(const UChar** )pp,end)
+ (enc)->is_mbc_ambiguous(flag,(const OnigUChar** )pp,end)
#define ONIGENC_SUPPORT_AMBIG_FLAG(enc) ((enc)->support_ambig_flag)
#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
(enc)->is_allowed_reverse_match(s,end)
@@ -407,7 +411,7 @@ int onigenc_is_allowed_reverse_match P_((OnigEncoding enc, const UChar* s, const
(enc)->get_ctype_code_range(ctype,sbr,mbr)
ONIG_EXTERN
-UChar* onigenc_step_back P_((OnigEncoding enc, const UChar* start, const UChar* s, int n));
+OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, int n));
#endif /* is not ONIG_RUBY_M17N */
@@ -420,21 +424,21 @@ int onigenc_set_default_encoding P_((OnigEncoding enc));
ONIG_EXTERN
OnigEncoding onigenc_get_default_encoding P_(());
ONIG_EXTERN
-void onigenc_set_default_caseconv_table P_((const UChar* table));
+void onigenc_set_default_caseconv_table P_((const OnigUChar* table));
ONIG_EXTERN
-UChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const UChar* start, const UChar* s, const UChar** prev));
+OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar** prev));
ONIG_EXTERN
-UChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const UChar* start, const UChar* s));
+OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
ONIG_EXTERN
-UChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const UChar* start, const UChar* s));
+OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
ONIG_EXTERN
-UChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const UChar* start, const UChar* s));
+OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));
ONIG_EXTERN
-int onigenc_strlen P_((OnigEncoding enc, const UChar* p, const UChar* end));
+int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));
ONIG_EXTERN
-int onigenc_strlen_null P_((OnigEncoding enc, const UChar* p));
+int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
ONIG_EXTERN
-int onigenc_str_bytelen_null P_((OnigEncoding enc, const UChar* p));
+int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
@@ -697,8 +701,8 @@ struct re_registers {
typedef struct re_registers OnigRegion;
typedef struct {
- UChar* par;
- UChar* par_end;
+ OnigUChar* par;
+ OnigUChar* par_end;
} OnigErrorInfo;
typedef struct {
@@ -778,25 +782,25 @@ typedef struct {
ONIG_EXTERN
int onig_init P_((void));
ONIG_EXTERN
-int onig_error_code_to_str PV_((UChar* s, int err_code, ...));
+int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
ONIG_EXTERN
void onig_set_warn_func P_((OnigWarnFunc f));
ONIG_EXTERN
void onig_set_verb_warn_func P_((OnigWarnFunc f));
ONIG_EXTERN
-int onig_new P_((regex_t**, const UChar* pattern, const UChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
+int onig_new P_((regex_t**, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
ONIG_EXTERN
-int onig_new_deluxe P_((regex_t** reg, const UChar* pattern, const UChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
+int onig_new_deluxe P_((regex_t** reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
ONIG_EXTERN
void onig_free P_((regex_t*));
ONIG_EXTERN
-int onig_recompile P_((regex_t*, const UChar* pattern, const UChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
+int onig_recompile P_((regex_t*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
ONIG_EXTERN
-int onig_recompile_deluxe P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
+int onig_recompile_deluxe P_((regex_t* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
ONIG_EXTERN
-int onig_search P_((regex_t*, const UChar* str, const UChar* end, const UChar* start, const UChar* range, OnigRegion* region, OnigOptionType option));
+int onig_search P_((regex_t*, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
-int onig_match P_((regex_t*, const UChar* str, const UChar* end, const UChar* at, OnigRegion* region, OnigOptionType option));
+int onig_match P_((regex_t*, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
OnigRegion* onig_region_new P_((void));
ONIG_EXTERN
@@ -812,11 +816,11 @@ 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 UChar* name, const UChar* name_end, int** nums));
+int onig_name_to_group_numbers P_((regex_t* reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));
ONIG_EXTERN
-int onig_name_to_backref_number P_((regex_t* reg, const UChar* name, const UChar* name_end, OnigRegion *region));
+int onig_name_to_backref_number P_((regex_t* reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));
ONIG_EXTERN
-int onig_foreach_name P_((regex_t* reg, int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), void* arg));
+int onig_foreach_name P_((regex_t* reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,regex_t*,void*), void* arg));
ONIG_EXTERN
int onig_number_of_names P_((regex_t* reg));
ONIG_EXTERN
diff --git a/ext/mbstring/oniguruma/regcomp.c b/ext/mbstring/oniguruma/regcomp.c
index 5171b15a3..a2315fcec 100644
--- a/ext/mbstring/oniguruma/regcomp.c
+++ b/ext/mbstring/oniguruma/regcomp.c
@@ -3339,7 +3339,6 @@ typedef struct {
typedef struct {
MinMaxLen mmd;
- BitStatusType backrefed_status;
OnigEncoding enc;
OnigOptionType options;
OnigAmbigType ambig_flag;
@@ -4271,7 +4270,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
r = optimize_node_left(en->target, opt, env);
if (is_set_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK)) {
- if (BIT_STATUS_AT(env->backrefed_status, en->regnum))
+ if (BIT_STATUS_AT(env->scan_env->backrefed_mem, en->regnum))
remove_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK);
}
}
diff --git a/ext/mbstring/oniguruma/regexec.c b/ext/mbstring/oniguruma/regexec.c
index 2c082de42..25d97773f 100644
--- a/ext/mbstring/oniguruma/regexec.c
+++ b/ext/mbstring/oniguruma/regexec.c
@@ -3354,8 +3354,11 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
if (sch_range > end) sch_range = (UChar* )end;
}
}
- if (reg->dmax != ONIG_INFINITE_DISTANCE &&
- (end - start) >= reg->threshold_len) {
+
+ if ((end - start) < reg->threshold_len)
+ goto mismatch;
+
+ if (reg->dmax != ONIG_INFINITE_DISTANCE) {
do {
if (! forward_search_range(reg, str, end, s, sch_range,
&low, &high, &low_prev)) goto mismatch;
@@ -3368,22 +3371,26 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
prev = s;
s += enc_len(reg->enc, s);
}
- if ((reg->anchor & ANCHOR_ANYCHAR_STAR) != 0) {
- if (IS_NOT_NULL(prev)) {
- while (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end) &&
- s < range) {
- prev = s;
- s += enc_len(reg->enc, s);
- }
- }
- }
} while (s < range);
goto mismatch;
}
else { /* check only. */
- if ((end - start) < reg->threshold_len ||
- ! forward_search_range(reg, str, end, s, sch_range,
+ if (! forward_search_range(reg, str, end, s, sch_range,
&low, &high, (UChar** )NULL)) goto mismatch;
+
+ if ((reg->anchor & ANCHOR_ANYCHAR_STAR) != 0) {
+ do {
+ MATCH_AND_RETURN_CHECK;
+ prev = s;
+ s += enc_len(reg->enc, s);
+
+ while (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end) && s < range) {
+ prev = s;
+ s += enc_len(reg->enc, s);
+ }
+ } while (s < range);
+ goto mismatch;
+ }
}
}
diff --git a/ext/mbstring/oniguruma/reggnu.c b/ext/mbstring/oniguruma/reggnu.c
index 2c8169c48..70e8582ff 100644
--- a/ext/mbstring/oniguruma/reggnu.c
+++ b/ext/mbstring/oniguruma/reggnu.c
@@ -29,7 +29,7 @@
#include "regint.h"
-#ifndef ONIGGNU_H /* name changes from oniggnu.h to regex.h in ruby. */
+#ifndef ONIGGNU_H
#include "oniggnu.h"
#endif
diff --git a/ext/mbstring/oniguruma/regint.h b/ext/mbstring/oniguruma/regint.h
index a704b0e26..2bd514b7c 100644
--- a/ext/mbstring/oniguruma/regint.h
+++ b/ext/mbstring/oniguruma/regint.h
@@ -73,7 +73,7 @@
#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */
/* interface to external system */
-#ifdef NOT_RUBY /* gived from Makefile */
+#ifdef NOT_RUBY /* given from Makefile */
#include "config.h"
#define USE_CAPTURE_HISTORY
#define USE_VARIABLE_META_CHARS
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index a7db7585d..c67d77b0c 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_mbregex.c,v 1.48.2.2 2005/02/21 10:20:23 moriyoshi Exp $ */
+/* $Id: php_mbregex.c,v 1.53 2005/08/03 14:07:24 sniper Exp $ */
#ifdef HAVE_CONFIG_H
@@ -283,11 +283,11 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
int found = 0;
php_mb_regex_t *retval = NULL, **rc = NULL;
OnigErrorInfo err_info;
- UChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
+ OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
found = zend_hash_find(&MBSTRG(ht_rc), (char *)pattern, patlen+1, (void **) &rc);
if (found == FAILURE || (*rc)->options != options || (*rc)->enc != enc || (*rc)->syntax != syntax) {
- if ((err_code = onig_new(&retval, (UChar *)pattern, (UChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
+ if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
onig_error_code_to_str(err_str, err_code, err_info);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex compile err: %s", err_str);
retval = NULL;
@@ -559,7 +559,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
regs = onig_region_new();
/* actually execute the regular expression */
- if (onig_search(re, (UChar *)string, (UChar *)(string + string_len), string, (UChar *)(string + string_len), regs, 0) < 0) {
+ if (onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), string, (OnigUChar *)(string + string_len), regs, 0) < 0) {
RETVAL_FALSE;
goto out;
}
@@ -634,8 +634,8 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
smart_str eval_buf = { 0 };
smart_str *pbuf;
int i, err, eval, n;
- UChar *pos;
- UChar *string_lim;
+ OnigUChar *pos;
+ OnigUChar *string_lim;
char *description = NULL;
char pat_buf[2];
@@ -699,12 +699,12 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
/* do the actual work */
err = 0;
pos = string;
- string_lim = (UChar*)(string + string_len);
+ string_lim = (OnigUChar*)(string + string_len);
regs = onig_region_new();
while (err >= 0) {
- err = onig_search(re, (UChar *)string, (UChar *)string_lim, pos, (UChar *)string_lim, regs, 0);
+ err = onig_search(re, (OnigUChar *)string, (OnigUChar *)string_lim, pos, (OnigUChar *)string_lim, regs, 0);
if (err <= -2) {
- UChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
+ OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in php_mbereg_replace_exec(): %s", err_str);
break;
@@ -717,7 +717,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
}
#endif
/* copy the part of the string before the match */
- smart_str_appendl(&out_buf, pos, (size_t)((UChar *)(string + regs->beg[0]) - pos));
+ smart_str_appendl(&out_buf, pos, (size_t)((OnigUChar *)(string + regs->beg[0]) - pos));
/* copy replacement and backrefs */
i = 0;
p = replace;
@@ -754,7 +754,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
zval_dtor(&v);
}
n = regs->end[0];
- if ((size_t)(pos - (UChar *)string) < n) {
+ if ((size_t)(pos - (OnigUChar *)string) < n) {
pos = string + n;
} else {
if (pos < string_lim) {
@@ -814,7 +814,7 @@ PHP_FUNCTION(mb_split)
php_mb_regex_t *re;
OnigRegion *regs = NULL;
char *string;
- UChar *pos;
+ OnigUChar *pos;
int string_len;
int n, err;
@@ -835,28 +835,28 @@ PHP_FUNCTION(mb_split)
array_init(return_value);
- pos = (UChar *)string;
+ pos = (OnigUChar *)string;
err = 0;
regs = onig_region_new();
/* churn through str, generating array entries as we go */
while ((--count != 0) &&
- (err = onig_search(re, (UChar *)string, (UChar *)(string + string_len), pos, (UChar *)(string + string_len), regs, 0)) >= 0) {
+ (err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0)) >= 0) {
if (regs->beg[0] == regs->end[0]) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
break;
}
/* add it to the array */
- if (regs->beg[0] < string_len && regs->beg[0] >= (size_t)(pos - (UChar *)string)) {
- add_next_index_stringl(return_value, pos, ((UChar *)(string + regs->beg[0]) - pos), 1);
+ if (regs->beg[0] < string_len && regs->beg[0] >= (size_t)(pos - (OnigUChar *)string)) {
+ add_next_index_stringl(return_value, pos, ((OnigUChar *)(string + regs->beg[0]) - pos), 1);
} else {
err = -2;
break;
}
/* point at our new starting point */
n = regs->end[0];
- if ((pos - (UChar *)string) < n) {
- pos = (UChar *)string + n;
+ if ((pos - (OnigUChar *)string) < n) {
+ pos = (OnigUChar *)string + n;
}
if (count < 0) {
count = 0;
@@ -868,7 +868,7 @@ PHP_FUNCTION(mb_split)
/* see if we encountered an error */
if (err <= -2) {
- UChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
+ OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbsplit(): %s", err_str);
zval_dtor(return_value);
@@ -876,11 +876,11 @@ PHP_FUNCTION(mb_split)
}
/* otherwise we just have one last element to add to the array */
- n = ((UChar *)(string + string_len) - pos);
+ n = ((OnigUChar *)(string + string_len) - pos);
if (n > 0) {
add_next_index_stringl(return_value, pos, n, 1);
} else {
- add_next_index_stringl(return_value, empty_string, 0, 1);
+ add_next_index_stringl(return_value, "", 0, 1);
}
}
/* }}} */
@@ -922,7 +922,7 @@ PHP_FUNCTION(mb_ereg_match)
}
/* match */
- err = onig_match(re, (UChar *)string, (UChar *)(string + string_len), (UChar *)string, NULL, 0);
+ err = onig_match(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), (OnigUChar *)string, NULL, 0);
if (err >= 0) {
RETVAL_TRUE;
} else {
@@ -938,7 +938,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
zval **arg_pattern, **arg_options;
int n, i, err, pos, len, beg, end, option;
- UChar *str;
+ OnigUChar *str;
OnigSyntaxType *syntax;
option = MBSTRG(regex_default_options);
@@ -975,7 +975,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
str = NULL;
len = 0;
if (MBSTRG(search_str) != NULL && Z_TYPE_P(MBSTRG(search_str)) == IS_STRING){
- str = (UChar *)Z_STRVAL_P(MBSTRG(search_str));
+ str = (OnigUChar *)Z_STRVAL_P(MBSTRG(search_str));
len = Z_STRLEN_P(MBSTRG(search_str));
}
@@ -999,7 +999,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
MBSTRG(search_pos) = len;
RETVAL_FALSE;
} else if (err <= -2) {
- UChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
+ OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str);
RETVAL_FALSE;
@@ -1138,12 +1138,12 @@ PHP_FUNCTION(mb_ereg_search_init)
PHP_FUNCTION(mb_ereg_search_getregs)
{
int n, i, len, beg, end;
- UChar *str;
+ OnigUChar *str;
if (MBSTRG(search_regs) != NULL && Z_TYPE_P(MBSTRG(search_str)) == IS_STRING && Z_STRVAL_P(MBSTRG(search_str)) != NULL) {
array_init(return_value);
- str = (UChar *)Z_STRVAL_P(MBSTRG(search_str));
+ str = (OnigUChar *)Z_STRVAL_P(MBSTRG(search_str));
len = Z_STRLEN_P(MBSTRG(search_str));
n = MBSTRG(search_regs)->num_regs;
for (i = 0; i < n; i++) {
diff --git a/ext/mbstring/php_mbregex.h b/ext/mbstring/php_mbregex.h
index dd5c6bf2d..8c523b831 100644
--- a/ext/mbstring/php_mbregex.h
+++ b/ext/mbstring/php_mbregex.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_mbregex.h,v 1.11 2004/02/28 20:45:23 moriyoshi Exp $ */
+/* $Id: php_mbregex.h,v 1.12 2005/08/03 14:07:24 sniper Exp $ */
#ifndef _PHP_MBREGEX_H
#define _PHP_MBREGEX_H
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index 42ecaa8d5..99eed1d8d 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h
index c2d360a24..6e3c5c1f7 100644
--- a/ext/mbstring/php_unicode.h
+++ b/ext/mbstring/php_unicode.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/mbstring/tests/htmlent.phpt b/ext/mbstring/tests/htmlent.phpt
index ca7d64ba4..e49714ddc 100644
--- a/ext/mbstring/tests/htmlent.phpt
+++ b/ext/mbstring/tests/htmlent.phpt
@@ -6,18 +6,19 @@ HTML input/output
extension_loaded('mbstring') or die('skip mbstring not available');
?>
--INI--
+output_buffering=4096
output_handler=mb_output_handler
zlib.output_compression=
-arg_separator.input="x"
+arg_separator.input=x
error_reporting=0
mbstring.http_input=HTML-ENTITIES
-mbstring.internal_encoding=UTF8
+mbstring.internal_encoding=UTF-8
mbstring.http_output=HTML-ENTITIES
mbstring.encoding_translation=1
--FILE--
<?php
// enable output encoding through output handler
-ob_start("mb_output_handler");
+//ob_start("mb_output_handler");
// &#64... are must be decoded on input these are not reencoded on output.
// If you see &#64;&#65;&#66; on output this means input encoding fails.
// If you do not see &auml;... on output this means output encoding fails.
@@ -27,9 +28,14 @@ ob_start("mb_output_handler");
?>
<?php echo mb_http_input('l').'>'.mb_internal_encoding().'>'.mb_http_output();?>
-<?php mb_parse_str("test=&&;&&#64;&#65;&#66;&#128;&#129;&#130;&auml;&ouml;&uuml;&euro;&lang;&rang;");
-echo "test='$test'";
+<?php mb_parse_str("test=&#38;&#64;&#65;&#66;&#128;&#129;&#130;&auml;&ouml;&uuml;&euro;&lang;&rang;", $test);
+print_r($test);
?>
+===DONE===
--EXPECT--
HTML-ENTITIES>UTF-8>HTML-ENTITIES
-test='&&;&@AB&#128;&#129;&#130;&auml;&ouml;&uuml;&euro;&lang;&rang;' \ No newline at end of file
+Array
+(
+ [test] => &@AB&#128;&#129;&#130;&auml;&ouml;&uuml;&euro;&lang;&rang;
+)
+===DONE===
diff --git a/ext/mcrypt/config.m4 b/ext/mcrypt/config.m4
index cba74d1ee..2a36c0a83 100644
--- a/ext/mcrypt/config.m4
+++ b/ext/mcrypt/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.28.2.2 2005/01/22 01:36:56 sniper Exp $
+dnl $Id: config.m4,v 1.31 2005/05/29 23:16:41 sniper Exp $
dnl
AC_DEFUN([PHP_MCRYPT_CHECK_VERSION],[
@@ -21,7 +21,7 @@ AC_DEFUN([PHP_MCRYPT_CHECK_VERSION],[
PHP_ARG_WITH(mcrypt, for mcrypt support,
-[ --with-mcrypt[=DIR] Include mcrypt support.])
+[ --with-mcrypt[=DIR] Include mcrypt support])
if test "$PHP_MCRYPT" != "no"; then
for i in $PHP_MCRYPT /usr/local /usr; do
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index 0338b8e6c..cf947a3dc 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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 @@
| Derick Rethans <derick@derickrethans.nl> |
+----------------------------------------------------------------------+
*/
-/* $Id: mcrypt.c,v 1.90 2004/04/18 14:04:48 derick Exp $ */
+/* $Id: mcrypt.c,v 1.91 2005/08/03 14:07:24 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/mcrypt/php_mcrypt.h b/ext/mcrypt/php_mcrypt.h
index 30fa69270..a6bd1ffd0 100644
--- a/ext/mcrypt/php_mcrypt.h
+++ b/ext/mcrypt/php_mcrypt.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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 @@
| Derick Rethans <derick@derickrethans.nl> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_mcrypt.h,v 1.25 2004/01/08 17:32:21 sniper Exp $ */
+/* $Id: php_mcrypt.h,v 1.26 2005/08/03 14:07:24 sniper Exp $ */
#ifndef PHP_MCRYPT_H
#define PHP_MCRYPT_H
diff --git a/ext/mcve/CREDITS b/ext/mcve/CREDITS
deleted file mode 100644
index 9111acffa..000000000
--- a/ext/mcve/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-MCVE
-Brad House, Chris Faulhaber, Steven Schoch
diff --git a/ext/mcve/config.m4 b/ext/mcve/config.m4
deleted file mode 100644
index ae7b936c6..000000000
--- a/ext/mcve/config.m4
+++ /dev/null
@@ -1,110 +0,0 @@
-dnl config.m4 for PHP MCVE Extension
-
-PHP_ARG_WITH(mcve, for MCVE support,
-[ --with-mcve[=DIR] Include MCVE support. libmcve >= 3.2.2 or libmonetra >= 4.0 required])
-
-PHP_ARG_WITH(openssl-dir,OpenSSL dir for MCVE,
-[ --with-openssl-dir[=DIR] MCVE: openssl install prefix.], no, no)
-
-if test "$PHP_MCVE" != "no"; then
- dnl determine egrep command for AC_EGREP_CPP below
- AC_CHECK_PROG(EGREP, egrep, grep -E)
- AC_SUBST(EGREP)
-
- if test "$PHP_OPENSSL_DIR" != "no"; then
- PHP_OPENSSL=$PHP_OPENSSL_DIR
- PHP_SETUP_OPENSSL(MCVE_SHARED_LIBADD, [], [
- AC_MSG_ERROR([MCVE: OpenSSL check failed. Please check config.log for more information.])
- ])
- else
- AC_MSG_RESULT([If configure fails, try adding --with-openssl-dir=<DIR>])
- fi
-
- case "$PHP_MCVE" in
- yes [)]
- for i in /usr/local/mcve /usr/local /usr; do
- if test -r $i/include/mcve.h; then
- MCVE_DIR=$i
- break
- fi
- done
- ;;
- * [)]
- test -r "$PHP_MCVE/include/mcve.h" && MCVE_DIR=$PHP_MCVE
- ;;
- esac
-
- if test -z "$MCVE_DIR"; then
- AC_MSG_ERROR([mcve.h NOT FOUND. Please check your MCVE installation.])
- fi
-
- dnl Check version (M_EXPORT exists in >= 3.2.2)
- saved_CPPFLAGS=$CPPFLAGS
- AC_MSG_CHECKING([for correct libmcve version])
- AC_EGREP_CPP(yes,[
-#include "$MCVE_DIR/include/mcve.h"
-#ifdef M_EXPORT
-yes
-#endif
- ],[
- AC_MSG_RESULT([ok])
- ],[
- AC_MSG_ERROR([libmcve 3.2.2 or greater required.])
- ])
-
- AC_MSG_CHECKING([for correct libmonetra 4.2 or higher])
- AC_EGREP_CPP(yes,[
-#include "$MCVE_DIR/include/mcve.h"
-#ifdef MCVE_SetSSL_CAfile
-yes
-#endif
- ],[
- AC_MSG_RESULT([yes])
- ],[
- AC_DEFINE([LIBMONETRA_BELOW_4_2], 1, [Whether or not we're using libmonetra 4.2 or higher ])
- AC_MSG_RESULT([no])
- ])
-
- CPPFLAGS=$saved_CPPFLAGS
-
- PHP_ADD_INCLUDE($MCVE_DIR/include)
- PHP_ADD_LIBRARY_WITH_PATH(mcve, $MCVE_DIR/lib, MCVE_SHARED_LIBADD)
-
- dnl Build test. Check for libmcve or libmonetra
- dnl libmonetra_compat.h handle's MCVE_ -> M_ conversion
- dnl so it is API compatible
-
- has_mcve=0
- dnl check for libmcve
- PHP_CHECK_LIBRARY(mcve, MCVE_DestroyEngine,
- [
- has_mcve=1
- ], [
- has_mcve=0
- ], [
- $MCVE_SHARED_LIBADD
- ])
-
- dnl check for libmonetra if no proper libmcve
- dnl symlink named libmcve is created to libmonetra
- dnl during libmonetra install, so this is valid
- if test "$has_mcve" = "0" ; then
- PHP_CHECK_LIBRARY(mcve, M_DestroyEngine,
- [
- has_mcve=1
- ], [
- has_mcve=0
- ], [
- $MCVE_SHARED_LIBADD
- ])
- fi
-
- if test "$has_mcve" = "1" ; then
- AC_DEFINE(HAVE_MCVE, 1, [ ])
- else
- AC_MSG_ERROR([MCVE: Sanity check failed. Please check config.log for more information.])
- fi
-
- PHP_NEW_EXTENSION(mcve, mcve.c, $ext_shared)
- PHP_SUBST(MCVE_SHARED_LIBADD)
-fi
diff --git a/ext/mcve/config.w32 b/ext/mcve/config.w32
deleted file mode 100644
index 5d85f5ba6..000000000
--- a/ext/mcve/config.w32
+++ /dev/null
@@ -1,18 +0,0 @@
-// $Id: config.w32,v 1.1 2003/12/19 15:04:22 wez Exp $
-// vim:ft=javascript
-
-ARG_WITH("mcve", "MCVE support", "no");
-
-if (PHP_MCVE != "no") {
-
- if (CHECK_HEADER_ADD_INCLUDE("mcve.h", "CFLAGS_MCVE", PHP_MCVE) &&
- CHECK_LIB("ssleay32.lib", "mcve", PHP_MCVE) &&
- CHECK_LIB("libeay32.lib", "mcve", PHP_MCVE) &&
- CHECK_LIB("libmcve.lib", "mcve", PHP_MCVE)) {
- EXTENSION('mcve', 'mcve.c');
- AC_DEFINE('HAVE_MCVE', 1);
- } else {
- WARNING("mcve not enabled; libraries and headers not found");
- }
-}
-
diff --git a/ext/mcve/mcve.c b/ext/mcve/mcve.c
deleted file mode 100644
index bf5c9779d..000000000
--- a/ext/mcve/mcve.c
+++ /dev/null
@@ -1,2603 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Brad House <brad@mainstreetsoftworks.com> |
- | Chris Faulhaber <jedgar@fxp.org> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: mcve.c,v 1.28.2.5 2005/07/26 08:38:25 hyanantha Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-
-#if PHP_WIN32
-#include "config.w32.h"
-#else
-#include <php_config.h>
-#endif
-
-#if HAVE_MCVE
-
-/* standard php include(s) */
-#include "ext/standard/head.h"
-#include "ext/standard/php_standard.h"
-#include "ext/standard/info.h"
-
-/* local include(s) */
-#include <mcve.h>
-
-/* local php include(s) */
-#include "php_mcve.h"
-
-/* {{{ globals */
-static int le_conn; /* connection resource */
-static int le_user; /* store add/edit/get user information */
-
-static int mcve_init; /* For Safe Memory Deallocation */
-/* }}} */
-
-/* {{{ extension definition structures */
-function_entry mcve_functions[] = {
- PHP_FE(m_initengine, NULL)
- PHP_FE(m_initconn, NULL)
- PHP_FE(m_deleteresponse, NULL)
- PHP_FE(m_destroyconn, NULL)
- PHP_FE(m_setdropfile, NULL)
- PHP_FE(m_setip, NULL)
- PHP_FE(m_setssl, NULL)
-#if LIBMONETRA_VERSION >= 050000
- PHP_FE(m_setssl_cafile, NULL)
- PHP_FE(m_responsekeys, NULL)
-#endif
- PHP_FE(m_setssl_files, NULL)
- PHP_FE(m_settimeout, NULL)
- PHP_FE(m_setblocking, NULL)
- PHP_FE(m_verifyconnection, NULL)
- PHP_FE(m_verifysslcert, NULL)
- PHP_FE(m_maxconntimeout, NULL)
- PHP_FE(m_connectionerror, NULL)
- PHP_FE(m_deletetrans, NULL)
- PHP_FE(m_connect, NULL)
- PHP_FE(m_transnew, NULL)
- PHP_FE(m_transparam, NULL)
-#if LIBMONETRA_VERSION >= 050000
- PHP_FE(m_transkeyval, NULL)
- PHP_FE(m_validateidentifier, NULL)
-#endif
- PHP_FE(m_transsend, NULL)
- PHP_FE(m_ping, NULL)
- PHP_FE(m_responseparam, NULL)
- PHP_FE(m_returnstatus, NULL)
- PHP_FE(m_returncode, NULL)
- PHP_FE(m_transactionssent, NULL)
- PHP_FE(m_transactionitem, NULL)
- PHP_FE(m_transactionbatch, NULL)
- PHP_FE(m_transactionid, NULL)
- PHP_FE(m_transactionauth, NULL)
- PHP_FE(m_transactiontext, NULL)
- PHP_FE(m_transactionavs, NULL)
- PHP_FE(m_transactioncv, NULL)
- PHP_FE(m_getuserparam, NULL)
- PHP_FE(m_monitor, NULL)
- PHP_FE(m_transinqueue, NULL)
- PHP_FE(m_checkstatus, NULL)
- PHP_FE(m_completeauthorizations, second_arg_force_ref)
- PHP_FE(m_sale, NULL)
- PHP_FE(m_preauth, NULL)
- PHP_FE(m_void, NULL)
- PHP_FE(m_preauthcompletion, NULL)
- PHP_FE(m_force, NULL)
- PHP_FE(m_override, NULL)
- PHP_FE(m_return, NULL)
- PHP_FE(m_iscommadelimited, NULL)
- PHP_FE(m_parsecommadelimited, NULL)
- PHP_FE(m_getcommadelimited, NULL)
- PHP_FE(m_getcell, NULL)
- PHP_FE(m_getcellbynum, NULL)
- PHP_FE(m_numcolumns, NULL)
- PHP_FE(m_numrows, NULL)
- PHP_FE(m_getheader, NULL)
- PHP_FE(m_destroyengine, NULL)
- PHP_FE(m_settle, NULL)
- PHP_FE(m_gut, NULL)
- PHP_FE(m_gl, NULL)
- PHP_FE(m_gft, NULL)
- PHP_FE(m_qc, NULL)
- PHP_FE(m_ub, NULL)
- PHP_FE(m_chkpwd, NULL)
- PHP_FE(m_bt, NULL)
- PHP_FE(m_uwait, NULL)
- PHP_FE(m_text_code, NULL)
- PHP_FE(m_text_avs, NULL)
- PHP_FE(m_text_cv, NULL)
- PHP_FE(m_chngpwd, NULL)
- PHP_FE(m_listusers, NULL)
- PHP_FE(m_adduser, NULL)
- PHP_FE(m_enableuser, NULL)
- PHP_FE(m_disableuser, NULL)
- PHP_FE(m_getuserarg, NULL)
- PHP_FE(m_adduserarg, NULL)
- PHP_FE(m_deleteusersetup, NULL)
- PHP_FE(m_initusersetup, NULL)
- PHP_FE(m_deluser, NULL)
- PHP_FE(m_edituser, NULL)
- PHP_FE(m_liststats, NULL)
- /* Backwards compatability functions below */
- PHP_FE(mcve_initengine, NULL)
- PHP_FE(mcve_initconn, NULL)
- PHP_FE(mcve_deleteresponse, NULL)
- PHP_FE(mcve_destroyconn, NULL)
- PHP_FE(mcve_setdropfile, NULL)
- PHP_FE(mcve_setip, NULL)
- PHP_FE(mcve_setssl, NULL)
- PHP_FE(mcve_setssl_files, NULL)
- PHP_FE(mcve_settimeout, NULL)
- PHP_FE(mcve_setblocking, NULL)
- PHP_FE(mcve_verifyconnection, NULL)
- PHP_FE(mcve_verifysslcert, NULL)
- PHP_FE(mcve_maxconntimeout, NULL)
- PHP_FE(mcve_connectionerror, NULL)
- PHP_FE(mcve_deletetrans, NULL)
- PHP_FE(mcve_connect, NULL)
- PHP_FE(mcve_transnew, NULL)
- PHP_FE(mcve_transparam, NULL)
- PHP_FE(mcve_transsend, NULL)
- PHP_FE(mcve_ping, NULL)
- PHP_FE(mcve_responseparam, NULL)
- PHP_FE(mcve_returnstatus, NULL)
- PHP_FE(mcve_returncode, NULL)
- PHP_FE(mcve_transactionssent, NULL)
- PHP_FE(mcve_transactionitem, NULL)
- PHP_FE(mcve_transactionbatch, NULL)
- PHP_FE(mcve_transactionid, NULL)
- PHP_FE(mcve_transactionauth, NULL)
- PHP_FE(mcve_transactiontext, NULL)
- PHP_FE(mcve_transactionavs, NULL)
- PHP_FE(mcve_transactioncv, NULL)
- PHP_FE(mcve_getuserparam, NULL)
- PHP_FE(mcve_monitor, NULL)
- PHP_FE(mcve_transinqueue, NULL)
- PHP_FE(mcve_checkstatus, NULL)
- PHP_FE(mcve_completeauthorizations, second_arg_force_ref)
- PHP_FE(mcve_sale, NULL)
- PHP_FE(mcve_preauth, NULL)
- PHP_FE(mcve_void, NULL)
- PHP_FE(mcve_preauthcompletion, NULL)
- PHP_FE(mcve_force, NULL)
- PHP_FE(mcve_override, NULL)
- PHP_FE(mcve_return, NULL)
- PHP_FE(mcve_iscommadelimited, NULL)
- PHP_FE(mcve_parsecommadelimited, NULL)
- PHP_FE(mcve_getcommadelimited, NULL)
- PHP_FE(mcve_getcell, NULL)
- PHP_FE(mcve_getcellbynum, NULL)
- PHP_FE(mcve_numcolumns, NULL)
- PHP_FE(mcve_numrows, NULL)
- PHP_FE(mcve_getheader, NULL)
- PHP_FE(mcve_destroyengine, NULL)
- PHP_FE(mcve_settle, NULL)
- PHP_FE(mcve_gut, NULL)
- PHP_FE(mcve_gl, NULL)
- PHP_FE(mcve_gft, NULL)
- PHP_FE(mcve_qc, NULL)
- PHP_FE(mcve_ub, NULL)
- PHP_FE(mcve_chkpwd, NULL)
- PHP_FE(mcve_bt, NULL)
- PHP_FE(mcve_uwait, NULL)
- PHP_FE(mcve_text_code, NULL)
- PHP_FE(mcve_text_avs, NULL)
- PHP_FE(mcve_text_cv, NULL)
- PHP_FE(mcve_chngpwd, NULL)
- PHP_FE(mcve_listusers, NULL)
- PHP_FE(mcve_adduser, NULL)
- PHP_FE(mcve_enableuser, NULL)
- PHP_FE(mcve_disableuser, NULL)
- PHP_FE(mcve_getuserarg, NULL)
- PHP_FE(mcve_adduserarg, NULL)
- PHP_FE(mcve_deleteusersetup, NULL)
- PHP_FE(mcve_initusersetup, NULL)
- PHP_FE(mcve_deluser, NULL)
- PHP_FE(mcve_edituser, NULL)
- PHP_FE(mcve_liststats, NULL)
- { NULL, NULL, NULL }
-};
-
-zend_module_entry mcve_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
- STANDARD_MODULE_HEADER,
-#endif
- "mcve", /* module name */
- mcve_functions, /* struct of functions (see above) */
- PHP_MINIT(mcve), /* module initialization functions */
- NULL, /* module shutdown functions */
- NULL, /* request initialization functions */
- NULL, /* request shutdown functions */
- PHP_MINFO(mcve), /* declare the info function for phpinfo() */
-#if ZEND_MODULE_API_NO >= 20010901
- PHP_MCVE_VERSION, /* declare MCVE version number */
-#endif
- STANDARD_MODULE_PROPERTIES
-};
-
-/* }}} */
-
-/* declare the module for dynamic loading */
-#ifdef COMPILE_DL_MCVE
-ZEND_GET_MODULE(mcve)
-# ifdef PHP_WIN32
-# include "zend_arg_defs.c"
-# endif
-#endif
-
-/* {{{ MCVE_CONN destructor */
-static void _free_mcve_conn(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- MCVE_CONN *conn;
-
- conn = (MCVE_CONN *)rsrc->ptr;
- MCVE_DestroyConn(conn);
- efree(conn);
-}
-/* }}} */
-
-/* {{{ module initialization */
-PHP_MINIT_FUNCTION(mcve)
-{
- /* register the MCVE_CONN destructor */
- le_conn = zend_register_list_destructors_ex(_free_mcve_conn, NULL, "mcve connection", module_number);
-
- /* Key definitions for Transaction Parameters */
- REGISTER_LONG_CONSTANT("MC_TRANTYPE", MC_TRANTYPE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USERNAME", MC_USERNAME, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_PASSWORD", MC_PASSWORD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ACCOUNT", MC_ACCOUNT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRACKDATA", MC_TRACKDATA, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXPDATE", MC_EXPDATE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_STREET", MC_STREET, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ZIP", MC_ZIP, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CV", MC_CV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_COMMENTS", MC_COMMENTS, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CLERKID", MC_CLERKID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_STATIONID", MC_STATIONID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_APPRCODE", MC_APPRCODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_AMOUNT", MC_AMOUNT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_PTRANNUM", MC_PTRANNUM, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TTID", MC_TTID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER", MC_USER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_PWD", MC_PWD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ACCT", MC_ACCT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_BDATE", MC_BDATE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EDATE", MC_EDATE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_BATCH", MC_BATCH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_FILE", MC_FILE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN", MC_ADMIN, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_AUDITTYPE", MC_AUDITTYPE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CUSTOM", MC_CUSTOM, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXAMOUNT", MC_EXAMOUNT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES", MC_EXCHARGES, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_RATE", MC_RATE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_RENTERNAME", MC_RENTERNAME, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_RETURNCITY", MC_RETURNCITY, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_RETURNSTATE", MC_RETURNSTATE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_RETURNLOCATION", MC_RETURNLOCATION, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_PRIORITY", MC_PRIORITY, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_INQUIRY", MC_INQUIRY, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARDTYPES", MC_CARDTYPES, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_SUB", MC_SUB, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_MARKER", MC_MARKER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_DEVICETYPE", MC_DEVICETYPE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ERRORCODE", MC_ERRORCODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_NEWBATCH", MC_NEWBATCH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CURR", MC_CURR, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_DESCMERCH", MC_DESCMERCH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_DESCLOC", MC_DESCLOC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ORIGTYPE", MC_ORIGTYPE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_PIN", MC_PIN, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_VOIDORIGTYPE", MC_VOIDORIGTYPE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TIMESTAMP", MC_TIMESTAMP, MCVE_CONST);
-
- /* Args for priorities */
- REGISTER_LONG_CONSTANT("MC_PRIO_HIGH", MC_PRIO_HIGH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_PRIO_NORMAL", MC_PRIO_NORMAL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_PRIO_LOW", MC_PRIO_LOW, MCVE_CONST);
-
- /* Args for adding a user */
- REGISTER_LONG_CONSTANT("MC_USER_PROC", MC_USER_PROC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_USER", MC_USER_USER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_PWD", MC_USER_PWD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_INDCODE", MC_USER_INDCODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_MERCHID", MC_USER_MERCHID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_BANKID", MC_USER_BANKID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_TERMID", MC_USER_TERMID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_CLIENTNUM", MC_USER_CLIENTNUM, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_STOREID", MC_USER_STOREID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_AGENTID", MC_USER_AGENTID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_CHAINID", MC_USER_CHAINID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_ZIPCODE", MC_USER_ZIPCODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_TIMEZONE", MC_USER_TIMEZONE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_MERCHCAT", MC_USER_MERCHCAT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_MERNAME", MC_USER_MERNAME, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_MERCHLOC", MC_USER_MERCHLOC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_STATECODE", MC_USER_STATECODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_PHONE", MC_USER_PHONE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_SUB", MC_USER_SUB, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_CARDTYPES", MC_USER_CARDTYPES, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_MODE", MC_USER_MODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_VNUMBER", MC_USER_VNUMBER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_ROUTINGID", MC_USER_ROUTINGID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_PPROPERTY", MC_USER_PPROPERTY, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_PID", MC_USER_PID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_PIDPWD", MC_USER_PIDPWD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_SMID", MC_USER_SMID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_SMIDPWD", MC_USER_SMIDPWD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_USDDIV", MC_USER_USDDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_AUDDIV", MC_USER_AUDDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_DKKDIV", MC_USER_DKKDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_GBPDIV", MC_USER_GBPDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_HKDDIV", MC_USER_HKDDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_JPYDIV", MC_USER_JPYDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_NZDDIV", MC_USER_NZDDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_NOKDIV", MC_USER_NOKDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_SGDDIV", MC_USER_SGDDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_ZARDIV", MC_USER_ZARDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_SEKDIV", MC_USER_SEKDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_CHFDIV", MC_USER_CHFDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_CADDIV", MC_USER_CADDIV, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_USER_DIVNUM", MC_USER_DIVNUM, MCVE_CONST);
-
- /* Values for cardtypes */
- REGISTER_LONG_CONSTANT("MC_CARD_VISA", MC_CARD_VISA, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARD_MC", MC_CARD_MC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARD_AMEX", MC_CARD_AMEX, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARD_DISC", MC_CARD_DISC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARD_JCB", MC_CARD_JCB, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARD_CB", MC_CARD_CB, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARD_DC", MC_CARD_DC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARD_GIFT", MC_CARD_GIFT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARD_OTHER", MC_CARD_OTHER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_CARD_ALL", MC_CARD_ALL, MCVE_CONST);
-
- /* Values for modes */
- REGISTER_LONG_CONSTANT("MC_MODE_AUTH", MC_MODE_AUTH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_MODE_SETTLE", MC_MODE_SETTLE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_MODE_BOTH", MC_MODE_BOTH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_MODE_ALL", MC_MODE_ALL, MCVE_CONST);
-
- /* Values for EXCHARGES */
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_REST", MC_EXCHARGES_REST, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_GIFT", MC_EXCHARGES_GIFT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_MINI", MC_EXCHARGES_MINI, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_TELE", MC_EXCHARGES_TELE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_OTHER", MC_EXCHARGES_OTHER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_LAUND", MC_EXCHARGES_LAUND, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_NONE", MC_EXCHARGES_NONE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_GAS", MC_EXCHARGES_GAS, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_MILE", MC_EXCHARGES_MILE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_LATE", MC_EXCHARGES_LATE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_1WAY", MC_EXCHARGES_1WAY, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_EXCHARGES_VIOL", MC_EXCHARGES_VIOL, MCVE_CONST);
-
- /* Value definitions for Transaction Types */
- REGISTER_LONG_CONSTANT("MC_TRAN_SALE", MC_TRAN_SALE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_REDEMPTION", MC_TRAN_REDEMPTION, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_PREAUTH", MC_TRAN_PREAUTH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_VOID", MC_TRAN_VOID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_PREAUTHCOMPLETE", MC_TRAN_PREAUTHCOMPLETE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_FORCE", MC_TRAN_FORCE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_OVERRIDE", MC_TRAN_OVERRIDE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_RETURN", MC_TRAN_RETURN, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_RELOAD", MC_TRAN_RELOAD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_CREDIT", MC_TRAN_CREDIT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_SETTLE", MC_TRAN_SETTLE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_INCREMENTAL", MC_TRAN_INCREMENTAL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_REVERSAL", MC_TRAN_REVERSAL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_ACTIVATE", MC_TRAN_ACTIVATE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_BALANCEINQ", MC_TRAN_BALANCEINQ, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_CASHOUT", MC_TRAN_CASHOUT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_TOREVERSAL", MC_TRAN_TOREVERSAL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_SETTLERFR", MC_TRAN_SETTLERFR, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_ISSUE", MC_TRAN_ISSUE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_TIP", MC_TRAN_TIP, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_MERCHRETURN", MC_TRAN_MERCHRETURN, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_IVRREQ", MC_TRAN_IVRREQ, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_IVRRESP", MC_TRAN_IVRRESP, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_ADMIN", MC_TRAN_ADMIN, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_PING", MC_TRAN_PING, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_CHKPWD", MC_TRAN_CHKPWD, MCVE_CONST);
-
- /* Engine Admin Transaction Types */
- REGISTER_LONG_CONSTANT("MC_TRAN_CHNGPWD", MC_TRAN_CHNGPWD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_LISTSTATS", MC_TRAN_LISTSTATS, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_LISTUSERS", MC_TRAN_LISTUSERS, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_GETUSERINFO", MC_TRAN_GETUSERINFO, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_ADDUSER", MC_TRAN_ADDUSER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_EDITUSER", MC_TRAN_EDITUSER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_DELUSER", MC_TRAN_DELUSER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_ENABLEUSER", MC_TRAN_ENABLEUSER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_DISABLEUSER", MC_TRAN_DISABLEUSER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_IMPORT", MC_TRAN_IMPORT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_EXPORT", MC_TRAN_EXPORT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_ERRORLOG", MC_TRAN_ERRORLOG, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_CLEARERRORLOG", MC_TRAN_CLEARERRORLOG, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_TRAN_GETSUBACCTS", MC_TRAN_GETSUBACCTS, MCVE_CONST);
-
- /* Value definitions for Admin Types */
- REGISTER_LONG_CONSTANT("MC_ADMIN_GUT", MC_ADMIN_GUT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_GL", MC_ADMIN_GL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_GFT", MC_ADMIN_GFT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_BT", MC_ADMIN_BT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_UB", MC_ADMIN_UB, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_QC", MC_ADMIN_QC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_RS", MC_ADMIN_RS, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_CTH", MC_ADMIN_CTH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_CFH", MC_ADMIN_CFH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_FORCESETTLE", MC_ADMIN_FORCESETTLE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_SETBATCHNUM", MC_ADMIN_SETBATCHNUM, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_RENUMBERBATCH", MC_ADMIN_RENUMBERBATCH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_FIELDEDIT", MC_ADMIN_FIELDEDIT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MC_ADMIN_CLOSEBATCH", MC_ADMIN_CLOSEBATCH, MCVE_CONST);
-
- REGISTER_LONG_CONSTANT("M_UNUSED", MCVE_UNUSED, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_NEW", MCVE_NEW, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_PENDING", MCVE_PENDING, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_DONE", MCVE_DONE, MCVE_CONST);
-
- REGISTER_LONG_CONSTANT("M_GOOD", MCVE_GOOD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_BAD", MCVE_BAD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_STREET", MCVE_STREET, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_ZIP", MCVE_ZIP, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_UNKNOWN", MCVE_UNKNOWN, MCVE_CONST);
-
- REGISTER_LONG_CONSTANT("M_ERROR", MCVE_ERROR, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_FAIL", MCVE_FAIL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_SUCCESS", MCVE_SUCCESS, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_AUTH", MCVE_AUTH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_DENY", MCVE_DENY, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_CALL", MCVE_CALL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_DUPL", MCVE_DUPL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_PKUP", MCVE_PKUP, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_RETRY", MCVE_RETRY, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_SETUP", MCVE_SETUP, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_TIMEOUT", MCVE_TIMEOUT, MCVE_CONST);
-
- REGISTER_LONG_CONSTANT("M_SALE", MCVE_SALE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_PREAUTH", MCVE_PREAUTH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_FORCE", MCVE_FORCE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_OVERRIDE", MCVE_OVERRIDE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_RETURN", MCVE_RETURN, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_SETTLE", MCVE_SETTLE, MCVE_CONST);
-
- REGISTER_LONG_CONSTANT("M_PROC", MCVE_PROC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_USER", MCVE_USER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_PWD", MCVE_PWD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_INDCODE", MCVE_INDCODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_MERCHID", MCVE_MERCHID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_BANKID", MCVE_BANKID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_TERMID", MCVE_TERMID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_CLIENTNUM", MCVE_CLIENTNUM, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_STOREID", MCVE_STOREID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_AGENTID", MCVE_AGENTID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_CHAINID", MCVE_CHAINID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_ZIPCODE", MCVE_ZIPCODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_TIMEZONE", MCVE_TIMEZONE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_MERCHCAT", MCVE_MERCHCAT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_MERNAME", MCVE_MERNAME, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_MERCHLOC", MCVE_MERCHLOC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_STATECODE", MCVE_STATECODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("M_SERVICEPHONE", MCVE_SERVICEPHONE, MCVE_CONST);
-
- /* COMPATABILITY VARIABLES */
- REGISTER_LONG_CONSTANT("MCVE_UNUSED", MCVE_UNUSED, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_NEW", MCVE_NEW, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_PENDING", MCVE_PENDING, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_DONE", MCVE_DONE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_GOOD", MCVE_GOOD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_BAD", MCVE_BAD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_STREET", MCVE_STREET, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_ZIP", MCVE_ZIP, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_UNKNOWN", MCVE_UNKNOWN, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_ERROR", MCVE_ERROR, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_FAIL", MCVE_FAIL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_SUCCESS", MCVE_SUCCESS, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_AUTH", MCVE_AUTH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_DENY", MCVE_DENY, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_CALL", MCVE_CALL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_DUPL", MCVE_DUPL, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_PKUP", MCVE_PKUP, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_RETRY", MCVE_RETRY, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_SETUP", MCVE_SETUP, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_TIMEOUT", MCVE_TIMEOUT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_SALE", MCVE_SALE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_PREAUTH", MCVE_PREAUTH, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_FORCE", MCVE_FORCE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_OVERRIDE", MCVE_OVERRIDE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_RETURN", MCVE_RETURN, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_SETTLE", MCVE_SETTLE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_PROC", MCVE_PROC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_USER", MCVE_USER, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_PWD", MCVE_PWD, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_INDCODE", MCVE_INDCODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_MERCHID", MCVE_MERCHID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_BANKID", MCVE_BANKID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_TERMID", MCVE_TERMID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_CLIENTNUM", MCVE_CLIENTNUM, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_STOREID", MCVE_STOREID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_AGENTID", MCVE_AGENTID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_CHAINID", MCVE_CHAINID, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_ZIPCODE", MCVE_ZIPCODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_TIMEZONE", MCVE_TIMEZONE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_MERCHCAT", MCVE_MERCHCAT, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_MERNAME", MCVE_MERNAME, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_MERCHLOC", MCVE_MERCHLOC, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_STATECODE", MCVE_STATECODE, MCVE_CONST);
- REGISTER_LONG_CONSTANT("MCVE_SERVICEPHONE", MCVE_SERVICEPHONE, MCVE_CONST);
-
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ module information */
-PHP_MINFO_FUNCTION(mcve)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "mcve/monetra support", "enabled");
- php_info_print_table_row(2, "version", PHP_MCVE_VERSION);
- php_info_print_table_end();
-}
-/* }}} */
-
-
-/* {{{ proto int m_initengine(string location)
- Ready the client for IP/SSL Communication */
-PHP_FUNCTION(m_initengine)
-{
- int ret;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_string_ex(arg);
-
- if (mcve_init) {
- MCVE_DestroyEngine();
- }
- ret = MCVE_InitEngine(Z_STRVAL_PP(arg));
- mcve_init = 1;
-
- RETURN_LONG(ret);
-}
-/* }}} */
-
-/* {{{ proto resource m_initconn(void)
- Create and initialize an MCVE_CONN structure */
-PHP_FUNCTION(m_initconn)
-{
- MCVE_CONN *conn;
-
- conn = emalloc(sizeof(MCVE_CONN));
-
- MCVE_InitConn(conn);
-
-/* Since the identifiers are pointer addresses, we need to validate it by
- * checking our linked list in PHP, since we don't want to cause segfaults */
-#if LIBMONETRA_VERSION >= 050000
- M_ValidateIdentifier(conn, 1);
-#endif
- ZEND_REGISTER_RESOURCE(return_value, conn, le_conn);
-}
-/* }}} */
-
-
-/* {{{ proto bool m_deleteresponse(resource conn, int identifier)
- Delete specified transaction from MCVE_CONN structure */
-PHP_FUNCTION(m_deleteresponse)
-{
- MCVE_CONN *conn;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- MCVE_DeleteResponse(conn, Z_LVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool m_deletetrans(resource conn, int identifier)
- Delete specified transaction from MCVE_CONN structure */
-PHP_FUNCTION(m_deletetrans)
-{
- MCVE_CONN *conn;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection",
- le_conn);
-
- convert_to_long_ex(arg2);
-
- MCVE_DeleteTrans(conn, Z_LVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto void m_destroyconn(resource conn)
- Destroy the connection and MCVE_CONN structure */
-PHP_FUNCTION(m_destroyconn)
-{
-#if 0
- MCVE_CONN *conn;
-#endif
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
-/* If MCVE_DestroyConn() is called within a PHP script, the Resource handle is
- never cleared, as there does not appear to be an UNREGISTER or DESTROY resource
- call in the Zend API. What happens is this uninitialized memory location is
- passed again to the MCVE_DestroyConn() function at script exit (cleanup), and
- causes weird stuff. So we just go ahead and let the PHP garbage collector call
- our _free_mcve_conn() we registered (le_conn) to clean up */
-#if 0
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg, -1, "mcve connection", le_conn);
-
- MCVE_DestroyConn(conn);
-#endif
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int m_setdropfile(resource conn, string directory)
- Set the connection method to Drop-File */
-PHP_FUNCTION(m_setdropfile)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
-
- retval = MCVE_SetDropFile(conn, Z_STRVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_setip(resource conn, string host, int port)
- Set the connection method to IP */
-PHP_FUNCTION(m_setip)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_long_ex(arg3);
-
- retval = MCVE_SetIP(conn, Z_STRVAL_PP(arg2), Z_LVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_setssl(resource conn, string host, int port)
- Set the connection method to SSL */
-PHP_FUNCTION(m_setssl)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_long_ex(arg3);
-
- retval = MCVE_SetSSL(conn, Z_STRVAL_PP(arg2), Z_LVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-#if LIBMONETRA_VERSION >= 050000
-/* {{{ proto int m_setssl_cafile(resource conn, string cafile)
- Set SSL CA (Certificate Authority) file for verification of server
- certificate
-*/
-PHP_FUNCTION(m_setssl_cafile)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
- convert_to_string_ex(arg2);
-
- retval = M_SetSSL_CAfile(conn, Z_STRVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-#endif
-
-/* {{{ proto int m_setssl_files(resource conn, string sslkeyfile, string sslcertfile)
- Set certificate key files and certificates if server requires client certificate
- verification
-*/
-PHP_FUNCTION(m_setssl_files)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2, **arg3;
-
-#ifndef LIBMONETRA_BELOW_4_2
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-#else
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-#endif
-
- convert_to_string_ex(arg2);
-
-#ifndef LIBMONETRA_BELOW_4_2
- convert_to_string_ex(arg3);
- retval = MCVE_SetSSL_Files(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3));
-#else
- convert_to_string_ex(arg1);
- retval = MCVE_SetSSL_Files(Z_STRVAL_PP(arg1), Z_STRVAL_PP(arg2));
-#endif
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_settimeout(resource conn, int seconds)
- Set maximum transaction time (per trans)
-*/
-PHP_FUNCTION(m_settimeout)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_SetTimeout(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_setblocking(resource conn, int tf)
- Set blocking/non-blocking mode for connection
-*/
-PHP_FUNCTION(m_setblocking)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_SetBlocking(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto bool m_verifyconnection(resource conn, int tf)
- Set whether or not to PING upon connect to verify connection
-*/
-PHP_FUNCTION(m_verifyconnection)
-{
- MCVE_CONN *conn;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- MCVE_VerifyConnection(conn, Z_LVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool m_verifysslcert(resource conn, int tf)
- Set whether or not to verify the server ssl certificate
-*/
-PHP_FUNCTION(m_verifysslcert)
-{
- MCVE_CONN *conn;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- MCVE_VerifySSLCert(conn, Z_LVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool m_maxconntimeout(resource conn, int secs)
- The maximum amount of time the API will attempt a connection to MCVE
-*/
-PHP_FUNCTION(m_maxconntimeout)
-{
- MCVE_CONN *conn;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- MCVE_MaxConnTimeout(conn, Z_LVAL_PP(arg2));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int m_connect(resource conn)
- Establish the connection to MCVE */
-PHP_FUNCTION(m_connect)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg, -1, "mcve connection", le_conn);
-
- retval = MCVE_Connect(conn);
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto string m_connectionerror(resource conn)
- Get a textual representation of why a connection failed */
-PHP_FUNCTION(m_connectionerror)
-{
- MCVE_CONN *conn;
- const char *retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg, -1, "mcve connection", le_conn);
-
- retval = MCVE_ConnectionError(conn);
-
- if (retval == NULL) {
- RETVAL_STRING("",1);
- } else {
- RETVAL_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-/* {{{ proto int m_transactionssent(resource conn)
- Check to see if outgoing buffer is clear */
-PHP_FUNCTION(m_transactionssent)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg, -1, "mcve connection", le_conn);
-
- retval = MCVE_TransactionsSent(conn);
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_ping(resource conn)
- Send a ping request to MCVE */
-PHP_FUNCTION(m_ping)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg, -1, "mcve connection", le_conn);
-
- retval = MCVE_Ping(conn);
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_transnew(resource conn)
- Start a new transaction */
-PHP_FUNCTION(m_transnew)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg, -1, "mcve connection", le_conn);
-
- retval = MCVE_TransNew(conn);
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-#if LIBMONETRA_VERSION >= 050000
-/* {{{ proto int m_validateidentifier(resource conn, int tf)
- Whether or not to validate the passed identifier on any transaction it is passed to
-*/
-PHP_FUNCTION(m_validateidentifier)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
- retval = M_ValidateIdentifier(conn, (int)Z_LVAL_PP(arg2));
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_transkeyval(resource conn, long identifier, string key, string value)
- Add key/value pair to a transaction. Replaces deprecated transparam() */
-PHP_FUNCTION(m_transkeyval)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2, **arg3, **arg4;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_string_ex(arg4);
-
- retval = M_TransKeyVal(conn, (long)Z_LVAL_PP(arg2), Z_STRVAL_PP(arg3), Z_STRVAL_PP(arg4));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-#endif
-
-/* {{{ proto int m_transparam(resource conn, long identifier, int key, ...)
- Add a parameter to a transaction (deprecated) */
-PHP_FUNCTION(m_transparam)
-{
- MCVE_CONN *conn;
- int retval;
- int key;
- zval **arg1, **arg2, **arg3, **arg4, **arg5;
-
- if (ZEND_NUM_ARGS() == 4) {
- if (zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE)
- WRONG_PARAM_COUNT;
- } else if (ZEND_NUM_ARGS() == 5) {
- if (zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE)
- WRONG_PARAM_COUNT;
- } else {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long_ex(arg3);
-
- key = Z_LVAL_PP(arg3);
-
- if (key == MC_CUSTOM && ZEND_NUM_ARGS() != 5)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- switch (key) {
- /* Typecast to MCVE_int64 */
- case MC_TTID:
- convert_to_long_ex(arg4);
- retval = MCVE_TransParam(conn, (long)Z_LVAL_PP(arg2), key, (MCVE_int64)Z_LVAL_PP(arg4));
- break;
-
- /* Typecast to long */
-
- case MC_PTRANNUM:
- case MC_TIMESTAMP:
- case MC_MARKER:
- convert_to_long_ex(arg4);
- retval = MCVE_TransParam(conn, (long)Z_LVAL_PP(arg2), key, (long)Z_LVAL_PP(arg4));
- break;
-
- /* Typecast to int */
- case MC_ADMIN:
- case MC_SUB:
- case MC_TRANTYPE:
- case MC_AUDITTYPE:
- case MC_EXCHARGES:
- case MC_INQUIRY:
- case MC_PRIORITY:
- case MC_CARDTYPES:
- case MC_ORIGTYPE:
- case MC_VOIDORIGTYPE:
- convert_to_long_ex(arg4);
- retval = MCVE_TransParam(conn, (long)Z_LVAL_PP(arg2), key, (int)Z_LVAL_PP(arg4));
- break;
-
- /* Typecast to double */
- case MC_AMOUNT:
- case MC_EXAMOUNT:
- case MC_RATE:
- convert_to_double_ex(arg4);
- retval = MCVE_TransParam(conn, (long)Z_LVAL_PP(arg2), key, (double)Z_DVAL_PP(arg4));
- break;
-
- case MC_CUSTOM:
- convert_to_string_ex(arg4);
- convert_to_string_ex(arg5);
- retval = MCVE_TransParam(conn, (long)Z_LVAL_PP(arg2), key, Z_STRVAL_PP(arg4), Z_STRVAL_PP(arg5));
- break;
-
- default:
- convert_to_string_ex(arg4);
- retval = MCVE_TransParam(conn, (long)Z_LVAL_PP(arg2), key, Z_STRVAL_PP(arg4));
- break;
- }
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_transsend(resource conn, long identifier)
- Finalize and send the transaction */
-PHP_FUNCTION(m_transsend)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_TransSend(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto string m_responseparam(resource conn, long identifier, string key)
- Get a custom response parameter */
-PHP_FUNCTION(m_responseparam)
-{
- MCVE_CONN *conn;
- const char *retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 ||
- zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
- convert_to_string_ex(arg3);
-
- retval = MCVE_ResponseParam(conn, Z_LVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- if (retval == NULL) {
- RETVAL_STRING("",1);
- } else {
- RETVAL_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-#if LIBMONETRA_VERSION >= 050000
-/* {{{ proto array m_responsekeys(resource conn, long identifier)
- Returns array of strings which represents the keys that can be used
- for response parameters on this transaction
-*/
-PHP_FUNCTION(m_responsekeys)
-{
- MCVE_CONN *conn;
- char **retval;
- int num_keys, i;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
- convert_to_long_ex(arg2);
-
- array_init(return_value);
-
- retval=M_ResponseKeys(conn, Z_LVAL_PP(arg2), &num_keys);
- if (retval != NULL) {
- for (i=0; i<num_keys; i++)
- add_next_index_string(return_value, retval[i], 1);
- M_FreeResponseKeys(retval, num_keys);
- }
-}
-/* }}} */
-#endif
-
-/* {{{ proto string m_getuserparam(resource conn, long identifier, int key)
- Get a user response parameter */
-PHP_FUNCTION(m_getuserparam)
-{
- MCVE_CONN *conn;
- const char *retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 ||
- zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
- convert_to_long_ex(arg3);
-
- retval = MCVE_GetUserParam(conn, Z_LVAL_PP(arg2), Z_LVAL_PP(arg3));
-
- if (retval == NULL) {
- RETVAL_STRING("",1);
- } else {
- RETVAL_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-/* {{{ proto int m_returnstatus(resource conn, int identifier)
- Check to see if the transaction was successful */
-PHP_FUNCTION(m_returnstatus)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_ReturnStatus(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_returncode(resource conn, int identifier)
- Grab the exact return code from the transaction */
-PHP_FUNCTION(m_returncode)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_ReturnCode(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_transactionitem(resource conn, int identifier)
- Get the ITEM number in the associated batch for this transaction */
-PHP_FUNCTION(m_transactionitem)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_TransactionItem(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_transactionavs(resource conn, int identifier)
- Get the Address Verification return status */
-PHP_FUNCTION(m_transactionavs)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_TransactionAVS(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-
-/* {{{ proto int m_transactioncv(resource conn, int identifier)
- Get the CVC2/CVV2/CID return status */
-PHP_FUNCTION(m_transactioncv)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_TransactionCV(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_transactionbatch(resource conn, int identifier)
- Get the batch number associated with the transaction */
-PHP_FUNCTION(m_transactionbatch)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_TransactionBatch(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_transactionid(resource conn, int identifier)
- Get the unique system id for the transaction
-*/
-PHP_FUNCTION(m_transactionid)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_TransactionID(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto string m_transactionauth(resource conn, int identifier)
- Get the authorization number returned for the transaction (alpha-numeric) */
-PHP_FUNCTION(m_transactionauth)
-{
- MCVE_CONN *conn;
- const char *retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_TransactionAuth(conn, Z_LVAL_PP(arg2));
-
- if (retval == NULL) {
- RETVAL_STRING("",1);
- } else {
- RETVAL_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-/* {{{ proto string m_transactiontext(resource conn, int identifier)
- Get verbiage (text) return from MCVE or processing institution */
-PHP_FUNCTION(m_transactiontext)
-{
- MCVE_CONN *conn;
- const char *retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_TransactionText(conn, Z_LVAL_PP(arg2));
- if (retval == NULL) {
- RETVAL_STRING("",1);
- } else {
- RETVAL_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-/* {{{ proto int m_monitor(resource conn)
- Perform communication with MCVE (send/receive data) Non-blocking */
-PHP_FUNCTION(m_monitor)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg, -1, "mcve connection", le_conn);
-
- retval = MCVE_Monitor(conn);
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_transinqueue(resource conn)
- Number of transactions in client-queue */
-PHP_FUNCTION(m_transinqueue)
-{
- MCVE_CONN *conn;
- int retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg, -1, "mcve connection", le_conn);
-
- retval = MCVE_TransInQueue(conn);
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_checkstatus(resource conn, int identifier)
- Check to see if a transaction has completed */
-PHP_FUNCTION(m_checkstatus)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_CheckStatus(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_completeauthorizations(resource conn, int &array)
- Number of complete authorizations in queue, returning an array of their identifiers */
-PHP_FUNCTION(m_completeauthorizations)
-{
- MCVE_CONN *conn;
- long i, *list, listnum;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2))
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- listnum = MCVE_CompleteAuthorizations(conn, &list);
-
- if (listnum) {
- /* should use ZVAL_DESTRUCTOR */
- pval_destructor(*arg2);
- array_init(*arg2);
- for (i = 0; i < listnum; i++)
- add_index_long(*arg2, i, list[i]);
- free(list);
- }
-
- RETURN_LONG(listnum);
-}
-/* }}} */
-
-/* {{{ proto int m_sale(resource conn, string username, string password, string trackdata, string account, string expdate, float amount, string street, string zip, string cv, string comments, string clerkid, string stationid, int ptrannum)
- Send a SALE to MCVE */
-PHP_FUNCTION(m_sale)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8;
- zval **arg9, **arg10, **arg11, **arg12, **arg13, **arg14;
-
- if (ZEND_NUM_ARGS() != 14 || zend_get_parameters_ex(14, &arg1, &arg2,
- &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10, &arg11,
- &arg12, &arg13, &arg14) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_string_ex(arg4);
- convert_to_string_ex(arg5);
- convert_to_string_ex(arg6);
- convert_to_double_ex(arg7);
- convert_to_string_ex(arg8);
- convert_to_string_ex(arg9);
- convert_to_string_ex(arg10);
- convert_to_string_ex(arg11);
- convert_to_string_ex(arg12);
- convert_to_string_ex(arg13);
- convert_to_long_ex(arg14);
-
- retval = MCVE_Sale(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3),
- Z_STRVAL_PP(arg4), Z_STRVAL_PP(arg5), Z_STRVAL_PP(arg6),
- Z_DVAL_PP(arg7), Z_STRVAL_PP(arg8), Z_STRVAL_PP(arg9),
- Z_STRVAL_PP(arg10), Z_STRVAL_PP(arg11), Z_STRVAL_PP(arg12),
- Z_STRVAL_PP(arg13), Z_LVAL_PP(arg14));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_preauth(resource conn, string username, string password, string trackdata, string account, string expdate, float amount, string street, string zip, string cv, string comments, string clerkid, string stationid, int ptrannum)
- Send a PREAUTHORIZATION to MCVE */
-PHP_FUNCTION(m_preauth)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8;
- zval **arg9, **arg10, **arg11, **arg12, **arg13, **arg14;
-
- if (ZEND_NUM_ARGS() != 14 || zend_get_parameters_ex(14, &arg1, &arg2,
- &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10, &arg11,
- &arg12, &arg13, &arg14) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_string_ex(arg4);
- convert_to_string_ex(arg5);
- convert_to_string_ex(arg6);
- convert_to_double_ex(arg7);
- convert_to_string_ex(arg8);
- convert_to_string_ex(arg9);
- convert_to_string_ex(arg10);
- convert_to_string_ex(arg11);
- convert_to_string_ex(arg12);
- convert_to_string_ex(arg13);
- convert_to_long_ex(arg14);
-
- retval = MCVE_PreAuth(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3),
- Z_STRVAL_PP(arg4), Z_STRVAL_PP(arg5), Z_STRVAL_PP(arg6),
- Z_DVAL_PP(arg7), Z_STRVAL_PP(arg8), Z_STRVAL_PP(arg9),
- Z_STRVAL_PP(arg10), Z_STRVAL_PP(arg11), Z_STRVAL_PP(arg12),
- Z_STRVAL_PP(arg13), Z_LVAL_PP(arg14));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_override(resource conn, string username, string password, string trackdata, string account, string expdate, float amount, string street, string zip, string cv, string comments, string clerkid, string stationid, int ptrannum)
- Send an OVERRIDE to MCVE */
-PHP_FUNCTION(m_override)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8;
- zval **arg9, **arg10, **arg11, **arg12, **arg13, **arg14;
-
- if (ZEND_NUM_ARGS() != 14 || zend_get_parameters_ex(14, &arg1, &arg2,
- &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10, &arg11,
- &arg12, &arg13, &arg14) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_string_ex(arg4);
- convert_to_string_ex(arg5);
- convert_to_string_ex(arg6);
- convert_to_double_ex(arg7);
- convert_to_string_ex(arg8);
- convert_to_string_ex(arg9);
- convert_to_string_ex(arg10);
- convert_to_string_ex(arg11);
- convert_to_string_ex(arg12);
- convert_to_string_ex(arg13);
- convert_to_long_ex(arg14);
-
- retval = MCVE_Override(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3),
- Z_STRVAL_PP(arg4), Z_STRVAL_PP(arg5), Z_STRVAL_PP(arg6),
- Z_DVAL_PP(arg7), Z_STRVAL_PP(arg8), Z_STRVAL_PP(arg9),
- Z_STRVAL_PP(arg10), Z_STRVAL_PP(arg11), Z_STRVAL_PP(arg12),
- Z_STRVAL_PP(arg13), Z_LVAL_PP(arg14));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_void(resource conn, string username, string password, int sid, int ptrannum)
- VOID a transaction in the settlement queue */
-PHP_FUNCTION(m_void)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5;
-
- if (ZEND_NUM_ARGS() != 5 ||
- zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_long_ex(arg4);
- convert_to_long_ex(arg5);
-
- retval = MCVE_Void(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3), (MCVE_int64)Z_LVAL_PP(arg4), Z_LVAL_PP(arg5));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_preauthcompletion(resource conn, string username, string password, float finalamount, int sid, int ptrannum)
- Complete a PREAUTHORIZATION... Ready it for settlement */
-PHP_FUNCTION(m_preauthcompletion)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6;
-
- if (ZEND_NUM_ARGS() != 6 ||
- zend_get_parameters_ex(6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_double_ex(arg4);
- convert_to_long_ex(arg5);
- convert_to_long_ex(arg6);
-
- retval = MCVE_PreAuthCompletion(conn, Z_STRVAL_PP(arg2),
- Z_STRVAL_PP(arg3), Z_DVAL_PP(arg4), Z_LVAL_PP(arg5), Z_LVAL_PP(arg6));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_force(resiurce conn, string username, string password, string trackdata, string account, string expdate, float amount, string authcode, string comments, string clerkid, string stationid, int ptrannum)
- Send a FORCE to MCVE. (typically, a phone-authorization) */
-PHP_FUNCTION(m_force)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8;
- zval **arg9, **arg10, **arg11, **arg12;
-
- if (ZEND_NUM_ARGS() != 12 || zend_get_parameters_ex(12, &arg1, &arg2,
- &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10, &arg11, &arg12) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_string_ex(arg4);
- convert_to_string_ex(arg5);
- convert_to_string_ex(arg6);
- convert_to_double_ex(arg7);
- convert_to_string_ex(arg8);
- convert_to_string_ex(arg9);
- convert_to_string_ex(arg10);
- convert_to_string_ex(arg11);
- convert_to_long_ex(arg12);
-
- retval = MCVE_Force(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3),
- Z_STRVAL_PP(arg4), Z_STRVAL_PP(arg5), Z_STRVAL_PP(arg6),
- Z_DVAL_PP(arg7), Z_STRVAL_PP(arg8), Z_STRVAL_PP(arg9),
- Z_STRVAL_PP(arg10), Z_STRVAL_PP(arg11), Z_LVAL_PP(arg12));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_return(int conn, string username, string password, string trackdata, string account, string expdate, float amount, string comments, string clerkid, string stationid, int ptrannum)
- Issue a RETURN or CREDIT to MCVE */
-PHP_FUNCTION(m_return)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8;
- zval **arg9, **arg10, **arg11;
-
- if (ZEND_NUM_ARGS() != 11 || zend_get_parameters_ex(11, &arg1, &arg2,
- &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10, &arg11) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_string_ex(arg4);
- convert_to_string_ex(arg5);
- convert_to_string_ex(arg6);
- convert_to_double_ex(arg7);
- convert_to_string_ex(arg8);
- convert_to_string_ex(arg9);
- convert_to_string_ex(arg10);
- convert_to_long_ex(arg11);
-
- retval = MCVE_Return(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3),
- Z_STRVAL_PP(arg4), Z_STRVAL_PP(arg5), Z_STRVAL_PP(arg6),
- Z_DVAL_PP(arg7), Z_STRVAL_PP(arg8), Z_STRVAL_PP(arg9),
- Z_STRVAL_PP(arg10), Z_LVAL_PP(arg11));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-
-/* {{{ proto int m_settle(resource conn, string username, string password, string batch)
- Issue a settlement command to do a batch deposit */
-PHP_FUNCTION(m_settle)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_string_ex(arg4);
-
- retval = MCVE_Settle(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3), Z_STRVAL_PP(arg4));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_ub(resource conn, string username, string password)
- Get a list of all Unsettled batches */
-PHP_FUNCTION(m_ub)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
-
- retval = MCVE_Ub(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_qc(resource conn, string username, string password, string clerkid, string stationid, string comments, int ptrannum)
- Audit MCVE for a list of transactions in the outgoing queue */
-PHP_FUNCTION(m_qc)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
-
- if (ZEND_NUM_ARGS() != 7 ||
- zend_get_parameters_ex(7, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_string_ex(arg4);
- convert_to_string_ex(arg5);
- convert_to_string_ex(arg6);
- convert_to_long_ex(arg7);
-
- retval = MCVE_Qc(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3), Z_STRVAL_PP(arg4),
- Z_STRVAL_PP(arg5), Z_STRVAL_PP(arg6), Z_LVAL_PP(arg7));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_gut(resource conn, string username, string password, int type, string account, string clerkid, string stationid, string comments, int ptrannum, string startdate, string enddate)
- Audit MCVE for Unsettled Transactions */
-PHP_FUNCTION(m_gut)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8, **arg9, **arg10, **arg11;
-
- if (ZEND_NUM_ARGS() != 11 || zend_get_parameters_ex(11, &arg1, &arg2,
- &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10, &arg11) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_long_ex(arg4);
- convert_to_string_ex(arg5);
- convert_to_string_ex(arg6);
- convert_to_string_ex(arg7);
- convert_to_string_ex(arg8);
- convert_to_double_ex(arg9);
- convert_to_string_ex(arg10);
- convert_to_string_ex(arg11);
-
- retval = MCVE_Gut(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3), Z_LVAL_PP(arg4),
- Z_STRVAL_PP(arg5), Z_STRVAL_PP(arg6), Z_STRVAL_PP(arg7), Z_STRVAL_PP(arg8),
- Z_DVAL_PP(arg9), Z_STRVAL_PP(arg10),Z_STRVAL_PP(arg11));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_gl(int conn, string username, string password, int type, string account, string batch, string clerkid, string stationid, string comments, int ptrannum, string startdate, string enddate)
- Audit MCVE for settled transactions */
-PHP_FUNCTION(m_gl)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8, **arg9, **arg10, **arg11, **arg12;
-
- if (ZEND_NUM_ARGS() != 12 || zend_get_parameters_ex(12, &arg1, &arg2,
- &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10, &arg11, &arg12) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_long_ex(arg4);
- convert_to_string_ex(arg5);
- convert_to_string_ex(arg6);
- convert_to_string_ex(arg7);
- convert_to_string_ex(arg8);
- convert_to_string_ex(arg9);
- convert_to_double_ex(arg10);
- convert_to_string_ex(arg11);
- convert_to_string_ex(arg12);
-
- retval = MCVE_Gl(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3), Z_LVAL_PP(arg4),
- Z_STRVAL_PP(arg5), Z_STRVAL_PP(arg6), Z_STRVAL_PP(arg7), Z_STRVAL_PP(arg8),
- Z_STRVAL_PP(arg9), Z_DVAL_PP(arg10), Z_STRVAL_PP(arg11), Z_STRVAL_PP(arg12));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_gft(resource conn, string username, string password, int type, string account, string clerkid, string stationid, string comments, int ptrannum, string startdate, string enddate)
- Audit MCVE for Failed transactions
-*/
-PHP_FUNCTION(m_gft)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8, **arg9, **arg10, **arg11;
-
- if (ZEND_NUM_ARGS() != 11 || zend_get_parameters_ex(11, &arg1, &arg2,
- &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10, &arg11) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_long_ex(arg4);
- convert_to_string_ex(arg5);
- convert_to_string_ex(arg6);
- convert_to_string_ex(arg7);
- convert_to_string_ex(arg8);
- convert_to_long_ex(arg9);
- convert_to_string_ex(arg10);
- convert_to_string_ex(arg11);
-
- retval = MCVE_Gft(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3), Z_LVAL_PP(arg4),
- Z_STRVAL_PP(arg5), Z_STRVAL_PP(arg6), Z_STRVAL_PP(arg7), Z_STRVAL_PP(arg8),
- Z_LVAL_PP(arg9), Z_STRVAL_PP(arg10), Z_STRVAL_PP(arg11));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_chkpwd(resource conn, string username, string password)
- Verify Password */
-PHP_FUNCTION(m_chkpwd)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
-
- retval = MCVE_Chkpwd(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_bt(resource conn, string username, string password)
- Get unsettled batch totals */
-PHP_FUNCTION(m_bt)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
-
- retval = MCVE_Bt(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto string m_getcell(resource conn, int identifier, string column, int row)
- Get a specific cell from a comma delimited response by column name */
-PHP_FUNCTION(m_getcell)
-{
- MCVE_CONN *conn;
- const char *retval;
- zval **arg1, **arg2, **arg3, **arg4;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
- convert_to_string_ex(arg3);
- convert_to_long_ex(arg4);
-
- retval = MCVE_GetCell(conn, Z_LVAL_PP(arg2), Z_STRVAL_PP(arg3), Z_LVAL_PP(arg4));
-
- if (retval == NULL) {
- RETURN_STRING("", 1);
- } else {
- RETURN_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-/* {{{ proto string m_getcellbynum(resource conn, int identifier, int column, int row)
- Get a specific cell from a comma delimited response by column number */
-PHP_FUNCTION(m_getcellbynum)
-{
- MCVE_CONN *conn;
- const char *retval;
- zval **arg1, **arg2, **arg3, **arg4;
-
- if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
- convert_to_long_ex(arg3);
- convert_to_long_ex(arg4);
-
- retval = MCVE_GetCellByNum(conn, Z_LVAL_PP(arg2), Z_LVAL_PP(arg3), Z_LVAL_PP(arg4));
-
- if (retval == NULL) {
- RETURN_STRING("", 1);
- } else {
- RETURN_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-/* {{{ proto int m_numcolumns(resource conn, int identifier)
- Number of columns returned in a comma delimited response */
-PHP_FUNCTION(m_numcolumns)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_NumColumns(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_numrows(resource conn, int identifier)
- Number of rows returned in a comma delimited response */
-PHP_FUNCTION(m_numrows)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_NumRows(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_iscommadelimited(resource conn, int identifier)
- Checks to see if response is comma delimited */
-PHP_FUNCTION(m_iscommadelimited)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_IsCommaDelimited(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_parsecommadelimited(resource conn, int identifier)
- Parse the comma delimited response so m_getcell, etc will work */
-PHP_FUNCTION(m_parsecommadelimited)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_ParseCommaDelimited(conn, Z_LVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto string m_getcommadelimited(resource conn, int identifier)
- Get the RAW comma delimited data returned from MCVE */
-PHP_FUNCTION(m_getcommadelimited)
-{
- MCVE_CONN *conn;
- const char *retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_GetCommaDelimited(conn, Z_LVAL_PP(arg2));
-
- RETURN_STRING(estrdup(retval), 0);
-}
-/* }}} */
-
-/* {{{ proto string m_getheader(resource conn, int identifier, int column_num)
- Get the name of the column in a comma-delimited response */
-PHP_FUNCTION(m_getheader)
-{
- MCVE_CONN *conn;
- const char *retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_long_ex(arg2);
- convert_to_long_ex(arg3);
-
- retval = MCVE_GetHeader(conn, Z_LVAL_PP(arg2), Z_LVAL_PP(arg3));
-
- RETURN_STRING(estrdup(retval), 0);
-}
-/* }}} */
-
-/* {{{ proto void m_destroyengine(void)
- Free memory associated with IP/SSL connectivity */
-PHP_FUNCTION(m_destroyengine)
-{
- MCVE_DestroyEngine();
- mcve_init = 0;
-}
-/* }}} */
-
-/* {{{ proto int m_chngpwd(resource conn, string admin_password, string new_password)
- Change the system administrator's password */
-PHP_FUNCTION(m_chngpwd)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
-
- retval = MCVE_Chngpwd(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_listusers(resource conn, string admin_password)
- List all users on MCVE system */
-PHP_FUNCTION(m_listusers)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
-
- retval = MCVE_ListUsers(conn, Z_STRVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_enableuser(resource conn, string admin_password, string username)
- Enable an inactive MCVE user account */
-PHP_FUNCTION(m_enableuser)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
-
- retval = MCVE_EnableUser(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_disableuser(resource conn, string admin_password, string username)
- Disable an active MCVE user account */
-PHP_FUNCTION(m_disableuser)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
-
- retval = MCVE_DisableUser(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_deluser(resource conn, string admin_password, string username)
- Delete an MCVE user account */
-PHP_FUNCTION(m_deluser)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
- convert_to_string_ex(arg3);
-
- retval = MCVE_DelUser(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_liststats(resource conn, string admin_password)
- List statistics for all users on MCVE system */
-PHP_FUNCTION(m_liststats)
-{
- MCVE_CONN *conn;
- long retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
-
- convert_to_string_ex(arg2);
-
- retval = MCVE_ListStats(conn, Z_STRVAL_PP(arg2));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto resource m_initusersetup(void)
- Initialize structure to store user data */
-PHP_FUNCTION(m_initusersetup)
-{
- MCVE_UserSetup *usersetup;
-
- usersetup = emalloc(sizeof(MCVE_UserSetup));
-
- MCVE_InitUserSetup(usersetup);
-
- ZEND_REGISTER_RESOURCE(return_value, usersetup, le_user);
-}
-/* }}} */
-
-/* {{{ proto void m_deleteusersetup(resource usersetup)
- Deallocate data associated with usersetup structure */
-PHP_FUNCTION(m_deleteusersetup)
-{
- MCVE_UserSetup *usersetup;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(usersetup, MCVE_UserSetup *, arg, -1, "mcve user setup", le_user);
-
- MCVE_DeleteUserSetup(usersetup);
- efree(usersetup);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int m_adduserarg(resource usersetup, int argtype, string argval)
- Add a value to user configuration structure */
-PHP_FUNCTION(m_adduserarg)
-{
- MCVE_UserSetup *usersetup;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(usersetup, MCVE_UserSetup *, arg1, -1, "mcve user setup", le_user);
-
- convert_to_long_ex(arg2);
- convert_to_string_ex(arg3);
-
- retval = MCVE_AddUserArg(usersetup, Z_LVAL_PP(arg2), Z_STRVAL_PP(arg3));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto string m_getuserarg(resource usersetup, int argtype)
- Grab a value from usersetup structure */
-PHP_FUNCTION(m_getuserarg)
-{
- MCVE_UserSetup *usersetup;
- char *retval;
- zval **arg1, **arg2;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(usersetup, MCVE_UserSetup *, arg1, -1, "mcve user setup", le_user);
-
- convert_to_long_ex(arg2);
-
- retval = MCVE_GetUserArg(usersetup, Z_LVAL_PP(arg2));
-
- RETURN_STRING(retval, 1);
-}
-/* }}} */
-
-/* {{{ proto int m_adduser(resource conn, string admin_password, int usersetup)
- Add an MCVE user using usersetup structure */
-PHP_FUNCTION(m_adduser)
-{
- MCVE_CONN *conn;
- MCVE_UserSetup *usersetup;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
- ZEND_FETCH_RESOURCE(usersetup, MCVE_UserSetup *, arg3, -1, "mcve user setup", le_user);
-
- convert_to_string_ex(arg2);
-
- retval = MCVE_AddUser(conn, Z_STRVAL_PP(arg2), usersetup);
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto int m_edituser(resource conn, string admin_password, int usersetup)
- Edit MCVE user using usersetup structure */
-PHP_FUNCTION(m_edituser)
-{
- MCVE_CONN *conn;
- MCVE_UserSetup *usersetup;
- long retval;
- zval **arg1, **arg2, **arg3;
-
- if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
- WRONG_PARAM_COUNT;
-
- ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn);
- ZEND_FETCH_RESOURCE(usersetup, MCVE_UserSetup *, arg3, -1, "mcve user setup", le_user);
-
- convert_to_string_ex(arg2);
-
- retval = MCVE_EditUser(conn, Z_STRVAL_PP(arg2), usersetup);
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-
-/* {{{ proto int m_uwait(long microsecs)
- Wait x microsecs */
-PHP_FUNCTION(m_uwait)
-{
- long retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(arg);
-
- retval = MCVE_uwait(Z_LVAL_PP(arg));
-
- RETURN_LONG(retval);
-}
-/* }}} */
-
-/* {{{ proto string m_text_code(string code)
- Get a textual representation of the return_code */
-PHP_FUNCTION(m_text_code)
-{
- const char *retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(arg);
-
- retval = MCVE_TEXT_Code(Z_LVAL_PP(arg));
-
- if (retval == NULL) {
- RETVAL_STRING("",1);
- } else {
- RETVAL_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-/* {{{ proto string m_text_avs(string code)
- Get a textual representation of the return_avs */
-PHP_FUNCTION(m_text_avs)
-{
- const char *retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(arg);
-
- retval = MCVE_TEXT_AVS(Z_LVAL_PP(arg));
-
- if (retval == NULL) {
- RETVAL_STRING("",1);
- } else {
- RETVAL_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-/* {{{ proto string m_text_cv(int code)
- Get a textual representation of the return_cv */
-PHP_FUNCTION(m_text_cv)
-{
- const char *retval;
- zval **arg;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_long_ex(arg);
-
- retval = MCVE_TEXT_CV(Z_LVAL_PP(arg));
-
- if (retval == NULL) {
- RETVAL_STRING("",1);
- } else {
- RETVAL_STRING(estrdup(retval), 0);
- }
-}
-/* }}} */
-
-/* Map new funnction names to old function names for compatability */
-M_map_function(m_initengine, mcve_initengine)
-M_map_function(m_initconn, mcve_initconn)
-M_map_function(m_deleteresponse, mcve_deleteresponse)
-M_map_function(m_destroyconn, mcve_destroyconn)
-M_map_function(m_setdropfile, mcve_setdropfile)
-M_map_function(m_setip, mcve_setip)
-M_map_function(m_setssl, mcve_setssl)
-M_map_function(m_setssl_files, mcve_setssl_files)
-M_map_function(m_settimeout, mcve_settimeout)
-M_map_function(m_setblocking, mcve_setblocking)
-M_map_function(m_verifyconnection, mcve_verifyconnection)
-M_map_function(m_verifysslcert, mcve_verifysslcert)
-M_map_function(m_maxconntimeout, mcve_maxconntimeout)
-M_map_function(m_connectionerror, mcve_connectionerror)
-M_map_function(m_deletetrans, mcve_deletetrans)
-M_map_function(m_connect, mcve_connect)
-M_map_function(m_transnew, mcve_transnew)
-M_map_function(m_transparam, mcve_transparam)
-M_map_function(m_transsend, mcve_transsend)
-M_map_function(m_ping, mcve_ping)
-M_map_function(m_responseparam, mcve_responseparam)
-M_map_function(m_returnstatus, mcve_returnstatus)
-M_map_function(m_returncode, mcve_returncode)
-M_map_function(m_transactionssent, mcve_transactionssent)
-M_map_function(m_transactionitem, mcve_transactionitem)
-M_map_function(m_transactionbatch, mcve_transactionbatch)
-M_map_function(m_transactionid, mcve_transactionid)
-M_map_function(m_transactionauth, mcve_transactionauth)
-M_map_function(m_transactiontext, mcve_transactiontext)
-M_map_function(m_transactionavs, mcve_transactionavs)
-M_map_function(m_transactioncv, mcve_transactioncv)
-M_map_function(m_getuserparam, mcve_getuserparam)
-M_map_function(m_monitor, mcve_monitor)
-M_map_function(m_transinqueue, mcve_transinqueue)
-M_map_function(m_checkstatus, mcve_checkstatus)
-M_map_function(m_completeauthorizations, mcve_completeauthorizations)
-M_map_function(m_sale, mcve_sale)
-M_map_function(m_preauth, mcve_preauth)
-M_map_function(m_void, mcve_void)
-M_map_function(m_preauthcompletion, mcve_preauthcompletion)
-M_map_function(m_force, mcve_force)
-M_map_function(m_override, mcve_override)
-M_map_function(m_return, mcve_return)
-M_map_function(m_iscommadelimited, mcve_iscommadelimited)
-M_map_function(m_parsecommadelimited, mcve_parsecommadelimited)
-M_map_function(m_getcommadelimited, mcve_getcommadelimited)
-M_map_function(m_getcell, mcve_getcell)
-M_map_function(m_getcellbynum, mcve_getcellbynum)
-M_map_function(m_numcolumns, mcve_numcolumns)
-M_map_function(m_numrows, mcve_numrows)
-M_map_function(m_getheader, mcve_getheader)
-M_map_function(m_destroyengine, mcve_destroyengine)
-M_map_function(m_settle, mcve_settle)
-M_map_function(m_gut, mcve_gut)
-M_map_function(m_gl, mcve_gl)
-M_map_function(m_gft, mcve_gft)
-M_map_function(m_qc, mcve_qc)
-M_map_function(m_ub, mcve_ub)
-M_map_function(m_chkpwd, mcve_chkpwd)
-M_map_function(m_bt, mcve_bt)
-M_map_function(m_uwait, mcve_uwait)
-M_map_function(m_text_code, mcve_text_code)
-M_map_function(m_text_avs, mcve_text_avs)
-M_map_function(m_text_cv, mcve_text_cv)
-M_map_function(m_chngpwd, mcve_chngpwd)
-M_map_function(m_listusers, mcve_listusers)
-M_map_function(m_adduser, mcve_adduser)
-M_map_function(m_enableuser, mcve_enableuser)
-M_map_function(m_disableuser, mcve_disableuser)
-M_map_function(m_getuserarg, mcve_getuserarg)
-M_map_function(m_adduserarg, mcve_adduserarg)
-M_map_function(m_deleteusersetup, mcve_deleteusersetup)
-M_map_function(m_initusersetup, mcve_initusersetup)
-M_map_function(m_deluser, mcve_deluser)
-M_map_function(m_edituser, mcve_edituser)
-M_map_function(m_liststats, mcve_liststats)
-
-#endif
-
-/* END OF MCVE PHP EXTENSION */
-
-/*
- * 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/mcve/mcve.dsp b/ext/mcve/mcve.dsp
deleted file mode 100644
index f170d83c8..000000000
--- a/ext/mcve/mcve.dsp
+++ /dev/null
@@ -1,107 +0,0 @@
-# Microsoft Developer Studio Project File - Name="mcve" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mcve - 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 "mcve.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 "mcve.mak" CFG="mcve - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mcve - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mcve - 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)" == "mcve - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MCVE_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MCVE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MCVE=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib libmcve.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mcve.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "mcve - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "mcve_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MCVE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MCVE=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib libmcve.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mcve.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mcve - Win32 Release_TS"
-# Name "mcve - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mcve.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_mcve.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/mcve/mcve.php b/ext/mcve/mcve.php
deleted file mode 100644
index f749220b3..000000000
--- a/ext/mcve/mcve.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?
-$module = 'MCVE';
-if(!extension_loaded($module)) {
- dl('mcve.so');
-}
-$functions = get_extension_funcs($module);
-echo "Functions available in the $module extension:<br>\n";
-foreach($functions as $func) {
- echo $func."<br>\n";
-}
-echo "<br>\n";
-?>
diff --git a/ext/mcve/mcve_simple_test.php b/ext/mcve/mcve_simple_test.php
deleted file mode 100644
index 3a1c4f060..000000000
--- a/ext/mcve/mcve_simple_test.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
- MCVE_InitEngine(NULL);
- $conn=MCVE_InitConn();
- if (MCVE_SetIP($conn, "testbox.mcve.com", 8333)) {
- echo "Set connection Properly";
- } else {
- echo "Failed Setting method";
- exit();
- }
- if (!MCVE_Connect($conn)) {
- echo "<BR>Could not connect<BR>";
- } else {
- echo "<BR>Connection Established<BR>";
- }
- MCVE_DestroyConn($conn);
- MCVE_DestroyEngine();
-
-?>
diff --git a/ext/mcve/mcve_test1.php b/ext/mcve/mcve_test1.php
deleted file mode 100644
index a4f7dba8d..000000000
--- a/ext/mcve/mcve_test1.php
+++ /dev/null
@@ -1,83 +0,0 @@
-<HTML>
-<BODY>
-<?php
-
-// MCVE Config stuff
-$username="vitale";
-$password="test";
-// 1:IP or 2:SSL
-$method=2;
-$host="testbox.mcve.com";
-$port=8444; //8444 is typically SSL and 8333 is standard
-// End config stuff
-
-
-if (!$account)
- $account="4012888888881";
-if (!$exp)
- $exp="0512";
-if (!$amount)
- $amount=12.00;
-
-function flush_buffer()
-{
- for ($i=0; $i<2048; $i++) {
- echo " ";
- }
- flush();
-}
-
-
-dl("./php_mcve.so");
-
- echo "Initializing MCVE<BR>";
- flush_buffer();
- mcve_initengine("./CAfile.pem");
- $conn=mcve_initconn();
- if ($method == 1)
- $ret=mcve_setip($conn, $host, $port);
- else if ($method == 2)
- $ret=mcve_setssl($conn, $host, $port);
-
- if (!$ret) {
- echo "Could not set method<BR>";
- exit(1);
- }
- echo "Connection method and location set<BR>";
- flush_buffer();
- if (!mcve_connect($conn)) {
- echo "Connection Failed<BR>";
- exit(1);
- }
- echo "Connection Established<BR>";
- flush_buffer();
- $identifier=mcve_sale($conn, $username, $password, NULL, $account, $exp,
- $amount, NULL, NULL, NULL, NULL, NULL, NULL, 001);
- echo "Transaction Sent: CC: $account EXP: $exp AMOUNT: $amount<BR>";
- flush_buffer();
- while (mcve_checkstatus($conn, $identifier) != MCVE_DONE) {
- mcve_monitor($conn);
- }
- echo "Transaction Complete<BR>";
- flush_buffer();
- $status=mcve_returnstatus($conn, $identifier);
- if ($status == MCVE_SUCCESS) {
- $text=mcve_transactiontext($conn, $identifier);
- $auth=mcve_transactionauth($conn, $identifier);
- echo "Transaction Authorized<BR>";
- echo "Auth: $auth<BR>";
- echo "Text: $text<BR>";
- } else if ($status == MCVE_FAIL) {
- $text=mcve_transactiontext($conn, $identifier);
- echo "Transaction Denied<BR>";
- echo "Text: $text<BR>";
- } else
- echo "Transaction error<BR>";
- flush_buffer();
- mcve_destroyconn($conn);
- mcve_destroyengine();
-
-?>
-</BODY>
-</HTML>
-
diff --git a/ext/mcve/mcve_test2.php b/ext/mcve/mcve_test2.php
deleted file mode 100644
index b34d25070..000000000
--- a/ext/mcve/mcve_test2.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?
- #
- # $Id: mcve_test2.php,v 1.1 2002/03/27 15:39:29 sniper Exp $
- #
-
-$connect_type = "IP";
-
-dl("php_mcve.so");
-
-$conn = MCVE_InitConn();
-print "MCVE_InitConn() returned $conn<br>\n";
-
-if ($connect_type == "IP") {
- MCVE_SetIP($conn, "localhost", 8333) or
- die("MCVE_SetIP() failed");
- print "MCVE_SetIP() successful<br>\n";
-} else {
- MCVE_SetDropFile($conn, "/var/mcve/trans") or
- die("MCVE_SetDropFile() failed");
- print "MCVE_SetDropFile() successful<br>\n";
-}
-
-MCVE_Connect($conn) or
- die("MCVE_Connect() failed");
-print "MCVE_Connect() successful<br>\n";
-
-# send a request
-$ident = MCVE_Sale($conn, "test", "test", NULL, "5454545454545454",
- "1205", 11.00, NULL, NULL, NULL, NULL, "me", NULL, 54321);
-if ($ident == -1)
- die("MCVE_Sale() failed");
-else
- print "Identifier: $ident<br>\n";
-
-$ident = MCVE_Sale($conn, "test", "test", NULL, "5454545454545454",
- "1205", 12.00, NULL, NULL, NULL, NULL, "me", NULL, 54321);
-if ($ident == -1)
- die("MCVE_Sale() failed");
-else
- print "Identifier: $ident<br>\n";
-
-$pending = 0;
-$complete = -1;
-while ($pending != $complete) {
- sleep(2);
-
- MCVE_Monitor($conn);
-
- $pending = MCVE_TransInQueue($conn);
- print "Transactions pending: $pending<br>\n";
-
- $complete = MCVE_CompleteAuthorizations($conn, &$list);
- print "Authorizations complete: $complete<br>\n";
-
- flush();
-}
-
-for ($i = 0; $i < $complete; $i++) {
- $status = MCVE_CheckStatus($conn, $i);
- print "Transaction #" . $list[$i] . " complete: $status<br>\n";
-}
-
-MCVE_DestroyConn($conn);
-print "MCVE_DestroyConn() completed<br>\n";
-
-#phpinfo();
-
-?>
diff --git a/ext/mcve/php_mcve.h b/ext/mcve/php_mcve.h
deleted file mode 100644
index 130ab3aa1..000000000
--- a/ext/mcve/php_mcve.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Brad House <brad@mainstreetsoftworks.com> |
- | Chris Faulhaber <jedgar@fxp.org> |
- +----------------------------------------------------------------------+
-*/
-/* $Id: php_mcve.h,v 1.14.2.2 2005/07/18 20:11:09 bradmssw Exp $ */
-
-#ifndef _PHP_MCVE_H
-#define _PHP_MCVE_H
-
-extern zend_module_entry mcve_module_entry;
-
-#define mcve_module_ptr &mcve_module_entry
-#define phpext_mcve_ptr mcve_module_ptr
-
-#define PHP_MCVE_VERSION "5.0"
-
-#include <mcve.h>
-
-#ifndef LIBMONETRA_VERSION
-#define LIBMONETRA_VERSION 040000
-#endif
-
-#define MCVE_CONST (CONST_CS | CONST_PERSISTENT)
-
-#define M_map_function(newname, oldname) \
- PHP_FUNCTION(oldname) { \
- PHP_FN(newname)(INTERNAL_FUNCTION_PARAM_PASSTHRU); \
- }
-
-PHP_MINIT_FUNCTION(mcve);
-PHP_MINFO_FUNCTION(mcve);
-
-PHP_FUNCTION(m_initengine);
-PHP_FUNCTION(m_initconn);
-PHP_FUNCTION(m_deleteresponse);
-PHP_FUNCTION(m_destroyconn);
-PHP_FUNCTION(m_setdropfile);
-PHP_FUNCTION(m_setip);
-PHP_FUNCTION(m_setssl);
-#if LIBMONETRA_VERSION >= 050000
-PHP_FUNCTION(m_setssl_cafile);
-PHP_FUNCTION(m_responsekeys);
-#endif
-PHP_FUNCTION(m_setssl_files);
-PHP_FUNCTION(m_setblocking);
-PHP_FUNCTION(m_settimeout);
-PHP_FUNCTION(m_verifyconnection);
-PHP_FUNCTION(m_verifysslcert);
-PHP_FUNCTION(m_maxconntimeout);
-PHP_FUNCTION(m_connectionerror);
-PHP_FUNCTION(m_deletetrans);
-PHP_FUNCTION(m_connect);
-PHP_FUNCTION(m_transnew);
-#if LIBMONETRA_VERSION >= 050000
-PHP_FUNCTION(m_transkeyval);
-PHP_FUNCTION(m_validateidentifier);
-#endif
-PHP_FUNCTION(m_transparam);
-PHP_FUNCTION(m_transsend);
-PHP_FUNCTION(m_ping);
-PHP_FUNCTION(m_responseparam);
-PHP_FUNCTION(m_returnstatus);
-PHP_FUNCTION(m_returncode);
-PHP_FUNCTION(m_transactionssent);
-PHP_FUNCTION(m_transactionitem);
-PHP_FUNCTION(m_transactionbatch);
-PHP_FUNCTION(m_transactionid);
-PHP_FUNCTION(m_transactionauth);
-PHP_FUNCTION(m_transactionavs);
-PHP_FUNCTION(m_transactioncv);
-PHP_FUNCTION(m_transactiontext);
-PHP_FUNCTION(m_getuserparam);
-PHP_FUNCTION(m_monitor);
-PHP_FUNCTION(m_transinqueue);
-PHP_FUNCTION(m_checkstatus);
-PHP_FUNCTION(m_completeauthorizations);
-PHP_FUNCTION(m_sale);
-PHP_FUNCTION(m_preauth);
-PHP_FUNCTION(m_override);
-PHP_FUNCTION(m_void);
-PHP_FUNCTION(m_preauthcompletion);
-PHP_FUNCTION(m_force);
-PHP_FUNCTION(m_return);
-PHP_FUNCTION(m_iscommadelimited);
-PHP_FUNCTION(m_parsecommadelimited);
-PHP_FUNCTION(m_getcommadelimited);
-PHP_FUNCTION(m_getcell);
-PHP_FUNCTION(m_getcellbynum);
-PHP_FUNCTION(m_numcolumns);
-PHP_FUNCTION(m_numrows);
-PHP_FUNCTION(m_getheader);
-PHP_FUNCTION(m_destroyengine);
-PHP_FUNCTION(m_settle);
-PHP_FUNCTION(m_qc);
-PHP_FUNCTION(m_gut);
-PHP_FUNCTION(m_gft);
-PHP_FUNCTION(m_ub);
-PHP_FUNCTION(m_gl);
-PHP_FUNCTION(m_chkpwd);
-PHP_FUNCTION(m_bt);
-PHP_FUNCTION(m_uwait);
-PHP_FUNCTION(m_text_code);
-PHP_FUNCTION(m_text_avs);
-PHP_FUNCTION(m_text_cv);
-PHP_FUNCTION(m_chngpwd);
-PHP_FUNCTION(m_listusers);
-PHP_FUNCTION(m_adduser);
-PHP_FUNCTION(m_enableuser);
-PHP_FUNCTION(m_disableuser);
-PHP_FUNCTION(m_getuserarg);
-PHP_FUNCTION(m_adduserarg);
-PHP_FUNCTION(m_deleteusersetup);
-PHP_FUNCTION(m_initusersetup);
-PHP_FUNCTION(m_deluser);
-PHP_FUNCTION(m_edituser);
-PHP_FUNCTION(m_liststats);
-
-/* prototypes for compatability functions */
-PHP_FUNCTION(mcve_initengine);
-PHP_FUNCTION(mcve_initconn);
-PHP_FUNCTION(mcve_deleteresponse);
-PHP_FUNCTION(mcve_destroyconn);
-PHP_FUNCTION(mcve_setdropfile);
-PHP_FUNCTION(mcve_setip);
-PHP_FUNCTION(mcve_setssl);
-PHP_FUNCTION(mcve_setssl_files);
-PHP_FUNCTION(mcve_setblocking);
-PHP_FUNCTION(mcve_settimeout);
-PHP_FUNCTION(mcve_verifyconnection);
-PHP_FUNCTION(mcve_verifysslcert);
-PHP_FUNCTION(mcve_maxconntimeout);
-PHP_FUNCTION(mcve_connectionerror);
-PHP_FUNCTION(mcve_deletetrans);
-PHP_FUNCTION(mcve_connect);
-PHP_FUNCTION(mcve_transnew);
-PHP_FUNCTION(mcve_transparam);
-PHP_FUNCTION(mcve_transsend);
-PHP_FUNCTION(mcve_ping);
-PHP_FUNCTION(mcve_responseparam);
-PHP_FUNCTION(mcve_returnstatus);
-PHP_FUNCTION(mcve_returncode);
-PHP_FUNCTION(mcve_transactionssent);
-PHP_FUNCTION(mcve_transactionitem);
-PHP_FUNCTION(mcve_transactionbatch);
-PHP_FUNCTION(mcve_transactionid);
-PHP_FUNCTION(mcve_transactionauth);
-PHP_FUNCTION(mcve_transactionavs);
-PHP_FUNCTION(mcve_transactioncv);
-PHP_FUNCTION(mcve_transactiontext);
-PHP_FUNCTION(mcve_getuserparam);
-PHP_FUNCTION(mcve_monitor);
-PHP_FUNCTION(mcve_transinqueue);
-PHP_FUNCTION(mcve_checkstatus);
-PHP_FUNCTION(mcve_completeauthorizations);
-PHP_FUNCTION(mcve_sale);
-PHP_FUNCTION(mcve_preauth);
-PHP_FUNCTION(mcve_override);
-PHP_FUNCTION(mcve_void);
-PHP_FUNCTION(mcve_preauthcompletion);
-PHP_FUNCTION(mcve_force);
-PHP_FUNCTION(mcve_return);
-PHP_FUNCTION(mcve_iscommadelimited);
-PHP_FUNCTION(mcve_parsecommadelimited);
-PHP_FUNCTION(mcve_getcommadelimited);
-PHP_FUNCTION(mcve_getcell);
-PHP_FUNCTION(mcve_getcellbynum);
-PHP_FUNCTION(mcve_numcolumns);
-PHP_FUNCTION(mcve_numrows);
-PHP_FUNCTION(mcve_getheader);
-PHP_FUNCTION(mcve_destroyengine);
-PHP_FUNCTION(mcve_settle);
-PHP_FUNCTION(mcve_qc);
-PHP_FUNCTION(mcve_gut);
-PHP_FUNCTION(mcve_gft);
-PHP_FUNCTION(mcve_ub);
-PHP_FUNCTION(mcve_gl);
-PHP_FUNCTION(mcve_chkpwd);
-PHP_FUNCTION(mcve_bt);
-PHP_FUNCTION(mcve_uwait);
-PHP_FUNCTION(mcve_text_code);
-PHP_FUNCTION(mcve_text_avs);
-PHP_FUNCTION(mcve_text_cv);
-PHP_FUNCTION(mcve_chngpwd);
-PHP_FUNCTION(mcve_listusers);
-PHP_FUNCTION(mcve_adduser);
-PHP_FUNCTION(mcve_enableuser);
-PHP_FUNCTION(mcve_disableuser);
-PHP_FUNCTION(mcve_getuserarg);
-PHP_FUNCTION(mcve_adduserarg);
-PHP_FUNCTION(mcve_deleteusersetup);
-PHP_FUNCTION(mcve_initusersetup);
-PHP_FUNCTION(mcve_deluser);
-PHP_FUNCTION(mcve_edituser);
-PHP_FUNCTION(mcve_liststats);
-
-
-#endif /* _PHP_MCVE_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/mcve/tests/001.phpt b/ext/mcve/tests/001.phpt
deleted file mode 100644
index 495db1676..000000000
--- a/ext/mcve/tests/001.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-Check for mcve presence
---SKIPIF--
-<?php if (!extension_loaded("mcve")) print "skip"; ?>
---FILE--
-<?php
-echo "mcve extension is available";
-/*
- you can add regression tests for your extension here
-
- the output of your test code has to be equal to the
- text in the --EXPECT-- section below for the tests
- to pass, differences between the output and the
- expected text are interpreted as failure
-
- see php5/tests/README for further information on
- writing regression tests
-*/
-?>
---EXPECT--
-mcve extension is available
diff --git a/ext/mhash/config.m4 b/ext/mhash/config.m4
index e505eeea2..89ea5d3a4 100644
--- a/ext/mhash/config.m4
+++ b/ext/mhash/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.14 2003/10/01 02:53:11 sniper Exp $
+dnl $Id: config.m4,v 1.15 2005/05/29 23:16:41 sniper Exp $
dnl
PHP_ARG_WITH(mhash, for mhash support,
-[ --with-mhash[=DIR] Include mhash support.])
+[ --with-mhash[=DIR] Include mhash support])
if test "$PHP_MHASH" != "no"; then
for i in $PHP_MHASH /usr/local /usr /opt/mhash; do
diff --git a/ext/mhash/mhash.c b/ext/mhash/mhash.c
index 5ae63e584..85c35be32 100644
--- a/ext/mhash/mhash.c
+++ b/ext/mhash/mhash.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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 @@
| Nikos Mavroyanopoulos <nmav@hellug.gr> (HMAC, KEYGEN) |
+----------------------------------------------------------------------+
*/
-/* $Id: mhash.c,v 1.47 2004/01/08 08:16:06 andi Exp $ */
+/* $Id: mhash.c,v 1.48 2005/08/03 14:07:25 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/mhash/php_mhash.h b/ext/mhash/php_mhash.h
index 3044d6db0..a48ff9da4 100644
--- a/ext/mhash/php_mhash.h
+++ b/ext/mhash/php_mhash.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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 @@
| Nikos Mavroyanopoulos <nmav@hellug.gr> (HMAC, KEYGEN) |
+----------------------------------------------------------------------+
*/
-/* $Id: php_mhash.h,v 1.11 2004/01/08 17:32:23 sniper Exp $ */
+/* $Id: php_mhash.h,v 1.12 2005/08/03 14:07:25 sniper Exp $ */
#ifndef PHP_MHASH_H
#define PHP_MHASH_H
diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c
index 88832eeb9..fd87d1d4e 100644
--- a/ext/mime_magic/mime_magic.c
+++ b/ext/mime_magic/mime_magic.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
- $Id: mime_magic.c,v 1.37.2.2 2005/05/25 03:06:07 iliaa Exp $
+ $Id: mime_magic.c,v 1.42.2.3 2005/10/18 15:04:07 derick 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:
@@ -160,7 +160,6 @@
#include <fcntl.h>
#include <sys/types.h>
-#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -261,7 +260,9 @@ PHP_INI_END()
*/
static void php_mime_magic_init_globals(zend_mime_magic_globals *mime_magic_globals)
{
- mime_global.magicfile = NULL;
+ memset(mime_magic_globals, 0, sizeof(zend_mime_magic_globals));
+ mime_global.magic = NULL;
+ mime_global.last = NULL;
}
/* }}} */
@@ -272,9 +273,7 @@ PHP_MINIT_FUNCTION(mime_magic)
ZEND_INIT_MODULE_GLOBALS(mime_magic, php_mime_magic_init_globals, NULL);
REGISTER_INI_ENTRIES();
- mime_global.magicfile = MIME_MAGIC_G(magicfile);
-
- if(mime_global.magicfile) {
+ if(MIME_MAGIC_G(magicfile)) {
if(apprentice()) {
MIME_MAGIC_G(status) = "invalid magic file, disabled";
} else {
@@ -351,7 +350,7 @@ PHP_FUNCTION(mime_content_type)
if (conf->magic == (struct magic *)-1) {
if(MIME_MAGIC_G(debug))
- php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_ERROR, "mime_magic could not be initialized, magic file %s is not available", conf->magicfile);
+ php_error_docref("http://www.php.net/mime_magic" TSRMLS_CC, E_ERROR, "mime_magic could not be initialized, magic file %s is not available", MIME_MAGIC_G(magicfile));
RETURN_FALSE;
}
@@ -394,7 +393,11 @@ static int apprentice(void)
magic_server_config_rec *conf = &mime_global;
TSRMLS_FETCH();
- fname = conf->magicfile; /* todo cwd? */
+ if (!MIME_MAGIC_G(magicfile)) {
+ return -1;
+ }
+
+ fname = MIME_MAGIC_G(magicfile); /* todo cwd? */
f = fopen(fname, "rb");
if (f == NULL) {
conf->magic = (struct magic *)-1;
@@ -431,9 +434,6 @@ static int apprentice(void)
/* parse it */
if (parse(line + ws_offset, lineno) != 0)
++errs;
-
- if(errs && !MIME_MAGIC_G(debug))
- break;
}
(void) fclose(f);
@@ -1074,6 +1074,8 @@ static int magic_process(zval *what TSRMLS_DC)
streampos = php_stream_tell(stream); /* remember stream position for restauration */
php_stream_seek(stream, 0, SEEK_SET);
break;
+ default:
+ return -1;
}
diff --git a/ext/mime_magic/php_mime_magic.h b/ext/mime_magic/php_mime_magic.h
index 88ace8e7b..6ccfe6973 100644
--- a/ext/mime_magic/php_mime_magic.h
+++ b/ext/mime_magic/php_mime_magic.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: |
+----------------------------------------------------------------------+
- $Id: php_mime_magic.h,v 1.10 2004/01/08 17:32:24 sniper Exp $
+ $Id: php_mime_magic.h,v 1.11 2005/08/03 14:07:26 sniper Exp $
*/
#ifndef PHP_MIME_MAGIC_H
diff --git a/ext/mime_magic/phpmimemagic.h b/ext/mime_magic/phpmimemagic.h
index 3bad49092..b592d2440 100644
--- a/ext/mime_magic/phpmimemagic.h
+++ b/ext/mime_magic/phpmimemagic.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: |
+----------------------------------------------------------------------+
- $Id: phpmimemagic.h,v 1.2 2004/01/08 17:32:24 sniper Exp $
+ $Id: phpmimemagic.h,v 1.3.2.1 2005/10/18 12:41:29 tony2001 Exp $
*/
#ifndef PHPMIMEMAGIC_H
@@ -343,7 +343,6 @@ typedef struct magic_rsl_s {
/* per-server info */
typedef struct {
- char *magicfile; /* where magic be found */
struct magic *magic; /* head of magic config list */
struct magic *last;
} magic_server_config_rec;
diff --git a/ext/ming/config.m4 b/ext/ming/config.m4
index 29939d575..1ee78103a 100644
--- a/ext/ming/config.m4
+++ b/ext/ming/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.20.2.2 2005/07/25 21:03:27 helly Exp $
+dnl $Id: config.m4,v 1.22.2.3 2005/11/24 00:51:42 helly Exp $
dnl
PHP_ARG_WITH(ming, for MING support,
@@ -9,7 +9,7 @@ if test "$PHP_MING" != "no"; then
AC_CHECK_LIB(m, sin)
for i in $PHP_MING /usr/local /usr; do
- if test -f $i/lib/libming.$SHLIB_SUFFIX_NAME -o -f $i/lib/libming.a; then
+ if test -f $i/$PHP_LIBDIR/libming.$SHLIB_SUFFIX_NAME -o -f $i/$PHP_LIBDIR/libming.a; then
MING_DIR=$i
break
fi
@@ -34,11 +34,11 @@ if test "$PHP_MING" != "no"; then
],[
AC_MSG_ERROR([Ming library 0.2a or greater required.])
],[
- -L$MING_DIR/lib
+ -L$MING_DIR/$PHP_LIBDIR
])
PHP_ADD_INCLUDE($MING_INC_DIR)
- PHP_ADD_LIBRARY_WITH_PATH(ming, $MING_DIR/lib, MING_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(ming, $MING_DIR/$PHP_LIBDIR, MING_SHARED_LIBADD)
AC_MSG_CHECKING([for destroySWFBlock])
AC_TRY_RUN([
@@ -72,6 +72,13 @@ yes
AC_DEFINE(HAVE_NEW_MING, 1, [ ])
dnl FIXME: This is now unconditional..better check coming later.
AC_DEFINE(HAVE_MING_ZLIB, 1, [ ])
+ AC_TRY_COMPILE([
+#include <ming.h>
+int main(int,void) {
+ SWFMovie_output(NULL, NULL, NULL, 0));
+ return 0;
+}
+ ], [ AC_DEFINE(HAVE_MING_MOVIE_LEVEL, 1, []) ])
])
CPPFLAGS=$old_CPPFLAGS
diff --git a/ext/ming/config.w32 b/ext/ming/config.w32
index 00118ac6c..4010b22bb 100644
--- a/ext/ming/config.w32
+++ b/ext/ming/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.2.2.1 2005/07/25 21:03:27 helly Exp $
+// $Id: config.w32,v 1.4 2005/07/18 00:42:47 fmk Exp $
// vim:ft=javascript
ARG_WITH("ming", "MING support", "no");
diff --git a/ext/ming/ming.c b/ext/ming/ming.c
index 18d79ff03..a5a031dd8 100644
--- a/ext/ming/ming.c
+++ b/ext/ming/ming.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ming.c,v 1.68.2.3 2005/07/25 21:03:27 helly Exp $ */
+/* $Id: ming.c,v 1.79.2.2 2005/11/24 00:51:42 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -2244,7 +2244,7 @@ PHP_METHOD(swfmovie, output)
Ming_setSWFCompression(oldval);
}
RETURN_LONG(out);
-#elif defined(HAVE_NEW_MING)
+#elif defined(HAVE_NEW_MING) && defined(HAVE_MING_MOVIE_LEVEL)
zval **zlimit = NULL;
int limit = -1;
int argc = ZEND_NUM_ARGS();
@@ -2323,7 +2323,7 @@ PHP_METHOD(swfmovie, saveToFile)
if (oldval >= -1 && oldval <=9)
Ming_setSWFCompression(oldval);
RETURN_LONG(out);
-#elif defined(HAVE_NEW_MING)
+#elif defined(HAVE_NEW_MING) && defined(HAVE_MING_MOVIE_LEVEL)
RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what, limit));
#else
RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what));
@@ -2374,7 +2374,7 @@ PHP_METHOD(swfmovie, save)
if (Z_TYPE_PP(x) == IS_RESOURCE) {
ZEND_FETCH_RESOURCE(stream, php_stream *, x, -1,"File-Handle",php_file_le_stream());
-#if defined(HAVE_NEW_MING)
+#if defined(HAVE_NEW_MING) && defined(HAVE_MING_MOVIE_LEVEL)
RETURN_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, stream, limit));
#else
RETVAL_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, stream));
@@ -2393,7 +2393,7 @@ PHP_METHOD(swfmovie, save)
RETURN_FALSE;
}
-#if defined(HAVE_NEW_MING)
+#if defined(HAVE_NEW_MING) && defined(HAVE_MING_MOVIE_LEVEL)
retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, (void *)stream, limit);
#else
retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, (void *)stream);
diff --git a/ext/ming/php_ming.h b/ext/ming/php_ming.h
index afba0d2fa..1ff7e2278 100644
--- a/ext/ming/php_ming.h
+++ b/ext/ming/php_ming.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ming.h,v 1.16 2004/03/27 00:39:06 helly Exp $ */
+/* $Id: php_ming.h,v 1.17 2005/08/03 14:07:27 sniper Exp $ */
#ifndef _PHP_MING_H
#define _PHP_MING_H
diff --git a/ext/ming/tests/swfaction-new.phpt b/ext/ming/tests/swfaction-new.phpt
index 1af5e737e..ba4845a61 100755
--- a/ext/ming/tests/swfaction-new.phpt
+++ b/ext/ming/tests/swfaction-new.phpt
@@ -6,7 +6,7 @@ if (!extension_loaded("ming")) die("skip");
if (!MING_NEW && !MING_ZLIB) die("skip old ming");
?>
--FILE--
-<?php /* $Id: swfaction-new.phpt,v 1.1.2.2 2005/07/25 21:03:29 helly Exp $ */
+<?php /* $Id: swfaction-new.phpt,v 1.1 2005/07/18 00:14:53 helly Exp $ */
$s = new SWFShape();
$f = $s->addFill(0xff, 0, 0);
diff --git a/ext/ming/tests/swfaction.phpt b/ext/ming/tests/swfaction.phpt
index 010502de9..5e787d186 100644
--- a/ext/ming/tests/swfaction.phpt
+++ b/ext/ming/tests/swfaction.phpt
@@ -6,7 +6,7 @@ if (!extension_loaded("ming")) die("skip");
if (MING_NEW || MING_ZLIB) die("skip new ming");
?>
--FILE--
-<?php /* $Id: swfaction.phpt,v 1.1.2.1 2005/07/25 21:03:29 helly Exp $ */
+<?php /* $Id: swfaction.phpt,v 1.3 2005/07/18 00:14:53 helly Exp $ */
$s = new SWFShape();
$f = $s->addFill(0xff, 0, 0);
diff --git a/ext/mnogosearch/CREDITS b/ext/mnogosearch/CREDITS
deleted file mode 100644
index 3ab998a1d..000000000
--- a/ext/mnogosearch/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-mnoGoSearch
-Sergey Kartashoff, Alex Barkov, Ramil Kalimullin
diff --git a/ext/mnogosearch/README b/ext/mnogosearch/README
deleted file mode 100644
index 077320c0c..000000000
--- a/ext/mnogosearch/README
+++ /dev/null
@@ -1,24 +0,0 @@
-$Source: /repository/php-src/ext/mnogosearch/Attic/README,v $
-$Id: README,v 1.11 2004/01/17 12:59:36 sniper Exp $
-
-mnoGoSearch extension module for PHP.
-
-For details please refer to http://www.mnogosearch.org/
-
-If used with mysql you should not use bundled mysql library
-in the php distribution. You should use native mysql
-library. To do this you should compile php with specefying mysql-dir
-(for example --with-mysql=/usr, not --with-mysql).
-
-To compile PHP with CVS versions of mnogosearch (not with official releases)
-you must open configure script of mnogosearch in your editor. Find
-line like the following:
-
-VERSION=x.x.x-`date "+%d%m%Y"`
-
-where x.x.x is the mnogosearch version number like 3.2.16 or so.
-Then just remove -`date "+%d%m%Y"`. After that this line should be
-VERSION=x.x.x
-
-After complete you should reconfigure, recompile, reinstall mnogosearch and
-php.
diff --git a/ext/mnogosearch/config.m4 b/ext/mnogosearch/config.m4
deleted file mode 100644
index f3fd7ad2a..000000000
--- a/ext/mnogosearch/config.m4
+++ /dev/null
@@ -1,53 +0,0 @@
-dnl
-dnl $Source: /repository/php-src/ext/mnogosearch/Attic/config.m4,v $
-dnl $Id: config.m4,v 1.11.2.1 2004/08/29 10:59:12 gluke Exp $
-dnl
-
-PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
-[ --with-mnogosearch[=DIR]
- Include mnoGoSearch support. DIR is the mnoGoSearch
- base install directory, defaults to /usr/local/mnogosearch.])
-
- if test "$PHP_MNOGOSEARCH" != "no"; then
-
- if test "$PHP_MNOGOSEARCH" = "yes"; then
- MNOGOSEARCH_BINDIR=/usr/local/mnogosearch/bin
- MNOGOSEARCH_INCDIR=/usr/local/mnogosearch/include
- MNOGOSEARCH_LIBDIR=/usr/local/mnogosearch/lib
- else
- MNOGOSEARCH_BINDIR=$PHP_MNOGOSEARCH/bin
- MNOGOSEARCH_INCDIR=$PHP_MNOGOSEARCH/include
- MNOGOSEARCH_LIBDIR=$PHP_MNOGOSEARCH/lib
- fi
-
- AC_MSG_CHECKING(for mnoGoSearch version)
-
- if test -x "$MNOGOSEARCH_BINDIR/udm-config"; then
- MNOGOSEARCH_VERSION=`$MNOGOSEARCH_BINDIR/udm-config --version`
- MNOGOSEARCH_VERSION_ID=`$MNOGOSEARCH_BINDIR/udm-config --version-id`
-
- if test $? -ne 0; then
- AC_MSG_RESULT(<= 3.1.9)
- AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
- fi
-
- if test "$MNOGOSEARCH_VERSION_ID" -lt 30110; then
- AC_MSG_RESULT(<= 3.1.9)
- AC_MSG_ERROR(mnoGoSearch 3.1.10 at least required)
- fi
-
- AC_MSG_RESULT($MNOGOSEARCH_VERSION)
-
- PHP_EVAL_LIBLINE(`$MNOGOSEARCH_BINDIR/udm-config --libs`, MNOGOSEARCH_SHARED_LIBADD)
- else
- AC_MSG_ERROR(udm-config script not found in $MNOGOSEARCH_BINDIR)
- fi
-
- PHP_ADD_INCLUDE($MNOGOSEARCH_INCDIR)
-
- AC_DEFINE(HAVE_MNOGOSEARCH,1,[ ])
-
- PHP_NEW_EXTENSION(mnogosearch, php_mnogo.c, $ext_shared)
- PHP_SUBST(MNOGOSEARCH_SHARED_LIBADD)
-
- fi
diff --git a/ext/mnogosearch/index.php b/ext/mnogosearch/index.php
deleted file mode 100644
index fc1f79337..000000000
--- a/ext/mnogosearch/index.php
+++ /dev/null
@@ -1,1055 +0,0 @@
-<?
-
-/*
- $Source: /repository/php-src/ext/mnogosearch/Attic/index.php,v $
- $Id: index.php,v 1.16 2004/01/17 12:59:36 sniper Exp $
-*/
-
-/* mnoGoSearch-php-lite v.1.4
- * for mnoGoSearch ( formely known as UdmSearch ) free web search engine
- * (C) 2001-2002 by Sergey Kartashoff <gluke@mail.ru>,
- * mnoGoSearch Developers Team <devel@mnogosearch.org>
- */
-
-if (!extension_loaded('mnogosearch')) {
- print "<b>This script requires PHP 4.0.5+ with mnoGoSearch extension</b>";
- exit;
-}
-
-// maximal page number to view
-$MAX_NP=1000;
-
-// maximum results per page
-$MAX_PS=100;
-
-// (optional) Enable autowild feature for url limits
-// 'yes' - default value, can be 'yes' or 'no'
-// $auto_wild='yes';
-
-/* variables section */
-
-if (Udm_Api_Version() >= 30204) {
- $dbaddr='mysql://mnogo:mnogo@/mnogo/?dbmode=single';
-} else {
- $dbaddr='mysql://mnogo:mnogo@/mnogo/';
- $dbmode='single';
-}
-
-$localcharset='koi8-r';
-$browsercharset='utf-8';
-$phrase=$cache=$crosswords='no';
-$ispelluseprefixes=$trackquery='no';
-$spell_host=$vardir=$datadir='';
-$ispellmode='text';
-
-$affix_file=array();
-$spell_file=array();
-$stopwordtable_arr=array();
-$stopwordfile_arr=array();
-$synonym_arr=array();
-$searchd_arr=array();
-
-// $affix_file['en']='/opt/udm/ispell/en.aff';
-// $affix_file['ru']='/opt/udm/ispell/ru.aff';
-// $spell_file['en']='/opt/udm/ispell/en.dict';
-// $spell_file['ru']='/opt/udm/ispell/ru.dict';
- $stopwordtable_arr[]='stopword';
-// $stopwordfile_arr[]='stopwords.txt';
-// $synonym_arr[]='/opt/udm/synonym/english.syn';
-$searchd_arr[]='localhost';
-
-$minwordlength=1;
-$maxwordlength=32;
-
-$storedocurl="/cgi-bin/storedoc.cgi";
-
-/* initialisation section */
-
-if(isset($HTTP_GET_VARS)){
- while(list($var, $val)=each($HTTP_GET_VARS)){
- $$var=$val;
- }
-}
-if(isset($HTTP_POST_VARS)){
- while(list($var, $val)=each($HTTP_POST_VARS)){
- $$var=$val;
- }
-}
-if(isset($HTTP_COOKIE_VARS)){
- while(list($var, $val)=each($HTTP_COOKIE_VARS)){
- $$var=$val;
- }
-}
-if(isset($HTTP_SERVER_VARS)){
- while(list($var, $val)=each($HTTP_SERVER_VARS)){
- $$var=$val;
- }
-}
-
-$self=$PHP_SELF;
-
-if ($ps=="") $ps=20;
-if ($np=="") $np=0;
-if ($o=="") $o=0;
-
-if (($dt!='back') && ($dt!='er') && ($dt!='range')) $dt='back';
-if ($dp=="") $dp=0;
-if (($dx!=0) && ($dx!=-1) && ($dx!=1)) $dx=0;
-if ($dy<1970) $dy=1970;
-if (($dm<0) || ($dm>11)) $dm=0;
-if (($dd<=0) || ($dd>31)) $dd="01";
-
-$db=urldecode($db);
-$de=urldecode($de);
-
-if ($db=="") $db='01/01/1970';
-if ($de=="") $de='31/12/2020';
-
-// define this to enable stored support
-// $storedaddr="localhost";
-$storedocurl='/cgi-bin/storedoc.cgi';
-
-if (isset($q)) {
- $q=urldecode($q);
- $have_query_flag=1;
-} else {
- $have_query_flag=0;
-}
-
-$ul=urldecode($ul);
-$tag=urldecode($t);
-$lang=urldecode($lang);
-
-$query_orig=$q;
-
-if (isset($CHARSET_SAVED_QUERY_STRING)) {
- $q_local=urldecode($CHARSET_SAVED_QUERY_STRING);
- if (preg_match('/q=([^&]*)\&/',$q_local,$param)) {
- $q_local=urlencode($param[1]);
- } elseif (preg_match('/q=(.*)$/',$q_local,$param)) {
- $q_local=urlencode($param[1]);
- } else {
- $q_local=urlencode($q);
- }
-} else {
- $q_local=urlencode($q);
-}
-
-$ul_local=urlencode($ul);
-$t_local=urlencode($tag);
-$db_local=urlencode($db);
-$de_local=urlencode($de);
-$lang_local=urlencode($lang);
-
-if (($MAX_NP > 0) && ($np>$MAX_NP)) $np=$MAX_NP;
-if (($MAX_PS > 0) && ($ps>$MAX_PS)) $ps=$MAX_PS;
-
-// -----------------------------------------------
-// print_bottom()
-// -----------------------------------------------
-function print_bottom(){
- print ("<HR><center><img src=\"http://mnogosearch.org/img/mnogo.gif\">\n");
- print ("<font size=\"-1\">Powered by <a href=\"http://mnogosearch.org/\">mnoGoSearch</a></font><br>\n");
- print ("<p></BODY></HTML>\n");
-}
-
-
-// -----------------------------------------------
-// print_error_local($str)
-// -----------------------------------------------
-function print_error_local($str){
- print ("<CENTER><FONT COLOR=\"#FF0000\">An error occured!</FONT>\n");
- print ("<P><B>$str</B></CENTER>\n");
- print_bottom();
- exit;
-}
-
-// -----------------------------------------------
-// exit_local()
-// -----------------------------------------------
-function exit_local($print_err = 1) {
- drop_temp_table($print_err);
- exit;
-}
-
-// -----------------------------------------------
-// format_lastmod($lastmod)
-// -----------------------------------------------
-function format_lastmod($lastmod) {
- $temp=$lastmod;
- if (!$temp) $temp = 'undefined';
- else $temp = strftime('%a, %d %b %Y %H:%M:%S %Z',$temp);
-
- return $temp;
-}
-
-// -----------------------------------------------
-// format_dp($dp)
-// -----------------------------------------------
-function format_dp($dp) {
- $result=0;
-
- while ($dp != '') {
- if (preg_match('/^([\-\+]?\d+)([sMhdmy]?)/',$dp,$param)) {
- switch ($param[2]) {
- case 's': $multiplier=1; break;
- case 'M': $multiplier=60; break;
- case 'h': $multiplier=3600; break;
- case 'd': $multiplier=3600*24; break;
- case 'm': $multiplier=3600*24*31; break;
- case 'y': $multiplier=3600*24*365; break;
- default: $multiplier=1;
- }
-
- $result += $param[1]*$multiplier;
- $dp=preg_replace("/^[\-\+]?\d+$param[2]/",'',$dp);
- } else {
- return 0;
- }
- }
-
- return $result;
-}
-
-// -----------------------------------------------
-// format_userdate($date)
-// -----------------------------------------------
-function format_userdate($date) {
- $result=0;
-
- if (preg_match('/^(\d+)\/(\d+)\/(\d+)$/',$date,$param)) {
- $day=$param[1];
- $mon=$param[2];
- $year=$param[3];
-
- $result=mktime(0,0,0,$mon,$day,$year);
- }
-
- return $result;
-}
-
-// -----------------------------------------------
-// ParseDocText($text)
-// -----------------------------------------------
-function ParseDocText($text){
- global $all_words;
- global $hlbeg, $hlend;
-
- $str=$text;
-
- if (Udm_Api_Version() < 30200) {
- for ($i=0; $i<count($all_words); $i++) {
- $word=$all_words[$i];
- $str = preg_replace("/([\s\t\r\n\~\!\@\#\$\%\^\&\*\(\)\-\_\=\+\\\|\{\}\[\]\;\:\'\"\<\>\?\/\,\.]+)($word)/i","\\1$hlbeg\\2$hlend",$str);
- $str = preg_replace("/^($word)/i","$hlbeg\\1$hlend",$str);
- }
- } else {
- $str = str_replace("\2",$hlbeg,$str);
- $str = str_replace("\3",$hlend,$str);
- }
-
- return $str;
-}
-
-// -----------------------------------------------
-// print_template($t,$echo=1)
-// -----------------------------------------------
-function print_template($t,$echo=1){
- global $templates, $udm_agent;
- global $first_doc, $last_doc, $found, $query_orig, $error, $self;
- global $nav, $wordinfo;
- global $url, $ue, $o, $cat;
- global $clones, $searchtime;
- global $title, $rating, $desc, $contype, $lastmod, $docsize, $ndoc;
- global $keyw, $text, $category;
- global $crc, $Randoms, $rec_id, $DEBUG;
- global $lang_url_translation, $phpver;
-
-
- $str=$templates["$t"][$o];
- if ($str == '') $str=$templates["$t"][0];
-
- $str=ereg_replace('\$f', "$first_doc", $str);
- $str=ereg_replace('\$l', "$last_doc", $str);
- $str=ereg_replace('\$t', "$found", $str);
- $str=ereg_replace('\$A', $self, $str);
-
- $str=ereg_replace('\$Q', HtmlSpecialChars(StripSlashes($query_orig)), $str);
- $str=ereg_replace('\$q', urlencode($query_orig), $str);
- $str=eregi_replace('\$UE', $ue, $str);
-
- $str=ereg_replace('\$E', $error, $str);
- $str=ereg_replace('\$W', $wordinfo, $str);
-
- $str=ereg_replace('\$V', $nav, $str);
-
- if ($lang_url_translation == 'yes') {
- $nolangurl = ereg_replace("\.[a-z]{2}\.[a-z]{2,4}$", "", $url);
- $str=ereg_replace('\$DU', $nolangurl, $str);
- } else {
- $str=ereg_replace('\$DU', $url, $str);
- }
-
- $str=ereg_replace('\$DT', $title, $str);
- $str=ereg_replace('\$DR', "$rating", $str);
- $str=ereg_replace('\$DX', $text, $str);
- $str=ereg_replace('\$DE', ($desc != '')?$desc:$text, $str);
- $str=ereg_replace('\$DC', $contype, $str);
- $str=ereg_replace('\$DM', $lastmod, $str);
- $str=ereg_replace('\$DS', "$docsize", $str);
- $str=ereg_replace('\$DN', "$ndoc", $str);
- $str=ereg_replace('\$DD', $desc, $str);
- $str=ereg_replace('\$DK', $keyw, $str);
- $str=ereg_replace('\$SearchTime', "$searchtime", $str);
-
- if ($phpver >= 40006) {
- if (ereg('\$CP',$str)) {
- if ($temp_cp_arr=Udm_Cat_Path($udm_agent,$cat)) {
- reset($temp_cp_arr);
- $temp_cp='';
- for ($i=0; $i<count($temp_cp_arr); $i+=2) {
- $cp_path=$temp_cp_arr[$i];
- $cp_name=$temp_cp_arr[$i+1];
- $temp_cp .= " &gt; <a href=\"$PHP_SELF?cat=$cp_path\">$cp_name</a> ";
- }
- $str=ereg_replace('\$CP', $temp_cp, $str);
- } else $str=ereg_replace('\$CP', '', $str);
- }
-
- if (ereg('\$CS',$str)) {
- if ($temp_cp_arr=Udm_Cat_List($udm_agent,$cat)) {
- reset($temp_cp_arr);
- $temp_cp='';
- for ($i=0; $i<count($temp_cp_arr); $i+=2) {
- $cp_path=$temp_cp_arr[$i];
- $cp_name=$temp_cp_arr[$i+1];
- $temp_cp .= "<a href=\"$PHP_SELF?cat=$cp_path\">$cp_name</a><br>";
- }
- $str=ereg_replace('\$CS', $temp_cp, $str);
- } else $str=ereg_replace('\$CS', '', $str);
- }
-
- if (ereg('\$DY',$str)) {
- if ($temp_cp_arr=Udm_Cat_Path($udm_agent,$category)) {
- reset($temp_cp_arr);
- $temp_cp='';
- for ($i=0; $i<count($temp_cp_arr); $i+=2) {
- $cp_path=$temp_cp_arr[$i];
- $cp_name=$temp_cp_arr[$i+1];
- $temp_cp .= " &gt; <a href=\"$PHP_SELF?cat=$cp_path\">$cp_name</a> ";
- }
- $str=ereg_replace('\$DY', $temp_cp, $str);
- } else $str=ereg_replace('\$DY', '', $str);
- }
- } else {
- $str=ereg_replace('\$CP', '', $str);
- $str=ereg_replace('\$CS', '', $str);
- $str=ereg_replace('\$DY', '', $str);
- }
-
- $sub=$str;
- while($sub=strstr($sub,'$r')){
- $sub=substr($sub,2);
- $pos=0;
- $num='';
-
- while(($sub[$pos]>='0')&&($sub[$pos]<='9')){
- $num.=$sub[$pos++];
- }
-
- $str=ereg_replace('\$r'.$num, ''.$Randoms[$num], $str);
- }
-
-// if (strstr($str,'$CL')&&($t=='res')) {
-// if (strtolower($clones) == 'no') {
-// $str=ereg_replace('\$CL', '', $str);
-// } elseif ($crc<>'') {
-// }
- $str=ereg_replace('\$CL', $clon, $str);
-// }
-
- if($echo) echo $str; else return $str;
-}
-
-// -----------------------------------------------
-// make_nav($query_orig)
-// -----------------------------------------------
-function make_nav($query_orig){
- global $found,$np,$isnext,$ps,$tag,$ul,$self,$o,$m,$cat;
- global $dt, $dp, $dx, $dm, $dy, $dd, $db, $de, $lang, $wm, $wf;
- global $q_local,$ul_local,$t_local,$db_local,$de_local,$lang_local;
-
- if($np>0){
- $prevp=$np-1;
- $prev_href="$self?q=$q_local&np=$prevp&m=$m".
- ($ps==20?'':"&ps=$ps").
- ($tag==''?'':"&t=$t_local").
- ($ul==''?'':"&ul=$ul_local").
- ($wm==''?'':"&wm=$wm").
- ($wf==''?'':"&wf=$wf").
- (!$o?'':"&o=$o").
- ($dt=='back'?'':"&dt=$dt").
- (!$dp?'':"&dp=$dp").
- (!$dx?'':"&dx=$dx").
- ($dd=='01'?'':"&dd=$dd").
- (!$dm?'':"&dm=$dm").
- ($dy=='1970'?'':"&dy=$dy").
- ($db=='01/01/1970'?'':"&db=$db_local").
- ($de=='31/12/2020'?'':"&de=$de_local").
- ($cat==''?'':"&cat=$cat").
- ($lang==''?'':"&lang=$lang_local");
-
- $nav_left="<TD><A HREF=\"$prev_href\">Prev</A></TD>\n";
- } elseif ($np==0) {
- $nav_left="<TD><FONT COLOR=\"#707070\">Prev</FONT></TD>\n";
- }
-
- if($isnext==1) {
- $nextp=$np+1;
- $next_href="$self?q=$q_local&np=$nextp&m=$m".
- ($ps==20?'':"&ps=$ps").
- ($tag==''?'':"&t=$t_local").
- ($ul==''?'':"&ul=$ul_local").
- ($wm==''?'':"&wm=$wm").
- ($wf==''?'':"&wf=$wf").
- (!$o?'':"&o=$o").
- ($dt=='back'?'':"&dt=$dt").
- (!$dp?'':"&dp=$dp").
- (!$dx?'':"&dx=$dx").
- ($dd=='01'?'':"&dd=$dd").
- (!$dm?'':"&dm=$dm").
- ($dy=='1970'?'':"&dy=$dy").
- ($db=='01/01/1970'?'':"&db=$db_local").
- ($de=='31/12/2020'?'':"&de=$de_local").
- ($cat==''?'':"&cat=$cat").
- ($lang==''?'':"&lang=$lang_local");
-
- $nav_right="<TD><A HREF=\"$next_href\">Next</TD>\n";
- } else {
- $nav_right="<TD><FONT COLOR=\"#707070\">Next</FONT></TD>\n";
- }
-
- $nav_bar0='<TD>$NP</TD>';
- $nav_bar1='<TD><A HREF="$NH">$NP</A></TD>';
-
- $tp=ceil($found/$ps);
-
- $cp=$np+1;
-
- if ($cp>5) {
- $lp=$cp-5;
- } else {
- $lp=1;
- }
-
- $rp=$lp+10-1;
- if ($rp>$tp) {
- $rp=$tp;
- $lp=$rp-10+1;
- if ($lp<1) $lp=1;
- }
-
-
- if ($lp!=$rp) {
- for ($i=$lp; $i<=$rp;$i++) {
- $realp=$i-1;
-
- if ($i==$cp) {
- $nav_bar=$nav_bar.$nav_bar0;
- } else {
- $nav_bar=$nav_bar.$nav_bar1;
- }
-
- $href="$self?q=$q_local&np=$realp&m=$m".
- ($ps==20?'':"&ps=$ps").
- ($tag==''?'':"&t=$t_local").
- ($ul==''?'':"&ul=$ul_local").
- ($wm==''?'':"&wm=$wm").
- ($wf==''?'':"&wf=$wf").
- (!$o?'':"&o=$o").
- ($dt=='back'?'':"&dt=$dt").
- (!$dp?'':"&dp=$dp").
- (!$dx?'':"&dx=$dx").
- ($dd=='01'?'':"&dd=$dd").
- (!$dm?'':"&dm=$dm").
- ($dy=='1970'?'':"&dy=$dy").
- ($db=='01/01/1970'?'':"&db=$db_local").
- ($de=='31/12/2020'?'':"&de=$de_local").
- ($cat==''?'':"&cat=$cat").
- ($lang==''?'':"&lang=$lang_local");
-
- $nav_bar=ereg_replace('\$NP',"$i",$nav_bar);
- $nav_bar=ereg_replace('\$NH',"$href",$nav_bar);
- }
-
- $nav="<TABLE BORDER=0><TR>$nav_left $nav_bar $nav_right</TR></TABLE>\n";
- } elseif ($found) {
- $nav="<TABLE BORDER=0><TR>$nav_left $nav_right</TR></TABLE>\n";
- }
-
- return $nav;
-}
-
-// -----------------------------------------------
-// M A I N
-// -----------------------------------------------
-
- if (preg_match("/^(\d+)\.(\d+)\.(\d+)/",phpversion(),$param)) {
- $phpver=$param[1];
- if ($param[2] < 9) {
- $phpver .= "0$param[2]";
- } else {
- $phpver .= "$param[2]";
- }
- if ($param[3] < 9) {
- $phpver .= "0$param[3]";
- } else {
- $phpver .= "$param[3]";
- }
- } else {
- print "Cannot determine php version: <b>".phpversion()."</b>\n";
- exit;
- }
-
- $have_spell_flag=0;
-
- if (Udm_Api_Version() >= 30204) {
- $udm_agent=Udm_Alloc_Agent($dbaddr);
- } else {
- $udm_agent=Udm_Alloc_Agent($dbaddr,$dbmode);
- }
-
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_PAGE_SIZE,$ps);
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_PAGE_NUM,$np);
-
- if ($phpver >= 40006) {
- if ($temp_cp_arr=Udm_Cat_Path($udm_agent,$cat)) {
- reset($temp_cp_arr);
- $temp_cp='';
- for ($i=0; $i<count($temp_cp_arr); $i+=2) {
- $cp_path=$temp_cp_arr[$i];
- $cp_name=$temp_cp_arr[$i+1];
- $temp_cp .= " &gt; <a href=\"$PHP_SELF?cat=$cp_path\">$cp_name</a> ";
- }
- $t_CP=$temp_cp;
- }
-
- if ($temp_cp_arr=Udm_Cat_List($udm_agent,$cat)) {
- reset($temp_cp_arr);
- $temp_cp='';
- for ($i=0; $i<count($temp_cp_arr); $i+=2) {
- $cp_path=$temp_cp_arr[$i];
- $cp_name=$temp_cp_arr[$i+1];
- $temp_cp .= "<a href=\"$PHP_SELF?cat=$cp_path\">$cp_name</a><br>";
- }
- $t_CS=$temp_cp;
- }
-
- if ($temp_cp_arr=Udm_Cat_Path($udm_agent,$category)) {
- reset($temp_cp_arr);
- $temp_cp='';
- for ($i=0; $i<count($temp_cp_arr); $i+=2) {
- $cp_path=$temp_cp_arr[$i];
- $cp_name=$temp_cp_arr[$i+1];
- $temp_cp .= " &gt; <a href=\"$PHP_SELF?cat=$cp_path\">$cp_name</a> ";
- }
- $t_DY=$temp_cp;
- }
- }
-
- $trackquery=strtolower($trackquery);
- if ($trackquery == 'yes') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_TRACK_MODE,UDM_TRACK_ENABLED);
- } else {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_TRACK_MODE,UDM_TRACK_DISABLED);
- }
-
- $phrase=strtolower($phrase);
- if ($phrase == 'yes') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_PHRASE_MODE,UDM_PHRASE_ENABLED);
- } else {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_PHRASE_MODE,UDM_PHRASE_DISABLED);
- }
-
- $cache=strtolower($cache);
- if ($cache == 'yes') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_CACHE_MODE,UDM_CACHE_ENABLED);
- } else {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_CACHE_MODE,UDM_CACHE_DISABLED);
- }
-
- $ispelluseprefixes=strtolower($ispelluseprefixes);
- if ($ispelluseprefixes == 'yes') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_ISPELL_PREFIXES,UDM_PREFIXES_ENABLED);
- } else {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_ISPELL_PREFIXES,UDM_PREFIXES_DISABLED);
- }
-
- if (Udm_Api_Version() >= 30111) {
- $crosswords=strtolower($crosswords);
- if ($crosswords == 'yes') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_CROSS_WORDS,UDM_CROSS_WORDS_ENABLED);
- } else {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_CROSS_WORDS,UDM_CROSS_WORDS_DISABLED);
- }
- }
-
- if ($localcharset != '') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_CHARSET,$localcharset);
- }
-
- if (Udm_Api_Version() >= 30200) {
- if ($localcharset == '') Udm_Set_Agent_Param($udm_agent,UDM_PARAM_CHARSET,'utf-8');
- if ($browsercharset != '') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_BROWSER_CHARSET,$browsercharset);
- Header ("Content-Type: text/html; charset=$browsercharset");
- } else {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_BROWSER_CHARSET,'utf-8');
- Header ("Content-Type: text/html; charset=utf-8");
- }
- if ($hlbeg != '') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_HLBEG,$hlbeg);
- } else {
- $hlbeg='<font color="000088"><b>';
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_HLBEG,'<font color="000088"><b>');
- }
- if ($hlend != '') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_HLEND,$hlend);
- } else {
- $hlend='</b></font>';
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_HLEND,'</b></font>');
- }
- }
-
-
- for ($i=0; $i < count($stopwordtable_arr); $i++) {
- if ($stopwordtable_arr[$i] != '') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_STOPTABLE,$stopwordtable_arr[$i]);
- }
- }
-
- for ($i=0; $i < count($stopwordfile_arr); $i++) {
- if ($stopwordfile_arr[$i] != '') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_STOPFILE,$stopwordfile_arr[$i]);
- }
- }
-
- if (Udm_Api_Version() >= 30203) {
- for ($i=0; $i < count($synonym_arr); $i++) {
- if ($synonym_arr[$i] != '') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_SYNONYM,$synonym_arr[$i]);
- }
- }
-
- for ($i=0; $i < count($searchd_arr); $i++) {
- if ($searchd_arr[$i] != '') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_SEARCHD,$searchd_arr[$i]);
- }
- }
-
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_QSTRING,$QUERY_STRING);
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_REMOTE_ADDR,$REMOTE_ADDR);
- }
-
- if (Udm_Api_Version() >= 30204) {
- if ($have_query_flag)Udm_Set_Agent_Param($udm_agent,UDM_PARAM_QUERY,$query_orig);
- if ($storedaddr != '') Udm_Set_Agent_Param($udm_agent,UDM_PARAM_STORED,$storedaddr);
- }
-
- if ($m=='any') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_SEARCH_MODE,UDM_MODE_ANY);
- } elseif ($m=='all') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_SEARCH_MODE,UDM_MODE_ALL);
- } elseif ($m=='bool') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_SEARCH_MODE,UDM_MODE_BOOL);
- } elseif ($m=='phrase') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_SEARCH_MODE,UDM_MODE_PHRASE);
- } else {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_SEARCH_MODE,UDM_MODE_ALL);
- }
-
- if ($wm=='wrd') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_WORD_MATCH,UDM_MATCH_WORD);
- } elseif ($wm=='beg') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_WORD_MATCH,UDM_MATCH_BEGIN);
- } elseif ($wm=='end') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_WORD_MATCH,UDM_MATCH_END);
- } elseif ($wm=='sub') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_WORD_MATCH,UDM_MATCH_SUBSTR);
- } else {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_WORD_MATCH,UDM_MATCH_WORD);
- }
-
- if ($minwordlength >= 0) {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_MIN_WORD_LEN,$minwordlength);
- }
-
- if ($maxwordlength >= 0) {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_MAX_WORD_LEN,$maxwordlength);
- }
-
- if ($phpver >= 40007) {
- if ($vardir != '') Udm_Set_Agent_Param($udm_agent,UDM_PARAM_VARDIR,$vardir);
- if ($datadir != '') Udm_Set_Agent_Param($udm_agent,UDM_PARAM_VARDIR,$datadir);
- }
-
- if ($wf != '') {
- Udm_Set_Agent_Param($udm_agent,UDM_PARAM_WEIGHT_FACTOR,$wf);
- }
-
- if ($ul != '') {
- $auto_wild=strtolower($auto_wild);
- if (($auto_wild == 'yes') ||
- ($auto_wild == '')) {
- if ((substr($ul,0,7) == 'http://') ||
- (substr($ul,0,8) == 'https://') ||
- (substr($ul,0,7) == 'news://') ||
- (substr($ul,0,6) == 'ftp://')) {
- Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_URL,"$ul%");
- } else {
- Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_URL,"%$ul%");
- }
- } else {
- Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_URL,$ul);
- }
- }
-
- if ($tag != '') Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_TAG,$tag);
- if ($cat != '') Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_CAT,$cat);
- if ($lang != '')Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_LANG,$lang);
-
- if (($dt == 'back') && ($dp != '0')) {
- $recent_time=format_dp($dp);
- if ($recent_time != 0) {
- $dl=time()-$recent_time;
- Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_DATE,">$dl");
- }
- } elseif ($dt=='er') {
- $recent_time=mktime(0,0,0,($dm+1),$dd,$dy);
- if ($dx == -1) {
- Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_DATE,"<$recent_time");
- } elseif ($dx == 1) {
- Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_DATE,">$recent_time");
- }
- } elseif ($dt=='range') {
- $begin_time=format_userdate($db);
- if ($begin_time) Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_DATE,">$begin_time");
-
- $end_time=format_userdate($de);
- if ($end_time) Udm_Add_Search_Limit($udm_agent,UDM_LIMIT_DATE,"<$end_time");
- }
-
-// if ($have_query_flag) $q=ParseQ($q);
-
-?>
-
-<HTML>
-<HEAD>
- <TITLE>mnoGoSearch: <? echo HtmlSpecialChars(StripSlashes($query_orig)); ?></TITLE>
-</HEAD>
-
-<body BGCOLOR="#FFFFFF" LINK="#0050A0" VLINK="#0050A0" ALINK="#0050A0">
-<center>
-
-<FORM METHOD=GET ACTION="<? echo $self; ?>">
-<table bgcolor=#eeeee0 border=0 width=100%>
-<tr><td>
-<BR>
-<INPUT TYPE="hidden" NAME="ps" VALUE="10">
-Search for: <INPUT TYPE="text" NAME="q" SIZE=50 VALUE="<? echo HtmlSpecialChars(StripSlashes($query_orig)); ?>">
-<INPUT TYPE="submit" VALUE="Search!"><BR>
-
-Results per page:
-<SELECT NAME="ps">
-<OPTION VALUE="10" <? if ($ps==10) echo 'SELECTED';?>>10
-<OPTION VALUE="20" <? if ($ps==20) echo 'SELECTED';?>>20
-<OPTION VALUE="50" <? if ($ps==50) echo 'SELECTED';?>>50
-</SELECT>
-
-Match:
-<SELECT NAME="m">
-<OPTION VALUE="all" <? if ($m=='all') echo 'SELECTED';?>>All
-<OPTION VALUE="any" <? if ($m=='any') echo 'SELECTED';?>>Any
-<OPTION VALUE="bool" <? if ($m=='bool') echo 'SELECTED';?>>Boolean
-<OPTION VALUE="phrase" <? if ($m=='phrase') echo 'SELECTED';?>>Full phrase
-</SELECT>
-
-
-Search for:
-<SELECT NAME="wm">
-<OPTION VALUE="wrd" <? if ($wm=='wrd') echo 'SELECTED';?>>Whole word
-<OPTION VALUE="beg" <? if ($wm=='beg') echo 'SELECTED';?>>Beginning
-<OPTION VALUE="end" <? if ($wm=='end') echo 'SELECTED';?>>Ending
-<OPTION VALUE="sub" <? if ($wm=='sub') echo 'SELECTED';?>>Substring
-</SELECT>
-
-<br>
-
-Search through:
-<SELECT NAME="ul">
-<OPTION VALUE="" <? if ($ul=='') echo 'SELECTED';?>>Entire site
-<OPTION VALUE="/docs/" <? if ($ul=='/docs/') echo 'SELECTED';?>>Docs
-<OPTION VALUE="/files/" <? if ($ul=='/files') echo 'SELECTED';?>>Files
-<OPTION VALUE="/servers/" <? if ($ul=='/servers/') echo 'SELECTED';?>>Servers
-</SELECT>
-
-in:
-<SELECT NAME="wf">
-<OPTION VALUE="222211" <? if ($wf=='222211') echo 'SELECTED';?>>all sections
-<OPTION VALUE="220000" <? if ($wf=='220000') echo 'SELECTED';?>>Description
-<OPTION VALUE="202000" <? if ($wf=='202000') echo 'SELECTED';?>>Keywords
-<OPTION VALUE="200200" <? if ($wf=='200200') echo 'SELECTED';?>>Title
-<OPTION VALUE="200010" <? if ($wf=='200010') echo 'SELECTED';?>>Body
-</SELECT>
-
-Language:
-<SELECT NAME="lang">
-<OPTION VALUE="" <? if ($lang=='222211') echo 'SELECTED';?>>Any
-<OPTION VALUE="en" <? if ($lang=='en') echo 'SELECTED';?>>English
-<OPTION VALUE="ru" <? if ($lang=='ru') echo 'SELECTED';?>>Russian
-</SELECT>
-
-Restrict search:
-<SELECT NAME="t">
-<OPTION VALUE="" <? if ($t=='') echo 'SELECTED';?>>All sites
-<OPTION VALUE="AA" <? if ($t=='AA') echo 'SELECTED';?>>Sport
-<OPTION VALUE="BB" <? if ($t=='BB') echo 'SELECTED';?>>Shopping
-<OPTION VALUE="CC" <? if ($t=='CC') echo 'SELECTED';?>>Internet
-</SELECT>
-
-</td></tr>
-
-<!-- 'search with time limits' options -->
-<TR><TD>
-<TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0>
-<CAPTION>
-Limit results to pages published within a specified period of time.<BR>
-<FONT SIZE=-1><I>(Please select only one option)</I></FONT>
-</CAPTION>
-<TR>
-<TD VALIGN=center><INPUT TYPE=radio NAME="dt" VALUE="back" <? if ($dt=='back') echo 'checked';?>></TD>
-<TD><SELECT NAME="dp">
-<OPTION VALUE="0" <? if ($dp=='0') echo 'SELECTED';?>>anytime
-<OPTION VALUE="10M" <? if ($dp=='10M') echo 'SELECTED';?>>in the last ten minutes
-<OPTION VALUE="1h" <? if ($dp=='1h') echo 'SELECTED';?>>in the last hour
-<OPTION VALUE="7d" <? if ($dp=='7d') echo 'SELECTED';?>>in the last week
-<OPTION VALUE="14d" <? if ($dp=='14d') echo 'SELECTED';?>>in the last 2 weeks
-<OPTION VALUE="1m" <? if ($dp=='1m') echo 'SELECTED';?>>in the last month
-</SELECT>
-</TD>
-</TR>
-<TR>
-<TD VALIGN=center><INPUT type=radio NAME="dt" VALUE="er" <? if ($dt=='er') echo 'checked';?>>
-</TD>
-<TD><SELECT NAME="dx">
-<OPTION VALUE="1" <? if ($dx=='1') echo 'SELECTED';?>>After
-<OPTION VALUE="-1" <? if ($dx=='-1') echo 'SELECTED';?>>Before
-</SELECT>
-
-or on
-
-<SELECT NAME="dm">
-<OPTION VALUE="0" <? if ($dm=='0') echo 'SELECTED';?>>January
-<OPTION VALUE="1" <? if ($dm=='1') echo 'SELECTED';?>>February
-<OPTION VALUE="2" <? if ($dm=='2') echo 'SELECTED';?>>March
-<OPTION VALUE="3" <? if ($dm=='3') echo 'SELECTED';?>>April
-<OPTION VALUE="4" <? if ($dm=='4') echo 'SELECTED';?>>May
-<OPTION VALUE="5" <? if ($dm=='5') echo 'SELECTED';?>>June
-<OPTION VALUE="6" <? if ($dm=='6') echo 'SELECTED';?>>July
-<OPTION VALUE="7" <? if ($dm=='7') echo 'SELECTED';?>>August
-<OPTION VALUE="8" <? if ($dm=='8') echo 'SELECTED';?>>September
-<OPTION VALUE="9" <? if ($dm=='9') echo 'SELECTED';?>>October
-<OPTION VALUE="10" <? if ($dm=='10') echo 'SELECTED';?>>November
-<OPTION VALUE="11" <? if ($dm=='11') echo 'SELECTED';?>>December
-</SELECT>
-<INPUT TYPE=text NAME="dd" VALUE="<? echo $dd; ?>" SIZE=2 maxlength=2>
-,
-<SELECT NAME="dy" >
-<OPTION VALUE="1999" <? if ($dy=='1999') echo 'SELECTED';?>>1999
-<OPTION VALUE="2000" <? if ($dy=='2000') echo 'SELECTED';?>>2000
-<OPTION VALUE="2001" <? if ($dy=='2001') echo 'SELECTED';?>>2001
-</SELECT>
-</TD>
-</TR>
-<TR>
-<TD VALIGN=center><INPUT TYPE=radio NAME="dt" VALUE="range" <? if ($dt=='range') echo 'checked';?>>
-</TD>
-<TD>
-Between
-<INPUT TYPE=text NAME="db" VALUE="<? echo $db; ?>" SIZE=11 MAXLENGTH=11>
-and
-<INPUT TYPE=text NAME="de" VALUE="<? echo $de; ?>" SIZE=11 MAXLENGTH=11>
-</TD>
-</TR>
-</TABLE>
-
-</TD></TR>
-<!-- end of stl options -->
-
-<!-- categories stuff -->
-<tr><td><? echo $t_CP; ?></td></tr>
-<tr><td><? echo $t_CS; ?></td></tr>
-<input type=hidden name=cat value="<? echo $cat; ?>">
-<!-- categories stuff end -->
-
-</table>
-</form>
-</center>
-
-
-<?
-
- $ispellmode=strtolower($ispellmode);
- if ($ispellmode == 'db') {
- if (! Udm_Load_Ispell_Data($udm_agent,UDM_ISPELL_TYPE_DB,'','',1)) {
- print_error_local(Udm_Error($udm_agent));
- } else $have_spell_flag=1;
- } elseif ($ispellmode == 'server') {
- if (Udm_Api_Version() >= 30112) {
- if (! Udm_Load_Ispell_Data($udm_agent,UDM_ISPELL_TYPE_SERVER,$spell_host,'',1)) {
- print_error_local("Error loading ispell data from server $spell_host");
- } else $have_spell_flag=1;
- }
- } elseif ($ispellmode == 'text') {
- reset($affix_file);
- while (list($t_lang,$file)=each($affix_file)) {
- if (! Udm_Load_Ispell_Data($udm_agent,UDM_ISPELL_TYPE_AFFIX,$t_lang,$file,0)) {
- print_error_local("Error loading ispell data from file");
- } else $have_spell_flag=1;
-
- $temp=$spell_file[$t_lang];
- for ($i=0; $i<count($temp); $i++) {
- if (! Udm_Load_Ispell_Data($udm_agent,UDM_ISPELL_TYPE_SPELL,$t_lang,$temp[$i],1)) {
- print_error_local("Error loading ispell data from file");
- } else $have_spell_flag=1;
- }
- }
- }
-
-if (! $have_query_flag) {
- print_bottom();
- return;
-} elseif ($have_query_flag && ($q=='')) {
- print ("<FONT COLOR=red>You should give at least one word to search for.</FONT>\n");
- print_bottom();
- return;
-}
-
-$res=Udm_Find($udm_agent,$q);
-
-if(($errno=Udm_Errno($udm_agent))>0){
- print_error_local(Udm_Error($udm_agent));
-} else {
- $found=Udm_Get_Res_Param($res,UDM_PARAM_FOUND);
- $rows=Udm_Get_Res_Param($res,UDM_PARAM_NUM_ROWS);
- $wordinfo=Udm_Get_Res_Param($res,UDM_PARAM_WORDINFO);
- $searchtime=Udm_Get_Res_Param($res,UDM_PARAM_SEARCHTIME);
- $first_doc=Udm_Get_Res_Param($res,UDM_PARAM_FIRST_DOC);
- $last_doc=Udm_Get_Res_Param($res,UDM_PARAM_LAST_DOC);
-
- if (!$found) {
- print ("Search Time: $searchtime<br>Search results:\n");
- print ("<small>$wordinfo</small><HR><CENTER>Sorry, but search returned no results.<P>\n");
- print ("<I>Try to produce less restrictive search query.</I></CENTER>\n");
-
- print_bottom();
- return;
- }
-
- $from=IntVal($np)*IntVal($ps);
- $to=IntVal($np+1)*IntVal($ps);
-
- if($to>$found) $to=$found;
- if (($from+$ps)<$found) $isnext=1;
- $nav=make_nav($query_orig);
-
- print("Search Time: $searchtime<br>Search results: <small>$wordinfo</small><HR>\n");
- print("Displaying documents $first_doc-$last_doc of total <B>$found</B> found.\n");
-
- $stored_link=-1;
- if ((Udm_Api_Version() == 30203) && ($storedaddr != '')) {
- $stored_link=Udm_Open_Stored($udm_agent,$storedaddr);
- }
-
- for($i=0;$i<$rows;$i++){
- $excerpt_flag=0;
- if (Udm_Api_Version() >= 30204) {
- $excerpt_flag=Udm_Make_Excerpt($udm_agent, $res, $i);
- }
-
- $ndoc=Udm_Get_Res_Field($res,$i,UDM_FIELD_ORDER);
- $rating=Udm_Get_Res_Field($res,$i,UDM_FIELD_RATING);
- $url=Udm_Get_Res_Field($res,$i,UDM_FIELD_URL);
- $contype=Udm_Get_Res_Field($res,$i,UDM_FIELD_CONTENT);
- $docsize=Udm_Get_Res_Field($res,$i,UDM_FIELD_SIZE);
- $lastmod=format_lastmod(Udm_Get_Res_Field($res,$i,UDM_FIELD_MODIFIED));
-
- $title=Udm_Get_Res_Field($res,$i,UDM_FIELD_TITLE);
- $title=($title) ? htmlspecialChars($title):'No title';
-
- $title=ParseDocText($title);
- $text=ParseDocText(htmlspecialChars(Udm_Get_Res_Field($res,$i,UDM_FIELD_TEXT)));
- $keyw=ParseDocText(htmlspecialChars(Udm_Get_Res_Field($res,$i,UDM_FIELD_KEYWORDS)));
- $desc=ParseDocText(htmlspecialChars(Udm_Get_Res_Field($res,$i,UDM_FIELD_DESC)));
-
- $crc=Udm_Get_Res_Field($res,$i,UDM_FIELD_CRC);
- $rec_id=Udm_Get_Res_Field($res,$i,UDM_FIELD_URLID);
-
- if (Udm_Api_Version() >= 30203) {
- $doclang=Udm_Get_Res_Field($res,$i,UDM_FIELD_LANG);
- $doccharset=Udm_Get_Res_Field($res,$i,UDM_FIELD_CHARSET);
- }
-
- if ($phpver >= 40006) {
- $category=Udm_Get_Res_Field($res,$i,UDM_FIELD_CATEGORY);
- } else {
- $category='';
- }
-
- print ("<DL><DT><b>$ndoc.</b><a href=\"$url\" TARGET=\"_blank\"><b>$title</b></a>\n");
- print ("[<b>$rating</b>]<DD>\n");
- print (($desc != '')?$desc:$text."...<BR>$t_DY<UL><li>\n");
- print ("<A HREF=\"$url\" TARGET=\"_blank\">$url</A>\n");
- print ("($contype) $lastmod, $docsize bytes</UL></DL>\n");
-
- if (Udm_Api_Version() == 30203) {
- if ((($stored_link>0) && (Udm_Check_Stored($udm_agent,$stored_link,Udm_CRC32($udm_agent,$url)))) ||
- ($stored_link==-1)) {
- $storedstr="$storedocurl?rec_id=".Udm_CRC32($udm_agent,$url).
- "&DM=".urlencode($lastmod).
- "&DS=$docsize".
- "&L=$doclang".
- "&CS=$doccharset".
- "&DU=".urlencode($url).
- "&q=".urlencode($query_orig);
- print ("<DD><a href=\"$storedstr\">Cached copy</a>\n");
- }
- } elseif (Udm_Api_Version() >= 30204) {
- if ($excerpt_flag) {
- $storedstr="$storedocurl?rec_id=".Udm_CRC32($udm_agent,$save_url).
- "&DM=".urlencode($lastmod).
- "&DS=$docsize".
- "&L=$doclang".
- "&CS=$doccharset".
- "&DU=".urlencode($save_url).
- "&q=".urlencode($query_orig);
- print_template('stored');
- }
- }
- }
-
- if ((Udm_Api_Version() == 30203) &&
- ($stored_link>0)) {
- Udm_Close_Stored($udm_agent, $stored_link);
- }
-
- print("<HR><CENTER> $nav </CENTER>\n");
- print_bottom();
-
- // Free result
- Udm_Free_Res($res);
-}
-
- if ($have_spell_flag) Udm_Free_Ispell_Data($udm_agent);
- Udm_Free_Agent($udm_agent);
-?>
diff --git a/ext/mnogosearch/php_mnogo.c b/ext/mnogosearch/php_mnogo.c
deleted file mode 100644
index 4d8b4efe0..000000000
--- a/ext/mnogosearch/php_mnogo.c
+++ /dev/null
@@ -1,2667 +0,0 @@
-/* $Source: /repository/php-src/ext/mnogosearch/Attic/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.90.2.6 2005/01/23 15:01:44 gluke Exp $ */
-
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: |
- | Initial version by Alex Barkov <bar@izhcom.ru> |
- | and Ramil Kalimullin <ram@izhcom.ru> |
- | Further development by Sergey Kartashoff <gluke@mail.ru> |
- +----------------------------------------------------------------------+
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_mnogo.h"
-#include "ext/standard/php_standard.h"
-#include "ext/standard/info.h"
-#include "php_globals.h"
-
-#ifdef HAVE_MNOGOSEARCH
-
-#define UDMSTRSIZ 1024*5
-
-#define UDM_FIELD_URLID 1
-#define UDM_FIELD_URL 2
-#define UDM_FIELD_CONTENT 3
-#define UDM_FIELD_TITLE 4
-#define UDM_FIELD_KEYWORDS 5
-#define UDM_FIELD_DESC 6
-#define UDM_FIELD_TEXT 7
-#define UDM_FIELD_SIZE 8
-#define UDM_FIELD_RATING 9
-#define UDM_FIELD_MODIFIED 10
-#define UDM_FIELD_ORDER 11
-#define UDM_FIELD_CRC 12
-#define UDM_FIELD_CATEGORY 13
-#define UDM_FIELD_LANG 14
-#define UDM_FIELD_CHARSET 15
-#define UDM_FIELD_SITEID 16
-#define UDM_FIELD_POP_RANK 17
-#define UDM_FIELD_ORIGINID 18
-
-/* udm_set_agent_param constants */
-#define UDM_PARAM_PAGE_SIZE 1
-#define UDM_PARAM_PAGE_NUM 2
-#define UDM_PARAM_SEARCH_MODE 3
-#define UDM_PARAM_CACHE_MODE 4
-#define UDM_PARAM_TRACK_MODE 5
-#define UDM_PARAM_CHARSET 6
-#define UDM_PARAM_STOPTABLE 7
-#define UDM_PARAM_STOPFILE 8
-#define UDM_PARAM_WEIGHT_FACTOR 9
-#define UDM_PARAM_WORD_MATCH 10
-#define UDM_PARAM_PHRASE_MODE 11
-#define UDM_PARAM_MIN_WORD_LEN 12
-#define UDM_PARAM_MAX_WORD_LEN 13
-#define UDM_PARAM_ISPELL_PREFIXES 14
-#define UDM_PARAM_CROSS_WORDS 15
-#define UDM_PARAM_VARDIR 16
-#define UDM_PARAM_LOCAL_CHARSET 17
-#define UDM_PARAM_BROWSER_CHARSET 18
-#define UDM_PARAM_HLBEG 19
-#define UDM_PARAM_HLEND 20
-#define UDM_PARAM_SYNONYM 21
-#define UDM_PARAM_SEARCHD 22 /* unused */
-#define UDM_PARAM_QSTRING 23
-#define UDM_PARAM_REMOTE_ADDR 24
-#define UDM_PARAM_QUERY 25
-#define UDM_PARAM_STORED 26
-#define UDM_PARAM_GROUPBYSITE 27
-#define UDM_PARAM_SITEID 28
-#define UDM_PARAM_DETECT_CLONES 29
-#define UDM_PARAM_SORT_ORDER 30
-#define UDM_PARAM_RESULTS_LIMIT 31
-#define UDM_PARAM_EXCERPT_SIZE 32
-#define UDM_PARAM_EXCERPT_PADDING 33
-
-/* udm_add_search_limit constants */
-#define UDM_LIMIT_URL 1
-#define UDM_LIMIT_TAG 2
-#define UDM_LIMIT_LANG 3
-#define UDM_LIMIT_CAT 4
-#define UDM_LIMIT_DATE 5
-#define UDM_LIMIT_TYPE 6
-
-/* word match type */
-#define UDM_MATCH_WORD 0
-#define UDM_MATCH_BEGIN 1
-#define UDM_MATCH_SUBSTR 2
-#define UDM_MATCH_END 3
-
-/* track modes */
-#define UDM_TRACK_ENABLED 1
-#define UDM_TRACK_DISABLED 0
-
-/* cache modes */
-#define UDM_CACHE_ENABLED 1
-#define UDM_CACHE_DISABLED 0
-
-/* phrase modes */
-#define UDM_PHRASE_ENABLED 1
-#define UDM_PHRASE_DISABLED 0
-
-/* prefix modes */
-#define UDM_PREFIXES_ENABLED 1
-#define UDM_PREFIXES_DISABLED 0
-
-/* crosswords modes */
-#define UDM_CROSS_WORDS_ENABLED 1
-#define UDM_CROSS_WORDS_DISABLED 0
-
-/* General modes */
-#define UDM_ENABLED 1
-#define UDM_DISABLED 0
-
-/* udm_get_res_param constants */
-#define UDM_PARAM_NUM_ROWS 256
-#define UDM_PARAM_FOUND 257
-#define UDM_PARAM_WORDINFO 258
-#define UDM_PARAM_SEARCHTIME 259
-#define UDM_PARAM_FIRST_DOC 260
-#define UDM_PARAM_LAST_DOC 261
-#define UDM_PARAM_WORDINFO_ALL 262
-
-/* udm_load_ispell_data constants */
-#define UDM_ISPELL_TYPE_AFFIX 1
-#define UDM_ISPELL_TYPE_SPELL 2
-#define UDM_ISPELL_TYPE_DB 3
-#define UDM_ISPELL_TYPE_SERVER 4
-
-/* True globals, no need for thread safety */
-static int le_link,le_res;
-
-#include <udm_config.h>
-#include <udmsearch.h>
-
-/* {{{ mnogosearch_functions[]
- */
-function_entry mnogosearch_functions[] = {
- PHP_FE(udm_api_version, NULL)
-
-#if UDM_VERSION_ID >= 30200
- PHP_FE(udm_check_charset, NULL)
-#if UDM_VERSION_ID >= 30203
- PHP_FE(udm_crc32, NULL)
-#endif
-#if UDM_VERSION_ID >= 30204
- PHP_FE(udm_parse_query_string, NULL)
- PHP_FE(udm_make_excerpt, NULL)
- PHP_FE(udm_set_agent_param_ex, NULL)
- PHP_FE(udm_get_agent_param_ex, NULL)
- PHP_FE(udm_get_res_field_ex, NULL)
-#endif
-#if UDM_VERSION_ID >= 30211
- PHP_FE(udm_hash32, NULL)
- PHP_FE(udm_alloc_agent_array, NULL)
-#endif
-#if UDM_VERSION_ID >= 30216
- PHP_FE(udm_store_doc_cgi, NULL)
-#endif
-#endif
-
- PHP_FE(udm_alloc_agent, NULL)
- PHP_FE(udm_set_agent_param, NULL)
-
- PHP_FE(udm_load_ispell_data, NULL)
- PHP_FE(udm_free_ispell_data, NULL)
-
- PHP_FE(udm_add_search_limit, NULL)
- PHP_FE(udm_clear_search_limits, NULL)
-
- PHP_FE(udm_errno, NULL)
- PHP_FE(udm_error, NULL)
-
- PHP_FE(udm_find, NULL)
- PHP_FE(udm_get_res_param, NULL)
- PHP_FE(udm_get_res_field, NULL)
-
- PHP_FE(udm_cat_list, NULL)
- PHP_FE(udm_cat_path, NULL)
-
- PHP_FE(udm_free_res, NULL)
- PHP_FE(udm_free_agent, NULL)
-
-#if UDM_VERSION_ID > 30110
- PHP_FE(udm_get_doc_count, NULL)
-#endif
-
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-zend_module_entry mnogosearch_module_entry = {
- STANDARD_MODULE_HEADER,
- "mnogosearch",
- mnogosearch_functions,
- PHP_MINIT(mnogosearch),
- PHP_MSHUTDOWN(mnogosearch),
- PHP_RINIT(mnogosearch),
- NULL,
- PHP_MINFO(mnogosearch),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
-};
-
-
-#ifdef COMPILE_DL_MNOGOSEARCH
-ZEND_GET_MODULE(mnogosearch)
-#endif
-
-static void _free_udm_agent(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- UDM_AGENT * Agent = (UDM_AGENT *)rsrc->ptr;
-#if UDM_VERSION_ID >= 30204
- UdmEnvFree(Agent->Conf);
- UdmAgentFree(Agent);
-#else
- UdmFreeEnv(Agent->Conf);
- UdmFreeAgent(Agent);
-#endif
-}
-
-static void _free_udm_res(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- UDM_RESULT * Res = (UDM_RESULT *)rsrc->ptr;
-
-#if UDM_VERSION_ID >= 30204
- UdmResultFree(Res);
-#else
- UdmFreeResult(Res);
-#endif
-}
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-DLEXPORT PHP_MINIT_FUNCTION(mnogosearch)
-{
- UdmInit();
- le_link = zend_register_list_destructors_ex(_free_udm_agent,NULL,"mnogosearch agent",module_number);
- le_res = zend_register_list_destructors_ex(_free_udm_res,NULL,"mnogosearch result",module_number);
-
- REGISTER_LONG_CONSTANT("UDM_FIELD_URLID", UDM_FIELD_URLID,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_URL", UDM_FIELD_URL,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_CONTENT", UDM_FIELD_CONTENT,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_TITLE", UDM_FIELD_TITLE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_KEYWORDS", UDM_FIELD_KEYWORDS,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_DESC", UDM_FIELD_DESC,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_DESCRIPTION", UDM_FIELD_DESC,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_TEXT", UDM_FIELD_TEXT,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_SIZE", UDM_FIELD_SIZE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_RATING", UDM_FIELD_RATING,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_SCORE", UDM_FIELD_RATING,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_MODIFIED", UDM_FIELD_MODIFIED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_ORDER", UDM_FIELD_ORDER,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_CRC", UDM_FIELD_CRC,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_CATEGORY", UDM_FIELD_CATEGORY,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_LANG", UDM_FIELD_LANG,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_CHARSET", UDM_FIELD_CHARSET,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_SITEID", UDM_FIELD_SITEID,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_POP_RANK", UDM_FIELD_POP_RANK,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_FIELD_ORIGINID", UDM_FIELD_ORIGINID,CONST_CS | CONST_PERSISTENT);
-
- /* udm_set_agent_param constants */
- REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_SIZE", UDM_PARAM_PAGE_SIZE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_PAGE_NUM", UDM_PARAM_PAGE_NUM,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_MODE", UDM_PARAM_SEARCH_MODE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_CACHE_MODE", UDM_PARAM_CACHE_MODE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_TRACK_MODE", UDM_PARAM_TRACK_MODE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_PHRASE_MODE", UDM_PARAM_PHRASE_MODE,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_CHARSET", UDM_PARAM_CHARSET,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_LOCAL_CHARSET",UDM_PARAM_LOCAL_CHARSET,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_BROWSER_CHARSET",UDM_PARAM_BROWSER_CHARSET,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_STOPTABLE", UDM_PARAM_STOPTABLE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_TABLE", UDM_PARAM_STOPTABLE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE", UDM_PARAM_STOPFILE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_FILE", UDM_PARAM_STOPFILE,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_WEIGHT_FACTOR",UDM_PARAM_WEIGHT_FACTOR,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_MATCH", UDM_PARAM_WORD_MATCH,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_MAX_WORD_LEN",UDM_PARAM_MAX_WORD_LEN,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_MAX_WORDLEN", UDM_PARAM_MAX_WORD_LEN,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_MIN_WORD_LEN",UDM_PARAM_MIN_WORD_LEN,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_MIN_WORDLEN", UDM_PARAM_MIN_WORD_LEN,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_ISPELL_PREFIXES",UDM_PARAM_ISPELL_PREFIXES,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_ISPELL_PREFIX",UDM_PARAM_ISPELL_PREFIXES,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_PREFIXES", UDM_PARAM_ISPELL_PREFIXES,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_PREFIX", UDM_PARAM_ISPELL_PREFIXES,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_CROSS_WORDS", UDM_PARAM_CROSS_WORDS,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_CROSSWORDS", UDM_PARAM_CROSS_WORDS,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_VARDIR", UDM_PARAM_VARDIR,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_DATADIR", UDM_PARAM_VARDIR,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_HLBEG", UDM_PARAM_HLBEG,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_HLEND", UDM_PARAM_HLEND,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_SYNONYM", UDM_PARAM_SYNONYM,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_STORED", UDM_PARAM_STORED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_GROUPBYSITE", UDM_PARAM_GROUPBYSITE,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_QSTRING", UDM_PARAM_QSTRING,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_REMOTE_ADDR", UDM_PARAM_REMOTE_ADDR,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_QUERY", UDM_PARAM_QUERY,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_SITEID", UDM_PARAM_SITEID,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_DETECT_CLONES",UDM_PARAM_DETECT_CLONES,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_SORT_ORDER",UDM_PARAM_SORT_ORDER,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_RESULTS_LIMIT",UDM_PARAM_RESULTS_LIMIT,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PARAM_EXCERPT_SIZE",UDM_PARAM_EXCERPT_SIZE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_EXCERPT_PADDING",UDM_PARAM_EXCERPT_PADDING,CONST_CS | CONST_PERSISTENT);
-
- /* udm_add_search_limit constants */
- REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT", UDM_LIMIT_CAT,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_LIMIT_URL", UDM_LIMIT_URL,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_LIMIT_TAG", UDM_LIMIT_TAG,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_LIMIT_LANG", UDM_LIMIT_LANG,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_LIMIT_DATE", UDM_LIMIT_DATE,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_LIMIT_TYPE", UDM_LIMIT_TYPE,CONST_CS | CONST_PERSISTENT);
-
- /* udm_get_res_param constants */
- REGISTER_LONG_CONSTANT("UDM_PARAM_FOUND", UDM_PARAM_FOUND,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_NUM_ROWS", UDM_PARAM_NUM_ROWS,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_WORDINFO", UDM_PARAM_WORDINFO,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_WORDINFO_ALL",UDM_PARAM_WORDINFO_ALL,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_INFO", UDM_PARAM_WORDINFO,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCHTIME", UDM_PARAM_SEARCHTIME,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCH_TIME", UDM_PARAM_SEARCHTIME,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_FIRST_DOC", UDM_PARAM_FIRST_DOC,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PARAM_LAST_DOC", UDM_PARAM_LAST_DOC,CONST_CS | CONST_PERSISTENT);
-
- /* search modes */
- REGISTER_LONG_CONSTANT("UDM_MODE_ALL", UDM_MODE_ALL,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_MODE_ANY", UDM_MODE_ANY,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_MODE_BOOL", UDM_MODE_BOOL,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_MODE_PHRASE", UDM_MODE_PHRASE,CONST_CS | CONST_PERSISTENT);
-
- /* search cache params */
- REGISTER_LONG_CONSTANT("UDM_CACHE_ENABLED", UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_CACHE_DISABLED", UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
-
- /* track mode params */
- REGISTER_LONG_CONSTANT("UDM_TRACK_ENABLED", UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_TRACK_DISABLED", UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
-
- /* phrase mode params */
- REGISTER_LONG_CONSTANT("UDM_PHRASE_ENABLED", UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PHRASE_DISABLED", UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
-
- /* general params */
- REGISTER_LONG_CONSTANT("UDM_ENABLED", UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_DISABLED", UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
-
- /* crosswords mode params */
- REGISTER_LONG_CONSTANT("UDM_CROSS_WORDS_ENABLED",UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_CROSSWORDS_ENABLED",UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_CROSS_WORDS_DISABLED",UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_CROSSWORDS_DISABLED",UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
-
- /* prefixes mode params */
- REGISTER_LONG_CONSTANT("UDM_PREFIXES_ENABLED", UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PREFIX_ENABLED", UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_ISPELL_PREFIXES_ENABLED",UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_ISPELL_PREFIX_ENABLED",UDM_ENABLED,CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("UDM_PREFIXES_DISABLED", UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_PREFIX_DISABLED", UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_ISPELL_PREFIXES_DISABLED",UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_ISPELL_PREFIX_DISABLED",UDM_DISABLED,CONST_CS | CONST_PERSISTENT);
-
- /* ispell type params */
- REGISTER_LONG_CONSTANT("UDM_ISPELL_TYPE_AFFIX", UDM_ISPELL_TYPE_AFFIX,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_ISPELL_TYPE_SPELL", UDM_ISPELL_TYPE_SPELL,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_ISPELL_TYPE_DB", UDM_ISPELL_TYPE_DB,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_ISPELL_TYPE_SERVER",UDM_ISPELL_TYPE_SERVER,CONST_CS | CONST_PERSISTENT);
-
- /* word match mode params */
- REGISTER_LONG_CONSTANT("UDM_MATCH_WORD", UDM_MATCH_WORD,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_MATCH_BEGIN", UDM_MATCH_BEGIN,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_MATCH_SUBSTR", UDM_MATCH_SUBSTR,CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("UDM_MATCH_END", UDM_MATCH_END,CONST_CS | CONST_PERSISTENT);
-
- return SUCCESS;
-}
-/* }}} */
-
-DLEXPORT PHP_MSHUTDOWN_FUNCTION(mnogosearch)
-{
- return SUCCESS;
-}
-
-
-DLEXPORT PHP_RINIT_FUNCTION(mnogosearch)
-{
- return SUCCESS;
-}
-
-
-DLEXPORT PHP_MINFO_FUNCTION(mnogosearch)
-{
- char buf[32];
-
- php_info_print_table_start();
- php_info_print_table_row(2, "mnoGoSearch Support", "enabled" );
-
- sprintf(buf,"%d", UDM_VERSION_ID);
- php_info_print_table_row(2, "mnoGoSearch library version", buf );
- php_info_print_table_end();
-}
-
-static char* MyRemoveHiLightDup(const char *s){
- size_t len=strlen(s)+1;
- char *d, *res = (char*)emalloc(len);
-
- for(d=res; s[0]; s++)
- {
- switch(s[0])
- {
- case '\2':
- case '\3':
- break;
- case '&':
- if (s[1] == '#')
- {
- char *e;
- int code= 0;
-
- for (e= (char *)s+2; (*e >= '0') && (*e <= '9'); code= code*10 + e[0]-'0', e++);
- if (*e == ';')
- {
- *d++= (code < 128) ? code : '?';
- s= e;
- break;
- }
- }
- /* pass through */
-
- default:
- *d++=*s;
- }
- }
- *d='\0';
- return res;
-}
-
-/* {{{ proto int udm_alloc_agent(string dbaddr [, string dbmode])
- Allocate mnoGoSearch session */
-DLEXPORT PHP_FUNCTION(udm_alloc_agent)
-{
- switch(ZEND_NUM_ARGS()){
-
- case 1: {
- pval **yydbaddr;
- char *dbaddr;
- UDM_ENV * Env;
- UDM_AGENT * Agent;
-
- if(zend_get_parameters_ex(1,&yydbaddr)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_string_ex(yydbaddr);
- dbaddr = Z_STRVAL_PP(yydbaddr);
-
-#if UDM_VERSION_ID >= 30204
- Env=UdmEnvInit(NULL);
- UdmVarListReplaceStr(&Env->Vars,"SyslogFacility","local7");
-#if UDM_VERSION_ID >= 30215
- UdmSetLogLevel(NULL,0);
-#else
- UdmSetLogLevel(Env,0);
-#endif
- UdmOpenLog("mnoGoSearch-php",Env,0);
-#if UDM_VERSION_ID <= 30210
- if(!memcmp(dbaddr,"searchd:",8)){
- UDM_URL Url;
- UdmURLParse(&Url,dbaddr);
- UdmDBListAdd(&Env->sdcl,Url.hostinfo);
- }
-
- UdmVarListReplaceStr(&Env->Vars,"DBAddr",dbaddr);
-
- if(UDM_OK!=UdmDBSetAddr(Env->db,dbaddr,UDM_OPEN_MODE_READ)){
- sprintf(Env->errstr,"Invalid DBAddr: '%s'",dbaddr);
-#if UDM_VERSION_ID <= 30207
- Env->errcode=1;
-#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Invalid DBAddr");
- RETURN_FALSE;
- }
-#else
- UdmDBListAdd(&Env->dbl,dbaddr, UDM_OPEN_MODE_WRITE);
-#endif
- Agent=UdmAgentInit(NULL,Env,0);
-#elif UDM_VERSION_ID >= 30200
- Env=UdmAllocEnv();
- Env->vars=UdmAllocVarList();
- Env->DBAddr=strdup(dbaddr);
- UdmEnvSetDBMode(Env,"single");
- Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ);
-#else
- Env=UdmAllocEnv();
- UdmEnvSetDBAddr(Env,dbaddr);
- Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ);
-#endif
- ZEND_REGISTER_RESOURCE(return_value,Agent,le_link);
- }
- break;
-
- case 2: {
- pval **yydbaddr;
- pval **yydbmode;
- char *dbaddr;
- char *dbmode;
- UDM_ENV * Env;
- UDM_AGENT * Agent;
-
- if(zend_get_parameters_ex(2,&yydbaddr,&yydbmode)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_string_ex(yydbaddr);
- convert_to_string_ex(yydbmode);
- dbaddr = Z_STRVAL_PP(yydbaddr);
- dbmode = Z_STRVAL_PP(yydbmode);
-
-#if UDM_VERSION_ID >= 30204
- Env=UdmEnvInit(NULL);
- UdmVarListReplaceStr(&Env->Vars,"SyslogFacility","local7");
-#if UDM_VERSION_ID >= 30215
- UdmSetLogLevel(NULL,0);
-#else
- UdmSetLogLevel(Env,0);
-#endif
- UdmOpenLog("mnoGoSearch-php",Env,0);
-#if UDM_VERSION_ID <= 30210
- if(!memcmp(dbaddr,"searchd:",8)){
- UDM_URL Url;
- UdmURLParse(&Url,dbaddr);
- UdmDBListAdd(&Env->sdcl,Url.hostinfo);
- }
- UdmVarListReplaceStr(&Env->Vars,"DBAddr",dbaddr);
- if(UDM_OK!=UdmDBSetAddr(Env->db,dbaddr,UDM_OPEN_MODE_READ)){
- sprintf(Env->errstr,"Invalid DBAddr: '%s'",dbaddr);
-#if UDM_VERSION_ID <= 30207
- Env->errcode=1;
-#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Invalid DBAddr");
- RETURN_FALSE;
- }
-#else
- UdmDBListAdd(&Env->dbl,dbaddr, UDM_OPEN_MODE_WRITE);
-#endif
- Agent=UdmAgentInit(NULL,Env,0);
-#elif UDM_VERSION_ID >= 30200
- Env=UdmAllocEnv();
- Env->vars=UdmAllocVarList();
- Env->DBAddr=strdup(dbaddr);
- UdmEnvSetDBMode(Env,dbmode);
- Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ);
-#else
- Env=UdmAllocEnv();
- UdmEnvSetDBAddr(Env,dbaddr);
- UdmEnvSetDBMode(Env,dbmode);
- Agent=UdmAllocAgent(Env,0,UDM_OPEN_MODE_READ);
-#endif
- ZEND_REGISTER_RESOURCE(return_value,Agent,le_link);
- }
- break;
-
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-}
-/* }}} */
-
-/* {{{ proto int udm_set_agent_param(int agent, int var, string val)
- Set mnoGoSearch agent session parameters */
-DLEXPORT PHP_FUNCTION(udm_set_agent_param)
-{
- pval **yyagent, **yyvar, **yyval;
- char *val;
- int var;
- UDM_AGENT * Agent;
-
- switch(ZEND_NUM_ARGS()){
-
- case 3:
- if(zend_get_parameters_ex(3,&yyagent,&yyvar,&yyval)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_long_ex(yyvar);
- convert_to_string_ex(yyval);
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-agent", le_link);
- var = Z_LVAL_PP(yyvar);
- val = Z_STRVAL_PP(yyval);
-
- break;
-
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-
- switch(var){
- case UDM_PARAM_PAGE_SIZE:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"ps",val);
-#else
- Agent->page_size=atoi(val);
- if(Agent->page_size<1)Agent->page_size=20;
-#endif
- break;
-
- case UDM_PARAM_PAGE_NUM:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"np",val);
-#else
- Agent->page_number=atoi(val);
- if(Agent->page_number<0)Agent->page_number=0;
-#endif
- break;
-
- case UDM_PARAM_SEARCH_MODE:
- switch (atoi(val)){
- case UDM_MODE_ALL:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"m","all");
-#else
- Agent->search_mode=UDM_MODE_ALL;
-#endif
- break;
-
- case UDM_MODE_ANY:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"m","any");
-#else
- Agent->search_mode=UDM_MODE_ANY;
-#endif
- break;
-
- case UDM_MODE_BOOL:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"m","bool");
-#else
- Agent->search_mode=UDM_MODE_BOOL;
-#endif
- break;
-
- case UDM_MODE_PHRASE:
-#if UDM_VERSION_ID >= 30200
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown search mode");
- RETURN_FALSE;
-#else
- Agent->search_mode=UDM_MODE_PHRASE;
-#endif
- break;
-
- default:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"m","all");
-#else
- Agent->search_mode=UDM_MODE_ALL;
-#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown search mode");
- RETURN_FALSE;
- break;
- }
- break;
-
- case UDM_PARAM_WORD_MATCH:
- switch (atoi(val)){
- case UDM_MATCH_WORD:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","wrd");
-#else
- Agent->word_match=UDM_MATCH_WORD;
-#endif
- break;
-
- case UDM_MATCH_BEGIN:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","beg");
-#else
- Agent->word_match=UDM_MATCH_BEGIN;
-#endif
- break;
-
- case UDM_MATCH_END:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","end");
-#else
- Agent->word_match=UDM_MATCH_END;
-#endif
- break;
-
- case UDM_MATCH_SUBSTR:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","sub");
-#else
- Agent->word_match=UDM_MATCH_SUBSTR;
-#endif
- break;
-
- default:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"wm","wrd");
-#else
- Agent->word_match=UDM_MATCH_WORD;
-#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown word match mode");
- RETURN_FALSE;
- break;
- }
- break;
- case UDM_PARAM_CACHE_MODE:
- switch (atoi(val)){
- case UDM_ENABLED:
-#if UDM_VERSION_ID < 30200
- Agent->cache_mode=UDM_ENABLED;
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"Cache","yes");
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"Cache","yes",UDM_VARSRC_GLOBAL);
-#endif
- break;
-
- case UDM_DISABLED:
-#if UDM_VERSION_ID < 30200
- Agent->cache_mode=UDM_DISABLED;
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"Cache","no");
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"Cache","no",UDM_VARSRC_GLOBAL);
-#endif
- break;
-
- default:
-#if UDM_VERSION_ID < 30200
- Agent->cache_mode=UDM_DISABLED;
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"Cache","no");
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"Cache","no",UDM_VARSRC_GLOBAL);
-#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown cache mode");
- RETURN_FALSE;
- break;
- }
-
- break;
-
- case UDM_PARAM_TRACK_MODE:
- switch (atoi(val)){
- case UDM_ENABLED:
-#if UDM_VERSION_ID < 30200
- Agent->track_mode|=UDM_TRACK_QUERIES;
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"TrackQuery","yes");
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"TrackQuery","yes",UDM_VARSRC_GLOBAL);
-#endif
- break;
-
- case UDM_DISABLED:
-#if UDM_VERSION_ID < 30200
- Agent->track_mode &= ~(UDM_TRACK_QUERIES);
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"TrackQuery","no");
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"TrackQuery","no",UDM_VARSRC_GLOBAL);
-#endif
-
- break;
-
- default:
-#if UDM_VERSION_ID < 30200
- Agent->track_mode &= ~(UDM_TRACK_QUERIES);
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"TrackQuery","no");
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"TrackQuery","no",UDM_VARSRC_GLOBAL);
-#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown track mode");
- RETURN_FALSE;
- break;
- }
-
- break;
-
- case UDM_PARAM_PHRASE_MODE:
-#if UDM_VERSION_ID < 30200
- switch (atoi(val)){
- case UDM_ENABLED:
- Agent->Conf->use_phrases=UDM_ENABLED;
- break;
-
- case UDM_DISABLED:
- Agent->Conf->use_phrases=UDM_DISABLED;
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown phrase mode");
- RETURN_FALSE;
- break;
- }
-#endif
- break;
-
- case UDM_PARAM_ISPELL_PREFIXES:
- switch (atoi(val)){
- case UDM_ENABLED:
-#if UDM_VERSION_ID < 30200
- Agent->Conf->ispell_mode |= UDM_ISPELL_USE_PREFIXES;
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"IspellUsePrefixes","1");
-#else
- UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 1, UDM_VARSRC_GLOBAL);
-#endif
- break;
-
- case UDM_DISABLED:
-#if UDM_VERSION_ID < 30200
- Agent->Conf->ispell_mode &= ~UDM_ISPELL_USE_PREFIXES;
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"IspellUsePrefixes","0");
-#else
- UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 0, UDM_VARSRC_GLOBAL);
-#endif
- break;
-
-
- default:
-#if UDM_VERSION_ID < 30200
- Agent->Conf->ispell_mode |= UDM_ISPELL_USE_PREFIXES;
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"IspellUsePrefixes","0");
-#else
- UdmAddIntVar(Agent->Conf->vars, "IspellUsePrefixes", 1, UDM_VARSRC_GLOBAL);
-#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown ispell prefixes mode");
- RETURN_FALSE;
- break;
- }
-
- break;
-
- case UDM_PARAM_CHARSET:
- case UDM_PARAM_LOCAL_CHARSET:
-#if UDM_VERSION_ID < 30200
- Agent->Conf->local_charset=UdmGetCharset(val);
- Agent->charset=Agent->Conf->local_charset;
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"LocalCharset",val);
- {
- const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"LocalCharset","iso-8859-1");
- Agent->Conf->lcs=UdmGetCharSet(charset);
- }
-#else
- Agent->Conf->local_charset=strdup(val);
- UdmReplaceStrVar(Agent->Conf->vars,"LocalCharset",val,UDM_VARSRC_GLOBAL);
-#endif
-
- break;
-
-#if UDM_VERSION_ID >= 30200
- case UDM_PARAM_BROWSER_CHARSET:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"BrowserCharset",val);
- {
- const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"BrowserCharset","iso-8859-1");
- Agent->Conf->bcs=UdmGetCharSet(charset);
- }
-#else
- Agent->Conf->browser_charset=strdup(val);
- UdmReplaceStrVar(Agent->Conf->vars,"BrowserCharset",val,UDM_VARSRC_GLOBAL);
-#endif
- break;
-
- case UDM_PARAM_HLBEG:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"HlBeg",val);
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"HlBeg",val,UDM_VARSRC_GLOBAL);
-#endif
- break;
-
- case UDM_PARAM_HLEND:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"HlEnd",val);
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"HlEnd",val,UDM_VARSRC_GLOBAL);
-#endif
- break;
-
- case UDM_PARAM_SYNONYM:
- if (UdmSynonymListLoad(Agent->Conf,val)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s",Agent->Conf->errstr);
- RETURN_FALSE;
-#if UDM_VERSION_ID >= 30204
- } else UdmSynonymListSort(&(Agent->Conf->Synonyms));
-#else
- } else UdmSynonymListSort(&(Agent->Conf->SynList));
-#endif
- break;
-
- case UDM_PARAM_QSTRING:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"QUERY_STRING",val);
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"QUERY_STRING",val,UDM_VARSRC_GLOBAL);
-#endif
- break;
-
-
- case UDM_PARAM_REMOTE_ADDR:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"IP",val);
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"IP",val,UDM_VARSRC_GLOBAL);
-#endif
- break;
-#endif
-
- case UDM_PARAM_STOPTABLE:
-#if UDM_VERSION_ID < 30200
- strcat(Agent->Conf->stop_tables," ");
- strcat(Agent->Conf->stop_tables,val);
-#endif
- break;
-
- case UDM_PARAM_STOPFILE:
-#if UDM_VERSION_ID >= 30204
- if (UdmStopListLoad(Agent->Conf,val)) {
-#else
- if (UdmFileLoadStopList(Agent->Conf,val)) {
-#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", Agent->Conf->errstr);
- RETURN_FALSE;
- }
- break;
-
- case UDM_PARAM_WEIGHT_FACTOR:
-#if UDM_VERSION_ID < 30200
- Agent->weight_factor=strdup(val);
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"wf",val);
-#else
- UdmReplaceStrVar(Agent->Conf->vars,"wf",val,UDM_VARSRC_GLOBAL);
- {
- size_t len;
-
- len=strlen(val);
- if((len>0)&&(len<256)){
- const char *sec;
- int sn;
-
- for(sn=0;sn<256;sn++){
- Agent->wf[sn]=0;
- }
-
- for(sec=val+len-1;sec>=val;sec--){
- Agent->wf[len-(sec-val)]=UdmHex2Int(*sec);
- }
- }
- }
-#endif
- break;
-
- case UDM_PARAM_MIN_WORD_LEN:
-#if UDM_VERSION_ID >= 30204
- Agent->Conf->WordParam.min_word_len=atoi(val);
-#else
- Agent->Conf->min_word_len=atoi(val);
-#endif
- break;
-
- case UDM_PARAM_MAX_WORD_LEN:
-#if UDM_VERSION_ID >= 30204
- Agent->Conf->WordParam.max_word_len=atoi(val);
-#else
- Agent->Conf->max_word_len=atoi(val);
-#endif
- break;
-
- case UDM_PARAM_CROSS_WORDS:
- switch (atoi(val)){
- case UDM_ENABLED:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"CrossWords","yes");
-#else
- Agent->Conf->use_crossword=UDM_ENABLED;
-#endif
- break;
-
- case UDM_DISABLED:
-#if UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"CrossWords","no");
-#else
- Agent->Conf->use_crossword=UDM_DISABLED;
-#endif
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown crosswords mode");
- RETURN_FALSE;
- break;
- }
-
- break;
-
-#if UDM_VERSION_ID > 30112
-
- case UDM_PARAM_VARDIR:
-#if UDM_VERSION_ID < 30200
- udm_snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
-#elif UDM_VERSION_ID >= 30208
- UdmVarListReplaceStr(&Agent->Conf->Vars,"Vardir",val);
-#elif UDM_VERSION_ID >= 30204
- UdmVarListReplaceStr(&Agent->Conf->Vars,"Vardir",val);
- snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
-#else
- snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
-#endif
- break;
-#endif
-
-#if UDM_VERSION_ID >= 30204
- case UDM_PARAM_QUERY:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"q",val);
-
- break;
-
- case UDM_PARAM_STORED:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"StoredAddr",val);
-
- break;
-#endif
-
-#if UDM_VERSION_ID >= 30207
- case UDM_PARAM_GROUPBYSITE:
- switch (atoi(val)){
- case UDM_ENABLED:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"GroupBySite","yes");
-
- break;
-
- case UDM_DISABLED:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"GroupBySite","no");
-
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown groupbysite mode");
- RETURN_FALSE;
- break;
- }
-
- break;
-
- case UDM_PARAM_SITEID:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"site",val);
-
- break;
-
- case UDM_PARAM_DETECT_CLONES:
- switch (atoi(val)){
- case UDM_ENABLED:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"DetectClones","yes");
-
- break;
-
- case UDM_DISABLED:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"DetectClones","no");
-
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown clones mode");
- RETURN_FALSE;
- break;
- }
-
- break;
-#endif
-
-#if UDM_VERSION_ID >= 30214
- case UDM_PARAM_SORT_ORDER:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"s",val);
-
- break;
-#endif
-
-#if UDM_VERSION_ID >= 30215
- case UDM_PARAM_RESULTS_LIMIT:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"ResultsLimit",val);
-
- break;
-#endif
-
-#if UDM_VERSION_ID >= 30216
- case UDM_PARAM_EXCERPT_SIZE:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"ExcerptSize",val);
-
- break;
- case UDM_PARAM_EXCERPT_PADDING:
- UdmVarListReplaceStr(&Agent->Conf->Vars,"ExcerptPadding",val);
-
- break;
-#endif
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown agent session parameter");
- RETURN_FALSE;
- break;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int udm_load_ispell_data(int agent, int var, string val1, [string charset], string val2, int flag)
- Load ispell data */
-DLEXPORT PHP_FUNCTION(udm_load_ispell_data)
-{
- pval **yyagent, **yyvar, **yyval1, **yyval2, **yyflag, **yycharset ;
- char *val1, *val2, *charset;
- int var, flag;
- UDM_AGENT * Agent;
-
- switch(ZEND_NUM_ARGS()){
-
- case 5:
- if(zend_get_parameters_ex(5,&yyagent,&yyvar,&yyval1,&yyval2,&yyflag)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_long_ex(yyvar);
- convert_to_long_ex(yyflag);
- convert_to_string_ex(yyval1);
- convert_to_string_ex(yyval2);
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-agent", le_link);
- var = Z_LVAL_PP(yyvar);
- flag = Z_LVAL_PP(yyflag);
- val1 = Z_STRVAL_PP(yyval1);
- val2 = Z_STRVAL_PP(yyval2);
- charset = "us-ascii";
-
- break;
-
- case 6:
- if(zend_get_parameters_ex(6,&yyagent,&yyvar,&yyval1,&yycharset,&yyval2,&yyflag)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_long_ex(yyvar);
- convert_to_long_ex(yyflag);
- convert_to_string_ex(yyval1);
- convert_to_string_ex(yyval2);
- convert_to_string_ex(yycharset);
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-agent", le_link);
- var = Z_LVAL_PP(yyvar);
- flag = Z_LVAL_PP(yyflag);
- val1 = Z_STRVAL_PP(yyval1);
- val2 = Z_STRVAL_PP(yyval2);
- charset = Z_STRVAL_PP(yycharset);
-
- break;
-
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-
-
- switch(var){
-#if UDM_VERSION_ID < 30200
- case UDM_ISPELL_TYPE_DB:
- Agent->Conf->ispell_mode |= UDM_ISPELL_MODE_DB;
-
- if (UdmDBImportAffixes(Agent,Agent->charset) ||
- UdmImportDictionaryFromDB(Agent)) {
- RETURN_FALSE;
- }
-
- break;
-
-#if UDM_VERSION_ID > 30111
-
- case UDM_ISPELL_TYPE_SERVER:
- Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_DB;
- Agent->Conf->ispell_mode |= UDM_ISPELL_MODE_SERVER;
-
- Agent->Conf->spellhost = strdup(val1);
-
- break;
-
-#endif
-#endif
-
- case UDM_ISPELL_TYPE_AFFIX:
-#if UDM_VERSION_ID < 30200
- Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_DB;
-#if UDM_VERSION_ID > 30111
- Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_SERVER;
-#endif
- if (UdmImportAffixes(Agent->Conf,val1,val2,NULL,0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
- RETURN_FALSE;
- }
-#elif UDM_VERSION_ID < 30225
- if (UdmImportAffixes(Agent->Conf,val1,charset,val2)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
- RETURN_FALSE;
- }
-#else
- if(UdmAffixListListAdd(&Agent->Conf->Affixes,val1,charset,val2)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load affix file %s",val2);
- RETURN_FALSE;
- }
-#endif
- break;
-
- case UDM_ISPELL_TYPE_SPELL:
-#if UDM_VERSION_ID < 30200
- Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_DB;
-#if UDM_VERSION_ID > 30111
- Agent->Conf->ispell_mode &= ~UDM_ISPELL_MODE_SERVER;
-#endif
- if (UdmImportDictionary(Agent->Conf,val1,val2,1,"")) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
- RETURN_FALSE;
- }
-#elif UDM_VERSION_ID < 30225
- if (UdmImportDictionary(Agent->Conf,val1,charset,val2,0,"")) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
- RETURN_FALSE;
- }
-#else
- if(UdmSpellListListAdd(&Agent->Conf->Spells,val1,charset,val2)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot load spell file %s",val2);
- RETURN_FALSE;
- }
-#endif
- break;
-
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown ispell type parameter");
- RETURN_FALSE;
- break;
- }
-
- if (flag) {
-#if UDM_VERSION_ID < 30225
-#if UDM_VERSION_ID >= 30204
- if(Agent->Conf->Spells.nspell) {
- UdmSortDictionary(&Agent->Conf->Spells);
- UdmSortAffixes(&Agent->Conf->Affixes,&Agent->Conf->Spells);
- }
-#else
- if(Agent->Conf->nspell) {
- UdmSortDictionary(Agent->Conf);
- UdmSortAffixes(Agent->Conf);
- }
-#endif
-#else
- if(Agent->Conf->Spells.nitems && Agent->Conf->Affixes.nitems) {
- char *err= Agent->Conf->errstr;
- int flags= strcasecmp(UdmVarListFindStr(&Agent->Conf->Vars,
- "IspellUsePrefixes","no"),"no");
- flags= flags ? 0 : UDM_SPELL_NOPREFIX;
- if (UdmSpellListListLoad(&Agent->Conf->Spells, err, 128) ||
- UdmAffixListListLoad(&Agent->Conf->Affixes, flags, err, 128)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error loading ispell data");
- RETURN_FALSE;
- }
- }
-#endif
- }
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int udm_free_ispell_data(int agent)
- Free memory allocated for ispell data */
-DLEXPORT PHP_FUNCTION(udm_free_ispell_data)
-{
- pval ** yyagent;
- UDM_AGENT * Agent;
- switch(ZEND_NUM_ARGS()){
- case 1: {
- if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
-
-#if UDM_VERSION_ID >= 30225
- UdmSpellListListFree(&Agent->Conf->Spells);
- UdmAffixListListFree(&Agent->Conf->Affixes);
-#elif UDM_VERSION_ID >= 30204
- UdmSpellListFree(&Agent->Conf->Spells);
- UdmAffixListFree(&Agent->Conf->Affixes);
-#elif UDM_VERSION_ID > 30111
- UdmFreeIspell(Agent->Conf);
-#endif
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int udm_add_search_limit(int agent, int var, string val)
- Add mnoGoSearch search restrictions */
-DLEXPORT PHP_FUNCTION(udm_add_search_limit)
-{
- pval **yyagent, **yyvar, **yyval;
- char *val;
- int var;
- UDM_AGENT * Agent;
-
- switch(ZEND_NUM_ARGS()){
-
- case 3:
- if(zend_get_parameters_ex(3,&yyagent,&yyvar,&yyval)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_long_ex(yyvar);
- convert_to_string_ex(yyval);
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-agent", le_link);
- var = Z_LVAL_PP(yyvar);
- val = Z_STRVAL_PP(yyval);
-
- break;
-
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-
- switch(var){
- case UDM_LIMIT_URL:
-#if UDM_VERSION_ID >= 30204
- UdmVarListAddStr(&Agent->Conf->Vars,"ul",val);
-#else
- UdmAddURLLimit(Agent->Conf,val);
-#endif
- break;
-
- case UDM_LIMIT_TAG:
-#if UDM_VERSION_ID >= 30204
- UdmVarListAddStr(&Agent->Conf->Vars,"t",val);
-#else
- UdmAddTagLimit(Agent->Conf,val);
-#endif
- break;
-
- case UDM_LIMIT_LANG:
-#if UDM_VERSION_ID >= 30204
- UdmVarListAddStr(&Agent->Conf->Vars,"lang",val);
-#else
- UdmAddLangLimit(Agent->Conf,val);
-#endif
- break;
-
- case UDM_LIMIT_CAT:
-#if UDM_VERSION_ID >= 30204
- UdmVarListAddStr(&Agent->Conf->Vars,"cat",val);
-#else
- UdmAddCatLimit(Agent->Conf,val);
-#endif
- break;
-
- case UDM_LIMIT_TYPE:
-#if UDM_VERSION_ID >= 30207
- UdmVarListAddStr(&Agent->Conf->Vars,"type",val);
-#endif
- break;
-
- case UDM_LIMIT_DATE:
-#if UDM_VERSION_ID < 30200
- {
- struct udm_stl_info_t stl_info = { 0, 0, 0 };
- char *edate;
-
- if (val[0] == '>') {
- Z_TYPE(stl_info)=1;
- } else if (val[0] == '<') {
- Z_TYPE(stl_info)=-1;
- } else if((val[0]=='#')&&(edate=strchr(val,','))){
- Z_TYPE(stl_info)=2;
- stl_info.t2=(time_t)(atol(edate+1));
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Incorrect date limit format");
- RETURN_FALSE;
- }
-
- stl_info.t1=(time_t)(atol(val+1));
- UdmAddTimeLimit(Agent->Conf,&stl_info);
- }
-#elif UDM_VERSION_ID >= 30210
- {
- struct tm *d_tm;
- time_t d_t;
- char *d_val2;
- char d_db[20], d_de[20];
- d_t = atol (val+1);
- d_tm = localtime (&d_t);
- if (val[0] == '>') {
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dt","er");
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dx","1");
- sprintf (d_db, "%d", d_tm->tm_mday);
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dd",d_db);
- sprintf (d_db, "%d", d_tm->tm_mon);
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dm",d_db);
- sprintf (d_db, "%d", d_tm->tm_year+1900);
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dy",d_db);
- RETURN_TRUE;
- } else if (val[0] == '<') {
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dt","er");
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dx","-1");
- sprintf (d_db, "%d", d_tm->tm_mday);
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dd",d_db);
- sprintf (d_db, "%d", d_tm->tm_mon);
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dm",d_db);
- sprintf (d_db, "%d", d_tm->tm_year+1900);
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dy",d_db);
- RETURN_TRUE;
- } else if ( (val[0]=='#') && (d_val2 = strchr(val,',')) ){
- UdmVarListReplaceStr(&Agent->Conf->Vars,"dt","range");
- sprintf (d_db, "%d/%d/%d", d_tm->tm_mday, d_tm->tm_mon+1, d_tm->tm_year+1900);
- d_t = atol (d_val2+1);
- d_tm = localtime (&d_t);
- sprintf (d_de, "%d/%d/%d", d_tm->tm_mday, d_tm->tm_mon+1, d_tm->tm_year+1900);
- UdmVarListReplaceStr(&Agent->Conf->Vars,"db",d_db);
- UdmVarListReplaceStr(&Agent->Conf->Vars,"de",d_de);
- RETURN_TRUE;
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Incorrect date limit format");
- RETURN_FALSE;
- }
- }
-#endif
- break;
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown search limit parameter");
- RETURN_FALSE;
- break;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int udm_clear_search_limits(int agent)
- Clear all mnoGoSearch search restrictions */
-DLEXPORT PHP_FUNCTION(udm_clear_search_limits)
-{
- pval ** yyagent;
- UDM_AGENT * Agent;
- int i;
-
- switch(ZEND_NUM_ARGS()){
- case 1: {
- if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
-#if UDM_VERSION_ID >= 30204
- for(i=0;i<Agent->Conf->Vars.nvars;i++){
- if ((!strcasecmp("ul",Agent->Conf->Vars.Var[i].name))||
- (!strcasecmp("cat",Agent->Conf->Vars.Var[i].name))||
- (!strcasecmp("t",Agent->Conf->Vars.Var[i].name))||
- (!strcasecmp("type",Agent->Conf->Vars.Var[i].name))||
- (!strcasecmp("lang",Agent->Conf->Vars.Var[i].name))) {
- UDM_FREE(Agent->Conf->Vars.Var[i].name);
- UDM_FREE(Agent->Conf->Vars.Var[i].val);
- Agent->Conf->Vars.nvars--;
- }
- }
-#else
- UdmClearLimits(Agent->Conf);
-#endif
- RETURN_TRUE;
-}
-/* }}} */
-
-#if UDM_VERSION_ID >= 30200
-/* {{{ proto int udm_check_charset(int agent, string charset)
- Check if the given charset is known to mnogosearch */
-DLEXPORT PHP_FUNCTION(udm_check_charset)
-{
- pval ** yycharset, ** yyagent;
- UDM_AGENT * Agent;
- int id=-1;
-
- switch(ZEND_NUM_ARGS()){
- case 2: {
- if (zend_get_parameters_ex(2, &yyagent,&yycharset)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
- convert_to_string_ex(yycharset);
-
-
- if (UdmGetCharSet(Z_STRVAL_PP(yycharset))) {
- RETURN_TRUE;
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} */
-#endif
-
-#if UDM_VERSION_ID >= 30203
-/* {{{ proto int udm_crc32(int agent, string str)
- Return CRC32 checksum of gived string */
-DLEXPORT PHP_FUNCTION(udm_crc32)
-{
- pval ** yystr, ** yyagent;
- char *str;
- int crc32;
- char buf[32];
- UDM_AGENT * Agent;
- int id=-1;
-
- switch(ZEND_NUM_ARGS()){
- case 2: {
- if (zend_get_parameters_ex(2, &yyagent,&yystr)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
- convert_to_string_ex(yystr);
- str = Z_STRVAL_PP(yystr);
-
- crc32=UdmCRC32((str),strlen(str));
- snprintf(buf,sizeof(buf)-1,"%u",crc32);
-
- RETURN_STRING(buf,1);
-}
-/* }}} */
-#endif
-
-#if UDM_VERSION_ID >= 30204
-/* {{{ proto int udm_parse_query_string(int agent, string str)
- Parses query string, initialises variables and search limits taken from it */
-DLEXPORT PHP_FUNCTION(udm_parse_query_string)
-{
- pval ** yystr, ** yyagent;
- char *str;
- UDM_AGENT * Agent;
- int id=-1;
-
- switch(ZEND_NUM_ARGS()){
- case 2: {
- if (zend_get_parameters_ex(2, &yyagent,&yystr)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
- convert_to_string_ex(yystr);
- str = Z_STRVAL_PP(yystr);
-
- UdmParseQueryString(Agent,&Agent->Conf->Vars,str);
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int udm_make_excerpt(int agent, int res, int row)
- Perform search */
-DLEXPORT PHP_FUNCTION(udm_make_excerpt)
-{
- pval ** yyagent, **yyres, **yyrow_num;
- UDM_RESULT * Res;
- UDM_AGENT * Agent;
- int id=-1, row;
-
- switch(ZEND_NUM_ARGS()){
- case 3: {
- if (zend_get_parameters_ex(3, &yyagent, &yyres, &yyrow_num)==FAILURE) {
- RETURN_FALSE;
- }
- convert_to_string_ex(yyrow_num);
- row=atoi(Z_STRVAL_PP(yyrow_num));
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
- ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, "mnoGoSearch-Result", le_res);
-
- if(row<Res->num_rows){
- char *al;
- char *Excerpt;
-
-#if UDM_VERSION_ID >= 30216
- size_t ExcerptSize, ExcerptPadding;
-
- ExcerptSize = (size_t)UdmVarListFindInt(&Agent->Conf->Vars, "ExcerptSize", 256);
- ExcerptPadding = (size_t)UdmVarListFindInt(&Agent->Conf->Vars, "ExcerptPadding", 40);
-#endif
-
- al = (char *)MyRemoveHiLightDup((const char *)(UdmVarListFindStr(&(Res->Doc[row].Sections), "URL", "")));
- UdmVarListReplaceInt(&(Res->Doc[row].Sections), "STORED_ID", UdmCRC32(al, strlen(al)));
- efree(al);
-
-#if UDM_VERSION_ID >= 30216
- Excerpt = UdmExcerptDoc(Agent, Res, &(Res->Doc[row]), ExcerptSize, ExcerptPadding);
- if (Excerpt) {
- UdmVarListReplaceStr(&(Res->Doc[row].Sections),"Body",Excerpt);
- UDM_FREE(Excerpt);
- }
-#else
- Excerpt = UdmExcerptDoc(Agent, Res, &(Res->Doc[row]), 256);
- if ((Excerpt != NULL) && (strlen(Excerpt) > 6)) {
- char *HlExcerpt = UdmHlConvert(&Res->WWList, Excerpt, Agent->Conf->lcs, Agent->Conf->bcs);
- UdmVarListReplaceStr(&(Res->Doc[row].Sections),"Body",HlExcerpt);
- UDM_FREE(HlExcerpt);
- }
-#endif
- if (Excerpt != NULL && (UdmVarListFindStr(&(Res->Doc[row].Sections), "Z", NULL) == NULL)) {
- UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",1);
- UDM_FREE(Excerpt);
- } else {
- UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",0);
- RETURN_FALSE;
- }
- }else{
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"row number too large");
- RETURN_FALSE;
- }
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int udm_set_agent_param_ex(int agent, string var, string val)
- Set mnoGoSearch agent session parameters extended */
-DLEXPORT PHP_FUNCTION(udm_set_agent_param_ex)
-{
- pval **yyagent, **yyvar, **yyval;
- char *val, *var;
- UDM_AGENT * Agent;
-
- switch(ZEND_NUM_ARGS()){
-
- case 3:
- if(zend_get_parameters_ex(3,&yyagent,&yyvar,&yyval)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_string_ex(yyvar);
- convert_to_string_ex(yyval);
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-agent", le_link);
- var = Z_STRVAL_PP(yyvar);
- val = Z_STRVAL_PP(yyval);
-
- break;
-
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-
- UdmVarListReplaceStr(&Agent->Conf->Vars,var,val);
-
- if (!strcasecmp(var,"LocalCharset")) {
- const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"LocalCharset","iso-8859-1");
- Agent->Conf->lcs=UdmGetCharSet(charset);
- } else if (!strcasecmp(var,"BrowserCharset")) {
- const char * charset=UdmVarListFindStr(&Agent->Conf->Vars,"BrowserCharset","iso-8859-1");
- Agent->Conf->bcs=UdmGetCharSet(charset);
- } else if (!strcasecmp(var,"Synonym")) {
- if (UdmSynonymListLoad(Agent->Conf,val)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s",Agent->Conf->errstr);
- RETURN_FALSE;
- } else UdmSynonymListSort(&(Agent->Conf->Synonyms));
- } else if (!strcasecmp(var,"Stopwordfile")) {
- if (UdmStopListLoad(Agent->Conf,val)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", Agent->Conf->errstr);
- RETURN_FALSE;
- }
- } else if (!strcasecmp(var,"MinWordLen")) {
- Agent->Conf->WordParam.min_word_len=atoi(val);
- } else if (!strcasecmp(var,"MaxWordLen")) {
- Agent->Conf->WordParam.max_word_len=atoi(val);
-#if UDM_VERSION_ID <= 30207
- } else if (!strcasecmp(var,"VarDir")) {
- snprintf(Agent->Conf->vardir,sizeof(Agent->Conf->vardir)-1,"%s%s",val,UDMSLASHSTR);
-#endif
- }
-
- RETURN_TRUE;
-}
-
-/* {{{ proto string udm_get_agent_param_ex(int agent, string field)
- Fetch mnoGoSearch environment parameters */
-DLEXPORT PHP_FUNCTION(udm_get_agent_param_ex)
-{
- pval **yyagent, **yyfield_name;
-
- UDM_AGENT * Agent;
- int row;
- char *field;
-
- switch(ZEND_NUM_ARGS()){
- case 2: {
- if (zend_get_parameters_ex(2, &yyagent,&yyfield_name)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_string_ex(yyfield_name);
- field = Z_STRVAL_PP(yyfield_name);
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-agent", le_link);
-
- RETURN_STRING((char *)UdmVarListFindStr(&Agent->Conf->Vars,field,""),1);
-}
-/* }}} */
-
-/* {{{ proto string udm_get_res_field_ex(int res, int row, string field)
- Fetch mnoGoSearch result field */
-DLEXPORT PHP_FUNCTION(udm_get_res_field_ex)
-{
- pval **yyres, **yyrow_num, **yyfield_name;
-
- UDM_RESULT * Res;
- int row;
- char *field;
-
- switch(ZEND_NUM_ARGS()){
- case 3: {
- if (zend_get_parameters_ex(3, &yyres,&yyrow_num,&yyfield_name)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_string_ex(yyrow_num);
- convert_to_string_ex(yyfield_name);
- field = Z_STRVAL_PP(yyfield_name);
- row = atoi(Z_STRVAL_PP(yyrow_num));
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-
- ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, "mnoGoSearch-Result", le_res);
- if(row<Res->num_rows){
- if (!strcasecmp(field,"URL")) {
- char *al;
- al = (char *)MyRemoveHiLightDup((const char *)(UdmVarListFindStr(&(Res->Doc[row].Sections), field, "")));
- UdmVarListReplaceStr(&Res->Doc[row].Sections,field,al);
- efree(al);
- }
- RETURN_STRING((char *)UdmVarListFindStr(&Res->Doc[row].Sections,field,""),1);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"row number too large");
- RETURN_FALSE;
- }
-}
-/* }}} */
-#endif
-
-#if UDM_VERSION_ID >= 30216
-/* {{{ proto int udm_store_doc_cgi(int agent)
- Get CachedCopy of document and return TRUE if cached copy found */
-DLEXPORT PHP_FUNCTION(udm_store_doc_cgi)
-{
- pval ** yyagent;
- UDM_AGENT * Agent;
- int id=-1;
-
- const char *htok;
- char *last = NULL;
- UDM_DOCUMENT *Doc;
- UDM_RESULT *Res;
- UDM_HTMLTOK tag;
- char *HDoc=NULL;
- char *HEnd=NULL;
- char ch;
- const char *content_type, *charset;
- UDM_CHARSET *cs;
-
- switch(ZEND_NUM_ARGS()){
- case 1: {
- if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
-
- Doc=UdmDocInit(NULL);
- Res=UdmResultInit(NULL);
-
- UdmPrepare(Agent,Res);
- UdmVarListReplaceStr(&Doc->Sections, "URL", UdmVarListFindStr(&Agent->Conf->Vars, "URL", "0"));
- UdmVarListReplaceStr(&Doc->Sections, "dbnum", UdmVarListFindStr(&Agent->Conf->Vars, "dbnum", "0"));
- UdmURLAction(Agent, Doc, UDM_URL_ACTION_GET_CACHED_COPY);
- UdmVarListReplaceLst(&Agent->Conf->Vars, &Doc->Sections, NULL, "*");
-
- charset = UdmVarListFindStr(&Agent->Conf->Vars,"Charset","iso-8859-1");
- cs = UdmGetCharSet(charset);
-
- /* UnStore Doc, Highlight and Display */
-
- content_type = UdmVarListFindStr(&Agent->Conf->Vars, "Content-Type", "text/html");
-
- if(!Doc->Buf.content) {
- UdmResultFree(Res);
- UdmDocFree(Doc);
-
- RETURN_FALSE;
- }
-
- HEnd=HDoc = (char*)emalloc(UDM_MAXDOCSIZE + 32);
- *HEnd='\0';
-
- if (strncasecmp(content_type, "text/plain", 10) == 0) {
- sprintf(HEnd, "<pre>\n");
- HEnd += strlen(HEnd);
- }
-
- UdmHTMLTOKInit(&tag);
- for(htok = UdmHTMLToken(Doc->Buf.content, (const char **)&last, &tag) ; htok ;) {
- switch(tag.type) {
- case UDM_HTML_COM:
- case UDM_HTML_TAG:
- memcpy(HEnd,htok,(size_t)(last-htok));
- HEnd+=last-htok;
- HEnd[0]='\0';
- UdmHTMLParseTag(&tag,Doc);
- break;
- case UDM_HTML_TXT:
- ch = *last; *last = '\0';
- if (tag.title || tag.script) {
- sprintf(HEnd, "%s", UdmHlConvert(NULL, htok, cs, cs));
- } else {
- sprintf(HEnd, "%s", UdmHlConvert(&Res->WWList, htok, cs, cs));
- }
- HEnd=UDM_STREND(HEnd);
- *last = ch;
- break;
- }
- htok = UdmHTMLToken(NULL, (const char **)&last, &tag);
- }
-
- if (strncasecmp(content_type, "text/plain", 10) == 0) {
- sprintf(HEnd, "</pre>\n");
- HEnd += strlen(HEnd);
- }
-
- UdmVarListAddStr(&Agent->Conf->Vars, "document", HDoc);
-
- UdmResultFree(Res);
- UdmDocFree(Doc);
- efree(HDoc);
-
- RETURN_TRUE;
-}
-/* }}} */
-#endif
-
-#if UDM_VERSION_ID >= 30211
-/* {{{ proto int udm_alloc_agent_array(array dbaddr)
- Allocate mnoGoSearch session */
-DLEXPORT PHP_FUNCTION(udm_alloc_agent_array)
-{
- switch(ZEND_NUM_ARGS()){
-
- case 1: {
- pval **yydbaddr;
- zval **tmp;
- char *dbaddr;
- UDM_ENV * Env;
- UDM_AGENT * Agent;
- HashPosition pos;
-
- if(zend_get_parameters_ex(1,&yydbaddr)==FAILURE){
- RETURN_FALSE;
- }
-
- if (Z_TYPE_PP(yydbaddr) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument DBAddr must be an array.");
- RETURN_FALSE;
- }
- convert_to_array_ex(yydbaddr);
-
- Env=UdmEnvInit(NULL);
- UdmVarListReplaceStr(&Env->Vars,"SyslogFacility","local7");
-#if UDM_VERSION_ID >= 30215
- UdmSetLogLevel(NULL,0);
-#else
- UdmSetLogLevel(Env,0);
-#endif
- UdmOpenLog("mnoGoSearch-php",Env,0);
-
- zend_hash_internal_pointer_reset_ex(HASH_OF(*yydbaddr), &pos);
-
- while (zend_hash_get_current_data_ex(HASH_OF(*yydbaddr), (void **)&tmp, &pos) == SUCCESS) {
- convert_to_string_ex(tmp);
- dbaddr = Z_STRVAL_PP(tmp);
- UdmDBListAdd(&Env->dbl,dbaddr, UDM_OPEN_MODE_WRITE);
-
- zend_hash_move_forward_ex(HASH_OF(*yydbaddr), &pos);
- }
-
- Agent=UdmAgentInit(NULL,Env,0);
- ZEND_REGISTER_RESOURCE(return_value,Agent,le_link);
- }
- break;
-
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-}
-/* }}} */
-
-/* {{{ proto int udm_hash32(int agent, string str)
- Return Hash32 checksum of gived string */
-DLEXPORT PHP_FUNCTION(udm_hash32)
-{
- pval ** yystr, ** yyagent;
- char *str;
- udmhash32_t hash32;
- char buf[32];
- UDM_AGENT * Agent;
- int id=-1;
-
- switch(ZEND_NUM_ARGS()){
- case 2: {
- if (zend_get_parameters_ex(2, &yyagent,&yystr)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
- convert_to_string_ex(yystr);
- str = Z_STRVAL_PP(yystr);
-
- hash32=UdmHash32((str),strlen(str));
-#if UDM_VERSION_ID >= 30215
- snprintf(buf,sizeof(buf)-1,"%i",hash32);
-#else
- snprintf(buf,sizeof(buf)-1,"%u",hash32);
-#endif
-
- RETURN_STRING(buf,1);
-}
-/* }}} */
-#endif
-
-/* {{{ proto int udm_find(int agent, string query)
- Perform search */
-DLEXPORT PHP_FUNCTION(udm_find)
-{
- pval ** yyquery=NULL, ** yyagent;
- UDM_RESULT * Res;
- UDM_AGENT * Agent;
- int id=-1;
-
- switch(ZEND_NUM_ARGS()){
-#if UDM_VERSION_ID >= 30213
- case 1: {
- if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
-#endif
- case 2: {
- if (zend_get_parameters_ex(2, &yyagent,&yyquery)==FAILURE) {
- RETURN_FALSE;
- }
- convert_to_string_ex(yyquery);
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
-
-#if UDM_VERSION_ID < 30200
- if ((Res=UdmFind(Agent,UdmTolower(Z_STRVAL_PP(yyquery),Agent->charset)))) {
-#else
-#if UDM_VERSION_ID >= 30213
- if ((yyquery) && (strlen(Z_STRVAL_PP(yyquery))))
- UdmVarListReplaceStr(&Agent->Conf->Vars, "q",
- Z_STRVAL_PP(yyquery));
- if ((Res=UdmFind(Agent))) {
-#else
- if ((Res=UdmFind(Agent,Z_STRVAL_PP(yyquery)))) {
-#endif
-#endif
- ZEND_REGISTER_RESOURCE(return_value,Res,le_res);
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} */
-
-/* {{{ proto string udm_get_res_field(int res, int row, int field)
- Fetch mnoGoSearch result field */
-DLEXPORT PHP_FUNCTION(udm_get_res_field)
-{
- pval **yyres, **yyrow_num, **yyfield_name;
-
- UDM_RESULT * Res;
- int row,field;
-
- switch(ZEND_NUM_ARGS()){
- case 3: {
- if (zend_get_parameters_ex(3, &yyres,&yyrow_num,&yyfield_name)==FAILURE){
- RETURN_FALSE;
- }
- convert_to_string_ex(yyrow_num);
- convert_to_string_ex(yyfield_name);
- field=atoi(Z_STRVAL_PP(yyfield_name));
- row=atoi(Z_STRVAL_PP(yyrow_num));
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, "mnoGoSearch-Result", le_res);
- if(row<Res->num_rows){
- switch(field){
- case UDM_FIELD_URL:
-#if UDM_VERSION_ID >= 30204
- {
- char *al;
- al = (char *)MyRemoveHiLightDup((const char *)(UdmVarListFindStr(&(Res->Doc[row].Sections), "URL", "")));
- UdmVarListReplaceStr(&Res->Doc[row].Sections,"URL",al);
- efree(al);
-
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"URL",""),1);
- }
-#else
- RETURN_STRING((Res->Doc[row].url)?(Res->Doc[row].url):"",1);
-#endif
- break;
-
- case UDM_FIELD_CONTENT:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Content-Type",""),1);
-#else
- RETURN_STRING((Res->Doc[row].content_type)?(Res->Doc[row].content_type):"",1);
-#endif
- break;
-
- case UDM_FIELD_TITLE:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Title",""),1);
-#else
- RETURN_STRING((Res->Doc[row].title)?(Res->Doc[row].title):"",1);
-#endif
- break;
-
- case UDM_FIELD_KEYWORDS:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Meta.Keywords",""),1);
-#else
- RETURN_STRING((Res->Doc[row].keywords)?(Res->Doc[row].keywords):"",1);
-#endif
- break;
-
- case UDM_FIELD_DESC:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Meta.Description",""),1);
-#else
- RETURN_STRING((Res->Doc[row].description)?(Res->Doc[row].description):"",1);
-#endif
- break;
-
- case UDM_FIELD_TEXT:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Body",""),1);
-#else
- RETURN_STRING((Res->Doc[row].text)?(Res->Doc[row].text):"",1);
-#endif
- break;
-
- case UDM_FIELD_SIZE:
-#if UDM_VERSION_ID >= 30204
- RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"Content-Length",0));
-#else
- RETURN_LONG((Res->Doc[row].size));
-#endif
- break;
-
- case UDM_FIELD_URLID:
-#if UDM_VERSION_ID >= 30204
- RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"ID",0));
-#else
- RETURN_LONG((Res->Doc[row].url_id));
-#endif
- break;
-
- case UDM_FIELD_RATING:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Score",""),1);
-#else
- RETURN_LONG((Res->Doc[row].rating));
-#endif
- break;
-
- case UDM_FIELD_MODIFIED:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Last-Modified",""),1);
-#else
- RETURN_LONG((Res->Doc[row].last_mod_time));
-#endif
- break;
-
- case UDM_FIELD_ORDER:
-#if UDM_VERSION_ID >= 30204
- RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"Order",0));
-#else
- RETURN_LONG((Res->Doc[row].order));
-#endif
- break;
-
- case UDM_FIELD_CRC:
-#if UDM_VERSION_ID >= 30204
- RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"crc32",0));
-#else
- RETURN_LONG((Res->Doc[row].crc32));
-#endif
- break;
-
- case UDM_FIELD_CATEGORY:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Category",""),1);
-#else
- RETURN_STRING((Res->Doc[row].category)?(Res->Doc[row].category):"",1);
-#endif
- break;
-
-#if UDM_VERSION_ID >= 30203
- case UDM_FIELD_LANG:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Content-Language",""),1);
-#else
- RETURN_STRING((Res->Doc[row].lang)?(Res->Doc[row].lang):"",1);
-#endif
- break;
-
- case UDM_FIELD_CHARSET:
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Charset",""),1);
-#else
- RETURN_STRING((Res->Doc[row].charset)?(Res->Doc[row].charset):"",1);
-#endif
- break;
-#endif
-
-#if UDM_VERSION_ID >= 30207
- case UDM_FIELD_SITEID:
- RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"Site_id",0));
-
- break;
-
- case UDM_FIELD_POP_RANK:
- RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"Pop_Rank",""),1);
-
- break;
-
- case UDM_FIELD_ORIGINID:
- RETURN_LONG(UdmVarListFindInt(&(Res->Doc[row].Sections),"Origin-Id",0));
-
- break;
-#endif
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown mnoGoSearch field name");
- RETURN_FALSE;
- break;
- }
- }else{
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"row number too large");
- RETURN_FALSE;
- }
-}
-/* }}} */
-
-/* {{{ proto string udm_get_res_param(int res, int param)
- Get mnoGoSearch result parameters */
-DLEXPORT PHP_FUNCTION(udm_get_res_param)
-{
- pval ** yyres, ** yyparam;
- int param;
- UDM_RESULT * Res;
- switch(ZEND_NUM_ARGS()){
- case 2: {
- if (zend_get_parameters_ex(2, &yyres, &yyparam)==FAILURE) {
- RETURN_FALSE;
- }
- convert_to_long_ex(yyparam);
- param=(Z_LVAL_PP(yyparam));
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, "mnoGoSearch-Result", le_res);
- switch(param){
- case UDM_PARAM_NUM_ROWS:
- RETURN_LONG(Res->num_rows);
- break;
-
- case UDM_PARAM_FOUND:
- RETURN_LONG(Res->total_found);
- break;
-
- case UDM_PARAM_WORDINFO:
-#if UDM_VERSION_ID >= 30204
- {
- int len,i;
- for(len = i = 0; i < Res->WWList.nwords; i++)
- len += Res->WWList.Word[i].len + 64;
- {
- size_t wsize=(1+len)*sizeof(char);
- char *wordinfo = (char*) emalloc(wsize);
-
- *wordinfo = '\0';
-
- for(i = 0; i < Res->WWList.nwords; i++){
- if ((Res->WWList.Word[i].count > 0) ||
- (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY)) {
- if(wordinfo[0]) strcat(wordinfo,", ");
- sprintf(UDM_STREND(wordinfo)," %s : %d", Res->WWList.Word[i].word, Res->WWList.Word[i].count);
- } else if (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) {
- if(wordinfo[0]) strcat(wordinfo,", ");
- sprintf(UDM_STREND(wordinfo)," %s : stopword", Res->WWList.Word[i].word);
- }
- }
- RETURN_STRING(wordinfo,0);
- }
- }
-#else
- RETURN_STRING((Res->wordinfo)?(Res->wordinfo):"",1);
-#endif
- break;
-
-#if UDM_VERSION_ID >= 30204
- case UDM_PARAM_WORDINFO_ALL:
- {
- int len,i,j;
- for(len = i = 0; i < Res->WWList.nwords; i++)
- len += Res->WWList.Word[i].len + 64;
- {
- size_t wsize=(1+len)*sizeof(char);
- char *wordinfo = (char*) emalloc(wsize);
- int corder = (size_t)-1, ccount = 0;
-
- *wordinfo = '\0';
-
- for(i = 0; i < Res->WWList.nwords; i++) {
- corder = Res->WWList.Word[i].order;
- ccount = 0;
- for(j = 0; j < Res->WWList.nwords; j++) {
- if (Res->WWList.Word[j].order == corder) {
- ccount += Res->WWList.Word[j].count;
- }
- }
- if (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_STOP) {
- sprintf(UDM_STREND(wordinfo),"%s%s : stopword", (*wordinfo) ? ", " : "", Res->WWList.Word[i].word);
- } else if (Res->WWList.Word[i].origin == UDM_WORD_ORIGIN_QUERY) {
- sprintf(UDM_STREND(wordinfo),"%s%s : %d / %d", (*wordinfo) ? ", " : "", Res->WWList.Word[i].word, Res->WWList.Word[i].count, ccount);
- } else continue;
- }
- RETURN_STRING(wordinfo,0);
- }
- }
- break;
-#endif
-
- case UDM_PARAM_SEARCHTIME:
- RETURN_DOUBLE(((double)Res->work_time)/1000);
- break;
-
- case UDM_PARAM_FIRST_DOC:
- RETURN_LONG(Res->first);
- break;
-
- case UDM_PARAM_LAST_DOC:
- RETURN_LONG(Res->last);
- break;
-
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unknown mnoGoSearch param name");
- RETURN_FALSE;
- break;
- }
-}
-/* }}} */
-
-/* {{{ proto int udm_free_res(int res)
- mnoGoSearch free result */
-DLEXPORT PHP_FUNCTION(udm_free_res)
-{
- pval ** yyres;
- UDM_RESULT * Res;
- switch(ZEND_NUM_ARGS()){
- case 1: {
- if (zend_get_parameters_ex(1, &yyres)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Res, UDM_RESULT *, yyres, -1, "mnoGoSearch-Result", le_res);
- zend_list_delete(Z_LVAL_PP(yyres));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int udm_free_agent(int agent)
- Free mnoGoSearch session */
-DLEXPORT PHP_FUNCTION(udm_free_agent)
-{
- pval ** yyagent;
- UDM_RESULT * Agent;
- switch(ZEND_NUM_ARGS()){
- case 1: {
- if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_RESULT *, yyagent, -1, "mnoGoSearch-agent", le_link);
- zend_list_delete(Z_LVAL_PP(yyagent));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int udm_errno(int agent)
- Get mnoGoSearch error number */
-DLEXPORT PHP_FUNCTION(udm_errno)
-{
- pval ** yyagent;
- UDM_AGENT * Agent;
- switch(ZEND_NUM_ARGS()){
- case 1: {
- if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
-#if UDM_VERSION_ID >= 30208
- if (UdmEnvErrMsg(Agent->Conf) && strlen(UdmEnvErrMsg(Agent->Conf))) {
- RETURN_LONG(1);
- } else {
- RETURN_LONG(0);
- }
-#elif UDM_VERSION_ID >= 30204
- RETURN_LONG(UdmEnvErrCode(Agent->Conf));
-#else
- RETURN_LONG(UdmDBErrorCode(Agent->db));
-#endif
-}
-/* }}} */
-
-/* {{{ proto string udm_error(int agent)
- Get mnoGoSearch error message */
-DLEXPORT PHP_FUNCTION(udm_error)
-{
- pval ** yyagent;
- UDM_AGENT * Agent;
-
- switch(ZEND_NUM_ARGS()){
- case 1: {
- if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link);
-#if UDM_VERSION_ID >= 30204
- RETURN_STRING((UdmEnvErrMsg(Agent->Conf))?(UdmEnvErrMsg(Agent->Conf)):"",1);
-#else
- RETURN_STRING((UdmDBErrorMsg(Agent->db))?(UdmDBErrorMsg(Agent->db)):"",1);
-#endif
-}
-/* }}} */
-
-/* {{{ proto int udm_api_version()
- Get mnoGoSearch API version */
-DLEXPORT PHP_FUNCTION(udm_api_version)
-{
- RETURN_LONG(UDM_VERSION_ID);
-}
-/* }}} */
-
-/* {{{ proto array udm_cat_list(int agent, string category)
- Get mnoGoSearch categories list with the same root */
-DLEXPORT PHP_FUNCTION(udm_cat_list)
-{
- pval ** yycat, ** yyagent;
- UDM_AGENT * Agent;
- char *cat;
-#if UDM_VERSION_ID >= 30204
- UDM_CATEGORY C;
-#else
- UDM_CATEGORY *c=NULL;
-#endif
- char *buf=NULL;
- int id=-1;
-
- switch(ZEND_NUM_ARGS()){
- case 2: {
- if (zend_get_parameters_ex(2, &yyagent,&yycat)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
- convert_to_string_ex(yycat);
- cat = Z_STRVAL_PP(yycat);
-
-#if UDM_VERSION_ID >= 30204
- bzero(&C,sizeof(C));
- strncpy(C.addr,cat,sizeof(C.addr)-1);
-#if UDM_VERSION_ID <= 30210
- if(!UdmCatAction(Agent,&C,UDM_CAT_ACTION_LIST,Agent->Conf->db)){
-#else
- if(UDM_OK == UdmCatAction(Agent,&C,UDM_CAT_ACTION_LIST)){
-#endif
-#else
- if((c=UdmCatList(Agent,cat))){
-#endif
- array_init(return_value);
-
- if (!(buf=ecalloc(1,UDMSTRSIZ+1))) {
- RETURN_FALSE;
- }
-
-#if UDM_VERSION_ID >= 30204
- {
- int i;
- if (C.ncategories) {
- for(i=0;i<C.ncategories;i++){
- add_next_index_stringl(return_value, C.Category[i].path,strlen(C.Category[i].path),1);
- add_next_index_stringl(return_value, C.Category[i].name,strlen(C.Category[i].name),1);
- }
- } else {
- RETURN_FALSE;
- }
- }
-#else
- while(c->rec_id){
- snprintf(buf, UDMSTRSIZ, "%s%s",c->link[0]?"@ ":"", c->name);
- add_next_index_string(return_value, c->link[0]?c->link:c->path, 1);
- add_next_index_string(return_value, buf, 1);
- c++;
- }
-#endif
- efree(buf);
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} */
-
-/* {{{ proto array udm_cat_path(int agent, string category)
- Get mnoGoSearch categories path from the root to the given catgory */
-DLEXPORT PHP_FUNCTION(udm_cat_path)
-{
- pval ** yycat, ** yyagent;
- UDM_AGENT * Agent;
- char *cat;
-#if UDM_VERSION_ID >= 30204
- UDM_CATEGORY C;
-#else
- UDM_CATEGORY *c=NULL;
-#endif
- char *buf=NULL;
- int id=-1;
-
- switch(ZEND_NUM_ARGS()){
- case 2: {
- if (zend_get_parameters_ex(2, &yyagent,&yycat)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
- convert_to_string_ex(yycat);
- cat = Z_STRVAL_PP(yycat);
-
-#if UDM_VERSION_ID >= 30204
- bzero(&C,sizeof(C));
- strncpy(C.addr,cat,sizeof(C.addr)-1);
-#if UDM_VERSION_ID <= 30210
- if(!UdmCatAction(Agent,&C,UDM_CAT_ACTION_PATH,Agent->Conf->db)){
-#else
- if(UDM_OK == UdmCatAction(Agent,&C,UDM_CAT_ACTION_PATH)){
-#endif
-#else
- if((c=UdmCatPath(Agent,cat))){
-#endif
- array_init(return_value);
-
- if (!(buf=ecalloc(1,UDMSTRSIZ+1))) {
- RETURN_FALSE;
- }
-
-#if UDM_VERSION_ID >= 30204
- {
- int i;
- if (C.ncategories) {
- for(i=0;i<C.ncategories;i++){
- add_next_index_stringl(return_value, C.Category[i].path,strlen(C.Category[i].path),1);
- add_next_index_stringl(return_value, C.Category[i].name,strlen(C.Category[i].name),1);
- }
- } else {
- RETURN_FALSE;
- }
- }
-#else
- while(c->rec_id){
- snprintf(buf, UDMSTRSIZ, "%s%s",c->link[0]?"@ ":"", c->name);
- add_next_index_string(return_value, c->link[0]?c->link:c->path, 1);
- add_next_index_string(return_value, buf, 1);
- c++;
- }
-#endif
- efree(buf);
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} */
-
-#if UDM_VERSION_ID > 30110
-/* {{{ proto int udm_get_doc_count(int agent)
- Get total number of documents in database */
-DLEXPORT PHP_FUNCTION(udm_get_doc_count)
-{
- pval ** yyagent;
- UDM_AGENT * Agent;
- int id=-1;
-
- switch(ZEND_NUM_ARGS()){
- case 1: {
- if (zend_get_parameters_ex(1, &yyagent)==FAILURE) {
- RETURN_FALSE;
- }
- }
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
- }
- ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, id, "mnoGoSearch-Agent", le_link);
-#if UDM_VERSION_ID >= 30204
-#if UDM_VERSION_ID <= 30210
- if (!Agent->doccount) UdmURLAction(Agent,NULL,UDM_URL_ACTION_DOCCOUNT,Agent->Conf->db);
-#else
- if (!Agent->doccount) UdmURLAction(Agent,NULL,UDM_URL_ACTION_DOCCOUNT);
-#endif
- RETURN_LONG(Agent->doccount);
-#else
- RETURN_LONG(UdmGetDocCount(Agent));
-#endif
-}
-/* }}} */
-#endif
-
-
-#endif
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim<600: sw=4 ts=4
- */
diff --git a/ext/mnogosearch/php_mnogo.h b/ext/mnogosearch/php_mnogo.h
deleted file mode 100644
index 0bdea74d7..000000000
--- a/ext/mnogosearch/php_mnogo.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* $Source: /repository/php-src/ext/mnogosearch/Attic/php_mnogo.h,v $ */
-/* $Id: php_mnogo.h,v 1.25.2.2 2004/11/15 19:07:34 gluke Exp $ */
-
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: |
- | Initial version by Alex Barkov <bar@izhcom.ru> |
- | and Ramil Kalimullin <ram@izhcom.ru> |
- | Further development by Sergey Kartashoff <gluke@mail.ru> |
- +----------------------------------------------------------------------+
-*/
-
-#ifndef _PHP_MNOGO_H
-#define _PHP_MNOGO_H
-
-#if HAVE_MNOGOSEARCH
-
-#include <udm_config.h>
-#include <udmsearch.h>
-
-#if UDM_VERSION_ID >= 30203
-#include <udm_crc32.h>
-#include <udm_store.h>
-#endif
-
-extern zend_module_entry mnogosearch_module_entry;
-#define mnogosearch_module_ptr &mnogosearch_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_MNOGO_API __declspec(dllexport)
-#else
-#define PHP_MNOGO_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-/* mnoGoSearch functions */
-DLEXPORT PHP_MINIT_FUNCTION(mnogosearch);
-DLEXPORT PHP_RINIT_FUNCTION(mnogosearch);
-DLEXPORT PHP_MSHUTDOWN_FUNCTION(mnogosearch);
-DLEXPORT PHP_MINFO_FUNCTION(mnogosearch);
-
-DLEXPORT PHP_FUNCTION(udm_api_version);
-#if UDM_VERSION_ID >= 30200
-DLEXPORT PHP_FUNCTION(udm_check_charset);
-#if UDM_VERSION_ID >= 30203
-DLEXPORT PHP_FUNCTION(udm_crc32);
-#endif
-#if UDM_VERSION_ID >= 30204
-DLEXPORT PHP_FUNCTION(udm_parse_query_string);
-DLEXPORT PHP_FUNCTION(udm_make_excerpt);
-DLEXPORT PHP_FUNCTION(udm_set_agent_param_ex);
-DLEXPORT PHP_FUNCTION(udm_get_agent_param_ex);
-DLEXPORT PHP_FUNCTION(udm_get_res_field_ex);
-#endif
-#if UDM_VERSION_ID >= 30211
-DLEXPORT PHP_FUNCTION(udm_hash32);
-DLEXPORT PHP_FUNCTION(udm_alloc_agent_array);
-#endif
-#if UDM_VERSION_ID >= 30216
-DLEXPORT PHP_FUNCTION(udm_store_doc_cgi);
-#endif
-#endif
-
-DLEXPORT PHP_FUNCTION(udm_alloc_agent);
-DLEXPORT PHP_FUNCTION(udm_set_agent_param);
-
-DLEXPORT PHP_FUNCTION(udm_load_ispell_data);
-DLEXPORT PHP_FUNCTION(udm_free_ispell_data);
-
-DLEXPORT PHP_FUNCTION(udm_add_search_limit);
-DLEXPORT PHP_FUNCTION(udm_clear_search_limits);
-
-DLEXPORT PHP_FUNCTION(udm_error);
-DLEXPORT PHP_FUNCTION(udm_errno);
-
-DLEXPORT PHP_FUNCTION(udm_find);
-DLEXPORT PHP_FUNCTION(udm_get_res_field);
-DLEXPORT PHP_FUNCTION(udm_get_res_param);
-
-DLEXPORT PHP_FUNCTION(udm_cat_list);
-DLEXPORT PHP_FUNCTION(udm_cat_path);
-
-DLEXPORT PHP_FUNCTION(udm_free_res);
-DLEXPORT PHP_FUNCTION(udm_free_agent);
-
-#if UDM_VERSION_ID > 30110
-DLEXPORT PHP_FUNCTION(udm_get_doc_count);
-#endif
-
-#else
-
-#define mnogosearch_module_ptr NULL
-
-#endif
-
-#define phpext_mnogosearch_ptr mnogosearch_module_ptr
-
-#endif /* _PHP_MNOGO_H */
diff --git a/ext/msession/msession.c b/ext/msession/msession.c
index 60f436080..ffbe791c4 100644
--- a/ext/msession/msession.c
+++ b/ext/msession/msession.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| msession 1.0 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -156,9 +156,9 @@ zend_module_entry msession_module_entry = {
"msession",
msession_functions,
PHP_MINIT(msession),
- PHP_MSHUTDOWN(msession),
- PHP_RINIT(msession),
- PHP_RSHUTDOWN(msession),
+ NULL,
+ NULL,
+ NULL,
PHP_MINFO(msession),
#ifdef PHP_4_1
NO_VERSION_YET,
@@ -181,21 +181,6 @@ PHP_MINIT_FUNCTION(msession)
return SUCCESS;
}
-PHP_MSHUTDOWN_FUNCTION(msession)
-{
- return SUCCESS;
-}
-
-PHP_RINIT_FUNCTION(msession)
-{
- return SUCCESS;
-}
-
-PHP_RSHUTDOWN_FUNCTION(msession)
-{
- return SUCCESS;
-}
-
PHP_MINFO_FUNCTION(msession)
{
php_info_print_table_start();
diff --git a/ext/msession/php_msession.h b/ext/msession/php_msession.h
index edd2a7bb6..c2f5f9b45 100644
--- a/ext/msession/php_msession.h
+++ b/ext/msession/php_msession.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| msession 1.0 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -35,9 +35,6 @@ extern zend_module_entry msession_module_entry;
#endif
PHP_MINIT_FUNCTION(msession);
-PHP_MSHUTDOWN_FUNCTION(msession);
-PHP_RINIT_FUNCTION(msession);
-PHP_RSHUTDOWN_FUNCTION(msession);
PHP_MINFO_FUNCTION(msession);
PHP_FUNCTION(msession_connect);
diff --git a/ext/msession/reqclient.h b/ext/msession/reqclient.h
index 22414fea3..aa5220095 100644
--- a/ext/msession/reqclient.h
+++ b/ext/msession/reqclient.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| msession 1.0 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2001 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/msql/config.m4 b/ext/msql/config.m4
index b7a37f78a..2dcd1150b 100644
--- a/ext/msql/config.m4
+++ b/ext/msql/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.12.14.1 2004/12/30 07:04:10 sniper Exp $
+dnl $Id: config.m4,v 1.14 2005/05/29 23:16:42 sniper Exp $
dnl
dnl
@@ -23,7 +23,7 @@ AC_DEFUN([PHP_MSQL_VERSION],[
PHP_ARG_WITH(msql,for mSQL support,
[ --with-msql[=DIR] Include mSQL support. DIR is the mSQL base
- install directory, defaults to /usr/local/Hughes.])
+ install directory, defaults to /usr/local/Hughes])
if test "$PHP_MSQL" != "no"; then
if test "$PHP_MSQL" = "yes"; then
diff --git a/ext/msql/php_msql.c b/ext/msql/php_msql.c
index 62ff1f7be..13b35b529 100644
--- a/ext/msql/php_msql.c
+++ b/ext/msql/php_msql.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_msql.c,v 1.57.2.1 2005/02/17 20:13:10 andi Exp $ */
+/* $Id: php_msql.c,v 1.60 2005/08/03 14:07:28 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1102,8 +1102,8 @@ PHP_FUNCTION(msql_fetch_field)
}
object_init(return_value);
- add_property_string(return_value, "name",(msql_field->name?msql_field->name:empty_string), 1);
- add_property_string(return_value, "table",(msql_field->table?msql_field->table:empty_string), 1);
+ add_property_string(return_value, "name",(msql_field->name?msql_field->name:""), 1);
+ add_property_string(return_value, "table",(msql_field->table?msql_field->table:""), 1);
add_property_long(return_value, "not_null",IS_NOT_NULL(msql_field->flags));
#if MSQL1
add_property_long(return_value, "primary_key",(msql_field->flags&PRI_KEY_FLAG?1:0));
diff --git a/ext/msql/php_msql.h b/ext/msql/php_msql.h
index 0f85fb035..b03e48c49 100644
--- a/ext/msql/php_msql.h
+++ b/ext/msql/php_msql.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_msql.h,v 1.12 2004/01/08 17:32:27 sniper Exp $ */
+/* $Id: php_msql.h,v 1.13 2005/08/03 14:07:28 sniper Exp $ */
#ifndef PHP_MSQL_H
#define PHP_MSQL_H
diff --git a/ext/mssql/config.m4 b/ext/mssql/config.m4
index e362735a8..bbeeebe76 100644
--- a/ext/mssql/config.m4
+++ b/ext/mssql/config.m4
@@ -1,20 +1,22 @@
dnl
-dnl $Id: config.m4,v 1.5.2.2 2004/12/08 18:58:25 fmk Exp $
+dnl $Id: config.m4,v 1.9.2.2 2005/10/10 10:28:53 sniper Exp $
dnl
PHP_ARG_WITH(mssql,for MSSQL support via FreeTDS,
[ --with-mssql[=DIR] Include MSSQL-DB support. DIR is the FreeTDS home
- directory, defaults to /usr/local/freetds.])
-
+ directory, defaults to /usr/local/freetds])
if test "$PHP_MSSQL" != "no"; then
- FREETDS_INSTALLATION_DIR=""
if test "$PHP_MSSQL" = "yes"; then
-
for i in /usr/local /usr; do
if test -f $i/include/tds.h; then
FREETDS_INSTALLATION_DIR=$i
+ FREETDS_INCLUDE_DIR=$i/include
+ break
+ elif test -f $i/include/freetds/tds.h; then
+ FREETDS_INSTALLATION_DIR=$i
+ FREETDS_INCLUDE_DIR=$i/include/freetds
break
fi
done
@@ -27,20 +29,22 @@ if test "$PHP_MSSQL" != "no"; then
if test -f $PHP_MSSQL/include/tds.h; then
FREETDS_INSTALLATION_DIR=$PHP_MSSQL
+ FREETDS_INCLUDE_DIR=$PHP_MSSQL/include
+ elif test -f $PHP_MSSQL/include/freetds/tds.h; then
+ FREETDS_INSTALLATION_DIR=$PHP_MSSQL
+ FREETDS_INCLUDE_DIR=$PHP_MSSQL/include/freetds
else
AC_MSG_ERROR(Directory $PHP_MSSQL is not a FreeTDS installation directory)
fi
fi
- if test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.a" && test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.so"; then
- AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/lib/libtds.[a|so])
+ if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.a" && test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.so"; then
+ AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.[a|so])
fi
- MSSQL_INCDIR=$FREETDS_INSTALLATION_DIR/include
- MSSQL_LIBDIR=$FREETDS_INSTALLATION_DIR/lib
+ PHP_ADD_INCLUDE($FREETDS_INCLUDE_DIR)
+ PHP_ADD_LIBRARY_WITH_PATH(sybdb, $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, MSSQL_SHARED_LIBADD)
- PHP_ADD_INCLUDE($MSSQL_INCDIR)
- PHP_ADD_LIBRARY_WITH_PATH(sybdb, $MSSQL_LIBDIR, MSSQL_SHARED_LIBADD)
PHP_NEW_EXTENSION(mssql, php_mssql.c, $ext_shared)
AC_CHECK_LIB(dnet_stub, dnet_addr,
[ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,MSSQL_SHARED_LIBADD)
diff --git a/ext/mssql/config.w32 b/ext/mssql/config.w32
index fa38ca9a6..0955f9cdc 100644
--- a/ext/mssql/config.w32
+++ b/ext/mssql/config.w32
@@ -1,15 +1,28 @@
-// $Id: config.w32,v 1.4 2003/12/03 14:29:43 wez Exp $
+// $Id: config.w32,v 1.7 2005/01/18 22:38:24 fmk Exp $
// vim:ft=javascript
ARG_WITH("mssql", "mssql support", "no");
-if (PHP_MSSQL == "yes") {
- if (CHECK_LIB("ntwdblib.lib", "mssql", "\\MSSQL7\\DevTools\\Lib") &&
- CHECK_HEADER_ADD_INCLUDE("sqlfront.h", "CFLAGS_MSSQL")) {
+if (PHP_MSSQL != "no") {
+ if (CHECK_LIB("ntwdblib.lib", "mssql", "\\MSSQL7\\DevTools\\Lib;\\MSSQL7\\DevTools\\Lib;" + PHP_MSSQL) &&
+ CHECK_HEADER_ADD_INCLUDE("sqlfront.h", "CFLAGS_MSSQL", "\\MSSQL7\\DevTools\\Include;\\MSSQL7\\DevTools\\Include" + PHP_MSSQL)) {
EXTENSION("mssql", "php_mssql.c");
- ADD_FLAG("CFLAGS_MSSQL", "/D DBNTWIN32=1 /D MSSQL70=1");
AC_DEFINE('HAVE_MSSQL', 1, 'Have MSSQL support');
+ ADD_FLAG("CFLAGS_MSSQL", "/D DBNTWIN32=1 /D MSSQL70=1");
} else {
WARNING("mssql not enabled; libraries and headers not found");
}
}
+
+ARG_WITH("dblib", "mssql support with freetds", "no");
+
+if (PHP_DBLIB != "no") {
+ if (CHECK_LIB("dblib.lib", "dblib", PHP_PHP_BUILD + "\\freetds") &&
+ CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_DBLIB", PHP_PHP_BUILD + "\\freetds;" + PHP_DBLIB)) {
+ EXTENSION("dblib", "php_mssql.c", null, null, null, "ext\\dblib");
+ AC_DEFINE('HAVE_MSSQL', 1, 'Have MSSQL support');
+ ADD_FLAG("CFLAGS_DBLIB", "/D HAVE_FREETDS=1 /D DBNTWIN32=1 /D MSSQL70=1 /D MSSQL_EXPORTS /D COMPILE_DL_MSSQL");
+ } else {
+ WARNING("dblib not enabled; libraries and headers not found");
+ }
+}
diff --git a/ext/mssql/mssql.dsp b/ext/mssql/mssql.dsp
index 283923bb5..43294280d 100644
--- a/ext/mssql/mssql.dsp
+++ b/ext/mssql/mssql.dsp
@@ -13,7 +13,7 @@ CFG=mssql - Win32 Release_TS
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
-!MESSAGE NMAKE /f "mssql.mak" CFG="mssql - Win32 MSSQL 70 Debug_TS"
+!MESSAGE NMAKE /f "mssql.mak" CFG="mssql - Win32 Release_TS"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
@@ -71,7 +71,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x406 /d "NDEBUG"
@@ -81,7 +81,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mssql70.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mssql-70\lib"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mssql.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mssql-70\lib"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib ntwdblib.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_mssql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mssql-70\lib"
!ENDIF
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index a9aa3c039..e85c8dcd2 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_mssql.c,v 1.137.2.9 2005/04/12 17:46:06 fmk Exp $ */
+/* $Id: php_mssql.c,v 1.152.2.7 2005/11/18 21:23:20 fmk Exp $ */
#ifdef COMPILE_DL_MSSQL
#define HAVE_MSSQL 1
@@ -140,7 +140,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY_EX("mssql.batchsize", "0", PHP_INI_ALL, OnUpdateLong, batchsize, zend_mssql_globals, mssql_globals, display_link_numbers)
STD_PHP_INI_BOOLEAN("mssql.datetimeconvert", "1", PHP_INI_ALL, OnUpdateBool, datetimeconvert, zend_mssql_globals, mssql_globals)
STD_PHP_INI_BOOLEAN("mssql.secure_connection", "0", PHP_INI_SYSTEM, OnUpdateBool, secure_connection, zend_mssql_globals, mssql_globals)
- STD_PHP_INI_ENTRY_EX("mssql.max_procs", "25", PHP_INI_ALL, OnUpdateLong, max_procs, zend_mssql_globals, mssql_globals, display_link_numbers)
+ STD_PHP_INI_ENTRY_EX("mssql.max_procs", "-1", PHP_INI_ALL, OnUpdateLong, max_procs, zend_mssql_globals, mssql_globals, display_link_numbers)
PHP_INI_END()
/* error handler */
@@ -334,14 +334,16 @@ PHP_RINIT_FUNCTION(mssql)
MS_SQL_G(default_link) = -1;
MS_SQL_G(num_links) = MS_SQL_G(num_persistent);
MS_SQL_G(appname) = estrndup("PHP 5", 5);
- MS_SQL_G(server_message) = empty_string;
+ MS_SQL_G(server_message) = NULL;
MS_SQL_G(min_error_severity) = MS_SQL_G(cfg_min_error_severity);
MS_SQL_G(min_message_severity) = MS_SQL_G(cfg_min_message_severity);
if (MS_SQL_G(connect_timeout) < 1) MS_SQL_G(connect_timeout) = 1;
dbsetlogintime(MS_SQL_G(connect_timeout));
if (MS_SQL_G(timeout) < 0) MS_SQL_G(timeout) = 60;
dbsettime(MS_SQL_G(timeout));
- dbsetmaxprocs((TDS_SHORT)MS_SQL_G(max_procs));
+ if (MS_SQL_G(max_procs) != -1) {
+ dbsetmaxprocs((TDS_SHORT)MS_SQL_G(max_procs));
+ }
return SUCCESS;
}
@@ -380,7 +382,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *user, *passwd, *host;
char *hashed_details;
- int hashed_details_length;
+ int hashed_details_length, new_link = 0;
mssql_link mssql, *mssql_ptr;
char buffer[32];
@@ -438,6 +440,25 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
sprintf(hashed_details,"mssql_%s_%s_%s",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd)); /* SAFE */
}
break;
+ case 4: {
+ zval **yyhost,**yyuser,**yypasswd, **yynew_link;
+
+ if (zend_get_parameters_ex(4, &yyhost, &yyuser, &yypasswd, &yynew_link) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_string_ex(yyhost);
+ convert_to_string_ex(yyuser);
+ convert_to_string_ex(yypasswd);
+ convert_to_long_ex(yynew_link);
+ host = Z_STRVAL_PP(yyhost);
+ user = Z_STRVAL_PP(yyuser);
+ passwd = Z_STRVAL_PP(yypasswd);
+ new_link = Z_LVAL_PP(yynew_link);
+ hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+5+3;
+ hashed_details = (char *) emalloc(hashed_details_length+1);
+ sprintf(hashed_details,"mssql_%s_%s_%s",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd)); /* SAFE */
+ }
+ break;
default:
WRONG_PARAM_COUNT;
break;
@@ -472,6 +493,11 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifndef HAVE_FREETDS
}
#endif
+
+#ifdef HAVE_FREETDS
+ DBSETLCHARSET(mssql.login, "ISO-8859-1");
+#endif
+
DBSETLAPP(mssql.login,MS_SQL_G(appname));
mssql.valid = 1;
@@ -487,7 +513,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
list_entry *le;
/* try to find if we already have this link in our persistent list */
- if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void **) &le)==FAILURE) { /* we don't */
+ if (new_link || zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void **) &le)==FAILURE) { /* we don't */
list_entry new_le;
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
@@ -600,7 +626,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
* if it doesn't, open a new mssql link, add it to the resource list,
* and add a pointer to it with hashed_details as the key.
*/
- if (zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length + 1,(void **) &index_ptr)==SUCCESS) {
+ if (!new_link && zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length + 1,(void **) &index_ptr)==SUCCESS) {
int type,link;
void *ptr;
@@ -690,7 +716,7 @@ static int php_mssql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
return MS_SQL_G(default_link);
}
-/* {{{ proto int mssql_connect([string servername [, string username [, string password]]])
+/* {{{ proto int mssql_connect([string servername [, string username [, string password [, bool new_link]]])
Establishes a connection to a MS-SQL server */
PHP_FUNCTION(mssql_connect)
{
@@ -699,7 +725,7 @@ PHP_FUNCTION(mssql_connect)
/* }}} */
-/* {{{ proto int mssql_pconnect([string servername [, string username [, string password]]])
+/* {{{ proto int mssql_pconnect([string servername [, string username [, string password [, bool new_link]]]])
Establishes a persistent connection to a MS-SQL server */
PHP_FUNCTION(mssql_pconnect)
{
@@ -832,13 +858,15 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
break;
#ifdef SQLUNIQUE
case SQLUNIQUE: {
+#else
+ case 36: { /* FreeTDS hack */
+#endif
char *data = charcol(offset);
/* uniqueidentifier is a 16-byte binary number */
ZVAL_STRINGL(result, data, 16, 1);
}
break;
-#endif
case SQLVARBINARY:
case SQLBINARY:
case SQLIMAGE: {
@@ -863,11 +891,9 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
if ((column_type != SQLDATETIME && column_type != SQLDATETIM4) || MS_SQL_G(datetimeconvert)) {
switch (column_type) {
- case SQLDATETIM4 :
- res_length += 14;
- break;
case SQLDATETIME :
- res_length += 10;
+ case SQLDATETIM4 :
+ res_length += 20;
break;
case SQLMONEY :
case SQLMONEY4 :
@@ -875,6 +901,8 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
case SQLDECIMAL :
case SQLNUMERIC :
res_length += 5;
+ case 127 :
+ res_length += 20;
break;
}
@@ -933,11 +961,9 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
if ((column_type != SQLDATETIME && column_type != SQLDATETIM4) || MS_SQL_G(datetimeconvert)) {
switch (column_type) {
- case SQLDATETIM4 :
- res_length += 14;
- break;
case SQLDATETIME :
- res_length += 10;
+ case SQLDATETIM4 :
+ res_length += 20;
break;
case SQLMONEY :
case SQLMONEY4 :
@@ -945,6 +971,8 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
case SQLDECIMAL :
case SQLNUMERIC :
res_length += 5;
+ case 127 :
+ res_length += 20;
break;
}
@@ -989,34 +1017,39 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
if (statement->binds != NULL) { /* Maybe a non-parameter sp */
if (zend_hash_find(statement->binds, parameter, strlen(parameter), (void**)&bind)==SUCCESS) {
- switch (type) {
- case SQLBIT:
- case SQLINT1:
- case SQLINT2:
- case SQLINT4:
- convert_to_long_ex(&bind->zval);
- /* FIXME this works only on little endian machine !!! */
- Z_LVAL_P(bind->zval) = *((int *)(dbretdata(mssql_ptr->link,i)));
- break;
-
- case SQLFLT4:
- case SQLFLT8:
- case SQLFLTN:
- case SQLMONEY4:
- case SQLMONEY:
- case SQLMONEYN:
- convert_to_double_ex(&bind->zval);
- Z_DVAL_P(bind->zval) = *((double *)(dbretdata(mssql_ptr->link,i)));
- break;
-
- case SQLCHAR:
- case SQLVARCHAR:
- case SQLTEXT:
- convert_to_string_ex(&bind->zval);
- Z_STRLEN_P(bind->zval) = dbretlen(mssql_ptr->link,i);
- Z_STRVAL_P(bind->zval) = estrndup(dbretdata(mssql_ptr->link,i),Z_STRLEN_P(bind->zval));
- break;
- /* TODO binary */
+ if (!dbretlen(mssql_ptr->link,i)) {
+ ZVAL_NULL(bind->zval);
+ }
+ else {
+ switch (type) {
+ case SQLBIT:
+ case SQLINT1:
+ case SQLINT2:
+ case SQLINT4:
+ convert_to_long_ex(&bind->zval);
+ /* FIXME this works only on little endian machine !!! */
+ Z_LVAL_P(bind->zval) = *((int *)(dbretdata(mssql_ptr->link,i)));
+ break;
+
+ case SQLFLT4:
+ case SQLFLT8:
+ case SQLFLTN:
+ case SQLMONEY4:
+ case SQLMONEY:
+ case SQLMONEYN:
+ convert_to_double_ex(&bind->zval);
+ Z_DVAL_P(bind->zval) = *((double *)(dbretdata(mssql_ptr->link,i)));
+ break;
+
+ case SQLCHAR:
+ case SQLVARCHAR:
+ case SQLTEXT:
+ convert_to_string_ex(&bind->zval);
+ Z_STRLEN_P(bind->zval) = dbretlen(mssql_ptr->link,i);
+ Z_STRVAL_P(bind->zval) = estrndup(dbretdata(mssql_ptr->link,i),Z_STRLEN_P(bind->zval));
+ break;
+ /* TODO binary */
+ }
}
}
else {
@@ -1041,56 +1074,55 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue TSRMLS_DC)
{
int i, j = 0;
- int *column_types;
char computed_buf[16];
- column_types = (int *) safe_emalloc(sizeof(int), result->num_fields, 0);
- for (i=0; i<result->num_fields; i++) {
- char *source = NULL;
- char *fname = (char *)dbcolname(mssql_ptr->link,i+1);
-
- if (*fname) {
- result->fields[i].name = estrdup(fname);
- } else {
- if (j>0) {
- snprintf(computed_buf,16,"computed%d",j);
+ if (!result->have_fields) {
+ for (i=0; i<result->num_fields; i++) {
+ char *source = NULL;
+ char *fname = (char *)dbcolname(mssql_ptr->link,i+1);
+
+ if (*fname) {
+ result->fields[i].name = estrdup(fname);
} else {
- strcpy(computed_buf,"computed");
+ if (j>0) {
+ snprintf(computed_buf,16,"computed%d",j);
+ } else {
+ strcpy(computed_buf,"computed");
+ }
+ result->fields[i].name = estrdup(computed_buf);
+ j++;
+ }
+ result->fields[i].max_length = dbcollen(mssql_ptr->link,i+1);
+ source = (char *)dbcolsource(mssql_ptr->link,i+1);
+ if (source) {
+ result->fields[i].column_source = estrdup(source);
+ }
+ else {
+ result->fields[i].column_source = STR_EMPTY_ALLOC();
+ }
+
+ result->fields[i].type = coltype(i+1);
+ /* set numeric flag */
+ switch (result->fields[i].type) {
+ case SQLINT1:
+ case SQLINT2:
+ case SQLINT4:
+ case SQLINTN:
+ case SQLFLT4:
+ case SQLFLT8:
+ case SQLNUMERIC:
+ case SQLDECIMAL:
+ result->fields[i].numeric = 1;
+ break;
+ case SQLCHAR:
+ case SQLVARCHAR:
+ case SQLTEXT:
+ default:
+ result->fields[i].numeric = 0;
+ break;
}
- result->fields[i].name = estrdup(computed_buf);
- j++;
- }
- result->fields[i].max_length = dbcollen(mssql_ptr->link,i+1);
- source = (char *)dbcolsource(mssql_ptr->link,i+1);
- if (source) {
- result->fields[i].column_source = estrdup(source);
- }
- else {
- result->fields[i].column_source = empty_string;
- }
-
- column_types[i] = coltype(i+1);
-
- Z_TYPE(result->fields[i]) = column_types[i];
- /* set numeric flag */
- switch (column_types[i]) {
- case SQLINT1:
- case SQLINT2:
- case SQLINT4:
- case SQLINTN:
- case SQLFLT4:
- case SQLFLT8:
- case SQLNUMERIC:
- case SQLDECIMAL:
- result->fields[i].numeric = 1;
- break;
- case SQLCHAR:
- case SQLVARCHAR:
- case SQLTEXT:
- default:
- result->fields[i].numeric = 0;
- break;
}
+ result->have_fields = 1;
}
i=0;
@@ -1105,7 +1137,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r
result->data[i] = (zval *) safe_emalloc(sizeof(zval), result->num_fields, 0);
for (j=0; j<result->num_fields; j++) {
INIT_ZVAL(result->data[i][j]);
- MS_SQL_G(get_column_content(mssql_ptr, j+1, &result->data[i][j], column_types[j] TSRMLS_CC));
+ MS_SQL_G(get_column_content(mssql_ptr, j+1, &result->data[i][j], result->fields[j].type TSRMLS_CC));
}
if (i<result->batchsize || result->batchsize==0) {
i++;
@@ -1116,7 +1148,6 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r
break;
result->lastresult = retvalue;
}
- efree(column_types);
if (result->statement && (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS)) {
_mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC);
}
@@ -1224,9 +1255,10 @@ PHP_FUNCTION(mssql_query)
result->blocks_initialized = 0;
result->mssql_ptr = mssql_ptr;
result->cur_field=result->cur_row=result->num_rows=0;
+ result->have_fields = 0;
- result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0);
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
+ result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0);
+ result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
ZEND_REGISTER_RESOURCE(return_value, result, le_result);
}
@@ -1285,7 +1317,7 @@ PHP_FUNCTION(mssql_get_last_message)
RETURN_STRING(MS_SQL_G(server_message),1);
}
else {
- RETURN_STRING(empty_string,1);
+ RETURN_STRING("",1);
}
}
@@ -1833,6 +1865,11 @@ PHP_FUNCTION(mssql_next_result)
mssql_ptr = result->mssql_ptr;
retvalue = dbresults(mssql_ptr->link);
+
+ while (dbnumcols(mssql_ptr->link) <= 0 && retvalue == SUCCEED) {
+ retvalue = dbresults(mssql_ptr->link);
+ }
+
if (retvalue == FAIL) {
RETURN_FALSE;
}
@@ -1850,6 +1887,7 @@ PHP_FUNCTION(mssql_next_result)
result->num_fields = dbnumcols(mssql_ptr->link);
result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0);
+ result->have_fields = 0;
result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
RETURN_TRUE;
}
@@ -2003,7 +2041,9 @@ PHP_FUNCTION(mssql_bind)
type=Z_LVAL_PP(yytype);
is_output=Z_LVAL_PP(yyis_output);
is_null=Z_LVAL_PP(yyis_null);
- maxlen=Z_LVAL_PP(yymaxlen);
+ if (is_output) {
+ maxlen=Z_LVAL_PP(yymaxlen);
+ }
}
break;
@@ -2076,17 +2116,22 @@ PHP_FUNCTION(mssql_bind)
zend_hash_init(statement->binds, 13, NULL, _mssql_bind_hash_dtor, 0);
}
- memset((void*)&bind,0,sizeof(mssql_bind));
- zend_hash_add(statement->binds,Z_STRVAL_PP(param_name),Z_STRLEN_PP(param_name),&bind,sizeof(mssql_bind),(void **)&bindp);
- if( NULL == bindp ) RETURN_FALSE;
- bindp->zval=*var;
- zval_add_ref(var);
-
- /* no call to dbrpcparam if RETVAL */
- if ( strcmp("RETVAL",Z_STRVAL_PP(param_name))!=0 ) {
- if (dbrpcparam(mssql_ptr->link, Z_STRVAL_PP(param_name), (BYTE)status, type, maxlen, datalen, (LPBYTE)value)==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set parameter");
- RETURN_FALSE;
+ if (zend_hash_exists(statement->binds, Z_STRVAL_PP(param_name), Z_STRLEN_PP(param_name))) {
+ RETURN_FALSE;
+ }
+ else {
+ memset((void*)&bind,0,sizeof(mssql_bind));
+ zend_hash_add(statement->binds, Z_STRVAL_PP(param_name), Z_STRLEN_PP(param_name), &bind, sizeof(mssql_bind), (void **)&bindp);
+ if( NULL == bindp ) RETURN_FALSE;
+ bindp->zval=*var;
+ zval_add_ref(var);
+
+ /* no call to dbrpcparam if RETVAL */
+ if ( strcmp("RETVAL",Z_STRVAL_PP(param_name))!=0 ) {
+ if (dbrpcparam(mssql_ptr->link, Z_STRVAL_PP(param_name), (BYTE)status, type, maxlen, datalen, (LPBYTE)value)==FAIL) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set parameter");
+ RETURN_FALSE;
+ }
}
}
@@ -2157,6 +2202,7 @@ PHP_FUNCTION(mssql_execute)
result->mssql_ptr = mssql_ptr;
result->cur_field=result->cur_row=result->num_rows=0;
result->num_fields = num_fields;
+ result->have_fields = 0;
result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), num_fields, 0);
result->statement = statement;
diff --git a/ext/mssql/php_mssql.h b/ext/mssql/php_mssql.h
index 82cf4fcec..088dd329f 100644
--- a/ext/mssql/php_mssql.h
+++ b/ext/mssql/php_mssql.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
*/
-/* $Id: php_mssql.h,v 1.38 2004/06/07 18:03:51 fmk Exp $ */
+/* $Id: php_mssql.h,v 1.42 2005/08/08 21:32:18 fmk Exp $ */
#ifndef PHP_MSSQL_H
#define PHP_MSSQL_H
@@ -31,13 +31,12 @@
#define PHP_MSSQL_API
#endif
-
-#define MSSQL_VERSION "7.0"
-#include "sqlfront.h"
-#include "sqldb.h"
+#include <sqlfront.h>
+#include <sqldb.h>
typedef short TDS_SHORT;
-#if HAVE_FREETDS
+#ifdef HAVE_FREETDS
+#define MSSQL_VERSION "FreeTDS"
#define SQLTEXT SYBTEXT
#define SQLCHAR SYBCHAR
#define SQLVARCHAR SYBVARCHAR
@@ -72,6 +71,7 @@ typedef short TDS_SHORT;
typedef unsigned char *LPBYTE;
typedef float DBFLT4;
#else
+#define MSSQL_VERSION "7.0"
#define DBERRHANDLE(a, b) dbprocerrhandle(a, b)
#define DBMSGHANDLE(a, b) dbprocmsghandle(a, b)
#define EHANDLEFUNC DBERRHANDLE_PROC
@@ -188,7 +188,7 @@ typedef struct mssql_result {
int lastresult;
int blocks_initialized;
int cur_row,cur_field;
- int num_rows,num_fields;
+ int num_rows,num_fields,have_fields;
} mssql_result;
diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4
index d167b5c22..4eed751d9 100644
--- a/ext/mysql/config.m4
+++ b/ext/mysql/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.61.2.3 2005/06/20 13:46:02 sniper Exp $
+dnl $Id: config.m4,v 1.67.2.1 2005/09/04 04:51:23 wez Exp $
dnl
AC_DEFUN([MYSQL_LIB_CHK], [
- str="$MYSQL_DIR/$1/lib$MY_LIBNAME.*"
+ str="$MYSQL_DIR/$1/lib$MYSQL_LIBNAME.*"
for j in `echo $str`; do
if test -r $j; then
MYSQL_LIB_DIR=$MYSQL_DIR/$1
@@ -40,15 +40,15 @@ AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [
PHP_ARG_WITH(mysql, for MySQL support,
-[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory.])
+[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory])
PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket,
[ --with-mysql-sock[=DIR] MySQL: Location of the MySQL unix socket pointer.
- If unspecified, the default locations are searched.], no, no)
+ If unspecified, the default locations are searched], no, no)
if test -z "$PHP_ZLIB_DIR"; then
PHP_ARG_WITH(zlib-dir, for the location of libz,
- [ --with-zlib-dir[=DIR] MySQL: Set the path to libz install prefix.], no, no)
+ [ --with-zlib-dir[=DIR] MySQL: Set the path to libz install prefix], no, no)
fi
@@ -66,6 +66,9 @@ if test "$PHP_MYSQL" != "no"; then
AC_MSG_RESULT([no])
fi
+ MYSQL_DIR=
+ MYSQL_INC_DIR=
+
for i in $PHP_MYSQL /usr/local /usr; do
if test -r $i/include/mysql/mysql.h; then
MYSQL_DIR=$i
@@ -80,38 +83,43 @@ if test "$PHP_MYSQL" != "no"; then
if test -z "$MYSQL_DIR"; then
AC_MSG_ERROR([Cannot find MySQL header files under $PHP_MYSQL.
-Note that the MySQL client library is not bundled anymore.])
+Note that the MySQL client library is not bundled anymore!])
fi
- MY_LIBNAME=mysqlclient
+ MYSQL_LIBNAME=mysqlclient
case $host_alias in
*netware*[)]
- MY_LIBNAME=mysql
+ MYSQL_LIBNAME=mysql
;;
esac
- for i in lib lib/mysql lib64 lib64/mysql; do
+ dnl for compat with PHP 4 build system
+ if test -z "$PHP_LIBDIR"; then
+ PHP_LIBDIR=lib
+ fi
+
+ for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do
MYSQL_LIB_CHK($i)
done
if test -z "$MYSQL_LIB_DIR"; then
- AC_MSG_ERROR([Cannot find libmysqlclient under $MYSQL_DIR.
-Note that the MySQL client library is not bundled anymore.])
+ AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR.
+Note that the MySQL client library is not bundled anymore!])
fi
- PHP_CHECK_LIBRARY($MY_LIBNAME, mysql_close, [ ],
+ PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_close, [ ],
[
if test "$PHP_ZLIB_DIR" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, MYSQL_SHARED_LIBADD)
- PHP_CHECK_LIBRARY($MY_LIBNAME, mysql_error, [], [
+ PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_error, [], [
AC_MSG_ERROR([mysql configure failed. Please check config.log for more information.])
], [
- -L$PHP_ZLIB_DIR/lib -L$MYSQL_LIB_DIR
+ -L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$MYSQL_LIB_DIR
])
- MYSQL_LIBS="-L$PHP_ZLIB_DIR/lib -lz"
+ MYSQL_LIBS="-L$PHP_ZLIB_DIR/$PHP_LIBDIR -lz"
else
PHP_ADD_LIBRARY(z,, MYSQL_SHARED_LIBADD)
- PHP_CHECK_LIBRARY($MY_LIBNAME, mysql_errno, [], [
+ PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_errno, [], [
AC_MSG_ERROR([Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.])
], [
-L$MYSQL_LIB_DIR
@@ -122,13 +130,13 @@ Note that the MySQL client library is not bundled anymore.])
-L$MYSQL_LIB_DIR
])
- PHP_ADD_LIBRARY_WITH_PATH($MY_LIBNAME, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH($MYSQL_LIBNAME, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD)
PHP_ADD_INCLUDE($MYSQL_INC_DIR)
PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared)
MYSQL_MODULE_TYPE=external
- MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MY_LIBNAME $MYSQL_LIBS"
+ MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MYSQL_LIBNAME $MYSQL_LIBS"
MYSQL_INCLUDE=-I$MYSQL_INC_DIR
PHP_SUBST(MYSQL_SHARED_LIBADD)
diff --git a/ext/mysql/config.w32 b/ext/mysql/config.w32
index 9c4dc4522..267f2c3d1 100644
--- a/ext/mysql/config.w32
+++ b/ext/mysql/config.w32
@@ -1,11 +1,12 @@
-// $Id: config.w32,v 1.1 2003/12/05 06:09:29 sebastian Exp $
+// $Id: config.w32,v 1.2 2005/06/05 19:25:00 wez Exp $
// vim:ft=javascript
ARG_WITH("mysql", "MySQL support", "no");
if (PHP_MYSQL != "no") {
if (CHECK_LIB("libmysql.lib", "mysql", PHP_MYSQL) &&
- CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) {
+ CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL",
+ PHP_MYSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) {
EXTENSION("mysql", "php_mysql.c");
AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library');
} else {
diff --git a/ext/mysql/package.xml b/ext/mysql/package.xml
index f1e0c2c1a..79fd6ba90 100644
--- a/ext/mysql/package.xml
+++ b/ext/mysql/package.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE package SYSTEM "../pear/package.dtd">
<package>
- <name>mysqli</name>
+ <name>mysql</name>
<summary>MySQL database access functions</summary>
<maintainers>
<maintainer>
@@ -28,11 +28,12 @@ These functions allow you to access MySQL database servers.
</description>
<license>PHP</license>
<release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
+ <state>stable</state>
+ <version>1.0</version>
+ <date>2005-09-04</date>
<notes>
-package.xml added to support intallation using pear installer
+This is the MySQL driver, taken from the PHP 5.1 release.
+It can also be built against PHP 4.
</notes>
<configureoptions>
<configureoption name="with-mysql" default="autodetect" prompt="mysql installation dir?"/>
@@ -54,7 +55,7 @@ package.xml added to support intallation using pear installer
<file role="test" name="tests/skipif.inc"/>
</filelist>
<deps>
- <dep type="php" rel="ge" version="5" />
+ <dep type="php" rel="ge" version="4" />
</deps>
</release>
</package>
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 2fb926c1c..163d3c514 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mysql.c,v 1.209.2.2 2005/04/07 22:23:28 sniper Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.2 2005/09/04 17:10:56 wez Exp $ */
/* TODO:
*
@@ -33,7 +33,14 @@
#include "php_globals.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
-#include "zend_exceptions.h"
+
+#ifdef ZEND_ENGINE_2
+# include "zend_exceptions.h"
+#else
+ /* PHP 4 compat */
+# define OnUpdateLong OnUpdateInt
+# define E_STRICT E_NOTICE
+#endif
#if HAVE_MYSQL
@@ -211,7 +218,7 @@ zend_module_entry mysql_module_entry = {
PHP_RINIT(mysql),
PHP_RSHUTDOWN(mysql),
PHP_MINFO(mysql),
- NO_VERSION_YET,
+ "1.0",
STANDARD_MODULE_PROPERTIES
};
/* }}} */
@@ -1904,6 +1911,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
zval *res, *ctor_params = NULL;
zend_class_entry *ce;
+#ifdef ZEND_ENGINE_2
if (into_object) {
char *class_name;
int class_name_len;
@@ -1922,7 +1930,9 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
return;
}
result_type = MYSQL_ASSOC;
- } else {
+ } else
+#endif
+ {
if (ZEND_NUM_ARGS() > expected_args) {
WRONG_PARAM_COUNT;
}
@@ -1997,6 +2007,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
}
}
+#ifdef ZEND_ENGINE_2
if (into_object) {
zval dataset = *return_value;
zend_fcall_info fci;
@@ -2060,6 +2071,8 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
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);
}
}
+#endif
+
}
/* }}} */
@@ -2248,9 +2261,9 @@ PHP_FUNCTION(mysql_fetch_field)
}
object_init(return_value);
- add_property_string(return_value, "name",(mysql_field->name?mysql_field->name:empty_string), 1);
- add_property_string(return_value, "table",(mysql_field->table?mysql_field->table:empty_string), 1);
- add_property_string(return_value, "def",(mysql_field->def?mysql_field->def:empty_string), 1);
+ add_property_string(return_value, "name",(mysql_field->name?mysql_field->name:""), 1);
+ add_property_string(return_value, "table",(mysql_field->table?mysql_field->table:""), 1);
+ add_property_string(return_value, "def",(mysql_field->def?mysql_field->def:""), 1);
add_property_long(return_value, "max_length", mysql_field->max_length);
add_property_long(return_value, "not_null", IS_NOT_NULL(mysql_field->flags)?1:0);
add_property_long(return_value, "primary_key", IS_PRI_KEY(mysql_field->flags)?1:0);
diff --git a/ext/mysql/php_mysql.h b/ext/mysql/php_mysql.h
index 02984e227..739cff7b1 100644
--- a/ext/mysql/php_mysql.h
+++ b/ext/mysql/php_mysql.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
*/
-/* $Id: php_mysql.h,v 1.36 2004/01/08 17:32:29 sniper Exp $ */
+/* $Id: php_mysql.h,v 1.37 2005/08/03 14:07:30 sniper Exp $ */
#ifndef PHP_MYSQL_H
#define PHP_MYSQL_H
diff --git a/ext/mysql/tests/001.phpt b/ext/mysql/tests/001.phpt
index 5d36462ba..8a7c9d22c 100755
--- a/ext/mysql/tests/001.phpt
+++ b/ext/mysql/tests/001.phpt
@@ -19,7 +19,7 @@ $test .= ($db) ? '1' : '0';
mysql_close($db);
/*** test mysql_connect localhost:port ***/
-$db = mysql_connect($host, $user, $passwd, '', 3306);
+$db = mysql_connect("{$host}:3306", $user, $passwd, '');
$test .= ($db) ? '1' : '0';
mysql_close($db);
diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4
index 1d3f07bdb..bfb978bac 100644
--- a/ext/mysqli/config.m4
+++ b/ext/mysqli/config.m4
@@ -1,19 +1,20 @@
dnl
-dnl $Id: config.m4,v 1.17.2.2 2005/02/05 11:02:10 georg Exp $
+dnl $Id: config.m4,v 1.22 2005/06/07 12:39:02 sniper Exp $
dnl config.m4 for extension mysqli
PHP_ARG_WITH(mysqli, for MySQLi support,
[ --with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname
- to mysql_config.])
+ to mysql_config])
PHP_ARG_ENABLE(embedded_mysqli, whether to enable embedded MySQLi support,
-[ --enable-embedded-mysqli MYSQLi: Enable embedded support.], no, no)
+[ --enable-embedded-mysqli MYSQLi: Enable embedded support], no, no)
if test "$PHP_MYSQLI" != "no"; then
- if test "$PHP_MYSQL" = "yes"; then
- AC_MSG_ERROR([--with-mysql (using bundled libs) can not be used together with --with-mysqli.])
- fi
+dnl there are no mysql libs currently bundled with PHP.. --Jani
+dnl if test "$PHP_MYSQL" = "yes"; then
+dnl AC_MSG_ERROR([--with-mysql (using bundled libs) can not be used together with --with-mysqli.])
+dnl fi
if test "$PHP_MYSQLI" = "yes"; then
MYSQL_CONFIG=`$php_shtool path mysql_config`
@@ -54,6 +55,6 @@ if test "$PHP_MYSQLI" != "no"; then
$MYSQLI_LIBLINE
])
- PHP_NEW_EXTENSION(mysqli, mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c mysqli_fe.c mysqli_report.c mysqli_repl.c, $ext_shared)
+ PHP_NEW_EXTENSION(mysqli, mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c mysqli_fe.c mysqli_report.c mysqli_repl.c mysqli_driver.c mysqli_warning.c mysqli_exception.c mysqli_embedded.c, $ext_shared)
PHP_SUBST(MYSQLI_SHARED_LIBADD)
fi
diff --git a/ext/mysqli/config.w32 b/ext/mysqli/config.w32
index 8fd0d7483..9b52b4166 100644
--- a/ext/mysqli/config.w32
+++ b/ext/mysqli/config.w32
@@ -1,12 +1,12 @@
-// $Id: config.w32,v 1.4.2.1 2004/11/04 02:42:14 edink Exp $
+// $Id: config.w32,v 1.7 2005/06/05 19:25:01 wez Exp $
// vim:ft=javascript
ARG_WITH("mysqli", "MySQLi support", "no");
if (PHP_MYSQLI != "no") {
if (CHECK_LIB("libmysql.lib", "mysqli", PHP_MYSQLI) &&
- CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQLI)) {
- EXTENSION("mysqli", "mysqli.c mysqli_api.c mysqli_fe.c mysqli_nonapi.c mysqli_prop.c mysqli_report.c mysqli_repl.c");
+ CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_MYSQLI + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQLI)) {
+ EXTENSION("mysqli", "mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c mysqli_fe.c mysqli_report.c mysqli_repl.c mysqli_driver.c mysqli_warning.c mysqli_exception.c mysqli_embedded.c");
AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
} else {
WARNING("mysqli not enabled; libraries and headers not found");
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 71a0477dd..c09207c13 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli.c,v 1.43.2.17 2005/06/27 18:22:00 tony2001 Exp $
+ $Id: mysqli.c,v 1.72.2.5 2005/11/15 14:28:40 dmitry Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -37,9 +37,12 @@
ZEND_DECLARE_MODULE_GLOBALS(mysqli)
static zend_object_handlers mysqli_object_handlers;
static HashTable classes;
+static HashTable mysqli_driver_properties;
static HashTable mysqli_link_properties;
static HashTable mysqli_result_properties;
static HashTable mysqli_stmt_properties;
+static HashTable mysqli_warning_properties;
+
extern void php_mysqli_connect(INTERNAL_FUNCTION_PARAMETERS);
typedef int (*mysqli_read_t)(mysqli_object *obj, zval **retval TSRMLS_DC);
@@ -130,32 +133,36 @@ static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
static void mysqli_objects_destroy_object(void *object, zend_object_handle handle TSRMLS_DC)
{
mysqli_object *intern = (mysqli_object *)object;
- MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
+ MYSQLI_RESOURCE *my_res;
zend_objects_destroy_object(object, handle TSRMLS_CC);
+
+ my_res = (MYSQLI_RESOURCE *)intern->ptr;
/* link object */
if (instanceof_function(intern->zo.ce, mysqli_link_class_entry TSRMLS_CC)) {
if (my_res && my_res->ptr) {
MY_MYSQL *mysql = (MY_MYSQL *)my_res->ptr;
-
if (mysql->mysql) {
mysql_close(mysql->mysql);
}
-
php_clear_mysql(mysql);
efree(mysql);
-
my_res->ptr = NULL;
}
- } else if (intern->zo.ce == mysqli_stmt_class_entry) { /* stmt object */
+ } else if (instanceof_function(intern->zo.ce, mysqli_stmt_class_entry TSRMLS_CC)) { /* stmt object */
if (my_res && my_res->ptr) {
- php_clear_stmt_bind((MY_STMT *)my_res->ptr);
+ MY_STMT *stmt = (MY_STMT *)my_res->ptr;
+ php_clear_stmt_bind(stmt);
}
- } else if (intern->zo.ce == mysqli_result_class_entry) { /* result object */
+ } else if (instanceof_function(intern->zo.ce, mysqli_result_class_entry TSRMLS_CC)) { /* stmt 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)) { /* stmt object */
+ if (my_res && my_res->ptr) {
+ php_clear_warnings((MYSQLI_WARNING *)my_res->info);
+ }
}
intern->ptr = NULL;
my_efree(my_res);
@@ -202,6 +209,7 @@ zval *mysqli_read_property(zval *object, zval *member, int type TSRMLS_DC)
if (obj->prop_handler != NULL) {
ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd);
}
+
if (ret == SUCCESS) {
/* check if mysqli object is still valid */
@@ -294,23 +302,36 @@ static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC)
{
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC);
- if (obj->zo.ce != mysqli_link_class_entry) {
+ if (obj->zo.ce != mysqli_link_class_entry && obj->zo.ce != mysqli_stmt_class_entry &&
+ obj->zo.ce != mysqli_result_class_entry && obj->zo.ce != mysqli_driver_class_entry &&
+ obj->zo.ce != mysqli_warning_class_entry) {
return obj->zo.ce->constructor;
} else {
static zend_internal_function f;
- f.function_name = mysqli_link_class_entry->name;
- f.scope = mysqli_link_class_entry;
+ f.function_name = obj->zo.ce->name;
+ f.scope = obj->zo.ce;
f.arg_info = NULL;
f.num_args = 0;
f.fn_flags = 0;
f.type = ZEND_INTERNAL_FUNCTION;
- f.handler = ZEND_FN(mysqli_connect);
+ if (obj->zo.ce == mysqli_link_class_entry) {
+ f.handler = ZEND_FN(mysqli_connect);
+ } else if (obj->zo.ce == mysqli_stmt_class_entry) {
+ f.handler = ZEND_FN(mysqli_stmt_construct);
+ } else if (obj->zo.ce == mysqli_result_class_entry) {
+ f.handler = ZEND_FN(mysqli_result_construct);
+ } else if (obj->zo.ce == mysqli_driver_class_entry) {
+ f.handler = ZEND_FN(mysqli_driver_construct);
+ } else if (obj->zo.ce == mysqli_warning_class_entry) {
+ f.handler = ZEND_FN(mysqli_warning___construct);
+ }
return (union _zend_function*)&f;
}
}
+
/* {{{ mysqli_objects_new
*/
PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_type TSRMLS_DC)
@@ -323,8 +344,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_
intern = emalloc(sizeof(mysqli_object));
memset(intern, 0, sizeof(mysqli_object));
intern->zo.ce = class_type;
- intern->zo.in_get = 0;
- intern->zo.in_set = 0;
+ intern->zo.guards = NULL;
intern->ptr = NULL;
intern->valid = 0;
intern->prop_handler = NULL;
@@ -352,19 +372,15 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_
/* {{{ mysqli_module_entry
*/
zend_module_entry mysqli_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
-#endif
"mysqli",
mysqli_functions,
PHP_MINIT(mysqli),
PHP_MSHUTDOWN(mysqli),
- PHP_RINIT(mysqli), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(mysqli), /* Replace with NULL if there's nothing to do at request end */
+ PHP_RINIT(mysqli),
+ PHP_RSHUTDOWN(mysqli),
PHP_MINFO(mysqli),
-#if ZEND_MODULE_API_NO >= 20010901
"0.1", /* Replace with version number for your extension */
-#endif
STANDARD_MODULE_PROPERTIES
};
/* }}} */
@@ -401,6 +417,11 @@ static void php_mysqli_init_globals(zend_mysqli_globals *mysqli_globals)
mysqli_globals->reconnect = 0;
mysqli_globals->report_mode = 0;
mysqli_globals->report_ht = 0;
+#ifdef HAVE_EMBEDDED_MYSQLI
+ mysqli_globals->embedded = 1;
+#else
+ mysqli_globals->embedded = 0;
+#endif
}
/* }}} */
@@ -408,7 +429,7 @@ static void php_mysqli_init_globals(zend_mysqli_globals *mysqli_globals)
*/
PHP_MINIT_FUNCTION(mysqli)
{
- zend_class_entry *ce;
+ 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);
@@ -423,13 +444,36 @@ PHP_MINIT_FUNCTION(mysqli)
zend_hash_init(&classes, 0, NULL, NULL, 1);
- REGISTER_MYSQLI_CLASS_ENTRY("mysqli", mysqli_link_class_entry, mysqli_link_methods);
+ INIT_CLASS_ENTRY(cex, "mysqli_sql_exception", mysqli_exception_methods);
+#ifdef HAVE_SPL
+ mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException, NULL TSRMLS_CC);
+#else
+ mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_get_default(), NULL TSRMLS_CC);
+#endif
+ mysqli_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
+ zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC);
+ zend_declare_property_string(mysqli_exception_class_entry, "sqlstate", sizeof("sqlstate")-1, "00000", ZEND_ACC_PROTECTED TSRMLS_CC);
+
+ REGISTER_MYSQLI_CLASS_ENTRY("mysqli_driver", mysqli_driver_class_entry, mysqli_driver_methods);
+ ce = mysqli_driver_class_entry;
+ zend_hash_init(&mysqli_driver_properties, 0, NULL, NULL, 1);
+ MYSQLI_ADD_PROPERTIES(&mysqli_driver_properties, mysqli_driver_property_entries);
+ zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_driver_properties, sizeof(mysqli_driver_properties), NULL);
+ ce->ce_flags |= ZEND_ACC_FINAL_CLASS;
+ REGISTER_MYSQLI_CLASS_ENTRY("mysqli", mysqli_link_class_entry, mysqli_link_methods);
ce = mysqli_link_class_entry;
zend_hash_init(&mysqli_link_properties, 0, NULL, NULL, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_link_properties, mysqli_link_property_entries);
zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_link_properties, sizeof(mysqli_link_properties), NULL);
+ REGISTER_MYSQLI_CLASS_ENTRY("mysqli_warning", mysqli_warning_class_entry, mysqli_warning_methods);
+ ce = mysqli_warning_class_entry;
+ ce->ce_flags |= ZEND_ACC_FINAL_CLASS | ZEND_ACC_PROTECTED;
+ zend_hash_init(&mysqli_warning_properties, 0, NULL, NULL, 1);
+ MYSQLI_ADD_PROPERTIES(&mysqli_warning_properties, mysqli_warning_property_entries);
+ zend_hash_add(&classes, ce->name, ce->name_length+1, &mysqli_warning_properties, sizeof(mysqli_warning_properties), NULL);
+
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_result", mysqli_result_class_entry, mysqli_result_methods);
ce = mysqli_result_class_entry;
zend_hash_init(&mysqli_result_properties, 0, NULL, NULL, 1);
@@ -476,6 +520,10 @@ PHP_MINIT_FUNCTION(mysqli)
REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_FOR_UPDATE", CURSOR_TYPE_FOR_UPDATE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_SCROLLABLE", CURSOR_TYPE_SCROLLABLE, CONST_CS | CONST_PERSISTENT);
#endif
+
+#if MYSQL_VERSION_ID > 50007
+ REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_PREFETCH_ROWS", STMT_ATTR_PREFETCH_ROWS, CONST_CS | CONST_PERSISTENT);
+#endif
/* column information */
REGISTER_LONG_CONSTANT("MYSQLI_NOT_NULL_FLAG", NOT_NULL_FLAG, CONST_CS | CONST_PERSISTENT);
@@ -524,7 +572,7 @@ PHP_MINIT_FUNCTION(mysqli)
REGISTER_LONG_CONSTANT("MYSQLI_RPL_SLAVE", MYSQL_RPL_SLAVE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_RPL_ADMIN", MYSQL_RPL_ADMIN, CONST_CS | CONST_PERSISTENT);
- /* bind blob support */
+ /* bind support */
REGISTER_LONG_CONSTANT("MYSQLI_NO_DATA", MYSQL_NO_DATA, CONST_CS | CONST_PERSISTENT);
#ifdef MYSQL_DATA_TRUNCATED
REGISTER_LONG_CONSTANT("MYSQLI_DATA_TRUNCATED", MYSQL_DATA_TRUNCATED, CONST_CS | CONST_PERSISTENT);
@@ -544,9 +592,11 @@ PHP_MINIT_FUNCTION(mysqli)
*/
PHP_MSHUTDOWN_FUNCTION(mysqli)
{
- zend_hash_destroy(&mysqli_link_properties);
+ zend_hash_destroy(&mysqli_driver_properties);
zend_hash_destroy(&mysqli_result_properties);
zend_hash_destroy(&mysqli_stmt_properties);
+ zend_hash_destroy(&mysqli_warning_properties);
+ zend_hash_destroy(&mysqli_link_properties);
zend_hash_destroy(&classes);
UNREGISTER_INI_ENTRIES();
@@ -592,6 +642,109 @@ PHP_MINFO_FUNCTION(mysqli)
}
/* }}} */
+/* {{{ mixed mysqli_stmt_construct()
+constructor for statement object.
+Parameters:
+ object -> mysqli_init
+ object, query -> mysqli_prepare
+*/
+ZEND_FUNCTION(mysqli_stmt_construct)
+{
+ MY_MYSQL *mysql;
+ zval *mysql_link;
+ MY_STMT *stmt;
+ MYSQLI_RESOURCE *mysqli_resource;
+ char *statement;
+ int stmt_len;
+
+ switch (ZEND_NUM_ARGS())
+ {
+ case 1: /* mysql_stmt_init */
+ if (zend_parse_parameters(1 TSRMLS_CC, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
+ return;
+ }
+ MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
+
+ stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
+
+ stmt->stmt = mysql_stmt_init(mysql->mysql);
+ break;
+ case 2:
+ if (zend_parse_parameters(2 TSRMLS_CC, "Os", &mysql_link, mysqli_link_class_entry, &statement, &stmt_len)==FAILURE) {
+ return;
+ }
+ MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
+
+ stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
+
+ if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) {
+ mysql_stmt_prepare(stmt->stmt, statement, stmt_len);
+ }
+ break;
+ default:
+ WRONG_PARAM_COUNT;
+ break;
+ }
+
+ if (!stmt->stmt) {
+ efree(stmt);
+ RETURN_FALSE;
+ }
+
+ mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
+ mysqli_resource->ptr = (void *)stmt;
+
+ ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource;
+ ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->valid = 1;
+}
+/* }}} */
+
+/* {{{ mixed mysqli_result_construct()
+constructor for result object.
+Parameters:
+ object [, mode] -> mysqli_store/use_result
+*/
+ZEND_FUNCTION(mysqli_result_construct)
+{
+ MY_MYSQL *mysql;
+ MYSQL_RES *result;
+ zval *mysql_link;
+ MYSQLI_RESOURCE *mysqli_resource;
+ long resmode = MYSQLI_STORE_RESULT;
+
+ switch (ZEND_NUM_ARGS()) {
+ case 1:
+ if (zend_parse_parameters(1 TSRMLS_CC, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
+ return;
+ }
+ break;
+ case 2:
+ if (zend_parse_parameters(2 TSRMLS_CC, "Ol", &mysql_link, mysqli_link_class_entry, &resmode)==FAILURE) {
+ return;
+ }
+ break;
+ default:
+ WRONG_PARAM_COUNT;
+ }
+
+ MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
+
+ result = (resmode == MYSQLI_STORE_RESULT) ? mysql_store_result(mysql->mysql) :
+ mysql_use_result(mysql->mysql);
+
+ if (!result) {
+ RETURN_FALSE;
+ }
+
+ mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
+ mysqli_resource->ptr = (void *)result;
+
+ ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource;
+ ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->valid = 1;
+
+}
+/* }}} */
+
/* {{{ php_mysqli_fetch_into_hash
*/
void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags, int into_object)
@@ -636,7 +789,6 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
}
}
}
-
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result");
if ((fetchtype & MYSQLI_BOTH) == 0) {
@@ -838,6 +990,7 @@ int php_local_infile_init(void **ptr, const char *filename, void *userdata)
}
/* }}} */
+/* {{{ int php_local_infile_read */
int php_local_infile_read(void *ptr, char *buf, uint buf_len)
{
mysqli_local_infile *data;
@@ -911,6 +1064,7 @@ int php_local_infile_read(void *ptr, char *buf, uint buf_len)
efree(fp);
return rc;
}
+/* }}} */
/* {{{ php_local_infile_error
*/
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index da27a44b2..f43722f79 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_api.c,v 1.87.2.22 2005/06/17 16:37:07 georg Exp $
+ $Id: mysqli_api.c,v 1.118.2.6 2005/11/08 13:50:50 andrey Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -153,7 +153,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
break;
case 'b': /* Blob (send data) */
- bind[ofs].buffer_type = MYSQL_TYPE_VAR_STRING;
+ bind[ofs].buffer_type = MYSQL_TYPE_LONG_BLOB;
bind[ofs].is_null = 0;
bind[ofs].length = 0;
break;
@@ -186,7 +186,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
stmt->param.var_cnt = num_vars;
stmt->param.vars = (zval **)safe_emalloc(num_vars, sizeof(zval), 0);
for (i = 0; i < num_vars; i++) {
- if (bind[i].buffer_type != MYSQLI_BIND_SEND_DATA) {
+ if (bind[i].buffer_type != MYSQL_TYPE_LONG_BLOB) {
ZVAL_ADDREF(*args[i+start]);
stmt->param.vars[i] = *args[i+start];
} else {
@@ -242,7 +242,6 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
WRONG_PARAM_COUNT;
}
-
var_cnt = argc - start;
if (var_cnt != mysql_stmt_field_count(stmt->stmt)) {
@@ -279,6 +278,15 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
bind[ofs].is_null = &stmt->result.is_null[ofs];
break;
+ case MYSQL_TYPE_NULL:
+ stmt->result.buf[ofs].type = IS_NULL;
+ stmt->result.buf[ofs].buflen = 0;
+ bind[ofs].buffer_type = MYSQL_TYPE_NULL;
+ bind[ofs].buffer = 0;
+ bind[ofs].is_null = &stmt->result.is_null[ofs];
+ bind[ofs].buffer_length = 0;
+ break;
+
case MYSQL_TYPE_SHORT:
case MYSQL_TYPE_TINY:
case MYSQL_TYPE_LONG:
@@ -302,14 +310,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
bind[ofs].is_null = &stmt->result.is_null[ofs];
bind[ofs].buffer_length = stmt->result.buf[ofs].buflen;
break;
- case MYSQL_TYPE_NULL:
- stmt->result.buf[ofs].type = IS_NULL;
- stmt->result.buf[ofs].buflen = 0;
- bind[ofs].buffer_type = MYSQL_TYPE_NULL;
- bind[ofs].buffer = 0;
- bind[ofs].is_null = &stmt->result.is_null[ofs];
- bind[ofs].buffer_length = 0;
- break;
+
case MYSQL_TYPE_DATE:
case MYSQL_TYPE_TIME:
case MYSQL_TYPE_DATETIME:
@@ -322,7 +323,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
#ifdef FIELD_TYPE_NEWDECIMAL
case MYSQL_TYPE_NEWDECIMAL:
#endif
- stmt->result.buf[ofs].type = IS_STRING;
+ stmt->result.buf[ofs].type = IS_STRING;
/*
If the user has called $stmt->store_result() then we have asked
max_length to be updated. this is done only for BLOBS because we don't want to allocate
@@ -404,7 +405,6 @@ PHP_FUNCTION(mysqli_character_set_name)
{
MY_MYSQL *mysql;
zval *mysql_link;
- char *charsetname;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
@@ -412,9 +412,7 @@ PHP_FUNCTION(mysqli_character_set_name)
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
- charsetname = (char *)mysql_character_set_name(mysql->mysql);
-
- RETURN_STRING(charsetname, 1);
+ RETURN_STRING((char *) mysql_character_set_name(mysql->mysql), 1);
}
/* }}} */
@@ -432,10 +430,9 @@ PHP_FUNCTION(mysqli_close)
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
mysql_close(mysql->mysql);
- php_clear_mysql(mysql);
+ php_clear_mysql(mysql);
efree(mysql);
MYSQLI_CLEAR_RESOURCE(&mysql_link);
-
RETURN_TRUE;
}
/* }}} */
@@ -574,7 +571,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
case MYSQL_TYPE_VAR_STRING:
convert_to_string_ex(&stmt->param.vars[i]);
stmt->stmt->params[i].buffer = Z_STRVAL_PP(&stmt->param.vars[i]);
- stmt->stmt->params[i].buffer_length = strlen(Z_STRVAL_PP(&stmt->param.vars[i]));
+ stmt->stmt->params[i].buffer_length = Z_STRLEN_PP(&stmt->param.vars[i]);
break;
case MYSQL_TYPE_DOUBLE:
convert_to_double_ex(&stmt->param.vars[i]);
@@ -587,13 +584,14 @@ PHP_FUNCTION(mysqli_stmt_execute)
default:
break;
}
- }
+ }
}
}
if (mysql_stmt_execute(stmt->stmt)) {
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
RETURN_FALSE;
}
+
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
php_mysqli_report_index(stmt->query, stmt->stmt->mysql->server_status TSRMLS_CC);
}
@@ -611,6 +609,7 @@ PHP_FUNCTION(mysqli_stmt_fetch)
unsigned int i;
ulong ret;
int lval;
+ unsigned int ulval;
double dval;
my_ulonglong llval;
@@ -636,13 +635,28 @@ PHP_FUNCTION(mysqli_stmt_fetch)
#endif
for (i = 0; i < stmt->result.var_cnt; i++) {
if (stmt->result.vars[i]->type == IS_STRING && stmt->result.vars[i]->value.str.len) {
- efree(stmt->result.vars[i]->value.str.val);
+ efree(stmt->result.vars[i]->value.str.val);
}
if (!stmt->result.is_null[i]) {
switch (stmt->result.buf[i].type) {
case IS_LONG:
- memcpy(&lval, stmt->result.buf[i].val, sizeof(lval));
- ZVAL_LONG(stmt->result.vars[i], lval);
+ if ((sizeof(long) ==4) && (stmt->stmt->fields[i].type == MYSQL_TYPE_LONG)
+ && (stmt->stmt->fields[i].flags & UNSIGNED_FLAG))
+ {
+ /* unsigned int (11) */
+ char tmp[12];
+ memcpy (&ulval, stmt->result.buf[i].val, sizeof(lval));
+ if (ulval > INT_MAX) {
+ sprintf((char *)&tmp, "%u", ulval);
+ ZVAL_STRING(stmt->result.vars[i], tmp, 1);
+ } else {
+ memcpy(&lval, stmt->result.buf[i].val, sizeof(lval));
+ ZVAL_LONG(stmt->result.vars[i], lval);
+ }
+ } else {
+ memcpy(&lval, stmt->result.buf[i].val, sizeof(lval));
+ ZVAL_LONG(stmt->result.vars[i], lval);
+ }
break;
case IS_DOUBLE:
memcpy(&dval, stmt->result.buf[i].val, sizeof(dval));
@@ -742,10 +756,6 @@ PHP_FUNCTION(mysqli_fetch_fields)
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result");
- if (!(field = mysql_fetch_field(result))) {
- RETURN_FALSE;
- }
-
array_init(return_value);
for (i = 0; i < mysql_num_fields(result); i++) {
@@ -786,7 +796,7 @@ PHP_FUNCTION(mysqli_fetch_field_direct)
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result");
-
+
if (offset < 0 || offset >= mysql_num_fields(result)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field offset is invalid for resultset");
RETURN_FALSE;
@@ -804,6 +814,8 @@ PHP_FUNCTION(mysqli_fetch_field_direct)
add_property_string(return_value, "orgtable",(field->org_table ? field->org_table : ""), 1);
add_property_string(return_value, "def",(field->def ? field->def : ""), 1);
add_property_long(return_value, "max_length", field->max_length);
+ add_property_long(return_value, "length", field->length);
+ add_property_long(return_value, "charsetnr", field->charsetnr);
add_property_long(return_value, "flags", field->flags);
add_property_long(return_value, "type", field->type);
add_property_long(return_value, "decimals", field->decimals);
@@ -877,7 +889,7 @@ PHP_FUNCTION(mysqli_field_seek)
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result");
if (fieldnr < 0 || fieldnr >= mysql_num_fields(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field offset is invalid for resultset");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
RETURN_FALSE;
}
@@ -1033,7 +1045,7 @@ PHP_FUNCTION(mysqli_init)
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->ptr = (void *)mysql;
- if (!getThis()) {
+ if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry TSRMLS_CC)) {
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
} else {
((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource;
@@ -1065,7 +1077,7 @@ PHP_FUNCTION(mysqli_kill)
{
MY_MYSQL *mysql;
zval *mysql_link;
- unsigned long processid;
+ long processid;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &processid) == FAILURE) {
return;
@@ -1080,7 +1092,7 @@ PHP_FUNCTION(mysqli_kill)
}
/* }}} */
-/* {{{ proto void mysqli_set_local_infile_default(object link)
+/* {{{ proto mysqli_set_local_infile_default(object link)
unsets user defined handler for load local infile command */
PHP_FUNCTION(mysqli_set_local_infile_default)
{
@@ -1133,7 +1145,8 @@ PHP_FUNCTION(mysqli_set_local_infile_handler)
/* {{{ proto bool mysqli_more_results(object link)
check if there any more query results from a multi query */
-PHP_FUNCTION(mysqli_more_results) {
+PHP_FUNCTION(mysqli_more_results)
+{
MY_MYSQL *mysql;
zval *mysql_link;
@@ -1276,11 +1289,11 @@ PHP_FUNCTION(mysqli_prepare)
return;
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
-
if (mysql->mysql->status == MYSQL_STATUS_GET_RESULT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "All data must be fetched before a new preparing of a statement takes place");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "All data must be fetched before a new statement prepare takes place");
RETURN_FALSE;
}
+
stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) {
@@ -1361,14 +1374,16 @@ PHP_FUNCTION(mysqli_real_connect)
flags ^= CLIENT_LOCAL_FILES;
}
+ if (!socket) {
+ socket = MyG(default_socket);
+ }
+
if (mysql_real_connect(mysql->mysql,hostname,username,passwd,dbname,port,socket,flags) == NULL) {
- MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
+ php_mysqli_throw_sql_exception( mysql->mysql->net.sqlstate, mysql->mysql->net.last_errno TSRMLS_CC,
+ mysql->mysql->net.last_error);
- if (!(MyG(report_mode) & MYSQLI_REPORT_ERROR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql->mysql));
- }
RETURN_FALSE;
}
php_mysqli_set_error(mysql_errno(mysql->mysql), (char *)mysql_error(mysql->mysql) TSRMLS_CC);
@@ -1465,7 +1480,7 @@ PHP_FUNCTION(mysqli_stmt_send_long_data)
zval *mysql_stmt;
char *data;
long param_nr;
- int data_len;
+ int data_len;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &mysql_stmt, mysqli_stmt_class_entry, &param_nr, &data, &data_len) == FAILURE) {
@@ -1484,39 +1499,6 @@ PHP_FUNCTION(mysqli_stmt_send_long_data)
}
/* }}} */
-#ifdef HAVE_EMBEDDED_MYSQLI
-/* {{{ proto bool mysqli_server_init(void)
- initialize embedded server */
-PHP_FUNCTION(mysqli_server_init)
-{
- zval *server;
- zval *groups;
-
- if (MyG(embedded)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Embedded server already initialized.");
- RETURN_FALSE;
- }
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|aa", &server, &groups) == FAILURE) {
- return;
- }
-
- if (mysql_server_init(0, NULL, NULL)) {
- RETURN_FALSE;
- }
- MyG(embedded) = 1;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto void mysqli_server_end(void)
-*/
-PHP_FUNCTION(mysqli_server_end)
-{
- mysql_server_end();
-}
-/* }}} */
-#endif
/* {{{ proto mixed mysqli_stmt_affected_rows(object stmt)
Return the number of rows affected in the last query for the given link */
@@ -1572,7 +1554,7 @@ PHP_FUNCTION(mysqli_stmt_data_seek)
}
if (offset < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be positive");
- RETURN_FALSE;
+ RETURN_FALSE;
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
@@ -1781,7 +1763,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
{
MY_STMT *stmt;
zval *mysql_stmt;
- ulong mode;
+ ulong mode;
ulong attr;
int rc;
@@ -1933,13 +1915,13 @@ PHP_FUNCTION(mysqli_stmt_store_result)
{
MY_STMT *stmt;
zval *mysql_stmt;
- int i;
-
+ int i=0;
+
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
-
+
/*
If the user wants to store the data and we have BLOBs/TEXTs we try to allocate
not the maximal length of the type (which is 16MB even for LONGBLOB) but
diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c
new file mode 100644
index 000000000..e63098ade
--- /dev/null
+++ b/ext/mysqli/mysqli_driver.c
@@ -0,0 +1,163 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Georg Richter <georg@php.net> |
+ +----------------------------------------------------------------------+
+
+*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <signal.h>
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_mysqli.h"
+#include "zend_exceptions.h"
+
+
+#define MAP_PROPERTY_MYG_BOOL_READ(name, value) \
+static int name(mysqli_object *obj, zval **retval TSRMLS_DC) \
+{ \
+ ALLOC_ZVAL(*retval); \
+ ZVAL_BOOL(*retval, MyG(value)); \
+ return SUCCESS; \
+} \
+
+#define MAP_PROPERTY_MYG_BOOL_WRITE(name, value) \
+static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
+{ \
+ MyG(value) = Z_LVAL_P(value) > 0; \
+ return SUCCESS; \
+} \
+
+#define MAP_PROPERTY_MYG_LONG_READ(name, value) \
+static int name(mysqli_object *obj, zval **retval TSRMLS_DC) \
+{ \
+ ALLOC_ZVAL(*retval); \
+ ZVAL_LONG(*retval, MyG(value)); \
+ return SUCCESS; \
+} \
+
+#define MAP_PROPERTY_MYG_LONG_WRITE(name, value) \
+static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
+{ \
+ MyG(value) = Z_LVAL_P(value); \
+ return SUCCESS; \
+} \
+
+#define MAP_PROPERTY_MYG_STRING_READ(name, value) \
+static int name(mysqli_object *obj, zval **retval TSRMLS_DC) \
+{ \
+ ALLOC_ZVAL(*retval); \
+ ZVAL_STRING(*retval, MyG(value), 1); \
+ return SUCCESS; \
+} \
+
+#define MAP_PROPERTY_MYG_STRING_WRITE(name, value) \
+static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
+{ \
+ MyG(value) = Z_STRVAL_P(value); \
+ return SUCCESS; \
+} \
+
+/* {{{ property driver_report_write */
+static int driver_report_write(mysqli_object *obj, zval *value TSRMLS_DC)
+{
+ MyG(report_mode) = Z_LVAL_P(value);
+ php_set_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL,
+ zend_exception_get_default() TSRMLS_CC);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ property driver_embedded_read */
+static int driver_embedded_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+ ALLOC_ZVAL(*retval);
+#ifdef HAVE_EMBEDDED_MYSQLI
+ ZVAL_BOOL(*retval, 1);
+#else
+ ZVAL_BOOL(*retval, 0);
+#endif
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ property driver_client_version_read */
+static int driver_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+ ALLOC_ZVAL(*retval);
+ ZVAL_LONG(*retval, MYSQL_VERSION_ID);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ property driver_client_info_read */
+static int driver_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+ ALLOC_ZVAL(*retval);
+ ZVAL_STRING(*retval, MYSQL_SERVER_VERSION, 1);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ property driver_driver_version_read */
+static int driver_driver_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+ ALLOC_ZVAL(*retval);
+ ZVAL_LONG(*retval, MYSQLI_VERSION_ID);
+ return SUCCESS;
+}
+/* }}} */
+
+MAP_PROPERTY_MYG_BOOL_READ(driver_reconnect_read, reconnect);
+MAP_PROPERTY_MYG_BOOL_WRITE(driver_reconnect_write, reconnect);
+MAP_PROPERTY_MYG_LONG_READ(driver_report_read, report_mode);
+
+ZEND_FUNCTION(mysqli_driver_construct)
+{
+
+}
+
+mysqli_property_entry mysqli_driver_property_entries[] = {
+ {"client_info", driver_client_info_read, NULL},
+ {"client_version", driver_client_version_read, NULL},
+ {"driver_version", driver_driver_version_read, NULL},
+ {"embedded", driver_embedded_read, NULL},
+ {"reconnect", driver_reconnect_read, driver_reconnect_write},
+ {"report_mode", driver_report_read, driver_report_write},
+ {NULL, NULL, NULL}
+};
+
+/* {{{ mysqli_driver_methods[]
+ */
+function_entry mysqli_driver_methods[] = {
+ PHP_FALIAS(embedded_server_start, mysqli_embedded_server_start, NULL)
+ PHP_FALIAS(embedded_server_end, mysqli_embedded_server_end, NULL)
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c
new file mode 100644
index 000000000..34405810d
--- /dev/null
+++ b/ext/mysqli/mysqli_embedded.c
@@ -0,0 +1,132 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Georg Richter <georg@php.net> |
+ +----------------------------------------------------------------------+
+
+*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <signal.h>
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_mysqli.h"
+
+/* {{{ proto bool mysqli_embedded_server_start(bool start, array arguments, array groups)
+ initialize and start embedded server */
+PHP_FUNCTION(mysqli_embedded_server_start)
+{
+#ifdef HAVE_EMBEDDED_MYSQLI
+ int argc = 0;
+ char **arguments;
+ char **groups;
+ zval **args, **grps, **start;
+ HashPosition pos;
+ int index, rc;
+
+ if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &start, &args, &grps) == FAILURE) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ convert_to_long_ex(start);
+ convert_to_array_ex(args);
+ convert_to_array_ex(grps);
+
+ if (!Z_LVAL_PP(start)) {
+ mysql_server_init(-1,NULL, NULL);
+ RETURN_TRUE;
+ }
+ /* get arguments */
+ if ((argc = zend_hash_num_elements(HASH_OF(*args)))) {
+ arguments = safe_emalloc(sizeof(char *), argc + 1, 0);
+ arguments[0] = NULL;
+
+ zend_hash_internal_pointer_reset_ex(HASH_OF(*args), &pos);
+
+ for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*args), &pos)) {
+ zval **item;
+
+ if (zend_hash_get_current_data_ex(HASH_OF(*args), (void **) &item, &pos) == FAILURE) {
+ break;
+ }
+
+ convert_to_string_ex(item);
+
+ arguments[++index] = Z_STRVAL_PP(item);
+ }
+ argc++;
+ }
+
+ /* get groups */
+ if ((zend_hash_num_elements(HASH_OF(*grps)))) {
+ groups = safe_emalloc(sizeof(char *), zend_hash_num_elements(HASH_OF(*grps)) + 1, 0);
+ arguments[0] = NULL;
+
+ zend_hash_internal_pointer_reset_ex(HASH_OF(*args), &pos);
+
+ for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*args), &pos)) {
+ zval ** item;
+
+ if (zend_hash_get_current_data_ex(HASH_OF(*args), (void **) &item, &pos) == FAILURE) {
+ break;
+ }
+
+ convert_to_string_ex(item);
+
+ groups[++index] = Z_STRVAL_PP(item);
+ }
+ groups[index] = NULL;
+ } else {
+ groups = safe_emalloc(sizeof(char *), 1, 0);
+ groups[0] = NULL;
+ }
+
+ rc = mysql_server_init(argc, arguments, NULL);
+
+ if (argc) {
+ efree(arguments);
+ }
+ efree(groups);
+
+ if (rc) {
+ RETURN_FALSE;
+ }
+ RETURN_TRUE;
+#endif
+}
+/* }}} */
+
+/* {{{ proto void mysqli_embedded_server_end(void)
+*/
+PHP_FUNCTION(mysqli_embedded_server_end)
+{
+#ifdef HAVE_MYSQLI_EMBEDDED
+ mysql_server_end();
+#endif
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c
new file mode 100644
index 000000000..a65fd97eb
--- /dev/null
+++ b/ext/mysqli/mysqli_exception.c
@@ -0,0 +1,84 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Georg Richter <georg@php.net> |
+ +----------------------------------------------------------------------+
+
+*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <signal.h>
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_mysqli.h"
+#include "zend_exceptions.h"
+
+/* {{{ mysqli_exception_methods[]
+ */
+function_entry mysqli_exception_methods[] = {
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...)
+{
+ zval *sql_ex;
+ va_list arg;
+ char *message;
+
+ va_start(arg, format);
+ vspprintf(&message, 0, format, arg);
+ va_end(arg);;
+
+ if (!(MyG(report_mode) & MYSQLI_REPORT_STRICT)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%s/%d): %s", sqlstate, errorno, message);
+ efree(message);
+ return;
+ }
+
+ MAKE_STD_ZVAL(sql_ex);
+ object_init_ex(sql_ex, mysqli_exception_class_entry);
+
+ if (message) {
+ zend_update_property_string(mysqli_exception_class_entry, sql_ex, "message", sizeof("message") - 1,
+ message TSRMLS_CC);
+ }
+
+ if (sqlstate) {
+ zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1,
+ sqlstate TSRMLS_CC);
+ } else {
+ zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1,
+ "00000" TSRMLS_CC);
+ }
+
+ efree(message);
+ zend_update_property_long(mysqli_exception_class_entry, sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC);
+
+ zend_throw_exception_object(sql_ex TSRMLS_CC);
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c
index 32cb200ea..9849e310a 100644
--- a/ext/mysqli/mysqli_fe.c
+++ b/ext/mysqli/mysqli_fe.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_fe.c,v 1.40.2.3 2005/05/13 13:53:08 georg Exp $
+ $Id: mysqli_fe.c,v 1.49.2.2 2005/10/18 10:02:36 tony2001 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -65,11 +65,10 @@ function_entry mysqli_functions[] = {
PHP_FE(mysqli_disable_reads_from_master, NULL)
PHP_FE(mysqli_disable_rpl_parse, NULL)
PHP_FE(mysqli_dump_debug_info, NULL)
-#ifdef HAVE_EMBEDDED_MYSQLI
- PHP_FE(mysqli_embedded_connect, NULL)
-#endif
PHP_FE(mysqli_enable_reads_from_master, NULL)
PHP_FE(mysqli_enable_rpl_parse, NULL)
+ PHP_FE(mysqli_embedded_server_end, NULL)
+ PHP_FE(mysqli_embedded_server_start, NULL)
PHP_FE(mysqli_errno, NULL)
PHP_FE(mysqli_error, NULL)
PHP_FE(mysqli_stmt_execute, NULL)
@@ -86,12 +85,16 @@ function_entry mysqli_functions[] = {
PHP_FE(mysqli_field_seek, NULL)
PHP_FE(mysqli_field_tell, NULL)
PHP_FE(mysqli_free_result, NULL)
+#ifdef HAVE_MYSQLI_GET_CHARSET
+ PHP_FE(mysqli_get_charset, NULL)
+#endif
PHP_FE(mysqli_get_client_info, NULL)
PHP_FE(mysqli_get_client_version, NULL)
PHP_FE(mysqli_get_host_info, NULL)
PHP_FE(mysqli_get_proto_info, NULL)
PHP_FE(mysqli_get_server_info, NULL)
PHP_FE(mysqli_get_server_version, NULL)
+ PHP_FE(mysqli_get_warnings, NULL)
PHP_FE(mysqli_init, NULL)
PHP_FE(mysqli_info, NULL)
PHP_FE(mysqli_insert_id, NULL)
@@ -131,14 +134,11 @@ function_entry mysqli_functions[] = {
PHP_FE(mysqli_stmt_bind_result, second_arg_force_by_ref_rest)
PHP_FE(mysqli_stmt_fetch, NULL)
PHP_FE(mysqli_stmt_free_result, NULL)
+ PHP_FE(mysqli_stmt_get_warnings, NULL)
PHP_FE(mysqli_stmt_insert_id, NULL)
PHP_FE(mysqli_stmt_reset, NULL)
PHP_FE(mysqli_stmt_param_count, NULL)
PHP_FE(mysqli_send_query, NULL)
-#ifdef HAVE_EMBEDDED_MYSQLI
- PHP_FE(mysqli_server_end, NULL)
- PHP_FE(mysqli_server_init, NULL)
-#endif
PHP_FE(mysqli_slave_query, NULL)
PHP_FE(mysqli_sqlstate, NULL)
PHP_FE(mysqli_ssl_set, NULL)
@@ -186,7 +186,7 @@ function_entry mysqli_functions[] = {
function_entry mysqli_link_methods[] = {
PHP_FALIAS(autocommit,mysqli_autocommit,NULL)
PHP_FALIAS(change_user,mysqli_change_user,NULL)
- PHP_FALIAS(character_set_name,mysqli_character_set_name,NULL)
+ PHP_FALIAS(character_set_name, mysqli_character_set_name,NULL)
PHP_FALIAS(client_encoding, mysqli_character_set_name,NULL)
PHP_FALIAS(close,mysqli_close,NULL)
PHP_FALIAS(commit,mysqli_commit,NULL)
@@ -197,16 +197,20 @@ function_entry mysqli_link_methods[] = {
PHP_FALIAS(dump_debug_info,mysqli_dump_debug_info,NULL)
PHP_FALIAS(enable_reads_from_master,mysqli_enable_reads_from_master,NULL)
PHP_FALIAS(enable_rpl_parse,mysqli_enable_rpl_parse,NULL)
+#ifdef HAVE_MYSQLI_GET_CHARSET
+ PHP_FALIAS(get_charset,mysqli_get_charset,NULL)
+#endif
PHP_FALIAS(get_client_info,mysqli_get_client_info,NULL)
PHP_FALIAS(get_server_info,mysqli_get_server_info,NULL)
+ PHP_FALIAS(get_warnings, mysqli_get_warnings, NULL)
PHP_FALIAS(init,mysqli_init,NULL)
PHP_FALIAS(kill,mysqli_kill,NULL)
PHP_FALIAS(set_local_infile_default,mysqli_set_local_infile_default,NULL)
PHP_FALIAS(set_local_infile_handler,mysqli_set_local_infile_handler,NULL)
PHP_FALIAS(master_query,mysqli_master_query,NULL)
PHP_FALIAS(multi_query,mysqli_multi_query,NULL)
+ PHP_FALIAS(mysqli,mysqli_connect,NULL)
PHP_FALIAS(more_results,mysqli_more_results, NULL)
- PHP_FALIAS(mysqli, mysqli_connect, NULL)
PHP_FALIAS(next_result, mysqli_next_result, NULL)
PHP_FALIAS(options,mysqli_options,NULL)
PHP_FALIAS(ping,mysqli_ping,NULL)
@@ -241,6 +245,7 @@ function_entry mysqli_link_methods[] = {
* Every user visible function must have an entry in mysqli_result_functions[].
*/
function_entry mysqli_result_methods[] = {
+ PHP_FALIAS(mysqli_result, mysqli_result_construct, NULL)
PHP_FALIAS(close,mysqli_free_result,NULL)
PHP_FALIAS(free,mysqli_free_result,NULL)
PHP_FALIAS(data_seek,mysqli_data_seek,NULL)
@@ -263,6 +268,7 @@ function_entry mysqli_result_methods[] = {
* Every user visible function must have an entry in mysqli_stmt_functions[].
*/
function_entry mysqli_stmt_methods[] = {
+ PHP_FALIAS(mysqli_stmt, mysqli_stmt_construct, NULL)
PHP_FALIAS(attr_get,mysqli_stmt_attr_get,NULL)
PHP_FALIAS(attr_set,mysqli_stmt_attr_set,NULL)
PHP_FALIAS(bind_param,mysqli_stmt_bind_param,second_arg_force_by_ref_rest)
@@ -271,6 +277,7 @@ function_entry mysqli_stmt_methods[] = {
PHP_FALIAS(data_seek,mysqli_stmt_data_seek,NULL)
PHP_FALIAS(execute,mysqli_stmt_execute,NULL)
PHP_FALIAS(fetch,mysqli_stmt_fetch,NULL)
+ PHP_FALIAS(get_warnings, mysqli_stmt_get_warnings, NULL)
PHP_FALIAS(result_metadata, mysqli_stmt_result_metadata,NULL)
PHP_FALIAS(num_rows, mysqli_stmt_num_rows,NULL)
PHP_FALIAS(send_long_data,mysqli_stmt_send_long_data,NULL)
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 4efeb1d13..2dc545978 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_nonapi.c,v 1.34.2.11 2005/08/06 16:56:06 andrey Exp $
+ $Id: mysqli_nonapi.c,v 1.54.2.2 2005/10/10 20:06:35 tony2001 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -52,7 +52,7 @@ PHP_FUNCTION(mysqli_connect)
if (!socket_len) {
socket = NULL;
}
-
+
/* TODO: safe mode handling */
if (PG(sql_safe_mode)){
} else {
@@ -67,13 +67,22 @@ PHP_FUNCTION(mysqli_connect)
}
}
- mysql = (MY_MYSQL *)ecalloc(1, sizeof(MY_MYSQL));
+ mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL));
if (!(mysql->mysql = mysql_init(NULL))) {
efree(mysql);
RETURN_FALSE;
}
+#ifdef HAVE_EMBEDDED_MYSQLI
+ if (hostname_len && hostname) {
+ unsigned int external=1;
+ mysql_options(mysql->mysql, MYSQL_OPT_USE_REMOTE_CONNECTION, (char *)&external);
+ } else {
+ mysql_options(mysql->mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, 0);
+ }
+#endif
+
if (!socket) {
socket = MyG(default_socket);
}
@@ -81,12 +90,11 @@ PHP_FUNCTION(mysqli_connect)
if (mysql_real_connect(mysql->mysql,hostname,username,passwd,dbname,port,socket,CLIENT_MULTI_RESULTS) == NULL) {
/* Save error messages */
- MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
+ php_mysqli_throw_sql_exception( mysql->mysql->net.sqlstate, mysql->mysql->net.last_errno TSRMLS_CC,
+ mysql->mysql->net.last_error);
+
php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
- if (!(MyG(report_mode) & MYSQLI_REPORT_ERROR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql->mysql));
- }
/* free mysql structure */
mysql_close(mysql->mysql);
efree(mysql);
@@ -104,7 +112,7 @@ PHP_FUNCTION(mysqli_connect)
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->ptr = (void *)mysql;
- if (!object) {
+ if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) {
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
} else {
((mysqli_object *) zend_object_store_get_object(object TSRMLS_CC))->ptr = mysqli_resource;
@@ -113,60 +121,6 @@ PHP_FUNCTION(mysqli_connect)
}
/* }}} */
-#ifdef HAVE_EMBEDDED_MYSQLI
-/* {{{ proto object mysqli_embedded_connect(void)
- Open a connection to a embedded mysql server */
-PHP_FUNCTION(mysqli_embedded_connect)
-{
- MY_MYSQL *mysql;
- MYSQLI_RESOURCE *mysqli_resource;
- zval *object = getThis();
- char *dbname = NULL;
- int dblen = 0;
-
- if (!MyG(embedded)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Embedded server was not initialized.");
- RETURN_FALSE;
- }
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &dbname, &dblen) == FAILURE) {
- return;
- }
-
- mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL));
-
- if (!(mysql = mysql_init(NULL))) {
- efree(mysql);
- RETURN_FALSE;
- }
-
- if (mysql_real_connect(mysql, NULL, NULL, NULL, dbname, 0, NULL, 0) == NULL) {
- MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
- php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
-
- if (!(MyG(report_mode) & MYSQLI_REPORT_ERROR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql->mysql));
- }
- /* free mysql structure */
- mysql_close(mysql->mysql);
- efree(mysql);
- RETURN_FALSE;
- }
-
- php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
-
- mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
- mysqli_resource->ptr = (void *)mysql;
-
- if (!object) {
- MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
- } else {
- ((mysqli_object *) zend_object_store_get_object(object TSRMLS_CC))->ptr = mysqli_resource;
- }
-}
-/* }}} */
-#endif
-
/* {{{ proto int mysqli_connect_errno(void)
Returns the numerical value of the error message from last connect command */
PHP_FUNCTION(mysqli_connect_errno)
@@ -218,7 +172,7 @@ PHP_FUNCTION(mysqli_multi_query)
MY_MYSQL *mysql;
zval *mysql_link;
char *query = NULL;
- unsigned long query_len;
+ unsigned int query_len;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
return;
@@ -264,6 +218,7 @@ PHP_FUNCTION(mysqli_query)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &mysql_link, mysqli_link_class_entry, &query, &query_len, &resultmode) == FAILURE) {
return;
}
+
if (!query_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty query");
RETURN_FALSE;
@@ -293,6 +248,8 @@ PHP_FUNCTION(mysqli_query)
result = (resultmode == MYSQLI_USE_RESULT) ? mysql_use_result(mysql->mysql) : mysql_store_result(mysql->mysql);
if (!result) {
+ php_mysqli_throw_sql_exception(mysql->mysql->net.sqlstate, mysql->mysql->net.last_errno TSRMLS_CC,
+ mysql->mysql->net.last_error);
RETURN_FALSE;
}
@@ -306,6 +263,54 @@ PHP_FUNCTION(mysqli_query)
}
/* }}} */
+/* {{{ proto object mysqli_get_warnings(object link) */
+PHP_FUNCTION(mysqli_get_warnings)
+{
+ MY_MYSQL *mysql;
+ zval *mysql_link;
+ MYSQLI_RESOURCE *mysqli_resource;
+ MYSQLI_WARNING *w;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ return;
+ }
+ MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, "mysqli_link");
+
+ if (mysql_warning_count(mysql->mysql)) {
+ w = php_get_warnings(mysql->mysql);
+ } else {
+ RETURN_FALSE;
+ }
+ mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
+ mysqli_resource->ptr = mysqli_resource->info = (void *)w;
+ MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
+}
+/* }}} */
+
+/* {{{ proto object mysqli_get_warnings(object link) */
+PHP_FUNCTION(mysqli_stmt_get_warnings)
+{
+ MY_STMT *stmt;
+ zval *stmt_link;
+ MYSQLI_RESOURCE *mysqli_resource;
+ MYSQLI_WARNING *w;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &stmt_link, mysqli_stmt_class_entry) == FAILURE) {
+ return;
+ }
+ MYSQLI_FETCH_RESOURCE(stmt, MY_STMT*, &stmt_link, "mysqli_stmt");
+
+ if (mysql_warning_count(stmt->stmt->mysql)) {
+ w = php_get_warnings(stmt->stmt->mysql);
+ } else {
+ RETURN_FALSE;
+ }
+ mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
+ mysqli_resource->ptr = mysqli_resource->info = (void *)w;
+ MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
+}
+/* }}} */
+
#ifdef HAVE_MYSQLI_SET_CHARSET
/* {{{ proto bool mysqli_set_charset(object link, string csname)
sets client character set */
@@ -321,8 +326,7 @@ PHP_FUNCTION(mysqli_set_charset)
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, "mysqli_link");
- if (mysql_set_character_set(mysql->mysql, cs_name))
- {
+ if (mysql_set_character_set(mysql->mysql, cs_name)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -330,6 +334,36 @@ PHP_FUNCTION(mysqli_set_charset)
/* }}} */
#endif
+#ifdef HAVE_MYSQLI_GET_CHARSET
+/* {{{ object mysqli_get_charset(object link)
+ returns a character set object */
+PHP_FUNCTION(mysqli_get_charset)
+{
+ MY_MYSQL *mysql;
+ zval *mysql_link;
+ MY_CHARSET_INFO cs;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ return;
+ }
+ MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, &mysql_link, "mysqli_link");
+
+ object_init(return_value);
+
+ mysql_get_character_set_info(mysql->mysql, &cs);
+
+ add_property_string(return_value, "charset", (cs.name) ? (char *)cs.csname : "", 1);
+ add_property_string(return_value, "collation",(cs.name) ? (char *)cs.name : "", 1);
+ add_property_string(return_value, "comment", (cs.comment) ? (char *)cs.comment : "", 1);
+ add_property_string(return_value, "dir", (cs.dir) ? (char *)cs.dir : "", 1);
+ add_property_long(return_value, "min_length", cs.mbminlen);
+ add_property_long(return_value, "max_length", cs.mbmaxlen);
+ add_property_long(return_value, "number", cs.number);
+ add_property_long(return_value, "state", cs.state);
+}
+/* }}} */
+#endif
+
/*
* Local variables:
* tab-width: 4
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c
index 80596faf6..3a6792a56 100644
--- a/ext/mysqli/mysqli_prop.c
+++ b/ext/mysqli/mysqli_prop.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_prop.c,v 1.14.2.6 2005/03/30 13:52:39 jorton Exp $
+ $Id: mysqli_prop.c,v 1.23 2005/08/03 14:07:30 sniper Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -36,24 +36,22 @@
return SUCCESS; \
} \
-
-
#define MYSQLI_GET_MYSQL() \
MYSQL *p; \
ALLOC_ZVAL(*retval);\
-CHECK_OBJECT(); \
+CHECK_OBJECT();\
p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql;
#define MYSQLI_GET_RESULT() \
MYSQL_RES *p; \
ALLOC_ZVAL(*retval);\
-CHECK_OBJECT(); \
+CHECK_OBJECT();\
p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr
#define MYSQLI_GET_STMT() \
MYSQL_STMT *p; \
ALLOC_ZVAL(*retval);\
-CHECK_OBJECT(); \
+CHECK_OBJECT();\
p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->stmt
#define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, __ret_type)\
@@ -179,9 +177,8 @@ static int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
MYSQL_RES *p;
- ALLOC_ZVAL(*retval);
+ ALLOC_ZVAL(*retval);
CHECK_OBJECT();
-
p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
if (!p) {
@@ -198,11 +195,10 @@ static int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
MYSQL_RES *p;
- ALLOC_ZVAL(*retval);
+ ALLOC_ZVAL(*retval);
CHECK_OBJECT();
p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
-
if (!p || !p->field_count) {
ZVAL_NULL(*retval);
} else {
@@ -284,6 +280,7 @@ MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT
MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_STMT());
MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_GET_STMT());
+/* }}} */
mysqli_property_entry mysqli_link_property_entries[] = {
{"affected_rows", link_affected_rows_read, NULL},
{"client_info", link_client_info_read, NULL},
diff --git a/ext/mysqli/mysqli_repl.c b/ext/mysqli/mysqli_repl.c
index 0a4a46cca..f61d3713a 100644
--- a/ext/mysqli/mysqli_repl.c
+++ b/ext/mysqli/mysqli_repl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_repl.c,v 1.2 2004/02/26 12:33:23 sniper Exp $
+ $Id: mysqli_repl.c,v 1.3 2005/08/03 14:07:31 sniper Exp $
*/
#ifdef HAVE_CONFIG_H
diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c
index 08addee55..058383be7 100644
--- a/ext/mysqli/mysqli_report.c
+++ b/ext/mysqli/mysqli_report.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_report.c,v 1.9 2004/07/07 08:02:27 georg Exp $
+ $Id: mysqli_report.c,v 1.11 2005/08/03 14:07:31 sniper Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -46,7 +46,7 @@ PHP_FUNCTION(mysqli_report)
/* {{{ void php_mysqli_report_error(char *sqlstate, int errorno, char *error) */
void php_mysqli_report_error(char *sqlstate, int errorno, char *error TSRMLS_DC) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error (%s/%d): %s", sqlstate, errorno, error);
+ php_mysqli_throw_sql_exception(sqlstate, errorno TSRMLS_CC, error);
}
/* }}} */
@@ -61,7 +61,7 @@ void php_mysqli_report_index(char *query, unsigned int status TSRMLS_DC) {
} else {
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s used in query/prepared statement %s", index, query);
+ php_mysqli_throw_sql_exception("00000", 0 TSRMLS_CC, "%s used in query/prepared statement %s", index, query);
}
/* }}} */
diff --git a/ext/mysqli/mysqli_report.h b/ext/mysqli/mysqli_report.h
index 6d227777e..dee0aab71 100644
--- a/ext/mysqli/mysqli_report.h
+++ b/ext/mysqli/mysqli_report.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_report.h,v 1.3 2004/02/26 12:33:23 sniper Exp $
+ $Id: mysqli_report.h,v 1.5 2005/08/03 14:07:31 sniper Exp $
*/
#ifndef __HAVE_MYSQLI_PROFILER_H__
@@ -52,3 +52,13 @@ typedef struct {
#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c
new file mode 100644
index 000000000..19aa8eec8
--- /dev/null
+++ b/ext/mysqli/mysqli_warning.c
@@ -0,0 +1,235 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Georg Richter <georg@php.net> |
+ +----------------------------------------------------------------------+
+
+*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <signal.h>
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_mysqli.h"
+
+/* {{{ void php_clear_warnings() */
+void php_clear_warnings(MYSQLI_WARNING *w)
+{
+ MYSQLI_WARNING *n;
+
+ while (w) {
+ n = w;
+ efree(w->reason);
+ w = w->next;
+ efree(n);
+ }
+}
+/* }}} */
+
+/* {{{ MYSQLI_WARNING *php_new_warning */
+MYSQLI_WARNING *php_new_warning(char *reason, char *sqlstate, int errorno)
+{
+ MYSQLI_WARNING *w;
+
+ w = (MYSQLI_WARNING *)ecalloc(1, sizeof(MYSQLI_WARNING));
+
+ w->reason = safe_estrdup(reason);
+ if (sqlstate) {
+ strcpy(w->sqlstate, sqlstate);
+ } else {
+ strcpy(w->sqlstate, "00000");
+ }
+ w->errorno = errorno;
+
+ return w;
+}
+/* }}} */
+
+/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql) */
+MYSQLI_WARNING *php_get_warnings(MYSQL *mysql)
+{
+ MYSQLI_WARNING *w, *first = NULL, *prev = NULL;
+ MYSQL_RES *result;
+ MYSQL_ROW row;
+
+ if (mysql_query(mysql, "SHOW WARNINGS")) {
+ return NULL;
+ }
+
+ result = mysql_store_result(mysql);
+ while ((row = mysql_fetch_row(result))) {
+ w = php_new_warning(row[2], "HY000", atoi(row[1]));
+ if (!first) {
+ first = w;
+ }
+ if (prev) {
+ prev->next = (void *)w;
+ }
+ prev = w;
+ }
+ mysql_free_result(result);
+ return first;
+}
+/* }}} */
+
+/* {{{ bool mysqli_warning::next() */
+PHP_METHOD(mysqli_warning, next)
+{
+ MYSQLI_WARNING *w;
+ zval *mysqli_warning;
+ mysqli_object *obj = (mysqli_object *)zend_objects_get_address(getThis() TSRMLS_CC);
+
+ if (obj->ptr) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ &mysqli_warning, mysqli_warning_class_entry) == FAILURE) {
+ return;
+ }
+
+ MYSQLI_FETCH_RESOURCE(w, MYSQLI_WARNING *, &mysqli_warning, "mysqli_warning");
+
+ if (w->next) {
+ w = w->next;
+ ((MYSQLI_RESOURCE *)(obj->ptr))->ptr = w;
+ RETURN_TRUE;
+ }
+ }
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ property mysqli_warning_message */
+int mysqli_warning_message(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+ MYSQLI_WARNING *w;
+
+ if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) {
+ return FAILURE;
+ }
+
+ w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
+ ALLOC_ZVAL(*retval);
+ if (w->reason) {
+ ZVAL_STRING(*retval, w->reason, 1);
+ } else {
+ ZVAL_NULL(*retval);
+ }
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ property mysqli_warning_sqlstate */
+int mysqli_warning_sqlstate(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+ MYSQLI_WARNING *w;
+
+ if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) {
+ return FAILURE;
+ }
+
+ w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
+ ALLOC_ZVAL(*retval);
+ ZVAL_STRING(*retval, w->sqlstate, 1);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ property mysqli_warning_error */
+int mysqli_warning_errno(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+ MYSQLI_WARNING *w;
+
+ if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) {
+ return FAILURE;
+ }
+ w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
+ ALLOC_ZVAL(*retval);
+ ZVAL_LONG(*retval, w->errorno);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ mysqli_warning_construct(object obj) */
+PHP_METHOD(mysqli_warning, __construct)
+{
+ zval *z;
+ mysqli_object *obj;
+ MYSQL *hdl;
+ MYSQLI_WARNING *w;
+ MYSQLI_RESOURCE *mysqli_resource;
+
+ if (ZEND_NUM_ARGS() != 1) {
+ WRONG_PARAM_COUNT;
+ }
+ if (zend_parse_parameters(1 TSRMLS_CC, "o", &z)==FAILURE) {
+ return;
+ }
+ obj = (mysqli_object *)zend_object_store_get_object(z TSRMLS_CC);\
+
+ if (obj->zo.ce == mysqli_link_class_entry) {
+ MY_MYSQL *mysql;
+ MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &z, "mysqli_link");
+ hdl = mysql->mysql;
+ } else if (obj->zo.ce == mysqli_stmt_class_entry) {
+ MY_STMT *stmt;
+ MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &z, "mysqli_stmt");
+ hdl = stmt->stmt->mysql;
+ } else {
+ RETURN_FALSE;
+ }
+
+ if (mysql_warning_count(hdl)) {
+ w = php_get_warnings(hdl);
+ } else {
+ RETURN_FALSE;
+ }
+
+ mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
+ mysqli_resource->ptr = mysqli_resource->info = (void *)w;
+
+ if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_warning_class_entry TSRMLS_CC)) {
+ MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
+ } else {
+ ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource;
+ ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->valid = 1;
+ }
+
+}
+/* }}} */
+
+function_entry mysqli_warning_methods[] = {
+ PHP_ME(mysqli_warning, __construct, NULL, ZEND_ACC_PROTECTED)
+ PHP_ME(mysqli_warning, next, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+mysqli_property_entry mysqli_warning_property_entries[] = {
+ {"message", mysqli_warning_message, NULL},
+ {"sqlstate", mysqli_warning_sqlstate, NULL},
+ {"errno", mysqli_warning_errno, NULL},
+ {NULL, NULL, NULL}
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h
index faf68bd02..31e9040ac 100644
--- a/ext/mysqli/php_mysqli.h
+++ b/ext/mysqli/php_mysqli.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: php_mysqli.h,v 1.38.2.6 2005/05/21 08:54:56 georg Exp $
+ $Id: php_mysqli.h,v 1.54.2.2 2005/10/18 13:51:50 tony2001 Exp $
*/
/* A little hack to prevent build break, when mysql is used together with
@@ -26,11 +26,23 @@
#endif
#include <mysql.h>
+
+/* character set support */
+#if MYSQL_VERSION_ID > 50009
+#define HAVE_MYSQLI_GET_CHARSET
+#endif
+
+#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
+#define HAVE_MYSQLI_SET_CHARSET
+#endif
+
#include <errmsg.h>
#ifndef PHP_MYSQLI_H
#define PHP_MYSQLI_H
+#define MYSQLI_VERSION_ID 101008
+
typedef struct {
ulong buflen;
char *val;
@@ -76,10 +88,17 @@ typedef struct _mysqli_object {
HashTable *prop_handler;
} mysqli_object; /* extends zend_object */
+typedef struct {
+ char *reason;
+ char sqlstate[6];
+ int errorno;
+ void *next;
+} MYSQLI_WARNING;
+
typedef struct _mysqli_property_entry {
char *pname;
int (*r_func)(mysqli_object *obj, zval **retval TSRMLS_DC);
- int (*w_func)(mysqli_object *obj, zval **retval TSRMLS_DC);
+ int (*w_func)(mysqli_object *obj, zval *value TSRMLS_DC);
} mysqli_property_entry;
typedef struct {
@@ -95,10 +114,6 @@ typedef struct {
#define PHP_MYSQLI_API
#endif
-#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
-#define HAVE_MYSQLI_SET_CHARSET
-#endif
-
#ifdef ZTS
#include "TSRM.h"
#endif
@@ -110,13 +125,21 @@ extern function_entry mysqli_functions[];
extern function_entry mysqli_link_methods[];
extern function_entry mysqli_stmt_methods[];
extern function_entry mysqli_result_methods[];
+extern function_entry mysqli_driver_methods[];
+extern function_entry mysqli_warning_methods[];
+extern function_entry mysqli_exception_methods[];
+
extern mysqli_property_entry mysqli_link_property_entries[];
extern mysqli_property_entry mysqli_result_property_entries[];
extern mysqli_property_entry mysqli_stmt_property_entries[];
+extern mysqli_property_entry mysqli_driver_property_entries[];
+extern mysqli_property_entry mysqli_warning_property_entries[];
extern void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flag, int into_object);
extern void php_clear_stmt_bind(MY_STMT *stmt);
-void php_clear_mysql(MY_MYSQL *);
+extern void php_clear_mysql(MY_MYSQL *);
+extern MYSQLI_WARNING *php_get_warnings(MYSQL *mysql);
+extern void php_clear_warnings(MYSQLI_WARNING *w);
extern void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type);
extern void php_mysqli_report_error(char *sqlstate, int errorno, char *error TSRMLS_DC);
extern void php_mysqli_report_index(char *query, unsigned int status TSRMLS_DC);
@@ -125,14 +148,17 @@ extern int php_local_infile_read(void *, char *, uint);
extern void php_local_infile_end(void *);
extern int php_local_infile_error(void *, char *, uint);
extern void php_set_local_infile_handler_default(MY_MYSQL *);
-
+extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...);
zend_class_entry *mysqli_link_class_entry;
zend_class_entry *mysqli_stmt_class_entry;
zend_class_entry *mysqli_result_class_entry;
+zend_class_entry *mysqli_driver_class_entry;
+zend_class_entry *mysqli_warning_class_entry;
+zend_class_entry *mysqli_exception_class_entry;
-zend_class_entry _mysqli_link_class_entry;
-zend_class_entry _mysqli_stmt_class_entry;
-zend_class_entry _mysqli_result_class_entry;
+#ifdef HAVE_SPL
+extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
+#endif
PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRMLS_DC);
@@ -147,9 +173,10 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
}
#define REGISTER_MYSQLI_CLASS_ENTRY(name, mysqli_entry, class_functions) { \
- INIT_CLASS_ENTRY(_##mysqli_entry,name,class_functions); \
- _##mysqli_entry.create_object = mysqli_objects_new; \
- mysqli_entry = zend_register_internal_class(&_##mysqli_entry TSRMLS_CC); \
+ zend_class_entry ce; \
+ INIT_CLASS_ENTRY(ce, name,class_functions); \
+ ce.create_object = mysqli_objects_new; \
+ mysqli_entry = zend_register_internal_class(&ce TSRMLS_CC); \
} \
#define MYSQLI_REGISTER_RESOURCE_EX(__ptr, __zval, __ce) \
@@ -164,7 +191,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
#define MYSQLI_REGISTER_RESOURCE(__ptr, __ce) \
{\
zval *object = getThis();\
- if (!object) {\
+ if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) {\
object = return_value;\
Z_TYPE_P(object) = IS_OBJECT;\
(object)->value.obj = mysqli_objects_new(__ce TSRMLS_CC);\
@@ -177,17 +204,17 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
MYSQLI_RESOURCE *my_res; \
mysqli_object *intern = (mysqli_object *)zend_object_store_get_object(*(__id) TSRMLS_CC);\
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {\
- php_error(E_WARNING, "Couldn't fetch %s", intern->zo.ce->name);\
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name);\
RETURN_NULL();\
}\
if (!intern->valid) { \
- php_error(E_WARNING, "invalid resource %s", intern->zo.ce->name); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid resource %s", intern->zo.ce->name); \
RETURN_NULL(); \
} \
__ptr = (__type)my_res->ptr; \
if (!strcmp((char *)__name, "mysqli_stmt")) {\
if (!((MY_STMT *)__ptr)->stmt->mysql) {\
- php_error(E_WARNING, "Statement isn't valid anymore");\
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Statement isn't valid anymore");\
RETURN_NULL();\
}\
}\
@@ -215,7 +242,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
{ \
int i = 0; \
while (b[i].pname != NULL) { \
- mysqli_add_property(a, b[i].pname, (mysqli_read_t)b[i].r_func, NULL TSRMLS_CC); \
+ mysqli_add_property(a, b[i].pname, (mysqli_read_t)b[i].r_func, (mysqli_write_t)b[i].w_func TSRMLS_CC); \
i++; \
}\
}
@@ -246,9 +273,10 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
/*** REPORT MODES ***/
#define MYSQLI_REPORT_OFF 0
-#define MYSQLI_REPORT_INDEX 1
-#define MYSQLI_REPORT_ERROR 2
-#define MYSQLI_REPORT_CLOSE 4
+#define MYSQLI_REPORT_ERROR 1
+#define MYSQLI_REPORT_STRICT 2
+#define MYSQLI_REPORT_INDEX 4
+#define MYSQLI_REPORT_CLOSE 8
#define MYSQLI_REPORT_ALL 255
#define MYSQLI_REPORT_MYSQL_ERROR(mysql) \
@@ -290,9 +318,6 @@ PHP_FUNCTION(mysqli_debug);
PHP_FUNCTION(mysqli_disable_reads_from_master);
PHP_FUNCTION(mysqli_disable_rpl_parse);
PHP_FUNCTION(mysqli_dump_debug_info);
-#ifdef HAVE_EMBEDDED_MYSQLI
-PHP_FUNCTION(mysqli_embedded_connect);
-#endif
PHP_FUNCTION(mysqli_enable_reads_from_master);
PHP_FUNCTION(mysqli_enable_rpl_parse);
PHP_FUNCTION(mysqli_errno);
@@ -309,12 +334,16 @@ PHP_FUNCTION(mysqli_field_count);
PHP_FUNCTION(mysqli_field_seek);
PHP_FUNCTION(mysqli_field_tell);
PHP_FUNCTION(mysqli_free_result);
+#ifdef HAVE_MYSQLI_GET_CHARSET
+PHP_FUNCTION(mysqli_get_charset);
+#endif
PHP_FUNCTION(mysqli_get_client_info);
PHP_FUNCTION(mysqli_get_client_version);
PHP_FUNCTION(mysqli_get_host_info);
PHP_FUNCTION(mysqli_get_proto_info);
PHP_FUNCTION(mysqli_get_server_info);
PHP_FUNCTION(mysqli_get_server_version);
+PHP_FUNCTION(mysqli_get_warnings);
PHP_FUNCTION(mysqli_info);
PHP_FUNCTION(mysqli_insert_id);
PHP_FUNCTION(mysqli_init);
@@ -355,10 +384,8 @@ PHP_FUNCTION(mysqli_stmt_fetch);
PHP_FUNCTION(mysqli_stmt_param_count);
PHP_FUNCTION(mysqli_stmt_send_long_data);
PHP_FUNCTION(mysqli_send_query);
-#ifdef HAVE_EMBEDDED_MYSQLI
-PHP_FUNCTION(mysqli_server_init);
-PHP_FUNCTION(mysqli_server_end);
-#endif
+PHP_FUNCTION(mysqli_embedded_server_end);
+PHP_FUNCTION(mysqli_embedded_server_start);
PHP_FUNCTION(mysqli_slave_query);
PHP_FUNCTION(mysqli_sqlstate);
PHP_FUNCTION(mysqli_ssl_set);
@@ -369,6 +396,7 @@ PHP_FUNCTION(mysqli_stmt_data_seek);
PHP_FUNCTION(mysqli_stmt_errno);
PHP_FUNCTION(mysqli_stmt_error);
PHP_FUNCTION(mysqli_stmt_free_result);
+PHP_FUNCTION(mysqli_stmt_get_warnings);
PHP_FUNCTION(mysqli_stmt_reset);
PHP_FUNCTION(mysqli_stmt_insert_id);
PHP_FUNCTION(mysqli_stmt_num_rows);
@@ -380,6 +408,11 @@ PHP_FUNCTION(mysqli_thread_safe);
PHP_FUNCTION(mysqli_use_result);
PHP_FUNCTION(mysqli_warning_count);
+ZEND_FUNCTION(mysqli_stmt_construct);
+ZEND_FUNCTION(mysqli_result_construct);
+ZEND_FUNCTION(mysqli_driver_construct);
+ZEND_METHOD(mysqli_warning,__construct);
+
ZEND_BEGIN_MODULE_GLOBALS(mysqli)
long default_link;
long num_links;
@@ -390,13 +423,13 @@ ZEND_BEGIN_MODULE_GLOBALS(mysqli)
char *default_socket;
char *default_pw;
int reconnect;
+ int strict;
long error_no;
char *error_msg;
int report_mode;
HashTable *report_ht;
-#ifdef HAVE_EMBEDDED_MYSQLI
+ unsigned int multi_query;
unsigned int embedded;
-#endif
ZEND_END_MODULE_GLOBALS(mysqli)
@@ -424,4 +457,6 @@ ZEND_EXTERN_MODULE_GLOBALS(mysqli)
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
*/
diff --git a/ext/mysqli/tests/001.phpt b/ext/mysqli/tests/001.phpt
index 880325bb5..3f2f3c2d3 100644
--- a/ext/mysqli/tests/001.phpt
+++ b/ext/mysqli/tests/001.phpt
@@ -2,13 +2,14 @@
mysqli connect
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
$dbname = "test";
$test = "";
-
+
/*** test mysqli_connect localhost:port ***/
$link = mysqli_connect($host, $user, $passwd, "", 3306);
$test .= ($link) ? "1" : "0";
diff --git a/ext/mysqli/tests/003.phpt b/ext/mysqli/tests/003.phpt
index d043dc772..28aedb032 100644
--- a/ext/mysqli/tests/003.phpt
+++ b/ext/mysqli/tests/003.phpt
@@ -7,9 +7,9 @@ mysqli connect
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, "test");
- mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time,
diff --git a/ext/mysqli/tests/006.phpt b/ext/mysqli/tests/006.phpt
index 4b495cc59..a53ad7a54 100644
--- a/ext/mysqli/tests/006.phpt
+++ b/ext/mysqli/tests/006.phpt
@@ -10,6 +10,7 @@ mysqli fetch long values
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,
diff --git a/ext/mysqli/tests/007.phpt b/ext/mysqli/tests/007.phpt
index 503863bdc..cb32033cc 100644
--- a/ext/mysqli/tests/007.phpt
+++ b/ext/mysqli/tests/007.phpt
@@ -10,6 +10,7 @@ mysqli fetch short values
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
diff --git a/ext/mysqli/tests/008.phpt b/ext/mysqli/tests/008.phpt
index 12311d621..9fc01b8ad 100644
--- a/ext/mysqli/tests/008.phpt
+++ b/ext/mysqli/tests/008.phpt
@@ -10,6 +10,7 @@ mysqli fetch tinyint values
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint,
diff --git a/ext/mysqli/tests/009.phpt b/ext/mysqli/tests/009.phpt
index 6b8f57b20..c69447a00 100644
--- a/ext/mysqli/tests/009.phpt
+++ b/ext/mysqli/tests/009.phpt
@@ -1,7 +1,13 @@
--TEST--
mysqli fetch bigint values
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+ if (PHP_INT_SIZE == 8) {
+ echo 'skip test valid only for 32bit systems';
+ exit;
+ }
+ require_once('skipif.inc');
+?>
--FILE--
<?php
include "connect.inc";
@@ -10,6 +16,7 @@ mysqli fetch bigint values
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 bigint default 5,
@@ -25,15 +32,32 @@ mysqli fetch bigint values
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ $rc = mysqli_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
var_dump($test);
mysqli_stmt_close($stmt);
+
+ mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch_uint");
+ mysqli_query($link,"CREATE TABLE test_bind_fetch_uint(c1 integer unsigned, c2 integer unsigned)");
+
+ mysqli_query($link, "INSERT INTO test_bind_fetch_uint (c1,c2) VALUES (20123456, 3123456789)");
+
+ $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch_uint");
+ mysqli_bind_result($stmt, $c1, $c2);
+ mysqli_execute($stmt);
+ $rc = mysqli_fetch($stmt);
+
+ echo $c1, "\n", $c2, "\n";
+
+ mysqli_stmt_close($stmt);
+
+
mysqli_close($link);
?>
+
--EXPECT--
array(7) {
[0]=>
@@ -47,7 +71,9 @@ array(7) {
[4]=>
int(0)
[5]=>
- string(13) "-333333333333"
+ int(0)
[6]=>
int(100)
}
+20123456
+3123456789
diff --git a/ext/mysqli/tests/010.phpt b/ext/mysqli/tests/010.phpt
index 0d74bed50..6b79d62f4 100644
--- a/ext/mysqli/tests/010.phpt
+++ b/ext/mysqli/tests/010.phpt
@@ -12,6 +12,7 @@ precision=12
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
diff --git a/ext/mysqli/tests/014.phpt b/ext/mysqli/tests/014.phpt
index 69c347b88..a180bea75 100644
--- a/ext/mysqli/tests/014.phpt
+++ b/ext/mysqli/tests/014.phpt
@@ -1,7 +1,7 @@
--TEST--
mysqli autocommit/commit/rollback
--SKIPIF--
-<?php
+<?php
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd);
$result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'");
@@ -36,6 +36,7 @@ mysqli autocommit/commit/rollback
mysqli_rollback($link);
$result = mysqli_query($link, "SELECT * FROM ac_01");
+ printf("Num_of_rows=%d\n", mysqli_num_rows($result));
$row = mysqli_fetch_row($result);
mysqli_free_result($result);
@@ -54,6 +55,7 @@ mysqli autocommit/commit/rollback
mysqli_close($link);
?>
--EXPECT--
+Num_of_rows=1
array(2) {
[0]=>
string(1) "1"
diff --git a/ext/mysqli/tests/017.phpt b/ext/mysqli/tests/017.phpt
index 7f51ca4b9..54d11ef71 100644
--- a/ext/mysqli/tests/017.phpt
+++ b/ext/mysqli/tests/017.phpt
@@ -2,6 +2,7 @@
mysqli fetch functions
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/020.phpt b/ext/mysqli/tests/020.phpt
index 85834c52a..4ae140f62 100644
--- a/ext/mysqli/tests/020.phpt
+++ b/ext/mysqli/tests/020.phpt
@@ -10,6 +10,7 @@ mysqli bind_param/bind_result date
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time,
diff --git a/ext/mysqli/tests/023.phpt b/ext/mysqli/tests/023.phpt
index 69e9b2085..24a717a6e 100644
--- a/ext/mysqli/tests/023.phpt
+++ b/ext/mysqli/tests/023.phpt
@@ -10,6 +10,7 @@ mysqli bind_param/bind_prepare fetch long values
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,
diff --git a/ext/mysqli/tests/024.phpt b/ext/mysqli/tests/024.phpt
index c6d6cd7e7..f0d0a6407 100644
--- a/ext/mysqli/tests/024.phpt
+++ b/ext/mysqli/tests/024.phpt
@@ -10,6 +10,7 @@ mysqli bind_param/bind_result short values
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
diff --git a/ext/mysqli/tests/025.phpt b/ext/mysqli/tests/025.phpt
index 85ff0fa29..f3338cf46 100644
--- a/ext/mysqli/tests/025.phpt
+++ b/ext/mysqli/tests/025.phpt
@@ -10,6 +10,7 @@ mysqli bind_param/bind_result tinyint values
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint,
diff --git a/ext/mysqli/tests/026.phpt b/ext/mysqli/tests/026.phpt
index 0f9e88260..d38e3c180 100644
--- a/ext/mysqli/tests/026.phpt
+++ b/ext/mysqli/tests/026.phpt
@@ -10,6 +10,7 @@ mysqli bind_param/bind_result with send_long_data
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 varchar(10), c2 text)");
diff --git a/ext/mysqli/tests/033.phpt b/ext/mysqli/tests/033.phpt
index 025539ea4..de401f49d 100644
--- a/ext/mysqli/tests/033.phpt
+++ b/ext/mysqli/tests/033.phpt
@@ -2,6 +2,7 @@
function test: mysqli_get_host_info
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
@@ -16,4 +17,4 @@ function test: mysqli_get_host_info
mysqli_close($link);
?>
--EXPECTF--
-string(%d) "%s via %s" \ No newline at end of file
+string(%d) "%s via %s"
diff --git a/ext/mysqli/tests/034.phpt b/ext/mysqli/tests/034.phpt
index 47c99f07e..468861c3c 100644
--- a/ext/mysqli/tests/034.phpt
+++ b/ext/mysqli/tests/034.phpt
@@ -2,6 +2,7 @@
function test: mysqli_get_proto_info
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/036.phpt b/ext/mysqli/tests/036.phpt
index 58d27b481..057795bb4 100644
--- a/ext/mysqli/tests/036.phpt
+++ b/ext/mysqli/tests/036.phpt
@@ -1,7 +1,13 @@
--TEST--
function test: mysqli_insert_id()
--SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+ if (PHP_INT_SIZE == 8) {
+ echo 'skip test valid only for 32bit systems';
+ exit;
+ }
+ require_once('skipif.inc');
+?>
--FILE--
<?php
diff --git a/ext/mysqli/tests/041.phpt b/ext/mysqli/tests/041.phpt
index e78c60a95..90bed1ad4 100644
--- a/ext/mysqli/tests/041.phpt
+++ b/ext/mysqli/tests/041.phpt
@@ -9,16 +9,12 @@ function test: mysqli_warning_count()
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd);
-
mysqli_select_db($link, "test");
mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
+ mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
- mysqli_query($link, "CREATE TABLE test_warnings (a int not null");
-
- mysqli_query($link, "INSERT INTO test_warnings VALUES (1),(2),(NULL)");
- $num = mysqli_warning_count($link);
- var_dump($num);
+ var_dump(mysqli_warning_count($link));
mysqli_close($link);
?>
diff --git a/ext/mysqli/tests/042.phpt b/ext/mysqli/tests/042.phpt
index fe6d23e17..719e24925 100644
--- a/ext/mysqli/tests/042.phpt
+++ b/ext/mysqli/tests/042.phpt
@@ -10,6 +10,7 @@ mysqli_fetch_object
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
diff --git a/ext/mysqli/tests/045.phpt b/ext/mysqli/tests/045.phpt
index 5a6efeafb..2f9490c28 100644
--- a/ext/mysqli/tests/045.phpt
+++ b/ext/mysqli/tests/045.phpt
@@ -17,6 +17,7 @@ mysqli_bind_result (SHOW)
?>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/047.phpt b/ext/mysqli/tests/047.phpt
index d6ccb0df3..8663e8a64 100644
--- a/ext/mysqli/tests/047.phpt
+++ b/ext/mysqli/tests/047.phpt
@@ -31,7 +31,7 @@ mysqli_get_metadata
--EXPECTF--
array(2) {
[0]=>
- object(stdClass)#4 (11) {
+ object(stdClass)#5 (11) {
["name"]=>
string(3) "foo"
["orgname"]=>
@@ -56,7 +56,7 @@ array(2) {
int(0)
}
[1]=>
- object(stdClass)#5 (11) {
+ object(stdClass)#6 (11) {
["name"]=>
string(3) "bar"
["orgname"]=>
diff --git a/ext/mysqli/tests/049.phpt b/ext/mysqli/tests/049.phpt
index 13ea5594c..8d16c3d4c 100644
--- a/ext/mysqli/tests/049.phpt
+++ b/ext/mysqli/tests/049.phpt
@@ -2,6 +2,7 @@
mysql_fetch_row (OO-Style)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/060.phpt b/ext/mysqli/tests/060.phpt
index 875130dc5..ba6c231c5 100644
--- a/ext/mysqli/tests/060.phpt
+++ b/ext/mysqli/tests/060.phpt
@@ -16,6 +16,7 @@ mysqli_fetch_object with classes
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
mysqli_query($link,"DROP TABLE IF EXISTS test_fetch");
mysqli_query($link,"CREATE TABLE test_fetch(c1 smallint unsigned,
diff --git a/ext/mysqli/tests/061.csv b/ext/mysqli/tests/061.csv
deleted file mode 100644
index 66b4a55b0..000000000
--- a/ext/mysqli/tests/061.csv
+++ /dev/null
@@ -1 +0,0 @@
-foo;bar \ No newline at end of file
diff --git a/ext/mysqli/tests/061.phpt b/ext/mysqli/tests/061.phpt
index 9c278353c..c7a217f27 100644
--- a/ext/mysqli/tests/061.phpt
+++ b/ext/mysqli/tests/061.phpt
@@ -2,6 +2,7 @@
local infile handler
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
@@ -15,17 +16,18 @@ local infile handler
$link = mysqli_connect($host, $user, $passwd, "test");
/* create temporary file */
- $fp = fopen("061.csv", "w");
+ $filename = dirname(__FILE__) . "061.csv";
+ $fp = fopen($filename, "w");
fwrite($fp, "foo;bar");
fclose($fp);
mysqli_query($link,"DROP TABLE IF EXISTS t_061");
mysqli_query($link,"CREATE TABLE t_061 (c1 varchar(10), c2 varchar(10))");
- mysqli_query($link, "LOAD DATA LOCAL INFILE '061.csv' INTO TABLE t_061 FIELDS TERMINATED BY ';'");
+ mysqli_query($link, "LOAD DATA LOCAL INFILE '{$filename}' INTO TABLE t_061 FIELDS TERMINATED BY ';'");
mysqli_set_local_infile_handler($link, "my_read");
- mysqli_query($link, "LOAD DATA LOCAL INFILE '061.csv' INTO TABLE t_061 FIELDS TERMINATED BY ';'");
+ mysqli_query($link, "LOAD DATA LOCAL INFILE '{$filename}' INTO TABLE t_061 FIELDS TERMINATED BY ';'");
if ($result = mysqli_query($link, "SELECT c1,c2 FROM t_061")) {
while (($row = mysqli_fetch_row($result))) {
@@ -35,6 +37,7 @@ local infile handler
}
mysqli_close($link);
+ unlink($filename);
?>
--EXPECT--
foo-bar
diff --git a/ext/mysqli/tests/062.phpt b/ext/mysqli/tests/062.phpt
new file mode 100644
index 000000000..962abce16
--- /dev/null
+++ b/ext/mysqli/tests/062.phpt
@@ -0,0 +1,25 @@
+--TEST--
+resultset constructor
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ $mysql = new mysqli($host, $user, $passwd);
+
+ $mysql->real_query("SELECT 'foo' FROM DUAL");
+
+ $myresult = new mysqli_result($mysql);
+
+ $row = $myresult->fetch_row();
+ $myresult->close();
+ $mysql->close();
+
+ var_dump($row);
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ string(3) "foo"
+}
diff --git a/ext/mysqli/tests/063.phpt b/ext/mysqli/tests/063.phpt
new file mode 100644
index 000000000..9dd01629a
--- /dev/null
+++ b/ext/mysqli/tests/063.phpt
@@ -0,0 +1,21 @@
+--TEST--
+resultset constructor
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ $mysql = new mysqli($host, $user, $passwd);
+
+ $stmt = new mysqli_stmt($mysql, "SELECT 'foo' FROM DUAL");
+ $stmt->execute();
+ $stmt->bind_result($foo);
+ $stmt->fetch();
+ $stmt->close();
+ $mysql->close();
+
+ var_dump($foo);
+?>
+--EXPECT--
+string(3) "foo"
diff --git a/ext/mysqli/tests/064.phpt b/ext/mysqli/tests/064.phpt
index 1d6358e53..e6df1e450 100644
--- a/ext/mysqli/tests/064.phpt
+++ b/ext/mysqli/tests/064.phpt
@@ -8,7 +8,7 @@ NULL binding
$mysql = new mysqli($host, $user, $passwd);
- $stmt = $mysql->prepare("SELECT NULL FROM DUAL");
+ $stmt = new mysqli_stmt($mysql, "SELECT NULL FROM DUAL");
$stmt->execute();
$stmt->bind_result($foo);
$stmt->fetch();
diff --git a/ext/mysqli/tests/065.phpt b/ext/mysqli/tests/065.phpt
index 950a10a43..09ee886ec 100644
--- a/ext/mysqli/tests/065.phpt
+++ b/ext/mysqli/tests/065.phpt
@@ -3,12 +3,16 @@ set character set
--SKIPIF--
<?php
require_once('skipif.inc');
+if (!function_exists('mysqli_set_charset')) {
+ die('skip mysqli_set_charset() not available');
+}
?>
--FILE--
<?php
include "connect.inc";
$mysql = new mysqli($host, $user, $passwd);
+ mysqli_query($mysql, "SET sql_mode=''");
$esc_str = chr(0xbf) . chr(0x5c);
diff --git a/ext/mysqli/tests/066.phpt b/ext/mysqli/tests/066.phpt
new file mode 100644
index 000000000..01434f8d3
--- /dev/null
+++ b/ext/mysqli/tests/066.phpt
@@ -0,0 +1,28 @@
+--TEST--
+function test: mysqli_warning object
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+ include "connect.inc";
+
+ /*** test mysqli_connect 127.0.0.1 ***/
+ $mysql = new mysqli($host, $user, $passwd, "test");
+
+ $mysql->query("DROP TABLE IF EXISTS test_warnings");
+
+ $mysql->query("CREATE TABLE test_warnings (a int not null)");
+
+ $mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)");
+
+ if (($warning = new mysqli_warning($mysql))) {
+ do {
+ printf("Warning\n");
+ } while ($warning->next());
+ }
+
+ $mysql->close();
+?>
+--EXPECT--
+Warning
diff --git a/ext/mysqli/tests/067.phpt b/ext/mysqli/tests/067.phpt
new file mode 100644
index 000000000..d58d24cfe
--- /dev/null
+++ b/ext/mysqli/tests/067.phpt
@@ -0,0 +1,51 @@
+--TEST--
+function test: nested selects (cursors)
+--SKIPIF--
+<?php
+ require_once('skipif.inc');
+ /* skip cursor test for versions < 50004 */
+ if (mysqli_get_client_version() < 50009) {
+ die("skip Client library doesn't support cursors");
+ }
+?>
+--FILE--
+<?php
+
+ function open_cursor($mysql, $query) {
+ $stmt = $mysql->prepare($query);
+ $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY);
+ return $stmt;
+ }
+
+ include "connect.inc";
+ $a = array();
+
+ /*** test mysqli_connect 127.0.0.1 ***/
+ $mysql = new mysqli($host, $user, $passwd, "test");
+
+ for ($i=0;$i < 3; $i++) {
+ $mysql->query("DROP TABLE IF EXISTS cursor$i");
+ $mysql->query("CREATE TABLE cursor$i (a int not null)");
+ $mysql->query("INSERT INTO cursor$i VALUES (1),(2),(3),(4),(5),(6)");
+ $stmt[$i] = open_cursor($mysql, "SELECT a FROM cursor$i");
+ $stmt[$i]->execute();
+ $stmt[$i]->bind_result($a[$i]);
+ }
+
+
+ $cnt = 0;
+ while ($stmt[0]->fetch()) {
+ $stmt[1]->fetch();
+ $stmt[2]->fetch();
+ $cnt += $a[0] + $a[1] + $a[2];
+ }
+
+ for ($i=0; $i < 3; $i++) {
+ $stmt[$i]->close();
+ }
+
+ $mysql->close();
+ var_dump($cnt);
+?>
+--EXPECT--
+int(63)
diff --git a/ext/mysqli/tests/bug28817.phpt b/ext/mysqli/tests/bug28817.phpt
new file mode 100644
index 000000000..0cc8b1361
--- /dev/null
+++ b/ext/mysqli/tests/bug28817.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Bug #28817 testcase (properties)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ class my_mysql extends mysqli {
+ public $p_test;
+
+ function __construct() {
+ $this->p_test[] = "foo";
+ $this->p_test[] = "bar";
+ }
+ }
+
+
+ $mysql = new my_mysql();
+
+ var_dump($mysql->p_test);
+ @var_dump($mysql->errno);
+
+ $mysql->connect($host, $user, $passwd);
+ $mysql->select_db("nonexistingdb");
+
+ var_dump($mysql->errno > 0);
+
+ $mysql->close();
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ string(3) "foo"
+ [1]=>
+ string(3) "bar"
+}
+NULL
+bool(true)
diff --git a/ext/mysqli/tests/bug32405.phpt b/ext/mysqli/tests/bug32405.phpt
index 9b58e3611..f805dc798 100644
--- a/ext/mysqli/tests/bug32405.phpt
+++ b/ext/mysqli/tests/bug32405.phpt
@@ -9,6 +9,7 @@ Bug #32405
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
+ mysqli_query($link, "SET sql_mode=''");
/* two fields are needed. the problem does not occur with 1 field only selected. */
$link->query("CREATE TABLE test_users(user_id int(10) unsigned NOT NULL auto_increment, login varchar(50) default '', PRIMARY KEY (user_id))");
diff --git a/ext/mysqli/tests/bug33491.phpt b/ext/mysqli/tests/bug33491.phpt
new file mode 100644
index 000000000..067e489aa
--- /dev/null
+++ b/ext/mysqli/tests/bug33491.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #33491 (extended mysqli class crashes when result is not object)
+--INI--
+error_reporting=4095
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+class DB extends mysqli
+{
+ public function query_single($query) {
+ $result = parent::query($query);
+ $result->fetch_row(); // <- Here be crash
+ }
+}
+
+require_once dirname(__FILE__)."/connect.inc";
+
+// Segfault when using the DB class which extends mysqli
+$DB = new DB($host, $user, $passwd, '');
+$DB->query_single('SELECT DATE()');
+
+?>
+--EXPECTF--
+Fatal error: Call to a member function fetch_row() on a non-object in %sbug33491.php on line %d
diff --git a/ext/mysqli/tests/bug34785.phpt b/ext/mysqli/tests/bug34785.phpt
new file mode 100644
index 000000000..a2b9f2288
--- /dev/null
+++ b/ext/mysqli/tests/bug34785.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #32405
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ include ("connect.inc");
+
+ class my_stmt extends mysqli_stmt
+ {
+ public function __construct($link, $query) {
+ parent::__construct($link, $query);
+ }
+ }
+
+ class my_result extends mysqli_result
+ {
+ public function __construct($link, $query) {
+ parent::__construct($link, $query);
+ }
+ }
+
+ /*** test mysqli_connect 127.0.0.1 ***/
+ $link = mysqli_connect($host, $user, $passwd);
+ mysqli_query($link, "SET sql_mode=''");
+
+ $stmt = new my_stmt($link, "SELECT 'foo' FROM DUAL");
+
+ $stmt->execute();
+ $stmt->bind_result($var);
+ $stmt->fetch();
+
+ $stmt->close();
+ var_dump($var);
+
+ mysqli_real_query($link, "SELECT 'bar' FROM DUAL");
+ $result = new my_result($link, MYSQLI_STORE_RESULT);
+ $row = $result->fetch_row();
+ $result->close();
+
+ var_dump($row[0]);
+
+ mysqli_close($link);
+?>
+--EXPECT--
+string(3) "foo"
+string(3) "bar"
diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt
new file mode 100644
index 000000000..12d6ce2e9
--- /dev/null
+++ b/ext/mysqli/tests/bug34810.phpt
@@ -0,0 +1,38 @@
+--TEST--
+bug #34810 (mysqli::init() and others use wrong $this pointer without checks)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+class DbConnection {
+ public function connect() {
+ include "connect.inc";
+
+ $link = mysqli::connect($host, $user, $passwd);
+ var_dump($link);
+
+ $link = mysqli::init();
+ var_dump($link);
+
+ $mysql = new mysqli($host, $user, $passwd, "test");
+ $mysql->query("DROP TABLE IF EXISTS test_warnings");
+ $mysql->query("CREATE TABLE test_warnings (a int not null)");
+ $mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)");
+ var_dump(mysqli_warning::__construct($mysql));
+ }
+}
+
+$db = new DbConnection();
+$db->connect();
+
+echo "Done\n";
+?>
+--EXPECTF--
+object(mysqli)#%d (0) {
+}
+object(mysqli)#%d (0) {
+}
+object(mysqli_warning)#%d (0) {
+}
+Done
diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc
index aa1d30a17..2fcf4ff0f 100644
--- a/ext/mysqli/tests/connect.inc
+++ b/ext/mysqli/tests/connect.inc
@@ -2,9 +2,22 @@
/* default values are localhost, root and empty password
Change the values if you use another configuration */
+ $driver = new mysqli_driver;
- $host = "localhost";
- $user = "root";
- $passwd = "";
+ if (!$driver->embedded) {
+ $host = "localhost";
+ $user = "root";
+ $passwd = "";
+ } else {
+ $path = dirname(__FILE__);
+ $host = $user = $passwd = NULL;
+ $args = array(
+ "--datadir=$path",
+ "--innodb_data_home_dir=$path",
+ "--innodb_data_file_path=ibdata1:10M:autoextend",
+ "--log-error=$path/testrun.log"
+ );
+ $driver->embedded_server_start(TRUE, $args, NULL);
+ }
?>
diff --git a/ext/mysqli/tests/skipif.inc b/ext/mysqli/tests/skipif.inc
index 68a9c7cf0..f471b5e12 100644
--- a/ext/mysqli/tests/skipif.inc
+++ b/ext/mysqli/tests/skipif.inc
@@ -1,4 +1,10 @@
<?php
- if (!extension_loaded('mysqli'))
- die('skip mysqli extension not available');
+if (!extension_loaded('mysqli')){
+ die('skip mysqli extension not available');
+}
+include "connect.inc";
+$driver = new mysqli_driver();
+if (!$driver->embedded && !@mysqli_connect($host, $user, $passwd, "", 3306)) {
+ die('skip could not connect to MySQL');
+}
?>
diff --git a/ext/mysqli/tests/skipifemb.inc b/ext/mysqli/tests/skipifemb.inc
new file mode 100644
index 000000000..298c7219a
--- /dev/null
+++ b/ext/mysqli/tests/skipifemb.inc
@@ -0,0 +1,5 @@
+<?php
+ $driver = new mysqli_driver();
+ if ($driver->embedded)
+ die("skip test doesn't run with embedded server");
+?>
diff --git a/ext/ncurses/config.m4 b/ext/ncurses/config.m4
index 7649ffd20..b4f214c99 100644
--- a/ext/ncurses/config.m4
+++ b/ext/ncurses/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.17 2003/12/09 20:33:08 sniper Exp $
+dnl $Id: config.m4,v 1.19 2005/05/29 23:16:42 sniper Exp $
dnl
PHP_ARG_WITH(ncurses, for ncurses support,
-[ --with-ncurses[=DIR] Include ncurses support (CLI/CGI only).])
+[ --with-ncurses[=DIR] Include ncurses support (CLI/CGI only)])
if test "$PHP_NCURSES" != "no"; then
@@ -40,18 +40,18 @@ if test "$PHP_NCURSES" != "no"; then
PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL, [
AC_DEFINE(HAVE_NCURSESLIB,1,[ ])
- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $NCURSES_DIR/lib, NCURSES_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $NCURSES_DIR/$PHP_LIBDIR, NCURSES_SHARED_LIBADD)
PHP_CHECK_LIBRARY(panel, new_panel, [
AC_DEFINE(HAVE_NCURSES_PANEL,1,[ ])
- PHP_ADD_LIBRARY_WITH_PATH(panel, $NCURSES_DIR/lib, NCURSES_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(panel, $NCURSES_DIR/$PHP_LIBDIR, NCURSES_SHARED_LIBADD)
], [], [
- -L$NCURSES_DIR/lib -l$LIBNAME -lm
+ -L$NCURSES_DIR/$PHP_LIBDIR -l$LIBNAME -lm
])
], [
AC_MSG_ERROR(Wrong ncurses lib version or lib not found)
], [
- -L$NCURSES_DIR/lib -lm
+ -L$NCURSES_DIR/$PHP_LIBDIR -lm
])
AC_CHECK_LIB($LIBNAME, color_set, [AC_DEFINE(HAVE_NCURSES_COLOR_SET, 1, [ ])])
diff --git a/ext/ncurses/ncurses.c b/ext/ncurses/ncurses.c
index eedd8a32c..1c1516236 100644
--- a/ext/ncurses/ncurses.c
+++ b/ext/ncurses/ncurses.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -59,8 +59,8 @@ zend_module_entry ncurses_module_entry = {
ncurses_functions,
PHP_MINIT(ncurses),
PHP_MSHUTDOWN(ncurses),
- PHP_RINIT(ncurses), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(ncurses), /* Replace with NULL if there's nothing to do at request end */
+ NULL,
+ NULL,
PHP_MINFO(ncurses),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
@@ -264,24 +264,6 @@ PHP_MSHUTDOWN_FUNCTION(ncurses)
}
/* }}} */
-/* Remove if there's nothing to do at request start */
-/* {{{ PHP_RINIT_FUNCTION
- */
-PHP_RINIT_FUNCTION(ncurses)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* Remove if there's nothing to do at request end */
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(ncurses)
-{
- return SUCCESS;
-}
-/* }}} */
-
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(ncurses)
diff --git a/ext/ncurses/ncurses_fe.c b/ext/ncurses/ncurses_fe.c
index 71e6a7816..59f0a8b0e 100644
--- a/ext/ncurses/ncurses_fe.c
+++ b/ext/ncurses/ncurses_fe.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/ncurses/ncurses_functions.c b/ext/ncurses/ncurses_functions.c
index 90d416eb4..096c9b7c5 100644
--- a/ext/ncurses/ncurses_functions.c
+++ b/ext/ncurses/ncurses_functions.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -84,7 +84,7 @@ PHP_FUNCTION(ncurses_color_set)
/* }}} */
#endif
-/* {{{ proto int ncurses_delwin(resource window)
+/* {{{ proto bool ncurses_delwin(resource window)
Deletes a ncurses window */
PHP_FUNCTION(ncurses_delwin)
{
@@ -98,6 +98,7 @@ PHP_FUNCTION(ncurses_delwin)
FETCH_WINRES(w, &handle);
zend_list_delete(Z_LVAL_P(handle));
+ RETURN_TRUE;
}
/* }}} */
@@ -149,7 +150,7 @@ PHP_FUNCTION(ncurses_init)
c.value = *zscr;
zval_copy_ctor(&c.value);
c.flags = CONST_CS;
- c.name = zend_strndup(ZEND_STRS("STDSCR"));
+ c.name = zend_strndup(ZEND_STRL("STDSCR"));
c.name_len = sizeof("STDSCR");
zend_register_constant(&c TSRMLS_CC);
@@ -162,7 +163,7 @@ PHP_FUNCTION(ncurses_init)
c.value = *zscr; \
zval_copy_ctor(&c.value); \
c.flags = CONST_CS; \
- c.name = zend_strndup(ZEND_STRS("NCURSES_" #x)); \
+ c.name = zend_strndup(ZEND_STRL("NCURSES_" #x)); \
c.name_len = sizeof("NCURSES_" #x); \
zend_register_constant(&c TSRMLS_CC)
diff --git a/ext/ncurses/php_ncurses.h b/ext/ncurses/php_ncurses.h
index 6d17f9b4b..6b0ebcce6 100644
--- a/ext/ncurses/php_ncurses.h
+++ b/ext/ncurses/php_ncurses.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -47,8 +47,6 @@ extern function_entry ncurses_functions[];
PHP_MINIT_FUNCTION(ncurses);
PHP_MSHUTDOWN_FUNCTION(ncurses);
-PHP_RINIT_FUNCTION(ncurses);
-PHP_RSHUTDOWN_FUNCTION(ncurses);
PHP_MINFO_FUNCTION(ncurses);
ZEND_BEGIN_MODULE_GLOBALS(ncurses)
diff --git a/ext/ncurses/php_ncurses_fe.h b/ext/ncurses/php_ncurses_fe.h
index 62dca40f8..3397d9cbd 100644
--- a/ext/ncurses/php_ncurses_fe.h
+++ b/ext/ncurses/php_ncurses_fe.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4
index 48ac58746..591b6861c 100644
--- a/ext/oci8/config.m4
+++ b/ext/oci8/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.50.2.3 2005/02/25 11:32:01 tony2001 Exp $
+dnl $Id: config.m4,v 1.55 2005/05/29 23:16:42 sniper Exp $
dnl
AC_DEFUN([PHP_OCI_IF_DEFINED],[
@@ -18,30 +18,20 @@ AC_DEFUN([PHP_OCI_IF_DEFINED],[
])
])
-AC_DEFUN([AC_OCI8_VERSION],[
- AC_MSG_CHECKING([Oracle version])
- if test -s "$OCI8_DIR/orainst/unix.rgs"; then
- OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
- test -z "$OCI8_VERSION" && OCI8_VERSION=7.3
- elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
- OCI8_VERSION=10.1
- elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
- OCI8_VERSION=9.0
- elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
- OCI8_VERSION=8.1
- elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then
- OCI8_VERSION=8.0
- elif test -f $OCI8_DIR/lib/libclntsh.a; then
- if test -f $OCI8_DIR/lib/libcore4.a; then
- OCI8_VERSION=8.0
- else
- OCI8_VERSION=8.1
- fi
+AC_DEFUN([AC_OCI8_CHECK_LIB_DIR],[
+ PHP_CHECK_64BIT([ TMP_OCI8_LIB_DIR=lib32 ], [ TMP_OCI8_LIB_DIR=lib ])
+ AC_MSG_CHECKING([OCI8 libraries dir])
+ if test -d "$OCI8_DIR/lib" -a ! -d "$OCI8_DIR/lib32"; then
+ OCI8_LIB_DIR=lib
+ elif ! test -d "$OCI8_DIR/lib" -a -d "$OCI8_DIR/lib32"; then
+ OCI8_LIB_DIR=lib32
+ elif test -d "$OCI8_DIR/lib" -a -d "$OCI8_DIR/lib32"; then
+ OCI8_LIB_DIR=$TMP_OCI8_LIB_DIR
else
AC_MSG_ERROR([Oracle (OCI8) required libraries not found])
fi
- AC_MSG_RESULT($OCI8_VERSION)
-])
+ AC_MSG_RESULT($OCI8_LIB_DIR)
+])
AC_DEFUN([AC_OCI8IC_VERSION],[
AC_MSG_CHECKING([Oracle Instant Client version])
@@ -60,6 +50,32 @@ AC_DEFUN([AC_OCI8IC_VERSION],[
AC_MSG_RESULT([$OCI8_VERSION])
])
+
+AC_DEFUN([AC_OCI8_VERSION],[
+ AC_MSG_CHECKING([Oracle version])
+ if test -s "$OCI8_DIR/orainst/unix.rgs"; then
+ OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
+ test -z "$OCI8_VERSION" && OCI8_VERSION=7.3
+ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
+ OCI8_VERSION=10.1
+ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
+ OCI8_VERSION=9.0
+ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
+ OCI8_VERSION=8.1
+ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then
+ OCI8_VERSION=8.0
+ elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.a; then
+ if test -f $OCI8_DIR/$OCI8_LIB_DIR/libcore4.a; then
+ OCI8_VERSION=8.0
+ else
+ OCI8_VERSION=8.1
+ fi
+ else
+ AC_MSG_ERROR(Oracle-OCI8 needed libraries not found)
+ fi
+ AC_MSG_RESULT($OCI8_VERSION)
+])
+
PHP_ARG_WITH(oci8, for Oracle (OCI8) support using ORACLE_HOME installation,
[ --with-oci8[=DIR] Include Oracle (OCI8) support using an ORACLE_HOME
install. The default DIR is ORACLE_HOME])
@@ -71,13 +87,12 @@ if test "$PHP_OCI8" = "no"; then
Oracle Instant Client. DIR is the directory with the
Instant Client libraries. On Linux it will default to
/usr/lib/oracle/<most_recent_version>/client/lib
- Other platforms will need to have it explicitly specified.])
+ Other platforms will need to have it explicitly specified])
else
PHP_OCI8_INSTANT_CLIENT="no";
fi
if test "$PHP_OCI8" != "no"; then
-
if test "$PHP_OCI8_INSTANT_CLIENT" != "no"; then
AC_MSG_ERROR([--with-oci8 and --with-oci8-instant-client are mutually exclusive])
fi
@@ -90,6 +105,8 @@ if test "$PHP_OCI8" != "no"; then
fi
AC_MSG_RESULT($OCI8_DIR)
+ AC_OCI8_CHECK_LIB_DIR($OCI8_DIR)
+
if test -d "$OCI8_DIR/rdbms/public"; then
PHP_ADD_INCLUDE($OCI8_DIR/rdbms/public)
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/public"
@@ -107,24 +124,25 @@ if test "$PHP_OCI8" != "no"; then
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/plsql/public"
fi
- if test -f "$OCI8_DIR/lib/sysliblist"; then
- PHP_EVAL_LIBLINE(`cat $OCI8_DIR/lib/sysliblist`, OCI8_SYSLIB)
- elif test -f "$OCI8_DIR/rdbms/lib/sysliblist"; then
- PHP_EVAL_LIBLINE(`cat $OCI8_DIR/rdbms/lib/sysliblist`, OCI8_SYSLIB)
+ if test -f "$OCI8_DIR/$OCI8_LIB_DIR/sysliblist"; then
+ PHP_EVAL_LIBLINE(`cat $OCI8_DIR/$OCI8_LIB_DIR/sysliblist`, OCI8_SYSLIB)
+ elif test -f "$OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist"; then
+ PHP_EVAL_LIBLINE(`cat $OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist`, OCI8_SYSLIB)
fi
AC_OCI8_VERSION($OCI8_DIR)
+
case $OCI8_VERSION in
8.0)
PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, "", OCI8_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(core4, "", OCI8_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(psa, "", OCI8_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(clntsh, $OCI8_DIR/lib, OCI8_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(clntsh, $OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD)
;;
8.1)
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
- PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
+ PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD)
dnl
dnl OCI_ATTR_STATEMENT is not available in all 8.1.x versions
@@ -134,7 +152,7 @@ if test "$PHP_OCI8" != "no"; then
9.0)
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
- PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
+ PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
dnl These functions are only available in version >= 9.2
@@ -145,24 +163,23 @@ if test "$PHP_OCI8" != "no"; then
AC_DEFINE(HAVE_OCI_9_2,1,[ ])
OCI8_VERSION=9.2
], [], [
- -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
+ -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD
])
], [], [
- -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
+ -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD
])
;;
-
+
10.1)
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
- PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
+ PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
AC_DEFINE(HAVE_OCI_9_2,1,[ ])
AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
AC_DEFINE(PHP_OCI8_HAVE_COLLECTIONS,1,[ ])
;;
-
*)
- AC_MSG_ERROR([Unsupported Oracle version])
+ AC_MSG_ERROR([Unsupported Oracle version!])
;;
esac
@@ -178,10 +195,10 @@ if test "$PHP_OCI8" != "no"; then
PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
], [], [
- -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
+ -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD
])
], [
- -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
+ -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD
])
dnl
@@ -191,17 +208,16 @@ if test "$PHP_OCI8" != "no"; then
[
AC_DEFINE(PHP_OCI8_HAVE_COLLECTIONS,1,[ ])
], [], [
- -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
+ -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD
])
-
PHP_NEW_EXTENSION(oci8, oci8.c, $ext_shared)
AC_DEFINE(HAVE_OCI8,1,[ ])
PHP_SUBST_OLD(OCI8_SHARED_LIBADD)
PHP_SUBST_OLD(OCI8_DIR)
PHP_SUBST_OLD(OCI8_VERSION)
-
+
elif test "$PHP_OCI8_INSTANT_CLIENT" != "no"; then
AC_MSG_CHECKING([Oracle Instant Client directory])
@@ -267,5 +283,5 @@ dnl Header directory for Instant Client SDK zip file install
PHP_SUBST_OLD(OCI8_SHARED_LIBADD)
PHP_SUBST_OLD(OCI8_DIR)
PHP_SUBST_OLD(OCI8_VERSION)
-
+
fi
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 7bc91e06e..5065087a6 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -22,7 +22,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.257.2.8 2005/06/13 09:31:03 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.269.2.3 2005/10/10 10:44:39 tony2001 Exp $ */
/* TODO list:
*
@@ -126,7 +126,7 @@ MUTEX_T mx_lock;
#define CALL_OCI(call) \
{ \
if (OCI(in_call)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI8 Recursive call!\n"); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI8 Recursive call!"); \
exit(-1); \
} else { \
OCI(in_call)=1; \
@@ -139,7 +139,7 @@ MUTEX_T mx_lock;
{ \
if (OCI(in_call)) { \
retcode=-1; \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI8 Recursive call!\n"); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI8 Recursive call!"); \
exit(-1); \
} else { \
OCI(in_call)=1; \
@@ -576,21 +576,21 @@ static void php_oci_init_globals(php_oci_globals *oci_globals_p TSRMLS_DC)
);
}
-static int _sessions_pcleanup(zend_llist *session_list TSRMLS_DC)
+static int _sessions_pcleanup(zend_llist *session_list)
{
zend_llist_destroy(session_list);
return 1;
}
-static int _session_pcleanup(oci_session *session TSRMLS_DC)
+static int _session_pcleanup(oci_session *session)
{
_oci_close_session(session);
return 1;
}
-static int _server_pcleanup(oci_server *server TSRMLS_DC)
+static int _server_pcleanup(oci_server *server)
{
_oci_close_server(server);
@@ -786,7 +786,7 @@ 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.257.2.8 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.3 $");
sprintf(buf, "%ld", num_persistent);
php_info_print_table_row(2, "Active Persistent Links", buf);
@@ -880,12 +880,12 @@ static int _oci_bind_post_exec(void *data TSRMLS_DC)
if (bind->indicator == -1) { /* NULL */
zval *val = bind->zval;
- if (Z_TYPE_P(val) == IS_STRING && (Z_STRVAL_P(val) != empty_string)) {
+ if (Z_TYPE_P(val) == IS_STRING) {
*Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
}
zval_dtor(val);
ZVAL_NULL(val);
- } else if (Z_TYPE_P(bind->zval) == IS_STRING && (Z_STRVAL_P(bind->zval) != empty_string)) {
+ } else if (Z_TYPE_P(bind->zval) == IS_STRING) {
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';
}
@@ -1015,7 +1015,7 @@ static void _oci_conn_list_dtor(oci_connection *connection TSRMLS_DC)
)
);
}
-
+
if (connection->pError) {
CALL_OCI(
OCIHandleFree(
@@ -1489,7 +1489,12 @@ static int _oci_make_zval(zval *value,oci_statement *statement,oci_out_column *c
if (oci_loadlob(statement->conn,descr,&buffer,&loblen)) {
ZVAL_FALSE(value);
} else {
- ZVAL_STRINGL(value,buffer,loblen,0);
+ if (loblen > 0) {
+ ZVAL_STRINGL(value,buffer,loblen,0);
+ }
+ else {
+ ZVAL_EMPTY_STRING(value);
+ }
}
} else {
/* return the locator */
@@ -2248,6 +2253,10 @@ static int oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char
return -1;
}
+ if (readlen == 0) {
+ return 0;
+ }
+
buf = emalloc(readlen + 1);
while (readlen > 0) { /* thies loop should not be entered on readlen == 0 */
@@ -2351,6 +2360,10 @@ static int oci_readlob(oci_connection *connection, oci_descriptor *mydescr, char
*len = 0;
return -1;
}
+
+ if (loblen == 0) {
+ return 0;
+ }
/* check if we're in LOB's borders */
if ((mydescr->lob_current_position + *len) > loblen) {
@@ -2879,7 +2892,6 @@ static oci_session *_oci_open_session(oci_server* server,char *username,char *pa
)
);
- session->num = zend_list_insert(session, le_session);
session->is_open = 1;
mutex_lock(mx_lock);
@@ -2892,6 +2904,7 @@ static oci_session *_oci_open_session(oci_server* server,char *username,char *pa
}
mutex_unlock(mx_lock);
+ session->num = zend_list_insert(session, le_session);
oci_debug("_oci_open_session new sess=%d user=%s",session->num,username);
return session;
@@ -3024,7 +3037,6 @@ static void _oci_close_session(oci_session *session)
)
);
#endif
-
if (session->exclusive) {
efree(session);
}
@@ -4016,7 +4028,12 @@ PHP_FUNCTION(oci_lob_load)
}
if (!oci_loadlob(descr->conn,descr,&buffer,&loblen)) {
- RETURN_STRINGL(buffer,loblen,0);
+ if (loblen > 0) {
+ RETURN_STRINGL(buffer,loblen,0);
+ }
+ else {
+ RETURN_EMPTY_STRING();
+ }
} else {
RETURN_FALSE;
}
@@ -4050,7 +4067,12 @@ PHP_FUNCTION(oci_lob_read)
loblen = Z_LVAL_PP(len);
if (oci_readlob(descr->conn,descr,&buffer,&loblen) == 0) {
- RETURN_STRINGL(buffer,loblen,0);
+ if (loblen > 0) {
+ RETURN_STRINGL(buffer,loblen,0);
+ }
+ else {
+ RETURN_EMPTY_STRING();
+ }
} else {
RETURN_FALSE;
}
diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h
index 7463c6afa..b9ddd3435 100644
--- a/ext/oci8/php_oci8.h
+++ b/ext/oci8/php_oci8.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_oci8.h,v 1.35 2004/04/29 12:59:22 iliaa Exp $ */
+/* $Id: php_oci8.h,v 1.36 2005/08/03 14:07:33 sniper Exp $ */
#if HAVE_OCI8
# ifndef PHP_OCI8_H
diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c
index efe14520d..9ed07f4b8 100644
--- a/ext/odbc/birdstep.c
+++ b/ext/odbc/birdstep.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: birdstep.c,v 1.11.2.1 2005/01/09 21:05:16 sniper Exp $ */
+/* $Id: birdstep.c,v 1.13 2005/08/03 14:07:34 sniper Exp $ */
/*
* TODO:
diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4
index 349af5a83..1285f789f 100644
--- a/ext/odbc/config.m4
+++ b/ext/odbc/config.m4
@@ -1,11 +1,17 @@
dnl
-dnl $Id: config.m4,v 1.65.2.6 2005/04/21 23:02:15 sniper Exp $
+dnl $Id: config.m4,v 1.78.2.1 2005/11/21 19:06:02 sniper Exp $
dnl
+AC_DEFUN([PHP_ODBC_CHECK_HEADER],[
+if ! test -f "$ODBC_INCDIR/$1"; then
+ AC_MSG_ERROR([ODBC header file '$ODBC_INCDIR/$1' not found!])
+fi
+])
+
dnl
dnl Figure out which library file to link with for the Solid support.
dnl
-AC_DEFUN([AC_FIND_SOLID_LIBS],[
+AC_DEFUN([PHP_ODBC_FIND_SOLID_LIBS],[
AC_MSG_CHECKING([Solid library file])
ac_solid_uname_r=`uname -r 2>/dev/null`
ac_solid_uname_s=`uname -s 2>/dev/null`
@@ -17,7 +23,7 @@ AC_DEFUN([AC_FIND_SOLID_LIBS],[
if ldd -v /bin/sh | grep GLIBC > /dev/null; then
AC_DEFINE(SS_LINUX,1,[Needed in sqlunix.h ])
ac_solid_os=l2x
- else
+ else
AC_DEFINE(SS_LINUX,1,[Needed in sqlunix.h ])
ac_solid_os=lux
fi;;
@@ -48,7 +54,7 @@ AC_DEFUN([AC_FIND_SOLID_LIBS],[
# Check for the library files, and setup the ODBC_LIBS path...
#
if test ! -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -a \
- ! -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a; then
+ ! -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a; then
#
# we have an error and should bail out, as we can't find the libs!
#
@@ -71,7 +77,8 @@ fi
dnl
dnl Figure out which library file to link with for the Empress support.
dnl
-AC_DEFUN([AC_FIND_EMPRESS_LIBS],[
+
+AC_DEFUN([PHP_ODBC_FIND_EMPRESS_LIBS],[
AC_MSG_CHECKING([Empress library file])
ODBC_LIBS=`echo $1/libempodbccl.so | cut -d' ' -f1`
if test ! -f $ODBC_LIBS; then
@@ -80,7 +87,7 @@ AC_DEFUN([AC_FIND_EMPRESS_LIBS],[
AC_MSG_RESULT(`echo $ODBC_LIBS | sed -e 's!.*/!!'`)
])
-AC_DEFUN([AC_FIND_EMPRESS_BCS_LIBS],[
+AC_DEFUN([PHP_ODBC_FIND_EMPRESS_BCS_LIBS],[
AC_MSG_CHECKING([Empress local access library file])
ODBCBCS_LIBS=`echo $1/libempodbcbcs.a | cut -d' ' -f1`
if test ! -f $ODBCBCS_LIBS; then
@@ -93,7 +100,7 @@ if test -z "$ODBC_TYPE"; then
AC_MSG_CHECKING(for Adabas support)
AC_ARG_WITH(adabas,
[ --with-adabas[=DIR] Include Adabas D support. DIR is the Adabas base
- install directory, defaults to /usr/local.],
+ install directory [/usr/local]],
[
PHP_WITH_SHARED
if test "$withval" = "yes"; then
@@ -101,8 +108,8 @@ AC_ARG_WITH(adabas,
fi
if test "$withval" != "no"; then
PHP_ADD_INCLUDE($withval/incl)
- PHP_ADD_LIBPATH($withval/lib)
- ODBC_OBJS="$withval/lib/odbclib.a"
+ PHP_ADD_LIBPATH($withval/$PHP_LIBDIR)
+ ODBC_OBJS="$withval/$PHP_LIBDIR/odbclib.a"
ODBC_LIB="$abs_builddir/ext/odbc/libodbc_adabas.a"
$srcdir/build/shtool mkdir -f -p ext/odbc
rm -f "$ODBC_LIB"
@@ -111,6 +118,7 @@ AC_ARG_WITH(adabas,
PHP_ADD_LIBRARY(sqlrte)
PHP_ADD_LIBRARY_WITH_PATH(odbc_adabas, $abs_builddir/ext/odbc)
ODBC_TYPE=adabas
+ PHP_ODBC_CHECK_HEADER(sqlext.h)
AC_DEFINE(HAVE_ADABAS,1,[ ])
AC_MSG_RESULT(yes)
else
@@ -125,7 +133,7 @@ if test -z "$ODBC_TYPE"; then
AC_MSG_CHECKING(for SAP DB support)
AC_ARG_WITH(sapdb,
[ --with-sapdb[=DIR] Include SAP DB support. DIR is SAP DB base
- install directory, defaults to /usr/local.],
+ install directory [/usr/local]],
[
PHP_WITH_SHARED
if test "$withval" = "yes"; then
@@ -159,7 +167,7 @@ AC_ARG_WITH(solid,
fi
if test "$withval" != "no"; then
ODBC_INCDIR=$withval/include
- ODBC_LIBDIR=$withval/lib
+ ODBC_LIBDIR=$withval/$PHP_LIBDIR
ODBC_INCLUDE=-I$ODBC_INCDIR
ODBC_TYPE=solid
if test -f $ODBC_LIBDIR/soc*35.a; then
@@ -170,7 +178,7 @@ AC_ARG_WITH(solid,
AC_DEFINE(HAVE_SOLID,1,[ ])
fi
AC_MSG_RESULT(yes)
- AC_FIND_SOLID_LIBS($ODBC_LIBDIR)
+ PHP_ODBC_FIND_SOLID_LIBS($ODBC_LIBDIR)
else
AC_MSG_RESULT(no)
fi
@@ -192,13 +200,11 @@ AC_ARG_WITH(ibm-db2,
ODBC_LIBDIR=/home/db2inst1/sqllib/lib
else
ODBC_INCDIR=$withval/include
- ODBC_LIBDIR=$withval/lib
+ ODBC_LIBDIR=$withval/$PHP_LIBDIR
fi
- if ! test -f "$ODBC_INCDIR/sqlcli1.h"; then
- AC_MSG_ERROR([IBM DB2 header files not found])
- fi
-
+ PHP_ODBC_CHECK_HEADER(sqlcli1.h)
+
ODBC_INCLUDE=-I$ODBC_INCDIR
ODBC_LFLAGS=-L$ODBC_LIBDIR
ODBC_TYPE=db2
@@ -226,6 +232,33 @@ You need to source your DB2 environment before running PHP configure:
fi
if test -z "$ODBC_TYPE"; then
+AC_MSG_CHECKING(for ODBCRouter.com support)
+AC_ARG_WITH(ODBCRouter,
+[ --with-ODBCRouter[=DIR] Include ODBCRouter.com support. DIR is ODBCRouter base
+ install directory [/usr]],
+[
+ PHP_WITH_SHARED
+ if test "$withval" = "yes"; then
+ withval=/usr
+ fi
+ if test "$withval" != "no"; then
+ ODBC_INCDIR=$withval/include
+ ODBC_LIBDIR=$withval/lib
+ ODBC_LFLAGS=-L$ODBC_LIBDIR
+ ODBC_INCLUDE=-I$ODBC_INCDIR
+ ODBC_LIBS=-lodbcsdk
+ ODBC_TYPE=ODBCRouter
+ AC_DEFINE(HAVE_ODBC_ROUTER,1,[ ])
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+],[
+ AC_MSG_RESULT(no)
+])
+fi
+
+if test -z "$ODBC_TYPE"; then
AC_MSG_CHECKING(for Empress support)
AC_ARG_WITH(empress,
[ --with-empress[=DIR] Include Empress support. DIR is the Empress base
@@ -247,7 +280,7 @@ AC_ARG_WITH(empress,
ODBC_TYPE=empress
AC_DEFINE(HAVE_EMPRESS,1,[ ])
AC_MSG_RESULT(yes)
- AC_FIND_EMPRESS_LIBS($ODBC_LIBDIR)
+ PHP_ODBC_FIND_EMPRESS_LIBS($ODBC_LIBDIR)
else
AC_MSG_RESULT(no)
fi
@@ -261,9 +294,8 @@ AC_MSG_CHECKING(for Empress local access support)
AC_ARG_WITH(empress-bcs,
[ --with-empress-bcs[=DIR]
Include Empress Local Access support. DIR is the
- Empress base install directory, defaults to
- \$EMPRESSPATH. From PHP 4, this option only supports
- Empress Version 8.60 and above.],
+ Empress base install directory. (Empress Version >= 8.60 required)
+ [\$EMPRESSPATH]],
[
PHP_WITH_SHARED
if test "$withval" != "no"; then
@@ -295,7 +327,7 @@ AC_ARG_WITH(empress-bcs,
ODBC_TYPE=empress
AC_DEFINE(HAVE_EMPRESS,1,[ ])
AC_MSG_RESULT(yes)
- AC_FIND_EMPRESS_BCS_LIBS($ODBC_LIBDIR)
+ PHP_ODBC_FIND_EMPRESS_BCS_LIBS($ODBC_LIBDIR)
else
AC_MSG_RESULT(no)
fi
@@ -308,7 +340,7 @@ if test -z "$ODBC_TYPE"; then
AC_MSG_CHECKING(for Birdstep support)
AC_ARG_WITH(birdstep,
[ --with-birdstep[=DIR] Include Birdstep support. DIR is the Birdstep base
- install directory, defaults to /usr/local/birdstep.],
+ install directory [/usr/local/birdstep]],
[
PHP_WITH_SHARED
@@ -318,7 +350,7 @@ AC_ARG_WITH(birdstep,
ODBC_LIBDIR=/usr/local/birdstep/lib
else
ODBC_INCDIR=$withval/include
- ODBC_LIBDIR=$withval/lib
+ ODBC_LIBDIR=$withval/$PHP_LIBDIR
fi
case $host_alias in
@@ -342,10 +374,10 @@ AC_ARG_WITH(birdstep,
ODBC_TYPE=birdstep
ODBC_LFLAGS=-L$ODBC_LIBDIR
ODBC_LIBS="-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil"
-
- if test -e "$ODBC_LIBDIR/libCrdbc32.$SHLIB_SUFFIX_NAME"; then
+
+ if test -f "$ODBC_LIBDIR/libCrdbc32.$SHLIB_SUFFIX_NAME"; then
ODBC_LIBS="-lCrdbc32 -lCadm32 -lCncp32 -lCrm32 -lCsql32 -lCdict32 -lCrdm32 -lCrpc32 -lutil"
- elif test -e "$ODBC_LIBDIR/libCrdbc.$SHLIB_SUFFIX_NAME"; then
+ elif test -f "$ODBC_LIBDIR/libCrdbc.$SHLIB_SUFFIX_NAME"; then
ODBC_LIBS="-lCrdbc -lCadm -lCncp -lCrm -lCsql -lCdict -lCrdm -lCrpc -lutil"
fi
@@ -374,14 +406,14 @@ AC_ARG_WITH(custom-odbc,
run configure script:
CPPFLAGS=\"-DODBC_QNX -DSQLANY_BUG\"
LDFLAGS=-lunix
- CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\".],
+ CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\"],
[
if test "$withval" = "yes"; then
withval=/usr/local
fi
if test "$withval" != "no"; then
ODBC_INCDIR=$withval/include
- ODBC_LIBDIR=$withval/lib
+ ODBC_LIBDIR=$withval/$PHP_LIBDIR
ODBC_LFLAGS=-L$ODBC_LIBDIR
ODBC_INCLUDE=-I$ODBC_INCDIR
ODBC_LIBS=$CUSTOM_ODBC_LIBS
@@ -400,7 +432,7 @@ if test -z "$ODBC_TYPE"; then
AC_MSG_CHECKING(for iODBC support)
AC_ARG_WITH(iodbc,
[ --with-iodbc[=DIR] Include iODBC support. DIR is the iODBC base
- install directory, defaults to /usr/local.],
+ install directory [/usr/local]],
[
PHP_WITH_SHARED
if test "$withval" = "yes"; then
@@ -411,7 +443,7 @@ AC_ARG_WITH(iodbc,
PHP_ADD_INCLUDE($withval/include, 1)
ODBC_TYPE=iodbc
ODBC_INCLUDE=-I$withval/include
- ODBC_LFLAGS=-L$withval/lib
+ ODBC_LFLAGS=-L$withval/$PHP_LIBDIR
ODBC_LIBS=-liodbc
AC_DEFINE(HAVE_IODBC,1,[ ])
AC_DEFINE(HAVE_ODBC2,1,[ ])
@@ -428,8 +460,7 @@ if test -z "$ODBC_TYPE"; then
AC_MSG_CHECKING(for Easysoft ODBC-ODBC Bridge support)
AC_ARG_WITH(esoob,
[ --with-esoob[=DIR] Include Easysoft OOB support. DIR is the OOB base
- install directory,
- defaults to /usr/local/easysoft/oob/client.],
+ install directory [/usr/local/easysoft/oob/client]],
[
PHP_WITH_SHARED
if test "$withval" = "yes"; then
@@ -437,7 +468,7 @@ AC_ARG_WITH(esoob,
fi
if test "$withval" != "no"; then
ODBC_INCDIR=$withval/include
- ODBC_LIBDIR=$withval/lib
+ ODBC_LIBDIR=$withval/$PHP_LIBDIR
ODBC_LFLAGS=-L$ODBC_LIBDIR
ODBC_INCLUDE=-I$ODBC_INCDIR
ODBC_LIBS=-lesoobclient
@@ -456,7 +487,7 @@ if test -z "$ODBC_TYPE"; then
AC_MSG_CHECKING(for unixODBC support)
AC_ARG_WITH(unixODBC,
[ --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base
- install directory, defaults to /usr/local.],
+ install directory [/usr/local]],
[
PHP_WITH_SHARED
if test "$withval" = "yes"; then
@@ -464,11 +495,12 @@ AC_ARG_WITH(unixODBC,
fi
if test "$withval" != "no"; then
ODBC_INCDIR=$withval/include
- ODBC_LIBDIR=$withval/lib
+ ODBC_LIBDIR=$withval/$PHP_LIBDIR
ODBC_LFLAGS=-L$ODBC_LIBDIR
ODBC_INCLUDE=-I$ODBC_INCDIR
ODBC_LIBS=-lodbc
ODBC_TYPE=unixODBC
+ PHP_ODBC_CHECK_HEADER(sqlext.h)
AC_DEFINE(HAVE_UNIXODBC,1,[ ])
AC_MSG_RESULT(yes)
else
@@ -485,20 +517,20 @@ AC_ARG_WITH(dbmaker,
[ --with-dbmaker[=DIR] Include DBMaker support. DIR is the DBMaker base
install directory, defaults to where the latest
version of DBMaker is installed (such as
- /home/dbmaker/3.6).],
+ /home/dbmaker/3.6)],
[
PHP_WITH_SHARED
if test "$withval" = "yes"; then
# find dbmaker's home directory
- DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | awk -F: '{print $6}'`
+ DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | $AWK -F: '{print $6}'`
# check DBMaker version (from 5.0 to 2.0)
DBMAKER_VERSION=5.0
while test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a "$DBMAKER_VERSION" != "2.9"; do
- DM_VER=`echo $DBMAKER_VERSION | sed -e 's/\.//' | awk '{ print $1-1;}'`
- MAJOR_V=`echo $DM_VER | awk '{ print $1/10; }' | awk -F. '{ print $1; }'`
- MINOR_V=`echo $DM_VER | awk '{ print $1%10; }'`
+ DM_VER=`echo $DBMAKER_VERSION | sed -e 's/\.//' | $AWK '{ print $1-1;}'`
+ MAJOR_V=`echo $DM_VER | $AWK '{ print $1/10; }' | $AWK -F. '{ print $1; }'`
+ MINOR_V=`echo $DM_VER | $AWK '{ print $1%10; }'`
DBMAKER_VERSION=$MAJOR_V.$MINOR_V
done
@@ -513,7 +545,7 @@ AC_ARG_WITH(dbmaker,
if test "$withval" != "no"; then
ODBC_INCDIR=$withval/include
- ODBC_LIBDIR=$withval/lib
+ ODBC_LIBDIR=$withval/$PHP_LIBDIR
ODBC_INCLUDE=-I$ODBC_INCDIR
ODBC_LFLAGS=-L$ODBC_LIBDIR
ODBC_INCLUDE=-I$ODBC_INCDIR
diff --git a/ext/odbc/php_birdstep.h b/ext/odbc/php_birdstep.h
index 5e0d931c4..7c9e2ad79 100644
--- a/ext/odbc/php_birdstep.h
+++ b/ext/odbc/php_birdstep.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_birdstep.h,v 1.4 2004/01/08 17:32:34 sniper Exp $ */
+/* $Id: php_birdstep.h,v 1.5 2005/08/03 14:07:34 sniper Exp $ */
#ifndef PHP_BIRDSTEP_H
#define PHP_BIRDSTEP_H
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 57ac18563..3bd9cf531 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc.c,v 1.179.2.5 2005/07/02 22:50:01 edink Exp $ */
+/* $Id: php_odbc.c,v 1.189.2.1 2005/09/08 06:19:07 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -314,7 +314,11 @@ static PHP_INI_DISP(display_defPW)
PUTS("********");
#endif
} else {
- PUTS("<i>no value</i>");
+ if (PG(html_errors)) {
+ PUTS("<i>no value</i>");
+ } else {
+ PUTS("no value");
+ }
}
}
/* }}} */
@@ -504,6 +508,12 @@ PHP_MINIT_FUNCTION(odbc)
REGISTER_LONG_CONSTANT("SQL_QUICK", SQL_QUICK, CONST_PERSISTENT | CONST_CS);
#endif
+#if defined(HAVE_IBMDB2) && defined(_AIX)
+ /* atexit() handler in the DB2/AIX library segfaults in PHP CLI */
+ /* DB2NOEXITLIST env variable prevents DB2 from invoking atexit() */
+ putenv("DB2NOEXITLIST=TRUE");
+#endif
+
return SUCCESS;
}
/* }}} */
@@ -846,7 +856,7 @@ PHP_FUNCTION(odbc_prepare)
convert_to_string_ex(pv_query);
query = Z_STRVAL_PP(pv_query);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
result->numparams = 0;
@@ -1269,7 +1279,7 @@ PHP_FUNCTION(odbc_exec)
convert_to_string_ex(pv_query);
query = Z_STRVAL_PP(pv_query);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -1421,13 +1431,13 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
case SQL_VARBINARY:
case SQL_LONGVARBINARY:
if (result->binmode <= 0) {
- Z_STRVAL_P(tmp) = empty_string;
+ Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC();
break;
}
if (result->binmode == 1) sql_c_type = SQL_C_BINARY;
case SQL_LONGVARCHAR:
if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) {
- Z_STRVAL_P(tmp) = empty_string;
+ Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC();
break;
}
if (buf == NULL) buf = emalloc(result->longreadlen + 1);
@@ -1580,13 +1590,13 @@ PHP_FUNCTION(odbc_fetch_into)
case SQL_VARBINARY:
case SQL_LONGVARBINARY:
if (result->binmode <= 0) {
- Z_STRVAL_P(tmp) = empty_string;
+ Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC();
break;
}
if (result->binmode == 1) sql_c_type = SQL_C_BINARY;
case SQL_LONGVARCHAR:
if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) {
- Z_STRVAL_P(tmp) = empty_string;
+ Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC();
break;
}
@@ -2073,6 +2083,47 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
SQLSetConnectOption((*conn)->hdbc, SQL_TRANSLATE_OPTION,
SQL_SOLID_XLATOPT_NOCNV);
#endif
+#ifdef HAVE_ODBC_ROUTER
+ {
+#define CONNSTRSIZE 2048
+ char *lpszConnStr = emalloc(CONNSTRSIZE);
+ if (lpszConnStr && db) {
+ short cbszConnStr;
+ if (strstr(db, ";")) {
+ /* the caller has apparently passed a connection-string */
+ if (strstr(db, "uid") || strstr(db, "UID")) {
+ uid = NULL;
+ }
+ if (strstr(db, "pwd") || strstr(db, "PWD")) {
+ pwd = NULL;
+ }
+ strncpy( lpszConnStr, db, CONNSTRSIZE);
+ }
+ else {
+ strcpy(lpszConnStr, "DSN=");
+ strcat(lpszConnStr, db);
+ }
+ if (uid) {
+ if (uid[0]) {
+ strcat(lpszConnStr, ";UID=");
+ strcat(lpszConnStr, uid);
+ strcat(lpszConnStr, ";");
+ }
+ if (pwd) {
+ if (pwd[0]) {
+ strcat(lpszConnStr, "PWD=");
+ strcat(lpszConnStr, pwd);
+ strcat(lpszConnStr, ";");
+ }
+ }
+ }
+ rc = SQLDriverConnect((*conn)->hdbc, NULL, lpszConnStr, SQL_NTS,
+ lpszConnStr, CONNSTRSIZE, &cbszConnStr,
+ SQL_DRIVER_NOPROMPT);
+ efree(lpszConnStr);
+ }
+ }
+#else
#ifdef HAVE_OPENLINK
{
char dsnbuf[1024];
@@ -2131,6 +2182,7 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS);
#endif
#endif
+#endif
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
odbc_sql_error(*conn, SQL_NULL_HSTMT, "SQLConnect");
SQLFreeConnect((*conn)->hdbc);
@@ -2669,7 +2721,7 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
} else { /* last error message */
len = SQL_MAX_MESSAGE_LENGTH;
}
-
+
if (argc == 1) {
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_handle, -1, "ODBC-Link", le_conn, le_pconn);
ptr = ecalloc(len + 1, 1);
@@ -2798,7 +2850,7 @@ PHP_FUNCTION(odbc_tables)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -2882,7 +2934,7 @@ PHP_FUNCTION(odbc_columns)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -2962,7 +3014,7 @@ PHP_FUNCTION(odbc_columnprivileges)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -3039,7 +3091,7 @@ PHP_FUNCTION(odbc_foreignkeys)
fschema = Z_STRVAL_PP(pv_fschema);
convert_to_string_ex(pv_ftable);
ftable = Z_STRVAL_PP(pv_ftable);
-#if defined(HAVE_DBMAKER) || defined (HAVE_IBMDB2)
+#if defined(HAVE_DBMAKER) || defined(HAVE_IBMDB2)
#define EMPTY_TO_NULL(xstr) \
if ((int)strlen((xstr)) == 0) (xstr) = NULL
@@ -3056,7 +3108,7 @@ PHP_FUNCTION(odbc_foreignkeys)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -3131,7 +3183,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -3199,7 +3251,7 @@ PHP_FUNCTION(odbc_primarykeys)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -3277,7 +3329,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -3355,7 +3407,7 @@ PHP_FUNCTION(odbc_procedures)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -3437,7 +3489,7 @@ PHP_FUNCTION(odbc_specialcolumns)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -3518,7 +3570,7 @@ PHP_FUNCTION(odbc_statistics)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
@@ -3592,7 +3644,7 @@ PHP_FUNCTION(odbc_tableprivileges)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
- result = (odbc_result *)emalloc(sizeof(odbc_result));
+ result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h
index 4be00c85a..2c2b5bfe1 100644
--- a/ext/odbc/php_odbc.h
+++ b/ext/odbc/php_odbc.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc.h,v 1.58.2.1 2005/04/14 21:17:42 sniper Exp $ */
+/* $Id: php_odbc.h,v 1.60 2005/08/03 14:07:34 sniper Exp $ */
#ifndef PHP_ODBC_H
#define PHP_ODBC_H
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index 0a0a6d68a..254896fb3 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc_includes.h,v 1.9.2.1 2005/05/10 13:22:12 sniper Exp $ */
+/* $Id: php_odbc_includes.h,v 1.12 2005/08/03 14:07:34 sniper Exp $ */
#ifndef PHP_ODBC_INCLUDES_H
#define PHP_ODBC_INCLUDES_H
@@ -126,6 +126,20 @@ PHP_FUNCTION(solid_fetch_prev);
#include <sqlext.h>
#define HAVE_SQL_EXTENDED_FETCH 1
+#elif defined(HAVE_ODBC_ROUTER) /* ODBCRouter.com */
+
+#ifdef CHAR
+#undef CHAR
+#endif
+
+#ifdef SQLCHAR
+#undef SQLCHAR
+#endif
+
+#define ODBC_TYPE "ODBCRouter"
+#include <odbcsdk.h>
+#undef HAVE_SQL_EXTENDED_FETCH
+
#elif defined(HAVE_OPENLINK) /* OpenLink ODBC drivers */
#define ODBC_TYPE "Openlink"
diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4
index 23a04dd58..a805527a3 100644
--- a/ext/openssl/config0.m4
+++ b/ext/openssl/config0.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config0.m4,v 1.2.4.2 2005/01/01 14:35:29 wez Exp $
+dnl $Id: config0.m4,v 1.4 2005/01/01 14:32:58 wez Exp $
dnl
PHP_ARG_WITH(openssl, for OpenSSL support,
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 8b097c398..cc3f4e08d 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: openssl.c,v 1.89.2.7 2005/04/19 22:05:39 sniper Exp $ */
+/* $Id: openssl.c,v 1.98.2.1 2005/08/18 13:34:37 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -2152,7 +2152,7 @@ PHP_FUNCTION(openssl_pkey_get_private)
/* {{{ PKCS7 S/MIME functions */
-/* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts]]])
+/* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content]]]])
Verifys that the data block is intact, the signer is who they say they are, and returns the CERTs of the signers */
PHP_FUNCTION(openssl_pkcs7_verify)
{
@@ -2161,17 +2161,18 @@ PHP_FUNCTION(openssl_pkcs7_verify)
STACK_OF(X509) *signers= NULL;
STACK_OF(X509) *others = NULL;
PKCS7 * p7 = NULL;
- BIO * in = NULL, * datain = NULL;
+ BIO * in = NULL, * datain = NULL, * dataout = NULL;
long flags = 0;
char * filename; int filename_len;
char * extracerts = NULL; int extracerts_len;
char * signersfilename = NULL; int signersfilename_len;
+ char * datafilename = NULL; int datafilename_len;
RETVAL_LONG(-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|sas", &filename, &filename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|sass", &filename, &filename_len,
&flags, &signersfilename, &signersfilename_len, &cainfo,
- &extracerts, &extracerts_len) == FAILURE) {
+ &extracerts, &extracerts_len, &datafilename, &datafilename_len) == FAILURE) {
return;
}
@@ -2204,18 +2205,30 @@ PHP_FUNCTION(openssl_pkcs7_verify)
#endif
goto clean_exit;
}
+
+ if (datafilename) {
+
+ if (php_openssl_safe_mode_chk(datafilename TSRMLS_CC)) {
+ goto clean_exit;
+ }
+
+ dataout = BIO_new_file(datafilename, "w");
+ if (dataout == NULL) {
+ goto clean_exit;
+ }
+ }
#if DEBUG_SMIME
zend_printf("Calling PKCS7 verify\n");
#endif
- if (PKCS7_verify(p7, others, store, datain, NULL, flags)) {
+ if (PKCS7_verify(p7, others, store, datain, dataout, flags)) {
RETVAL_TRUE;
if (signersfilename) {
BIO *certout;
- if (php_openssl_safe_mode_chk(filename TSRMLS_CC)) {
+ if (php_openssl_safe_mode_chk(signersfilename TSRMLS_CC)) {
goto clean_exit;
}
@@ -2242,6 +2255,7 @@ clean_exit:
X509_STORE_free(store);
BIO_free(datain);
BIO_free(in);
+ BIO_free(dataout);
PKCS7_free(p7);
sk_X509_free(others);
}
@@ -3260,7 +3274,7 @@ SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
if (cafile || capath) {
if (!SSL_CTX_load_verify_locations(ctx, cafile, capath)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set verify locations `%s' `%s'\n", cafile, capath);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set verify locations `%s' `%s'", cafile, capath);
return NULL;
}
}
diff --git a/ext/openssl/openssl.mak b/ext/openssl/openssl.mak
new file mode 100644
index 000000000..4c907b8d7
--- /dev/null
+++ b/ext/openssl/openssl.mak
@@ -0,0 +1,185 @@
+# Temporarily here -- later may go into some batch file
+# which will set this as an environment variable
+PROJECT_ROOT = ..\..
+
+# Module details
+MODULE_NAME = php_ossl
+MODULE_DESC = "PHP 5 - OpenSSL Extension"
+VMAJ = 1
+VMIN = 0
+VREV = 0
+
+#include the common settings
+include $(PROJECT_ROOT)/netware/common.mif
+
+# OpenSSL directory
+OSSL_DIR = P:/APPS/script/sw/OpenSSL
+
+# Build type defaults to 'release'
+ifndef BUILD
+BUILD = release
+endif
+
+# Extensions of all input and output files
+.SUFFIXES:
+.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d
+
+# Source files
+C_SRC = openssl.c \
+ xp_ssl.c \
+ start.c \
+
+CPP_SRC_NODIR = $(notdir $(CPP_SRC))
+C_SRC_NODIR = $(notdir $(C_SRC))
+SRC_DIR = $(dir $(CPP_SRC) $(C_SRC))
+
+# Library files
+LIBRARY = $(OSSL_DIR)/lib/RSAglue.lib \
+ $(OSSL_DIR)/lib/crypto.lib \
+ $(OSSL_DIR)/lib/ssl.lib
+
+# Destination directories and files
+OBJ_DIR = $(BUILD)
+FINAL_DIR = $(BUILD)
+MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map
+OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj))
+DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d))
+
+# Binary file
+ifndef BINARY
+ BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm
+endif
+
+# Compile flags
+C_FLAGS += -c -maxerrors 25 -msgstyle gcc
+C_FLAGS += -wchar_t on -bool on -processor Pentium
+C_FLAGS += -nostdinc -nosyspath
+C_FLAGS += -relax_pointers # To remove type-casting errors
+C_FLAGS += -DNETWARE -DZTS
+C_FLAGS += -DUSE_OLD_FUNCTIONS -DCOMPILE_DL_OPENSSL=1
+
+C_FLAGS += -I. -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main
+C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware
+C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm
+C_FLAGS += -I- -I$(SDK_DIR)/include -I$(MWCIncludes)
+C_FLAGS += -I$(OSSL_DIR)/include
+
+ifndef STACK_SIZE
+STACK_SIZE=8192
+endif
+
+# Extra stuff based on debug / release builds
+ifeq '$(BUILD)' 'debug'
+ SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym
+ C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON
+ C_FLAGS += -exc cw -DZEND_DEBUG=1
+ LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE)
+ export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib
+else
+ C_FLAGS += -opt all -inline on -inline smart -inline auto -sym off
+ C_FLAGS += -opt intrinsics -opt level=4 -DZEND_DEBUG=0
+ LD_FLAGS += -sym off
+ export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
+endif
+
+
+# Dependencies
+MODULE = LibC \
+ phplib
+IMPORT = @$(SDK_DIR)/imports/libc.imp \
+ @$(SDK_DIR)/imports/ws2nlm.imp \
+ @$(SDK_DIR)/imports/netware.imp \
+ @$(MPK_DIR)/import/mpkOrg.imp \
+ @$(PROJECT_ROOT)/netware/phplib.imp
+EXPORT = ($(MODULE_NAME)) get_module
+API = OutputToScreen
+
+# Virtual paths
+vpath %.cpp .
+vpath %.c . ..\..\netware
+vpath %.obj $(OBJ_DIR)
+
+
+all: prebuild project
+
+.PHONY: all
+
+prebuild:
+ @if not exist $(OBJ_DIR) md $(OBJ_DIR)
+
+project: $(BINARY)
+ @echo Build complete.
+
+$(OBJ_DIR)/%.d: %.cpp
+ @echo Building Dependencies for $(<F)
+ @$(CC) -M $< $(C_FLAGS) -o $@
+
+$(OBJ_DIR)/%.d: %.c
+ @echo Building Dependencies for $(<F)
+ @$(CC) -M $< $(C_FLAGS) -o $@
+
+$(OBJ_DIR)/%.obj: %.cpp
+ @echo Compiling $?...
+ @$(CC) $< $(C_FLAGS) -o $@
+
+$(OBJ_DIR)/%.obj: %.c
+ @echo Compiling $?...
+ @$(CC) $< $(C_FLAGS) -o $@
+
+
+$(BINARY): $(OBJECTS)
+ @echo Import $(IMPORT) > $(basename $@).def
+ifdef API
+ @echo Import $(API) >> $(basename $@).def
+endif
+ @echo Module $(MODULE) >> $(basename $@).def
+ifdef EXPORT
+ @echo Export $(EXPORT) >> $(basename $@).def
+endif
+ @echo AutoUnload >> $(basename $@).def
+ifeq '$(BUILD)' 'debug'
+ @echo Debug >> $(basename $@).def
+endif
+ @echo Flag_On 0x00000008 >> $(basename $@).def
+ @echo Start _LibCPrelude >> $(basename $@).def
+ @echo Exit _LibCPostlude >> $(basename $@).def
+
+# Two functions imported to build the openssl extension
+ @echo Import GetProcessSwitchCount >> $(basename $@).def
+ @echo Import RunningProcess >> $(basename $@).def
+
+ $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc
+ @echo xdcdata $(basename $@).xdc >> $(basename $@).def
+
+ @echo Linking $@...
+ @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link
+
+ @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link
+
+ @$(LINK) @$(basename $@).link
+
+
+.PHONY: clean
+clean: cleanobj cleanbin
+
+.PHONY: cleand
+cleand:
+ @echo Deleting all dependency files...
+ -@del "$(OBJ_DIR)\*.d"
+
+.PHONY: cleanobj
+cleanobj:
+ @echo Deleting all object files...
+ -@del "$(OBJ_DIR)\*.obj"
+
+.PHONY: cleanbin
+cleanbin:
+ @echo Deleting binary files...
+ -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm"
+ @echo Deleting MAP, DEF files, etc....
+ -@del "$(FINAL_DIR)\$(MODULE_NAME).map"
+ -@del "$(FINAL_DIR)\$(MODULE_NAME).def"
+ -@del "$(FINAL_DIR)\$(MODULE_NAME).link"
+ifeq '$(BUILD)' 'debug'
+ -@del $(FINAL_DIR)\$(MODULE_NAME).sym
+endif
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 8568e5304..15820a61c 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_openssl.h,v 1.15 2004/01/08 17:32:36 sniper Exp $ */
+/* $Id: php_openssl.h,v 1.16 2005/08/03 14:07:36 sniper Exp $ */
#ifndef PHP_OPENSSL_H
#define PHP_OPENSSL_H
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 530d90493..f291eea85 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: xp_ssl.c,v 1.16.2.3 2005/01/04 03:45:40 iliaa Exp $ */
+/* $Id: xp_ssl.c,v 1.22.2.1 2005/09/07 15:36:23 dmitry Exp $ */
#include "php.h"
#include "ext/standard/file.h"
@@ -27,6 +27,10 @@
#include <openssl/x509.h>
#include <openssl/err.h>
+#ifdef NETWARE
+#include <sys/select.h>
+#endif
+
int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stream TSRMLS_DC);
SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC);
@@ -42,6 +46,8 @@ typedef struct _php_openssl_netstream_data_t {
int is_client;
int ssl_active;
php_stream_xport_crypt_method_t method;
+ unsigned state_set:1;
+ unsigned _spare:31;
} php_openssl_netstream_data_t;
php_stream_ops php_openssl_socket_ops;
@@ -88,6 +94,8 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes TSRMLS_DC)
case SSL_ERROR_WANT_WRITE:
/* re-negotiation, or perhaps the SSL layer needs more
* packets: retry in next iteration */
+ errno = EAGAIN;
+ retry = sslsock->s.is_blocked;
break;
case SSL_ERROR_SYSCALL:
if (ERR_peek_error() == 0) {
@@ -155,6 +163,7 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes TSRMLS_DC)
}
retry = 0;
+ errno = 0;
}
return retry;
}
@@ -206,7 +215,7 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
if (nr_bytes <= 0) {
retry = handle_ssl_error(stream, nr_bytes TSRMLS_CC);
- stream->eof = (retry == 0 && !SSL_pending(sslsock->ssl_handle));
+ stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle));
} else {
/* we got the data */
@@ -373,10 +382,13 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
int n, retry = 1;
if (cparam->inputs.activate && !sslsock->ssl_active) {
- if (sslsock->is_client) {
- SSL_set_connect_state(sslsock->ssl_handle);
- } else {
- SSL_set_accept_state(sslsock->ssl_handle);
+ if (!sslsock->state_set) {
+ if (sslsock->is_client) {
+ SSL_set_connect_state(sslsock->ssl_handle);
+ } else {
+ SSL_set_accept_state(sslsock->ssl_handle);
+ }
+ sslsock->state_set = 1;
}
do {
@@ -405,6 +417,8 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
}
X509_free(peer_cert);
+ } else {
+ n = errno == EAGAIN ? 0 : -1;
}
return n;
@@ -437,7 +451,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_
if (clisock >= 0) {
php_openssl_netstream_data_t *clisockdata;
- clisockdata = pemalloc(sizeof(*clisockdata), stream->is_persistent);
+ clisockdata = emalloc(sizeof(*clisockdata));
if (clisockdata == NULL) {
closesocket(clisock);
diff --git a/ext/oracle/CREDITS b/ext/oracle/CREDITS
deleted file mode 100644
index f06045fdc..000000000
--- a/ext/oracle/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-Oracle
-Stig Bakken, Mitch Golden, Rasmus Lerdorf, Andreas Karajannis, Thies C. Arntzen
diff --git a/ext/oracle/config.m4 b/ext/oracle/config.m4
deleted file mode 100644
index b4a828ac9..000000000
--- a/ext/oracle/config.m4
+++ /dev/null
@@ -1,159 +0,0 @@
-dnl
-dnl $Id: config.m4,v 1.30.2.1 2004/12/30 07:04:11 sniper Exp $
-dnl
-
-AC_DEFUN([AC_ORACLE_VERSION],[
- AC_MSG_CHECKING([Oracle version])
- if test -s "$ORACLE_DIR/orainst/unix.rgs"; then
- ORACLE_VERSION=`grep '"ocommon"' $ORACLE_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
- test -z "$ORACLE_VERSION" && ORACLE_VERSION=7.3
- elif test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
- ORACLE_VERSION=9.0
- elif test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
- ORACLE_VERSION=8.1
- elif test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then
- ORACLE_VERSION=8.0
- elif test -f $ORACLE_DIR/lib/libclntsh.a; then
- if test -f $ORACLE_DIR/lib/libcore4.a; then
- ORACLE_VERSION=8.0
- else
- ORACLE_VERSION=8.1
- fi
- else
- AC_MSG_ERROR(Oracle needed libraries not found)
- fi
- AC_MSG_RESULT($ORACLE_VERSION)
-])
-
-PHP_ARG_WITH(oracle, for Oracle-ORACLE support,
-[ --with-oracle[=DIR] Include Oracle-oci7 support. Default DIR is ORACLE_HOME.])
-
-if test "$PHP_ORACLE" != "no"; then
- AC_MSG_CHECKING([Oracle Install-Dir])
- if test "$PHP_ORACLE" = "yes"; then
- ORACLE_DIR=$ORACLE_HOME
- else
- ORACLE_DIR=$PHP_ORACLE
- fi
- AC_MSG_RESULT($ORACLE_DIR)
-
- if test -d "$ORACLE_DIR/rdbms/public"; then
- PHP_ADD_INCLUDE($ORACLE_DIR/rdbms/public)
- fi
- if test -d "$ORACLE_DIR/rdbms/demo"; then
- PHP_ADD_INCLUDE($ORACLE_DIR/rdbms/demo)
- fi
- if test -d "$ORACLE_DIR/network/public"; then
- PHP_ADD_INCLUDE($ORACLE_DIR/network/public)
- fi
- if test -d "$ORACLE_DIR/plsql/public"; then
- PHP_ADD_INCLUDE($ORACLE_DIR/plsql/public)
- fi
-
- if test -f "$ORACLE_DIR/lib/sysliblist"; then
- PHP_EVAL_LIBLINE(`cat $ORACLE_DIR/lib/sysliblist`, ORACLE_SHARED_LIBADD)
- elif test -f "$ORACLE_DIR/rdbms/lib/sysliblist"; then
- PHP_EVAL_LIBLINE(`cat $ORACLE_DIR/rdbms/lib/sysliblist`, ORACLE_SHARED_LIBADD)
- fi
-
- AC_ORACLE_VERSION($ORACLE_DIR)
- case $ORACLE_VERSION in
- 7.0|7.1)
- if test -f $ORACLE_DIR/lib/liboracle.$SHLIB_SUFFIX_NAME; then
- PHP_ADD_LIBRARY_WITH_PATH(oracle, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- else
- PHP_ADD_LIBRARY_WITH_PATH(core, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(cv6, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(nlsrtl, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(core, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(cv6, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(nlsrtl, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(sqlnet, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(ora, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(sqlnet, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- if test "$ext_shared" = "yes"; then
- ORACLE_SHARED_LIBADD="$ORACLE_DIR/lib/osntab.o $ORACLE_SHARED_LIBADD";
- else
- LIBS="$ORACLE_DIR/lib/osntab.o $LIBS";
- fi
- PHP_ADD_LIBRARY_WITH_PATH(ocic, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- if test "`uname -s 2>/dev/null`" = "AIX"; then
- if test "$ext_shared" = "yes"; then
- ORACLE_SHARED_LIBADD="$ORACLE_SHARED_LIBADD -bI:$ORACLE_DIR/lib/mili.exp"
- else
- LIBS="$LIBS -bI:$ORACLE_DIR/lib/mili.exp"
- fi
- fi
- fi
- ;;
-
- 7.2)
- if test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME; then
- PHP_ADD_LIBRARY_WITH_PATH(clntsh, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- else
- PHP_ADD_LIBRARY_WITH_PATH(core3, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(c3v6, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(ora, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(sqlnet, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(ora, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(sqlnet, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- if test "$ext_shared" = "yes"; then
- ORACLE_SHARED_LIBADD="$ORACLE_DIR/lib/osntab.o $ORACLE_SHARED_LIBADD";
- else
- LIBS="$ORACLE_DIR/lib/osntab.o $LIBS";
- fi
- PHP_ADD_LIBRARY_WITH_PATH(ocic, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- fi
- ;;
-
- 7.3)
- if test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME; then
- PHP_ADD_LIBRARY_WITH_PATH(clntsh, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- else
- PHP_ADD_LIBRARY_WITH_PATH(core3, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(core3, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(c3v6, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(epc, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(generic, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(common, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(client, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(sqlnet, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(ncr, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(sqlnet, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(generic, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(common, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(client, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(sqlnet, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(ncr, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(sqlnet, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(client, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- fi
- ;;
-
- 8.0)
- PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, "", ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(core4, "", ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(psa, "", ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(clntsh, $ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- ;;
-
- 8.1|9.0)
- PHP_ADD_LIBRARY(clntsh, 1, ORACLE_SHARED_LIBADD)
- PHP_ADD_LIBPATH($ORACLE_DIR/lib, ORACLE_SHARED_LIBADD)
- ;;
- *)
- AC_MSG_ERROR(Unsupported Oracle version!)
- ;;
- esac
-
- PHP_NEW_EXTENSION(oracle, oracle.c, $ext_shared)
- AC_DEFINE(HAVE_ORACLE,1,[ ])
-
- PHP_SUBST_OLD(ORACLE_SHARED_LIBADD)
- PHP_SUBST_OLD(ORACLE_DIR)
- PHP_SUBST_OLD(ORACLE_VERSION)
-fi
diff --git a/ext/oracle/config.w32 b/ext/oracle/config.w32
deleted file mode 100644
index be59e0889..000000000
--- a/ext/oracle/config.w32
+++ /dev/null
@@ -1,18 +0,0 @@
-// $Id: config.w32,v 1.2 2004/01/07 20:06:29 wez Exp $
-// vim:ft=javascript
-
-ARG_WITH("oracle", "ORACLE support", "no");
-
-if (PHP_ORACLE != "no") {
-
- if (CHECK_HEADER_ADD_INCLUDE("winoci.h", "CFLAGS_ORACLE", PHP_PHP_BUILD + "\\oci7*\\include;" + PHP_ORACLE) &&
- CHECK_LIB("ociw32.lib", "oracle", PHP_ORACLE, "oci7")) {
- EXTENSION('oracle', 'oracle.c');
-
- AC_DEFINE('HAVE_ORACLE', 1);
-
- } else {
- WARNING("oracle not enabled; libraries and headers not found");
- }
-}
-
diff --git a/ext/oracle/oracle.c b/ext/oracle/oracle.c
deleted file mode 100644
index efeaca94a..000000000
--- a/ext/oracle/oracle.c
+++ /dev/null
@@ -1,1770 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Stig Sæther Bakken <ssb@php.net> |
- | Mitch Golden <mgolden@interport.net> |
- | Rasmus Lerdorf <rasmus@php.net> |
- | Andreas Karajannis <Andreas.Karajannis@gmd.de> |
- | Thies C. Arntzen <thies@thieso.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: oracle.c,v 1.94 2004/01/08 08:16:41 andi Exp $ */
-
-/* comment out the next line if you're on Oracle 7.x and don't have the olog
- call. */
-
-#define HAS_OLOG 1
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-
-#include "zend_globals.h"
-
-#if HAVE_ORACLE
-
-#include "php_oracle.h"
-#define HASH_DTOR (void (*)(void *))
-
-#include "ext/standard/info.h"
-
-
-#ifndef min
-#define min(a, b) ((a) > (b) ? (b) : (a))
-#endif
-
-#ifdef PHP_WIN32
-#define PHP_ORA_API __declspec(dllexport)
-#else
-#define PHP_ORA_API
-#endif
-
-#ifdef ZTS
-int ora_globals_id;
-#else
-PHP_ORA_API php_ora_globals ora_globals;
-#endif
-
-#define DB_SIZE 65536
-
-#define ORA_FETCHINTO_ASSOC (1<<0)
-#define ORA_FETCHINTO_NULLS (1<<1)
-
-static oraCursor *ora_get_cursor(HashTable *, pval ** TSRMLS_DC);
-static char *ora_error(Cda_Def *);
-static int ora_describe_define(oraCursor *);
-static void _close_oraconn(zend_rsrc_list_entry *rsrc TSRMLS_DC);
-static int _close_oracur(oraCursor *cur TSRMLS_DC);
-static int _ora_ping(oraConnection *conn);
-int ora_set_param_values(oraCursor *cursor, int isout TSRMLS_DC);
-
-void ora_do_logon(INTERNAL_FUNCTION_PARAMETERS, int persistent);
-
-static int le_conn, le_pconn, le_cursor;
-
-/* {{{ prototypes
- */
-PHP_FUNCTION(ora_bind);
-PHP_FUNCTION(ora_close);
-PHP_FUNCTION(ora_commit);
-PHP_FUNCTION(ora_commitoff);
-PHP_FUNCTION(ora_commiton);
-PHP_FUNCTION(ora_do);
-PHP_FUNCTION(ora_error);
-PHP_FUNCTION(ora_errorcode);
-PHP_FUNCTION(ora_exec);
-PHP_FUNCTION(ora_fetch);
-PHP_FUNCTION(ora_fetch_into);
-PHP_FUNCTION(ora_columntype);
-PHP_FUNCTION(ora_columnname);
-PHP_FUNCTION(ora_columnsize);
-PHP_FUNCTION(ora_getcolumn);
-PHP_FUNCTION(ora_numcols);
-PHP_FUNCTION(ora_numrows);
-PHP_FUNCTION(ora_logoff);
-PHP_FUNCTION(ora_logon);
-PHP_FUNCTION(ora_plogon);
-PHP_FUNCTION(ora_open);
-PHP_FUNCTION(ora_parse);
-PHP_FUNCTION(ora_rollback);
-
-PHP_MINIT_FUNCTION(oracle);
-PHP_RINIT_FUNCTION(oracle);
-PHP_MSHUTDOWN_FUNCTION(oracle);
-PHP_RSHUTDOWN_FUNCTION(oracle);
-PHP_MINFO_FUNCTION(oracle);
-/* }}} */
-
-/* {{{ oracle_functions[]
- */
-function_entry oracle_functions[] = {
- PHP_FE(ora_bind, NULL)
- PHP_FE(ora_close, NULL)
- PHP_FE(ora_commit, NULL)
- PHP_FE(ora_commitoff, NULL)
- PHP_FE(ora_commiton, NULL)
- PHP_FE(ora_do, NULL)
- PHP_FE(ora_error, NULL)
- PHP_FE(ora_errorcode, NULL)
- PHP_FE(ora_exec, NULL)
- PHP_FE(ora_fetch, NULL)
- PHP_FE(ora_fetch_into, second_arg_force_ref)
- PHP_FE(ora_columntype, NULL)
- PHP_FE(ora_columnname, NULL)
- PHP_FE(ora_columnsize, NULL)
- PHP_FE(ora_getcolumn, NULL)
- PHP_FE(ora_numcols, NULL)
- PHP_FE(ora_numrows, NULL)
- PHP_FE(ora_logoff, NULL)
- PHP_FE(ora_logon, NULL)
- PHP_FE(ora_plogon, NULL)
- PHP_FE(ora_open, NULL)
- PHP_FE(ora_parse, NULL)
- PHP_FE(ora_rollback, NULL)
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-/* {{{ oracle_module_entry
- */
-zend_module_entry oracle_module_entry = {
- STANDARD_MODULE_HEADER,
- "oracle",
- oracle_functions,
- PHP_MINIT(oracle), /* extension-wide startup function */
- PHP_MSHUTDOWN(oracle), /* extension-wide shutdown function */
- PHP_RINIT(oracle), /* per-request startup function */
- PHP_RSHUTDOWN(oracle), /* per-request shutdown function */
- PHP_MINFO(oracle),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-/* {{{ ora_func_tab[]
- */
-static const text *ora_func_tab[] =
-{(text *) "unused",
-/* 1, 2 */ (text *) "unused", (text *) "OSQL",
-/* 3, 4 */ (text *) "unused", (text *) "OEXEC/OEXN",
-/* 5, 6 */ (text *) "unused", (text *) "OBIND",
-/* 7, 8 */ (text *) "unused", (text *) "ODEFIN",
-/* 9, 10 */ (text *) "unused", (text *) "ODSRBN",
-/* 11, 12 */ (text *) "unused", (text *) "OFETCH/OFEN",
-/* 13, 14 */ (text *) "unused", (text *) "OOPEN",
-/* 15, 16 */ (text *) "unused", (text *) "OCLOSE",
-/* 17, 18 */ (text *) "unused", (text *) "unused",
-/* 19, 20 */ (text *) "unused", (text *) "unused",
-/* 21, 22 */ (text *) "unused", (text *) "ODSC",
-/* 23, 24 */ (text *) "unused", (text *) "ONAME",
-/* 25, 26 */ (text *) "unused", (text *) "OSQL3",
-/* 27, 28 */ (text *) "unused", (text *) "OBNDRV",
-/* 29, 30 */ (text *) "unused", (text *) "OBNDRN",
-/* 31, 32 */ (text *) "unused", (text *) "unused",
-/* 33, 34 */ (text *) "unused", (text *) "OOPT",
-/* 35, 36 */ (text *) "unused", (text *) "unused",
-/* 37, 38 */ (text *) "unused", (text *) "unused",
-/* 39, 40 */ (text *) "unused", (text *) "unused",
-/* 41, 42 */ (text *) "unused", (text *) "unused",
-/* 43, 44 */ (text *) "unused", (text *) "unused",
-/* 45, 46 */ (text *) "unused", (text *) "unused",
-/* 47, 48 */ (text *) "unused", (text *) "unused",
-/* 49, 50 */ (text *) "unused", (text *) "unused",
-/* 51, 52 */ (text *) "unused", (text *) "OCAN",
-/* 53, 54 */ (text *) "unused", (text *) "OPARSE",
-/* 55, 56 */ (text *) "unused", (text *) "OEXFET",
-/* 57, 58 */ (text *) "unused", (text *) "OFLNG",
-/* 59, 60 */ (text *) "unused", (text *) "ODESCR",
-/* 61, 62 */ (text *) "unused", (text *) "OBNDRA"
-};
-/* }}} */
-
-#ifdef COMPILE_DL_ORACLE
-ZEND_GET_MODULE(oracle)
-# ifdef PHP_WIN32
-# include "zend_arg_defs.c"
-# endif
-#endif
-
-/* {{{ _close_oraconn
- */
-static void _close_oraconn(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- oraConnection *conn = (oraConnection *)rsrc->ptr;
-
- conn->open = 0;
-
- ologof(&conn->lda);
- ORA(num_links)--;
-
- zend_hash_del(ORA(conns),(void*)&conn,sizeof(void*));
-
- if (conn->persistent) {
- ORA(num_persistent)--;
- free(conn);
- } else {
- efree(conn);
- }
-}
-/* }}} */
-
-/* {{{ pval_ora_param_destructor
- */
-static void
-pval_ora_param_destructor(oraParam *param)
-{
- if (param->progv) {
- efree(param->progv);
- }
-}
-/* }}} */
-
-/* {{{ _close_oracur
- */
-static int _close_oracur(oraCursor *cur TSRMLS_DC)
-{
- int i;
-
- if (cur){
- if (cur->query){
- efree(cur->query);
- }
- if (cur->params){
- zend_hash_destroy(cur->params);
- efree(cur->params);
- cur->params = NULL;
- }
- if (cur->columns){
- for(i = 0; i < cur->ncols; i++){
- if (cur->columns[i].buf)
- efree(cur->columns[i].buf);
- }
- efree(cur->columns);
- cur->columns = NULL;
- }
-
- if (cur->open){
- oraConnection *db_conn;
-
- if (zend_hash_find(ORA(conns),(void*)&(cur->conn_ptr),sizeof(void*),(void **)&db_conn) == SUCCESS) {
- oclose(&cur->cda);
- }
- }
-
- efree(cur);
- }
-
- return 1;
-}
-/* }}} */
-
-/* {{{ php_close_ora_cursor
- */
-static void php_close_ora_cursor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- oraCursor *cur = (oraCursor *)rsrc->ptr;
-
- _close_oracur(cur TSRMLS_CC);
-}
-/* }}} */
-
-/* {{{ php_ora_init_globals
- */
-static void php_ora_init_globals(php_ora_globals *ora_globals_p TSRMLS_DC)
-{
- if (cfg_get_long("oracle.allow_persistent",
- &ORA(allow_persistent))
- == FAILURE) {
- ORA(allow_persistent) = -1;
- }
- if (cfg_get_long("oracle.max_persistent",
- &ORA(max_persistent))
- == FAILURE) {
- ORA(max_persistent) = -1;
- }
- if (cfg_get_long("oracle.max_links",
- &ORA(max_links))
- == FAILURE) {
- ORA(max_links) = -1;
- }
-
- ORA(num_persistent) = 0;
-
- ORA(conns) = malloc(sizeof(HashTable));
- zend_hash_init(ORA(conns), 13, NULL, NULL, 1);
-
- memset((void*) &ORA(db_err_conn),0,sizeof(ORA(db_err_conn)));
-}
-/* }}} */
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(oracle)
-{
-#ifdef ZTS
- ts_allocate_id(&ora_globals_id, sizeof(php_ora_globals), (ts_allocate_ctor) php_ora_init_globals, NULL);
-#else
- php_ora_init_globals(&ora_globals TSRMLS_CC);
-#endif
-
- le_cursor = zend_register_list_destructors_ex(php_close_ora_cursor, NULL, "oracle cursor", module_number);
- le_conn = zend_register_list_destructors_ex(_close_oraconn, NULL, "oracle link", module_number);
- le_pconn = zend_register_list_destructors_ex(NULL, _close_oraconn, "oracle link persistent", module_number);
-
- REGISTER_LONG_CONSTANT("ORA_BIND_INOUT", 0, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("ORA_BIND_IN", 1, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("ORA_BIND_OUT", 2, CONST_CS | CONST_PERSISTENT);
-
- REGISTER_LONG_CONSTANT("ORA_FETCHINTO_ASSOC",ORA_FETCHINTO_ASSOC, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("ORA_FETCHINTO_NULLS",ORA_FETCHINTO_NULLS, CONST_CS | CONST_PERSISTENT);
-
-#ifdef ZTS
- opinit(OCI_EV_TSF);
-#endif
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RINIT_FUNCTION
- */
-PHP_RINIT_FUNCTION(oracle)
-{
- ORA(num_links) =
- ORA(num_persistent);
- /*
- ORA(defaultlrl) = 0;
- ORA(defaultbinmode) = 0;
- ORA(defaultconn) = 0;
- */
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(oracle)
-{
- zend_hash_destroy(ORA(conns));
- free(ORA(conns));
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(oracle)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ _ora_ping
- */
-static int _ora_ping(oraConnection *conn)
-{
- Cda_Def cda;
-
- if (oopen(&cda, &conn->lda, (text *) 0, -1, -1, (text *) 0, -1)) {
- return 0;
- }
-
- if (oparse(&cda, "select sysdate from dual", (sb4) - 1, 0, VERSION_7)) {
- oclose(&cda);
- return 0;
- }
-
- oclose(&cda);
- return 1;
-
-}
-/* }}} */
-
-/*
- ** PHP functions
-*/
-
-/* {{{ proto resource ora_logon(string user, string password)
- Open an Oracle connection */
-PHP_FUNCTION(ora_logon)
-{
- ora_do_logon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
-}
-/* }}} */
-
-/* {{{ proto resource ora_plogon(string user, string password)
- Open a persistent Oracle connection */
-PHP_FUNCTION(ora_plogon)
-{
- ora_do_logon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
-}
-/* }}} */
-
-/* {{{ ora_do_logon
- */
-void ora_do_logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)
-{
- char *user,*passwd;
- pval **arg1, **arg2;
- char *hashed_details;
- int hashed_details_length;
- oraConnection *db_conn;
-
- if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(arg1);
- convert_to_string_ex(arg2);
-
- user = Z_STRVAL_PP(arg1);
- passwd = Z_STRVAL_PP(arg2);
-
- hashed_details_length = sizeof("oracle__")-1+strlen(user)+strlen(passwd);
- hashed_details = (char *) emalloc(hashed_details_length+1);
- sprintf(hashed_details,"oracle_%s_%s",user,passwd);
-
- if (!ORA(allow_persistent)) {
- persistent=0;
- }
- if (persistent) {
- list_entry *le;
-
- /* try to find if we already have this link in our persistent list */
- if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */
- list_entry new_le;
-
- if (ORA(max_links)!=-1 && ORA(num_links)>=ORA(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Too many open links (%d)",ORA(num_links));
- efree(hashed_details);
- RETURN_FALSE;
- }
- if (ORA(max_persistent)!=-1 && ORA(num_persistent)>=ORA(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Too many open persistent links (%d)",ORA(num_persistent));
- efree(hashed_details);
- RETURN_FALSE;
- }
- /* create the link */
- db_conn = (oraConnection *)malloc(sizeof(oraConnection));
- memset((void *) db_conn,0,sizeof(oraConnection));
- db_conn->persistent = 1;
-
- if (
-#if HAS_OLOG
- olog(&db_conn->lda, db_conn->hda, user,strlen(user), passwd, strlen(passwd), 0, -1, OCI_LM_DEF)
-#else
- orlon(&db_conn->lda, db_conn->hda, user,strlen(user), passwd, strlen(passwd), 0)
-#endif
- ) {
- ORA(db_err_conn) = *db_conn;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to ORACLE (%s)",ora_error(&db_conn->lda));
-
- if (persistent) {
- free(db_conn);
- } else {
- efree(db_conn);
- }
-
- efree(hashed_details);
- RETURN_FALSE;
- }
-
- /* hash it up */
- Z_TYPE(new_le) = le_pconn;
- new_le.ptr = db_conn;
- if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) {
- free(db_conn);
- efree(hashed_details);
- RETURN_FALSE;
- }
- ORA(num_persistent)++;
- ORA(num_links)++;
- zend_hash_add(ORA(conns),(void*)&db_conn,sizeof(void*),(void*)&db_conn,sizeof(void*),NULL);
- } else { /* we do */
- if (Z_TYPE_P(le) != le_pconn) {
- RETURN_FALSE;
- }
-
- db_conn = (oraConnection *) le->ptr;
-
- /* ensure that the link did not die */
-
- if (!_ora_ping(db_conn)) {
- if (
-#if HAS_OLOG
- olog(&db_conn->lda, db_conn->hda, user,strlen(user), passwd, strlen(passwd), 0, -1, OCI_LM_DEF)
-#else
- orlon(&db_conn->lda, db_conn->hda, user,strlen(user), passwd, strlen(passwd), 0)
-#endif
- ) {
- ORA(db_err_conn) = *db_conn;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Link to server lost, unable to reconnect",ora_error(&db_conn->lda));
- zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1);
- efree(hashed_details);
- RETURN_FALSE;
- }
- }
- }
- ZEND_REGISTER_RESOURCE(return_value, db_conn, le_pconn);
- } else { /* non persistent */
- list_entry *index_ptr,new_index_ptr;
-
- /* first we check the hash for the hashed_details key. if it exists,
- * it should point us to the right offset where the actual Oracle link sits.
- * if it doesn't, open a new Oracle link, add it to the resource list,
- * and add a pointer to it with hashed_details as the key.
- */
- if (zend_hash_find(&EG(regular_list),hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) {
- int type,link;
- void *ptr;
-
- if (Z_TYPE_P(index_ptr) != le_index_ptr) {
- RETURN_FALSE;
- }
- link = (int) index_ptr->ptr;
- ptr = zend_list_find(link,&type); /* check if the link is still there */
- if (ptr && (type==le_conn || type==le_pconn)) {
- zend_list_addref(link);
- Z_LVAL_P(return_value) = link;
- Z_TYPE_P(return_value) = IS_RESOURCE;
- efree(hashed_details);
- return;
- } else {
- zend_hash_del(&EG(regular_list),hashed_details,hashed_details_length+1);
- }
- }
- if (ORA(max_links)!=-1 && ORA(num_links)>=ORA(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Too many open links (%d)",ORA(num_links));
- efree(hashed_details);
- RETURN_FALSE;
- }
-
- db_conn = (oraConnection *) emalloc(sizeof(oraConnection));
- memset((void *) db_conn,0,sizeof(oraConnection));
- db_conn->persistent = 0;
-
- if (
-#if HAS_OLOG
- olog(&db_conn->lda, db_conn->hda, user,strlen(user), passwd, strlen(passwd), 0, -1, OCI_LM_DEF)
-#else
- orlon(&db_conn->lda, db_conn->hda, user,strlen(user), passwd, strlen(passwd), 0)
-#endif
- ) {
- ORA(db_err_conn) = *db_conn;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Connection Failed: %s\n",ora_error(&db_conn->lda));
- efree(hashed_details);
- efree(db_conn);
- RETURN_FALSE;
- }
-
- /* add it to the list */
- ZEND_REGISTER_RESOURCE(return_value, db_conn, le_conn);
-
- /* add it to the hash */
- new_index_ptr.ptr = (void *) Z_LVAL_P(return_value);
- Z_TYPE(new_index_ptr) = le_index_ptr;
- if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) {
- efree(hashed_details);
- RETURN_FALSE;
- }
- zend_hash_add(ORA(conns),(void*)&db_conn,sizeof(void*),(void*)&db_conn,sizeof(void*),NULL);
- ORA(num_links)++;
- }
-
- efree(hashed_details);
-}
-/* }}} */
-
-/* {{{ proto bool ora_logoff(resource connection)
- Close an Oracle connection */
-PHP_FUNCTION(ora_logoff)
-{ /* conn_index */
- oraConnection *conn;
- pval **arg;
-
- if (zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
-
- zend_list_delete(Z_LVAL_PP(arg));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto resource ora_open(resource connection)
- Open an Oracle cursor */
-PHP_FUNCTION(ora_open)
-{ /* conn_index */
- pval **arg;
- oraConnection *conn = NULL;
- oraCursor *cursor = NULL;
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
-
- cursor = (oraCursor *)emalloc(sizeof(oraCursor));
- memset(cursor, 0, sizeof(oraCursor));
- if (oopen(&cursor->cda, &conn->lda, (text *) 0, -1, -1, (text *) 0, -1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open new cursor (%s)",
- ora_error(&cursor->cda));
- efree(cursor);
- RETURN_FALSE;
- }
- cursor->open = 1;
- cursor->conn_ptr = conn;
- ZEND_REGISTER_RESOURCE(return_value, cursor, le_cursor);
- cursor->conn_id = Z_LVAL_P(return_value);
-}
-
-/* }}} */
-
-/* {{{ proto bool ora_close(resource cursor)
- Close an Oracle cursor */
-PHP_FUNCTION(ora_close)
-{ /* conn_index */
- pval **arg;
- oraCursor *cursor;
-
- if (zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- ZEND_FETCH_RESOURCE(cursor, oraCursor *, arg, -1, "Oracle-Cursor", le_cursor);
-
- zend_list_delete(Z_LVAL_PP(arg));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ora_commitoff(resource connection)
- Disable automatic commit */
-PHP_FUNCTION(ora_commitoff)
-{ /* conn_index */
- pval **arg;
- oraConnection *conn;
-
- if (zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
-
- if (ocof(&conn->lda)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to turn off auto-commit (%s)",
- ora_error(&conn->lda));
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ora_commiton(resource connection)
- Enable automatic commit */
-PHP_FUNCTION(ora_commiton)
-{ /* conn_index */
- pval **arg;
- oraConnection *conn;
-
- if (zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
-
- if (ocon(&conn->lda)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to turn on auto-commit (%s)",
- ora_error(&conn->lda));
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ora_commit(resource connection)
- Commit an Oracle transaction */
-PHP_FUNCTION(ora_commit)
-{ /* conn_index */
- pval **arg;
- oraConnection *conn;
-
- if (zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
-
- if (ocom(&conn->lda)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to commit transaction (%s)",
- ora_error(&conn->lda));
- RETURN_FALSE;
- }
- RETVAL_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ora_rollback(resource connection)
- Roll back an Oracle transaction */
-PHP_FUNCTION(ora_rollback)
-{ /* conn_index */
- pval **arg;
- oraConnection *conn;
-
- if (zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
-
- if (orol(&conn->lda)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to roll back transaction (%s)",
- ora_error(&conn->lda));
- RETURN_FALSE;
- }
- RETVAL_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ora_parse(resource cursor, string sql_statement [, int defer])
- Parse an Oracle SQL statement */
-PHP_FUNCTION(ora_parse)
-{
- pval **curs, **sql, **def;
- oraCursor *cursor;
- sword defer = 0;
- text *query;
-
- switch (ZEND_NUM_ARGS()) {
- case 3:
- zend_get_parameters_ex(3,&curs,&sql,&def);
- convert_to_long_ex(def);
- if (Z_LVAL_PP(def)) {
- defer = DEFER_PARSE;
- }
- break;
- case 2:
- zend_get_parameters_ex(2,&curs,&sql);
- break;
- default:
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(sql);
- query = (text *) estrndup(Z_STRVAL_PP(sql),Z_STRLEN_PP(sql));
-
- if (query == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid query");
- RETURN_FALSE;
- }
-
- if (!(cursor = ora_get_cursor(&EG(regular_list),curs TSRMLS_CC))){
- efree(query);
- RETURN_FALSE;
- }
-
- if (cursor->query) {
- efree(cursor->query);
- }
-
- cursor->query = query;
- cursor->fetched = 0;
-
- if (cursor->params && cursor->nparams > 0){
- zend_hash_destroy(cursor->params);
- efree(cursor->params);
- cursor->params = NULL;
- cursor->nparams = 0;
- }
-
- if (oparse(&cursor->cda, query, (sb4) - 1, defer, VERSION_7)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Parse failed (%s)",ora_error(&cursor->cda));
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool ora_bind(resource cursor, string php_variable_name, string sql_parameter_name, int length [, int type])
- Bind a PHP variable to an Oracle parameter */
-PHP_FUNCTION(ora_bind)
-{
- pval **curs, **pvar, **svar, **plen, **ptyp;
- int inout = 0;
- oraParam *newparam, *paramptr;
- oraCursor *cursor;
- char *paramname;
-
- switch (ZEND_NUM_ARGS()) {
- case 5:
- zend_get_parameters_ex(5,&curs,&pvar,&svar,&plen,&ptyp);
- convert_to_long_ex(ptyp);
- inout = Z_LVAL_PP(ptyp);
- break;
- case 4:
- zend_get_parameters_ex(4,&curs,&pvar,&svar,&plen);
- break;
- default:
- WRONG_PARAM_COUNT;
- }
-
- cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC);
- if (cursor == NULL) {
- RETURN_FALSE;
- }
-
- convert_to_string_ex(pvar);
- convert_to_string_ex(svar);
- convert_to_long_ex(plen);
-
- if (cursor->params == NULL) {
- ALLOC_HASHTABLE(cursor->params);
- if (!cursor->params ||
- zend_hash_init(cursor->params, 19, NULL,
- HASH_DTOR pval_ora_param_destructor, 0) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize parameter list");
- RETURN_FALSE;
- }
- }
- newparam = (oraParam *)emalloc(sizeof(oraParam));
-
- if ((paramname = estrndup(Z_STRVAL_PP(pvar), Z_STRLEN_PP(pvar))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory for parametername");
- efree(newparam);
- RETURN_FALSE;
- }
-
- if (zend_hash_add(cursor->params, paramname, Z_STRLEN_PP(pvar) + 1,
- newparam, sizeof(oraParam), (void **)&paramptr) == FAILURE) {
- /* XXX zend_hash_destroy */
- efree(paramname);
- efree(newparam);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not make parameter placeholder");
- RETURN_FALSE;
- }
-
- efree(newparam);
- efree(paramname);
-
- paramptr->progvl = Z_LVAL_PP(plen) + 1;
- paramptr->inout = inout;
-
- paramptr->progv = (text *)emalloc(paramptr->progvl);
-
-/* XXX Maximum for progvl */
- paramptr->alen = paramptr->progvl;
-
- if (obndra(&cursor->cda,
- Z_STRVAL_PP(svar),
- -1,
- (ub1 *)paramptr->progv,
- paramptr->progvl,
- SQLT_STR, /* ftype */
- -1, /* scale */
- 0/*&paramptr->ind*/, /* ind */
- &paramptr->alen, /* alen */
- 0 /*&paramptr->arcode*/,
- 0, /* maxsize */
- 0,
- 0,
- -1,
- -1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Bind failed (%s)",
- ora_error(&cursor->cda));
- RETURN_FALSE;
- }
-
- cursor->nparams++;
- RETURN_TRUE;
-}
-/* }}} */
-
-/*
- XXX Make return values compatible with old module ?
- */
-/* {{{ proto bool ora_exec(resource cursor)
- Execute a parsed statement */
-PHP_FUNCTION(ora_exec)
-{ /* cursor_index */
- pval **arg;
- oraCursor *cursor = NULL;
-
- if (zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- if ((cursor = ora_get_cursor(&EG(regular_list), arg TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
- }
-
- if (cursor->cda.ft == FT_SELECT) {
- if (ora_describe_define(cursor) < 0) {
- /* error message is given by ora_describe_define() */
- RETURN_FALSE;
- }
- }
-
- if(cursor->nparams > 0){
- if(!ora_set_param_values(cursor, 0 TSRMLS_CC)){
- RETURN_FALSE;
- }
- }
-
- if (oexec(&cursor->cda)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Exec failed (%s)",
- ora_error(&cursor->cda));
- RETURN_FALSE;
- }
-
- if(cursor->nparams > 0){
- if(!ora_set_param_values(cursor, 1 TSRMLS_CC)){
- RETURN_FALSE;
- }
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int ora_numcols(resource cursor)
- Returns the numbers of columns in a result */
-PHP_FUNCTION(ora_numcols)
-{ /* cursor_index */
- pval **arg;
- oraCursor *cursor = NULL;
-
- if (zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- if ((cursor = ora_get_cursor(&EG(regular_list), arg TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
- }
-
- RETURN_LONG(cursor->ncols);
-}
-/* }}} */
-
-/* {{{ proto int ora_numrows(resource cursor)
- Returns the number of rows in a result */
-PHP_FUNCTION(ora_numrows)
-{ /* cursor_index */
- pval **arg;
- oraCursor *cursor = NULL;
-
- if(zend_get_parameters_ex(1, &arg) == FAILURE)
- WRONG_PARAM_COUNT;
-
- if((cursor = ora_get_cursor(&EG(regular_list), arg TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
- }
-
- RETURN_LONG(cursor->cda.rpc);
-}
-/* }}} */
-
-/* prepares/executes/fetches 1st row if avail*/
-/* {{{ proto resource ora_do(resource connection, resource cursor)
- Parse and execute a statement and fetch first result row */
-PHP_FUNCTION(ora_do)
-{
- pval **con,**sql;
- oraConnection *conn = NULL;
- oraCursor *cursor = NULL;
- text *query;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &con,&sql) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- ZEND_FETCH_RESOURCE2(conn, oraConnection *, con, -1, "Oracle-Connection", le_conn, le_pconn);
-
- convert_to_string_ex(sql);
-
- cursor = (oraCursor *)emalloc(sizeof(oraCursor));
-
- memset(cursor, 0, sizeof(oraCursor));
-
- query = (text *) estrndup(Z_STRVAL_PP(sql),Z_STRLEN_PP(sql));
-
- if (query == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid query in Ora_Do");
- RETURN_FALSE;
- }
-
- cursor->query = query;
-
- if (oopen(&cursor->cda, &conn->lda, (text *) 0, -1, -1, (text *) 0, -1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open new cursor (%s)",
- ora_error(&cursor->cda));
- efree(cursor);
- RETURN_FALSE;
- }
- cursor->open = 1;
- cursor->conn_ptr = conn;
- cursor->conn_id = Z_LVAL_PP(con);
-
- /* Prepare stmt */
-
- if (oparse(&cursor->cda, query, (sb4) - 1, 1, VERSION_7)){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Do failed (%s)",
- ora_error(&cursor->cda));
- _close_oracur(cursor TSRMLS_CC);
- RETURN_FALSE;
- }
-
- /* Execute stmt (and fetch 1st row for selects) */
- if (cursor->cda.ft == FT_SELECT) {
- if (ora_describe_define(cursor) < 0){
- /* error message is given by ora_describe_define() */
- _close_oracur(cursor TSRMLS_CC);
- RETURN_FALSE;
- }
- if (oexfet(&cursor->cda, 1, 0, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Do failed (%s)",
- ora_error(&cursor->cda));
- _close_oracur(cursor TSRMLS_CC);
- RETURN_FALSE;
- }
- cursor->fetched = 1;
- } else {
- if (oexec(&cursor->cda)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Do failed (%s)",
- ora_error(&cursor->cda));
- _close_oracur(cursor TSRMLS_CC);
- RETURN_FALSE;
- }
- }
-
- ZEND_REGISTER_RESOURCE(return_value, cursor, le_cursor);
-}
-/* }}} */
-
-/* {{{ proto bool ora_fetch(resource cursor)
- Fetch a row of result data from a cursor */
-PHP_FUNCTION(ora_fetch)
-{ /* cursor_index */
- pval **arg;
- oraCursor *cursor;
-
- if (zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if ((cursor = ora_get_cursor(&EG(regular_list), arg TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
- }
-
- if (cursor->ncols == 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available on this cursor");
- RETURN_FALSE;
- }
-
- /* Get data from Oracle */
- if (ofetch(&cursor->cda)) {
- if (cursor->cda.rc != NO_DATA_FOUND) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Fetch failed (%s)",
- ora_error(&cursor->cda));
- }
- RETURN_FALSE;
- }
- cursor->fetched++;
- RETVAL_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int ora_fetch_into(resource cursor, array result [, int flags])
- Fetch a row into the specified result array */
-PHP_FUNCTION(ora_fetch_into)
-{
- pval **curs, **arr, **flg, *tmp;
- oraCursor *cursor;
- int i;
- int flags = 0;
-
- switch(ZEND_NUM_ARGS()){
- case 2:
- zend_get_parameters_ex(2, &curs, &arr);
- break;
-
- case 3:
- zend_get_parameters_ex(3, &curs, &arr, &flg);
- convert_to_long_ex(flg);
- flags = Z_LVAL_PP(flg);
- break;
-
- default:
- WRONG_PARAM_COUNT;
- break;
- }
-
- /* Find the cursor */
- if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
- }
-
- if (cursor->ncols == 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available on this cursor");
- RETURN_FALSE;
- }
-
- if (ofetch(&cursor->cda)) {
- if (cursor->cda.rc != NO_DATA_FOUND) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Fetch_Into failed (%s)",ora_error(&cursor->cda));
- }
- RETURN_FALSE;
- }
- cursor->fetched++;
-
- if (Z_TYPE_PP(arr) != IS_ARRAY){
- pval_destructor(*arr);
- array_init(*arr);
- }
- zend_hash_internal_pointer_reset(Z_ARRVAL_PP(arr));
-
- for (i = 0; i < cursor->ncols; i++) {
- if (cursor->columns[i].col_retcode == 1405) {
- if (!(flags&ORA_FETCHINTO_NULLS)){
- continue; /* don't add anything for NULL columns, unless the calles wants it */
- } else {
- MAKE_STD_ZVAL(tmp);
- ZVAL_NULL(tmp);
- }
- } else if (cursor->columns[i].col_retcode != 0 &&
- cursor->columns[i].col_retcode != 1406) {
- /* So error fetching column. The most common is 1405, a NULL */
- /* was retreived. 1406 is ASCII or string buffer data was */
- /* truncated. The converted data from the database did not fit */
- /* into the buffer. Since we allocated the buffer to be large */
- /* enough, this should not occur. Anyway, we probably want to */
- /* return what we did get, in that case */
- RETURN_FALSE;
- } else {
- MAKE_STD_ZVAL(tmp);
-
- Z_TYPE_P(tmp) = IS_STRING;
- Z_STRLEN_P(tmp) = 0;
-
- switch(cursor->columns[i].dbtype) {
- case SQLT_LNG:
- case SQLT_LBI:
- {
- ub4 ret_len;
- int offset = cursor->columns[i].col_retlen;
- sb2 result;
-
- if (cursor->columns[i].col_retcode == 1406) { /* truncation -> get the rest! */
- while (1) {
- cursor->columns[i].buf = erealloc(cursor->columns[i].buf,offset + DB_SIZE + 1);
-
- if (! cursor->columns[i].buf) {
- offset = 0;
- break;
- }
-
- result = oflng(&cursor->cda,
- (sword)(i + 1),
- cursor->columns[i].buf + offset,
- DB_SIZE,
- 1,
- &ret_len,
- offset);
- if (result) {
- break;
- }
-
- if (ret_len <= 0) {
- break;
- }
-
- offset += ret_len;
- }
- }
- if (cursor->columns[i].buf && offset) {
- Z_STRLEN_P(tmp) = offset;
- } else {
- Z_STRLEN_P(tmp) = 0;
- }
- }
- break;
- default:
- Z_STRLEN_P(tmp) = min(cursor->columns[i].col_retlen,
- cursor->columns[i].dsize);
- break;
- }
- Z_STRVAL_P(tmp) = estrndup(cursor->columns[i].buf,Z_STRLEN_P(tmp));
- }
-
- if (flags&ORA_FETCHINTO_ASSOC){
- zend_hash_update(Z_ARRVAL_PP(arr), cursor->columns[i].cbuf, cursor->columns[i].cbufl+1, (void *) &tmp, sizeof(pval*), NULL);
- } else {
- zend_hash_index_update(Z_ARRVAL_PP(arr), i, (void *) &tmp, sizeof(pval*), NULL);
- }
-
- }
-
- RETURN_LONG(cursor->ncols);
-}
-/* }}} */
-
-/* {{{ proto string ora_columnname(resource cursor, int column)
- Get the name of an Oracle result column */
-PHP_FUNCTION(ora_columnname)
-{ /* cursor_index, column_index */
- pval **curs, **col;
- oraCursor *cursor = NULL;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &curs, &col) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
- }
-
- convert_to_long_ex(col);
-
- if (cursor->ncols == 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this cursor index");
- RETURN_FALSE;
- }
-
- if (Z_LVAL_PP(col) >= cursor->ncols){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column index larger than number of columns");
- RETURN_FALSE;
- }
-
- if (Z_LVAL_PP(col) < 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column numbering starts at 0");
- RETURN_FALSE;
- }
-
- RETURN_STRINGL(cursor->columns[Z_LVAL_PP(col)].cbuf,
- cursor->columns[Z_LVAL_PP(col)].cbufl,1);
-}
-/* }}} */
-
-/* {{{ proto string ora_columntype(resource cursor, int column)
- Get the type of an Oracle result column */
-PHP_FUNCTION(ora_columntype)
-{ /* cursor_index, column_index */
- pval **curs, **col;
- int colno;
- oraCursor *cursor = NULL;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &curs, &col) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
- }
-
- convert_to_long_ex(col);
- colno = Z_LVAL_PP(col);
-
- if (cursor->ncols == 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this cursor index");
- RETURN_FALSE;
- }
-
- if (colno >= cursor->ncols){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column index larger than number of columns");
- RETURN_FALSE;
- }
-
- if (colno < 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column numbering starts at 0");
- RETURN_FALSE;
- }
-
- switch (cursor->columns[colno].dbtype) {
- case SQLT_CHR:
- RETURN_STRINGL("VARCHAR2", 8, 1);
- case SQLT_VCS:
- case SQLT_AVC:
- RETURN_STRINGL("VARCHAR", 7, 1);
- case SQLT_STR:
- case SQLT_AFC:
- RETURN_STRINGL("CHAR", 4, 1);
- case SQLT_NUM: case SQLT_INT:
- case SQLT_FLT: case SQLT_UIN:
- RETURN_STRINGL("NUMBER", 6, 1);
- case SQLT_LNG:
- RETURN_STRINGL("LONG", 4, 1);
- case SQLT_LBI:
- RETURN_STRINGL("LONG RAW", 8, 1);
- case SQLT_RID:
- RETURN_STRINGL("ROWID", 5, 1);
- case SQLT_DAT:
- RETURN_STRINGL("DATE", 4, 1);
-#ifdef SQLT_CUR
- case SQLT_CUR:
- RETURN_STRINGL("CURSOR", 6, 1);
-#endif
- default:
- {
- char numbuf[21];
- snprintf(numbuf, 20, "UNKNOWN(%d)", cursor->columns[colno].dbtype);
- numbuf[20] = '\0';
- RETVAL_STRING(numbuf,1);
- }
- }
-}
-/* }}} */
-
-/* {{{ proto int ora_columnsize(int cursor, int column)
- Return the size of the column */
-PHP_FUNCTION(ora_columnsize)
-{ /* cursor_index, column_index */
- pval **curs, **col;
- oraCursor *cursor = NULL;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &curs, &col) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- /* Find the cursor */
- if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
- }
-
- convert_to_long_ex(col);
-
- if (cursor->ncols == 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this cursor index");
- RETURN_FALSE;
- }
-
- if (Z_LVAL_PP(col) >= cursor->ncols){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column index larger than number of columns");
- RETURN_FALSE;
- }
-
- if (Z_LVAL_PP(col) < 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column numbering starts at 0");
- RETURN_FALSE;
- }
-
- RETURN_LONG(cursor->columns[Z_LVAL_PP(col)].dbsize);
-}
-/* }}} */
-
-/* {{{ proto mixed ora_getcolumn(resource cursor, int column)
- Get data from a fetched row */
-PHP_FUNCTION(ora_getcolumn)
-{ /* cursor_index, column_index */
- pval **curs,**col;
- int colno;
- oraCursor *cursor = NULL;
- oraColumn *column = NULL;
- int len;
- sb2 type;
-
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &curs, &col) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
- }
-
- if (cursor->ncols == 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this cursor index");
- RETURN_FALSE;
- }
-
- convert_to_long_ex(col);
- colno = Z_LVAL_PP(col);
-
- if (colno >= cursor->ncols){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column index larger than number of columns");
- RETURN_FALSE;
- }
-
- if (colno < 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column numbering starts at 0");
- RETURN_FALSE;
- }
-
- if (cursor->fetched == 0){
- if (ofetch(&cursor->cda)) {
- if (cursor->cda.rc != NO_DATA_FOUND) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Fetch failed (%s)",
- ora_error(&cursor->cda));
- }
- RETURN_FALSE;
- }
- cursor->fetched++;
- }
-
- column = &cursor->columns[colno];
-
- type = column->dbtype;
-
- if (column->col_retcode == 1405) {
- RETURN_NULL();
- }
-
- if (column->col_retcode != 0 && column->col_retcode != 1406) {
- /* So error fetching column. The most common is 1405, a NULL
- * was retreived. 1406 is ASCII or string buffer data was
- * truncated. The converted data from the database did not fit
- * into the buffer. Since we allocated the buffer to be large
- * enough, this should not occur. Anyway, we probably want to
- * return what we did get, in that case
- */
- RETURN_FALSE;
- } else {
- switch(type) {
- case SQLT_CHR:
- case SQLT_NUM:
- case SQLT_INT:
- case SQLT_FLT:
- case SQLT_STR:
- case SQLT_UIN:
- case SQLT_AFC:
- case SQLT_AVC:
- case SQLT_DAT:
- len = min(column->col_retlen, column->dsize);
- RETURN_STRINGL(column->buf,len,1);
-
- case SQLT_LNG:
- case SQLT_LBI:
- {
- ub4 ret_len;
- int offset = column->col_retlen;
- sb2 result;
-
- if (column->col_retcode == 1406) { /* truncation -> get the rest! */
- while (1) {
- column->buf = erealloc(column->buf,offset + DB_SIZE + 1);
-
- if (! column->buf) {
- offset = 0;
- break;
- }
-
- result = oflng(&cursor->cda,
- (sword)(colno + 1),
- column->buf + offset,
- DB_SIZE,
- 1,
- &ret_len,
- offset);
- if (result) {
- break;
- }
-
- if (ret_len <= 0) {
- break;
- }
-
- offset += ret_len;
- }
- }
- if (column->buf && offset) {
- RETURN_STRINGL(column->buf, offset, 1);
- } else {
- RETURN_FALSE;
- }
- }
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_GetColumn found invalid type (%d)", type);
- RETURN_FALSE;
- }
- }
-}
-/* }}} */
-
-/* {{{ proto string ora_error(resource cursor_or_connection)
- Get an Oracle error message */
-PHP_FUNCTION(ora_error)
-{
- pval **arg;
- oraCursor *cursor;
- oraConnection *conn;
- void *res;
- int what;
- int argc = ZEND_NUM_ARGS();
-
- if (argc < 0 || argc >> 1 || zend_get_parameters_ex(argc, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc == 1) {
- res = zend_fetch_resource(arg TSRMLS_CC, -1,"Oracle-Connection/Cursor",&what,3,le_conn, le_pconn, le_cursor);
- ZEND_VERIFY_RESOURCE(res);
-
- if (what == le_cursor) {
- cursor = (oraCursor *) res;
- RETURN_STRING(ora_error(&cursor->cda),1);
- } else {
- conn = (oraConnection *) res;
- RETURN_STRING(ora_error(&conn->lda),1);
- }
- } else {
- RETURN_STRING(ora_error(&ORA(db_err_conn).lda),1);
- }
-}
-/* }}} */
-
-/* {{{ proto int ora_errorcode(resource cursor_or_connection)
- Get an Oracle error code */
-PHP_FUNCTION(ora_errorcode)
-{
- pval **arg;
- oraCursor *cursor;
- oraConnection *conn;
- void *res;
- int what;
- int argc = ZEND_NUM_ARGS();
-
- if (argc < 0 || argc >> 1 || zend_get_parameters_ex(argc, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (argc == 1) {
- res = zend_fetch_resource(arg TSRMLS_CC, -1,"Oracle-Connection/Cursor",&what,3,le_conn, le_pconn, le_cursor);
- ZEND_VERIFY_RESOURCE(res);
-
- if (what == le_cursor) {
- cursor = (oraCursor *) res;
- RETURN_LONG(cursor->cda.rc);
- } else {
- conn = (oraConnection *) res;
- RETURN_LONG(conn->lda.rc);
- }
- } else {
- RETURN_LONG(ORA(db_err_conn).lda.rc);
- }
-}
-/* }}} */
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(oracle)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "Oracle Support", "enabled");
-#ifndef PHP_WIN32
- php_info_print_table_row(2, "Oracle Version", PHP_ORACLE_VERSION );
- php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_ORACLE_DIR );
- php_info_print_table_row(2, "Libraries Used", PHP_ORACLE_SHARED_LIBADD );
-#endif
- php_info_print_table_end();
-}
-/* }}} */
-
-/*
-** Functions internal to this module.
-*/
-
-/* {{{ ora_get_cursor
- */
-static oraCursor *
-ora_get_cursor(HashTable *list, pval **ind TSRMLS_DC)
-{
- oraCursor *cursor;
- oraConnection *db_conn;
-
- cursor = (oraCursor *) zend_fetch_resource(ind TSRMLS_CC, -1, "Oracle-Cursor", NULL, 1, le_cursor);
- if (! cursor) {
- return NULL;
- }
-
- if (zend_hash_find(ORA(conns),(void*)&(cursor->conn_ptr),sizeof(void*),(void **)&db_conn) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connection already closed for cursor index %d", ind);
- return NULL;
- }
-
- return cursor;
-}
-/* }}} */
-
-/* {{{ ora_error
- */
-static char *
-ora_error(Cda_Def * cda)
-{
- sword n, l;
- static text errmsg[ 512 ];
-
- n = oerhms(cda, cda->rc, errmsg, 400);
-
- /* remove the last newline */
- l = strlen(errmsg);
- if (l < 400 && errmsg[l - 1] == '\n') {
- errmsg[l - 1] = '\0';
- l--;
- }
- if (cda->fc > 0) {
- strcat(errmsg, " -- while processing OCI function ");
- strncat(errmsg, ora_func_tab[cda->fc], 75); /* 512 - 400 - 36 */
- }
- return (char *) errmsg;
-}
-/* }}} */
-
-/* {{{ ora_describe_define
- */
-static sword
-ora_describe_define(oraCursor * cursor)
-{
- long col = 0;
- int i;
- sb2 type;
- sb4 dbsize;
- TSRMLS_FETCH();
-
- if (cursor == NULL) {
- return -1;
- }
-
- if (cursor->columns) {
- for(i = 0; i < cursor->ncols; i++){
- if (cursor->columns[i].buf)
- efree(cursor->columns[i].buf);
- }
- efree(cursor->columns);
- }
-
- cursor->ncols = 0;
-
- while(1){
- if (odescr(&cursor->cda, (sword) cursor->ncols + 1, &dbsize, (sb2 *)0, (sb1 *)0,
- (sb4 *)0, (sb4 *)0, (sb2 *)0, (sb2 *)0, (sb2 *)0)){
- if (cursor->cda.rc == VAR_NOT_IN_LIST) {
- break;
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ora_error(&cursor->cda));
- cursor->ncols = 0;
- return -1;
- }
- }
- cursor->ncols++;
- }
-
- if (cursor->ncols > 0){
- cursor->columns = (oraColumn *) safe_emalloc(sizeof(oraColumn), cursor->ncols, 0);
- memset(cursor->columns,0,sizeof(oraColumn) * cursor->ncols);
- }
-
- for(col = 0; col < cursor->ncols; col++){
- cursor->columns[col].cbufl = ORANAMELEN;
-
- if (odescr(&cursor->cda, (sword)col + 1, &cursor->columns[col].dbsize,
- &cursor->columns[col].dbtype, &cursor->columns[col].cbuf[0],
- &cursor->columns[col].cbufl, &cursor->columns[col].dsize,
- &cursor->columns[col].prec, &cursor->columns[col].scale,
- &cursor->columns[col].nullok)) {
- if (cursor->cda.rc == VAR_NOT_IN_LIST) {
- break;
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ora_error(&cursor->cda));
- return -1;
- }
- }
-
- cursor->columns[col].cbuf[cursor->columns[col].cbufl] = '\0';
-
- switch (cursor->columns[col].dbtype) {
- case SQLT_LBI:
- cursor->columns[col].dsize = DB_SIZE;
- type = SQLT_LBI;
- break;
- case SQLT_LNG:
- cursor->columns[col].dsize = DB_SIZE;
- default:
- type = SQLT_STR;
- break;
- }
-
- cursor->columns[col].buf = (ub1 *) emalloc(cursor->columns[col].dsize + 1);
-
- /* Define an output variable for the column */
- if (odefin(&cursor->cda, (sword)col + 1, cursor->columns[col].buf,
- cursor->columns[col].dsize + 1, type, -1, &cursor->columns[col].indp,
- (text *) 0, -1, -1, &cursor->columns[col].col_retlen,
- &cursor->columns[col].col_retcode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ora_error(&cursor->cda));
- return -1;
- }
- }
- return 1;
-}
-/* }}} */
-
-/* {{{ ora_set_param_values
- */
-int ora_set_param_values(oraCursor *cursor, int isout TSRMLS_DC)
-{
- char *paramname;
- oraParam *param;
- pval **pdata;
- int i, len, plen;
-
- zend_hash_internal_pointer_reset(cursor->params);
-
- if(zend_hash_num_elements(cursor->params) != cursor->nparams){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mismatch in number of parameters");
- return 0;
- }
-
- for(i = 0; i < cursor->nparams; i++, zend_hash_move_forward(cursor->params)){
- if(zend_hash_get_current_key(cursor->params, &paramname, NULL, 0) != HASH_KEY_IS_STRING){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't get parameter name");
- return 0;
- }
-
- if(zend_hash_get_current_data(cursor->params, (void **)&param) == FAILURE){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't get parameter data");
- return 0;
- }
-
- if(isout){
- SET_VAR_STRINGL(paramname, estrdup(param->progv), strlen(param->progv));
- continue;
- }
-
- /* doing the in-loop */
-
- if (zend_hash_find(&EG(symbol_table), paramname, strlen(paramname) + 1, (void **)&pdata) == FAILURE){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't find variable for parameter");
- return 0;
- }
-
- convert_to_string(*pdata);
- plen = Z_STRLEN_PP(pdata);
-
- if (param->progvl <= plen){
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Input value will be truncated");
- }
-
- len = min(param->progvl - 1, plen);
-
- strncpy(param->progv, Z_STRVAL_PP(pdata), len);
- param->progv[len] = '\0';
- }
-
- return 1;
-}
-/* }}} */
-
-#endif /* HAVE_ORACLE */
-
-/*
- * 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/oracle/oracle.dsp b/ext/oracle/oracle.dsp
deleted file mode 100644
index fbaa218ab..000000000
--- a/ext/oracle/oracle.dsp
+++ /dev/null
@@ -1,113 +0,0 @@
-# Microsoft Developer Studio Project File - Name="oracle" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=oracle - 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 "oracle.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 "oracle.mak" CFG="oracle - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "oracle - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "oracle - 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)" == "oracle - 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_ORACLE" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\oci73\include" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ORACLE=1 /D COMPILE_DL_ORACLE=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib ociw32.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_oracle.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\oci73\lib" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "oracle - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\oci73\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ORACLE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ORACLE=1 /D COMPILE_DL_ORACLE=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts-debug.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts_debug.lib ociw32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_oracle.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\oci73\lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "oracle - Win32 Release_TS"
-# Name "oracle - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\oracle.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_oracle.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/oracle/package.xml b/ext/oracle/package.xml
deleted file mode 100644
index 53e07e79c..000000000
--- a/ext/oracle/package.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>oracle</name>
- <summary>Oracle functions</summary>
- <maintainers>
- <maintainer>
- <user>thies</user>
- <name>Thies C. Arntzen</name>
- <email>thies@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>ssb</user>
- <name>Stig Bakken</name>
- <email>ssb@php.net</email>
- <role>developer</role>
- </maintainer>
- <maintainer>
- <user>rasmus</user>
- <name>Rasmus Lerdorf</name>
- <email>rasmus@php.net</email>
- <role>developer</role>
- </maintainer>
- <maintainer>
- <user>???</user>
- <name>Mitch Golden</name>
- <email>mgolden@interport.net</email>
- <role>developer</role>
- </maintainer>
- <maintainer>
- <user>???</user>
- <name>Andreas Karajannis</name>
- <email>Andreas.Karajannis@gmd.de</email>
- <role>developer</role>
- </maintainer>
- </maintainers>
- <description>
-This extension adds support for Oracle database server access.
-For Oracle 8 and above you should use the oci8 extension instead.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support intallation using pear installer
- </notes>
- <configureoptions>
- <configureoption name="with-oracle" default="autodetect" prompt="ORACLE_HOME directory?"/>
- </configureoptions>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="oracle.dsp"/>
- <file role="src" name="oracle.c"/>
- <file role="src" name="php_oracle.h"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/oracle/php_oracle.h b/ext/oracle/php_oracle.h
deleted file mode 100644
index 4b187efcc..000000000
--- a/ext/oracle/php_oracle.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* $Id: php_oracle.h,v 1.8 2001/07/28 11:36:05 zeev Exp $ */
-
-/* synced with oracle.h,v 1.40 1999/06/01 08:11:04 thies Exp $ */
-
-#ifndef PHP_ORACLE_H
-#define PHP_ORACLE_H
-
-#if HAVE_ORACLE
-
-#if (defined(__osf__) && defined(__alpha))
-# ifndef A_OSF
-# define A_OSF
-# endif
-# ifndef OSF1
-# define OSF1
-# endif
-# ifndef _INTRINSICS
-# define _INTRINSICS
-# endif
-#endif /* osf alpha */
-
-#include "oratypes.h"
-#include "ocidfn.h"
-#include "ociapr.h"
-
-extern zend_module_entry oracle_module_entry;
-#define phpext_oracle_ptr &oracle_module_entry
-
-#ifdef ZTS
-#define ORA(v) TSRMG(ora_globals_id, php_ora_globals *, v)
-#else
-#define ORA(v) (ora_globals.v)
-#endif
-
-/* oparse flags */
-#define DEFER_PARSE 1
-#define NATIVE 1
-#define VERSION_7 2
-
-#define ORANUMWIDTH 38
-
-#if (defined(__osf__) && defined(__alpha)) || defined(CRAY) || defined(KSR)
-#define HDA_SIZE 512
-#else
-#define HDA_SIZE 256
-#endif
-
-#define ORAUIDLEN 32
-#define ORAPWLEN 32
-#define ORANAMELEN 32
-#define ORABUFLEN 2000
-
-/* Some Oracle error codes */
-#define VAR_NOT_IN_LIST 1007
-#define NO_DATA_FOUND 1403
-#define NULL_VALUE_RETURNED 1405
-
-/* Some SQL and ORA function codes */
-#define FT_INSERT 3
-#define FT_SELECT 4
-#define FT_UPDATE 5
-#define FT_DELETE 9
-
-#define FC_OOPEN 14
-
-typedef struct {
- int open;
- int persistent;
- Lda_Def lda;
- ub1 hda[HDA_SIZE];
-} oraConnection;
-
-typedef struct oraColumn {
- sb4 dbsize;
- sb2 dbtype;
- text cbuf[ORANAMELEN+1];
- sb4 cbufl;
- sb4 dsize;
- sb2 prec;
- sb2 scale;
- sb2 nullok;
- ub1 *buf;
- sb2 indp;
- ub2 col_retlen, col_retcode;
-} oraColumn;
-
-typedef struct oraParam {
- text *progv;
- sword progvl;
- sb2 inout;
- ub2 alen;
-} oraParam;
-
-typedef struct oraCursor {
- int open;
- Cda_Def cda;
- text *query;
- HashTable *params;
- int nparams;
- oraColumn *columns;
- int ncols;
- int fetched;
- oraConnection *conn_ptr;
- int conn_id;
-} oraCursor;
-
-typedef struct {
- char *defDB;
- char *defUser;
- char *defPW;
- long allow_persistent;
- long max_persistent;
- long max_links;
- long num_persistent;
- long num_links;
- HashTable *conns;
- oraConnection db_err_conn;
-} php_ora_globals;
-
-#else
-
-#define phpext_oracle_ptr NULL
-
-#endif /* HAVE_ORACLE */
-
-#endif /* PHP_ORACLE_H */
-
-/*
- * Local Variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
-
-
-
-
diff --git a/ext/ovrimos/CREDITS b/ext/ovrimos/CREDITS
deleted file mode 100644
index b8c4b7563..000000000
--- a/ext/ovrimos/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-Ovrimos
-Nikos Mavroyanopoulos
diff --git a/ext/ovrimos/config.m4 b/ext/ovrimos/config.m4
deleted file mode 100644
index 20c20025a..000000000
--- a/ext/ovrimos/config.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-dnl
-dnl $Id: config.m4,v 1.6 2003/10/01 02:53:11 sniper Exp $
-dnl
-
-PHP_ARG_WITH(ovrimos, for Ovrimos SQL Server support,
-[ --with-ovrimos[=DIR] Include Ovrimos SQL Server support. DIR is the
- Ovrimos libsqlcli install directory.])
-
-if test "$PHP_OVRIMOS" != "no"; then
- for i in $PHP_OVRIMOS /usr/local /usr; do
- test -f $i/include/sqlcli.h && OVRIMOS_DIR=$i && break
- done
-
- if test -z "$OVRIMOS_DIR"; then
- AC_MSG_ERROR(Please reinstall Ovrimos' libsqlcli - I cannot find sqlcli.h)
- fi
-
- PHP_ADD_INCLUDE($OVRIMOS_DIR/include)
- LDFLAGS="$LDFLAGS $ld_runpath_switch$OVRIMOS_DIR/lib -L$OVRIMOS_DIR/lib"
- AC_CHECK_LIB(sqlcli, main)
- PHP_ADD_LIBRARY_WITH_PATH(sqlcli, $OVRIMOS_DIR/lib, OVRIMOS_SHARED_LIBADD)
-
- PHP_NEW_EXTENSION(ovrimos, ovrimos.c, $ext_shared)
- PHP_SUBST(OVRIMOS_SHARED_LIBADD)
- AC_DEFINE(HAVE_LIBSQLCLI,1,[ ])
-fi
diff --git a/ext/ovrimos/ovrimos.c b/ext/ovrimos/ovrimos.c
deleted file mode 100644
index c0f502165..000000000
--- a/ext/ovrimos/ovrimos.c
+++ /dev/null
@@ -1,1291 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Dimitris Souflis, Nikos Mavroyanopoulos |
- | for Ovrimos S.A. |
- | |
- | Contact support@ovrimos.com for questions regarding this module |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: ovrimos.c,v 1.26 2004/01/08 08:16:42 andi Exp $ */
-
-#include "php.h"
-#include "php_globals.h"
-#include "zend_API.h"
-#include "ext/standard/php_standard.h"
-#include "ext/standard/info.h"
-
-#include <sqlcli.h> /* ovrimos header
- */
-
-#ifndef WIN32 /* stricmp is defined in sqlcli */
-# define stricmp strcasecmp
-#endif
-
-
-PHP_MINFO_FUNCTION(ovrimos)
-{
- php_printf("&quot;Ovrimos&quot; module<br />\n");
-}
-
-/* Main User Functions
- */
-
-/* ovrimos_connect() currently does not support secure (SSL/TLS) connections.
- * As an alternative you can use the unixODBC driver available at
- * http://www.ovrimos.com/download which supports SSL.
- * Contact support@ovrimos.com for more information.
- */
-
-/* 2001-07-27: ovrimos_close_all() function was removed in order
- * for this module to be reentrant.
- */
-
-
-/* structures introduced in order to support the old ovrimos-php-api with
- * the new multi-threaded library (old works with the old library).
- * This version is reentrant.
- *
- * The only limitation is that a connection ( as returned by ovrimos_connect())
- * may only be accessed by one thread (but this is the case in php now).
- */
-
-typedef struct {
- SQLS statement;
- int longreadlen;
- struct _CON_STATE* con_state;
-} STATEMENT;
-
-typedef struct _CON_STATE {
- SQLH connection;
- STATEMENT * statements;
- int nstatements;
-} CON_STATE;
-
-typedef STATEMENT* PSTATEMENT;
-typedef CON_STATE* PCON_STATE;
-
-static void column_to_string(SQLS stmt, int i, char *buffer, int *len, PSTATEMENT pstmt);
-
-/* {{{ proto int ovrimos_connect(string host, string db, string user, string password)
- Connect to an Ovrimos database */
-PHP_FUNCTION(ovrimos_connect)
-{
- pval *arg1, *arg2, *arg3, *arg4;
- PCON_STATE state;
- SQLH conn = 0;
-
- if (ARG_COUNT(ht) != 4
- || getParameters(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_string(arg1);
- convert_to_string(arg2);
- convert_to_string(arg3);
- convert_to_string(arg4);
-
- if (!sqlConnect
- (Z_STRVAL_P(arg1), Z_STRVAL_P(arg2), Z_STRVAL_P(arg3),
- Z_STRVAL_P(arg4), &conn, 0)) {
- RETURN_LONG(0);
- }
-
- state = ecalloc( 1, sizeof(CON_STATE));
-
- state->connection = conn;
- state->statements = NULL;
- state->nstatements = 0;
-
- RETURN_LONG( (long)state);
-}
-
-/* }}} */
-
-/* {{{ proto void ovrimos_close(int connection)
- Close a connection */
-PHP_FUNCTION(ovrimos_close)
-{
- pval *arg1;
- int i;
- PCON_STATE state;
-
- if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &arg1) == FAILURE
- || Z_TYPE_P(arg1) != IS_LONG) {
- WRONG_PARAM_COUNT;
- }
-
- state = (PCON_STATE) Z_LVAL_P(arg1);
-
- /* free all the statements associated with
- * the connection. (called results in php)
- */
-
- for (i=0;i < state->nstatements;i++) {
- if ( state->statements[i].statement!=NULL) {
- sqlFreeStmt( state->statements[i].statement);
- }
- }
- if (state->statements!=NULL)
- efree( state->statements);
-
- /* close the SQL_Handle
- */
- sqlDisconnect( state->connection);
-
- efree( state);
-
- return;
-}
-
-/* }}} */
-
-
-/* {{{ proto bool ovrimos_longreadlen(int result_id, int length)
- Handle LONG columns */
-PHP_FUNCTION(ovrimos_longreadlen)
-{
- pval *arg1, *arg2;
- PSTATEMENT stmt;
-
- if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_long(arg1);
- convert_to_long(arg2);
-
- stmt = (PSTATEMENT) Z_LVAL_P(arg1);
-
- stmt->longreadlen = Z_LVAL_P(arg2);
- RETURN_TRUE;
-}
-
-/* }}} */
-
-#define DEFAULT_LONGREADLEN 0
-
-/* These two functions are quite expensive. Some optimization may be
- * done in a later version.
- */
-static int local_sqlAllocStmt( PCON_STATE state, SQLH conn, SQLS *stmt, PSTATEMENT* pstmt) {
-int index, ret;
-
- ret = sqlAllocStmt( conn, stmt);
- if (!ret) return ret;
-
- state->nstatements++;
- state->statements = erealloc(state->statements, state->nstatements*sizeof( STATEMENT));
-
- index = state->nstatements - 1;
- state->statements[ index].statement = (*stmt);
- state->statements[ index].longreadlen = DEFAULT_LONGREADLEN;
- state->statements[ index].con_state = state;
-
- *pstmt = &state->statements[ index];
-
- return 1;
-}
-
-static int local_sqlFreeStmt( PSTATEMENT statement, SQLS stmt) {
-int j, i;
-PSTATEMENT new_statements;
-PCON_STATE state = statement->con_state;
-
- sqlFreeStmt( stmt);
-
- if (state->nstatements-1 == 0) {
- efree( state->statements);
- state->statements = NULL;
- state->nstatements--;
-
- return 1;
- }
-
- new_statements = safe_emalloc( (state->nstatements-1), sizeof(STATEMENT), 0);
-
- for (i=j=0;i<state->nstatements;i++) {
- if (state->statements->statement != stmt) {
- new_statements[j].statement = state->statements[i].statement;
- new_statements[j].longreadlen = state->statements[i].longreadlen;
- new_statements[j++].con_state = state->statements[i].con_state;
- }
- }
-
- efree( state->statements);
- state->statements = new_statements;
- state->nstatements--;
-
- return 1; /* true */
-}
-
-/* {{{ proto int ovrimos_prepare(int connection_id, string query)
- Prepares a statement for execution */
-PHP_FUNCTION(ovrimos_prepare)
-{
- pval *arg1, *arg2;
- SQLH conn;
- char *query;
- SQLS stmt;
- PCON_STATE state;
- PSTATEMENT pstmt;
-
- if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_long(arg1);
- convert_to_string(arg2);
-
- state = (PCON_STATE) Z_LVAL_P(arg1);
-
- conn = (SQLH) state->connection;
- query = Z_STRVAL_P(arg2);
-
- if (!local_sqlAllocStmt( state, conn, &stmt, &pstmt)) {
- RETURN_FALSE;
- }
- if (!sqlPrepare(stmt, query)) {
- local_sqlFreeStmt( pstmt, stmt);
- RETURN_FALSE;
- }
- if (!sqlGetOutputColDescr(stmt)) {
- local_sqlFreeStmt( pstmt, stmt);
- RETURN_FALSE;
- }
- if (!sqlGetParamDescr(stmt)) {
- local_sqlFreeStmt( pstmt, stmt);
- RETURN_FALSE;
- }
-
- /* returns a result id which is actually a
- * pointer to a STATEMENT structure;
- */
- RETURN_LONG( (long)pstmt);
-}
-
-/* }}} */
-
-/*
- * Execute prepared SQL statement. Supports only input parameters.
- */
-/* {{{ proto bool ovrimos_execute(int result_id [, array parameters_array])
- Execute a prepared statement */
-PHP_FUNCTION(ovrimos_execute)
-{
- pval *arg1, *arg2;
- SQLS stmt;
- int numArgs;
- int icol, colnb;
- PSTATEMENT pstmt;
-
- numArgs = ARG_COUNT(ht);
-
- if (getParameters(ht, numArgs, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg1);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
-
- stmt = pstmt->statement;
- colnb = sqlGetParamNb(stmt);
-
- if (colnb != 0) {
- pval **tmp;
- int arr_elem;
-
- if (Z_TYPE_P(arg2) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not an array in call to ovrimos_execute()");
- RETURN_FALSE;
- }
- arr_elem = zend_hash_num_elements(Z_ARRVAL_P(arg2));
- if (arr_elem < colnb) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not enough parameters in call to ovrimos_execute(): %d instead of %d", arr_elem, colnb);
- RETURN_FALSE;
- }
-
- zend_hash_internal_pointer_reset(Z_ARRVAL_P(arg2));
-
- for (icol = 0; icol < colnb; icol++) {
- int len;
- cvt_error err;
- bool ret;
- char *msg;
- char buffer[10240];
- sql_type to_type = sqlGetParamSQLType(stmt, icol);
- sql_type from_type;
-
- if (zend_hash_get_current_data
- (Z_ARRVAL_P(arg2), (void **) &tmp) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error getting parameter %d in call to ovrimos_execute()", icol);
- RETURN_FALSE;
- }
- convert_to_string(*tmp);
- if (Z_TYPE_PP(tmp) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error converting parameter %d to string in call to ovrimos_execute()", icol);
- RETURN_FALSE;
- }
-
- /* PHP data to param type */
- Z_TYPE(from_type) = T_VARCHAR;
- from_type.u.length = Z_STRLEN_PP(tmp);
-
- *buffer = 0;
- memcpy(buffer + 1, Z_STRVAL_PP(tmp),
- from_type.u.length);
- buffer[from_type.u.length + 1] = 0;
-
- ret =
- type_convert(buffer, &from_type, &to_type, 0,
- &err);
- switch (err) {
- case cvt_trunc:
- msg = "Data truncated";
- break;
- case cvt_range:
- msg = "Numeric value out of range";
- break;
- case cvt_prec:
- msg = "Precision lost";
- break;
- case cvt_incomp:
- msg =
- "Restricted data type attribute violation";
- break;
- case cvt_no:
- msg = "Conversion failed";
- break;
- default:
- msg = "Unknown error";
- break;
- }
- if (!ret) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error converting parameter %d: %s in call to ovrimos_execute()", icol, msg);
- RETURN_FALSE;
- }
-
- len = sql_type_size(to_type) - 1;
- if (!sqlPutParam(stmt, icol, buffer + 1, len)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could send parameter %d (%d bytes) in call to ovrimos_execute()", icol, len);
- RETURN_FALSE;
- }
- }
- }
-
- if (!sqlExec(stmt)) {
- RETURN_FALSE;
- }
-
- RETURN_TRUE;
-}
-
-/* }}} */
-
-/* {{{ proto string ovrimos_cursor(int result_id)
- Get cursor name */
-PHP_FUNCTION(ovrimos_cursor)
-{
- char cname[126];
- pval *arg1;
- SQLS stmt;
- PSTATEMENT pstmt;
-
- if (getParameters(ht, 1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_long(arg1);
-
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
- stmt = pstmt->statement;
-
- if (!sqlGetCursorName(stmt, cname)) {
- RETURN_FALSE;
- }
- RETURN_STRING(cname, 1);
-}
-
-/* }}} */
-
-/* This function returns a result id. The result ID is
- * a pointer to a STATEMENT structure.
- * Every result is mapped to a statement.
- */
-
-/* {{{ proto int ovrimos_exec(int connection_id, string query)
- Prepare and execute an SQL statement */
-PHP_FUNCTION(ovrimos_exec)
-{
- pval *arg1, *arg2;
- SQLH conn;
- SQLS stmt;
- int numArgs;
- char *query;
- PSTATEMENT pstmt;
- PCON_STATE state;
-
- numArgs = ARG_COUNT(ht);
- if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg1);
- convert_to_string(arg2);
-
- state = (PCON_STATE) Z_LVAL_P(arg1);
- conn = state->connection;
- query = Z_STRVAL_P(arg2);
-
- if (!local_sqlAllocStmt( state, conn, &stmt, &pstmt)) {
- RETURN_FALSE;
- }
-
- if (!sqlExecDirect(stmt, query)) {
- local_sqlFreeStmt( pstmt, stmt);
- RETURN_FALSE;
- }
- if (!sqlGetOutputColDescr(stmt)) {
- local_sqlFreeStmt( pstmt, stmt);
- RETURN_FALSE;
- }
- if (!sqlGetParamDescr(stmt)) {
- local_sqlFreeStmt( pstmt, stmt);
- RETURN_FALSE;
- }
-
- RETURN_LONG( (long)pstmt);
-}
-
-/* }}} */
-
-/* {{{ column_to_string
- */
-static void column_to_string(SQLS stmt, int i, char *buffer, int *len, PSTATEMENT pstmt)
-{
- const char *bf = sqlColValue(stmt, i, 0);
- int longreadlen;
-
- longreadlen = pstmt->longreadlen;
-
- switch (sqlGetOutputColType(stmt, i)) {
- case T_BIGINT:
- case T_UBIGINT:{
- switch (sqlGetOutputColType(stmt, i)) {
- case T_BIGINT:
- printsint64(Read(sint64, bf), buffer);
- break;
- case T_UBIGINT:
- printuint64(Read(uint64, bf), buffer);
- break;
- }
- *len = strlen(buffer);
- }
- break;
- case T_INTEGER:
- sprintf(buffer, "%11d", Read(sint32, bf));
- *len = strlen(buffer);
- break;
- case T_UINTEGER:
- sprintf(buffer, "%10u", Read(uint32, bf));
- *len = strlen(buffer);
- break;
- case T_SMALLINT:
- sprintf(buffer, "%6hd", Read(sint16, bf));
- *len = strlen(buffer);
- break;
- case T_USMALLINT:
- sprintf(buffer, "%5hu", Read(uint16, bf));
- *len = strlen(buffer);
- break;
- case T_TINYINT:
- sprintf(buffer, "%4hd", (sint16) Read(sint8, bf));
- *len = strlen(buffer);
- break;
- case T_UTINYINT:
- sprintf(buffer, "%3hu", (uint16) Read(uint8, bf));
- *len = strlen(buffer);
- break;
- case T_BIT:
- sprintf(buffer, "%s",
- (Read(uint8, bf) == 0) ? "off" : "on");
- *len = strlen(buffer);
- break;
- case T_REAL:
- sprintf(buffer, "%9.7g", (double) Read(float, bf));
- *len = strlen(buffer);
- break;
-
- case T_FLOAT:
- case T_DOUBLE:
- sprintf(buffer, "%19.17g", Read(double, bf));
- *len = strlen(buffer);
- break;
- case T_DECIMAL:
- case T_NUMERIC:{
- int prec = sqlGetOutputColPrecision(stmt, i);
- int scale = sqlGetOutputColScale(stmt, i);
- sprintf(buffer, "%*.*f", prec + 2, scale,
- Read(double, bf));
- *len = strlen(buffer);
- } break;
- case T_CHAR:
- case T_VARCHAR:
- strcpy(buffer, bf);
- *len = strlen(buffer);
- break;
- case T_UNI_CHAR:
- case T_UNI_VARCHAR:
- uni_strcpy((uni_char *) buffer, (uni_char *) bf);
- *len = uni_strlen((uni_char *) buffer);
- break;
- case T_BINARY:{
- int sz = sqlGetOutputColLength(stmt, i);
- memcpy(buffer, bf, sz);
- *len = sz;
- } break;
-
- case T_VARBINARY:{
- int sz = Read(uint16, bf);
- memcpy(buffer, bf + 2, sz);
- *len = sz;
- } break;
-
- case T_DATE:{
- if (!sql_date_to_str((uint32 *) bf, buffer)) {
- strcpy(buffer, "Error!");
- }
- }
- break;
-
- case T_TIME:{
- int prec = sqlGetOutputColPrecision(stmt, i);
- if (!sql_time_to_str
- ((uint32 *) bf, prec, 0, buffer)) {
- strcpy(buffer, "Error!");
- }
- }
- break;
-
- case T_TIMESTAMP:{
- int prec = sqlGetOutputColPrecision(stmt, i);
- if (!sql_timestamp_to_str
- ((uint32 *) bf, prec, 0, buffer)) {
- strcpy(buffer, "Error!");
- }
-
- }
- break;
-
- case T_LONGVARCHAR:
- case T_LONGVARBINARY:{
- if (longreadlen == 0) {
- *buffer = 0;
- *len = 0;
- } else
- if (!sqlColValueLong
- (stmt, i, 0, 0, longreadlen, buffer, len)) {
- strcpy(buffer, "Error!");
- }
- }
- break;
- }
-}
-/* }}} */
-
-/* {{{ proto bool ovrimos_fetch_into(int result_id, array result_array [, string how [, int rownumber]])
- Fetch one result row into an array
- how: 'Next' (default), 'Prev', 'First', 'Last', 'Absolute'
- */
-PHP_FUNCTION(ovrimos_fetch_into)
-{
- int numArgs;
- char *s_how;
- typedef enum { h_next = 0, h_prev, h_first, h_last, h_absolute
- } h_type;
- h_type how = h_next; /* default */
- sint32 rownum = 0;
- pval *arg_id, *arg_how = 0, *arg_row = 0, *arr, *tmp;
- SQLS stmt;
- PSTATEMENT pstmt;
- int icol, colnb;
- bool ret=0;
- numArgs = ARG_COUNT(ht);
-
- switch (numArgs) {
- case 2:
- if (getParameters(ht, 2, &arg_id, &arr) == FAILURE)
- WRONG_PARAM_COUNT;
- break;
- case 3:
- if (getParameters(ht, 3, &arg_id, &arr, &arg_how) ==
- FAILURE) WRONG_PARAM_COUNT;
- break;
- case 4:
- if (getParameters(ht, 4, &arg_id, &arr, &arg_how, &arg_row)
- == FAILURE)
- WRONG_PARAM_COUNT;
- break;
- default:
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg_id);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg_id);
-
- stmt = pstmt->statement;
-
- if (arg_how != 0) {
- if (Z_TYPE_P(arg_how) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third argument not string in ovrimos_fetch_into()");
- RETURN_FALSE;
- }
- s_how = Z_STRVAL_P(arg_how);
- if (stricmp(s_how, "next") == 0) {
- how = h_next;
- } else if (stricmp(s_how, "prev") == 0) {
- how = h_prev;
- } else if (stricmp(s_how, "first") == 0) {
- how = h_first;
- } else if (stricmp(s_how, "last") == 0) {
- how = h_last;
- } else if (stricmp(s_how, "absolute") == 0) {
- how = h_absolute;
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third argument not valid in ovrimos_fetch_into()");
- RETURN_FALSE;
- }
- if (arg_row == 0 && how == h_absolute) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth argument is required for ABSOLUTE in ovrimos_fetch_into()");
- RETURN_FALSE;
- }
- if (arg_row != 0) {
- convert_to_long(arg_row);
- rownum = Z_LVAL_P(arg_row);
- switch (how) {
- case h_next:
- case h_prev:
- rownum--; /* Next 1 should send FUNC_CURSOR_NEXT(0) */
- break;
- default:
- break;
- }
- }
- }
-
- if (Z_TYPE_P(arr) != IS_ARRAY) {
- array_init(arr);
- }
- switch (how) {
- case h_absolute:
- case h_first:
- ret = sqlCursorFirst(stmt, rownum);
- break;
- case h_last:
- ret = sqlCursorLast(stmt, rownum);
- break;
- case h_next:
- ret = sqlCursorNext(stmt, rownum);
- break;
- case h_prev:
- ret = sqlCursorPrev(stmt, rownum);
- break;
- }
- if (!ret) {
- RETURN_FALSE;
- }
-
- colnb = sqlGetOutputColNb(stmt);
- for (icol = 0; icol < colnb; icol++) {
- int len;
- char buffer[10240];
- tmp = (pval *) emalloc(sizeof(pval));
- tmp->refcount = 1;
- Z_TYPE_P(tmp) = IS_STRING;
- Z_STRLEN_P(tmp) = 0;
-
- /* Produce column value in 'tmp' ... */
-
- column_to_string(stmt, icol, buffer, &len, pstmt);
- Z_STRLEN_P(tmp) = len;
- Z_STRVAL_P(tmp) = estrndup(buffer, len);
-
- zend_hash_index_update(Z_ARRVAL_P(arr), icol, &tmp,
- sizeof(pval *), NULL);
- }
-
- RETURN_TRUE;
-}
-
-/* }}} */
-
-/* {{{ proto bool ovrimos_fetch_row(int result_id [, int how [, int row_number]])
- how: 'Next' (default), 'Prev', 'First', 'Last', 'Absolute'
- Fetch a row */
-PHP_FUNCTION(ovrimos_fetch_row)
-{
- int numArgs;
- char *s_how;
- typedef enum { h_next = 0, h_prev, h_first, h_last, h_absolute
- } h_type;
- h_type how = h_next; /* default */
- sint32 rownum = 0;
- pval *arg_id, *arg_how = 0, *arg_row = 0;
- SQLS stmt;
- PSTATEMENT pstmt;
- bool ret = 0;
- numArgs = ARG_COUNT(ht);
-
- switch (numArgs) {
- case 1:
- if (getParameters(ht, 1, &arg_id) == FAILURE)
- WRONG_PARAM_COUNT;
- break;
- case 2:
- if (getParameters(ht, 2, &arg_id, &arg_how) == FAILURE)
- WRONG_PARAM_COUNT;
- break;
- case 3:
- if (getParameters(ht, 3, &arg_id, &arg_how, &arg_row) ==
- FAILURE) WRONG_PARAM_COUNT;
- break;
- default:
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg_id);
-
- pstmt = (PSTATEMENT) Z_LVAL_P(arg_id);
- stmt = (SQLS) pstmt->statement;
-
- if (arg_how != 0) {
- if (Z_TYPE_P(arg_how) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument not string in ovrimos_fetch_row()");
- RETURN_FALSE;
- }
- s_how = Z_STRVAL_P(arg_how);
- if (stricmp(s_how, "next") == 0) {
- how = h_next;
- } else if (stricmp(s_how, "prev") == 0) {
- how = h_prev;
- } else if (stricmp(s_how, "first") == 0) {
- how = h_first;
- } else if (stricmp(s_how, "last") == 0) {
- how = h_last;
- } else if (stricmp(s_how, "absolute") == 0) {
- how = h_absolute;
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument not valid in ovrimos_fetch_row()");
- RETURN_FALSE;
- }
- if (arg_row == 0 && how == 4) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third argument is required for ABSOLUTE in ovrimos_fetch_row()");
- RETURN_FALSE;
- }
- if (arg_row != 0) {
- convert_to_long(arg_row);
- rownum = Z_LVAL_P(arg_row);
- switch (how) {
- case h_next:
- case h_prev:
- rownum--; /* Next 1 should send FUNC_CURSOR_NEXT(0) */
- break;
- default:
- break;
- }
- }
- }
-
- switch (how) {
- case h_absolute:
- case h_first:
- ret = sqlCursorFirst(stmt, rownum);
- break;
- case h_last:
- ret = sqlCursorLast(stmt, rownum);
- break;
- case h_next:
- ret = sqlCursorNext(stmt, rownum);
- break;
- case h_prev:
- ret = sqlCursorPrev(stmt, rownum);
- break;
- }
- if (!ret) {
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-
-/* }}} */
-
-/* {{{ proto string ovrimos_result(int result_id, mixed field)
- Get result data */
-PHP_FUNCTION(ovrimos_result)
-{
- int numArgs = ARG_COUNT(ht);
- pval *arg_id, *arg_field;
- int icol=0, colnb;
- SQLS stmt;
- int len;
- PSTATEMENT pstmt;
- char buffer[1024];
-
- if (numArgs != 2
- || getParameters(ht, 2, &arg_id,
- &arg_field) == FAILURE) WRONG_PARAM_COUNT;
-
- convert_to_long(arg_id);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg_id);
- stmt = (SQLS) pstmt->statement;
-
- colnb = sqlGetOutputColNb(stmt);
-
- if (Z_TYPE_P(arg_field) == IS_STRING) {
- int i;
- for (i = 0; i < colnb; i++) {
- if (!stricmp
- (Z_STRVAL_P(arg_field),
- sqlGetOutputColName(stmt, i))) {
- icol = i;
- break;
- }
- }
- } else if (Z_TYPE_P(arg_field) == IS_LONG) {
- icol = Z_LVAL_P(arg_field) - 1;
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument neither number nor string in ovrimos_result()");
- RETURN_FALSE;
- }
- if (icol < 0 || icol > colnb) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown column in ovrimos_result()");
- RETURN_FALSE;
- }
- column_to_string(stmt, icol, buffer, &len, pstmt);
-
- RETURN_STRINGL(buffer, len, 1);
-}
-
-/* }}} */
-
-/* {{{ proto int ovrimos_result_all(int result_id [, string format])
- Print result as HTML table */
-PHP_FUNCTION(ovrimos_result_all)
-{
- long fetched = 0;
- pval *arg1, *arg2;
- int numArgs;
- SQLS stmt;
- int icol, colnb;
- PSTATEMENT pstmt;
- char buffer[1024];
- int len;
-
- numArgs = ARG_COUNT(ht);
- if (numArgs == 1) {
- if (getParameters(ht, 1, &arg1) == FAILURE)
- WRONG_PARAM_COUNT;
- } else {
- if (getParameters(ht, 2, &arg1, &arg2) == FAILURE)
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg1);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
- stmt = (SQLS) pstmt->statement;
-
- colnb = sqlGetOutputColNb(stmt);
-
- /* Start table tag */
- if (numArgs == 1) {
- php_printf("<table><tr>");
- } else {
- convert_to_string(arg2);
- php_printf("<table %s ><tr>", Z_STRVAL_P(arg2));
- }
-
- for (icol = 0; icol < colnb; icol++) {
- php_printf("<th>%s</th>", sqlGetOutputColName(stmt, icol));
- }
-
- php_printf("</tr>\n");
-
- if (sqlCursorFirst(stmt, 0)) {
- do {
- fetched++;
- php_printf("<tr>");
- for (icol = 0; icol < colnb; icol++) {
- column_to_string(stmt, icol, buffer, &len, pstmt);
- php_printf("<td>%s</td>", buffer);
- }
- php_printf("</tr>\n");
- } while (sqlCursorNext(stmt, 0));
- }
- php_printf("</table>\n");
-
- RETURN_LONG(fetched);
-}
-
-/* }}} */
-
-/* {{{ proto bool ovrimos_free_result(int result_id)
- Free resources associated with a result */
-PHP_FUNCTION(ovrimos_free_result)
-{
- pval *arg1;
- SQLS stmt;
- PSTATEMENT pstmt;
-
- if (getParameters(ht, 1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_long(arg1);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
- stmt = (SQLS) pstmt->statement;
-
- sqlCloseCursor( stmt);
- local_sqlFreeStmt( pstmt, stmt);
- RETURN_TRUE;
-}
-
-/* }}} */
-
-/* {{{ proto int ovrimos_num_rows(int result_id)
- Get number of rows in a result */
-PHP_FUNCTION(ovrimos_num_rows)
-{
- uint32 rows;
- pval *arg1;
- SQLS stmt;
- PSTATEMENT pstmt;
-
- if (getParameters(ht, 1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg1);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
- stmt = (SQLS) pstmt->statement;
-
-
- sqlGetRowCount(stmt, &rows);
- RETURN_LONG(rows);
-}
-
-/* }}} */
-
-/* {{{ proto int ovrimos_num_fields(int result_id)
- Get number of columns in a result */
-PHP_FUNCTION(ovrimos_num_fields)
-{
- pval *arg1;
- SQLS stmt;
- PSTATEMENT pstmt;
-
- if (getParameters(ht, 1, &arg1) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg1);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
-
- stmt = (SQLS) pstmt->statement;
-
- RETURN_LONG(sqlGetOutputColNb(stmt));
-}
-
-/* }}} */
-
-/* {{{ proto string ovrimos_field_name(int result_id, int field_number)
- Get a column name */
-PHP_FUNCTION(ovrimos_field_name)
-{
- pval *arg1, *arg2;
- SQLS stmt;
- int field;
- PSTATEMENT pstmt;
-
- if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg1);
- convert_to_long(arg2);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
-
- stmt = (SQLS) pstmt->statement;
-
-
- if (Z_LVAL_P(arg2) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1! in call to ovrimos_field_name()");
- RETURN_FALSE;
- }
-
- field = Z_LVAL_P(arg2) - 1;
-
- if (field >= sqlGetOutputColNb(stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No field at this index (%d) in call to ovrimos_field_name()", field);
- RETURN_FALSE;
- }
-
- RETURN_STRING((char *) sqlGetOutputColName(stmt, field), 1);
-}
-
-/* }}} */
-
-/* {{{ proto int ovrimos_field_type(int result_id, int field_number)
- Get the datatype of a column */
-PHP_FUNCTION(ovrimos_field_type)
-{
- pval *arg1, *arg2;
- SQLS stmt;
- int field;
- PSTATEMENT pstmt;
-
- if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg1);
- convert_to_long(arg2);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
-
- stmt = (SQLS) pstmt->statement;
-
- if (Z_LVAL_P(arg2) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1! in call to ovrimos_field_type()");
- RETURN_FALSE;
- }
-
- field = Z_LVAL_P(arg2) - 1;
-
- if (field >= sqlGetOutputColNb(stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No field at this index (%d) in call to ovrimos_field_type()", field);
- RETURN_FALSE;
- }
-
- RETURN_LONG(sqlGetOutputColType(stmt, field));
-}
-
-/* }}} */
-
-/* {{{ proto int ovrimos_field_len(int result_id, int field_number)
- Get the length of a column */
-PHP_FUNCTION(ovrimos_field_len)
-{
- pval *arg1, *arg2;
- SQLS stmt;
- int field;
- PSTATEMENT pstmt;
- int longreadlen;
-
- if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long(arg1);
- convert_to_long(arg2);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
-
- longreadlen = pstmt->longreadlen;
-
- stmt = (SQLS) pstmt->statement;
-
- if (Z_LVAL_P(arg2) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1! in call to ovrimos_field_len()");
- RETURN_FALSE;
- }
-
- field = Z_LVAL_P(arg2) - 1;
-
- if (field >= sqlGetOutputColNb(stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No field at this index (%d) in call to ovrimos_field_len()", field);
- RETURN_FALSE;
- }
-
- switch (sqlGetOutputColType(stmt, field)) {
- case T_LONGVARCHAR:
- case T_LONGVARBINARY:
- RETURN_LONG(longreadlen);
- default:
- RETURN_LONG(sqlGetOutputColLength(stmt, field));
- }
-}
-
-/* }}} */
-
-/* {{{ proto int ovrimos_field_num(int result_id, string field_name)
- Return column number */
-PHP_FUNCTION(ovrimos_field_num)
-{
- pval *arg1, *arg2;
- SQLS stmt;
- int i, n;
- PSTATEMENT pstmt;
-
- if (getParameters(ht, 2, &arg1, &arg2) == FAILURE
- || Z_TYPE_P(arg2) != IS_STRING) {
- WRONG_PARAM_COUNT;
- }
- convert_to_long(arg1);
- pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
- stmt = (SQLS) pstmt->statement;
-
- n = sqlGetOutputColNb(stmt);
- for (i = 0; i < n; i++) {
- if (!strcmp
- (Z_STRVAL_P(arg2), sqlGetOutputColName(stmt, i))) {
- RETURN_LONG(i + 1);
- }
- }
- RETURN_FALSE;
-}
-
-/* }}} */
-
-#if 0
-/* {{{ proto int ovrimos_autocommit(int connection_id, int OnOff)
- Toggle autocommit mode
- There can be problems with pconnections!*/
-PHP_FUNCTION(ovrimos_autocommit)
-{
-}
-
-/* }}} */
-#endif
-
-/* {{{ proto bool ovrimos_commit(int connection_id)
- Commit an ovrimos transaction */
-PHP_FUNCTION(ovrimos_commit)
-{
- pval *arg1;
- SQLS stmt;
- int i;
- PCON_STATE state;
-
- if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &arg1) == FAILURE
- || Z_TYPE_P(arg1) != IS_LONG) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long( arg1);
- state = (PCON_STATE) Z_LVAL_P(arg1);
-
- for (i=0;i<state->nstatements;i++) {
- stmt = state->statements[ i].statement;
- if (stmt==NULL) {
- continue;
- }
- if (!sqlCommit(stmt)) {
- RETURN_FALSE;
- }
- }
- RETURN_TRUE;
-}
-
-/* }}} */
-
-/* {{{ proto bool ovrimos_rollback(int connection_id)
- Rollback a transaction */
-PHP_FUNCTION(ovrimos_rollback)
-{
- pval *arg1;
- SQLS stmt;
- int i;
- PCON_STATE state;
-
- if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &arg1) == FAILURE
- || Z_TYPE_P(arg1) != IS_LONG) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long( arg1);
- state = (PCON_STATE) Z_LVAL_P(arg1);
-
- for (i=0;i<state->nstatements;i++) {
- stmt = (SQLS) state->statements[ i].statement;
- if (stmt==NULL) continue;
-
- if (!sqlRollback(stmt)) {
- RETURN_FALSE;
- }
- }
- RETURN_TRUE;
-}
-
-/* }}} */
-
-#if 0
-/* {{{ proto int ovrimos_setoption(int conn_id|result_id, int which, int option, int value)
- Sets connection or statement options */
-PHP_FUNCTION(ovrimos_setoption)
-{
-}
-
-/* }}} */
-#endif
-
-/* {{{ ovrimos_functions[]
- */
-function_entry ovrimos_functions[] = {
-/* PHP_FE(ovrimos_setoption, NULL)*/
-/* PHP_FE(ovrimos_autocommit, NULL)*/
- PHP_FE(ovrimos_close, NULL)
- PHP_FE(ovrimos_commit, NULL)
- PHP_FE(ovrimos_connect, NULL)
- PHP_FE(ovrimos_cursor, NULL)
- PHP_FE(ovrimos_exec, NULL)
- PHP_FE(ovrimos_prepare, NULL)
- PHP_FE(ovrimos_execute, NULL)
- PHP_FE(ovrimos_fetch_row, NULL)
- PHP_FE(ovrimos_fetch_into, second_arg_force_ref)
- PHP_FE(ovrimos_field_len, NULL)
- PHP_FE(ovrimos_field_name, NULL)
- PHP_FE(ovrimos_field_type, NULL)
- PHP_FE(ovrimos_field_num, NULL)
- PHP_FE(ovrimos_free_result, NULL)
- PHP_FE(ovrimos_num_fields, NULL)
- PHP_FE(ovrimos_num_rows, NULL)
- PHP_FE(ovrimos_result, NULL)
- PHP_FE(ovrimos_result_all, NULL)
- PHP_FE(ovrimos_rollback, NULL)
-/* PHP_FE(ovrimos_binmode, NULL)*/
- PHP_FE(ovrimos_longreadlen, NULL)
- PHP_FALIAS(ovrimos_do, ovrimos_exec, NULL) {NULL, NULL, NULL}
-};
-/* }}} */
-
-zend_module_entry ovrimos_module_entry = {
- STANDARD_MODULE_HEADER,
- "ovrimos",
- ovrimos_functions,
- NULL,
- NULL,
- NULL,
- NULL,
- PHP_MINFO(ovrimos),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
-};
-
-DLEXPORT zend_module_entry *get_module()
-{
- return &ovrimos_module_entry;
-};
-
-/*
- * 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/ovrimos/php_ovrimos.h b/ext/ovrimos/php_ovrimos.h
deleted file mode 100644
index b3e133604..000000000
--- a/ext/ovrimos/php_ovrimos.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef PHP_OVRIMOS_H
-#define PHP_OVRIMOS_H
-
-#if HAVE_LIBSQLCLI
-
-#if PHP_API_VERSION < 19990421
-#define zend_module_entry zend_module_entry
-#include "zend_modules.h"
-#include "internal_functions.h"
-#endif
-
-extern zend_module_entry ovrimos_module_entry;
-#define ovrimos_module_ptr &ovrimos_module_entry
-
-PHP_FUNCTION(ovrimos_connect);
-PHP_FUNCTION(ovrimos_close);
-PHP_FUNCTION(ovrimos_longreadlen);
-PHP_FUNCTION(ovrimos_prepare);
-PHP_FUNCTION(ovrimos_execute);
-PHP_FUNCTION(ovrimos_cursor);
-PHP_FUNCTION(ovrimos_exec);
-PHP_FUNCTION(ovrimos_fetch_into);
-PHP_FUNCTION(ovrimos_fetch_row);
-PHP_FUNCTION(ovrimos_result);
-PHP_FUNCTION(ovrimos_result_all);
-PHP_FUNCTION(ovrimos_free_result);
-PHP_FUNCTION(ovrimos_num_rows);
-PHP_FUNCTION(ovrimos_num_fields);
-PHP_FUNCTION(ovrimos_field_name);
-PHP_FUNCTION(ovrimos_field_type);
-PHP_FUNCTION(ovrimos_field_len);
-PHP_FUNCTION(ovrimos_field_num);
-/*PHP_FUNCTION(ovrimos_autocommit);*/
-PHP_FUNCTION(ovrimos_commit);
-PHP_FUNCTION(ovrimos_rollback);
-/*PHP_FUNCTION(ovrimos_setoption);*/
-
-#else
-#define ovrimos_module_ptr NULL
-#endif
-
-#define phpext_ovrimos_ptr ovrimos_module_ptr
-
-#endif
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 25b0b86a8..c111d1e6b 100755
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: pcntl.c,v 1.44.2.3 2005/05/07 14:58:02 wez Exp $ */
+/* $Id: pcntl.c,v 1.48 2005/08/03 14:07:37 sniper Exp $ */
#define PCNTL_DEBUG 0
diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h
index d47dfd8df..656e973f7 100644
--- a/ext/pcntl/php_pcntl.h
+++ b/ext/pcntl/php_pcntl.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_pcntl.h,v 1.17.2.2 2005/05/07 14:58:02 wez Exp $ */
+/* $Id: php_pcntl.h,v 1.20 2005/08/03 14:07:37 sniper Exp $ */
#ifndef PHP_PCNTL_H
#define PHP_PCNTL_H
diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c
index 9019995b0..d088f67d0 100644
--- a/ext/pcntl/php_signal.c
+++ b/ext/pcntl/php_signal.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_signal.c,v 1.8 2004/01/08 08:16:44 andi Exp $ */
+/* $Id: php_signal.c,v 1.9 2005/08/03 14:07:37 sniper Exp $ */
#include "php_signal.h"
diff --git a/ext/pcntl/php_signal.h b/ext/pcntl/php_signal.h
index c16f01017..54f6d1abb 100644
--- a/ext/pcntl/php_signal.h
+++ b/ext/pcntl/php_signal.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_signal.h,v 1.8 2004/01/08 17:32:37 sniper Exp $ */
+/* $Id: php_signal.h,v 1.9 2005/08/03 14:07:37 sniper Exp $ */
#include <signal.h>
#ifndef PHP_SIGNAL_H
diff --git a/ext/pcre/config.w32 b/ext/pcre/config.w32
index 69badd0c0..2da2a3f31 100644
--- a/ext/pcre/config.w32
+++ b/ext/pcre/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.3.2.2 2005/08/25 18:36:45 edink Exp $
+// $Id: config.w32,v 1.4.2.1 2005/08/09 06:25:24 sebastian Exp $
// vim:ft=javascript
ARG_WITH("pcre-regex", "Perl Compatible Regular Expressions", "yes");
diff --git a/ext/pcre/config.m4 b/ext/pcre/config0.m4
index 7a4a8ff3b..c03cd4e7d 100644
--- a/ext/pcre/config.m4
+++ b/ext/pcre/config0.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.32.2.2 2005/08/22 16:55:56 andrei Exp $
+dnl $Id: config0.m4,v 1.36.2.1 2005/11/16 22:14:32 sniper Exp $
dnl
dnl By default we'll compile and link against the bundled PCRE library
@@ -15,6 +15,7 @@ if test "$PHP_PCRE_REGEX" != "no"; then
if test "$PHP_PCRE_REGEX" = "yes"; then
PHP_NEW_EXTENSION(pcre, pcrelib/pcre_chartables.c pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_dfa_exec.c pcrelib/pcre_exec.c pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c pcrelib/pcre_info.c pcrelib/pcre_maketables.c pcrelib/pcre_ord2utf8.c pcrelib/pcre_printint.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_ucp_findchar.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c, $ext_shared,,-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -I@ext_srcdir@/pcrelib)
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
+ PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
else
for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do
@@ -25,7 +26,7 @@ if test "$PHP_PCRE_REGEX" != "no"; then
AC_MSG_ERROR([Could not find pcre.h in $PHP_PCRE_REGEX])
fi
- for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/lib; do
+ for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do
test -f $j/libpcre.a -o -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
done
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 16226a3cb..d5b1feaf1 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_pcre.c,v 1.157.2.5 2005/05/31 12:55:33 sniper Exp $ */
+/* $Id: php_pcre.c,v 1.168.2.3 2005/10/28 08:30:41 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -100,7 +100,9 @@ static PHP_MINIT_FUNCTION(pcre)
/* {{{ PHP_MSHUTDOWN_FUNCTION(pcre) */
static PHP_MSHUTDOWN_FUNCTION(pcre)
{
-#ifndef ZTS
+#ifdef ZTS
+ ts_free_id(pcre_globals_id);
+#else
php_pcre_shutdown_globals(&pcre_globals TSRMLS_CC);
#endif
@@ -545,7 +547,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
*/
if (count < num_subpats) {
for (; i < num_subpats; i++) {
- add_next_index_string(match_sets[i], empty_string, 1);
+ add_next_index_string(match_sets[i], "", 1);
}
}
} else {
@@ -620,6 +622,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
if (subpat_names[i]) {
zend_hash_update(Z_ARRVAL_P(subpats), subpat_names[i],
strlen(subpat_names[i])+1, &match_sets[i], sizeof(zval *), NULL);
+ ZVAL_ADDREF(match_sets[i]);
}
zend_hash_next_index_insert(Z_ARRVAL_P(subpats), &match_sets[i], sizeof(zval *), NULL);
}
@@ -768,7 +771,7 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject,
esc_match_len = 0;
}
} else {
- esc_match = empty_string;
+ esc_match = "";
esc_match_len = 0;
match_len = 0;
}
@@ -792,7 +795,7 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject,
/* Run the code */
if (zend_eval_string(code.c, &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
efree(compiled_string_description);
- php_error_docref(NULL TSRMLS_CC,E_ERROR, "Failed evaluating code:\n%s", code.c);
+ php_error_docref(NULL TSRMLS_CC,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, code.c);
/* zend_error() does not return in this case */
}
efree(compiled_string_description);
@@ -815,7 +818,7 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject,
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 TSRMLS_DC)
+ int *result_len, int limit, int *replace_count TSRMLS_DC)
{
pcre *re = NULL; /* Compiled regular expression */
pcre_extra *extra = NULL; /* Holds results of studying */
@@ -895,9 +898,12 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
piece = subject + start_offset;
if (count > 0 && (limit == -1 || limit > 0)) {
+ if (replace_count) {
+ ++*replace_count;
+ }
/* Set the match location in subject */
match = subject + offsets[0];
-
+
new_len = *result_len + offsets[0] - start_offset; /* part before the match */
/* If evaluating, do it and add the return string's length */
@@ -1027,7 +1033,7 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
/* {{{ php_replace_in_subject
*/
-static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject, int *result_len, int limit, zend_bool is_callable_replace TSRMLS_DC)
+static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject, int *result_len, int limit, zend_bool is_callable_replace, int *replace_count TSRMLS_DC)
{
zval **regex_entry,
**replace_entry = NULL,
@@ -1039,7 +1045,8 @@ static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject,
/* Make sure we're dealing with strings. */
convert_to_string_ex(subject);
- ZVAL_STRINGL(&empty_replace, empty_string, 0, 0);
+ /* FIXME: This might need to be changed to STR_EMPTY_ALLOC(). Check if this zval could be dtor()'ed somehow */
+ ZVAL_STRINGL(&empty_replace, "", 0, 0);
/* If regex is an array */
if (Z_TYPE_P(regex) == IS_ARRAY) {
@@ -1083,7 +1090,8 @@ static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject,
replace_value,
is_callable_replace,
result_len,
- limit TSRMLS_CC)) != NULL) {
+ limit,
+ replace_count TSRMLS_CC)) != NULL) {
efree(subject_value);
subject_value = result;
subject_len = *result_len;
@@ -1101,7 +1109,8 @@ static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject,
replace,
is_callable_replace,
result_len,
- limit TSRMLS_CC);
+ limit,
+ replace_count TSRMLS_CC);
return result;
}
}
@@ -1115,17 +1124,20 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
**replace,
**subject,
**limit,
- **subject_entry;
+ **subject_entry,
+ **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;
/* Get function parameters and do error-checking. */
- if (ZEND_NUM_ARGS() < 3 || ZEND_NUM_ARGS() > 4 ||
- zend_get_parameters_ex(ZEND_NUM_ARGS(), &regex, &replace, &subject, &limit) == FAILURE) {
+ if (ZEND_NUM_ARGS() < 3 || ZEND_NUM_ARGS() > 5 ||
+ zend_get_parameters_ex(ZEND_NUM_ARGS(), &regex, &replace, &subject, &limit, &zcount) == FAILURE) {
WRONG_PARAM_COUNT;
}
if (!is_callable_replace && Z_TYPE_PP(replace) == IS_ARRAY && Z_TYPE_PP(regex) != IS_ARRAY) {
@@ -1154,6 +1166,9 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
convert_to_long_ex(limit);
limit_val = Z_LVAL_PP(limit);
}
+ if (ZEND_NUM_ARGS() > 4) {
+ replace_count_ptr =& replace_count;
+ }
if (Z_TYPE_PP(regex) != IS_ARRAY)
convert_to_string_ex(regex);
@@ -1167,7 +1182,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
and add the result to the return_value array. */
while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) {
SEPARATE_ZVAL(subject_entry);
- if ((result = php_replace_in_subject(*regex, *replace, subject_entry, &result_len, limit_val, is_callable_replace TSRMLS_CC)) != NULL) {
+ if ((result = php_replace_in_subject(*regex, *replace, subject_entry, &result_len, limit_val, is_callable_replace, replace_count_ptr TSRMLS_CC)) != NULL) {
/* Add to return array */
switch(zend_hash_get_current_key(Z_ARRVAL_PP(subject), &string_key, &num_key, 0))
{
@@ -1183,16 +1198,20 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
zend_hash_move_forward(Z_ARRVAL_PP(subject));
}
- }
- else { /* if subject is not an array */
- if ((result = php_replace_in_subject(*regex, *replace, subject, &result_len, limit_val, is_callable_replace TSRMLS_CC)) != NULL) {
+ } else { /* if subject is not an array */
+ if ((result = php_replace_in_subject(*regex, *replace, subject, &result_len, limit_val, is_callable_replace, replace_count_ptr TSRMLS_CC)) != NULL) {
RETVAL_STRINGL(result, result_len, 0);
}
- }
+ }
+ if (replace_count_ptr) {
+ zval_dtor(*zcount);
+ ZVAL_LONG(*zcount, replace_count);
+ }
+
}
/* }}} */
-/* {{{ proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit])
+/* {{{ proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
Perform Perl-style regular expression replacement. */
PHP_FUNCTION(preg_replace)
{
@@ -1200,7 +1219,7 @@ PHP_FUNCTION(preg_replace)
}
/* }}} */
-/* {{{ proto string preg_replace_callback(mixed regex, mixed callback, mixed subject [, int limit])
+/* {{{ proto string preg_replace_callback(mixed regex, mixed callback, mixed subject [, int limit [, count]])
Perform Perl-style regular expression replacement using replacement callback. */
PHP_FUNCTION(preg_replace_callback)
{
@@ -1423,7 +1442,7 @@ PHP_FUNCTION(preg_quote)
/* Nothing to do if we got an empty string */
if (in_str == in_str_end) {
- RETVAL_STRINGL(empty_string, 0, 0);
+ RETURN_EMPTY_STRING();
}
if (ZEND_NUM_ARGS() == 2) {
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index 028017d5b..13bbe5196 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_pcre.h,v 1.39 2004/02/01 03:02:47 moriyoshi Exp $ */
+/* $Id: php_pcre.h,v 1.41 2005/08/03 14:07:38 sniper 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 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);
diff --git a/ext/pcre/tests/bug34790.phpt b/ext/pcre/tests/bug34790.phpt
new file mode 100755
index 000000000..5baec5793
--- /dev/null
+++ b/ext/pcre/tests/bug34790.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #34790 (preg_match_all(), named capturing groups, variable assignment/return => crash)
+--FILE--
+<?php
+function func1(){
+ $string = 'what the word and the other word the';
+ preg_match_all('/(?P<word>the)/', $string, $matches);
+ return $matches['word'];
+}
+$words = func1();
+var_dump($words);
+?>
+--EXPECT--
+array(4) {
+ [0]=>
+ string(3) "the"
+ [1]=>
+ string(3) "the"
+ [2]=>
+ string(3) "the"
+ [3]=>
+ string(3) "the"
+}
diff --git a/ext/pcre/tests/pcre_count.phpt b/ext/pcre/tests/pcre_count.phpt
new file mode 100644
index 000000000..1239d48ff
--- /dev/null
+++ b/ext/pcre/tests/pcre_count.phpt
@@ -0,0 +1,40 @@
+--TEST--
+preg_replace() fifth parameter - count
+--FILE--
+<?php
+$regex = '/(([0-9a-z]+)-([0-9]+))-(([0-9]+)-([0-9]+))/';
+
+$string= '1-2-3-4 a-2-3-4 1-a-3-4 1-2-a-4 1-2-3-a a-a-a-a 4-3-2-1 100-200-300-400-500-600-700-800';
+$count = 0;
+var_dump(preg_replace($regex, 'xxxx', $string, -1, $count));
+var_dump($count);
+//////////////////////////////////////////////////////
+
+$regex = '/([a-z]+)/';
+
+$string= 'Here must only number like 42 and 13 appear';
+var_dump(preg_replace($regex, 'xxxx', $string, -1, $count));
+var_dump($count);
+
+////////////////////////////////////////////////////////
+$regex = '~((V(I|1)(4|A)GR(4|A))|(V(I|1)C(0|O)D(I|1)(N|\/\\\/)))~i';
+
+$string= 'Viagra V14GR4 Vicodin V1C0D1/\/ v1c0d1/|/';
+var_dump(preg_replace($regex, '...', $string, -1, $count));
+var_dump($count);
+////////////////////////////////////////////////////////
+$regex = '~((V(I|1)(4|A)GR(4|A))|(V(I|1)C(0|O)D(I|1)(N|\/\\\/)))~i';
+$count = NULL;
+$string= 'Viagra V14GR4 Vicodin V1C0D1/\/ v1c0d1/|/';
+var_dump(preg_replace($regex, '...', $string, -1));
+var_dump($count);
+?>
+--EXPECT--
+string(56) "xxxx xxxx 1-a-3-4 1-2-a-4 1-2-3-a a-a-a-a xxxx xxxx-xxxx"
+int(5)
+string(41) "Hxxxx xxxx xxxx xxxx xxxx 42 xxxx 13 xxxx"
+int(7)
+string(25) "... ... ... ... v1c0d1/|/"
+int(4)
+string(25) "... ... ... ... v1c0d1/|/"
+NULL
diff --git a/ext/pdo/CREDITS b/ext/pdo/CREDITS
new file mode 100755
index 000000000..e65021935
--- /dev/null
+++ b/ext/pdo/CREDITS
@@ -0,0 +1,2 @@
+PHP Data Objects
+Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle
diff --git a/ext/dio/EXPERIMENTAL b/ext/pdo/EXPERIMENTAL
index e69de29bb..e69de29bb 100644
--- a/ext/dio/EXPERIMENTAL
+++ b/ext/pdo/EXPERIMENTAL
diff --git a/ext/pdo/Makefile.frag b/ext/pdo/Makefile.frag
new file mode 100644
index 000000000..283a6e243
--- /dev/null
+++ b/ext/pdo/Makefile.frag
@@ -0,0 +1,26 @@
+phpincludedir=$(prefix)/include/php
+
+PDO_HEADER_FILES= \
+ php_pdo.h \
+ php_pdo_driver.h
+
+install-pdo-headers:
+ @echo "Installing PDO headers: $(INSTALL_ROOT)$(phpincludedir)/ext/pdo/"
+ @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/pdo
+ @for f in $(PDO_HEADER_FILES); do \
+ if test -f "$(top_srcdir)/$$f"; then \
+ $(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
+ elif test -f "$(top_builddir)/$$f"; then \
+ $(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
+ elif test -f "$(top_srcdir)/ext/pdo/$$f"; then \
+ $(INSTALL_DATA) $(top_srcdir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
+ elif test -f "$(top_builddir)/ext/pdo/$$f"; then \
+ $(INSTALL_DATA) $(top_builddir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
+ else \
+ echo "hmmm"; \
+ fi \
+ done;
+
+# mini hack
+install: $(all_targets) $(install_targets) install-pdo-headers
+
diff --git a/ext/pdo/README b/ext/pdo/README
new file mode 100755
index 000000000..9431b6147
--- /dev/null
+++ b/ext/pdo/README
@@ -0,0 +1,56 @@
+$Id: README,v 1.3 2005/02/09 23:34:53 wez Exp $
+
+PHP Data Objects
+================
+
+Concept: Data Access Abstraction
+
+Goals:
+
+1/ Be light-weight
+2/ Provide common API for common database operations
+3/ Be performant
+4/ Keep majority of PHP specific stuff in the PDO core (such as persistent
+ resource management); drivers should only have to worry about getting the
+ data and not about PHP internals.
+
+
+Transactions and autocommit
+===========================
+
+When you create a database handle, you *should* specify the autocommit
+behaviour that you require. PDO will default to autocommit on.
+
+$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => true));
+
+When auto-commit is on, the driver will implicitly commit each query as it is
+executed. This works fine for most simple tasks but can be significantly
+slower when you are making a large number of udpates.
+
+$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => false));
+
+When auto-commit is off, you must then use $dbh->beginTransaction() to
+initiate a transaction. When your work is done, you then call $dbh->commit()
+or $dbh->rollBack() to persist or abort your changes respectively. Not all
+databases support transactions.
+
+You can change the auto-commit mode at run-time:
+
+$dbh->setAttribute(PDO_ATTR_AUTOCOMMIT, false);
+
+Regardless of the error handling mode set on the database handle, if the
+autocommit mode cannot be changed, an exception will be thrown.
+
+Some drivers will allow you to temporarily disable autocommit if you call
+$dbh->beginTransaction(). When you commit() or rollBack() such a transaction,
+the handle will switch back to autocommit mode again. If the mode could not
+be changed, an exception will be raised, as noted above.
+
+When the database handle is closed or destroyed (or at request end for
+persistent handles), the driver will implicitly rollBack(). It is your
+responsibility to call commit() when you are done making changes and
+autocommit is turned off.
+
+vim:tw=78:et
+
+
diff --git a/ext/pdo/TODO b/ext/pdo/TODO
new file mode 100755
index 000000000..32614c498
--- /dev/null
+++ b/ext/pdo/TODO
@@ -0,0 +1,97 @@
+$Id: TODO,v 1.6.2.2 2005/11/26 21:29:31 wez Exp $
+
+Roadmap for PDO
+
+Core, version 1.1:
+==================
+
+ - Add PDO::queryParams(), similar to PDO::query(), but accepts
+ an array of parameters as the second argument, pushing the remaining
+ args (which are args to setFetchMode()) up by one.
+
+ - Separate the handle factory call into two phases:
+ - handle creation
+ - connecting
+
+ This would then allow PDO to call setAttribute()
+ for each driver option specified in the constructor.
+ Right now, the handling of driver attributes is a bit sloppy.
+
+ - Add:
+ pdo.max_persistent
+ pdo.persistent_timeout
+ pdo.ping_interval
+
+ with the same meanings as those options from oci8.
+
+ - BLOB/CLOB.
+ Investigate the various APIs to determine if we can
+ transparently map BLOBs and CLOBs as PDO_PARAM_LOB.
+ If the API needs hints from the client side, we need
+ to introduce a PDO_PARAM_CLOB to differentiate between
+ binary and character data.
+
+ - Character set selection.
+ Generalize/standardize this.
+
+ - meta data.
+ Formalize getColumnMeta().
+ Look at retrieving lists of tables and other objects in the db.
+
+ - tracing/logging/debugging
+ Add ini options:
+
+ pdo.trace_file
+ pdo.enable_tracing
+
+ And corresponding attributes, ATTR_TRACE_FILE, ATTR_TRACING_ENABLE,
+ settable at dbh and stmt levels independently. If set at the dbh level,
+ the stmt will inherit its value. If not set explicitly in code, the
+ defaults for the dbh will come from the INI settings.
+
+ ATTR_TRACE_FILE will accept a string or a stream.
+
+ The INI options are useful for administrative tracing/debugging.
+ Trace mode will output very verbose info.
+
+
+General DB API Roundup:
+=========
+ Consider how the following can be implemented in PDO:
+
+ mysqli_change_user(); alters auth credentials on a live connection
+ mysqli_info(); info about rows affected by last query
+ mysqli_master_query(); force query to run on master
+ mysqli_ping(); ping / reconnect
+ mysqli_stat(); one line summary of server status
+
+ oci_password_change()
+
+ Also consider master/slave and/or failover server configuration.
+
+
+Postgres:
+=========
+
+ - Real large object support.
+ - Someone with more pgsql experience can suggest more features
+
+Oracle:
+=======
+
+ - Support for array types and collections.
+
+Userspace PDO Driver:
+=====================
+
+ - Will be hard.
+
+PDO Session module:
+===================
+
+ - Is it worth writing in C?
+ Probably not.
+
+
+vim:se et ts=2 sw=2 tw=78:
+
diff --git a/ext/pdo/config.m4 b/ext/pdo/config.m4
new file mode 100755
index 000000000..e275fecf6
--- /dev/null
+++ b/ext/pdo/config.m4
@@ -0,0 +1,68 @@
+dnl $Id: config.m4,v 1.15.2.3 2005/11/24 21:38:09 wez Exp $
+dnl config.m4 for extension pdo
+dnl vim:se ts=2 sw=2 et:
+
+AC_DEFUN([PHP_PDO_PEAR_CHECK],[
+ pdo_running_under_pear=0
+ case `pwd` in
+ /var/tmp/pear-build-*)
+ pdo_running_under_pear=1
+ ;;
+ esac
+
+ if test "$pdo_running_under_pear$PHP_PEAR_VERSION" = "1"; then
+ # we're running in an environment that smells like pear,
+ # and the PHP_PEAR_VERSION env var is not set. That implies
+ # that we're running under a slightly broken pear installer
+ AC_MSG_ERROR([
+PDO requires that you upgrade your PEAR installer tools. Please
+do so now by running:
+
+ % sudo pear upgrade pear
+
+or by manually downloading and installing PEAR version 1.3.5 or higher.
+
+Once you've upgraded, please re-try your PDO install.
+ ])
+ fi
+])
+
+PHP_ARG_ENABLE(pdo, whether to enable PDO support,
+[ --disable-pdo Disable PHP Data Objects support], yes)
+
+if test "$PHP_PDO" != "no"; then
+
+ PHP_PDO_PEAR_CHECK
+
+ if test "$ext_shared" = "yes" ; then
+ case $host_alias in
+ *darwin*)
+ if test "$pdo_running_under_pear" = "1"; then
+ AC_MSG_ERROR([
+Due to the way that loadable modules work on OSX/Darwin, you need to
+compile the PDO package statically into the PHP core.
+
+Please follow the instructions at: http://netevil.org/node.php?nid=202
+for more detail on this issue.
+ ])
+ fi
+ ext_shared=no
+ ;;
+ esac
+ fi
+ PHP_NEW_EXTENSION(pdo, pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c, $ext_shared)
+ ifdef([PHP_ADD_EXTENSION_DEP],
+ [
+ PHP_ADD_EXTENSION_DEP(pdo, spl, true)
+ ])
+
+ ifdef([PHP_INSTALL_HEADERS],
+ [
+ dnl Sadly, this is a complete NOP for pecl extensions
+ PHP_INSTALL_HEADERS(ext/pdo, [php_pdo.h php_pdo_driver.h])
+ ])
+
+ dnl so we always include the known-good working hack.
+ PHP_ADD_MAKEFILE_FRAGMENT
+fi
+
diff --git a/ext/pdo/config.w32 b/ext/pdo/config.w32
new file mode 100755
index 000000000..c9ece3020
--- /dev/null
+++ b/ext/pdo/config.w32
@@ -0,0 +1,10 @@
+// $Id: config.w32,v 1.5.2.2 2005/10/04 07:47:11 helly Exp $
+// vim:ft=javascript
+
+ARG_ENABLE("pdo", "Enable PHP Data Objects support", "no");
+
+if (PHP_PDO != "no") {
+ EXTENSION('pdo', 'pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c');
+ ADD_EXTENSION_DEP('pdo', 'spl', true);
+}
+
diff --git a/ext/pdo/package.xml b/ext/pdo/package.xml
new file mode 100755
index 000000000..2abd3ca55
--- /dev/null
+++ b/ext/pdo/package.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE package SYSTEM "../pear/package.dtd">
+<package version="1.0">
+ <name>PDO</name>
+ <summary>PHP Data Objects Interface</summary>
+ <maintainers>
+ <maintainer>
+ <user>wez</user>
+ <name>Wez Furlong</name>
+ <email>wez@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>helly</user>
+ <name>Marcus Boerger</name>
+ <email>helly@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>iliaa</user>
+ <name>Ilia Alshanetsky</name>
+ <email>iliaa@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>gschlossnagle</user>
+ <name>George Schlossnagle</name>
+ <email>george@omniti.com</email>
+ <role>lead</role>
+ </maintainer>
+ </maintainers>
+
+ <description>
+ PDO provides a uniform data access interface, sporting advanced features such
+ as prepared statements and bound parameters. PDO drivers are dynamically
+ loadable and may be developed independently from the core, but still accessed
+ using the same API.
+
+ Read the documentation at http://www.php.net/pdo for more information.
+ </description>
+ <license>PHP</license>
+ <release>
+ <state>stable</state>
+ <version>1.0.1</version>
+ <date>2005-11-26</date>
+
+ <notes>
+** NOTE WELL! **
+All the PDO_XXX constants have been renamed to PDO::XXX form for future
+compatibility with PHP namespaces. Sorry for the inconvenience, especially
+after Release Candidate 1.
+
+You need to install a PDO database driver to make use of PDO,
+check http://pecl.php.net/package-search.php?pkg_name=PDO
+for a list of available PDO drivers.
+
+It is highly recommended that you update to PHP 5.1 before using PDO.
+
+If you are running on Windows, you can find a precompiled binary at:
+http://pecl4win.php.net/ext.php/php_pdo.dll
+
+You can find additional PDO drivers at:
+http://pecl4win.php.net
+
+** Changes **
+- Changed PDO_XXX constants to PDO::XXX
+- It is now possible to extend PDO and PDOStatement and override their constructors
+
+- Fixed Bug #35303; PDO::prepare() can cause crashes with invalid parameters
+- Fixed Bug #35135; "new PDOStatement" can cause crashes.
+- Fixed Bug #35293 and PECL Bug #5589; segfault when creating persistent connections
+- Fixed PECL Bug #5010, problem installing headers
+- renamed pdo_drivers() to PDO::getAvailableDrivers()
+- Various fixes when building with SPL
+- PDO::setAttribute(PDO::ATTR_STATEMENT_CLASS) allows you to set your own
+ PDOStatement replacement when extending PDO and PDOStatement
+- Fixed Bug #34687; error information from PDO::query() was not always returned
+- Fixed PECL Bug #5750; uri: DSN was not handled correctly
+- Fixed PECL Bug #5589; segfault when persistent connection attempt fails
+- Fixed Bug #34590; User defined PDOStatement class methods are not callable
+- Fixed Bug #34908; FETCH_INTO segfaults without destination object
+- Fixed PECL Bug #5809; PDOStatement::execute(array(...)) modifies args
+- Fixed PECL Bug #5772; FETCH_FUNC cannot call functions with mixed case names
+
+** Note **
+
+You should uninstall and re-install your individual database drivers whenever
+you upgrade the base PDO package, otherwise you will see an error about PDO API
+numbers when you run your PHP scripts.
+
+ </notes>
+
+ <filelist>
+ <file role="src" name="config.m4"/>
+ <file role="src" name="config.w32"/>
+ <file role="src" name="pdo.c"/>
+ <file role="src" name="pdo_dbh.c"/>
+ <file role="src" name="pdo_stmt.c"/>
+ <file role="src" name="php_pdo.h"/>
+ <file role="src" name="php_pdo_driver.h"/>
+ <file role="src" name="php_pdo_int.h"/>
+ <file role="src" name="pdo_sql_parser.re"/>
+ <file role="src" name="pdo_sql_parser.c"/>
+ <file role="src" name="pdo_sqlstate.c"/>
+ <file role="src" name="Makefile.frag"/>
+
+ <file role="doc" name="README"/>
+ <file role="doc" name="TODO"/>
+ <file role="doc" name="pdo.php"/>
+ <file role="doc" name="CREDITS"/>
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="5.0.3"/>
+ </deps>
+ </release>
+</package>
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
new file mode 100755
index 000000000..b786ad982
--- /dev/null
+++ b/ext/pdo/pdo.c
@@ -0,0 +1,399 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ | Marcus Boerger <helly@php.net> |
+ | Sterling Hughes <sterling@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo.c,v 1.57.2.13 2005/11/26 21:22:49 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <ctype.h>
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_pdo.h"
+#include "php_pdo_driver.h"
+#include "php_pdo_int.h"
+#include "zend_exceptions.h"
+
+static zend_class_entry *spl_ce_RuntimeException;
+
+ZEND_DECLARE_MODULE_GLOBALS(pdo)
+
+/* True global resources - no need for thread safety here */
+
+/* the registry of PDO drivers */
+HashTable pdo_driver_hash;
+
+/* we use persistent resources for the driver connection stuff */
+static int le_ppdo;
+
+int php_pdo_list_entry(void)
+{
+ return le_ppdo;
+}
+
+/* for exceptional circumstances */
+zend_class_entry *pdo_exception_ce;
+
+PDO_API zend_class_entry *php_pdo_get_exception(void)
+{
+ return pdo_exception_ce;
+}
+
+PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC)
+{
+#if can_handle_soft_dependency_on_SPL && defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1))
+ if (!root) {
+ if (!spl_ce_RuntimeException) {
+ zend_class_entry **pce;
+
+ if (zend_hash_find(CG(class_table), "runtimeexception", sizeof("RuntimeException"), (void **) &pce) == SUCCESS) {
+ spl_ce_RuntimeException = *pce;
+ return *pce;
+ }
+ } else {
+ return spl_ce_RuntimeException;
+ }
+ }
+#endif
+#if (PHP_MAJOR_VERSION < 6)
+ return zend_exception_get_default();
+#else
+ return zend_exception_get_default(TSRMLS_C);
+#endif
+}
+
+zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce;
+
+/* proto array pdo_drivers()
+ Return array of available PDO drivers */
+PHP_FUNCTION(pdo_drivers)
+{
+ HashPosition pos;
+ pdo_driver_t **pdriver;
+
+ array_init(return_value);
+
+ zend_hash_internal_pointer_reset_ex(&pdo_driver_hash, &pos);
+ while (SUCCESS == zend_hash_get_current_data_ex(&pdo_driver_hash, (void**)&pdriver, &pos)) {
+ add_next_index_stringl(return_value, (char*)(*pdriver)->driver_name, (*pdriver)->driver_name_len, 1);
+ zend_hash_move_forward_ex(&pdo_driver_hash, &pos);
+ }
+}
+/* }}} */
+
+/* {{{ pdo_functions[] */
+function_entry pdo_functions[] = {
+ PHP_FE(pdo_drivers, NULL)
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ pdo_functions[] */
+#if ZEND_MODULE_API_NO >= 20050922
+static zend_module_dep pdo_deps[] = {
+#ifdef HAVE_SPL
+ ZEND_MOD_REQUIRED("spl")
+#endif
+ {NULL, NULL, NULL}
+};
+#endif
+/* }}} */
+
+/* {{{ pdo_module_entry */
+zend_module_entry pdo_module_entry = {
+#if ZEND_MODULE_API_NO >= 20050922
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_deps,
+#else
+ STANDARD_MODULE_HEADER,
+#endif
+ "PDO",
+ pdo_functions,
+ PHP_MINIT(pdo),
+ PHP_MSHUTDOWN(pdo),
+ PHP_RINIT(pdo),
+ PHP_RSHUTDOWN(pdo),
+ PHP_MINFO(pdo),
+ "1.0.1",
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_PDO
+ZEND_GET_MODULE(pdo)
+#endif
+
+/* {{{ PHP_INI */
+PHP_INI_BEGIN()
+ STD_PHP_INI_ENTRY("pdo.global_value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_pdo_globals, pdo_globals)
+PHP_INI_END()
+/* }}} */
+
+/* {{{ php_pdo_init_globals */
+static void php_pdo_init_globals(zend_pdo_globals *pdo_globals)
+{
+ pdo_globals->global_value = 0;
+}
+/* }}} */
+
+PDO_API int php_pdo_register_driver(pdo_driver_t *driver)
+{
+ if (driver->api_version != PDO_DRIVER_API) {
+ zend_error(E_ERROR, "PDO: driver %s requires PDO API version %ld; this is PDO version %d",
+ driver->driver_name, driver->api_version, PDO_DRIVER_API);
+ return FAILURE;
+ }
+ if (!zend_hash_exists(&module_registry, "pdo", sizeof("pdo"))) {
+ zend_error(E_ERROR, "You MUST load PDO before loading any PDO drivers");
+ return FAILURE; /* NOTREACHED */
+ }
+
+ return zend_hash_add(&pdo_driver_hash, (char*)driver->driver_name, driver->driver_name_len,
+ (void**)&driver, sizeof(driver), NULL);
+}
+
+PDO_API void php_pdo_unregister_driver(pdo_driver_t *driver)
+{
+ if (!zend_hash_exists(&module_registry, "pdo", sizeof("pdo"))) {
+ return;
+ }
+
+ zend_hash_del(&pdo_driver_hash, (char*)driver->driver_name, driver->driver_name_len);
+}
+
+pdo_driver_t *pdo_find_driver(const char *name, int namelen)
+{
+ pdo_driver_t **driver = NULL;
+
+ zend_hash_find(&pdo_driver_hash, (char*)name, namelen, (void**)&driver);
+
+ return driver ? *driver : NULL;
+}
+
+PDO_API int php_pdo_parse_data_source(const char *data_source,
+ unsigned long data_source_len, struct pdo_data_src_parser *parsed,
+ int nparams)
+{
+ int i, j;
+ int valstart = -1;
+ int semi = -1;
+ int optstart = 0;
+ int nlen;
+ int n_matches = 0;
+
+ i = 0;
+ while (i < data_source_len) {
+ /* looking for NAME= */
+
+ if (data_source[i] == '\0') {
+ break;
+ }
+
+ if (data_source[i] != '=') {
+ ++i;
+ continue;
+ }
+
+ valstart = ++i;
+
+ /* now we're looking for VALUE; or just VALUE<NUL> */
+ semi = -1;
+ while (i < data_source_len) {
+ if (data_source[i] == '\0') {
+ semi = i++;
+ break;
+ }
+ if (data_source[i] == ';') {
+ semi = i++;
+ break;
+ }
+ ++i;
+ }
+
+ if (semi == -1) {
+ semi = i;
+ }
+
+ /* find the entry in the array */
+ nlen = valstart - optstart - 1;
+ for (j = 0; j < nparams; j++) {
+ if (0 == strncmp(data_source + optstart, parsed[j].optname, nlen) && parsed[j].optname[nlen] == '\0') {
+ /* got a match */
+ if (parsed[j].freeme) {
+ efree(parsed[j].optval);
+ }
+ parsed[j].optval = estrndup(data_source + valstart, semi - valstart);
+ parsed[j].freeme = 1;
+ ++n_matches;
+ break;
+ }
+ }
+
+ while (i < data_source_len && isspace(data_source[i])) {
+ i++;
+ }
+
+ optstart = i;
+ }
+
+ return n_matches;
+}
+
+static const char digit_vec[] = "0123456789";
+PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC)
+{
+ char buffer[65];
+ char outbuf[65] = "";
+ register char *p;
+ long long_val;
+ char *dst = outbuf;
+
+ if (i64 < 0) {
+ i64 = -i64;
+ *dst++ = '-';
+ }
+
+ if (i64 == 0) {
+ *dst++ = '0';
+ *dst++ = '\0';
+ return estrdup(outbuf);
+ }
+
+ p = &buffer[sizeof(buffer)-1];
+ *p = '\0';
+
+ while ((pdo_uint64_t)i64 > (pdo_uint64_t)LONG_MAX) {
+ pdo_uint64_t quo = (pdo_uint64_t)i64 / (unsigned int)10;
+ unsigned int rem = (unsigned int)(i64 - quo*10U);
+ *--p = digit_vec[rem];
+ i64 = (pdo_int64_t)quo;
+ }
+ long_val = (long)i64;
+ while (long_val != 0) {
+ long quo = long_val / 10;
+ *--p = digit_vec[(unsigned int)(long_val - quo * 10)];
+ long_val = quo;
+ }
+ while ((*dst++ = *p++) != 0)
+ ;
+ *dst = '\0';
+ return estrdup(outbuf);
+}
+
+/* {{{ PHP_MINIT_FUNCTION */
+PHP_MINIT_FUNCTION(pdo)
+{
+ zend_class_entry ce;
+
+ spl_ce_RuntimeException = NULL;
+
+ ZEND_INIT_MODULE_GLOBALS(pdo, php_pdo_init_globals, NULL);
+ REGISTER_INI_ENTRIES();
+
+ if (FAILURE == pdo_sqlstate_init_error_table()) {
+ return FAILURE;
+ }
+
+ zend_hash_init(&pdo_driver_hash, 0, NULL, NULL, 1);
+
+ le_ppdo = zend_register_list_destructors_ex(NULL, php_pdo_pdbh_dtor,
+ "PDO persistent database", module_number);
+
+ INIT_CLASS_ENTRY(ce, "PDOException", NULL);
+
+ pdo_exception_ce = zend_register_internal_class_ex(&ce, php_pdo_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC);
+
+ zend_declare_property_null(pdo_exception_ce, "errorInfo", sizeof("errorInfo")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
+
+ pdo_dbh_init(TSRMLS_C);
+ pdo_stmt_init(TSRMLS_C);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION */
+PHP_MSHUTDOWN_FUNCTION(pdo)
+{
+ UNREGISTER_INI_ENTRIES();
+ zend_hash_destroy(&pdo_driver_hash);
+ pdo_sqlstate_fini_error_table();
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_RINIT_FUNCTION */
+PHP_RINIT_FUNCTION(pdo)
+{
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_RSHUTDOWN_FUNCTION */
+PHP_RSHUTDOWN_FUNCTION(pdo)
+{
+ /* TODO: visit persistent handles: for each persistent statement handle,
+ * remove bound parameter associations */
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION */
+PHP_MINFO_FUNCTION(pdo)
+{
+ HashPosition pos;
+ char *drivers = NULL, *ldrivers = estrdup("");
+ pdo_driver_t **pdriver;
+
+ php_info_print_table_start();
+ php_info_print_table_header(2, "PDO support", "enabled");
+
+ zend_hash_internal_pointer_reset_ex(&pdo_driver_hash, &pos);
+ while (SUCCESS == zend_hash_get_current_data_ex(&pdo_driver_hash, (void**)&pdriver, &pos)) {
+ spprintf(&drivers, 0, "%s, %s", ldrivers, (*pdriver)->driver_name);
+ zend_hash_move_forward_ex(&pdo_driver_hash, &pos);
+ efree(ldrivers);
+ ldrivers = drivers;
+ }
+
+ php_info_print_table_row(2, "PDO drivers", drivers ? drivers+2 : "");
+
+ if (drivers) {
+ efree(drivers);
+ }
+
+ php_info_print_table_end();
+
+#if 0
+ DISPLAY_INI_ENTRIES();
+#endif
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo/pdo.php b/ext/pdo/pdo.php
new file mode 100755
index 000000000..1008f7bd0
--- /dev/null
+++ b/ext/pdo/pdo.php
@@ -0,0 +1,62 @@
+<?php
+dl('pdo.so');
+dl('pdo_sqlite.so');
+
+//$x = new PDO("oci:dbname=hostname", 'php', 'php');
+$x = new PDO("sqlite::memory:");
+
+$x->query("create table test(name string, value string)");
+debug_zval_dump($x);
+
+$stmt = $x->prepare("INSERT INTO test (NAME, VALUE) VALUES (:name, :value)");
+
+$stmt->bindParam(":name", $the_name, PDO_PARAM_STR, 32);
+$stmt->bindParam(":value", $the_value, PDO_PARAM_STR, 32);
+
+for ($i = 0; $i < 4; $i++) {
+ $the_name = "foo" . rand();
+ $the_value = "bar" . rand();
+
+ if (!$stmt->execute()) {
+ break;
+ }
+}
+
+$stmt = null;
+
+echo "DEFAULT:\n";
+foreach ($x->query("select NAME, VALUE from test") as $row) {
+ print_r($row);
+}
+
+echo "OBJ:\n";
+
+class Foo {
+ public $NAME = "Don't change me";
+}
+
+$foo = new foo;
+
+foreach ($x->query("select NAME, VALUE from test", PDO_FETCH_COLUMN, 1) as $row) {
+ debug_zval_dump($row);
+}
+
+echo "Done\n";
+exit;
+
+$stmt = $x->prepare("select NAME, VALUE from test where value like ?");
+$the_name = 'bar%';
+$stmt->execute(array($the_name)) or die("failed to execute!");
+$stmt->bindColumn('VALUE', $value);
+
+while ($row = $stmt->fetch()) {
+ echo "name=$row[NAME] value=$row[VALUE]\n";
+ echo "value is $value\n";
+ echo "\n";
+}
+
+echo "Let's try an update\n";
+
+echo "All done\n";
+
+?>
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
new file mode 100755
index 000000000..987eedc25
--- /dev/null
+++ b/ext/pdo/pdo_dbh.c
@@ -0,0 +1,1433 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ | Marcus Boerger <helly@php.net> |
+ | Sterling Hughes <sterling@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_dbh.c,v 1.82.2.18 2005/11/25 00:20:12 wez Exp $ */
+
+/* The PDO Database Handle Class */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_pdo.h"
+#include "php_pdo_driver.h"
+#include "php_pdo_int.h"
+#include "zend_exceptions.h"
+#include "zend_object_handlers.h"
+#include "zend_hash.h"
+
+void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *supp TSRMLS_DC)
+{
+ pdo_error_type *pdo_err = &dbh->error_code;
+ char *message = NULL;
+ const char *msg;
+ zval *info = NULL;
+
+ if (dbh->error_mode == PDO_ERRMODE_SILENT) {
+#if 0
+ /* BUG: if user is running in silent mode and hits an error at the driver level
+ * when they use the PDO methods to call up the error information, they may
+ * get bogus information */
+ return;
+#endif
+ }
+
+ if (stmt) {
+ pdo_err = &stmt->error_code;
+ }
+
+ strcpy(*pdo_err, sqlstate);
+
+ /* hash sqlstate to error messages */
+ msg = pdo_sqlstate_state_to_description(*pdo_err);
+ if (!msg) {
+ msg = "<<Unknown error>>";
+ }
+
+ MAKE_STD_ZVAL(info);
+ array_init(info);
+
+ add_next_index_string(info, *pdo_err, 1);
+ add_next_index_long(info, 0);
+
+ if (supp) {
+ spprintf(&message, 0, "SQLSTATE[%s]: %s: %s", *pdo_err, msg, supp);
+ } else {
+ spprintf(&message, 0, "SQLSTATE[%s]: %s", *pdo_err, msg);
+ }
+
+ if (dbh->error_mode != PDO_ERRMODE_EXCEPTION) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
+
+ if (info) {
+ zval_ptr_dtor(&info);
+ }
+ } else {
+ zval *ex;
+ zend_class_entry *def_ex = php_pdo_get_exception_base(1 TSRMLS_CC), *pdo_ex = php_pdo_get_exception();
+
+ MAKE_STD_ZVAL(ex);
+ object_init_ex(ex, pdo_ex);
+
+ zend_update_property_string(def_ex, ex, "message", sizeof("message")-1, message TSRMLS_CC);
+ zend_update_property_string(def_ex, ex, "code", sizeof("code")-1, *pdo_err TSRMLS_CC);
+
+ if (info) {
+ zend_update_property(pdo_ex, ex, "errorInfo", sizeof("errorInfo")-1, info TSRMLS_CC);
+ zval_ptr_dtor(&info);
+ }
+
+ zend_throw_exception_object(ex TSRMLS_CC);
+ }
+
+ if (message) {
+ efree(message);
+ }
+}
+
+void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_error_type *pdo_err = &dbh->error_code;
+ const char *msg = "<<Unknown>>";
+ char *supp = NULL;
+ long native_code = 0;
+ char *message = NULL;
+ zval *info = NULL;
+
+ if (dbh->error_mode == PDO_ERRMODE_SILENT) {
+ return;
+ }
+
+ if (stmt) {
+ pdo_err = &stmt->error_code;
+ }
+
+ /* hash sqlstate to error messages */
+ msg = pdo_sqlstate_state_to_description(*pdo_err);
+ if (!msg) {
+ msg = "<<Unknown error>>";
+ }
+
+ if (dbh->methods->fetch_err) {
+
+ MAKE_STD_ZVAL(info);
+ array_init(info);
+
+ add_next_index_string(info, *pdo_err, 1);
+
+ if (dbh->methods->fetch_err(dbh, stmt, info TSRMLS_CC)) {
+ zval **item;
+
+ if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(info), 1, (void**)&item)) {
+ native_code = Z_LVAL_PP(item);
+ }
+
+ if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(info), 2, (void**)&item)) {
+ supp = estrndup(Z_STRVAL_PP(item), Z_STRLEN_PP(item));
+ }
+ }
+
+ zval_ptr_dtor(&info);
+ info = NULL;
+ }
+
+ if (supp) {
+ spprintf(&message, 0, "SQLSTATE[%s]: %s: %ld %s", *pdo_err, msg, native_code, supp);
+ } else {
+ spprintf(&message, 0, "SQLSTATE[%s]: %s", *pdo_err, msg);
+ }
+
+ if (dbh->error_mode == PDO_ERRMODE_WARNING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
+
+ if (info) {
+ zval_ptr_dtor(&info);
+ }
+ } else if (EG(exception) == NULL) {
+ zval *ex;
+ zend_class_entry *def_ex = php_pdo_get_exception_base(1 TSRMLS_CC), *pdo_ex = php_pdo_get_exception();
+
+ MAKE_STD_ZVAL(ex);
+ object_init_ex(ex, pdo_ex);
+
+ zend_update_property_string(def_ex, ex, "message", sizeof("message")-1, message TSRMLS_CC);
+ zend_update_property_string(def_ex, ex, "code", sizeof("code")-1, *pdo_err TSRMLS_CC);
+
+ if (info) {
+ zend_update_property(pdo_ex, ex, "errorInfo", sizeof("errorInfo")-1, info TSRMLS_CC);
+ zval_ptr_dtor(&info);
+ }
+
+ zend_throw_exception_object(ex TSRMLS_CC);
+ }
+
+ if (message) {
+ efree(message);
+ }
+
+ if (supp) {
+ efree(supp);
+ }
+}
+
+static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC)
+{
+ php_stream *stream;
+ char *dsn = NULL;
+
+ stream = php_stream_open_wrapper(uri, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
+ if (stream) {
+ dsn = php_stream_get_line(stream, buf, buflen, NULL);
+ php_stream_close(stream);
+ }
+ return dsn;
+}
+
+/* {{{ proto object PDO::__construct(string dsn, string username, string passwd [, array options])
+ */
+static PHP_METHOD(PDO, dbh_constructor)
+{
+ zval *object = getThis();
+ pdo_dbh_t *dbh = NULL;
+ zend_bool is_persistent = FALSE;
+ char *data_source;
+ int data_source_len;
+ char *colon;
+ char *username=NULL, *password=NULL;
+ int usernamelen, passwordlen;
+ pdo_driver_t *driver = NULL;
+ zval *options = NULL;
+ char alt_dsn[512];
+ int call_factory = 1;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!a!", &data_source, &data_source_len,
+ &username, &usernamelen, &password, &passwordlen, &options)) {
+ ZVAL_NULL(object);
+ return;
+ }
+
+ /* parse the data source name */
+ colon = strchr(data_source, ':');
+
+ if (!colon) {
+ /* let's see if this string has a matching dsn in the php.ini */
+ char *ini_dsn = NULL;
+
+ snprintf(alt_dsn, sizeof(alt_dsn), "pdo.dsn.%s", data_source);
+ if (FAILURE == cfg_get_string(alt_dsn, &ini_dsn)) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source name");
+ ZVAL_NULL(object);
+ return;
+ }
+
+ data_source = ini_dsn;
+ colon = strchr(data_source, ':');
+
+ if (!colon) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source name (via INI: %s)", alt_dsn);
+ ZVAL_NULL(object);
+ return;
+ }
+ }
+
+ if (!strncmp(data_source, "uri:", sizeof("uri:")-1)) {
+ /* the specified URI holds connection details */
+ data_source = dsn_from_uri(data_source + sizeof("uri:")-1, alt_dsn, sizeof(alt_dsn) TSRMLS_CC);
+ if (!data_source) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source URI");
+ ZVAL_NULL(object);
+ return;
+ }
+ colon = strchr(data_source, ':');
+ if (!colon) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source name (via URI)");
+ ZVAL_NULL(object);
+ return;
+ }
+ }
+
+ driver = pdo_find_driver(data_source, colon - data_source);
+
+ if (!driver) {
+ /* NB: don't want to include the data_source in the error message as
+ * it might contain a password */
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "could not find driver");
+ ZVAL_NULL(object);
+ return;
+ }
+
+ dbh = (pdo_dbh_t *) zend_object_store_get_object(object TSRMLS_CC);
+
+ /* is this supposed to be a persistent connection ? */
+ if (options) {
+ zval **v;
+ int plen;
+ char *hashkey = NULL;
+ list_entry *le;
+ pdo_dbh_t *pdbh = NULL;
+
+ if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_PERSISTENT, (void**)&v)) {
+ if (Z_TYPE_PP(v) == IS_STRING) {
+ /* user specified key */
+ plen = spprintf(&hashkey, 0, "PDO:DBH:DSN=%s:%s:%s:%s", data_source,
+ username ? username : "",
+ password ? password : "",
+ Z_STRVAL_PP(v));
+ is_persistent = 1;
+ } else {
+ convert_to_long_ex(v);
+ is_persistent = Z_LVAL_PP(v) ? 1 : 0;
+ plen = spprintf(&hashkey, 0, "PDO:DBH:DSN=%s:%s:%s", data_source,
+ username ? username : "",
+ password ? password : "");
+ }
+ }
+
+ if (is_persistent) {
+ /* let's see if we have one cached.... */
+ if (SUCCESS == zend_hash_find(&EG(persistent_list), hashkey, plen+1, (void*)&le)) {
+ if (Z_TYPE_P(le) == php_pdo_list_entry()) {
+ pdbh = (pdo_dbh_t*)le->ptr;
+
+ /* is the connection still alive ? */
+ if (pdbh->methods->check_liveness && FAILURE == (pdbh->methods->check_liveness)(pdbh TSRMLS_CC)) {
+ /* nope... need to kill it */
+ pdbh = NULL;
+ }
+ }
+ }
+
+ if (pdbh) {
+ call_factory = 0;
+ } else {
+ /* need a brand new pdbh */
+ pdbh = pecalloc(1, sizeof(*pdbh), 1);
+
+ if (!pdbh) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO handle");
+ /* NOTREACHED */
+ }
+
+ pdbh->is_persistent = 1;
+ if (!(pdbh->persistent_id = pemalloc(plen + 1, 1))) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO handle");
+ }
+ memcpy((char *)pdbh->persistent_id, hashkey, plen+1);
+ pdbh->persistent_id_len = plen+1;
+ pdbh->refcount = 1;
+ }
+ }
+
+ if (pdbh) {
+ /* let's copy the emalloc bits over from the other handle */
+ pdbh->ce = dbh->ce;
+ pdbh->def_stmt_ce = dbh->def_stmt_ce;
+ pdbh->def_stmt_ctor_args = dbh->def_stmt_ctor_args;
+ pdbh->properties = dbh->properties;
+ /* kill the non-persistent thingamy */
+ efree(dbh);
+ /* switch over to the persistent one */
+ dbh = pdbh;
+ zend_object_store_set_object(object, dbh TSRMLS_CC);
+ dbh->refcount++;
+ }
+
+ if (hashkey) {
+ efree(hashkey);
+ }
+ }
+
+ dbh->data_source_len = strlen(colon + 1);
+ dbh->data_source = (const char*)pestrdup(colon + 1, is_persistent);
+ dbh->username = username ? pestrdup(username, is_persistent) : NULL;
+ dbh->password = password ? pestrdup(password, is_persistent) : NULL;
+
+ dbh->auto_commit = pdo_attr_lval(options, PDO_ATTR_AUTOCOMMIT, 1 TSRMLS_CC);
+
+ if (!dbh->data_source || (username && !dbh->username) || (password && !dbh->password)) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory");
+ }
+
+ if (!call_factory) {
+ /* we got a persistent guy from our cache */
+ return;
+ }
+
+ if (driver->db_handle_factory(dbh, options TSRMLS_CC)) {
+ /* all set */
+
+ if (is_persistent) {
+ list_entry le;
+
+ /* register in the persistent list etc. */
+ /* we should also need to replace the object store entry,
+ since it was created with emalloc */
+
+ le.type = php_pdo_list_entry();
+ le.ptr = dbh;
+
+ if (FAILURE == zend_hash_update(&EG(persistent_list),
+ (char*)dbh->persistent_id, dbh->persistent_id_len, (void*)&le,
+ sizeof(le), NULL)) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to register persistent entry");
+ }
+ }
+
+ dbh->driver = driver;
+ return;
+ }
+
+ /* the connection failed; things will tidy up in free_storage */
+ /* XXX raise exception */
+ ZVAL_NULL(object);
+}
+/* }}} */
+
+static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */
+{
+ if (ctor_args) {
+ if (Z_TYPE_P(ctor_args) != IS_ARRAY) {
+ pdo_raise_impl_error(dbh, NULL, "HY000", "constructor arguments must be passed as an array" TSRMLS_CC);
+ return NULL;
+ }
+ if (!dbstmt_ce->constructor) {
+ pdo_raise_impl_error(dbh, NULL, "HY000", "user-supplied statement does not accept constructor arguments" TSRMLS_CC);
+ return NULL;
+ }
+ }
+
+ Z_TYPE_P(object) = IS_OBJECT;
+ object_init_ex(object, dbstmt_ce);
+ object->refcount = 1;
+ object->is_ref = 1;
+
+ return object;
+} /* }}} */
+
+static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */
+{
+ zval *query_string;
+ zval z_key;
+
+ MAKE_STD_ZVAL(query_string);
+ ZVAL_STRINGL(query_string, stmt->query_string, stmt->query_stringlen, 1);
+ ZVAL_STRINGL(&z_key, "queryString", sizeof("queryString")-1, 0);
+ std_object_handlers.write_property(object, &z_key, query_string TSRMLS_CC);
+ zval_ptr_dtor(&query_string);
+
+ if (dbstmt_ce->constructor) {
+ zend_fcall_info fci;
+ zend_fcall_info_cache fcc;
+ zval *retval;
+
+ fci.size = sizeof(zend_fcall_info);
+ fci.function_table = &dbstmt_ce->function_table;
+ fci.function_name = NULL;
+ fci.object_pp = &object;
+ fci.symbol_table = NULL;
+ fci.retval_ptr_ptr = &retval;
+ if (ctor_args) {
+ HashTable *ht = Z_ARRVAL_P(ctor_args);
+ Bucket *p;
+
+ fci.param_count = 0;
+ fci.params = safe_emalloc(sizeof(zval*), ht->nNumOfElements, 0);
+ p = ht->pListHead;
+ while (p != NULL) {
+ fci.params[fci.param_count++] = (zval**)p->pData;
+ p = p->pListNext;
+ }
+ } else {
+ fci.param_count = 0;
+ fci.params = NULL;
+ }
+ fci.no_separation = 1;
+
+ fcc.initialized = 1;
+ fcc.function_handler = dbstmt_ce->constructor;
+ fcc.calling_scope = EG(scope);
+ fcc.object_pp = &object;
+
+ if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
+ zval_dtor(object);
+ ZVAL_NULL(object);
+ object = NULL; /* marks failure */
+ } else {
+ zval_ptr_dtor(&retval);
+ }
+
+ if (fci.params) {
+ efree(fci.params);
+ }
+ }
+}
+/* }}} */
+
+/* {{{ proto object PDO::prepare(string statment [, array options])
+ Prepares a statement for execution and returns a statement object */
+static PHP_METHOD(PDO, prepare)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+ pdo_stmt_t *stmt;
+ char *statement;
+ int statement_len;
+ zval *options = NULL, **opt, **item, *ctor_args;
+ zend_class_entry *dbstmt_ce, **pce;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &statement,
+ &statement_len, &options)) {
+ RETURN_FALSE;
+ }
+
+ PDO_DBH_CLEAR_ERR();
+ PDO_CONSTRUCT_CHECK;
+
+ if (ZEND_NUM_ARGS() > 1 && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_STATEMENT_CLASS, (void**)&opt)) {
+ if (Z_TYPE_PP(opt) != IS_ARRAY || zend_hash_index_find(Z_ARRVAL_PP(opt), 0, (void**)&item) == FAILURE
+ || Z_TYPE_PP(item) != IS_STRING
+ || 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); "
+ "the classname must be a string specifying an existing class"
+ TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ dbstmt_ce = *pce;
+ if (!instanceof_function(dbstmt_ce, pdo_dbstmt_ce TSRMLS_CC)) {
+ pdo_raise_impl_error(dbh, NULL, "HY000",
+ "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ if (dbstmt_ce->constructor && !(dbstmt_ce->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) {
+ pdo_raise_impl_error(dbh, NULL, "HY000",
+ "user-supplied statement class cannot have a public constructor" TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ if (zend_hash_index_find(Z_ARRVAL_PP(opt), 1, (void**)&item) == SUCCESS) {
+ if (Z_TYPE_PP(item) != IS_ARRAY) {
+ pdo_raise_impl_error(dbh, NULL, "HY000",
+ "PDO::ATTR_STATEMENT_CLASS requires format array(classname, ctor_args); "
+ "ctor_args must be an array"
+ TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ ctor_args = *item;
+ } else {
+ ctor_args = NULL;
+ }
+ } else {
+ dbstmt_ce = dbh->def_stmt_ce;
+ ctor_args = dbh->def_stmt_ctor_args;
+ }
+
+ if (!pdo_stmt_instantiate(dbh, return_value, dbstmt_ce, ctor_args TSRMLS_CC)) {
+ pdo_raise_impl_error(dbh, NULL, "HY000",
+ "failed to instantiate user-supplied statement class"
+ TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ stmt = (pdo_stmt_t*)zend_object_store_get_object(return_value TSRMLS_CC);
+
+ /* unconditionally keep this for later reference */
+ stmt->query_string = estrndup(statement, statement_len);
+ stmt->query_stringlen = statement_len;
+ stmt->default_fetch_type = PDO_FETCH_BOTH;
+ stmt->dbh = dbh;
+ /* give it a reference to me */
+ zend_objects_store_add_ref(getThis() TSRMLS_CC);
+ stmt->database_object_handle = *getThis();
+ /* we haven't created a lazy object yet */
+ ZVAL_NULL(&stmt->lazy_object_ref);
+
+ if (dbh->methods->preparer(dbh, statement, statement_len, stmt, options TSRMLS_CC)) {
+ pdo_stmt_construct(stmt, return_value, dbstmt_ce, ctor_args TSRMLS_CC);
+ return;
+ }
+
+ PDO_HANDLE_DBH_ERR();
+
+ /* kill the object handle for the stmt here */
+ zval_dtor(return_value);
+
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto bool PDO::beginTransaction()
+ Initiates a transaction */
+static PHP_METHOD(PDO, beginTransaction)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ PDO_CONSTRUCT_CHECK;
+
+ if (dbh->in_txn) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "There is already an active transaction");
+ RETURN_FALSE;
+ }
+
+ if (!dbh->methods->begin) {
+ /* TODO: this should be an exception; see the auto-commit mode
+ * comments below */
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "This driver doesn't support transactions");
+ RETURN_FALSE;
+ }
+
+ if (dbh->methods->begin(dbh TSRMLS_CC)) {
+ dbh->in_txn = 1;
+ RETURN_TRUE;
+ }
+
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto bool PDO::commit()
+ Commit a transaction */
+static PHP_METHOD(PDO, commit)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ PDO_CONSTRUCT_CHECK;
+
+ if (!dbh->in_txn) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "There is no active transaction");
+ RETURN_FALSE;
+ }
+
+ if (dbh->methods->commit(dbh TSRMLS_CC)) {
+ dbh->in_txn = 0;
+ RETURN_TRUE;
+ }
+
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto bool PDO::rollBack()
+ roll back a transaction */
+static PHP_METHOD(PDO, rollBack)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ PDO_CONSTRUCT_CHECK;
+
+ if (!dbh->in_txn) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "There is no active transaction");
+ RETURN_FALSE;
+ }
+
+ if (dbh->methods->rollback(dbh TSRMLS_CC)) {
+ dbh->in_txn = 0;
+ RETURN_TRUE;
+ }
+
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto bool PDO::setAttribute(long attribute, mixed value)
+ Set an attribute */
+static PHP_METHOD(PDO, setAttribute)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+ long attr;
+ zval *value = NULL;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz!", &attr, &value)) {
+ RETURN_FALSE;
+ }
+
+ PDO_CONSTRUCT_CHECK;
+
+ switch (attr) {
+ case PDO_ATTR_ERRMODE:
+ convert_to_long(value);
+ switch (Z_LVAL_P(value)) {
+ case PDO_ERRMODE_SILENT:
+ case PDO_ERRMODE_WARNING:
+ case PDO_ERRMODE_EXCEPTION:
+ dbh->error_mode = Z_LVAL_P(value);
+ RETURN_TRUE;
+ default:
+ pdo_raise_impl_error(dbh, NULL, "HY000", "invalid error mode" TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ RETURN_FALSE;
+
+ case PDO_ATTR_CASE:
+ convert_to_long(value);
+ switch (Z_LVAL_P(value)) {
+ case PDO_CASE_NATURAL:
+ case PDO_CASE_UPPER:
+ case PDO_CASE_LOWER:
+ dbh->desired_case = Z_LVAL_P(value);
+ RETURN_TRUE;
+ default:
+ pdo_raise_impl_error(dbh, NULL, "HY000", "invalid case folding mode" TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ RETURN_FALSE;
+
+ case PDO_ATTR_ORACLE_NULLS:
+ convert_to_long(value);
+ dbh->oracle_nulls = Z_LVAL_P(value);
+ RETURN_TRUE;
+
+ case PDO_ATTR_STRINGIFY_FETCHES:
+ convert_to_long(value);
+ dbh->stringify = Z_LVAL_P(value) ? 1 : 0;
+ RETURN_TRUE;
+
+ case PDO_ATTR_STATEMENT_CLASS: {
+ /* array(string classname, array(mixed ctor_args)) */
+ zend_class_entry **pce;
+ zval **item;
+
+ if (dbh->is_persistent) {
+ pdo_raise_impl_error(dbh, NULL, "HY000",
+ "PDO::ATTR_STATEMENT_CLASS cannot be used with persistent PDO instances"
+ TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ if (Z_TYPE_P(value) != IS_ARRAY
+ || zend_hash_index_find(Z_ARRVAL_P(value), 0, (void**)&item) == FAILURE
+ || Z_TYPE_PP(item) != IS_STRING
+ || 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, array(ctor_args)); "
+ "the classname must be a string specifying an existing class"
+ TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ if (!instanceof_function(*pce, pdo_dbstmt_ce TSRMLS_CC)) {
+ pdo_raise_impl_error(dbh, NULL, "HY000",
+ "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ if ((*pce)->constructor && !((*pce)->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) {
+ pdo_raise_impl_error(dbh, NULL, "HY000",
+ "user-supplied statement class cannot have a public constructor" TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ dbh->def_stmt_ce = *pce;
+ if (dbh->def_stmt_ctor_args) {
+ zval_ptr_dtor(&dbh->def_stmt_ctor_args);
+ dbh->def_stmt_ctor_args = NULL;
+ }
+ if (zend_hash_index_find(Z_ARRVAL_P(value), 1, (void**)&item) == SUCCESS) {
+ if (Z_TYPE_PP(item) != IS_ARRAY) {
+ pdo_raise_impl_error(dbh, NULL, "HY000",
+ "PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); "
+ "ctor_args must be an array"
+ TSRMLS_CC);
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ }
+ (*item)->refcount++;
+ dbh->def_stmt_ctor_args = *item;
+ }
+ RETURN_TRUE;
+ }
+
+ default:
+ ;
+ }
+
+ if (!dbh->methods->set_attribute) {
+ goto fail;
+ }
+
+ PDO_DBH_CLEAR_ERR();
+ if (dbh->methods->set_attribute(dbh, attr, value TSRMLS_CC)) {
+ RETURN_TRUE;
+ }
+
+fail:
+ if (attr == PDO_ATTR_AUTOCOMMIT) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "The auto-commit mode cannot be changed for this driver");
+ } else if (!dbh->methods->set_attribute) {
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support setting attributes" TSRMLS_CC);
+ } else {
+ PDO_HANDLE_DBH_ERR();
+ }
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto mixed PDO::getAttribute(long attribute)
+ Get an attribute */
+static PHP_METHOD(PDO, getAttribute)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+ long attr;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr)) {
+ RETURN_FALSE;
+ }
+
+ PDO_DBH_CLEAR_ERR();
+ PDO_CONSTRUCT_CHECK;
+
+ /* handle generic PDO-level atributes */
+ switch (attr) {
+ case PDO_ATTR_PERSISTENT:
+ RETURN_BOOL(dbh->is_persistent);
+
+ case PDO_ATTR_CASE:
+ RETURN_LONG(dbh->desired_case);
+
+ case PDO_ATTR_ORACLE_NULLS:
+ RETURN_LONG(dbh->oracle_nulls);
+
+ case PDO_ATTR_ERRMODE:
+ RETURN_LONG(dbh->error_mode);
+
+ case PDO_ATTR_DRIVER_NAME:
+ RETURN_STRINGL((char*)dbh->driver->driver_name, dbh->driver->driver_name_len, 1);
+
+ case PDO_ATTR_STATEMENT_CLASS:
+ array_init(return_value);
+ add_next_index_string(return_value, dbh->def_stmt_ce->name, 1);
+ if (dbh->def_stmt_ctor_args) {
+ dbh->def_stmt_ctor_args->refcount++;
+ add_next_index_zval(return_value, dbh->def_stmt_ctor_args);
+ }
+ return;
+ }
+
+ if (!dbh->methods->get_attribute) {
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support getting attributes" TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
+ switch (dbh->methods->get_attribute(dbh, attr, return_value TSRMLS_CC)) {
+ case -1:
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+
+ case 0:
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support that attribute" TSRMLS_CC);
+ RETURN_FALSE;
+
+ default:
+ return;
+ }
+}
+/* }}} */
+
+/* {{{ proto long PDO::exec(string query)
+ Execute a query that does not return a row set, returning the number of affected rows */
+static PHP_METHOD(PDO, exec)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+ char *statement;
+ int statement_len;
+ long ret;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &statement, &statement_len)) {
+ RETURN_FALSE;
+ }
+
+ if (!statement_len) {
+ RETURN_FALSE;
+ }
+ PDO_DBH_CLEAR_ERR();
+ PDO_CONSTRUCT_CHECK;
+ ret = dbh->methods->doer(dbh, statement, statement_len TSRMLS_CC);
+ if(ret == -1) {
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ } else {
+ RETURN_LONG(ret);
+ }
+}
+/* }}} */
+
+
+/* {{{ proto string PDO::lastInsertId([string seqname])
+ Returns the id of the last row that we affected on this connection. Some databases require a sequence or table name to be passed in. Not always meaningful. */
+static PHP_METHOD(PDO, lastInsertId)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+ char *name = NULL;
+ int namelen;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &name, &namelen)) {
+ RETURN_FALSE;
+ }
+
+ PDO_DBH_CLEAR_ERR();
+ PDO_CONSTRUCT_CHECK;
+ if (!dbh->methods->last_id) {
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()" TSRMLS_CC);
+ RETURN_FALSE;
+ } else {
+ Z_STRVAL_P(return_value) = dbh->methods->last_id(dbh, name, &Z_STRLEN_P(return_value) TSRMLS_CC);
+ if (!Z_STRVAL_P(return_value)) {
+ PDO_HANDLE_DBH_ERR();
+ RETURN_FALSE;
+ } else {
+ Z_TYPE_P(return_value) = IS_STRING;
+ }
+ }
+}
+/* }}} */
+
+/* {{{ proto string PDO::errorCode()
+ Fetch the error code associated with the last operation on the database handle */
+static PHP_METHOD(PDO, errorCode)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (ZEND_NUM_ARGS()) {
+ RETURN_FALSE;
+ }
+ PDO_CONSTRUCT_CHECK;
+
+ if (dbh->query_stmt) {
+ RETURN_STRING(dbh->query_stmt->error_code, 1);
+ }
+
+ RETURN_STRING(dbh->error_code, 1);
+}
+/* }}} */
+
+/* {{{ proto int PDO::errorInfo()
+ Fetch extended error information associated with the last operation on the database handle */
+static PHP_METHOD(PDO, errorInfo)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (ZEND_NUM_ARGS()) {
+ RETURN_FALSE;
+ }
+ PDO_CONSTRUCT_CHECK;
+
+ array_init(return_value);
+
+ if (dbh->query_stmt) {
+ add_next_index_string(return_value, dbh->query_stmt->error_code, 1);
+ } else {
+ add_next_index_string(return_value, dbh->error_code, 1);
+ }
+ if (dbh->methods->fetch_err) {
+ dbh->methods->fetch_err(dbh, dbh->query_stmt, return_value TSRMLS_CC);
+ }
+}
+/* }}} */
+
+/* {{{ proto object PDO::query(string sql [, PDOStatement::setFetchMode() args])
+ Prepare and execute $sql; returns the statement object for iteration */
+static PHP_METHOD(PDO, query)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+ pdo_stmt_t *stmt;
+ char *statement;
+ int statement_len;
+
+ if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &statement,
+ &statement_len)) {
+ RETURN_FALSE;
+ }
+
+ PDO_DBH_CLEAR_ERR();
+ PDO_CONSTRUCT_CHECK;
+
+ if (!pdo_stmt_instantiate(dbh, return_value, dbh->def_stmt_ce, dbh->def_stmt_ctor_args TSRMLS_CC)) {
+ pdo_raise_impl_error(dbh, NULL, "HY000", "failed to instantiate user supplied statement class" TSRMLS_CC);
+ return;
+ }
+ stmt = (pdo_stmt_t*)zend_object_store_get_object(return_value TSRMLS_CC);
+
+ /* unconditionally keep this for later reference */
+ stmt->query_string = estrndup(statement, statement_len);
+ stmt->query_stringlen = statement_len;
+ stmt->default_fetch_type = PDO_FETCH_BOTH;
+ stmt->active_query_string = stmt->query_string;
+ stmt->active_query_stringlen = statement_len;
+ stmt->dbh = dbh;
+ /* give it a reference to me */
+ zend_objects_store_add_ref(getThis() TSRMLS_CC);
+ stmt->database_object_handle = *getThis();
+ /* we haven't created a lazy object yet */
+ ZVAL_NULL(&stmt->lazy_object_ref);
+
+ if (dbh->methods->preparer(dbh, statement, statement_len, stmt, NULL TSRMLS_CC)) {
+ if (ZEND_NUM_ARGS() == 1 || SUCCESS == pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, 1)) {
+ /* now execute the statement */
+ PDO_STMT_CLEAR_ERR();
+ if (stmt->methods->executer(stmt TSRMLS_CC)) {
+ int ret = 1;
+ if (!stmt->executed) {
+ if (stmt->dbh->alloc_own_columns) {
+ ret = pdo_stmt_describe_columns(stmt TSRMLS_CC);
+ }
+ stmt->executed = 1;
+ }
+ if (ret) {
+ pdo_stmt_construct(stmt, return_value, dbh->def_stmt_ce, dbh->def_stmt_ctor_args TSRMLS_CC);
+ return;
+ }
+ }
+ }
+ /* something broke */
+ dbh->query_stmt = stmt;
+ dbh->query_stmt_zval = *return_value;
+ PDO_HANDLE_STMT_ERR();
+ } else {
+ PDO_HANDLE_DBH_ERR();
+ zval_dtor(return_value);
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto string PDO::quote(string string [, int paramtype])
+ quotes string for use in a query. The optional paramtype acts as a hint for drivers that have alternate quoting styles. The default value is PDO_PARAM_STR */
+static PHP_METHOD(PDO, quote)
+{
+ pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+ char *str;
+ int str_len;
+ long paramtype = PDO_PARAM_STR;
+ char *qstr;
+ int qlen;
+
+ if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s|l", &str, &str_len,
+ &paramtype)) {
+ RETURN_FALSE;
+ }
+
+ PDO_DBH_CLEAR_ERR();
+ PDO_CONSTRUCT_CHECK;
+ if (!dbh->methods->quoter) {
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support quoting" TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
+ if (dbh->methods->quoter(dbh, str, str_len, &qstr, &qlen, paramtype TSRMLS_CC)) {
+ RETURN_STRINGL(qstr, qlen, 0);
+ }
+ PDO_HANDLE_DBH_ERR();
+}
+/* }}} */
+
+/* {{{ proto int PDO::__wakeup()
+ Prevents use of a PDO instance that has been unserialized */
+static PHP_METHOD(PDO, __wakeup)
+{
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDO instances");
+}
+/* }}} */
+
+/* {{{ proto int PDO::__sleep()
+ Prevents serialization of a PDO instance */
+static PHP_METHOD(PDO, __sleep)
+{
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDO instances");
+}
+/* }}} */
+
+/* {{{ proto array pdo_drivers()
+ Return array of available PDO drivers */
+static PHP_METHOD(PDO, getAvailableDrivers)
+{
+ HashPosition pos;
+ pdo_driver_t **pdriver;
+
+ array_init(return_value);
+
+ zend_hash_internal_pointer_reset_ex(&pdo_driver_hash, &pos);
+ while (SUCCESS == zend_hash_get_current_data_ex(&pdo_driver_hash, (void**)&pdriver, &pos)) {
+ add_next_index_stringl(return_value, (char*)(*pdriver)->driver_name, (*pdriver)->driver_name_len, 1);
+ zend_hash_move_forward_ex(&pdo_driver_hash, &pos);
+ }
+}
+/* }}} */
+
+function_entry pdo_dbh_functions[] = {
+ ZEND_MALIAS(PDO, __construct, dbh_constructor, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, prepare, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, beginTransaction,NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, commit, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, rollBack, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, setAttribute, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, exec, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, query, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, lastInsertId, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, errorCode, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, errorInfo, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, getAttribute, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, quote, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDO, __wakeup, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+ PHP_ME(PDO, __sleep, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+ PHP_ME(PDO, getAvailableDrivers, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ {NULL, NULL, NULL}
+};
+
+/* {{{ overloaded object handlers for PDO class */
+int pdo_hash_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC)
+{
+ function_entry *funcs;
+ zend_function func;
+ zend_internal_function *ifunc = (zend_internal_function*)&func;
+ int namelen;
+ char *lc_name;
+
+ if (!dbh->methods->get_driver_methods) {
+ return 0;
+ }
+ funcs = dbh->methods->get_driver_methods(dbh,
+ PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC);
+ if (!funcs) {
+ return 0;
+ }
+
+ if (!(dbh->cls_methods[kind] = pemalloc(sizeof(HashTable), dbh->is_persistent))) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO methods.");
+ }
+ zend_hash_init_ex(dbh->cls_methods[kind], 8, NULL, NULL, dbh->is_persistent, 0);
+
+ while (funcs->fname) {
+ ifunc->type = ZEND_INTERNAL_FUNCTION;
+ ifunc->handler = funcs->handler;
+ ifunc->function_name = funcs->fname;
+ ifunc->scope = dbh->ce;
+ ifunc->prototype = NULL;
+ if (funcs->arg_info) {
+ ifunc->arg_info = funcs->arg_info + 1;
+ ifunc->num_args = funcs->num_args;
+ if (funcs->arg_info[0].required_num_args == -1) {
+ ifunc->required_num_args = funcs->num_args;
+ } else {
+ ifunc->required_num_args = funcs->arg_info[0].required_num_args;
+ }
+ ifunc->pass_rest_by_reference = funcs->arg_info[0].pass_by_reference;
+ ifunc->return_reference = funcs->arg_info[0].return_reference;
+ } else {
+ ifunc->arg_info = NULL;
+ ifunc->num_args = 0;
+ ifunc->required_num_args = 0;
+ ifunc->pass_rest_by_reference = 0;
+ ifunc->return_reference = 0;
+ }
+ if (funcs->flags) {
+ ifunc->fn_flags = funcs->flags;
+ } else {
+ ifunc->fn_flags = ZEND_ACC_PUBLIC;
+ }
+ namelen = strlen(funcs->fname);
+ lc_name = emalloc(namelen+1);
+ zend_str_tolower_copy(lc_name, funcs->fname, namelen);
+ zend_hash_add(dbh->cls_methods[kind], lc_name, namelen+1, &func, sizeof(func), NULL);
+ efree(lc_name);
+ funcs++;
+ }
+
+ return 1;
+}
+
+static union _zend_function *dbh_method_get(
+#if PHP_API_VERSION >= 20041225
+ zval **object_pp,
+#else
+ zval *object,
+#endif
+ char *method_name, int method_len TSRMLS_DC)
+{
+ zend_function *fbc = NULL;
+ char *lc_method_name;
+#if PHP_API_VERSION >= 20041225
+ zval *object = *object_pp;
+#endif
+ pdo_dbh_t *dbh = zend_object_store_get_object(object TSRMLS_CC);
+
+ lc_method_name = emalloc(method_len + 1);
+ zend_str_tolower_copy(lc_method_name, method_name, method_len);
+
+ if (zend_hash_find(&dbh->ce->function_table, lc_method_name, method_len+1, (void**)&fbc) == FAILURE) {
+ /* not a pre-defined method, nor a user-defined method; check
+ * the driver specific methods */
+ if (!dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) {
+ if (!pdo_hash_methods(dbh,
+ PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC)
+ || !dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) {
+ goto out;
+ }
+ }
+
+ if (zend_hash_find(dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH],
+ lc_method_name, method_len+1, (void**)&fbc) == FAILURE) {
+ fbc = NULL;
+ goto out;
+ }
+ /* got it */
+ }
+
+out:
+ efree(lc_method_name);
+ return fbc;
+}
+
+static int dbh_compare(zval *object1, zval *object2 TSRMLS_DC)
+{
+ return -1;
+}
+
+static zend_object_handlers pdo_dbh_object_handlers;
+
+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)
+{
+#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
+}
+
+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
+}
+
+void pdo_dbh_init(TSRMLS_D)
+{
+ zend_class_entry ce;
+
+ INIT_CLASS_ENTRY(ce, "PDO", pdo_dbh_functions);
+ pdo_dbh_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ pdo_dbh_ce->create_object = pdo_dbh_new;
+
+ memcpy(&pdo_dbh_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
+ pdo_dbh_object_handlers.get_method = dbh_method_get;
+ pdo_dbh_object_handlers.compare_objects = dbh_compare;
+
+ REGISTER_PDO_CLASS_CONST_LONG("PARAM_BOOL", (long)PDO_PARAM_BOOL);
+ REGISTER_PDO_CLASS_CONST_LONG("PARAM_NULL", (long)PDO_PARAM_NULL);
+ REGISTER_PDO_CLASS_CONST_LONG("PARAM_INT", (long)PDO_PARAM_INT);
+ REGISTER_PDO_CLASS_CONST_LONG("PARAM_STR", (long)PDO_PARAM_STR);
+ REGISTER_PDO_CLASS_CONST_LONG("PARAM_LOB", (long)PDO_PARAM_LOB);
+ REGISTER_PDO_CLASS_CONST_LONG("PARAM_STMT", (long)PDO_PARAM_STMT);
+ REGISTER_PDO_CLASS_CONST_LONG("PARAM_INPUT_OUTPUT", (long)PDO_PARAM_INPUT_OUTPUT);
+
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_LAZY", (long)PDO_FETCH_LAZY);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_ASSOC",(long)PDO_FETCH_ASSOC);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_NUM", (long)PDO_FETCH_NUM);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_BOTH", (long)PDO_FETCH_BOTH);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_OBJ", (long)PDO_FETCH_OBJ);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_BOUND",(long)PDO_FETCH_BOUND);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_COLUMN",(long)PDO_FETCH_COLUMN);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_CLASS",(long)PDO_FETCH_CLASS);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_INTO", (long)PDO_FETCH_INTO);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_FUNC", (long)PDO_FETCH_FUNC);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_GROUP",(long)PDO_FETCH_GROUP);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_UNIQUE",(long)PDO_FETCH_UNIQUE);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_CLASSTYPE",(long)PDO_FETCH_CLASSTYPE);
+#if PHP_MAJOR_VERSION > 5 || PHP_MINOR_VERSION >= 1
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_SERIALIZE",(long)PDO_FETCH_SERIALIZE);
+#endif
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_NAMED",(long)PDO_FETCH_NAMED);
+
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_AUTOCOMMIT", (long)PDO_ATTR_AUTOCOMMIT);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_PREFETCH", (long)PDO_ATTR_PREFETCH);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_TIMEOUT", (long)PDO_ATTR_TIMEOUT);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_ERRMODE", (long)PDO_ATTR_ERRMODE);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_SERVER_VERSION", (long)PDO_ATTR_SERVER_VERSION);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_CLIENT_VERSION", (long)PDO_ATTR_CLIENT_VERSION);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_SERVER_INFO", (long)PDO_ATTR_SERVER_INFO);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_CONNECTION_STATUS", (long)PDO_ATTR_CONNECTION_STATUS);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_CASE", (long)PDO_ATTR_CASE);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_CURSOR_NAME", (long)PDO_ATTR_CURSOR_NAME);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_CURSOR", (long)PDO_ATTR_CURSOR);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_ORACLE_NULLS", (long)PDO_ATTR_ORACLE_NULLS);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_PERSISTENT", (long)PDO_ATTR_PERSISTENT);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_STATEMENT_CLASS", (long)PDO_ATTR_STATEMENT_CLASS);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_FETCH_TABLE_NAMES", (long)PDO_ATTR_FETCH_TABLE_NAMES);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_FETCH_CATALOG_NAMES", (long)PDO_ATTR_FETCH_CATALOG_NAMES);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_DRIVER_NAME", (long)PDO_ATTR_DRIVER_NAME);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_STRINGIFY_FETCHES",(long)PDO_ATTR_STRINGIFY_FETCHES);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_MAX_COLUMN_LEN",(long)PDO_ATTR_MAX_COLUMN_LEN);
+
+ REGISTER_PDO_CLASS_CONST_LONG("ERRMODE_SILENT", (long)PDO_ERRMODE_SILENT);
+ REGISTER_PDO_CLASS_CONST_LONG("ERRMODE_WARNING", (long)PDO_ERRMODE_WARNING);
+ REGISTER_PDO_CLASS_CONST_LONG("ERRMODE_EXCEPTION", (long)PDO_ERRMODE_EXCEPTION);
+
+ REGISTER_PDO_CLASS_CONST_LONG("CASE_NATURAL", (long)PDO_CASE_NATURAL);
+ REGISTER_PDO_CLASS_CONST_LONG("CASE_LOWER", (long)PDO_CASE_LOWER);
+ REGISTER_PDO_CLASS_CONST_LONG("CASE_UPPER", (long)PDO_CASE_UPPER);
+
+ REGISTER_PDO_CLASS_CONST_LONG("NULL_NATURAL", (long)PDO_NULL_NATURAL);
+ REGISTER_PDO_CLASS_CONST_LONG("NULL_EMPTY_STRING", (long)PDO_NULL_EMPTY_STRING);
+ REGISTER_PDO_CLASS_CONST_LONG("NULL_TO_STRING", (long)PDO_NULL_TO_STRING);
+
+ REGISTER_PDO_CLASS_CONST_STRING("ERR_NONE", PDO_ERR_NONE);
+
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_NEXT", (long)PDO_FETCH_ORI_NEXT);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_PRIOR", (long)PDO_FETCH_ORI_PRIOR);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_FIRST", (long)PDO_FETCH_ORI_FIRST);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_LAST", (long)PDO_FETCH_ORI_LAST);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_ABS", (long)PDO_FETCH_ORI_ABS);
+ REGISTER_PDO_CLASS_CONST_LONG("FETCH_ORI_REL", (long)PDO_FETCH_ORI_REL);
+
+ REGISTER_PDO_CLASS_CONST_LONG("CURSOR_FWDONLY", (long)PDO_CURSOR_FWDONLY);
+ REGISTER_PDO_CLASS_CONST_LONG("CURSOR_SCROLL", (long)PDO_CURSOR_SCROLL);
+
+#if 0
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_CANT_MAP", (long)PDO_ERR_CANT_MAP);
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_SYNTAX", (long)PDO_ERR_SYNTAX);
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_CONSTRAINT", (long)PDO_ERR_CONSTRAINT);
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_NOT_FOUND", (long)PDO_ERR_NOT_FOUND);
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_ALREADY_EXISTS", (long)PDO_ERR_ALREADY_EXISTS);
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_NOT_IMPLEMENTED", (long)PDO_ERR_NOT_IMPLEMENTED);
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_MISMATCH", (long)PDO_ERR_MISMATCH);
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_TRUNCATED", (long)PDO_ERR_TRUNCATED);
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_DISCONNECTED", (long)PDO_ERR_DISCONNECTED);
+ REGISTER_PDO_CLASS_CONST_LONG("ERR_NO_PERM", (long)PDO_ERR_NO_PERM);
+#endif
+
+}
+
+static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ int i;
+
+ if (--dbh->refcount)
+ return;
+
+ if (dbh->methods) {
+ dbh->methods->closer(dbh TSRMLS_CC);
+ }
+
+ if (dbh->data_source) {
+ pefree((char *)dbh->data_source, dbh->is_persistent);
+ }
+ if (dbh->username) {
+ pefree(dbh->username, dbh->is_persistent);
+ }
+ if (dbh->password) {
+ pefree(dbh->password, dbh->is_persistent);
+ }
+
+ if (dbh->def_stmt_ctor_args) {
+ zval_ptr_dtor(&dbh->def_stmt_ctor_args);
+ }
+
+ for (i = 0; i < PDO_DBH_DRIVER_METHOD_KIND__MAX; i++) {
+ if (dbh->cls_methods[i]) {
+ zend_hash_destroy(dbh->cls_methods[i]);
+ }
+ }
+
+ pefree(dbh, dbh->is_persistent);
+}
+
+static void pdo_dbh_free_storage(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ if (dbh->in_txn && dbh->methods && dbh->methods->rollback) {
+ dbh->methods->rollback(dbh TSRMLS_CC);
+ dbh->in_txn = 0;
+ }
+
+ if (dbh->properties) {
+ zend_hash_destroy(dbh->properties);
+ efree(dbh->properties);
+ dbh->properties = NULL;
+ }
+
+ if (!dbh->is_persistent) {
+ dbh_free(dbh TSRMLS_CC);
+ } else if (dbh->methods && dbh->methods->persistent_shutdown) {
+ dbh->methods->persistent_shutdown(dbh TSRMLS_CC);
+ }
+}
+
+zend_object_value pdo_dbh_new(zend_class_entry *ce TSRMLS_DC)
+{
+ zend_object_value retval;
+ pdo_dbh_t *dbh;
+ zval *tmp;
+
+ dbh = emalloc(sizeof(*dbh));
+ memset(dbh, 0, sizeof(*dbh));
+ dbh->ce = ce;
+ dbh->refcount = 1;
+ ALLOC_HASHTABLE(dbh->properties);
+ zend_hash_init(dbh->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(dbh->properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+ dbh->def_stmt_ce = pdo_dbstmt_ce;
+
+ retval.handle = zend_objects_store_put(dbh, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbh_free_storage, NULL TSRMLS_CC);
+ retval.handlers = &pdo_dbh_object_handlers;
+
+ return retval;
+}
+
+/* }}} */
+
+ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor)
+{
+ if (rsrc->ptr) {
+ pdo_dbh_t *dbh = (pdo_dbh_t*)rsrc->ptr;
+ dbh_free(dbh TSRMLS_CC);
+ rsrc->ptr = NULL;
+ }
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
new file mode 100644
index 000000000..cf991268e
--- /dev/null
+++ b/ext/pdo/pdo_sql_parser.c
@@ -0,0 +1,692 @@
+/* Generated by re2c 0.9.9.rc1 on Sat Sep 10 15:53:03 2005 */
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: George Schlossnagle <george@omniti.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_sql_parser.c,v 1.35.2.2 2005/09/10 20:58:57 wez Exp $ */
+
+#include "php.h"
+#include "php_pdo_driver.h"
+#include "php_pdo_int.h"
+
+#define PDO_PARSER_TEXT 1
+#define PDO_PARSER_BIND 2
+#define PDO_PARSER_BIND_POS 3
+#define PDO_PARSER_EOI 4
+
+#define RET(i) {s->cur = cursor; return i; }
+
+#define YYCTYPE char
+#define YYCURSOR cursor
+#define YYLIMIT s->lim
+#define YYMARKER s->ptr
+#define YYFILL(n)
+
+typedef struct Scanner {
+ char *lim, *ptr, *cur, *tok;
+} Scanner;
+
+static int scan(Scanner *s)
+{
+ char *cursor = s->cur;
+
+ s->tok = cursor;
+
+
+ {
+ static unsigned char yybm[] = {
+ 0, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 52, 162, 162, 162, 162, 196,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 244, 162, 162, 162, 162, 244,
+ 162, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 162, 2, 162, 162, 170,
+ 162, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ };
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ goto yy0;
+ ++YYCURSOR;
+yy0:
+ if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 2) {
+ goto yy8;
+ }
+ if(yych <= 0x00) goto yy11;
+ if(yych <= '&') goto yy2;
+ if(yych <= '\'') goto yy4;
+ if(yych <= '>') goto yy5;
+ goto yy6;
+yy2: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 64) {
+ goto yy30;
+ }
+ if(yych <= 0x00) goto yy3;
+ if(yych == '"') goto yy28;
+ goto yy33;
+yy3:
+{ RET(PDO_PARSER_TEXT); }
+yy4: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 16) {
+ goto yy19;
+ }
+ if(yych <= 0x00) goto yy3;
+ if(yych == '\'') goto yy21;
+ goto yy24;
+yy5: yych = *++YYCURSOR;
+ if(yybm[0+yych] & 4) {
+ goto yy13;
+ }
+ if(yych <= 'Z'){
+ if(yych <= '/') goto yy3;
+ if(yych <= ':') goto yy16;
+ if(yych <= '@') goto yy3;
+ goto yy16;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy3;
+ goto yy16;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy16;
+ goto yy3;
+ }
+ }
+yy6: ++YYCURSOR;
+ if(yybm[0+(yych = *YYCURSOR)] & 4) {
+ yych = *YYCURSOR;
+ goto yy13;
+ }
+ goto yy7;
+yy7:
+{ RET(PDO_PARSER_BIND_POS); }
+yy8: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy9;
+yy9: if(yybm[0+yych] & 2) {
+ goto yy8;
+ }
+ goto yy10;
+yy10:
+{ RET(PDO_PARSER_TEXT); }
+yy11: ++YYCURSOR;
+ goto yy12;
+yy12:
+{ RET(PDO_PARSER_EOI); }
+yy13: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy14;
+yy14: if(yybm[0+yych] & 4) {
+ goto yy13;
+ }
+ goto yy15;
+yy15:
+{ RET(PDO_PARSER_TEXT); }
+yy16: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy17;
+yy17: if(yybm[0+yych] & 8) {
+ goto yy16;
+ }
+ goto yy18;
+yy18:
+{ RET(PDO_PARSER_BIND); }
+yy19: yyaccept = 1;
+ YYMARKER = ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ goto yy20;
+yy20: if(yybm[0+yych] & 16) {
+ goto yy19;
+ }
+ if(yych <= '\''){
+ if(yych <= 0x00) goto yy15;
+ if(yych <= '&') goto yy23;
+ goto yy21;
+ } else {
+ if(yych == '\\') goto yy26;
+ goto yy23;
+ }
+yy21: ++YYCURSOR;
+ if(yybm[0+(yych = *YYCURSOR)] & 4) {
+ yych = *YYCURSOR;
+ goto yy13;
+ }
+ goto yy22;
+yy22:
+{ RET(PDO_PARSER_TEXT); }
+yy23: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy24;
+yy24: if(yybm[0+yych] & 32) {
+ goto yy23;
+ }
+ if(yych <= 0x00) goto yy25;
+ if(yych <= '[') goto yy27;
+ goto yy26;
+yy25: YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 1: goto yy15;
+ case 0: goto yy3;
+ }
+yy26: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == '\'') goto yy23;
+ goto yy25;
+yy27: yych = *++YYCURSOR;
+ goto yy22;
+yy28: ++YYCURSOR;
+ if(yybm[0+(yych = *YYCURSOR)] & 4) {
+ yych = *YYCURSOR;
+ goto yy13;
+ }
+ goto yy29;
+yy29:
+{ RET(PDO_PARSER_TEXT); }
+yy30: yyaccept = 1;
+ YYMARKER = ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ goto yy31;
+yy31: if(yybm[0+yych] & 64) {
+ goto yy30;
+ }
+ if(yych <= '"'){
+ if(yych <= 0x00) goto yy15;
+ if(yych >= '"') goto yy28;
+ goto yy32;
+ } else {
+ if(yych == '\\') goto yy34;
+ goto yy32;
+ }
+yy32: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy33;
+yy33: if(yybm[0+yych] & 128) {
+ goto yy32;
+ }
+ if(yych <= 0x00) goto yy25;
+ if(yych <= '[') goto yy35;
+ goto yy34;
+yy34: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == '"') goto yy32;
+ goto yy25;
+yy35: ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy29;
+}
+}
+
+}
+
+struct placeholder {
+ char *pos;
+ int len;
+ int bindno;
+ int qlen; /* quoted length of value */
+ char *quoted; /* quoted value */
+ int freeq;
+ struct placeholder *next;
+};
+
+PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
+ char **outquery, int *outquery_len TSRMLS_DC)
+{
+ Scanner s;
+ char *ptr, *newbuffer;
+ int t;
+ int bindno = 0;
+ int ret = 0;
+ int newbuffer_len;
+ HashTable *params;
+ struct pdo_bound_param_data *param;
+ int query_type = PDO_PLACEHOLDER_NONE;
+ struct placeholder *placeholders = NULL, *placetail = NULL, *plc = NULL;
+
+ ptr = *outquery;
+ s.cur = inquery;
+ s.lim = inquery + inquery_len;
+
+ /* phase 1: look for args */
+ while((t = scan(&s)) != PDO_PARSER_EOI) {
+ if (t == PDO_PARSER_BIND || t == PDO_PARSER_BIND_POS) {
+ if (t == PDO_PARSER_BIND) {
+ query_type |= PDO_PLACEHOLDER_NAMED;
+ } else {
+ query_type |= PDO_PLACEHOLDER_POSITIONAL;
+ }
+
+ plc = emalloc(sizeof(*plc));
+ memset(plc, 0, sizeof(*plc));
+ plc->next = NULL;
+ plc->pos = s.tok;
+ plc->len = s.cur - s.tok;
+ plc->bindno = bindno++;
+
+ if (placetail) {
+ placetail->next = plc;
+ } else {
+ placeholders = plc;
+ }
+ placetail = plc;
+ }
+ }
+
+ if (bindno == 0) {
+ /* nothing to do; good! */
+ return 0;
+ }
+
+ /* did the query make sense to me? */
+ if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) {
+ /* they mixed both types; punt */
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters" TSRMLS_CC);
+ return -1;
+ }
+
+
+ if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) {
+ /* query matches native syntax */
+ ret = 0;
+ goto clean_up;
+ }
+
+ if (stmt->named_rewrite_template) {
+ /* magic/hack.
+ * We we pretend that the query was positional even if
+ * it was named so that we fall into the
+ * named rewrite case below. Not too pretty,
+ * but it works. */
+ query_type = PDO_PLACEHOLDER_POSITIONAL;
+ }
+
+ params = stmt->bound_params;
+
+ /* Do we have placeholders but no bound params */
+ if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC);
+ ret = -1;
+ goto clean_up;
+ }
+
+ /* what are we going to do ? */
+
+ if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
+ /* query generation */
+
+ newbuffer_len = inquery_len;
+
+ /* let's quote all the values */
+ for (plc = placeholders; plc; plc = plc->next) {
+ if (query_type == PDO_PLACEHOLDER_POSITIONAL) {
+ ret = zend_hash_index_find(params, plc->bindno, (void**) &param);
+ } else {
+ ret = zend_hash_find(params, plc->pos, plc->len, (void**) &param);
+ }
+ if (ret == FAILURE) {
+ /* parameter was not defined */
+ ret = -1;
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ goto clean_up;
+ }
+ if (stmt->dbh->methods->quoter) {
+ if (param->param_type == PDO_PARAM_LOB && Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ php_stream *stm;
+
+ php_stream_from_zval_no_verify(stm, &param->parameter);
+ if (stm) {
+ size_t len;
+ char *buf = NULL;
+
+ len = php_stream_copy_to_mem(stm, &buf, PHP_STREAM_COPY_ALL, 0);
+ if (!stmt->dbh->methods->quoter(stmt->dbh, buf, len, &plc->quoted, &plc->qlen,
+ param->param_type TSRMLS_CC)) {
+ /* bork */
+ ret = -1;
+ strcpy(stmt->error_code, stmt->dbh->error_code);
+ efree(buf);
+ goto clean_up;
+ }
+ efree(buf);
+
+ } else {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ ret = -1;
+ goto clean_up;
+ }
+ plc->freeq = 1;
+ } else {
+ switch (Z_TYPE_P(param->parameter)) {
+ case IS_NULL:
+ plc->quoted = "NULL";
+ plc->qlen = sizeof("NULL")-1;
+ plc->freeq = 0;
+ break;
+
+ case IS_LONG:
+ case IS_DOUBLE:
+ convert_to_string(param->parameter);
+ plc->qlen = Z_STRLEN_P(param->parameter);
+ plc->quoted = Z_STRVAL_P(param->parameter);
+ plc->freeq = 0;
+ break;
+
+ case IS_BOOL:
+ convert_to_long(param->parameter);
+ default:
+ convert_to_string(param->parameter);
+ if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter), &plc->quoted, &plc->qlen,
+ param->param_type TSRMLS_CC)) {
+ /* bork */
+ ret = -1;
+ strcpy(stmt->error_code, stmt->dbh->error_code);
+ goto clean_up;
+ }
+ plc->freeq = 1;
+ }
+ }
+ } else {
+ plc->quoted = Z_STRVAL_P(param->parameter);
+ plc->qlen = Z_STRLEN_P(param->parameter);
+ }
+ newbuffer_len += plc->qlen;
+ }
+
+rewrite:
+ /* allocate output buffer */
+ newbuffer = emalloc(newbuffer_len + 1);
+ *outquery = newbuffer;
+
+ /* and build the query */
+ plc = placeholders;
+ ptr = inquery;
+
+ do {
+ t = plc->pos - ptr;
+ if (t) {
+ memcpy(newbuffer, ptr, t);
+ newbuffer += t;
+ }
+ memcpy(newbuffer, plc->quoted, plc->qlen);
+ newbuffer += plc->qlen;
+ ptr = plc->pos + plc->len;
+
+ plc = plc->next;
+ } while (plc);
+
+ t = (inquery + inquery_len) - ptr;
+ if (t) {
+ memcpy(newbuffer, ptr, t);
+ newbuffer += t;
+ }
+ *newbuffer = '\0';
+ *outquery_len = newbuffer - *outquery;
+
+ ret = 1;
+ goto clean_up;
+
+ } else if (query_type == PDO_PLACEHOLDER_POSITIONAL) {
+ /* rewrite ? to :pdoX */
+ char idxbuf[32];
+ const char *tmpl = stmt->named_rewrite_template ? stmt->named_rewrite_template : ":pdo%d";
+ char *name;
+
+ newbuffer_len = inquery_len;
+
+ if (stmt->bound_param_map == NULL) {
+ ALLOC_HASHTABLE(stmt->bound_param_map);
+ zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0);
+ }
+
+ for (plc = placeholders; plc; plc = plc->next) {
+ snprintf(idxbuf, sizeof(idxbuf), tmpl, plc->bindno + 1);
+ plc->quoted = estrdup(idxbuf);
+ plc->qlen = strlen(plc->quoted);
+ plc->freeq = 1;
+ newbuffer_len += plc->qlen;
+
+ name = estrndup(plc->pos, plc->len);
+
+ if (stmt->named_rewrite_template) {
+ /* create a mapping */
+
+ zend_hash_update(stmt->bound_param_map, name, plc->len + 1, idxbuf, plc->qlen + 1, NULL);
+ }
+
+ /* map number to name */
+ zend_hash_index_update(stmt->bound_param_map, plc->bindno, idxbuf, plc->qlen + 1, NULL);
+
+ efree(name);
+ }
+
+ goto rewrite;
+
+ } else {
+ /* rewrite :name to ? */
+
+ newbuffer_len = inquery_len;
+
+ if (stmt->bound_param_map == NULL) {
+ ALLOC_HASHTABLE(stmt->bound_param_map);
+ zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0);
+ }
+
+ for (plc = placeholders; plc; plc = plc->next) {
+ char *name;
+
+ name = estrndup(plc->pos, plc->len);
+ zend_hash_index_update(stmt->bound_param_map, plc->bindno, name, plc->len + 1, NULL);
+ efree(name);
+ plc->quoted = "?";
+ plc->qlen = 1;
+ }
+
+ goto rewrite;
+ }
+
+clean_up:
+
+ while (placeholders) {
+ plc = placeholders;
+ placeholders = plc->next;
+
+ if (plc->freeq) {
+ efree(plc->quoted);
+ }
+
+ efree(plc);
+ }
+
+ return ret;
+}
+
+#if 0
+int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char **outquery,
+ int *outquery_len TSRMLS_DC)
+{
+ Scanner s;
+ char *ptr;
+ int t;
+ int bindno = 0;
+ int newbuffer_len;
+ int padding;
+ HashTable *params = stmt->bound_params;
+ struct pdo_bound_param_data *param;
+ /* allocate buffer for query with expanded binds, ptr is our writing pointer */
+ newbuffer_len = inquery_len;
+
+ /* calculate the possible padding factor due to quoting */
+ if(stmt->dbh->max_escaped_char_length) {
+ padding = stmt->dbh->max_escaped_char_length;
+ } else {
+ padding = 3;
+ }
+ if(params) {
+ zend_hash_internal_pointer_reset(params);
+ while (SUCCESS == zend_hash_get_current_data(params, (void**)&param)) {
+ if(param->parameter) {
+ convert_to_string(param->parameter);
+ /* accomodate a string that needs to be fully quoted
+ bind placeholders are at least 2 characters, so
+ the accomodate their own "'s
+ */
+ newbuffer_len += padding * Z_STRLEN_P(param->parameter);
+ }
+ zend_hash_move_forward(params);
+ }
+ }
+ *outquery = (char *) emalloc(newbuffer_len + 1);
+ *outquery_len = 0;
+
+ ptr = *outquery;
+ s.cur = inquery;
+ s.lim = inquery + inquery_len;
+ while((t = scan(&s)) != PDO_PARSER_EOI) {
+ if(t == PDO_PARSER_TEXT) {
+ memcpy(ptr, s.tok, s.cur - s.tok);
+ ptr += (s.cur - s.tok);
+ *outquery_len += (s.cur - s.tok);
+ }
+ else if(t == PDO_PARSER_BIND) {
+ if(!params) {
+ /* error */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ /* lookup bind first via hash and then index */
+ /* stupid keys need to be null-terminated, even though we know their length */
+ if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok,(void **)&param))
+ ||
+ (SUCCESS == zend_hash_index_find(params, bindno, (void **)&param)))
+ {
+ char *quotedstr;
+ int quotedstrlen;
+ /* restore the in-string key, doesn't need null-termination here */
+ /* currently everything is a string here */
+
+ /* quote the bind value if necessary */
+ if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ {
+ memcpy(ptr, quotedstr, quotedstrlen);
+ ptr += quotedstrlen;
+ *outquery_len += quotedstrlen;
+ efree(quotedstr);
+ } else {
+ memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter));
+ ptr += Z_STRLEN_P(param->parameter);
+ *outquery_len += (Z_STRLEN_P(param->parameter));
+ }
+ }
+ else {
+ /* error and cleanup */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ bindno++;
+ }
+ else if(t == PDO_PARSER_BIND_POS) {
+ if(!params) {
+ /* error */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ /* lookup bind by index */
+ if(SUCCESS == zend_hash_index_find(params, bindno, (void **)&param))
+ {
+ char *quotedstr;
+ int quotedstrlen;
+ /* currently everything is a string here */
+
+ /* quote the bind value if necessary */
+ if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ {
+ memcpy(ptr, quotedstr, quotedstrlen);
+ ptr += quotedstrlen;
+ *outquery_len += quotedstrlen;
+ efree(quotedstr);
+ } else {
+ memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter));
+ ptr += Z_STRLEN_P(param->parameter);
+ *outquery_len += (Z_STRLEN_P(param->parameter));
+ }
+ }
+ else {
+ /* error and cleanup */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ bindno++;
+ }
+ }
+ *ptr = '\0';
+ return 0;
+}
+#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker ft=c
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo/pdo_sql_parser.c.orig b/ext/pdo/pdo_sql_parser.c.orig
new file mode 100644
index 000000000..b20911698
--- /dev/null
+++ b/ext/pdo/pdo_sql_parser.c.orig
@@ -0,0 +1,712 @@
+/* Generated by re2c 0.9.9.rc1 on Sat Sep 10 15:53:03 2005 */
+#line 1 "ext/pdo/pdo_sql_parser.re"
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: George Schlossnagle <george@omniti.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_sql_parser.c,v 1.35.2.2 2005/09/10 20:58:57 wez Exp $ */
+
+#include "php.h"
+#include "php_pdo_driver.h"
+#include "php_pdo_int.h"
+
+#define PDO_PARSER_TEXT 1
+#define PDO_PARSER_BIND 2
+#define PDO_PARSER_BIND_POS 3
+#define PDO_PARSER_EOI 4
+
+#define RET(i) {s->cur = cursor; return i; }
+
+#define YYCTYPE char
+#define YYCURSOR cursor
+#define YYLIMIT s->lim
+#define YYMARKER s->ptr
+#define YYFILL(n)
+
+typedef struct Scanner {
+ char *lim, *ptr, *cur, *tok;
+} Scanner;
+
+static int scan(Scanner *s)
+{
+ char *cursor = s->cur;
+
+ s->tok = cursor;
+ #line 55 "ext/pdo/pdo_sql_parser.re"
+
+
+ {
+ static unsigned char yybm[] = {
+ 0, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 52, 162, 162, 162, 162, 196,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 244, 162, 162, 162, 162, 244,
+ 162, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 162, 2, 162, 162, 170,
+ 162, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ };
+
+#line 89 "<stdout>"
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ goto yy0;
+ ++YYCURSOR;
+yy0:
+ if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+ if(yybm[0+yych] & 2) {
+ goto yy8;
+ }
+ if(yych <= 0x00) goto yy11;
+ if(yych <= '&') goto yy2;
+ if(yych <= '\'') goto yy4;
+ if(yych <= '>') goto yy5;
+ goto yy6;
+yy2: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 64) {
+ goto yy30;
+ }
+ if(yych <= 0x00) goto yy3;
+ if(yych == '"') goto yy28;
+ goto yy33;
+yy3:
+#line 63 "ext/pdo/pdo_sql_parser.re"
+{ RET(PDO_PARSER_TEXT); }
+#line 117 "<stdout>"
+yy4: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 16) {
+ goto yy19;
+ }
+ if(yych <= 0x00) goto yy3;
+ if(yych == '\'') goto yy21;
+ goto yy24;
+yy5: yych = *++YYCURSOR;
+ if(yybm[0+yych] & 4) {
+ goto yy13;
+ }
+ if(yych <= 'Z'){
+ if(yych <= '/') goto yy3;
+ if(yych <= ':') goto yy16;
+ if(yych <= '@') goto yy3;
+ goto yy16;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy3;
+ goto yy16;
+ } else {
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy16;
+ goto yy3;
+ }
+ }
+yy6: ++YYCURSOR;
+ if(yybm[0+(yych = *YYCURSOR)] & 4) {
+ yych = *YYCURSOR;
+ goto yy13;
+ }
+ goto yy7;
+yy7:
+#line 62 "ext/pdo/pdo_sql_parser.re"
+{ RET(PDO_PARSER_BIND_POS); }
+#line 154 "<stdout>"
+yy8: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy9;
+yy9: if(yybm[0+yych] & 2) {
+ goto yy8;
+ }
+ goto yy10;
+yy10:
+#line 64 "ext/pdo/pdo_sql_parser.re"
+{ RET(PDO_PARSER_TEXT); }
+#line 166 "<stdout>"
+yy11: ++YYCURSOR;
+ goto yy12;
+yy12:
+#line 65 "ext/pdo/pdo_sql_parser.re"
+{ RET(PDO_PARSER_EOI); }
+#line 172 "<stdout>"
+yy13: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy14;
+yy14: if(yybm[0+yych] & 4) {
+ goto yy13;
+ }
+ goto yy15;
+yy15:
+#line 60 "ext/pdo/pdo_sql_parser.re"
+{ RET(PDO_PARSER_TEXT); }
+#line 184 "<stdout>"
+yy16: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy17;
+yy17: if(yybm[0+yych] & 8) {
+ goto yy16;
+ }
+ goto yy18;
+yy18:
+#line 61 "ext/pdo/pdo_sql_parser.re"
+{ RET(PDO_PARSER_BIND); }
+#line 196 "<stdout>"
+yy19: yyaccept = 1;
+ YYMARKER = ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ goto yy20;
+yy20: if(yybm[0+yych] & 16) {
+ goto yy19;
+ }
+ if(yych <= '\''){
+ if(yych <= 0x00) goto yy15;
+ if(yych <= '&') goto yy23;
+ goto yy21;
+ } else {
+ if(yych == '\\') goto yy26;
+ goto yy23;
+ }
+yy21: ++YYCURSOR;
+ if(yybm[0+(yych = *YYCURSOR)] & 4) {
+ yych = *YYCURSOR;
+ goto yy13;
+ }
+ goto yy22;
+yy22:
+#line 59 "ext/pdo/pdo_sql_parser.re"
+{ RET(PDO_PARSER_TEXT); }
+#line 222 "<stdout>"
+yy23: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy24;
+yy24: if(yybm[0+yych] & 32) {
+ goto yy23;
+ }
+ if(yych <= 0x00) goto yy25;
+ if(yych <= '[') goto yy27;
+ goto yy26;
+yy25: YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 1: goto yy15;
+ case 0: goto yy3;
+ }
+yy26: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == '\'') goto yy23;
+ goto yy25;
+yy27: yych = *++YYCURSOR;
+ goto yy22;
+yy28: ++YYCURSOR;
+ if(yybm[0+(yych = *YYCURSOR)] & 4) {
+ yych = *YYCURSOR;
+ goto yy13;
+ }
+ goto yy29;
+yy29:
+#line 58 "ext/pdo/pdo_sql_parser.re"
+{ RET(PDO_PARSER_TEXT); }
+#line 254 "<stdout>"
+yy30: yyaccept = 1;
+ YYMARKER = ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ goto yy31;
+yy31: if(yybm[0+yych] & 64) {
+ goto yy30;
+ }
+ if(yych <= '"'){
+ if(yych <= 0x00) goto yy15;
+ if(yych >= '"') goto yy28;
+ goto yy32;
+ } else {
+ if(yych == '\\') goto yy34;
+ goto yy32;
+ }
+yy32: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy33;
+yy33: if(yybm[0+yych] & 128) {
+ goto yy32;
+ }
+ if(yych <= 0x00) goto yy25;
+ if(yych <= '[') goto yy35;
+ goto yy34;
+yy34: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych == '"') goto yy32;
+ goto yy25;
+yy35: ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy29;
+}
+}
+#line 66 "ext/pdo/pdo_sql_parser.re"
+
+}
+
+struct placeholder {
+ char *pos;
+ int len;
+ int bindno;
+ int qlen; /* quoted length of value */
+ char *quoted; /* quoted value */
+ int freeq;
+ struct placeholder *next;
+};
+
+PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
+ char **outquery, int *outquery_len TSRMLS_DC)
+{
+ Scanner s;
+ char *ptr, *newbuffer;
+ int t;
+ int bindno = 0;
+ int ret = 0;
+ int newbuffer_len;
+ HashTable *params;
+ struct pdo_bound_param_data *param;
+ int query_type = PDO_PLACEHOLDER_NONE;
+ struct placeholder *placeholders = NULL, *placetail = NULL, *plc = NULL;
+
+ ptr = *outquery;
+ s.cur = inquery;
+ s.lim = inquery + inquery_len;
+
+ /* phase 1: look for args */
+ while((t = scan(&s)) != PDO_PARSER_EOI) {
+ if (t == PDO_PARSER_BIND || t == PDO_PARSER_BIND_POS) {
+ if (t == PDO_PARSER_BIND) {
+ query_type |= PDO_PLACEHOLDER_NAMED;
+ } else {
+ query_type |= PDO_PLACEHOLDER_POSITIONAL;
+ }
+
+ plc = emalloc(sizeof(*plc));
+ memset(plc, 0, sizeof(*plc));
+ plc->next = NULL;
+ plc->pos = s.tok;
+ plc->len = s.cur - s.tok;
+ plc->bindno = bindno++;
+
+ if (placetail) {
+ placetail->next = plc;
+ } else {
+ placeholders = plc;
+ }
+ placetail = plc;
+ }
+ }
+
+ if (bindno == 0) {
+ /* nothing to do; good! */
+ return 0;
+ }
+
+ /* did the query make sense to me? */
+ if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) {
+ /* they mixed both types; punt */
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters" TSRMLS_CC);
+ return -1;
+ }
+
+
+ if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) {
+ /* query matches native syntax */
+ ret = 0;
+ goto clean_up;
+ }
+
+ if (stmt->named_rewrite_template) {
+ /* magic/hack.
+ * We we pretend that the query was positional even if
+ * it was named so that we fall into the
+ * named rewrite case below. Not too pretty,
+ * but it works. */
+ query_type = PDO_PLACEHOLDER_POSITIONAL;
+ }
+
+ params = stmt->bound_params;
+
+ /* Do we have placeholders but no bound params */
+ if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC);
+ ret = -1;
+ goto clean_up;
+ }
+
+ /* what are we going to do ? */
+
+ if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
+ /* query generation */
+
+ newbuffer_len = inquery_len;
+
+ /* let's quote all the values */
+ for (plc = placeholders; plc; plc = plc->next) {
+ if (query_type == PDO_PLACEHOLDER_POSITIONAL) {
+ ret = zend_hash_index_find(params, plc->bindno, (void**) &param);
+ } else {
+ ret = zend_hash_find(params, plc->pos, plc->len, (void**) &param);
+ }
+ if (ret == FAILURE) {
+ /* parameter was not defined */
+ ret = -1;
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ goto clean_up;
+ }
+ if (stmt->dbh->methods->quoter) {
+ if (param->param_type == PDO_PARAM_LOB && Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ php_stream *stm;
+
+ php_stream_from_zval_no_verify(stm, &param->parameter);
+ if (stm) {
+ size_t len;
+ char *buf = NULL;
+
+ len = php_stream_copy_to_mem(stm, &buf, PHP_STREAM_COPY_ALL, 0);
+ if (!stmt->dbh->methods->quoter(stmt->dbh, buf, len, &plc->quoted, &plc->qlen,
+ param->param_type TSRMLS_CC)) {
+ /* bork */
+ ret = -1;
+ strcpy(stmt->error_code, stmt->dbh->error_code);
+ efree(buf);
+ goto clean_up;
+ }
+ efree(buf);
+
+ } else {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ ret = -1;
+ goto clean_up;
+ }
+ plc->freeq = 1;
+ } else {
+ switch (Z_TYPE_P(param->parameter)) {
+ case IS_NULL:
+ plc->quoted = "NULL";
+ plc->qlen = sizeof("NULL")-1;
+ plc->freeq = 0;
+ break;
+
+ case IS_LONG:
+ case IS_DOUBLE:
+ convert_to_string(param->parameter);
+ plc->qlen = Z_STRLEN_P(param->parameter);
+ plc->quoted = Z_STRVAL_P(param->parameter);
+ plc->freeq = 0;
+ break;
+
+ case IS_BOOL:
+ convert_to_long(param->parameter);
+ default:
+ convert_to_string(param->parameter);
+ if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter), &plc->quoted, &plc->qlen,
+ param->param_type TSRMLS_CC)) {
+ /* bork */
+ ret = -1;
+ strcpy(stmt->error_code, stmt->dbh->error_code);
+ goto clean_up;
+ }
+ plc->freeq = 1;
+ }
+ }
+ } else {
+ plc->quoted = Z_STRVAL_P(param->parameter);
+ plc->qlen = Z_STRLEN_P(param->parameter);
+ }
+ newbuffer_len += plc->qlen;
+ }
+
+rewrite:
+ /* allocate output buffer */
+ newbuffer = emalloc(newbuffer_len + 1);
+ *outquery = newbuffer;
+
+ /* and build the query */
+ plc = placeholders;
+ ptr = inquery;
+
+ do {
+ t = plc->pos - ptr;
+ if (t) {
+ memcpy(newbuffer, ptr, t);
+ newbuffer += t;
+ }
+ memcpy(newbuffer, plc->quoted, plc->qlen);
+ newbuffer += plc->qlen;
+ ptr = plc->pos + plc->len;
+
+ plc = plc->next;
+ } while (plc);
+
+ t = (inquery + inquery_len) - ptr;
+ if (t) {
+ memcpy(newbuffer, ptr, t);
+ newbuffer += t;
+ }
+ *newbuffer = '\0';
+ *outquery_len = newbuffer - *outquery;
+
+ ret = 1;
+ goto clean_up;
+
+ } else if (query_type == PDO_PLACEHOLDER_POSITIONAL) {
+ /* rewrite ? to :pdoX */
+ char idxbuf[32];
+ const char *tmpl = stmt->named_rewrite_template ? stmt->named_rewrite_template : ":pdo%d";
+ char *name;
+
+ newbuffer_len = inquery_len;
+
+ if (stmt->bound_param_map == NULL) {
+ ALLOC_HASHTABLE(stmt->bound_param_map);
+ zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0);
+ }
+
+ for (plc = placeholders; plc; plc = plc->next) {
+ snprintf(idxbuf, sizeof(idxbuf), tmpl, plc->bindno + 1);
+ plc->quoted = estrdup(idxbuf);
+ plc->qlen = strlen(plc->quoted);
+ plc->freeq = 1;
+ newbuffer_len += plc->qlen;
+
+ name = estrndup(plc->pos, plc->len);
+
+ if (stmt->named_rewrite_template) {
+ /* create a mapping */
+
+ zend_hash_update(stmt->bound_param_map, name, plc->len + 1, idxbuf, plc->qlen + 1, NULL);
+ }
+
+ /* map number to name */
+ zend_hash_index_update(stmt->bound_param_map, plc->bindno, idxbuf, plc->qlen + 1, NULL);
+
+ efree(name);
+ }
+
+ goto rewrite;
+
+ } else {
+ /* rewrite :name to ? */
+
+ newbuffer_len = inquery_len;
+
+ if (stmt->bound_param_map == NULL) {
+ ALLOC_HASHTABLE(stmt->bound_param_map);
+ zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0);
+ }
+
+ for (plc = placeholders; plc; plc = plc->next) {
+ char *name;
+
+ name = estrndup(plc->pos, plc->len);
+ zend_hash_index_update(stmt->bound_param_map, plc->bindno, name, plc->len + 1, NULL);
+ efree(name);
+ plc->quoted = "?";
+ plc->qlen = 1;
+ }
+
+ goto rewrite;
+ }
+
+clean_up:
+
+ while (placeholders) {
+ plc = placeholders;
+ placeholders = plc->next;
+
+ if (plc->freeq) {
+ efree(plc->quoted);
+ }
+
+ efree(plc);
+ }
+
+ return ret;
+}
+
+#if 0
+int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char **outquery,
+ int *outquery_len TSRMLS_DC)
+{
+ Scanner s;
+ char *ptr;
+ int t;
+ int bindno = 0;
+ int newbuffer_len;
+ int padding;
+ HashTable *params = stmt->bound_params;
+ struct pdo_bound_param_data *param;
+ /* allocate buffer for query with expanded binds, ptr is our writing pointer */
+ newbuffer_len = inquery_len;
+
+ /* calculate the possible padding factor due to quoting */
+ if(stmt->dbh->max_escaped_char_length) {
+ padding = stmt->dbh->max_escaped_char_length;
+ } else {
+ padding = 3;
+ }
+ if(params) {
+ zend_hash_internal_pointer_reset(params);
+ while (SUCCESS == zend_hash_get_current_data(params, (void**)&param)) {
+ if(param->parameter) {
+ convert_to_string(param->parameter);
+ /* accomodate a string that needs to be fully quoted
+ bind placeholders are at least 2 characters, so
+ the accomodate their own "'s
+ */
+ newbuffer_len += padding * Z_STRLEN_P(param->parameter);
+ }
+ zend_hash_move_forward(params);
+ }
+ }
+ *outquery = (char *) emalloc(newbuffer_len + 1);
+ *outquery_len = 0;
+
+ ptr = *outquery;
+ s.cur = inquery;
+ s.lim = inquery + inquery_len;
+ while((t = scan(&s)) != PDO_PARSER_EOI) {
+ if(t == PDO_PARSER_TEXT) {
+ memcpy(ptr, s.tok, s.cur - s.tok);
+ ptr += (s.cur - s.tok);
+ *outquery_len += (s.cur - s.tok);
+ }
+ else if(t == PDO_PARSER_BIND) {
+ if(!params) {
+ /* error */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ /* lookup bind first via hash and then index */
+ /* stupid keys need to be null-terminated, even though we know their length */
+ if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok,(void **)&param))
+ ||
+ (SUCCESS == zend_hash_index_find(params, bindno, (void **)&param)))
+ {
+ char *quotedstr;
+ int quotedstrlen;
+ /* restore the in-string key, doesn't need null-termination here */
+ /* currently everything is a string here */
+
+ /* quote the bind value if necessary */
+ if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ {
+ memcpy(ptr, quotedstr, quotedstrlen);
+ ptr += quotedstrlen;
+ *outquery_len += quotedstrlen;
+ efree(quotedstr);
+ } else {
+ memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter));
+ ptr += Z_STRLEN_P(param->parameter);
+ *outquery_len += (Z_STRLEN_P(param->parameter));
+ }
+ }
+ else {
+ /* error and cleanup */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ bindno++;
+ }
+ else if(t == PDO_PARSER_BIND_POS) {
+ if(!params) {
+ /* error */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ /* lookup bind by index */
+ if(SUCCESS == zend_hash_index_find(params, bindno, (void **)&param))
+ {
+ char *quotedstr;
+ int quotedstrlen;
+ /* currently everything is a string here */
+
+ /* quote the bind value if necessary */
+ if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ {
+ memcpy(ptr, quotedstr, quotedstrlen);
+ ptr += quotedstrlen;
+ *outquery_len += quotedstrlen;
+ efree(quotedstr);
+ } else {
+ memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter));
+ ptr += Z_STRLEN_P(param->parameter);
+ *outquery_len += (Z_STRLEN_P(param->parameter));
+ }
+ }
+ else {
+ /* error and cleanup */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ bindno++;
+ }
+ }
+ *ptr = '\0';
+ return 0;
+}
+#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker ft=c
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re
new file mode 100644
index 000000000..6e9d21f17
--- /dev/null
+++ b/ext/pdo/pdo_sql_parser.re
@@ -0,0 +1,487 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: George Schlossnagle <george@omniti.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_sql_parser.re,v 1.28.2.2 2005/09/10 20:58:19 wez Exp $ */
+
+#include "php.h"
+#include "php_pdo_driver.h"
+#include "php_pdo_int.h"
+
+#define PDO_PARSER_TEXT 1
+#define PDO_PARSER_BIND 2
+#define PDO_PARSER_BIND_POS 3
+#define PDO_PARSER_EOI 4
+
+#define RET(i) {s->cur = cursor; return i; }
+
+#define YYCTYPE char
+#define YYCURSOR cursor
+#define YYLIMIT s->lim
+#define YYMARKER s->ptr
+#define YYFILL(n)
+
+typedef struct Scanner {
+ char *lim, *ptr, *cur, *tok;
+} Scanner;
+
+static int scan(Scanner *s)
+{
+ char *cursor = s->cur;
+
+ s->tok = cursor;
+ /*!re2c
+ BINDCHR = [:][a-zA-Z0-9_]+;
+ QUESTION = [?];
+ SPECIALS = [:?"'];
+ ESCQQ = [\\]["];
+ ESCQ = [\\]['];
+ EOF = [\000];
+ ANYNOEOF = [\001-\377];
+ */
+
+ /*!re2c
+ (["] (ESCQQ|ANYNOEOF\[\\"])* ["]) { RET(PDO_PARSER_TEXT); }
+ (['] (ESCQ|ANYNOEOF\[\\'])* [']) { RET(PDO_PARSER_TEXT); }
+ SPECIALS{2,} { RET(PDO_PARSER_TEXT); }
+ BINDCHR { RET(PDO_PARSER_BIND); }
+ QUESTION { RET(PDO_PARSER_BIND_POS); }
+ SPECIALS { RET(PDO_PARSER_TEXT); }
+ (ANYNOEOF\SPECIALS)+ { RET(PDO_PARSER_TEXT); }
+ EOF { RET(PDO_PARSER_EOI); }
+ */
+}
+
+struct placeholder {
+ char *pos;
+ int len;
+ int bindno;
+ int qlen; /* quoted length of value */
+ char *quoted; /* quoted value */
+ int freeq;
+ struct placeholder *next;
+};
+
+PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
+ char **outquery, int *outquery_len TSRMLS_DC)
+{
+ Scanner s;
+ char *ptr, *newbuffer;
+ int t;
+ int bindno = 0;
+ int ret = 0;
+ int newbuffer_len;
+ HashTable *params;
+ struct pdo_bound_param_data *param;
+ int query_type = PDO_PLACEHOLDER_NONE;
+ struct placeholder *placeholders = NULL, *placetail = NULL, *plc = NULL;
+
+ ptr = *outquery;
+ s.cur = inquery;
+ s.lim = inquery + inquery_len;
+
+ /* phase 1: look for args */
+ while((t = scan(&s)) != PDO_PARSER_EOI) {
+ if (t == PDO_PARSER_BIND || t == PDO_PARSER_BIND_POS) {
+ if (t == PDO_PARSER_BIND) {
+ query_type |= PDO_PLACEHOLDER_NAMED;
+ } else {
+ query_type |= PDO_PLACEHOLDER_POSITIONAL;
+ }
+
+ plc = emalloc(sizeof(*plc));
+ memset(plc, 0, sizeof(*plc));
+ plc->next = NULL;
+ plc->pos = s.tok;
+ plc->len = s.cur - s.tok;
+ plc->bindno = bindno++;
+
+ if (placetail) {
+ placetail->next = plc;
+ } else {
+ placeholders = plc;
+ }
+ placetail = plc;
+ }
+ }
+
+ if (bindno == 0) {
+ /* nothing to do; good! */
+ return 0;
+ }
+
+ /* did the query make sense to me? */
+ if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) {
+ /* they mixed both types; punt */
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters" TSRMLS_CC);
+ return -1;
+ }
+
+
+ if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) {
+ /* query matches native syntax */
+ ret = 0;
+ goto clean_up;
+ }
+
+ if (stmt->named_rewrite_template) {
+ /* magic/hack.
+ * We we pretend that the query was positional even if
+ * it was named so that we fall into the
+ * named rewrite case below. Not too pretty,
+ * but it works. */
+ query_type = PDO_PLACEHOLDER_POSITIONAL;
+ }
+
+ params = stmt->bound_params;
+
+ /* Do we have placeholders but no bound params */
+ if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC);
+ ret = -1;
+ goto clean_up;
+ }
+
+ /* what are we going to do ? */
+
+ if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
+ /* query generation */
+
+ newbuffer_len = inquery_len;
+
+ /* let's quote all the values */
+ for (plc = placeholders; plc; plc = plc->next) {
+ if (query_type == PDO_PLACEHOLDER_POSITIONAL) {
+ ret = zend_hash_index_find(params, plc->bindno, (void**) &param);
+ } else {
+ ret = zend_hash_find(params, plc->pos, plc->len, (void**) &param);
+ }
+ if (ret == FAILURE) {
+ /* parameter was not defined */
+ ret = -1;
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ goto clean_up;
+ }
+ if (stmt->dbh->methods->quoter) {
+ if (param->param_type == PDO_PARAM_LOB && Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ php_stream *stm;
+
+ php_stream_from_zval_no_verify(stm, &param->parameter);
+ if (stm) {
+ size_t len;
+ char *buf = NULL;
+
+ len = php_stream_copy_to_mem(stm, &buf, PHP_STREAM_COPY_ALL, 0);
+ if (!stmt->dbh->methods->quoter(stmt->dbh, buf, len, &plc->quoted, &plc->qlen,
+ param->param_type TSRMLS_CC)) {
+ /* bork */
+ ret = -1;
+ strcpy(stmt->error_code, stmt->dbh->error_code);
+ efree(buf);
+ goto clean_up;
+ }
+ efree(buf);
+
+ } else {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ ret = -1;
+ goto clean_up;
+ }
+ plc->freeq = 1;
+ } else {
+ switch (Z_TYPE_P(param->parameter)) {
+ case IS_NULL:
+ plc->quoted = "NULL";
+ plc->qlen = sizeof("NULL")-1;
+ plc->freeq = 0;
+ break;
+
+ case IS_LONG:
+ case IS_DOUBLE:
+ convert_to_string(param->parameter);
+ plc->qlen = Z_STRLEN_P(param->parameter);
+ plc->quoted = Z_STRVAL_P(param->parameter);
+ plc->freeq = 0;
+ break;
+
+ case IS_BOOL:
+ convert_to_long(param->parameter);
+ default:
+ convert_to_string(param->parameter);
+ if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter), &plc->quoted, &plc->qlen,
+ param->param_type TSRMLS_CC)) {
+ /* bork */
+ ret = -1;
+ strcpy(stmt->error_code, stmt->dbh->error_code);
+ goto clean_up;
+ }
+ plc->freeq = 1;
+ }
+ }
+ } else {
+ plc->quoted = Z_STRVAL_P(param->parameter);
+ plc->qlen = Z_STRLEN_P(param->parameter);
+ }
+ newbuffer_len += plc->qlen;
+ }
+
+rewrite:
+ /* allocate output buffer */
+ newbuffer = emalloc(newbuffer_len + 1);
+ *outquery = newbuffer;
+
+ /* and build the query */
+ plc = placeholders;
+ ptr = inquery;
+
+ do {
+ t = plc->pos - ptr;
+ if (t) {
+ memcpy(newbuffer, ptr, t);
+ newbuffer += t;
+ }
+ memcpy(newbuffer, plc->quoted, plc->qlen);
+ newbuffer += plc->qlen;
+ ptr = plc->pos + plc->len;
+
+ plc = plc->next;
+ } while (plc);
+
+ t = (inquery + inquery_len) - ptr;
+ if (t) {
+ memcpy(newbuffer, ptr, t);
+ newbuffer += t;
+ }
+ *newbuffer = '\0';
+ *outquery_len = newbuffer - *outquery;
+
+ ret = 1;
+ goto clean_up;
+
+ } else if (query_type == PDO_PLACEHOLDER_POSITIONAL) {
+ /* rewrite ? to :pdoX */
+ char idxbuf[32];
+ const char *tmpl = stmt->named_rewrite_template ? stmt->named_rewrite_template : ":pdo%d";
+ char *name;
+
+ newbuffer_len = inquery_len;
+
+ if (stmt->bound_param_map == NULL) {
+ ALLOC_HASHTABLE(stmt->bound_param_map);
+ zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0);
+ }
+
+ for (plc = placeholders; plc; plc = plc->next) {
+ snprintf(idxbuf, sizeof(idxbuf), tmpl, plc->bindno + 1);
+ plc->quoted = estrdup(idxbuf);
+ plc->qlen = strlen(plc->quoted);
+ plc->freeq = 1;
+ newbuffer_len += plc->qlen;
+
+ name = estrndup(plc->pos, plc->len);
+
+ if (stmt->named_rewrite_template) {
+ /* create a mapping */
+
+ zend_hash_update(stmt->bound_param_map, name, plc->len + 1, idxbuf, plc->qlen + 1, NULL);
+ }
+
+ /* map number to name */
+ zend_hash_index_update(stmt->bound_param_map, plc->bindno, idxbuf, plc->qlen + 1, NULL);
+
+ efree(name);
+ }
+
+ goto rewrite;
+
+ } else {
+ /* rewrite :name to ? */
+
+ newbuffer_len = inquery_len;
+
+ if (stmt->bound_param_map == NULL) {
+ ALLOC_HASHTABLE(stmt->bound_param_map);
+ zend_hash_init(stmt->bound_param_map, 13, NULL, NULL, 0);
+ }
+
+ for (plc = placeholders; plc; plc = plc->next) {
+ char *name;
+
+ name = estrndup(plc->pos, plc->len);
+ zend_hash_index_update(stmt->bound_param_map, plc->bindno, name, plc->len + 1, NULL);
+ efree(name);
+ plc->quoted = "?";
+ plc->qlen = 1;
+ }
+
+ goto rewrite;
+ }
+
+clean_up:
+
+ while (placeholders) {
+ plc = placeholders;
+ placeholders = plc->next;
+
+ if (plc->freeq) {
+ efree(plc->quoted);
+ }
+
+ efree(plc);
+ }
+
+ return ret;
+}
+
+#if 0
+int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char **outquery,
+ int *outquery_len TSRMLS_DC)
+{
+ Scanner s;
+ char *ptr;
+ int t;
+ int bindno = 0;
+ int newbuffer_len;
+ int padding;
+ HashTable *params = stmt->bound_params;
+ struct pdo_bound_param_data *param;
+ /* allocate buffer for query with expanded binds, ptr is our writing pointer */
+ newbuffer_len = inquery_len;
+
+ /* calculate the possible padding factor due to quoting */
+ if(stmt->dbh->max_escaped_char_length) {
+ padding = stmt->dbh->max_escaped_char_length;
+ } else {
+ padding = 3;
+ }
+ if(params) {
+ zend_hash_internal_pointer_reset(params);
+ while (SUCCESS == zend_hash_get_current_data(params, (void**)&param)) {
+ if(param->parameter) {
+ convert_to_string(param->parameter);
+ /* accomodate a string that needs to be fully quoted
+ bind placeholders are at least 2 characters, so
+ the accomodate their own "'s
+ */
+ newbuffer_len += padding * Z_STRLEN_P(param->parameter);
+ }
+ zend_hash_move_forward(params);
+ }
+ }
+ *outquery = (char *) emalloc(newbuffer_len + 1);
+ *outquery_len = 0;
+
+ ptr = *outquery;
+ s.cur = inquery;
+ s.lim = inquery + inquery_len;
+ while((t = scan(&s)) != PDO_PARSER_EOI) {
+ if(t == PDO_PARSER_TEXT) {
+ memcpy(ptr, s.tok, s.cur - s.tok);
+ ptr += (s.cur - s.tok);
+ *outquery_len += (s.cur - s.tok);
+ }
+ else if(t == PDO_PARSER_BIND) {
+ if(!params) {
+ /* error */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ /* lookup bind first via hash and then index */
+ /* stupid keys need to be null-terminated, even though we know their length */
+ if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok,(void **)&param))
+ ||
+ (SUCCESS == zend_hash_index_find(params, bindno, (void **)&param)))
+ {
+ char *quotedstr;
+ int quotedstrlen;
+ /* restore the in-string key, doesn't need null-termination here */
+ /* currently everything is a string here */
+
+ /* quote the bind value if necessary */
+ if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ {
+ memcpy(ptr, quotedstr, quotedstrlen);
+ ptr += quotedstrlen;
+ *outquery_len += quotedstrlen;
+ efree(quotedstr);
+ } else {
+ memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter));
+ ptr += Z_STRLEN_P(param->parameter);
+ *outquery_len += (Z_STRLEN_P(param->parameter));
+ }
+ }
+ else {
+ /* error and cleanup */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ bindno++;
+ }
+ else if(t == PDO_PARSER_BIND_POS) {
+ if(!params) {
+ /* error */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ /* lookup bind by index */
+ if(SUCCESS == zend_hash_index_find(params, bindno, (void **)&param))
+ {
+ char *quotedstr;
+ int quotedstrlen;
+ /* currently everything is a string here */
+
+ /* quote the bind value if necessary */
+ if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ {
+ memcpy(ptr, quotedstr, quotedstrlen);
+ ptr += quotedstrlen;
+ *outquery_len += quotedstrlen;
+ efree(quotedstr);
+ } else {
+ memcpy(ptr, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter));
+ ptr += Z_STRLEN_P(param->parameter);
+ *outquery_len += (Z_STRLEN_P(param->parameter));
+ }
+ }
+ else {
+ /* error and cleanup */
+ efree(*outquery);
+ *outquery = NULL;
+ return (int) (s.cur - inquery);
+ }
+ bindno++;
+ }
+ }
+ *ptr = '\0';
+ return 0;
+}
+#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker ft=c
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo/pdo_sqlstate.c b/ext/pdo/pdo_sqlstate.c
new file mode 100644
index 000000000..8b833c5b6
--- /dev/null
+++ b/ext/pdo/pdo_sqlstate.c
@@ -0,0 +1,340 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_sqlstate.c,v 1.7 2005/07/01 23:32:39 edink Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_pdo.h"
+#include "php_pdo_driver.h"
+
+struct pdo_sqlstate_info {
+ char state[6];
+ const char *desc;
+};
+
+static HashTable err_hash;
+
+static struct pdo_sqlstate_info err_initializer[] = {
+ { "00000", "No error" },
+ { "01000", "Warning" },
+ { "01001", "Cursor operation conflict" },
+ { "01002", "Disconnect error" },
+ { "01003", "NULL value eliminated in set function" },
+ { "01004", "String data, right truncated" },
+ { "01006", "Privilege not revoked" },
+ { "01007", "Privilege not granted" },
+ { "01008", "Implicit zero bit padding" },
+ { "0100C", "Dynamic result sets returned" },
+ { "01P01", "Deprecated feature" },
+ { "01S00", "Invalid connection string attribute" },
+ { "01S01", "Error in row" },
+ { "01S02", "Option value changed" },
+ { "01S06", "Attempt to fetch before the result set returned the first rowset" },
+ { "01S07", "Fractional truncation" },
+ { "01S08", "Error saving File DSN" },
+ { "01S09", "Invalid keyword" },
+ { "02000", "No data" },
+ { "02001", "No additional dynamic result sets returned" },
+ { "03000", "Sql statement not yet complete" },
+ { "07002", "COUNT field incorrect" },
+ { "07005", "Prepared statement not a cursor-specification" },
+ { "07006", "Restricted data type attribute violation" },
+ { "07009", "Invalid descriptor index" },
+ { "07S01", "Invalid use of default parameter" },
+ { "08000", "Connection exception" },
+ { "08001", "Client unable to establish connection" },
+ { "08002", "Connection name in use" },
+ { "08003", "Connection does not exist" },
+ { "08004", "Server rejected the connection" },
+ { "08006", "Connection failure" },
+ { "08007", "Connection failure during transaction" },
+ { "08S01", "Communication link failure" },
+ { "09000", "Triggered action exception" },
+ { "0A000", "Feature not supported" },
+ { "0B000", "Invalid transaction initiation" },
+ { "0F000", "Locator exception" },
+ { "0F001", "Invalid locator specification" },
+ { "0L000", "Invalid grantor" },
+ { "0LP01", "Invalid grant operation" },
+ { "0P000", "Invalid role specification" },
+ { "21000", "Cardinality violation" },
+ { "21S01", "Insert value list does not match column list" },
+ { "21S02", "Degree of derived table does not match column list" },
+ { "22000", "Data exception" },
+ { "22001", "String data, right truncated" },
+ { "22002", "Indicator variable required but not supplied" },
+ { "22003", "Numeric value out of range" },
+ { "22004", "Null value not allowed" },
+ { "22005", "Error in assignment" },
+ { "22007", "Invalid datetime format" },
+ { "22008", "Datetime field overflow" },
+ { "22009", "Invalid time zone displacement value" },
+ { "2200B", "Escape character conflict" },
+ { "2200C", "Invalid use of escape character" },
+ { "2200D", "Invalid escape octet" },
+ { "2200F", "Zero length character string" },
+ { "2200G", "Most specific type mismatch" },
+ { "22010", "Invalid indicator parameter value" },
+ { "22011", "Substring error" },
+ { "22012", "Division by zero" },
+ { "22015", "Interval field overflow" },
+ { "22018", "Invalid character value for cast specification" },
+ { "22019", "Invalid escape character" },
+ { "2201B", "Invalid regular expression" },
+ { "2201E", "Invalid argument for logarithm" },
+ { "2201F", "Invalid argument for power function" },
+ { "2201G", "Invalid argument for width bucket function" },
+ { "22020", "Invalid limit value" },
+ { "22021", "Character not in repertoire" },
+ { "22022", "Indicator overflow" },
+ { "22023", "Invalid parameter value" },
+ { "22024", "Unterminated c string" },
+ { "22025", "Invalid escape sequence" },
+ { "22026", "String data, length mismatch" },
+ { "22027", "Trim error" },
+ { "2202E", "Array subscript error" },
+ { "22P01", "Floating point exception" },
+ { "22P02", "Invalid text representation" },
+ { "22P03", "Invalid binary representation" },
+ { "22P04", "Bad copy file format" },
+ { "22P05", "Untranslatable character" },
+ { "23000", "Integrity constraint violation" },
+ { "23001", "Restrict violation" },
+ { "23502", "Not null violation" },
+ { "23503", "Foreign key violation" },
+ { "23505", "Unique violation" },
+ { "23514", "Check violation" },
+ { "24000", "Invalid cursor state" },
+ { "25000", "Invalid transaction state" },
+ { "25001", "Active sql transaction" },
+ { "25002", "Branch transaction already active" },
+ { "25003", "Inappropriate access mode for branch transaction" },
+ { "25004", "Inappropriate isolation level for branch transaction" },
+ { "25005", "No active sql transaction for branch transaction" },
+ { "25006", "Read only sql transaction" },
+ { "25007", "Schema and data statement mixing not supported" },
+ { "25008", "Held cursor requires same isolation level" },
+ { "25P01", "No active sql transaction" },
+ { "25P02", "In failed sql transaction" },
+ { "25S01", "Transaction state" },
+ { "25S02", "Transaction is still active" },
+ { "25S03", "Transaction is rolled back" },
+ { "26000", "Invalid sql statement name" },
+ { "27000", "Triggered data change violation" },
+ { "28000", "Invalid authorization specification" },
+ { "2B000", "Dependent privilege descriptors still exist" },
+ { "2BP01", "Dependent objects still exist" },
+ { "2D000", "Invalid transaction termination" },
+ { "2F000", "Sql routine exception" },
+ { "2F002", "Modifying sql data not permitted" },
+ { "2F003", "Prohibited sql statement attempted" },
+ { "2F004", "Reading sql data not permitted" },
+ { "2F005", "Function executed no return statement" },
+ { "34000", "Invalid cursor name" },
+ { "38000", "External routine exception" },
+ { "38001", "Containing sql not permitted" },
+ { "38002", "Modifying sql data not permitted" },
+ { "38003", "Prohibited sql statement attempted" },
+ { "38004", "Reading sql data not permitted" },
+ { "39000", "External routine invocation exception" },
+ { "39001", "Invalid sqlstate returned" },
+ { "39004", "Null value not allowed" },
+ { "39P01", "Trigger protocol violated" },
+ { "39P02", "Srf protocol violated" },
+ { "3B000", "Savepoint exception" },
+ { "3B001", "Invalid savepoint specification" },
+ { "3C000", "Duplicate cursor name" },
+ { "3D000", "Invalid catalog name" },
+ { "3F000", "Invalid schema name" },
+ { "40000", "Transaction rollback" },
+ { "40001", "Serialization failure" },
+ { "40002", "Transaction integrity constraint violation" },
+ { "40003", "Statement completion unknown" },
+ { "40P01", "Deadlock detected" },
+ { "42000", "Syntax error or access violation" },
+ { "42501", "Insufficient privilege" },
+ { "42601", "Syntax error" },
+ { "42602", "Invalid name" },
+ { "42611", "Invalid column definition" },
+ { "42622", "Name too long" },
+ { "42701", "Duplicate column" },
+ { "42702", "Ambiguous column" },
+ { "42703", "Undefined column" },
+ { "42704", "Undefined object" },
+ { "42710", "Duplicate object" },
+ { "42712", "Duplicate alias" },
+ { "42723", "Duplicate function" },
+ { "42725", "Ambiguous function" },
+ { "42803", "Grouping error" },
+ { "42804", "Datatype mismatch" },
+ { "42809", "Wrong object type" },
+ { "42830", "Invalid foreign key" },
+ { "42846", "Cannot coerce" },
+ { "42883", "Undefined function" },
+ { "42939", "Reserved name" },
+ { "42P01", "Undefined table" },
+ { "42P02", "Undefined parameter" },
+ { "42P03", "Duplicate cursor" },
+ { "42P04", "Duplicate database" },
+ { "42P05", "Duplicate prepared statement" },
+ { "42P06", "Duplicate schema" },
+ { "42P07", "Duplicate table" },
+ { "42P08", "Ambiguous parameter" },
+ { "42P09", "Ambiguous alias" },
+ { "42P10", "Invalid column reference" },
+ { "42P11", "Invalid cursor definition" },
+ { "42P12", "Invalid database definition" },
+ { "42P13", "Invalid function definition" },
+ { "42P14", "Invalid prepared statement definition" },
+ { "42P15", "Invalid schema definition" },
+ { "42P16", "Invalid table definition" },
+ { "42P17", "Invalid object definition" },
+ { "42P18", "Indeterminate datatype" },
+ { "42S01", "Base table or view already exists" },
+ { "42S02", "Base table or view not found" },
+ { "42S11", "Index already exists" },
+ { "42S12", "Index not found" },
+ { "42S21", "Column already exists" },
+ { "42S22", "Column not found" },
+ { "44000", "WITH CHECK OPTION violation" },
+ { "53000", "Insufficient resources" },
+ { "53100", "Disk full" },
+ { "53200", "Out of memory" },
+ { "53300", "Too many connections" },
+ { "54000", "Program limit exceeded" },
+ { "54001", "Statement too complex" },
+ { "54011", "Too many columns" },
+ { "54023", "Too many arguments" },
+ { "55000", "Object not in prerequisite state" },
+ { "55006", "Object in use" },
+ { "55P02", "Cant change runtime param" },
+ { "55P03", "Lock not available" },
+ { "57000", "Operator intervention" },
+ { "57014", "Query canceled" },
+ { "57P01", "Admin shutdown" },
+ { "57P02", "Crash shutdown" },
+ { "57P03", "Cannot connect now" },
+ { "58030", "Io error" },
+ { "58P01", "Undefined file" },
+ { "58P02", "Duplicate file" },
+ { "F0000", "Config file error" },
+ { "F0001", "Lock file exists" },
+ { "HY000", "General error" },
+ { "HY001", "Memory allocation error" },
+ { "HY003", "Invalid application buffer type" },
+ { "HY004", "Invalid SQL data type" },
+ { "HY007", "Associated statement is not prepared" },
+ { "HY008", "Operation canceled" },
+ { "HY009", "Invalid use of null pointer" },
+ { "HY010", "Function sequence error" },
+ { "HY011", "Attribute cannot be set now" },
+ { "HY012", "Invalid transaction operation code" },
+ { "HY013", "Memory management error" },
+ { "HY014", "Limit on the number of handles exceeded" },
+ { "HY015", "No cursor name available" },
+ { "HY016", "Cannot modify an implementation row descriptor" },
+ { "HY017", "Invalid use of an automatically allocated descriptor handle" },
+ { "HY018", "Server declined cancel request" },
+ { "HY019", "Non-character and non-binary data sent in pieces" },
+ { "HY020", "Attempt to concatenate a null value" },
+ { "HY021", "Inconsistent descriptor information" },
+ { "HY024", "Invalid attribute value" },
+ { "HY090", "Invalid string or buffer length" },
+ { "HY091", "Invalid descriptor field identifier" },
+ { "HY092", "Invalid attribute/option identifier" },
+ { "HY093", "Invalid parameter number" },
+ { "HY095", "Function type out of range" },
+ { "HY096", "Invalid information type" },
+ { "HY097", "Column type out of range" },
+ { "HY098", "Scope type out of range" },
+ { "HY099", "Nullable type out of range" },
+ { "HY100", "Uniqueness option type out of range" },
+ { "HY101", "Accuracy option type out of range" },
+ { "HY103", "Invalid retrieval code" },
+ { "HY104", "Invalid precision or scale value" },
+ { "HY105", "Invalid parameter type" },
+ { "HY106", "Fetch type out of range" },
+ { "HY107", "Row value out of range" },
+ { "HY109", "Invalid cursor position" },
+ { "HY110", "Invalid driver completion" },
+ { "HY111", "Invalid bookmark value" },
+ { "HYC00", "Optional feature not implemented" },
+ { "HYT00", "Timeout expired" },
+ { "HYT01", "Connection timeout expired" },
+ { "IM001", "Driver does not support this function" },
+ { "IM002", "Data source name not found and no default driver specified" },
+ { "IM003", "Specified driver could not be loaded" },
+ { "IM004", "Driver's SQLAllocHandle on SQL_HANDLE_ENV failed" },
+ { "IM005", "Driver's SQLAllocHandle on SQL_HANDLE_DBC failed" },
+ { "IM006", "Driver's SQLSetConnectAttr failed" },
+ { "IM007", "No data source or driver specified; dialog prohibited" },
+ { "IM008", "Dialog failed" },
+ { "IM009", "Unable to load translation DLL" },
+ { "IM010", "Data source name too long" },
+ { "IM011", "Driver name too long" },
+ { "IM012", "DRIVER keyword syntax error" },
+ { "IM013", "Trace file error" },
+ { "IM014", "Invalid name of File DSN" },
+ { "IM015", "Corrupt file data source" },
+ { "P0000", "Plpgsql error" },
+ { "P0001", "Raise exception" },
+ { "XX000", "Internal error" },
+ { "XX001", "Data corrupted" },
+ { "XX002", "Index corrupted" }
+};
+
+void pdo_sqlstate_fini_error_table(void)
+{
+ zend_hash_destroy(&err_hash);
+}
+
+int pdo_sqlstate_init_error_table(void)
+{
+ int i;
+ struct pdo_sqlstate_info *info;
+
+ if (FAILURE == zend_hash_init(&err_hash,
+ sizeof(err_initializer)/sizeof(err_initializer[0]), NULL, NULL, 1)) {
+ return FAILURE;
+ }
+
+ for (i = 0; i < sizeof(err_initializer)/sizeof(err_initializer[0]); i++) {
+ info = &err_initializer[i];
+
+ zend_hash_add(&err_hash, info->state, sizeof(info->state), &info, sizeof(info), NULL);
+ }
+
+ return SUCCESS;
+}
+
+const char *pdo_sqlstate_state_to_description(char *state)
+{
+ struct pdo_sqlstate_info **info;
+ if (SUCCESS == zend_hash_find(&err_hash, state, sizeof(err_initializer[0].state),
+ (void**)&info)) {
+ return (*info)->desc;
+ }
+ return NULL;
+}
+
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
new file mode 100755
index 000000000..ac9e0a52f
--- /dev/null
+++ b/ext/pdo/pdo_stmt.c
@@ -0,0 +1,2490 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ | Marcus Boerger <helly@php.net> |
+ | Sterling Hughes <sterling@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_stmt.c,v 1.118.2.21 2005/11/26 21:20:52 wez Exp $ */
+
+/* The PDO Statement Handle Class */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "ext/standard/php_var.h"
+#include "php_pdo.h"
+#include "php_pdo_driver.h"
+#include "php_pdo_int.h"
+#include "zend_exceptions.h"
+#include "zend_interfaces.h"
+#include "php_memory_streams.h"
+
+#if COMPILE_DL_PDO
+/* {{{ content from zend_arg_defs.c:
+ * since it is a .c file, it won't be installed for use by PECL extensions, so we include it here. */
+ZEND_BEGIN_ARG_INFO(first_arg_force_ref, 0)
+ ZEND_ARG_PASS_INFO(1)
+ZEND_END_ARG_INFO();
+
+
+ZEND_BEGIN_ARG_INFO(second_arg_force_ref, 0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(1)
+ZEND_END_ARG_INFO();
+
+ZEND_BEGIN_ARG_INFO(third_arg_force_ref, 0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(1)
+ZEND_END_ARG_INFO();
+
+
+ZEND_BEGIN_ARG_INFO(fourth_arg_force_ref, 0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(1)
+ZEND_END_ARG_INFO();
+
+ZEND_BEGIN_ARG_INFO(all_args_by_ref, 1)
+ZEND_END_ARG_INFO();
+/* }}} */
+#endif
+
+#define PHP_STMT_GET_OBJ \
+ pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(getThis() TSRMLS_CC); \
+ if (!stmt->dbh) { \
+ RETURN_FALSE; \
+ } \
+
+static PHP_FUNCTION(dbstmt_constructor) /* {{{ */
+{
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "You should not create a PDOStatement manually");
+}
+/* }}} */
+
+static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param TSRMLS_DC) /* {{{ */
+{
+ if (stmt->bound_param_map) {
+ /* rewriting :name to ? style.
+ * We need to fixup the parameter numbers on the parameters.
+ * If we find that a given named parameter has been used twice,
+ * we will raise an error, as we can't be sure that it is safe
+ * to bind multiple parameters onto the same zval in the underlying
+ * driver */
+ char *name;
+ int position = 0;
+
+ if (stmt->named_rewrite_template) {
+ /* this is not an error here */
+ return 1;
+ }
+ if (!param->name) {
+ /* do the reverse; map the parameter number to the name */
+ if (SUCCESS == zend_hash_index_find(stmt->bound_param_map, param->paramno, (void**)&name)) {
+ param->name = estrdup(name);
+ param->namelen = strlen(param->name);
+ return 1;
+ }
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ return 0;
+ }
+
+ zend_hash_internal_pointer_reset(stmt->bound_param_map);
+ while (SUCCESS == zend_hash_get_current_data(stmt->bound_param_map, (void**)&name)) {
+ if (strcmp(name, param->name)) {
+ position++;
+ zend_hash_move_forward(stmt->bound_param_map);
+ continue;
+ }
+ if (param->paramno >= 0) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead" TSRMLS_CC);
+ return -1;
+ }
+ param->paramno = position;
+ return 1;
+ }
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ return 0;
+ }
+ return 1;
+}
+/* }}} */
+
+/* trigger callback hook for parameters */
+static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
+{
+ int ret = 1, is_param = 1;
+ struct pdo_bound_param_data *param;
+ HashTable *ht;
+
+ if (!stmt->methods->param_hook) {
+ return 1;
+ }
+
+ ht = stmt->bound_params;
+
+iterate:
+ if (ht) {
+ zend_hash_internal_pointer_reset(ht);
+ while (SUCCESS == zend_hash_get_current_data(ht, (void**)&param)) {
+ if (!stmt->methods->param_hook(stmt, param, event_type TSRMLS_CC)) {
+ ret = 0;
+ break;
+ }
+
+ zend_hash_move_forward(ht);
+ }
+ }
+ if (ret && is_param) {
+ ht = stmt->bound_columns;
+ is_param = 0;
+ goto iterate;
+ }
+
+ return ret;
+}
+/* }}} */
+
+int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ int col;
+
+ stmt->columns = ecalloc(stmt->column_count, sizeof(struct pdo_column_data));
+
+ for (col = 0; col < stmt->column_count; col++) {
+ if (!stmt->methods->describer(stmt, col TSRMLS_CC)) {
+ return 0;
+ }
+
+ /* if we are applying case conversions on column names, do so now */
+ if (stmt->dbh->native_case != stmt->dbh->desired_case && stmt->dbh->desired_case != PDO_CASE_NATURAL) {
+ char *s = stmt->columns[col].name;
+
+ switch (stmt->dbh->desired_case) {
+ case PDO_CASE_UPPER:
+ while (*s != '\0') {
+ *s = toupper(*s);
+ s++;
+ }
+ break;
+ case PDO_CASE_LOWER:
+ while (*s != '\0') {
+ *s = tolower(*s);
+ s++;
+ }
+ break;
+ default:
+ ;
+ }
+ }
+
+#if 0
+ /* update the column index on named bound parameters */
+ if (stmt->bound_params) {
+ struct pdo_bound_param_data *param;
+
+ if (SUCCESS == zend_hash_find(stmt->bound_params, stmt->columns[col].name,
+ stmt->columns[col].namelen, (void**)&param)) {
+ param->paramno = col;
+ }
+ }
+#endif
+ if (stmt->bound_columns) {
+ struct pdo_bound_param_data *param;
+
+ if (SUCCESS == zend_hash_find(stmt->bound_columns, stmt->columns[col].name,
+ stmt->columns[col].namelen, (void**)&param)) {
+ param->paramno = col;
+ }
+ }
+
+ }
+ return 1;
+}
+/* }}} */
+
+static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value TSRMLS_DC) /* {{{ */
+{
+ if (Z_TYPE(stmt->lazy_object_ref) == IS_NULL) {
+ Z_TYPE(stmt->lazy_object_ref) = IS_OBJECT;
+ Z_OBJ_HANDLE(stmt->lazy_object_ref) = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_row_free_storage, NULL TSRMLS_CC);
+ Z_OBJ_HT(stmt->lazy_object_ref) = &pdo_row_object_handlers;
+ /* stmt->refcount++; */
+ }
+ Z_TYPE_P(return_value) = IS_OBJECT;
+ Z_OBJ_HANDLE_P(return_value) = Z_OBJ_HANDLE(stmt->lazy_object_ref);
+ Z_OBJ_HT_P(return_value) = Z_OBJ_HT(stmt->lazy_object_ref);
+ zend_objects_store_add_ref(return_value TSRMLS_CC);
+}
+/* }}} */
+
+static void param_dtor(void *data) /* {{{ */
+{
+ struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)data;
+ TSRMLS_FETCH();
+
+ /* tell the driver that it is going away */
+ if (param->stmt->methods->param_hook) {
+ param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE TSRMLS_CC);
+ }
+
+ if (param->name) {
+ efree(param->name);
+ }
+
+ zval_ptr_dtor(&(param->parameter));
+ if (param->driver_params) {
+ zval_ptr_dtor(&(param->driver_params));
+ }
+}
+/* }}} */
+
+static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is_param TSRMLS_DC) /* {{{ */
+{
+ HashTable *hash;
+ struct pdo_bound_param_data *pparam = NULL;
+
+ hash = is_param ? stmt->bound_params : stmt->bound_columns;
+
+ if (!hash) {
+ ALLOC_HASHTABLE(hash);
+ zend_hash_init(hash, 13, NULL, param_dtor, 0);
+
+ if (is_param) {
+ stmt->bound_params = hash;
+ } else {
+ stmt->bound_columns = hash;
+ }
+ }
+
+ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && ! ZVAL_IS_NULL(param->parameter)) {
+ convert_to_string(param->parameter);
+ }
+
+ param->stmt = stmt;
+ param->is_param = is_param;
+
+ ZVAL_ADDREF(param->parameter);
+ if (param->driver_params) {
+ ZVAL_ADDREF(param->driver_params);
+ }
+
+ if (!is_param && param->name && stmt->columns) {
+ /* try to map the name to the column */
+ int i;
+
+ for (i = 0; i < stmt->column_count; i++) {
+ if (strcmp(stmt->columns[i].name, param->name) == 0) {
+ param->paramno = i;
+ break;
+ }
+ }
+
+ /* if you prepare and then execute passing an array of params keyed by names,
+ * then this will trigger, and we don't want that */
+ if (param->paramno == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Did not found column name '%s' in the defined columns; it will not be bound", param->name);
+ }
+ }
+
+ if (param->name) {
+ if (is_param && param->name[0] != ':') {
+ char *temp = emalloc(++param->namelen + 1);
+ temp[0] = ':';
+ memmove(temp+1, param->name, param->namelen);
+ param->name = temp;
+ } else {
+ param->name = estrndup(param->name, param->namelen);
+ }
+ }
+
+ if (is_param && !rewrite_name_to_position(stmt, param TSRMLS_CC)) {
+ if (param->name) {
+ efree(param->name);
+ param->name = NULL;
+ }
+ return 0;
+ }
+
+ /* tell the driver we just created a parameter */
+ if (stmt->methods->param_hook) {
+ if (!stmt->methods->param_hook(stmt, param,
+ PDO_PARAM_EVT_ALLOC TSRMLS_CC)) {
+ return 0;
+ }
+ }
+
+ if (param->paramno >= 0) {
+ zend_hash_index_del(hash, param->paramno);
+ }
+
+ if (param->name) {
+ zend_hash_update(hash, param->name, param->namelen, param, sizeof(*param), (void**)&pparam);
+ } else {
+ zend_hash_index_update(hash, param->paramno, param, sizeof(*param), (void**)&pparam);
+ }
+
+ return 1;
+}
+/* }}} */
+
+/* {{{ proto bool PDOStatement::execute([array $bound_input_params])
+ Execute a prepared statement, optionally binding parameters */
+static PHP_METHOD(PDOStatement, execute)
+{
+ zval *input_params = NULL;
+ int ret = 1;
+ PHP_STMT_GET_OBJ;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &input_params)) {
+ RETURN_FALSE;
+ }
+
+ PDO_STMT_CLEAR_ERR();
+
+ if (input_params) {
+ struct pdo_bound_param_data param;
+ zval **tmp;
+ uint str_length;
+ ulong num_index;
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(input_params));
+ while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(input_params), (void*)&tmp)) {
+ memset(&param, 0, sizeof(param));
+
+ if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_P(input_params),
+ &param.name, &str_length, &num_index, 0, NULL)) {
+ /* yes this is correct. we don't want to count the null byte. ask wez */
+ param.namelen = str_length - 1;
+ param.paramno = -1;
+ } else {
+ /* we're okay to be zero based here */
+ if (num_index < 0) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", NULL TSRMLS_CC);
+ RETURN_FALSE;
+ }
+ param.paramno = num_index;
+ }
+
+ param.param_type = PDO_PARAM_STR;
+ MAKE_STD_ZVAL(param.parameter);
+ *param.parameter = **tmp;
+ zval_copy_ctor(param.parameter);
+ INIT_PZVAL(param.parameter);
+
+ if (!really_register_bound_param(&param, stmt, 1 TSRMLS_CC)) {
+ zval_ptr_dtor(&param.parameter);
+ RETURN_FALSE;
+ }
+ zval_ptr_dtor(&param.parameter);
+
+ zend_hash_move_forward(Z_ARRVAL_P(input_params));
+ }
+ }
+
+ if (PDO_PLACEHOLDER_NONE == stmt->supports_placeholders) {
+ /* handle the emulated parameter binding,
+ * stmt->active_query_string holds the query with binds expanded and
+ * quoted.
+ */
+
+ ret = pdo_parse_params(stmt, stmt->query_string, stmt->query_stringlen,
+ &stmt->active_query_string, &stmt->active_query_stringlen TSRMLS_CC);
+
+ if (ret == 0) {
+ /* no changes were made */
+ stmt->active_query_string = stmt->query_string;
+ stmt->active_query_stringlen = stmt->query_stringlen;
+ } else if (ret == -1) {
+ /* something broke */
+ PDO_HANDLE_STMT_ERR();
+ RETURN_FALSE;
+ }
+ } else if (!dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_PRE TSRMLS_CC)) {
+ PDO_HANDLE_STMT_ERR();
+ RETURN_FALSE;
+ }
+ if (stmt->methods->executer(stmt TSRMLS_CC)) {
+ if (stmt->active_query_string && stmt->active_query_string != stmt->query_string) {
+ efree(stmt->active_query_string);
+ }
+ stmt->active_query_string = NULL;
+ if (!stmt->executed) {
+ /* this is the first execute */
+
+ if (stmt->dbh->alloc_own_columns) {
+ /* for "big boy" drivers, we need to allocate memory to fetch
+ * the results into, so lets do that now */
+ ret = pdo_stmt_describe_columns(stmt TSRMLS_CC);
+ }
+
+ stmt->executed = 1;
+ }
+
+ if (ret && !dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_POST TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+
+ RETURN_BOOL(ret);
+ }
+ if (stmt->active_query_string && stmt->active_query_string != stmt->query_string) {
+ efree(stmt->active_query_string);
+ }
+ stmt->active_query_string = NULL;
+ PDO_HANDLE_STMT_ERR();
+ RETURN_FALSE;
+}
+/* }}} */
+
+static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *type_override TSRMLS_DC) /* {{{ */
+{
+ struct pdo_column_data *col;
+ char *value = NULL;
+ unsigned long value_len = 0;
+ int caller_frees = 0;
+ int type, new_type;
+
+ col = &stmt->columns[colno];
+ type = PDO_PARAM_TYPE(col->param_type);
+ new_type = type_override ? PDO_PARAM_TYPE(*type_override) : type;
+
+ value = NULL;
+ value_len = 0;
+
+ stmt->methods->get_col(stmt, colno, &value, &value_len, &caller_frees TSRMLS_CC);
+
+ switch (type) {
+ case PDO_PARAM_INT:
+ if (value && value_len == sizeof(long)) {
+ ZVAL_LONG(dest, *(long*)value);
+ break;
+ }
+ ZVAL_NULL(dest);
+ break;
+
+ case PDO_PARAM_BOOL:
+ if (value && value_len == sizeof(zend_bool)) {
+ ZVAL_BOOL(dest, *(zend_bool*)value);
+ break;
+ }
+ ZVAL_NULL(dest);
+ break;
+
+ case PDO_PARAM_LOB:
+ if (value == NULL) {
+ ZVAL_NULL(dest);
+ } else if (value_len == 0) {
+ if (stmt->dbh->stringify || new_type == PDO_PARAM_STR) {
+ char *buf = NULL;
+ size_t len;
+ len = php_stream_copy_to_mem((php_stream*)value, &buf, PHP_STREAM_COPY_ALL, 0);
+ ZVAL_STRINGL(dest, buf, len, 0);
+ php_stream_close((php_stream*)value);
+ } else {
+ php_stream_to_zval((php_stream*)value, dest);
+ }
+ } else if (!stmt->dbh->stringify && new_type != PDO_PARAM_STR) {
+ /* they gave us a string, but LOBs are represented as streams in PDO */
+ php_stream *stm;
+#ifdef TEMP_STREAM_TAKE_BUFFER
+ if (caller_frees) {
+ stm = php_stream_memory_open(TEMP_STREAM_TAKE_BUFFER, value, value_len);
+ if (stm) {
+ caller_frees = 0;
+ }
+ } else
+#endif
+ {
+ stm = php_stream_memory_open(TEMP_STREAM_READONLY, value, value_len);
+ }
+ if (stm) {
+ php_stream_to_zval(stm, dest);
+ } else {
+ ZVAL_NULL(dest);
+ }
+ } else {
+ ZVAL_STRINGL(dest, value, value_len, !caller_frees);
+ if (caller_frees) {
+ caller_frees = 0;
+ }
+ }
+ break;
+
+ case PDO_PARAM_STR:
+ if (value && !(value_len == 0 && stmt->dbh->oracle_nulls == PDO_NULL_EMPTY_STRING)) {
+ ZVAL_STRINGL(dest, value, value_len, !caller_frees);
+ if (caller_frees) {
+ caller_frees = 0;
+ }
+ break;
+ }
+ default:
+ ZVAL_NULL(dest);
+ }
+
+ if (type != new_type) {
+ switch (new_type) {
+ case PDO_PARAM_INT:
+ convert_to_long_ex(&dest);
+ break;
+ case PDO_PARAM_BOOL:
+ convert_to_boolean_ex(&dest);
+ break;
+ case PDO_PARAM_STR:
+ convert_to_string_ex(&dest);
+ break;
+ case PDO_PARAM_NULL:
+ convert_to_null_ex(&dest);
+ break;
+ default:
+ ;
+ }
+ }
+
+ if (caller_frees && value) {
+ efree(value);
+ }
+
+ if (stmt->dbh->stringify) {
+ switch (Z_TYPE_P(dest)) {
+ case IS_LONG:
+ case IS_DOUBLE:
+ convert_to_string(dest);
+ break;
+ }
+ }
+
+ if (Z_TYPE_P(dest) == IS_NULL && stmt->dbh->oracle_nulls == PDO_NULL_TO_STRING) {
+ ZVAL_EMPTY_STRING(dest);
+ }
+}
+/* }}} */
+
+static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori,
+ long offset, int do_bind TSRMLS_DC) /* {{{ */
+{
+ if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_PRE TSRMLS_CC)) {
+ return 0;
+ }
+
+ if (!stmt->methods->fetcher(stmt, ori, offset TSRMLS_CC)) {
+ return 0;
+ }
+
+ /* some drivers might need to describe the columns now */
+ if (!stmt->columns && !pdo_stmt_describe_columns(stmt TSRMLS_CC)) {
+ return 0;
+ }
+
+ if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_POST TSRMLS_CC)) {
+ return 0;
+ }
+
+ if (do_bind && stmt->bound_columns) {
+ /* update those bound column variables now */
+ struct pdo_bound_param_data *param;
+
+ zend_hash_internal_pointer_reset(stmt->bound_columns);
+ while (SUCCESS == zend_hash_get_current_data(stmt->bound_columns, (void**)&param)) {
+ if (param->paramno >= 0) {
+ convert_to_string(param->parameter);
+
+ /* delete old value */
+ zval_dtor(param->parameter);
+
+ /* set new value */
+ fetch_value(stmt, param->parameter, param->paramno, (int *)&param->param_type TSRMLS_CC);
+
+ /* TODO: some smart thing that avoids duplicating the value in the
+ * general loop below. For now, if you're binding output columns,
+ * it's better to use LAZY or BOUND fetches if you want to shave
+ * off those cycles */
+ }
+
+ zend_hash_move_forward(stmt->bound_columns);
+ }
+ }
+
+ return 1;
+}
+/* }}} */
+
+static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ zend_class_entry * ce = stmt->fetch.cls.ce;
+ zend_fcall_info * fci = &stmt->fetch.cls.fci;
+ zend_fcall_info_cache * fcc = &stmt->fetch.cls.fcc;
+
+ fci->size = sizeof(zend_fcall_info);
+
+ if (!ce) {
+ stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR;
+ }
+
+ if (ce->constructor) {
+ fci->function_table = &ce->function_table;
+ fci->function_name = NULL;
+ fci->symbol_table = NULL;
+ fci->retval_ptr_ptr = &stmt->fetch.cls.retval_ptr;
+ if (stmt->fetch.cls.ctor_args) {
+ HashTable *ht = Z_ARRVAL_P(stmt->fetch.cls.ctor_args);
+ Bucket *p;
+
+ fci->param_count = 0;
+ fci->params = safe_emalloc(sizeof(zval**), ht->nNumOfElements, 0);
+ p = ht->pListHead;
+ while (p != NULL) {
+ fci->params[fci->param_count++] = (zval**)p->pData;
+ p = p->pListNext;
+ }
+ } else {
+ fci->param_count = 0;
+ fci->params = NULL;
+ }
+ fci->no_separation = 1;
+
+ fcc->initialized = 1;
+ fcc->function_handler = ce->constructor;
+ fcc->calling_scope = EG(scope);
+ return 1;
+ } else if (stmt->fetch.cls.ctor_args) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it" TSRMLS_CC);
+ return 0;
+ } else {
+ return 1; /* no ctor no args is also ok */
+ }
+}
+/* }}} */
+
+static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci, zend_fcall_info_cache * fcc, int num_args TSRMLS_DC) /* {{{ */
+{
+ zval **object = NULL, **method;
+ char *fname, *cname;
+ zend_class_entry * ce = NULL, **pce;
+ zend_function *function_handler;
+
+ if (Z_TYPE_P(callable) == IS_ARRAY) {
+ if (Z_ARRVAL_P(callable)->nNumOfElements < 2) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback" TSRMLS_CC);
+ return 0;
+ }
+ object = (zval**)Z_ARRVAL_P(callable)->pListHead->pData;
+ method = (zval**)Z_ARRVAL_P(callable)->pListHead->pListNext->pData;
+
+ if (Z_TYPE_PP(object) == IS_STRING) { /* static call */
+ object = NULL;
+ } else if (Z_TYPE_PP(object) == IS_OBJECT) { /* object call */
+ ce = Z_OBJCE_PP(object);
+ } else {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback; bogus object/class name" TSRMLS_CC);
+ return 0;
+ }
+
+ if (Z_TYPE_PP(method) != IS_STRING) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback; bogus method name" TSRMLS_CC);
+ return 0;
+ }
+ }
+
+ if (!zend_is_callable(callable, 0, &fname)) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback" TSRMLS_CC);
+ return 0;
+ }
+
+ /* ATM we do not support array($obj, "CLASS::FUNC") or "CLASS_FUNC" */
+ cname = fname;
+ if ((fname = strstr(fname, "::")) == NULL) {
+ fname = cname;
+ cname = NULL;
+ } else {
+ *fname = '\0';
+ fname += 2;
+ }
+ if (cname) {
+ if (zend_lookup_class(cname, strlen(cname), &pce TSRMLS_CC) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not exist" TSRMLS_CC);
+ return 0;
+ } else {
+ if (ce) {
+ /* pce must be base of ce or ce itself */
+ if (ce != *pce && !instanceof_function(ce, *pce TSRMLS_CC)) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class has bogus lineage" TSRMLS_CC);
+ return 0;
+ }
+ }
+ ce = *pce;
+ }
+ }
+
+ zend_str_tolower_copy(fname, fname, strlen(fname));
+ fci->function_table = ce ? &ce->function_table : EG(function_table);
+ if (zend_hash_find(fci->function_table, fname, strlen(fname)+1, (void **)&function_handler) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function does not exist" TSRMLS_CC);
+ return 0;
+ }
+ efree(cname ? cname : fname);
+
+ fci->size = sizeof(zend_fcall_info);
+ fci->function_name = NULL;
+ fci->symbol_table = NULL;
+ fci->param_count = num_args; /* probably less */
+ fci->params = safe_emalloc(sizeof(zval**), num_args, 0);
+ fci->object_pp = object;
+
+ fcc->initialized = 1;
+ fcc->function_handler = function_handler;
+ fcc->calling_scope = EG(scope);
+ fcc->object_pp = object;
+
+ return 1;
+}
+/* }}} */
+
+static int do_fetch_func_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ zend_fcall_info * fci = &stmt->fetch.cls.fci;
+ zend_fcall_info_cache * fcc = &stmt->fetch.cls.fcc;
+
+ if (!make_callable_ex(stmt, stmt->fetch.func.function, fci, fcc, stmt->column_count TSRMLS_CC)) {
+ return 0;
+ } else {
+ stmt->fetch.func.values = safe_emalloc(sizeof(zval*), stmt->column_count, 0);
+ return 1;
+ }
+}
+/* }}} */
+
+static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs TSRMLS_DC) /* {{{ */
+{
+ /* fci.size is used to check if it is valid */
+ if (stmt->fetch.cls.fci.size && stmt->fetch.cls.fci.params) {
+ efree(stmt->fetch.cls.fci.params);
+ stmt->fetch.cls.fci.params = NULL;
+ }
+ stmt->fetch.cls.fci.size = 0;
+ if (stmt->fetch.cls.ctor_args && free_ctor_agrs) {
+ zval_ptr_dtor(&stmt->fetch.cls.ctor_args);
+ stmt->fetch.cls.ctor_args = NULL;
+ stmt->fetch.cls.fci.param_count = 0;
+ }
+ if (stmt->fetch.func.values) {
+ FREE_ZVAL(stmt->fetch.func.values);
+ stmt->fetch.func.values = NULL;
+ }
+ return 1;
+}
+/* }}} */
+
+/* perform a fetch. If do_bind is true, update any bound columns.
+ * If return_value is not null, store values into it according to HOW. */
+static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
+ enum pdo_fetch_type how, enum pdo_fetch_orientation ori, long offset, zval *return_all TSRMLS_DC) /* {{{ */
+{
+ int flags = how & PDO_FETCH_FLAGS, idx, old_arg_count;
+ zend_class_entry * ce, * old_ce;
+ zval grp_val, *grp, **pgrp, *retval, *old_ctor_args;
+
+ how = how & ~PDO_FETCH_FLAGS;
+ if (how == PDO_FETCH_USE_DEFAULT) {
+ how = stmt->default_fetch_type;
+ }
+
+ if (!do_fetch_common(stmt, ori, offset, do_bind TSRMLS_CC)) {
+ return 0;
+ }
+
+ if (how == PDO_FETCH_BOUND) {
+ RETVAL_TRUE;
+ return 1;
+ }
+
+ if (return_value) {
+ int i = 0;
+
+ if (how == PDO_FETCH_LAZY) {
+ get_lazy_object(stmt, return_value TSRMLS_CC);
+ return 1;
+ }
+
+ RETVAL_FALSE;
+
+ switch (how) {
+ case PDO_FETCH_ASSOC:
+ case PDO_FETCH_BOTH:
+ case PDO_FETCH_NUM:
+ case PDO_FETCH_NAMED:
+ array_init(return_value);
+ break;
+
+ case PDO_FETCH_COLUMN:
+ if (stmt->fetch.column >= 0 && stmt->fetch.column < stmt->column_count) {
+ fetch_value(stmt, return_value, stmt->fetch.column, NULL TSRMLS_CC);
+ if (!return_all) {
+ return 1;
+ } else {
+ break;
+ }
+ }
+ return 0;
+
+ case PDO_FETCH_OBJ:
+ object_init_ex(return_value, ZEND_STANDARD_CLASS_DEF_PTR);
+ break;
+
+ case PDO_FETCH_CLASS:
+ if (flags & PDO_FETCH_CLASSTYPE) {
+ zval val;
+ zend_class_entry **cep;
+
+ old_ce = stmt->fetch.cls.ce;
+ old_ctor_args = stmt->fetch.cls.ctor_args;
+ old_arg_count = stmt->fetch.cls.fci.param_count;
+ do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+
+ INIT_PZVAL(&val);
+ fetch_value(stmt, &val, i++, NULL TSRMLS_CC);
+ if (Z_TYPE(val) != IS_NULL) {
+ convert_to_string(&val);
+ if (zend_lookup_class(Z_STRVAL(val), Z_STRLEN(val), &cep TSRMLS_CC) == FAILURE) {
+ stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR;
+ } else {
+ stmt->fetch.cls.ce = *cep;
+ }
+ }
+
+ do_fetch_class_prepare(stmt TSRMLS_CC);
+ zval_dtor(&val);
+ }
+ ce = stmt->fetch.cls.ce;
+ if ((flags & PDO_FETCH_SERIALIZE) == 0) {
+ object_init_ex(return_value, ce);
+ if (!stmt->fetch.cls.fci.size) {
+ if (!do_fetch_class_prepare(stmt TSRMLS_CC))
+ {
+ return 0;
+ }
+ }
+ }
+ break;
+
+ case PDO_FETCH_INTO:
+ if (!stmt->fetch.into) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch-into object specified." TSRMLS_CC);
+ return 0;
+ break;
+ }
+
+ Z_TYPE_P(return_value) = IS_OBJECT;
+ Z_OBJ_HANDLE_P(return_value) = Z_OBJ_HANDLE_P(stmt->fetch.into);
+ Z_OBJ_HT_P(return_value) = Z_OBJ_HT_P(stmt->fetch.into);
+ zend_objects_store_add_ref(stmt->fetch.into TSRMLS_CC);
+
+ if (zend_get_class_entry(return_value TSRMLS_CC) == ZEND_STANDARD_CLASS_DEF_PTR) {
+ how = PDO_FETCH_OBJ;
+ }
+ break;
+
+ case PDO_FETCH_FUNC:
+ if (!stmt->fetch.func.fci.size) {
+ if (!do_fetch_func_prepare(stmt TSRMLS_CC))
+ {
+ return 0;
+ }
+ }
+ break;
+
+
+ default:
+ /* shouldn't happen */
+ return 0;
+ }
+
+ if (return_all) {
+ INIT_PZVAL(&grp_val);
+ fetch_value(stmt, &grp_val, i, NULL TSRMLS_CC);
+ convert_to_string(&grp_val);
+ if (how == PDO_FETCH_COLUMN) {
+ i = stmt->column_count; /* no more data to fetch */
+ } else {
+ i++;
+ }
+ }
+
+ for (idx = 0; i < stmt->column_count; i++, idx++) {
+ zval *val;
+ MAKE_STD_ZVAL(val);
+ fetch_value(stmt, val, i, NULL TSRMLS_CC);
+
+ switch (how) {
+ case PDO_FETCH_ASSOC:
+ add_assoc_zval(return_value, stmt->columns[i].name, val);
+ break;
+
+ case PDO_FETCH_BOTH:
+ add_assoc_zval(return_value, stmt->columns[i].name, val);
+ ZVAL_ADDREF(val);
+ add_next_index_zval(return_value, val);
+ break;
+
+ case PDO_FETCH_NAMED:
+ /* already have an item with this name? */
+ {
+ zval **curr_val = NULL;
+ if (zend_hash_find(Z_ARRVAL_P(return_value), stmt->columns[i].name,
+ strlen(stmt->columns[i].name)+1,
+ (void**)&curr_val) == SUCCESS) {
+ zval *arr;
+ if (Z_TYPE_PP(curr_val) != IS_ARRAY) {
+ /* a little bit of black magic here:
+ * we're creating a new array and swapping it for the
+ * zval that's already stored in the hash under the name
+ * we want. We then add that zval to the array.
+ * This is effectively the same thing as:
+ * if (!is_array($hash[$name])) {
+ * $hash[$name] = array($hash[$name]);
+ * }
+ * */
+ zval *cur;
+
+ MAKE_STD_ZVAL(arr);
+ array_init(arr);
+
+ cur = *curr_val;
+ *curr_val = arr;
+
+ add_next_index_zval(arr, cur);
+ } else {
+ arr = *curr_val;
+ }
+ add_next_index_zval(arr, val);
+ } else {
+ add_assoc_zval(return_value, stmt->columns[i].name, val);
+ }
+ }
+ break;
+
+ case PDO_FETCH_NUM:
+ add_next_index_zval(return_value, val);
+ break;
+
+ case PDO_FETCH_OBJ:
+ case PDO_FETCH_INTO:
+ zend_update_property(NULL, return_value,
+ stmt->columns[i].name, stmt->columns[i].namelen,
+ val TSRMLS_CC);
+ zval_ptr_dtor(&val);
+ break;
+
+ case PDO_FETCH_CLASS:
+ if ((flags & PDO_FETCH_SERIALIZE) == 0 || idx) {
+ zend_update_property(ce, return_value,
+ stmt->columns[i].name, stmt->columns[i].namelen,
+ val TSRMLS_CC);
+ zval_ptr_dtor(&val);
+ } else {
+#ifdef MBO_0
+ php_unserialize_data_t var_hash;
+
+ PHP_VAR_UNSERIALIZE_INIT(var_hash);
+ if (php_var_unserialize(&return_value, (const unsigned char**)&Z_STRVAL_P(val), Z_STRVAL_P(val)+Z_STRLEN_P(val), NULL TSRMLS_CC) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize data" TSRMLS_CC);
+ PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
+ return 0;
+ }
+ PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
+#endif
+#if PHP_MAJOR_VERSION > 5 || PHP_MINOR_VERSION >= 1
+ if (!ce->unserialize) {
+ zval_ptr_dtor(&val);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC);
+ return 0;
+ } else if (ce->unserialize(&return_value, ce, Z_TYPE_P(val) == IS_STRING ? Z_STRVAL_P(val) : "", Z_TYPE_P(val) == IS_STRING ? Z_STRLEN_P(val) : 0, NULL TSRMLS_CC) == FAILURE) {
+ zval_ptr_dtor(&val);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC);
+ zval_dtor(return_value);
+ ZVAL_NULL(return_value);
+ return 0;
+ } else {
+ zval_ptr_dtor(&val);
+ }
+#endif
+ }
+ break;
+
+ case PDO_FETCH_FUNC:
+ stmt->fetch.func.values[idx] = val;
+ stmt->fetch.cls.fci.params[idx] = &stmt->fetch.func.values[idx];
+ break;
+
+ default:
+ zval_ptr_dtor(&val);
+ pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range" TSRMLS_CC);
+ return 0;
+ break;
+ }
+ }
+
+ switch (how) {
+ case PDO_FETCH_CLASS:
+ if (ce->constructor) {
+ stmt->fetch.cls.fci.object_pp = &return_value;
+ stmt->fetch.cls.fcc.object_pp = &return_value;
+ if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc TSRMLS_CC) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor" TSRMLS_CC);
+ return 0;
+ } else {
+ if (stmt->fetch.cls.retval_ptr) {
+ zval_ptr_dtor(&stmt->fetch.cls.retval_ptr);
+ }
+ }
+ }
+ if (flags & PDO_FETCH_CLASSTYPE) {
+ do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ stmt->fetch.cls.ce = old_ce;
+ stmt->fetch.cls.ctor_args = old_ctor_args;
+ stmt->fetch.cls.fci.param_count = old_arg_count;
+ }
+ break;
+
+ case PDO_FETCH_FUNC:
+ stmt->fetch.func.fci.param_count = idx;
+ stmt->fetch.func.fci.retval_ptr_ptr = &retval;
+ if (zend_call_function(&stmt->fetch.func.fci, &stmt->fetch.func.fcc TSRMLS_CC) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call user-supplied function" TSRMLS_CC);
+ return 0;
+ } else {
+ if (return_all) {
+ zval_ptr_dtor(&return_value); /* we don't need that */
+ return_value = retval;
+ } else {
+ *return_value = *retval;
+ zval_copy_ctor(return_value);
+ INIT_PZVAL(return_value);
+ zval_ptr_dtor(&retval);
+ }
+ }
+ while(idx--) {
+ zval_ptr_dtor(&stmt->fetch.func.values[idx]);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (return_all) {
+ if ((flags & PDO_FETCH_UNIQUE) == PDO_FETCH_UNIQUE) {
+ add_assoc_zval(return_all, Z_STRVAL(grp_val), return_value);
+ } else {
+ if (zend_symtable_find(Z_ARRVAL_P(return_all), Z_STRVAL(grp_val), Z_STRLEN(grp_val)+1, (void**)&pgrp) == FAILURE) {
+ MAKE_STD_ZVAL(grp);
+ array_init(grp);
+ add_assoc_zval(return_all, Z_STRVAL(grp_val), grp);
+ } else {
+ grp = *pgrp;
+ }
+ add_next_index_zval(grp, return_value);
+ }
+ zval_dtor(&grp_val);
+ }
+
+ }
+
+ return 1;
+}
+/* }}} */
+
+static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, int mode, int fetch_all TSRMLS_DC) /* {{{ */
+{
+ int flags = mode & PDO_FETCH_FLAGS;
+
+ mode = mode & ~PDO_FETCH_FLAGS;
+
+ if (mode == PDO_FETCH_USE_DEFAULT) {
+ flags = stmt->default_fetch_type & PDO_FETCH_FLAGS;
+ mode = stmt->default_fetch_type & ~PDO_FETCH_FLAGS;
+ }
+
+#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 1
+ if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO::FETCH_SERIALIZE is not supported in this PHP version" TSRMLS_CC);
+ return 0;
+ }
+#endif
+
+ switch(mode) {
+ case PDO_FETCH_FUNC:
+ if (!fetch_all) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_FUNC is only allowed in PDOStatement::fetchAll()" TSRMLS_CC);
+ return 0;
+ }
+ return 1;
+
+ default:
+ if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_SERIALIZE can only be used together with PDO::FETCH_CLASS" TSRMLS_CC);
+ return 0;
+ }
+ if ((flags & PDO_FETCH_CLASSTYPE) == PDO_FETCH_CLASSTYPE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_CLASSTYPE can only be used together with PDO::FETCH_CLASS" TSRMLS_CC);
+ return 0;
+ }
+ if (mode >= PDO_FETCH__MAX) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode" TSRMLS_CC);
+ return 0;
+ }
+ /* no break; */
+
+ case PDO_FETCH_CLASS:
+ return 1;
+ }
+}
+/* }}} */
+
+/* {{{ proto mixed PDOStatement::fetch([int $how = PDO_FETCH_BOTH [, int $orientation [, int $offset]]])
+ Fetches the next row and returns it, or false if there are no more rows */
+static PHP_METHOD(PDOStatement, fetch)
+{
+ long how = PDO_FETCH_USE_DEFAULT;
+ long ori = PDO_FETCH_ORI_NEXT;
+ long off = 0;
+ PHP_STMT_GET_OBJ;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lll", &how,
+ &ori, &off)) {
+ RETURN_FALSE;
+ }
+
+ PDO_STMT_CLEAR_ERR();
+
+ if (!pdo_stmt_verify_mode(stmt, how, 0 TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+
+ if (!do_fetch(stmt, TRUE, return_value, how, ori, off, 0 TSRMLS_CC)) {
+ PDO_HANDLE_STMT_ERR();
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto mixed PDOStatement::fetchObject(string class_name [, NULL|array ctor_args])
+ Fetches the next row and returns it as an object. */
+static PHP_METHOD(PDOStatement, fetchObject)
+{
+ long how = PDO_FETCH_CLASS;
+ long ori = PDO_FETCH_ORI_NEXT;
+ long off = 0;
+ char *class_name;
+ int class_name_len;
+ zend_class_entry *old_ce;
+ zval *old_ctor_args, *ctor_args;
+ int error = 0, old_arg_count;
+
+ PHP_STMT_GET_OBJ;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sz",
+ &class_name, &class_name_len, &ctor_args)) {
+ RETURN_FALSE;
+ }
+
+ PDO_STMT_CLEAR_ERR();
+
+ if (!pdo_stmt_verify_mode(stmt, how, 0 TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+
+ old_ce = stmt->fetch.cls.ce;
+ old_ctor_args = stmt->fetch.cls.ctor_args;
+ old_arg_count = stmt->fetch.cls.fci.param_count;
+
+ do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+
+ switch(ZEND_NUM_ARGS()) {
+ case 0:
+ stmt->fetch.cls.ce = zend_standard_class_def;
+ break;
+ case 2:
+ if (Z_TYPE_P(ctor_args) != IS_NULL && Z_TYPE_P(ctor_args) != IS_ARRAY) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC);
+ error = 1;
+ break;
+ }
+ if (Z_TYPE_P(ctor_args) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(ctor_args))) {
+ ALLOC_ZVAL(stmt->fetch.cls.ctor_args);
+ *stmt->fetch.cls.ctor_args = *ctor_args;
+ zval_copy_ctor(stmt->fetch.cls.ctor_args);
+ } else {
+ stmt->fetch.cls.ctor_args = NULL;
+ }
+ /* no break */
+ case 1:
+ stmt->fetch.cls.ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+
+ if (!stmt->fetch.cls.ce) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Could not find user-supplied class" TSRMLS_CC);
+ error = 1;
+ break;
+ }
+ }
+
+ if (!error && !do_fetch(stmt, TRUE, return_value, how, ori, off, 0 TSRMLS_CC)) {
+ error = 1;
+ }
+ if (error) {
+ PDO_HANDLE_STMT_ERR();
+ }
+ do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
+
+ stmt->fetch.cls.ce = old_ce;
+ stmt->fetch.cls.ctor_args = old_ctor_args;
+ stmt->fetch.cls.fci.param_count = old_arg_count;
+ if (error) {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto string PDOStatement::fetchColumn([int column_number])
+ Returns a data of the specified column in the result set. */
+static PHP_METHOD(PDOStatement, fetchColumn)
+{
+ long col_n = 0;
+ PHP_STMT_GET_OBJ;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &col_n)) {
+ RETURN_FALSE;
+ }
+
+ PDO_STMT_CLEAR_ERR();
+
+ if (!do_fetch_common(stmt, PDO_FETCH_ORI_NEXT, 0, TRUE TSRMLS_CC)) {
+ PDO_HANDLE_STMT_ERR();
+ RETURN_FALSE;
+ }
+
+ fetch_value(stmt, return_value, col_n, NULL TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto array PDOStatement::fetchAll([int $how = PDO_FETCH_BOTH [, string class_name [, NULL|array ctor_args]]])
+ Returns an array of all of the results. */
+static PHP_METHOD(PDOStatement, fetchAll)
+{
+ long how = PDO_FETCH_USE_DEFAULT;
+ zval *data, *return_all;
+ zval *arg2;
+ zend_class_entry *old_ce;
+ zval *old_ctor_args, *ctor_args = NULL;
+ int error = 0, old_arg_count;
+ PHP_STMT_GET_OBJ;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lzz", &how, &arg2, &ctor_args)) {
+ RETURN_FALSE;
+ }
+
+ if (!pdo_stmt_verify_mode(stmt, how, 1 TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+
+ old_ce = stmt->fetch.cls.ce;
+ old_ctor_args = stmt->fetch.cls.ctor_args;
+ old_arg_count = stmt->fetch.cls.fci.param_count;
+
+ do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+
+ switch(how & ~PDO_FETCH_FLAGS) {
+ case PDO_FETCH_CLASS:
+ switch(ZEND_NUM_ARGS()) {
+ case 0:
+ case 1:
+ stmt->fetch.cls.ce = zend_standard_class_def;
+ break;
+ case 3:
+ if (Z_TYPE_P(ctor_args) != IS_NULL && Z_TYPE_P(ctor_args) != IS_ARRAY) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC);
+ error = 1;
+ break;
+ }
+ if (Z_TYPE_P(ctor_args) != IS_ARRAY || !zend_hash_num_elements(Z_ARRVAL_P(ctor_args))) {
+ ctor_args = NULL;
+ }
+ /* no break */
+ case 2:
+ stmt->fetch.cls.ctor_args = ctor_args; /* we're not going to free these */
+ if (Z_TYPE_P(arg2) != IS_STRING) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid class name (should be a string)" TSRMLS_CC);
+ error = 1;
+ break;
+ } else {
+ stmt->fetch.cls.ce = zend_fetch_class(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ if (!stmt->fetch.cls.ce) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not find user-specified class" TSRMLS_CC);
+ error = 1;
+ break;
+ }
+ }
+ }
+ if (!error) {
+ do_fetch_class_prepare(stmt TSRMLS_CC);
+ }
+ break;
+
+ case PDO_FETCH_FUNC:
+ switch(ZEND_NUM_ARGS()) {
+ case 0:
+ case 1:
+ break;
+ case 3:
+ case 2:
+ stmt->fetch.func.function = arg2;
+ break;
+ }
+ do_fetch_func_prepare(stmt TSRMLS_CC);
+ break;
+
+ case PDO_FETCH_COLUMN:
+ switch(ZEND_NUM_ARGS()) {
+ case 0:
+ case 1:
+ stmt->fetch.column = how & PDO_FETCH_GROUP ? 1 : 0;
+ break;
+ case 2:
+ convert_to_long(arg2);
+ stmt->fetch.column = Z_LVAL_P(arg2);
+ break;
+ case 3:
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Third parameter not allowed for PDO::FETCH_COLUMN" TSRMLS_CC);
+ error = 1;
+ }
+ break;
+
+ default:
+ if (ZEND_NUM_ARGS() > 1) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Extraneous additional parameters" TSRMLS_CC);
+ error = 1;
+ }
+ }
+
+ if (!error) {
+ PDO_STMT_CLEAR_ERR();
+ MAKE_STD_ZVAL(data);
+ if (how & PDO_FETCH_GROUP) {
+ array_init(return_value);
+ return_all = return_value;
+ } else {
+ return_all = 0;
+ }
+ if (!do_fetch(stmt, TRUE, data, how, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC)) {
+ FREE_ZVAL(data);
+ error = 2;
+ }
+ }
+ if (!error) {
+ if ((how & PDO_FETCH_GROUP)) {
+ do {
+ MAKE_STD_ZVAL(data);
+ } while (do_fetch(stmt, TRUE, data, how, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC));
+ } else {
+ array_init(return_value);
+ do {
+ add_next_index_zval(return_value, data);
+ MAKE_STD_ZVAL(data);
+ } while (do_fetch(stmt, TRUE, data, how, PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC));
+ }
+ FREE_ZVAL(data);
+ }
+
+ do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+
+ stmt->fetch.cls.ce = old_ce;
+ stmt->fetch.cls.ctor_args = old_ctor_args;
+ stmt->fetch.cls.fci.param_count = old_arg_count;
+
+ if (error) {
+ PDO_HANDLE_STMT_ERR();
+ if (error != 2) {
+ RETURN_FALSE;
+ } else { /* on no results, return an empty array */
+ if (Z_TYPE_P(return_value) != IS_ARRAY) {
+ array_init(return_value);
+ }
+ return;
+ }
+ }
+}
+/* }}} */
+
+static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int is_param) /* {{{ */
+{
+ struct pdo_bound_param_data param = {0};
+
+ param.paramno = -1;
+ param.param_type = PDO_PARAM_STR;
+
+ if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
+ "lz|llz!", &param.paramno, &param.parameter, &param.param_type, &param.max_value_len,
+ &param.driver_params)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|llz!", &param.name,
+ &param.namelen, &param.parameter, &param.param_type, &param.max_value_len,
+ &param.driver_params)) {
+ return 0;
+ }
+ }
+
+ if (param.paramno > 0) {
+ --param.paramno; /* make it zero-based internally */
+ } else if (!param.name) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based" TSRMLS_CC);
+ return 0;
+ }
+
+ return really_register_bound_param(&param, stmt, is_param TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto bool PDOStatement::bindValue(mixed $paramno, mixed $param [, int $type ])
+ bind an input parameter to the value of a PHP variable. $paramno is the 1-based position of the placeholder in the SQL statement (but can be the parameter name for drivers that support named placeholders). It should be called prior to execute(). */
+static PHP_METHOD(PDOStatement, bindValue)
+{
+ struct pdo_bound_param_data param = {0};
+ PHP_STMT_GET_OBJ;
+
+ 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,
+ &param.namelen, &param.parameter, &param.param_type)) {
+ RETURN_FALSE;
+ }
+ }
+
+ if (param.paramno > 0) {
+ --param.paramno; /* make it zero-based internally */
+ } else if (!param.name) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based" TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
+ RETURN_BOOL(really_register_bound_param(&param, stmt, TRUE TSRMLS_CC));
+}
+/* }}} */
+
+
+/* {{{ proto bool PDOStatement::bindParam(mixed $paramno, mixed &$param [, int $type [, int $maxlen [, mixed $driverdata]]])
+ bind a parameter to a PHP variable. $paramno is the 1-based position of the placeholder in the SQL statement (but can be the parameter name for drivers that support named placeholders). This isn't supported by all drivers. It should be called prior to execute(). */
+static PHP_METHOD(PDOStatement, bindParam)
+{
+ PHP_STMT_GET_OBJ;
+ RETURN_BOOL(register_bound_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, TRUE));
+}
+/* }}} */
+
+/* {{{ proto bool PDOStatement::bindColumn(mixed $column, mixed &$param [, int $type [, int $maxlen [, mixed $driverdata]]])
+ bind a column to a PHP variable. On each row fetch $param will contain the value of the corresponding column. $column is the 1-based offset of the column, or the column name. For portability, don't call this before execute(). */
+static PHP_METHOD(PDOStatement, bindColumn)
+{
+ PHP_STMT_GET_OBJ;
+ RETURN_BOOL(register_bound_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, FALSE));
+}
+/* }}} */
+
+/* {{{ proto int PDOStatement::rowCount()
+ Returns the number of rows in a result set, or the number of rows affected by the last execute(). It is not always meaningful. */
+static PHP_METHOD(PDOStatement, rowCount)
+{
+ PHP_STMT_GET_OBJ;
+
+ RETURN_LONG(stmt->row_count);
+}
+/* }}} */
+
+/* {{{ proto string PDOStatement::errorCode()
+ Fetch the error code associated with the last operation on the statement handle */
+static PHP_METHOD(PDOStatement, errorCode)
+{
+ PHP_STMT_GET_OBJ;
+
+ if (ZEND_NUM_ARGS()) {
+ RETURN_FALSE;
+ }
+
+ RETURN_STRING(stmt->error_code, 1);
+}
+/* }}} */
+
+/* {{{ proto array PDOStatement::errorInfo()
+ Fetch extended error information associated with the last operation on the statement handle */
+static PHP_METHOD(PDOStatement, errorInfo)
+{
+ PHP_STMT_GET_OBJ;
+
+ if (ZEND_NUM_ARGS()) {
+ RETURN_FALSE;
+ }
+
+ array_init(return_value);
+ add_next_index_string(return_value, stmt->error_code, 1);
+
+ if (stmt->dbh->methods->fetch_err) {
+ stmt->dbh->methods->fetch_err(stmt->dbh, stmt, return_value TSRMLS_CC);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool PDOStatement::setAttribute(long attribute, mixed value)
+ Set an attribute */
+static PHP_METHOD(PDOStatement, setAttribute)
+{
+ long attr;
+ zval *value = NULL;
+ PHP_STMT_GET_OBJ;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz!", &attr, &value)) {
+ RETURN_FALSE;
+ }
+
+ if (!stmt->methods->set_attribute) {
+ goto fail;
+ }
+
+ PDO_STMT_CLEAR_ERR();
+ if (stmt->methods->set_attribute(stmt, attr, value TSRMLS_CC)) {
+ RETURN_TRUE;
+ }
+
+fail:
+ if (!stmt->methods->set_attribute) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support setting attributes" TSRMLS_CC);
+ } else {
+ PDO_HANDLE_STMT_ERR();
+ }
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto mixed PDOStatement::getAttribute(long attribute)
+ Get an attribute */
+static PHP_METHOD(PDOStatement, getAttribute)
+{
+ long attr;
+ PHP_STMT_GET_OBJ;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr)) {
+ RETURN_FALSE;
+ }
+
+ if (!stmt->methods->get_attribute) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support getting attributes" TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
+ PDO_STMT_CLEAR_ERR();
+ switch (stmt->methods->get_attribute(stmt, attr, return_value TSRMLS_CC)) {
+ case -1:
+ PDO_HANDLE_STMT_ERR();
+ RETURN_FALSE;
+
+ case 0:
+ /* XXX: should do something better here */
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver doesn't support getting that attribute" TSRMLS_CC);
+ RETURN_FALSE;
+
+ default:
+ return;
+ }
+}
+/* }}} */
+
+/* {{{ proto int PDOStatement::columnCount()
+ Returns the number of columns in the result set */
+static PHP_METHOD(PDOStatement, columnCount)
+{
+ PHP_STMT_GET_OBJ;
+ if (ZEND_NUM_ARGS()) {
+ RETURN_FALSE;
+ }
+ RETURN_LONG(stmt->column_count);
+}
+/* }}} */
+
+/* {{{ proto array PDOStatement::getColumnMeta(int $column)
+ Returns meta data for a numbered column */
+static PHP_METHOD(PDOStatement, getColumnMeta)
+{
+ long colno;
+ struct pdo_column_data *col;
+ PHP_STMT_GET_OBJ;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colno)) {
+ RETURN_FALSE;
+ }
+ if(colno < 0) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "42P10", "column number must be non-negative" TSRMLS_CC);
+ RETURN_FALSE;
+ }
+ if (!stmt->methods->get_column_meta) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver doesn't support meta data" TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
+ PDO_STMT_CLEAR_ERR();
+ if (FAILURE == stmt->methods->get_column_meta(stmt, colno, return_value TSRMLS_CC)) {
+ PDO_HANDLE_STMT_ERR();
+ RETURN_FALSE;
+ }
+
+ /* add stock items */
+ col = &stmt->columns[colno];
+ add_assoc_string(return_value, "name", col->name, 1);
+ add_assoc_long(return_value, "len", col->maxlen); /* FIXME: unsigned ? */
+ add_assoc_long(return_value, "precision", col->precision);
+ add_assoc_long(return_value, "pdo_type", col->param_type);
+}
+/* }}} */
+
+/* {{{ proto bool PDOStatement::setFetchMode(int mode [mixed* params])
+ Changes the default fetch mode for subsequent fetches (params have different meaning for different fetch modes) */
+
+int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip)
+{
+ long mode = PDO_FETCH_BOTH;
+ int argc = ZEND_NUM_ARGS() - skip;
+ zval ***args;
+ zend_class_entry **cep;
+
+ do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
+
+ switch (stmt->default_fetch_type) {
+ case PDO_FETCH_INTO:
+ if (stmt->fetch.into) {
+ ZVAL_DELREF(stmt->fetch.into);
+ stmt->fetch.into = NULL;
+ }
+ break;
+ default:
+ ;
+ }
+
+ stmt->default_fetch_type = PDO_FETCH_BOTH;
+
+ if (argc == 0) {
+ return SUCCESS;
+ }
+
+ args = safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval*), 0);
+
+ if (FAILURE == zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args)) {
+fail_out:
+ efree(args);
+ return FAILURE;
+ }
+
+ convert_to_long_ex(args[skip]);
+ mode = Z_LVAL_PP(args[skip]);
+
+ if (!pdo_stmt_verify_mode(stmt, mode, 0 TSRMLS_CC)) {
+ return FAILURE;
+ }
+
+ switch (mode & ~PDO_FETCH_FLAGS) {
+ case PDO_FETCH_LAZY:
+ case PDO_FETCH_ASSOC:
+ case PDO_FETCH_NUM:
+ case PDO_FETCH_BOTH:
+ case PDO_FETCH_OBJ:
+ case PDO_FETCH_BOUND:
+ case PDO_FETCH_NAMED:
+ break;
+
+ case PDO_FETCH_COLUMN:
+ if (argc != 2) {
+ goto fail_out;
+ }
+ convert_to_long_ex(args[skip+1]);
+ stmt->fetch.column = Z_LVAL_PP(args[skip+1]);
+ break;
+
+ case PDO_FETCH_CLASS:
+ if (argc < 2 || argc > 3) {
+ goto fail_out;
+ }
+ convert_to_string_ex(args[skip+1]);
+
+ if (FAILURE == zend_lookup_class(Z_STRVAL_PP(args[skip+1]),
+ Z_STRLEN_PP(args[skip+1]), &cep TSRMLS_CC)) {
+ goto fail_out;
+ }
+
+ if (!cep || !*cep) {
+ goto fail_out;
+ }
+
+ stmt->fetch.cls.ce = *cep;
+ stmt->fetch.cls.ctor_args = NULL;
+
+ if (stmt->dbh->is_persistent) {
+ /* TODO: CRITICAL for final release */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
+ }
+
+ if (argc == 3) {
+ if (Z_TYPE_PP(args[skip+2]) != IS_NULL && Z_TYPE_PP(args[skip+2]) != IS_ARRAY) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC);
+ } else if (Z_TYPE_PP(args[skip+2]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_PP(args[skip+2]))) {
+ ALLOC_ZVAL(stmt->fetch.cls.ctor_args);
+ *stmt->fetch.cls.ctor_args = **args[skip+2];
+ zval_copy_ctor(stmt->fetch.cls.ctor_args);
+ }
+ }
+
+ do_fetch_class_prepare(stmt TSRMLS_CC);
+ break;
+
+ case PDO_FETCH_INTO:
+ if (argc != 2) {
+ goto fail_out;
+ }
+ if (Z_TYPE_PP(args[skip+1]) != IS_OBJECT) {
+ goto fail_out;
+ }
+
+ if (stmt->dbh->is_persistent) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
+ }
+
+ MAKE_STD_ZVAL(stmt->fetch.into);
+
+ Z_TYPE_P(stmt->fetch.into) = IS_OBJECT;
+ Z_OBJ_HANDLE_P(stmt->fetch.into) = Z_OBJ_HANDLE_PP(args[skip+1]);
+ Z_OBJ_HT_P(stmt->fetch.into) = Z_OBJ_HT_PP(args[skip+1]);
+ zend_objects_store_add_ref(stmt->fetch.into TSRMLS_CC);
+ break;
+
+ default:
+ if ((mode & ~PDO_FETCH_FLAGS) < PDO_FETCH__MAX && (mode & ~PDO_FETCH_FLAGS) >= 0) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "22003", "unhandled mode; this is a PDO bug, please report it" TSRMLS_CC);
+ } else {
+ pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range" TSRMLS_CC);
+ }
+ return FAILURE;
+ }
+
+ stmt->default_fetch_type = mode;
+ efree(args);
+
+ return SUCCESS;
+}
+
+static PHP_METHOD(PDOStatement, setFetchMode)
+{
+ PHP_STMT_GET_OBJ;
+
+ RETVAL_BOOL(
+ pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAM_PASSTHRU,
+ stmt, 0) == SUCCESS ? 1 : 0
+ );
+}
+/* }}} */
+
+/* {{{ proto bool PDOStatement::nextRowset()
+ Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeded, false otherwise */
+
+static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ if (!stmt->methods->next_rowset(stmt TSRMLS_CC)) {
+ return 0;
+ }
+
+ /* un-describe */
+ if (stmt->columns) {
+ int i;
+ struct pdo_column_data *cols = stmt->columns;
+
+ for (i = 0; i < stmt->column_count; i++) {
+ efree(cols[i].name);
+ }
+ efree(stmt->columns);
+ stmt->columns = NULL;
+ stmt->column_count = 0;
+ }
+
+ pdo_stmt_describe_columns(stmt TSRMLS_CC);
+
+ return 1;
+}
+
+static PHP_METHOD(PDOStatement, nextRowset)
+{
+ PHP_STMT_GET_OBJ;
+
+ if (!stmt->methods->next_rowset) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver does not support multiple rowsets" TSRMLS_CC);
+ RETURN_FALSE;
+ }
+
+ PDO_STMT_CLEAR_ERR();
+
+ if (!pdo_stmt_do_next_rowset(stmt TSRMLS_CC)) {
+ PDO_HANDLE_STMT_ERR();
+ RETURN_FALSE;
+ }
+
+ pdo_stmt_describe_columns(stmt TSRMLS_CC);
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool PDOStatement::closeCursor()
+ Closes the cursor, leaving the statement ready for re-execution. */
+static PHP_METHOD(PDOStatement, closeCursor)
+{
+ PHP_STMT_GET_OBJ;
+
+ if (!stmt->methods->cursor_closer) {
+ /* emulate it by fetching and discarding rows */
+ do {
+ while (stmt->methods->fetcher(stmt, PDO_FETCH_ORI_NEXT, 0 TSRMLS_CC))
+ ;
+ if (!stmt->methods->next_rowset) {
+ break;
+ }
+
+ if (!pdo_stmt_do_next_rowset(stmt TSRMLS_CC)) {
+ break;
+ }
+
+ } while (1);
+ RETURN_TRUE;
+ }
+
+ PDO_STMT_CLEAR_ERR();
+
+ if (!stmt->methods->cursor_closer(stmt TSRMLS_CC)) {
+ PDO_HANDLE_STMT_ERR();
+ RETURN_FALSE;
+ }
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto void PDOStatement::debugDumpParams()
+ A utility for internals hackers to debug parameter internals */
+static PHP_METHOD(PDOStatement, debugDumpParams)
+{
+ php_stream *out = php_stream_open_wrapper("php://output", "w", 0, NULL);
+ HashPosition pos;
+ struct pdo_bound_param_data *param;
+ PHP_STMT_GET_OBJ;
+
+ php_stream_printf(out TSRMLS_CC, "SQL: [%d] %.*s\n",
+ stmt->query_stringlen,
+ stmt->query_stringlen, stmt->query_string);
+
+ php_stream_printf(out TSRMLS_CC, "Params: %d\n",
+ stmt->bound_params ? zend_hash_num_elements(stmt->bound_params) : 0);
+
+ if (stmt->bound_params) {
+ zend_hash_internal_pointer_reset_ex(stmt->bound_params, &pos);
+ while (SUCCESS == zend_hash_get_current_data_ex(stmt->bound_params,
+ (void**)&param, &pos)) {
+ char *str;
+ uint len;
+ ulong num;
+
+ if (zend_hash_get_current_key_ex(stmt->bound_params, &str, &len, &num, 0, &pos) == HASH_KEY_IS_STRING) {
+ php_stream_printf(out TSRMLS_CC, "Key: Position #%d:\n", num);
+ } else {
+ php_stream_printf(out TSRMLS_CC, "Key: Name: [%d] %.*s\n", len, len, str);
+ }
+
+ php_stream_printf(out TSRMLS_CC, "paramno=%d\nname=[%d] %.*s\nis_param=%d\nparam_type=%d\n",
+ param->paramno, param->namelen, param->namelen, param->name,
+ param->is_param,
+ param->param_type);
+
+ }
+ }
+
+ php_stream_close(out);
+}
+/* }}} */
+
+/* {{{ proto int PDOStatement::__wakeup()
+ Prevents use of a PDOStatement instance that has been unserialized */
+static PHP_METHOD(PDOStatement, __wakeup)
+{
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDOStatement instances");
+}
+/* }}} */
+
+/* {{{ proto int PDOStatement::__sleep()
+ Prevents serialization of a PDOStatement instance */
+static PHP_METHOD(PDOStatement, __sleep)
+{
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDOStatement instances");
+}
+/* }}} */
+
+function_entry pdo_dbstmt_functions[] = {
+ PHP_ME(PDOStatement, execute, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, fetch, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, bindParam, second_arg_force_ref, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, bindColumn, second_arg_force_ref, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, bindValue, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, rowCount, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, fetchColumn, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, fetchAll, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, fetchObject, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, errorCode, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, errorInfo, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, setAttribute, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, getAttribute, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, columnCount, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, getColumnMeta, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, setFetchMode, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, nextRowset, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, closeCursor, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, debugDumpParams, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(PDOStatement, __wakeup, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+ PHP_ME(PDOStatement, __sleep, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+ {NULL, NULL, NULL}
+};
+
+/* {{{ overloaded handlers for PDOStatement class */
+static void dbstmt_prop_write(zval *object, zval *member, zval *value TSRMLS_DC)
+{
+ pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC);
+
+ convert_to_string(member);
+
+ if(strcmp(Z_STRVAL_P(member), "queryString") == 0) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only" TSRMLS_CC);
+ } else {
+ std_object_handlers.write_property(object, member, value TSRMLS_CC);
+ }
+}
+
+static void dbstmt_prop_delete(zval *object, zval *member TSRMLS_DC)
+{
+ pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC);
+
+ convert_to_string(member);
+
+ if(strcmp(Z_STRVAL_P(member), "queryString") == 0) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only" TSRMLS_CC);
+ } else {
+ std_object_handlers.unset_property(object, member TSRMLS_CC);
+ }
+}
+
+static union _zend_function *dbstmt_method_get(
+#if PHP_API_VERSION >= 20041225
+ zval **object_pp,
+#else
+ zval *object,
+#endif
+ char *method_name, int method_len TSRMLS_DC)
+{
+ zend_function *fbc = NULL;
+ char *lc_method_name;
+#if PHP_API_VERSION >= 20041225
+ zval *object = *object_pp;
+#endif
+
+ lc_method_name = emalloc(method_len + 1);
+ zend_str_tolower_copy(lc_method_name, method_name, method_len);
+
+ if (zend_hash_find(&Z_OBJCE_P(object)->function_table, lc_method_name,
+ method_len+1, (void**)&fbc) == FAILURE) {
+ pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(object TSRMLS_CC);
+ /* not a pre-defined method, nor a user-defined method; check
+ * the driver specific methods */
+ if (!stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) {
+ if (!pdo_hash_methods(stmt->dbh,
+ PDO_DBH_DRIVER_METHOD_KIND_STMT TSRMLS_CC)
+ || !stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) {
+ goto out;
+ }
+ }
+
+ if (zend_hash_find(stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT],
+ lc_method_name, method_len+1, (void**)&fbc) == FAILURE) {
+ fbc = NULL;
+ goto out;
+ }
+ /* got it */
+ }
+
+out:
+ efree(lc_method_name);
+ return fbc;
+}
+
+static int dbstmt_compare(zval *object1, zval *object2 TSRMLS_DC)
+{
+ return -1;
+}
+
+zend_object_handlers pdo_dbstmt_object_handlers;
+
+void pdo_stmt_init(TSRMLS_D)
+{
+ zend_class_entry ce;
+
+ INIT_CLASS_ENTRY(ce, "PDOStatement", pdo_dbstmt_functions);
+ pdo_dbstmt_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ pdo_dbstmt_ce->get_iterator = pdo_stmt_iter_get;
+ pdo_dbstmt_ce->create_object = pdo_dbstmt_new;
+ zend_class_implements(pdo_dbstmt_ce TSRMLS_CC, 1, zend_ce_traversable);
+ zend_declare_property_null(pdo_dbstmt_ce, "queryString", sizeof("queryString")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
+
+ memcpy(&pdo_dbstmt_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
+ pdo_dbstmt_object_handlers.write_property = dbstmt_prop_write;
+ pdo_dbstmt_object_handlers.unset_property = dbstmt_prop_delete;
+ pdo_dbstmt_object_handlers.get_method = dbstmt_method_get;
+ pdo_dbstmt_object_handlers.compare_objects = dbstmt_compare;
+
+ INIT_CLASS_ENTRY(ce, "PDORow", pdo_row_functions);
+ pdo_row_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ pdo_row_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; /* when removing this a lot of handlers need to be redone */
+ pdo_row_ce->create_object = pdo_row_new;
+}
+
+static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ if (stmt->properties) {
+ zend_hash_destroy(stmt->properties);
+ efree(stmt->properties);
+ stmt->properties = NULL;
+ }
+
+ if (stmt->bound_params) {
+ zend_hash_destroy(stmt->bound_params);
+ FREE_HASHTABLE(stmt->bound_params);
+ stmt->bound_params = NULL;
+ }
+ if (stmt->bound_param_map) {
+ zend_hash_destroy(stmt->bound_param_map);
+ FREE_HASHTABLE(stmt->bound_param_map);
+ stmt->bound_param_map = NULL;
+ }
+ if (stmt->bound_columns) {
+ zend_hash_destroy(stmt->bound_columns);
+ FREE_HASHTABLE(stmt->bound_columns);
+ stmt->bound_columns = NULL;
+ }
+
+ if (stmt->methods && stmt->methods->dtor) {
+ stmt->methods->dtor(stmt TSRMLS_CC);
+ }
+ if (stmt->query_string) {
+ efree(stmt->query_string);
+ }
+
+ if (stmt->columns) {
+ int i;
+ struct pdo_column_data *cols = stmt->columns;
+
+ for (i = 0; i < stmt->column_count; i++) {
+ if (cols[i].name) {
+ efree(cols[i].name);
+ cols[i].name = NULL;
+ }
+ }
+ efree(stmt->columns);
+ stmt->columns = NULL;
+ }
+
+ if (stmt->fetch.into && stmt->default_fetch_type == PDO_FETCH_INTO) {
+ FREE_ZVAL(stmt->fetch.into);
+ stmt->fetch.into = NULL;
+ }
+
+ do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
+
+ zend_objects_store_del_ref(&stmt->database_object_handle TSRMLS_CC);
+ efree(stmt);
+}
+
+PDO_API void php_pdo_stmt_addref(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ stmt->refcount++;
+}
+
+PDO_API void php_pdo_stmt_delref(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ if (--stmt->refcount == 0) {
+ free_statement(stmt TSRMLS_CC);
+ }
+}
+
+void pdo_dbstmt_free_storage(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ php_pdo_stmt_delref(stmt TSRMLS_CC);
+}
+
+zend_object_value pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC)
+{
+ zend_object_value retval;
+ zval *tmp;
+
+ pdo_stmt_t *stmt;
+ stmt = emalloc(sizeof(*stmt));
+ memset(stmt, 0, sizeof(*stmt));
+ stmt->ce = ce;
+ stmt->refcount = 1;
+ ALLOC_HASHTABLE(stmt->properties);
+ zend_hash_init(stmt->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(stmt->properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+
+ retval.handle = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbstmt_free_storage, NULL TSRMLS_CC);
+ retval.handlers = &pdo_dbstmt_object_handlers;
+
+ return retval;
+}
+/* }}} */
+
+/* {{{ statement iterator */
+
+struct php_pdo_iterator {
+ zend_object_iterator iter;
+ pdo_stmt_t *stmt;
+ ulong key;
+ zval *fetch_ahead;
+};
+
+static void pdo_stmt_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
+{
+ struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data;
+
+ if (--I->stmt->refcount == 0) {
+ free_statement(I->stmt TSRMLS_CC);
+ }
+
+ if (I->fetch_ahead) {
+ zval_ptr_dtor(&I->fetch_ahead);
+ }
+
+ efree(I);
+}
+
+static int pdo_stmt_iter_valid(zend_object_iterator *iter TSRMLS_DC)
+{
+ struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data;
+
+ return I->fetch_ahead ? SUCCESS : FAILURE;
+}
+
+static void pdo_stmt_iter_get_data(zend_object_iterator *iter, zval ***data TSRMLS_DC)
+{
+ struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data;
+
+ /* sanity */
+ if (!I->fetch_ahead) {
+ *data = NULL;
+ return;
+ }
+
+ *data = &I->fetch_ahead;
+}
+
+static int pdo_stmt_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len,
+ ulong *int_key TSRMLS_DC)
+{
+ struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data;
+
+ if (I->key == (ulong)-1) {
+ return HASH_KEY_NON_EXISTANT;
+ }
+ *int_key = I->key;
+ return HASH_KEY_IS_LONG;
+}
+
+static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
+{
+ struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter->data;
+
+ if (I->fetch_ahead) {
+ zval_ptr_dtor(&I->fetch_ahead);
+ I->fetch_ahead = NULL;
+ }
+
+ MAKE_STD_ZVAL(I->fetch_ahead);
+
+ if (!do_fetch(I->stmt, TRUE, I->fetch_ahead, PDO_FETCH_USE_DEFAULT,
+ PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC)) {
+ pdo_stmt_t *stmt = I->stmt; /* for PDO_HANDLE_STMT_ERR() */
+
+ PDO_HANDLE_STMT_ERR();
+ I->key = (ulong)-1;
+ FREE_ZVAL(I->fetch_ahead);
+ I->fetch_ahead = NULL;
+
+ return;
+ }
+
+ I->key++;
+}
+
+static zend_object_iterator_funcs pdo_stmt_iter_funcs = {
+ pdo_stmt_iter_dtor,
+ pdo_stmt_iter_valid,
+ pdo_stmt_iter_get_data,
+ pdo_stmt_iter_get_key,
+ pdo_stmt_iter_move_forwards,
+ NULL
+};
+
+zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC)
+{
+ pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(object TSRMLS_CC);
+ struct php_pdo_iterator *I;
+
+ I = ecalloc(1, sizeof(*I));
+ I->iter.funcs = &pdo_stmt_iter_funcs;
+ I->iter.data = I;
+ I->stmt = stmt;
+ stmt->refcount++;
+
+ MAKE_STD_ZVAL(I->fetch_ahead);
+ if (!do_fetch(I->stmt, TRUE, I->fetch_ahead, PDO_FETCH_USE_DEFAULT,
+ PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC)) {
+ PDO_HANDLE_STMT_ERR();
+ I->key = (ulong)-1;
+ FREE_ZVAL(I->fetch_ahead);
+ I->fetch_ahead = NULL;
+ }
+
+ return &I->iter;
+}
+
+/* }}} */
+
+/* {{{ overloaded handlers for PDORow class (used by PDO_FETCH_LAZY) */
+
+function_entry pdo_row_functions[] = {
+ {NULL, NULL, NULL}
+};
+
+static zval *row_prop_or_dim_read(zval *object, zval *member, int type TSRMLS_DC)
+{
+ zval *return_value;
+ pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC);
+ int colno = -1;
+
+ MAKE_STD_ZVAL(return_value);
+
+ if (Z_TYPE_P(member) == IS_LONG) {
+ if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) {
+ fetch_value(stmt, return_value, Z_LVAL_P(member), NULL TSRMLS_CC);
+ }
+ } else {
+ convert_to_string(member);
+ /* TODO: replace this with a hash of available column names to column
+ * numbers */
+ for (colno = 0; colno < stmt->column_count; colno++) {
+ if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) {
+ fetch_value(stmt, return_value, colno, NULL TSRMLS_CC);
+ break;
+ }
+ }
+ }
+
+ return_value->refcount = 0;
+ return_value->is_ref = 0;
+
+ return return_value;
+}
+
+static void row_prop_or_dim_write(zval *object, zval *member, zval *value TSRMLS_DC)
+{
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set");
+}
+
+static int row_prop_or_dim_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+{
+ pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC);
+ int colno = -1;
+
+ if (Z_TYPE_P(member) == IS_LONG) {
+ return Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count;
+ } else {
+ convert_to_string(member);
+
+ /* TODO: replace this with a hash of available column names to column
+ * numbers */
+ for (colno = 0; colno < stmt->column_count; colno++) {
+ if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) {
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+static void row_prop_or_dim_delete(zval *object, zval *offset TSRMLS_DC)
+{
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a PDORow");
+}
+
+static HashTable *row_get_properties(zval *object TSRMLS_DC)
+{
+ zval *tmp;
+ pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object TSRMLS_CC);
+ int i;
+ HashTable *ht;
+
+ MAKE_STD_ZVAL(tmp);
+ array_init(tmp);
+
+ for (i = 0; i < stmt->column_count; i++) {
+ zval *val;
+ MAKE_STD_ZVAL(val);
+ fetch_value(stmt, val, i, NULL TSRMLS_CC);
+
+ add_assoc_zval(tmp, stmt->columns[i].name, val);
+ }
+
+ ht = Z_ARRVAL_P(tmp);
+
+ ZVAL_NULL(tmp);
+ FREE_ZVAL(tmp);
+
+ return ht;
+}
+
+static union _zend_function *row_method_get(
+#if PHP_API_VERSION >= 20041225
+ zval **object_pp,
+#else
+ zval *object,
+#endif
+ char *method_name, int method_len TSRMLS_DC)
+{
+ zend_function *fbc;
+ char *lc_method_name;
+
+ lc_method_name = emalloc(method_len + 1);
+ zend_str_tolower_copy(lc_method_name, method_name, method_len);
+
+ if (zend_hash_find(&pdo_row_ce->function_table, lc_method_name, method_len+1, (void**)&fbc) == FAILURE) {
+ efree(lc_method_name);
+ return NULL;
+ }
+
+ efree(lc_method_name);
+ return fbc;
+}
+
+static int row_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
+{
+ return FAILURE;
+}
+
+static union _zend_function *row_get_ctor(zval *object TSRMLS_DC)
+{
+ static zend_internal_function ctor = {0};
+
+ ctor.type = ZEND_INTERNAL_FUNCTION;
+ ctor.function_name = "__construct";
+ ctor.scope = pdo_row_ce;
+ ctor.handler = ZEND_FN(dbstmt_constructor);
+
+ return (union _zend_function*)&ctor;
+}
+
+static zend_class_entry *row_get_ce(zval *object TSRMLS_DC)
+{
+ return pdo_dbstmt_ce;
+}
+
+static int row_get_classname(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
+{
+ *class_name = estrndup("PDORow", sizeof("PDORow")-1);
+ *class_name_len = sizeof("PDORow")-1;
+ return 0;
+}
+
+static int row_compare(zval *object1, zval *object2 TSRMLS_DC)
+{
+ return -1;
+}
+
+zend_object_handlers pdo_row_object_handlers = {
+ ZEND_OBJECTS_STORE_HANDLERS,
+ row_prop_or_dim_read,
+ row_prop_or_dim_write,
+ row_prop_or_dim_read,
+ row_prop_or_dim_write,
+ NULL,
+ NULL,
+ NULL,
+ row_prop_or_dim_exists,
+ row_prop_or_dim_delete,
+ row_prop_or_dim_exists,
+ row_prop_or_dim_delete,
+ row_get_properties,
+ row_method_get,
+ row_call_method,
+ row_get_ctor,
+ row_get_ce,
+ row_get_classname,
+ row_compare,
+ NULL, /* cast */
+ NULL
+};
+
+void pdo_row_free_storage(pdo_stmt_t *stmt TSRMLS_DC)
+{
+#if 0
+ ZVAL_NULL(&stmt->lazy_object_ref);
+
+ if (--stmt->refcount == 0) {
+ free_statement(stmt TSRMLS_CC);
+ }
+#endif
+}
+
+zend_object_value pdo_row_new(zend_class_entry *ce TSRMLS_DC)
+{
+ zend_object_value retval;
+
+ retval.handle = zend_objects_store_put(NULL, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_row_free_storage, NULL TSRMLS_CC);
+ retval.handlers = &pdo_row_object_handlers;
+
+ return retval;
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h
new file mode 100755
index 000000000..c5f9c4c5b
--- /dev/null
+++ b/ext/pdo/php_pdo.h
@@ -0,0 +1,91 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo.h,v 1.7.2.4 2005/10/02 20:38:18 helly Exp $ */
+
+#ifndef PHP_PDO_H
+#define PHP_PDO_H
+
+#include "zend.h"
+
+#if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1)
+#define can_handle_soft_dependency_on_SPL 1
+#endif
+
+extern zend_module_entry pdo_module_entry;
+#define phpext_pdo_ptr &pdo_module_entry
+
+#ifdef PHP_WIN32
+# if defined(PDO_EXPORTS) || (!defined(COMPILE_DL_PDO))
+# define PDO_API __declspec(dllexport)
+# elif defined(COMPILE_DL_PDO)
+# define PDO_API __declspec(dllimport)
+# else
+# define PDO_API /* nothing special */
+# endif
+#else
+# define PDO_API /* nothing special */
+#endif
+
+#ifdef ZTS
+# include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(pdo);
+PHP_MSHUTDOWN_FUNCTION(pdo);
+PHP_RINIT_FUNCTION(pdo);
+PHP_RSHUTDOWN_FUNCTION(pdo);
+PHP_MINFO_FUNCTION(pdo);
+
+ZEND_BEGIN_MODULE_GLOBALS(pdo)
+ long global_value;
+ZEND_END_MODULE_GLOBALS(pdo)
+
+#ifdef ZTS
+# define PDOG(v) TSRMG(pdo_globals_id, zend_pdo_globals *, v)
+#else
+# define PDOG(v) (pdo_globals.v)
+#endif
+
+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);
+
+#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);
+
+#define PDO_CONSTRUCT_CHECK \
+ if (!dbh->driver) { \
+ pdo_raise_impl_error(dbh, NULL, "00000", "PDO constructor was not called" TSRMLS_CC); \
+ return; \
+ } \
+
+
+#endif /* PHP_PDO_H */
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
new file mode 100755
index 000000000..fefb5449d
--- /dev/null
+++ b/ext/pdo/php_pdo_driver.h
@@ -0,0 +1,660 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_driver.h,v 1.66.2.6 2005/10/31 02:07:37 wez Exp $ */
+
+#ifndef PHP_PDO_DRIVER_H
+#define PHP_PDO_DRIVER_H
+
+#include "php_pdo.h"
+
+/* forward declarations */
+typedef struct _pdo_dbh_t pdo_dbh_t;
+typedef struct _pdo_stmt_t pdo_stmt_t;
+struct pdo_bound_param_data;
+
+#ifdef PHP_WIN32
+typedef __int64 pdo_int64_t;
+typedef unsigned __int64 pdo_uint64_t;
+#else
+typedef long long int pdo_int64_t;
+typedef unsigned long long int pdo_uint64_t;
+#endif
+PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC);
+
+#ifndef TRUE
+# define TRUE 1
+#endif
+#ifndef FALSE
+# define FALSE 0
+#endif
+
+#define PDO_DRIVER_API 20051031
+
+enum pdo_param_type {
+ PDO_PARAM_NULL,
+
+ /* int as in long (the php native int type).
+ * If you mark a column as an int, PDO expects get_col to return
+ * a pointer to a long */
+ PDO_PARAM_INT,
+
+ /* get_col ptr should point to start of the string buffer */
+ PDO_PARAM_STR,
+
+ /* get_col: when len is 0 ptr should point to a php_stream *,
+ * otherwise it should behave like a string. Indicate a NULL field
+ * value by setting the ptr to NULL */
+ PDO_PARAM_LOB,
+
+ /* get_col: will expect the ptr to point to a new PDOStatement object handle,
+ * but this isn't wired up yet */
+ PDO_PARAM_STMT, /* hierarchical result set */
+
+ /* get_col ptr should point to a zend_bool */
+ PDO_PARAM_BOOL,
+};
+
+/* magic flag to denote a parameter as being input/output */
+#define PDO_PARAM_INPUT_OUTPUT 0x80000000
+
+#define PDO_PARAM_FLAGS 0xFFFF0000
+
+#define PDO_PARAM_TYPE(x) ((x) & ~PDO_PARAM_FLAGS)
+
+enum pdo_fetch_type {
+ PDO_FETCH_USE_DEFAULT,
+ PDO_FETCH_LAZY,
+ PDO_FETCH_ASSOC,
+ PDO_FETCH_NUM,
+ PDO_FETCH_BOTH,
+ PDO_FETCH_OBJ,
+ PDO_FETCH_BOUND, /* return true/false only; rely on bound columns */
+ PDO_FETCH_COLUMN, /* fetch a numbered column only */
+ PDO_FETCH_CLASS, /* create an instance of named class, call ctor and set properties */
+ PDO_FETCH_INTO, /* fetch row into an existing object */
+ PDO_FETCH_FUNC, /* fetch into function and return its result */
+ PDO_FETCH_NAMED, /* like PDO_FETCH_ASSOC, but can handle duplicate names */
+ PDO_FETCH__MAX /* must be last */
+};
+
+#define PDO_FETCH_FLAGS 0xFFFF0000 /* fetchAll() modes or'd to PDO_FETCH_XYZ */
+#define PDO_FETCH_GROUP 0x00010000 /* fetch into groups */
+#define PDO_FETCH_UNIQUE 0x00030000 /* fetch into groups assuming first col is unique */
+#define PDO_FETCH_CLASSTYPE 0x00040000 /* fetch class gets its class name from 1st column */
+#define PDO_FETCH_SERIALIZE 0x00080000 /* fetch class instances by calling serialize */
+
+/* fetch orientation for scrollable cursors */
+enum pdo_fetch_orientation {
+ PDO_FETCH_ORI_NEXT, /* default: fetch the next available row */
+ PDO_FETCH_ORI_PRIOR, /* scroll back to prior row and fetch that */
+ PDO_FETCH_ORI_FIRST, /* scroll to the first row and fetch that */
+ PDO_FETCH_ORI_LAST, /* scroll to the last row and fetch that */
+ PDO_FETCH_ORI_ABS, /* scroll to an absolute numbered row and fetch that */
+ PDO_FETCH_ORI_REL /* scroll relative to the current row, and fetch that */
+};
+
+enum pdo_attribute_type {
+ PDO_ATTR_AUTOCOMMIT, /* use to turn on or off auto-commit mode */
+ PDO_ATTR_PREFETCH, /* configure the prefetch size for drivers that support it. Size is in KB */
+ PDO_ATTR_TIMEOUT, /* connection timeout in seconds */
+ PDO_ATTR_ERRMODE, /* control how errors are handled */
+ PDO_ATTR_SERVER_VERSION, /* database server version */
+ PDO_ATTR_CLIENT_VERSION, /* client library version */
+ PDO_ATTR_SERVER_INFO, /* server information */
+ PDO_ATTR_CONNECTION_STATUS, /* connection status */
+ PDO_ATTR_CASE, /* control case folding for portability */
+ PDO_ATTR_CURSOR_NAME, /* name a cursor for use in "WHERE CURRENT OF <name>" */
+ PDO_ATTR_CURSOR, /* cursor type */
+ PDO_ATTR_ORACLE_NULLS, /* convert empty strings to NULL */
+ PDO_ATTR_PERSISTENT, /* pconnect style connection */
+ PDO_ATTR_STATEMENT_CLASS, /* array(classname, array(ctor_args)) to specify the class of the constructed statement */
+ PDO_ATTR_FETCH_TABLE_NAMES, /* include table names in the column names, where available */
+ PDO_ATTR_FETCH_CATALOG_NAMES, /* include the catalog/db name names in the column names, where available */
+ PDO_ATTR_DRIVER_NAME, /* name of the driver (as used in the constructor) */
+ PDO_ATTR_STRINGIFY_FETCHES, /* converts integer/float types to strings during fetch */
+ PDO_ATTR_MAX_COLUMN_LEN, /* make database calculate maximum length of data found in a column */
+
+ /* this defines the start of the range for driver specific options.
+ * Drivers should define their own attribute constants beginning with this
+ * value. */
+ PDO_ATTR_DRIVER_SPECIFIC = 1000
+};
+
+enum pdo_cursor_type {
+ PDO_CURSOR_FWDONLY, /* forward only cursor (default) */
+ PDO_CURSOR_SCROLL /* scrollable cursor */
+};
+
+/* SQL-92 SQLSTATE error codes.
+
+The character string value returned for an SQLSTATE consists of a two-character
+class value followed by a three-character subclass value. A class value of 01
+indicates a warning and is accompanied by a return code of
+SQL_SUCCESS_WITH_INFO.
+
+Class values other than '01', except for the class 'IM',
+indicate an error and are accompanied by a return code of SQL_ERROR. The class
+'IM' is specific to warnings and errors that derive from the implementation of
+ODBC itself.
+
+The subclass value '000' in any class indicates that there is no
+subclass for that SQLSTATE. The assignment of class and subclass values is
+defined by SQL-92.
+*/
+
+typedef char pdo_error_type[6]; /* SQLSTATE */
+
+
+#define PDO_ERR_NONE "00000"
+
+enum pdo_error_mode {
+ PDO_ERRMODE_SILENT, /* just set error codes */
+ PDO_ERRMODE_WARNING, /* raise E_WARNING */
+ PDO_ERRMODE_EXCEPTION /* throw exceptions */
+};
+
+enum pdo_case_conversion {
+ PDO_CASE_NATURAL,
+ PDO_CASE_UPPER,
+ PDO_CASE_LOWER
+};
+
+/* oracle interop settings */
+enum pdo_null_handling {
+ PDO_NULL_NATURAL = 0,
+ PDO_NULL_EMPTY_STRING = 1,
+ PDO_NULL_TO_STRING = 2,
+};
+
+/* {{{ utils for reading attributes set as driver_options */
+static inline long pdo_attr_lval(zval *options, enum pdo_attribute_type option_name, long defval TSRMLS_DC)
+{
+ zval **v;
+
+ if (options && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), option_name, (void**)&v)) {
+ convert_to_long_ex(v);
+ return Z_LVAL_PP(v);
+ }
+ return defval;
+}
+static inline char *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, char *defval TSRMLS_DC)
+{
+ zval **v;
+
+ if (options && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), option_name, (void**)&v)) {
+ convert_to_string_ex(v);
+ return estrndup(Z_STRVAL_PP(v), Z_STRLEN_PP(v));
+ }
+ return defval ? estrdup(defval) : NULL;
+}
+/* }}} */
+
+/* This structure is registered with PDO when a PDO driver extension is
+ * initialized */
+typedef struct {
+ const char *driver_name;
+ unsigned long driver_name_len;
+ unsigned long api_version; /* needs to be compatible with PDO */
+
+#define PDO_DRIVER_HEADER(name) \
+ #name, sizeof(#name)-1, \
+ PDO_DRIVER_API
+
+ /* create driver specific portion of the database handle and stash it into
+ * the dbh. dbh contains the data source string and flags for this
+ * instance. You MUST respect dbh->is_persistent and pass that flag to
+ * pemalloc() for all allocations that are stored in the dbh or your instance
+ * data in the db, otherwise you will crash PHP when persistent connections
+ * are used.
+ */
+ int (*db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC);
+
+} pdo_driver_t;
+
+/* {{{ methods for a database handle */
+
+/* close or otherwise disconnect the database */
+typedef int (*pdo_dbh_close_func)(pdo_dbh_t *dbh TSRMLS_DC);
+
+/* prepare a statement and stash driver specific portion into stmt */
+typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC);
+
+/* execute a statement (that does not return a result set) */
+typedef long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC);
+
+/* quote a string */
+typedef int (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC);
+
+/* transaction related */
+typedef int (*pdo_dbh_txn_func)(pdo_dbh_t *dbh TSRMLS_DC);
+
+/* setting of attributes */
+typedef int (*pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC);
+
+/* return last insert id. NULL indicates error condition, otherwise, the return value
+ * MUST be an emalloc'd NULL terminated string. */
+typedef char *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC);
+
+/* fetch error information. if stmt is not null, fetch information pertaining
+ * to the statement, otherwise fetch global error information. The driver
+ * should add the following information to the array "info" in this order:
+ * - native error code
+ * - string representation of the error code ... any other optional driver
+ * specific data ... */
+typedef int (*pdo_dbh_fetch_error_func)(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC);
+
+/* fetching of attributes */
+typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC);
+
+/* checking/pinging persistent connections; return SUCCESS if the connection
+ * is still alive and ready to be used, FAILURE otherwise.
+ * You may set this handler to NULL, which is equivalent to returning SUCCESS. */
+typedef int (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh TSRMLS_DC);
+
+/* called at request end for each persistent dbh; this gives the driver
+ * the opportunity to safely release resources that only have per-request
+ * scope */
+typedef void (*pdo_dbh_request_shutdown)(pdo_dbh_t *dbh TSRMLS_DC);
+
+/* for adding methods to the dbh or stmt objects
+pointer to a list of driver specific functions. The convention is
+to prefix the function names using the PDO driver name; this will
+reduce the chance of collisions with future functionality in the
+PDO class or in user code (they can extend the PDO object).
+*/
+enum {
+ PDO_DBH_DRIVER_METHOD_KIND_DBH = 0,
+ PDO_DBH_DRIVER_METHOD_KIND_STMT,
+ PDO_DBH_DRIVER_METHOD_KIND__MAX
+};
+
+typedef function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind TSRMLS_DC);
+
+struct pdo_dbh_methods {
+ pdo_dbh_close_func closer;
+ pdo_dbh_prepare_func preparer;
+ pdo_dbh_do_func doer;
+ pdo_dbh_quote_func quoter;
+ pdo_dbh_txn_func begin;
+ pdo_dbh_txn_func commit;
+ pdo_dbh_txn_func rollback;
+ pdo_dbh_set_attr_func set_attribute;
+ pdo_dbh_last_id_func last_id;
+ pdo_dbh_fetch_error_func fetch_err;
+ pdo_dbh_get_attr_func get_attribute;
+ pdo_dbh_check_liveness_func check_liveness;
+ pdo_dbh_get_driver_methods_func get_driver_methods;
+ pdo_dbh_request_shutdown persistent_shutdown;
+};
+
+/* }}} */
+
+/* {{{ methods for a statement handle */
+
+/* free the statement handle */
+typedef int (*pdo_stmt_dtor_func)(pdo_stmt_t *stmt TSRMLS_DC);
+
+/* start the query */
+typedef int (*pdo_stmt_execute_func)(pdo_stmt_t *stmt TSRMLS_DC);
+
+/* causes the next row in the set to be fetched; indicates if there are no
+ * more rows. The ori and offset params modify which row should be returned,
+ * if the stmt represents a scrollable cursor */
+typedef int (*pdo_stmt_fetch_func)(pdo_stmt_t *stmt,
+ enum pdo_fetch_orientation ori, long offset TSRMLS_DC);
+
+/* queries information about the type of a column, by index (0 based).
+ * Driver should populate stmt->columns[colno] with appropriate info */
+typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno TSRMLS_DC);
+
+/* retrieves pointer and size of the value for a column.
+ * Note that PDO expects the driver to manage the lifetime of this data;
+ * it will copy the value into a zval on behalf of the script.
+ * If the driver sets caller_frees, ptr should point to emalloc'd memory
+ * and PDO will free it as soon as it is done using it.
+ */
+typedef int (*pdo_stmt_get_col_data_func)(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC);
+
+/* hook for bound params */
+enum pdo_param_event {
+ PDO_PARAM_EVT_ALLOC,
+ PDO_PARAM_EVT_FREE,
+ PDO_PARAM_EVT_EXEC_PRE,
+ PDO_PARAM_EVT_EXEC_POST,
+ PDO_PARAM_EVT_FETCH_PRE,
+ PDO_PARAM_EVT_FETCH_POST
+};
+
+typedef int (*pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC);
+
+/* setting of attributes */
+typedef int (*pdo_stmt_set_attr_func)(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC);
+
+/* fetching of attributes */
+typedef int (*pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC);
+
+/* retrieves meta data for a numbered column.
+ * Returns SUCCESS/FAILURE.
+ * On SUCCESS, fill in return_value with an array with the following fields.
+ * If a particular field is not supported, then the driver simply does not add it to
+ * the array, so that scripts can use isset() to check for it.
+ *
+ * ### this is just a rough first cut, and subject to change ###
+ *
+ * these are added by PDO itself, based on data from the describe handler:
+ * name => the column name
+ * len => the length/size of the column
+ * precision => precision of the column
+ * pdo_type => an integer, one of the PDO_PARAM_XXX values
+ *
+ * scale => the floating point scale
+ * table => the table for that column
+ * type => a string representation of the type, mapped to the PHP equivalent type name
+ * native_type => a string representation of the type, native style, if different from
+ * the mapped name.
+ * flags => an array of flags including zero or more of the following:
+ * primary_key, not_null, unique_key, multiple_key, unsigned, auto_increment, blob
+ *
+ * Any driver specific data should be returned using a prefixed key or value.
+ * Eg: custom data for the mysql driver would use either
+ * 'mysql:foobar' => 'some data' // to add a new key to the array
+ * or
+ * 'flags' => array('not_null', 'mysql:some_flag'); // to add data to an existing key
+ */
+typedef int (*pdo_stmt_get_column_meta_func)(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC);
+
+/* advances the statement to the next rowset of the batch.
+ * If it returns 1, PDO will tear down its idea of columns
+ * and meta data. If it returns 0, PDO will indicate an error
+ * to the caller. */
+typedef int (*pdo_stmt_next_rowset_func)(pdo_stmt_t *stmt TSRMLS_DC);
+
+/* closes the active cursor on a statement, leaving the prepared
+ * statement ready for re-execution. Useful to explicitly state
+ * that you are done with a given rowset, without having to explicitly
+ * fetch all the rows. */
+typedef int (*pdo_stmt_cursor_closer_func)(pdo_stmt_t *stmt TSRMLS_DC);
+
+struct pdo_stmt_methods {
+ pdo_stmt_dtor_func dtor;
+ pdo_stmt_execute_func executer;
+ pdo_stmt_fetch_func fetcher;
+ pdo_stmt_describe_col_func describer;
+ pdo_stmt_get_col_data_func get_col;
+ pdo_stmt_param_hook_func param_hook;
+ pdo_stmt_set_attr_func set_attribute;
+ pdo_stmt_get_attr_func get_attribute;
+ pdo_stmt_get_column_meta_func get_column_meta;
+ pdo_stmt_next_rowset_func next_rowset;
+ pdo_stmt_cursor_closer_func cursor_closer;
+};
+
+/* }}} */
+
+enum pdo_placeholder_support {
+ PDO_PLACEHOLDER_NONE=0,
+ PDO_PLACEHOLDER_NAMED=1,
+ PDO_PLACEHOLDER_POSITIONAL=2
+};
+
+/* represents a connection to a database */
+struct _pdo_dbh_t {
+ /* these items must appear in this order at the beginning of the
+ struct so that this can be cast as a zend_object. we need this
+ to allow the extending class to escape all the custom handlers
+ that PDO declares.
+ */
+ zend_class_entry *ce;
+ HashTable *properties;
+ unsigned int in_get:1;
+ unsigned int in_set:1;
+
+ /* driver specific methods */
+ struct pdo_dbh_methods *methods;
+ /* driver specific data */
+ void *driver_data;
+
+ /* credentials */
+ char *username, *password;
+
+ /* if true, then data stored and pointed at by this handle must all be
+ * persistently allocated */
+ unsigned is_persistent:1;
+
+ /* if true, driver should act as though a COMMIT were executed between
+ * each executed statement; otherwise, COMMIT must be carried out manually
+ * */
+ unsigned auto_commit:1;
+
+ /* if true, the handle has been closed and will not function anymore */
+ unsigned is_closed:1;
+
+ /* if true, the driver requires that memory be allocated explicitly for
+ * the columns that are returned */
+ unsigned alloc_own_columns:1;
+
+ /* if true, commit or rollBack is allowed to be called */
+ unsigned in_txn:1;
+
+ /* max length a single character can become after correct quoting */
+ unsigned max_escaped_char_length:3;
+
+ /* oracle compat; see enum pdo_null_handling */
+ unsigned oracle_nulls:2;
+
+ /* when set, convert int/floats to strings */
+ unsigned stringify:1;
+
+ /* the sum of the number of bits here and the bit fields preceeding should
+ * equal 32 */
+ unsigned _reserved_flags:21;
+
+ /* data source string used to open this handle */
+ const char *data_source;
+ unsigned long data_source_len;
+
+ /* the global error code. */
+ pdo_error_type error_code;
+
+ enum pdo_error_mode error_mode;
+
+ enum pdo_case_conversion native_case, desired_case;
+
+ /* persistent hash key associated with this handle */
+ const char *persistent_id;
+ int persistent_id_len;
+ unsigned int refcount;
+
+ /* driver specific "class" methods for the dbh and stmt */
+ HashTable *cls_methods[PDO_DBH_DRIVER_METHOD_KIND__MAX];
+
+ pdo_driver_t *driver;
+
+ zend_class_entry *def_stmt_ce;
+ zval *def_stmt_ctor_args;
+
+ /* when calling PDO::query(), we need to keep the error
+ * context from the statement around until we next clear it.
+ * This will allow us to report the correct error message
+ * when PDO::query() fails */
+ pdo_stmt_t *query_stmt;
+ zval query_stmt_zval;
+};
+
+/* describes a column */
+struct pdo_column_data {
+ char *name;
+ long namelen;
+ unsigned long maxlen;
+ enum pdo_param_type param_type;
+ unsigned long precision;
+
+ /* don't touch this unless your name is dbdo */
+ void *dbdo_data;
+};
+
+/* describes a bound parameter */
+struct pdo_bound_param_data {
+ long paramno; /* if -1, then it has a name, and we don't know the index *yet* */
+ char *name;
+ long namelen;
+
+ long max_value_len; /* as a hint for pre-allocation */
+
+ zval *parameter; /* the variable itself */
+ enum pdo_param_type param_type; /* desired or suggested type */
+
+ zval *driver_params; /* optional parameter(s) for the driver */
+ void *driver_data;
+
+ pdo_stmt_t *stmt; /* for convenience in dtor */
+ int is_param; /* parameter or column ? */
+};
+
+/* represents a prepared statement */
+struct _pdo_stmt_t {
+ /* these items must appear in this order at the beginning of the
+ struct so that this can be cast as a zend_object. we need this
+ to allow the extending class to escape all the custom handlers
+ that PDO declares.
+ */
+ zend_class_entry *ce;
+ HashTable *properties;
+ unsigned int in_get:1;
+ unsigned int in_set:1;
+
+ /* driver specifics */
+ struct pdo_stmt_methods *methods;
+ void *driver_data;
+
+ /* if true, we've already successfully executed this statement at least
+ * once */
+ unsigned executed:1;
+ /* if true, the statement supports placeholders and can implement
+ * bindParam() for its prepared statements, if false, PDO should
+ * emulate prepare and bind on its behalf */
+ unsigned supports_placeholders:2;
+
+ unsigned _reserved:29;
+
+ /* the number of columns in the result set; not valid until after
+ * the statement has been executed at least once. In some cases, might
+ * not be valid until fetch (at the driver level) has been called at least once.
+ * */
+ int column_count;
+ struct pdo_column_data *columns;
+
+ /* we want to keep the dbh alive while we live, so we own a reference */
+ zval database_object_handle;
+ pdo_dbh_t *dbh;
+
+ /* keep track of bound input parameters. Some drivers support
+ * input/output parameters, but you can't rely on that working */
+ HashTable *bound_params;
+ /* When rewriting from named to positional, this maps positions to names */
+ HashTable *bound_param_map;
+ /* keep track of PHP variables bound to named (or positional) columns
+ * in the result set */
+ HashTable *bound_columns;
+
+ /* not always meaningful */
+ long row_count;
+
+ /* used to hold the statement's current query */
+ char *query_string;
+ int query_stringlen;
+
+ /* the copy of the query with expanded binds ONLY for emulated-prepare drivers */
+ char *active_query_string;
+ int active_query_stringlen;
+
+ /* the cursor specific error code. */
+ pdo_error_type error_code;
+
+ /* for lazy fetches, we always return the same lazy object handle.
+ * Let's keep it here. */
+ zval lazy_object_ref;
+ unsigned long refcount;
+
+ /* defaults for fetches */
+ enum pdo_fetch_type default_fetch_type;
+ union {
+ int column;
+ struct {
+ zend_class_entry *ce;
+ zval *ctor_args; /* freed */
+ zval *retval_ptr;
+ zend_fcall_info fci;
+ zend_fcall_info_cache fcc;
+ } cls;
+ struct {
+ zval *function;
+ zval *fetch_args; /* freed */
+ zval *object;
+ zend_fcall_info fci;
+ zend_fcall_info_cache fcc;
+ zval **values; /* freed */
+ } func;
+ zval *into;
+ } fetch;
+
+ /* used by the query parser for driver specific
+ * parameter naming (see pgsql driver for example) */
+ const char *named_rewrite_template;
+};
+
+/* call this in MINIT to register your PDO driver */
+PDO_API int php_pdo_register_driver(pdo_driver_t *driver);
+/* call this in MSHUTDOWN to unregister your PDO driver */
+PDO_API void php_pdo_unregister_driver(pdo_driver_t *driver);
+
+/* For the convenience of drivers, this function will parse a data source
+ * string, of the form "name=value; name2=value2" and populate variables
+ * according to the data you pass in and array of pdo_data_src_parser structures */
+struct pdo_data_src_parser {
+ const char *optname;
+ char *optval;
+ int freeme;
+};
+
+PDO_API int php_pdo_parse_data_source(const char *data_source,
+ unsigned long data_source_len, struct pdo_data_src_parser *parsed,
+ int nparams);
+
+PDO_API zend_class_entry *php_pdo_get_exception(void);
+
+PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
+ char **outquery, int *outquery_len TSRMLS_DC);
+
+PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt,
+ const char *sqlstate, const char *supp TSRMLS_DC);
+
+PDO_API void php_pdo_stmt_addref(pdo_stmt_t *stmt TSRMLS_DC);
+PDO_API void php_pdo_stmt_delref(pdo_stmt_t *stmt TSRMLS_DC);
+
+
+#endif /* PHP_PDO_DRIVER_H */
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h
new file mode 100755
index 000000000..8a4724630
--- /dev/null
+++ b/ext/pdo/php_pdo_int.h
@@ -0,0 +1,84 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ | Marcus Boerger <helly@php.net> |
+ | Sterling Hughes <sterling@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_int.h,v 1.17.2.4 2005/10/02 22:11:17 wez Exp $ */
+
+/* Stuff private to the PDO extension and not for consumption by PDO drivers
+ * */
+
+extern HashTable pdo_driver_hash;
+extern zend_class_entry *pdo_exception_ce;
+PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC);
+int php_pdo_list_entry(void);
+
+void pdo_dbh_init(TSRMLS_D);
+void pdo_stmt_init(TSRMLS_D);
+
+extern zend_object_value pdo_dbh_new(zend_class_entry *ce TSRMLS_DC);
+extern function_entry pdo_dbh_functions[];
+extern zend_class_entry *pdo_dbh_ce;
+extern ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor);
+
+extern zend_object_value pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC);
+extern function_entry pdo_dbstmt_functions[];
+extern zend_class_entry *pdo_dbstmt_ce;
+void pdo_dbstmt_free_storage(pdo_stmt_t *stmt TSRMLS_DC);
+zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC);
+extern zend_object_handlers pdo_dbstmt_object_handlers;
+int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC);
+int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip_first_arg);
+
+extern zend_object_value pdo_row_new(zend_class_entry *ce TSRMLS_DC);
+extern function_entry pdo_row_functions[];
+extern zend_class_entry *pdo_row_ce;
+void pdo_row_free_storage(pdo_stmt_t *stmt TSRMLS_DC);
+extern zend_object_handlers pdo_row_object_handlers;
+
+zend_object_iterator *php_pdo_dbstmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC);
+
+extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);
+
+extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
+
+#define PDO_DBH_CLEAR_ERR() do { \
+ strcpy(dbh->error_code, PDO_ERR_NONE); \
+ if (dbh->query_stmt) { \
+ dbh->query_stmt = NULL; \
+ zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \
+ } \
+} while (0)
+#define PDO_STMT_CLEAR_ERR() strcpy(stmt->error_code, PDO_ERR_NONE)
+#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL TSRMLS_CC); }
+#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt TSRMLS_CC); }
+
+int pdo_sqlstate_init_error_table(void);
+void pdo_sqlstate_fini_error_table(void);
+const char *pdo_sqlstate_state_to_description(char *state);
+int pdo_hash_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC);
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo/tests/bug_34630.phpt b/ext/pdo/tests/bug_34630.phpt
new file mode 100644
index 000000000..dd5f6fce0
--- /dev/null
+++ b/ext/pdo/tests/bug_34630.phpt
@@ -0,0 +1,57 @@
+--TEST--
+PDO Common: PHP Bug #34630: inserting streams as LOBs
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$driver = $db->getAttribute(PDO::ATTR_DRIVER_NAME);
+$is_oci = $driver == 'oci';
+
+if ($is_oci) {
+ $db->exec('CREATE TABLE test (id int NOT NULL PRIMARY KEY, val BLOB)');
+} else {
+ $db->exec('CREATE TABLE test (id int NOT NULL PRIMARY KEY, val VARCHAR(256))');
+}
+$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+$fp = tmpfile();
+fwrite($fp, "I am the LOB data");
+rewind($fp);
+
+if ($is_oci) {
+ /* oracle is a bit different; you need to initiate a transaction otherwise
+ * the empty blob will be committed implicitly when the statement is
+ * executed */
+ $db->beginTransaction();
+ $insert = $db->prepare("insert into test (id, val) values (1, EMPTY_BLOB()) RETURNING val INTO :blob");
+} else {
+ $insert = $db->prepare("insert into test (id, val) values (1, :blob)");
+}
+$insert->bindValue(':blob', $fp, PDO::PARAM_LOB);
+$insert->execute();
+$insert = null;
+
+$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
+var_dump($db->query("SELECT * from test")->fetchAll(PDO::FETCH_ASSOC));
+
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ array(2) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(17) "I am the LOB data"
+ }
+}
diff --git a/ext/pdo/tests/bug_34687.phpt b/ext/pdo/tests/bug_34687.phpt
new file mode 100644
index 000000000..3ab78189d
--- /dev/null
+++ b/ext/pdo/tests/bug_34687.phpt
@@ -0,0 +1,32 @@
+--TEST--
+PDO Common: PHP Bug #34687: query doesn't return error information
+--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 getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
+$x = $db->query("UPDATE non_existent_pdo_test_table set foo = 'bar'");
+
+var_dump($x);
+$code = $db->errorCode();
+if ($code !== '00000' && strlen($code)) {
+ echo "OK: $code\n";
+} else {
+ echo "ERR: $code\n";
+ print_r($db->errorInfo());
+}
+
+?>
+--EXPECTF--
+bool(false)
+OK: %s
diff --git a/ext/pdo/tests/pdo.inc b/ext/pdo/tests/pdo.inc
new file mode 100755
index 000000000..c9deeb0e6
--- /dev/null
+++ b/ext/pdo/tests/pdo.inc
@@ -0,0 +1,11 @@
+<?php
+
+function set_sql($name, $query)
+{
+ if (empty($GLOBALS['SQL'][$name]))
+ {
+ $GLOBALS['SQL'][$name] = $query;
+ }
+}
+
+?>
diff --git a/ext/pdo/tests/pdo_001.phpt b/ext/pdo/tests/pdo_001.phpt
new file mode 100644
index 000000000..3b79a09a9
--- /dev/null
+++ b/ext/pdo/tests/pdo_001.phpt
@@ -0,0 +1,50 @@
+--TEST--
+PDO Common: PDO::FETCH_ASSOC
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
+$db->exec("INSERT INTO test VALUES(1, 'A')");
+$db->exec("INSERT INTO test VALUES(2, 'B')");
+$db->exec("INSERT INTO test VALUES(3, 'C')");
+
+$stmt = $db->prepare('SELECT * from test');
+$stmt->execute();
+
+var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ array(2) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(1) "A"
+ }
+ [1]=>
+ array(2) {
+ ["id"]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ }
+ [2]=>
+ array(2) {
+ ["id"]=>
+ string(1) "3"
+ ["val"]=>
+ string(1) "C"
+ }
+}
diff --git a/ext/pdo/tests/pdo_002.phpt b/ext/pdo/tests/pdo_002.phpt
new file mode 100644
index 000000000..047fd5941
--- /dev/null
+++ b/ext/pdo/tests/pdo_002.phpt
@@ -0,0 +1,50 @@
+--TEST--
+PDO Common: PDO::FETCH_NUM
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
+$db->exec("INSERT INTO test VALUES(1, 'A')");
+$db->exec("INSERT INTO test VALUES(2, 'B')");
+$db->exec("INSERT INTO test VALUES(3, 'C')");
+
+$stmt = $db->prepare('SELECT * from test');
+$stmt->execute();
+
+var_dump($stmt->fetchAll(PDO::FETCH_NUM));
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "A"
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "2"
+ [1]=>
+ string(1) "B"
+ }
+ [2]=>
+ array(2) {
+ [0]=>
+ string(1) "3"
+ [1]=>
+ string(1) "C"
+ }
+}
diff --git a/ext/pdo/tests/pdo_003.phpt b/ext/pdo/tests/pdo_003.phpt
new file mode 100644
index 000000000..ccd23c8eb
--- /dev/null
+++ b/ext/pdo/tests/pdo_003.phpt
@@ -0,0 +1,62 @@
+--TEST--
+PDO Common: PDO::FETCH_BOTH
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
+$db->exec("INSERT INTO test VALUES(1, 'A')");
+$db->exec("INSERT INTO test VALUES(2, 'B')");
+$db->exec("INSERT INTO test VALUES(3, 'C')");
+
+$stmt = $db->prepare('SELECT * from test');
+$stmt->execute();
+
+var_dump($stmt->fetchAll(PDO::FETCH_BOTH));
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ array(4) {
+ ["id"]=>
+ string(1) "1"
+ [0]=>
+ string(1) "1"
+ ["val"]=>
+ string(1) "A"
+ [1]=>
+ string(1) "A"
+ }
+ [1]=>
+ array(4) {
+ ["id"]=>
+ string(1) "2"
+ [0]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ [1]=>
+ string(1) "B"
+ }
+ [2]=>
+ array(4) {
+ ["id"]=>
+ string(1) "3"
+ [0]=>
+ string(1) "3"
+ ["val"]=>
+ string(1) "C"
+ [1]=>
+ string(1) "C"
+ }
+}
diff --git a/ext/pdo/tests/pdo_004.phpt b/ext/pdo/tests/pdo_004.phpt
new file mode 100644
index 000000000..933629eea
--- /dev/null
+++ b/ext/pdo/tests/pdo_004.phpt
@@ -0,0 +1,50 @@
+--TEST--
+PDO Common: PDO::FETCH_OBJ
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
+$db->exec("INSERT INTO test VALUES(1, 'A')");
+$db->exec("INSERT INTO test VALUES(2, 'B')");
+$db->exec("INSERT INTO test VALUES(3, 'C')");
+
+$stmt = $db->prepare('SELECT * from test');
+$stmt->execute();
+
+var_dump($stmt->fetchAll(PDO::FETCH_OBJ));
+?>
+--EXPECTF--
+array(3) {
+ [0]=>
+ object(stdClass)#%d (2) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(1) "A"
+ }
+ [1]=>
+ object(stdClass)#%d (2) {
+ ["id"]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ }
+ [2]=>
+ object(stdClass)#%d (2) {
+ ["id"]=>
+ string(1) "3"
+ ["val"]=>
+ string(1) "C"
+ }
+}
diff --git a/ext/pdo/tests/pdo_005.phpt b/ext/pdo/tests/pdo_005.phpt
new file mode 100644
index 000000000..c0264d9f3
--- /dev/null
+++ b/ext/pdo/tests/pdo_005.phpt
@@ -0,0 +1,154 @@
+--TEST--
+PDO Common: PDO::FETCH_CLASS
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(10))');
+$db->exec("INSERT INTO test VALUES(1, 'A', 'AA')");
+$db->exec("INSERT INTO test VALUES(2, 'B', 'BB')");
+$db->exec("INSERT INTO test VALUES(3, 'C', 'CC')");
+
+$stmt = $db->prepare('SELECT id, val, val2 from test');
+
+class TestBase
+{
+ public $id;
+ protected $val;
+ private $val2;
+}
+
+class TestDerived extends TestBase
+{
+ protected $row;
+
+ public function __construct(&$row)
+ {
+ echo __METHOD__ . "($row,{$this->id})\n";
+ $this->row = $row++;
+ }
+}
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_CLASS));
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_CLASS, 'TestBase'));
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_CLASS, 'TestDerived', array(0)));
+
+?>
+--EXPECTF--
+array(3) {
+ [0]=>
+ object(stdClass)#%d (3) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(1) "A"
+ ["val2"]=>
+ string(2) "AA"
+ }
+ [1]=>
+ object(stdClass)#%d (3) {
+ ["id"]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ ["val2"]=>
+ string(2) "BB"
+ }
+ [2]=>
+ object(stdClass)#%d (3) {
+ ["id"]=>
+ string(1) "3"
+ ["val"]=>
+ string(1) "C"
+ ["val2"]=>
+ string(2) "CC"
+ }
+}
+array(3) {
+ [0]=>
+ object(TestBase)#%d (3) {
+ ["id"]=>
+ string(1) "1"
+ ["val:protected"]=>
+ string(1) "A"
+ ["val2:private"]=>
+ string(2) "AA"
+ }
+ [1]=>
+ object(TestBase)#%d (3) {
+ ["id"]=>
+ string(1) "2"
+ ["val:protected"]=>
+ string(1) "B"
+ ["val2:private"]=>
+ string(2) "BB"
+ }
+ [2]=>
+ object(TestBase)#%d (3) {
+ ["id"]=>
+ string(1) "3"
+ ["val:protected"]=>
+ string(1) "C"
+ ["val2:private"]=>
+ string(2) "CC"
+ }
+}
+TestDerived::__construct(0,1)
+TestDerived::__construct(1,2)
+TestDerived::__construct(2,3)
+array(3) {
+ [0]=>
+ object(TestDerived)#%d (5) {
+ ["row:protected"]=>
+ int(0)
+ ["id"]=>
+ string(1) "1"
+ ["val:protected"]=>
+ string(1) "A"
+ ["val2:private"]=>
+ NULL
+ ["val2"]=>
+ string(2) "AA"
+ }
+ [1]=>
+ object(TestDerived)#%d (5) {
+ ["row:protected"]=>
+ int(1)
+ ["id"]=>
+ string(1) "2"
+ ["val:protected"]=>
+ string(1) "B"
+ ["val2:private"]=>
+ NULL
+ ["val2"]=>
+ string(2) "BB"
+ }
+ [2]=>
+ object(TestDerived)#%d (5) {
+ ["row:protected"]=>
+ int(2)
+ ["id"]=>
+ string(1) "3"
+ ["val:protected"]=>
+ string(1) "C"
+ ["val2:private"]=>
+ NULL
+ ["val2"]=>
+ string(2) "CC"
+ }
+}
diff --git a/ext/pdo/tests/pdo_006.phpt b/ext/pdo/tests/pdo_006.phpt
new file mode 100644
index 000000000..fc8330172
--- /dev/null
+++ b/ext/pdo/tests/pdo_006.phpt
@@ -0,0 +1,77 @@
+--TEST--
+PDO Common: PDO::FETCH_GROUP
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
+$db->exec("INSERT INTO test VALUES(1, 'A')");
+$db->exec("INSERT INTO test VALUES(2, 'A')");
+$db->exec("INSERT INTO test VALUES(3, 'C')");
+
+$stmt = $db->prepare('SELECT val, id from test');
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_GROUP));
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_GROUP));
+
+?>
+--EXPECT--
+array(2) {
+ ["A"]=>
+ array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "1"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "2"
+ }
+ }
+ ["C"]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "3"
+ }
+ }
+}
+array(2) {
+ ["A"]=>
+ array(2) {
+ [0]=>
+ array(1) {
+ ["id"]=>
+ string(1) "1"
+ }
+ [1]=>
+ array(1) {
+ ["id"]=>
+ string(1) "2"
+ }
+ }
+ ["C"]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ ["id"]=>
+ string(1) "3"
+ }
+ }
+}
diff --git a/ext/pdo/tests/pdo_007.phpt b/ext/pdo/tests/pdo_007.phpt
new file mode 100644
index 000000000..291e86320
--- /dev/null
+++ b/ext/pdo/tests/pdo_007.phpt
@@ -0,0 +1,65 @@
+--TEST--
+PDO Common: PDO::FETCH_UNIQUE
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id CHAR(1) NOT NULL PRIMARY KEY, val VARCHAR(10))');
+$db->exec("INSERT INTO test VALUES('A', 'A')");
+$db->exec("INSERT INTO test VALUES('B', 'A')");
+$db->exec("INSERT INTO test VALUES('C', 'C')");
+
+$stmt = $db->prepare('SELECT id, val from test');
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_UNIQUE));
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE));
+
+?>
+--EXPECT--
+array(3) {
+ ["A"]=>
+ array(1) {
+ [0]=>
+ string(1) "A"
+ }
+ ["B"]=>
+ array(1) {
+ [0]=>
+ string(1) "A"
+ }
+ ["C"]=>
+ array(1) {
+ [0]=>
+ string(1) "C"
+ }
+}
+array(3) {
+ ["A"]=>
+ array(1) {
+ ["val"]=>
+ string(1) "A"
+ }
+ ["B"]=>
+ array(1) {
+ ["val"]=>
+ string(1) "A"
+ }
+ ["C"]=>
+ array(1) {
+ ["val"]=>
+ string(1) "C"
+ }
+}
diff --git a/ext/pdo/tests/pdo_008.phpt b/ext/pdo/tests/pdo_008.phpt
new file mode 100644
index 000000000..3e9e12e77
--- /dev/null
+++ b/ext/pdo/tests/pdo_008.phpt
@@ -0,0 +1,40 @@
+--TEST--
+PDO Common: PDO::FETCH_UNIQUE conflict
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id CHAR(1) NOT NULL PRIMARY KEY, val VARCHAR(10))');
+$db->exec("INSERT INTO test VALUES('A', 'A')");
+$db->exec("INSERT INTO test VALUES('B', 'A')");
+$db->exec("INSERT INTO test VALUES('C', 'C')");
+
+$stmt = $db->prepare('SELECT val, id from test');
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_UNIQUE));
+
+?>
+--EXPECT--
+array(2) {
+ ["A"]=>
+ array(1) {
+ [0]=>
+ string(1) "B"
+ }
+ ["C"]=>
+ array(1) {
+ [0]=>
+ string(1) "C"
+ }
+}
diff --git a/ext/pdo/tests/pdo_009.phpt b/ext/pdo/tests/pdo_009.phpt
new file mode 100644
index 000000000..0e2117747
--- /dev/null
+++ b/ext/pdo/tests/pdo_009.phpt
@@ -0,0 +1,131 @@
+--TEST--
+PDO Common: PDO::FETCH_CLASSTYPE
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(10) NOT NULL UNIQUE)');
+$db->exec('INSERT INTO classtypes VALUES(0, \'stdClass\')');
+$db->exec('INSERT INTO classtypes VALUES(1, \'Test1\')');
+$db->exec('INSERT INTO classtypes VALUES(2, \'Test2\')');
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(10))');
+$db->exec('INSERT INTO test VALUES(1, 0, \'A\')');
+$db->exec('INSERT INTO test VALUES(2, 1, \'B\')');
+$db->exec('INSERT INTO test VALUES(3, 2, \'C\')');
+$db->exec('INSERT INTO test VALUES(4, 3, \'D\')');
+
+$stmt = $db->prepare('SELECT classtypes.name, test.id AS id, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id');
+
+class Test1
+{
+ public function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+class Test2
+{
+ public function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+class Test3
+{
+ public function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_NUM));
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE, 'Test3'));
+
+?>
+--EXPECTF--
+array(4) {
+ [0]=>
+ array(3) {
+ [0]=>
+ string(8) "stdClass"
+ [1]=>
+ string(1) "1"
+ [2]=>
+ string(1) "A"
+ }
+ [1]=>
+ array(3) {
+ [0]=>
+ string(5) "Test1"
+ [1]=>
+ string(1) "2"
+ [2]=>
+ string(1) "B"
+ }
+ [2]=>
+ array(3) {
+ [0]=>
+ string(5) "Test2"
+ [1]=>
+ string(1) "3"
+ [2]=>
+ string(1) "C"
+ }
+ [3]=>
+ array(3) {
+ [0]=>
+ NULL
+ [1]=>
+ string(1) "4"
+ [2]=>
+ string(1) "D"
+ }
+}
+Test1::__construct()
+Test2::__construct()
+Test3::__construct()
+array(4) {
+ [0]=>
+ object(stdClass)#%d (2) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(1) "A"
+ }
+ [1]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ }
+ [2]=>
+ object(Test2)#%d (2) {
+ ["id"]=>
+ string(1) "3"
+ ["val"]=>
+ string(1) "C"
+ }
+ [3]=>
+ object(Test3)#%d (2) {
+ ["id"]=>
+ string(1) "4"
+ ["val"]=>
+ string(1) "D"
+ }
+}
diff --git a/ext/pdo/tests/pdo_010.phpt b/ext/pdo/tests/pdo_010.phpt
new file mode 100644
index 000000000..812b868eb
--- /dev/null
+++ b/ext/pdo/tests/pdo_010.phpt
@@ -0,0 +1,119 @@
+--TEST--
+PDO Common: PDO::FETCH_CLASSTYPE and GROUP/UNIQUE
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(10) NOT NULL UNIQUE)');
+$db->exec('INSERT INTO classtypes VALUES(0, \'stdClass\')');
+$db->exec('INSERT INTO classtypes VALUES(1, \'Test1\')');
+$db->exec('INSERT INTO classtypes VALUES(2, \'Test2\')');
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(10), grp VARCHAR(10))');
+$db->exec('INSERT INTO test VALUES(1, 0, \'A\', \'Group1\')');
+$db->exec('INSERT INTO test VALUES(2, 1, \'B\', \'Group1\')');
+$db->exec('INSERT INTO test VALUES(3, 2, \'C\', \'Group2\')');
+$db->exec('INSERT INTO test VALUES(4, 3, \'D\', \'Group2\')');
+
+$stmt = $db->prepare('SELECT classtypes.name, test.grp AS grp, test.id AS id, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id');
+
+class Test1
+{
+ public function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+class Test2
+{
+ public function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+class Test3
+{
+ public function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_GROUP, 'Test3'));
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_UNIQUE, 'Test3'));
+
+?>
+--EXPECTF--
+Test1::__construct()
+Test2::__construct()
+Test3::__construct()
+array(2) {
+ ["Group1"]=>
+ array(2) {
+ [0]=>
+ object(stdClass)#%d (2) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(1) "A"
+ }
+ [1]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ }
+ }
+ ["Group2"]=>
+ array(2) {
+ [0]=>
+ object(Test2)#%d (2) {
+ ["id"]=>
+ string(1) "3"
+ ["val"]=>
+ string(1) "C"
+ }
+ [1]=>
+ object(Test3)#%d (2) {
+ ["id"]=>
+ string(1) "4"
+ ["val"]=>
+ string(1) "D"
+ }
+ }
+}
+Test1::__construct()
+Test2::__construct()
+Test3::__construct()
+array(2) {
+ ["Group1"]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ }
+ ["Group2"]=>
+ object(Test3)#%d (2) {
+ ["id"]=>
+ string(1) "4"
+ ["val"]=>
+ string(1) "D"
+ }
+}
diff --git a/ext/pdo/tests/pdo_011.phpt b/ext/pdo/tests/pdo_011.phpt
new file mode 100644
index 000000000..e3eefc4af
--- /dev/null
+++ b/ext/pdo/tests/pdo_011.phpt
@@ -0,0 +1,245 @@
+--TEST--
+PDO Common: PDO::FETCH_FUNC and statement overloading
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))');
+$db->exec('INSERT INTO test VALUES(1, \'A\', \'Group1\')');
+$db->exec('INSERT INTO test VALUES(2, \'B\', \'Group1\')');
+$db->exec('INSERT INTO test VALUES(3, \'C\', \'Group2\')');
+$db->exec('INSERT INTO test VALUES(4, \'D\', \'Group2\')');
+
+class DerivedStatement extends PDOStatement
+{
+ private function __construct($name, $db)
+ {
+ $this->name = $name;
+ echo __METHOD__ . "($name)\n";
+ }
+
+ function retrieve($id, $val) {
+ echo __METHOD__ . "($id,$val)\n";
+ return array($id=>$val);
+ }
+}
+
+$select1 = $db->prepare('SELECT grp, id FROM test');
+$select2 = $db->prepare('SELECT id, val FROM test');
+$derived = $db->prepare('SELECT id, val FROM test', array(PDO::ATTR_STATEMENT_CLASS=>array('DerivedStatement', array('Overloaded', $db))));
+
+class Test1
+{
+ public function __construct($id, $val)
+ {
+ echo __METHOD__ . "($id,$val)\n";
+ $this->id = $id;
+ $this->val = $val;
+ }
+
+ static public function factory($id, $val)
+ {
+ echo __METHOD__ . "($id,$val)\n";
+ return new self($id, $val);
+ }
+}
+
+function test($id,$val='N/A')
+{
+ echo __METHOD__ . "($id,$val)\n";
+ return array($id=>$val);
+}
+
+$f = new Test1(0,0);
+
+$select1->execute();
+var_dump($select1->fetchAll(PDO::FETCH_FUNC|PDO::FETCH_GROUP, 'test'));
+
+$select2->execute();
+var_dump($select2->fetchAll(PDO::FETCH_FUNC, 'test'));
+
+$select2->execute();
+var_dump($select2->fetchAll(PDO::FETCH_FUNC, array('Test1','factory')));
+
+$select2->execute();
+var_dump($select2->fetchAll(PDO::FETCH_FUNC, array($f, 'factory')));
+
+var_dump(get_class($derived));
+$derived->execute();
+var_dump($derived->fetchAll(PDO::FETCH_FUNC, array($derived, 'retrieve')));
+
+?>
+--EXPECTF--
+DerivedStatement::__construct(Overloaded)
+Test1::__construct(0,0)
+test(1,N/A)
+test(2,N/A)
+test(3,N/A)
+test(4,N/A)
+array(2) {
+ ["Group1"]=>
+ array(2) {
+ [0]=>
+ array(1) {
+ [1]=>
+ string(3) "N/A"
+ }
+ [1]=>
+ array(1) {
+ [2]=>
+ string(3) "N/A"
+ }
+ }
+ ["Group2"]=>
+ array(2) {
+ [0]=>
+ array(1) {
+ [3]=>
+ string(3) "N/A"
+ }
+ [1]=>
+ array(1) {
+ [4]=>
+ string(3) "N/A"
+ }
+ }
+}
+test(1,A)
+test(2,B)
+test(3,C)
+test(4,D)
+array(4) {
+ [0]=>
+ array(1) {
+ [1]=>
+ string(1) "A"
+ }
+ [1]=>
+ array(1) {
+ [2]=>
+ string(1) "B"
+ }
+ [2]=>
+ array(1) {
+ [3]=>
+ string(1) "C"
+ }
+ [3]=>
+ array(1) {
+ [4]=>
+ string(1) "D"
+ }
+}
+Test1::factory(1,A)
+Test1::__construct(1,A)
+Test1::factory(2,B)
+Test1::__construct(2,B)
+Test1::factory(3,C)
+Test1::__construct(3,C)
+Test1::factory(4,D)
+Test1::__construct(4,D)
+array(4) {
+ [0]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(1) "A"
+ }
+ [1]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ }
+ [2]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "3"
+ ["val"]=>
+ string(1) "C"
+ }
+ [3]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "4"
+ ["val"]=>
+ string(1) "D"
+ }
+}
+Test1::factory(1,A)
+Test1::__construct(1,A)
+Test1::factory(2,B)
+Test1::__construct(2,B)
+Test1::factory(3,C)
+Test1::__construct(3,C)
+Test1::factory(4,D)
+Test1::__construct(4,D)
+array(4) {
+ [0]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(1) "A"
+ }
+ [1]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ }
+ [2]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "3"
+ ["val"]=>
+ string(1) "C"
+ }
+ [3]=>
+ object(Test1)#%d (2) {
+ ["id"]=>
+ string(1) "4"
+ ["val"]=>
+ string(1) "D"
+ }
+}
+string(16) "DerivedStatement"
+DerivedStatement::retrieve(1,A)
+DerivedStatement::retrieve(2,B)
+DerivedStatement::retrieve(3,C)
+DerivedStatement::retrieve(4,D)
+array(4) {
+ [0]=>
+ array(1) {
+ [1]=>
+ string(1) "A"
+ }
+ [1]=>
+ array(1) {
+ [2]=>
+ string(1) "B"
+ }
+ [2]=>
+ array(1) {
+ [3]=>
+ string(1) "C"
+ }
+ [3]=>
+ array(1) {
+ [4]=>
+ string(1) "D"
+ }
+}
diff --git a/ext/pdo/tests/pdo_012.phpt b/ext/pdo/tests/pdo_012.phpt
new file mode 100644
index 000000000..471c397c0
--- /dev/null
+++ b/ext/pdo/tests/pdo_012.phpt
@@ -0,0 +1,98 @@
+--TEST--
+PDO Common: PDOStatement::setFetchMode
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))');
+$db->exec('INSERT INTO test VALUES(1, \'A\', \'Group1\')');
+$db->exec('INSERT INTO test VALUES(2, \'B\', \'Group2\')');
+
+$SELECT = 'SELECT val, grp FROM test';
+
+$stmt = $db->query($SELECT, PDO::FETCH_NUM);
+var_dump($stmt->fetchAll());
+
+class Test
+{
+ function __construct($name = 'N/A')
+ {
+ echo __METHOD__ . "($name)\n";
+ }
+}
+
+unset($stmt);
+
+$stmt = $db->query($SELECT, PDO::FETCH_CLASS, 'Test');
+var_dump($stmt->fetchAll());
+
+unset($stmt);
+
+$stmt = $db->query($SELECT, PDO::FETCH_NUM);
+$stmt->setFetchMode(PDO::FETCH_CLASS, 'Test', array('Changed'));
+var_dump($stmt->fetchAll());
+
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(1) "A"
+ [1]=>
+ string(6) "Group1"
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "B"
+ [1]=>
+ string(6) "Group2"
+ }
+}
+Test::__construct(N/A)
+Test::__construct(N/A)
+array(2) {
+ [0]=>
+ object(Test)#%d (2) {
+ ["val"]=>
+ string(1) "A"
+ ["grp"]=>
+ string(6) "Group1"
+ }
+ [1]=>
+ object(Test)#%d (2) {
+ ["val"]=>
+ string(1) "B"
+ ["grp"]=>
+ string(6) "Group2"
+ }
+}
+Test::__construct(Changed)
+Test::__construct(Changed)
+array(2) {
+ [0]=>
+ object(Test)#%d (2) {
+ ["val"]=>
+ string(1) "A"
+ ["grp"]=>
+ string(6) "Group1"
+ }
+ [1]=>
+ object(Test)#%d (2) {
+ ["val"]=>
+ string(1) "B"
+ ["grp"]=>
+ string(6) "Group2"
+ }
+}
diff --git a/ext/pdo/tests/pdo_013.phpt b/ext/pdo/tests/pdo_013.phpt
new file mode 100644
index 000000000..009c7e2d6
--- /dev/null
+++ b/ext/pdo/tests/pdo_013.phpt
@@ -0,0 +1,96 @@
+--TEST--
+PDO Common: PDOStatement iterator
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))');
+$db->exec('INSERT INTO test VALUES(1, \'A\', \'Group1\')');
+$db->exec('INSERT INTO test VALUES(2, \'B\', \'Group2\')');
+
+$SELECT = 'SELECT val, grp FROM test';
+
+$stmt = $db->prepare($SELECT);
+
+$stmt->execute();
+$stmt->setFetchMode(PDO::FETCH_NUM);
+foreach ($stmt as $data)
+{
+ var_dump($data);
+}
+
+class Test
+{
+ function __construct($name = 'N/A')
+ {
+ echo __METHOD__ . "($name)\n";
+ }
+}
+
+unset($stmt);
+
+foreach ($db->query($SELECT, PDO::FETCH_CLASS, 'Test') as $data)
+{
+ var_dump($data);
+}
+
+unset($stmt);
+
+$stmt = $db->query($SELECT, PDO::FETCH_CLASS, 'Test', array('WOW'));
+
+foreach($stmt as $data)
+{
+ var_dump($data);
+}
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ string(1) "A"
+ [1]=>
+ string(6) "Group1"
+}
+array(2) {
+ [0]=>
+ string(1) "B"
+ [1]=>
+ string(6) "Group2"
+}
+Test::__construct(N/A)
+object(Test)#%d (2) {
+ ["val"]=>
+ string(1) "A"
+ ["grp"]=>
+ string(6) "Group1"
+}
+Test::__construct(N/A)
+object(Test)#%d (2) {
+ ["val"]=>
+ string(1) "B"
+ ["grp"]=>
+ string(6) "Group2"
+}
+Test::__construct(WOW)
+object(Test)#%d (2) {
+ ["val"]=>
+ string(1) "A"
+ ["grp"]=>
+ string(6) "Group1"
+}
+Test::__construct(WOW)
+object(Test)#%d (2) {
+ ["val"]=>
+ string(1) "B"
+ ["grp"]=>
+ string(6) "Group2"
+}
diff --git a/ext/pdo/tests/pdo_014.phpt b/ext/pdo/tests/pdo_014.phpt
new file mode 100644
index 000000000..b26135728
--- /dev/null
+++ b/ext/pdo/tests/pdo_014.phpt
@@ -0,0 +1,102 @@
+--TEST--
+PDO Common: PDOStatement SPL iterator
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+if (!extension_loaded('SPL')) print 'skip SPL not available';
+if (!class_exists('IteratorIterator', false)) die('skip IteratorIterator class not present');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))');
+$db->exec('INSERT INTO test VALUES(1, \'A\', \'Group1\')');
+$db->exec('INSERT INTO test VALUES(2, \'B\', \'Group2\')');
+$SELECT = 'SELECT val, grp FROM test';
+
+class Test
+{
+ function __construct($name = 'N/A')
+ {
+ echo __METHOD__ . "($name)\n";
+ }
+}
+
+$stmt = $db->query($SELECT, PDO::FETCH_CLASS, 'Test', array('WOW'));
+
+$it = new IteratorIterator($stmt); /* check if we can convert that thing */
+
+/*** HINT: If YOU plan to do so remember not to call rewind() -> see below ***/
+
+foreach($it as $data)
+{
+ var_dump($data);
+}
+
+$it->next(); /* must be allowed */
+var_dump($it->current()); /* must return NULL */
+var_dump($it->valid()); /* must return false */
+
+class PDOStatementAggregate extends PDOStatement implements IteratorAggregate
+{
+ private function __construct()
+ {
+ echo __METHOD__ . "\n";
+ $this->setFetchMode(PDO::FETCH_NUM);
+ /* default fetch mode is BOTH, so we see if the ctor can overwrite that */
+ }
+
+ function getIterator()
+ {
+ echo __METHOD__ . "\n";
+ $this->execute();
+ return new IteratorIterator($this, 'PDOStatement');
+ }
+}
+
+$stmt = $db->prepare($SELECT, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementAggregate')));
+
+foreach($stmt as $data)
+{
+ var_dump($data);
+}
+
+?>
+--EXPECTF--
+Test::__construct(WOW)
+object(Test)#4 (2) {
+ ["val"]=>
+ string(1) "A"
+ ["grp"]=>
+ string(6) "Group1"
+}
+Test::__construct(WOW)
+object(Test)#6 (2) {
+ ["val"]=>
+ string(1) "B"
+ ["grp"]=>
+ string(6) "Group2"
+}
+NULL
+bool(false)
+PDOStatementAggregate::__construct
+PDOStatementAggregate::getIterator
+array(2) {
+ [0]=>
+ string(1) "A"
+ [1]=>
+ string(6) "Group1"
+}
+array(2) {
+ [0]=>
+ string(1) "B"
+ [1]=>
+ string(6) "Group2"
+}
diff --git a/ext/pdo/tests/pdo_015.phpt b/ext/pdo/tests/pdo_015.phpt
new file mode 100644
index 000000000..aea292b97
--- /dev/null
+++ b/ext/pdo/tests/pdo_015.phpt
@@ -0,0 +1,100 @@
+--TEST--
+PDO Common: PDO::FETCH_COLUMN
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(20))');
+$db->exec('INSERT INTO test VALUES(1, \'A\', \'A2\')');
+$db->exec('INSERT INTO test VALUES(2, \'A\', \'B2\')');
+
+$select1 = $db->prepare('SELECT id, val, val2 FROM test');
+$select2 = $db->prepare('SELECT val, val2 FROM test');
+
+$select1->execute();
+var_dump($select1->fetchAll(PDO::FETCH_COLUMN));
+$select1->execute();
+var_dump($select1->fetchAll(PDO::FETCH_COLUMN, 2));
+$select1->execute();
+var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP));
+$select1->execute();
+var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE));
+$select1->execute();
+var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE, 0));
+$select1->execute();
+var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE, 1));
+$select1->execute();
+var_dump($select1->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE, 2));
+
+$select2->execute();
+var_dump($select2->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP));
+
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+}
+array(2) {
+ [0]=>
+ string(2) "A2"
+ [1]=>
+ string(2) "B2"
+}
+array(2) {
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "A"
+ }
+ [2]=>
+ array(1) {
+ [0]=>
+ string(1) "A"
+ }
+}
+array(2) {
+ [1]=>
+ string(1) "A"
+ [2]=>
+ string(1) "A"
+}
+array(2) {
+ [1]=>
+ string(1) "1"
+ [2]=>
+ string(1) "2"
+}
+array(2) {
+ [1]=>
+ string(1) "A"
+ [2]=>
+ string(1) "A"
+}
+array(2) {
+ [1]=>
+ string(2) "A2"
+ [2]=>
+ string(2) "B2"
+}
+array(1) {
+ ["A"]=>
+ array(2) {
+ [0]=>
+ string(2) "A2"
+ [1]=>
+ string(2) "B2"
+ }
+}
diff --git a/ext/pdo/tests/pdo_016.phpt b/ext/pdo/tests/pdo_016.phpt
new file mode 100644
index 000000000..8d193d37e
--- /dev/null
+++ b/ext/pdo/tests/pdo_016.phpt
@@ -0,0 +1,199 @@
+--TEST--
+PDO Common: PDO::FETCH_BOUND
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))');
+$db->exec('INSERT INTO test VALUES(0, \'String0\')');
+$db->exec('INSERT INTO test VALUES(1, \'String1\')');
+$db->exec('INSERT INTO test VALUES(2, \'String2\')');
+
+$stmt1 = $db->prepare('SELECT COUNT(idx) FROM test');
+$stmt2 = $db->prepare('SELECT idx, txt FROM test ORDER by idx');
+
+$stmt1->execute();
+var_dump($stmt1->fetchColumn());
+$stmt1 = null;
+
+$stmt2->execute();
+$cont = $stmt2->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE);
+var_dump($cont);
+
+echo "===WHILE===\n";
+
+$stmt2->bindColumn('idx', $idx);
+$stmt2->bindColumn('txt', $txt);
+$stmt2->execute();
+
+while($stmt2->fetch(PDO::FETCH_BOUND)) {
+ var_dump(array($idx=>$txt));
+}
+
+echo "===ALONE===\n";
+
+$stmt3 = $db->prepare('SELECT txt FROM test WHERE idx=:inp');
+$stmt3->bindParam(':inp', $idx); /* by foreign name */
+
+$stmt4 = $db->prepare('SELECT idx FROM test WHERE txt=:txt');
+$stmt4->bindParam(':txt', $txt); /* using same name */
+
+foreach($cont as $idx => $txt)
+{
+ var_dump(array($idx=>$txt));
+ var_dump($stmt3->execute());
+
+ if ($idx == 0) {
+ /* portability-wise, you may only bindColumn()s
+ * after execute() has been called at least once */
+ $stmt3->bindColumn('txt', $col1);
+ }
+ var_dump($stmt3->fetch(PDO::FETCH_BOUND));
+ $stmt3->closeCursor();
+
+ var_dump($stmt4->execute());
+ if ($idx == 0) {
+ /* portability-wise, you may only bindColumn()s
+ * after execute() has been called at least once */
+ $stmt4->bindColumn('idx', $col2);
+ }
+ var_dump($stmt4->fetch(PDO::FETCH_BOUND));
+ $stmt4->closeCursor();
+ var_dump(array($col2=>$col1));
+}
+
+echo "===REBIND/SAME===\n";
+
+$stmt4->bindColumn('idx', $col1);
+
+foreach($cont as $idx => $txt)
+{
+ var_dump(array($idx=>$txt));
+ var_dump($stmt3->execute());
+ var_dump($stmt3->fetch(PDO::FETCH_BOUND));
+ $stmt3->closeCursor();
+ var_dump($col1);
+ var_dump($stmt4->execute());
+ var_dump($stmt4->fetch(PDO::FETCH_BOUND));
+ $stmt4->closeCursor();
+ var_dump($col1);
+}
+
+echo "===REBIND/CONFLICT===\n";
+
+$stmt2->bindColumn('idx', $col1);
+$stmt2->bindColumn('txt', $col1);
+$stmt2->execute();
+
+while($stmt2->fetch(PDO::FETCH_BOUND))
+{
+ var_dump($col1);
+}
+
+
+?>
+--EXPECT--
+string(1) "3"
+array(3) {
+ [0]=>
+ string(7) "String0"
+ [1]=>
+ string(7) "String1"
+ [2]=>
+ string(7) "String2"
+}
+===WHILE===
+array(1) {
+ [0]=>
+ string(7) "String0"
+}
+array(1) {
+ [1]=>
+ string(7) "String1"
+}
+array(1) {
+ [2]=>
+ string(7) "String2"
+}
+===ALONE===
+array(1) {
+ [0]=>
+ string(7) "String0"
+}
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+array(1) {
+ [0]=>
+ string(7) "String0"
+}
+array(1) {
+ [1]=>
+ string(7) "String1"
+}
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+array(1) {
+ [1]=>
+ string(7) "String1"
+}
+array(1) {
+ [2]=>
+ string(7) "String2"
+}
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+array(1) {
+ [2]=>
+ string(7) "String2"
+}
+===REBIND/SAME===
+array(1) {
+ [0]=>
+ string(7) "String0"
+}
+bool(true)
+bool(true)
+string(7) "String0"
+bool(true)
+bool(true)
+string(1) "0"
+array(1) {
+ [1]=>
+ string(7) "String1"
+}
+bool(true)
+bool(true)
+string(7) "String1"
+bool(true)
+bool(true)
+string(1) "1"
+array(1) {
+ [2]=>
+ string(7) "String2"
+}
+bool(true)
+bool(true)
+string(7) "String2"
+bool(true)
+bool(true)
+string(1) "2"
+===REBIND/CONFLICT===
+string(7) "String0"
+string(7) "String1"
+string(7) "String2"
diff --git a/ext/pdo/tests/pdo_016a.phpt b/ext/pdo/tests/pdo_016a.phpt
new file mode 100755
index 000000000..cdb9dd7a8
--- /dev/null
+++ b/ext/pdo/tests/pdo_016a.phpt
@@ -0,0 +1,199 @@
+--TEST--
+PDO Common: PDO::FETCH_BOUND w/o :
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))');
+$db->exec('INSERT INTO test VALUES(0, \'String0\')');
+$db->exec('INSERT INTO test VALUES(1, \'String1\')');
+$db->exec('INSERT INTO test VALUES(2, \'String2\')');
+
+$stmt1 = $db->prepare('SELECT COUNT(idx) FROM test');
+$stmt2 = $db->prepare('SELECT idx, txt FROM test ORDER by idx');
+
+$stmt1->execute();
+var_dump($stmt1->fetchColumn());
+$stmt1 = null;
+
+$stmt2->execute();
+$cont = $stmt2->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE);
+var_dump($cont);
+
+echo "===WHILE===\n";
+
+$stmt2->bindColumn('idx', $idx);
+$stmt2->bindColumn('txt', $txt);
+$stmt2->execute();
+
+while($stmt2->fetch(PDO::FETCH_BOUND)) {
+ var_dump(array($idx=>$txt));
+}
+
+echo "===ALONE===\n";
+
+$stmt3 = $db->prepare('SELECT txt FROM test WHERE idx=:inp');
+$stmt3->bindParam('inp', $idx); /* by foreign name */
+
+$stmt4 = $db->prepare('SELECT idx FROM test WHERE txt=:txt');
+$stmt4->bindParam('txt', $txt); /* using same name */
+
+foreach($cont as $idx => $txt)
+{
+ var_dump(array($idx=>$txt));
+ var_dump($stmt3->execute());
+
+ if ($idx == 0) {
+ /* portability-wise, you may only bindColumn()s
+ * after execute() has been called at least once */
+ $stmt3->bindColumn('txt', $col1);
+ }
+ var_dump($stmt3->fetch(PDO::FETCH_BOUND));
+ $stmt3->closeCursor();
+
+ var_dump($stmt4->execute());
+ if ($idx == 0) {
+ /* portability-wise, you may only bindColumn()s
+ * after execute() has been called at least once */
+ $stmt4->bindColumn('idx', $col2);
+ }
+ var_dump($stmt4->fetch(PDO::FETCH_BOUND));
+ $stmt4->closeCursor();
+ var_dump(array($col2=>$col1));
+}
+
+echo "===REBIND/SAME===\n";
+
+$stmt4->bindColumn('idx', $col1);
+
+foreach($cont as $idx => $txt)
+{
+ var_dump(array($idx=>$txt));
+ var_dump($stmt3->execute());
+ var_dump($stmt3->fetch(PDO::FETCH_BOUND));
+ $stmt3->closeCursor();
+ var_dump($col1);
+ var_dump($stmt4->execute());
+ var_dump($stmt4->fetch(PDO::FETCH_BOUND));
+ $stmt4->closeCursor();
+ var_dump($col1);
+}
+
+echo "===REBIND/CONFLICT===\n";
+
+$stmt2->bindColumn('idx', $col1);
+$stmt2->bindColumn('txt', $col1);
+$stmt2->execute();
+
+while($stmt2->fetch(PDO::FETCH_BOUND))
+{
+ var_dump($col1);
+}
+
+
+?>
+--EXPECT--
+string(1) "3"
+array(3) {
+ [0]=>
+ string(7) "String0"
+ [1]=>
+ string(7) "String1"
+ [2]=>
+ string(7) "String2"
+}
+===WHILE===
+array(1) {
+ [0]=>
+ string(7) "String0"
+}
+array(1) {
+ [1]=>
+ string(7) "String1"
+}
+array(1) {
+ [2]=>
+ string(7) "String2"
+}
+===ALONE===
+array(1) {
+ [0]=>
+ string(7) "String0"
+}
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+array(1) {
+ [0]=>
+ string(7) "String0"
+}
+array(1) {
+ [1]=>
+ string(7) "String1"
+}
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+array(1) {
+ [1]=>
+ string(7) "String1"
+}
+array(1) {
+ [2]=>
+ string(7) "String2"
+}
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+array(1) {
+ [2]=>
+ string(7) "String2"
+}
+===REBIND/SAME===
+array(1) {
+ [0]=>
+ string(7) "String0"
+}
+bool(true)
+bool(true)
+string(7) "String0"
+bool(true)
+bool(true)
+string(1) "0"
+array(1) {
+ [1]=>
+ string(7) "String1"
+}
+bool(true)
+bool(true)
+string(7) "String1"
+bool(true)
+bool(true)
+string(1) "1"
+array(1) {
+ [2]=>
+ string(7) "String2"
+}
+bool(true)
+bool(true)
+string(7) "String2"
+bool(true)
+bool(true)
+string(1) "2"
+===REBIND/CONFLICT===
+string(7) "String0"
+string(7) "String1"
+string(7) "String2"
diff --git a/ext/pdo/tests/pdo_017.phpt b/ext/pdo/tests/pdo_017.phpt
new file mode 100644
index 000000000..f1bfb97f6
--- /dev/null
+++ b/ext/pdo/tests/pdo_017.phpt
@@ -0,0 +1,63 @@
+--TEST--
+PDO Common: transactions
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+
+$db = PDOTest::factory();
+try {
+ $db->beginTransaction();
+} catch (PDOException $e) {
+ die('skip no working transactions: ' . $e->getMessage());
+}
+
+if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
+ if (false === PDOTest::detect_transactional_mysql_engine($db)) {
+ die('skip your mysql configuration does not support working transactions');
+ }
+}
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
+ $suf = ' Type=' . PDOTest::detect_transactional_mysql_engine($db);
+} else {
+ $suf = '';
+}
+
+$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10))'.$suf);
+$db->exec("INSERT INTO test VALUES(1, 'A')");
+$db->exec("INSERT INTO test VALUES(2, 'B')");
+$db->exec("INSERT INTO test VALUES(3, 'C')");
+$delete = $db->prepare('DELETE FROM test');
+
+function countRows($action) {
+ global $db;
+ $select = $db->prepare('SELECT COUNT(*) FROM test');
+ $select->execute();
+ $res = $select->fetchColumn();
+ return "Counted $res rows after $action.\n";
+}
+
+echo countRows('insert');
+
+$db->beginTransaction();
+$delete->execute();
+echo countRows('delete');
+$db->rollBack();
+
+echo countRows('rollback');
+
+?>
+--EXPECT--
+Counted 3 rows after insert.
+Counted 0 rows after delete.
+Counted 3 rows after rollback.
diff --git a/ext/pdo/tests/pdo_018.phpt b/ext/pdo/tests/pdo_018.phpt
new file mode 100644
index 000000000..c46ffde07
--- /dev/null
+++ b/ext/pdo/tests/pdo_018.phpt
@@ -0,0 +1,270 @@
+--TEST--
+PDO Common: serializing
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+if (!interface_exists('Serializable')) die('skip no Serializable interface');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+class TestBase implements Serializable
+{
+ public $BasePub = 'Public';
+ protected $BasePro = 'Protected';
+ private $BasePri = 'Private';
+
+ function serialize()
+ {
+ $serialized = array();
+ foreach($this as $prop => $val) {
+ $serialized[$prop] = $val;
+ }
+ $serialized = serialize($serialized);
+ echo __METHOD__ . "() = '$serialized'\n";
+ return $serialized;
+ }
+
+ function unserialize($serialized)
+ {
+ echo __METHOD__ . "($serialized)\n";
+ foreach(unserialize($serialized) as $prop => $val) {
+ $this->$prop = '#'.$val;
+ }
+ return true;
+ }
+}
+
+class TestDerived extends TestBase
+{
+ public $BasePub = 'DerivedPublic';
+ protected $BasePro = 'DerivdeProtected';
+ public $DerivedPub = 'Public';
+ protected $DerivedPro = 'Protected';
+ private $DerivedPri = 'Private';
+
+ function serialize()
+ {
+ echo __METHOD__ . "()\n";
+ return TestBase::serialize();
+ }
+
+ function unserialize($serialized)
+ {
+ echo __METHOD__ . "()\n";
+ return TestBase::unserialize($serialized);
+ }
+}
+
+class TestLeaf extends TestDerived
+{
+}
+
+$db->exec('CREATE TABLE classtypes(id int NOT NULL PRIMARY KEY, name VARCHAR(20) NOT NULL UNIQUE)');
+$db->exec('INSERT INTO classtypes VALUES(0, \'stdClass\')');
+$db->exec('INSERT INTO classtypes VALUES(1, \'TestBase\')');
+$db->exec('INSERT INTO classtypes VALUES(2, \'TestDerived\')');
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, classtype int, val VARCHAR(255))');
+
+$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+var_dump($db->query('SELECT COUNT(*) FROM classtypes')->fetchColumn());
+var_dump($db->query('SELECT id, name FROM classtypes ORDER by id')->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE));
+
+$objs = array();
+$objs[0] = new stdClass;
+$objs[1] = new TestBase;
+$objs[2] = new TestDerived;
+$objs[3] = new TestLeaf;
+
+$stmt = $db->prepare('SELECT id FROM classtypes WHERE name=:cname');
+$stmt->bindParam(':cname', $cname);
+
+$ctypes = array();
+
+foreach($objs as $obj)
+{
+ $cname = get_class($obj);
+ $ctype = NULL; /* set default for non stored class name */
+ $stmt->execute();
+ $stmt->bindColumn('id', $ctype);
+ $stmt->fetch(PDO::FETCH_BOUND);
+ $ctypes[$cname] = $ctype;
+}
+
+echo "===TYPES===\n";
+var_dump($ctypes);
+
+unset($stmt);
+
+echo "===INSERT===\n";
+$stmt = $db->prepare('INSERT INTO test VALUES(:id, :classtype, :val)');
+$stmt->bindParam(':id', $idx);
+$stmt->bindParam(':classtype', $ctype);
+$stmt->bindParam(':val', $val);
+
+foreach($objs as $idx => $obj)
+{
+ $ctype = $ctypes[get_class($obj)];
+ if (method_exists($obj, 'serialize'))
+ {
+ $val = $obj->serialize();
+ }
+ else
+ {
+ $val = '';
+ }
+ $stmt->execute();
+}
+
+unset($stmt);
+
+echo "===DATA===\n";
+var_dump($db->query('SELECT test.val FROM test')->fetchAll(PDO::FETCH_COLUMN));
+
+echo "===FAILURE===\n";
+try
+{
+ $db->query('SELECT classtypes.name AS name, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id')->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_SERIALIZE, 'TestLeaf', array());
+}
+catch (PDOException $e)
+{
+ echo 'Exception:';
+ echo $e->getMessage()."\n";
+}
+
+echo "===COUNT===\n";
+var_dump($db->query('SELECT COUNT(*) FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id WHERE (classtypes.id IS NULL OR classtypes.id > 0)')->fetchColumn());
+
+echo "===DATABASE===\n";
+$stmt = $db->prepare('SELECT classtypes.name AS name, test.val AS val FROM test LEFT JOIN classtypes ON test.classtype=classtypes.id WHERE (classtypes.id IS NULL OR classtypes.id > 0)');
+
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
+
+echo "===FETCHCLASS===\n";
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_CLASSTYPE|PDO::FETCH_SERIALIZE, 'TestLeaf'));
+
+
+?>
+--EXPECTF--
+string(1) "3"
+array(3) {
+ [0]=>
+ string(8) "stdClass"
+ [1]=>
+ string(8) "TestBase"
+ [2]=>
+ string(11) "TestDerived"
+}
+===TYPES===
+array(4) {
+ ["stdClass"]=>
+ string(1) "0"
+ ["TestBase"]=>
+ string(1) "1"
+ ["TestDerived"]=>
+ string(1) "2"
+ ["TestLeaf"]=>
+ NULL
+}
+===INSERT===
+TestBase::serialize() = 'a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}'
+TestDerived::serialize()
+TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}'
+TestDerived::serialize()
+TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}'
+===DATA===
+array(4) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}"
+ [2]=>
+ string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}"
+ [3]=>
+ string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}"
+}
+===FAILURE===
+Exception:SQLSTATE[HY000]: General error: cannot unserialize class
+===COUNT===
+string(1) "3"
+===DATABASE===
+array(3) {
+ [0]=>
+ array(2) {
+ ["name"]=>
+ string(8) "TestBase"
+ ["val"]=>
+ string(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}"
+ }
+ [1]=>
+ array(2) {
+ ["name"]=>
+ string(11) "TestDerived"
+ ["val"]=>
+ string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}"
+ }
+ [2]=>
+ array(2) {
+ ["name"]=>
+ NULL
+ ["val"]=>
+ string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}"
+ }
+}
+===FETCHCLASS===
+TestBase::unserialize(a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";})
+TestDerived::unserialize()
+TestBase::unserialize(a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";})
+TestDerived::unserialize()
+TestBase::unserialize(a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";})
+array(3) {
+ [0]=>
+ object(TestBase)#%d (3) {
+ ["BasePub"]=>
+ string(7) "#Public"
+ ["BasePro:protected"]=>
+ string(10) "#Protected"
+ ["BasePri:private"]=>
+ string(8) "#Private"
+ }
+ [1]=>
+ object(TestDerived)#%d (6) {
+ ["BasePub"]=>
+ string(14) "#DerivedPublic"
+ ["BasePro:protected"]=>
+ string(17) "#DerivdeProtected"
+ ["DerivedPub"]=>
+ string(7) "#Public"
+ ["DerivedPro:protected"]=>
+ string(10) "#Protected"
+ ["DerivedPri:private"]=>
+ string(7) "Private"
+ ["BasePri:private"]=>
+ string(7) "Private"
+ }
+ [2]=>
+ object(TestLeaf)#%d (6) {
+ ["BasePub"]=>
+ string(14) "#DerivedPublic"
+ ["BasePro:protected"]=>
+ string(17) "#DerivdeProtected"
+ ["DerivedPub"]=>
+ string(7) "#Public"
+ ["DerivedPro:protected"]=>
+ string(10) "#Protected"
+ ["DerivedPri:private"]=>
+ string(7) "Private"
+ ["BasePri:private"]=>
+ string(7) "Private"
+ }
+}
diff --git a/ext/pdo/tests/pdo_019.phpt b/ext/pdo/tests/pdo_019.phpt
new file mode 100644
index 000000000..f6d75bbd1
--- /dev/null
+++ b/ext/pdo/tests/pdo_019.phpt
@@ -0,0 +1,71 @@
+--TEST--
+PDO Common: fetch() and while()
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))');
+$db->exec('INSERT INTO test VALUES(0, \'String0\')');
+$db->exec('INSERT INTO test VALUES(1, \'String1\')');
+$db->exec('INSERT INTO test VALUES(2, \'String2\')');
+$db->exec('INSERT INTO test VALUES(3, \'String3\')');
+
+
+var_dump($db->query('SELECT COUNT(*) FROM test')->fetchColumn());
+
+$stmt = $db->prepare('SELECT idx, txt FROM test ORDER by idx');
+
+$stmt->execute();
+$cont = $stmt->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE);
+var_dump($cont);
+
+echo "===WHILE===\n";
+
+$stmt->bindColumn('idx', $idx);
+$stmt->bindColumn('txt', $txt);
+$stmt->execute();
+
+while($stmt->fetch(PDO::FETCH_BOUND)) {
+ var_dump(array($idx=>$txt));
+}
+
+?>
+--EXPECT--
+string(1) "4"
+array(4) {
+ [0]=>
+ string(7) "String0"
+ [1]=>
+ string(7) "String1"
+ [2]=>
+ string(7) "String2"
+ [3]=>
+ string(7) "String3"
+}
+===WHILE===
+array(1) {
+ [0]=>
+ string(7) "String0"
+}
+array(1) {
+ [1]=>
+ string(7) "String1"
+}
+array(1) {
+ [2]=>
+ string(7) "String2"
+}
+array(1) {
+ [3]=>
+ string(7) "String3"
+}
diff --git a/ext/pdo/tests/pdo_020.phpt b/ext/pdo/tests/pdo_020.phpt
new file mode 100644
index 000000000..dc7e4d1a7
--- /dev/null
+++ b/ext/pdo/tests/pdo_020.phpt
@@ -0,0 +1,34 @@
+--TEST--
+PDO Common: PDOStatement::columnCount
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))');
+$db->exec("INSERT INTO test VALUES(1, 'A', 'A')");
+$db->exec("INSERT INTO test VALUES(2, 'B', 'B')");
+$db->exec("INSERT INTO test VALUES(3, 'C', 'C')");
+
+foreach (array('SELECT id, val FROM test', 'SELECT id, val, val2 FROM test', 'SELECT COUNT(*) FROM test') as $sql) {
+
+ $stmt = $db->query($sql);
+ $res = $stmt->columnCount();
+ echo "Counted $res columns after $sql.\n";
+ $stmt = null;
+}
+
+?>
+--EXPECT--
+Counted 2 columns after SELECT id, val FROM test.
+Counted 3 columns after SELECT id, val, val2 FROM test.
+Counted 1 columns after SELECT COUNT(*) FROM test.
diff --git a/ext/pdo/tests/pdo_021.phpt b/ext/pdo/tests/pdo_021.phpt
new file mode 100644
index 000000000..104c3394d
--- /dev/null
+++ b/ext/pdo/tests/pdo_021.phpt
@@ -0,0 +1,57 @@
+--TEST--
+PDO Common: PDOStatement::execute with parameters
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))');
+
+$select = $db->prepare('SELECT COUNT(id) FROM test');
+
+$data = array(
+ array('10', 'Abc', 'zxy'),
+ array('20', 'Def', 'wvu'),
+ array('30', 'Ghi', 'tsr'),
+ array('40', 'Jkl', 'qpo'),
+ array('50', 'Mno', 'nml'),
+ array('60', 'Pqr', 'kji'),
+);
+
+
+// Insert using question mark placeholders
+$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)");
+foreach ($data as $row) {
+ $stmt->execute($row);
+}
+$select->execute();
+$num = $select->fetchColumn();
+echo 'There are ' . $num . " rows in the table.\n";
+
+$select->closeCursor();
+
+// Insert using named parameters
+$stmt2 = $db->prepare("INSERT INTO test VALUES(:first, :second, :third)");
+foreach ($data as $row) {
+ $stmt2->execute(array(':first'=>($row[0] + 5), ':second'=>$row[1],
+ ':third'=>$row[2]));
+}
+
+$select->execute();
+$num = $select->fetchColumn();
+echo 'There are ' . $num . " rows in the table.\n";
+
+
+?>
+--EXPECT--
+There are 6 rows in the table.
+There are 12 rows in the table.
diff --git a/ext/pdo/tests/pdo_022.phpt b/ext/pdo/tests/pdo_022.phpt
new file mode 100644
index 000000000..daec14f9e
--- /dev/null
+++ b/ext/pdo/tests/pdo_022.phpt
@@ -0,0 +1,62 @@
+--TEST--
+PDO Common: PDOStatement::getColumnMeta
+--SKIPIF--
+<?php # vim:ft=php
+die('skip this feature is not yet finalized, no test makes sense');
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+/*
+ * Note well: meta information is a nightmare to handle portably.
+ * it's not really PDOs job.
+ * We've not yet defined exactly what makes sense for getColumnMeta,
+ * so no tests make any sense to anyone. When they do, we can enable
+ * this test file.
+ * TODO: filter out driver dependent components from this common core
+ * test file.
+ */
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))');
+$db->exec('insert2', "INSERT INTO test VALUES(:first, :second, :third)");
+
+$data = array(
+ array('10', 'Abc', 'zxy'),
+ array('20', 'Def', 'wvu'),
+ array('30', 'Ghi', 'tsr'),
+ array('40', 'Jkl', 'qpo'),
+ array('50', 'Mno', 'nml'),
+ array('60', 'Pqr', 'kji'),
+);
+
+
+// Insert using question mark placeholders
+$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)");
+foreach ($data as $row) {
+ $stmt->execute($row);
+}
+
+// Retrieve column metadata for a result set returned by explicit SELECT
+$select = $db->query('SELECT id, val, val2 FROM test');
+$meta = $select->getColumnMeta(0);
+var_dump($meta);
+$meta = $select->getColumnMeta(1);
+var_dump($meta);
+$meta = $select->getColumnMeta(2);
+var_dump($meta);
+
+// Retrieve column metadata for a result set returned by a function
+$select = $db->query('SELECT COUNT(*) FROM test');
+$meta = $select->getColumnMeta(0);
+var_dump($meta);
+
+?>
+--EXPECT--
+The unexpected!
diff --git a/ext/pdo/tests/pdo_023.phpt b/ext/pdo/tests/pdo_023.phpt
new file mode 100644
index 000000000..564bcf8c5
--- /dev/null
+++ b/ext/pdo/tests/pdo_023.phpt
@@ -0,0 +1,112 @@
+--TEST--
+PDO Common: extending PDO
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+
+class PDOStatementX extends PDOStatement
+{
+ public $test1 = 1;
+
+ protected function __construct()
+ {
+ $this->test2 = 2;
+ $this->test2 = 22;
+ echo __METHOD__ . "()\n";
+ }
+
+ function __destruct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+class PDODatabaseX extends PDO
+{
+ public $test1 = 1;
+
+ function __destruct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function test()
+ {
+ $this->test2 = 2;
+ var_dump($this->test1);
+ var_dump($this->test2);
+ $this->test2 = 22;
+ }
+
+ function query($sql)
+ {
+ echo __METHOD__ . "()\n";
+ $stmt = parent::prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx')));
+ $stmt->execute();
+ return $stmt;
+ }
+}
+
+$db = PDOTest::factory('PDODatabaseX');
+$db->test();
+var_dump($db);
+
+$db->query('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10))');
+$db->query('INSERT INTO test VALUES(0, \'A\')');
+$db->query('INSERT INTO test VALUES(1, \'B\')');
+
+
+$stmt = $db->query('SELECT val, id FROM test');
+var_dump($stmt);
+var_dump($stmt->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_UNIQUE));
+
+$stmt = NULL;
+$db = NULL;
+
+
+?>
+--EXPECTF--
+int(1)
+int(2)
+object(PDODatabaseX)#%d (2) {
+ ["test1"]=>
+ int(1)
+ ["test2"]=>
+ int(22)
+}
+PDODatabaseX::query()
+PDOStatementX::__construct()
+PDOStatementX::__destruct()
+PDODatabaseX::query()
+PDOStatementX::__construct()
+PDOStatementX::__destruct()
+PDODatabaseX::query()
+PDOStatementX::__construct()
+PDOStatementX::__destruct()
+PDODatabaseX::query()
+PDOStatementX::__construct()
+object(PDOStatementX)#%d (3) {
+ ["test1"]=>
+ int(1)
+ ["queryString"]=>
+ string(24) "SELECT val, id FROM test"
+ ["test2"]=>
+ int(22)
+}
+array(2) {
+ ["A"]=>
+ string(1) "0"
+ ["B"]=>
+ string(1) "1"
+}
+PDOStatementX::__destruct()
+PDODatabaseX::__destruct()
diff --git a/ext/pdo/tests/pdo_024.phpt b/ext/pdo/tests/pdo_024.phpt
new file mode 100644
index 000000000..1b4f841f3
--- /dev/null
+++ b/ext/pdo/tests/pdo_024.phpt
@@ -0,0 +1,35 @@
+--TEST--
+PDO Common: assert that bindParam does not modify parameter
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('create table test (id int, name varchar(10))');
+
+$stmt = $db->prepare('insert into test (id, name) values(0, :name)');
+$name = NULL;
+$before_bind = $name;
+$stmt->bindParam(':name', $name);
+if ($name !== $before_bind) {
+ echo "bind: fail\n";
+} else {
+ echo "bind: success\n";
+}
+var_dump($stmt->execute());
+var_dump($db->query('select name from test where id=0')->fetchColumn());
+
+?>
+--EXPECT--
+bind: success
+bool(true)
+NULL
diff --git a/ext/pdo/tests/pdo_025.phpt b/ext/pdo/tests/pdo_025.phpt
new file mode 100644
index 000000000..2c27c489f
--- /dev/null
+++ b/ext/pdo/tests/pdo_025.phpt
@@ -0,0 +1,113 @@
+--TEST--
+PDO Common: PDO::FETCH_INTO
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))');
+
+$data = array(
+ array('10', 'Abc', 'zxy'),
+ array('20', 'Def', 'wvu'),
+ array('30', 'Ghi', 'tsr'),
+ array('40', 'Jkl', 'qpo'),
+ array('50', 'Mno', 'nml'),
+ array('60', 'Pqr', 'kji'),
+);
+
+
+// Insert using question mark placeholders
+$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)");
+foreach ($data as $row) {
+ $stmt->execute($row);
+}
+
+class Test {
+ public $id, $val, $val2;
+}
+
+$stmt = $db->prepare('SELECT * FROM test');
+$stmt->setFetchMode(PDO::FETCH_INTO, new Test);
+$stmt->execute();
+
+foreach($stmt as $obj) {
+ var_dump($obj);
+}
+
+echo "===FAIL===\n";
+
+class Fail {
+ protected $id;
+ public $val, $val2;
+}
+
+$stmt->setFetchMode(PDO::FETCH_INTO, new Fail);
+$stmt->execute();
+
+foreach($stmt as $obj) {
+ var_dump($obj);
+}
+
+?>
+--EXPECTF--
+object(Test)#%d (3) {
+ ["id"]=>
+ string(2) "10"
+ ["val"]=>
+ string(3) "Abc"
+ ["val2"]=>
+ string(3) "zxy"
+}
+object(Test)#%d (3) {
+ ["id"]=>
+ string(2) "20"
+ ["val"]=>
+ string(3) "Def"
+ ["val2"]=>
+ string(3) "wvu"
+}
+object(Test)#%d (3) {
+ ["id"]=>
+ string(2) "30"
+ ["val"]=>
+ string(3) "Ghi"
+ ["val2"]=>
+ string(3) "tsr"
+}
+object(Test)#%d (3) {
+ ["id"]=>
+ string(2) "40"
+ ["val"]=>
+ string(3) "Jkl"
+ ["val2"]=>
+ string(3) "qpo"
+}
+object(Test)#%d (3) {
+ ["id"]=>
+ string(2) "50"
+ ["val"]=>
+ string(3) "Mno"
+ ["val2"]=>
+ string(3) "nml"
+}
+object(Test)#%d (3) {
+ ["id"]=>
+ string(2) "60"
+ ["val"]=>
+ string(3) "Pqr"
+ ["val2"]=>
+ string(3) "kji"
+}
+===FAIL===
+
+Fatal error: Cannot access protected property Fail::$id in %spdo_025.php on line %d
diff --git a/ext/pdo/tests/pdo_026.phpt b/ext/pdo/tests/pdo_026.phpt
new file mode 100644
index 000000000..a0891bedf
--- /dev/null
+++ b/ext/pdo/tests/pdo_026.phpt
@@ -0,0 +1,111 @@
+--TEST--
+PDO Common: extending PDO (2)
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+
+$data = array(
+ array('10', 'Abc', 'zxy'),
+ array('20', 'Def', 'wvu'),
+ array('30', 'Ghi', 'tsr'),
+);
+
+class PDOStatementX extends PDOStatement
+{
+ public $dbh;
+
+ protected function __construct($dbh)
+ {
+ $this->dbh = $dbh;
+ echo __METHOD__ . "()\n";
+ }
+
+ function __destruct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+class PDODatabase extends PDO
+{
+ function __destruct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function query($sql)
+ {
+ echo __METHOD__ . "()\n";
+ $stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this))));
+ $stmt->setFetchMode(PDO::FETCH_ASSOC);
+ $stmt->execute();
+ return $stmt;
+ }
+}
+
+$db = PDOTest::factory('PDODatabase');
+var_dump(get_class($db));
+
+$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))');
+
+$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)");
+var_dump(get_class($stmt));
+foreach ($data as $row) {
+ $stmt->execute($row);
+}
+
+unset($stmt);
+
+$stmt = $db->query('SELECT * FROM test');
+var_dump(get_class($stmt));
+var_dump(get_class($stmt->dbh));
+
+foreach($stmt as $obj) {
+ var_dump($obj);
+}
+
+echo "===DONE===\n";
+?>
+--EXPECT--
+string(11) "PDODatabase"
+string(12) "PDOStatement"
+PDODatabase::query()
+PDOStatementX::__construct()
+string(13) "PDOStatementX"
+string(11) "PDODatabase"
+array(3) {
+ ["id"]=>
+ string(2) "10"
+ ["val"]=>
+ string(3) "Abc"
+ ["val2"]=>
+ string(3) "zxy"
+}
+array(3) {
+ ["id"]=>
+ string(2) "20"
+ ["val"]=>
+ string(3) "Def"
+ ["val2"]=>
+ string(3) "wvu"
+}
+array(3) {
+ ["id"]=>
+ string(2) "30"
+ ["val"]=>
+ string(3) "Ghi"
+ ["val2"]=>
+ string(3) "tsr"
+}
+===DONE===
+PDODatabase::__destruct()
+PDOStatementX::__destruct()
diff --git a/ext/pdo/tests/pdo_027.phpt b/ext/pdo/tests/pdo_027.phpt
new file mode 100644
index 000000000..1d9990d3f
--- /dev/null
+++ b/ext/pdo/tests/pdo_027.phpt
@@ -0,0 +1,29 @@
+--TEST--
+PDO Common: PDO::FETCH_LAZY
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('create table test (id int, name varchar(10))');
+$db->exec("INSERT INTO test (id,name) VALUES(1,'test1')");
+$db->exec("INSERT INTO test (id,name) VALUES(2,'test2')");
+
+foreach ($db->query("SELECT * FROM test", PDO::FETCH_LAZY) as $v) {
+ echo "lazy: " . $v->id.$v->name."\n";
+}
+echo "End\n";
+?>
+--EXPECT--
+lazy: 1test1
+lazy: 2test2
+End
diff --git a/ext/pdo/tests/pdo_028.phpt b/ext/pdo/tests/pdo_028.phpt
new file mode 100644
index 000000000..0d1058dc5
--- /dev/null
+++ b/ext/pdo/tests/pdo_028.phpt
@@ -0,0 +1,45 @@
+--TEST--
+PDO Common: bindValue
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val1 VARCHAR(10), val2 VARCHAR(10), val3 VARCHAR(10))');
+$stmt = $db->prepare('INSERT INTO test values (1, ?, ?, ?)');
+
+$data = array("one", "two", "three");
+
+foreach ($data as $i => $v) {
+ $stmt->bindValue($i+1, $v);
+}
+$stmt->execute();
+
+$stmt = $db->prepare('SELECT * from test');
+$stmt->execute();
+
+var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ array(4) {
+ ["id"]=>
+ string(1) "1"
+ ["val1"]=>
+ string(3) "one"
+ ["val2"]=>
+ string(3) "two"
+ ["val3"]=>
+ string(5) "three"
+ }
+}
diff --git a/ext/pdo/tests/pdo_029.phpt b/ext/pdo/tests/pdo_029.phpt
new file mode 100755
index 000000000..c0b674cd4
--- /dev/null
+++ b/ext/pdo/tests/pdo_029.phpt
@@ -0,0 +1,125 @@
+--TEST--
+PDO Common: extending PDO (3)
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+
+$data = array(
+ array('10', 'Abc', 'zxy'),
+ array('20', 'Def', 'wvu'),
+ array('30', 'Ghi', 'tsr'),
+);
+
+class PDOStatementX extends PDOStatement
+{
+ public $dbh;
+
+ protected function __construct($dbh)
+ {
+ $this->dbh = $dbh;
+ echo __METHOD__ . "()\n";
+ }
+
+ function __destruct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function execute()
+ {
+ echo __METHOD__ . "()\n";
+ parent::execute();
+ }
+}
+
+class PDODatabase extends PDO
+{
+ function __destruct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function query($sql)
+ {
+ echo __METHOD__ . "()\n";
+ $stmt = $this->prepare($sql, array(PDO::ATTR_STATEMENT_CLASS=>array('PDOStatementx', array($this))));
+ $stmt->setFetchMode(PDO::FETCH_ASSOC);
+ $stmt->execute();
+ return $stmt;
+ }
+}
+
+$db = PDOTest::factory('PDODatabase');
+var_dump(get_class($db));
+
+$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))');
+
+$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)");
+var_dump(get_class($stmt));
+foreach ($data as $row) {
+ $stmt->execute($row);
+}
+
+unset($stmt);
+
+echo "===QUERY===\n";
+
+$stmt = $db->query('SELECT * FROM test');
+var_dump(get_class($stmt));
+var_dump(get_class($stmt->dbh));
+
+echo "===FOREACH===\n";
+
+foreach($stmt as $obj) {
+ var_dump($obj);
+}
+
+echo "===DONE===\n";
+exit(0);
+?>
+--EXPECT--
+string(11) "PDODatabase"
+string(12) "PDOStatement"
+===QUERY===
+PDODatabase::query()
+PDOStatementX::__construct()
+PDOStatementX::execute()
+string(13) "PDOStatementX"
+string(11) "PDODatabase"
+===FOREACH===
+array(3) {
+ ["id"]=>
+ string(2) "10"
+ ["val"]=>
+ string(3) "Abc"
+ ["val2"]=>
+ string(3) "zxy"
+}
+array(3) {
+ ["id"]=>
+ string(2) "20"
+ ["val"]=>
+ string(3) "Def"
+ ["val2"]=>
+ string(3) "wvu"
+}
+array(3) {
+ ["id"]=>
+ string(2) "30"
+ ["val"]=>
+ string(3) "Ghi"
+ ["val2"]=>
+ string(3) "tsr"
+}
+===DONE===
+PDODatabase::__destruct()
+PDOStatementX::__destruct()
diff --git a/ext/pdo/tests/pdo_030.phpt b/ext/pdo/tests/pdo_030.phpt
new file mode 100755
index 000000000..e9d547540
--- /dev/null
+++ b/ext/pdo/tests/pdo_030.phpt
@@ -0,0 +1,176 @@
+--TEST--
+PDO Common: extending PDO (4)
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+
+$data = array(
+ array('10', 'Abc', 'zxy'),
+ array('20', 'Def', 'wvu'),
+ array('30', 'Ghi', 'tsr'),
+);
+
+class PDOStatementX extends PDOStatement
+{
+ public $dbh;
+
+ protected function __construct($dbh)
+ {
+ $this->dbh = $dbh;
+ $this->setFetchMode(PDO::FETCH_ASSOC);
+ echo __METHOD__ . "()\n";
+ }
+
+ function __destruct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function execute()
+ {
+ echo __METHOD__ . "()\n";
+ parent::execute();
+ }
+}
+
+class PDODatabase extends PDO
+{
+ function __destruct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function query($sql)
+ {
+ echo __METHOD__ . "()\n";
+ return parent::query($sql);
+ }
+}
+
+$db = PDOTest::factory('PDODatabase');
+var_dump(get_class($db));
+
+$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))');
+
+$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)");
+var_dump(get_class($stmt));
+foreach ($data as $row) {
+ $stmt->execute($row);
+}
+
+unset($stmt);
+
+echo "===QUERY===\n";
+
+var_dump($db->getAttribute(PDO::ATTR_STATEMENT_CLASS));
+$db->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('PDOStatementx', array($db)));
+var_dump($db->getAttribute(PDO::ATTR_STATEMENT_CLASS));
+$stmt = $db->query('SELECT * FROM test');
+var_dump(get_class($stmt));
+var_dump(get_class($stmt->dbh));
+
+echo "===FOREACH===\n";
+
+foreach($stmt as $obj) {
+ var_dump($obj);
+}
+
+echo "===DONE===\n";
+exit(0);
+?>
+--EXPECTF--
+string(11) "PDODatabase"
+string(12) "PDOStatement"
+===QUERY===
+array(1) {
+ [0]=>
+ string(12) "PDOStatement"
+}
+array(2) {
+ [0]=>
+ string(13) "PDOStatementX"
+ [1]=>
+ array(1) {
+ [0]=>
+ object(PDODatabase)#%d (0) {
+ }
+ }
+}
+PDODatabase::query()
+PDOStatementX::__construct()
+string(13) "PDOStatementX"
+string(11) "PDODatabase"
+===FOREACH===
+array(3) {
+ ["id"]=>
+ string(2) "10"
+ ["val"]=>
+ string(3) "Abc"
+ ["val2"]=>
+ string(3) "zxy"
+}
+array(3) {
+ ["id"]=>
+ string(2) "20"
+ ["val"]=>
+ string(3) "Def"
+ ["val2"]=>
+ string(3) "wvu"
+}
+array(3) {
+ ["id"]=>
+ string(2) "30"
+ ["val"]=>
+ string(3) "Ghi"
+ ["val2"]=>
+ string(3) "tsr"
+}
+===DONE===
+PDODatabase::__destruct()
+PDOStatementX::__destruct()
+--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
new file mode 100755
index 000000000..30a75d79b
--- /dev/null
+++ b/ext/pdo/tests/pdo_031.phpt
@@ -0,0 +1,63 @@
+--TEST--
+PDO Common: PDOStatement SPL iterator
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+if (!extension_loaded('SPL')) print 'skip SPL not available';
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+if (!class_exists('RecursiveArrayIterator', false)) die('skip Class RecursiveArrayIterator missing');
+if (!class_exists('RecursiveTreeIterator', false) && !file_exists(getenv('REDIR_TEST_DIR').'../../spl/examples/recursivetreeiterator.inc')) die('skip Class RecursiveTreeIterator missing');
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+if (!class_exists('RecursiveTreeIterator', false)) require_once(getenv('REDIR_TEST_DIR').'../../spl/examples/recursivetreeiterator.inc');
+
+$data = array(
+ array('10', 'Abc', 'zxy'),
+ array('20', 'Def', 'wvu'),
+ array('30', 'Ghi', 'tsr'),
+);
+
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), val2 VARCHAR(16))');
+
+$stmt = $db->prepare("INSERT INTO test VALUES(?, ?, ?)");
+foreach ($data as $row) {
+ $stmt->execute($row);
+}
+
+unset($stmt);
+
+echo "===QUERY===\n";
+
+$stmt = $db->query('SELECT * FROM test');
+
+foreach(new RecursiveTreeIterator(new RecursiveArrayIterator($stmt->fetchAll(PDO::FETCH_ASSOC)), RecursiveTreeIterator::BYPASS_KEY) as $c=>$v)
+{
+ echo "$v [$c]\n";
+}
+
+echo "===DONE===\n";
+exit(0);
+?>
+--EXPECT--
+===QUERY===
+|-Array [0]
+| |-10 [id]
+| |-Abc [val]
+| \-zxy [val2]
+|-Array [1]
+| |-20 [id]
+| |-Def [val]
+| \-wvu [val2]
+\-Array [2]
+ |-30 [id]
+ |-Ghi [val]
+ \-tsr [val2]
+===DONE===
diff --git a/ext/pdo/tests/pdo_032.phpt b/ext/pdo/tests/pdo_032.phpt
new file mode 100644
index 000000000..aed6dd397
--- /dev/null
+++ b/ext/pdo/tests/pdo_032.phpt
@@ -0,0 +1,83 @@
+--TEST--
+PDO Common: PDO::ATTR_CASE
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
+$db->exec("INSERT INTO test VALUES(1, 'A')");
+$db->exec("INSERT INTO test VALUES(2, 'B')");
+$db->exec("INSERT INTO test VALUES(3, 'C')");
+
+// Lower case columns
+$db->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
+$stmt = $db->prepare('SELECT * from test');
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
+$stmt->closeCursor();
+
+// Upper case columns
+$db->setAttribute(PDO::ATTR_CASE, PDO::CASE_UPPER);
+$stmt = $db->prepare('SELECT * from test');
+$stmt->execute();
+var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
+$stmt->closeCursor();
+
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ array(2) {
+ ["id"]=>
+ string(1) "1"
+ ["val"]=>
+ string(1) "A"
+ }
+ [1]=>
+ array(2) {
+ ["id"]=>
+ string(1) "2"
+ ["val"]=>
+ string(1) "B"
+ }
+ [2]=>
+ array(2) {
+ ["id"]=>
+ string(1) "3"
+ ["val"]=>
+ string(1) "C"
+ }
+}
+array(3) {
+ [0]=>
+ array(2) {
+ ["ID"]=>
+ string(1) "1"
+ ["VAL"]=>
+ string(1) "A"
+ }
+ [1]=>
+ array(2) {
+ ["ID"]=>
+ string(1) "2"
+ ["VAL"]=>
+ string(1) "B"
+ }
+ [2]=>
+ array(2) {
+ ["ID"]=>
+ string(1) "3"
+ ["VAL"]=>
+ string(1) "C"
+ }
+}
diff --git a/ext/pdo/tests/pdo_test.inc b/ext/pdo/tests/pdo_test.inc
new file mode 100644
index 000000000..3a3040eac
--- /dev/null
+++ b/ext/pdo/tests/pdo_test.inc
@@ -0,0 +1,85 @@
+<?php
+# PDO test framework utilities
+
+if (getenv('PDOTEST_DSN') === false) {
+ $common = '';
+ $append = false;
+ foreach(file(dirname($_SERVER['PHP_SELF']).'/common.phpt') as $line) {
+ if ($append) {
+ $common .= $line;
+ } elseif (trim($line) == '--REDIRECTTEST--') {
+ $append = true;
+ }
+ }
+ if (ini_get('magic_quotes_runtime')) $common = stripslashes($common);
+ $conf = eval($common);
+ foreach($conf['ENV'] as $n=>$v) putenv("$n=$v");
+}
+
+class PDOTest {
+ // create an instance of the PDO driver, based on
+ // the current environment
+ static function factory($classname = 'PDO') {
+ $dsn = getenv('PDOTEST_DSN');
+ $user = getenv('PDOTEST_USER');
+ $pass = getenv('PDOTEST_PASS');
+ $attr = getenv('PDOTEST_ATTR');
+ if (is_string($attr) && strlen($attr)) {
+ $attr = unserialize($attr);
+ } else {
+ $attr = null;
+ }
+
+ if ($user === false) $user = NULL;
+ if ($pass === false) $pass = NULL;
+
+ $db = new $classname($dsn, $user, $pass, $attr);
+
+ // clean up any crufty test tables we might have left behind
+ // on a previous run
+ static $test_tables = array(
+ 'test',
+ 'test2',
+ 'classtypes'
+ );
+ foreach ($test_tables as $table) {
+ $db->exec("DROP TABLE $table");
+ }
+
+ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+ $db->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
+ $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
+ return $db;
+ }
+
+ static function skip() {
+ try {
+ $db = PDOTest::factory();
+ } catch (PDOException $e) {
+ die("skip " . $e->getMessage());
+ }
+ }
+
+ static function detect_transactional_mysql_engine($db) {
+ foreach ($db->query('show engines') as $row) {
+ if ($row[1] == 'YES' && ($row[0] == 'INNOBASE' || $row[0] == 'BDB')) {
+ return $row[0];
+ }
+ }
+ return false;
+ }
+
+ static function test_factory($file) {
+ $data = file_get_contents($file);
+ $data = preg_replace('/^.*--REDIRECTTEST--/s', '', $data);
+ $config = eval($data);
+ foreach ($config['ENV'] as $k => $v) {
+ putenv("$k=$v");
+ }
+ return self::factory();
+ }
+}
+
+
+
+?>
diff --git a/ext/pdo/tests/pecl_bug_5217.phpt b/ext/pdo/tests/pecl_bug_5217.phpt
new file mode 100644
index 000000000..0f9bc2c9d
--- /dev/null
+++ b/ext/pdo/tests/pecl_bug_5217.phpt
@@ -0,0 +1,29 @@
+--TEST--
+PDO Common: PECL Bug #5217: serialize/unserialze safety
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+try {
+ $ser = serialize($db);
+ debug_zval_dump($ser);
+ $db = unserialize($ser);
+ $db->exec('CREATE TABLE test (id int NOT NULL PRIMARY KEY, val VARCHAR(10))');
+} catch (Exception $e) {
+ echo "Safely caught " . $e->getMessage() . "\n";
+}
+
+echo "PHP Didn't crash!\n";
+?>
+--EXPECT--
+Safely caught You cannot serialize or unserialize PDO instances
+PHP Didn't crash!
diff --git a/ext/pdo/tests/pecl_bug_5772.phpt b/ext/pdo/tests/pecl_bug_5772.phpt
new file mode 100644
index 000000000..af380ff28
--- /dev/null
+++ b/ext/pdo/tests/pecl_bug_5772.phpt
@@ -0,0 +1,29 @@
+--TEST--
+PDO Common: PECL Bug #5772 PDO::FETCH_FUNC breaks on mixed case func name
+--SKIPIF--
+<?php # vim:ft=php:
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec("CREATE TABLE test (id int NOT NULL, PRIMARY KEY (id))");
+$db->exec("INSERT INTO test (id) VALUES (1)");
+
+function heLLO($row) {
+ return $row;
+}
+
+foreach ($db->query("SELECT * FROM test")->fetchAll(PDO::FETCH_FUNC, 'heLLO') as $row) {
+ var_dump($row);
+}
+
+--EXPECT--
+string(1) "1"
diff --git a/ext/pdo/tests/pecl_bug_5809.phpt b/ext/pdo/tests/pecl_bug_5809.phpt
new file mode 100644
index 000000000..fa36233e1
--- /dev/null
+++ b/ext/pdo/tests/pecl_bug_5809.phpt
@@ -0,0 +1,34 @@
+--TEST--
+PDO Common: PECL Bug #5809 PDOStatement::execute(array()) changes param
+--SKIPIF--
+<?php # vim:ft=php:
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec("CREATE TABLE test (id int NOT NULL, PRIMARY KEY (id))");
+$db->exec("INSERT INTO test (id) VALUES (1)");
+
+$values = array(1);
+var_dump($values);
+$stmt = $db->prepare('SELECT * FROM test WHERE id = ?');
+$stmt->execute($values);
+var_dump($values);
+
+--EXPECT--
+array(1) {
+ [0]=>
+ int(1)
+}
+array(1) {
+ [0]=>
+ int(1)
+}
diff --git a/ext/pdo_dblib/CREDITS b/ext/pdo_dblib/CREDITS
new file mode 100644
index 000000000..91a8057be
--- /dev/null
+++ b/ext/pdo_dblib/CREDITS
@@ -0,0 +1,2 @@
+DB-LIB (MS SQL, Sybase)
+Wez Furlong, Frank M. Kromann
diff --git a/ext/pdo_dblib/README b/ext/pdo_dblib/README
new file mode 100644
index 000000000..888ffb676
--- /dev/null
+++ b/ext/pdo_dblib/README
@@ -0,0 +1,25 @@
+This is the unified Sybase-DB style driver for PDO.
+There are three implementations of this library that are known to me:
+
+- The Sybase DB lib itself
+- MSSQL DB lib
+- FreeTDS DB lib
+
+This extension will compile and register itself as 'mssql' when built against
+the mssql libraries (and be named php_pdo_mssql.dll), or 'sybase' otherwise
+(php_pdo_sybase.dll)
+
+If you want to try out the free "desktop" version of SQL Server, known as the MSDE, google to obtain the appropriate download link. Here are some short tips on getting it running:
+
+- Download it and run it to extract it
+- Open up a command prompt
+- cd \MSDERelA
+- setup.exe SQLSECURITY=1 SAPWD=yoursecretpassword
+- cd \Program Files\Microsoft SQL Server\80\Tools\Binn
+- SVRNETCN.exe
+- enable TCP (you MUST do this if you want to access it via FreeTDS/Sybase libs)
+- net start mssqlserver
+
+Consult the MS docs for more information about all this stuff.
+
+
diff --git a/ext/pdo_dblib/config.m4 b/ext/pdo_dblib/config.m4
new file mode 100644
index 000000000..64d495d8d
--- /dev/null
+++ b/ext/pdo_dblib/config.m4
@@ -0,0 +1,88 @@
+dnl
+dnl $Id: config.m4,v 1.2.2.2 2005/11/01 13:12:52 wez Exp $
+dnl
+
+if test "$PHP_PDO" != "no"; then
+PHP_ARG_WITH(pdo-dblib, for PDO_DBLIB support via FreeTDS,
+[ --with-pdo-dblib[=DIR] Include PDO_DBLIB-DB support. DIR is the FreeTDS home
+ directory])
+
+
+if test "$PHP_PDO_DBLIB" != "no"; then
+
+ if test "$PHP_PDO_DBLIB" = "yes"; then
+
+ for i in /usr/local /usr; do
+ if test -f $i/include/tds.h; then
+ PDO_FREETDS_INSTALLATION_DIR=$i
+ PDO_FREETDS_INCLUDE_DIR=$i/include
+ break
+ elif test -f $i/include/freetds/tds.h; then
+ PDO_FREETDS_INSTALLATION_DIR=$i
+ PDO_FREETDS_INCLUDE_DIR=$i/include/freetds
+ break;
+ fi
+ done
+
+ if test -z "$PDO_FREETDS_INSTALLATION_DIR"; then
+ AC_MSG_ERROR(Cannot find FreeTDS in known installation directories)
+ fi
+
+ elif test "$PHP_PDO_DBLIB" != "no"; then
+
+ if test -f $PHP_PDO_DBLIB/include/tds.h; then
+ PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB
+ PDO_FREETDS_INCLUDE_DIR=$PHP_PDO_DBLIB/include
+ elif test -f $PHP_PDO_DBLIB/include/freetds/tds.h; then
+ PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB
+ PDO_FREETDS_INCLUDE_DIR=$PHP_PDO_DBLIB/include/freetds
+ else
+ AC_MSG_ERROR(Directory $PHP_PDO_DBLIB is not a FreeTDS installation directory)
+ fi
+ fi
+
+ if test "x$PHP_LIBDIR" = "x" ; then
+ PHP_LIBDIR=lib
+ fi
+
+ if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.so"; then
+ AC_MSG_ERROR(Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.[a|so])
+ fi
+
+ PHP_ADD_INCLUDE($PDO_FREETDS_INCLUDE_DIR)
+ PHP_ADD_LIBRARY_WITH_PATH(sybdb, $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, PDO_DBLIB_SHARED_LIBADD)
+
+ ifdef([PHP_CHECK_PDO_INCLUDES],
+ [
+ PHP_CHECK_PDO_INCLUDES
+ ],[
+ AC_MSG_CHECKING([for PDO includes])
+ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$prefix/include/php/ext
+ else
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
+ fi
+ AC_MSG_RESULT($pdo_inc_path)
+ ])
+
+ PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\""
+ PHP_NEW_EXTENSION(pdo_dblib, pdo_dblib.c dblib_driver.c dblib_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_DBLIB_DEFS)
+ AC_CHECK_LIB(dnet_stub, dnet_addr,
+ [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,PDO_DBLIB_SHARED_LIBADD)
+ AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ])
+ ])
+ AC_DEFINE(HAVE_PDO_DBLIB,1,[ ])
+ AC_DEFINE(HAVE_FREETDS,1,[ ])
+ PHP_SUBST(PDO_DBLIB_SHARED_LIBADD)
+
+ ifdef([PHP_ADD_EXTENSION_DEP],
+ [
+ PHP_ADD_EXTENSION_DEP(pdo_dblib, pdo)
+ ])
+fi
+
+fi
diff --git a/ext/pdo_dblib/config.w32 b/ext/pdo_dblib/config.w32
new file mode 100755
index 000000000..3b7a3a4b8
--- /dev/null
+++ b/ext/pdo_dblib/config.w32
@@ -0,0 +1,69 @@
+// $Id: config.w32,v 1.7 2005/02/16 18:09:26 wez Exp $
+// vim:ft=javascript
+
+ARG_WITH("pdo-dblib", "freetds dblib (Sybase, MS-SQL) support for PDO", "no");
+
+if (PHP_PDO_DBLIB != "no") {
+ /* if they pointed us to a freetds dir, pick that up,
+ * otherwise we'll poke around and look for MSSQL libs */
+
+ if (CHECK_LIB("sybdb.lib", "pdo_dblib", PHP_PDO_DBLIB) &&
+ CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_PDO_DBLIB",
+ PHP_PDO_DBLIB, null, null, true))
+ {
+ EXTENSION("pdo_dblib", "pdo_dblib.c dblib_driver.c dblib_stmt.c");
+ ADD_FLAG('CFLAGS_PDO_DBLIB', "/I pecl /I ..\\pecl /D PDO_DBLIB_FLAVOUR=\\\"freetds\\\"");
+ }
+ ADD_EXTENSION_DEP('pdo_dblib', 'pdo');
+}
+
+ARG_WITH("pdo-mssql", "Native MS-SQL support for PDO", "no");
+
+if (PHP_PDO_MSSQL != "no") {
+ /* if they pointed us to a freetds dir, pick that up,
+ * otherwise we'll poke around and look for MSSQL libs */
+
+ pdo_mssql_locations = new Array(
+ PHP_PDO_MSSQL,
+ "\\Program Files\\Microsoft SQL Server\\80",
+ "\\MSSQL8",
+ "\\MSSQL7",
+ PHP_PHP_BUILD + "\\MSSQL80"
+ );
+ PDO_DBLIB_FLAVOUR = 0;
+
+ if (CHECK_LIB("sybdb.lib", "pdo_mssql", PHP_PDO_MSSQL) &&
+ CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_PDO_MSSQL",
+ PHP_PDO_MSSQL, null, null, true)) {
+ /* smells like FreeTDS (or maybe native sybase dblib) */
+ PDO_DBLIB_FLAVOUR = "freetds";
+ } else {
+
+ for (i = 0; i < pdo_mssql_locations.length; i++) {
+ if (CHECK_LIB("ntwdblib.lib", "pdo_mssql",
+ pdo_mssql_locations[i] + "\\DevTools\\Lib") &&
+ CHECK_HEADER_ADD_INCLUDE("sqlfront.h", "CFLAGS_PDO_MSSQL",
+ pdo_mssql_locations[i] + "\\DevTools\\Include",
+ null, null, true)) {
+ if (pdo_mssql_locations[i] == 'yes') {
+ PDO_DBLIB_FLAVOUR = 70;
+ } else {
+ pdo_mssql_locations[i].match(new RegExp("(\\d)"));
+ PDO_DBLIB_FLAVOUR = RegExp.$1 + 0;
+ }
+ break;
+ }
+ }
+ }
+
+ if (PDO_DBLIB_FLAVOUR != 0) {
+ EXTENSION("pdo_mssql", "pdo_dblib.c dblib_driver.c dblib_stmt.c", null, null, null, "ext\\pdo_mssql");
+ if (PDO_DBLIB_FLAVOUR != "freetds") {
+ ADD_FLAG("CFLAGS_PDO_MSSQL", "/DPHP_DBLIB_IS_MSSQL=1 /DDBNTWIN32=1 /DMSSQL" + PDO_DBLIB_FLAVOUR + "0=1 /DMSSQL_VERSION=\\\"" + PDO_DBLIB_FLAVOUR + ".0\\\"");
+ ADD_FLAG("CFLAGS_PDO_MSSQL", "/DPDO_DBLIB_IS_MSSQL=" + PDO_DBLIB_FLAVOUR);
+ PDO_DBLIB_FLAVOUR = "MSSQL_" + PDO_DBLIB_FLAVOUR;
+ }
+ ADD_FLAG('CFLAGS_PDO_MSSQL', "/I pecl /I ..\\pecl /D PDO_DBLIB_FLAVOUR=\\\"" + PDO_DBLIB_FLAVOUR + "\\\"");
+ }
+ ADD_EXTENSION_DEP('pdo_mssql', 'pdo');
+}
diff --git a/ext/pdo_dblib/db.php b/ext/pdo_dblib/db.php
new file mode 100644
index 000000000..f9bac04d2
--- /dev/null
+++ b/ext/pdo_dblib/db.php
@@ -0,0 +1,31 @@
+<?php
+
+/* assumes that you have the freetds db.lib on windows */
+
+dl('php_pdo.dll');
+dl('php_pdo_sybase.dll');
+
+try {
+
+$db = new PDO('sybase:', 'pdo', 'pdo');
+$db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_EXCEPTION);
+debug_zval_dump($db);
+
+$stmt = $db->prepare('select 10');
+debug_zval_dump($stmt);
+
+$x = $stmt->execute();
+debug_zval_dump($x);
+
+while (($r = $stmt->fetch())) {
+ print_r($r);
+}
+
+} catch (Exception $e) {
+ print $e;
+}
+
+$stmt = null;
+$db = null;
+echo "All done\n";
+?>
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
new file mode 100644
index 000000000..2766ec2d3
--- /dev/null
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -0,0 +1,272 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ | Frank M. Kromann <frank@kromann.info> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: dblib_driver.c,v 1.9.2.1 2005/10/09 19:00:34 iliaa Exp $ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_dblib.h"
+#include "php_pdo_dblib_int.h"
+#include "zend_exceptions.h"
+
+static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+{
+ pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
+ pdo_dblib_err *einfo = &H->err;
+ pdo_dblib_stmt *S = NULL;
+ char *message;
+ char *msg;
+
+ if (stmt) {
+ S = (pdo_dblib_stmt*)stmt->driver_data;
+ einfo = &S->err;
+ }
+
+ if (einfo->dberr == SYBESMSG && einfo->lastmsg) {
+ msg = einfo->lastmsg;
+ } else if (einfo->dberr == SYBESMSG && DBLIB_G(err).lastmsg) {
+ msg = DBLIB_G(err).lastmsg;
+ DBLIB_G(err).lastmsg = NULL;
+ } else {
+ msg = einfo->dberrstr;
+ }
+
+ spprintf(&message, 0, "%s [%d] (severity %d) [%s]",
+ msg, einfo->dberr, einfo->severity, stmt ? stmt->active_query_string : "");
+
+ add_next_index_long(info, einfo->dberr);
+ add_next_index_string(info, message, 0);
+ add_next_index_long(info, einfo->oserr);
+ add_next_index_long(info, einfo->severity);
+ if (einfo->oserrstr) {
+ add_next_index_string(info, einfo->oserrstr, 1);
+ }
+
+ return 1;
+}
+
+
+static int dblib_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
+
+ if (H) {
+ if (H->link) {
+ dbclose(H->link);
+ H->link = NULL;
+ }
+ if (H->login) {
+ dbfreelogin(H->login);
+ H->login = NULL;
+ }
+ pefree(H, dbh->is_persistent);
+ dbh->driver_data = NULL;
+ }
+ return 0;
+}
+
+static int dblib_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+{
+ pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
+ pdo_dblib_stmt *S = ecalloc(1, sizeof(*S));
+
+ S->H = H;
+ stmt->driver_data = S;
+ stmt->methods = &dblib_stmt_methods;
+ stmt->supports_placeholders = PDO_PLACEHOLDER_NONE;
+ S->err.sqlstate = stmt->error_code;
+
+ return 1;
+}
+
+static long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC)
+{
+ pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
+ RETCODE ret, resret;
+
+ dbsetuserdata(H->link, (BYTE*)&H->err);
+
+ if (FAIL == dbcmd(H->link, sql)) {
+ return -1;
+ }
+
+ if (FAIL == dbsqlexec(H->link)) {
+ return -1;
+ }
+
+ resret = dbresults(H->link);
+
+ if (resret == FAIL) {
+ return -1;
+ }
+
+ ret = dbnextrow(H->link);
+ if (ret == FAIL) {
+ return -1;
+ }
+
+ if (dbnumcols(H->link) <= 0) {
+ return DBCOUNT(H->link);
+ }
+
+ /* throw away any rows it might have returned */
+ dbcanquery(H->link);
+
+ return DBCOUNT(H->link);
+}
+
+static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+{
+ pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
+ char *q;
+ int l = 1;
+
+ *quoted = q = emalloc(2 * unquotedlen + 3);
+ *q++ = '\'';
+
+ while (unquotedlen--) {
+ if (*unquoted == '\'') {
+ *q++ = '\'';
+ *q++ = '\'';
+ l += 2;
+ } else {
+ *q++ = *unquoted;
+ ++l;
+ }
+ unquoted++;
+ }
+
+ *q++ = '\'';
+ *q++ = '\0';
+ *quotedlen = l+1;
+
+ return 1;
+}
+
+static struct pdo_dbh_methods dblib_methods = {
+ dblib_handle_closer,
+ dblib_handle_preparer,
+ dblib_handle_doer,
+ dblib_handle_quoter,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* last insert */
+ dblib_fetch_error, /* fetch error */
+ NULL, /* get attr */
+ NULL, /* check liveness */
+};
+
+static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC)
+{
+ pdo_dblib_db_handle *H;
+ int i, ret = 0;
+ struct pdo_data_src_parser vars[] = {
+ { "charset", NULL, 0 },
+ { "appname", "PHP " PDO_DBLIB_FLAVOUR, 0 },
+ { "host", "127.0.0.1", 0 },
+ { "dbname", NULL, 0 },
+ { "secure", NULL, 0 }, /* DBSETLSECURE */
+ /* TODO: DBSETLVERSION ? */
+ };
+
+ php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5);
+
+ H = pecalloc(1, sizeof(*H), dbh->is_persistent);
+ H->login = dblogin();
+ H->err.sqlstate = dbh->error_code;
+
+ if (!H->login) {
+ goto cleanup;
+ }
+
+ if (dbh->username) {
+ DBSETLUSER(H->login, dbh->username);
+ }
+ if (dbh->password) {
+ DBSETLPWD(H->login, dbh->password);
+ }
+
+#if !PHP_DBLIB_IS_MSSQL
+ if (vars[0].optval) {
+ DBSETLCHARSET(H->login, vars[0].optval);
+ }
+#endif
+
+ DBSETLAPP(H->login, vars[1].optval);
+
+#if PHP_DBLIB_IS_MSSQL
+ dbprocerrhandle(H->login, (EHANDLEFUNC) error_handler);
+ dbprocmsghandle(H->login, (MHANDLEFUNC) msg_handler);
+#endif
+
+ H->link = dbopen(H->login, vars[2].optval);
+
+ if (H->link == NULL) {
+ goto cleanup;
+ }
+
+ if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) {
+ goto cleanup;
+ }
+
+ ret = 1;
+ dbh->max_escaped_char_length = 2;
+ dbh->alloc_own_columns = 1;
+
+cleanup:
+ for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) {
+ if (vars[i].freeme) {
+ efree(vars[i].optval);
+ }
+ }
+
+ dbh->methods = &dblib_methods;
+ dbh->driver_data = H;
+
+ if (!ret) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC,
+ "SQLSTATE[%s] %s (severity %d)",
+ DBLIB_G(err).sqlstate,
+ DBLIB_G(err).dberrstr,
+ DBLIB_G(err).severity);
+ }
+
+ return ret;
+}
+
+pdo_driver_t pdo_dblib_driver = {
+#if PDO_DBLIB_IS_MSSQL
+ PDO_DRIVER_HEADER(mssql),
+#elif defined(PHP_WIN32)
+ PDO_DRIVER_HEADER(sybase),
+#else
+ PDO_DRIVER_HEADER(dblib),
+#endif
+ pdo_dblib_handle_factory
+};
+
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
new file mode 100644
index 000000000..bc390564c
--- /dev/null
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -0,0 +1,265 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ | Frank M. Kromann <frank@kromann.info> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: dblib_stmt.c,v 1.6.2.1 2005/10/12 15:03:02 iliaa Exp $ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_dblib.h"
+#include "php_pdo_dblib_int.h"
+#include "zend_exceptions.h"
+
+static void free_rows(pdo_dblib_stmt *S TSRMLS_DC)
+{
+ int i, j;
+
+ for (i = 0; i < S->nrows; i++) {
+ for (j = 0; j < S->ncols; j++) {
+ pdo_dblib_colval *val = &S->rows[i] + j;
+ if (val->data) {
+ efree(val->data);
+ val->data = NULL;
+ }
+ }
+ }
+ efree(S->rows);
+ S->rows = NULL;
+ S->nrows = 0;
+}
+
+static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
+
+ if (S->rows) {
+ free_rows(S TSRMLS_CC);
+ }
+ if (S->cols) {
+ efree(S->cols);
+ }
+ efree(S);
+
+ return 1;
+}
+
+static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_dbh_t *dbh = stmt->dbh;
+ pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
+ pdo_dblib_db_handle *H = S->H;
+ RETCODE resret, ret;
+ int i, j;
+ int arows;
+ unsigned int size;
+
+ dbsetuserdata(H->link, &S->err);
+
+ if (S->rows) {
+ /* clean them up */
+ free_rows(S TSRMLS_CC);
+ }
+
+ if (FAIL == dbcmd(H->link, stmt->active_query_string)) {
+ return 0;
+ }
+ if (FAIL == dbsqlexec(H->link)) {
+ return 0;
+ }
+
+ resret = dbresults(H->link);
+ if (resret == FAIL) {
+ return 0;
+ }
+
+ ret = dbnextrow(H->link);
+
+ stmt->row_count = DBCOUNT(H->link);
+
+ if (ret == NO_MORE_ROWS) {
+ return 1;
+ }
+
+ if (!S->cols) {
+ S->ncols = dbnumcols(H->link);
+
+ if (S->ncols <= 0) {
+ return 1;
+ }
+
+ S->cols = ecalloc(S->ncols, sizeof(pdo_dblib_col));
+ stmt->column_count = S->ncols;
+
+ for (i = 0, j = 0; i < S->ncols; i++) {
+ S->cols[i].coltype = dbcoltype(H->link, i+1);
+ S->cols[i].name = dbcolname(H->link, i+1);
+ if (S->cols[i].name) {
+ S->cols[i].name = estrdup(S->cols[i].name);
+ } else if (j) {
+ spprintf(&S->cols[i].name, 0, "computed%d", j++);
+ } else {
+ S->cols[i].name = estrdup("computed");
+ j++;
+ }
+ S->cols[i].source = dbcolsource(H->link, i+1);
+ S->cols[i].source = estrdup(S->cols[i].source ? S->cols[i].source : "");
+ S->cols[i].maxlen = dbcollen(H->link, i+1);
+ }
+ }
+
+ arows = 100;
+ size = S->ncols * sizeof(pdo_dblib_colval);
+ S->rows = emalloc(arows * size);
+
+ /* let's fetch all the data */
+ do {
+ if (S->nrows >= arows) {
+ arows *= 2;
+ S->rows = erealloc(S->rows, arows * size);
+ }
+ for (i = 0; i < S->ncols; i++) {
+ pdo_dblib_colval *val = &S->rows[S->nrows * S->ncols + i];
+
+ if (dbdatlen(H->link, i+1) == 0 && dbdata(H->link, i+1) == NULL) {
+ val->len = 0;
+ val->data = NULL;
+ } else {
+ switch (S->cols[i].coltype) {
+ case SQLCHAR:
+ case SQLTEXT:
+ case SQLVARBINARY:
+ case SQLBINARY:
+ case SQLIMAGE:
+ val->len = dbdatlen(H->link, i+1);
+ val->data = emalloc(val->len + 1);
+ memcpy(val->data, dbdata(H->link, i+1), val->len);
+ val->data[val->len] = '\0';
+ break;
+
+ default:
+ if (dbwillconvert(S->cols[i].coltype, SQLCHAR)) {
+ val->len = 32 + (2 * dbdatlen(H->link, i+1));
+ val->data = emalloc(val->len);
+
+ val->len = dbconvert(NULL, S->cols[i].coltype, dbdata(H->link, i+1),
+ dbdatlen(H->link, i+1), SQLCHAR, val->data, val->len);
+
+ if (val->len >= 0) {
+ val->data[val->len] = '\0';
+ }
+ } else {
+ val->len = 0;
+ val->data = NULL;
+ }
+ }
+ }
+ }
+
+ S->nrows++;
+
+ ret = dbnextrow(H->link);
+
+ if (ret == BUF_FULL) {
+ dbclrbuf(H->link, DBLASTROW(H->link)-1);
+ }
+ } while (ret != FAIL && ret != NO_MORE_ROWS);
+
+ if (resret != NO_MORE_RESULTS) {
+ /* there are additional result sets available */
+ dbresults(H->link);
+ /* cancel pending rows */
+ dbcanquery(H->link);
+
+ /* TODO: figure out a sane solution */
+ }
+
+ S->current = -1;
+
+ return 1;
+}
+
+static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt,
+ enum pdo_fetch_orientation ori, long offset TSRMLS_DC)
+{
+ pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
+
+ if (!S->rows) {
+ return 0;
+ }
+
+ if (++S->current < S->nrows) {
+ return 1;
+ }
+
+ return 0;
+}
+
+static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+{
+ pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
+ struct pdo_column_data *col = &stmt->columns[colno];
+
+ if (!S->rows) {
+ return 0;
+ }
+
+ col->maxlen = S->cols[colno].maxlen;
+ col->namelen = strlen(S->cols[colno].name);
+ col->name = estrdup(S->cols[colno].name);
+ col->param_type = PDO_PARAM_STR;
+
+ return 1;
+}
+
+static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
+ unsigned long *len, int *caller_frees TSRMLS_DC)
+{
+ pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
+ pdo_dblib_colval *val = &S->rows[S->current * S->ncols + colno];
+
+ *ptr = val->data;
+ *len = val->len;
+ return 1;
+}
+
+static int pdo_dblib_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
+ enum pdo_param_event event_type TSRMLS_DC)
+{
+ return 1;
+}
+
+
+struct pdo_stmt_methods dblib_stmt_methods = {
+ pdo_dblib_stmt_dtor,
+ pdo_dblib_stmt_execute,
+ pdo_dblib_stmt_fetch,
+ pdo_dblib_stmt_describe,
+ pdo_dblib_stmt_get_col,
+ pdo_dblib_stmt_param_hook,
+ NULL, /* set attr */
+ NULL, /* get attr */
+ NULL, /* meta */
+};
+
diff --git a/ext/pdo_dblib/package.xml b/ext/pdo_dblib/package.xml
new file mode 100644
index 000000000..6b2335424
--- /dev/null
+++ b/ext/pdo_dblib/package.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE package SYSTEM "../pear/package.dtd">
+<package version="1.0">
+ <name>PDO_DBLIB</name>
+ <summary>FreeTDS/Sybase/MSSQL driver for PDO</summary>
+ <maintainers>
+ <maintainer>
+ <user>wez</user>
+ <name>Wez Furlong</name>
+ <email>wez@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>fmk</user>
+ <name>Frank M. Kromann</name>
+ <email>fmk@php.net</email>
+ <role>lead</role>
+ </maintainer>
+
+ </maintainers>
+ <description>
+ This extension provides a FreeTDS/Sybase/MSSQL driver for PDO.
+ </description>
+ <license>PHP</license>
+ <release>
+ <state>stable</state>
+ <version>1.0</version>
+ <date>2005-11-26</date>
+
+ <notes>
+Update code for API changes in PDO; no actual changes have been made to this driver.
+
+Windows binaries can be found at:
+http://pecl4win.php.net/ext.php/php_pdo_mssql.dll,
+
+however: you are *strongly* recommended to use PDO_ODBC instead of this driver on
+Windows platforms.
+
+** Changes **
+- Fix Bug #34777; segfault when retrieving non-existent error info
+- Fix Bug #35032; didn't find FreeTDS includes on some systems
+ </notes>
+
+ <filelist>
+ <file role="src" name="config.m4"/>
+ <file role="src" name="pdo_dblib.c"/>
+ <file role="src" name="dblib_driver.c"/>
+ <file role="src" name="dblib_stmt.c"/>
+ <file role="src" name="php_pdo_dblib.h"/>
+ <file role="src" name="php_pdo_dblib_int.h"/>
+
+ <file role="doc" name="CREDITS"/>
+ <file role="doc" name="README"/>
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="5.0.3"/>
+ <dep type="ext" name="pdo" rel="ge" version="1.0"/>
+ </deps>
+ </release>
+</package>
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c
new file mode 100644
index 000000000..5c6b2c2f2
--- /dev/null
+++ b/ext/pdo_dblib/pdo_dblib.c
@@ -0,0 +1,224 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ | Frank M. Kromann <frank@kromann.info> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_dblib.c,v 1.9.2.3 2005/11/26 20:50:07 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_dblib.h"
+#include "php_pdo_dblib_int.h"
+#include "zend_exceptions.h"
+
+ZEND_DECLARE_MODULE_GLOBALS(dblib)
+
+function_entry pdo_dblib_functions[] = {
+ {NULL, NULL, NULL}
+};
+
+#if ZEND_MODULE_API_NO >= 20050922
+static zend_module_dep pdo_dblib_deps[] = {
+ ZEND_MOD_REQUIRED("pdo")
+ {NULL, NULL, NULL}
+};
+#endif
+
+zend_module_entry pdo_dblib_module_entry = {
+#if ZEND_MODULE_API_NO >= 20050922
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_dblib_deps,
+#else
+ STANDARD_MODULE_HEADER,
+#endif
+#if PDO_DBLIB_IS_MSSQL
+ "pdo_mssql",
+#elif defined(PHP_WIN32)
+ "pdo_sybase",
+#else
+ "pdo_dblib",
+#endif
+ pdo_dblib_functions,
+ PHP_MINIT(pdo_dblib),
+ PHP_MSHUTDOWN(pdo_dblib),
+ NULL,
+ PHP_RSHUTDOWN(pdo_dblib),
+ PHP_MINFO(pdo_dblib),
+ "1.0",
+ STANDARD_MODULE_PROPERTIES
+};
+
+#if defined(COMPILE_DL_PDO_DBLIB) || defined(COMPILE_DL_PDO_MSSQL)
+ZEND_GET_MODULE(pdo_dblib)
+#endif
+
+int error_handler(DBPROCESS *dbproc, int severity, int dberr,
+ int oserr, char *dberrstr, char *oserrstr)
+{
+ pdo_dblib_err *einfo;
+ char *state = "HY000";
+ TSRMLS_FETCH();
+
+ einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
+ if (!einfo) einfo = &DBLIB_G(err);
+
+ einfo->severity = severity;
+ einfo->oserr = oserr;
+ einfo->dberr = dberr;
+ if (einfo->oserrstr) {
+ efree(einfo->oserrstr);
+ }
+ if (einfo->dberrstr) {
+ efree(einfo->dberrstr);
+ }
+ if (oserrstr) {
+ einfo->oserrstr = estrdup(oserrstr);
+ } else {
+ einfo->oserrstr = NULL;
+ }
+ if (dberrstr) {
+ einfo->dberrstr = estrdup(dberrstr);
+ } else {
+ einfo->dberrstr = NULL;
+ }
+
+ switch (dberr) {
+ case SYBESEOF:
+ case SYBEFCON: state = "01002"; break;
+ case SYBEMEM: state = "HY001"; break;
+ case SYBEPWD: state = "28000"; break;
+ }
+ strcpy(einfo->sqlstate, state);
+
+#if 0
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "dblib error: %d %s (severity %d)",
+ dberr, dberrstr, severity);
+#endif
+
+ return INT_CANCEL;
+}
+
+int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate,
+ int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line)
+{
+ pdo_dblib_err *einfo;
+ TSRMLS_FETCH();
+
+ if (severity) {
+ einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
+ if (!einfo) {
+ einfo = &DBLIB_G(err);
+ }
+
+ if (einfo->lastmsg) {
+ efree(einfo->lastmsg);
+ }
+
+ einfo->lastmsg = estrdup(msgtext);
+ }
+
+#if 0
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "dblib message: %s (severity %d)", msgtext, severity);
+#endif
+
+ return 0;
+}
+
+static int init_dblib_globals(zend_dblib_globals *g)
+{
+ memset(g, 0, sizeof(*g));
+ g->err.sqlstate = g->sqlstate;
+ return SUCCESS;
+}
+
+PHP_RSHUTDOWN_FUNCTION(pdo_dblib)
+{
+ if (DBLIB_G(err).oserrstr) {
+ efree(DBLIB_G(err).oserrstr);
+ DBLIB_G(err).oserrstr = NULL;
+ }
+ if (DBLIB_G(err).dberrstr) {
+ efree(DBLIB_G(err).dberrstr);
+ DBLIB_G(err).dberrstr = NULL;
+ }
+ if (DBLIB_G(err).lastmsg) {
+ efree(DBLIB_G(err).lastmsg);
+ DBLIB_G(err).lastmsg = NULL;
+ }
+ return SUCCESS;
+}
+
+PHP_MINIT_FUNCTION(pdo_dblib)
+{
+ if (FAIL == dbinit()) {
+ return FAILURE;
+ }
+
+ if (FAILURE == php_pdo_register_driver(&pdo_dblib_driver)) {
+ return FAILURE;
+ }
+
+ ZEND_INIT_MODULE_GLOBALS(dblib, init_dblib_globals, NULL);
+
+ /* TODO:
+
+ dbsetifile()
+ dbsetmaxprocs()
+ dbsetlogintime()
+ dbsettime()
+
+ */
+
+#if !PHP_DBLIB_IS_MSSQL
+ dberrhandle(error_handler);
+ dbmsghandle(msg_handler);
+#endif
+
+ return SUCCESS;
+}
+
+PHP_MSHUTDOWN_FUNCTION(pdo_dblib)
+{
+ php_pdo_unregister_driver(&pdo_dblib_driver);
+ dbexit();
+ return SUCCESS;
+}
+
+PHP_MINFO_FUNCTION(pdo_dblib)
+{
+ php_info_print_table_start();
+ php_info_print_table_header(2, "PDO Driver for "
+#if PDO_DBLIB_IS_MSSQL
+ "MSSQL"
+#elif defined(PHP_WIN32)
+ "FreeTDS/Sybase/MSSQL"
+#else
+ "FreeTDS/Sybase"
+#endif
+ " DB-lib", "enabled");
+ php_info_print_table_row(2, "Flavour", PDO_DBLIB_FLAVOUR);
+ php_info_print_table_end();
+}
+
diff --git a/ext/pdo_dblib/php_pdo_dblib.h b/ext/pdo_dblib/php_pdo_dblib.h
new file mode 100644
index 000000000..e832ee285
--- /dev/null
+++ b/ext/pdo_dblib/php_pdo_dblib.h
@@ -0,0 +1,45 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ | Frank M. Kromann <frank@kromann.info> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_dblib.h,v 1.2 2005/01/18 02:42:52 wez Exp $ */
+
+#ifndef PHP_PDO_DBLIB_H
+#define PHP_PDO_DBLIB_H
+
+
+extern zend_module_entry pdo_dblib_module_entry;
+#define phpext_pdo_dblib_ptr &pdo_dblib_module_entry
+
+#ifdef PHP_WIN32
+# define PHP_PDO_DBLIB_API __declspec(dllexport)
+#else
+# define PHP_PDO_DBLIB_API
+#endif
+
+#ifdef ZTS
+# include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(pdo_dblib);
+PHP_MSHUTDOWN_FUNCTION(pdo_dblib);
+PHP_MINFO_FUNCTION(pdo_dblib);
+PHP_RSHUTDOWN_FUNCTION(pdo_dblib);
+
+#endif
+
diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h
new file mode 100644
index 000000000..5f7b055ee
--- /dev/null
+++ b/ext/pdo_dblib/php_pdo_dblib_int.h
@@ -0,0 +1,156 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ | Frank M. Kromann <frank@kromann.info> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_dblib_int.h,v 1.4 2005/07/12 12:16:02 wez Exp $ */
+
+#ifndef PHP_PDO_DBLIB_INT_H
+#define PHP_PDO_DBLIB_INT_H
+
+#ifndef PDO_DBLIB_FLAVOUR
+# define PDO_DBLIB_FLAVOUR "Generic DB-lib"
+#endif
+
+#if PHP_DBLIB_IS_MSSQL
+# include <sqlfront.h>
+# include <sqldb.h>
+
+# define DBERRHANDLE(a, b) dbprocerrhandle(a, b)
+# define DBMSGHANDLE(a, b) dbprocmsghandle(a, b)
+# define EHANDLEFUNC DBERRHANDLE_PROC
+# define MHANDLEFUNC DBMSGHANDLE_PROC
+# define DBSETOPT(a, b, c) dbsetopt(a, b, c)
+# define SYBESMSG SQLESMSG
+# define SYBESEOF SQLESEOF
+# define SYBEFCON SQLECONN // SQLEFCON does not exist in MS SQL Server.
+# define SYBEMEM SQLEMEM
+# define SYBEPWD SQLEPWD
+
+#else
+# include <sybfront.h>
+# include <sybdb.h>
+# include <syberror.h>
+
+/* alias some types */
+# define SQLTEXT SYBTEXT
+# define SQLCHAR SYBCHAR
+# define SQLVARCHAR SYBVARCHAR
+# define SQLINT1 SYBINT1
+# define SQLINT2 SYBINT2
+# define SQLINT4 SYBINT4
+# define SQLINTN SYBINTN
+# define SQLBIT SYBBIT
+# define SQLFLT4 SYBREAL
+# define SQLFLT8 SYBFLT8
+# define SQLFLTN SYBFLTN
+# define SQLDECIMAL SYBDECIMAL
+# define SQLNUMERIC SYBNUMERIC
+# define SQLDATETIME SYBDATETIME
+# define SQLDATETIM4 SYBDATETIME4
+# define SQLDATETIMN SYBDATETIMN
+# define SQLMONEY SYBMONEY
+# define SQLMONEY4 SYBMONEY4
+# define SQLMONEYN SYBMONEYN
+# define SQLIMAGE SYBIMAGE
+# define SQLBINARY SYBBINARY
+# define SQLVARBINARY SYBVARBINARY
+# ifdef SYBUNIQUE
+# define SQLUNIQUE SYBUNIQUE
+# endif
+
+# define DBERRHANDLE(a, b) dberrhandle(b)
+# define DBMSGHANDLE(a, b) dbmsghandle(b)
+# define DBSETOPT(a, b, c) dbsetopt(a, b, c, -1)
+# define NO_MORE_RPC_RESULTS 3
+# define dbfreelogin dbloginfree
+# define dbrpcexec dbrpcsend
+
+typedef short TDS_SHORT;
+# ifndef PHP_WIN32
+typedef unsigned char *LPBYTE;
+# endif
+typedef float DBFLT4;
+#endif
+
+int error_handler(DBPROCESS *dbproc, int severity, int dberr,
+ int oserr, char *dberrstr, char *oserrstr);
+
+int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate,
+ int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line);
+
+extern pdo_driver_t pdo_dblib_driver;
+extern struct pdo_stmt_methods dblib_stmt_methods;
+
+typedef struct {
+ int severity;
+ int oserr;
+ int dberr;
+ char *oserrstr;
+ char *dberrstr;
+ char *sqlstate;
+ char *lastmsg;
+} pdo_dblib_err;
+
+typedef struct {
+ LOGINREC *login;
+ DBPROCESS *link;
+
+ pdo_dblib_err err;
+} pdo_dblib_db_handle;
+
+typedef struct {
+ int coltype;
+ char *name;
+ int maxlen;
+ char *source;
+} pdo_dblib_col;
+
+typedef struct {
+ unsigned long len;
+ char *data;
+} pdo_dblib_colval;
+
+typedef struct {
+ pdo_dblib_db_handle *H;
+
+ int ncols;
+ pdo_dblib_col *cols;
+
+ pdo_dblib_colval *rows;
+ int nrows;
+
+ int current;
+
+ pdo_dblib_err err;
+} pdo_dblib_stmt;
+
+ZEND_BEGIN_MODULE_GLOBALS(dblib)
+ pdo_dblib_err err;
+ char sqlstate[6];
+ZEND_END_MODULE_GLOBALS(dblib)
+
+#ifdef ZTS
+# define DBLIB_G(v) TSRMG(dblib_globals_id, zend_dblib_globals *, v)
+#else
+# define DBLIB_G(v) (dblib_globals.v)
+#endif
+
+ZEND_EXTERN_MODULE_GLOBALS(dblib);
+
+#endif
+
diff --git a/ext/pdo_firebird/CREDITS b/ext/pdo_firebird/CREDITS
new file mode 100644
index 000000000..a33294b69
--- /dev/null
+++ b/ext/pdo_firebird/CREDITS
@@ -0,0 +1,2 @@
+Firebird/InterBase driver for PDO
+Ard Biesheuvel
diff --git a/ext/w32api/EXPERIMENTAL b/ext/pdo_firebird/EXPERIMENTAL
index e69de29bb..e69de29bb 100644
--- a/ext/w32api/EXPERIMENTAL
+++ b/ext/pdo_firebird/EXPERIMENTAL
diff --git a/ext/pdo_firebird/config.m4 b/ext/pdo_firebird/config.m4
new file mode 100644
index 000000000..78618f386
--- /dev/null
+++ b/ext/pdo_firebird/config.m4
@@ -0,0 +1,53 @@
+dnl
+dnl $Id: config.m4,v 1.8 2005/06/14 00:00:52 sniper Exp $
+dnl
+
+if test "$PHP_PDO" != "no"; then
+
+PHP_ARG_WITH(pdo-firebird,for Firebird support for PDO,
+[ --with-pdo-firebird[=DIR] PDO: Firebird support. DIR is the Firebird base
+ install directory, defaults to /opt/firebird])
+
+if test "$PHP_PDO_FIREBIRD" != "no"; then
+ if test "$PHP_PDO_FIREBIRD" = "yes"; then
+ FIREBIRD_INCDIR=/opt/firebird/include
+ FIREBIRD_LIBDIR=/opt/firebird/lib
+ else
+ FIREBIRD_INCDIR=$PHP_PDO_FIREBIRD/include
+ FIREBIRD_LIBDIR=$PHP_PDO_FIREBIRD/lib
+ fi
+
+ PHP_CHECK_LIBRARY(fbclient, isc_detach_database,
+ [
+ FIREBIRD_LIBNAME=fbclient
+ ], [
+ PHP_CHECK_LIBRARY(gds, isc_detach_database,
+ [
+ FIREBIRD_LIBNAME=gds
+ ], [
+ PHP_CHECK_LIBRARY(ib_util, isc_detach_database,
+ [
+ FIREBIRD_LIBNAME=ib_util
+ ], [
+ AC_MSG_ERROR([libfbclient, libgds or libib_util not found! Check config.log for more information.])
+ ], [
+ -L$FIREBIRD_LIBDIR
+ ])
+ ], [
+ -L$FIREBIRD_LIBDIR
+ ])
+ ], [
+ -L$FIREBIRD_LIBDIR
+ ])
+
+ PHP_CHECK_PDO_INCLUDES
+
+ PHP_ADD_LIBRARY_WITH_PATH($FIREBIRD_LIBNAME, $FIREBIRD_LIBDIR, PDO_FIREBIRD_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($FIREBIRD_INCDIR)
+ AC_DEFINE(HAVE_PDO_FIREBIRD,1,[ ])
+ PHP_NEW_EXTENSION(pdo_firebird, pdo_firebird.c firebird_driver.c firebird_statement.c, $ext_shared,,-I$pdo_inc_path)
+ PHP_SUBST(PDO_FIREBIRD_SHARED_LIBADD)
+ PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo)
+fi
+
+fi
diff --git a/ext/pdo_firebird/config.w32 b/ext/pdo_firebird/config.w32
new file mode 100644
index 000000000..952ad79ee
--- /dev/null
+++ b/ext/pdo_firebird/config.w32
@@ -0,0 +1,18 @@
+// $Id: config.w32,v 1.6 2004/06/12 18:42:13 abies Exp $
+// vim:ft=javascript
+
+ARG_WITH("pdo-firebird", "Firebird support for PDO", "no");
+
+if (PHP_PDO_FIREBIRD != "no") {
+
+ if ((CHECK_LIB("fbclient_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD)
+ || CHECK_LIB("gds32_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD)
+ ) && CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_PDO_FIREBIRD", PHP_PHP_BUILD + "\\interbase\\include;" + PHP_PDO_FIREBIRD)) {
+
+ EXTENSION("pdo_firebird", "pdo_firebird.c firebird_driver.c firebird_statement.c");
+ ADD_FLAG('CFLAGS_PDO_FIREBIRD', "/I ..\\pecl");
+ } else {
+ WARNING("pdo_firebird not enabled; libraries and headers not found");
+ }
+ ADD_EXTENSION_DEP('pdo_firebird', 'pdo');
+}
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
new file mode 100644
index 000000000..0accbea87
--- /dev/null
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -0,0 +1,664 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Ard Biesheuvel <abies@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: firebird_driver.c,v 1.17.2.1 2005/09/11 01:42:41 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define _GNU_SOURCE
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_firebird.h"
+#include "php_pdo_firebird_int.h"
+
+static int firebird_alloc_prepare_stmt(pdo_dbh_t*, const char*, long, XSQLDA*, isc_stmt_handle*,
+ HashTable* TSRMLS_DC);
+
+/* map driver specific error message to PDO error */
+void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, long line TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_db_handle *H = stmt ? ((pdo_firebird_stmt *)stmt->driver_data)->H
+ : (pdo_firebird_db_handle *)dbh->driver_data;
+ pdo_error_type *const error_code = stmt ? &stmt->error_code : &dbh->error_code;
+
+#if 0
+ switch (isc_sqlcode(H->isc_status)) {
+
+ case 0:
+ *error_code = PDO_ERR_NONE;
+ break;
+ default:
+ *error_code = PDO_ERR_CANT_MAP;
+ break;
+ case -104:
+ *error_code = PDO_ERR_SYNTAX;
+ break;
+ case -530:
+ case -803:
+ *error_code = PDO_ERR_CONSTRAINT;
+ break;
+ case -204:
+ case -205:
+ case -206:
+ case -829:
+ *error_code = PDO_ERR_NOT_FOUND;
+ break;
+
+ *error_code = PDO_ERR_ALREADY_EXISTS;
+ break;
+
+ *error_code = PDO_ERR_NOT_IMPLEMENTED;
+ break;
+ case -313:
+ case -804:
+ *error_code = PDO_ERR_MISMATCH;
+ break;
+ case -303:
+ case -314:
+ case -413:
+ *error_code = PDO_ERR_TRUNCATED;
+ break;
+
+ *error_code = PDO_ERR_DISCONNECTED;
+ break;
+ }
+#else
+ strcpy(*error_code, "HY000");
+#endif
+}
+/* }}} */
+
+#define RECORD_ERROR(dbh) _firebird_error(dbh, NULL, __FILE__, __LINE__ TSRMLS_CC)
+
+/* called by PDO to close a db handle */
+static int firebird_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+
+ if (dbh->in_txn) {
+ if (dbh->auto_commit) {
+ if (isc_commit_transaction(H->isc_status, &H->tr)) {
+ RECORD_ERROR(dbh);
+ }
+ } else {
+ if (isc_rollback_transaction(H->isc_status, &H->tr)) {
+ RECORD_ERROR(dbh);
+ }
+ }
+ }
+
+ if (isc_detach_database(H->isc_status, &H->db)) {
+ RECORD_ERROR(dbh);
+ }
+
+ pefree(H, dbh->is_persistent);
+
+ return 0;
+}
+/* }}} */
+
+/* called by PDO to prepare an SQL query */
+static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, /* {{{ */
+ pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+ pdo_firebird_stmt *S = NULL;
+ HashTable *np;
+
+ do {
+ isc_stmt_handle s = NULL;
+ XSQLDA num_sqlda;
+ static char const info[] = { isc_info_sql_stmt_type };
+ char result[8];
+
+ num_sqlda.version = PDO_FB_SQLDA_VERSION;
+ num_sqlda.sqln = 1;
+
+ ALLOC_HASHTABLE(np);
+ zend_hash_init(np, 8, NULL, NULL, 0);
+
+ /* allocate and prepare statement */
+ if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &num_sqlda, &s, np TSRMLS_CC)) {
+ break;
+ }
+
+ /* allocate a statement handle struct of the right size (struct out_sqlda is inlined) */
+ S = ecalloc(1, sizeof(*S)-sizeof(XSQLDA) + XSQLDA_LENGTH(num_sqlda.sqld));
+ S->H = H;
+ S->stmt = s;
+ S->fetch_buf = ecalloc(1,sizeof(char*) * num_sqlda.sqld);
+ S->out_sqlda.version = PDO_FB_SQLDA_VERSION;
+ S->out_sqlda.sqln = stmt->column_count = num_sqlda.sqld;
+ S->named_params = np;
+
+ /* determine the statement type */
+ if (isc_dsql_sql_info(H->isc_status, &s, sizeof(info), const_cast(info), sizeof(result),
+ result)) {
+ break;
+ }
+ S->statement_type = result[3];
+
+ /* fill the output sqlda with information about the prepared query */
+ if (isc_dsql_describe(H->isc_status, &s, PDO_FB_SQLDA_VERSION, &S->out_sqlda)) {
+ RECORD_ERROR(dbh);
+ break;
+ }
+
+ /* allocate the input descriptors */
+ if (isc_dsql_describe_bind(H->isc_status, &s, PDO_FB_SQLDA_VERSION, &num_sqlda)) {
+ break;
+ }
+
+ if (num_sqlda.sqld) {
+ S->in_sqlda = ecalloc(1,XSQLDA_LENGTH(num_sqlda.sqld));
+ S->in_sqlda->version = PDO_FB_SQLDA_VERSION;
+ S->in_sqlda->sqln = num_sqlda.sqld;
+
+ if (isc_dsql_describe_bind(H->isc_status, &s, PDO_FB_SQLDA_VERSION, S->in_sqlda)) {
+ break;
+ }
+ }
+
+ stmt->driver_data = S;
+ stmt->methods = &firebird_stmt_methods;
+ stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL;
+
+ return 1;
+
+ } while (0);
+
+ RECORD_ERROR(dbh);
+
+ zend_hash_destroy(np);
+ FREE_HASHTABLE(np);
+
+ if (S) {
+ if (S->in_sqlda) {
+ efree(S->in_sqlda);
+ }
+ efree(S);
+ }
+
+ return 0;
+}
+/* }}} */
+
+/* called by PDO to execute a statement that doesn't produce a result set */
+static long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+ isc_stmt_handle stmt = NULL;
+ static char const info_count[] = { isc_info_sql_records };
+ char result[64];
+ int ret = 0;
+ XSQLDA in_sqlda, out_sqlda;
+
+ /* TODO no placeholders in exec() for now */
+ in_sqlda.version = out_sqlda.version = PDO_FB_SQLDA_VERSION;
+ in_sqlda.sqld = out_sqlda.sqld = 0;
+
+ /* allocate and prepare statement */
+ if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &out_sqlda, &stmt, 0 TSRMLS_CC)) {
+ return -1;
+ }
+
+ /* execute the statement */
+ if (isc_dsql_execute2(H->isc_status, &H->tr, &stmt, PDO_FB_SQLDA_VERSION, &in_sqlda, &out_sqlda)) {
+ RECORD_ERROR(dbh);
+ return -1;
+ }
+
+ /* find out how many rows were affected */
+ if (isc_dsql_sql_info(H->isc_status, &stmt, sizeof(info_count), const_cast(info_count),
+ sizeof(result), result)) {
+ RECORD_ERROR(dbh);
+ return -1;
+ }
+
+ if (result[0] == isc_info_sql_records) {
+ unsigned i = 3, result_size = isc_vax_integer(&result[1],2);
+
+ while (result[i] != isc_info_end && i < result_size) {
+ short len = (short)isc_vax_integer(&result[i+1],2);
+ if (result[i] != isc_info_req_select_count) {
+ ret += isc_vax_integer(&result[i+3],len);
+ }
+ i += len+3;
+ }
+ }
+
+ /* commit if we're in auto_commit mode */
+ if (dbh->auto_commit && isc_commit_retaining(H->isc_status, &H->tr)) {
+ RECORD_ERROR(dbh);
+ }
+
+ return ret;
+}
+/* }}} */
+
+/* called by the PDO SQL parser to add quotes to values that are copied into SQL */
+static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, /* {{{ */
+ char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+{
+ int qcount = 0;
+ char const *c;
+
+ /* Firebird only requires single quotes to be doubled if string lengths are used */
+
+ /* count the number of ' characters */
+ for (c = unquoted; (c = strchr(c,'\'')); qcount++, c++);
+
+ if (!qcount) {
+ return 0;
+ } else {
+ char const *l, *r;
+ char *c;
+
+ *quotedlen = unquotedlen + qcount;
+ *quoted = c = emalloc(*quotedlen+1);
+
+ /* foreach (chunk that ends in a quote) */
+ for (l = unquoted; (r = strchr(l,'\'')); l = r+1) {
+
+ /* copy the chunk */
+ strncpy(c, l, r-l);
+ c += (r-l);
+
+ /* add the second quote */
+ *c++ = '\'';
+ }
+
+ /* copy the remainder */
+ strncpy(c, l, *quotedlen-(c-*quoted));
+
+ return 1;
+ }
+}
+/* }}} */
+
+/* called by PDO to start a transaction */
+static int firebird_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+ char tpb[8] = { isc_tpb_version3 }, *ptpb = tpb+1;
+#if abies_0
+ if (dbh->transaction_flags & PDO_TRANS_ISOLATION_LEVEL) {
+ if (dbh->transaction_flags & PDO_TRANS_READ_UNCOMMITTED) {
+ /* this is a poor fit, but it's all we have */
+ *ptpb++ = isc_tpb_read_committed;
+ *ptpb++ = isc_tpb_rec_version;
+ dbh->transaction_flags &= ~(PDO_TRANS_ISOLATION_LEVEL^PDO_TRANS_READ_UNCOMMITTED);
+ } else if (dbh->transaction_flags & PDO_TRANS_READ_COMMITTED) {
+ *ptpb++ = isc_tpb_read_committed;
+ *ptpb++ = isc_tpb_no_rec_version;
+ dbh->transaction_flags &= ~(PDO_TRANS_ISOLATION_LEVEL^PDO_TRANS_READ_COMMITTED);
+ } else if (dbh->transaction_flags & PDO_TRANS_REPEATABLE_READ) {
+ *ptpb++ = isc_tpb_concurrency;
+ dbh->transaction_flags &= ~(PDO_TRANS_ISOLATION_LEVEL^PDO_TRANS_REPEATABLE_READ);
+ } else {
+ *ptpb++ = isc_tpb_consistency;
+ dbh->transaction_flags &= ~(PDO_TRANS_ISOLATION_LEVEL^PDO_TRANS_SERIALIZABLE);
+ }
+ }
+
+ if (dbh->transaction_flags & PDO_TRANS_ACCESS_MODE) {
+ if (dbh->transaction_flags & PDO_TRANS_READONLY) {
+ *ptpb++ = isc_tpb_read;
+ dbh->transaction_flags &= ~(PDO_TRANS_ACCESS_MODE^PDO_TRANS_READONLY);
+ } else {
+ *ptpb++ = isc_tpb_write;
+ dbh->transaction_flags &= ~(PDO_TRANS_ACCESS_MODE^PDO_TRANS_READWRITE);
+ }
+ }
+
+ if (dbh->transaction_flags & PDO_TRANS_CONFLICT_RESOLUTION) {
+ if (dbh->transaction_flags & PDO_TRANS_RETRY) {
+ *ptpb++ = isc_tpb_wait;
+ dbh->transaction_flags &= ~(PDO_TRANS_CONFLICT_RESOLUTION^PDO_TRANS_RETRY);
+ } else {
+ *ptpb++ = isc_tpb_nowait;
+ dbh->transaction_flags &= ~(PDO_TRANS_CONFLICT_RESOLUTION^PDO_TRANS_ABORT);
+ }
+ }
+#endif
+ if (isc_start_transaction(H->isc_status, &H->tr, 1, &H->db, (unsigned short)(ptpb-tpb), tpb)) {
+ RECORD_ERROR(dbh);
+ return 0;
+ }
+ return 1;
+}
+/* }}} */
+
+/* called by PDO to commit a transaction */
+static int firebird_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+
+ if (isc_commit_transaction(H->isc_status, &H->tr)) {
+ RECORD_ERROR(dbh);
+ return 0;
+ }
+ return 1;
+}
+/* }}} */
+
+/* called by PDO to rollback a transaction */
+static int firebird_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+
+ if (isc_rollback_transaction(H->isc_status, &H->tr)) {
+ RECORD_ERROR(dbh);
+ return 0;
+ }
+ return 1;
+}
+/* }}} */
+
+/* used by prepare and exec to allocate a statement handle and prepare the SQL */
+static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, long sql_len, /* {{{ */
+ XSQLDA *out_sqlda, isc_stmt_handle *s, HashTable *named_params TSRMLS_DC)
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+ char *c, *new_sql, in_quote, in_param, pname[64], *ppname;
+ long l, pindex = -1;
+
+ /* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */
+ if (sql_len > SHORT_MAX) {
+ strcpy(dbh->error_code, "01004");
+ return 0;
+ }
+
+ /* start a new transaction implicitly if auto_commit is enabled and no transaction is open */
+ if (dbh->auto_commit && !dbh->in_txn) {
+ /* dbh->transaction_flags = PDO_TRANS_READ_UNCOMMITTED; */
+
+ if (!firebird_handle_begin(dbh TSRMLS_CC)) {
+ return 0;
+ }
+ dbh->in_txn = 1;
+ }
+
+ /* allocate the statement */
+ if (isc_dsql_allocate_statement(H->isc_status, &H->db, s)) {
+ RECORD_ERROR(dbh);
+ return 0;
+ }
+
+ /* in order to support named params, which Firebird itself doesn't,
+ we need to replace :foo by ?, and store the name we just replaced */
+ new_sql = c = emalloc(sql_len+1);
+
+ for (l = in_quote = in_param = 0; l <= sql_len; ++l) {
+ if ( !(in_quote ^= (sql[l] == '\''))) {
+ if (!in_param) {
+ switch (sql[l]) {
+ case ':':
+ in_param = 1;
+ ppname = pname;
+ case '?':
+ *c++ = '?';
+ ++pindex;
+ continue;
+ }
+ } else {
+ if ((in_param &= (sql[l] == '_') || (sql[l] >= 'A' && sql[l] <= 'Z')
+ || (sql[l] >= 'a' && sql[l] <= 'z') || (sql[l] >= '0' && sql[l] <= '9'))) {
+ *ppname++ = sql[l];
+ continue;
+ } else {
+ *ppname++ = 0;
+ if (named_params) {
+ zend_hash_update(named_params, pname, (unsigned int)(ppname-pname),
+ (void*)&pindex, sizeof(long)+1,NULL);
+ }
+ }
+ }
+ }
+ *c++ = sql[l];
+ }
+
+ /* prepare the statement */
+ if (isc_dsql_prepare(H->isc_status, &H->tr, s, 0, new_sql, PDO_FB_DIALECT, out_sqlda)) {
+ RECORD_ERROR(dbh);
+ efree(new_sql);
+ return 0;
+ }
+
+ efree(new_sql);
+ return 1;
+}
+/* }}} */
+
+/* called by PDO to set a driver-specific dbh attribute */
+static int firebird_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+
+ switch (attr) {
+ case PDO_ATTR_AUTOCOMMIT:
+
+ convert_to_boolean(val);
+
+ /* ignore if the new value equals the old one */
+ if (dbh->auto_commit ^ Z_BVAL_P(val)) {
+ if (dbh->in_txn) {
+ if (Z_BVAL_P(val)) {
+ /* turning on auto_commit with an open transaction is illegal, because
+ we won't know what to do with it */
+ H->last_app_error = "Cannot enable auto-commit while a transaction is already open";
+ return 0;
+ } else {
+ /* close the transaction */
+ if (!firebird_handle_commit(dbh TSRMLS_CC)) {
+ break;
+ }
+ dbh->in_txn = 0;
+ }
+ }
+ dbh->auto_commit = Z_BVAL_P(val);
+ }
+ return 1;
+ }
+ return 0;
+}
+/* }}} */
+
+/* callback to used to report database server info */
+static void firebird_info_cb(void *arg, char const *s) /* {{{ */
+{
+ if (arg) {
+ if (*(char*)arg) { /* second call */
+ strcat(arg, " ");
+ }
+ strcat(arg, s);
+ }
+}
+/* }}} */
+
+/* called by PDO to get a driver-specific dbh attribute */
+static int firebird_handle_get_attribute(pdo_dbh_t const *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+
+ switch (attr) {
+ char tmp[200];
+
+ case PDO_ATTR_AUTOCOMMIT:
+ ZVAL_LONG(val,dbh->auto_commit);
+ return 1;
+
+ case PDO_ATTR_CONNECTION_STATUS:
+ ZVAL_BOOL(val, !isc_version(&H->db, firebird_info_cb, NULL));
+ return 1;
+
+ case PDO_ATTR_CLIENT_VERSION: {
+#if defined(__GNUC__) || defined(PHP_WIN32)
+ info_func_t info_func = NULL;
+#ifdef __GNUC__
+ info_func = (info_func_t)dlsym(RTLD_DEFAULT, "isc_get_client_version");
+#else
+ HMODULE l = GetModuleHandle("fbclient");
+
+ if (!l && !(l = GetModuleHandle("gds32"))) {
+ break;
+ }
+ info_func = (info_func_t)GetProcAddress(l, "isc_get_client_version");
+#endif
+ if (info_func) {
+ info_func(tmp);
+ ZVAL_STRING(val,tmp,1);
+ } else {
+ ZVAL_STRING(val,"Firebird 1.0/Interbase 6",1);
+ }
+#else
+ ZVAL_NULL(val);
+#endif
+ }
+ return 1;
+
+ case PDO_ATTR_SERVER_VERSION:
+ case PDO_ATTR_SERVER_INFO:
+ *tmp = 0;
+
+ if (!isc_version(&H->db, firebird_info_cb, (void*)tmp)) {
+ ZVAL_STRING(val,tmp,1);
+ return 1;
+ }
+ }
+ return 0;
+}
+/* }}} */
+
+/* called by PDO to retrieve driver-specific information about an error that has occurred */
+static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
+ ISC_STATUS *s = H->isc_status;
+ char buf[400];
+ long i = 0, l, sqlcode = isc_sqlcode(s);
+
+ if (sqlcode) {
+ add_next_index_long(info, sqlcode);
+
+ while ((l = isc_interprete(&buf[i],&s))) {
+ i += l;
+ strcpy(&buf[i++], " ");
+ }
+ add_next_index_string(info, buf, 1);
+ } else {
+ add_next_index_long(info, -999);
+ add_next_index_string(info, const_cast(H->last_app_error),1);
+ }
+ return 1;
+}
+/* }}} */
+
+static struct pdo_dbh_methods firebird_methods = { /* {{{ */
+ firebird_handle_closer,
+ firebird_handle_preparer,
+ firebird_handle_doer,
+ firebird_handle_quoter,
+ firebird_handle_begin,
+ firebird_handle_commit,
+ firebird_handle_rollback,
+ firebird_handle_set_attribute,
+ NULL, /* last_id not supported */
+ pdo_firebird_fetch_error_func,
+ firebird_handle_get_attribute,
+ NULL /* check_liveness */
+};
+/* }}} */
+
+/* the driver-specific PDO handle constructor */
+static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+{
+ struct pdo_data_src_parser vars[] = {
+ { "dbname", NULL, 0 },
+ { "charset", NULL, 0 },
+ { "role", NULL, 0 }
+ };
+ int i, ret = 0;
+ pdo_firebird_db_handle *H = dbh->driver_data = pecalloc(1,sizeof(*H),dbh->is_persistent);
+
+ php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 3);
+
+ do {
+ static char const dpb_flags[] = {
+ isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype, isc_dpb_sql_role_name };
+ char const *dpb_values[] = { dbh->username, dbh->password, vars[1].optval, vars[2].optval };
+ char dpb_buffer[256] = { isc_dpb_version1 }, *dpb;
+
+ dpb = dpb_buffer + 1;
+
+ /* loop through all the provided arguments and set dpb fields accordingly */
+ for (i = 0; i < sizeof(dpb_flags); ++i) {
+ if (dpb_values[i]) {
+ dpb += sprintf(dpb, "%c%c%s", dpb_flags[i], (unsigned char)strlen(dpb_values[i]),
+ dpb_values[i]);
+ }
+ }
+
+ /* fire it up baby! */
+ if (isc_attach_database(H->isc_status, 0, vars[0].optval, &H->db,(short)(dpb-dpb_buffer),
+ dpb_buffer)) {
+ break;
+ }
+
+ dbh->methods = &firebird_methods;
+ dbh->native_case = PDO_CASE_UPPER;
+ dbh->alloc_own_columns = 1;
+
+ ret = 1;
+
+ } while (0);
+
+ for (i = 0; i < sizeof(vars)/sizeof(vars[0]); ++i) {
+ if (vars[i].freeme) {
+ efree(vars[i].optval);
+ }
+ }
+
+ if (!ret) {
+ firebird_handle_closer(dbh TSRMLS_CC);
+ }
+
+ return ret;
+}
+/* }}} */
+
+pdo_driver_t pdo_firebird_driver = { /* {{{ */
+ PDO_DRIVER_HEADER(firebird),
+ pdo_firebird_handle_factory
+};
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
new file mode 100644
index 000000000..95415e805
--- /dev/null
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -0,0 +1,702 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Ard Biesheuvel <abies@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: firebird_statement.c,v 1.18 2005/08/03 14:07:39 sniper Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_firebird.h"
+#include "php_pdo_firebird_int.h"
+
+#include <time.h>
+
+#define RECORD_ERROR(stmt) _firebird_error(NULL, stmt, __FILE__, __LINE__ TSRMLS_CC)
+
+/* free the allocated space for passing field values to the db and back */
+static void free_sqlda(XSQLDA const *sqlda) /* {{{ */
+{
+ int i;
+
+ for (i = 0; i < sqlda->sqld; ++i) {
+ XSQLVAR const *var = &sqlda->sqlvar[i];
+
+ if (var->sqlind) {
+ efree(var->sqlind);
+ }
+ }
+}
+/* }}} */
+
+/* called by PDO to clean up a statement handle */
+static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+ int result = 1, i;
+
+ /* release the statement */
+ if (isc_dsql_free_statement(S->H->isc_status, &S->stmt, DSQL_drop)) {
+ RECORD_ERROR(stmt);
+ result = 0;
+ }
+
+ /* clean up the fetch buffers if they have been used */
+ for (i = 0; i < S->out_sqlda.sqld; ++i) {
+ if (S->fetch_buf[i]) {
+ efree(S->fetch_buf[i]);
+ }
+ }
+ efree(S->fetch_buf);
+
+ zend_hash_destroy(S->named_params);
+ FREE_HASHTABLE(S->named_params);
+
+ /* clean up the input descriptor */
+ if (S->in_sqlda) {
+ free_sqlda(S->in_sqlda);
+ efree(S->in_sqlda);
+ }
+
+ free_sqlda(&S->out_sqlda);
+ efree(S);
+
+ return result;
+}
+/* }}} */
+
+/* called by PDO to execute a prepared query */
+static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+ pdo_firebird_db_handle *H = S->H;
+
+ do {
+ /* named cursors should be closed first */
+ if (*S->name && isc_dsql_free_statement(H->isc_status, &S->stmt, DSQL_close)) {
+ break;
+ }
+
+ /* assume all params have been bound */
+
+ if ((S->statement_type == isc_info_sql_stmt_exec_procedure &&
+ isc_dsql_execute2(H->isc_status, &H->tr, &S->stmt, PDO_FB_SQLDA_VERSION,
+ S->in_sqlda, &S->out_sqlda))
+ || isc_dsql_execute(H->isc_status, &H->tr, &S->stmt, PDO_FB_SQLDA_VERSION,
+ S->in_sqlda)) {
+ break;
+ }
+
+ /* commit? */
+ if (stmt->dbh->auto_commit && isc_commit_retaining(H->isc_status, &H->tr)) {
+ break;
+ }
+
+ *S->name = 0;
+ S->exhausted = 0;
+
+ return 1;
+ } while (0);
+
+ RECORD_ERROR(stmt);
+
+ return 0;
+}
+/* }}} */
+
+/* called by PDO to fetch the next row from a statement */
+static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */
+ enum pdo_fetch_orientation ori, long offset TSRMLS_DC)
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+ pdo_firebird_db_handle *H = S->H;
+
+ if (!stmt->executed) {
+ strcpy(stmt->error_code, "HY000");
+ H->last_app_error = "Cannot fetch from a closed cursor";
+ } else if (!S->exhausted) {
+
+ /* an EXECUTE PROCEDURE statement can be fetched from once, without calling the API, because
+ * the result was returned in the execute call */
+ if (S->statement_type == isc_info_sql_stmt_exec_procedure) {
+ S->exhausted = 1;
+ } else {
+ if (isc_dsql_fetch(H->isc_status, &S->stmt, PDO_FB_SQLDA_VERSION, &S->out_sqlda)) {
+ if (H->isc_status[0] && H->isc_status[1]) {
+ RECORD_ERROR(stmt);
+ }
+ S->exhausted = 1;
+ return 0;
+ }
+ }
+ return 1;
+ }
+ return 0;
+}
+/* }}} */
+
+/* called by PDO to retrieve information about the fields being returned */
+static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+ struct pdo_column_data *col = &stmt->columns[colno];
+ XSQLVAR *var = &S->out_sqlda.sqlvar[colno];
+
+ /* allocate storage for the column */
+ var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short));
+ var->sqldata = &((char*)var->sqlind)[sizeof(short)];
+
+ col->precision = -var->sqlscale;
+ col->maxlen = var->sqllen;
+ col->namelen = var->aliasname_length;
+ col->name = estrndup(var->aliasname,var->aliasname_length);
+
+ return 1;
+}
+/* }}} */
+
+#if abies_0
+/* internal function to override return types of parameters */
+static void set_param_type(enum pdo_param_type *param_type, XSQLVAR const *var) /* {{{ */
+{
+ /* set the param type after the field type */
+ switch (var->sqltype & ~1) {
+ case SQL_INT64:
+#if SIZEOF_LONG < 8
+ if (0) /* always a string if its size exceeds native long */
+#endif
+ case SQL_SHORT:
+ case SQL_LONG:
+ if (var->sqlscale == 0) {
+ *param_type = PDO_PARAM_INT;
+ break;
+ }
+ case SQL_TEXT:
+ case SQL_VARYING:
+ case SQL_TYPE_DATE:
+ case SQL_TYPE_TIME:
+ case SQL_TIMESTAMP:
+ case SQL_BLOB:
+ *param_type = PDO_PARAM_STR;
+ break;
+ case SQL_FLOAT:
+ case SQL_DOUBLE:
+ *param_type = PDO_PARAM_DBL;
+ break;
+ }
+}
+/* }}} */
+#endif
+
+#define FETCH_BUF(buf,type,len,lenvar) ((buf) = (buf) ? (buf) : \
+ emalloc((len) ? (len * sizeof(type)) : ((*(unsigned long*)lenvar) = sizeof(type))))
+
+/* fetch a blob into a fetch buffer */
+static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */
+ unsigned long *len, ISC_QUAD *blob_id TSRMLS_DC)
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+ pdo_firebird_db_handle *H = S->H;
+ isc_blob_handle blobh = NULL;
+ char const bl_item = isc_info_blob_total_length;
+ char bl_info[20];
+ unsigned short i;
+ int result = *len = 0;
+
+ if (isc_open_blob(H->isc_status, &H->db, &H->tr, &blobh, blob_id)) {
+ RECORD_ERROR(stmt);
+ return 0;
+ }
+
+ if (isc_blob_info(H->isc_status, &blobh, 1, const_cast(&bl_item),
+ sizeof(bl_info), bl_info)) {
+ RECORD_ERROR(stmt);
+ goto fetch_blob_end;
+ }
+
+ /* find total length of blob's data */
+ for (i = 0; i < sizeof(bl_info); ) {
+ unsigned short item_len;
+ char item = bl_info[i++];
+
+ if (item == isc_info_end || item == isc_info_truncated || item == isc_info_error
+ || i >= sizeof(bl_info)) {
+ H->last_app_error = "Couldn't determine BLOB size";
+ goto fetch_blob_end;
+ }
+
+ item_len = (unsigned short) isc_vax_integer(&bl_info[i], 2);
+
+ if (item == isc_info_blob_total_length) {
+ *len = isc_vax_integer(&bl_info[i+2], item_len);
+ break;
+ }
+ i += item_len+2;
+ }
+
+ /* we've found the blob's length, now fetch! */
+
+ if (*len) {
+ unsigned long cur_len;
+ unsigned short seg_len;
+ ISC_STATUS stat;
+
+ *ptr = S->fetch_buf[colno] = erealloc(*ptr, *len+1);
+
+ for (cur_len = stat = 0; (!stat || stat == isc_segment) && cur_len < *len; cur_len += seg_len) {
+
+ unsigned short chunk_size = (*len-cur_len) > USHRT_MAX ? USHRT_MAX
+ : (unsigned short)(*len-cur_len);
+
+ stat = isc_get_segment(H->isc_status, &blobh, &seg_len, chunk_size, &(*ptr)[cur_len]);
+ }
+
+ (*ptr)[*len++] = '\0';
+
+ if (H->isc_status[0] == 1 && (stat != 0 && stat != isc_segstr_eof && stat != isc_segment)) {
+ H->last_app_error = "Error reading from BLOB";
+ goto fetch_blob_end;
+ }
+ }
+ result = 1;
+
+fetch_blob_end:
+ if (isc_close_blob(H->isc_status, &blobh)) {
+ RECORD_ERROR(stmt);
+ return 0;
+ }
+ return result;
+}
+/* }}} */
+
+static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */
+ unsigned long *len, int *caller_frees TSRMLS_DC)
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+ XSQLVAR const *var = &S->out_sqlda.sqlvar[colno];
+
+ if (*var->sqlind == -1) {
+ /* A NULL value */
+ *ptr = NULL;
+ *len = 0;
+ } else {
+ /* override the column param type */
+ /* set_param_type(&stmt->columns[colno].param_type,var); */
+ stmt->columns[colno].param_type = PDO_PARAM_STR;
+
+ if (var->sqlscale < 0) {
+ static ISC_INT64 const scales[] = { 1, 10, 100, 1000, 10000, 100000, 1000000,
+ 100000000, 1000000000, 1000000000, LL_LIT(10000000000),LL_LIT(100000000000),
+ LL_LIT(10000000000000), LL_LIT(100000000000000),LL_LIT(1000000000000000),
+ LL_LIT(1000000000000000),LL_LIT(1000000000000000000) };
+ ISC_INT64 n, f = scales[-var->sqlscale];
+
+ switch (var->sqltype & ~1) {
+ case SQL_SHORT:
+ n = *(short*)var->sqldata;
+ break;
+ case SQL_LONG:
+ n = *(ISC_LONG*)var->sqldata;
+ break;
+ case SQL_INT64:
+ n = *(ISC_INT64*)var->sqldata;
+ }
+
+ *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL);
+
+ if (n >= 0) {
+ *len = sprintf(*ptr, "%" LL_MASK "d.%0*" LL_MASK "d",
+ n / f, -var->sqlscale, n % f);
+ } else if (n < -f) {
+ *len = sprintf(*ptr, "%" LL_MASK "d.%0*" LL_MASK "d",
+ n / f, -var->sqlscale, -n % f);
+ } else {
+ *len = sprintf(*ptr, "-0.%0*" LL_MASK "d", -var->sqlscale, -n % f);
+ }
+ } else {
+ switch (var->sqltype & ~1) {
+ struct tm t;
+ char *fmt;
+
+/**
+* For the time being, this code has been changed to convert every returned value to a string
+* before passing it back up to the PDO driver.
+*/
+
+ case SQL_VARYING:
+ *ptr = &var->sqldata[2];
+ *len = *(short*)var->sqldata;
+ break;
+ case SQL_TEXT:
+ *ptr = var->sqldata;
+ *len = var->sqllen;
+ break;
+/* --- cut here --- */
+ case SQL_SHORT:
+ *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL);
+ *len = sprintf(*ptr, "%d", *(short*)var->sqldata);
+ break;
+ case SQL_LONG:
+ *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL);
+ *len = sprintf(*ptr, "%ld", *(ISC_LONG*)var->sqldata);
+ break;
+ case SQL_INT64:
+ *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL);
+ *len = sprintf(*ptr, "%" LL_MASK "d", *(ISC_INT64*)var->sqldata);
+ break;
+ case SQL_FLOAT:
+ *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL);
+ *len = sprintf(*ptr, "%f", *(float*)var->sqldata);
+ break;
+ case SQL_DOUBLE:
+ *ptr = FETCH_BUF(S->fetch_buf[colno], char, 24, NULL);
+ *len = sprintf(*ptr, "%f" , *(double*)var->sqldata);
+ break;
+/* --- cut here --- */
+#if abies_0
+ case SQL_SHORT:
+ *ptr = FETCH_BUF(S->fetch_buf[colno], long, 0, *len);
+ *(long*)*ptr = *(short*)var->sqldata;
+ break;
+ case SQL_LONG:
+#if SIZEOF_LONG == 8
+ *ptr = FETCH_BUF(S->fetch_buf[colno], long, 0, *len);
+ *(long*)*ptr = *(ISC_LONG*)var->sqldata;
+#else
+ *ptr = var->sqldata;
+#endif
+ break;
+ case SQL_INT64:
+ *len = sizeof(long);
+#if SIZEOF_LONG == 8
+ *ptr = var->sqldata;
+#else
+ *ptr = FETCH_BUF(S->fetch_buf[colno], char, 20, NULL);
+ *len = sprintf(*ptr, "%" LL_MASK "d", *(ISC_INT64*)var->sqldata);
+#endif
+ break;
+ case SQL_FLOAT:
+ *ptr = FETCH_BUF(S->fetch_buf[colno], double, 0, *len);
+ *(double*)*ptr = *(float*)var->sqldata;
+ break;
+ case SQL_DOUBLE:
+ *ptr = var->sqldata;
+ *len = sizeof(double);
+ break;
+#endif
+ case SQL_TYPE_DATE:
+ isc_decode_sql_date((ISC_DATE*)var->sqldata, &t);
+ fmt = INI_STR("ibase.dateformat");
+ if (0) {
+ case SQL_TYPE_TIME:
+ isc_decode_sql_time((ISC_TIME*)var->sqldata, &t);
+ fmt = INI_STR("ibase.timeformat");
+ } else if (0) {
+ case SQL_TIMESTAMP:
+ isc_decode_timestamp((ISC_TIMESTAMP*)var->sqldata, &t);
+ fmt = INI_STR("ibase.timestampformat");
+ }
+
+ /* convert the timestamp into a string */
+ *ptr = FETCH_BUF(S->fetch_buf[colno], char, *len = 80, NULL);
+ *len = strftime(*ptr, *len, fmt, &t);
+ break;
+ case SQL_BLOB:
+ return firebird_fetch_blob(stmt,colno,ptr,len,
+ (ISC_QUAD*)var->sqldata TSRMLS_CC);
+ }
+ }
+ }
+ return 1;
+}
+/* }}} */
+
+static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param TSRMLS_DC)
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+ pdo_firebird_db_handle *H = S->H;
+ isc_blob_handle h = NULL;
+ unsigned long put_cnt = 0, rem_cnt;
+ unsigned short chunk_size;
+ int result = 1;
+
+ if (isc_create_blob(H->isc_status, &H->db, &H->tr, &h, blob_id)) {
+ RECORD_ERROR(stmt);
+ return 0;
+ }
+
+ SEPARATE_ZVAL(&param);
+
+ convert_to_string_ex(&param);
+
+ for (rem_cnt = Z_STRLEN_P(param); rem_cnt > 0; rem_cnt -= chunk_size) {
+
+ chunk_size = rem_cnt > USHRT_MAX ? USHRT_MAX : (unsigned short)rem_cnt;
+
+ if (isc_put_segment(H->isc_status, &h, chunk_size, &Z_STRVAL_P(param)[put_cnt])) {
+ RECORD_ERROR(stmt);
+ result = 0;
+ break;
+ }
+ put_cnt += chunk_size;
+ }
+
+ zval_dtor(param);
+
+ if (isc_close_blob(H->isc_status, &h)) {
+ RECORD_ERROR(stmt);
+ return 0;
+ }
+ return result;
+}
+
+static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, /* {{{ */
+ enum pdo_param_event event_type TSRMLS_DC)
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+ XSQLDA *sqlda = param->is_param ? S->in_sqlda : &S->out_sqlda;
+ XSQLVAR *var;
+
+ if (event_type == PDO_PARAM_EVT_FREE) { /* not used */
+ return 1;
+ }
+
+ if (!sqlda || param->paramno >= sqlda->sqld) {
+ strcpy(stmt->error_code, "HY093");
+ S->H->last_app_error = "Invalid parameter index";
+ return 0;
+ }
+ if (param->is_param && param->paramno == -1) {
+ long *index;
+
+ /* try to determine the index by looking in the named_params hash */
+ if (SUCCESS == zend_hash_find(S->named_params, param->name, param->namelen+1, (void*)&index)) {
+ param->paramno = *index;
+ } else {
+ /* ... or by looking in the input descriptor */
+ int i;
+
+ for (i = 0; i < sqlda->sqld; ++i) {
+ XSQLVAR *var = &sqlda->sqlvar[i];
+
+ if ((var->aliasname_length && !strncasecmp(param->name, var->aliasname,
+ min(param->namelen, var->aliasname_length)))
+ || (var->sqlname_length && !strncasecmp(param->name, var->sqlname,
+ min(param->namelen, var->sqlname_length)))) {
+ param->paramno = i;
+ break;
+ }
+ }
+ if (i >= sqlda->sqld) {
+ strcpy(stmt->error_code, "HY093");
+ S->H->last_app_error = "Invalid parameter name";
+ return 0;
+ }
+ }
+ }
+
+ var = &sqlda->sqlvar[param->paramno];
+
+ switch (event_type) {
+ char *value;
+ unsigned long value_len;
+ int caller_frees;
+
+ case PDO_PARAM_EVT_ALLOC:
+ if (param->is_param) {
+ /* allocate the parameter */
+ var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short));
+ var->sqldata = &((char*)var->sqlind)[sizeof(short)];
+ }
+ break;
+
+ case PDO_PARAM_EVT_EXEC_PRE:
+ if (!param->is_param) {
+ break;
+ }
+
+ *var->sqlind = 0;
+
+ switch (var->sqltype & ~1) {
+ case SQL_ARRAY:
+ strcpy(stmt->error_code, "HY000");
+ S->H->last_app_error = "Cannot bind to array field";
+ return 0;
+
+ case SQL_BLOB:
+ return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata,
+ param->parameter TSRMLS_CC);
+ }
+
+ /* check if a NULL should be inserted */
+ switch (Z_TYPE_P(param->parameter)) {
+ int force_null;
+
+ case IS_LONG:
+ var->sqltype = sizeof(long) == 8 ? SQL_INT64 : SQL_LONG;
+ var->sqldata = (void*)&Z_LVAL_P(param->parameter);
+ var->sqllen = sizeof(long);
+ break;
+ case IS_DOUBLE:
+ var->sqltype = SQL_DOUBLE;
+ var->sqldata = (void*)&Z_DVAL_P(param->parameter);
+ var->sqllen = sizeof(double);
+ break;
+ case IS_STRING:
+ force_null = 0;
+
+ /* for these types, an empty string can be handled like a NULL value */
+ switch (var->sqltype & ~1) {
+ case SQL_SHORT:
+ case SQL_LONG:
+ case SQL_INT64:
+ case SQL_FLOAT:
+ case SQL_DOUBLE:
+ case SQL_TIMESTAMP:
+ case SQL_TYPE_DATE:
+ case SQL_TYPE_TIME:
+ force_null = (Z_STRLEN_P(param->parameter) == 0);
+ }
+ if (!force_null) {
+ var->sqltype = SQL_TEXT;
+ var->sqldata = Z_STRVAL_P(param->parameter);
+ var->sqllen = Z_STRLEN_P(param->parameter);
+ break;
+ }
+ case IS_NULL:
+ /* complain if this field doesn't allow NULL values */
+ if (~var->sqltype & 1) {
+ strcpy(stmt->error_code, "HY105");
+ S->H->last_app_error = "Parameter requires non-null value";
+ return 0;
+ }
+ *var->sqlind = -1;
+ break;
+ default:
+ strcpy(stmt->error_code, "HY105");
+ S->H->last_app_error = "Binding arrays/objects is not supported";
+ return 0;
+ }
+ break;
+
+ case PDO_PARAM_EVT_FETCH_POST:
+ value = NULL;
+ value_len = 0;
+ caller_frees = 0;
+
+ if (firebird_stmt_get_col(stmt, param->paramno, &value, &value_len, &caller_frees TSRMLS_CC)) {
+ switch (PDO_PARAM_TYPE(param->param_type)) {
+ case PDO_PARAM_STR:
+ if (value) {
+ ZVAL_STRINGL(param->parameter, value, value_len, 1);
+ break;
+ }
+ case PDO_PARAM_INT:
+ if (value) {
+ ZVAL_LONG(param->parameter, *(long*)value);
+ break;
+ }
+#if abies_0
+ case PDO_PARAM_DBL:
+ if (value) {
+ ZVAL_DOUBLE(param->parameter, *(double*)value);
+ break;
+ }
+#endif
+ default:
+ ZVAL_NULL(param->parameter);
+ }
+ if (value && caller_frees) {
+ efree(value);
+ }
+ return 1;
+ }
+ return 0;
+ default:
+ ;
+ }
+ return 1;
+}
+/* }}} */
+
+static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+
+ switch (attr) {
+ default:
+ return 0;
+ case PDO_ATTR_CURSOR_NAME:
+ convert_to_string(val);
+
+ if (isc_dsql_set_cursor_name(S->H->isc_status, &S->stmt, Z_STRVAL_P(val),0)) {
+ RECORD_ERROR(stmt);
+ return 0;
+ }
+ strncpy(S->name, Z_STRVAL_P(val), sizeof(S->name));
+ S->name[sizeof(S->name)] = 0;
+ break;
+ }
+ return 1;
+}
+/* }}} */
+
+static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+
+ switch (attr) {
+ default:
+ return 0;
+ case PDO_ATTR_CURSOR_NAME:
+ if (*S->name) {
+ ZVAL_STRING(val,S->name,1);
+ } else {
+ ZVAL_NULL(val);
+ }
+ break;
+ }
+ return 1;
+}
+/* }}} */
+
+struct pdo_stmt_methods firebird_stmt_methods = { /* {{{ */
+ firebird_stmt_dtor,
+ firebird_stmt_execute,
+ firebird_stmt_fetch,
+ firebird_stmt_describe,
+ firebird_stmt_get_col,
+ firebird_stmt_param_hook,
+ firebird_stmt_set_attribute,
+ firebird_stmt_get_attribute
+};
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_firebird/package.xml b/ext/pdo_firebird/package.xml
new file mode 100644
index 000000000..b07870189
--- /dev/null
+++ b/ext/pdo_firebird/package.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE package SYSTEM "../pear/package.dtd">
+<package version="1.0"><!-- $Id: package.xml,v 1.7.2.1 2005/09/11 05:27:29 wez Exp $ -->
+ <name>PDO_FIREBIRD</name>
+ <summary>Firebird/InterBase 6 driver for PDO</summary>
+ <maintainers>
+ <maintainer>
+ <user>abies</user>
+ <name>Ard Biesheuvel</name>
+ <email>abies@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ </maintainers>
+ <configureoptions>
+ <configureoption name="with-pdo-firebird" prompt="dir"/>
+</configureoptions>
+ <description>
+ This extension provides a Firebird/InterBase driver for PDO. It supports
+ all versions of Firebird and InterBase versions 6 and up.
+ </description>
+ <license>PHP</license>
+ <release>
+ <state>beta</state>
+ <version>0.3</version>
+ <date>2005-09-11</date>
+
+ <notes>
+ To compile and run this module, you will need to have the main PDO module and Firebird's
+ or InterBase's client library installed on your system.
+
+ Hope it works!
+ </notes>
+
+ <filelist>
+ <file role="doc" name="CREDITS"/>
+
+ <file role="src" name="config.m4"/>
+ <file role="src" name="config.w32"/>
+ <file role="src" name="firebird_driver.c"/>
+ <file role="src" name="firebird_statement.c"/>
+ <file role="src" name="pdo_firebird.c"/>
+ <file role="src" name="php_pdo_firebird.h"/>
+ <file role="src" name="php_pdo_firebird_int.h"/>
+
+ <dir name="tests">
+ <file role="test">connect.phpt</file>
+ <file role="test">ddl.phpt</file>
+ <file role="test">execute.phpt</file>
+ </dir>
+
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="5.0.3"/>
+ <dep type="ext" rel="ge" name="pdo" version="1.0RC1"/>
+ </deps>
+ </release>
+</package>
diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c
new file mode 100644
index 000000000..956f836c1
--- /dev/null
+++ b/ext/pdo_firebird/pdo_firebird.c
@@ -0,0 +1,87 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Ard Biesheuvel <abies@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_firebird.c,v 1.4.2.1 2005/09/11 05:27:30 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_firebird.h"
+#include "php_pdo_firebird_int.h"
+
+function_entry pdo_firebird_functions[] = { /* {{{ */
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+zend_module_entry pdo_firebird_module_entry = { /* {{{ */
+ STANDARD_MODULE_HEADER,
+ "PDO_Firebird",
+ pdo_firebird_functions,
+ PHP_MINIT(pdo_firebird),
+ PHP_MSHUTDOWN(pdo_firebird),
+ NULL,
+ NULL,
+ PHP_MINFO(pdo_firebird),
+ "0.3",
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_PDO_FIREBIRD
+ZEND_GET_MODULE(pdo_firebird)
+#endif
+
+PHP_MINIT_FUNCTION(pdo_firebird) /* {{{ */
+{
+ php_pdo_register_driver(&pdo_firebird_driver);
+
+ return SUCCESS;
+}
+/* }}} */
+
+PHP_MSHUTDOWN_FUNCTION(pdo_firebird) /* {{{ */
+{
+ php_pdo_unregister_driver(&pdo_firebird_driver);
+
+ return SUCCESS;
+}
+/* }}} */
+
+PHP_MINFO_FUNCTION(pdo_firebird) /* {{{ */
+{
+ php_info_print_table_start();
+ php_info_print_table_header(2, "PDO Driver for Firebird/InterBase", "enabled");
+ php_info_print_table_end();
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_firebird/php_pdo_firebird.h b/ext/pdo_firebird/php_pdo_firebird.h
new file mode 100644
index 000000000..5af158dfc
--- /dev/null
+++ b/ext/pdo_firebird/php_pdo_firebird.h
@@ -0,0 +1,58 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Ard Biesheuvel <abies@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_firebird.h,v 1.3 2005/08/03 14:07:39 sniper Exp $ */
+
+#ifndef PHP_PDO_FIREBIRD_H
+#define PHP_PDO_FIREBIRD_H
+
+extern zend_module_entry pdo_firebird_module_entry;
+#define phpext_pdo_firebird_ptr &pdo_firebird_module_entry
+
+#ifdef PHP_WIN32
+# ifdef PDO_FIREBIRD_EXPORTS
+# define PDO_FB_API __declspec(dllexport)
+# elif defined(COMPILE_DL_PDO_FIREBIRD)
+# define PDO_FB_API __declspec(dllimport)
+# else
+# define PDO_FB_API
+# endif
+#else
+# define PDO_FB_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(pdo_firebird);
+PHP_MSHUTDOWN_FUNCTION(pdo_firebird);
+PHP_RINIT_FUNCTION(pdo_firebird);
+PHP_RSHUTDOWN_FUNCTION(pdo_firebird);
+PHP_MINFO_FUNCTION(pdo_firebird);
+
+#endif /* PHP_PDO_FIREBIRD_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h
new file mode 100644
index 000000000..62f68a313
--- /dev/null
+++ b/ext/pdo_firebird/php_pdo_firebird_int.h
@@ -0,0 +1,127 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Ard Biesheuvel <abies@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_firebird_int.h,v 1.10 2005/08/03 14:07:39 sniper Exp $ */
+
+#ifndef PHP_PDO_FIREBIRD_INT_H
+#define PHP_PDO_FIREBIRD_INT_H
+
+#include <ibase.h>
+
+#ifdef SQLDA_VERSION
+#define PDO_FB_SQLDA_VERSION SQLDA_VERSION
+#else
+#define PDO_FB_SQLDA_VERSION 1
+#endif
+
+#define PDO_FB_DIALECT 3
+
+#define SHORT_MAX (1 << (8*sizeof(short)-1))
+
+#if SIZEOF_LONG == 8
+# define LL_MASK "l"
+# define LL_LIT(lit) lit ## L
+#else
+# ifdef PHP_WIN32
+# define LL_MASK "I64"
+# define LL_LIT(lit) lit ## I64
+# else
+# define LL_MASK "ll"
+# define LL_LIT(lit) lit ## LL
+# endif
+#endif
+
+/* Firebird API has a couple of missing const decls in its API */
+#define const_cast(s) ((char*)(s))
+
+#ifdef PHP_WIN32
+typedef void (__stdcall *info_func_t)(char*);
+#else
+typedef void (*info_func_t)(char*);
+#endif
+
+#ifndef min
+#define min(a,b) ((a)<(b)?(a):(b))
+#endif
+
+typedef struct {
+
+ /* the result of the last API call */
+ ISC_STATUS isc_status[20];
+
+ /* the connection handle */
+ isc_db_handle db;
+
+ /* the transaction handle */
+ isc_tr_handle tr;
+
+ /* the last error that didn't come from the API */
+ char const *last_app_error;
+
+} pdo_firebird_db_handle;
+
+
+typedef struct {
+
+ /* the link that owns this statement */
+ pdo_firebird_db_handle *H;
+
+ /* the statement handle */
+ isc_stmt_handle stmt;
+
+ /* the name of the cursor (if it has one) */
+ char name[32];
+
+ /* the type of statement that was issued */
+ char statement_type:8;
+
+ /* whether EOF was reached for this statement */
+ unsigned exhausted:1;
+
+ unsigned _reserved:23;
+
+ /* the named params that were converted to ?'s by the driver */
+ HashTable *named_params;
+
+ /* allocated space to convert fields values to other types */
+ char **fetch_buf;
+
+ /* the input SQLDA */
+ XSQLDA *in_sqlda;
+
+ /* the output SQLDA */
+ XSQLDA out_sqlda; /* last member */
+
+} pdo_firebird_stmt;
+
+extern pdo_driver_t pdo_firebird_driver;
+
+extern struct pdo_stmt_methods firebird_stmt_methods;
+
+void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, long line TSRMLS_DC);
+
+#endif /* PHP_PDO_FIREBIRD_INT_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_firebird/tests/common.phpt b/ext/pdo_firebird/tests/common.phpt
new file mode 100644
index 000000000..cb1caf315
--- /dev/null
+++ b/ext/pdo_firebird/tests/common.phpt
@@ -0,0 +1,27 @@
+--TEST--
+FIREBIRD
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_odbc')) print 'skip'; ?>
+--REDIRECTTEST--
+# magic auto-configuration
+
+$config = array(
+ 'TESTS' => 'ext/pdo/tests'
+);
+
+
+if (false !== getenv('PDO_FIREBIRD_TEST_DSN')) {
+ # user set them from their shell
+ $config['ENV']['PDOTEST_DSN'] = getenv('PDO_FIREBIRD_TEST_DSN');
+ $config['ENV']['PDOTEST_USER'] = getenv('PDO_FIREBIRD_TEST_USER');
+ $config['ENV']['PDOTEST_PASS'] = getenv('PDO_FIREBIRD_TEST_PASS');
+ if (false !== getenv('PDO_FIREBIRD_TEST_ATTR')) {
+ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_FIREBIRD_TEST_ATTR');
+ }
+} else {
+ $config['ENV']['PDOTEST_DSN'] = 'firebird:dbname=/opt/firebird/test.gdb';
+ $config['ENV']['PDOTEST_USER'] = 'SYSDBA';
+ $config['ENV']['PDOTEST_PASS'] = 'password';
+}
+return $config;
diff --git a/ext/pdo_firebird/tests/connect.phpt b/ext/pdo_firebird/tests/connect.phpt
new file mode 100644
index 000000000..c33cb1f66
--- /dev/null
+++ b/ext/pdo_firebird/tests/connect.phpt
@@ -0,0 +1,16 @@
+--TEST--
+PDO_Firebird: connect/disconnect
+--SKIPIF--
+<?php include("skipif.inc"); ?>
+--FILE--
+<?php /* $Id: connect.phpt,v 1.1 2004/06/11 01:37:06 abies Exp $ */
+
+ require("testdb.inc");
+
+ $db = new PDO("firebird:dbname=$test_base",$user,$password) or die;
+ unset($db);
+ echo "done\n";
+
+?>
+--EXPECT--
+done
diff --git a/ext/pdo_firebird/tests/ddl.phpt b/ext/pdo_firebird/tests/ddl.phpt
new file mode 100644
index 000000000..d03e48b7a
--- /dev/null
+++ b/ext/pdo_firebird/tests/ddl.phpt
@@ -0,0 +1,37 @@
+--TEST--
+PDO_Firebird: DDL/transactions
+--SKIPIF--
+<?php include("skipif.inc"); ?>
+--FILE--
+<?php /* $Id: ddl.phpt,v 1.1 2004/06/12 03:09:48 abies Exp $ */
+
+ require("testdb.inc");
+
+ $db = new PDO("firebird:dbname=$test_base",$user,$password) or die;
+ $db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING);
+
+ $db->exec("CREATE TABLE ddl (id INT NOT NULL PRIMARY KEY, text BLOB SUB_TYPE 1)");
+ $db->exec("CREATE GENERATOR gen_ddl_id");
+ $db->exec("CREATE TRIGGER ddl_bi FOR ddl BEFORE INSERT AS
+ BEGIN IF (NEW.id IS NULL) THEN NEW.id=GEN_ID(gen_ddl_id,1); END");
+
+ $db->setAttribute(PDO_ATTR_AUTOCOMMIT,0);
+
+ $db->beginTransaction();
+ var_dump($db->exec("INSERT INTO ddl (text) VALUES ('bla')"));
+ var_dump($db->exec("UPDATE ddl SET text='blabla'"));
+ $db->rollback();
+
+ $db->beginTransaction();
+ var_dump($db->exec("DELETE FROM ddl"));
+ $db->commit();
+
+ unset($db);
+ echo "done\n";
+
+?>
+--EXPECT--
+int(1)
+int(1)
+int(0)
+done
diff --git a/ext/pdo_firebird/tests/execute.phpt b/ext/pdo_firebird/tests/execute.phpt
new file mode 100644
index 000000000..bfaa31335
--- /dev/null
+++ b/ext/pdo_firebird/tests/execute.phpt
@@ -0,0 +1,65 @@
+--TEST--
+PDO_Firebird: prepare/execute/binding
+--SKIPIF--
+<?php include("skipif.inc"); ?>
+--INI--
+ibase.timestampformat=%Y-%m-%d %H:%M:%S
+--FILE--
+<?php /* $Id: execute.phpt,v 1.4 2004/06/23 13:26:09 abies Exp $ */
+
+ require("testdb.inc");
+
+ $db = new PDO("firebird:dbname=$test_base",$user,$password) or die;
+
+ var_dump($db->getAttribute(PDO_ATTR_CONNECTION_STATUS));
+
+ $db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING);
+
+ $db->exec("CREATE TABLE ddl (id SMALLINT NOT NULL PRIMARY KEY, text VARCHAR(32),
+ datetime TIMESTAMP DEFAULT '2000-02-12' NOT NULL)");
+ $db->exec("INSERT INTO ddl (id,text) VALUES (1,'bla')");
+
+ $s = $db->prepare("SELECT * FROM ddl WHERE id=? FOR UPDATE");
+
+ $s->bindParam(1,$id = 0);
+ $s->bindColumn("TEXT",$var = null);
+ $id = 1;
+ $s->execute();
+ $s->setAttribute(PDO_ATTR_CURSOR_NAME, "c");
+
+ var_dump($id);
+
+ var_dump($s->fetch());
+
+ var_dump($var);
+
+ var_dump($db->exec("UPDATE ddl SET id=2 WHERE CURRENT OF c"));
+
+ var_dump($s->fetch());
+
+ unset($s);
+ unset($db);
+ echo "done\n";
+
+?>
+--EXPECT--
+bool(true)
+int(1)
+array(6) {
+ ["ID"]=>
+ string(1) "1"
+ [0]=>
+ string(1) "1"
+ ["TEXT"]=>
+ string(3) "bla"
+ [1]=>
+ string(3) "bla"
+ ["DATETIME"]=>
+ string(19) "2000-02-12 00:00:00"
+ [2]=>
+ string(19) "2000-02-12 00:00:00"
+}
+string(3) "bla"
+int(1)
+bool(false)
+done
diff --git a/ext/pdo_firebird/tests/skipif.inc b/ext/pdo_firebird/tests/skipif.inc
new file mode 100644
index 000000000..515a278f9
--- /dev/null
+++ b/ext/pdo_firebird/tests/skipif.inc
@@ -0,0 +1,5 @@
+<?php /* $Id: skipif.inc,v 1.1 2004/06/11 01:37:06 abies Exp $ */
+
+if (!extension_loaded("interbase") || !extension_loaded("pdo_firebird")) print "skip";
+
+?>
diff --git a/ext/pdo_firebird/tests/testdb.inc b/ext/pdo_firebird/tests/testdb.inc
new file mode 100644
index 000000000..1b775f38e
--- /dev/null
+++ b/ext/pdo_firebird/tests/testdb.inc
@@ -0,0 +1,34 @@
+<?php /* $Id: testdb.inc,v 1.1 2004/06/11 01:37:06 abies Exp $ */
+
+$user = 'SYSDBA';
+$password = 'masterkey';
+ini_set('ibase.default_user',$user);
+ini_set('ibase.default_password',$password);
+
+/* we need just the generated name, not the file itself */
+unlink($test_base = tempnam('/tmp',"php_ibase_test"));
+
+function init_db()
+{
+ global $test_base, $user, $password;
+
+ $test_db = ibase_query(IBASE_CREATE,sprintf("CREATE DATABASE '%s' USER '%s' PASSWORD '%s'",
+ $test_base, $user, $password));
+ $tr = ibase_trans($test_db);
+ ibase_query($tr,"create table test1 (i integer, c varchar(100))");
+ ibase_commit_ret($tr);
+ ibase_query($tr,"insert into test1(i, c) values(1, 'test table not created with isql')");
+ ibase_commit($tr);
+ ibase_close($test_db);
+}
+
+function cleanup_db()
+{
+ global $test_base;
+
+ $r = ibase_connect($test_base);
+ ibase_drop_db($r);
+}
+
+register_shutdown_function('cleanup_db');
+init_db();
diff --git a/ext/pdo_mysql/CREDITS b/ext/pdo_mysql/CREDITS
new file mode 100755
index 000000000..0735d9a1e
--- /dev/null
+++ b/ext/pdo_mysql/CREDITS
@@ -0,0 +1,2 @@
+mySQL 3.x driver for PDO
+George Schlossnagle
diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4
new file mode 100755
index 000000000..1cfa766d0
--- /dev/null
+++ b/ext/pdo_mysql/config.m4
@@ -0,0 +1,131 @@
+dnl
+dnl $Id: config.m4,v 1.25.2.4 2005/11/25 17:07:49 wez Exp $
+dnl
+
+if test "$PHP_PDO" != "no"; then
+
+AC_DEFUN([PDO_MYSQL_LIB_CHK], [
+ str="$PDO_MYSQL_DIR/$1/libmysqlclient.*"
+ for j in `echo $str`; do
+ if test -r $j; then
+ PDO_MYSQL_LIB_DIR=$MYSQL_DIR/$1
+ break 2
+ fi
+ done
+])
+
+PHP_ARG_WITH(pdo-mysql, for MySQL support for PDO,
+[ --with-pdo-mysql[=DIR] PDO: MySQL support. DIR is the MySQL base directory])
+
+if test "$PHP_PDO_MYSQL" != "no"; then
+ AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
+
+ AC_MSG_CHECKING([for mysql_config])
+
+ if test -f $PHP_PDO_MYSQL && test -x $PHP_PDO_MYSQL ; then
+ PDO_MYSQL_CONFIG=$PHP_PDO_MYSQL
+ elif test "$PHP_PDO_MYSQL" != "yes"; then
+ if test -d "$PHP_PDO_MYSQL" ; then
+ if test -x "$PHP_PDO_MYSQL/bin/mysql_config" ; then
+ PDO_MYSQL_CONFIG="$PHP_PDO_MYSQL/bin/mysql_config"
+ else
+ PDO_MYSQL_DIR="$PHP_PDO_MYSQL"
+ fi
+ else
+ AC_MSG_RESULT([$PHP_PDO_MYSQL is not a directory])
+ AC_MSG_ERROR([can't find mysql under the "$PHP_PDO_MYSQL" that you specified])
+ fi
+ else
+ for i in /usr/local /usr ; do
+ if test -x "$i/bin/mysql_config" ; then
+ PDO_MYSQL_CONFIG="$i/bin/mysql_config"
+ break;
+ fi
+ if test -r $i/include/mysql/mysql.h || test -r $i/include/mysql.h ; then
+ PDO_MYSQL_DIR="$i"
+ break;
+ fi
+ done
+ fi
+
+ if test -n "$PDO_MYSQL_CONFIG" && test -x "$PDO_MYSQL_CONFIG" ; then
+ AC_MSG_RESULT($PDO_MYSQL_CONFIG)
+ PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags`
+ PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs`
+ PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket`
+ PHP_SUBST_OLD(PDO_MYSQL_LIBS)
+ elif test -z "$PDO_MYSQL_DIR"; then
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Cannot find MySQL header files under $PDO_MYSQL_DIR])
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_CHECKING([for mysql install under $PDO_MYSQL_DIR])
+ 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
+ if test -r $PDO_MYSQL_DIR/lib/mysql; then
+ PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/lib/mysql
+ else
+ PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/lib
+ fi
+
+ if test -r "$PDO_MYSQL_LIB_DIR"; then
+ AC_MSG_RESULT([libs under $PDO_MYSQL_LIB_DIR; seems promising])
+ else
+ AC_MSG_RESULT([can't find it])
+ 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_INCLUDE($PDO_MYSQL_INC_DIR)
+ PDO_MYSQL_INCLUDE=-I$PDO_MYSQL_INC_DIR
+ fi
+
+ AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ])
+
+ PHP_CHECK_LIBRARY(mysqlclient, mysql_query,
+ [
+ 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
+
+ ifdef([PHP_CHECK_PDO_INCLUDES],
+ [
+ PHP_CHECK_PDO_INCLUDES
+ ],[
+ AC_MSG_CHECKING([for PDO includes])
+ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$prefix/include/php/ext
+ else
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
+ fi
+ AC_MSG_RESULT($pdo_inc_path)
+ ])
+
+ PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path $PDO_MYSQL_INCLUDE)
+ 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
+
+fi
+dnl vim: se ts=2 sw=2 et:
diff --git a/ext/pdo_mysql/config.w32 b/ext/pdo_mysql/config.w32
new file mode 100644
index 000000000..23ff7daa3
--- /dev/null
+++ b/ext/pdo_mysql/config.w32
@@ -0,0 +1,15 @@
+// $Id: config.w32,v 1.4 2004/08/15 15:56:33 helly Exp $
+// vim:ft=javascript
+
+ARG_WITH("pdo-mysql", "MySQL support for PDO", "no");
+
+if (PHP_PDO_MYSQL != "no") {
+ if (CHECK_LIB("libmysql.lib", "pdo_mysql", PHP_PDO_MYSQL) &&
+ CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_PDO_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_PDO_MYSQL)) {
+ EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c");
+ ADD_FLAG('CFLAGS_PDO_MYSQL', "/I ..\\pecl");
+ } else {
+ WARNING("pdo_mysql not enabled; libraries and headers not found");
+ }
+ ADD_EXTENSION_DEP('pdo_mysql', 'pdo');
+}
diff --git a/ext/pdo_mysql/get_error_codes.php b/ext/pdo_mysql/get_error_codes.php
new file mode 100644
index 000000000..2785c93b9
--- /dev/null
+++ b/ext/pdo_mysql/get_error_codes.php
@@ -0,0 +1,27 @@
+<?php
+ $codes = array();
+ $maxlen = 0;
+
+ while (!feof(STDIN)) {
+ $line = fgets(STDIN);
+
+ if (ereg('^(ER_.*),[[:space:]]+"(.*)",[[:space:]]+"(.*)"', $line, $matches)) {
+ $codes[$matches[1]] = $matches[2];
+ $maxlen = max($maxlen, strlen($matches[1]));
+ }
+ }
+
+ if (empty($codes)) {
+ fputs(STDERR, "input doesn't look like a MySQL sql_state.h file\n");
+ exit(3);
+ }
+
+ echo "/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */\n";
+ foreach ($codes as $code => $state) {
+ echo "#ifdef $code\n";
+ printf(" case %-{$maxlen}s: return \"%s\";\n", $code, $state);
+ echo "#endif\n";
+ }
+
+
+?> \ No newline at end of file
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
new file mode 100755
index 000000000..61f697203
--- /dev/null
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -0,0 +1,526 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: George Schlossnagle <george@omniti.com> |
+ | Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: mysql_driver.c,v 1.59.2.6 2005/11/25 12:56:04 tony2001 Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_mysql.h"
+#include "php_pdo_mysql_int.h"
+#include <mysqld_error.h>
+#include "zend_exceptions.h"
+
+
+const char *pdo_mysql_get_sqlstate(unsigned int my_errno) {
+ switch (my_errno) {
+ /* import auto-generated case: code */
+#include "php_pdo_mysql_sqlstate.h"
+ default: return "HY000";
+ }
+}
+
+int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC) /* {{{ */
+{
+ pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
+ pdo_error_type *pdo_err;
+ pdo_mysql_error_info *einfo;
+ pdo_mysql_stmt *S = NULL;
+
+ if (stmt) {
+ S = (pdo_mysql_stmt*)stmt->driver_data;
+ pdo_err = &stmt->error_code;
+ einfo = &S->einfo;
+ } else {
+ pdo_err = &dbh->error_code;
+ einfo = &H->einfo;
+ }
+
+#if HAVE_MYSQL_STMT_PREPARE
+ if (S && S->stmt) {
+ einfo->errcode = mysql_stmt_errno(S->stmt);
+ }
+ else
+#endif
+ {
+ einfo->errcode = mysql_errno(H->server);
+ }
+
+ einfo->file = file;
+ einfo->line = line;
+
+ if (einfo->errmsg) {
+ pefree(einfo->errmsg, dbh->is_persistent);
+ einfo->errmsg = NULL;
+ }
+
+ if (einfo->errcode) {
+ if (2014 != einfo->errcode) {
+ einfo->errmsg = pestrdup(mysql_error(H->server), dbh->is_persistent);
+ } else {
+ einfo->errmsg = pestrdup(
+ "Cannot execute queries while other unbuffered queries are active. "
+ "Consider using PDOStatement::fetchAll(). Alternatively, if your code "
+ "is only ever going to run against mysql, you may enable query "
+ "buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.",
+ dbh->is_persistent);
+ }
+ } else { /* no error */
+ strcpy(*pdo_err, PDO_ERR_NONE);
+ return 0;
+ }
+
+#if HAVE_MYSQL_SQLSTATE
+# if HAVE_MYSQL_STMT_PREPARE
+ if (S && S->stmt) {
+ strcpy(*pdo_err, mysql_stmt_sqlstate(S->stmt));
+ } else
+# endif
+ {
+ strcpy(*pdo_err, mysql_sqlstate(H->server));
+ }
+#else
+ strcpy(*pdo_err, pdo_mysql_get_sqlstate(einfo->errcode));
+#endif
+
+ if (!dbh->methods) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ *pdo_err, einfo->errcode, einfo->errmsg);
+ }
+/* printf("** [%s:%d] %s %s\n", file, line, *pdo_err, einfo->errmsg); */
+
+ return einfo->errcode;
+}
+/* }}} */
+
+static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+{
+ pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
+ pdo_mysql_error_info *einfo = &H->einfo;
+
+ if (stmt) {
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+ einfo = &S->einfo;
+ } else {
+ einfo = &H->einfo;
+ }
+
+ if (einfo->errcode) {
+ add_next_index_long(info, einfo->errcode);
+ add_next_index_string(info, einfo->errmsg, 1);
+ }
+
+ return 1;
+}
+
+static int mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
+
+ if (H) {
+ if (H->server) {
+ mysql_close(H->server);
+ H->server = NULL;
+ }
+ if (H->einfo.errmsg) {
+ pefree(H->einfo.errmsg, dbh->is_persistent);
+ H->einfo.errmsg = NULL;
+ }
+ pefree(H, dbh->is_persistent);
+ dbh->driver_data = NULL;
+ }
+ return 0;
+}
+/* }}} */
+
+static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+{
+ pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
+ pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt));
+#if HAVE_MYSQL_STMT_PREPARE
+ char *nsql = NULL;
+ int nsql_len = 0;
+ int ret;
+#endif
+
+ S->H = H;
+ stmt->driver_data = S;
+ stmt->methods = &mysql_stmt_methods;
+
+ /* TODO: add runtime check to determine if the server we are talking to supports
+ * prepared statements; if it doesn't, we should set stmt->supports_placeholders
+ * to PDO_PLACEHOLDER_NONE, and have the rest of the code look at S->stmt to
+ * determine if we're using real prepared statements or the PDO emulated version */
+#if HAVE_MYSQL_STMT_PREPARE
+ stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL;
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+
+ if (ret == 1) {
+ /* query was rewritten */
+ sql = nsql;
+ sql_len = nsql_len;
+ } else if (ret == -1) {
+ /* failed to parse */
+ strcpy(dbh->error_code, stmt->error_code);
+ return 0;
+ }
+
+ if (!(S->stmt = mysql_stmt_init(H->server))) {
+ pdo_mysql_error(dbh);
+ if (nsql) {
+ efree(nsql);
+ }
+ return 0;
+ }
+
+ if (mysql_stmt_prepare(S->stmt, sql, sql_len)) {
+ /* TODO: might need to pull statement specific info here? */
+ /* if the query isn't supported by the protocol, fallback to emulation */
+ if (mysql_errno(H->server) == 1295) {
+ if (nsql) {
+ efree(nsql);
+ }
+ goto fallback;
+ }
+ pdo_mysql_error(dbh);
+ if (nsql) {
+ efree(nsql);
+ }
+ return 0;
+ }
+ if (nsql) {
+ efree(nsql);
+ }
+
+ S->num_params = mysql_stmt_param_count(S->stmt);
+
+ if (S->num_params) {
+ S->params = ecalloc(S->num_params, sizeof(MYSQL_BIND));
+ S->in_null = ecalloc(S->num_params, sizeof(my_bool));
+ S->in_length = ecalloc(S->num_params, sizeof(unsigned long));
+ }
+
+ dbh->alloc_own_columns = 1;
+
+ S->max_length = pdo_attr_lval(driver_options, PDO_ATTR_MAX_COLUMN_LEN, 0 TSRMLS_CC);
+
+ return 1;
+
+fallback:
+#endif
+ stmt->supports_placeholders = PDO_PLACEHOLDER_NONE;
+
+ return 1;
+}
+
+static long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC)
+{
+ pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
+
+ if (mysql_real_query(H->server, sql, sql_len)) {
+ pdo_mysql_error(dbh);
+ return -1;
+ } else {
+ my_ulonglong c = mysql_affected_rows(H->server);
+ if (c == (my_ulonglong) -1) {
+ pdo_mysql_error(dbh);
+ return (H->einfo.errcode ? -1 : 0);
+ } else {
+ return c;
+ }
+ }
+}
+
+static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+{
+ pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
+ char *id = php_pdo_int64_to_str(mysql_insert_id(H->server) TSRMLS_CC);
+ *len = strlen(id);
+ return id;
+}
+
+static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+{
+ pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
+ *quoted = safe_emalloc(2, unquotedlen, 3);
+ *quotedlen = mysql_real_escape_string(H->server, *quoted + 1, unquoted, unquotedlen);
+ (*quoted)[0] =(*quoted)[++*quotedlen] = '"';
+ (*quoted)[++*quotedlen] = '\0';
+ return 1;
+}
+
+static int mysql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ return 0 <= mysql_handle_doer(dbh, ZEND_STRL("START TRANSACTION") TSRMLS_CC);
+}
+
+static int mysql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ return 0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT") TSRMLS_CC);
+}
+
+static int mysql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ return 0 <= mysql_handle_doer(dbh, ZEND_STRL("ROLLBACK") TSRMLS_CC);
+}
+
+static int mysql_handle_autocommit(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ if (dbh->auto_commit) {
+ return 0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=1") TSRMLS_CC);
+ } else {
+ return 0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=0") TSRMLS_CC);
+ }
+}
+
+static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
+{
+ switch (attr) {
+ case PDO_ATTR_AUTOCOMMIT:
+
+ convert_to_boolean(val);
+
+ /* ignore if the new value equals the old one */
+ if (dbh->auto_commit ^ Z_BVAL_P(val)) {
+ dbh->auto_commit = Z_BVAL_P(val);
+ mysql_handle_autocommit(dbh TSRMLS_CC);
+ }
+ return 1;
+
+ case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY:
+ ((pdo_mysql_db_handle *)dbh->driver_data)->buffered = Z_BVAL_P(val);
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC)
+{
+ pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
+
+ switch (attr) {
+ case PDO_ATTR_CLIENT_VERSION:
+ ZVAL_STRING(return_value, (char *)mysql_get_client_info(), 1);
+ break;
+
+ case PDO_ATTR_SERVER_VERSION:
+ ZVAL_STRING(return_value, (char *)mysql_get_server_info(H->server), 1);
+ break;
+
+ case PDO_ATTR_CONNECTION_STATUS:
+ ZVAL_STRING(return_value, (char *)mysql_get_host_info(H->server), 1);
+ break;
+
+ case PDO_ATTR_SERVER_INFO: {
+ char *tmp;
+
+ if ((tmp = (char *)mysql_stat(H->server))) {
+ ZVAL_STRING(return_value, tmp, 1);
+ } else {
+ pdo_mysql_error(dbh);
+ return -1;
+ }
+ }
+ break;
+
+ case PDO_ATTR_AUTOCOMMIT:
+ ZVAL_LONG(return_value, dbh->auto_commit);
+ return 1;
+
+ case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY:
+ ZVAL_LONG(return_value, H->buffered);
+ return 1;
+
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
+
+static struct pdo_dbh_methods mysql_methods = {
+ mysql_handle_closer,
+ mysql_handle_preparer,
+ mysql_handle_doer,
+ mysql_handle_quoter,
+ mysql_handle_begin,
+ mysql_handle_commit,
+ mysql_handle_rollback,
+ pdo_mysql_set_attribute,
+ pdo_mysql_last_insert_id,
+ pdo_mysql_fetch_error_func,
+ pdo_mysql_get_attribute,
+ NULL /* check_liveness: TODO: ping */
+};
+
+#ifndef PDO_MYSQL_UNIX_ADDR
+# ifdef PHP_WIN32
+# define PDO_MYSQL_UNIX_ADDR "MySQL"
+# else
+# define PDO_MYSQL_UNIX_ADDR "/tmp/mysql.sock"
+# endif
+#endif
+
+static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+{
+ pdo_mysql_db_handle *H;
+ int i, ret = 0;
+ char *host = NULL, *unix_socket = NULL;
+ unsigned int port = 3306;
+ char *dbname;
+ struct pdo_data_src_parser vars[] = {
+ { "charset", NULL, 0 },
+ { "dbname", "", 0 },
+ { "host", "localhost", 0 },
+ { "port", "3306", 0 },
+ { "unix_socket", PDO_MYSQL_UNIX_ADDR, 0 },
+ };
+ int connect_opts = 0
+#ifdef CLIENT_MULTI_RESULTS
+ |CLIENT_MULTI_RESULTS
+#endif
+#ifdef CLIENT_MULTI_STATEMENTS
+ |CLIENT_MULTI_STATEMENTS
+#endif
+ ;
+
+ php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5);
+
+ H = pecalloc(1, sizeof(pdo_mysql_db_handle), dbh->is_persistent);
+
+ H->einfo.errcode = 0;
+ H->einfo.errmsg = NULL;
+
+ /* allocate an environment */
+
+ /* handle for the server */
+ if (!(H->server = mysql_init(NULL))) {
+ pdo_mysql_error(dbh);
+ goto cleanup;
+ }
+
+ dbh->driver_data = H;
+
+ /* handle MySQL options */
+ if (driver_options) {
+ long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC);
+ long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0 TSRMLS_CC);
+ char *init_cmd = NULL, *default_file = NULL, *default_group = NULL;
+
+ H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 0 TSRMLS_CC);
+
+ if (mysql_options(H->server, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout)) {
+ pdo_mysql_error(dbh);
+ goto cleanup;
+ }
+
+ if (mysql_options(H->server, MYSQL_OPT_LOCAL_INFILE, (const char *)&local_infile)) {
+ pdo_mysql_error(dbh);
+ goto cleanup;
+ }
+
+ init_cmd = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_INIT_COMMAND, NULL TSRMLS_CC);
+ if (init_cmd) {
+ if (mysql_options(H->server, MYSQL_INIT_COMMAND, (const char *)init_cmd)) {
+ efree(init_cmd);
+ pdo_mysql_error(dbh);
+ goto cleanup;
+ }
+ efree(init_cmd);
+ }
+
+ default_file = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_FILE, NULL TSRMLS_CC);
+ if (default_file) {
+ if (mysql_options(H->server, MYSQL_READ_DEFAULT_FILE, (const char *)default_file)) {
+ efree(default_file);
+ pdo_mysql_error(dbh);
+ goto cleanup;
+ }
+ efree(default_file);
+ }
+
+ default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL TSRMLS_CC);
+ if (default_group) {
+ if (mysql_options(H->server, MYSQL_READ_DEFAULT_GROUP, (const char *)default_group)) {
+ efree(default_group);
+ pdo_mysql_error(dbh);
+ goto cleanup;
+ }
+ efree(default_group);
+ }
+ }
+
+ dbname = vars[1].optval;
+ host = vars[2].optval;
+ if(vars[3].optval) {
+ port = atoi(vars[3].optval);
+ }
+ if (vars[2].optval && !strcmp("localhost", vars[2].optval)) {
+ unix_socket = vars[4].optval;
+ }
+ if (mysql_real_connect(H->server, host, dbh->username, dbh->password, dbname, port, unix_socket, connect_opts) == NULL) {
+ pdo_mysql_error(dbh);
+ goto cleanup;
+ }
+
+ mysql_handle_autocommit(dbh TSRMLS_CC);
+
+ H->attached = 1;
+
+ dbh->alloc_own_columns = 1;
+ dbh->max_escaped_char_length = 2;
+ dbh->methods = &mysql_methods;
+
+ ret = 1;
+
+cleanup:
+ for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) {
+ if (vars[i].freeme) {
+ efree(vars[i].optval);
+ }
+ }
+
+ dbh->methods = &mysql_methods;
+
+ return ret;
+}
+/* }}} */
+
+pdo_driver_t pdo_mysql_driver = {
+ PDO_DRIVER_HEADER(mysql),
+ pdo_mysql_handle_factory
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
new file mode 100755
index 000000000..9009a3a74
--- /dev/null
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -0,0 +1,608 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: George Schlossnagle <george@omniti.com> |
+ | Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: mysql_statement.c,v 1.48.2.7 2005/10/29 02:41:50 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_mysql.h"
+#include "php_pdo_mysql_int.h"
+
+
+static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+
+ if (S->result) {
+ /* free the resource */
+ mysql_free_result(S->result);
+ S->result = NULL;
+ }
+ if (S->einfo.errmsg) {
+ efree(S->einfo.errmsg);
+ S->einfo.errmsg = NULL;
+ }
+#if HAVE_MYSQL_STMT_PREPARE
+ if (S->stmt) {
+ mysql_stmt_close(S->stmt);
+ S->stmt = NULL;
+ }
+ if (S->params) {
+ efree(S->params);
+ efree(S->in_null);
+ efree(S->in_length);
+ }
+ if (S->bound_result)
+ {
+ int i;
+ for (i = 0; i < stmt->column_count; i++) {
+ efree(S->bound_result[i].buffer);
+ }
+
+ efree(S->bound_result);
+ efree(S->out_null);
+ efree(S->out_length);
+ }
+#endif
+ efree(S);
+ return 1;
+}
+
+#define PDO_MYSQL_MAX_BUFFER 1024*1024 /* 1 megabyte */
+
+static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+ pdo_mysql_db_handle *H = S->H;
+ my_ulonglong row_count;
+#if HAVE_MYSQL_STMT_PREPARE
+ int i;
+
+ if (S->stmt) {
+ /* (re)bind the parameters */
+ if (mysql_stmt_bind_param(S->stmt, S->params)) {
+ pdo_mysql_error_stmt(stmt);
+ return 0;
+ }
+
+ if (mysql_stmt_execute(S->stmt)) {
+ pdo_mysql_error_stmt(stmt);
+ return 0;
+ }
+
+ if (!S->result) {
+ /* figure out the result set format, if any */
+ S->result = mysql_stmt_result_metadata(S->stmt);
+ if (S->result) {
+ int calc_max_length = H->buffered && S->max_length == 1;
+
+ S->fields = mysql_fetch_fields(S->result);
+
+ if (S->bound_result) {
+ int i;
+ for (i = 0; i < stmt->column_count; i++) {
+ efree(S->bound_result[i].buffer);
+ }
+ efree(S->bound_result);
+ efree(S->out_null);
+ efree(S->out_length);
+ }
+
+ stmt->column_count = (int)mysql_num_fields(S->result);
+ S->bound_result = ecalloc(stmt->column_count, sizeof(MYSQL_BIND));
+ S->out_null = ecalloc(stmt->column_count, sizeof(my_bool));
+ S->out_length = ecalloc(stmt->column_count, sizeof(unsigned long));
+
+ /* summon memory to hold the row */
+ for (i = 0; i < stmt->column_count; i++) {
+ if (calc_max_length && S->fields[i].type == FIELD_TYPE_BLOB) {
+ my_bool on = 1;
+ mysql_stmt_attr_set(S->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &on);
+ calc_max_length = 0;
+ }
+ switch (S->fields[i].type) {
+ case FIELD_TYPE_INT24:
+ S->bound_result[i].buffer_length = MAX_MEDIUMINT_WIDTH;
+ break;
+ case FIELD_TYPE_LONG:
+ S->bound_result[i].buffer_length = MAX_INT_WIDTH;
+ break;
+ case FIELD_TYPE_LONGLONG:
+ S->bound_result[i].buffer_length = MAX_BIGINT_WIDTH;
+ break;
+ case FIELD_TYPE_TINY:
+ S->bound_result[i].buffer_length = MAX_TINYINT_WIDTH;
+ break;
+ case FIELD_TYPE_SHORT:
+ S->bound_result[i].buffer_length = MAX_SMALLINT_WIDTH;
+ break;
+ default:
+ S->bound_result[i].buffer_length =
+ S->fields[i].max_length? S->fields[i].max_length:
+ S->fields[i].length;
+ /* work-around for longtext and alike */
+ if (S->bound_result[i].buffer_length > PDO_MYSQL_MAX_BUFFER) {
+ S->bound_result[i].buffer_length = PDO_MYSQL_MAX_BUFFER;
+ }
+ }
+#if 0
+ printf("%d: max_length=%d length=%d buffer_length=%d type=%d\n",
+ i,
+ S->fields[i].max_length,
+ S->fields[i].length,
+ S->bound_result[i].buffer_length,
+ S->fields[i].type
+ );
+#endif
+
+ /* there are cases where the length reported by mysql is too short.
+ * eg: when describing a table that contains an enum column. Since
+ * we have no way of knowing the true length either, we'll bump up
+ * our buffer size to a reasonable size, just in case */
+ if (S->fields[i].max_length == 0 && S->bound_result[i].buffer_length < 128 && MYSQL_TYPE_VAR_STRING) {
+ S->bound_result[i].buffer_length = 128;
+ }
+
+ S->out_length[i] = 0;
+
+ S->bound_result[i].buffer = emalloc(S->bound_result[i].buffer_length);
+ S->bound_result[i].is_null = &S->out_null[i];
+ S->bound_result[i].length = &S->out_length[i];
+ S->bound_result[i].buffer_type = MYSQL_TYPE_STRING;
+ }
+
+ if (mysql_stmt_bind_result(S->stmt, S->bound_result)) {
+ pdo_mysql_error_stmt(stmt);
+ return 0;
+ }
+
+ /* if buffered, pre-fetch all the data */
+ if (H->buffered) {
+ mysql_stmt_store_result(S->stmt);
+ }
+ }
+ }
+
+ row_count = mysql_stmt_affected_rows(S->stmt);
+ if (row_count != (my_ulonglong)-1) {
+ stmt->row_count = row_count;
+ }
+ return 1;
+ }
+#endif
+ /* ensure that we free any previous unfetched results */
+ if (S->result) {
+ mysql_free_result(S->result);
+ S->result = NULL;
+ }
+
+ if (mysql_real_query(H->server, stmt->active_query_string, stmt->active_query_stringlen) != 0) {
+ pdo_mysql_error_stmt(stmt);
+ return 0;
+ }
+
+ row_count = mysql_affected_rows(H->server);
+ if (row_count == (my_ulonglong)-1) {
+ /* we either have a query that returned a result set or an error occured
+ lets see if we have access to a result set */
+ if (!H->buffered) {
+ S->result = mysql_use_result(H->server);
+ } else {
+ S->result = mysql_store_result(H->server);
+ }
+ if (NULL == S->result) {
+ pdo_mysql_error_stmt(stmt);
+ return 0;
+ }
+
+ stmt->row_count = 0;
+
+ if (!stmt->executed) {
+ stmt->column_count = (int) mysql_num_fields(S->result);
+ S->fields = mysql_fetch_fields(S->result);
+ }
+ } else {
+ /* this was a DML or DDL query (INSERT, UPDATE, DELETE, ... */
+ stmt->row_count = row_count;
+ }
+
+ return 1;
+}
+
+static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
+{
+#if HAVE_MYSQL_NEXT_RESULT
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+ pdo_mysql_db_handle *H = S->H;
+ my_ulonglong row_count;
+ int ret;
+
+ /* ensure that we free any previous unfetched results */
+#if HAVE_MYSQL_STMT_PREPARE
+ if (S->stmt) {
+ mysql_stmt_free_result(S->stmt);
+ }
+#endif
+ if (S->result) {
+ mysql_free_result(S->result);
+ S->result = NULL;
+ }
+
+ ret = mysql_next_result(H->server);
+
+ if (ret > 0) {
+ pdo_mysql_error_stmt(stmt);
+ return 0;
+ } else if (ret < 0) {
+ /* No more results */
+ return 0;
+ } else {
+ if ((my_ulonglong)-1 == (row_count = mysql_affected_rows(H->server))) {
+ pdo_mysql_error_stmt(stmt);
+ return 0;
+ }
+
+ if (!H->buffered) {
+ S->result = mysql_use_result(H->server);
+ } else {
+ S->result = mysql_store_result(H->server);
+ }
+
+ if (NULL == S->result) {
+ return 0;
+ }
+
+ stmt->row_count = row_count;
+ stmt->column_count = (int) mysql_num_fields(S->result);
+ S->fields = mysql_fetch_fields(S->result);
+ return 1;
+ }
+#else
+ strcpy(stmt->error_code, "HYC00");
+ return 0;
+#endif
+}
+
+
+static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
+ enum pdo_param_event event_type TSRMLS_DC)
+{
+#if HAVE_MYSQL_STMT_PREPARE
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+ MYSQL_BIND *b;
+
+ if (S->stmt && param->is_param) {
+ switch (event_type) {
+ case PDO_PARAM_EVT_ALLOC:
+ /* sanity check parameter number range */
+ if (param->paramno < 0 || param->paramno >= S->num_params) {
+ strcpy(stmt->error_code, "HY093");
+ return 0;
+ }
+ b = &S->params[param->paramno];
+ param->driver_data = b;
+ b->is_null = &S->in_null[param->paramno];
+ b->length = &S->in_length[param->paramno];
+ return 1;
+
+ case PDO_PARAM_EVT_EXEC_PRE:
+ b = (MYSQL_BIND*)param->driver_data;
+
+ *b->is_null = 0;
+ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL ||
+ Z_TYPE_P(param->parameter) == IS_NULL) {
+ *b->is_null = 1;
+ b->buffer_type = MYSQL_TYPE_STRING;
+ b->buffer = NULL;
+ b->buffer_length = 0;
+ *b->length = 0;
+ return 1;
+ }
+
+ switch (PDO_PARAM_TYPE(param->param_type)) {
+ case PDO_PARAM_STMT:
+ return 0;
+ case PDO_PARAM_LOB:
+ if (Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ php_stream *stm;
+ php_stream_from_zval_no_verify(stm, &param->parameter);
+ if (stm) {
+ SEPARATE_ZVAL_IF_NOT_REF(&param->parameter);
+ Z_TYPE_P(param->parameter) = IS_STRING;
+ Z_STRLEN_P(param->parameter) = php_stream_copy_to_mem(stm,
+ &Z_STRVAL_P(param->parameter), PHP_STREAM_COPY_ALL, 0);
+ } else {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ return 0;
+ }
+ }
+ /* fall through */
+
+ default:
+ ;
+ }
+
+ switch (Z_TYPE_P(param->parameter)) {
+ case IS_STRING:
+ b->buffer_type = MYSQL_TYPE_STRING;
+ b->buffer = Z_STRVAL_P(param->parameter);
+ b->buffer_length = Z_STRLEN_P(param->parameter);
+ *b->length = Z_STRLEN_P(param->parameter);
+ return 1;
+
+ case IS_LONG:
+ b->buffer_type = MYSQL_TYPE_LONG;
+ b->buffer = &Z_LVAL_P(param->parameter);
+ return 1;
+
+ case IS_DOUBLE:
+ b->buffer_type = MYSQL_TYPE_DOUBLE;
+ b->buffer = &Z_DVAL_P(param->parameter);
+ return 1;
+
+ default:
+ return 0;
+ }
+ }
+ }
+#endif
+ return 1;
+}
+
+static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt,
+ enum pdo_fetch_orientation ori, long offset TSRMLS_DC)
+{
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+#if HAVE_MYSQL_STMT_PREPARE
+ int ret;
+
+ if (S->stmt) {
+ ret = mysql_stmt_fetch(S->stmt);
+
+#ifdef MYSQL_DATA_TRUNCATED
+ if (ret == MYSQL_DATA_TRUNCATED) {
+ ret = 0;
+ }
+#endif
+
+ if (ret) {
+ if (ret != MYSQL_NO_DATA) {
+ pdo_mysql_error_stmt(stmt);
+ }
+ return 0;
+ }
+
+ return 1;
+ }
+#endif
+
+ if (!S->result) {
+ return 0;
+ }
+ if ((S->current_data = mysql_fetch_row(S->result)) == NULL) {
+ if (mysql_errno(S->H->server)) {
+ pdo_mysql_error_stmt(stmt);
+ }
+ return 0;
+ }
+ S->current_lengths = mysql_fetch_lengths(S->result);
+ return 1;
+}
+
+static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+{
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+ struct pdo_column_data *cols = stmt->columns;
+ unsigned int i;
+
+ if (!S->result) {
+ return 0;
+ }
+
+ if (colno >= stmt->column_count) {
+ /* error invalid column */
+ return 0;
+ }
+
+ /* fetch all on demand, this seems easiest
+ ** if we've been here before bail out
+ */
+ if (cols[0].name) {
+ return 1;
+ }
+ for (i=0; i < stmt->column_count; i++) {
+ int namelen;
+ namelen = strlen(S->fields[i].name);
+ cols[i].precision = S->fields[i].decimals;
+ cols[i].maxlen = S->fields[i].length;
+ cols[i].namelen = namelen;
+ cols[i].name = estrndup(S->fields[i].name, namelen);
+ cols[i].param_type = PDO_PARAM_STR;
+ }
+ return 1;
+}
+
+static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC)
+{
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+
+#if HAVE_MYSQL_STMT_PREPARE
+ if (!S->stmt) {
+#endif
+ if (S->current_data == NULL || !S->result) {
+ return 0;
+ }
+#if HAVE_MYSQL_STMT_PREPARE
+ }
+#endif
+ if (colno >= stmt->column_count) {
+ /* error invalid column */
+ return 0;
+ }
+#if HAVE_MYSQL_STMT_PREPARE
+ if (S->stmt) {
+ if (S->out_null[colno]) {
+ *ptr = NULL;
+ *len = 0;
+ return 1;
+ }
+ *ptr = S->bound_result[colno].buffer;
+ if (S->out_length[colno] > S->bound_result[colno].buffer_length) {
+ /* mysql lied about the column width */
+ strcpy(stmt->error_code, "01004"); /* truncated */
+ S->out_length[colno] = S->bound_result[colno].buffer_length;
+ *len = S->out_length[colno];
+ return 0;
+ }
+ *len = S->out_length[colno];
+ return 1;
+ }
+#endif
+ *ptr = S->current_data[colno];
+ *len = S->current_lengths[colno];
+ return 1;
+}
+
+static char *type_to_name_native(int type)
+{
+#define PDO_MYSQL_NATIVE_TYPE_NAME(x) case FIELD_TYPE_##x: return #x;
+
+ switch (type) {
+ PDO_MYSQL_NATIVE_TYPE_NAME(STRING)
+ PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING)
+#ifdef MYSQL_HAS_TINY
+ PDO_MYSQL_NATIVE_TYPE_NAME(TINY)
+#endif
+ PDO_MYSQL_NATIVE_TYPE_NAME(SHORT)
+ PDO_MYSQL_NATIVE_TYPE_NAME(LONG)
+ PDO_MYSQL_NATIVE_TYPE_NAME(LONGLONG)
+ PDO_MYSQL_NATIVE_TYPE_NAME(INT24)
+ PDO_MYSQL_NATIVE_TYPE_NAME(FLOAT)
+ PDO_MYSQL_NATIVE_TYPE_NAME(DOUBLE)
+ PDO_MYSQL_NATIVE_TYPE_NAME(DECIMAL)
+ PDO_MYSQL_NATIVE_TYPE_NAME(TIMESTAMP)
+#ifdef MYSQL_HAS_YEAR
+ PDO_MYSQL_NATIVE_TYPE_NAME(YEAR)
+#endif
+ PDO_MYSQL_NATIVE_TYPE_NAME(DATE)
+ PDO_MYSQL_NATIVE_TYPE_NAME(TIME)
+ PDO_MYSQL_NATIVE_TYPE_NAME(DATETIME)
+ PDO_MYSQL_NATIVE_TYPE_NAME(TINY_BLOB)
+ PDO_MYSQL_NATIVE_TYPE_NAME(MEDIUM_BLOB)
+ PDO_MYSQL_NATIVE_TYPE_NAME(LONG_BLOB)
+ PDO_MYSQL_NATIVE_TYPE_NAME(BLOB)
+ PDO_MYSQL_NATIVE_TYPE_NAME(NULL)
+ default:
+ return NULL;
+ }
+}
+
+static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC)
+{
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+ MYSQL_FIELD *F;
+ zval *flags;
+ char *str;
+
+ if (!S->result) {
+ return FAILURE;
+ }
+ if (colno >= stmt->column_count) {
+ /* error invalid column */
+ return FAILURE;
+ }
+
+ array_init(return_value);
+ MAKE_STD_ZVAL(flags);
+ array_init(flags);
+
+ F = S->fields + colno;
+
+ if (F->def) {
+ add_assoc_string(return_value, "mysql:def", F->def, 1);
+ }
+ if (IS_NOT_NULL(F->flags)) {
+ add_next_index_string(flags, "not_null", 1);
+ }
+ if (IS_PRI_KEY(F->flags)) {
+ add_next_index_string(flags, "primary_key", 1);
+ }
+ if (F->flags & MULTIPLE_KEY_FLAG) {
+ add_next_index_string(flags, "multiple_key", 1);
+ }
+ if (F->flags & UNIQUE_KEY_FLAG) {
+ add_next_index_string(flags, "unique_key", 1);
+ }
+ if (IS_BLOB(F->flags)) {
+ add_next_index_string(flags, "blob", 1);
+ }
+ str = type_to_name_native(F->type);
+ if (str) {
+ add_assoc_string(return_value, "native_type", str, 1);
+ }
+
+ add_assoc_zval(return_value, "flags", flags);
+ return SUCCESS;
+}
+
+static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+#if HAVE_MYSQL_STMT_PREPARE
+ if (S->stmt) {
+ int retval = mysql_stmt_free_result(S->stmt);
+ return retval ? 0 : 1;
+ }
+#endif
+ if (S->result) {
+ mysql_free_result(S->result);
+ S->result = NULL;
+ }
+ return 1;
+}
+
+struct pdo_stmt_methods mysql_stmt_methods = {
+ pdo_mysql_stmt_dtor,
+ pdo_mysql_stmt_execute,
+ pdo_mysql_stmt_fetch,
+ pdo_mysql_stmt_describe,
+ pdo_mysql_stmt_get_col,
+ pdo_mysql_stmt_param_hook,
+ NULL, /* set_attr */
+ NULL, /* get_attr */
+ pdo_mysql_stmt_col_meta,
+ pdo_mysql_stmt_next_rowset,
+ pdo_mysql_stmt_cursor_closer
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_mysql/package.xml b/ext/pdo_mysql/package.xml
new file mode 100644
index 000000000..ee53e1ac2
--- /dev/null
+++ b/ext/pdo_mysql/package.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE package SYSTEM "../pear/package.dtd">
+<package version="1.0">
+ <name>PDO_MYSQL</name>
+ <summary>MySQL driver for PDO</summary>
+ <maintainers>
+ <maintainer>
+ <user>gschlossnagle</user>
+ <name>George Schlossnagle</name>
+ <email>george@omniti.com</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>iliaa</user>
+ <name>Ilia Alshanetsky</name>
+ <email>iliaa@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>wez</user>
+ <name>Wez Furlong</name>
+ <email>wez@php.net</email>
+ <role>lead</role>
+ </maintainer>
+
+ </maintainers>
+ <description>
+ This extension provides a MySQL driver for PDO.
+ </description>
+ <license>PHP</license>
+ <release>
+ <state>stable</state>
+ <version>1.0</version>
+ <date>2005-11-26</date>
+
+ <notes>
+** Changes **
+- Improved error detection for OPTIMIZE queries
+- Added PDO::MYSQL_ATTR_LOCAL_INFILE, PDO::MYSQL_ATTR_INIT_COMMAND,
+ PDO::MYSQL_ATTR_READ_DEFAULT_FILE, PDO::MYSQL_ATTR_READ_DEFAULT_GROUP
+- Improved error reporting when using native prepared statements
+- Fixed PECL Bug #5193: improved bounds checking when calling getColumnMeta()
+- Fixed Bug #34630: improved (emulated) LOB support
+- Fixed Bug #34623: crash when selecting longtext fields
+- Fixed PECL Bug #5802; is_null flag was sticking
+- Fixed PECL Bug #5645; added mysql client library version information to phpinfo() output.
+
+Windows binaries can be found at http://pecl4win.php.net/ext.php/php_pdo_mysql.dll
+ </notes>
+
+ <filelist>
+ <file role="src" name="config.m4"/>
+ <file role="src" name="pdo_mysql.c"/>
+ <file role="src" name="mysql_driver.c"/>
+ <file role="src" name="mysql_statement.c"/>
+ <file role="src" name="php_pdo_mysql.h"/>
+ <file role="src" name="php_pdo_mysql_int.h"/>
+ <file role="src" name="php_pdo_mysql_sqlstate.h"/>
+
+ <file role="doc" name="CREDITS"/>
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="5.0.3"/>
+ <dep type="ext" name="pdo" rel="ge" version="1.0"/>
+ </deps>
+ </release>
+</package>
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
new file mode 100755
index 000000000..b46a075b7
--- /dev/null
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -0,0 +1,114 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: George Schlossnagle <george@omniti.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_mysql.c,v 1.8.2.8 2005/11/26 20:50:07 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_mysql.h"
+#include "php_pdo_mysql_int.h"
+
+/* {{{ pdo_mysql_functions[] */
+function_entry pdo_mysql_functions[] = {
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ pdo_mysql_functions[] */
+#if ZEND_MODULE_API_NO >= 20050922
+static zend_module_dep pdo_mysql_deps[] = {
+ ZEND_MOD_REQUIRED("pdo")
+ {NULL, NULL, NULL}
+};
+#endif
+/* }}} */
+
+/* {{{ pdo_mysql_module_entry */
+zend_module_entry pdo_mysql_module_entry = {
+#if ZEND_MODULE_API_NO >= 20050922
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_mysql_deps,
+#else
+ STANDARD_MODULE_HEADER,
+#endif
+ "pdo_mysql",
+ pdo_mysql_functions,
+ PHP_MINIT(pdo_mysql),
+ PHP_MSHUTDOWN(pdo_mysql),
+ NULL,
+ NULL,
+ PHP_MINFO(pdo_mysql),
+ "1.0",
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_PDO_MYSQL
+ZEND_GET_MODULE(pdo_mysql)
+#endif
+
+/* true global environment */
+
+/* {{{ PHP_MINIT_FUNCTION
+ */
+PHP_MINIT_FUNCTION(pdo_mysql)
+{
+ REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_USE_BUFFERED_QUERY", (long)PDO_MYSQL_ATTR_USE_BUFFERED_QUERY);
+ REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_LOCAL_INFILE", (long)PDO_MYSQL_ATTR_LOCAL_INFILE);
+ REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_INIT_COMMAND", (long)PDO_MYSQL_ATTR_INIT_COMMAND);
+ REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_FILE", (long)PDO_MYSQL_ATTR_READ_DEFAULT_FILE);
+ REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_GROUP", (long)PDO_MYSQL_ATTR_READ_DEFAULT_GROUP);
+
+ return php_pdo_register_driver(&pdo_mysql_driver);
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(pdo_mysql)
+{
+ php_pdo_unregister_driver(&pdo_mysql_driver);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(pdo_mysql)
+{
+ php_info_print_table_start();
+ php_info_print_table_header(2, "PDO Driver for MySQL, client library version", mysql_get_client_info());
+ php_info_print_table_end();
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h
new file mode 100755
index 000000000..d994749e6
--- /dev/null
+++ b/ext/pdo_mysql/php_pdo_mysql.h
@@ -0,0 +1,53 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: George Schlossnagle <george@omniti.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_mysql.h,v 1.3 2005/07/03 02:20:08 wez Exp $ */
+
+#ifndef PHP_PDO_MYSQL_H
+#define PHP_PDO_MYSQL_H
+
+extern zend_module_entry pdo_mysql_module_entry;
+#define phpext_pdo_mysql_ptr &pdo_mysql_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_PDO_MYSQL_API __declspec(dllexport)
+#else
+#define PHP_PDO_MYSQL_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(pdo_mysql);
+PHP_MSHUTDOWN_FUNCTION(pdo_mysql);
+PHP_RINIT_FUNCTION(pdo_mysql);
+PHP_RSHUTDOWN_FUNCTION(pdo_mysql);
+PHP_MINFO_FUNCTION(pdo_mysql);
+
+#endif /* PHP_PDO_MYSQL_H */
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
new file mode 100755
index 000000000..85a046368
--- /dev/null
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -0,0 +1,86 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: George Schlossnagle <george@omniti.com> |
+ | Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_mysql_int.h,v 1.16.2.1 2005/10/27 17:34:24 tony2001 Exp $ */
+
+#ifndef PHP_PDO_MYSQL_INT_H
+#define PHP_PDO_MYSQL_INT_H
+
+#include <mysql.h>
+
+typedef struct {
+ const char *file;
+ int line;
+ unsigned int errcode;
+ char *errmsg;
+} pdo_mysql_error_info;
+
+/* stuff we use in a mySQL database handle */
+typedef struct {
+ MYSQL *server;
+
+ unsigned attached:1;
+ unsigned buffered:1;
+ unsigned _reserved:31;
+
+ pdo_mysql_error_info einfo;
+} pdo_mysql_db_handle;
+
+typedef struct {
+ MYSQL_FIELD *def;
+} pdo_mysql_column;
+
+typedef struct {
+ pdo_mysql_db_handle *H;
+ MYSQL_RES *result;
+ MYSQL_FIELD *fields;
+ MYSQL_ROW current_data;
+ long *current_lengths;
+ pdo_mysql_error_info einfo;
+#if HAVE_MYSQL_STMT_PREPARE
+ MYSQL_STMT *stmt;
+
+ int num_params;
+ MYSQL_BIND *params;
+ my_bool *in_null;
+ unsigned long *in_length;
+
+ MYSQL_BIND *bound_result;
+ my_bool *out_null;
+ unsigned long *out_length;
+ unsigned max_length:1;
+#endif
+} pdo_mysql_stmt;
+
+extern pdo_driver_t pdo_mysql_driver;
+
+extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC);
+#define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC)
+#define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC)
+
+extern struct pdo_stmt_methods mysql_stmt_methods;
+
+enum {
+ PDO_MYSQL_ATTR_USE_BUFFERED_QUERY = PDO_ATTR_DRIVER_SPECIFIC,
+ PDO_MYSQL_ATTR_LOCAL_INFILE,
+ PDO_MYSQL_ATTR_INIT_COMMAND,
+ PDO_MYSQL_ATTR_READ_DEFAULT_FILE,
+ PDO_MYSQL_ATTR_READ_DEFAULT_GROUP,
+};
+#endif
diff --git a/ext/pdo_mysql/php_pdo_mysql_sqlstate.h b/ext/pdo_mysql/php_pdo_mysql_sqlstate.h
new file mode 100644
index 000000000..97724b72e
--- /dev/null
+++ b/ext/pdo_mysql/php_pdo_mysql_sqlstate.h
@@ -0,0 +1,388 @@
+/* DO NOT EDIT THIS FILE!!! It is auto generated by get_error_codes.php */
+#ifdef ER_DUP_KEY
+ case ER_DUP_KEY : return "23000";
+#endif
+#ifdef ER_OUTOFMEMORY
+ case ER_OUTOFMEMORY : return "HY001";
+#endif
+#ifdef ER_OUT_OF_SORTMEMORY
+ case ER_OUT_OF_SORTMEMORY : return "HY001";
+#endif
+#ifdef ER_CON_COUNT_ERROR
+ case ER_CON_COUNT_ERROR : return "08004";
+#endif
+#ifdef ER_BAD_HOST_ERROR
+ case ER_BAD_HOST_ERROR : return "08S01";
+#endif
+#ifdef ER_HANDSHAKE_ERROR
+ case ER_HANDSHAKE_ERROR : return "08S01";
+#endif
+#ifdef ER_DBACCESS_DENIED_ERROR
+ case ER_DBACCESS_DENIED_ERROR : return "42000";
+#endif
+#ifdef ER_ACCESS_DENIED_ERROR
+ case ER_ACCESS_DENIED_ERROR : return "28000";
+#endif
+#ifdef ER_NO_DB_ERROR
+ case ER_NO_DB_ERROR : return "3D000";
+#endif
+#ifdef ER_UNKNOWN_COM_ERROR
+ case ER_UNKNOWN_COM_ERROR : return "08S01";
+#endif
+#ifdef ER_BAD_NULL_ERROR
+ case ER_BAD_NULL_ERROR : return "23000";
+#endif
+#ifdef ER_BAD_DB_ERROR
+ case ER_BAD_DB_ERROR : return "42000";
+#endif
+#ifdef ER_TABLE_EXISTS_ERROR
+ case ER_TABLE_EXISTS_ERROR : return "42S01";
+#endif
+#ifdef ER_BAD_TABLE_ERROR
+ case ER_BAD_TABLE_ERROR : return "42S02";
+#endif
+#ifdef ER_NON_UNIQ_ERROR
+ case ER_NON_UNIQ_ERROR : return "23000";
+#endif
+#ifdef ER_SERVER_SHUTDOWN
+ case ER_SERVER_SHUTDOWN : return "08S01";
+#endif
+#ifdef ER_BAD_FIELD_ERROR
+ case ER_BAD_FIELD_ERROR : return "42S22";
+#endif
+#ifdef ER_WRONG_FIELD_WITH_GROUP
+ case ER_WRONG_FIELD_WITH_GROUP : return "42000";
+#endif
+#ifdef ER_WRONG_GROUP_FIELD
+ case ER_WRONG_GROUP_FIELD : return "42000";
+#endif
+#ifdef ER_WRONG_SUM_SELECT
+ case ER_WRONG_SUM_SELECT : return "42000";
+#endif
+#ifdef ER_WRONG_VALUE_COUNT
+ case ER_WRONG_VALUE_COUNT : return "21S01";
+#endif
+#ifdef ER_TOO_LONG_IDENT
+ case ER_TOO_LONG_IDENT : return "42000";
+#endif
+#ifdef ER_DUP_FIELDNAME
+ case ER_DUP_FIELDNAME : return "42S21";
+#endif
+#ifdef ER_DUP_KEYNAME
+ case ER_DUP_KEYNAME : return "42000";
+#endif
+#ifdef ER_DUP_ENTRY
+ case ER_DUP_ENTRY : return "23000";
+#endif
+#ifdef ER_WRONG_FIELD_SPEC
+ case ER_WRONG_FIELD_SPEC : return "42000";
+#endif
+#ifdef ER_PARSE_ERROR
+ case ER_PARSE_ERROR : return "42000";
+#endif
+#ifdef ER_NONUNIQ_TABLE
+ case ER_NONUNIQ_TABLE : return "42000";
+#endif
+#ifdef ER_INVALID_DEFAULT
+ case ER_INVALID_DEFAULT : return "42000";
+#endif
+#ifdef ER_MULTIPLE_PRI_KEY
+ case ER_MULTIPLE_PRI_KEY : return "42000";
+#endif
+#ifdef ER_TOO_MANY_KEYS
+ case ER_TOO_MANY_KEYS : return "42000";
+#endif
+#ifdef ER_TOO_MANY_KEY_PARTS
+ case ER_TOO_MANY_KEY_PARTS : return "42000";
+#endif
+#ifdef ER_TOO_LONG_KEY
+ case ER_TOO_LONG_KEY : return "42000";
+#endif
+#ifdef ER_KEY_COLUMN_DOES_NOT_EXITS
+ case ER_KEY_COLUMN_DOES_NOT_EXITS : return "42000";
+#endif
+#ifdef ER_BLOB_USED_AS_KEY
+ case ER_BLOB_USED_AS_KEY : return "42000";
+#endif
+#ifdef ER_TOO_BIG_FIELDLENGTH
+ case ER_TOO_BIG_FIELDLENGTH : return "42000";
+#endif
+#ifdef ER_WRONG_AUTO_KEY
+ case ER_WRONG_AUTO_KEY : return "42000";
+#endif
+#ifdef ER_FORCING_CLOSE
+ case ER_FORCING_CLOSE : return "08S01";
+#endif
+#ifdef ER_IPSOCK_ERROR
+ case ER_IPSOCK_ERROR : return "08S01";
+#endif
+#ifdef ER_NO_SUCH_INDEX
+ case ER_NO_SUCH_INDEX : return "42S12";
+#endif
+#ifdef ER_WRONG_FIELD_TERMINATORS
+ case ER_WRONG_FIELD_TERMINATORS : return "42000";
+#endif
+#ifdef ER_BLOBS_AND_NO_TERMINATED
+ case ER_BLOBS_AND_NO_TERMINATED : return "42000";
+#endif
+#ifdef ER_CANT_REMOVE_ALL_FIELDS
+ case ER_CANT_REMOVE_ALL_FIELDS : return "42000";
+#endif
+#ifdef ER_CANT_DROP_FIELD_OR_KEY
+ case ER_CANT_DROP_FIELD_OR_KEY : return "42000";
+#endif
+#ifdef ER_BLOB_CANT_HAVE_DEFAULT
+ case ER_BLOB_CANT_HAVE_DEFAULT : return "42000";
+#endif
+#ifdef ER_WRONG_DB_NAME
+ case ER_WRONG_DB_NAME : return "42000";
+#endif
+#ifdef ER_WRONG_TABLE_NAME
+ case ER_WRONG_TABLE_NAME : return "42000";
+#endif
+#ifdef ER_TOO_BIG_SELECT
+ case ER_TOO_BIG_SELECT : return "42000";
+#endif
+#ifdef ER_UNKNOWN_PROCEDURE
+ case ER_UNKNOWN_PROCEDURE : return "42000";
+#endif
+#ifdef ER_WRONG_PARAMCOUNT_TO_PROCEDURE
+ case ER_WRONG_PARAMCOUNT_TO_PROCEDURE : return "42000";
+#endif
+#ifdef ER_UNKNOWN_TABLE
+ case ER_UNKNOWN_TABLE : return "42S02";
+#endif
+#ifdef ER_FIELD_SPECIFIED_TWICE
+ case ER_FIELD_SPECIFIED_TWICE : return "42000";
+#endif
+#ifdef ER_UNSUPPORTED_EXTENSION
+ case ER_UNSUPPORTED_EXTENSION : return "42000";
+#endif
+#ifdef ER_TABLE_MUST_HAVE_COLUMNS
+ case ER_TABLE_MUST_HAVE_COLUMNS : return "42000";
+#endif
+#ifdef ER_UNKNOWN_CHARACTER_SET
+ case ER_UNKNOWN_CHARACTER_SET : return "42000";
+#endif
+#ifdef ER_TOO_BIG_ROWSIZE
+ case ER_TOO_BIG_ROWSIZE : return "42000";
+#endif
+#ifdef ER_WRONG_OUTER_JOIN
+ case ER_WRONG_OUTER_JOIN : return "42000";
+#endif
+#ifdef ER_NULL_COLUMN_IN_INDEX
+ case ER_NULL_COLUMN_IN_INDEX : return "42000";
+#endif
+#ifdef ER_PASSWORD_ANONYMOUS_USER
+ case ER_PASSWORD_ANONYMOUS_USER : return "42000";
+#endif
+#ifdef ER_PASSWORD_NOT_ALLOWED
+ case ER_PASSWORD_NOT_ALLOWED : return "42000";
+#endif
+#ifdef ER_PASSWORD_NO_MATCH
+ case ER_PASSWORD_NO_MATCH : return "42000";
+#endif
+#ifdef ER_WRONG_VALUE_COUNT_ON_ROW
+ case ER_WRONG_VALUE_COUNT_ON_ROW : return "21S01";
+#endif
+#ifdef ER_INVALID_USE_OF_NULL
+ case ER_INVALID_USE_OF_NULL : return "42000";
+#endif
+#ifdef ER_REGEXP_ERROR
+ case ER_REGEXP_ERROR : return "42000";
+#endif
+#ifdef ER_NONEXISTING_GRANT
+ case ER_NONEXISTING_GRANT : return "42000";
+#endif
+#ifdef ER_TABLEACCESS_DENIED_ERROR
+ case ER_TABLEACCESS_DENIED_ERROR : return "42000";
+#endif
+#ifdef ER_COLUMNACCESS_DENIED_ERROR
+ case ER_COLUMNACCESS_DENIED_ERROR : return "42000";
+#endif
+#ifdef ER_ILLEGAL_GRANT_FOR_TABLE
+ case ER_ILLEGAL_GRANT_FOR_TABLE : return "42000";
+#endif
+#ifdef ER_GRANT_WRONG_HOST_OR_USER
+ case ER_GRANT_WRONG_HOST_OR_USER : return "42000";
+#endif
+#ifdef ER_NO_SUCH_TABLE
+ case ER_NO_SUCH_TABLE : return "42S02";
+#endif
+#ifdef ER_NONEXISTING_TABLE_GRANT
+ case ER_NONEXISTING_TABLE_GRANT : return "42000";
+#endif
+#ifdef ER_NOT_ALLOWED_COMMAND
+ case ER_NOT_ALLOWED_COMMAND : return "42000";
+#endif
+#ifdef ER_SYNTAX_ERROR
+ case ER_SYNTAX_ERROR : return "42000";
+#endif
+#ifdef ER_ABORTING_CONNECTION
+ case ER_ABORTING_CONNECTION : return "08S01";
+#endif
+#ifdef ER_NET_PACKET_TOO_LARGE
+ case ER_NET_PACKET_TOO_LARGE : return "08S01";
+#endif
+#ifdef ER_NET_READ_ERROR_FROM_PIPE
+ case ER_NET_READ_ERROR_FROM_PIPE : return "08S01";
+#endif
+#ifdef ER_NET_FCNTL_ERROR
+ case ER_NET_FCNTL_ERROR : return "08S01";
+#endif
+#ifdef ER_NET_PACKETS_OUT_OF_ORDER
+ case ER_NET_PACKETS_OUT_OF_ORDER : return "08S01";
+#endif
+#ifdef ER_NET_UNCOMPRESS_ERROR
+ case ER_NET_UNCOMPRESS_ERROR : return "08S01";
+#endif
+#ifdef ER_NET_READ_ERROR
+ case ER_NET_READ_ERROR : return "08S01";
+#endif
+#ifdef ER_NET_READ_INTERRUPTED
+ case ER_NET_READ_INTERRUPTED : return "08S01";
+#endif
+#ifdef ER_NET_ERROR_ON_WRITE
+ case ER_NET_ERROR_ON_WRITE : return "08S01";
+#endif
+#ifdef ER_NET_WRITE_INTERRUPTED
+ case ER_NET_WRITE_INTERRUPTED : return "08S01";
+#endif
+#ifdef ER_TOO_LONG_STRING
+ case ER_TOO_LONG_STRING : return "42000";
+#endif
+#ifdef ER_TABLE_CANT_HANDLE_BLOB
+ case ER_TABLE_CANT_HANDLE_BLOB : return "42000";
+#endif
+#ifdef ER_TABLE_CANT_HANDLE_AUTO_INCREMENT
+ case ER_TABLE_CANT_HANDLE_AUTO_INCREMENT : return "42000";
+#endif
+#ifdef ER_WRONG_COLUMN_NAME
+ case ER_WRONG_COLUMN_NAME : return "42000";
+#endif
+#ifdef ER_WRONG_KEY_COLUMN
+ case ER_WRONG_KEY_COLUMN : return "42000";
+#endif
+#ifdef ER_DUP_UNIQUE
+ case ER_DUP_UNIQUE : return "23000";
+#endif
+#ifdef ER_BLOB_KEY_WITHOUT_LENGTH
+ case ER_BLOB_KEY_WITHOUT_LENGTH : return "42000";
+#endif
+#ifdef ER_PRIMARY_CANT_HAVE_NULL
+ case ER_PRIMARY_CANT_HAVE_NULL : return "42000";
+#endif
+#ifdef ER_TOO_MANY_ROWS
+ case ER_TOO_MANY_ROWS : return "42000";
+#endif
+#ifdef ER_REQUIRES_PRIMARY_KEY
+ case ER_REQUIRES_PRIMARY_KEY : return "42000";
+#endif
+#ifdef ER_CHECK_NO_SUCH_TABLE
+ case ER_CHECK_NO_SUCH_TABLE : return "42000";
+#endif
+#ifdef ER_CHECK_NOT_IMPLEMENTED
+ case ER_CHECK_NOT_IMPLEMENTED : return "42000";
+#endif
+#ifdef ER_CANT_DO_THIS_DURING_AN_TRANSACTION
+ case ER_CANT_DO_THIS_DURING_AN_TRANSACTION: return "25000";
+#endif
+#ifdef ER_NEW_ABORTING_CONNECTION
+ case ER_NEW_ABORTING_CONNECTION : return "08S01";
+#endif
+#ifdef ER_MASTER_NET_READ
+ case ER_MASTER_NET_READ : return "08S01";
+#endif
+#ifdef ER_MASTER_NET_WRITE
+ case ER_MASTER_NET_WRITE : return "08S01";
+#endif
+#ifdef ER_TOO_MANY_USER_CONNECTIONS
+ case ER_TOO_MANY_USER_CONNECTIONS : return "42000";
+#endif
+#ifdef ER_READ_ONLY_TRANSACTION
+ case ER_READ_ONLY_TRANSACTION : return "25000";
+#endif
+#ifdef ER_LOCK_DEADLOCK
+ case ER_LOCK_DEADLOCK : return "40001";
+#endif
+#ifdef ER_NO_REFERENCED_ROW
+ case ER_NO_REFERENCED_ROW : return "23000";
+#endif
+#ifdef ER_ROW_IS_REFERENCED
+ case ER_ROW_IS_REFERENCED : return "23000";
+#endif
+#ifdef ER_CONNECT_TO_MASTER
+ case ER_CONNECT_TO_MASTER : return "08S01";
+#endif
+#ifdef ER_USER_LIMIT_REACHED
+ case ER_USER_LIMIT_REACHED : return "42000";
+#endif
+#ifdef ER_NO_DEFAULT
+ case ER_NO_DEFAULT : return "42000";
+#endif
+#ifdef ER_WRONG_VALUE_FOR_VAR
+ case ER_WRONG_VALUE_FOR_VAR : return "42000";
+#endif
+#ifdef ER_WRONG_TYPE_FOR_VAR
+ case ER_WRONG_TYPE_FOR_VAR : return "42000";
+#endif
+#ifdef ER_CANT_USE_OPTION_HERE
+ case ER_CANT_USE_OPTION_HERE : return "42000";
+#endif
+#ifdef ER_NOT_SUPPORTED_YET
+ case ER_NOT_SUPPORTED_YET : return "42000";
+#endif
+#ifdef ER_WRONG_FK_DEF
+ case ER_WRONG_FK_DEF : return "42000";
+#endif
+#ifdef ER_OPERAND_COLUMNS
+ case ER_OPERAND_COLUMNS : return "21000";
+#endif
+#ifdef ER_SUBQUERY_NO_1_ROW
+ case ER_SUBQUERY_NO_1_ROW : return "21000";
+#endif
+#ifdef ER_ILLEGAL_REFERENCE
+ case ER_ILLEGAL_REFERENCE : return "42S22";
+#endif
+#ifdef ER_DERIVED_MUST_HAVE_ALIAS
+ case ER_DERIVED_MUST_HAVE_ALIAS : return "42000";
+#endif
+#ifdef ER_SELECT_REDUCED
+ case ER_SELECT_REDUCED : return "01000";
+#endif
+#ifdef ER_TABLENAME_NOT_ALLOWED_HERE
+ case ER_TABLENAME_NOT_ALLOWED_HERE : return "42000";
+#endif
+#ifdef ER_NOT_SUPPORTED_AUTH_MODE
+ case ER_NOT_SUPPORTED_AUTH_MODE : return "08004";
+#endif
+#ifdef ER_SPATIAL_CANT_HAVE_NULL
+ case ER_SPATIAL_CANT_HAVE_NULL : return "42000";
+#endif
+#ifdef ER_COLLATION_CHARSET_MISMATCH
+ case ER_COLLATION_CHARSET_MISMATCH : return "42000";
+#endif
+#ifdef ER_WARN_TOO_FEW_RECORDS
+ case ER_WARN_TOO_FEW_RECORDS : return "01000";
+#endif
+#ifdef ER_WARN_TOO_MANY_RECORDS
+ case ER_WARN_TOO_MANY_RECORDS : return "01000";
+#endif
+#ifdef ER_WARN_NULL_TO_NOTNULL
+ case ER_WARN_NULL_TO_NOTNULL : return "01000";
+#endif
+#ifdef ER_WARN_DATA_OUT_OF_RANGE
+ case ER_WARN_DATA_OUT_OF_RANGE : return "01000";
+#endif
+#ifdef ER_WARN_DATA_TRUNCATED
+ case ER_WARN_DATA_TRUNCATED : return "01000";
+#endif
+#ifdef ER_WRONG_NAME_FOR_INDEX
+ case ER_WRONG_NAME_FOR_INDEX : return "42000";
+#endif
+#ifdef ER_WRONG_NAME_FOR_CATALOG
+ case ER_WRONG_NAME_FOR_CATALOG : return "42000";
+#endif
+#ifdef ER_UNKNOWN_STORAGE_ENGINE
+ case ER_UNKNOWN_STORAGE_ENGINE : return "42000";
+#endif
diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt
new file mode 100644
index 000000000..609e3dce5
--- /dev/null
+++ b/ext/pdo_mysql/tests/bug_33689.phpt
@@ -0,0 +1,50 @@
+--TEST--
+PDO MySQL Bug #33689
+--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';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+$db->exec('CREATE TABLE test (bar INT NOT NULL)');
+$db->exec('INSERT INTO test VALUES(1)');
+
+var_dump($db->query('SELECT * from test'));
+foreach ($db->query('SELECT * from test') as $row) {
+ print_r($row);
+}
+
+$stmt = $db->prepare('SELECT * from test');
+print_r($stmt->getColumnMeta(0));
+$stmt->execute();
+print_r($stmt->getColumnMeta(0));
+
+--EXPECTF--
+object(PDOStatement)#%d (1) {
+ ["queryString"]=>
+ string(18) "SELECT * from test"
+}
+Array
+(
+ [bar] => 1
+ [0] => 1
+)
+Array
+(
+ [native_type] => LONG
+ [flags] => Array
+ (
+ [0] => not_null
+ )
+
+ [name] => bar
+ [len] => 11
+ [precision] => 0
+ [pdo_type] => 2
+)
diff --git a/ext/pdo_mysql/tests/common.phpt b/ext/pdo_mysql/tests/common.phpt
new file mode 100644
index 000000000..8179454cf
--- /dev/null
+++ b/ext/pdo_mysql/tests/common.phpt
@@ -0,0 +1,28 @@
+--TEST--
+MySQL
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) print 'skip not loaded';
+?>
+--REDIRECTTEST--
+# magic auto-configuration
+
+$config = array(
+ 'TESTS' => 'ext/pdo/tests'
+);
+
+if (false !== getenv('PDO_MYSQL_TEST_DSN')) {
+ # user set them from their shell
+ $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN');
+ $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER');
+ $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS');
+ if (false !== getenv('PDO_MYSQL_TEST_ATTR')) {
+ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR');
+ }
+} else {
+ $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test';
+ $config['ENV']['PDOTEST_USER'] = 'root';
+ $config['ENV']['PDOTEST_PASS'] = '';
+}
+
+return $config;
diff --git a/ext/pdo_mysql/tests/config.inc b/ext/pdo_mysql/tests/config.inc
new file mode 100644
index 000000000..855f89bc1
--- /dev/null
+++ b/ext/pdo_mysql/tests/config.inc
@@ -0,0 +1,19 @@
+<?php
+
+if (false !== getenv('PDO_MYSQL_TEST_DSN')) {
+ # user set them from their shell
+ $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN');
+ $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER');
+ $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS');
+ if (false !== getenv('PDO_MYSQL_TEST_ATTR')) {
+ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR');
+ }
+} else {
+ $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test';
+ $config['ENV']['PDOTEST_USER'] = 'root';
+ $config['ENV']['PDOTEST_PASS'] = '';
+}
+
+foreach ($config['ENV'] as $k => $v) {
+ putenv("$k=$v");
+}
diff --git a/ext/pdo_mysql/tests/pecl_bug_5200.phpt b/ext/pdo_mysql/tests/pecl_bug_5200.phpt
new file mode 100644
index 000000000..2dffd1141
--- /dev/null
+++ b/ext/pdo_mysql/tests/pecl_bug_5200.phpt
@@ -0,0 +1,30 @@
+--TEST--
+PDO MySQL PECL Bug #5200
+--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';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt');
+
+$db->exec("CREATE TABLE test (bar INT NOT NULL, phase enum('please_select', 'I', 'II', 'IIa', 'IIb', 'III', 'IV'))");
+
+foreach ($db->query('DESCRIBE test phase')->fetchAll(PDO::FETCH_ASSOC) as $row) {
+ print_r($row);
+}
+
+--EXPECT--
+Array
+(
+ [field] => phase
+ [type] => enum('please_select','I','II','IIa','IIb','III','IV')
+ [null] => YES
+ [key] =>
+ [default] =>
+ [extra] =>
+)
diff --git a/ext/pdo_mysql/tests/pecl_bug_5780.phpt b/ext/pdo_mysql/tests/pecl_bug_5780.phpt
new file mode 100644
index 000000000..643597c01
--- /dev/null
+++ b/ext/pdo_mysql/tests/pecl_bug_5780.phpt
@@ -0,0 +1,41 @@
+--TEST--
+PDO MySQL PECL Bug #5780
+--SKIPIF--
+<?php # vim:ft=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';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt');
+
+$db->exec("CREATE TABLE test (login varchar(32) NOT NULL, data varchar(64) NOT NULL)");
+$db->exec("CREATE TABLE test2 (login varchar(32) NOT NULL, password varchar(64) NOT NULL)");
+$db->exec("INSERT INTO test2 (login, password) VALUES ('testing', 'testing')");
+$db->exec("INSERT INTO test2 (login, password) VALUES ('test2', 'testpw2')");
+
+$logstmt = $db->prepare('INSERT INTO test (login, data) VALUES (:var1, :var2)');
+$authstmt = $db->prepare('SELECT * FROM test2 WHERE login = :varlog AND password = :varpass');
+$authstmt->execute(array(':varlog' => 'testing', ':varpass' => 'testing'));
+var_dump($authstmt->fetch(PDO::FETCH_NUM));
+@var_dump($logstmt->execute(array(':var1' => 'test1', ':var2' => 'test2')));
+$info = $logstmt->errorInfo();
+unset($info[2]);
+var_dump($info);
+--EXPECT--
+array(2) {
+ [0]=>
+ string(7) "testing"
+ [1]=>
+ string(7) "testing"
+}
+bool(false)
+array(2) {
+ [0]=>
+ string(5) "HY000"
+ [1]=>
+ int(2014)
+}
diff --git a/ext/pdo_mysql/tests/pecl_bug_5802.phpt b/ext/pdo_mysql/tests/pecl_bug_5802.phpt
new file mode 100644
index 000000000..70bd46163
--- /dev/null
+++ b/ext/pdo_mysql/tests/pecl_bug_5802.phpt
@@ -0,0 +1,52 @@
+--TEST--
+PDO MySQL PECL Bug #5802
+--SKIPIF--
+<?php # vim:ft=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';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__). '/common.phpt');
+
+$db->exec('create table test ( bar char(3) NULL )');
+$stmt = $db->prepare('insert into test (bar) values(:bar)') or var_dump($db->errorInfo());
+
+$bar = 'foo';
+$stmt->bindParam(':bar', $bar);
+$stmt->execute() or var_dump($stmt->errorInfo());
+
+$bar = null;
+$stmt->bindParam(':bar', $bar);
+$stmt->execute() or var_dump($stmt->errorInfo());
+
+$bar = 'qaz';
+$stmt->bindParam(':bar', $bar);
+$stmt->execute() or var_dump($stmt->errorInfo());
+
+$stmt = $db->prepare('select * from test') or var_dump($db->errorInfo());
+
+if($stmt) $stmt->execute();
+if($stmt) var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
+
+--EXPECT--
+array(3) {
+ [0]=>
+ array(1) {
+ ["bar"]=>
+ string(3) "foo"
+ }
+ [1]=>
+ array(1) {
+ ["bar"]=>
+ NULL
+ }
+ [2]=>
+ array(1) {
+ ["bar"]=>
+ string(3) "qaz"
+ }
+}
diff --git a/ext/pdo_mysql/tests/show_tables.phpt b/ext/pdo_mysql/tests/show_tables.phpt
new file mode 100644
index 000000000..90b07db32
--- /dev/null
+++ b/ext/pdo_mysql/tests/show_tables.phpt
@@ -0,0 +1,20 @@
+--TEST--
+PDO MySQL SHOW TABLES
+--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';
+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('SHOW TABLES'));
+--EXPECT--
+PDOStatement Object
+(
+ [queryString] => SHOW TABLES
+)
diff --git a/ext/pdo_oci/CREDITS b/ext/pdo_oci/CREDITS
new file mode 100755
index 000000000..63e863a22
--- /dev/null
+++ b/ext/pdo_oci/CREDITS
@@ -0,0 +1,2 @@
+Oracle (OCI) driver for PDO
+Wez Furlong
diff --git a/ext/pdo_oci/EXPERIMENTAL b/ext/pdo_oci/EXPERIMENTAL
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ext/pdo_oci/EXPERIMENTAL
diff --git a/ext/pdo_oci/config.m4 b/ext/pdo_oci/config.m4
new file mode 100755
index 000000000..23780f96c
--- /dev/null
+++ b/ext/pdo_oci/config.m4
@@ -0,0 +1,209 @@
+dnl $Id: config.m4,v 1.14.2.1 2005/09/24 23:23:24 sniper Exp $
+
+if test "$PHP_PDO" != "no"; then
+
+AC_DEFUN([AC_PDO_OCI_VERSION],[
+ AC_MSG_CHECKING([Oracle version])
+ if test -s "$PDO_OCI_DIR/orainst/unix.rgs"; then
+ PDO_OCI_VERSION=`grep '"ocommon"' $PDO_OCI_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
+ test -z "$PDO_OCI_VERSION" && PDO_OCI_VERSION=7.3
+ elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
+ PDO_OCI_VERSION=10.1
+ elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
+ PDO_OCI_VERSION=9.0
+ elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
+ PDO_OCI_VERSION=8.1
+ elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then
+ PDO_OCI_VERSION=8.0
+ elif test -f $PDO_OCI_DIR/lib/libclntsh.a; then
+ if test -f $PDO_OCI_DIR/lib/libcore4.a; then
+ PDO_OCI_VERSION=8.0
+ else
+ PDO_OCI_VERSION=8.1
+ fi
+ else
+ AC_MSG_ERROR(Oracle-OCI needed libraries not found under $PDO_OCI_DIR)
+ fi
+ AC_MSG_RESULT($PDO_OCI_VERSION)
+])
+
+PHP_ARG_WITH(pdo-oci, Oracle OCI support for PDO,
+[ --with-pdo-oci[=DIR] PDO: Oracle-OCI support. Default DIR is ORACLE_HOME.
+ You may also use --with-pdo-oci=instantclient,prefix,version to use
+ the InstantClient SDK. For Linux with 10.1.0.3 rpms (for example) use:
+ --with-pdo-oci=instantclient,/usr,10.1.0.3])
+
+if test "$PHP_PDO_OCI" != "no"; then
+ AC_MSG_CHECKING([Oracle Install-Dir])
+ if test "$PHP_PDO_OCI" = "yes" -o -z "$PHP_PDO_OCI"; then
+ PDO_OCI_DIR=$ORACLE_HOME
+ else
+ PDO_OCI_DIR=$PHP_PDO_OCI
+ fi
+ AC_MSG_RESULT($PDO_OCI_DIR :$PHP_PDO_OCI:)
+
+ AC_MSG_CHECKING([if that is sane])
+ if test -z "$PDO_OCI_DIR"; then
+ AC_MSG_ERROR([
+You need to tell me where to find your oracle SDK, or set ORACLE_HOME.
+])
+ else
+ AC_MSG_RESULT([yes])
+ fi
+
+ if test "instantclient" = "`echo $PDO_OCI_DIR | cut -d, -f1`" ; then
+ PDO_OCI_IC_PREFIX="`echo $PDO_OCI_DIR | cut -d, -f2`"
+ PDO_OCI_IC_VERS="`echo $PDO_OCI_DIR | cut -d, -f3`"
+ AC_MSG_CHECKING([for oci.h])
+ if test -f $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client/oci.h ; then
+ PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client)
+ AC_MSG_RESULT($PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client)
+ elif test -f $PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include/oci.h ; then
+ PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include)
+ AC_MSG_RESULT($PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include)
+ else
+ AC_MSG_ERROR([I'm too dumb to figure out where the include dir is in your instant client install])
+ fi
+ PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib"
+ PDO_OCI_VERSION="`echo $PDO_OCI_IC_VERS | cut -d. -f1-2`"
+ else
+ if test -d "$PDO_OCI_DIR/rdbms/public"; then
+ PHP_ADD_INCLUDE($PDO_OCI_DIR/rdbms/public)
+ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/public"
+ fi
+ if test -d "$PDO_OCI_DIR/rdbms/demo"; then
+ PHP_ADD_INCLUDE($PDO_OCI_DIR/rdbms/demo)
+ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/demo"
+ fi
+ if test -d "$PDO_OCI_DIR/network/public"; then
+ PHP_ADD_INCLUDE($PDO_OCI_DIR/network/public)
+ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/network/public"
+ fi
+ if test -d "$PDO_OCI_DIR/plsql/public"; then
+ PHP_ADD_INCLUDE($PDO_OCI_DIR/plsql/public)
+ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/plsql/public"
+ fi
+ if test -d "$PDO_OCI_DIR/include"; then
+ PHP_ADD_INCLUDE($PDO_OCI_DIR/include)
+ PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/include"
+ fi
+
+ if test -f "$PDO_OCI_DIR/lib/sysliblist"; then
+ PHP_EVAL_LIBLINE(`cat $PDO_OCI_DIR/lib/sysliblist`, PDO_OCI_SYSLIB)
+ elif test -f "$PDO_OCI_DIR/rdbms/lib/sysliblist"; then
+ PHP_EVAL_LIBLINE(`cat $PDO_OCI_DIR/rdbms/lib/sysliblist`, PDO_OCI_SYSLIB)
+ fi
+ PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib"
+ AC_PDO_OCI_VERSION($PDO_OCI_DIR)
+ fi
+
+ case $PDO_OCI_VERSION in
+ 8.0)
+ PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, "", PDO_OCI_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(core4, "", PDO_OCI_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(psa, "", PDO_OCI_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(clntsh, $PDO_OCI_LIB_DIR, PDO_OCI_SHARED_LIBADD)
+ ;;
+
+ 8.1)
+ PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
+ ;;
+
+ 9.0)
+ PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
+ ;;
+
+ 10.1)
+ PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
+ ;;
+ 10.2)
+ PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
+ ;;
+ *)
+ AC_MSG_ERROR(Unsupported Oracle version! $PDO_OCI_VERSION)
+ ;;
+ esac
+
+ PHP_ADD_LIBPATH($PDO_OCI_LIB_DIR, PDO_OCI_SHARED_LIBADD)
+
+ PHP_CHECK_LIBRARY(clntsh, OCIEnvCreate,
+ [
+ AC_DEFINE(HAVE_OCIENVCREATE,1,[ ])
+ ], [], [
+ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD
+ ])
+
+ PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate,
+ [
+ AC_DEFINE(HAVE_OCIENVNLSCREATE,1,[ ])
+ ], [], [
+ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD
+ ])
+
+ dnl
+ dnl Check if we need to add -locijdbc8
+ dnl
+ PHP_CHECK_LIBRARY(clntsh, OCILobIsTemporary,
+ [
+ AC_DEFINE(HAVE_OCILOBISTEMPORARY,1,[ ])
+ ], [
+ PHP_CHECK_LIBRARY(ocijdbc8, OCILobIsTemporary,
+ [
+ PHP_ADD_LIBRARY(ocijdbc8, 1, PDO_OCI_SHARED_LIBADD)
+ AC_DEFINE(HAVE_OCILOBISTEMPORARY,1,[ ])
+ ], [], [
+ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD
+ ])
+ ], [
+ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD
+ ])
+
+ dnl
+ dnl Check if we have collections
+ dnl
+ PHP_CHECK_LIBRARY(clntsh, OCICollAssign,
+ [
+ AC_DEFINE(HAVE_OCICOLLASSIGN,1,[ ])
+ ], [], [
+ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD
+ ])
+
+ dnl Scrollable cursors?
+ PHP_CHECK_LIBRARY(clntsh, OCIStmtFetch2,
+ [
+ AC_DEFINE(HAVE_OCISTMTFETCH2,1,[ ])
+ ], [], [
+ -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD
+ ])
+
+ ifdef([PHP_CHECK_PDO_INCLUDES],
+ [
+ PHP_CHECK_PDO_INCLUDES
+ ],[
+ AC_MSG_CHECKING([for PDO includes])
+ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$prefix/include/php/ext
+ else
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
+ fi
+ AC_MSG_RESULT($pdo_inc_path)
+ ])
+
+ PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_inc_path)
+
+ PHP_SUBST_OLD(PDO_OCI_SHARED_LIBADD)
+ PHP_SUBST_OLD(PDO_OCI_DIR)
+ PHP_SUBST_OLD(PDO_OCI_VERSION)
+
+ ifdef([PHP_ADD_EXTENSION_DEP],
+ [
+ PHP_ADD_EXTENSION_DEP(pdo_oci, pdo)
+ ])
+
+fi
+
+fi
diff --git a/ext/pdo_oci/config.w32 b/ext/pdo_oci/config.w32
new file mode 100755
index 000000000..d58d2e961
--- /dev/null
+++ b/ext/pdo_oci/config.w32
@@ -0,0 +1,86 @@
+// $Id: config.w32,v 1.6 2005/01/20 15:54:35 edink Exp $
+// vim:ft=javascript
+
+ARG_WITH("pdo-oci", "Oracle OCI support for PDO", "no");
+
+if (PHP_PDO_OCI != "no") {
+
+ pdo_oci_dirs = new Array(
+ PHP_PDO_OCI,
+ PHP_PDO_OCI + "\\oci",
+ PHP_PHP_BUILD + "\\instantclient10_*\\sdk",
+ PHP_PHP_BUILD + "\\oci92"
+ );
+
+ pdo_oci_lib_paths = "";
+ pdo_oci_inc_paths = "";
+
+ // find the oracle install
+ for (i = 0; i < pdo_oci_dirs.length; i++) {
+ pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib;";
+ pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib\\msvc;";
+ pdo_oci_inc_paths += pdo_oci_dirs[i] + "\\include;";
+ }
+
+ pdo_oci_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient;"
+ pdo_oci_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient;";
+
+ pdo_oci_header = CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_PDO_OCI", pdo_oci_inc_paths, null, null, true);
+
+ if (pdo_oci_header && CHECK_LIB("oci.lib", "pdo_oci", pdo_oci_lib_paths)) {
+
+ pdo_oci_inc_dir = FSO.GetParentFolderName(pdo_oci_header);
+
+ EXTENSION('pdo_oci', 'pdo_oci.c oci_driver.c oci_statement.c');
+ ADD_FLAG('CFLAGS_PDO_OCI', "/I ..\\pecl");
+
+ /* probe for some functions not present in older versions */
+ pdo_oci_inc_dir = FSO.GetFolder(pdo_oci_header);
+ CHECK_FUNC_IN_HEADER('oci.h', 'OCIEnvCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI');
+ CHECK_FUNC_IN_HEADER('ociap.h', 'OCIStmtFetch2', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI');
+ CHECK_FUNC_IN_HEADER('ociap.h', 'OCIEnvNlsCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI');
+
+ } else {
+ WARNING("pdo-oci not enabled; libraries and headers not found");
+ }
+ ADD_EXTENSION_DEP('pdo_oci', 'pdo');
+}
+
+ARG_WITH("pdo-oci8", "Oracle OCI 8 (only) support for PDO", "no");
+
+if (PHP_PDO_OCI8 != "no") {
+ pdo_oci_dirs = new Array(
+ PHP_PDO_OCI,
+ PHP_PHP_BUILD + "\\oci805"
+ );
+
+ pdo_oci_lib_paths = "";
+ pdo_oci_inc_paths = "";
+
+ // find the oracle install
+ for (i = 0; i < pdo_oci_dirs.length; i++) {
+ pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib;";
+ pdo_oci_lib_paths += pdo_oci_dirs[i] + "\\lib\\msvc;";
+ pdo_oci_inc_paths += pdo_oci_dirs[i] + "\\include;";
+ }
+
+ pdo_oci_header = CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_PDO_OCI8", pdo_oci_inc_paths, null, null, true);
+
+ if (pdo_oci_header && CHECK_LIB("oci.lib", "pdo_oci8", pdo_oci_lib_paths)) {
+ pdo_oci_inc_dir = FSO.GetParentFolderName(pdo_oci_header);
+
+ EXTENSION('pdo_oci8', 'pdo_oci.c oci_driver.c oci_statement.c', null, null, null, "ext\\pdo_oci8");
+ ADD_FLAG('CFLAGS_PDO_OCI8', "/I ..\\pecl");
+
+ /* probe for some functions not present in older versions */
+ pdo_oci_inc_dir = FSO.GetFolder(pdo_oci_header);
+ CHECK_FUNC_IN_HEADER('oci.h', 'OCIEnvCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI8');
+ CHECK_FUNC_IN_HEADER('ociap.h', 'OCIStmtFetch2', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI8');
+ CHECK_FUNC_IN_HEADER('ociap.h', 'OCIEnvNlsCreate', pdo_oci_inc_dir, 'CFLAGS_PDO_OCI8');
+
+ } else {
+ WARNING("pdo-oci8 not enabled; libraries and headers not found");
+ }
+ ADD_EXTENSION_DEP('pdo_oci8', 'pdo');
+}
+
diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
new file mode 100755
index 000000000..30d068c87
--- /dev/null
+++ b/ext/pdo_oci/oci_driver.c
@@ -0,0 +1,558 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: oci_driver.c,v 1.24.2.2 2005/09/11 01:42:38 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_oci.h"
+#include "php_pdo_oci_int.h"
+#include "Zend/zend_exceptions.h"
+
+static int pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+ pdo_oci_error_info *einfo;
+
+ einfo = &H->einfo;
+
+ if (stmt) {
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+
+ if (S->einfo.errmsg) {
+ einfo = &S->einfo;
+ }
+ }
+
+ if (einfo->errcode) {
+ add_next_index_long(info, einfo->errcode);
+ add_next_index_string(info, einfo->errmsg, 1);
+ }
+
+ return 1;
+}
+/* }}} */
+
+ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, const char *file, int line TSRMLS_DC) /* {{{ */
+{
+ text errbuf[1024] = "<<Unknown>>";
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+ pdo_oci_error_info *einfo;
+ pdo_oci_stmt *S = NULL;
+ pdo_error_type *pdo_err = &dbh->error_code;
+
+ if (stmt) {
+ S = (pdo_oci_stmt*)stmt->driver_data;
+ einfo = &S->einfo;
+ pdo_err = &stmt->error_code;
+ if (einfo->errmsg) {
+ efree(einfo->errmsg);
+ }
+ }
+ else {
+ einfo = &H->einfo;
+ if (einfo->errmsg) {
+ pefree(einfo->errmsg, dbh->is_persistent);
+ }
+ }
+
+ einfo->errmsg = NULL;
+ einfo->errcode = 0;
+ einfo->file = file;
+ einfo->line = line;
+
+ switch (status) {
+ case OCI_SUCCESS:
+ strcpy(*pdo_err, "00000");
+ break;
+ case OCI_ERROR:
+ OCIErrorGet(err, (ub4)1, NULL, &einfo->errcode, errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
+ spprintf(&einfo->errmsg, 0, "%s: %s (%s:%d)", what, errbuf, file, line);
+ break;
+ case OCI_SUCCESS_WITH_INFO:
+ OCIErrorGet(err, (ub4)1, NULL, &einfo->errcode, errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
+ spprintf(&einfo->errmsg, 0, "%s: OCI_SUCCESS_WITH_INFO: %s (%s:%d)", what, errbuf, file, line);
+ break;
+ case OCI_NEED_DATA:
+ spprintf(&einfo->errmsg, 0, "%s: OCI_NEED_DATA (%s:%d)", what, file, line);
+ break;
+ case OCI_NO_DATA:
+ spprintf(&einfo->errmsg, 0, "%s: OCI_NO_DATA (%s:%d)", what, file, line);
+ break;
+ case OCI_INVALID_HANDLE:
+ spprintf(&einfo->errmsg, 0, "%s: OCI_INVALID_HANDLE (%s:%d)", what, file, line);
+ break;
+ case OCI_STILL_EXECUTING:
+ spprintf(&einfo->errmsg, 0, "%s: OCI_STILL_EXECUTING (%s:%d)", what, file, line);
+ break;
+ case OCI_CONTINUE:
+ spprintf(&einfo->errmsg, 0, "%s: OCI_CONTINUE (%s:%d)", what, file, line);
+ break;
+ }
+
+ if (einfo->errcode) {
+ switch (einfo->errcode) {
+ case 1013: /* user requested cancel of current operation */
+ zend_bailout();
+ break;
+
+#if 0
+ case 955: /* ORA-00955: name is already used by an existing object */
+ *pdo_err = PDO_ERR_ALREADY_EXISTS;
+ break;
+#endif
+
+ case 12154: /* ORA-12154: TNS:could not resolve service name */
+ strcpy(*pdo_err, "42S02");
+ break;
+
+ case 22: /* ORA-00022: invalid session id */
+ case 1012: /* ORA-01012: */
+ case 3113: /* ORA-03133: end of file on communication channel */
+ case 604:
+ case 1041:
+ /* consider the connection closed */
+ dbh->is_closed = 1;
+ H->attached = 0;
+ strcpy(*pdo_err, "01002"); /* FIXME */
+ break;
+
+ default:
+ strcpy(*pdo_err, "HY000");
+ }
+ }
+
+ if (stmt) {
+ /* always propogate the error code back up to the dbh,
+ * so that we can catch the error information when execute
+ * is called via query. See Bug #33707 */
+ if (H->einfo.errmsg) {
+ efree(H->einfo.errmsg);
+ }
+ H->einfo = *einfo;
+ H->einfo.errmsg = einfo->errmsg ? estrdup(einfo->errmsg) : NULL;
+ strcpy(dbh->error_code, stmt->error_code);
+ }
+
+ /* little mini hack so that we can use this code from the dbh ctor */
+ if (!dbh->methods) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg);
+ }
+
+ return einfo->errcode;
+}
+/* }}} */
+
+static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+
+ if (H->svc) {
+ /* rollback any outstanding work */
+ OCITransRollback(H->svc, H->err, 0);
+ }
+
+ if (H->session) {
+ OCIHandleFree(H->session, OCI_HTYPE_SESSION);
+ H->session = NULL;
+ }
+
+ if (H->svc) {
+ OCIHandleFree(H->svc, OCI_HTYPE_SVCCTX);
+ H->svc = NULL;
+ }
+
+ if (H->server && H->attached) {
+ H->last_err = OCIServerDetach(H->server, H->err, OCI_DEFAULT);
+ if (H->last_err) {
+ oci_drv_error("OCIServerDetach");
+ }
+ H->attached = 0;
+ }
+
+ if (H->server) {
+ OCIHandleFree(H->server, OCI_HTYPE_SERVER);
+ H->server = NULL;
+ }
+
+ OCIHandleFree(H->err, OCI_HTYPE_ERROR);
+ H->err = NULL;
+
+ if (H->charset && H->env) {
+ OCIHandleFree(H->env, OCI_HTYPE_ENV);
+ H->env = NULL;
+ }
+
+ if (H->einfo.errmsg) {
+ pefree(H->einfo.errmsg, dbh->is_persistent);
+ H->einfo.errmsg = NULL;
+ }
+
+ pefree(H, dbh->is_persistent);
+
+ return 0;
+}
+/* }}} */
+
+static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+ pdo_oci_stmt *S = ecalloc(1, sizeof(*S));
+ ub4 prefetch;
+ char *nsql = NULL;
+ int nsql_len = 0;
+ int ret;
+
+#if HAVE_OCISTMTFETCH2
+ S->exec_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR,
+ PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL ?
+ OCI_STMT_SCROLLABLE_READONLY : OCI_DEFAULT;
+#else
+ S->exec_type = OCI_DEFAULT;
+#endif
+
+ S->H = H;
+ stmt->supports_placeholders = PDO_PLACEHOLDER_NAMED;
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+
+ if (ret == 1) {
+ /* query was re-written */
+ sql = nsql;
+ sql_len = nsql_len;
+ } else if (ret == -1) {
+ /* couldn't grok it */
+ strcpy(dbh->error_code, stmt->error_code);
+ efree(S);
+ return 0;
+ }
+
+ /* create an OCI statement handle */
+ OCIHandleAlloc(H->env, (dvoid*)&S->stmt, OCI_HTYPE_STMT, 0, NULL);
+
+ /* and our own private error handle */
+ OCIHandleAlloc(H->env, (dvoid*)&S->err, OCI_HTYPE_ERROR, 0, NULL);
+
+ if (sql_len) {
+ H->last_err = OCIStmtPrepare(S->stmt, H->err, (text*)sql, sql_len, OCI_NTV_SYNTAX, OCI_DEFAULT);
+ if (nsql) {
+ efree(nsql);
+ nsql = NULL;
+ }
+ if (H->last_err) {
+ H->last_err = oci_drv_error("OCIStmtPrepare");
+ OCIHandleFree(S->stmt, OCI_HTYPE_STMT);
+ OCIHandleFree(S->err, OCI_HTYPE_ERROR);
+ efree(S);
+ return 0;
+ }
+
+ }
+
+ prefetch = 1024 * pdo_attr_lval(driver_options, PDO_ATTR_PREFETCH, 100 TSRMLS_CC);
+ if (prefetch) {
+ H->last_err = OCIAttrSet(S->stmt, OCI_HTYPE_STMT, &prefetch, 0,
+ OCI_ATTR_PREFETCH_MEMORY, H->err);
+ if (!H->last_err) {
+ prefetch /= 1024;
+ H->last_err = OCIAttrSet(S->stmt, OCI_HTYPE_STMT, &prefetch, 0,
+ OCI_ATTR_PREFETCH_ROWS, H->err);
+ }
+ }
+
+ stmt->driver_data = S;
+ stmt->methods = &oci_stmt_methods;
+ if (nsql) {
+ efree(nsql);
+ nsql = NULL;
+ }
+
+ return 1;
+}
+/* }}} */
+
+static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+ OCIStmt *stmt;
+ ub2 stmt_type;
+ ub4 rowcount;
+ int ret = -1;
+
+ OCIHandleAlloc(H->env, (dvoid*)&stmt, OCI_HTYPE_STMT, 0, NULL);
+
+ H->last_err = OCIStmtPrepare(stmt, H->err, (text*)sql, sql_len, OCI_NTV_SYNTAX, OCI_DEFAULT);
+ if (H->last_err) {
+ H->last_err = oci_drv_error("OCIStmtPrepare");
+ OCIHandleFree(stmt, OCI_HTYPE_STMT);
+ return -1;
+ }
+
+ H->last_err = OCIAttrGet(stmt, OCI_HTYPE_STMT, &stmt_type, 0, OCI_ATTR_STMT_TYPE, H->err);
+
+ if (stmt_type == OCI_STMT_SELECT) {
+ /* invalid usage; cancel it */
+ OCIHandleFree(stmt, OCI_HTYPE_STMT);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "issuing a SELECT query here is invalid");
+ return -1;
+ }
+
+ /* now we are good to go */
+ H->last_err = OCIStmtExecute(H->svc, stmt, H->err, 1, 0, NULL, NULL,
+ (dbh->auto_commit && !dbh->in_txn) ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT);
+
+ if (H->last_err) {
+ H->last_err = oci_drv_error("OCIStmtExecute");
+ } else {
+ /* return the number of affected rows */
+ H->last_err = OCIAttrGet(stmt, OCI_HTYPE_STMT, &rowcount, 0, OCI_ATTR_ROW_COUNT, H->err);
+ ret = rowcount;
+ }
+
+ OCIHandleFree(stmt, OCI_HTYPE_STMT);
+
+ return ret;
+}
+/* }}} */
+
+static int oci_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+
+ return 0;
+}
+/* }}} */
+
+static int oci_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ /* with Oracle, there is nothing special to be done */
+ return 1;
+}
+/* }}} */
+
+static int oci_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+
+ H->last_err = OCITransCommit(H->svc, H->err, 0);
+
+ if (H->last_err) {
+ H->last_err = oci_drv_error("OCITransCommit");
+ return 0;
+ }
+ return 1;
+}
+/* }}} */
+
+static int oci_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+
+ H->last_err = OCITransRollback(H->svc, H->err, 0);
+
+ if (H->last_err) {
+ H->last_err = oci_drv_error("OCITransRollback");
+ return 0;
+ }
+ return 1;
+}
+/* }}} */
+
+static int oci_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+
+ if (attr == PDO_ATTR_AUTOCOMMIT) {
+ if (dbh->in_txn) {
+ /* Assume they want to commit whatever is outstanding */
+ H->last_err = OCITransCommit(H->svc, H->err, 0);
+
+ if (H->last_err) {
+ H->last_err = oci_drv_error("OCITransCommit");
+ return 0;
+ }
+ dbh->in_txn = 0;
+ }
+
+ convert_to_long(val);
+
+ dbh->auto_commit = Z_LVAL_P(val);
+ return 1;
+ } else {
+ return 0;
+ }
+
+}
+/* }}} */
+
+static struct pdo_dbh_methods oci_methods = {
+ oci_handle_closer,
+ oci_handle_preparer,
+ oci_handle_doer,
+ oci_handle_quoter,
+ oci_handle_begin,
+ oci_handle_commit,
+ oci_handle_rollback,
+ oci_handle_set_attribute,
+ NULL,
+ pdo_oci_fetch_error_func,
+ NULL, /* get_attr */
+ NULL, /* check_liveness */
+ NULL /* get_driver_methods */
+};
+
+static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_db_handle *H;
+ int i, ret = 0;
+ struct pdo_data_src_parser vars[] = {
+ { "charset", NULL, 0 },
+ { "dbname", "", 0 }
+ };
+
+ php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 2);
+
+ H = pecalloc(1, sizeof(*H), dbh->is_persistent);
+ dbh->driver_data = H;
+
+ /* allocate an environment */
+#if HAVE_OCIENVNLSCREATE
+ if (vars[0].optval) {
+ H->charset = OCINlsCharSetNameToId(pdo_oci_Env, vars[0].optval);
+ if (H->charset) {
+ OCIEnvNlsCreate(&H->env, PDO_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, H->charset, H->charset);
+ }
+ }
+#endif
+ if (H->env == NULL) {
+ /* use the global environment */
+ H->env = pdo_oci_Env;
+ }
+
+ /* something to hold errors */
+ OCIHandleAlloc(H->env, (dvoid **)&H->err, OCI_HTYPE_ERROR, 0, NULL);
+
+ /* handle for the server */
+ OCIHandleAlloc(H->env, (dvoid **)&H->server, OCI_HTYPE_SERVER, 0, NULL);
+
+ H->last_err = OCIServerAttach(H->server, H->err, (text*)vars[1].optval,
+ strlen(vars[1].optval), OCI_DEFAULT);
+
+ if (H->last_err) {
+ oci_drv_error("pdo_oci_handle_factory");
+ goto cleanup;
+ }
+
+ H->attached = 1;
+
+ /* create a service context */
+ H->last_err = OCIHandleAlloc(H->env, (dvoid**)&H->svc, OCI_HTYPE_SVCCTX, 0, NULL);
+ if (H->last_err) {
+ oci_drv_error("OCIHandleAlloc: OCI_HTYPE_SVCCTX");
+ goto cleanup;
+ }
+
+ H->last_err = OCIHandleAlloc(H->env, (dvoid**)&H->session, OCI_HTYPE_SESSION, 0, NULL);
+ if (H->last_err) {
+ oci_drv_error("OCIHandleAlloc: OCI_HTYPE_SESSION");
+ goto cleanup;
+ }
+
+ /* set server handle into service handle */
+ H->last_err = OCIAttrSet(H->svc, OCI_HTYPE_SVCCTX, H->server, 0, OCI_ATTR_SERVER, H->err);
+ if (H->last_err) {
+ oci_drv_error("OCIAttrSet: OCI_ATTR_SERVER");
+ goto cleanup;
+ }
+
+ /* username */
+ if (dbh->username) {
+ H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION,
+ dbh->username, strlen(dbh->username),
+ OCI_ATTR_USERNAME, H->err);
+ if (H->last_err) {
+ oci_drv_error("OCIAttrSet: OCI_ATTR_USERNAME");
+ goto cleanup;
+ }
+ }
+
+ /* password */
+ if (dbh->password) {
+ H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION,
+ dbh->password, strlen(dbh->password),
+ OCI_ATTR_PASSWORD, H->err);
+ if (H->last_err) {
+ oci_drv_error("OCIAttrSet: OCI_ATTR_PASSWORD");
+ goto cleanup;
+ }
+ }
+
+ /* Now fire up the session */
+ H->last_err = OCISessionBegin(H->svc, H->err, H->session, OCI_CRED_RDBMS, OCI_DEFAULT);
+ if (H->last_err) {
+ oci_drv_error("OCISessionBegin:");
+ goto cleanup;
+ }
+
+ /* set the server handle into service handle */
+ H->last_err = OCIAttrSet(H->svc, OCI_HTYPE_SVCCTX, H->session, 0, OCI_ATTR_SESSION, H->err);
+ if (H->last_err) {
+ oci_drv_error("OCIAttrSet: OCI_ATTR_SESSION:");
+ goto cleanup;
+ }
+
+ dbh->methods = &oci_methods;
+ dbh->alloc_own_columns = 1;
+ dbh->native_case = PDO_CASE_UPPER;
+
+ ret = 1;
+
+cleanup:
+ for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) {
+ if (vars[i].freeme) {
+ efree(vars[i].optval);
+ }
+ }
+
+ if (!ret) {
+ oci_handle_closer(dbh TSRMLS_CC);
+ }
+
+ return ret;
+}
+/* }}} */
+
+pdo_driver_t pdo_oci_driver = {
+ PDO_DRIVER_HEADER(oci),
+ pdo_oci_handle_factory
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c
new file mode 100755
index 000000000..de34c9cea
--- /dev/null
+++ b/ext/pdo_oci/oci_statement.c
@@ -0,0 +1,732 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: oci_statement.c,v 1.16.2.8 2005/11/04 18:11:40 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_oci.h"
+#include "php_pdo_oci_int.h"
+#include "Zend/zend_extensions.h"
+
+#define STMT_CALL(name, params) \
+ S->last_err = name params; \
+ S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, __FILE__, __LINE__ TSRMLS_CC); \
+ if (S->last_err) { \
+ return 0; \
+ }
+
+#define STMT_CALL_MSG(name, msg, params) \
+ S->last_err = name params; \
+ S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, __FILE__, __LINE__ TSRMLS_CC); \
+ if (S->last_err) { \
+ return 0; \
+ }
+
+static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TSRMLS_DC);
+
+static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+ HashTable *BC = stmt->bound_columns;
+ HashTable *BP = stmt->bound_params;
+
+ int i;
+
+ if (S->stmt) {
+ /* cancel server side resources for the statement if we didn't
+ * fetch it all */
+ OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT);
+
+ /* free the handle */
+ OCIHandleFree(S->stmt, OCI_HTYPE_STMT);
+ S->stmt = NULL;
+ }
+ if (S->err) {
+ OCIHandleFree(S->err, OCI_HTYPE_ERROR);
+ S->err = NULL;
+ }
+
+ /* need to ensure these go away now */
+ if (BC) {
+ zend_hash_destroy(BC);
+ FREE_HASHTABLE(stmt->bound_columns);
+ stmt->bound_columns = NULL;
+ }
+
+ if (BP) {
+ zend_hash_destroy(BP);
+ FREE_HASHTABLE(stmt->bound_params);
+ stmt->bound_params = NULL;
+ }
+
+ if (S->einfo.errmsg) {
+ efree(S->einfo.errmsg);
+ S->einfo.errmsg = NULL;
+ }
+
+ if (S->cols) {
+ for (i = 0; i < stmt->column_count; i++) {
+ if (S->cols[i].data) {
+ switch (S->cols[i].dtype) {
+ case SQLT_BLOB:
+ case SQLT_CLOB:
+ /* do nothing */
+ break;
+ default:
+ efree(S->cols[i].data);
+ }
+ }
+ }
+ efree(S->cols);
+ S->cols = NULL;
+ }
+ efree(S);
+
+ stmt->driver_data = NULL;
+
+ return 1;
+} /* }}} */
+
+static int oci_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+ ub4 rowcount;
+ b4 mode;
+
+ if (!S->stmt_type) {
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_STMT_TYPE",
+ (S->stmt, OCI_HTYPE_STMT, &S->stmt_type, 0, OCI_ATTR_STMT_TYPE, S->err));
+ }
+
+ if (stmt->executed) {
+ /* ensure that we cancel the cursor from a previous fetch */
+ OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT);
+ }
+
+#ifdef OCI_STMT_SCROLLABLE_READONLY /* needed for oci8 ? */
+ if (S->exec_type == OCI_STMT_SCROLLABLE_READONLY) {
+ mode = OCI_STMT_SCROLLABLE_READONLY;
+ } else
+#endif
+ if (stmt->dbh->auto_commit && !stmt->dbh->in_txn) {
+ mode = OCI_COMMIT_ON_SUCCESS;
+ } else {
+ mode = OCI_DEFAULT;
+ }
+
+ STMT_CALL(OCIStmtExecute, (S->H->svc, S->stmt, S->err,
+ (S->stmt_type == OCI_STMT_SELECT && !S->have_blobs) ? 0 : 1, 0, NULL, NULL,
+ mode));
+
+ if (!stmt->executed) {
+ ub4 colcount;
+ /* do first-time-only definition of bind/mapping stuff */
+
+ /* how many columns do we have ? */
+ STMT_CALL_MSG(OCIAttrGet, "ATTR_PARAM_COUNT",
+ (S->stmt, OCI_HTYPE_STMT, &colcount, 0, OCI_ATTR_PARAM_COUNT, S->err));
+
+ stmt->column_count = (int)colcount;
+
+ S->cols = ecalloc(colcount, sizeof(pdo_oci_column));
+ }
+
+ STMT_CALL_MSG(OCIAttrGet, "ATTR_ROW_COUNT",
+ (S->stmt, OCI_HTYPE_STMT, &rowcount, 0, OCI_ATTR_ROW_COUNT, S->err));
+ stmt->row_count = (long)rowcount;
+
+ return 1;
+} /* }}} */
+
+static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp) /* {{{ */
+{
+ struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
+ pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
+ TSRMLS_FETCH();
+
+ if (!param || !param->parameter) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_input_cb; this should not happen");
+ return OCI_ERROR;
+ }
+
+ *indpp = &P->indicator;
+
+ if (P->thing) {
+ *bufpp = P->thing;
+ *alenp = sizeof(void*);
+ } else if (ZVAL_IS_NULL(param->parameter)) {
+ /* insert a NULL value into the column */
+ P->indicator = -1; /* NULL */
+ *bufpp = 0;
+ *alenp = -1;
+ } else if (!P->thing) {
+ /* regular string bind */
+ convert_to_string(param->parameter);
+ *bufpp = Z_STRVAL_P(param->parameter);
+ *alenp = Z_STRLEN_P(param->parameter);
+ }
+
+ *piecep = OCI_ONE_PIECE;
+ return OCI_CONTINUE;
+} /* }}} */
+
+static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp) /* {{{ */
+{
+ struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
+ pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
+ TSRMLS_FETCH();
+
+ if (!param || !param->parameter) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_output_cb; this should not happen");
+ return OCI_ERROR;
+ }
+
+ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) {
+ P->actual_len = sizeof(OCILobLocator*);
+ *bufpp = P->thing;
+ *alenpp = &P->actual_len;
+ *piecep = OCI_ONE_PIECE;
+ *rcodepp = &P->retcode;
+ *indpp = &P->indicator;
+ return OCI_CONTINUE;
+ }
+
+ if (Z_TYPE_P(param->parameter) == IS_OBJECT || Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ return OCI_CONTINUE;
+ }
+
+ convert_to_string(param->parameter);
+ zval_dtor(param->parameter);
+
+ Z_STRLEN_P(param->parameter) = param->max_value_len;
+ Z_STRVAL_P(param->parameter) = emalloc(Z_STRLEN_P(param->parameter)+1);
+ P->used_for_output = 1;
+
+ P->actual_len = Z_STRLEN_P(param->parameter);
+ *alenpp = &P->actual_len;
+ *bufpp = Z_STRVAL_P(param->parameter);
+ *piecep = OCI_ONE_PIECE;
+ *rcodepp = &P->retcode;
+ *indpp = &P->indicator;
+
+ return OCI_CONTINUE;
+} /* }}} */
+
+static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+
+ /* we're only interested in parameters for prepared SQL right now */
+ if (param->is_param) {
+ pdo_oci_bound_param *P;
+ sb4 value_sz = -1;
+
+ P = (pdo_oci_bound_param*)param->driver_data;
+
+ switch (event_type) {
+ case PDO_PARAM_EVT_FREE:
+ P = param->driver_data;
+ if (P) {
+ efree(P);
+ }
+ break;
+
+ case PDO_PARAM_EVT_ALLOC:
+ P = (pdo_oci_bound_param*)ecalloc(1, sizeof(pdo_oci_bound_param));
+ param->driver_data = P;
+
+ /* figure out what we're doing */
+ switch (PDO_PARAM_TYPE(param->param_type)) {
+ case PDO_PARAM_STMT:
+ return 0;
+
+ case PDO_PARAM_LOB:
+ /* P->thing is now an OCILobLocator * */
+ P->oci_type = SQLT_BLOB;
+ value_sz = sizeof(OCILobLocator*);
+ break;
+
+ case PDO_PARAM_STR:
+ default:
+ P->oci_type = SQLT_CHR;
+ value_sz = param->max_value_len + 1;
+ if (param->max_value_len == 0) {
+ value_sz = 4000; /* maximum size before value is interpreted as a LONG value */
+ }
+
+ }
+
+ if (param->name) {
+ STMT_CALL(OCIBindByName, (S->stmt,
+ &P->bind, S->err, (text*)param->name,
+ param->namelen, 0, value_sz, P->oci_type,
+ &P->indicator, 0, &P->retcode, 0, 0,
+ OCI_DATA_AT_EXEC));
+ } else {
+ STMT_CALL(OCIBindByPos, (S->stmt,
+ &P->bind, S->err, param->paramno+1,
+ 0, value_sz, P->oci_type,
+ &P->indicator, 0, &P->retcode, 0, 0,
+ OCI_DATA_AT_EXEC));
+ }
+
+ STMT_CALL(OCIBindDynamic, (P->bind,
+ S->err,
+ param, oci_bind_input_cb,
+ param, oci_bind_output_cb));
+
+ return 1;
+
+ case PDO_PARAM_EVT_EXEC_PRE:
+ P->indicator = 0;
+ P->used_for_output = 0;
+ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) {
+ ub4 empty = 0;
+ STMT_CALL(OCIDescriptorAlloc, (S->H->env, &P->thing, OCI_DTYPE_LOB, 0, NULL));
+ STMT_CALL(OCIAttrSet, (P->thing, OCI_DTYPE_LOB, &empty, 0, OCI_ATTR_LOBEMPTY, S->err));
+ S->have_blobs = 1;
+ }
+ return 1;
+
+ case PDO_PARAM_EVT_EXEC_POST:
+ /* fixup stuff set in motion in oci_bind_output_cb */
+ if (P->used_for_output) {
+ if (P->indicator == -1) {
+ /* set up a NULL value */
+ if (Z_TYPE_P(param->parameter) == IS_STRING
+#if ZEND_EXTENSION_API_NO < 220040718
+ && Z_STRVAL_P(param->parameter) != empty_string
+#endif
+ ) {
+ /* OCI likes to stick non-terminated strings in things */
+ *Z_STRVAL_P(param->parameter) = '\0';
+ }
+ zval_dtor(param->parameter);
+ ZVAL_NULL(param->parameter);
+ } else if (Z_TYPE_P(param->parameter) == IS_STRING
+#if ZEND_EXTENSION_API_NO < 220040718
+ && Z_STRVAL_P(param->parameter) != empty_string
+#endif
+ ) {
+ Z_STRLEN_P(param->parameter) = P->actual_len;
+ Z_STRVAL_P(param->parameter) = erealloc(Z_STRVAL_P(param->parameter), P->actual_len+1);
+ Z_STRVAL_P(param->parameter)[P->actual_len] = '\0';
+ }
+ } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB && P->thing) {
+ php_stream *stm;
+
+ if (Z_TYPE_P(param->parameter) == IS_NULL) {
+ /* if the param is NULL, then we assume that they
+ * wanted to bind a lob locator into it from the query
+ * */
+
+ stm = oci_create_lob_stream(stmt, (OCILobLocator*)P->thing TSRMLS_CC);
+ if (stm) {
+ OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE);
+ php_stream_to_zval(stm, param->parameter);
+ P->thing = NULL;
+ }
+ } else {
+ /* we're a LOB being used for insert; transfer the data now */
+ size_t n;
+ ub4 amt, offset = 1;
+ char *consume;
+
+ php_stream_from_zval_no_verify(stm, &param->parameter);
+ if (stm) {
+ OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE);
+ do {
+ char buf[8192];
+ n = php_stream_read(stm, buf, sizeof(buf));
+ if ((int)n <= 0) {
+ break;
+ }
+ consume = buf;
+ do {
+ amt = n;
+ OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing,
+ &amt, offset, consume, n,
+ OCI_ONE_PIECE,
+ NULL, NULL, 0, SQLCS_IMPLICIT);
+ offset += amt;
+ n -= amt;
+ consume += amt;
+ } while (n);
+ } while (1);
+ OCILobClose(S->H->svc, S->err, (OCILobLocator*)P->thing);
+ OCILobFlushBuffer(S->H->svc, S->err, (OCILobLocator*)P->thing, 0);
+ } else if (Z_TYPE_P(param->parameter) == IS_STRING) {
+ /* stick the string into the LOB */
+ consume = Z_STRVAL_P(param->parameter);
+ n = Z_STRLEN_P(param->parameter);
+ if (n) {
+ OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE);
+ while (n) {
+ amt = n;
+ OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing,
+ &amt, offset, consume, n,
+ OCI_ONE_PIECE,
+ NULL, NULL, 0, SQLCS_IMPLICIT);
+ consume += amt;
+ n -= amt;
+ }
+ OCILobClose(S->H->svc, S->err, (OCILobLocator*)P->thing);
+ }
+ }
+ OCIDescriptorFree(P->thing, OCI_DTYPE_LOB);
+ P->thing = NULL;
+ }
+ }
+
+ return 1;
+ }
+ }
+
+ return 1;
+} /* }}} */
+
+static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, long offset TSRMLS_DC) /* {{{ */
+{
+#if HAVE_OCISTMTFETCH2
+ ub4 ociori;
+#endif
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+
+#if HAVE_OCISTMTFETCH2
+ switch (ori) {
+ case PDO_FETCH_ORI_NEXT: ociori = OCI_FETCH_NEXT; break;
+ case PDO_FETCH_ORI_PRIOR: ociori = OCI_FETCH_PRIOR; break;
+ case PDO_FETCH_ORI_FIRST: ociori = OCI_FETCH_FIRST; break;
+ case PDO_FETCH_ORI_LAST: ociori = OCI_FETCH_LAST; break;
+ case PDO_FETCH_ORI_ABS: ociori = OCI_FETCH_ABSOLUTE; break;
+ case PDO_FETCH_ORI_REL: ociori = OCI_FETCH_RELATIVE; break;
+ }
+ S->last_err = OCIStmtFetch2(S->stmt, S->err, 1, ociori, offset, OCI_DEFAULT);
+#else
+ S->last_err = OCIStmtFetch(S->stmt, S->err, 1, OCI_FETCH_NEXT, OCI_DEFAULT);
+#endif
+
+ if (S->last_err == OCI_NO_DATA) {
+ /* no (more) data */
+ return 0;
+ }
+
+ if (S->last_err == OCI_NEED_DATA) {
+ oci_stmt_error("OCI_NEED_DATA");
+ return 0;
+ }
+
+ if (S->last_err == OCI_SUCCESS_WITH_INFO || S->last_err == OCI_SUCCESS) {
+ return 1;
+ }
+
+ oci_stmt_error("OCIStmtFetch");
+
+ return 0;
+} /* }}} */
+
+static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid **bufpp,
+ ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp)
+{
+ pdo_oci_column *col = (pdo_oci_column*)octxp;
+ TSRMLS_FETCH();
+
+ switch (col->dtype) {
+ case SQLT_BLOB:
+ case SQLT_CLOB:
+ *piecep = OCI_ONE_PIECE;
+ *bufpp = col->data;
+ *alenpp = &col->datalen;
+ break;
+
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "unhandled datatype in oci_define_callback; this should not happen");
+ return OCI_ERROR;
+ }
+
+ return OCI_CONTINUE;
+}
+
+static int oci_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+ OCIParam *param = NULL;
+ text *colname;
+ ub2 dtype, data_size, scale, precis;
+ ub4 namelen;
+ struct pdo_column_data *col = &stmt->columns[colno];
+ zend_bool dyn = FALSE;
+
+ /* describe the column */
+ STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err, (dvoid*)&param, colno+1));
+
+ /* what type ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_TYPE",
+ (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE, S->err));
+
+ /* how big ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_SIZE",
+ (param, OCI_DTYPE_PARAM, &data_size, 0, OCI_ATTR_DATA_SIZE, S->err));
+
+ /* scale ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_SCALE",
+ (param, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE, S->err));
+
+ /* precision ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_PRECISION",
+ (param, OCI_DTYPE_PARAM, &precis, 0, OCI_ATTR_PRECISION, S->err));
+
+ /* name ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_NAME",
+ (param, OCI_DTYPE_PARAM, &colname, &namelen, OCI_ATTR_NAME, S->err));
+
+ col->precision = scale;
+ col->maxlen = data_size;
+ col->namelen = namelen;
+ col->name = estrndup(colname, namelen);
+
+ S->cols[colno].dtype = dtype;
+
+ /* how much room do we need to store the field */
+ switch (dtype) {
+ case SQLT_LBI:
+ case SQLT_LNG:
+ if (dtype == SQLT_LBI) {
+ dtype = SQLT_BIN;
+ } else {
+ dtype = SQLT_CHR;
+ }
+ S->cols[colno].datalen = 512; /* XXX should be INT_MAX and fetched by pieces */
+ S->cols[colno].data = emalloc(S->cols[colno].datalen + 1);
+ col->param_type = PDO_PARAM_STR;
+ break;
+
+ case SQLT_BLOB:
+ case SQLT_CLOB:
+ col->param_type = PDO_PARAM_LOB;
+ STMT_CALL(OCIDescriptorAlloc, (S->H->env, (dvoid**)&S->cols[colno].data, OCI_DTYPE_LOB, 0, NULL));
+ S->cols[colno].datalen = sizeof(OCILobLocator*);
+ dyn = TRUE;
+ break;
+
+ case SQLT_BIN:
+ default:
+ if (dtype == SQLT_DAT || dtype == SQLT_NUM
+#ifdef SQLT_TIMESTAMP
+ || dtype == SQLT_TIMESTAMP
+#endif
+#ifdef SQLT_TIMESTAMP_TZ
+ || dtype == SQLT_TIMESTAMP_TZ
+#endif
+ ) {
+ /* should be big enough for most date formats and numbers */
+ S->cols[colno].datalen = 512;
+ } else {
+ S->cols[colno].datalen = col->maxlen;
+ }
+ if (dtype == SQLT_BIN) {
+ S->cols[colno].datalen *= 3;
+ }
+ S->cols[colno].data = emalloc(S->cols[colno].datalen + 1);
+ dtype = SQLT_CHR;
+
+ /* returning data as a string */
+ col->param_type = PDO_PARAM_STR;
+ }
+
+ STMT_CALL(OCIDefineByPos, (S->stmt, &S->cols[colno].def, S->err, colno+1,
+ S->cols[colno].data, S->cols[colno].datalen, dtype, &S->cols[colno].indicator,
+ &S->cols[colno].fetched_len, &S->cols[colno].retcode, dyn ? OCI_DYNAMIC_FETCH : OCI_DEFAULT));
+
+ if (dyn) {
+ STMT_CALL(OCIDefineDynamic, (S->cols[colno].def, S->err, &S->cols[colno],
+ oci_define_callback));
+ }
+
+ return 1;
+} /* }}} */
+
+struct oci_lob_self {
+ pdo_stmt_t *stmt;
+ pdo_oci_stmt *S;
+ OCILobLocator *lob;
+ ub4 offset;
+};
+
+static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+{
+ struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
+ ub4 amt;
+ sword r;
+
+ amt = count;
+ r = OCILobWrite(self->S->H->svc, self->S->err, self->lob,
+ &amt, self->offset, (char*)buf, count,
+ OCI_ONE_PIECE,
+ NULL, NULL, 0, SQLCS_IMPLICIT);
+
+ if (r != OCI_SUCCESS) {
+ return (size_t)-1;
+ }
+
+ self->offset += amt;
+ return amt;
+}
+
+static size_t oci_blob_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+{
+ struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
+ ub4 amt;
+ sword r;
+
+ amt = count;
+ r = OCILobRead(self->S->H->svc, self->S->err, self->lob,
+ &amt, self->offset, buf, count,
+ NULL, NULL, 0, SQLCS_IMPLICIT);
+
+ if (r != OCI_SUCCESS) {
+ return (size_t)-1;
+ }
+
+ self->offset += amt;
+ return amt;
+}
+
+static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC)
+{
+ struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
+ pdo_stmt_t *stmt = self->stmt;
+
+ if (close_handle) {
+ OCILobClose(self->S->H->svc, self->S->err, self->lob);
+ OCIDescriptorFree(self->lob, OCI_DTYPE_LOB);
+ efree(self);
+ }
+
+ php_pdo_stmt_delref(stmt TSRMLS_CC);
+ return 0;
+}
+
+static int oci_blob_flush(php_stream *stream TSRMLS_DC)
+{
+ struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
+ OCILobFlushBuffer(self->S->H->svc, self->S->err, self->lob, 0);
+ return 0;
+}
+
+static int oci_blob_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC)
+{
+ struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
+ /* TODO: implement */
+ return -1;
+}
+
+static php_stream_ops oci_blob_stream_ops = {
+ oci_blob_write,
+ oci_blob_read,
+ oci_blob_close,
+ oci_blob_flush,
+ "pdo_oci blob stream",
+ NULL, /*oci_blob_seek,*/
+ NULL,
+ NULL,
+ NULL
+};
+
+static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TSRMLS_DC)
+{
+ php_stream *stm;
+ struct oci_lob_self *self = ecalloc(1, sizeof(*self));
+ self->lob = lob;
+ self->offset = 1; /* 1-based */
+ self->stmt = stmt;
+ self->S = (pdo_oci_stmt*)stmt->driver_data;
+
+ stm = php_stream_alloc(&oci_blob_stream_ops, self, 0, "r+b");
+
+ if (stm) {
+ php_pdo_stmt_addref(stmt TSRMLS_CC);
+ return stm;
+ }
+
+ efree(self);
+ return NULL;
+}
+
+static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+ pdo_oci_column *C = &S->cols[colno];
+
+ /* check the indicator to ensure that the data is intact */
+ if (C->indicator == -1) {
+ /* A NULL value */
+ *ptr = NULL;
+ *len = 0;
+ return 1;
+ } else if (C->indicator == 0) {
+ /* it was stored perfectly */
+
+ if (C->dtype == SQLT_BLOB || C->dtype == SQLT_CLOB) {
+ if (C->data) {
+ *ptr = (char*)oci_create_lob_stream(stmt, (OCILobLocator*)C->data TSRMLS_CC);
+ OCILobOpen(S->H->svc, S->err, (OCILobLocator*)C->data, OCI_LOB_READONLY);
+ }
+ *len = 0;
+ return *ptr ? 1 : 0;
+ }
+
+ *ptr = C->data;
+ *len = C->fetched_len;
+ return 1;
+ } else {
+ /* it was truncated */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d data was too large for buffer and was truncated to fit it", colno);
+
+ *ptr = C->data;
+ *len = C->fetched_len;
+ return 1;
+ }
+} /* }}} */
+
+struct pdo_stmt_methods oci_stmt_methods = {
+ oci_stmt_dtor,
+ oci_stmt_execute,
+ oci_stmt_fetch,
+ oci_stmt_describe,
+ oci_stmt_get_col,
+ oci_stmt_param_hook
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_oci/package.xml b/ext/pdo_oci/package.xml
new file mode 100755
index 000000000..22cb4afd2
--- /dev/null
+++ b/ext/pdo_oci/package.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE package SYSTEM "../pear/package.dtd">
+<package version="1.0">
+ <name>PDO_OCI</name>
+ <summary>Oracle Call Interface driver for PDO</summary>
+ <maintainers>
+ <maintainer>
+ <user>wez</user>
+ <name>Wez Furlong</name>
+ <email>wez@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ </maintainers>
+ <description>
+ This extension provides an Oracle driver for PDO.
+ </description>
+ <license>PHP</license>
+ <release>
+ <state>stable</state>
+ <version>1.0</version>
+ <date>2005-11-26</date>
+
+ <notes>
+You need to install the PDO core module before you can make use of this one.
+You also require Oracle OCI 8 or higher client libraries installed on the
+machine where you intend to build and/or use it.
+
+If you are running on windows, you can download the binary from here:
+http://pecl4win.php.net/ext.php/php_pdo_oci.dll
+
+** Changes **
+- Improved handling of long columns
+- Fixed PECL Bug #5722; implemented LOB support.
+
+ </notes>
+
+ <filelist>
+ <file role="src" name="config.m4"/>
+ <file role="src" name="config.w32"/>
+ <file role="src" name="pdo_oci.c"/>
+ <file role="src" name="oci_driver.c"/>
+ <file role="src" name="oci_statement.c"/>
+ <file role="src" name="php_pdo_oci.h"/>
+ <file role="src" name="php_pdo_oci_int.h"/>
+
+ <file role="doc" name="CREDITS"/>
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="5.0.3"/>
+ <dep type="ext" rel="ge" name="pdo" version="1.0"/>
+ </deps>
+ </release>
+</package>
diff --git a/ext/pdo_oci/pdo_oci.c b/ext/pdo_oci/pdo_oci.c
new file mode 100755
index 000000000..df7104876
--- /dev/null
+++ b/ext/pdo_oci/pdo_oci.c
@@ -0,0 +1,133 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_oci.c,v 1.5.2.3 2005/11/26 21:25:39 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_oci.h"
+#include "php_pdo_oci_int.h"
+
+/* {{{ pdo_oci_functions[] */
+function_entry pdo_oci_functions[] = {
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ pdo_oci_module_entry */
+
+#if ZEND_MODULE_API_NO >= 20050922
+static zend_module_dep pdo_oci_deps[] = {
+ ZEND_MOD_REQUIRED("pdo")
+ {NULL, NULL, NULL}
+};
+#endif
+
+zend_module_entry pdo_oci_module_entry = {
+#if ZEND_MODULE_API_NO >= 20050922
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_oci_deps,
+#else
+ STANDARD_MODULE_HEADER,
+#endif
+ "PDO_OCI",
+ pdo_oci_functions,
+ PHP_MINIT(pdo_oci),
+ PHP_MSHUTDOWN(pdo_oci),
+ NULL,
+ NULL,
+ PHP_MINFO(pdo_oci),
+ "1.0",
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_PDO_OCI
+ZEND_GET_MODULE(pdo_oci)
+#endif
+
+const ub4 PDO_OCI_INIT_MODE =
+#if 0 && defined(OCI_SHARED)
+ /* shared mode is known to be bad for PHP */
+ OCI_SHARED
+#else
+ OCI_DEFAULT
+#endif
+#ifdef OCI_OBJECT
+ |OCI_OBJECT
+#endif
+#ifdef ZTS
+ |OCI_THREADED
+#endif
+ ;
+
+/* true global environment */
+OCIEnv *pdo_oci_Env = NULL;
+
+/* {{{ PHP_MINIT_FUNCTION
+ */
+PHP_MINIT_FUNCTION(pdo_oci)
+{
+ php_pdo_register_driver(&pdo_oci_driver);
+
+#if HAVE_OCIENVCREATE
+ OCIEnvCreate(&pdo_oci_Env, PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL, 0, NULL);
+#else
+ OCIInitialize(PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL);
+ OCIEnvInit(&pdo_oci_Env, OCI_DEFAULT, 0, NULL);
+#endif
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(pdo_oci)
+{
+ php_pdo_unregister_driver(&pdo_oci_driver);
+ OCIHandleFree((dvoid*)pdo_oci_Env, OCI_HTYPE_ENV);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(pdo_oci)
+{
+ php_info_print_table_start();
+ php_info_print_table_header(2, "PDO Driver for OCI 8 and later", "enabled");
+ php_info_print_table_end();
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_oci/php_pdo_oci.h b/ext/pdo_oci/php_pdo_oci.h
new file mode 100755
index 000000000..92362feb8
--- /dev/null
+++ b/ext/pdo_oci/php_pdo_oci.h
@@ -0,0 +1,53 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_oci.h,v 1.2 2005/01/12 05:47:03 wez Exp $ */
+
+#ifndef PHP_PDO_OCI_H
+#define PHP_PDO_OCI_H
+
+extern zend_module_entry pdo_oci_module_entry;
+#define phpext_pdo_oci_ptr &pdo_oci_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_PDO_OCI_API __declspec(dllexport)
+#else
+#define PHP_PDO_OCI_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(pdo_oci);
+PHP_MSHUTDOWN_FUNCTION(pdo_oci);
+PHP_RINIT_FUNCTION(pdo_oci);
+PHP_RSHUTDOWN_FUNCTION(pdo_oci);
+PHP_MINFO_FUNCTION(pdo_oci);
+
+#endif /* PHP_PDO_OCI_H */
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_oci/php_pdo_oci_int.h b/ext/pdo_oci/php_pdo_oci_int.h
new file mode 100755
index 000000000..edb344be5
--- /dev/null
+++ b/ext/pdo_oci/php_pdo_oci_int.h
@@ -0,0 +1,94 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_oci_int.h,v 1.4.2.1 2005/10/31 02:11:27 wez Exp $ */
+
+#include <oci.h>
+
+typedef struct {
+ const char *file;
+ int line;
+ sb4 errcode;
+ char *errmsg;
+} pdo_oci_error_info;
+
+/* stuff we use in an OCI database handle */
+typedef struct {
+ OCIServer *server;
+ OCISession *session;
+ OCIEnv *env;
+ OCIError *err;
+ OCISvcCtx *svc;
+ /* OCI9; 0 == use NLS_LANG */
+ ub2 charset;
+ sword last_err;
+
+ unsigned attached:1;
+ unsigned _reserved:31;
+
+ pdo_oci_error_info einfo;
+} pdo_oci_db_handle;
+
+typedef struct {
+ OCIDefine *def;
+ ub2 fetched_len;
+ ub2 retcode;
+ sb2 indicator;
+
+ char *data;
+ ub4 datalen;
+
+ ub2 dtype;
+
+} pdo_oci_column;
+
+typedef struct {
+ pdo_oci_db_handle *H;
+ OCIStmt *stmt;
+ OCIError *err;
+ sword last_err;
+ ub2 stmt_type;
+ ub4 exec_type;
+ pdo_oci_column *cols;
+ pdo_oci_error_info einfo;
+ unsigned int have_blobs:1;
+} pdo_oci_stmt;
+
+typedef struct {
+ OCIBind *bind; /* allocated by OCI */
+ sb2 oci_type;
+ sb2 indicator;
+ ub2 retcode;
+
+ ub4 actual_len;
+
+ dvoid *thing; /* for LOBS, REFCURSORS etc. */
+
+ unsigned used_for_output;
+} pdo_oci_bound_param;
+
+extern const ub4 PDO_OCI_INIT_MODE;
+extern pdo_driver_t pdo_oci_driver;
+extern OCIEnv *pdo_oci_Env;
+
+ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, const char *file, int line TSRMLS_DC);
+#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, __FILE__, __LINE__ TSRMLS_CC)
+#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, __FILE__, __LINE__ TSRMLS_CC)
+
+extern struct pdo_stmt_methods oci_stmt_methods;
+
diff --git a/ext/pdo_oci/tests/bug_33707.phpt b/ext/pdo_oci/tests/bug_33707.phpt
new file mode 100644
index 000000000..17ea37f74
--- /dev/null
+++ b/ext/pdo_oci/tests/bug_33707.phpt
@@ -0,0 +1,30 @@
+--TEST--
+PDO OCI Bug #33707
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
+require 'ext/pdo_oci/tests/config.inc';
+require 'ext/pdo/tests/pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require 'ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt');
+$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
+
+$rs = $db->query('select blah from a_table_that_doesnt_exist');
+var_dump($rs);
+var_dump($db->errorInfo());
+
+--EXPECTF--
+bool(false)
+array(3) {
+ [0]=>
+ string(5) "HY000"
+ [1]=>
+ int(942)
+ [2]=>
+ string(%d) "OCIStmtExecute: ORA-00942: table or view does not exist
+ (%s:%d)"
+}
diff --git a/ext/pdo_oci/tests/common.phpt b/ext/pdo_oci/tests/common.phpt
new file mode 100644
index 000000000..413b57bbf
--- /dev/null
+++ b/ext/pdo_oci/tests/common.phpt
@@ -0,0 +1,26 @@
+--TEST--
+OCI
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_oci')) print 'skip'; ?>
+--REDIRECTTEST--
+# magic auto-configuration
+
+$config = array(
+ 'TESTS' => 'ext/pdo/tests'
+);
+
+
+if (false !== getenv('PDO_OCI_TEST_DSN')) {
+ # user set them from their shell
+ $config['ENV']['PDOTEST_DSN'] = getenv('PDO_OCI_TEST_DSN');
+ $config['ENV']['PDOTEST_USER'] = getenv('PDO_OCI_TEST_USER');
+ $config['ENV']['PDOTEST_PASS'] = getenv('PDO_OCI_TEST_PASS');
+ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_OCI_TEST_ATTR');
+} else {
+ $config['ENV']['PDOTEST_DSN'] = 'oci:dbname=test';
+ $config['ENV']['PDOTEST_USER'] = 'SYSTEM';
+ $config['ENV']['PDOTEST_PASS'] = 'PASSWORD';
+}
+
+return $config;
diff --git a/ext/pdo_odbc/CREDITS b/ext/pdo_odbc/CREDITS
new file mode 100755
index 000000000..b5af9df35
--- /dev/null
+++ b/ext/pdo_odbc/CREDITS
@@ -0,0 +1,2 @@
+ODBC driver for PDO
+Wez Furlong
diff --git a/ext/pdo_odbc/EXPERIMENTAL b/ext/pdo_odbc/EXPERIMENTAL
new file mode 100644
index 000000000..139597f9c
--- /dev/null
+++ b/ext/pdo_odbc/EXPERIMENTAL
@@ -0,0 +1,2 @@
+
+
diff --git a/ext/pdo_odbc/config.m4 b/ext/pdo_odbc/config.m4
new file mode 100755
index 000000000..acc350d85
--- /dev/null
+++ b/ext/pdo_odbc/config.m4
@@ -0,0 +1,169 @@
+dnl $Id: config.m4,v 1.22 2005/07/27 03:22:02 wez Exp $
+dnl config.m4 for extension pdo_odbc
+dnl vim:et:sw=2:ts=2:
+
+if test "$PHP_PDO" != "no"; then
+
+define([PDO_ODBC_HELP_TEXT],[[
+ include and lib dirs are looked for under 'dir'.
+
+ 'flavour' can be one of: ibm-db2, unixODBC, generic
+ If ',dir' part is omitted, default for the flavour
+ you have selected will used. e.g.:
+
+ --with-pdo-odbc=unixODBC
+
+ will check for unixODBC under /usr/local. You may attempt
+ to use an otherwise unsupported driver using the \"generic\"
+ flavour. The syntax for generic ODBC support is:
+
+ --with-pdo-odbc=generic,dir,libname,ldflags,cflags
+
+ This extension will always be created as a shared extension
+ named pdo_odbc.so]])
+
+PHP_ARG_WITH(pdo-odbc, for ODBC v3 support for PDO,
+[ --with-pdo-odbc=flavour,dir
+ PDO: Support for 'flavour' ODBC driver.]PDO_ODBC_HELP_TEXT)
+
+
+AC_DEFUN([PDO_ODBC_CHECK_HEADER],[
+ AC_MSG_CHECKING([for $1 in $PDO_ODBC_INCDIR])
+ if test -f "$PDO_ODBC_INCDIR/$1"; then
+ php_pdo_have_header=yes
+ PHP_DEF_HAVE(translit($1,.,_))
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+])
+
+if test "$PHP_PDO_ODBC" != "no"; then
+
+ ifdef([PHP_CHECK_PDO_INCLUDES],
+ [
+ PHP_CHECK_PDO_INCLUDES
+ ],[
+ AC_MSG_CHECKING([for PDO includes])
+ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$prefix/include/php/ext
+ else
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
+ fi
+ AC_MSG_RESULT($pdo_inc_path)
+ ])
+
+ AC_MSG_CHECKING([for selected PDO ODBC flavour])
+
+ pdo_odbc_flavour="`echo $PHP_PDO_ODBC | cut -d, -f1`"
+ pdo_odbc_dir="`echo $PHP_PDO_ODBC | cut -d, -f2`"
+
+ if test "$pdo_odbc_dir" = "$PHP_PDO_ODBC" ; then
+ pdo_odbc_dir=
+ fi
+
+ case $pdo_odbc_flavour in
+ ibm-db2)
+ pdo_odbc_def_libdir=/home/db2inst1/sqllib/lib
+ pdo_odbc_def_incdir=/home/db2inst1/sqllib/include
+ pdo_odbc_def_lib=db2
+ ;;
+
+ unixODBC|unixodbc)
+ pdo_odbc_def_libdir=/usr/local/lib
+ pdo_odbc_def_incdir=/usr/local/include
+ pdo_odbc_def_lib=odbc
+ ;;
+
+ ODBCRouter|odbcrouter)
+ pdo_odbc_def_libdir=/usr/lib
+ pdo_odbc_def_incdir=/usr/include
+ pdo_odbc_def_lib=odbcsdk
+ ;;
+
+ generic)
+ pdo_odbc_def_lib="`echo $PHP_PDO_ODBC | cut -d, -f3`"
+ pdo_odbc_def_ldflags="`echo $PHP_PDO_ODBC | cut -d, -f4`"
+ pdo_odbc_def_cflags="`echo $PHP_PDO_ODBC | cut -d, -f5`"
+ pdo_odbc_flavour="$pdo_odbc_flavour ($pdo_odbc_def_lib)"
+ ;;
+
+ *)
+ AC_MSG_ERROR([Unknown ODBC flavour $pdo_odbc_flavour]PDO_ODBC_HELP_TEXT)
+ ;;
+ esac
+
+ if test -n "$pdo_odbc_dir"; then
+ PDO_ODBC_INCDIR="$pdo_odbc_dir/include"
+ PDO_ODBC_LIBDIR="$pdo_odbc_dir/lib"
+ else
+ PDO_ODBC_INCDIR="$pdo_odbc_def_incdir"
+ PDO_ODBC_LIBDIR="$pdo_odbc_def_libdir"
+ fi
+
+ AC_MSG_RESULT([$pdo_odbc_flavour
+ libs $PDO_ODBC_LIBDIR,
+ headers $PDO_ODBC_INCDIR])
+
+ if test ! -d "$PDO_ODBC_LIBDIR" ; then
+ AC_MSG_WARN([library dir $PDO_ODBC_LIBDIR does not exist])
+ fi
+
+ PDO_ODBC_CHECK_HEADER(odbc.h)
+ PDO_ODBC_CHECK_HEADER(odbcsdk.h)
+ PDO_ODBC_CHECK_HEADER(iodbc.h)
+ PDO_ODBC_CHECK_HEADER(sqlunix.h)
+ PDO_ODBC_CHECK_HEADER(sqltypes.h)
+ PDO_ODBC_CHECK_HEADER(sqlucode.h)
+ PDO_ODBC_CHECK_HEADER(sql.h)
+ PDO_ODBC_CHECK_HEADER(isql.h)
+ PDO_ODBC_CHECK_HEADER(sqlext.h)
+ PDO_ODBC_CHECK_HEADER(isqlext.h)
+ PDO_ODBC_CHECK_HEADER(udbcext.h)
+ PDO_ODBC_CHECK_HEADER(sqlcli1.h)
+ PDO_ODBC_CHECK_HEADER(LibraryManager.h)
+ PDO_ODBC_CHECK_HEADER(cli0core.h)
+ PDO_ODBC_CHECK_HEADER(cli0ext.h)
+ PDO_ODBC_CHECK_HEADER(cli0cli.h)
+ PDO_ODBC_CHECK_HEADER(cli0defs.h)
+ PDO_ODBC_CHECK_HEADER(cli0env.h)
+
+ if test "$php_pdo_have_header" != "yes"; then
+ AC_MSG_ERROR([Cannot find header file(s) for pdo_odbc])
+ fi
+
+ PDO_ODBC_INCLUDE="$pdo_odbc_def_cflags -I$PDO_ODBC_INCDIR -DPDO_ODBC_TYPE=\\\"$pdo_odbc_flavour\\\""
+ PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags -L$PDO_ODBC_LIBDIR -l$pdo_odbc_def_lib"
+
+ PHP_EVAL_LIBLINE([$PDO_ODBC_LDFLAGS], [PDO_ODBC_SHARED_LIBADD])
+
+ dnl Check first for an ODBC 1.0 function to assert that the libraries work
+ PHP_CHECK_LIBRARY($pdo_odbc_def_lib, SQLBindCol,
+ [
+ dnl And now check for an ODBC 3.0 function to assert that they're
+ dnl *good* libraries.
+ PHP_CHECK_LIBRARY($pdo_odbc_def_lib, SQLAllocHandle,
+ [], [
+ AC_MSG_ERROR([
+Your ODBC library does not appear to be ODBC 3 compatible.
+You should consider using unixODBC instead, and loading your
+libraries as a driver in that environment; it will emulate the
+functions required for PDO support.
+])], $PDO_ODBC_LDFLAGS)
+ ],[
+ AC_MSG_ERROR([Your ODBC library does not exist or there was an error. Check config.log for more information])
+ ], $PDO_ODBC_LDFLAGS)
+
+ PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_ODBC_INCLUDE)
+ PHP_SUBST(PDO_ODBC_SHARED_LIBADD)
+ ifdef([PHP_ADD_EXTENDION_DEP],
+ [
+ PHP_ADD_EXTENSION_DEP(pdo_odbc, pdo)
+ ])
+fi
+
+fi
diff --git a/ext/pdo_odbc/config.w32 b/ext/pdo_odbc/config.w32
new file mode 100755
index 000000000..42e36dcae
--- /dev/null
+++ b/ext/pdo_odbc/config.w32
@@ -0,0 +1,15 @@
+// $Id: config.w32,v 1.1 2004/05/17 15:43:01 wez Exp $
+// vim:ft=javascript
+
+ARG_WITH("pdo-odbc", "ODBC support for PDO", "no");
+
+if (PHP_PDO_ODBC != "no") {
+ if (CHECK_LIB("odbc32.lib", "pdo_odbc") && CHECK_LIB("odbccp32.lib", "pdo_odbc")) {
+ EXTENSION("pdo_odbc", "pdo_odbc.c odbc_driver.c odbc_stmt.c");
+ CHECK_HEADER_ADD_INCLUDE('sql.h', 'CFLAGS_PDO_ODBC');
+ CHECK_HEADER_ADD_INCLUDE('sqlext.h', 'CFLAGS_PDO_ODBC');
+ ADD_FLAG('CFLAGS_PDO_ODBC', "/I ..\\pecl");
+ }
+ ADD_EXTENSION_DEP('pdo_odbc', 'pdo');
+}
+
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
new file mode 100755
index 000000000..b85dde44c
--- /dev/null
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -0,0 +1,432 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: odbc_driver.c,v 1.27.2.1 2005/09/26 21:37:33 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_odbc.h"
+#include "php_pdo_odbc_int.h"
+#include "zend_exceptions.h"
+
+static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+{
+ pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
+ pdo_odbc_errinfo *einfo = &H->einfo;
+ pdo_odbc_stmt *S = NULL;
+ char *message = NULL;
+
+ if (stmt) {
+ S = (pdo_odbc_stmt*)stmt->driver_data;
+ einfo = &S->einfo;
+ }
+
+ spprintf(&message, 0, "%s (%s[%ld] at %s:%d)",
+ einfo->last_err_msg,
+ einfo->what, einfo->last_error,
+ einfo->file, einfo->line);
+
+ add_next_index_long(info, einfo->last_error);
+ add_next_index_string(info, message, 0);
+ add_next_index_string(info, einfo->last_state, 1);
+
+ return 1;
+}
+
+
+void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line TSRMLS_DC) /* {{{ */
+{
+ RETCODE rc;
+ SWORD errmsgsize = 0;
+ pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data;
+ pdo_odbc_errinfo *einfo = &H->einfo;
+ pdo_odbc_stmt *S = NULL;
+ pdo_error_type *pdo_err = &dbh->error_code;
+
+ if (stmt) {
+ S = (pdo_odbc_stmt*)stmt->driver_data;
+
+ einfo = &S->einfo;
+ pdo_err = &stmt->error_code;
+ }
+
+ if (statement == SQL_NULL_HSTMT && S) {
+ statement = S->stmt;
+ }
+
+ rc = SQLError(H->env, H->dbc, statement, einfo->last_state, &einfo->last_error,
+ einfo->last_err_msg, sizeof(einfo->last_err_msg)-1, &errmsgsize);
+
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ errmsgsize = 0;
+ }
+
+ einfo->last_err_msg[errmsgsize] = '\0';
+ einfo->file = file;
+ einfo->line = line;
+ einfo->what = what;
+
+ strcpy(*pdo_err, einfo->last_state);
+/* printf("@@ SQLSTATE[%s] %s\n", *pdo_err, einfo->last_err_msg); */
+ if (!dbh->methods) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] %s: %d %s",
+ *pdo_err, what, einfo->last_error, einfo->last_err_msg);
+ }
+}
+/* }}} */
+
+static int odbc_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data;
+
+ if (H->dbc != SQL_NULL_HANDLE) {
+ SQLEndTran(SQL_HANDLE_DBC, H->dbc, SQL_ROLLBACK);
+ SQLDisconnect(H->dbc);
+ SQLFreeHandle(SQL_HANDLE_DBC, H->dbc);
+ H->dbc = NULL;
+ }
+ SQLFreeHandle(SQL_HANDLE_ENV, H->env);
+ H->env = NULL;
+ pefree(H, dbh->is_persistent);
+ dbh->driver_data = NULL;
+
+ return 0;
+}
+
+static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+{
+ RETCODE rc;
+ pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
+ pdo_odbc_stmt *S = ecalloc(1, sizeof(*S));
+ enum pdo_cursor_type cursor_type = PDO_CURSOR_FWDONLY;
+ int ret;
+ char *nsql = NULL;
+ int nsql_len = 0;
+
+ S->H = H;
+
+ /* before we prepare, we need to peek at the query; if it uses named parameters,
+ * we want PDO to rewrite them for us */
+ stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL;
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+
+ if (ret == 1) {
+ /* query was re-written */
+ sql = nsql;
+ } else if (ret == -1) {
+ /* couldn't grok it */
+ strcpy(dbh->error_code, stmt->error_code);
+ efree(S);
+ return 0;
+ }
+
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, H->dbc, &S->stmt);
+
+ if (rc == SQL_INVALID_HANDLE || rc == SQL_ERROR) {
+ efree(S);
+ if (nsql) {
+ efree(nsql);
+ }
+ pdo_odbc_drv_error("SQLAllocStmt");
+ return 0;
+ }
+
+ cursor_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC);
+ if (cursor_type != PDO_CURSOR_FWDONLY) {
+ rc = SQLSetStmtAttr(S->stmt, SQL_ATTR_CURSOR_SCROLLABLE, (void*)SQL_SCROLLABLE, 0);
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ pdo_odbc_stmt_error("SQLSetStmtAttr: SQL_ATTR_CURSOR_SCROLLABLE");
+ SQLFreeHandle(SQL_HANDLE_STMT, S->stmt);
+ if (nsql) {
+ efree(nsql);
+ }
+ return 0;
+ }
+ }
+
+ rc = SQLPrepare(S->stmt, (char*)sql, SQL_NTS);
+ if (nsql) {
+ efree(nsql);
+ }
+
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_stmt_error("SQLPrepare");
+ }
+
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ SQLFreeHandle(SQL_HANDLE_STMT, S->stmt);
+ return 0;
+ }
+
+ stmt->driver_data = S;
+ stmt->methods = &odbc_stmt_methods;
+
+ return 1;
+}
+
+static long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC)
+{
+ pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
+ RETCODE rc;
+ long row_count = -1;
+ PDO_ODBC_HSTMT stmt;
+
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, H->dbc, &stmt);
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_drv_error("SQLAllocHandle: STMT");
+ return -1;
+ }
+
+ rc = SQLExecDirect(stmt, (char *)sql, sql_len);
+
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ pdo_odbc_doer_error("SQLExecDirect");
+ goto out;
+ }
+
+ rc = SQLRowCount(stmt, &row_count);
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ pdo_odbc_doer_error("SQLRowCount");
+ goto out;
+ }
+ if (row_count == -1) {
+ row_count = 0;
+ }
+out:
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ return row_count;
+}
+
+static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type TSRMLS_DC)
+{
+ pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
+ /* TODO: figure it out */
+ return 0;
+}
+
+static int odbc_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ if (dbh->auto_commit) {
+ /* we need to disable auto-commit now, to be able to initiate a transaction */
+ RETCODE rc;
+ pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
+
+ rc = SQLSetConnectAttr(H->dbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_OFF, SQL_IS_INTEGER);
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_drv_error("SQLSetConnectAttr AUTOCOMMIT = OFF");
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int odbc_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
+ RETCODE rc;
+
+ rc = SQLEndTran(SQL_HANDLE_DBC, H->dbc, SQL_COMMIT);
+
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_drv_error("SQLEndTran: Commit");
+
+ if (rc != SQL_SUCCESS_WITH_INFO) {
+ return 0;
+ }
+ }
+
+ if (dbh->auto_commit) {
+ /* turn auto-commit back on again */
+ rc = SQLSetConnectAttr(H->dbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_ON, SQL_IS_INTEGER);
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_drv_error("SQLSetConnectAttr AUTOCOMMIT = ON");
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int odbc_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
+ RETCODE rc;
+
+ rc = SQLEndTran(SQL_HANDLE_DBC, H->dbc, SQL_ROLLBACK);
+
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_drv_error("SQLEndTran: Rollback");
+
+ if (rc != SQL_SUCCESS_WITH_INFO) {
+ return 0;
+ }
+ }
+ if (dbh->auto_commit && H->dbc) {
+ /* turn auto-commit back on again */
+ rc = SQLSetConnectAttr(H->dbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_ON, SQL_IS_INTEGER);
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_drv_error("SQLSetConnectAttr AUTOCOMMIT = ON");
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int odbc_handle_get_attr(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
+{
+ switch (attr) {
+ case PDO_ATTR_CLIENT_VERSION:
+ ZVAL_STRING(val, "ODBC-" PDO_ODBC_TYPE, 1);
+ return 1;
+
+ case PDO_ATTR_SERVER_VERSION:
+ case PDO_ATTR_PREFETCH:
+ case PDO_ATTR_TIMEOUT:
+ case PDO_ATTR_SERVER_INFO:
+ case PDO_ATTR_CONNECTION_STATUS:
+ break;
+
+ }
+ return 0;
+}
+
+static struct pdo_dbh_methods odbc_methods = {
+ odbc_handle_closer,
+ odbc_handle_preparer,
+ odbc_handle_doer,
+ odbc_handle_quoter,
+ odbc_handle_begin,
+ odbc_handle_commit,
+ odbc_handle_rollback,
+ NULL, /* set attr */
+ NULL, /* last id */
+ pdo_odbc_fetch_error_func,
+ odbc_handle_get_attr, /* get attr */
+ NULL, /* check_liveness */
+};
+
+static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+{
+ pdo_odbc_db_handle *H;
+ RETCODE rc;
+ int use_direct = 0;
+ SQLUINTEGER cursor_lib;
+
+ H = pecalloc(1, sizeof(*H), dbh->is_persistent);
+
+ dbh->driver_data = H;
+
+ SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &H->env);
+ rc = SQLSetEnvAttr(H->env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0);
+
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ pdo_odbc_drv_error("SQLSetEnvAttr: ODBC3");
+ goto fail;
+ }
+
+#ifdef SQL_ATTR_CONNECTION_POOLING
+ if (pdo_odbc_pool_on != SQL_CP_OFF) {
+ rc = SQLSetEnvAttr(H->env, SQL_ATTR_CP_MATCH, (void*)pdo_odbc_pool_mode, 0);
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_drv_error("SQLSetEnvAttr: SQL_ATTR_CP_MATCH");
+ goto fail;
+ }
+ }
+#endif
+
+ rc = SQLAllocHandle(SQL_HANDLE_DBC, H->env, &H->dbc);
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ pdo_odbc_drv_error("SQLAllocHandle (DBC)");
+ goto fail;
+ }
+
+ rc = SQLSetConnectAttr(H->dbc, SQL_ATTR_AUTOCOMMIT,
+ (SQLPOINTER)(dbh->auto_commit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF), SQL_IS_INTEGER);
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_drv_error("SQLSetConnectAttr AUTOCOMMIT");
+ goto fail;
+ }
+
+ /* set up the cursor library, if needed, or if configured explicitly */
+ cursor_lib = pdo_attr_lval(driver_options, PDO_ODBC_ATTR_USE_CURSOR_LIBRARY, SQL_CUR_USE_IF_NEEDED TSRMLS_CC);
+ rc = SQLSetConnectAttr(H->dbc, SQL_ODBC_CURSORS, (void*)cursor_lib, SQL_IS_INTEGER);
+ if (rc != SQL_SUCCESS && cursor_lib != SQL_CUR_USE_IF_NEEDED) {
+ pdo_odbc_drv_error("SQLSetConnectAttr SQL_ODBC_CURSORS");
+ goto fail;
+ }
+
+ if (strchr(dbh->data_source, ';')) {
+ char dsnbuf[1024];
+ short dsnbuflen;
+
+ use_direct = 1;
+
+ /* Force UID and PWD to be set in the DSN */
+ if (dbh->username && *dbh->username && !strstr(dbh->data_source, "uid")
+ && !strstr(dbh->data_source, "UID")) {
+ char *dsn = pemalloc(strlen(dbh->data_source) + strlen(dbh->username) + strlen(dbh->password) + sizeof(";UID=;PWD="), dbh->is_persistent);
+ sprintf(dsn, "%s;UID=%s;PWD=%s", dbh->data_source, dbh->username, dbh->password);
+ pefree((char*)dbh->data_source, dbh->is_persistent);
+ dbh->data_source = dsn;
+ }
+
+ rc = SQLDriverConnect(H->dbc, NULL, (char*)dbh->data_source, strlen(dbh->data_source),
+ dsnbuf, sizeof(dsnbuf)-1, &dsnbuflen, SQL_DRIVER_NOPROMPT);
+ }
+ if (!use_direct) {
+ rc = SQLConnect(H->dbc, (char*)dbh->data_source, SQL_NTS, dbh->username, SQL_NTS, dbh->password, SQL_NTS);
+ }
+
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ pdo_odbc_drv_error(use_direct ? "SQLDriverConnect" : "SQLConnect");
+ goto fail;
+ }
+
+ /* TODO: if we want to play nicely, we should check to see if the driver really supports ODBC v3 or not */
+
+ dbh->methods = &odbc_methods;
+ dbh->alloc_own_columns = 1;
+
+ return 1;
+
+fail:
+ dbh->methods = &odbc_methods;
+ return 0;
+}
+/* }}} */
+
+pdo_driver_t pdo_odbc_driver = {
+ PDO_DRIVER_HEADER(odbc),
+ pdo_odbc_handle_factory
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
new file mode 100755
index 000000000..ea9a6980d
--- /dev/null
+++ b/ext/pdo_odbc/odbc_stmt.c
@@ -0,0 +1,616 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: odbc_stmt.c,v 1.26.2.1 2005/09/30 04:19:24 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_odbc.h"
+#include "php_pdo_odbc_int.h"
+
+static void free_cols(pdo_stmt_t *stmt, pdo_odbc_stmt *S TSRMLS_DC)
+{
+ if (S->cols) {
+ int i;
+
+ for (i = 0; i < stmt->column_count; i++) {
+ if (S->cols[i].data) {
+ efree(S->cols[i].data);
+ }
+ }
+ efree(S->cols);
+ S->cols = NULL;
+ }
+}
+
+static int odbc_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
+
+ if (S->stmt != SQL_NULL_HANDLE) {
+ if (stmt->executed) {
+ SQLCloseCursor(S->stmt);
+ }
+ SQLFreeHandle(SQL_HANDLE_STMT, S->stmt);
+ S->stmt = SQL_NULL_HANDLE;
+ }
+
+ free_cols(stmt, S TSRMLS_CC);
+
+ efree(S);
+
+ return 1;
+}
+
+static int odbc_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ RETCODE rc;
+ pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
+ char *buf = NULL;
+ long row_count = -1;
+
+ if (stmt->executed) {
+ SQLCloseCursor(S->stmt);
+ }
+
+ rc = SQLExecute(S->stmt);
+
+ while (rc == SQL_NEED_DATA) {
+ struct pdo_bound_param_data *param;
+ rc = SQLParamData(S->stmt, (SQLPOINTER*)&param);
+ if (rc == SQL_NEED_DATA) {
+ php_stream *stm;
+ int len;
+
+ if (Z_TYPE_P(param->parameter) != IS_RESOURCE) {
+ /* they passed in a string */
+ convert_to_string(param->parameter);
+ SQLPutData(S->stmt, Z_STRVAL_P(param->parameter), Z_STRLEN_P(param->parameter));
+ continue;
+ }
+
+ php_stream_from_zval_no_verify(stm, &param->parameter);
+ if (!stm) {
+ /* shouldn't happen either */
+ pdo_odbc_stmt_error("input LOB is no longer a stream");
+ SQLCloseCursor(S->stmt);
+ if (buf) {
+ efree(buf);
+ }
+ return 0;
+ }
+
+ /* now suck data from the stream and stick it into the database */
+ if (buf == NULL) {
+ buf = emalloc(8192);
+ }
+
+ do {
+ len = php_stream_read(stm, buf, 8192);
+ if (len == 0) {
+ break;
+ }
+ SQLPutData(S->stmt, buf, len);
+ } while (1);
+ }
+ }
+
+ if (buf) {
+ efree(buf);
+ }
+
+ switch (rc) {
+ case SQL_SUCCESS:
+ break;
+ case SQL_NO_DATA_FOUND:
+ case SQL_SUCCESS_WITH_INFO:
+ pdo_odbc_stmt_error("SQLExecute");
+ break;
+
+ default:
+ pdo_odbc_stmt_error("SQLExecute");
+ return 0;
+ }
+
+ SQLRowCount(S->stmt, &row_count);
+ stmt->row_count = row_count;
+
+ if (!stmt->executed) {
+ /* do first-time-only definition of bind/mapping stuff */
+ SQLSMALLINT colcount;
+
+ /* how many columns do we have ? */
+ SQLNumResultCols(S->stmt, &colcount);
+
+ stmt->column_count = (int)colcount;
+ S->cols = ecalloc(colcount, sizeof(pdo_odbc_column));
+ }
+
+ return 1;
+}
+
+static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
+ enum pdo_param_event event_type TSRMLS_DC)
+{
+ pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
+ RETCODE rc;
+ SWORD sqltype = 0, ctype = 0, scale = 0, nullable = 0;
+ UDWORD precision = 0;
+ pdo_odbc_param *P;
+
+ /* we're only interested in parameters for prepared SQL right now */
+ if (param->is_param) {
+
+ switch (event_type) {
+ case PDO_PARAM_EVT_FREE:
+ P = param->driver_data;
+ if (P) {
+ efree(P);
+ }
+ break;
+
+ case PDO_PARAM_EVT_ALLOC:
+ {
+ /* figure out what we're doing */
+ switch (PDO_PARAM_TYPE(param->param_type)) {
+ case PDO_PARAM_LOB:
+ break;
+
+ case PDO_PARAM_STMT:
+ return 0;
+
+ default:
+ break;
+ }
+
+ rc = SQLDescribeParam(S->stmt, param->paramno+1, &sqltype, &precision, &scale, &nullable);
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ /* MS Access, for instance, doesn't support SQLDescribeParam,
+ * so we need to guess */
+ sqltype = PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB ?
+ SQL_LONGVARBINARY :
+ SQL_LONGVARCHAR;
+ precision = 4000;
+ scale = 5;
+ nullable = 1;
+
+ if (param->max_value_len > 0) {
+ precision = param->max_value_len;
+ }
+ }
+ if (sqltype == SQL_BINARY || sqltype == SQL_VARBINARY || sqltype == SQL_LONGVARBINARY) {
+ ctype = SQL_C_BINARY;
+ } else {
+ ctype = SQL_C_CHAR;
+ }
+
+ P = emalloc(sizeof(*P));
+ param->driver_data = P;
+
+ P->len = 0; /* is re-populated each EXEC_PRE */
+ P->outbuf = NULL;
+
+ if ((param->param_type & PDO_PARAM_INPUT_OUTPUT) == PDO_PARAM_INPUT_OUTPUT) {
+ P->paramtype = SQL_PARAM_INPUT_OUTPUT;
+ } else if (param->max_value_len <= 0) {
+ P->paramtype = SQL_PARAM_INPUT;
+ } else {
+ P->paramtype = SQL_PARAM_OUTPUT;
+ }
+
+ if (P->paramtype != SQL_PARAM_INPUT) {
+ if (PDO_PARAM_TYPE(param->param_type) != PDO_PARAM_NULL) {
+ /* need an explicit buffer to hold result */
+ P->len = param->max_value_len > 0 ? param->max_value_len : precision;
+ P->outbuf = emalloc(P->len + 1);
+ }
+ }
+
+ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB && P->paramtype != SQL_PARAM_INPUT) {
+ pdo_odbc_stmt_error("Can't bind a lob for output");
+ return 0;
+ }
+
+ rc = SQLBindParameter(S->stmt, param->paramno+1,
+ P->paramtype, ctype, sqltype, precision, scale,
+ P->paramtype == SQL_PARAM_INPUT ?
+ (SQLPOINTER)param :
+ P->outbuf,
+ P->len,
+ &P->len
+ );
+
+ if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
+ return 1;
+ }
+ pdo_odbc_stmt_error("SQLBindParameter");
+ return 0;
+ }
+
+ case PDO_PARAM_EVT_EXEC_PRE:
+ P = param->driver_data;
+ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) {
+ if (Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ php_stream *stm;
+ php_stream_statbuf sb;
+
+ php_stream_from_zval_no_verify(stm, &param->parameter);
+
+ if (!stm) {
+ return 0;
+ }
+
+ if (0 == php_stream_stat(stm, &sb)) {
+ if (P->outbuf) {
+ int len, amount;
+ char *ptr = P->outbuf;
+ char *end = P->outbuf + P->len;
+
+ P->len = 0;
+ do {
+ amount = end - ptr;
+ if (amount == 0) {
+ break;
+ }
+ if (amount > 8192)
+ amount = 8192;
+ len = php_stream_read(stm, ptr, amount);
+ if (len == 0) {
+ break;
+ }
+ ptr += len;
+ P->len += len;
+ } while (1);
+
+ } else {
+ P->len = SQL_LEN_DATA_AT_EXEC(sb.sb.st_size);
+ }
+ } else {
+ if (P->outbuf) {
+ P->len = 0;
+ } else {
+ P->len = SQL_LEN_DATA_AT_EXEC(0);
+ }
+ }
+ } else {
+ convert_to_string(param->parameter);
+ if (P->outbuf) {
+ P->len = Z_STRLEN_P(param->parameter);
+ memcpy(P->outbuf, Z_STRVAL_P(param->parameter), P->len);
+ } else {
+ P->len = SQL_LEN_DATA_AT_EXEC(Z_STRLEN_P(param->parameter));
+ }
+ }
+ } else if (Z_TYPE_P(param->parameter) == IS_NULL || PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL) {
+ P->len = SQL_NULL_DATA;
+ } else {
+ convert_to_string(param->parameter);
+ if (P->outbuf) {
+ P->len = Z_STRLEN_P(param->parameter);
+ memcpy(P->outbuf, Z_STRVAL_P(param->parameter), P->len);
+ } else {
+ P->len = SQL_LEN_DATA_AT_EXEC(Z_STRLEN_P(param->parameter));
+ }
+ }
+ return 1;
+
+ case PDO_PARAM_EVT_EXEC_POST:
+ P = param->driver_data;
+ if (P->outbuf) {
+ switch (P->len) {
+ case SQL_NULL_DATA:
+ zval_dtor(param->parameter);
+ ZVAL_NULL(param->parameter);
+ break;
+ default:
+ convert_to_string(param->parameter);
+ Z_STRVAL_P(param->parameter) = erealloc(Z_STRVAL_P(param->parameter), P->len+1);
+ memcpy(Z_STRVAL_P(param->parameter), P->outbuf, P->len);
+ Z_STRLEN_P(param->parameter) = P->len;
+ Z_STRVAL_P(param->parameter)[P->len] = '\0';
+ }
+ }
+ return 1;
+ }
+ }
+ return 1;
+}
+
+static int odbc_stmt_fetch(pdo_stmt_t *stmt,
+ enum pdo_fetch_orientation ori, long offset TSRMLS_DC)
+{
+ pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
+ RETCODE rc;
+ SQLSMALLINT odbcori;
+
+ switch (ori) {
+ case PDO_FETCH_ORI_NEXT: odbcori = SQL_FETCH_NEXT; break;
+ case PDO_FETCH_ORI_PRIOR: odbcori = SQL_FETCH_PRIOR; break;
+ case PDO_FETCH_ORI_FIRST: odbcori = SQL_FETCH_FIRST; break;
+ case PDO_FETCH_ORI_LAST: odbcori = SQL_FETCH_LAST; break;
+ case PDO_FETCH_ORI_ABS: odbcori = SQL_FETCH_ABSOLUTE; break;
+ case PDO_FETCH_ORI_REL: odbcori = SQL_FETCH_RELATIVE; break;
+ default:
+ strcpy(stmt->error_code, "HY106");
+ return 0;
+ }
+ rc = SQLFetchScroll(S->stmt, odbcori, offset);
+
+ if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
+ pdo_odbc_stmt_error("SQLFetchScroll");
+ return 1;
+ }
+
+ if (rc == SQL_NO_DATA) {
+ /* pdo_odbc_stmt_error("SQLFetchScroll"); */
+ return 0;
+ }
+
+ pdo_odbc_stmt_error("SQLFetchScroll");
+
+ return 0;
+}
+
+static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+{
+ pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
+ struct pdo_column_data *col = &stmt->columns[colno];
+ zend_bool dyn = FALSE;
+ RETCODE rc;
+ SWORD colnamelen;
+ SDWORD colsize;
+
+ rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
+ sizeof(S->cols[colno].colname)-1, &colnamelen,
+ &S->cols[colno].coltype, &colsize, NULL, NULL);
+
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_stmt_error("SQLBindCol");
+ return 0;
+ }
+
+ col->maxlen = S->cols[colno].datalen = colsize;
+ col->namelen = colnamelen;
+ col->name = estrdup(S->cols[colno].colname);
+
+ /* returning data as a string */
+ col->param_type = PDO_PARAM_STR;
+
+ /* tell ODBC to put it straight into our buffer, but only if it
+ * isn't "long" data */
+ if (colsize < 256) {
+ S->cols[colno].data = emalloc(colsize+1);
+
+ rc = SQLBindCol(S->stmt, colno+1, SQL_C_CHAR, S->cols[colno].data,
+ S->cols[colno].datalen+1, &S->cols[colno].fetched_len);
+
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_stmt_error("SQLBindCol");
+ return 0;
+ }
+ } else {
+ /* allocate a smaller buffer to keep around for smaller
+ * "long" columns */
+ S->cols[colno].data = emalloc(256);
+ }
+
+ return 1;
+}
+
+static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC)
+{
+ pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
+ pdo_odbc_column *C = &S->cols[colno];
+
+ /* if it is a column containing "long" data, perform late binding now */
+ if (C->datalen > 255) {
+ unsigned long alloced = 4096;
+ unsigned long used = 0;
+ char *buf;
+ RETCODE rc;
+
+ /* fetch it into C->data, which is allocated with a length
+ * of 256 bytes; if there is more to be had, we then allocate
+ * bigger buffer for the caller to free */
+
+ rc = SQLGetData(S->stmt, colno+1, SQL_C_CHAR, C->data,
+ 256, &C->fetched_len);
+
+ if (rc == SQL_SUCCESS) {
+ /* all the data fit into our little buffer;
+ * jump down to the generic bound data case */
+ goto in_data;
+ }
+
+ if (rc == SQL_SUCCESS_WITH_INFO) {
+ /* promote up to a bigger buffer */
+
+ if (C->fetched_len != SQL_NO_TOTAL) {
+ /* use size suggested by the driver, if it knows it */
+ alloced = C->fetched_len + 1;
+ }
+
+ buf = emalloc(alloced);
+ memcpy(buf, C->data, 256);
+ used = 255; /* not 256; the driver NUL terminated the buffer */
+
+ do {
+ C->fetched_len = 0;
+ rc = SQLGetData(S->stmt, colno+1, SQL_C_CHAR,
+ buf + used, alloced - used,
+ &C->fetched_len);
+
+ if (rc == SQL_NO_DATA) {
+ /* we got the lot */
+ break;
+ }
+
+ if (C->fetched_len == SQL_NO_TOTAL) {
+ used += alloced - used;
+ } else {
+ used += C->fetched_len;
+ }
+
+ /* we need to fetch another chunk; resize the
+ * buffer */
+ alloced *= 2;
+ buf = erealloc(buf, alloced);
+ } while (1);
+
+ /* size down */
+ if (used < alloced - 1024) {
+ alloced = used+1;
+ buf = erealloc(buf, used+1);
+ }
+ buf[used] = '\0';
+ *ptr = buf;
+ *caller_frees = 1;
+ *len = used;
+ return 1;
+ }
+
+ /* something went caca */
+ *ptr = NULL;
+ *len = 0;
+ return 1;
+ }
+
+in_data:
+ /* check the indicator to ensure that the data is intact */
+ if (C->fetched_len == SQL_NULL_DATA) {
+ /* A NULL value */
+ *ptr = NULL;
+ *len = 0;
+ return 1;
+ } else if (C->fetched_len >= 0) {
+ /* it was stored perfectly */
+ *ptr = C->data;
+ *len = C->fetched_len;
+ return 1;
+ } else {
+ /* no data? */
+ *ptr = NULL;
+ *len = 0;
+ return 1;
+ }
+}
+
+static int odbc_stmt_set_param(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC)
+{
+ SQLRETURN rc;
+ pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
+
+ switch (attr) {
+ case PDO_ATTR_CURSOR_NAME:
+ convert_to_string(val);
+ rc = SQLSetCursorName(S->stmt, Z_STRVAL_P(val), Z_STRLEN_P(val));
+
+ if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
+ return 1;
+ }
+ pdo_odbc_stmt_error("SQLSetCursorName");
+ return 0;
+
+ default:
+ strcpy(S->einfo.last_err_msg, "Unknown Attribute");
+ S->einfo.what = "setAttribute";
+ strcpy(S->einfo.last_state, "IM0001");
+ return -1;
+ }
+}
+
+static int odbc_stmt_get_attr(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC)
+{
+ SQLRETURN rc;
+ pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
+
+ switch (attr) {
+ case PDO_ATTR_CURSOR_NAME:
+ {
+ char buf[256];
+ SQLSMALLINT len = 0;
+ rc = SQLGetCursorName(S->stmt, buf, sizeof(buf), &len);
+
+ if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
+ ZVAL_STRINGL(val, buf, len, 1);
+ return 1;
+ }
+ pdo_odbc_stmt_error("SQLGetCursorName");
+ return 0;
+ }
+
+ default:
+ strcpy(S->einfo.last_err_msg, "Unknown Attribute");
+ S->einfo.what = "getAttribute";
+ strcpy(S->einfo.last_state, "IM0001");
+ return -1;
+ }
+}
+
+static int odbc_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ SQLRETURN rc;
+ SQLSMALLINT colcount;
+ pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
+
+ /* NOTE: can't guarantee that output or input/output parameters
+ * are set until this fella returns SQL_NO_DATA, according to
+ * MSDN ODBC docs */
+ rc = SQLMoreResults(S->stmt);
+
+ if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
+ return 0;
+ }
+
+ free_cols(stmt, S TSRMLS_CC);
+ /* how many columns do we have ? */
+ SQLNumResultCols(S->stmt, &colcount);
+ stmt->column_count = (int)colcount;
+ S->cols = ecalloc(colcount, sizeof(pdo_odbc_column));
+
+ return 1;
+}
+
+struct pdo_stmt_methods odbc_stmt_methods = {
+ odbc_stmt_dtor,
+ odbc_stmt_execute,
+ odbc_stmt_fetch,
+ odbc_stmt_describe,
+ odbc_stmt_get_col,
+ odbc_stmt_param_hook,
+ odbc_stmt_set_param,
+ odbc_stmt_get_attr, /* get attr */
+ NULL, /* get column meta */
+ odbc_stmt_next_rowset
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_odbc/package.xml b/ext/pdo_odbc/package.xml
new file mode 100755
index 000000000..3d066fbaa
--- /dev/null
+++ b/ext/pdo_odbc/package.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE package SYSTEM "../pear/package.dtd">
+<package version="1.0">
+ <name>PDO_ODBC</name>
+ <summary>ODBC v3 Interface driver for PDO</summary>
+ <maintainers>
+ <maintainer>
+ <user>wez</user>
+ <name>Wez Furlong</name>
+ <email>wez@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ </maintainers>
+ <configureoptions>
+ <configureoption name="with-pdo-odbc" prompt="flavour,dir? (just leave blank for help)"/>
+</configureoptions>
+ <description>
+ This extension provides an ODBC v3 driver for PDO. It supports unixODBC
+ and IBM DB2 libraries, and will support more in future releases.
+ </description>
+ <license>PHP</license>
+ <release>
+ <state>stable</state>
+ <version>1.0</version>
+ <date>2005-11-26</date>
+
+ <notes>
+You need to install the PDO core module before you can make use of this one.
+You also require either IBM DB2 CLI libraries or unixODBC.
+
+If you are running on windows, you can download the binary from here:
+http://pecl4win.php.net/ext.php/php_pdo_odbc.dll
+ </notes>
+
+ <filelist>
+ <file role="src" name="config.m4"/>
+ <file role="src" name="config.w32"/>
+ <file role="src" name="pdo_odbc.c"/>
+ <file role="src" name="odbc_driver.c"/>
+ <file role="src" name="odbc_stmt.c"/>
+ <file role="src" name="php_pdo_odbc.h"/>
+ <file role="src" name="php_pdo_odbc_int.h"/>
+
+ <file role="doc" name="CREDITS"/>
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="5.0.3"/>
+ <dep type="ext" rel="ge" name="pdo" version="1.0"/>
+ </deps>
+ </release>
+</package>
diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c
new file mode 100755
index 000000000..eaec0ba85
--- /dev/null
+++ b/ext/pdo_odbc/pdo_odbc.c
@@ -0,0 +1,184 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_odbc.c,v 1.14.2.6 2005/11/26 20:50:07 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_odbc.h"
+#include "php_pdo_odbc_int.h"
+
+/* {{{ pdo_odbc_functions[] */
+function_entry pdo_odbc_functions[] = {
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ pdo_odbc_deps[] */
+#if ZEND_MODULE_API_NO >= 20050922
+static zend_module_dep pdo_odbc_deps[] = {
+ ZEND_MOD_REQUIRED("pdo")
+ {NULL, NULL, NULL}
+};
+#endif
+/* }}} */
+
+/* {{{ pdo_odbc_module_entry */
+zend_module_entry pdo_odbc_module_entry = {
+#if ZEND_MODULE_API_NO >= 20050922
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_odbc_deps,
+#else
+ STANDARD_MODULE_HEADER,
+#endif
+ "PDO_ODBC",
+ pdo_odbc_functions,
+ PHP_MINIT(pdo_odbc),
+ PHP_MSHUTDOWN(pdo_odbc),
+ NULL,
+ NULL,
+ PHP_MINFO(pdo_odbc),
+ "1.0",
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_PDO_ODBC
+ZEND_GET_MODULE(pdo_odbc)
+#endif
+
+#ifdef SQL_ATTR_CONNECTION_POOLING
+SQLUINTEGER pdo_odbc_pool_on = SQL_CP_OFF;
+SQLUINTEGER pdo_odbc_pool_mode = SQL_CP_ONE_PER_HENV;
+#endif
+
+#if defined(DB2CLI_VER) && !defined(PHP_WIN32)
+PHP_INI_BEGIN()
+ PHP_INI_ENTRY("pdo_odbc.db2_instance_name", NULL, PHP_INI_SYSTEM, NULL)
+PHP_INI_END()
+
+#endif
+
+/* {{{ PHP_MINIT_FUNCTION */
+PHP_MINIT_FUNCTION(pdo_odbc)
+{
+#ifdef SQL_ATTR_CONNECTION_POOLING
+ char *pooling_val = NULL;
+#endif
+
+ if (FAILURE == php_pdo_register_driver(&pdo_odbc_driver)) {
+ return FAILURE;
+ }
+
+#if defined(DB2CLI_VER) && !defined(PHP_WIN32)
+ REGISTER_INI_ENTRIES();
+ {
+ char *instance = INI_STR("pdo_odbc.db2_instance_name");
+ if (instance) {
+ char *env = malloc(sizeof("DB2INSTANCE=") + strlen(instance));
+ strcpy(env, "DB2INSTANCE=");
+ strcat(env, instance);
+ putenv(env);
+ /* after this point, we can't free env without breaking the environment */
+ }
+ }
+#endif
+
+#ifdef SQL_ATTR_CONNECTION_POOLING
+ /* ugh, we don't really like .ini stuff in PDO, but since ODBC connection
+ * pooling is process wide, we can't set it from within the scope of a
+ * request without affecting others, which goes against our isolated request
+ * policy. So, we use cfg_get_string here to check it this once.
+ * */
+ if (FAILURE == cfg_get_string("pdo_odbc.connection_pooling", &pooling_val) || pooling_val == NULL) {
+ pooling_val = "strict";
+ }
+ if (strcasecmp(pooling_val, "strict") == 0 || strcmp(pooling_val, "1") == 0) {
+ pdo_odbc_pool_on = SQL_CP_ONE_PER_HENV;
+ pdo_odbc_pool_mode = SQL_CP_STRICT_MATCH;
+ } else if (strcasecmp(pooling_val, "relaxed") == 0) {
+ pdo_odbc_pool_on = SQL_CP_ONE_PER_HENV;
+ pdo_odbc_pool_mode = SQL_CP_RELAXED_MATCH;
+ } else if (*pooling_val == '\0' || strcasecmp(pooling_val, "off") == 0) {
+ pdo_odbc_pool_on = SQL_CP_OFF;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value MUST be one of 'strict', 'relaxed' or 'off'");
+ return FAILURE;
+ }
+
+ if (pdo_odbc_pool_on != SQL_CP_OFF) {
+ SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)pdo_odbc_pool_on, 0);
+ }
+#endif
+
+ REGISTER_PDO_CLASS_CONST_LONG("ODBC_ATTR_USE_CURSOR_LIBRARY", PDO_ODBC_ATTR_USE_CURSOR_LIBRARY);
+ REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED);
+ REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_DRIVER", SQL_CUR_USE_DRIVER);
+ REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_ODBC", SQL_CUR_USE_ODBC);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(pdo_odbc)
+{
+#if defined(DB2CLI_VER) && !defined(PHP_WIN32)
+ UNREGISTER_INI_ENTRIES();
+#endif
+ php_pdo_unregister_driver(&pdo_odbc_driver);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(pdo_odbc)
+{
+ php_info_print_table_start();
+ php_info_print_table_header(2, "PDO Driver for ODBC (" PDO_ODBC_TYPE ")" , "enabled");
+#ifdef SQL_ATTR_CONNECTION_POOLING
+ php_info_print_table_row(2, "ODBC Connection Pooling", pdo_odbc_pool_on == SQL_CP_OFF ?
+ "Disabled" : (pdo_odbc_pool_mode == SQL_CP_STRICT_MATCH ? "Enabled, strict matching" : "Enabled, relaxed matching"));
+#else
+ php_info_print_table_row(2, "ODBC Connection Pooling", "Not supported in this build");
+#endif
+ php_info_print_table_end();
+
+#if defined(DB2CLI_VER) && !defined(PHP_WIN32)
+ DISPLAY_INI_ENTRIES();
+#endif
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/fam/php_fam.h b/ext/pdo_odbc/php_pdo_odbc.h
index 7875d9156..2803e293a 100644
--- a/ext/fam/php_fam.h
+++ b/ext/pdo_odbc/php_pdo_odbc.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,75 +12,70 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Author: |
+ | Author: Wez Furlong <wez@php.net> |
+----------------------------------------------------------------------+
-
- $Id: php_fam.h,v 1.4.2.1 2005/02/08 05:38:04 rasmus Exp $
*/
-#ifndef PHP_FAM_H
-#define PHP_FAM_H
+/* $Id: php_pdo_odbc.h,v 1.2 2005/07/07 12:49:21 wez Exp $ */
+
+#ifndef PHP_PDO_ODBC_H
+#define PHP_PDO_ODBC_H
-extern zend_module_entry fam_module_entry;
-#define phpext_fam_ptr &fam_module_entry
+extern zend_module_entry pdo_odbc_module_entry;
+#define phpext_pdo_odbc_ptr &pdo_odbc_module_entry
#ifdef PHP_WIN32
-#define PHP_FAM_API __declspec(dllexport)
+#define PHP_PDO_ODBC_API __declspec(dllexport)
#else
-#define PHP_FAM_API
+#define PHP_PDO_ODBC_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
-PHP_MINIT_FUNCTION(fam);
-PHP_MINFO_FUNCTION(fam);
+PHP_MINIT_FUNCTION(pdo_odbc);
+PHP_MSHUTDOWN_FUNCTION(pdo_odbc);
+PHP_RINIT_FUNCTION(pdo_odbc);
+PHP_RSHUTDOWN_FUNCTION(pdo_odbc);
+PHP_MINFO_FUNCTION(pdo_odbc);
-PHP_FUNCTION(fam_open);
-PHP_FUNCTION(fam_close);
-PHP_FUNCTION(fam_monitor_directory);
-PHP_FUNCTION(fam_monitor_file);
-PHP_FUNCTION(fam_monitor_collection);
-PHP_FUNCTION(fam_suspend_monitor);
-PHP_FUNCTION(fam_resume_monitor);
-PHP_FUNCTION(fam_cancel_monitor);
-PHP_FUNCTION(fam_pending);
-PHP_FUNCTION(fam_next_event);
+PHP_FUNCTION(confirm_pdo_odbc_compiled); /* For testing, remove later. */
/*
Declare any global variables you may need between the BEGIN
and END macros here:
-ZEND_BEGIN_MODULE_GLOBALS(fam)
- int global_value;
+ZEND_BEGIN_MODULE_GLOBALS(pdo_odbc)
+ long global_value;
char *global_string;
-ZEND_END_MODULE_GLOBALS(fam)
+ZEND_END_MODULE_GLOBALS(pdo_odbc)
*/
/* In every utility function you add that needs to use variables
- in php_fam_globals, call TSRM_FETCH(); after declaring other
+ in php_pdo_odbc_globals, call TSRMLS_FETCH(); after declaring other
variables used by that function, or better yet, pass in TSRMLS_CC
after the last function argument and declare your utility function
with TSRMLS_DC after the last declared argument. Always refer to
- the globals in your function as FAM_G(variable). You are
+ the globals in your function as PDO_ODBC_G(variable). You are
encouraged to rename these macros something shorter, see
examples in any other php module directory.
*/
#ifdef ZTS
-#define FAM_G(v) TSRMG(fam_globals_id, zend_fam_globals *, v)
+#define PDO_ODBC_G(v) TSRMG(pdo_odbc_globals_id, zend_pdo_odbc_globals *, v)
#else
-#define FAM_G(v) (fam_globals.v)
+#define PDO_ODBC_G(v) (pdo_odbc_globals.v)
#endif
-#endif /* PHP_FAM_H */
+#endif /* PHP_PDO_ODBC_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
- * indent-tabs-mode: t
* End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
*/
diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h
new file mode 100755
index 000000000..caa31f3cb
--- /dev/null
+++ b/ext/pdo_odbc/php_pdo_odbc_int.h
@@ -0,0 +1,182 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_odbc_int.h,v 1.9 2005/07/07 12:49:21 wez Exp $ */
+
+#ifdef PHP_WIN32
+# define PDO_ODBC_TYPE "Win32"
+#endif
+
+#ifndef PDO_ODBC_TYPE
+# warning Please fix configure to give your ODBC libraries a name
+# define PDO_ODBC_TYPE "Unknown"
+#endif
+
+/* {{{ Roll a dice, pick a header at random... */
+#if HAVE_SQLCLI1_H
+# include <sqlcli1.h>
+# if defined(DB268K) && HAVE_LIBRARYMANAGER_H
+# include <LibraryManager.h>
+# endif
+#endif
+
+#if HAVE_ODBC_H
+# include <odbc.h>
+#endif
+
+#if HAVE_IODBC_H
+# include <iodbc.h>
+#endif
+
+#if HAVE_SQLUNIX_H && !defined(PHP_WIN32)
+# include <sqlunix.h>
+#endif
+
+#if HAVE_SQLTYPES_H
+# include <sqltypes.h>
+#endif
+
+#if HAVE_SQLUCODE_H
+# include <sqlucode.h>
+#endif
+
+#if HAVE_SQL_H
+# include <sql.h>
+#endif
+
+#if HAVE_ISQL_H
+# include <isql.h>
+#endif
+
+#if HAVE_SQLEXT_H
+# include <sqlext.h>
+#endif
+
+#if HAVE_ISQLEXT_H
+# include <isqlext.h>
+#endif
+
+#if HAVE_UDBCEXT_H
+# include <udbcext.h>
+#endif
+
+#if HAVE_CLI0CORE_H
+# include <cli0core.h>
+#endif
+
+#if HAVE_CLI0EXT1_H
+# include <cli0ext.h>
+#endif
+
+#if HAVE_CLI0CLI_H
+# include <cli0cli.h>
+#endif
+
+#if HAVE_CLI0DEFS_H
+# include <cli0defs.h>
+#endif
+
+#if HAVE_CLI0ENV_H
+# include <cli0env.h>
+#endif
+
+#if HAVE_ODBCSDK_H
+# include <odbcsdk.h>
+#endif
+
+/* }}} */
+
+/* {{{ Figure out the type for handles */
+#if !defined(HENV) && !defined(SQLHENV) && defined(SQLHANDLE)
+# define PDO_ODBC_HENV SQLHANDLE
+# define PDO_ODBC_HDBC SQLHANDLE
+# define PDO_ODBC_HSTMT SQLHANDLE
+#elif !defined(HENV) && (defined(SQLHENV) || defined(DB2CLI_VER))
+# define PDO_ODBC_HENV SQLHENV
+# define PDO_ODBC_HDBC SQLHDBC
+# define PDO_ODBC_HSTMT SQLHSTMT
+#else
+# define PDO_ODBC_HENV HENV
+# define PDO_ODBC_HDBC HDBC
+# define PDO_ODBC_HSTMT HSTMT
+#endif
+/* }}} */
+
+typedef struct {
+ char last_state[6];
+ char last_err_msg[SQL_MAX_MESSAGE_LENGTH];
+ SDWORD last_error;
+ const char *file, *what;
+ int line;
+} pdo_odbc_errinfo;
+
+typedef struct {
+ PDO_ODBC_HENV env;
+ PDO_ODBC_HDBC dbc;
+ pdo_odbc_errinfo einfo;
+} pdo_odbc_db_handle;
+
+typedef struct {
+ char *data;
+ unsigned long datalen;
+ long fetched_len;
+ SWORD coltype;
+ char colname[32];
+} pdo_odbc_column;
+
+typedef struct {
+ PDO_ODBC_HSTMT stmt;
+ pdo_odbc_column *cols;
+ pdo_odbc_db_handle *H;
+ pdo_odbc_errinfo einfo;
+} pdo_odbc_stmt;
+
+typedef struct {
+ SQLINTEGER len;
+ SQLSMALLINT paramtype;
+ char *outbuf;
+} pdo_odbc_param;
+
+extern pdo_driver_t pdo_odbc_driver;
+extern struct pdo_stmt_methods odbc_stmt_methods;
+
+void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line TSRMLS_DC);
+#define pdo_odbc_drv_error(what) pdo_odbc_error(dbh, NULL, SQL_NULL_HSTMT, what, __FILE__, __LINE__ TSRMLS_CC)
+#define pdo_odbc_stmt_error(what) pdo_odbc_error(stmt->dbh, stmt, SQL_NULL_HSTMT, what, __FILE__, __LINE__ TSRMLS_CC)
+#define pdo_odbc_doer_error(what) pdo_odbc_error(dbh, NULL, stmt, what, __FILE__, __LINE__ TSRMLS_CC)
+
+void pdo_odbc_init_error_table(void);
+void pdo_odbc_fini_error_table(void);
+
+#ifdef SQL_ATTR_CONNECTION_POOLING
+extern SQLUINTEGER pdo_odbc_pool_on;
+extern SQLUINTEGER pdo_odbc_pool_mode;
+#endif
+
+enum {
+ PDO_ODBC_ATTR_USE_CURSOR_LIBRARY = PDO_ATTR_DRIVER_SPECIFIC,
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_odbc/tests/common.phpt b/ext/pdo_odbc/tests/common.phpt
new file mode 100644
index 000000000..f64da1a43
--- /dev/null
+++ b/ext/pdo_odbc/tests/common.phpt
@@ -0,0 +1,48 @@
+--TEST--
+ODBC
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_odbc')) print 'skip'; ?>
+--REDIRECTTEST--
+# magic auto-configuration
+
+$config = array(
+ 'TESTS' => 'ext/pdo/tests'
+);
+
+
+if (false !== getenv('PDO_ODBC_TEST_DSN')) {
+ # user set them from their shell
+ $config['ENV']['PDOTEST_DSN'] = getenv('PDO_ODBC_TEST_DSN');
+ $config['ENV']['PDOTEST_USER'] = getenv('PDO_ODBC_TEST_USER');
+ $config['ENV']['PDOTEST_PASS'] = getenv('PDO_ODBC_TEST_PASS');
+ if (false !== getenv('PDO_ODBC_TEST_ATTR')) {
+ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_ODBC_TEST_ATTR');
+ }
+} elseif (preg_match('/^WIN/i', PHP_OS)) {
+ # on windows, try to create a temporary MS access database
+ $path = realpath(dirname(__FILE__)) . '\pdo_odbc.mdb';
+ if (!file_exists($path)) {
+ try {
+ $adox = new COM('ADOX.Catalog');
+ $adox->Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' . $path);
+ $adox = null;
+
+ } catch (Exception $e) {
+ }
+ }
+ if (file_exists($path)) {
+ $config['ENV']['PDOTEST_DSN'] = "odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=$path;Uid=Admin";
+ }
+}
+# other magic autodetection here, eg: for DB2 by inspecting env
+/*
+$USER = 'db2inst1';
+$PASSWD = 'ibmdb2';
+$DBNAME = 'SAMPLE';
+
+$CONNECTION = "odbc:DSN=$DBNAME;UID=$USER;PWD=$PASSWD;";
+*/
+
+
+return $config;
diff --git a/ext/pdo_odbc/tests/long_columns.phpt b/ext/pdo_odbc/tests/long_columns.phpt
new file mode 100644
index 000000000..bc3abe94c
--- /dev/null
+++ b/ext/pdo_odbc/tests/long_columns.phpt
@@ -0,0 +1,44 @@
+--TEST--
+PDO ODBC "long" columns
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_odbc')) print 'skip not loaded';
+?>
+--FILE--
+<?php
+require 'ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory('ext/pdo_odbc/tests/common.phpt');
+$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
+
+if (false === $db->exec('CREATE TABLE TEST (id INT NOT NULL PRIMARY KEY, data CLOB)')) {
+ if (false === $db->exec('CREATE TABLE TEST (id INT NOT NULL PRIMARY KEY, data longtext)')) {
+ die("BORK: don't know how to create a long column here:\n" . implode(", ", $db->errorInfo()));
+ }
+}
+
+$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+$sizes = array(32, 64, 128, 253, 254, 255, 256, 257, 258, 512, 1024, 2048, 3998, 3999, 4000);
+
+$db->beginTransaction();
+$insert = $db->prepare('INSERT INTO TEST VALUES (?, ?)');
+foreach ($sizes as $num) {
+ $insert->execute(array($num, str_repeat('i', $num)));
+}
+$insert = null;
+$db->commit();
+
+foreach ($db->query('SELECT id, data from TEST') as $row) {
+ $expect = str_repeat('i', $row[0]);
+ if (strcmp($expect, $row[1])) {
+ echo "Failed on size $row[id]:\n";
+ printf("Expected %d bytes, got %d\n", strlen($expect), strlen($row['data']));
+ echo bin2hex($expect) . "\n";
+ echo bin2hex($row['data']) . "\n";
+ }
+}
+
+echo "Finished\n";
+
+--EXPECT--
+Finished
diff --git a/ext/pdo_pgsql/CREDITS b/ext/pdo_pgsql/CREDITS
new file mode 100644
index 000000000..bbb7b9442
--- /dev/null
+++ b/ext/pdo_pgsql/CREDITS
@@ -0,0 +1,2 @@
+PostgreSQL driver for PDO
+Edin Kadribasic, Ilia Alshanetsky
diff --git a/ext/pdo_pgsql/config.m4 b/ext/pdo_pgsql/config.m4
new file mode 100644
index 000000000..fd9a9297a
--- /dev/null
+++ b/ext/pdo_pgsql/config.m4
@@ -0,0 +1,131 @@
+dnl
+dnl $Id: config.m4,v 1.13 2005/07/27 02:51:01 wez Exp $
+dnl
+
+if test "$PHP_PDO" != "no"; then
+
+AC_DEFUN([PHP_PGSQL_CHECK_FUNCTIONS],[
+])
+
+PHP_ARG_WITH(pdo-pgsql,for PostgreSQL support for PDO,
+[ --with-pdo-pgsql[=DIR] PDO: PostgreSQL support. DIR is the PostgreSQL base
+ install directory or the path to pg_config])
+
+if test "$PHP_PDO_PGSQL" != "no"; then
+ PHP_EXPAND_PATH($PGSQL_INCLUDE, PGSQL_INCLUDE)
+
+ AC_MSG_CHECKING(for pg_config)
+ for i in $PHP_PDO_PGSQL $PHP_PDO_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do
+ if test -x $i/pg_config; then
+ PG_CONFIG="$i/pg_config"
+ break;
+ fi
+ done
+
+ if test -n "$PG_CONFIG"; then
+ AC_MSG_RESULT([$PG_CONFIG])
+ PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+ PGSQL_LIBDIR=`$PG_CONFIG --libdir`
+ AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h])
+ else
+ AC_MSG_RESULT(not found)
+ if test "$PHP_PDO_PGSQL" = "yes"; then
+ PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql"
+ else
+ PGSQL_SEARCH_PATHS=$PHP_PDO_PGSQL
+ fi
+
+ for i in $PGSQL_SEARCH_PATHS; do
+ for j in include include/pgsql include/postgres include/postgresql ""; do
+ if test -r "$i/$j/libpq-fe.h"; then
+ PGSQL_INC_BASE=$i
+ PGSQL_INCLUDE=$i/$j
+ if test -r "$i/$j/pg_config.h"; then
+ AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h])
+ fi
+ fi
+ done
+
+ for j in lib lib/pgsql lib/postgres lib/postgresql ""; do
+ if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then
+ PGSQL_LIBDIR=$i/$j
+ fi
+ done
+ done
+ fi
+
+ if test -z "$PGSQL_INCLUDE"; then
+ AC_MSG_ERROR(Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path)
+ fi
+
+ if test -z "$PGSQL_LIBDIR"; then
+ AC_MSG_ERROR(Cannot find libpq.so. Please specify correct PostgreSQL installation path)
+ fi
+
+ if test -z "$PGSQL_INCLUDE" -a -z "$PGSQL_LIBDIR" ; then
+ AC_MSG_ERROR([Unable to find libpq anywhere under $withval])
+ fi
+
+ AC_DEFINE(HAVE_PDO_PGSQL,1,[Whether to build PostgreSQL for PDO support or not])
+
+ AC_MSG_CHECKING([for openssl dependencies])
+ if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then
+ AC_MSG_RESULT([yes])
+ if pkg-config openssl ; then
+ PDO_PGSQL_CFLAGS="`pkg-config openssl --cflags`"
+ fi
+ else
+ AC_MSG_RESULT([no])
+ fi
+
+ old_LIBS=$LIBS
+ old_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR"
+ AC_CHECK_LIB(pq, PQescapeString,AC_DEFINE(HAVE_PQESCAPE,1,[PostgreSQL 7.2.0 or later]))
+ AC_CHECK_LIB(pq, PQsetnonblocking,AC_DEFINE(HAVE_PQSETNONBLOCKING,1,[PostgreSQL 7.0.x or later]))
+ AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[Broken libpq under windows]))
+ AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[Older PostgreSQL]))
+ AC_CHECK_LIB(pq, PQclientEncoding,AC_DEFINE(HAVE_PQCLIENTENCODING,1,[PostgreSQL 7.0.x or later]))
+ AC_CHECK_LIB(pq, PQparameterStatus,AC_DEFINE(HAVE_PQPARAMETERSTATUS,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQprotocolVersion,AC_DEFINE(HAVE_PQPROTOCOLVERSION,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQtransactionStatus,AC_DEFINE(HAVE_PGTRANSACTIONSTATUS,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQunescapeBytea,AC_DEFINE(HAVE_PQUNESCAPEBYTEA,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQExecParams,AC_DEFINE(HAVE_PQEXECPARAMS,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQresultErrorField,AC_DEFINE(HAVE_PQRESULTERRORFIELD,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether libpq is compiled with --enable-multibyte]))
+
+ AC_CHECK_LIB(pq, PQprepare,AC_DEFINE(HAVE_PQPREPARE,1,[prepared statements]))
+
+ LIBS=$old_LIBS
+ LDFLAGS=$old_LDFLAGS
+
+ PHP_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, PDO_PGSQL_SHARED_LIBADD)
+ PHP_SUBST(PDO_PGSQL_SHARED_LIBADD)
+
+ PHP_ADD_INCLUDE($PGSQL_INCLUDE)
+
+ ifdef([PHP_CHECK_PDO_INCLUDES],
+ [
+ PHP_CHECK_PDO_INCLUDES
+ ],[
+ AC_MSG_CHECKING([for PDO includes])
+ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$prefix/include/php/ext
+ else
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
+ fi
+ AC_MSG_RESULT($pdo_inc_path)
+ ])
+
+ PHP_NEW_EXTENSION(pdo_pgsql, pdo_pgsql.c pgsql_driver.c pgsql_statement.c, $ext_shared,,-I$pdo_inc_path $PDO_PGSQL_CFLAGS)
+ ifdef([PHP_ADD_EXTENSION_DEP],
+ [
+ PHP_ADD_EXTENSION_DEP(pdo_pgsql, pdo)
+ ])
+fi
+
+fi
diff --git a/ext/pdo_pgsql/config.w32 b/ext/pdo_pgsql/config.w32
new file mode 100644
index 000000000..36a2ea7f2
--- /dev/null
+++ b/ext/pdo_pgsql/config.w32
@@ -0,0 +1,17 @@
+// $Id: config.w32,v 1.4 2005/05/16 17:34:44 edink Exp $
+// vim:ft=javascript
+
+ARG_WITH("pdo-pgsql", "PostgreSQL support for PDO", "no");
+
+if (PHP_PDO_PGSQL != "no") {
+ if (CHECK_LIB("libpq.lib", "pdo_pgsql", PHP_PDO_PGSQL) &&
+ CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql")) {
+ EXTENSION("pdo_pgsql", "pdo_pgsql.c pgsql_driver.c pgsql_statement.c");
+ ADD_FLAG('CFLAGS_PDO_PGSQL', "/I ..\\pecl");
+ AC_DEFINE('HAVE_PDO_PGSQL', 1, 'Have PostgreSQL library');
+ ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PQPARAMETERSTATUS=1 /D HAVE_PQPROTOCOLVERSION=1 /D HAVE_PGTRANSACTIONSTATUS=1 /D HAVE_PQUNESCAPEBYTEA=1 /D HAVE_PQRESULTERRORFIELD=1");
+ } else {
+ WARNING("pdo_pgsql not enabled; libraries and headers not found");
+ }
+ ADD_EXTENSION_DEP('pdo_pgsql', 'pdo');
+}
diff --git a/ext/pdo_pgsql/package.xml b/ext/pdo_pgsql/package.xml
new file mode 100644
index 000000000..2f093a9ef
--- /dev/null
+++ b/ext/pdo_pgsql/package.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE package SYSTEM "../pear/package.dtd">
+<package version="1.0">
+ <name>PDO_PGSQL</name>
+ <summary>PostgreSQL driver for PDO</summary>
+ <maintainers>
+ <maintainer>
+ <user>edink</user>
+ <name>Edin Kadribasic</name>
+ <email>edink@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>iliaa</user>
+ <name>Ilia Alshanetsky</name>
+ <email>iliaa@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>wez</user>
+ <name>Wez Furlong</name>
+ <email>wez@php.net</email>
+ <role>lead</role>
+ </maintainer>
+
+ </maintainers>
+ <description>
+ This extension provides an PostgreSQL driver for PDO.
+ </description>
+ <license>PHP</license>
+ <release>
+ <state>stable</state>
+ <version>1.0</version>
+ <date>2005-11-26</date>
+
+ <notes>
+Now features native prepared statements and numerous other improvements.
+
+You need to install the PDO core module before you can make use of this one.
+You also require PostgreSQL client libraries installed on the machine where you
+intend to build and/or use it.
+
+If you are running on windows, you can download the binary from here:
+http://pecl4win.php.net/ext.php/php_pdo_pgsql.dll
+ </notes>
+
+ <filelist>
+ <file role="src" name="config.m4"/>
+ <file role="src" name="config.w32"/>
+ <file role="src" name="pdo_pgsql.c"/>
+ <file role="src" name="pgsql_driver.c"/>
+ <file role="src" name="pgsql_statement.c"/>
+ <file role="src" name="php_pdo_pgsql.h"/>
+ <file role="src" name="php_pdo_pgsql_int.h"/>
+
+ <file role="doc" name="CREDITS"/>
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="5.0.3"/>
+ <dep type="ext" rel="ge" name="pdo" version="1.0"/>
+ </deps>
+ </release>
+</package>
diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c
new file mode 100644
index 000000000..72dfac108
--- /dev/null
+++ b/ext/pdo_pgsql/pdo_pgsql.c
@@ -0,0 +1,129 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Edin Kadribasic <edink@emini.dk> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_pgsql.c,v 1.7.2.6 2005/11/26 20:50:08 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_pgsql.h"
+#include "php_pdo_pgsql_int.h"
+
+/* {{{ pdo_pgsql_functions[] */
+function_entry pdo_pgsql_functions[] = {
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ pdo_sqlite_deps
+ */
+#if ZEND_MODULE_API_NO >= 20050922
+static zend_module_dep pdo_pgsql_deps[] = {
+ ZEND_MOD_REQUIRED("pdo")
+ {NULL, NULL, NULL}
+};
+#endif
+/* }}} */
+
+/* {{{ pdo_pgsql_module_entry */
+zend_module_entry pdo_pgsql_module_entry = {
+#if ZEND_MODULE_API_NO >= 20050922
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_pgsql_deps,
+#else
+ STANDARD_MODULE_HEADER,
+#endif
+ "pdo_pgsql",
+ pdo_pgsql_functions,
+ PHP_MINIT(pdo_pgsql),
+ PHP_MSHUTDOWN(pdo_pgsql),
+ PHP_RINIT(pdo_pgsql),
+ PHP_RSHUTDOWN(pdo_pgsql),
+ PHP_MINFO(pdo_pgsql),
+ "1.0",
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_PDO_PGSQL
+ZEND_GET_MODULE(pdo_pgsql)
+#endif
+
+/* true global environment */
+
+/* {{{ PHP_MINIT_FUNCTION
+ */
+PHP_MINIT_FUNCTION(pdo_pgsql)
+{
+ php_pdo_register_driver(&pdo_pgsql_driver);
+ REGISTER_PDO_CLASS_CONST_LONG("PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT", PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(pdo_pgsql)
+{
+ php_pdo_unregister_driver(&pdo_pgsql_driver);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_RINIT_FUNCTION
+ */
+PHP_RINIT_FUNCTION(pdo_pgsql)
+{
+ /* php_pdo_register_driver(&pdo_pgsql_driver); */
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_RSHUTDOWN_FUNCTION(pdo_pgsql)
+{
+ /* php_pdo_unregister_driver(&pdo_pgsql_driver); */
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(pdo_pgsql)
+{
+ php_info_print_table_start();
+ php_info_print_table_header(2, "PDO Driver for PostgreSQL", "enabled");
+ php_info_print_table_end();
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
new file mode 100644
index 000000000..99c37d681
--- /dev/null
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -0,0 +1,492 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Edin Kadribasic <edink@emini.dk> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pgsql_driver.c,v 1.53.2.1 2005/11/25 03:35:04 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+
+#include "pg_config.h" /* needed for PG_VERSION */
+#include "php_pdo_pgsql.h"
+#include "php_pdo_pgsql_int.h"
+#include "zend_exceptions.h"
+
+static char * _pdo_pgsql_trim_message(const char *message, int persistent)
+{
+ register int i = strlen(message)-1;
+ char *tmp;
+
+ if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') {
+ --i;
+ }
+ while (i>0 && (message[i] == '\r' || message[i] == '\n')) {
+ --i;
+ }
+ ++i;
+ tmp = pemalloc(i + 1, persistent);
+ memcpy(tmp, message, i);
+ tmp[i] = '\0';
+
+ return tmp;
+}
+
+int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *file, int line TSRMLS_DC) /* {{{ */
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+ pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code;
+ pdo_pgsql_error_info *einfo = &H->einfo;
+ char *errmsg = PQerrorMessage(H->server);
+
+ einfo->errcode = errcode;
+ einfo->file = file;
+ einfo->line = line;
+
+ if (einfo->errmsg) {
+ pefree(einfo->errmsg, dbh->is_persistent);
+ einfo->errmsg = NULL;
+ }
+
+ if (sqlstate == NULL) {
+ strcpy(*pdo_err, "HY000");
+ }
+ else {
+ strcpy(*pdo_err, sqlstate);
+ }
+
+ if (errmsg) {
+ einfo->errmsg = _pdo_pgsql_trim_message(errmsg, dbh->is_persistent);
+ }
+
+ if (!dbh->methods) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ *pdo_err, einfo->errcode, einfo->errmsg);
+ }
+
+ return errcode;
+}
+/* }}} */
+
+static void _pdo_pgsql_notice(pdo_dbh_t *dbh, const char *message) /* {{{ */
+{
+/* pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; */
+}
+/* }}} */
+
+static int pdo_pgsql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+ pdo_pgsql_error_info *einfo = &H->einfo;
+
+ if (einfo->errcode) {
+ add_next_index_long(info, einfo->errcode);
+ add_next_index_string(info, einfo->errmsg, 1);
+ }
+
+ return 1;
+}
+/* }}} */
+
+static int pgsql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+ if (H) {
+ if (H->server) {
+ PQfinish(H->server);
+ H->server = NULL;
+ }
+ if (H->einfo.errmsg) {
+ pefree(H->einfo.errmsg, dbh->is_persistent);
+ H->einfo.errmsg = NULL;
+ }
+ pefree(H, dbh->is_persistent);
+ dbh->driver_data = NULL;
+ }
+ return 0;
+}
+/* }}} */
+
+static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+ pdo_pgsql_stmt *S = ecalloc(1, sizeof(pdo_pgsql_stmt));
+ int scrollable;
+#if HAVE_PQPREPARE
+ PGresult *res;
+ int ret;
+ char *nsql = NULL;
+ int nsql_len = 0;
+ ExecStatusType status;
+#endif
+
+ S->H = H;
+ stmt->driver_data = S;
+ stmt->methods = &pgsql_stmt_methods;
+
+ scrollable = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR,
+ PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL;
+
+ if (scrollable) {
+ /* TODO: check how scrollable cursors related to prepared statements */
+ spprintf(&S->cursor_name, 0, "pdo_pgsql_cursor_%08x", (unsigned int) stmt);
+ }
+
+#if HAVE_PQPREPARE
+ if ((!driver_options || pdo_attr_lval(driver_options,
+ PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, 0 TSRMLS_CC) == 0)
+ && PQprotocolVersion(H->server) > 2) {
+ stmt->supports_placeholders = PDO_PLACEHOLDER_NAMED;
+ stmt->named_rewrite_template = "$%d";
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+
+ if (ret == 1) {
+ /* query was re-written */
+ sql = nsql;
+ } else if (ret == -1) {
+ /* couldn't grok it */
+ strcpy(dbh->error_code, stmt->error_code);
+ return 0;
+ }
+
+ spprintf(&S->stmt_name, 0, "pdo_pgsql_stmt_%08x", (unsigned int)stmt);
+ /* that's all for now; we'll defer the actual prepare until the first execute call */
+
+ if (nsql) {
+ S->query = nsql;
+ } else {
+ S->query = estrdup(sql);
+ }
+
+ return 1;
+ }
+#endif
+
+ stmt->supports_placeholders = PDO_PLACEHOLDER_NONE;
+ return 1;
+}
+
+static long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC)
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+ PGresult *res;
+
+ if (!(res = PQexec(H->server, sql))) {
+ /* fatal error */
+ pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
+ return -1;
+ } else {
+ ExecStatusType qs = PQresultStatus(res);
+ if (qs != PGRES_COMMAND_OK && qs != PGRES_TUPLES_OK) {
+ pdo_pgsql_error(dbh, qs, pdo_pgsql_sqlstate(res));
+ PQclear(res);
+ return -1;
+ }
+ H->pgoid = PQoidValue(res);
+ PQclear(res);
+ }
+
+ return 1;
+}
+
+static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+{
+ unsigned char *escaped;
+
+ switch (paramtype) {
+ case PDO_PARAM_LOB:
+ /* escapedlen returned by PQescapeBytea() accounts for trailing 0 */
+ escaped = PQescapeBytea(unquoted, unquotedlen, quotedlen);
+ *quotedlen += 1;
+ *quoted = emalloc(*quotedlen + 1);
+ memcpy((*quoted)+1, escaped, *quotedlen-2);
+ (*quoted)[0] = '\'';
+ (*quoted)[*quotedlen-1] = '\'';
+ (*quoted)[*quotedlen] = '\0';
+ free(escaped);
+ break;
+ default:
+ *quoted = emalloc(2*unquotedlen + 3);
+ (*quoted)[0] = '\'';
+ *quotedlen = PQescapeString(*quoted + 1, unquoted, unquotedlen);
+ (*quoted)[*quotedlen + 1] = '\'';
+ (*quoted)[*quotedlen + 2] = '\0';
+ *quotedlen += 2;
+ }
+ return 1;
+}
+
+static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+ char *id = NULL;
+
+ if (name == NULL) {
+ if (H->pgoid == InvalidOid) {
+ return NULL;
+ }
+ *len = spprintf(&id, 0, "%ld", (long) H->pgoid);
+ } else {
+ PGresult *res;
+ ExecStatusType status;
+#ifdef HAVE_PQEXECPARAMS
+ const char *q[1];
+ q[0] = name;
+ res = PQexecParams(H->server, "SELECT CURRVAL($1)", 1, NULL, q, NULL, NULL, 0);
+#else
+ char *name_escaped, *q;
+ size_t l = strlen(name);
+
+ name_escaped = safe_emalloc(l, 2, 1);
+ PQescapeString(name_escaped, name, l);
+ spprintf(&q, 0, "SELECT CURRVAL('%s')", name_escaped);
+ res = PQexec(H->server, q);
+ efree(name_escaped);
+ efree(q);
+#endif
+ status = PQresultStatus(res);
+
+ if (res && (status == PGRES_TUPLES_OK)) {
+ id = estrdup((char *)PQgetvalue(res, 0, 0));
+ *len = PQgetlength(res, 0, 0);
+ } else {
+ pdo_pgsql_error(dbh, status, pdo_pgsql_sqlstate(res));
+ }
+
+ if (res) {
+ PQclear(res);
+ }
+ }
+ return id;
+}
+
+static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC)
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+
+ switch (attr) {
+ case PDO_ATTR_CLIENT_VERSION:
+ ZVAL_STRING(return_value, PG_VERSION, 1);
+ break;
+
+ case PDO_ATTR_SERVER_VERSION:
+#ifdef HAVE_PQPROTOCOLVERSION
+ if (PQprotocolVersion(H->server) >= 3) { /* PostgreSQL 7.4 or later */
+ ZVAL_STRING(return_value, (char*)PQparameterStatus(H->server, "server_version"), 1);
+ } else /* emulate above via a query */
+#endif
+ {
+ PGresult *res = PQexec(H->server, "SELECT VERSION()");
+ if (res && PQresultStatus(res) == PGRES_TUPLES_OK) {
+ ZVAL_STRING(return_value, (char *)PQgetvalue(res, 0, 0), 1);
+ }
+
+ if (res) {
+ PQclear(res);
+ }
+ }
+ break;
+
+ case PDO_ATTR_CONNECTION_STATUS:
+ switch (PQstatus(H->server)) {
+ case CONNECTION_STARTED:
+ ZVAL_STRINGL(return_value, "Waiting for connection to be made.", sizeof("Waiting for connection to be made.")-1, 1);
+ break;
+
+ case CONNECTION_MADE:
+ case CONNECTION_OK:
+ ZVAL_STRINGL(return_value, "Connection OK; waiting to send.", sizeof("Connection OK; waiting to send.")-1, 1);
+ break;
+
+ case CONNECTION_AWAITING_RESPONSE:
+ ZVAL_STRINGL(return_value, "Waiting for a response from the server.", sizeof("Waiting for a response from the server.")-1, 1);
+ break;
+
+ case CONNECTION_AUTH_OK:
+ ZVAL_STRINGL(return_value, "Received authentication; waiting for backend start-up to finish.", sizeof("Received authentication; waiting for backend start-up to finish.")-1, 1);
+ break;
+#ifdef CONNECTION_SSL_STARTUP
+ case CONNECTION_SSL_STARTUP:
+ ZVAL_STRINGL(return_value, "Negotiating SSL encryption.", sizeof("Negotiating SSL encryption.")-1, 1);
+ break;
+#endif
+ case CONNECTION_SETENV:
+ ZVAL_STRINGL(return_value, "Negotiating environment-driven parameter settings.", sizeof("Negotiating environment-driven parameter settings.")-1, 1);
+ break;
+
+ case CONNECTION_BAD:
+ default:
+ ZVAL_STRINGL(return_value, "Bad connection.", sizeof("Bad connection.")-1, 1);
+ break;
+ }
+ break;
+
+ case PDO_ATTR_SERVER_INFO: {
+ int spid = PQbackendPID(H->server);
+ char *tmp;
+#ifdef HAVE_PQPROTOCOLVERSION
+ spprintf(&tmp, 0,
+ "PID: %d; Client Encoding: %s; Is Superuser: %s; Session Authorization: %s; Date Style: %s",
+ spid,
+ (char*)PQparameterStatus(H->server, "client_encoding"),
+ (char*)PQparameterStatus(H->server, "is_superuser"),
+ (char*)PQparameterStatus(H->server, "session_authorization"),
+ (char*)PQparameterStatus(H->server, "DateStyle"));
+#else
+ spprintf(&tmp, 0, "PID: %d", spid);
+#endif
+ ZVAL_STRING(return_value, tmp, 0);
+ }
+ break;
+
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
+static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+ PGresult *res;
+ int ret = 1;
+
+ res = PQexec(H->server, cmd);
+
+ if (PQresultStatus(res) != PGRES_COMMAND_OK) {
+ ret = 0;
+ }
+
+ PQclear(res);
+ return ret;
+}
+
+static int pgsql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ return pdo_pgsql_transaction_cmd("BEGIN", dbh TSRMLS_CC);
+}
+
+static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ return pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC);
+}
+
+static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC);
+}
+
+static struct pdo_dbh_methods pgsql_methods = {
+ pgsql_handle_closer,
+ pgsql_handle_preparer,
+ pgsql_handle_doer,
+ pgsql_handle_quoter,
+ pgsql_handle_begin,
+ pgsql_handle_commit,
+ pgsql_handle_rollback,
+ NULL, /* set_attr */
+ pdo_pgsql_last_insert_id,
+ pdo_pgsql_fetch_error_func,
+ pdo_pgsql_get_attribute,
+ NULL, /* check_liveness */
+ NULL /* get_driver_methods */
+};
+
+static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+{
+ pdo_pgsql_db_handle *H;
+ int ret = 0;
+ char *conn_str, *p, *e;
+
+ H = pecalloc(1, sizeof(pdo_pgsql_db_handle), dbh->is_persistent);
+ dbh->driver_data = H;
+
+ H->einfo.errcode = 0;
+ H->einfo.errmsg = NULL;
+
+ /* PostgreSQL wants params in the connect string to be separated by spaces,
+ * if the PDO standard semicolons are used, we convert them to spaces
+ */
+ e = (char *) dbh->data_source + strlen(dbh->data_source);
+ p = (char *) dbh->data_source;
+ while ((p = memchr(p, ';', (e - p)))) {
+ *p = ' ';
+ }
+
+ /* support both full connection string & connection string + login and/or password */
+ if (!dbh->username || !dbh->password) {
+ conn_str = (char *) dbh->data_source;
+ } else if (dbh->username && dbh->password) {
+ spprintf(&conn_str, 0, "%s user=%s password=%s", dbh->data_source, dbh->username, dbh->password);
+ } else if (dbh->username) {
+ spprintf(&conn_str, 0, "%s user=%s", dbh->data_source, dbh->username);
+ } else {
+ spprintf(&conn_str, 0, "%s password=%s", dbh->data_source, dbh->password);
+ }
+
+ H->server = PQconnectdb(conn_str);
+
+ if (conn_str != dbh->data_source) {
+ efree(conn_str);
+ }
+
+ if (PQstatus(H->server) != CONNECTION_OK) {
+ pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE);
+ goto cleanup;
+ }
+
+ PQsetNoticeProcessor(H->server, (void(*)(void*,const char*))_pdo_pgsql_notice, (void *)&dbh);
+
+ H->attached = 1;
+ H->pgoid = -1;
+
+ dbh->methods = &pgsql_methods;
+ dbh->alloc_own_columns = 1;
+ dbh->max_escaped_char_length = 2;
+
+ ret = 1;
+
+cleanup:
+ dbh->methods = &pgsql_methods;
+ if (!ret) {
+ pgsql_handle_closer(dbh TSRMLS_CC);
+ }
+
+ return ret;
+}
+/* }}} */
+
+pdo_driver_t pdo_pgsql_driver = {
+ PDO_DRIVER_HEADER(pgsql),
+ pdo_pgsql_handle_factory
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
new file mode 100644
index 000000000..f3a1fc8af
--- /dev/null
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -0,0 +1,576 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Edin Kadribasic <edink@emini.dk> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pgsql_statement.c,v 1.31.2.4 2005/11/25 03:35:04 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_pgsql.h"
+#include "php_pdo_pgsql_int.h"
+
+/* from postgresql/src/include/catalog/pg_type.h */
+#define BOOLOID 16
+#define BYTEAOID 17
+#define INT8OID 20
+#define INT2OID 21
+#define INT4OID 23
+#define TEXTOID 25
+#define OIDOID 26
+
+
+static int pgsql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
+
+ if (S->result) {
+ /* free the resource */
+ PQclear(S->result);
+ S->result = NULL;
+ }
+
+#if HAVE_PQPREPARE
+ if (S->stmt_name) {
+ pdo_pgsql_db_handle *H = S->H;
+ char *q = NULL;
+ PGresult *res;
+
+ spprintf(&q, 0, "DEALLOCATE %s", S->stmt_name);
+ res = PQexec(H->server, q);
+ efree(q);
+ if (res) PQclear(res);
+ efree(S->stmt_name);
+ S->stmt_name = NULL;
+ }
+ if (S->param_lengths) {
+ efree(S->param_lengths);
+ S->param_lengths = NULL;
+ }
+ if (S->param_values) {
+ efree(S->param_values);
+ S->param_values = NULL;
+ }
+ if (S->param_formats) {
+ efree(S->param_formats);
+ S->param_formats = NULL;
+ }
+
+#endif
+
+ if (S->cursor_name) {
+ pdo_pgsql_db_handle *H = S->H;
+ char *q = NULL;
+ PGresult *res;
+
+ spprintf(&q, 0, "CLOSE %s", S->cursor_name);
+ res = PQexec(H->server, q);
+ efree(q);
+ if (res) PQclear(res);
+ efree(S->cursor_name);
+ S->cursor_name = NULL;
+ }
+
+ if(S->cols) {
+ efree(S->cols);
+ S->cols = NULL;
+ }
+ efree(S);
+ stmt->driver_data = NULL;
+ return 1;
+}
+
+static int pgsql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
+ pdo_pgsql_db_handle *H = S->H;
+ ExecStatusType status;
+
+ /* ensure that we free any previous unfetched results */
+ if(S->result) {
+ PQclear(S->result);
+ S->result = NULL;
+ }
+
+ S->current_row = 0;
+
+#if HAVE_PQPREPARE
+ if (S->stmt_name) {
+ /* using a prepared statement */
+
+ if (!stmt->executed) {
+ /* we deferred the prepare until now, because we didn't
+ * know anything about the parameter types; now we do */
+ S->result = PQprepare(H->server, S->stmt_name, S->query,
+ stmt->bound_params ? zend_hash_num_elements(stmt->bound_params) : 0,
+ S->param_types);
+ status = PQresultStatus(S->result);
+ switch (status) {
+ case PGRES_COMMAND_OK:
+ case PGRES_TUPLES_OK:
+ /* it worked */
+ PQclear(S->result);
+ break;
+ default:
+ pdo_pgsql_error_stmt(stmt, status,
+ pdo_pgsql_sqlstate(S->result));
+ return 0;
+ }
+ }
+ S->result = PQexecPrepared(H->server, S->stmt_name,
+ stmt->bound_params ?
+ zend_hash_num_elements(stmt->bound_params) :
+ 0,
+ (const char**)S->param_values,
+ S->param_lengths,
+ S->param_formats,
+ 0);
+ } else
+#endif
+ if (S->cursor_name) {
+ char *q = NULL;
+ spprintf(&q, 0, "DECLARE %s CURSOR FOR %s", S->cursor_name, stmt->active_query_string);
+ S->result = PQexec(H->server, q);
+ efree(q);
+ } else {
+ S->result = PQexec(H->server, stmt->active_query_string);
+ }
+ status = PQresultStatus(S->result);
+
+ if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) {
+ pdo_pgsql_error_stmt(stmt, status, pdo_pgsql_sqlstate(S->result));
+ return 0;
+ }
+
+ if(!stmt->executed) {
+ stmt->column_count = (int) PQnfields(S->result);
+ S->cols = ecalloc(stmt->column_count, sizeof(pdo_pgsql_column));
+ }
+
+ if (status == PGRES_COMMAND_OK) {
+ stmt->row_count = (long)atoi(PQcmdTuples(S->result));
+ H->pgoid = PQoidValue(S->result);
+ } else {
+ stmt->row_count = (long)PQntuples(S->result);
+ }
+
+ return 1;
+}
+
+static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
+ enum pdo_param_event event_type TSRMLS_DC)
+{
+ pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
+#if HAVE_PQPREPARE
+ if (S->stmt_name && param->is_param) {
+ switch (event_type) {
+ case PDO_PARAM_EVT_ALLOC:
+ /* decode name from $1, $2 into 0, 1 etc. */
+ if (param->name) {
+ if (param->name[0] == '$') {
+ param->paramno = atoi(param->name + 1);
+ } else {
+ /* resolve parameter name to rewritten name */
+ char *nameptr;
+ if (SUCCESS == zend_hash_find(stmt->bound_param_map,
+ param->name, param->namelen + 1, (void**)&nameptr)) {
+ param->paramno = atoi(nameptr + 1) - 1;
+ } else {
+ pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY093");
+ return 0;
+ }
+ }
+ }
+ break;
+
+ case PDO_PARAM_EVT_EXEC_PRE:
+ if (!S->param_values) {
+ S->param_values = ecalloc(
+ zend_hash_num_elements(stmt->bound_params),
+ sizeof(char*));
+ S->param_lengths = ecalloc(
+ zend_hash_num_elements(stmt->bound_params),
+ sizeof(int));
+ S->param_formats = ecalloc(
+ zend_hash_num_elements(stmt->bound_params),
+ sizeof(int));
+ S->param_types = ecalloc(
+ zend_hash_num_elements(stmt->bound_params),
+ sizeof(Oid));
+ }
+ if (param->paramno >= 0) {
+ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB &&
+ Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ php_stream *stm;
+ php_stream_from_zval_no_verify(stm, &param->parameter);
+ if (stm) {
+ SEPARATE_ZVAL_IF_NOT_REF(&param->parameter);
+ Z_TYPE_P(param->parameter) = IS_STRING;
+ Z_STRLEN_P(param->parameter) = php_stream_copy_to_mem(stm,
+ &Z_STRVAL_P(param->parameter), PHP_STREAM_COPY_ALL, 0);
+ } else {
+ /* expected a stream resource */
+ pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY105");
+ return 0;
+ }
+ }
+
+ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL ||
+ Z_TYPE_P(param->parameter) == IS_NULL) {
+ S->param_values[param->paramno] = NULL;
+ S->param_lengths[param->paramno] = 0;
+ } else if (Z_TYPE_P(param->parameter) == IS_BOOL) {
+ S->param_values[param->paramno] = Z_BVAL_P(param->parameter) ? "t" : "f";
+ S->param_lengths[param->paramno] = 1;
+ S->param_formats[param->paramno] = 0;
+ } else {
+ convert_to_string(param->parameter);
+ S->param_values[param->paramno] = Z_STRVAL_P(param->parameter);
+ S->param_lengths[param->paramno] = Z_STRLEN_P(param->parameter);
+ S->param_formats[param->paramno] = 0;
+ }
+
+ if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) {
+ S->param_types[param->paramno] = 0;
+ S->param_formats[param->paramno] = 1;
+ } else {
+ S->param_types[param->paramno] = 0;
+ }
+ }
+ break;
+ }
+ }
+#endif
+ return 1;
+}
+
+static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
+ enum pdo_fetch_orientation ori, long offset TSRMLS_DC)
+{
+ pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
+
+ if (S->cursor_name) {
+ char *ori_str;
+ char *q = NULL;
+ ExecStatusType status;
+
+ switch (ori) {
+ case PDO_FETCH_ORI_NEXT: ori_str = "FORWARD"; break;
+ case PDO_FETCH_ORI_PRIOR: ori_str = "BACKWARD"; break;
+ case PDO_FETCH_ORI_REL: ori_str = "RELATIVE"; break;
+ default:
+ return 0;
+ }
+
+ spprintf(&q, 0, "FETCH %s %ld FROM %s", ori_str, offset, S->cursor_name);
+ S->result = PQexec(S->H->server, q);
+ status = PQresultStatus(S->result);
+
+ if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) {
+ pdo_pgsql_error_stmt(stmt, status, pdo_pgsql_sqlstate(S->result));
+ return 0;
+ }
+
+ S->current_row = 1;
+ return 1;
+
+ } else {
+ if (S->current_row < stmt->row_count) {
+ S->current_row++;
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+}
+
+static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+{
+ pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
+ struct pdo_column_data *cols = stmt->columns;
+
+ if (!S->result) {
+ return 0;
+ }
+
+ cols[colno].name = estrdup(PQfname(S->result, colno));
+ cols[colno].namelen = strlen(cols[colno].name);
+ cols[colno].maxlen = PQfsize(S->result, colno);
+ cols[colno].precision = PQfmod(S->result, colno);
+ S->cols[colno].pgsql_type = PQftype(S->result, colno);
+
+ switch(S->cols[colno].pgsql_type) {
+
+ case BOOLOID:
+ cols[colno].param_type = PDO_PARAM_BOOL;
+ break;
+
+ case INT2OID:
+ case INT4OID:
+ case OIDOID:
+ cols[colno].param_type = PDO_PARAM_INT;
+ break;
+
+ case INT8OID:
+ if (sizeof(long)>=8) {
+ cols[colno].param_type = PDO_PARAM_INT;
+ } else {
+ cols[colno].param_type = PDO_PARAM_STR;
+ }
+ break;
+
+ case BYTEAOID:
+ cols[colno].param_type = PDO_PARAM_LOB;
+ break;
+
+ default:
+ cols[colno].param_type = PDO_PARAM_STR;
+ }
+
+ return 1;
+}
+
+/* PQunescapeBytea() from PostgreSQL 7.3 to provide bytea unescape feature to 7.2 users.
+ Renamed to php_pdo_pgsql_unescape_bytea() */
+/*
+ * PQunescapeBytea - converts the null terminated string representation
+ * of a bytea, strtext, into binary, filling a buffer. It returns a
+ * pointer to the buffer which is NULL on error, and the size of the
+ * buffer in retbuflen. The pointer may subsequently be used as an
+ * argument to the function free(3). It is the reverse of PQescapeBytea.
+ *
+ * The following transformations are reversed:
+ * '\0' == ASCII 0 == \000
+ * '\'' == ASCII 39 == \'
+ * '\\' == ASCII 92 == \\
+ *
+ * States:
+ * 0 normal 0->1->2->3->4
+ * 1 \ 1->5
+ * 2 \0 1->6
+ * 3 \00
+ * 4 \000
+ * 5 \'
+ * 6 \\
+ */
+static unsigned char *php_pdo_pgsql_unescape_bytea(unsigned char *strtext, size_t *retbuflen)
+{
+ size_t buflen;
+ unsigned char *buffer,
+ *sp,
+ *bp;
+ unsigned int state = 0;
+
+ if (strtext == NULL)
+ return NULL;
+ buflen = strlen(strtext); /* will shrink, also we discover if
+ * strtext */
+ buffer = (unsigned char *) emalloc(buflen); /* isn't NULL terminated */
+ for (bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++)
+ {
+ switch (state)
+ {
+ case 0:
+ if (*sp == '\\')
+ state = 1;
+ *bp = *sp;
+ break;
+ case 1:
+ if (*sp == '\'') /* state=5 */
+ { /* replace \' with 39 */
+ bp--;
+ *bp = '\'';
+ buflen--;
+ state = 0;
+ }
+ else if (*sp == '\\') /* state=6 */
+ { /* replace \\ with 92 */
+ bp--;
+ *bp = '\\';
+ buflen--;
+ state = 0;
+ }
+ else
+ {
+ if (isdigit(*sp))
+ state = 2;
+ else
+ state = 0;
+ *bp = *sp;
+ }
+ break;
+ case 2:
+ if (isdigit(*sp))
+ state = 3;
+ else
+ state = 0;
+ *bp = *sp;
+ break;
+ case 3:
+ if (isdigit(*sp)) /* state=4 */
+ {
+ unsigned char *start, *end, buf[4]; /* 000 + '\0' */
+
+ bp -= 3;
+ memcpy(buf, sp-2, 3);
+ buf[3] = '\0';
+ start = buf;
+ *bp = (unsigned char)strtoul(start, (char **)&end, 8);
+ buflen -= 3;
+ state = 0;
+ }
+ else
+ {
+ *bp = *sp;
+ state = 0;
+ }
+ break;
+ }
+ }
+ buffer = erealloc(buffer, buflen+1);
+ buffer[buflen] = '\0';
+
+ *retbuflen = buflen;
+ return buffer;
+}
+
+static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC)
+{
+ pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
+ struct pdo_column_data *cols = stmt->columns;
+ size_t tmp_len;
+
+ if (!S->result) {
+ return 0;
+ }
+
+ /* We have already increased count by 1 in pgsql_stmt_fetch() */
+ if (PQgetisnull(S->result, S->current_row - 1, colno)) { /* Check if we got NULL */
+ *ptr = NULL;
+ *len = 0;
+ } else {
+ *ptr = PQgetvalue(S->result, S->current_row - 1, colno);
+ *len = PQgetlength(S->result, S->current_row - 1, colno);
+
+ switch(cols[colno].param_type) {
+
+ case PDO_PARAM_INT:
+ S->cols[colno].intval = atol(*ptr);
+ *ptr = (char *) &(S->cols[colno].intval);
+ *len = sizeof(long);
+ break;
+
+ case PDO_PARAM_BOOL:
+ S->cols[colno].boolval = **ptr == 't' ? 1: 0;
+ *ptr = (char *) &(S->cols[colno].boolval);
+ *len = sizeof(zend_bool);
+ break;
+
+ case PDO_PARAM_LOB:
+ *ptr = php_pdo_pgsql_unescape_bytea(*ptr, &tmp_len);
+ *len = tmp_len;
+ *caller_frees = 1;
+ break;
+ case PDO_PARAM_NULL:
+ case PDO_PARAM_STR:
+ case PDO_PARAM_STMT:
+ case PDO_PARAM_INPUT_OUTPUT:
+ break;
+ }
+ }
+
+ return 1;
+}
+
+static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC)
+{
+ pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
+ PGresult *res;
+ char *q=NULL;
+ ExecStatusType status;
+
+ if (!S->result) {
+ return FAILURE;
+ }
+
+ if (colno >= stmt->column_count) {
+ return FAILURE;
+ }
+
+ array_init(return_value);
+ add_assoc_long(return_value, "pgsql:oid", S->cols[colno].pgsql_type);
+
+ /* Fetch metadata from Postgres system catalogue */
+ spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%d", S->cols[colno].pgsql_type);
+ res = PQexec(S->H->server, q);
+ efree(q);
+
+ status = PQresultStatus(res);
+
+ if (status != PGRES_TUPLES_OK) {
+ /* Failed to get system catalogue, but return success
+ * with the data we have collected so far
+ */
+ PQclear(res);
+ return 1;
+ }
+
+ /* We want exactly one row returned */
+ if (1 != PQntuples(res)) {
+ PQclear(res);
+ return 1;
+ }
+
+ add_assoc_string(return_value, "native_type", PQgetvalue(res, 0, 0), 1);
+
+ PQclear(res);
+ return 1;
+}
+
+static int pdo_pgsql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ return 1;
+}
+
+struct pdo_stmt_methods pgsql_stmt_methods = {
+ pgsql_stmt_dtor,
+ pgsql_stmt_execute,
+ pgsql_stmt_fetch,
+ pgsql_stmt_describe,
+ pgsql_stmt_get_col,
+ pgsql_stmt_param_hook,
+ NULL, /* set_attr */
+ NULL, /* get_attr */
+ pgsql_stmt_get_column_meta,
+ NULL, /* next_rowset */
+ pdo_pgsql_stmt_cursor_closer
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_pgsql/php_pdo_pgsql.h b/ext/pdo_pgsql/php_pdo_pgsql.h
new file mode 100644
index 000000000..eddb7556c
--- /dev/null
+++ b/ext/pdo_pgsql/php_pdo_pgsql.h
@@ -0,0 +1,55 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Edin Kadribasic <edink@emini.dk> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_pgsql.h,v 1.3 2005/08/03 14:07:39 sniper Exp $ */
+
+#ifndef PHP_PDO_PGSQL_H
+#define PHP_PDO_PGSQL_H
+
+#include <libpq-fe.h>
+
+extern zend_module_entry pdo_pgsql_module_entry;
+#define phpext_pdo_pgsql_ptr &pdo_pgsql_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_PDO_PGSQL_API __declspec(dllexport)
+#else
+#define PHP_PDO_PGSQL_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(pdo_pgsql);
+PHP_MSHUTDOWN_FUNCTION(pdo_pgsql);
+PHP_RINIT_FUNCTION(pdo_pgsql);
+PHP_RSHUTDOWN_FUNCTION(pdo_pgsql);
+PHP_MINFO_FUNCTION(pdo_pgsql);
+
+#endif /* PHP_PDO_PGSQL_H */
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h
new file mode 100644
index 000000000..dc2437110
--- /dev/null
+++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h
@@ -0,0 +1,102 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Edin Kadribasic <edink@emini.dk> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_pgsql_int.h,v 1.13.2.1 2005/11/25 03:35:04 wez Exp $ */
+
+#ifndef PHP_PDO_PGSQL_INT_H
+#define PHP_PDO_PGSQL_INT_H
+
+#include <libpq-fe.h>
+#include <php.h>
+
+#define PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE "08006"
+
+typedef struct {
+ const char *file;
+ int line;
+ unsigned int errcode;
+ char *errmsg;
+} pdo_pgsql_error_info;
+
+/* stuff we use in a pgsql database handle */
+typedef struct {
+ PGconn *server;
+ unsigned attached:1;
+ unsigned _reserved:31;
+ pdo_pgsql_error_info einfo;
+ Oid pgoid;
+} pdo_pgsql_db_handle;
+
+typedef struct {
+ char *def;
+ Oid pgsql_type;
+ long intval;
+ zend_bool boolval;
+} pdo_pgsql_column;
+
+typedef struct {
+ pdo_pgsql_db_handle *H;
+ PGresult *result;
+ int current_row;
+ pdo_pgsql_column *cols;
+ char *cursor_name;
+#if HAVE_PQPREPARE
+ char *stmt_name;
+ char *query;
+ char **param_values;
+ int *param_lengths;
+ int *param_formats;
+ Oid *param_types;
+#endif
+} pdo_pgsql_stmt;
+
+typedef struct {
+ char *repr;
+ long repr_len;
+ int pgsql_type;
+ void *thing; /* for LOBS, REFCURSORS etc. */
+} pdo_pgsql_bound_param;
+
+extern pdo_driver_t pdo_pgsql_driver;
+
+extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *file, int line TSRMLS_DC);
+#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, __FILE__, __LINE__ TSRMLS_CC)
+#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, __FILE__, __LINE__ TSRMLS_CC)
+
+extern struct pdo_stmt_methods pgsql_stmt_methods;
+
+#ifdef HAVE_PQRESULTERRORFIELD
+#define pdo_pgsql_sqlstate(r) PQresultErrorField(r, PG_DIAG_SQLSTATE)
+#else
+#define pdo_pgsql_sqlstate(r) (const char *)NULL
+#endif
+
+enum {
+ PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT = PDO_ATTR_DRIVER_SPECIFIC,
+};
+
+#endif /* PHP_PDO_PGSQL_INT_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_pgsql/tests/bug_33876.phpt b/ext/pdo_pgsql/tests/bug_33876.phpt
new file mode 100644
index 000000000..1184e7627
--- /dev/null
+++ b/ext/pdo_pgsql/tests/bug_33876.phpt
@@ -0,0 +1,149 @@
+--TEST--
+PDO PgSQL Bug #33876
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+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_ERRMODE, PDO::ERRMODE_SILENT);
+
+$db->exec('CREATE TABLE test (foo varchar(5) NOT NULL, bar bool NOT NULL)');
+$db->exec("INSERT INTO test VALUES('false','f')");
+$db->exec("INSERT INTO test VALUES('true', 't')");
+
+$res = $db->prepare('SELECT foo from test where bar = ?');
+
+# this is the portable approach to binding a bool
+$res->bindValue(1, false, PDO::PARAM_BOOL);
+if (!$res->execute())
+ print_r($res->errorInfo());
+else
+ print_r($res->fetchAll(PDO::FETCH_ASSOC));
+
+# this is the portable approach to binding a bool
+$res->bindValue(1, true, PDO::PARAM_BOOL);
+if (!$res->execute())
+ print_r($res->errorInfo());
+else
+ print_r($res->fetchAll(PDO::FETCH_ASSOC));
+
+
+# true gets cast to string (because the implied default is string)
+# true-as-string is 1, so this "works"
+if (!$res->execute(array(true)))
+ print_r($res->errorInfo());
+else
+ print_r($res->fetchAll(PDO::FETCH_ASSOC));
+
+# Expected to fail; unless told otherwise, PDO assumes string inputs
+# false -> "" as string, which pgsql doesn't like
+if (!$res->execute(array(false)))
+ print_r($res->errorInfo());
+else
+ print_r($res->fetchAll(PDO::FETCH_ASSOC));
+
+# And now using emulator prepares
+echo "EMUL\n";
+
+
+$res = $db->prepare('SELECT foo from test where bar = ?', array(
+ PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT => true));
+
+# this is the portable approach to binding a bool
+$res->bindValue(1, false, PDO::PARAM_BOOL);
+if (!$res->execute())
+ print_r($res->errorInfo());
+else
+ print_r($res->fetchAll(PDO::FETCH_ASSOC));
+
+# this is the portable approach to binding a bool
+$res->bindValue(1, true, PDO::PARAM_BOOL);
+if (!$res->execute())
+ print_r($res->errorInfo());
+else
+ print_r($res->fetchAll(PDO::FETCH_ASSOC));
+
+
+# true gets cast to string (because the implied default is string)
+# true-as-string is 1, so this "works"
+if (!$res->execute(array(true)))
+ print_r($res->errorInfo());
+else
+ print_r($res->fetchAll(PDO::FETCH_ASSOC));
+
+# Expected to fail; unless told otherwise, PDO assumes string inputs
+# false -> "" as string, which pgsql doesn't like
+if (!$res->execute(array(false)))
+ print_r($res->errorInfo());
+else
+ print_r($res->fetchAll(PDO::FETCH_ASSOC));
+
+
+
+--EXPECT--
+Array
+(
+ [0] => Array
+ (
+ [foo] => false
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [foo] => true
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [foo] => true
+ )
+
+)
+Array
+(
+ [0] => 22P02
+ [1] => 7
+ [2] => ERROR: invalid input syntax for type boolean: ""
+)
+EMUL
+Array
+(
+ [0] => Array
+ (
+ [foo] => false
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [foo] => true
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [foo] => true
+ )
+
+)
+Array
+(
+ [0] => 22P02
+ [1] => 7
+ [2] => ERROR: invalid input syntax for type boolean: ""
+)
diff --git a/ext/pdo_pgsql/tests/common.phpt b/ext/pdo_pgsql/tests/common.phpt
new file mode 100644
index 000000000..383700904
--- /dev/null
+++ b/ext/pdo_pgsql/tests/common.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Postgres
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_pgsql')) print 'skip'; ?>
+--REDIRECTTEST--
+# magic auto-configuration
+
+$config = array(
+ 'TESTS' => 'ext/pdo/tests'
+);
+
+if (false !== getenv('PDO_PGSQL_TEST_DSN')) {
+ # user set them from their shell
+ $config['ENV']['PDOTEST_DSN'] = getenv('PDO_PGSQL_TEST_DSN');
+ if (false !== getenv('PDO_PGSQL_TEST_ATTR')) {
+ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_PGSQL_TEST_ATTR');
+ }
+} else {
+ $config['ENV']['PDOTEST_DSN'] = 'pgsql:host=localhost port=5432 dbname=test user=root password=';
+}
+
+return $config;
diff --git a/ext/pdo_sqlite/CREDITS b/ext/pdo_sqlite/CREDITS
new file mode 100644
index 000000000..0a6c14588
--- /dev/null
+++ b/ext/pdo_sqlite/CREDITS
@@ -0,0 +1,2 @@
+SQLite 3.x driver for PDO
+Wez Furlong
diff --git a/ext/pdo_sqlite/EXPERIMENTAL b/ext/pdo_sqlite/EXPERIMENTAL
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ext/pdo_sqlite/EXPERIMENTAL
diff --git a/ext/pdo_sqlite/config.m4 b/ext/pdo_sqlite/config.m4
new file mode 100644
index 000000000..7f7d7e5a0
--- /dev/null
+++ b/ext/pdo_sqlite/config.m4
@@ -0,0 +1,122 @@
+dnl $Id: config.m4,v 1.26.2.6 2005/11/01 03:13:32 wez 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)
+
+if test "$PHP_PDO_SQLITE" != "no"; then
+
+ ifdef([PHP_CHECK_PDO_INCLUDES],
+ [
+ PHP_CHECK_PDO_INCLUDES
+ ],[
+ AC_MSG_CHECKING([for PDO includes])
+ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$prefix/include/php/ext
+ else
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
+ fi
+ AC_MSG_RESULT($pdo_inc_path)
+ ])
+
+ php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c"
+
+ if test "$PHP_PDO_SQLITE" != "yes"; then
+ SEARCH_PATH="$PHP_PDO_SQLITE /usr/local /usr" # you might want to change this
+ SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this
+ if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter
+ PDO_SQLITE_DIR=$PHP_PDO_SQLITE
+ else # search default path list
+ AC_MSG_CHECKING([for sqlite3 files in default path])
+ for i in $SEARCH_PATH ; do
+ if test -r $i/$SEARCH_FOR; then
+ PDO_SQLITE_DIR=$i
+ AC_MSG_RESULT(found in $i)
+ fi
+ done
+ fi
+ if test -z "$PDO_SQLITE_DIR"; then
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Please reinstall the sqlite3 distribution])
+ fi
+
+ PHP_ADD_INCLUDE($PDO_SQLITE_DIR/include)
+
+ LIBNAME=sqlite3
+ LIBSYMBOL=sqlite3_open
+
+ PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
+ [
+ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PDO_SQLITE_DIR/lib, PDO_SQLITE_SHARED_LIBADD)
+ AC_DEFINE(HAVE_PDO_SQLITELIB,1,[ ])
+ ],[
+ AC_MSG_ERROR([wrong sqlite lib version or lib not found])
+ ],[
+ -L$PDO_SQLITE_DIR/lib -lm
+ ])
+ PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[
+ AC_DEFINE(HAVE_SQLITE3_KEY,1, [have commercial sqlite3 with crypto support])
+ ])
+
+ PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
+ PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_inc_path)
+ else
+ # use bundled libs
+ pdo_sqlite_sources="sqlite/src/attach.c sqlite/src/auth.c sqlite/src/btree.c \
+ sqlite/src/build.c sqlite/src/callback.c sqlite/src/date.c sqlite/src/delete.c sqlite/src/expr.c \
+ sqlite/src/func.c sqlite/src/hash.c sqlite/src/insert.c sqlite/src/legacy.c \
+ sqlite/src/main.c sqlite/src/os_mac.c sqlite/src/os_unix.c sqlite/src/os_win.c \
+ sqlite/src/pager.c sqlite/src/pragma.c sqlite/src/prepare.c \
+ sqlite/src/printf.c sqlite/src/random.c sqlite/src/select.c \
+ sqlite/src/table.c sqlite/src/tokenize.c sqlite/src/analyze.c \
+ sqlite/src/trigger.c sqlite/src/update.c sqlite/src/utf.c sqlite/src/util.c \
+ sqlite/src/vacuum.c sqlite/src/vdbeapi.c sqlite/src/vdbeaux.c sqlite/src/vdbe.c \
+ sqlite/src/vdbemem.c sqlite/src/where.c sqlite/src/parse.c sqlite/src/opcodes.c \
+ sqlite/src/alter.c sqlite/src/vdbefifo.c sqlite/src/experimental.c"
+
+ PHP_NEW_EXTENSION(pdo_sqlite,
+ $php_pdo_sqlite_sources_core $pdo_sqlite_sources,
+ $ext_shared,,-I$ext_srcdir/sqlite/src -DPDO_SQLITE_BUNDLED=1 -DSQLITE_OMIT_CURSOR -I$pdo_inc_path)
+
+ PHP_ADD_BUILD_DIR($ext_builddir/sqlite/src, 1)
+ AC_CHECK_SIZEOF(char *,4)
+ AC_DEFINE(SQLITE_PTR_SZ, SIZEOF_CHAR_P, [Size of a pointer])
+ PDO_SQLITE_VERSION=`cat $ext_srcdir/sqlite/VERSION`
+ PDO_SQLITE_VERSION_NUMBER=`echo $PDO_SQLITE_VERSION | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}'`
+ sed -e s/--VERS--/$PDO_SQLITE_VERSION/ -e s/--VERSION-NUMBER--/$PDO_SQLITE_VERSION_NUMBER/ $ext_srcdir/sqlite/src/sqlite.h.in > $ext_srcdir/sqlite/src/sqlite3.h
+
+ touch $ext_srcdir/sqlite/src/parse.c $ext_srcdir/sqlite/src/parse.h
+
+ if test "$ext_shared" = "no" -o "$ext_srcdir" != "$abs_srcdir"; then
+ echo '#include <php_config.h>' > $ext_srcdir/sqlite/src/config.h
+ else
+ echo "#include \"$abs_builddir/config.h\"" > $ext_srcdir/sqlite/src/config.h
+ fi
+ cat >> $ext_srcdir/sqlite/src/config.h <<EOF
+#if ZTS
+# define THREADSAFE 1
+#endif
+#if !ZEND_DEBUG
+# define NDEBUG
+#endif
+/* discourage foolishness */
+#define sqlite3_temp_directory sqlite3_temp_directory_unsafe_except_in_minit
+EOF
+ AC_CHECK_FUNCS(usleep nanosleep)
+ AC_CHECK_HEADERS(time.h)
+
+ fi
+ ifdef([PHP_ADD_EXTENSION_DEP],
+ [
+ PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
+ ])
+fi
+
+fi
diff --git a/ext/pdo_sqlite/config.w32 b/ext/pdo_sqlite/config.w32
new file mode 100644
index 000000000..8c0aed648
--- /dev/null
+++ b/ext/pdo_sqlite/config.w32
@@ -0,0 +1,31 @@
+// $Id: config.w32,v 1.6.2.1 2005/08/28 16:53:20 iliaa Exp $
+// vim:ft=javascript
+
+ARG_WITH("pdo-sqlite", "for pdo_sqlite support", "no");
+
+if (PHP_PDO_SQLITE != "no") {
+
+ php_pdo_sqlite_version = file_get_contents(configure_module_dirname + "\\sqlite\\VERSION").replace(new RegExp("[\r\n]+", "g"));
+ php_pdo_sqlite_version.match(/(\d+)\.(\d+)\.(\d+)/);
+ // this only works for single digit numbers
+ php_pdo_sqlite_lib_version = RegExp.$1 + "000" + RegExp.$2 + "000" + RegExp.$3;
+
+ copy_and_subst(configure_module_dirname + "\\sqlite\\src\\sqlite.h.in",
+ configure_module_dirname + "\\sqlite3.h", new Array(
+ "--VERS--", php_pdo_sqlite_version,
+ "--VERSION-NUMBER--", php_pdo_sqlite_lib_version
+ ));
+
+ FSO.CopyFile(configure_module_dirname + "\\sqlite\\src\\sqlite_config.w32.h",
+ configure_module_dirname + "\\sqlite\\src\\config.h");
+
+ EXTENSION("pdo_sqlite", "pdo_sqlite.c sqlite_driver.c sqlite_statement.c", null, "/DSQLITE_OMIT_CURSOR /I" + configure_module_dirname + "/sqlite/src /I pecl /I ..\\pecl /I" + configure_module_dirname);
+ ADD_SOURCES(configure_module_dirname + "/sqlite/src",
+ "attach.c auth.c btree.c build.c callback.c date.c delete.c expr.c func.c hash.c insert.c \
+ legacy.c main.c os_mac.c os_unix.c os_win.c pager.c pragma.c prepare.c printf.c random.c \
+ select.c table.c tokenize.c trigger.c update.c utf.c util.c vacuum.c vdbeapi.c analyze.c \
+ vdbeaux.c vdbe.c vdbemem.c vdbefifo.c where.c parse.c opcodes.c alter.c experimental.c", "pdo_sqlite");
+
+ ADD_EXTENSION_DEP('pdo_sqlite', 'pdo');
+}
+
diff --git a/ext/pdo_sqlite/package.xml b/ext/pdo_sqlite/package.xml
new file mode 100755
index 000000000..19ac59893
--- /dev/null
+++ b/ext/pdo_sqlite/package.xml
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE package SYSTEM "../pear/package.dtd">
+<package version="1.0">
+ <name>PDO_SQLITE</name>
+ <summary>SQLite v3 Interface driver for PDO</summary>
+ <maintainers>
+ <maintainer>
+ <user>wez</user>
+ <name>Wez Furlong</name>
+ <email>wez@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ </maintainers>
+ <!-- configureoptions>
+ <configureoption name="with-pdo-sqlite" prompt="Path to your sqlite3 install"/>
+</configureoptions -->
+ <description>
+ This extension provides an SQLite v3 driver for PDO.
+ SQLite V3 is NOT compatible with the bundled SQLite 2 in PHP 5, but is a significant
+ step forwards, featuring complete utf-8 support, native support for blobs,
+ native support for prepared statements with bound parameters and improved
+ concurrency.
+ </description>
+ <license>PHP</license>
+ <release>
+ <state>stable</state>
+ <version>1.0</version>
+ <date>2005-11-26</date>
+
+ <notes>
+You need to install the PDO core module before you can make use of this one.
+This package includes a bundled SQLite 3 library.
+
+Windows binary:
+http://pecl4win.php.net/ext.php/php_pdo_sqlite.dll
+
+- Fixed PECL Bug #5633; build issues
+- Added sqliteCreateFunction() and sqliteCreateAggregate()
+- Fixed PECL Bug #3452; problem when first row of a result set contains a NULL value.
+- Upgraded bundled sqlite to 3.1.3
+- setting PDO_ATTR_TIMEOUT controls the busy timeout
+- Fixed PECL Bug #3391; cannot bind NULL parameters
+- Fixed build problem when building the bundled sqlite library
+ </notes>
+
+ <filelist>
+ <file role="src" name="config.m4"/>
+ <file role="src" name="config.w32"/>
+ <file role="src" name="pdo_sqlite.c"/>
+ <file role="src" name="sqlite_driver.c"/>
+ <file role="src" name="sqlite_statement.c"/>
+ <file role="src" name="php_pdo_sqlite.h"/>
+ <file role="src" name="php_pdo_sqlite_int.h"/>
+
+ <file role="doc" name="CREDITS"/>
+
+ <dir name="sqlite">
+<file role="src" name="aclocal.m4"/>
+<file role="src" name="config.guess"/>
+<file role="src" name="config.sub"/>
+<file role="src" name="configure"/>
+<file role="src" name="configure.ac"/>
+<file role="src" name="install-sh"/>
+<file role="src" name="ltmain.sh"/>
+<file role="src" name="main.mk"/>
+<file role="src" name="Makefile.in"/>
+<file role="src" name="Makefile.linux-gcc"/>
+<file role="src" name="mkdll.sh"/>
+<file role="src" name="mkopcodec.awk"/>
+<file role="src" name="mkopcodeh.awk"/>
+<file role="src" name="mkso.sh"/>
+<file role="src" name="publish.sh"/>
+<file role="src" name="README"/>
+<file role="src" name="spec.template"/>
+<file role="src" name="sqlite.1"/>
+<file role="src" name="sqlite3.def"/>
+<file role="src" name="sqlite3.pc.in"/>
+<file role="src" name="sqlite.pc.in"/>
+<file role="src" name="VERSION"/>
+<dir name="src">
+<file role="src" name="analyze.c"/>
+<file role="src" name="attach.c"/>
+<file role="src" name="alter.c"/>
+<file role="src" name="auth.c"/>
+<file role="src" name="btree.c"/>
+<file role="src" name="btree.h"/>
+<file role="src" name="build.c"/>
+<file role="src" name="callback.c"/>
+<file role="src" name="date.c"/>
+<file role="src" name="delete.c"/>
+<file role="src" name="expr.c"/>
+<file role="src" name="experimental.c"/>
+<file role="src" name="func.c"/>
+<file role="src" name="hash.c"/>
+<file role="src" name="hash.h"/>
+<file role="src" name="insert.c"/>
+<file role="src" name="legacy.c"/>
+<file role="src" name="main.c"/>
+<file role="src" name="md5.c"/>
+<file role="src" name="keywordhash.h"/>
+<file role="src" name="opcodes.c"/>
+<file role="src" name="opcodes.h"/>
+<file role="src" name="os_common.h"/>
+<file role="src" name="os.h"/>
+<file role="src" name="os_mac.c"/>
+<file role="src" name="os_mac.h"/>
+<file role="src" name="os_test.c"/>
+<file role="src" name="os_test.h"/>
+<file role="src" name="os_unix.c"/>
+<file role="src" name="os_unix.h"/>
+<file role="src" name="os_win.c"/>
+<file role="src" name="os_win.h"/>
+<file role="src" name="pager.c"/>
+<file role="src" name="pager.h"/>
+<file role="src" name="parse.y"/>
+<file role="src" name="parse.c"/>
+<file role="src" name="parse.h"/>
+<file role="src" name="pragma.c"/>
+<file role="src" name="prepare.c"/>
+<file role="src" name="printf.c"/>
+<file role="src" name="random.c"/>
+<file role="src" name="select.c"/>
+<file role="src" name="shell.c"/>
+<file role="src" name="sqlite.h.in"/>
+<file role="src" name="sqliteInt.h"/>
+<file role="src" name="table.c"/>
+<file role="src" name="tclsqlite.c"/>
+<file role="src" name="test1.c"/>
+<file role="src" name="test2.c"/>
+<file role="src" name="test3.c"/>
+<file role="src" name="test4.c"/>
+<file role="src" name="test5.c"/>
+<file role="src" name="tokenize.c"/>
+<file role="src" name="trigger.c"/>
+<file role="src" name="update.c"/>
+<file role="src" name="utf.c"/>
+<file role="src" name="util.c"/>
+<file role="src" name="vacuum.c"/>
+<file role="src" name="vdbeapi.c"/>
+<file role="src" name="vdbeaux.c"/>
+<file role="src" name="vdbe.c"/>
+<file role="src" name="vdbefifo.c"/>
+<file role="src" name="vdbe.h"/>
+<file role="src" name="vdbeInt.h"/>
+<file role="src" name="vdbemem.c"/>
+<file role="src" name="where.c"/>
+</dir>
+
+<dir name="tool">
+<file role="src" name="diffdb.c"/>
+<file role="src" name="lemon.c"/>
+<file role="src" name="lempar.c"/>
+<file role="src" name="memleak2.awk"/>
+<file role="src" name="memleak3.tcl"/>
+<file role="src" name="memleak.awk"/>
+<file role="src" name="mkkeywordhash.c"/>
+<file role="src" name="mkopts.tcl"/>
+<file role="src" name="opcodeDoc.awk"/>
+<file role="src" name="report1.txt"/>
+<file role="src" name="showdb.c"/>
+<file role="src" name="showjournal.c"/>
+<file role="src" name="spaceanal.tcl"/>
+<file role="src" name="space_used.tcl"/>
+<file role="src" name="speedtest2.tcl"/>
+<file role="src" name="speedtest.tcl"/>
+</dir>
+
+ </dir>
+
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="5.0.3"/>
+ <dep type="ext" rel="ge" name="pdo" version="1.0"/>
+ </deps>
+ </release>
+</package>
+<!-- vim: se ts=2 sw=2 et: -->
diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c
new file mode 100644
index 000000000..7e9013168
--- /dev/null
+++ b/ext/pdo_sqlite/pdo_sqlite.c
@@ -0,0 +1,116 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_sqlite.c,v 1.10.2.3 2005/11/26 20:50:08 wez Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_sqlite.h"
+#include "php_pdo_sqlite_int.h"
+#include "zend_exceptions.h"
+
+#define PHP_PDO_SQLITE_MODULE_VERSION "1.0"
+
+/* {{{ pdo_sqlite_functions[] */
+function_entry pdo_sqlite_functions[] = {
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ pdo_sqlite_deps
+ */
+#if ZEND_MODULE_API_NO >= 20050922
+static zend_module_dep pdo_sqlite_deps[] = {
+ ZEND_MOD_REQUIRED("pdo")
+ {NULL, NULL, NULL}
+};
+#endif
+/* }}} */
+
+/* {{{ pdo_sqlite_module_entry
+ */
+zend_module_entry pdo_sqlite_module_entry = {
+#if ZEND_MODULE_API_NO >= 20050922
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_sqlite_deps,
+#else
+ STANDARD_MODULE_HEADER,
+#endif
+ "pdo_sqlite",
+ pdo_sqlite_functions,
+ PHP_MINIT(pdo_sqlite),
+ PHP_MSHUTDOWN(pdo_sqlite),
+ NULL,
+ NULL,
+ PHP_MINFO(pdo_sqlite),
+ PHP_PDO_SQLITE_MODULE_VERSION,
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_PDO_SQLITE
+ZEND_GET_MODULE(pdo_sqlite)
+#endif
+
+/* {{{ PHP_MINIT_FUNCTION */
+PHP_MINIT_FUNCTION(pdo_sqlite)
+{
+ return php_pdo_register_driver(&pdo_sqlite_driver);
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION */
+PHP_MSHUTDOWN_FUNCTION(pdo_sqlite)
+{
+ php_pdo_unregister_driver(&pdo_sqlite_driver);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(pdo_sqlite)
+{
+ php_info_print_table_start();
+ php_info_print_table_header(2, "PDO Driver for SQLite 3.x", "enabled");
+ php_info_print_table_row(2, "PECL Module version",
+#if PDO_SQLITE_BUNDLED
+ "(bundled) "
+#endif
+ PHP_PDO_SQLITE_MODULE_VERSION
+ " $Id: pdo_sqlite.c,v 1.10.2.3 2005/11/26 20:50:08 wez Exp $");
+ php_info_print_table_row(2, "SQLite Library", sqlite3_libversion());
+ php_info_print_table_end();
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_sqlite/php_pdo_sqlite.h b/ext/pdo_sqlite/php_pdo_sqlite.h
new file mode 100644
index 000000000..dd0f8491b
--- /dev/null
+++ b/ext/pdo_sqlite/php_pdo_sqlite.h
@@ -0,0 +1,71 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_sqlite.h,v 1.2 2005/08/03 14:07:39 sniper Exp $ */
+
+
+#ifndef PHP_PDO_SQLITE_H
+#define PHP_PDO_SQLITE_H
+
+extern zend_module_entry pdo_sqlite_module_entry;
+#define phpext_pdo_sqlite_ptr &pdo_sqlite_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_PDO_SQLITE_API __declspec(dllexport)
+#else
+#define PHP_PDO_SQLITE_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(pdo_sqlite);
+PHP_MSHUTDOWN_FUNCTION(pdo_sqlite);
+PHP_RINIT_FUNCTION(pdo_sqlite);
+PHP_RSHUTDOWN_FUNCTION(pdo_sqlite);
+PHP_MINFO_FUNCTION(pdo_sqlite);
+
+/*
+ Declare any global variables you may need between the BEGIN
+ and END macros here:
+
+ZEND_BEGIN_MODULE_GLOBALS(pdo_sqlite)
+ long global_value;
+ char *global_string;
+ZEND_END_MODULE_GLOBALS(pdo_sqlite)
+*/
+
+/* In every utility function you add that needs to use variables
+ in php_pdo_sqlite_globals, call TSRMLS_FETCH(); after declaring other
+ variables used by that function, or better yet, pass in TSRMLS_CC
+ after the last function argument and declare your utility function
+ with TSRMLS_DC after the last declared argument. Always refer to
+ the globals in your function as PDO_SQLITE_G(variable). You are
+ encouraged to rename these macros something shorter, see
+ examples in any other php module directory.
+*/
+
+#ifdef ZTS
+#define PDO_SQLITE_G(v) TSRMG(pdo_sqlite_globals_id, zend_pdo_sqlite_globals *, v)
+#else
+#define PDO_SQLITE_G(v) (pdo_sqlite_globals.v)
+#endif
+
+#endif /* PHP_PDO_SQLITE_H */
+
diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h
new file mode 100644
index 000000000..ad2d1d330
--- /dev/null
+++ b/ext/pdo_sqlite/php_pdo_sqlite_int.h
@@ -0,0 +1,69 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_sqlite_int.h,v 1.3 2005/06/10 02:50:37 wez Exp $ */
+
+#ifndef PHP_PDO_SQLITE_INT_H
+#define PHP_PDO_SQLITE_INT_H
+
+#include <sqlite3.h>
+
+typedef struct {
+ const char *file;
+ int line;
+ unsigned int errcode;
+ char *errmsg;
+} pdo_sqlite_error_info;
+
+struct pdo_sqlite_fci {
+ zend_fcall_info fci;
+ zend_fcall_info_cache fcc;
+};
+
+struct pdo_sqlite_func {
+ struct pdo_sqlite_func *next;
+
+ zval *func, *step, *fini;
+ int argc;
+ const char *funcname;
+
+ /* accelerated callback references */
+ struct pdo_sqlite_fci afunc, astep, afini;
+};
+
+typedef struct {
+ sqlite3 *db;
+ pdo_sqlite_error_info einfo;
+ struct pdo_sqlite_func *funcs;
+} pdo_sqlite_db_handle;
+
+typedef struct {
+ pdo_sqlite_db_handle *H;
+ sqlite3_stmt *stmt;
+ unsigned pre_fetched:1;
+ unsigned done:1;
+} pdo_sqlite_stmt;
+
+extern pdo_driver_t pdo_sqlite_driver;
+
+extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC);
+#define pdo_sqlite_error(s) _pdo_sqlite_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC)
+#define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC)
+
+extern struct pdo_stmt_methods sqlite_stmt_methods;
+#endif
diff --git a/ext/pdo_sqlite/post-bundle.sh b/ext/pdo_sqlite/post-bundle.sh
new file mode 100755
index 000000000..e60cc85e8
--- /dev/null
+++ b/ext/pdo_sqlite/post-bundle.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Run this script after updating the bundled sqlite library
+
+cc -o sqlite/tool/lemon sqlite/tool/lemon.c
+./sqlite/tool/lemon sqlite/src/parse.y
+cat sqlite/src/parse.h sqlite/src/vdbe.c | awk -f sqlite/mkopcodeh.awk > sqlite/src/opcodes.h
+sort -n +2 sqlite/src/opcodes.h | awk -f sqlite/mkopcodec.awk > sqlite/src/opcodes.c
+cc -o sqlite/tool/mkkeywordhash sqlite/tool/mkkeywordhash.c
+./sqlite/tool/mkkeywordhash > sqlite/src/keywordhash.h
diff --git a/ext/pdo_sqlite/sqlite/Makefile.in b/ext/pdo_sqlite/sqlite/Makefile.in
new file mode 100644
index 000000000..db4714422
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/Makefile.in
@@ -0,0 +1,660 @@
+#!/usr/make
+#
+# Makefile for SQLITE
+#
+# This makefile is suppose to be configured automatically using the
+# autoconf. But if that does not work for you, you can configure
+# the makefile manually. Just set the parameters below to values that
+# work well for your system.
+#
+# If the configure script does not work out-of-the-box, you might
+# be able to get it to work by giving it some hints. See the comment
+# at the beginning of configure.in for additional information.
+#
+
+# The toplevel directory of the source tree. This is the directory
+# that contains this "Makefile.in" and the "configure.in" script.
+#
+TOP = @srcdir@
+
+# C Compiler and options for use in building executables that
+# will run on the platform that is doing the build.
+#
+BCC = @BUILD_CC@ @BUILD_CFLAGS@
+
+# C Compile and options for use in building executables that
+# will run on the target platform. (BCC and TCC are usually the
+# same unless your are cross-compiling.)
+#
+TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src
+
+# Define -DNDEBUG to compile without debugging (i.e., for production usage)
+# Omitting the define will cause extra debugging code to be inserted and
+# includes extra comments when "EXPLAIN stmt" is used.
+#
+TCC += @TARGET_DEBUG@
+
+# Compiler options needed for programs that use the TCL library.
+#
+TCC += @TCL_INCLUDE_SPEC@
+
+# The library that programs using TCL must link against.
+#
+LIBTCL = @TCL_LIB_SPEC@ @TCL_LIBS@
+
+# Compiler options needed for programs that use the readline() library.
+#
+READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
+
+# The library that programs using readline() must link against.
+#
+LIBREADLINE = @TARGET_READLINE_LIBS@
+
+# Should the database engine be compiled threadsafe
+#
+TCC += -DTHREADSAFE=@THREADSAFE@
+
+# The pthreads library if needed
+#
+LIBPTHREAD=@TARGET_THREAD_LIB@
+
+# Flags controlling use of the in memory btree implementation
+#
+# TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
+# default to file, 2 to default to memory, and 3 to force temporary
+# tables to always be in memory.
+#
+TEMP_STORE = -DTEMP_STORE=@TEMP_STORE@
+
+# Version numbers and release number for the SQLite being compiled.
+#
+VERSION = @VERSION@
+VERSION_NUMBER = @VERSION_NUMBER@
+RELEASE = @RELEASE@
+
+# Filename extensions
+#
+BEXE = @BUILD_EXEEXT@
+TEXE = @TARGET_EXEEXT@
+
+# The following variable is "1" if the configure script was able to locate
+# the tclConfig.sh file. It is an empty string otherwise. When this
+# variable is "1", the TCL extension library (libtclsqlite3.so) is built
+# and installed.
+#
+HAVE_TCL = @HAVE_TCL@
+
+# The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib"
+#
+SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
+
+# The directory into which to store package information for
+
+# Some standard variables and programs
+#
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+libdir = @libdir@
+INSTALL = @INSTALL@
+LIBTOOL = ./libtool
+ALLOWRELEASE = @ALLOWRELEASE@
+
+# libtool compile/link/install
+LTCOMPILE = $(LIBTOOL) --mode=compile $(TCC)
+LTLINK = $(LIBTOOL) --mode=link $(TCC)
+LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
+
+# You should not have to change anything below this line
+###############################################################################
+
+OPTS += -DSQLITE_OMIT_CURSOR # Cursors do not work at this time
+TCC += -DSQLITE_OMIT_CURSOR
+
+# Object files for the SQLite library.
+#
+LIBOBJ = alter.lo analyze.lo attach.lo auth.lo btree.lo build.lo \
+ callback.lo complete.lo date.lo \
+ delete.lo expr.lo func.lo hash.lo insert.lo \
+ main.lo opcodes.lo os_unix.lo os_win.lo \
+ pager.lo parse.lo pragma.lo prepare.lo printf.lo random.lo \
+ select.lo table.lo tokenize.lo trigger.lo update.lo \
+ util.lo vacuum.lo \
+ vdbe.lo vdbeapi.lo vdbeaux.lo vdbefifo.lo vdbemem.lo \
+ where.lo utf.lo legacy.lo
+
+# All of the source code files.
+#
+SRC = \
+ $(TOP)/src/alter.c \
+ $(TOP)/src/analyze.c \
+ $(TOP)/src/attach.c \
+ $(TOP)/src/auth.c \
+ $(TOP)/src/btree.c \
+ $(TOP)/src/btree.h \
+ $(TOP)/src/build.c \
+ $(TOP)/src/callback.c \
+ $(TOP)/src/complete.c \
+ $(TOP)/src/date.c \
+ $(TOP)/src/delete.c \
+ $(TOP)/src/expr.c \
+ $(TOP)/src/func.c \
+ $(TOP)/src/hash.c \
+ $(TOP)/src/hash.h \
+ $(TOP)/src/insert.c \
+ $(TOP)/src/legacy.c \
+ $(TOP)/src/main.c \
+ $(TOP)/src/os_unix.c \
+ $(TOP)/src/os_win.c \
+ $(TOP)/src/pager.c \
+ $(TOP)/src/pager.h \
+ $(TOP)/src/parse.y \
+ $(TOP)/src/pragma.c \
+ $(TOP)/src/prepare.c \
+ $(TOP)/src/printf.c \
+ $(TOP)/src/random.c \
+ $(TOP)/src/select.c \
+ $(TOP)/src/shell.c \
+ $(TOP)/src/sqlite.h.in \
+ $(TOP)/src/sqliteInt.h \
+ $(TOP)/src/table.c \
+ $(TOP)/src/tclsqlite.c \
+ $(TOP)/src/tokenize.c \
+ $(TOP)/src/trigger.c \
+ $(TOP)/src/utf.c \
+ $(TOP)/src/update.c \
+ $(TOP)/src/util.c \
+ $(TOP)/src/vacuum.c \
+ $(TOP)/src/vdbe.c \
+ $(TOP)/src/vdbe.h \
+ $(TOP)/src/vdbeapi.c \
+ $(TOP)/src/vdbeaux.c \
+ $(TOP)/src/vdbefifo.c \
+ $(TOP)/src/vdbemem.c \
+ $(TOP)/src/vdbeInt.h \
+ $(TOP)/src/where.c
+
+# Source code to the test files.
+#
+TESTSRC = \
+ $(TOP)/src/btree.c \
+ $(TOP)/src/date.c \
+ $(TOP)/src/func.c \
+ $(TOP)/src/os_unix.c \
+ $(TOP)/src/os_win.c \
+ $(TOP)/src/pager.c \
+ $(TOP)/src/pragma.c \
+ $(TOP)/src/printf.c \
+ $(TOP)/src/test1.c \
+ $(TOP)/src/test2.c \
+ $(TOP)/src/test3.c \
+ $(TOP)/src/test4.c \
+ $(TOP)/src/test5.c \
+ $(TOP)/src/utf.c \
+ $(TOP)/src/util.c \
+ $(TOP)/src/vdbe.c \
+ $(TOP)/src/md5.c \
+ $(TOP)/src/where.c
+
+# Header files used by all library source files.
+#
+HDR = \
+ sqlite3.h \
+ $(TOP)/src/btree.h \
+ $(TOP)/src/hash.h \
+ opcodes.h \
+ $(TOP)/src/os.h \
+ $(TOP)/src/os_common.h \
+ $(TOP)/src/os_unix.h \
+ $(TOP)/src/os_win.h \
+ $(TOP)/src/sqliteInt.h \
+ $(TOP)/src/vdbe.h \
+ parse.h
+
+# Header files used by the VDBE submodule
+#
+VDBEHDR = \
+ $(HDR) \
+ $(TOP)/src/vdbeInt.h
+
+# This is the default Makefile target. The objects listed here
+# are what get build when you type just "make" with no arguments.
+#
+all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)
+
+Makefile: $(TOP)/Makefile.in
+ ./config.status
+
+# Generate the file "last_change" which contains the date of change
+# of the most recently modified source code file
+#
+last_change: $(SRC)
+ cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \
+ | awk '{print $$5,$$6}' >last_change
+
+libsqlite3.la: $(LIBOBJ)
+ $(LTLINK) -o libsqlite3.la $(LIBOBJ) $(LIBPTHREAD) \
+ ${ALLOWRELEASE} -rpath $(libdir) -version-info "8:6:8"
+
+libtclsqlite3.la: tclsqlite.lo libsqlite3.la
+ $(LTLINK) -o libtclsqlite3.la tclsqlite.lo \
+ $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(LIBPTHREAD) \
+ -rpath $(libdir)/sqlite \
+ -version-info "8:6:8"
+
+sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
+ $(LTLINK) $(READLINE_FLAGS) $(LIBPTHREAD) \
+ -o sqlite3 $(TOP)/src/shell.c libsqlite3.la $(LIBREADLINE)
+
+# This target creates a directory named "tsrc" and fills it with
+# copies of all of the C source code and header files needed to
+# build on the target system. Some of the C source code and header
+# files are automatically generated. This target takes care of
+# all that automatic generation.
+#
+target_source: $(SRC) parse.c opcodes.c keywordhash.h $(VDBEHDR)
+ rm -rf tsrc
+ mkdir -p tsrc
+ cp $(SRC) $(VDBEHDR) tsrc
+ rm tsrc/sqlite.h.in tsrc/parse.y
+ cp parse.c opcodes.c keywordhash.h tsrc
+ cp $(TOP)/sqlite3.def tsrc
+
+# Rules to build the LEMON compiler generator
+#
+lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
+ $(BCC) -o lemon $(TOP)/tool/lemon.c
+ cp $(TOP)/tool/lempar.c .
+
+
+# Rules to build individual files
+#
+alter.lo: $(TOP)/src/alter.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/alter.c
+
+analyze.lo: $(TOP)/src/analyze.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/analyze.c
+
+attach.lo: $(TOP)/src/attach.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/attach.c
+
+auth.lo: $(TOP)/src/auth.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/auth.c
+
+btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
+ $(LTCOMPILE) -c $(TOP)/src/btree.c
+
+build.lo: $(TOP)/src/build.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/build.c
+
+callback.lo: $(TOP)/src/callback.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/callback.c
+
+complete.lo: $(TOP)/src/complete.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/complete.c
+
+date.lo: $(TOP)/src/date.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/date.c
+
+delete.lo: $(TOP)/src/delete.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/delete.c
+
+expr.lo: $(TOP)/src/expr.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/expr.c
+
+func.lo: $(TOP)/src/func.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/func.c
+
+hash.lo: $(TOP)/src/hash.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/hash.c
+
+insert.lo: $(TOP)/src/insert.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/insert.c
+
+legacy.lo: $(TOP)/src/legacy.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/legacy.c
+
+main.lo: $(TOP)/src/main.c $(HDR)
+ $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
+
+pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
+ $(LTCOMPILE) -c $(TOP)/src/pager.c
+
+opcodes.lo: opcodes.c
+ $(LTCOMPILE) -c opcodes.c
+
+opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
+ sort -n -b +2 opcodes.h | awk -f $(TOP)/mkopcodec.awk >opcodes.c
+
+opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
+ cat parse.h $(TOP)/src/vdbe.c | awk -f $(TOP)/mkopcodeh.awk >opcodes.h
+
+os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/os_unix.c
+
+os_win.lo: $(TOP)/src/os_win.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/os_win.c
+
+parse.lo: parse.c $(HDR)
+ $(LTCOMPILE) -c parse.c
+
+parse.h: parse.c
+
+parse.c: $(TOP)/src/parse.y lemon$(BEXE)
+ cp $(TOP)/src/parse.y .
+ ./lemon $(OPTS) parse.y
+
+pragma.lo: $(TOP)/src/pragma.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/pragma.c
+
+prepare.lo: $(TOP)/src/prepare.c $(HDR)
+ $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
+
+printf.lo: $(TOP)/src/printf.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/printf.c
+
+random.lo: $(TOP)/src/random.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/random.c
+
+select.lo: $(TOP)/src/select.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/select.c
+
+sqlite3.h: $(TOP)/src/sqlite.h.in
+ sed -e s/--VERS--/$(RELEASE)/ $(TOP)/src/sqlite.h.in | \
+ sed -e s/--VERSION-NUMBER--/$(VERSION_NUMBER)/ >sqlite3.h
+
+table.lo: $(TOP)/src/table.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/table.c
+
+tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/tclsqlite.c
+
+tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/tokenize.c
+
+keywordhash.h: $(TOP)/tool/mkkeywordhash.c
+ $(BCC) -o mkkeywordhash$(BEXE) $(OPTS) $(TOP)/tool/mkkeywordhash.c
+ ./mkkeywordhash$(BEXE) >keywordhash.h
+
+trigger.lo: $(TOP)/src/trigger.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/trigger.c
+
+update.lo: $(TOP)/src/update.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/update.c
+
+utf.lo: $(TOP)/src/utf.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/utf.c
+
+util.lo: $(TOP)/src/util.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/util.c
+
+vacuum.lo: $(TOP)/src/vacuum.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/vacuum.c
+
+vdbe.lo: $(TOP)/src/vdbe.c $(VDBEHDR)
+ $(LTCOMPILE) -c $(TOP)/src/vdbe.c
+
+vdbeapi.lo: $(TOP)/src/vdbeapi.c $(VDBEHDR)
+ $(LTCOMPILE) -c $(TOP)/src/vdbeapi.c
+
+vdbeaux.lo: $(TOP)/src/vdbeaux.c $(VDBEHDR)
+ $(LTCOMPILE) -c $(TOP)/src/vdbeaux.c
+
+vdbefifo.lo: $(TOP)/src/vdbefifo.c $(VDBEHDR)
+ $(LTCOMPILE) -c $(TOP)/src/vdbefifo.c
+
+vdbemem.lo: $(TOP)/src/vdbemem.c $(VDBEHDR)
+ $(LTCOMPILE) -c $(TOP)/src/vdbemem.c
+
+where.lo: $(TOP)/src/where.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/where.c
+
+tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
+ $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c
+
+tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR)
+ $(LTCOMPILE) -DTCL_USE_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c
+
+tclsqlite3: tclsqlite-shell.lo libsqlite3.la
+ $(LTLINK) -o tclsqlite3 tclsqlite-shell.lo \
+ libsqlite3.la $(LIBTCL)
+
+testfixture$(TEXE): $(TOP)/src/tclsqlite.c libsqlite3.la $(TESTSRC)
+ $(LTLINK) -DTCLSH=1 -DSQLITE_TEST=1 $(TEMP_STORE) \
+ -o testfixture $(TESTSRC) $(TOP)/src/tclsqlite.c \
+ libsqlite3.la $(LIBTCL)
+
+crashtest$(TEXE): $(TOP)/src/tclsqlite.c libsqlite3.la $(TESTSRC) $(TOP)/src/os_test.c
+ $(LTLINK) -DOS_TEST=1 -DTCLSH=1 -DSQLITE_TEST=1 \
+ -o crashtest \
+ $(TESTSRC) $(TOP)/src/os_test.c $(TOP)/src/tclsqlite.c \
+ libsqlite3.la $(LIBTCL)
+
+
+
+fulltest: testfixture$(TEXE) sqlite3$(TEXE) crashtest$(TEXE)
+ ./testfixture $(TOP)/test/all.test
+
+test: testfixture$(TEXE) sqlite3$(TEXE)
+ ./testfixture $(TOP)/test/quick.test
+
+sqlite3_analyzer$(TEXE): $(TOP)/src/tclsqlite.c libtclsqlite3.la \
+ $(TESTSRC) $(TOP)/tool/spaceanal.tcl
+ sed \
+ -e '/^#/d' \
+ -e 's,\\,\\\\,g' \
+ -e 's,",\\",g' \
+ -e 's,^,",' \
+ -e 's,$$,\\n",' \
+ $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
+ $(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 $(TEMP_STORE)\
+ -o sqlite3_analyzer$(EXE) $(TESTSRC) $(TOP)/src/tclsqlite.c \
+ libtclsqlite3.la $(LIBTCL)
+
+# Rules used to build documentation
+#
+arch.html: $(TOP)/www/arch.tcl
+ tclsh $(TOP)/www/arch.tcl >arch.html
+
+arch2.gif: $(TOP)/www/arch2.gif
+ cp $(TOP)/www/arch2.gif .
+
+autoinc.html: $(TOP)/www/autoinc.tcl
+ tclsh $(TOP)/www/autoinc.tcl >autoinc.html
+
+c_interface.html: $(TOP)/www/c_interface.tcl
+ tclsh $(TOP)/www/c_interface.tcl >c_interface.html
+
+capi3.html: $(TOP)/www/capi3.tcl
+ tclsh $(TOP)/www/capi3.tcl >capi3.html
+
+capi3ref.html: $(TOP)/www/capi3ref.tcl
+ tclsh $(TOP)/www/capi3ref.tcl >capi3ref.html
+
+changes.html: $(TOP)/www/changes.tcl
+ tclsh $(TOP)/www/changes.tcl >changes.html
+
+compile.html: $(TOP)/www/compile.tcl
+ tclsh $(TOP)/www/compile.tcl >compile.html
+
+copyright.html: $(TOP)/www/copyright.tcl
+ tclsh $(TOP)/www/copyright.tcl >copyright.html
+
+copyright-release.html: $(TOP)/www/copyright-release.html
+ cp $(TOP)/www/copyright-release.html .
+
+copyright-release.pdf: $(TOP)/www/copyright-release.pdf
+ cp $(TOP)/www/copyright-release.pdf .
+
+common.tcl: $(TOP)/www/common.tcl
+ cp $(TOP)/www/common.tcl .
+
+conflict.html: $(TOP)/www/conflict.tcl
+ tclsh $(TOP)/www/conflict.tcl >conflict.html
+
+datatypes.html: $(TOP)/www/datatypes.tcl
+ tclsh $(TOP)/www/datatypes.tcl >datatypes.html
+
+datatype3.html: $(TOP)/www/datatype3.tcl
+ tclsh $(TOP)/www/datatype3.tcl >datatype3.html
+
+docs.html: $(TOP)/www/docs.tcl
+ tclsh $(TOP)/www/docs.tcl >docs.html
+
+download.html: $(TOP)/www/download.tcl
+ mkdir -p doc
+ tclsh $(TOP)/www/download.tcl >download.html
+
+faq.html: $(TOP)/www/faq.tcl
+ tclsh $(TOP)/www/faq.tcl >faq.html
+
+fileformat.html: $(TOP)/www/fileformat.tcl
+ tclsh $(TOP)/www/fileformat.tcl >fileformat.html
+
+formatchng.html: $(TOP)/www/formatchng.tcl
+ tclsh $(TOP)/www/formatchng.tcl >formatchng.html
+
+index.html: $(TOP)/www/index.tcl last_change
+ tclsh $(TOP)/www/index.tcl >index.html
+
+lang.html: $(TOP)/www/lang.tcl
+ tclsh $(TOP)/www/lang.tcl >lang.html
+
+pragma.html: $(TOP)/www/pragma.tcl
+ tclsh $(TOP)/www/pragma.tcl >pragma.html
+
+lockingv3.html: $(TOP)/www/lockingv3.tcl
+ tclsh $(TOP)/www/lockingv3.tcl >lockingv3.html
+
+oldnews.html: $(TOP)/www/oldnews.tcl
+ tclsh $(TOP)/www/oldnews.tcl >oldnews.html
+
+omitted.html: $(TOP)/www/omitted.tcl
+ tclsh $(TOP)/www/omitted.tcl >omitted.html
+
+opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c
+ tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html
+
+mingw.html: $(TOP)/www/mingw.tcl
+ tclsh $(TOP)/www/mingw.tcl >mingw.html
+
+nulls.html: $(TOP)/www/nulls.tcl
+ tclsh $(TOP)/www/nulls.tcl >nulls.html
+
+quickstart.html: $(TOP)/www/quickstart.tcl
+ tclsh $(TOP)/www/quickstart.tcl >quickstart.html
+
+speed.html: $(TOP)/www/speed.tcl
+ tclsh $(TOP)/www/speed.tcl >speed.html
+
+sqlite.gif: $(TOP)/art/SQLite.gif
+ cp $(TOP)/art/SQLite.gif sqlite.gif
+
+sqlite.html: $(TOP)/www/sqlite.tcl
+ tclsh $(TOP)/www/sqlite.tcl >sqlite.html
+
+support.html: $(TOP)/www/support.tcl
+ tclsh $(TOP)/www/support.tcl >support.html
+
+tclsqlite.html: $(TOP)/www/tclsqlite.tcl
+ tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html
+
+vdbe.html: $(TOP)/www/vdbe.tcl
+ tclsh $(TOP)/www/vdbe.tcl >vdbe.html
+
+version3.html: $(TOP)/www/version3.tcl
+ tclsh $(TOP)/www/version3.tcl >version3.html
+
+
+# Files to be published on the website.
+#
+DOC = \
+ arch.html \
+ arch2.gif \
+ autoinc.html \
+ c_interface.html \
+ capi3.html \
+ capi3ref.html \
+ changes.html \
+ compile.html \
+ copyright.html \
+ copyright-release.html \
+ copyright-release.pdf \
+ conflict.html \
+ datatypes.html \
+ datatype3.html \
+ docs.html \
+ download.html \
+ faq.html \
+ fileformat.html \
+ formatchng.html \
+ index.html \
+ lang.html \
+ lockingv3.html \
+ mingw.html \
+ nulls.html \
+ oldnews.html \
+ omitted.html \
+ opcode.html \
+ pragma.html \
+ quickstart.html \
+ speed.html \
+ sqlite.gif \
+ sqlite.html \
+ support.html \
+ tclsqlite.html \
+ vdbe.html \
+ version3.html
+
+doc: common.tcl $(DOC)
+ mkdir -p doc
+ mv $(DOC) doc
+
+install: sqlite3 libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install}
+ $(INSTALL) -d $(DESTDIR)$(libdir)
+ $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
+ $(INSTALL) -d $(DESTDIR)$(exec_prefix)/bin
+ $(LTINSTALL) sqlite3 $(DESTDIR)$(exec_prefix)/bin
+ $(INSTALL) -d $(DESTDIR)$(prefix)/include
+ $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(prefix)/include
+ $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig;
+ $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(libdir)/pkgconfig;
+
+tcl_install: libtclsqlite3.la
+ tclsh $(TOP)/tclinstaller.tcl $(VERSION)
+
+clean:
+ rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la
+ rm -f sqlite3.h opcodes.*
+ rm -rf .libs .deps
+ rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
+ rm -f mkkeywordhash$(BEXE) keywordhash.h
+ rm -f $(PUBLISH)
+ rm -f *.da *.bb *.bbg gmon.out
+ rm -f testfixture$(TEXE) test.db
+ rm -rf doc
+ rm -f common.tcl
+ rm -f sqlite3.dll sqlite3.lib
+
+#
+# Windows section; all this funky .dll stuff ;-)
+#
+dll: sqlite3.dll
+
+REAL_LIBOBJ = $(LIBOBJ:%.lo=.libs/%.o)
+
+sqlite3.dll: $(LIBOBJ) $(TOP)/sqlite3.def
+ dllwrap --dllname sqlite3.dll --def $(TOP)/sqlite3.def $(REAL_LIBOBJ)
+ strip sqlite3.dll
+
+#target for dll import libraries
+implib: sqlite3.lib
+
+#make Borland C++ and/or Microsoft VC import library for the dll
+# ignore any errors (usually due to missing programs)
+sqlite3.lib: sqlite3.dll
+ -impdef -a sqlite3.def sqlite3.dll
+ -implib sqlite3.lib sqlite3.def
+ -lib /machine:i386 /def:$(TOP)/sqlite3.def
+
+distclean: clean
+ rm -f config.log config.status libtool Makefile config.h
diff --git a/ext/pdo_sqlite/sqlite/Makefile.linux-gcc b/ext/pdo_sqlite/sqlite/Makefile.linux-gcc
new file mode 100644
index 000000000..202f4a1ee
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/Makefile.linux-gcc
@@ -0,0 +1,112 @@
+#!/usr/make
+#
+# Makefile for SQLITE
+#
+# This is a template makefile for SQLite. Most people prefer to
+# use the autoconf generated "configure" script to generate the
+# makefile automatically. But that does not work for everybody
+# and in every situation. If you are having problems with the
+# "configure" script, you might want to try this makefile as an
+# alternative. Create a copy of this file, edit the parameters
+# below and type "make".
+#
+
+#### The toplevel directory of the source tree. This is the directory
+# that contains this "Makefile.in" and the "configure.in" script.
+#
+TOP = ../sqlite
+
+#### C Compiler and options for use in building executables that
+# will run on the platform that is doing the build.
+#
+BCC = gcc -g -O2
+#BCC = /opt/ancic/bin/c89 -0
+
+#### If the target operating system supports the "usleep()" system
+# call, then define the HAVE_USLEEP macro for all C modules.
+#
+#USLEEP =
+USLEEP = -DHAVE_USLEEP=1
+
+#### If you want the SQLite library to be safe for use within a
+# multi-threaded program, then define the following macro
+# appropriately:
+#
+#THREADSAFE = -DTHREADSAFE=1
+THREADSAFE = -DTHREADSAFE=0
+
+#### Specify any extra linker options needed to make the library
+# thread safe
+#
+#THREADLIB = -lpthread
+THREADLIB =
+
+#### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1
+# to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all
+# malloc()s and free()s in order to track down memory leaks.
+#
+# SQLite uses some expensive assert() statements in the inner loop.
+# You can make the library go almost twice as fast if you compile
+# with -DNDEBUG=1
+#
+#OPTS = -DSQLITE_DEBUG=2
+#OPTS = -DSQLITE_DEBUG=1
+#OPTS =
+OPTS = -DNDEBUG=1
+
+#### The suffix to add to executable files. ".exe" for windows.
+# Nothing for unix.
+#
+#EXE = .exe
+EXE =
+
+#### C Compile and options for use in building executables that
+# will run on the target platform. This is usually the same
+# as BCC, unless you are cross-compiling.
+#
+TCC = gcc -O6
+#TCC = gcc -g -O0 -Wall
+#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
+#TCC = /opt/mingw/bin/i386-mingw32-gcc -O6
+#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive
+
+#### Tools used to build a static library.
+#
+AR = ar cr
+#AR = /opt/mingw/bin/i386-mingw32-ar cr
+RANLIB = ranlib
+#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib
+
+#### Extra compiler options needed for programs that use the TCL library.
+#
+#TCL_FLAGS =
+#TCL_FLAGS = -DSTATIC_BUILD=1
+TCL_FLAGS = -I/home/drh/tcltk/8.4linux
+#TCL_FLAGS = -I/home/drh/tcltk/8.4win -DSTATIC_BUILD=1
+#TCL_FLAGS = -I/home/drh/tcltk/8.3hpux
+
+#### Linker options needed to link against the TCL library.
+#
+#LIBTCL = -ltcl -lm -ldl
+LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl
+#LIBTCL = /home/drh/tcltk/8.4win/libtcl84s.a -lmsvcrt
+#LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc
+
+#### Compiler options needed for programs that use the readline() library.
+#
+READLINE_FLAGS =
+#READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline
+
+#### Linker options needed by programs using readline() must link against.
+#
+LIBREADLINE =
+#LIBREADLINE = -static -lreadline -ltermcap
+
+#### Should the database engine assume text is coded as UTF-8 or iso8859?
+#
+# ENCODING = UTF8
+ENCODING = ISO8859
+
+# You should not have to change anything below this line
+###############################################################################
+include $(TOP)/main.mk
diff --git a/ext/pdo_sqlite/sqlite/README b/ext/pdo_sqlite/sqlite/README
new file mode 100644
index 000000000..6e4f39205
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/README
@@ -0,0 +1,35 @@
+This directory contains source code to
+
+ SQLite: An Embeddable SQL Database Engine
+
+To compile the project, first create a directory in which to place
+the build products. It is recommended, but not required, that the
+build directory be separate from the source directory. Cd into the
+build directory and then from the build directory run the configure
+script found at the root of the source tree. Then run "make".
+
+For example:
+
+ tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
+ mkdir bld ;# Build will occur in a sibling directory
+ cd bld ;# Change to the build directory
+ ../sqlite/configure ;# Run the configure script
+ make ;# Run the makefile.
+ make install ;# (Optional) Install the build products
+
+The configure script uses autoconf 2.50 and libtool. If the configure
+script does not work out for you, there is a generic makefile named
+"Makefile.linux-gcc" in the top directory of the source tree that you
+can copy and edit to suite your needs. Comments on the generic makefile
+show what changes are needed.
+
+The linux binaries on the website are created using the generic makefile,
+not the configure script. The configure script is unmaintained. (You
+can volunteer to take over maintenance of the configure script, if you want!)
+The windows binaries on the website are created using MinGW32 configured
+as a cross-compiler running under Linux. For details, see the ./publish.sh
+script at the top-level of the source tree.
+
+Contacts:
+
+ http://www.sqlite.org/
diff --git a/ext/pdo_sqlite/sqlite/VERSION b/ext/pdo_sqlite/sqlite/VERSION
new file mode 100644
index 000000000..406ebcbd9
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/VERSION
@@ -0,0 +1 @@
+3.2.7
diff --git a/ext/pdo_sqlite/sqlite/aclocal.m4 b/ext/pdo_sqlite/sqlite/aclocal.m4
new file mode 100644
index 000000000..852eb3134
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/aclocal.m4
@@ -0,0 +1,5913 @@
+# generated automatically by aclocal 1.8.2 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+
+# serial 47 AC_PROG_LIBTOOL
+# Debian $Rev: 192 $
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [m4_define([AC_PROVIDE_IFELSE],
+ [m4_ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [AC_LIBTOOL_CXX],
+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+ ])])
+dnl And a similar setup for Fortran 77 support
+ AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [AC_LIBTOOL_F77],
+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([LT_AC_PROG_GCJ],
+ [define([LT_AC_PROG_GCJ],
+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ AC_PATH_MAGIC
+ fi
+ ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+ [AC_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+[$]*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+ ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$5], , :, [$5])
+else
+ ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ else
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$4], , :, [$4])
+else
+ ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ testring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ *)
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
+ = "XX$testring") >/dev/null 2>&1 &&
+ new_result=`expr "X$testring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ testring=$testring$testring
+ done
+ testring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}]
+EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_unknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s out/conftest.err; then
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
+ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_AC_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=yes
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+ [include additional configurations @<:@automatic@:>@])],
+ [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ AC_MSG_WARN([output file `$ofile' does not exist])
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+ else
+ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+ fi
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+ "") ;;
+ *) AC_MSG_ERROR([invalid tag name: $tagname])
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ AC_MSG_ERROR([tag name \"$tagname\" already exists])
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && test "X$CXX" != "Xno"; then
+ AC_LIBTOOL_LANG_CXX_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+ AC_LIBTOOL_LANG_F77_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+ AC_LIBTOOL_LANG_GCJ_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+ AC_LIBTOOL_LANG_RC_CONFIG
+ ;;
+
+ *)
+ AC_MSG_ERROR([Unsupported tag name: $tagname])
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ AC_MSG_ERROR([unable to update list of available tagged configurations.])
+ fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="ifelse([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+ [AC_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # win32_libid shell function, so use a weaker test based on 'objdump'.
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | kfreebsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case "$host_cpu" in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ case $enable_ltdl_convenience in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
+# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
+# quotes!). If your package is not flat and you're not using automake,
+# define top_builddir and top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, lt_dlinit,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ else
+ enable_ltdl_install=yes
+ fi
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ LTDLINCL=
+ fi
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+ case $host_os in
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+ ;;
+ esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+ AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+ if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then :
+ else
+ AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+ _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+ fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+ [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ AC_PROG_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ freebsd-elf*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ freebsd* | kfreebsd*-gnu)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ ia64*|hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC)
+ # SGI C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc)
+ # Intel C++
+ with_gnu_ld=yes
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ cxx)
+ # Compaq C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
+ $rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ sco*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+ _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+ _LT_AC_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+ _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4*)
+ test "$enable_shared" = yes && enable_static=no
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars. Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ _LT_AC_TAGVAR(compiler, $1) \
+ _LT_AC_TAGVAR(CC, $1) \
+ _LT_AC_TAGVAR(LD, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+ _LT_AC_TAGVAR(old_archive_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+ _LT_AC_TAGVAR(predep_objects, $1) \
+ _LT_AC_TAGVAR(postdep_objects, $1) \
+ _LT_AC_TAGVAR(predeps, $1) \
+ _LT_AC_TAGVAR(postdeps, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(archive_cmds, $1) \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(postinstall_cmds, $1) \
+ _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+ _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+ _LT_AC_TAGVAR(no_undefined_flag, $1) \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+ _LT_AC_TAGVAR(hardcode_automatic, $1) \
+ _LT_AC_TAGVAR(module_cmds, $1) \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(exclude_expsyms, $1) \
+ _LT_AC_TAGVAR(include_expsyms, $1); do
+
+ case $var in
+ _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(module_cmds, $1) | \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\[$]0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+ ;;
+ esac
+
+ifelse([$1], [],
+ [cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ AC_MSG_NOTICE([creating $ofile])],
+ [cfgfile="$ofile"])
+
+ cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+])
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris* | sysv5*)
+ symcode='[[BDRT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | kfreebsd*-gnu)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # KAI C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ icpc)
+ # Intel C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ cxx)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | knetbsd*-gnu)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx)
+ # Digital/Compaq C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ sco*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc)
+ # Lucid
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ unixware*)
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc* | ecc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ ccc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+],[
+ runpath_var=
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)=
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+ _LT_AC_TAGVAR(module_cmds, $1)=
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_AC_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+ if test $supports_anon_versioning = yes; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
+ fi
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ # see comment about different semantics on the GNU ld section
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ bsdi4*)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes ; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ dgux*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ openbsd*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv5*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_AC_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && break
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+SED=$lt_cv_path_SED
+])
+AC_MSG_RESULT([$SED])
+])
+
diff --git a/ext/pdo_sqlite/sqlite/config.guess b/ext/pdo_sqlite/sqlite/config.guess
new file mode 100644
index 000000000..e8c6fc0c3
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/config.guess
@@ -0,0 +1,1432 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2004-01-05'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pegasos:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha*:OpenVMS:*:*)
+ echo alpha-hp-vms
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit 0;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit 0 ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ *:UNICOS/mp:*:*)
+ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
+ # FreeBSD's kernel, but not the complete OS.
+ case ${LIBC} in gnu) kernel_only='k' ;; esac
+ echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit 0 ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit 0 ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit 0 ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit 0 ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit 0 ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit 0 ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit 0 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit 0 ;;
+ *:DRAGONFLY:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly${UNAME_RELEASE}
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/ext/pdo_sqlite/sqlite/config.sub b/ext/pdo_sqlite/sqlite/config.sub
new file mode 100644
index 000000000..463186dbf
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/config.sub
@@ -0,0 +1,1537 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2004-01-05'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | msp430 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | msp430-* \
+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/ext/pdo_sqlite/sqlite/configure b/ext/pdo_sqlite/sqlite/configure
new file mode 100755
index 000000000..11e3c9c51
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/configure
@@ -0,0 +1,21326 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="src/sqlite.h.in"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA program_prefix VERSION RELEASE VERSION_NUMBER BUILD_CC BUILD_CFLAGS BUILD_LIBS TARGET_CC TARGET_CFLAGS TARGET_LINK TARGET_LFLAGS TARGET_RANLIB TARGET_AR THREADSAFE TARGET_THREAD_LIB ALLOWRELEASE TEMP_STORE BUILD_EXEEXT OS_UNIX OS_WIN TARGET_EXEEXT TARGET_LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIBS TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC HAVE_TCL TARGET_READLINE_LIBS TARGET_READLINE_INC TARGET_HAVE_READLINE TARGET_DEBUG LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-shared[=PKGS]
+ build shared libraries [default=yes]
+ --enable-static[=PKGS]
+ build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-threadsafe Support threadsafe operation
+ --enable-releasemode Support libtool link to release mode
+ --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always)
+ --disable-tcl do not build TCL extension
+ --enable-debug enable debugging & verbose explain
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-tags[=TAGS]
+ include additional configurations [automatic]
+ --with-hints=FILE Read configuration options from FILE
+ --with-tcl=DIR directory containing tcl configuration (tclConfig.sh)
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ CXXCPP C++ preprocessor
+ F77 Fortran 77 compiler command
+ FFLAGS Fortran 77 compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# The following RCS revision string applies to configure.in
+# $Revision$
+
+#########
+# Programs needed
+#
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi;
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi;
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi;
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && break
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+SED=$lt_cv_path_SED
+
+fi
+
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
+NM="$lt_cv_path_NM"
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # win32_libid shell function, so use a weaker test based on 'objdump'.
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | kfreebsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case "$host_cpu" in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 3058 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_cc_needs_belf=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+ CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cxx_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+ if test "${ac_cv_prog_CXXCPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$F77"; then
+ ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+ echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$F77" && break
+ done
+fi
+if test -z "$F77"; then
+ ac_ct_F77=$F77
+ for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_F77"; then
+ ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_F77="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+ echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_F77" && break
+done
+
+ F77=$ac_ct_F77
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:4521:" \
+ "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file. (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_f77_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_f77_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+ FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-g -O2"
+ else
+ FFLAGS="-g"
+ fi
+else
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-O2"
+ else
+ FFLAGS=
+ fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ i=0
+ testring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ *)
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
+ = "XX$testring") >/dev/null 2>&1 &&
+ new_result=`expr "X$testring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ testring=$testring$testring
+ done
+ testring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+ echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris* | sysv5*)
+ symcode='[BDRT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+ echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
+
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ AR=$ac_ct_AR
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
+else
+ pic_mode=default
+fi;
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+ case $host_os in
+ sco3.2v5*)
+ lt_prog_cc_shlib='-belf'
+ ;;
+ esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+ if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then :
+ else
+ { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+ lt_cv_prog_cc_can_build_shared=no
+ fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ else
+ lt_prog_compiler_static_works=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:5555: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:5559: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc* | ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ lt_prog_compiler_pic='-Kpic'
+ lt_prog_compiler_static='-dn'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:5788: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:5792: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_prog_compiler_pic_works=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:5848: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:5852: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s out/conftest.err; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag=
+ enable_shared_with_static_runtimes=no
+ archive_cmds=
+ archive_expsym_cmds=
+ old_archive_From_new_cmds=
+ old_archive_from_expsyms_cmds=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ thread_safe_flag_spec=
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_direct=no
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ link_all_deplibs=unknown
+ hardcode_automatic=no
+ module_cmds=
+ module_expsym_cmds=
+ always_export_symbols=no
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds="$tmp_archive_cmds"
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ else
+ archive_expsym_cmds="$tmp_archive_cmds"
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = yes; then
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.012|aix4.012.*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec=' '
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+
+ bsdi4*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes ; then
+ archive_cmds_need_lc=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec='-all_load $convenience'
+ link_all_deplibs=yes
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ link_all_deplibs=yes
+ ;;
+
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ openbsd*)
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z text'
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ no_undefined_flag='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv5*)
+ no_undefined_flag=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ hardcode_libdir_flag_spec=
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
+test "$ld_shlibs" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc=no
+ else
+ archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.01* | freebsdelf3.01*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=yes
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var " || \
+ test "X$hardcode_automatic"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+
+if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 8032 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 8130 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+# Report which librarie types wil actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ if test "$GCC" = yes; then
+ archive_cmds_need_lc=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec='-all_load $convenience'
+ link_all_deplibs=yes
+ else
+ ld_shlibs=no
+ fi
+ ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler \
+ CC \
+ LD \
+ lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
+ lt_prog_compiler_static \
+ lt_prog_compiler_no_builtin_flag \
+ export_dynamic_flag_spec \
+ thread_safe_flag_spec \
+ whole_archive_flag_spec \
+ enable_shared_with_static_runtimes \
+ old_archive_cmds \
+ old_archive_from_new_cmds \
+ predep_objects \
+ postdep_objects \
+ predeps \
+ postdeps \
+ compiler_lib_search_path \
+ archive_cmds \
+ archive_expsym_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ old_archive_from_expsyms_cmds \
+ allow_undefined_flag \
+ no_undefined_flag \
+ export_symbols_cmds \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+ hardcode_automatic \
+ module_cmds \
+ module_expsym_cmds \
+ lt_cv_prog_compiler_c_o \
+ exclude_expsyms \
+ include_expsyms; do
+
+ case $var in
+ old_archive_cmds | \
+ old_archive_from_new_cmds | \
+ archive_cmds | \
+ archive_expsym_cmds | \
+ module_cmds | \
+ module_expsym_cmds | \
+ old_archive_from_expsyms_cmds | \
+ export_symbols_cmds | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+ cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+ withval="$with_tags"
+ tagnames="$withval"
+fi;
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+ else
+ { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+ fi
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+ "") ;;
+ *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && test "X$CXX" != "Xno"; then
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+ lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.012|aix4.012.*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct_CXX=yes
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols_CXX=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX=' '
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes; then
+ archive_cmds_need_lc_CXX=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_CXX='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_CXX='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ whole_archive_flag_spec_CXX='-all_load $convenience'
+ link_all_deplibs_CXX=yes
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ freebsd12*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+ freebsd* | kfreebsd*-gnu)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC)
+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+ hardcode_libdir_separator_CXX=:
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ ia64*|hppa*64*)
+ archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc)
+ # Intel C++
+ with_gnu_ld=yes
+ archive_cmds_need_lc_CXX=no
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ cxx)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
+ $rm $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ sco*)
+ archive_cmds_need_lc_CXX=no
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.0-5 | solaris2.0-5.*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | kfreebsd*-gnu)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ icpc)
+ # Intel C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ cxx)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | knetbsd*-gnu)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ sco*)
+ case $cc_basename in
+ CC)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ unixware*)
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:10309: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:10313: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:10369: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:10373: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s out/conftest.err; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_CXX=no
+ else
+ archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.01* | freebsdelf3.01*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=yes
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+ test -n "$runpath_var CXX" || \
+ test "X$hardcode_automatic_CXX"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 11730 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 11828 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_CXX \
+ CC_CXX \
+ LD_CXX \
+ lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_pic_CXX \
+ lt_prog_compiler_static_CXX \
+ lt_prog_compiler_no_builtin_flag_CXX \
+ export_dynamic_flag_spec_CXX \
+ thread_safe_flag_spec_CXX \
+ whole_archive_flag_spec_CXX \
+ enable_shared_with_static_runtimes_CXX \
+ old_archive_cmds_CXX \
+ old_archive_from_new_cmds_CXX \
+ predep_objects_CXX \
+ postdep_objects_CXX \
+ predeps_CXX \
+ postdeps_CXX \
+ compiler_lib_search_path_CXX \
+ archive_cmds_CXX \
+ archive_expsym_cmds_CXX \
+ postinstall_cmds_CXX \
+ postuninstall_cmds_CXX \
+ old_archive_from_expsyms_cmds_CXX \
+ allow_undefined_flag_CXX \
+ no_undefined_flag_CXX \
+ export_symbols_cmds_CXX \
+ hardcode_libdir_flag_spec_CXX \
+ hardcode_libdir_flag_spec_ld_CXX \
+ hardcode_libdir_separator_CXX \
+ hardcode_automatic_CXX \
+ module_cmds_CXX \
+ module_expsym_cmds_CXX \
+ lt_cv_prog_compiler_c_o_CXX \
+ exclude_expsyms_CXX \
+ include_expsyms_CXX; do
+
+ case $var in
+ old_archive_cmds_CXX | \
+ old_archive_from_new_cmds_CXX | \
+ archive_cmds_CXX | \
+ archive_expsym_cmds_CXX | \
+ module_cmds_CXX | \
+ module_expsym_cmds_CXX | \
+ old_archive_from_expsyms_cmds_CXX | \
+ export_symbols_cmds_CXX | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4*)
+ test "$enable_shared" = yes && enable_static=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_static_F77='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_F77='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_F77=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_F77=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ else
+ lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc* | ecc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-static'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ lt_prog_compiler_pic_F77='-Kpic'
+ lt_prog_compiler_static_F77='-dn'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_F77='-Qoption ld '
+ lt_prog_compiler_pic_F77='-PIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_F77='-Kconform_pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_F77='-pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_F77=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_F77"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:12655: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:12659: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_prog_compiler_pic_works_F77=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+ case $lt_prog_compiler_pic_F77 in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+ esac
+else
+ lt_prog_compiler_pic_F77=
+ lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_F77=
+ ;;
+ *)
+ lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o_F77=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:12715: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:12719: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s out/conftest.err; then
+ lt_cv_prog_compiler_c_o_F77=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag_F77=
+ enable_shared_with_static_runtimes_F77=no
+ archive_cmds_F77=
+ archive_expsym_cmds_F77=
+ old_archive_From_new_cmds_F77=
+ old_archive_from_expsyms_cmds_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ thread_safe_flag_spec_F77=
+ hardcode_libdir_flag_spec_F77=
+ hardcode_libdir_flag_spec_ld_F77=
+ hardcode_libdir_separator_F77=
+ hardcode_direct_F77=no
+ hardcode_minus_L_F77=no
+ hardcode_shlibpath_var_F77=unsupported
+ link_all_deplibs_F77=unknown
+ hardcode_automatic_F77=no
+ module_cmds_F77=
+ module_expsym_cmds_F77=
+ always_export_symbols_F77=no
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_F77=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_F77=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_F77=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_F77=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_F77=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=no
+ enable_shared_with_static_runtimes_F77=yes
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_F77=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ sunos4*)
+ archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds_F77="$tmp_archive_cmds"
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ else
+ archive_expsym_cmds_F77="$tmp_archive_cmds"
+ fi
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_F77" = yes; then
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_F77=
+ fi
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=yes
+ archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_F77=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_F77=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_F77=''
+ hardcode_direct_F77=yes
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.012|aix4.012.*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct_F77=yes
+ else
+ # We have old collect2
+ hardcode_direct_F77=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_F77=yes
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_libdir_separator_F77=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_F77=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_F77='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_F77="-z nodefs"
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_F77=' ${wl}-bernotok'
+ allow_undefined_flag_F77=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols_F77=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_F77=' '
+ archive_cmds_need_lc_F77=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_F77=no
+ ;;
+
+ bsdi4*)
+ export_dynamic_flag_spec_F77=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_F77=' '
+ allow_undefined_flag_F77=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_F77='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_F77=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes ; then
+ archive_cmds_need_lc_F77=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_F77='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_F77='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_F77='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_F77='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct_F77=no
+ hardcode_automatic_F77=yes
+ hardcode_shlibpath_var_F77=unsupported
+ whole_archive_flag_spec_F77='-all_load $convenience'
+ link_all_deplibs_F77=yes
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_F77=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu)
+ archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ link_all_deplibs_F77=yes
+ ;;
+
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ newsos6)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ openbsd*)
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ allow_undefined_flag_F77=unsupported
+ archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ no_undefined_flag_F77=' -z text'
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_shlibpath_var_F77=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ esac
+ link_all_deplibs_F77=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_F77='$CC -r -o $output$reload_objs'
+ hardcode_direct_F77=no
+ ;;
+ motorola)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_F77=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ no_undefined_flag_F77='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv5*)
+ no_undefined_flag_F77=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ hardcode_libdir_flag_spec_F77=
+ hardcode_shlibpath_var_F77=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ ld_shlibs_F77=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_F77=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_F77 in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_F77
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+ allow_undefined_flag_F77=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_F77=no
+ else
+ archive_cmds_need_lc_F77=yes
+ fi
+ allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.01* | freebsdelf3.01*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=yes
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+ test -n "$runpath_var F77" || \
+ test "X$hardcode_automatic_F77"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_F77" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+ test "$hardcode_minus_L_F77" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_F77=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_F77=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
+
+if test "$hardcode_action_F77" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_F77 \
+ CC_F77 \
+ LD_F77 \
+ lt_prog_compiler_wl_F77 \
+ lt_prog_compiler_pic_F77 \
+ lt_prog_compiler_static_F77 \
+ lt_prog_compiler_no_builtin_flag_F77 \
+ export_dynamic_flag_spec_F77 \
+ thread_safe_flag_spec_F77 \
+ whole_archive_flag_spec_F77 \
+ enable_shared_with_static_runtimes_F77 \
+ old_archive_cmds_F77 \
+ old_archive_from_new_cmds_F77 \
+ predep_objects_F77 \
+ postdep_objects_F77 \
+ predeps_F77 \
+ postdeps_F77 \
+ compiler_lib_search_path_F77 \
+ archive_cmds_F77 \
+ archive_expsym_cmds_F77 \
+ postinstall_cmds_F77 \
+ postuninstall_cmds_F77 \
+ old_archive_from_expsyms_cmds_F77 \
+ allow_undefined_flag_F77 \
+ no_undefined_flag_F77 \
+ export_symbols_cmds_F77 \
+ hardcode_libdir_flag_spec_F77 \
+ hardcode_libdir_flag_spec_ld_F77 \
+ hardcode_libdir_separator_F77 \
+ hardcode_automatic_F77 \
+ module_cmds_F77 \
+ module_expsym_cmds_F77 \
+ lt_cv_prog_compiler_c_o_F77 \
+ exclude_expsyms_F77 \
+ include_expsyms_F77; do
+
+ case $var in
+ old_archive_cmds_F77 | \
+ old_archive_from_new_cmds_F77 | \
+ archive_cmds_F77 | \
+ archive_expsym_cmds_F77 | \
+ module_cmds_F77 | \
+ module_expsym_cmds_F77 | \
+ old_archive_from_expsyms_cmds_F77 | \
+ export_symbols_cmds_F77 | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:14749: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:14753: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_static_GCJ='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_GCJ='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_GCJ=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_GCJ=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ else
+ lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc* | ecc*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-static'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ lt_prog_compiler_pic_GCJ='-Kpic'
+ lt_prog_compiler_static_GCJ='-dn'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_GCJ='-Qoption ld '
+ lt_prog_compiler_pic_GCJ='-PIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_GCJ='-Kconform_pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_GCJ='-pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_GCJ=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_GCJ=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:14982: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:14986: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_prog_compiler_pic_works_GCJ=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+ case $lt_prog_compiler_pic_GCJ in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+ esac
+else
+ lt_prog_compiler_pic_GCJ=
+ lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_GCJ=
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o_GCJ=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:15042: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:15046: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s out/conftest.err; then
+ lt_cv_prog_compiler_c_o_GCJ=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag_GCJ=
+ enable_shared_with_static_runtimes_GCJ=no
+ archive_cmds_GCJ=
+ archive_expsym_cmds_GCJ=
+ old_archive_From_new_cmds_GCJ=
+ old_archive_from_expsyms_cmds_GCJ=
+ export_dynamic_flag_spec_GCJ=
+ whole_archive_flag_spec_GCJ=
+ thread_safe_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_ld_GCJ=
+ hardcode_libdir_separator_GCJ=
+ hardcode_direct_GCJ=no
+ hardcode_minus_L_GCJ=no
+ hardcode_shlibpath_var_GCJ=unsupported
+ link_all_deplibs_GCJ=unknown
+ hardcode_automatic_GCJ=no
+ module_cmds_GCJ=
+ module_expsym_cmds_GCJ=
+ always_export_symbols_GCJ=no
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_GCJ=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_GCJ=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_GCJ=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_GCJ=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_GCJ=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=no
+ enable_shared_with_static_runtimes_GCJ=yes
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_GCJ=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ sunos4*)
+ archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds_GCJ="$tmp_archive_cmds"
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ else
+ archive_expsym_cmds_GCJ="$tmp_archive_cmds"
+ fi
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_GCJ" = yes; then
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_GCJ=
+ fi
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=yes
+ archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_GCJ=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_GCJ=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_GCJ=''
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_separator_GCJ=':'
+ link_all_deplibs_GCJ=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.012|aix4.012.*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct_GCJ=yes
+ else
+ # We have old collect2
+ hardcode_direct_GCJ=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_libdir_separator_GCJ=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_GCJ=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_GCJ='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_GCJ="-z nodefs"
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_GCJ=' ${wl}-bernotok'
+ allow_undefined_flag_GCJ=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols_GCJ=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_GCJ=' '
+ archive_cmds_need_lc_GCJ=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_GCJ=no
+ ;;
+
+ bsdi4*)
+ export_dynamic_flag_spec_GCJ=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ=' '
+ allow_undefined_flag_GCJ=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_GCJ='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_GCJ=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if test "$GXX" = yes ; then
+ archive_cmds_need_lc_GCJ=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_GCJ='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_GCJ='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct_GCJ=no
+ hardcode_automatic_GCJ=yes
+ hardcode_shlibpath_var_GCJ=unsupported
+ whole_archive_flag_spec_GCJ='-all_load $convenience'
+ link_all_deplibs_GCJ=yes
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_GCJ=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu)
+ archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ link_all_deplibs_GCJ=yes
+ ;;
+
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ newsos6)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ openbsd*)
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ allow_undefined_flag_GCJ=unsupported
+ archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ no_undefined_flag_GCJ=' -z text'
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ esac
+ link_all_deplibs_GCJ=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+ hardcode_direct_GCJ=no
+ ;;
+ motorola)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ export_dynamic_flag_spec_GCJ='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_GCJ=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ no_undefined_flag_GCJ='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv5*)
+ no_undefined_flag_GCJ=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ hardcode_libdir_flag_spec_GCJ=
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ *)
+ ld_shlibs_GCJ=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_GCJ=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_GCJ in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_GCJ
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+ allow_undefined_flag_GCJ=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_GCJ=no
+ else
+ archive_cmds_need_lc_GCJ=yes
+ fi
+ allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.01* | freebsdelf3.01*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=yes
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+ test -n "$runpath_var GCJ" || \
+ test "X$hardcode_automatic_GCJ"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_GCJ" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+ test "$hardcode_minus_L_GCJ" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_GCJ=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_GCJ=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_GCJ=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
+
+if test "$hardcode_action_GCJ" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 17226 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 17324 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_GCJ \
+ CC_GCJ \
+ LD_GCJ \
+ lt_prog_compiler_wl_GCJ \
+ lt_prog_compiler_pic_GCJ \
+ lt_prog_compiler_static_GCJ \
+ lt_prog_compiler_no_builtin_flag_GCJ \
+ export_dynamic_flag_spec_GCJ \
+ thread_safe_flag_spec_GCJ \
+ whole_archive_flag_spec_GCJ \
+ enable_shared_with_static_runtimes_GCJ \
+ old_archive_cmds_GCJ \
+ old_archive_from_new_cmds_GCJ \
+ predep_objects_GCJ \
+ postdep_objects_GCJ \
+ predeps_GCJ \
+ postdeps_GCJ \
+ compiler_lib_search_path_GCJ \
+ archive_cmds_GCJ \
+ archive_expsym_cmds_GCJ \
+ postinstall_cmds_GCJ \
+ postuninstall_cmds_GCJ \
+ old_archive_from_expsyms_cmds_GCJ \
+ allow_undefined_flag_GCJ \
+ no_undefined_flag_GCJ \
+ export_symbols_cmds_GCJ \
+ hardcode_libdir_flag_spec_GCJ \
+ hardcode_libdir_flag_spec_ld_GCJ \
+ hardcode_libdir_separator_GCJ \
+ hardcode_automatic_GCJ \
+ module_cmds_GCJ \
+ module_expsym_cmds_GCJ \
+ lt_cv_prog_compiler_c_o_GCJ \
+ exclude_expsyms_GCJ \
+ include_expsyms_GCJ; do
+
+ case $var in
+ old_archive_cmds_GCJ | \
+ old_archive_from_new_cmds_GCJ | \
+ archive_cmds_GCJ | \
+ archive_expsym_cmds_GCJ | \
+ module_cmds_GCJ | \
+ module_expsym_cmds_GCJ | \
+ old_archive_from_expsyms_cmds_GCJ | \
+ export_symbols_cmds_GCJ | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_RC \
+ CC_RC \
+ LD_RC \
+ lt_prog_compiler_wl_RC \
+ lt_prog_compiler_pic_RC \
+ lt_prog_compiler_static_RC \
+ lt_prog_compiler_no_builtin_flag_RC \
+ export_dynamic_flag_spec_RC \
+ thread_safe_flag_spec_RC \
+ whole_archive_flag_spec_RC \
+ enable_shared_with_static_runtimes_RC \
+ old_archive_cmds_RC \
+ old_archive_from_new_cmds_RC \
+ predep_objects_RC \
+ postdep_objects_RC \
+ predeps_RC \
+ postdeps_RC \
+ compiler_lib_search_path_RC \
+ archive_cmds_RC \
+ archive_expsym_cmds_RC \
+ postinstall_cmds_RC \
+ postuninstall_cmds_RC \
+ old_archive_from_expsyms_cmds_RC \
+ allow_undefined_flag_RC \
+ no_undefined_flag_RC \
+ export_symbols_cmds_RC \
+ hardcode_libdir_flag_spec_RC \
+ hardcode_libdir_flag_spec_ld_RC \
+ hardcode_libdir_separator_RC \
+ hardcode_automatic_RC \
+ module_cmds_RC \
+ module_expsym_cmds_RC \
+ lt_cv_prog_compiler_c_o_RC \
+ exclude_expsyms_RC \
+ include_expsyms_RC; do
+
+ case $var in
+ old_archive_cmds_RC | \
+ old_archive_from_new_cmds_RC | \
+ archive_cmds_RC | \
+ archive_expsym_cmds_RC | \
+ module_cmds_RC | \
+ module_expsym_cmds_RC | \
+ old_archive_from_expsyms_cmds_RC | \
+ export_symbols_cmds_RC | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ ;;
+
+ *)
+ { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+#########
+# Set up an appropriate program prefix
+#
+if test "$program_prefix" = "NONE"; then
+ program_prefix=""
+fi
+
+
+VERSION=`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`
+echo "Version set to $VERSION"
+
+RELEASE=`cat $srcdir/VERSION`
+echo "Release set to $RELEASE"
+
+VERSION_NUMBER=`cat $srcdir/VERSION \
+ | sed 's/[^0-9]/ /g' \
+ | awk '{printf "%d%03d%03d",$1,$2,$3}'`
+echo "Version number set to $VERSION_NUMBER"
+
+
+#########
+# Check to see if the --with-hints=FILE option is used. If there is none,
+# then check for a files named "$host.hints" and ../$hosts.hints where
+# $host is the hostname of the build system. If still no hints are
+# found, try looking in $system.hints and ../$system.hints where
+# $system is the result of uname -s.
+#
+
+# Check whether --with-hints or --without-hints was given.
+if test "${with_hints+set}" = set; then
+ withval="$with_hints"
+ hints=$withval
+fi;
+if test "$hints" = ""; then
+ host=`hostname | sed 's/\..*//'`
+ if test -r $host.hints; then
+ hints=$host.hints
+ else
+ if test -r ../$host.hints; then
+ hints=../$host.hints
+ fi
+ fi
+fi
+if test "$hints" = ""; then
+ sys=`uname -s`
+ if test -r $sys.hints; then
+ hints=$sys.hints
+ else
+ if test -r ../$sys.hints; then
+ hints=../$sys.hints
+ fi
+ fi
+fi
+if test "$hints" != ""; then
+ echo "$as_me:$LINENO: result: reading hints from $hints" >&5
+echo "${ECHO_T}reading hints from $hints" >&6
+ . $hints
+fi
+
+#########
+# Locate a compiler for the build machine. This compiler should
+# generate command-line programs that run on the build machine.
+#
+default_build_cflags="-g"
+if test "$config_BUILD_CC" = ""; then
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test "$cross_compiling" = "yes"; then
+ { { echo "$as_me:$LINENO: error: unable to find a compiler for building build tools" >&5
+echo "$as_me: error: unable to find a compiler for building build tools" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ BUILD_CC=$CC
+ default_build_cflags=$CFLAGS
+else
+ BUILD_CC=$config_BUILD_CC
+ echo "$as_me:$LINENO: checking host compiler" >&5
+echo $ECHO_N "checking host compiler... $ECHO_C" >&6
+ CC=$BUILD_CC
+ echo "$as_me:$LINENO: result: $BUILD_CC" >&5
+echo "${ECHO_T}$BUILD_CC" >&6
+fi
+echo "$as_me:$LINENO: checking switches for the host compiler" >&5
+echo $ECHO_N "checking switches for the host compiler... $ECHO_C" >&6
+if test "$config_BUILD_CFLAGS" != ""; then
+ CFLAGS=$config_BUILD_CFLAGS
+ BUILD_CFLAGS=$config_BUILD_CFLAGS
+else
+ BUILD_CFLAGS=$default_build_cflags
+fi
+echo "$as_me:$LINENO: result: $BUILD_CFLAGS" >&5
+echo "${ECHO_T}$BUILD_CFLAGS" >&6
+if test "$config_BUILD_LIBS" != ""; then
+ BUILD_LIBS=$config_BUILD_LIBS
+fi
+
+
+
+
+##########
+# Locate a compiler that converts C code into *.o files that run on
+# the target machine.
+#
+echo "$as_me:$LINENO: checking target compiler" >&5
+echo $ECHO_N "checking target compiler... $ECHO_C" >&6
+if test "$config_TARGET_CC" != ""; then
+ TARGET_CC=$config_TARGET_CC
+else
+ TARGET_CC=$BUILD_CC
+fi
+echo "$as_me:$LINENO: result: $TARGET_CC" >&5
+echo "${ECHO_T}$TARGET_CC" >&6
+echo "$as_me:$LINENO: checking switches on the target compiler" >&5
+echo $ECHO_N "checking switches on the target compiler... $ECHO_C" >&6
+if test "$config_TARGET_CFLAGS" != ""; then
+ TARGET_CFLAGS=$config_TARGET_CFLAGS
+else
+ TARGET_CFLAGS=$BUILD_CFLAGS
+fi
+echo "$as_me:$LINENO: result: $TARGET_CFLAGS" >&5
+echo "${ECHO_T}$TARGET_CFLAGS" >&6
+echo "$as_me:$LINENO: checking target linker" >&5
+echo $ECHO_N "checking target linker... $ECHO_C" >&6
+if test "$config_TARGET_LINK" = ""; then
+ TARGET_LINK=$TARGET_CC
+else
+ TARGET_LINK=$config_TARGET_LINK
+fi
+echo "$as_me:$LINENO: result: $TARGET_LINK" >&5
+echo "${ECHO_T}$TARGET_LINK" >&6
+echo "$as_me:$LINENO: checking switches on the target compiler" >&5
+echo $ECHO_N "checking switches on the target compiler... $ECHO_C" >&6
+if test "$config_TARGET_TFLAGS" != ""; then
+ TARGET_TFLAGS=$config_TARGET_TFLAGS
+else
+ TARGET_TFLAGS=$BUILD_CFLAGS
+fi
+if test "$config_TARGET_RANLIB" != ""; then
+ TARGET_RANLIB=$config_TARGET_RANLIB
+else
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ TARGET_RANLIB=$RANLIB
+fi
+if test "$config_TARGET_AR" != ""; then
+ TARGET_AR=$config_TARGET_AR
+else
+ TARGET_AR='ar cr'
+fi
+echo "$as_me:$LINENO: result: $TARGET_TFLAGS" >&5
+echo "${ECHO_T}$TARGET_TFLAGS" >&6
+
+
+
+
+
+
+
+# Set the $cross variable if we are cross-compiling. Make
+# it 0 if we are not.
+#
+echo "$as_me:$LINENO: checking if host and target compilers are the same" >&5
+echo $ECHO_N "checking if host and target compilers are the same... $ECHO_C" >&6
+if test "$BUILD_CC" = "$TARGET_CC"; then
+ cross=0
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ cross=1
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+##########
+# Do we want to support multithreaded use of sqlite
+#
+# Check whether --enable-threadsafe or --disable-threadsafe was given.
+if test "${enable_threadsafe+set}" = set; then
+ enableval="$enable_threadsafe"
+
+else
+ enable_threadsafe=no
+fi;
+echo "$as_me:$LINENO: checking whether to support threadsafe operation" >&5
+echo $ECHO_N "checking whether to support threadsafe operation... $ECHO_C" >&6
+if test "$enable_threadsafe" = "no"; then
+ THREADSAFE=0
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+else
+ THREADSAFE=1
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+fi
+
+
+if test "$THREADSAFE" = "1"; then
+ LIBS=""
+
+echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_create ();
+int
+main ()
+{
+pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_pthread_pthread_create=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
+if test $ac_cv_lib_pthread_pthread_create = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+ LIBS="-lpthread $LIBS"
+
+fi
+
+ TARGET_THREAD_LIB="$LIBS"
+ LIBS=""
+else
+ TARGET_THREAD_LIB=""
+fi
+
+
+##########
+# Do we want to support release
+#
+# Check whether --enable-releasemode or --disable-releasemode was given.
+if test "${enable_releasemode+set}" = set; then
+ enableval="$enable_releasemode"
+
+else
+ enable_releasemode=no
+fi;
+echo "$as_me:$LINENO: checking whether to support shared library linked as release mode or not" >&5
+echo $ECHO_N "checking whether to support shared library linked as release mode or not... $ECHO_C" >&6
+if test "$enable_releasemode" = "no"; then
+ ALLOWRELEASE=""
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+else
+ ALLOWRELEASE="-release `cat VERSION`"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+fi
+
+
+##########
+# Do we want temporary databases in memory
+#
+# Check whether --enable-tempstore or --disable-tempstore was given.
+if test "${enable_tempstore+set}" = set; then
+ enableval="$enable_tempstore"
+
+else
+ enable_tempstore=yes
+fi;
+echo "$as_me:$LINENO: checking whether to use an in-ram database for temporary tables" >&5
+echo $ECHO_N "checking whether to use an in-ram database for temporary tables... $ECHO_C" >&6
+case "$enable_tempstore" in
+ never )
+ TEMP_STORE=0
+ echo "$as_me:$LINENO: result: never" >&5
+echo "${ECHO_T}never" >&6
+ ;;
+ no )
+ TEMP_STORE=1
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ always )
+ TEMP_STORE=3
+ echo "$as_me:$LINENO: result: always" >&5
+echo "${ECHO_T}always" >&6
+ ;;
+ * )
+ TEMP_STORE=2
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ ;;
+esac
+
+
+
+###########
+# Lots of things are different if we are compiling for Windows using
+# the CYGWIN environment. So check for that special case and handle
+# things accordingly.
+#
+echo "$as_me:$LINENO: checking if executables have the .exe suffix" >&5
+echo $ECHO_N "checking if executables have the .exe suffix... $ECHO_C" >&6
+if test "$config_BUILD_EXEEXT" = ".exe"; then
+ CYGWIN=yes
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: unknown" >&5
+echo "${ECHO_T}unknown" >&6
+fi
+if test "$CYGWIN" != "yes"; then
+
+case $host_os in
+ *cygwin* ) CYGWIN=yes;;
+ * ) CYGWIN=no;;
+esac
+
+fi
+if test "$CYGWIN" = "yes"; then
+ BUILD_EXEEXT=.exe
+else
+ BUILD_EXEEXT=$EXEEXT
+fi
+if test "$cross" = "0"; then
+ TARGET_EXEEXT=$BUILD_EXEEXT
+else
+ TARGET_EXEEXT=$config_TARGET_EXEEXT
+fi
+if test "$TARGET_EXEEXT" = ".exe"; then
+ OS_UNIX=0
+ OS_WIN=1
+ tclsubdir=win
+ TARGET_CFLAGS="$TARGET_CFLAGS -DOS_WIN=1"
+else
+ OS_UNIX=1
+ OS_WIN=0
+ tclsubdir=unix
+ TARGET_CFLAGS="$TARGET_CFLAGS -DOS_UNIX=1"
+fi
+
+
+
+
+
+
+##########
+# Extract generic linker options from the environment.
+#
+if test "$config_TARGET_LIBS" != ""; then
+ TARGET_LIBS=$config_TARGET_LIBS
+else
+ TARGET_LIBS=""
+fi
+
+
+##########
+# Figure out all the parameters needed to compile against Tcl.
+#
+# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG
+# macros in the in the tcl.m4 file of the standard TCL distribution.
+# Those macros could not be used directly since we have to make some
+# minor changes to accomodate systems that do not have TCL installed.
+#
+# Check whether --enable-tcl or --disable-tcl was given.
+if test "${enable_tcl+set}" = set; then
+ enableval="$enable_tcl"
+ use_tcl=$enableval
+else
+ use_tcl=yes
+fi;
+if test "${use_tcl}" = "yes" ; then
+
+# Check whether --with-tcl or --without-tcl was given.
+if test "${with_tcl+set}" = set; then
+ withval="$with_tcl"
+ with_tclconfig=${withval}
+fi;
+ echo "$as_me:$LINENO: checking for Tcl configuration" >&5
+echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6
+ if test "${ac_cv_c_tclconfig+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ # First check to see if --with-tcl was specified.
+ if test x"${with_tclconfig}" != x ; then
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
+ else
+ { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5
+echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null`
+ do
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ `ls -d ${libdir} 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null`
+ do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null`
+ do
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ use_tcl=no
+ { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5
+echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;}
+ { echo "$as_me:$LINENO: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&5
+echo "$as_me: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&2;}
+ { echo "$as_me:$LINENO: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&5
+echo "$as_me: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&2;}
+ else
+ TCL_BIN_DIR=${ac_cv_c_tclconfig}
+ echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5
+echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6
+
+ echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
+echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6
+ if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
+ echo "$as_me:$LINENO: result: loading" >&5
+echo "${ECHO_T}loading" >&6
+ . $TCL_BIN_DIR/tclConfig.sh
+ else
+ echo "$as_me:$LINENO: result: file not found" >&5
+echo "${ECHO_T}file not found" >&6
+ fi
+
+ #
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ #
+
+ if test -f $TCL_BIN_DIR/Makefile ; then
+ TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
+ TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
+ TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
+ fi
+
+ #
+ # eval is required to do the TCL_DBGX substitution
+ #
+
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ fi
+fi
+if test "${use_tcl}" = "no" ; then
+ HAVE_TCL=""
+else
+ HAVE_TCL=1
+fi
+
+
+##########
+# Figure out what C libraries are required to compile programs
+# that use "readline()" library.
+#
+if test "$config_TARGET_READLINE_LIBS" != ""; then
+ TARGET_READLINE_LIBS="$config_TARGET_READLINE_LIBS"
+else
+ CC=$TARGET_CC
+ LIBS=""
+ echo "$as_me:$LINENO: checking for library containing tgetent" >&5
+echo $ECHO_N "checking for library containing tgetent... $ECHO_C" >&6
+if test "${ac_cv_search_tgetent+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_tgetent=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char tgetent ();
+int
+main ()
+{
+tgetent ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_tgetent="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_tgetent" = no; then
+ for ac_lib in readline ncurses curses termcap; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char tgetent ();
+int
+main ()
+{
+tgetent ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_tgetent="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_tgetent" >&5
+echo "${ECHO_T}$ac_cv_search_tgetent" >&6
+if test "$ac_cv_search_tgetent" != no; then
+ test "$ac_cv_search_tgetent" = "none required" || LIBS="$ac_cv_search_tgetent $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for readline in -lreadline" >&5
+echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6
+if test "${ac_cv_lib_readline_readline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lreadline $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char readline ();
+int
+main ()
+{
+readline ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_readline_readline=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_readline_readline=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5
+echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6
+if test $ac_cv_lib_readline_readline = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBREADLINE 1
+_ACEOF
+
+ LIBS="-lreadline $LIBS"
+
+fi
+
+ TARGET_READLINE_LIBS="$LIBS"
+fi
+
+
+##########
+# Figure out where to get the READLINE header files.
+#
+echo "$as_me:$LINENO: checking readline header files" >&5
+echo $ECHO_N "checking readline header files... $ECHO_C" >&6
+found=no
+if test "$config_TARGET_READLINE_INC" != ""; then
+ TARGET_READLINE_INC=$config_TARGET_READLINE_INC
+ found=yes
+fi
+if test "$found" = "yes"; then
+ echo "$as_me:$LINENO: result: $TARGET_READLINE_INC" >&5
+echo "${ECHO_T}$TARGET_READLINE_INC" >&6
+else
+ echo "$as_me:$LINENO: result: not specified: still searching..." >&5
+echo "${ECHO_T}not specified: still searching..." >&6
+ if test "${ac_cv_header_readline_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for readline.h" >&5
+echo $ECHO_N "checking for readline.h... $ECHO_C" >&6
+if test "${ac_cv_header_readline_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_readline_h" >&5
+echo "${ECHO_T}$ac_cv_header_readline_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking readline.h usability" >&5
+echo $ECHO_N "checking readline.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <readline.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking readline.h presence" >&5
+echo $ECHO_N "checking readline.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <readline.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: readline.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: readline.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: readline.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: readline.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: readline.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: readline.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: readline.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: readline.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: readline.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: readline.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: readline.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: readline.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: readline.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: readline.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: readline.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for readline.h" >&5
+echo $ECHO_N "checking for readline.h... $ECHO_C" >&6
+if test "${ac_cv_header_readline_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_readline_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_readline_h" >&5
+echo "${ECHO_T}$ac_cv_header_readline_h" >&6
+
+fi
+if test $ac_cv_header_readline_h = yes; then
+ found=yes
+fi
+
+
+fi
+if test "$found" = "no"; then
+ for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
+ as_ac_File=`echo "ac_cv_file_$dir/include/readline.h" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $dir/include/readline.h" >&5
+echo $ECHO_N "checking for $dir/include/readline.h... $ECHO_C" >&6
+if eval "test \"\${$as_ac_File+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ test "$cross_compiling" = yes &&
+ { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+if test -r "$dir/include/readline.h"; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
+if test `eval echo '${'$as_ac_File'}'` = yes; then
+ found=yes
+fi
+
+ if test "$found" = "yes"; then
+ TARGET_READLINE_INC="-I$dir/include"
+ break
+ fi
+ as_ac_File=`echo "ac_cv_file_$dir/include/readline/readline.h" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $dir/include/readline/readline.h" >&5
+echo $ECHO_N "checking for $dir/include/readline/readline.h... $ECHO_C" >&6
+if eval "test \"\${$as_ac_File+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ test "$cross_compiling" = yes &&
+ { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+if test -r "$dir/include/readline/readline.h"; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
+if test `eval echo '${'$as_ac_File'}'` = yes; then
+ found=yes
+fi
+
+ if test "$found" = "yes"; then
+ TARGET_READLINE_INC="-I$dir/include/readline"
+ break
+ fi
+ done
+fi
+if test "$found" = "yes"; then
+ if test "$TARGET_READLINE_LIBS" = ""; then
+ TARGET_HAVE_READLINE=0
+ else
+ TARGET_HAVE_READLINE=1
+ fi
+else
+ TARGET_HAVE_READLINE=0
+fi
+
+
+
+#########
+# check for debug enabled
+# Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+ enableval="$enable_debug"
+ use_debug=$enableval
+else
+ use_debug=no
+fi;
+if test "${use_debug}" = "yes" ; then
+ TARGET_DEBUG=""
+else
+ TARGET_DEBUG="-DNDEBUG"
+fi
+
+
+#########
+# Figure out whether or not we have a "usleep()" function.
+#
+echo "$as_me:$LINENO: checking for usleep" >&5
+echo $ECHO_N "checking for usleep... $ECHO_C" >&6
+if test "${ac_cv_func_usleep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define usleep to an innocuous variant, in case <limits.h> declares usleep.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define usleep innocuous_usleep
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char usleep (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef usleep
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char usleep ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_usleep) || defined (__stub___usleep)
+choke me
+#else
+char (*f) () = usleep;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != usleep;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_usleep=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_usleep=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_usleep" >&5
+echo "${ECHO_T}$ac_cv_func_usleep" >&6
+if test $ac_cv_func_usleep = yes; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"
+fi
+
+
+#########
+# Generate the output files.
+#
+ ac_config_files="$ac_config_files Makefile sqlite3.pc"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
+t quote
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output. A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "sqlite3.pc" ) CONFIG_FILES="$CONFIG_FILES sqlite3.pc" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LN_S@,$LN_S,;t t
+s,@ECHO@,$ECHO,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@CPP@,$CPP,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@F77@,$F77,;t t
+s,@FFLAGS@,$FFLAGS,;t t
+s,@ac_ct_F77@,$ac_ct_F77,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@program_prefix@,$program_prefix,;t t
+s,@VERSION@,$VERSION,;t t
+s,@RELEASE@,$RELEASE,;t t
+s,@VERSION_NUMBER@,$VERSION_NUMBER,;t t
+s,@BUILD_CC@,$BUILD_CC,;t t
+s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
+s,@BUILD_LIBS@,$BUILD_LIBS,;t t
+s,@TARGET_CC@,$TARGET_CC,;t t
+s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t
+s,@TARGET_LINK@,$TARGET_LINK,;t t
+s,@TARGET_LFLAGS@,$TARGET_LFLAGS,;t t
+s,@TARGET_RANLIB@,$TARGET_RANLIB,;t t
+s,@TARGET_AR@,$TARGET_AR,;t t
+s,@THREADSAFE@,$THREADSAFE,;t t
+s,@TARGET_THREAD_LIB@,$TARGET_THREAD_LIB,;t t
+s,@ALLOWRELEASE@,$ALLOWRELEASE,;t t
+s,@TEMP_STORE@,$TEMP_STORE,;t t
+s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
+s,@OS_UNIX@,$OS_UNIX,;t t
+s,@OS_WIN@,$OS_WIN,;t t
+s,@TARGET_EXEEXT@,$TARGET_EXEEXT,;t t
+s,@TARGET_LIBS@,$TARGET_LIBS,;t t
+s,@TCL_VERSION@,$TCL_VERSION,;t t
+s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t
+s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t
+s,@TCL_LIBS@,$TCL_LIBS,;t t
+s,@TCL_INCLUDE_SPEC@,$TCL_INCLUDE_SPEC,;t t
+s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t
+s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t
+s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t
+s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t
+s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t
+s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t
+s,@HAVE_TCL@,$HAVE_TCL,;t t
+s,@TARGET_READLINE_LIBS@,$TARGET_READLINE_LIBS,;t t
+s,@TARGET_READLINE_INC@,$TARGET_READLINE_INC,;t t
+s,@TARGET_HAVE_READLINE@,$TARGET_HAVE_READLINE,;t t
+s,@TARGET_DEBUG@,$TARGET_DEBUG,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/ext/pdo_sqlite/sqlite/configure.ac b/ext/pdo_sqlite/sqlite/configure.ac
new file mode 100644
index 000000000..3682bf821
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/configure.ac
@@ -0,0 +1,616 @@
+#
+# The build process allows for using a cross-compiler. But the default
+# action is to target the same platform that we are running on. The
+# configure script needs to discover the following properties of the
+# build and target systems:
+#
+# srcdir
+#
+# The is the name of the directory that contains the
+# "configure" shell script. All source files are
+# located relative to this directory.
+#
+# bindir
+#
+# The name of the directory where executables should be
+# written by the "install" target of the makefile.
+#
+# program_prefix
+#
+# Add this prefix to the names of all executables that run
+# on the target machine. Default: ""
+#
+# ENABLE_SHARED
+#
+# True if shared libraries should be generated.
+#
+# BUILD_CC
+#
+# The name of a command that is used to convert C
+# source files into executables that run on the build
+# platform.
+#
+# BUILD_CFLAGS
+#
+# Switches that the build compiler needs in order to construct
+# command-line programs.
+#
+# BUILD_LIBS
+#
+# Libraries that the build compiler needs in order to construct
+# command-line programs.
+#
+# BUILD_EXEEXT
+#
+# The filename extension for executables on the build
+# platform. "" for Unix and ".exe" for Windows.
+#
+# TARGET_CC
+#
+# The name of a command that runs on the build platform
+# and converts C source files into *.o files for the
+# target platform. In other words, the cross-compiler.
+#
+# TARGET_CFLAGS
+#
+# Switches that the target compiler needs to turn C source files
+# into *.o files. Do not include TARGET_TCL_INC in this list.
+# Makefiles might add additional switches such as "-I.".
+#
+# TCL_*
+#
+# Lots of values are read in from the tclConfig.sh script,
+# if that script is available. This values are used for
+# constructing and installing the TCL extension.
+#
+# TARGET_READLINE_LIBS
+#
+# This is the library directives passed to the target linker
+# that cause the executable to link against the readline library.
+# This might be a switch like "-lreadline" or pathnames of library
+# file like "../../src/libreadline.a".
+#
+# TARGET_READLINE_INC
+#
+# This variables define the directory that contain header
+# files for the readline library. If the compiler is able
+# to find <readline.h> on its own, then this can be blank.
+#
+# TARGET_LINK
+#
+# The name of the linker that combines *.o files generated
+# by TARGET_CC into executables for the target platform.
+#
+# TARGET_LIBS
+#
+# Additional libraries or other switch that the target linker needs
+# to build an executable on the target. Do not include
+# on this list any libraries in TARGET_TCL_LIBS and
+# TARGET_READLINE_LIBS, etc.
+#
+# TARGET_EXEEXT
+#
+# The filename extension for executables on the
+# target platform. "" for Unix and ".exe" for windows.
+#
+# The generated configure script will make an attempt to guess
+# at all of the above parameters. You can override any of
+# the guesses by setting the environment variable named
+# "config_AAAA" where "AAAA" is the name of the parameter
+# described above. (Exception: srcdir cannot be set this way.)
+# If you have a file that sets one or more of these environment
+# variables, you can invoke configure as follows:
+#
+# configure --with-hints=FILE
+#
+# where FILE is the name of the file that sets the environment
+# variables. FILE should be an absolute pathname.
+#
+# This configure.in file is easy to reuse on other projects. Just
+# change the argument to AC_INIT(). And disable any features that
+# you don't need (for example BLT) by erasing or commenting out
+# the corresponding code.
+#
+AC_INIT(src/sqlite.h.in)
+
+dnl Put the RCS revision string after AC_INIT so that it will also
+dnl show in in configure.
+# The following RCS revision string applies to configure.in
+# $Revision$
+
+#########
+# Programs needed
+#
+AC_PROG_LIBTOOL
+AC_PROG_INSTALL
+
+#########
+# Set up an appropriate program prefix
+#
+if test "$program_prefix" = "NONE"; then
+ program_prefix=""
+fi
+AC_SUBST(program_prefix)
+
+VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`]
+echo "Version set to $VERSION"
+AC_SUBST(VERSION)
+RELEASE=`cat $srcdir/VERSION`
+echo "Release set to $RELEASE"
+AC_SUBST(RELEASE)
+VERSION_NUMBER=[`cat $srcdir/VERSION \
+ | sed 's/[^0-9]/ /g' \
+ | awk '{printf "%d%03d%03d",$1,$2,$3}'`]
+echo "Version number set to $VERSION_NUMBER"
+AC_SUBST(VERSION_NUMBER)
+
+#########
+# Check to see if the --with-hints=FILE option is used. If there is none,
+# then check for a files named "$host.hints" and ../$hosts.hints where
+# $host is the hostname of the build system. If still no hints are
+# found, try looking in $system.hints and ../$system.hints where
+# $system is the result of uname -s.
+#
+AC_ARG_WITH(hints,
+ [ --with-hints=FILE Read configuration options from FILE],
+ hints=$withval)
+if test "$hints" = ""; then
+ host=`hostname | sed 's/\..*//'`
+ if test -r $host.hints; then
+ hints=$host.hints
+ else
+ if test -r ../$host.hints; then
+ hints=../$host.hints
+ fi
+ fi
+fi
+if test "$hints" = ""; then
+ sys=`uname -s`
+ if test -r $sys.hints; then
+ hints=$sys.hints
+ else
+ if test -r ../$sys.hints; then
+ hints=../$sys.hints
+ fi
+ fi
+fi
+if test "$hints" != ""; then
+ AC_MSG_RESULT(reading hints from $hints)
+ . $hints
+fi
+
+#########
+# Locate a compiler for the build machine. This compiler should
+# generate command-line programs that run on the build machine.
+#
+default_build_cflags="-g"
+if test "$config_BUILD_CC" = ""; then
+ AC_PROG_CC
+ if test "$cross_compiling" = "yes"; then
+ AC_MSG_ERROR([unable to find a compiler for building build tools])
+ fi
+ BUILD_CC=$CC
+ default_build_cflags=$CFLAGS
+else
+ BUILD_CC=$config_BUILD_CC
+ AC_MSG_CHECKING([host compiler])
+ CC=$BUILD_CC
+ AC_MSG_RESULT($BUILD_CC)
+fi
+AC_MSG_CHECKING([switches for the host compiler])
+if test "$config_BUILD_CFLAGS" != ""; then
+ CFLAGS=$config_BUILD_CFLAGS
+ BUILD_CFLAGS=$config_BUILD_CFLAGS
+else
+ BUILD_CFLAGS=$default_build_cflags
+fi
+AC_MSG_RESULT($BUILD_CFLAGS)
+if test "$config_BUILD_LIBS" != ""; then
+ BUILD_LIBS=$config_BUILD_LIBS
+fi
+AC_SUBST(BUILD_CC)
+AC_SUBST(BUILD_CFLAGS)
+AC_SUBST(BUILD_LIBS)
+
+##########
+# Locate a compiler that converts C code into *.o files that run on
+# the target machine.
+#
+AC_MSG_CHECKING([target compiler])
+if test "$config_TARGET_CC" != ""; then
+ TARGET_CC=$config_TARGET_CC
+else
+ TARGET_CC=$BUILD_CC
+fi
+AC_MSG_RESULT($TARGET_CC)
+AC_MSG_CHECKING([switches on the target compiler])
+if test "$config_TARGET_CFLAGS" != ""; then
+ TARGET_CFLAGS=$config_TARGET_CFLAGS
+else
+ TARGET_CFLAGS=$BUILD_CFLAGS
+fi
+AC_MSG_RESULT($TARGET_CFLAGS)
+AC_MSG_CHECKING([target linker])
+if test "$config_TARGET_LINK" = ""; then
+ TARGET_LINK=$TARGET_CC
+else
+ TARGET_LINK=$config_TARGET_LINK
+fi
+AC_MSG_RESULT($TARGET_LINK)
+AC_MSG_CHECKING([switches on the target compiler])
+if test "$config_TARGET_TFLAGS" != ""; then
+ TARGET_TFLAGS=$config_TARGET_TFLAGS
+else
+ TARGET_TFLAGS=$BUILD_CFLAGS
+fi
+if test "$config_TARGET_RANLIB" != ""; then
+ TARGET_RANLIB=$config_TARGET_RANLIB
+else
+ AC_PROG_RANLIB
+ TARGET_RANLIB=$RANLIB
+fi
+if test "$config_TARGET_AR" != ""; then
+ TARGET_AR=$config_TARGET_AR
+else
+ TARGET_AR='ar cr'
+fi
+AC_MSG_RESULT($TARGET_TFLAGS)
+AC_SUBST(TARGET_CC)
+AC_SUBST(TARGET_CFLAGS)
+AC_SUBST(TARGET_LINK)
+AC_SUBST(TARGET_LFLAGS)
+AC_SUBST(TARGET_RANLIB)
+AC_SUBST(TARGET_AR)
+
+# Set the $cross variable if we are cross-compiling. Make
+# it 0 if we are not.
+#
+AC_MSG_CHECKING([if host and target compilers are the same])
+if test "$BUILD_CC" = "$TARGET_CC"; then
+ cross=0
+ AC_MSG_RESULT(yes)
+else
+ cross=1
+ AC_MSG_RESULT(no)
+fi
+
+##########
+# Do we want to support multithreaded use of sqlite
+#
+AC_ARG_ENABLE(threadsafe,
+[ --enable-threadsafe Support threadsafe operation],,enable_threadsafe=no)
+AC_MSG_CHECKING([whether to support threadsafe operation])
+if test "$enable_threadsafe" = "no"; then
+ THREADSAFE=0
+ AC_MSG_RESULT([no])
+else
+ THREADSAFE=1
+ AC_MSG_RESULT([yes])
+fi
+AC_SUBST(THREADSAFE)
+
+if test "$THREADSAFE" = "1"; then
+ LIBS=""
+ AC_CHECK_LIB(pthread, pthread_create)
+ TARGET_THREAD_LIB="$LIBS"
+ LIBS=""
+else
+ TARGET_THREAD_LIB=""
+fi
+AC_SUBST(TARGET_THREAD_LIB)
+
+##########
+# Do we want to support release
+#
+AC_ARG_ENABLE(releasemode,
+[ --enable-releasemode Support libtool link to release mode],,enable_releasemode=no)
+AC_MSG_CHECKING([whether to support shared library linked as release mode or not])
+if test "$enable_releasemode" = "no"; then
+ ALLOWRELEASE=""
+ AC_MSG_RESULT([no])
+else
+ ALLOWRELEASE="-release `cat VERSION`"
+ AC_MSG_RESULT([yes])
+fi
+AC_SUBST(ALLOWRELEASE)
+
+##########
+# Do we want temporary databases in memory
+#
+AC_ARG_ENABLE(tempstore,
+[ --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always)],,enable_tempstore=yes)
+AC_MSG_CHECKING([whether to use an in-ram database for temporary tables])
+case "$enable_tempstore" in
+ never )
+ TEMP_STORE=0
+ AC_MSG_RESULT([never])
+ ;;
+ no )
+ TEMP_STORE=1
+ AC_MSG_RESULT([no])
+ ;;
+ always )
+ TEMP_STORE=3
+ AC_MSG_RESULT([always])
+ ;;
+ * )
+ TEMP_STORE=2
+ AC_MSG_RESULT([yes])
+ ;;
+esac
+
+AC_SUBST(TEMP_STORE)
+
+###########
+# Lots of things are different if we are compiling for Windows using
+# the CYGWIN environment. So check for that special case and handle
+# things accordingly.
+#
+AC_MSG_CHECKING([if executables have the .exe suffix])
+if test "$config_BUILD_EXEEXT" = ".exe"; then
+ CYGWIN=yes
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(unknown)
+fi
+if test "$CYGWIN" != "yes"; then
+ AC_CYGWIN
+fi
+if test "$CYGWIN" = "yes"; then
+ BUILD_EXEEXT=.exe
+else
+ BUILD_EXEEXT=$EXEEXT
+fi
+if test "$cross" = "0"; then
+ TARGET_EXEEXT=$BUILD_EXEEXT
+else
+ TARGET_EXEEXT=$config_TARGET_EXEEXT
+fi
+if test "$TARGET_EXEEXT" = ".exe"; then
+ OS_UNIX=0
+ OS_WIN=1
+ tclsubdir=win
+ TARGET_CFLAGS="$TARGET_CFLAGS -DOS_WIN=1"
+else
+ OS_UNIX=1
+ OS_WIN=0
+ tclsubdir=unix
+ TARGET_CFLAGS="$TARGET_CFLAGS -DOS_UNIX=1"
+fi
+
+AC_SUBST(BUILD_EXEEXT)
+AC_SUBST(OS_UNIX)
+AC_SUBST(OS_WIN)
+AC_SUBST(TARGET_EXEEXT)
+
+##########
+# Extract generic linker options from the environment.
+#
+if test "$config_TARGET_LIBS" != ""; then
+ TARGET_LIBS=$config_TARGET_LIBS
+else
+ TARGET_LIBS=""
+fi
+AC_SUBST(TARGET_LIBS)
+
+##########
+# Figure out all the parameters needed to compile against Tcl.
+#
+# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG
+# macros in the in the tcl.m4 file of the standard TCL distribution.
+# Those macros could not be used directly since we have to make some
+# minor changes to accomodate systems that do not have TCL installed.
+#
+AC_ARG_ENABLE(tcl, [ --disable-tcl do not build TCL extension],
+ [use_tcl=$enableval],[use_tcl=yes])
+if test "${use_tcl}" = "yes" ; then
+ AC_ARG_WITH(tcl, [ --with-tcl=DIR directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval})
+ AC_MSG_CHECKING([for Tcl configuration])
+ AC_CACHE_VAL(ac_cv_c_tclconfig,[
+ # First check to see if --with-tcl was specified.
+ if test x"${with_tclconfig}" != x ; then
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
+ else
+ AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
+ fi
+ fi
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null`
+ do
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ `ls -d ${libdir} 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null`
+ do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null`
+ do
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ use_tcl=no
+ AC_MSG_WARN(Can't find Tcl configuration definitions)
+ AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***)
+ AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***)
+ else
+ TCL_BIN_DIR=${ac_cv_c_tclconfig}
+ AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh)
+
+ AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
+ if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . $TCL_BIN_DIR/tclConfig.sh
+ else
+ AC_MSG_RESULT([file not found])
+ fi
+
+ #
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ #
+
+ if test -f $TCL_BIN_DIR/Makefile ; then
+ TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
+ TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
+ TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
+ fi
+
+ #
+ # eval is required to do the TCL_DBGX substitution
+ #
+
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+ AC_SUBST(TCL_VERSION)
+ AC_SUBST(TCL_BIN_DIR)
+ AC_SUBST(TCL_SRC_DIR)
+ AC_SUBST(TCL_LIBS)
+ AC_SUBST(TCL_INCLUDE_SPEC)
+
+ AC_SUBST(TCL_LIB_FILE)
+ AC_SUBST(TCL_LIB_FLAG)
+ AC_SUBST(TCL_LIB_SPEC)
+
+ AC_SUBST(TCL_STUB_LIB_FILE)
+ AC_SUBST(TCL_STUB_LIB_FLAG)
+ AC_SUBST(TCL_STUB_LIB_SPEC)
+ fi
+fi
+if test "${use_tcl}" = "no" ; then
+ HAVE_TCL=""
+else
+ HAVE_TCL=1
+fi
+AC_SUBST(HAVE_TCL)
+
+##########
+# Figure out what C libraries are required to compile programs
+# that use "readline()" library.
+#
+if test "$config_TARGET_READLINE_LIBS" != ""; then
+ TARGET_READLINE_LIBS="$config_TARGET_READLINE_LIBS"
+else
+ CC=$TARGET_CC
+ LIBS=""
+ AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap])
+ AC_CHECK_LIB([readline], [readline])
+ TARGET_READLINE_LIBS="$LIBS"
+fi
+AC_SUBST(TARGET_READLINE_LIBS)
+
+##########
+# Figure out where to get the READLINE header files.
+#
+AC_MSG_CHECKING([readline header files])
+found=no
+if test "$config_TARGET_READLINE_INC" != ""; then
+ TARGET_READLINE_INC=$config_TARGET_READLINE_INC
+ found=yes
+fi
+if test "$found" = "yes"; then
+ AC_MSG_RESULT($TARGET_READLINE_INC)
+else
+ AC_MSG_RESULT(not specified: still searching...)
+ AC_CHECK_HEADER(readline.h, [found=yes])
+fi
+if test "$found" = "no"; then
+ for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
+ AC_CHECK_FILE($dir/include/readline.h, found=yes)
+ if test "$found" = "yes"; then
+ TARGET_READLINE_INC="-I$dir/include"
+ break
+ fi
+ AC_CHECK_FILE($dir/include/readline/readline.h, found=yes)
+ if test "$found" = "yes"; then
+ TARGET_READLINE_INC="-I$dir/include/readline"
+ break
+ fi
+ done
+fi
+if test "$found" = "yes"; then
+ if test "$TARGET_READLINE_LIBS" = ""; then
+ TARGET_HAVE_READLINE=0
+ else
+ TARGET_HAVE_READLINE=1
+ fi
+else
+ TARGET_HAVE_READLINE=0
+fi
+AC_SUBST(TARGET_READLINE_INC)
+AC_SUBST(TARGET_HAVE_READLINE)
+
+#########
+# check for debug enabled
+AC_ARG_ENABLE(debug, [ --enable-debug enable debugging & verbose explain],
+ [use_debug=$enableval],[use_debug=no])
+if test "${use_debug}" = "yes" ; then
+ TARGET_DEBUG=""
+else
+ TARGET_DEBUG="-DNDEBUG"
+fi
+AC_SUBST(TARGET_DEBUG)
+
+#########
+# Figure out whether or not we have a "usleep()" function.
+#
+AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"])
+
+#########
+# Generate the output files.
+#
+AC_OUTPUT([
+Makefile
+sqlite3.pc
+])
diff --git a/ext/pdo_sqlite/sqlite/install-sh b/ext/pdo_sqlite/sqlite/install-sh
new file mode 100755
index 000000000..e9de23842
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/install-sh
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/ext/pdo_sqlite/sqlite/ltmain.sh b/ext/pdo_sqlite/sqlite/ltmain.sh
new file mode 100644
index 000000000..4b9f94053
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/ltmain.sh
@@ -0,0 +1,6399 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The name of this program.
+progname=`$echo "$0" | ${SED} 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.2
+TIMESTAMP=" (1.1220.2.60 2004/01/25 12:25:08) Debian$Rev: 192 $"
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo A|tr A '\301'` in
+ A) # EBCDIC based system
+ SP2NL="tr '\100' '\n'"
+ NL2SP="tr '\r\n' '\100\100'"
+ ;;
+ *) # Assume ASCII based system
+ SP2NL="tr '\040' '\012'"
+ NL2SP="tr '\015\012' '\040\040'"
+ ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+ save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+ save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# Make sure IFS has a sensible default
+: ${IFS="
+"}
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ $echo "$modename: not configured to build any kind of library" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+win32_libid () {
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+ grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 | \
+ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+ if test "X$win32_nmres" = "Ximport" ; then
+ win32_libid_type="x86 archive import"
+ else
+ win32_libid_type="x86 archive static"
+ fi
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $echo $win32_libid_type
+}
+
+# End of Shell function definitions
+#####################################
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+ arg="$1"
+ shift
+
+ case $arg in
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ execute_dlfiles)
+ execute_dlfiles="$execute_dlfiles $arg"
+ ;;
+ tag)
+ tagname="$arg"
+ preserve_args="${preserve_args}=$arg"
+
+ # Check whether tagname contains only valid characters
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ $echo "$progname: invalid tag name: $tagname" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case $tagname in
+ CC)
+ # Don't test for the "default" C tag, as we know, it's there, but
+ # not specially marked.
+ ;;
+ *)
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
+ taglist="$taglist $tagname"
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+ else
+ $echo "$progname: ignoring unknown tag $tagname" 1>&2
+ fi
+ ;;
+ esac
+ ;;
+ *)
+ eval "$prev=\$arg"
+ ;;
+ esac
+
+ prev=
+ prevopt=
+ continue
+ fi
+
+ # Have we seen a non-optional argument yet?
+ case $arg in
+ --help)
+ show_help=yes
+ ;;
+
+ --version)
+ $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+ $echo
+ $echo "Copyright (C) 2003 Free Software Foundation, Inc."
+ $echo "This is free software; see the source for copying conditions. There is NO"
+ $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+ exit 0
+ ;;
+
+ --config)
+ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
+ done
+ exit 0
+ ;;
+
+ --debug)
+ $echo "$progname: enabling shell trace mode"
+ set -x
+ preserve_args="$preserve_args $arg"
+ ;;
+
+ --dry-run | -n)
+ run=:
+ ;;
+
+ --features)
+ $echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $echo "enable shared libraries"
+ else
+ $echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $echo "enable static libraries"
+ else
+ $echo "disable static libraries"
+ fi
+ exit 0
+ ;;
+
+ --finish) mode="finish" ;;
+
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
+ --preserve-dup-deps) duplicate_deps="yes" ;;
+
+ --quiet | --silent)
+ show=:
+ preserve_args="$preserve_args $arg"
+ ;;
+
+ --tag) prevopt="--tag" prev=tag ;;
+ --tag=*)
+ set tag "$optarg" ${1+"$@"}
+ shift
+ prev=tag
+ preserve_args="$preserve_args --tag"
+ ;;
+
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
+
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
+
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+fi
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+ # Infer the operation mode.
+ if test -z "$mode"; then
+ $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+ $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+ case $nonopt in
+ *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+ mode=link
+ for arg
+ do
+ case $arg in
+ -c)
+ mode=compile
+ break
+ ;;
+ esac
+ done
+ ;;
+ *db | *dbx | *strace | *truss)
+ mode=execute
+ ;;
+ *install*|cp|mv)
+ mode=install
+ ;;
+ *rm)
+ mode=uninstall
+ ;;
+ *)
+ # If we have no mode, but dlfiles were specified, then do execute mode.
+ test -n "$execute_dlfiles" && mode=execute
+
+ # Just use the default operation mode.
+ if test -z "$mode"; then
+ if test -n "$nonopt"; then
+ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+ else
+ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+ fi
+ fi
+ ;;
+ esac
+ fi
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$modename --help --mode=$mode' for more information."
+
+ # These modes are in order of execution frequency so that they run quickly.
+ case $mode in
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+
+ for arg
+ do
+ case "$arg_mode" in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ if test -n "$libobj" ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit 1
+ fi
+ arg_mode=target
+ continue
+ ;;
+
+ -static | -prefer-pic | -prefer-non-pic)
+ later="$later $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ lastarg="$lastarg $arg"
+ done
+ IFS="$save_ifs"
+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ * )
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ case $lastarg in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ base_compile="$base_compile $lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ $echo "$modename: you must specify an argument for -Xcompile"
+ exit 1
+ ;;
+ target)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit 1
+ ;;
+ *)
+ # Get the name of the library object.
+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSifmso]'
+ case $libobj in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.ii) xform=ii ;;
+ *.class) xform=class ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform=for ;;
+ *.java) xform=java ;;
+ esac
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+ case $libobj in
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+ *)
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+ # Only attempt this if the compiler in the base compile
+ # command doesn't match the default compiler.
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+ case "$base_compile " in
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit 1
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+
+ for arg in $later; do
+ case $arg in
+ -static)
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir=
+ else
+ xdir=$xdir/
+ fi
+ lobj=${xdir}$objdir/$objname
+
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ $run $rm $removelist
+ trap "$run $rm $removelist; exit 1" 1 2 15
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit 1" 1 2 15
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $run ln "$0" "$lockfile" 2>/dev/null; do
+ $show "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+ $echo $srcfile > "$lockfile"
+ fi
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+
+ $run $rm "$libobj" "${libobj}T"
+
+ # Create a libtool object file (analogous to a ".la" file),
+ # but don't create it if we're doing a dry run.
+ test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $srcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ fi
+
+ if test ! -d "${xdir}$objdir"; then
+ $show "$mkdir ${xdir}$objdir"
+ $run $mkdir ${xdir}$objdir
+ status=$?
+ if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+ exit $status
+ fi
+ fi
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ $run $rm "$lobj" "$output_obj"
+
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ test -n "$output_obj" && $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ $show "$mv $output_obj $lobj"
+ if $run $mv $output_obj $lobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the PIC object to the libtool object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ else
+ # No PIC object so indicate it doesn't exist in the libtool
+ # object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ else
+ command="$base_compile $srcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ $run $rm "$obj" "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+ else
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+ fi
+
+ $run $mv "${libobj}T" "${libobj}"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $run $rm "$lockfile"
+ fi
+
+ exit 0
+ ;;
+
+ # libtool link mode
+ link | relink)
+ modename="$modename: link"
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args="$nonopt"
+ base_compile="$nonopt $@"
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+ # Only attempt this if the compiler in the base link
+ # command doesn't match the default compiler.
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+ case $base_compile in
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+ # The compiler in $compile_command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit 1
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -all-static | -static)
+ if test "X$arg" = "X-all-static"; then
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ else
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ fi
+ build_libtool_libs=no
+ build_old_libs=yes
+ prefer_static_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+ ;;
+ *) qarg=$arg ;;
+ esac
+ libtool_args="$libtool_args $qarg"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ if test ! -f "$arg"; then
+ $echo "$modename: symbol file \`$arg' does not exist"
+ exit 1
+ fi
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat $save_arg`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit 1
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ done
+ else
+ $echo "$modename: link input file \`$save_arg' does not exist"
+ exit 1
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
+ prev=
+ compile_command="$compile_command $wl$qarg"
+ finalize_command="$finalize_command $wl$qarg"
+ continue
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+ continue
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: more than one -exported-symbols argument is not allowed"
+ exit 1
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ exit 1
+ fi
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-pw32* | *-*-beos*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-mingw* | *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs -framework System"
+ continue
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # gcc -m* arguments should be passed to the linker via $compiler_flags
+ # in order to pass architecture information to the linker
+ # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
+ # but this is not reliable with gcc because gcc may use -mfoo to
+ # select a different linker, different libraries, etc, while
+ # -Wl,-mfoo simply passes -mfoo to the linker.
+ -m*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ if test "$with_gcc" = "yes" ; then
+ compiler_flags="$compiler_flags $arg"
+ fi
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # in order for the loader to find any dlls it needs.
+ $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+ $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -static)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Wl,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $wl$flag"
+ linker_flags="$linker_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit 1
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ dlfiles="$dlfiles $arg"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+ done # argument parsing loop
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
+ # Create the object directory.
+ if test ! -d "$output_objdir"; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+ exit $status
+ fi
+ fi
+
+ # Determine the type of output
+ case $output in
+ "")
+ $echo "$modename: you must specify an output file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ case $host in
+ *cygwin* | *mingw* | *pw32*)
+ # don't eliminate duplcations in $postdeps and $predeps
+ duplicate_compiler_generated_deps=yes
+ ;;
+ *)
+ duplicate_compiler_generated_deps=$duplicate_deps
+ ;;
+ esac
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ libs="$libs $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+ case $linkmode in
+ lib)
+ passes="conv link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+ for pass in $passes; do
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+ continue
+ fi
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+ for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ for search_ext in .la $shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if (${SED} -e '2q' $lib |
+ grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ library_names=
+ old_library=
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ ;;
+ *)
+ $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ if test "$deplibs_check_method" != pass_all; then
+ $echo
+ $echo "*** Warning: Trying to link with static lib archive $deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because the file extensions .$libext of this argument makes me believe"
+ $echo "*** that it is just a static archive that I should not used here."
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the"
+ $echo "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ $echo "$modename: cannot find the library \`$lib'" 1>&2
+ exit 1
+ fi
+
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+
+ # Read the .la file
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit 1
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit 1
+ fi
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ if test -z "$linklib"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit 1
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+ exit 1
+ fi
+ if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ $echo "$modename: warning: library \`$lib' was moved." 1>&2
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ fi # $installed = yes
+ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit 1
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var"; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *" $absdir "*) ;;
+ *) temp_rpath="$temp_rpath $dir" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some systems (darwin)
+ if test "$shouldnotlink" = yes && test "$pass" = link ; then
+ $echo
+ if test "$linkmode" = prog; then
+ $echo "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $echo "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $echo "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+ libname=`eval \\$echo \"$libname_spec\"`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw*)
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+ newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ $show "extracting exported symbol list from \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ cmds=$extract_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ $show "generating import library for \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ cmds=$old_archive_from_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a module then we can not link against it, someone
+ # is ignoring the new warnings I added
+ if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
+ $echo "** Warning, lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $echo
+ $echo "** And there doesn't seem to be a static archive available"
+ $echo "** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ $echo "$modename: configuration error: unsupported hardcode properties"
+ exit 1
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes && \
+ test "$hardcode_minus_L" != yes && \
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ $echo
+ $echo "*** Warning: This system can not link to static lib archive $lib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ $echo "*** But as you try to build a module library, libtool will still create "
+ $echo "*** a static module, that should work as long as the dlopening application"
+ $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ convenience="$convenience $dir/$old_library"
+ old_convenience="$old_convenience $dir/$old_library"
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ *) temp_deplibs="$temp_deplibs $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ newlib_search_path="$newlib_search_path $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$deplib" && dir="."
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if grep "^installed=no" $deplib > /dev/null; then
+ path="$absdir/$objdir"
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ if test "$absdir" != "$libdir"; then
+ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+ fi
+ path="$absdir"
+ fi
+ depdepl=
+ case $host in
+ *-*-darwin*)
+ # we do not want to link against static libs, but need to link against shared
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$path/$depdepl" ; then
+ depdepl="$path/$depdepl"
+ fi
+ # do not add paths which are already there
+ case " $newlib_search_path " in
+ *" $path "*) ;;
+ *) newlib_search_path="$newlib_search_path $path";;
+ esac
+ fi
+ path=""
+ ;;
+ *)
+ path="-L$path"
+ ;;
+ esac
+
+ ;;
+ -l*)
+ case $host in
+ *-*-darwin*)
+ # Again, we only want to link against shared libraries
+ eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+ for tmp in $newlib_search_path ; do
+ if test -f "$tmp/lib$tmp_libs.dylib" ; then
+ eval depdepl="$tmp/lib$tmp_libs.dylib"
+ break
+ fi
+ done
+ path=""
+ ;;
+ *) continue ;;
+ esac
+ ;;
+ *) continue ;;
+ esac
+ case " $deplibs " in
+ *" $depdepl "*) ;;
+ *) deplibs="$deplibs $depdepl" ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$deplibs $path" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+ fi
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ objs="$objs$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval shared_ext=\"$shrext\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ if test "$module" = no; then
+ $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval shared_ext=\"$shrext\"
+ eval libname=\"$libname_spec\"
+ else
+ libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+ exit 1
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the non-libtool"
+ $echo "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
+ fi
+ fi
+
+ if test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+ fi
+
+ set dummy $rpath
+ if test "$#" -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+ fi
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ IFS="$save_ifs"
+
+ if test -n "$8"; then
+ $echo "$modename: too many parameters to \`-version-info'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$2"
+ number_minor="$3"
+ number_revision="$4"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows)
+ current=`expr $number_major + $number_minor`
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ current=`expr $number_major + $number_minor - 1`
+ age="$number_minor"
+ revision="$number_minor"
+ ;;
+ esac
+ ;;
+ no)
+ current="$2"
+ revision="$3"
+ age="$4"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case $revision in
+ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case $age in
+ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ minor_current=`expr $current + 1`
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current";
+ ;;
+
+ irix | nonstopux)
+ major=`expr $current - $age + 1`
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ major=.`expr $current - $age`
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+
+ *)
+ $echo "$modename: unknown library version type \`$version_type'" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+ fi
+
+ if test "$mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$echo "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ if test -n "$removelist"; then
+ $show "${rm}r $removelist"
+ $run ${rm}r $removelist
+ fi
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ for path in $notinst_path; do
+ lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+ deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+ dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+ done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ deplibs="$deplibs -framework System"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $rm conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $rm conftest
+ $LTCC -o conftest conftest.c $deplibs
+ if test "$?" -eq 0 ; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" -ne "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which I believe you do not have"
+ $echo "*** because a test_compile did reveal that the linker did not use it for"
+ $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ $rm conftest
+ $LTCC -o conftest conftest.c $i
+ # Did it work?
+ if test "$?" -eq 0 ; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because a test_compile did reveal that the linker did not use this one"
+ $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning! Library $i is needed by this library but I was not able to"
+ $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** library that it depends on before this library will be fully"
+ $echo "*** functional. Installing it before continuing would be even better."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method
+ file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null \
+ | grep " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test -n "$name" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval $echo \"$potent_lib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+ done
+ fi
+ if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
+ | grep . >/dev/null; then
+ $echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ $echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ $echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ $echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ $echo
+ $echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $echo "*** dependencies of module $libname. Therefore, libtool will create"
+ $echo "*** a static module, that should work as long as the dlopening"
+ $echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ $echo "*** The inter-library dependencies that have been dropped here will be"
+ $echo "*** automatically added whenever a program is linked with this library"
+ $echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ $echo
+ $echo "*** Since this library must not contain undefined symbols,"
+ $echo "*** because either the platform does not support them or"
+ $echo "*** it was explicitly requested with -no-undefined,"
+ $echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ dep_rpath="$dep_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ if len=`expr "X$cmd" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ $show "using reloadable object file for export list..."
+ skipped_export=:
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex"; then
+ $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$mv "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
+
+ libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linker_flags="$linker_flags $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise.
+ $echo "creating reloadable object files..."
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ delfiles=
+ last_robj=
+ k=1
+ output=$output_objdir/$save_output-${k}.$objext
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+ if test "X$objlist" = X ||
+ { len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len"; }; then
+ objlist="$objlist $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+ fi
+ last_robj=$output_objdir/$save_output-${k}.$objext
+ k=`expr $k + 1`
+ output=$output_objdir/$save_output-${k}.$objext
+ objlist=$obj
+ len=1
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+ if ${skipped_export-false}; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+ fi
+
+ # Set up a command to remove the reloadale object files
+ # after they are used.
+ i=0
+ while test "$i" -lt "$k"
+ do
+ i=`expr $i + 1`
+ delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+ done
+
+ $echo "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+
+ # Append the command to remove the reloadable object files
+ # to the just-reset $cmds.
+ eval cmds=\"\$cmds~\$rm $delfiles\"
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+ exit 0
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+ fi
+
+ case $output in
+ *.lo)
+ if test -n "$objs$old_deplibs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit 1
+ fi
+ libobj="$output"
+ obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $run $rm $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${obj}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
+
+ reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $run eval "echo timestamp > $libobj" || exit $?
+ exit 0
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+ esac
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+ fi
+
+ if test "$preload" = yes; then
+ if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+ fi
+ fi
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
+ case $host in
+ *darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ if test "$tagname" = CXX ; then
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ fi
+ ;;
+ esac
+
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ dlsyms=
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ dlsyms="${outputname}S.c"
+ else
+ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+ fi
+ fi
+
+ if test -n "$dlsyms"; then
+ case $dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${outputname}.nm"
+
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+ # Parse the name list into a source file.
+ $show "creating $output_objdir/$dlsyms"
+
+ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ $show "generating symbol list for \`$output'"
+
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$output.exp"
+ $run $rm $export_symbols
+ $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+ $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+ fi
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+ name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval '$echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -z "$run"; then
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $mv "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if grep -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+ else
+ $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+ fi
+
+ $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ fi
+
+ pic_flag_for_symtable=
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+ # Transform the symbol file into the correct name.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit 1
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ $show "$link_command"
+ $run eval "$link_command"
+ status=$?
+
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
+ fi
+
+ exit $status
+ fi
+
+ if test -n "$shlibpath_var"; then
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+ ;;
+ *)
+ # Relative path: add a thisdir entry.
+ rpath="$rpath\$thisdir/$dir:"
+ ;;
+ esac
+ done
+ temp_rpath="$rpath"
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $run $rm $output
+ # Link the executable and exit
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+ exit 0
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+ $echo "$modename: \`$output' will be relinked during installation" 1>&2
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+
+ # Now create the wrapper script.
+ $show "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $echo for shipping.
+ if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+ case $0 in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+ esac
+ qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if our run command is non-null.
+ if test -z "$run"; then
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ cwrappersource=`$echo ${objdir}/lt-${output}.c`
+ cwrapper=`$echo ${output}.exe`
+ $rm $cwrappersource $cwrapper
+ trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
+
+ cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "/bin/sh $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int i;
+
+ program_name = (char *) xstrdup ((char *) basename (argv[0]));
+ newargz = XMALLOC(char *, argc+2);
+EOF
+
+ cat >> $cwrappersource <<EOF
+ newargz[0] = "$SHELL";
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+ newargz[1] = fnqualify(argv[0]);
+ /* we know the script has the same name, without the .exe */
+ /* so make sure newargz[1] doesn't end in .exe */
+ strendzap(newargz[1],".exe");
+ for (i = 1; i < argc; i++)
+ newargz[i+1] = xstrdup(argv[i]);
+ newargz[argc+1] = NULL;
+EOF
+
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",newargz);
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void * p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha (name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return (char *) base;
+}
+
+char *
+fnqualify(const char *path)
+{
+ size_t size;
+ char *p;
+ char tmp[LT_PATHMAX + 1];
+
+ assert(path != NULL);
+
+ /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha (path[0]) && path[1] == ':')
+ return xstrdup (path);
+#endif
+ if (IS_DIR_SEPARATOR (path[0]))
+ return xstrdup (path);
+
+ /* prepend the current directory */
+ /* doesn't handle '~' */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+ p = XMALLOC(char, size);
+ sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+ return p;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert(str != NULL);
+ assert(pat != NULL);
+
+ len = strlen(str);
+ patlen = strlen(pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp(str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+ const char * message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+EOF
+ # we should really use a build-platform specific compiler
+ # here, but OTOH, the wrappers (shell script and this C one)
+ # are only useful if you want to execute the "real" binary.
+ # Since the "real" binary is built for $host, then this
+ # wrapper might as well be built for $host, too.
+ $run $LTCC -s -o $cwrapper $cwrappersource
+ ;;
+ esac
+ $rm $output
+ trap "$rm $output; exit 1" 1 2 15
+
+ $echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variable:
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ echo=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$echo will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $echo >> $output "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $echo >> $output "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$file\"
+ fi"
+
+ $echo >> $output "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $echo \"\$relink_command_output\" >&2
+ $rm \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $rm \"\$progdir/\$program\";
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $rm \"\$progdir/\$file\"
+ fi"
+ else
+ $echo >> $output "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $echo >> $output "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $echo >> $output "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2*)
+ $echo >> $output "\
+ exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $echo >> $output "\
+ exec \$progdir/\$program \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $echo >> $output "\
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+ \$echo \"This script is just a wrapper for \$program.\" 1>&2
+ $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+ chmod +x $output
+ fi
+ exit 0
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ # Add in members from convenience archives.
+ for xlib in $addlibs; do
+ # Extract the objects.
+ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
+
+ oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+ eval cmds=\"$old_archive_cmds\"
+
+ if len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ $echo "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+ # encoded into archives. This makes 'ar r' malfunction in
+ # this piecewise linking case whenever conflicting object
+ # names appear in distinct ar calls; check, warn and compensate.
+ if (for obj in $save_oldobjs
+ do
+ $echo "X$obj" | $Xsed -e 's%^.*/%%'
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+ $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+ AR_FLAGS=cq
+ fi
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ for obj in $save_oldobjs
+ do
+ oldobjs="$objlist $obj"
+ objlist="$objlist $obj"
+ eval test_cmds=\"$old_archive_cmds\"
+ if len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ eval cmd=\"$cmd\"
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$generated"; then
+ $show "${rm}r$generated"
+ $run ${rm}r$generated
+ fi
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ $show "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+ # Only create the output if not a dry run.
+ if test -z "$run"; then
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdependency_libs="$newdependency_libs $libdir/$name"
+ ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+ for lib in $dlfiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdlfiles="$newdlfiles $libdir/$name"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlfiles="$newdlfiles $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlprefiles="$newdlprefiles $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $rm $output
+ # place dlname in correct position for cygwin
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
+ $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $echo >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ fi
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+ ;;
+ esac
+ exit 0
+ ;;
+
+ # libtool install mode
+ install)
+ modename="$modename: install"
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+ # Aesthetically quote it.
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$arg "
+ arg="$1"
+ shift
+ else
+ install_prog=
+ arg="$nonopt"
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog$arg"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest="$arg"
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f) prev="-f" ;;
+ -g) prev="-g" ;;
+ -m) prev="-m" ;;
+ -o) prev="-o" ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*) ;;
+
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest="$arg"
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog $arg"
+ done
+
+ if test -z "$install_prog"; then
+ $echo "$modename: you must specify an install program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ $echo "$modename: no file or destination specified" 1>&2
+ else
+ $echo "$modename: you must specify a destination" 1>&2
+ fi
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Strip any trailing slash from the destination.
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$destdir" = "X$dest" && destdir=.
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+ if test "$#" -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ library_names=
+ old_library=
+ relink_command=
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ if test "$inst_prefix_dir" = "$destdir"; then
+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ exit 1
+ fi
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ $echo "$modename: warning: relinking \`$file'" 1>&2
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ exit 1
+ fi
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+ realname="$2"
+ shift
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ $show "$install_prog $dir/$srcname $destdir/$realname"
+ $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+ if test -n "$stripme" && test -n "$striplib"; then
+ $show "$striplib $destdir/$realname"
+ $run eval "$striplib $destdir/$realname" || exit $?
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ for linkname
+ do
+ if test "$linkname" != "$realname"; then
+ $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ fi
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ cmds=$postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Install the pseudo-library for information purposes.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ instname="$dir/$name"i
+ $show "$install_prog $instname $destdir/$name"
+ $run eval "$install_prog $instname $destdir/$name" || exit $?
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ if test -n "$destfile"; then
+ $show "$install_prog $file $destfile"
+ $run eval "$install_prog $file $destfile" || exit $?
+ fi
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+ $show "$install_prog $staticobj $staticdest"
+ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ fi
+ exit 0
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin*|*mingw*)
+ wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$notinst_deplibs"; then
+ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+ exit 1
+ fi
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ # If there is no directory component, then add one.
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+ libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
+ esac
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir="/tmp"
+ test -n "$TMPDIR" && tmpdir="$TMPDIR"
+ tmpdir="$tmpdir/libtool-$$"
+ if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
+ else
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
+ file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ ${rm}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ $echo "$modename: warning: cannot relink \`$file'" 1>&2
+ fi
+ else
+ # Install the binary that we compiled earlier.
+ file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyways
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+ ;;
+ esac
+ ;;
+ esac
+ $show "$install_prog$stripme $file $destfile"
+ $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+ test -n "$outputname" && ${rm}r "$tmpdir"
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ $show "$old_striplib $oldlib"
+ $run eval "$old_striplib $oldlib" || exit $?
+ fi
+
+ # Do each command in the postinstall commands.
+ cmds=$old_postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$future_libdirs"; then
+ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+ fi
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs'
+ else
+ exit 0
+ fi
+ ;;
+
+ # libtool finish mode
+ finish)
+ modename="$modename: finish"
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ cmds=$finish_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || admincmds="$admincmds
+ $cmd"
+ done
+ IFS="$save_ifs"
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $run eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ test "$show" = : && exit 0
+
+ $echo "----------------------------------------------------------------------"
+ $echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $echo " $libdir"
+ done
+ $echo
+ $echo "If you ever happen to want to link against installed libraries"
+ $echo "in a given directory, LIBDIR, you must either use libtool, and"
+ $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ $echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $echo " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $echo " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $echo
+ $echo "See any operating system documentation about shared libraries for"
+ $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ $echo "----------------------------------------------------------------------"
+ exit 0
+ ;;
+
+ # libtool execute mode
+ execute)
+ modename="$modename: execute"
+
+ # The first argument is the command name.
+ cmd="$nonopt"
+ if test -z "$cmd"; then
+ $echo "$modename: you must specify a COMMAND" 1>&2
+ $echo "$help"
+ exit 1
+ fi
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ if test ! -f "$file"; then
+ $echo "$modename: \`$file' is not a file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit 1
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ ;;
+
+ *)
+ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+ args="$args \"$file\""
+ done
+
+ if test -z "$run"; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ if test "${save_LC_ALL+set}" = set; then
+ LC_ALL="$save_LC_ALL"; export LC_ALL
+ fi
+ if test "${save_LANG+set}" = set; then
+ LANG="$save_LANG"; export LANG
+ fi
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ fi
+ $echo "$cmd$args"
+ exit 0
+ fi
+ ;;
+
+ # libtool clean and uninstall mode
+ clean | uninstall)
+ modename="$modename: $mode"
+ rm="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) rm="$rm $arg"; rmforce=yes ;;
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ if test -z "$rm"; then
+ $echo "$modename: you must specify an RM program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$file"; then
+ dir=.
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ fi
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ test "$mode" = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test "$mode" = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if (test -L "$file") >/dev/null 2>&1 \
+ || (test -h "$file") >/dev/null 2>&1 \
+ || test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+ test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+ if test "$mode" = uninstall; then
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ cmds=$postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ cmds=$old_postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+ # Read the .lo file
+ . $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" \
+ && test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" \
+ && test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ noexename=`$echo $name|${SED} 's,.exe$,,'`
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$noexename
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles || exit_status=1
+ done
+ objdir="$origobjdir"
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ $show "rmdir $dir"
+ $run rmdir $dir >/dev/null 2>&1
+ fi
+ done
+
+ exit $exit_status
+ ;;
+
+ "")
+ $echo "$modename: you must specify a MODE" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test -z "$exec_cmd"; then
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+ fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+ eval exec $exec_cmd
+ exit 1
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+-n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --finish same as \`--mode=finish'
+ --help display this help message and exit
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ --version print version information
+
+MODE must be one of the following:
+
+ clean remove files from the build directory
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+ exit 0
+ ;;
+
+clean)
+ $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+compile)
+ $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
+ -static always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+execute)
+ $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+finish)
+ $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+install)
+ $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+link)
+ $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -static do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+uninstall)
+ $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+*)
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/ext/pdo_sqlite/sqlite/main.mk b/ext/pdo_sqlite/sqlite/main.mk
new file mode 100644
index 000000000..d931e281a
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/main.mk
@@ -0,0 +1,565 @@
+###############################################################################
+# The following macros should be defined before this script is
+# invoked:
+#
+# TOP The toplevel directory of the source tree. This is the
+# directory that contains this "Makefile.in" and the
+# "configure.in" script.
+#
+# BCC C Compiler and options for use in building executables that
+# will run on the platform that is doing the build.
+#
+# USLEEP If the target operating system supports the "usleep()" system
+# call, then define the HAVE_USLEEP macro for all C modules.
+#
+# THREADSAFE If you want the SQLite library to be safe for use within a
+# multi-threaded program, then define the following macro
+# appropriately:
+#
+# THREADLIB Specify any extra linker options needed to make the library
+# thread safe
+#
+# OPTS Extra compiler command-line options.
+#
+# EXE The suffix to add to executable files. ".exe" for windows
+# and "" for Unix.
+#
+# TCC C Compiler and options for use in building executables that
+# will run on the target platform. This is usually the same
+# as BCC, unless you are cross-compiling.
+#
+# AR Tools used to build a static library.
+# RANLIB
+#
+# TCL_FLAGS Extra compiler options needed for programs that use the
+# TCL library.
+#
+# LIBTCL Linker options needed to link against the TCL library.
+#
+# READLINE_FLAGS Compiler options needed for programs that use the
+# readline() library.
+#
+# LIBREADLINE Linker options needed by programs using readline() must
+# link against.
+#
+# ENCODING "UTF8" or "ISO8859"
+#
+# Once the macros above are defined, the rest of this make script will
+# build the SQLite library and testing tools.
+################################################################################
+
+# This is how we compile
+#
+TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src
+
+# Object files for the SQLite library.
+#
+LIBOBJ+= alter.o analyze.o attach.o auth.o btree.o build.o \
+ callback.o complete.o date.o delete.o \
+ expr.o func.o hash.o insert.o \
+ main.o opcodes.o os_unix.o os_win.o \
+ pager.o parse.o pragma.o prepare.o printf.o random.o \
+ select.o table.o tclsqlite.o tokenize.o trigger.o \
+ update.o util.o vacuum.o \
+ vdbe.o vdbeapi.o vdbeaux.o vdbefifo.o vdbemem.o \
+ where.o utf.o legacy.o
+
+# All of the source code files.
+#
+SRC = \
+ $(TOP)/src/alter.c \
+ $(TOP)/src/analyze.c \
+ $(TOP)/src/attach.c \
+ $(TOP)/src/auth.c \
+ $(TOP)/src/btree.c \
+ $(TOP)/src/btree.h \
+ $(TOP)/src/build.c \
+ $(TOP)/src/callback.c \
+ $(TOP)/src/complete.c \
+ $(TOP)/src/date.c \
+ $(TOP)/src/delete.c \
+ $(TOP)/src/expr.c \
+ $(TOP)/src/func.c \
+ $(TOP)/src/hash.c \
+ $(TOP)/src/hash.h \
+ $(TOP)/src/insert.c \
+ $(TOP)/src/legacy.c \
+ $(TOP)/src/main.c \
+ $(TOP)/src/os_unix.c \
+ $(TOP)/src/os_win.c \
+ $(TOP)/src/pager.c \
+ $(TOP)/src/pager.h \
+ $(TOP)/src/parse.y \
+ $(TOP)/src/pragma.c \
+ $(TOP)/src/prepare.c \
+ $(TOP)/src/printf.c \
+ $(TOP)/src/random.c \
+ $(TOP)/src/select.c \
+ $(TOP)/src/shell.c \
+ $(TOP)/src/sqlite.h.in \
+ $(TOP)/src/sqliteInt.h \
+ $(TOP)/src/table.c \
+ $(TOP)/src/tclsqlite.c \
+ $(TOP)/src/tokenize.c \
+ $(TOP)/src/trigger.c \
+ $(TOP)/src/utf.c \
+ $(TOP)/src/update.c \
+ $(TOP)/src/util.c \
+ $(TOP)/src/vacuum.c \
+ $(TOP)/src/vdbe.c \
+ $(TOP)/src/vdbe.h \
+ $(TOP)/src/vdbeapi.c \
+ $(TOP)/src/vdbeaux.c \
+ $(TOP)/src/vdbefifo.c \
+ $(TOP)/src/vdbemem.c \
+ $(TOP)/src/vdbeInt.h \
+ $(TOP)/src/where.c
+
+# Source code to the test files.
+#
+TESTSRC = \
+ $(TOP)/src/btree.c \
+ $(TOP)/src/date.c \
+ $(TOP)/src/func.c \
+ $(TOP)/src/os_unix.c \
+ $(TOP)/src/os_win.c \
+ $(TOP)/src/pager.c \
+ $(TOP)/src/pragma.c \
+ $(TOP)/src/printf.c \
+ $(TOP)/src/test1.c \
+ $(TOP)/src/test2.c \
+ $(TOP)/src/test3.c \
+ $(TOP)/src/test4.c \
+ $(TOP)/src/test5.c \
+ $(TOP)/src/utf.c \
+ $(TOP)/src/util.c \
+ $(TOP)/src/vdbe.c \
+ $(TOP)/src/md5.c \
+ $(TOP)/src/where.c
+
+# Header files used by all library source files.
+#
+HDR = \
+ sqlite3.h \
+ $(TOP)/src/btree.h \
+ $(TOP)/src/hash.h \
+ opcodes.h \
+ $(TOP)/src/os.h \
+ $(TOP)/src/os_common.h \
+ $(TOP)/src/os_unix.h \
+ $(TOP)/src/os_win.h \
+ $(TOP)/src/sqliteInt.h \
+ $(TOP)/src/vdbe.h \
+ parse.h
+
+# Header files used by the VDBE submodule
+#
+VDBEHDR = \
+ $(HDR) \
+ $(TOP)/src/vdbeInt.h
+
+# This is the default Makefile target. The objects listed here
+# are what get build when you type just "make" with no arguments.
+#
+all: sqlite3.h libsqlite3.a sqlite3$(EXE)
+
+# Generate the file "last_change" which contains the date of change
+# of the most recently modified source code file
+#
+last_change: $(SRC)
+ cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \
+ | awk '{print $$5,$$6}' >last_change
+
+libsqlite3.a: $(LIBOBJ)
+ $(AR) libsqlite3.a $(LIBOBJ)
+ $(RANLIB) libsqlite3.a
+
+sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h
+ $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(TOP)/src/shell.c \
+ libsqlite3.a $(LIBREADLINE) $(THREADLIB)
+
+objects: $(LIBOBJ_ORIG)
+
+# This target creates a directory named "tsrc" and fills it with
+# copies of all of the C source code and header files needed to
+# build on the target system. Some of the C source code and header
+# files are automatically generated. This target takes care of
+# all that automatic generation.
+#
+target_source: $(SRC) $(VDBEHDR) opcodes.c keywordhash.h
+ rm -rf tsrc
+ mkdir tsrc
+ cp $(SRC) $(VDBEHDR) tsrc
+ rm tsrc/sqlite.h.in tsrc/parse.y
+ cp parse.c opcodes.c keywordhash.h tsrc
+ cp $(TOP)/sqlite3.def tsrc
+
+# Rules to build the LEMON compiler generator
+#
+lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
+ $(BCC) -o lemon $(TOP)/tool/lemon.c
+ cp $(TOP)/tool/lempar.c .
+
+# Rules to build individual files
+#
+alter.o: $(TOP)/src/alter.c $(HDR)
+ $(TCCX) -c $(TOP)/src/alter.c
+
+analyze.o: $(TOP)/src/analyze.c $(HDR)
+ $(TCCX) -c $(TOP)/src/analyze.c
+
+attach.o: $(TOP)/src/attach.c $(HDR)
+ $(TCCX) -c $(TOP)/src/attach.c
+
+auth.o: $(TOP)/src/auth.c $(HDR)
+ $(TCCX) -c $(TOP)/src/auth.c
+
+btree.o: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
+ $(TCCX) -c $(TOP)/src/btree.c
+
+build.o: $(TOP)/src/build.c $(HDR)
+ $(TCCX) -c $(TOP)/src/build.c
+
+callback.o: $(TOP)/src/callback.c $(HDR)
+ $(TCCX) -c $(TOP)/src/callback.c
+
+complete.o: $(TOP)/src/complete.c $(HDR)
+ $(TCCX) -c $(TOP)/src/complete.c
+
+date.o: $(TOP)/src/date.c $(HDR)
+ $(TCCX) -c $(TOP)/src/date.c
+
+delete.o: $(TOP)/src/delete.c $(HDR)
+ $(TCCX) -c $(TOP)/src/delete.c
+
+expr.o: $(TOP)/src/expr.c $(HDR)
+ $(TCCX) -c $(TOP)/src/expr.c
+
+func.o: $(TOP)/src/func.c $(HDR)
+ $(TCCX) -c $(TOP)/src/func.c
+
+hash.o: $(TOP)/src/hash.c $(HDR)
+ $(TCCX) -c $(TOP)/src/hash.c
+
+insert.o: $(TOP)/src/insert.c $(HDR)
+ $(TCCX) -c $(TOP)/src/insert.c
+
+legacy.o: $(TOP)/src/legacy.c $(HDR)
+ $(TCCX) -c $(TOP)/src/legacy.c
+
+main.o: $(TOP)/src/main.c $(HDR)
+ $(TCCX) -c $(TOP)/src/main.c
+
+pager.o: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
+ $(TCCX) -c $(TOP)/src/pager.c
+
+opcodes.o: opcodes.c
+ $(TCCX) -c opcodes.c
+
+opcodes.c: opcodes.h $(TOP)/mkopcodec.awk
+ sort -n -b +2 opcodes.h | awk -f $(TOP)/mkopcodec.awk >opcodes.c
+
+opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk
+ cat parse.h $(TOP)/src/vdbe.c | awk -f $(TOP)/mkopcodeh.awk >opcodes.h
+
+os_unix.o: $(TOP)/src/os_unix.c $(HDR)
+ $(TCCX) -c $(TOP)/src/os_unix.c
+
+os_win.o: $(TOP)/src/os_win.c $(HDR)
+ $(TCCX) -c $(TOP)/src/os_win.c
+
+parse.o: parse.c $(HDR)
+ $(TCCX) -c parse.c
+
+parse.h: parse.c
+
+parse.c: $(TOP)/src/parse.y lemon
+ cp $(TOP)/src/parse.y .
+ ./lemon $(OPTS) parse.y
+
+pragma.o: $(TOP)/src/pragma.c $(HDR)
+ $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/pragma.c
+
+prepare.o: $(TOP)/src/prepare.c $(HDR)
+ $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/prepare.c
+
+printf.o: $(TOP)/src/printf.c $(HDR)
+ $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/printf.c
+
+random.o: $(TOP)/src/random.c $(HDR)
+ $(TCCX) -c $(TOP)/src/random.c
+
+select.o: $(TOP)/src/select.c $(HDR)
+ $(TCCX) -c $(TOP)/src/select.c
+
+sqlite3.h: $(TOP)/src/sqlite.h.in
+ sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \
+ -e s/--VERSION-NUMBER--/`cat ${TOP}/VERSION | sed 's/[^0-9]/ /g' | awk '{printf "%d%03d%03d",$$1,$$2,$$3}'`/ \
+ $(TOP)/src/sqlite.h.in >sqlite3.h
+
+table.o: $(TOP)/src/table.c $(HDR)
+ $(TCCX) -c $(TOP)/src/table.c
+
+tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
+ $(TCCX) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
+
+tokenize.o: $(TOP)/src/tokenize.c keywordhash.h $(HDR)
+ $(TCCX) -c $(TOP)/src/tokenize.c
+
+keywordhash.h: $(TOP)/tool/mkkeywordhash.c
+ $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c
+ ./mkkeywordhash >keywordhash.h
+
+trigger.o: $(TOP)/src/trigger.c $(HDR)
+ $(TCCX) -c $(TOP)/src/trigger.c
+
+update.o: $(TOP)/src/update.c $(HDR)
+ $(TCCX) -c $(TOP)/src/update.c
+
+utf.o: $(TOP)/src/utf.c $(HDR)
+ $(TCCX) -c $(TOP)/src/utf.c
+
+util.o: $(TOP)/src/util.c $(HDR)
+ $(TCCX) -c $(TOP)/src/util.c
+
+vacuum.o: $(TOP)/src/vacuum.c $(HDR)
+ $(TCCX) -c $(TOP)/src/vacuum.c
+
+vdbe.o: $(TOP)/src/vdbe.c $(VDBEHDR)
+ $(TCCX) -c $(TOP)/src/vdbe.c
+
+vdbeapi.o: $(TOP)/src/vdbeapi.c $(VDBEHDR)
+ $(TCCX) -c $(TOP)/src/vdbeapi.c
+
+vdbeaux.o: $(TOP)/src/vdbeaux.c $(VDBEHDR)
+ $(TCCX) -c $(TOP)/src/vdbeaux.c
+
+vdbefifo.o: $(TOP)/src/vdbefifo.c $(VDBEHDR)
+ $(TCCX) -c $(TOP)/src/vdbefifo.c
+
+vdbemem.o: $(TOP)/src/vdbemem.c $(VDBEHDR)
+ $(TCCX) -c $(TOP)/src/vdbemem.c
+
+where.o: $(TOP)/src/where.c $(HDR)
+ $(TCCX) -c $(TOP)/src/where.c
+
+# Rules for building test programs and for running tests
+#
+tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
+ $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \
+ $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
+
+testfixture$(EXE): $(TOP)/src/tclsqlite.c libsqlite3.a $(TESTSRC)
+ $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -o testfixture$(EXE) \
+ $(TESTSRC) $(TOP)/src/tclsqlite.c \
+ libsqlite3.a $(LIBTCL) $(THREADLIB)
+
+crashtest: $(TOP)/src/tclsqlite.c libsqlite3.a $(TESTSRC) $(TOP)/src/os_test.c
+ $(TCCX) $(TCL_FLAGS) -DOS_TEST=1 -DTCLSH=1 -DSQLITE_TEST=1 \
+ -o crashtest \
+ $(TESTSRC) $(TOP)/src/os_test.c $(TOP)/src/tclsqlite.c \
+ libsqlite3.a $(LIBTCL) $(THREADLIB)
+
+fulltest: testfixture$(EXE) sqlite3$(EXE) crashtest
+ ./testfixture$(EXE) $(TOP)/test/all.test
+
+test: testfixture$(EXE) sqlite3$(EXE)
+ ./testfixture$(EXE) $(TOP)/test/quick.test
+
+sqlite3_analyzer$(EXE): $(TOP)/src/tclsqlite.c libsqlite3.a $(TESTSRC) \
+ $(TOP)/tool/spaceanal.tcl
+ sed \
+ -e '/^#/d' \
+ -e 's,\\,\\\\,g' \
+ -e 's,",\\",g' \
+ -e 's,^,",' \
+ -e 's,$$,\\n",' \
+ $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
+ $(TCCX) $(TCL_FLAGS) -DTCLSH=2 -DSQLITE_TEST=1 -o \
+ sqlite3_analyzer$(EXE) $(TESTSRC) $(TOP)/src/tclsqlite.c \
+ libsqlite3.a $(LIBTCL) $(THREADLIB)
+
+# Rules used to build documentation
+#
+arch.html: $(TOP)/www/arch.tcl
+ tclsh $(TOP)/www/arch.tcl >arch.html
+
+arch.png: $(TOP)/www/arch.png
+ cp $(TOP)/www/arch.png .
+
+arch2.gif: $(TOP)/www/arch2.gif
+ cp $(TOP)/www/arch2.gif .
+
+autoinc.html: $(TOP)/www/autoinc.tcl
+ tclsh $(TOP)/www/autoinc.tcl >autoinc.html
+
+c_interface.html: $(TOP)/www/c_interface.tcl
+ tclsh $(TOP)/www/c_interface.tcl >c_interface.html
+
+capi3.html: $(TOP)/www/capi3.tcl
+ tclsh $(TOP)/www/capi3.tcl >capi3.html
+
+capi3ref.html: $(TOP)/www/capi3ref.tcl
+ tclsh $(TOP)/www/capi3ref.tcl >capi3ref.html
+
+changes.html: $(TOP)/www/changes.tcl
+ tclsh $(TOP)/www/changes.tcl >changes.html
+
+compile.html: $(TOP)/www/compile.tcl
+ tclsh $(TOP)/www/compile.tcl >compile.html
+
+copyright.html: $(TOP)/www/copyright.tcl
+ tclsh $(TOP)/www/copyright.tcl >copyright.html
+
+copyright-release.html: $(TOP)/www/copyright-release.html
+ cp $(TOP)/www/copyright-release.html .
+
+copyright-release.pdf: $(TOP)/www/copyright-release.pdf
+ cp $(TOP)/www/copyright-release.pdf .
+
+common.tcl: $(TOP)/www/common.tcl
+ cp $(TOP)/www/common.tcl .
+
+conflict.html: $(TOP)/www/conflict.tcl
+ tclsh $(TOP)/www/conflict.tcl >conflict.html
+
+datatypes.html: $(TOP)/www/datatypes.tcl
+ tclsh $(TOP)/www/datatypes.tcl >datatypes.html
+
+datatype3.html: $(TOP)/www/datatype3.tcl
+ tclsh $(TOP)/www/datatype3.tcl >datatype3.html
+
+different.html: $(TOP)/www/different.tcl
+ tclsh $(TOP)/www/different.tcl >different.html
+
+docs.html: $(TOP)/www/docs.tcl
+ tclsh $(TOP)/www/docs.tcl >docs.html
+
+download.html: $(TOP)/www/download.tcl
+ mkdir -p doc
+ tclsh $(TOP)/www/download.tcl >download.html
+
+faq.html: $(TOP)/www/faq.tcl
+ tclsh $(TOP)/www/faq.tcl >faq.html
+
+fileformat.html: $(TOP)/www/fileformat.tcl
+ tclsh $(TOP)/www/fileformat.tcl >fileformat.html
+
+formatchng.html: $(TOP)/www/formatchng.tcl
+ tclsh $(TOP)/www/formatchng.tcl >formatchng.html
+
+index.html: $(TOP)/www/index.tcl last_change
+ tclsh $(TOP)/www/index.tcl >index.html
+
+lang.html: $(TOP)/www/lang.tcl
+ tclsh $(TOP)/www/lang.tcl doc >lang.html
+
+pragma.html: $(TOP)/www/pragma.tcl
+ tclsh $(TOP)/www/pragma.tcl >pragma.html
+
+lockingv3.html: $(TOP)/www/lockingv3.tcl
+ tclsh $(TOP)/www/lockingv3.tcl >lockingv3.html
+
+oldnews.html: $(TOP)/www/oldnews.tcl
+ tclsh $(TOP)/www/oldnews.tcl >oldnews.html
+
+omitted.html: $(TOP)/www/omitted.tcl
+ tclsh $(TOP)/www/omitted.tcl >omitted.html
+
+opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c
+ tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html
+
+mingw.html: $(TOP)/www/mingw.tcl
+ tclsh $(TOP)/www/mingw.tcl >mingw.html
+
+nulls.html: $(TOP)/www/nulls.tcl
+ tclsh $(TOP)/www/nulls.tcl >nulls.html
+
+quickstart.html: $(TOP)/www/quickstart.tcl
+ tclsh $(TOP)/www/quickstart.tcl >quickstart.html
+
+speed.html: $(TOP)/www/speed.tcl
+ tclsh $(TOP)/www/speed.tcl >speed.html
+
+sqlite.gif: $(TOP)/art/SQLite.gif
+ cp $(TOP)/art/SQLite.gif sqlite.gif
+
+sqlite.html: $(TOP)/www/sqlite.tcl
+ tclsh $(TOP)/www/sqlite.tcl >sqlite.html
+
+support.html: $(TOP)/www/support.tcl
+ tclsh $(TOP)/www/support.tcl >support.html
+
+tclsqlite.html: $(TOP)/www/tclsqlite.tcl
+ tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html
+
+vdbe.html: $(TOP)/www/vdbe.tcl
+ tclsh $(TOP)/www/vdbe.tcl >vdbe.html
+
+version3.html: $(TOP)/www/version3.tcl
+ tclsh $(TOP)/www/version3.tcl >version3.html
+
+whentouse.html: $(TOP)/www/whentouse.tcl
+ tclsh $(TOP)/www/whentouse.tcl >whentouse.html
+
+
+# Files to be published on the website.
+#
+DOC = \
+ arch.html \
+ arch.png \
+ arch2.gif \
+ autoinc.html \
+ c_interface.html \
+ capi3.html \
+ capi3ref.html \
+ changes.html \
+ compile.html \
+ copyright.html \
+ copyright-release.html \
+ copyright-release.pdf \
+ conflict.html \
+ datatypes.html \
+ datatype3.html \
+ different.html \
+ docs.html \
+ download.html \
+ faq.html \
+ fileformat.html \
+ formatchng.html \
+ index.html \
+ lang.html \
+ lockingv3.html \
+ mingw.html \
+ nulls.html \
+ oldnews.html \
+ omitted.html \
+ opcode.html \
+ pragma.html \
+ quickstart.html \
+ speed.html \
+ sqlite.gif \
+ sqlite.html \
+ support.html \
+ tclsqlite.html \
+ vdbe.html \
+ version3.html \
+ whentouse.html
+
+doc: common.tcl $(DOC)
+ mkdir -p doc
+ mv $(DOC) doc
+
+# Standard install and cleanup targets
+#
+install: sqlite3 libsqlite3.a sqlite3.h
+ mv sqlite3 /usr/bin
+ mv libsqlite3.a /usr/lib
+ mv sqlite3.h /usr/include
+
+clean:
+ rm -f *.o sqlite3 libsqlite3.a sqlite3.h opcodes.* crashtest
+ rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h
+ rm -f $(PUBLISH)
+ rm -f *.da *.bb *.bbg gmon.out
+ rm -rf tsrc
diff --git a/ext/pdo_sqlite/sqlite/mkdll.sh b/ext/pdo_sqlite/sqlite/mkdll.sh
new file mode 100644
index 000000000..1ad5f8332
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/mkdll.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# This script is used to compile SQLite into a DLL.
+#
+# Two separate DLLs are generated. "sqlite3.dll" is the core
+# library. "tclsqlite3.dll" contains the TCL bindings and is the
+# library that is loaded into TCL in order to run SQLite.
+#
+make target_source
+cd tsrc
+PATH=$PATH:/opt/mingw/bin
+TCLDIR=/home/drh/tcltk/846/win/846win
+TCLSTUBLIB=$TCLDIR/libtcl84stub.a
+OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DTHREADSAFE=1'
+CC="i386-mingw32msvc-gcc -O2 $OPTS -I. -I$TCLDIR"
+rm shell.c
+for i in *.c; do
+ CMD="$CC -c $i"
+ echo $CMD
+ $CMD
+done
+echo 'EXPORTS' >tclsqlite3.def
+echo 'Tclsqlite3_Init' >>tclsqlite3.def
+echo 'Tclsqlite_Init' >>tclsqlite3.def
+echo 'Sqlite3_Init' >>tclsqlite3.def
+echo 'Sqlite_Init' >>tclsqlite3.def
+i386-mingw32msvc-dllwrap \
+ --def tclsqlite3.def -v --export-all \
+ --driver-name i386-mingw32msvc-gcc \
+ --dlltool-name i386-mingw32msvc-dlltool \
+ --as i386-mingw32msvc-as \
+ --target i386-mingw32 \
+ -dllname tclsqlite3.dll -lmsvcrt *.o $TCLSTUBLIB
+i386-mingw32msvc-strip tclsqlite3.dll
+rm tclsqlite.o
+i386-mingw32msvc-dllwrap \
+ --def sqlite3.def -v --export-all \
+ --driver-name i386-mingw32msvc-gcc \
+ --dlltool-name i386-mingw32msvc-dlltool \
+ --as i386-mingw32msvc-as \
+ --target i386-mingw32 \
+ -dllname sqlite3.dll -lmsvcrt *.o
+i386-mingw32msvc-strip sqlite3.dll
+cd ..
diff --git a/ext/pdo_sqlite/sqlite/mkopcodec.awk b/ext/pdo_sqlite/sqlite/mkopcodec.awk
new file mode 100644
index 000000000..bf6bfbeb3
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/mkopcodec.awk
@@ -0,0 +1,28 @@
+#!/usr/bin/awk -f
+#
+# This AWK script scans the opcodes.h file (which is itself generated by
+# another awk script) and uses the information gleaned to create the
+# opcodes.c source file.
+#
+# Opcodes.c contains strings which are the symbolic names for the various
+# opcodes used by the VDBE. These strings are used when disassembling a
+# VDBE program during tracing or as a result of the EXPLAIN keyword.
+#
+BEGIN {
+ print "/* Automatically generated. Do not edit */"
+ print "/* See the mkopcodec.awk script for details. */"
+ printf "#if !defined(SQLITE_OMIT_EXPLAIN)"
+ printf " || !defined(NDEBUG)"
+ printf " || defined(VDBE_PROFILE)"
+ print " || defined(SQLITE_DEBUG)"
+ print "const char *const sqlite3OpcodeNames[] = { \"?\","
+}
+/define OP_/ {
+ sub("OP_","",$2)
+ i++
+ printf " /* %3d */ \"%s\",\n", $3, $2
+}
+END {
+ print "};"
+ print "#endif"
+}
diff --git a/ext/pdo_sqlite/sqlite/mkopcodeh.awk b/ext/pdo_sqlite/sqlite/mkopcodeh.awk
new file mode 100644
index 000000000..a258194ca
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/mkopcodeh.awk
@@ -0,0 +1,110 @@
+#!/usr/bin/awk -f
+#
+# Generate the file opcodes.h.
+#
+# This AWK script scans a concatenation of the parse.h output file from the
+# parser and the vdbe.c source file in order to generate the opcodes numbers
+# for all opcodes.
+#
+# The lines of the vdbe.c that we are interested in are of the form:
+#
+# case OP_aaaa: /* same as TK_bbbbb */
+#
+# The TK_ comment is optional. If it is present, then the value assigned to
+# the OP_ is the same as the TK_ value. If missing, the OP_ value is assigned
+# a small integer that is different from every other OP_ value.
+#
+# We go to the trouble of making some OP_ value the same as TK_ values
+# as an optimization. During parsing, things like expression operators
+# are coded with TK_ values such as TK_ADD, TK_DIVIDE, and so forth. Later
+# during code generation, we need to generate corresponding opcodes like
+# OP_Add and OP_Divide. By making TK_ADD==OP_Add and TK_DIVIDE==OP_Divide,
+# code to translation from one to the other is avoided. This makes the
+# code generator run (infinitesimally) faster and more importantly it makes
+# the total library smaller.
+#
+
+
+# Remember the TK_ values from the parse.h file
+/^#define TK_/ {
+ tk[$2] = $3
+}
+
+# Scan for "case OP_aaaa:" lines in the vdbe.c file
+/^case OP_/ {
+ name = $2
+ gsub(/:/,"",name)
+ gsub("\r","",name)
+ op[name] = -1
+ for(i=3; i<NF; i++){
+ if($i=="same" && $(i+1)=="as"){
+ sym = $(i+2)
+ sub(/,/,"",sym)
+ op[name] = tk[sym]
+ used[op[name]] = 1
+ sameas[op[name]] = sym
+ }
+ if($i=="no-push"){
+ nopush[name] = 1
+ }
+ }
+}
+
+# Assign numbers to all opcodes and output the result.
+END {
+ cnt = 0
+ max = 0
+ print "/* Automatically generated. Do not edit */"
+ print "/* See the mkopcodeh.awk script for details */"
+ for(name in op){
+ if( op[name]<0 ){
+ cnt++
+ while( used[cnt] ) cnt++
+ op[name] = cnt
+ }
+ used[op[name]] = 1;
+ if( op[name]>max ) max = op[name]
+ printf "#define %-25s %15d", name, op[name]
+ if( sameas[op[name]] ) {
+ printf " /* same as %-12s*/", sameas[op[name]]
+ }
+ printf "\n"
+
+ }
+ seenUnused = 0;
+ for(i=1; i<max; i++){
+ if( !used[i] ){
+ if( !seenUnused ){
+ printf "\n/* The following opcode values are never used */\n"
+ seenUnused = 1
+ }
+ printf "#define %-25s %15d\n", sprintf( "OP_NotUsed_%-3d", i ), i
+ }
+ }
+
+ # Generate the 10 16-bit bitmasks used by function opcodeUsesStack()
+ # in vdbeaux.c. See comments in that function for details.
+ #
+ nopush[0] = 0 # 0..15
+ nopush[1] = 0 # 16..31
+ nopush[2] = 0 # 32..47
+ nopush[3] = 0 # 48..63
+ nopush[4] = 0 # 64..79
+ nopush[5] = 0 # 80..95
+ nopush[6] = 0 # 96..111
+ nopush[7] = 0 # 112..127
+ nopush[8] = 0 # 128..143
+ nopush[9] = 0 # 144..159
+ for(name in op){
+ if( nopush[name] ){
+ n = op[name]
+ j = n%16
+ i = ((n - j)/16)
+ nopush[i] = nopush[i] + (2^j)
+ }
+ }
+ printf "\n"
+ for(i=0; i<10; i++){
+ printf "#define NOPUSH_MASK_%d %d\n", i, nopush[i]
+ }
+}
diff --git a/ext/pdo_sqlite/sqlite/mkso.sh b/ext/pdo_sqlite/sqlite/mkso.sh
new file mode 100644
index 000000000..b26382c99
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/mkso.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# This script is used to compile SQLite into a shared library on Linux.
+#
+# Two separate shared libraries are generated. "sqlite3.so" is the core
+# library. "tclsqlite3.so" contains the TCL bindings and is the
+# library that is loaded into TCL in order to run SQLite.
+#
+make target_source
+cd tsrc
+rm shell.c
+TCLDIR=/home/drh/tcltk/846/linux/846linux
+TCLSTUBLIB=$TCLDIR/libtclstub8.4g.a
+OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1'
+for i in *.c; do
+ if test $i != 'keywordhash.c'; then
+ CMD="cc -fPIC $OPTS -O2 -I. -I$TCLDIR -c $i"
+ echo $CMD
+ $CMD
+ fi
+done
+echo gcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so
+gcc -shared *.o $TCLSTUBLIB -o tclsqlite3.so
+strip tclsqlite3.so
+rm tclsqlite.c tclsqlite.o
+echo gcc -shared *.o -o sqlite3.so
+gcc -shared *.o -o sqlite3.so
+strip sqlite3.so
+cd ..
diff --git a/ext/pdo_sqlite/sqlite/publish.sh b/ext/pdo_sqlite/sqlite/publish.sh
new file mode 100644
index 000000000..0a61d90ed
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/publish.sh
@@ -0,0 +1,115 @@
+#!/bin/sh
+#
+# This script is used to compile SQLite and all its documentation and
+# ship everything up to the SQLite website. This script will only work
+# on the system "zadok" at the Hwaci offices. But others might find
+# the script useful as an example.
+#
+
+# Set srcdir to the name of the directory that contains the publish.sh
+# script.
+#
+srcdir=`echo "$0" | sed 's%\(^.*\)/[^/][^/]*$%\1%'`
+
+# Get the makefile.
+#
+cp $srcdir/Makefile.linux-gcc ./Makefile
+chmod +x $srcdir/install-sh
+
+# Get the current version number - needed to help build filenames
+#
+VERS=`cat $srcdir/VERSION`
+VERSW=`sed 's/\./_/g' $srcdir/VERSION`
+
+# Start by building an sqlite shell for linux.
+#
+make clean
+make sqlite3
+strip sqlite3
+mv sqlite3 sqlite3-$VERS.bin
+gzip sqlite3-$VERS.bin
+mv sqlite3-$VERS.bin.gz doc
+
+# Build a source archive useful for windows.
+#
+make target_source
+cd tsrc
+zip ../doc/sqlite-source-$VERSW.zip *
+cd ..
+
+# Build the sqlite.so and tclsqlite.so shared libraries
+# under Linux
+#
+. $srcdir/mkso.sh
+cd tsrc
+mv tclsqlite3.so tclsqlite-$VERS.so
+gzip tclsqlite-$VERS.so
+mv tclsqlite-$VERS.so.gz ../doc
+mv sqlite3.so sqlite-$VERS.so
+gzip sqlite-$VERS.so
+mv sqlite-$VERS.so.gz ../doc
+cd ..
+
+# Build the tclsqlite3.dll and sqlite3.dll shared libraries.
+#
+. $srcdir/mkdll.sh
+cd tsrc
+echo zip ../doc/tclsqlite-$VERSW.zip tclsqlite3.dll
+zip ../doc/tclsqlite-$VERSW.zip tclsqlite3.dll
+echo zip ../doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def
+zip ../doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def
+cd ..
+
+# Build the sqlite.exe executable for windows.
+#
+make target_source
+cd tsrc
+rm tclsqlite.c
+OPTS='-DSTATIC_BUILD=1 -DNDEBUG=1'
+i386-mingw32msvc-gcc -O2 $OPTS -I. -I$TCLDIR *.c -o sqlite3.exe
+zip ../doc/sqlite-$VERSW.zip sqlite3.exe
+cd ..
+
+# Construct a tarball of the source tree
+#
+ORIGIN=`pwd`
+cd $srcdir
+cd ..
+mv sqlite sqlite-$VERS
+EXCLUDE=`find sqlite-$VERS -print | grep CVS | sed 's,^, --exclude ,'`
+tar czf $ORIGIN/doc/sqlite-$VERS.tar.gz $EXCLUDE sqlite-$VERS
+mv sqlite-$VERS sqlite
+cd $ORIGIN
+
+#
+# Build RPMS (binary) and Source RPM
+#
+
+# Make sure we are properly setup to build RPMs
+#
+echo "%HOME %{expand:%%(cd; pwd)}" > $HOME/.rpmmacros
+echo "%_topdir %{HOME}/rpm" >> $HOME/.rpmmacros
+mkdir $HOME/rpm
+mkdir $HOME/rpm/BUILD
+mkdir $HOME/rpm/SOURCES
+mkdir $HOME/rpm/RPMS
+mkdir $HOME/rpm/SRPMS
+mkdir $HOME/rpm/SPECS
+
+# create the spec file from the template
+sed s/SQLITE_VERSION/$VERS/g $srcdir/spec.template > $HOME/rpm/SPECS/sqlite.spec
+
+# copy the source tarball to the rpm directory
+cp doc/sqlite-$VERS.tar.gz $HOME/rpm/SOURCES/.
+
+# build all the rpms
+rpm -ba $HOME/rpm/SPECS/sqlite.spec >& rpm-$vers.log
+
+# copy the RPMs into the build directory.
+mv $HOME/rpm/RPMS/i386/sqlite*-$vers*.rpm doc
+mv $HOME/rpm/SRPMS/sqlite-$vers*.rpm doc
+
+# Build the website
+#
+#cp $srcdir/../historical/* doc
+make doc
diff --git a/ext/pdo_sqlite/sqlite/spec.template b/ext/pdo_sqlite/sqlite/spec.template
new file mode 100644
index 000000000..24c5eaebb
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/spec.template
@@ -0,0 +1,62 @@
+%define name sqlite
+%define version SQLITE_VERSION
+%define release 1
+
+Name: %{name}
+Summary: SQLite is a C library that implements an embeddable SQL database engine
+Version: %{version}
+Release: %{release}
+Source: %{name}-%{version}.tar.gz
+Group: System/Libraries
+URL: http://www.hwaci.com/sw/sqlite/
+License: Public Domain
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+
+%description
+SQLite is a C library that implements an embeddable SQL database engine.
+Programs that link with the SQLite library can have SQL database access
+without running a separate RDBMS process. The distribution comes with a
+standalone command-line access program (sqlite) that can be used to
+administer an SQLite database and which serves as an example of how to
+use the SQLite library.
+
+%package -n %{name}-devel
+Summary: Header files and libraries for developing apps which will use sqlite
+Group: Development/C
+Requires: %{name} = %{version}-%{release}
+
+%description -n %{name}-devel
+The sqlite-devel package contains the header files and libraries needed
+to develop programs that use the sqlite database library.
+
+%prep
+%setup -q -n %{name}
+
+%build
+CFLAGS="%optflags -DNDEBUG=1" CXXFLAGS="%optflags -DNDEBUG=1" ./configure --prefix=%{_prefix}
+
+make
+make doc
+
+%install
+install -d $RPM_BUILD_ROOT/%{_prefix}
+install -d $RPM_BUILD_ROOT/%{_prefix}/bin
+install -d $RPM_BUILD_ROOT/%{_prefix}/include
+install -d $RPM_BUILD_ROOT/%{_prefix}/lib
+make install prefix=$RPM_BUILD_ROOT/%{_prefix}
+
+%clean
+rm -fr $RPM_BUILD_ROOT
+
+%files
+%defattr(-, root, root)
+%{_libdir}/*.so*
+%{_bindir}/*
+
+%files -n %{name}-devel
+%defattr(-, root, root)
+%{_libdir}/pkgconfig/sqlite3.pc
+%{_libdir}/*.a
+%{_libdir}/*.la
+%{_includedir}/*
+%doc doc/*
diff --git a/ext/pdo_sqlite/sqlite/sqlite.1 b/ext/pdo_sqlite/sqlite/sqlite.1
new file mode 100644
index 000000000..e35358ec6
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/sqlite.1
@@ -0,0 +1,203 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH SQLITE 1 "Mon Apr 15 23:49:17 2002"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+sqlite \- A command line interface for SQLite
+.SH SYNOPSIS
+.B sqlite
+.RI [ options ] " filename " [ SQL ]
+.SS SUMMARY
+.PP
+sqlite is a terminal-based front-end to the SQLite library. It enables
+you to type in queries interactively, issue them to SQLite and see the
+results. Alternatively, you can specify SQL code on the command-line. In
+addition it provides a number of meta-commands.
+
+.SH DESCRIPTION
+This manual page documents briefly the
+.B sqlite
+command.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.SS GETTING STARTED
+.PP
+To start the sqlite program, just type "sqlite" followed by the name
+the file that holds the SQLite database. If the file does not exist, a
+new one is created automatically. The sqlite program will then prompt
+you to enter SQL. Type in SQL statements (terminated by a semicolon),
+press "Enter" and the SQL will be executed.
+
+For example, to create a new SQLite database named "ex1" with a single
+table named "tbl1", you might do this:
+.sp
+.nf
+$ sqlite ex1
+SQLite version 2.0.0
+Enter ".help" for instructions
+sqlite> create table tbl1(one varchar(10), two smallint);
+sqlite> insert into tbl1 values('hello!',10);
+sqlite> insert into tbl1 values('goodbye', 20);
+sqlite> select * from tbl1;
+hello!|10
+goodbye|20
+sqlite>
+.sp
+.fi
+
+.SS SQLITE META-COMMANDS
+.PP
+Most of the time, sqlite just reads lines of input and passes them on
+to the SQLite library for execution. But if an input line begins with
+a dot ("."), then that line is intercepted and interpreted by the
+sqlite program itself. These "dot commands" are typically used to
+change the output format of queries, or to execute certain prepackaged
+query statements.
+
+For a listing of the available dot commands, you can enter ".help" at
+any time. For example:
+.sp
+.nf
+.cc |
+sqlite> .help
+.dump ?TABLE? ... Dump the database in an text format
+.echo ON|OFF Turn command echo on or off
+.exit Exit this program
+.explain ON|OFF Turn output mode suitable for EXPLAIN on or off.
+ "off" will revert to the output mode that was
+ previously in effect
+.header(s) ON|OFF Turn display of headers on or off
+.help Show this message
+.indices TABLE Show names of all indices on TABLE
+.mode MODE Set mode to one of "line(s)", "column(s)",
+ "insert", "list", or "html"
+.mode insert TABLE Generate SQL insert statements for TABLE
+.nullvalue STRING Print STRING instead of nothing for NULL data
+.output FILENAME Send output to FILENAME
+.output stdout Send output to the screen
+.prompt MAIN CONTINUE Replace the standard prompts
+ "sqlite > " and " ...> "
+ with the strings MAIN and CONTINUE
+ CONTINUE is optional.
+.quit Exit this program
+.read FILENAME Execute SQL in FILENAME
+.reindex ?TABLE? Rebuild indices
+.schema ?TABLE? Show the CREATE statements
+.separator STRING Change separator string for "list" mode
+.show Show the current values for the following:
+ .echo
+ .explain
+ .mode
+ .nullvalue
+ .output
+ .separator
+ .width
+.tables ?PATTERN? List names of tables matching a pattern
+.timeout MS Try opening locked tables for MS milliseconds
+.width NUM NUM ... Set column widths for "column" mode
+sqlite>
+|cc .
+.sp
+.fi
+
+.SH OPTIONS
+The program has the following options:
+.TP
+.BI \-init\ file
+Read in and process 'file', which contains "dot commands".
+You can use this file to initialize display settings.
+.TP
+.B \-html
+Set output mode to HTML.
+.TP
+.B \-list
+Set output mode to 'list'.
+.TP
+.B \-line
+Set output mode to 'line'.
+.TP
+.B \-column
+Set output mode to 'column'.
+.TP
+.BI \-separator\ separator
+Specify which output field separator for 'list' mode to use.
+Default is '|'.
+.TP
+.BI \-nullvalue\ string
+When a null is encountered, print 'string'. Default is no string.
+.TP
+.B \-[no]header
+Turn headers on or off. Default is off.
+.TP
+.B \-echo
+Print commands before execution.
+
+
+.SH OUTPUT MODE
+The SQLite program has different output modes, which define the way
+the output (from queries) is formatted.
+
+In 'list' mode, which is the default, one record per line is output,
+each field separated by the separator specified with the
+\fB-separator\fP option or \fB.separator\fP command.
+
+In 'line' mode, each column is output on its own line, records are
+separated by blank lines.
+
+In HTML mode, an XHTML table is generated.
+
+In 'column' mode, one record per line is output, aligned neatly in colums.
+
+.SH INIT FILE
+sqlite can be initialized using resource files. These can be combined with
+command line arguments to set up sqlite exactly the way you want it.
+Initialization proceeds as follows:
+
+o The defaults of
+
+.sp
+.nf
+.cc |
+mode = LIST
+separator = "|"
+main prompt = "sqlite> "
+continue prompt = " ...> "
+|cc .
+.sp
+.fi
+
+are established.
+
+o If a file .sqliterc can be found in the user's home directory, it is
+read and processed. It should only contain "dot commands". If the
+file is not found or cannot be read, processing continues without
+notification.
+
+o If a file is specified on the command line with the -init option, it
+is processed in the same manner as .sqliterc
+
+o All other command line options are processed
+
+o The database is opened and you are now ready to begin.
+
+.SH SEE ALSO
+http://www.hwaci.com/sw/sqlite/
+.br
+The sqlite-doc package
+.SH AUTHOR
+This manual page was originally written by Andreas Rottmann
+<rotty@debian.org>, for the Debian GNU/Linux system (but may be used
+by others).
diff --git a/ext/pdo_sqlite/sqlite/sqlite.pc.in b/ext/pdo_sqlite/sqlite/sqlite.pc.in
new file mode 100644
index 000000000..16ed41c3d
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/sqlite.pc.in
@@ -0,0 +1,12 @@
+# Package Information for pkg-config
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: SQLite
+Description: SQL database engine
+Version: @VERSION@
+Libs: -L${libdir} -lsqlite
+Cflags: -I${includedir}
diff --git a/ext/pdo_sqlite/sqlite/sqlite3.def b/ext/pdo_sqlite/sqlite/sqlite3.def
new file mode 100644
index 000000000..c57ca6897
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/sqlite3.def
@@ -0,0 +1,97 @@
+EXPORTS
+sqlite3_aggregate_context
+sqlite3_aggregate_count
+sqlite3_bind_blob
+sqlite3_bind_double
+sqlite3_bind_int
+sqlite3_bind_int64
+sqlite3_bind_null
+sqlite3_bind_parameter_count
+sqlite3_bind_parameter_index
+sqlite3_bind_parameter_name
+sqlite3_bind_text
+sqlite3_bind_text16
+sqlite3_busy_handler
+sqlite3_busy_timeout
+sqlite3_changes
+sqlite3_close
+sqlite3_collation_needed
+sqlite3_collation_needed16
+sqlite3_column_blob
+sqlite3_column_bytes
+sqlite3_column_bytes16
+sqlite3_column_count
+sqlite3_column_decltype
+sqlite3_column_decltype16
+sqlite3_column_double
+sqlite3_column_int
+sqlite3_column_int64
+sqlite3_column_name
+sqlite3_column_name16
+sqlite3_column_text
+sqlite3_column_text16
+sqlite3_column_type
+sqlite3_commit_hook
+sqlite3_complete
+sqlite3_complete16
+sqlite3_create_collation
+sqlite3_create_collation16
+sqlite3_create_function
+sqlite3_create_function16
+sqlite3_data_count
+sqlite3_db_handle
+sqlite3_errcode
+sqlite3_errmsg
+sqlite3_errmsg16
+sqlite3_exec
+sqlite3_expired
+sqlite3_finalize
+sqlite3_free
+sqlite3_free_table
+sqlite3_get_autocommit
+sqlite3_get_auxdata
+sqlite3_get_table
+sqlite3_global_recover
+sqlite3_interrupt
+sqlite3_last_insert_rowid
+sqlite3_libversion
+sqlite3_libversion_number
+sqlite3_mprintf
+sqlite3_open
+sqlite3_open16
+sqlite3_prepare
+sqlite3_prepare16
+sqlite3_progress_handler
+sqlite3_reset
+sqlite3_result_blob
+sqlite3_result_double
+sqlite3_result_error
+sqlite3_result_error16
+sqlite3_result_int
+sqlite3_result_int64
+sqlite3_result_null
+sqlite3_result_text
+sqlite3_result_text16
+sqlite3_result_text16be
+sqlite3_result_text16le
+sqlite3_result_value
+sqlite3_set_authorizer
+sqlite3_set_auxdata
+sqlite3_snprintf
+sqlite3_step
+sqlite3_total_changes
+sqlite3_trace
+sqlite3_transfer_bindings
+sqlite3_user_data
+sqlite3_value_blob
+sqlite3_value_bytes
+sqlite3_value_bytes16
+sqlite3_value_double
+sqlite3_value_int
+sqlite3_value_int64
+sqlite3_value_text
+sqlite3_value_text16
+sqlite3_value_text16be
+sqlite3_value_text16le
+sqlite3_value_type
+sqlite3_vmprintf
diff --git a/ext/pdo_sqlite/sqlite/sqlite3.pc.in b/ext/pdo_sqlite/sqlite/sqlite3.pc.in
new file mode 100644
index 000000000..c14b5ba33
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/sqlite3.pc.in
@@ -0,0 +1,12 @@
+# Package Information for pkg-config
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: SQLite
+Description: SQL database engine
+Version: @VERSION@
+Libs: -L${libdir} -lsqlite3
+Cflags: -I${includedir}
diff --git a/ext/pdo_sqlite/sqlite/src/alter.c b/ext/pdo_sqlite/sqlite/src/alter.c
new file mode 100644
index 000000000..b8e193cbd
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/alter.c
@@ -0,0 +1,557 @@
+/*
+** 2005 February 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains C code routines that used to generate VDBE code
+** that implements the ALTER TABLE command.
+**
+** $Id: alter.c,v 1.2.2.2 2005/09/26 19:33:24 iliaa Exp $
+*/
+#include "sqliteInt.h"
+#include <ctype.h>
+
+/*
+** The code in this file only exists if we are not omitting the
+** ALTER TABLE logic from the build.
+*/
+#ifndef SQLITE_OMIT_ALTERTABLE
+
+
+/*
+** This function is used by SQL generated to implement the
+** ALTER TABLE command. The first argument is the text of a CREATE TABLE or
+** CREATE INDEX command. The second is a table name. The table name in
+** the CREATE TABLE or CREATE INDEX statement is replaced with the second
+** argument and the result returned. Examples:
+**
+** sqlite_rename_table('CREATE TABLE abc(a, b, c)', 'def')
+** -> 'CREATE TABLE def(a, b, c)'
+**
+** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def')
+** -> 'CREATE INDEX i ON def(a, b, c)'
+*/
+static void renameTableFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ unsigned char const *zSql = sqlite3_value_text(argv[0]);
+ unsigned char const *zTableName = sqlite3_value_text(argv[1]);
+
+ int token;
+ Token tname;
+ char const *zCsr = zSql;
+ int len = 0;
+ char *zRet;
+
+ /* The principle used to locate the table name in the CREATE TABLE
+ ** statement is that the table name is the first token that is immediatedly
+ ** followed by a left parenthesis - TK_LP.
+ */
+ if( zSql ){
+ do {
+ /* Store the token that zCsr points to in tname. */
+ tname.z = zCsr;
+ tname.n = len;
+
+ /* Advance zCsr to the next token. Store that token type in 'token',
+ ** and it's length in 'len' (to be used next iteration of this loop).
+ */
+ do {
+ zCsr += len;
+ len = sqlite3GetToken(zCsr, &token);
+ } while( token==TK_SPACE );
+ assert( len>0 );
+ } while( token!=TK_LP );
+
+ zRet = sqlite3MPrintf("%.*s%Q%s", tname.z - zSql, zSql,
+ zTableName, tname.z+tname.n);
+ sqlite3_result_text(context, zRet, -1, sqlite3FreeX);
+ }
+}
+
+#ifndef SQLITE_OMIT_TRIGGER
+/* This function is used by SQL generated to implement the ALTER TABLE
+** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER
+** statement. The second is a table name. The table name in the CREATE
+** TRIGGER statement is replaced with the second argument and the result
+** returned. This is analagous to renameTableFunc() above, except for CREATE
+** TRIGGER, not CREATE INDEX and CREATE TABLE.
+*/
+static void renameTriggerFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ unsigned char const *zSql = sqlite3_value_text(argv[0]);
+ unsigned char const *zTableName = sqlite3_value_text(argv[1]);
+
+ int token;
+ Token tname;
+ int dist = 3;
+ char const *zCsr = zSql;
+ int len = 0;
+ char *zRet;
+
+ /* The principle used to locate the table name in the CREATE TRIGGER
+ ** statement is that the table name is the first token that is immediatedly
+ ** preceded by either TK_ON or TK_DOT and immediatedly followed by one
+ ** of TK_WHEN, TK_BEGIN or TK_FOR.
+ */
+ if( zSql ){
+ do {
+ /* Store the token that zCsr points to in tname. */
+ tname.z = zCsr;
+ tname.n = len;
+
+ /* Advance zCsr to the next token. Store that token type in 'token',
+ ** and it's length in 'len' (to be used next iteration of this loop).
+ */
+ do {
+ zCsr += len;
+ len = sqlite3GetToken(zCsr, &token);
+ }while( token==TK_SPACE );
+ assert( len>0 );
+
+ /* Variable 'dist' stores the number of tokens read since the most
+ ** recent TK_DOT or TK_ON. This means that when a WHEN, FOR or BEGIN
+ ** token is read and 'dist' equals 2, the condition stated above
+ ** to be met.
+ **
+ ** Note that ON cannot be a database, table or column name, so
+ ** there is no need to worry about syntax like
+ ** "CREATE TRIGGER ... ON ON.ON BEGIN ..." etc.
+ */
+ dist++;
+ if( token==TK_DOT || token==TK_ON ){
+ dist = 0;
+ }
+ } while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) );
+
+ /* Variable tname now contains the token that is the old table-name
+ ** in the CREATE TRIGGER statement.
+ */
+ zRet = sqlite3MPrintf("%.*s%Q%s", tname.z - zSql, zSql,
+ zTableName, tname.z+tname.n);
+ sqlite3_result_text(context, zRet, -1, sqlite3FreeX);
+ }
+}
+#endif /* !SQLITE_OMIT_TRIGGER */
+
+/*
+** Register built-in functions used to help implement ALTER TABLE
+*/
+void sqlite3AlterFunctions(sqlite3 *db){
+ static const struct {
+ char *zName;
+ signed char nArg;
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value **);
+ } aFuncs[] = {
+ { "sqlite_rename_table", 2, renameTableFunc},
+#ifndef SQLITE_OMIT_TRIGGER
+ { "sqlite_rename_trigger", 2, renameTriggerFunc},
+#endif
+ };
+ int i;
+
+ for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
+ sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg,
+ SQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0);
+ }
+}
+
+/*
+** Generate the text of a WHERE expression which can be used to select all
+** temporary triggers on table pTab from the sqlite_temp_master table. If
+** table pTab has no temporary triggers, or is itself stored in the
+** temporary database, NULL is returned.
+*/
+static char *whereTempTriggers(Parse *pParse, Table *pTab){
+ Trigger *pTrig;
+ char *zWhere = 0;
+ char *tmp = 0;
+ if( pTab->iDb!=1 ){
+ for( pTrig=pTab->pTrigger; pTrig; pTrig=pTrig->pNext ){
+ if( pTrig->iDb==1 ){
+ if( !zWhere ){
+ zWhere = sqlite3MPrintf("name=%Q", pTrig->name);
+ }else{
+ tmp = zWhere;
+ zWhere = sqlite3MPrintf("%s OR name=%Q", zWhere, pTrig->name);
+ sqliteFree(tmp);
+ }
+ }
+ }
+ }
+ return zWhere;
+}
+
+/*
+** Generate code to drop and reload the internal representation of table
+** pTab from the database, including triggers and temporary triggers.
+** Argument zName is the name of the table in the database schema at
+** the time the generated code is executed. This can be different from
+** pTab->zName if this function is being called to code part of an
+** "ALTER TABLE RENAME TO" statement.
+*/
+static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
+ Vdbe *v;
+ char *zWhere;
+ int iDb;
+#ifndef SQLITE_OMIT_TRIGGER
+ Trigger *pTrig;
+#endif
+
+ v = sqlite3GetVdbe(pParse);
+ if( !v ) return;
+ iDb = pTab->iDb;
+
+#ifndef SQLITE_OMIT_TRIGGER
+ /* Drop any table triggers from the internal schema. */
+ for(pTrig=pTab->pTrigger; pTrig; pTrig=pTrig->pNext){
+ assert( pTrig->iDb==iDb || pTrig->iDb==1 );
+ sqlite3VdbeOp3(v, OP_DropTrigger, pTrig->iDb, 0, pTrig->name, 0);
+ }
+#endif
+
+ /* Drop the table and index from the internal schema */
+ sqlite3VdbeOp3(v, OP_DropTable, iDb, 0, pTab->zName, 0);
+
+ /* Reload the table, index and permanent trigger schemas. */
+ zWhere = sqlite3MPrintf("tbl_name=%Q", zName);
+ if( !zWhere ) return;
+ sqlite3VdbeOp3(v, OP_ParseSchema, iDb, 0, zWhere, P3_DYNAMIC);
+
+#ifndef SQLITE_OMIT_TRIGGER
+ /* Now, if the table is not stored in the temp database, reload any temp
+ ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined.
+ */
+ if( (zWhere=whereTempTriggers(pParse, pTab)) ){
+ sqlite3VdbeOp3(v, OP_ParseSchema, 1, 0, zWhere, P3_DYNAMIC);
+ }
+#endif
+}
+
+/*
+** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy"
+** command.
+*/
+void sqlite3AlterRenameTable(
+ Parse *pParse, /* Parser context. */
+ SrcList *pSrc, /* The table to rename. */
+ Token *pName /* The new table name. */
+){
+ int iDb; /* Database that contains the table */
+ char *zDb; /* Name of database iDb */
+ Table *pTab; /* Table being renamed */
+ char *zName = 0; /* NULL-terminated version of pName */
+ sqlite3 *db = pParse->db; /* Database connection */
+ Vdbe *v;
+#ifndef SQLITE_OMIT_TRIGGER
+ char *zWhere = 0; /* Where clause to locate temp triggers */
+#endif
+
+ if( sqlite3_malloc_failed ) goto exit_rename_table;
+ assert( pSrc->nSrc==1 );
+
+ pTab = sqlite3LocateTable(pParse, pSrc->a[0].zName, pSrc->a[0].zDatabase);
+ if( !pTab ) goto exit_rename_table;
+ iDb = pTab->iDb;
+ zDb = db->aDb[iDb].zName;
+
+ /* Get a NULL terminated version of the new table name. */
+ zName = sqlite3NameFromToken(pName);
+ if( !zName ) goto exit_rename_table;
+
+ /* Check that a table or index named 'zName' does not already exist
+ ** in database iDb. If so, this is an error.
+ */
+ if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){
+ sqlite3ErrorMsg(pParse,
+ "there is already another table or index with this name: %s", zName);
+ goto exit_rename_table;
+ }
+
+ /* Make sure it is not a system table being altered, or a reserved name
+ ** that the table is being renamed to.
+ */
+ if( strlen(pTab->zName)>6 && 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7) ){
+ sqlite3ErrorMsg(pParse, "table %s may not be altered", pTab->zName);
+ goto exit_rename_table;
+ }
+ if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ goto exit_rename_table;
+ }
+
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ /* Invoke the authorization callback. */
+ if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){
+ goto exit_rename_table;
+ }
+#endif
+
+ /* Begin a transaction and code the VerifyCookie for database iDb.
+ ** Then modify the schema cookie (since the ALTER TABLE modifies the
+ ** schema).
+ */
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ){
+ goto exit_rename_table;
+ }
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+ sqlite3ChangeCookie(db, v, iDb);
+
+ /* Modify the sqlite_master table to use the new table name. */
+ sqlite3NestedParse(pParse,
+ "UPDATE %Q.%s SET "
+#ifdef SQLITE_OMIT_TRIGGER
+ "sql = sqlite_rename_table(sql, %Q), "
+#else
+ "sql = CASE "
+ "WHEN type = 'trigger' THEN sqlite_rename_trigger(sql, %Q)"
+ "ELSE sqlite_rename_table(sql, %Q) END, "
+#endif
+ "tbl_name = %Q, "
+ "name = CASE "
+ "WHEN type='table' THEN %Q "
+ "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN "
+ "'sqlite_autoindex_' || %Q || substr(name, %d+18,10) "
+ "ELSE name END "
+ "WHERE tbl_name=%Q AND "
+ "(type='table' OR type='index' OR type='trigger');",
+ zDb, SCHEMA_TABLE(iDb), zName, zName, zName,
+#ifndef SQLITE_OMIT_TRIGGER
+ zName,
+#endif
+ zName, strlen(pTab->zName), pTab->zName
+ );
+
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ /* If the sqlite_sequence table exists in this database, then update
+ ** it with the new table name.
+ */
+ if( sqlite3FindTable(db, "sqlite_sequence", zDb) ){
+ sqlite3NestedParse(pParse,
+ "UPDATE %Q.sqlite_sequence set name = %Q WHERE name = %Q",
+ zDb, zName, pTab->zName);
+ }
+#endif
+
+#ifndef SQLITE_OMIT_TRIGGER
+ /* If there are TEMP triggers on this table, modify the sqlite_temp_master
+ ** table. Don't do this if the table being ALTERed is itself located in
+ ** the temp database.
+ */
+ if( (zWhere=whereTempTriggers(pParse, pTab)) ){
+ sqlite3NestedParse(pParse,
+ "UPDATE sqlite_temp_master SET "
+ "sql = sqlite_rename_trigger(sql, %Q), "
+ "tbl_name = %Q "
+ "WHERE %s;", zName, zName, zWhere);
+ sqliteFree(zWhere);
+ }
+#endif
+
+ /* Drop and reload the internal table schema. */
+ reloadTableSchema(pParse, pTab, zName);
+
+exit_rename_table:
+ sqlite3SrcListDelete(pSrc);
+ sqliteFree(zName);
+}
+
+
+/*
+** This function is called after an "ALTER TABLE ... ADD" statement
+** has been parsed. Argument pColDef contains the text of the new
+** column definition.
+**
+** The Table structure pParse->pNewTable was extended to include
+** the new column during parsing.
+*/
+void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
+ Table *pNew; /* Copy of pParse->pNewTable */
+ Table *pTab; /* Table being altered */
+ int iDb; /* Database number */
+ const char *zDb; /* Database name */
+ const char *zTab; /* Table name */
+ char *zCol; /* Null-terminated column definition */
+ Column *pCol; /* The new column */
+ Expr *pDflt; /* Default value for the new column */
+ Vdbe *v;
+
+ if( pParse->nErr ) return;
+ pNew = pParse->pNewTable;
+ assert( pNew );
+
+ iDb = pNew->iDb;
+ zDb = pParse->db->aDb[iDb].zName;
+ zTab = pNew->zName;
+ pCol = &pNew->aCol[pNew->nCol-1];
+ pDflt = pCol->pDflt;
+ pTab = sqlite3FindTable(pParse->db, zTab, zDb);
+ assert( pTab );
+
+ /* If the default value for the new column was specified with a
+ ** literal NULL, then set pDflt to 0. This simplifies checking
+ ** for an SQL NULL default below.
+ */
+ if( pDflt && pDflt->op==TK_NULL ){
+ pDflt = 0;
+ }
+
+ /* Check that the new column is not specified as PRIMARY KEY or UNIQUE.
+ ** If there is a NOT NULL constraint, then the default value for the
+ ** column must not be NULL.
+ */
+ if( pCol->isPrimKey ){
+ sqlite3ErrorMsg(pParse, "Cannot add a PRIMARY KEY column");
+ return;
+ }
+ if( pNew->pIndex ){
+ sqlite3ErrorMsg(pParse, "Cannot add a UNIQUE column");
+ return;
+ }
+ if( pCol->notNull && !pDflt ){
+ sqlite3ErrorMsg(pParse,
+ "Cannot add a NOT NULL column with default value NULL");
+ return;
+ }
+
+ /* Ensure the default expression is something that sqlite3ValueFromExpr()
+ ** can handle (i.e. not CURRENT_TIME etc.)
+ */
+ if( pDflt ){
+ sqlite3_value *pVal;
+ if( sqlite3ValueFromExpr(pDflt, SQLITE_UTF8, SQLITE_AFF_NONE, &pVal) ){
+ /* malloc() has failed */
+ return;
+ }
+ if( !pVal ){
+ sqlite3ErrorMsg(pParse, "Cannot add a column with non-constant default");
+ return;
+ }
+ sqlite3ValueFree(pVal);
+ }
+
+ /* Modify the CREATE TABLE statement. */
+ zCol = sqliteStrNDup(pColDef->z, pColDef->n);
+ if( zCol ){
+ char *zEnd = &zCol[pColDef->n-1];
+ while( (zEnd>zCol && *zEnd==';') || isspace(*(unsigned char *)zEnd) ){
+ *zEnd-- = '\0';
+ }
+ sqlite3NestedParse(pParse,
+ "UPDATE %Q.%s SET "
+ "sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d,length(sql)) "
+ "WHERE type = 'table' AND name = %Q",
+ zDb, SCHEMA_TABLE(iDb), pNew->addColOffset, zCol, pNew->addColOffset+1,
+ zTab
+ );
+ sqliteFree(zCol);
+ }
+
+ /* If the default value of the new column is NULL, then set the file
+ ** format to 2. If the default value of the new column is not NULL,
+ ** the file format becomes 3.
+ */
+ if( (v=sqlite3GetVdbe(pParse)) ){
+ int f = (pDflt?3:2);
+
+ /* Only set the file format to $f if it is currently less than $f. */
+ sqlite3VdbeAddOp(v, OP_ReadCookie, iDb, 1);
+ sqlite3VdbeAddOp(v, OP_Integer, f, 0);
+ sqlite3VdbeAddOp(v, OP_Ge, 0, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_Integer, f, 0);
+ sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 1);
+ }
+
+ /* Reload the schema of the modified table. */
+ reloadTableSchema(pParse, pTab, pTab->zName);
+}
+
+
+/*
+** This function is called by the parser after the table-name in
+** an "ALTER TABLE <table-name> ADD" statement is parsed. Argument
+** pSrc is the full-name of the table being altered.
+**
+** This routine makes a (partial) copy of the Table structure
+** for the table being altered and sets Parse.pNewTable to point
+** to it. Routines called by the parser as the column definition
+** is parsed (i.e. sqlite3AddColumn()) add the new Column data to
+** the copy. The copy of the Table structure is deleted by tokenize.c
+** after parsing is finished.
+**
+** Routine sqlite3AlterFinishAddColumn() will be called to complete
+** coding the "ALTER TABLE ... ADD" statement.
+*/
+void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
+ Table *pNew;
+ Table *pTab;
+ Vdbe *v;
+ int iDb;
+ int i;
+ int nAlloc;
+
+
+ /* Look up the table being altered. */
+ assert( pParse->pNewTable==0 );
+ if( sqlite3_malloc_failed ) goto exit_begin_add_column;
+ pTab = sqlite3LocateTable(pParse, pSrc->a[0].zName, pSrc->a[0].zDatabase);
+ if( !pTab ) goto exit_begin_add_column;
+
+ /* Make sure this is not an attempt to ALTER a view. */
+ if( pTab->pSelect ){
+ sqlite3ErrorMsg(pParse, "Cannot add a column to a view");
+ goto exit_begin_add_column;
+ }
+
+ assert( pTab->addColOffset>0 );
+ iDb = pTab->iDb;
+
+ /* Put a copy of the Table struct in Parse.pNewTable for the
+ ** sqlite3AddColumn() function and friends to modify.
+ */
+ pNew = (Table *)sqliteMalloc(sizeof(Table));
+ if( !pNew ) goto exit_begin_add_column;
+ pParse->pNewTable = pNew;
+ pNew->nRef = 1;
+ pNew->nCol = pTab->nCol;
+ assert( pNew->nCol>0 );
+ nAlloc = (((pNew->nCol-1)/8)*8)+8;
+ assert( nAlloc>=pNew->nCol && nAlloc%8==0 && nAlloc-pNew->nCol<8 );
+ pNew->aCol = (Column *)sqliteMalloc(sizeof(Column)*nAlloc);
+ pNew->zName = sqliteStrDup(pTab->zName);
+ if( !pNew->aCol || !pNew->zName ){
+ goto exit_begin_add_column;
+ }
+ memcpy(pNew->aCol, pTab->aCol, sizeof(Column)*pNew->nCol);
+ for(i=0; i<pNew->nCol; i++){
+ Column *pCol = &pNew->aCol[i];
+ pCol->zName = sqliteStrDup(pCol->zName);
+ pCol->zType = 0;
+ pCol->pDflt = 0;
+ }
+ pNew->iDb = iDb;
+ pNew->addColOffset = pTab->addColOffset;
+ pNew->nRef = 1;
+
+ /* Begin a transaction and increment the schema cookie. */
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+ v = sqlite3GetVdbe(pParse);
+ if( !v ) goto exit_begin_add_column;
+ sqlite3ChangeCookie(pParse->db, v, iDb);
+
+exit_begin_add_column:
+ sqlite3SrcListDelete(pSrc);
+ return;
+}
+#endif /* SQLITE_ALTER_TABLE */
diff --git a/ext/pdo_sqlite/sqlite/src/analyze.c b/ext/pdo_sqlite/sqlite/src/analyze.c
new file mode 100644
index 000000000..0285580d3
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/analyze.c
@@ -0,0 +1,386 @@
+/*
+** 2005 July 8
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains code associated with the ANALYZE command.
+**
+** @(#) $Id: analyze.c,v 1.1.2.2 2005/09/26 19:33:24 iliaa Exp $
+*/
+#ifndef SQLITE_OMIT_ANALYZE
+#include "sqliteInt.h"
+
+/*
+** This routine generates code that opens the sqlite_stat1 table on cursor
+** iStatCur.
+**
+** If the sqlite_stat1 tables does not previously exist, it is created.
+** If it does previously exist, all entires associated with table zWhere
+** are removed. If zWhere==0 then all entries are removed.
+*/
+static void openStatTable(
+ Parse *pParse, /* Parsing context */
+ int iDb, /* The database we are looking in */
+ int iStatCur, /* Open the sqlite_stat1 table on this cursor */
+ const char *zWhere /* Delete entries associated with this table */
+){
+ sqlite3 *db = pParse->db;
+ Db *pDb;
+ int iRootPage;
+ Table *pStat;
+ Vdbe *v = sqlite3GetVdbe(pParse);
+
+ pDb = &db->aDb[iDb];
+ if( (pStat = sqlite3FindTable(db, "sqlite_stat1", pDb->zName))==0 ){
+ /* The sqlite_stat1 tables does not exist. Create it.
+ ** Note that a side-effect of the CREATE TABLE statement is to leave
+ ** the rootpage of the new table on the top of the stack. This is
+ ** important because the OpenWrite opcode below will be needing it. */
+ sqlite3NestedParse(pParse,
+ "CREATE TABLE %Q.sqlite_stat1(tbl,idx,stat)",
+ pDb->zName
+ );
+ iRootPage = 0; /* Cause rootpage to be taken from top of stack */
+ }else if( zWhere ){
+ /* The sqlite_stat1 table exists. Delete all entries associated with
+ ** the table zWhere. */
+ sqlite3NestedParse(pParse,
+ "DELETE FROM %Q.sqlite_stat1 WHERE tbl=%Q",
+ pDb->zName, zWhere
+ );
+ iRootPage = pStat->tnum;
+ }else{
+ /* The sqlite_stat1 table already exists. Delete all rows. */
+ iRootPage = pStat->tnum;
+ sqlite3VdbeAddOp(v, OP_Clear, pStat->tnum, iDb);
+ }
+
+ /* Open the sqlite_stat1 table for writing.
+ */
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
+ sqlite3VdbeAddOp(v, OP_OpenWrite, iStatCur, iRootPage);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iStatCur, 3);
+}
+
+/*
+** Generate code to do an analysis of all indices associated with
+** a single table.
+*/
+static void analyzeOneTable(
+ Parse *pParse, /* Parser context */
+ Table *pTab, /* Table whose indices are to be analyzed */
+ int iStatCur, /* Cursor that writes to the sqlite_stat1 table */
+ int iMem /* Available memory locations begin here */
+){
+ Index *pIdx; /* An index to being analyzed */
+ int iIdxCur; /* Cursor number for index being analyzed */
+ int nCol; /* Number of columns in the index */
+ Vdbe *v; /* The virtual machine being built up */
+ int i; /* Loop counter */
+ int topOfLoop; /* The top of the loop */
+ int endOfLoop; /* The end of the loop */
+ int addr; /* The address of an instruction */
+
+ v = sqlite3GetVdbe(pParse);
+ if( pTab==0 || pTab->pIndex==0 ){
+ /* Do no analysis for tables that have no indices */
+ return;
+ }
+
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0,
+ pParse->db->aDb[pTab->iDb].zName ) ){
+ return;
+ }
+#endif
+
+ iIdxCur = pParse->nTab;
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ /* Open a cursor to the index to be analyzed
+ */
+ sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
+ VdbeComment((v, "# %s", pIdx->zName));
+ sqlite3VdbeOp3(v, OP_OpenRead, iIdxCur, pIdx->tnum,
+ (char*)&pIdx->keyInfo, P3_KEYINFO);
+ nCol = pIdx->nColumn;
+ if( iMem+nCol*2>=pParse->nMem ){
+ pParse->nMem = iMem+nCol*2+1;
+ }
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iIdxCur, nCol+1);
+
+ /* Memory cells are used as follows:
+ **
+ ** mem[iMem]: The total number of rows in the table.
+ ** mem[iMem+1]: Number of distinct values in column 1
+ ** ...
+ ** mem[iMem+nCol]: Number of distinct values in column N
+ ** mem[iMem+nCol+1] Last observed value of column 1
+ ** ...
+ ** mem[iMem+nCol+nCol]: Last observed value of column N
+ **
+ ** Cells iMem through iMem+nCol are initialized to 0. The others
+ ** are initialized to NULL.
+ */
+ for(i=0; i<=nCol; i++){
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, iMem+i);
+ }
+ for(i=0; i<nCol; i++){
+ sqlite3VdbeAddOp(v, OP_MemNull, iMem+nCol+i+1, 0);
+ }
+
+ /* Do the analysis.
+ */
+ endOfLoop = sqlite3VdbeMakeLabel(v);
+ sqlite3VdbeAddOp(v, OP_Rewind, iIdxCur, endOfLoop);
+ topOfLoop = sqlite3VdbeCurrentAddr(v);
+ sqlite3VdbeAddOp(v, OP_MemIncr, iMem, 0);
+ for(i=0; i<nCol; i++){
+ sqlite3VdbeAddOp(v, OP_Column, iIdxCur, i);
+ sqlite3VdbeAddOp(v, OP_MemLoad, iMem+nCol+i+1, 0);
+ sqlite3VdbeAddOp(v, OP_Ne, 0x100, 0);
+ }
+ sqlite3VdbeAddOp(v, OP_Goto, 0, endOfLoop);
+ for(i=0; i<nCol; i++){
+ addr = sqlite3VdbeAddOp(v, OP_MemIncr, iMem+i+1, 0);
+ sqlite3VdbeChangeP2(v, topOfLoop + 3*i + 3, addr);
+ sqlite3VdbeAddOp(v, OP_Column, iIdxCur, i);
+ sqlite3VdbeAddOp(v, OP_MemStore, iMem+nCol+i+1, 1);
+ }
+ sqlite3VdbeResolveLabel(v, endOfLoop);
+ sqlite3VdbeAddOp(v, OP_Next, iIdxCur, topOfLoop);
+ sqlite3VdbeAddOp(v, OP_Close, iIdxCur, 0);
+
+ /* Store the results.
+ **
+ ** The result is a single row of the sqlite_stmt1 table. The first
+ ** two columns are the names of the table and index. The third column
+ ** is a string composed of a list of integer statistics about the
+ ** index. The first integer in the list is the total number of entires
+ ** in the index. There is one additional integer in the list for each
+ ** column of the table. This additional integer is a guess of how many
+ ** rows of the table the index will select. If D is the count of distinct
+ ** values and K is the total number of rows, then the integer is computed
+ ** as:
+ **
+ ** I = (K+D-1)/D
+ **
+ ** If K==0 then no entry is made into the sqlite_stat1 table.
+ ** If K>0 then it is always the case the D>0 so division by zero
+ ** is never possible.
+ */
+ sqlite3VdbeAddOp(v, OP_MemLoad, iMem, 0);
+ addr = sqlite3VdbeAddOp(v, OP_IfNot, 0, 0);
+ sqlite3VdbeAddOp(v, OP_NewRowid, iStatCur, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pIdx->zName, 0);
+ sqlite3VdbeAddOp(v, OP_MemLoad, iMem, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, " ", 0);
+ for(i=0; i<nCol; i++){
+ sqlite3VdbeAddOp(v, OP_MemLoad, iMem, 0);
+ sqlite3VdbeAddOp(v, OP_MemLoad, iMem+i+1, 0);
+ sqlite3VdbeAddOp(v, OP_Add, 0, 0);
+ sqlite3VdbeAddOp(v, OP_AddImm, -1, 0);
+ sqlite3VdbeAddOp(v, OP_MemLoad, iMem+i+1, 0);
+ sqlite3VdbeAddOp(v, OP_Divide, 0, 0);
+ if( i==nCol-1 ){
+ sqlite3VdbeAddOp(v, OP_Concat, nCol*2-1, 0);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Dup, 1, 0);
+ }
+ }
+ sqlite3VdbeOp3(v, OP_MakeRecord, 3, 0, "ttt", 0);
+ sqlite3VdbeAddOp(v, OP_Insert, iStatCur, 0);
+ sqlite3VdbeJumpHere(v, addr);
+ }
+}
+
+/*
+** Generate code that will cause the most recent index analysis to
+** be laoded into internal hash tables where is can be used.
+*/
+static void loadAnalysis(Parse *pParse, int iDb){
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ sqlite3VdbeAddOp(v, OP_LoadAnalysis, iDb, 0);
+}
+
+/*
+** Generate code that will do an analysis of an entire database
+*/
+static void analyzeDatabase(Parse *pParse, int iDb){
+ sqlite3 *db = pParse->db;
+ HashElem *k;
+ int iStatCur;
+ int iMem;
+
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+ iStatCur = pParse->nTab++;
+ openStatTable(pParse, iDb, iStatCur, 0);
+ iMem = pParse->nMem;
+ for(k=sqliteHashFirst(&db->aDb[iDb].tblHash); k; k=sqliteHashNext(k)){
+ Table *pTab = (Table*)sqliteHashData(k);
+ analyzeOneTable(pParse, pTab, iStatCur, iMem);
+ }
+ loadAnalysis(pParse, iDb);
+}
+
+/*
+** Generate code that will do an analysis of a single table in
+** a database.
+*/
+static void analyzeTable(Parse *pParse, Table *pTab){
+ int iDb;
+ int iStatCur;
+
+ assert( pTab!=0 );
+ iDb = pTab->iDb;
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+ iStatCur = pParse->nTab++;
+ openStatTable(pParse, iDb, iStatCur, pTab->zName);
+ analyzeOneTable(pParse, pTab, iStatCur, pParse->nMem);
+ loadAnalysis(pParse, iDb);
+}
+
+/*
+** Generate code for the ANALYZE command. The parser calls this routine
+** when it recognizes an ANALYZE command.
+**
+** ANALYZE -- 1
+** ANALYZE <database> -- 2
+** ANALYZE ?<database>.?<tablename> -- 3
+**
+** Form 1 causes all indices in all attached databases to be analyzed.
+** Form 2 analyzes all indices the single database named.
+** Form 3 analyzes all indices associated with the named table.
+*/
+void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){
+ sqlite3 *db = pParse->db;
+ int iDb;
+ int i;
+ char *z, *zDb;
+ Table *pTab;
+ Token *pTableName;
+
+ /* Read the database schema. If an error occurs, leave an error message
+ ** and code in pParse and return NULL. */
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ return;
+ }
+
+ if( pName1==0 ){
+ /* Form 1: Analyze everything */
+ for(i=0; i<db->nDb; i++){
+ if( i==1 ) continue; /* Do not analyze the TEMP database */
+ analyzeDatabase(pParse, i);
+ }
+ }else if( pName2==0 || pName2->n==0 ){
+ /* Form 2: Analyze the database or table named */
+ iDb = sqlite3FindDb(db, pName1);
+ if( iDb>=0 ){
+ analyzeDatabase(pParse, iDb);
+ }else{
+ z = sqlite3NameFromToken(pName1);
+ pTab = sqlite3LocateTable(pParse, z, 0);
+ sqliteFree(z);
+ if( pTab ){
+ analyzeTable(pParse, pTab);
+ }
+ }
+ }else{
+ /* Form 3: Analyze the fully qualified table name */
+ iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pTableName);
+ if( iDb>=0 ){
+ zDb = db->aDb[iDb].zName;
+ z = sqlite3NameFromToken(pTableName);
+ pTab = sqlite3LocateTable(pParse, z, zDb);
+ sqliteFree(z);
+ if( pTab ){
+ analyzeTable(pParse, pTab);
+ }
+ }
+ }
+}
+
+/*
+** Used to pass information from the analyzer reader through to the
+** callback routine.
+*/
+typedef struct analysisInfo analysisInfo;
+struct analysisInfo {
+ sqlite3 *db;
+ const char *zDatabase;
+};
+
+/*
+** This callback is invoked once for each index when reading the
+** sqlite_stat1 table.
+**
+** argv[0] = name of the index
+** argv[1] = results of analysis - on integer for each column
+*/
+static int analysisLoader(void *pData, int argc, char **argv, char **azNotUsed){
+ analysisInfo *pInfo = (analysisInfo*)pData;
+ Index *pIndex;
+ int i, c;
+ unsigned int v;
+ const char *z;
+
+ assert( argc==2 );
+ if( argv==0 || argv[0]==0 || argv[1]==0 ){
+ return 0;
+ }
+ pIndex = sqlite3FindIndex(pInfo->db, argv[0], pInfo->zDatabase);
+ if( pIndex==0 ){
+ return 0;
+ }
+ z = argv[1];
+ for(i=0; *z && i<=pIndex->nColumn; i++){
+ v = 0;
+ while( (c=z[0])>='0' && c<='9' ){
+ v = v*10 + c - '0';
+ z++;
+ }
+ pIndex->aiRowEst[i] = v;
+ if( *z==' ' ) z++;
+ }
+ return 0;
+}
+
+/*
+** Load the content of the sqlite_stat1 table into the index hash tables.
+*/
+void sqlite3AnalysisLoad(sqlite3 *db, int iDb){
+ analysisInfo sInfo;
+ HashElem *i;
+ char *zSql;
+
+ /* Clear any prior statistics */
+ for(i=sqliteHashFirst(&db->aDb[iDb].idxHash); i; i=sqliteHashNext(i)){
+ Index *pIdx = sqliteHashData(i);
+ sqlite3DefaultRowEst(pIdx);
+ }
+
+ /* Check to make sure the sqlite_stat1 table existss */
+ sInfo.db = db;
+ sInfo.zDatabase = db->aDb[iDb].zName;
+ if( sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)==0 ){
+ return;
+ }
+
+
+ /* Load new statistics out of the sqlite_stat1 table */
+ zSql = sqlite3MPrintf("SELECT idx, stat FROM %Q.sqlite_stat1",
+ sInfo.zDatabase);
+ sqlite3SafetyOff(db);
+ sqlite3_exec(db, zSql, analysisLoader, &sInfo, 0);
+ sqlite3SafetyOn(db);
+ sqliteFree(zSql);
+}
+
+
+#endif /* SQLITE_OMIT_ANALYZE */
diff --git a/ext/pdo_sqlite/sqlite/src/attach.c b/ext/pdo_sqlite/sqlite/src/attach.c
new file mode 100644
index 000000000..46b653e97
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/attach.c
@@ -0,0 +1,352 @@
+/*
+** 2003 April 6
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains code used to implement the ATTACH and DETACH commands.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+
+/*
+** This routine is called by the parser to process an ATTACH statement:
+**
+** ATTACH DATABASE filename AS dbname
+**
+** The pFilename and pDbname arguments are the tokens that define the
+** filename and dbname in the ATTACH statement.
+*/
+void sqlite3Attach(
+ Parse *pParse, /* The parser context */
+ Token *pFilename, /* Name of database file */
+ Token *pDbname, /* Name of the database to use internally */
+ int keyType, /* 0: no key. 1: TEXT, 2: BLOB */
+ Token *pKey /* Text of the key for keytype 1 and 2 */
+){
+ Db *aNew;
+ int rc, i;
+ char *zFile = 0;
+ char *zName = 0;
+ sqlite3 *db;
+ Vdbe *v;
+
+ v = sqlite3GetVdbe(pParse);
+ if( !v ) return;
+ sqlite3VdbeAddOp(v, OP_Expire, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Halt, 0, 0);
+ if( pParse->explain ) return;
+ db = pParse->db;
+ if( db->nDb>=MAX_ATTACHED+2 ){
+ sqlite3ErrorMsg(pParse, "too many attached databases - max %d",
+ MAX_ATTACHED);
+ pParse->rc = SQLITE_ERROR;
+ return;
+ }
+
+ if( !db->autoCommit ){
+ sqlite3ErrorMsg(pParse, "cannot ATTACH database within transaction");
+ pParse->rc = SQLITE_ERROR;
+ return;
+ }
+
+ zFile = sqlite3NameFromToken(pFilename);
+ if( zFile==0 ){
+ goto attach_end;
+ }
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ if( sqlite3AuthCheck(pParse, SQLITE_ATTACH, zFile, 0, 0)!=SQLITE_OK ){
+ goto attach_end;
+ }
+#endif /* SQLITE_OMIT_AUTHORIZATION */
+
+ zName = sqlite3NameFromToken(pDbname);
+ if( zName==0 ){
+ goto attach_end;
+ }
+ for(i=0; i<db->nDb; i++){
+ char *z = db->aDb[i].zName;
+ if( z && sqlite3StrICmp(z, zName)==0 ){
+ sqlite3ErrorMsg(pParse, "database %s is already in use", zName);
+ pParse->rc = SQLITE_ERROR;
+ goto attach_end;
+ }
+ }
+
+ if( db->aDb==db->aDbStatic ){
+ aNew = sqliteMalloc( sizeof(db->aDb[0])*3 );
+ if( aNew==0 ){
+ goto attach_end;
+ }
+ memcpy(aNew, db->aDb, sizeof(db->aDb[0])*2);
+ }else{
+ aNew = sqliteRealloc(db->aDb, sizeof(db->aDb[0])*(db->nDb+1) );
+ if( aNew==0 ){
+ goto attach_end;
+ }
+ }
+ db->aDb = aNew;
+ aNew = &db->aDb[db->nDb++];
+ memset(aNew, 0, sizeof(*aNew));
+ sqlite3HashInit(&aNew->tblHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&aNew->idxHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&aNew->trigHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&aNew->aFKey, SQLITE_HASH_STRING, 1);
+ aNew->zName = zName;
+ zName = 0;
+ aNew->safety_level = 3;
+ rc = sqlite3BtreeFactory(db, zFile, 0, MAX_PAGES, &aNew->pBt);
+ if( rc ){
+ sqlite3ErrorMsg(pParse, "unable to open database: %s", zFile);
+ }
+#if SQLITE_HAS_CODEC
+ {
+ extern int sqlite3CodecAttach(sqlite3*, int, void*, int);
+ char *zKey;
+ int nKey;
+ if( keyType==0 ){
+ /* No key specified. Use the key from the main database */
+ extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
+ sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
+ }else if( keyType==1 ){
+ /* Key specified as text */
+ zKey = sqlite3NameFromToken(pKey);
+ nKey = strlen(zKey);
+ }else{
+ /* Key specified as a BLOB */
+ char *zTemp;
+ assert( keyType==2 );
+ pKey->z++;
+ pKey->n--;
+ zTemp = sqlite3NameFromToken(pKey);
+ zKey = sqlite3HexToBlob(zTemp);
+ sqliteFree(zTemp);
+ }
+ sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
+ if( keyType ){
+ sqliteFree(zKey);
+ }
+ }
+#endif
+ db->flags &= ~SQLITE_Initialized;
+ if( pParse->nErr==0 && rc==SQLITE_OK ){
+ rc = sqlite3ReadSchema(pParse);
+ }
+ if( rc ){
+ int i = db->nDb - 1;
+ assert( i>=2 );
+ if( db->aDb[i].pBt ){
+ sqlite3BtreeClose(db->aDb[i].pBt);
+ db->aDb[i].pBt = 0;
+ }
+ sqlite3ResetInternalSchema(db, 0);
+ assert( pParse->nErr>0 ); /* Always set by sqlite3ReadSchema() */
+ if( pParse->rc==SQLITE_OK ){
+ pParse->rc = SQLITE_ERROR;
+ }
+ }
+
+attach_end:
+ sqliteFree(zFile);
+ sqliteFree(zName);
+}
+
+/*
+** This routine is called by the parser to process a DETACH statement:
+**
+** DETACH DATABASE dbname
+**
+** The pDbname argument is the name of the database in the DETACH statement.
+*/
+void sqlite3Detach(Parse *pParse, Token *pDbname){
+ int i;
+ sqlite3 *db;
+ Vdbe *v;
+ Db *pDb = 0;
+ char *zName;
+
+ v = sqlite3GetVdbe(pParse);
+ if( !v ) return;
+ sqlite3VdbeAddOp(v, OP_Expire, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Halt, 0, 0);
+ if( pParse->explain ) return;
+ db = pParse->db;
+ zName = sqlite3NameFromToken(pDbname);
+ if( zName==0 ) return;
+ for(i=0; i<db->nDb; i++){
+ pDb = &db->aDb[i];
+ if( pDb->pBt==0 ) continue;
+ if( sqlite3StrICmp(pDb->zName, zName)==0 ) break;
+ }
+ if( i>=db->nDb ){
+ sqlite3ErrorMsg(pParse, "no such database: %z", zName);
+ return;
+ }
+ if( i<2 ){
+ sqlite3ErrorMsg(pParse, "cannot detach database %z", zName);
+ return;
+ }
+ sqliteFree(zName);
+ if( !db->autoCommit ){
+ sqlite3ErrorMsg(pParse, "cannot DETACH database within transaction");
+ pParse->rc = SQLITE_ERROR;
+ return;
+ }
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ if( sqlite3AuthCheck(pParse,SQLITE_DETACH,db->aDb[i].zName,0,0)!=SQLITE_OK ){
+ return;
+ }
+#endif /* SQLITE_OMIT_AUTHORIZATION */
+ sqlite3BtreeClose(pDb->pBt);
+ pDb->pBt = 0;
+ sqlite3ResetInternalSchema(db, 0);
+}
+
+/*
+** Initialize a DbFixer structure. This routine must be called prior
+** to passing the structure to one of the sqliteFixAAAA() routines below.
+**
+** The return value indicates whether or not fixation is required. TRUE
+** means we do need to fix the database references, FALSE means we do not.
+*/
+int sqlite3FixInit(
+ DbFixer *pFix, /* The fixer to be initialized */
+ Parse *pParse, /* Error messages will be written here */
+ int iDb, /* This is the database that must be used */
+ const char *zType, /* "view", "trigger", or "index" */
+ const Token *pName /* Name of the view, trigger, or index */
+){
+ sqlite3 *db;
+
+ if( iDb<0 || iDb==1 ) return 0;
+ db = pParse->db;
+ assert( db->nDb>iDb );
+ pFix->pParse = pParse;
+ pFix->zDb = db->aDb[iDb].zName;
+ pFix->zType = zType;
+ pFix->pName = pName;
+ return 1;
+}
+
+/*
+** The following set of routines walk through the parse tree and assign
+** a specific database to all table references where the database name
+** was left unspecified in the original SQL statement. The pFix structure
+** must have been initialized by a prior call to sqlite3FixInit().
+**
+** These routines are used to make sure that an index, trigger, or
+** view in one database does not refer to objects in a different database.
+** (Exception: indices, triggers, and views in the TEMP database are
+** allowed to refer to anything.) If a reference is explicitly made
+** to an object in a different database, an error message is added to
+** pParse->zErrMsg and these routines return non-zero. If everything
+** checks out, these routines return 0.
+*/
+int sqlite3FixSrcList(
+ DbFixer *pFix, /* Context of the fixation */
+ SrcList *pList /* The Source list to check and modify */
+){
+ int i;
+ const char *zDb;
+ struct SrcList_item *pItem;
+
+ if( pList==0 ) return 0;
+ zDb = pFix->zDb;
+ for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
+ if( pItem->zDatabase==0 ){
+ pItem->zDatabase = sqliteStrDup(zDb);
+ }else if( sqlite3StrICmp(pItem->zDatabase,zDb)!=0 ){
+ sqlite3ErrorMsg(pFix->pParse,
+ "%s %T cannot reference objects in database %s",
+ pFix->zType, pFix->pName, pItem->zDatabase);
+ return 1;
+ }
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER)
+ if( sqlite3FixSelect(pFix, pItem->pSelect) ) return 1;
+ if( sqlite3FixExpr(pFix, pItem->pOn) ) return 1;
+#endif
+ }
+ return 0;
+}
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER)
+int sqlite3FixSelect(
+ DbFixer *pFix, /* Context of the fixation */
+ Select *pSelect /* The SELECT statement to be fixed to one database */
+){
+ while( pSelect ){
+ if( sqlite3FixExprList(pFix, pSelect->pEList) ){
+ return 1;
+ }
+ if( sqlite3FixSrcList(pFix, pSelect->pSrc) ){
+ return 1;
+ }
+ if( sqlite3FixExpr(pFix, pSelect->pWhere) ){
+ return 1;
+ }
+ if( sqlite3FixExpr(pFix, pSelect->pHaving) ){
+ return 1;
+ }
+ pSelect = pSelect->pPrior;
+ }
+ return 0;
+}
+int sqlite3FixExpr(
+ DbFixer *pFix, /* Context of the fixation */
+ Expr *pExpr /* The expression to be fixed to one database */
+){
+ while( pExpr ){
+ if( sqlite3FixSelect(pFix, pExpr->pSelect) ){
+ return 1;
+ }
+ if( sqlite3FixExprList(pFix, pExpr->pList) ){
+ return 1;
+ }
+ if( sqlite3FixExpr(pFix, pExpr->pRight) ){
+ return 1;
+ }
+ pExpr = pExpr->pLeft;
+ }
+ return 0;
+}
+int sqlite3FixExprList(
+ DbFixer *pFix, /* Context of the fixation */
+ ExprList *pList /* The expression to be fixed to one database */
+){
+ int i;
+ struct ExprList_item *pItem;
+ if( pList==0 ) return 0;
+ for(i=0, pItem=pList->a; i<pList->nExpr; i++, pItem++){
+ if( sqlite3FixExpr(pFix, pItem->pExpr) ){
+ return 1;
+ }
+ }
+ return 0;
+}
+#endif
+
+#ifndef SQLITE_OMIT_TRIGGER
+int sqlite3FixTriggerStep(
+ DbFixer *pFix, /* Context of the fixation */
+ TriggerStep *pStep /* The trigger step be fixed to one database */
+){
+ while( pStep ){
+ if( sqlite3FixSelect(pFix, pStep->pSelect) ){
+ return 1;
+ }
+ if( sqlite3FixExpr(pFix, pStep->pWhere) ){
+ return 1;
+ }
+ if( sqlite3FixExprList(pFix, pStep->pExprList) ){
+ return 1;
+ }
+ pStep = pStep->pNext;
+ }
+ return 0;
+}
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/auth.c b/ext/pdo_sqlite/sqlite/src/auth.c
new file mode 100644
index 000000000..693baa2c8
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/auth.c
@@ -0,0 +1,225 @@
+/*
+** 2003 January 11
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains code used to implement the sqlite3_set_authorizer()
+** API. This facility is an optional feature of the library. Embedded
+** systems that do not need this facility may omit it by recompiling
+** the library with -DSQLITE_OMIT_AUTHORIZATION=1
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+
+/*
+** All of the code in this file may be omitted by defining a single
+** macro.
+*/
+#ifndef SQLITE_OMIT_AUTHORIZATION
+
+/*
+** Set or clear the access authorization function.
+**
+** The access authorization function is be called during the compilation
+** phase to verify that the user has read and/or write access permission on
+** various fields of the database. The first argument to the auth function
+** is a copy of the 3rd argument to this routine. The second argument
+** to the auth function is one of these constants:
+**
+** SQLITE_CREATE_INDEX
+** SQLITE_CREATE_TABLE
+** SQLITE_CREATE_TEMP_INDEX
+** SQLITE_CREATE_TEMP_TABLE
+** SQLITE_CREATE_TEMP_TRIGGER
+** SQLITE_CREATE_TEMP_VIEW
+** SQLITE_CREATE_TRIGGER
+** SQLITE_CREATE_VIEW
+** SQLITE_DELETE
+** SQLITE_DROP_INDEX
+** SQLITE_DROP_TABLE
+** SQLITE_DROP_TEMP_INDEX
+** SQLITE_DROP_TEMP_TABLE
+** SQLITE_DROP_TEMP_TRIGGER
+** SQLITE_DROP_TEMP_VIEW
+** SQLITE_DROP_TRIGGER
+** SQLITE_DROP_VIEW
+** SQLITE_INSERT
+** SQLITE_PRAGMA
+** SQLITE_READ
+** SQLITE_SELECT
+** SQLITE_TRANSACTION
+** SQLITE_UPDATE
+**
+** The third and fourth arguments to the auth function are the name of
+** the table and the column that are being accessed. The auth function
+** should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE. If
+** SQLITE_OK is returned, it means that access is allowed. SQLITE_DENY
+** means that the SQL statement will never-run - the sqlite3_exec() call
+** will return with an error. SQLITE_IGNORE means that the SQL statement
+** should run but attempts to read the specified column will return NULL
+** and attempts to write the column will be ignored.
+**
+** Setting the auth function to NULL disables this hook. The default
+** setting of the auth function is NULL.
+*/
+int sqlite3_set_authorizer(
+ sqlite3 *db,
+ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
+ void *pArg
+){
+ db->xAuth = xAuth;
+ db->pAuthArg = pArg;
+ sqlite3ExpirePreparedStatements(db);
+ return SQLITE_OK;
+}
+
+/*
+** Write an error message into pParse->zErrMsg that explains that the
+** user-supplied authorization function returned an illegal value.
+*/
+static void sqliteAuthBadReturnCode(Parse *pParse, int rc){
+ sqlite3ErrorMsg(pParse, "illegal return value (%d) from the "
+ "authorization function - should be SQLITE_OK, SQLITE_IGNORE, "
+ "or SQLITE_DENY", rc);
+ pParse->rc = SQLITE_ERROR;
+}
+
+/*
+** The pExpr should be a TK_COLUMN expression. The table referred to
+** is in pTabList or else it is the NEW or OLD table of a trigger.
+** Check to see if it is OK to read this particular column.
+**
+** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN
+** instruction into a TK_NULL. If the auth function returns SQLITE_DENY,
+** then generate an error.
+*/
+void sqlite3AuthRead(
+ Parse *pParse, /* The parser context */
+ Expr *pExpr, /* The expression to check authorization on */
+ SrcList *pTabList /* All table that pExpr might refer to */
+){
+ sqlite3 *db = pParse->db;
+ int rc;
+ Table *pTab; /* The table being read */
+ const char *zCol; /* Name of the column of the table */
+ int iSrc; /* Index in pTabList->a[] of table being read */
+ const char *zDBase; /* Name of database being accessed */
+ TriggerStack *pStack; /* The stack of current triggers */
+
+ if( db->xAuth==0 ) return;
+ if( pExpr->op==TK_AS ) return;
+ assert( pExpr->op==TK_COLUMN );
+ for(iSrc=0; pTabList && iSrc<pTabList->nSrc; iSrc++){
+ if( pExpr->iTable==pTabList->a[iSrc].iCursor ) break;
+ }
+ if( iSrc>=0 && pTabList && iSrc<pTabList->nSrc ){
+ pTab = pTabList->a[iSrc].pTab;
+ }else if( (pStack = pParse->trigStack)!=0 ){
+ /* This must be an attempt to read the NEW or OLD pseudo-tables
+ ** of a trigger.
+ */
+ assert( pExpr->iTable==pStack->newIdx || pExpr->iTable==pStack->oldIdx );
+ pTab = pStack->pTab;
+ }else{
+ return;
+ }
+ if( pTab==0 ) return;
+ if( pExpr->iColumn>=0 ){
+ assert( pExpr->iColumn<pTab->nCol );
+ zCol = pTab->aCol[pExpr->iColumn].zName;
+ }else if( pTab->iPKey>=0 ){
+ assert( pTab->iPKey<pTab->nCol );
+ zCol = pTab->aCol[pTab->iPKey].zName;
+ }else{
+ zCol = "ROWID";
+ }
+ assert( pExpr->iDb<db->nDb );
+ zDBase = db->aDb[pExpr->iDb].zName;
+ rc = db->xAuth(db->pAuthArg, SQLITE_READ, pTab->zName, zCol, zDBase,
+ pParse->zAuthContext);
+ if( rc==SQLITE_IGNORE ){
+ pExpr->op = TK_NULL;
+ }else if( rc==SQLITE_DENY ){
+ if( db->nDb>2 || pExpr->iDb!=0 ){
+ sqlite3ErrorMsg(pParse, "access to %s.%s.%s is prohibited",
+ zDBase, pTab->zName, zCol);
+ }else{
+ sqlite3ErrorMsg(pParse, "access to %s.%s is prohibited",pTab->zName,zCol);
+ }
+ pParse->rc = SQLITE_AUTH;
+ }else if( rc!=SQLITE_OK ){
+ sqliteAuthBadReturnCode(pParse, rc);
+ }
+}
+
+/*
+** Do an authorization check using the code and arguments given. Return
+** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY
+** is returned, then the error count and error message in pParse are
+** modified appropriately.
+*/
+int sqlite3AuthCheck(
+ Parse *pParse,
+ int code,
+ const char *zArg1,
+ const char *zArg2,
+ const char *zArg3
+){
+ sqlite3 *db = pParse->db;
+ int rc;
+
+ /* Don't do any authorization checks if the database is initialising. */
+ if( db->init.busy ){
+ return SQLITE_OK;
+ }
+
+ if( db->xAuth==0 ){
+ return SQLITE_OK;
+ }
+ rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext);
+ if( rc==SQLITE_DENY ){
+ sqlite3ErrorMsg(pParse, "not authorized");
+ pParse->rc = SQLITE_AUTH;
+ }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
+ rc = SQLITE_DENY;
+ sqliteAuthBadReturnCode(pParse, rc);
+ }
+ return rc;
+}
+
+/*
+** Push an authorization context. After this routine is called, the
+** zArg3 argument to authorization callbacks will be zContext until
+** popped. Or if pParse==0, this routine is a no-op.
+*/
+void sqlite3AuthContextPush(
+ Parse *pParse,
+ AuthContext *pContext,
+ const char *zContext
+){
+ pContext->pParse = pParse;
+ if( pParse ){
+ pContext->zAuthContext = pParse->zAuthContext;
+ pParse->zAuthContext = zContext;
+ }
+}
+
+/*
+** Pop an authorization context that was previously pushed
+** by sqlite3AuthContextPush
+*/
+void sqlite3AuthContextPop(AuthContext *pContext){
+ if( pContext->pParse ){
+ pContext->pParse->zAuthContext = pContext->zAuthContext;
+ pContext->pParse = 0;
+ }
+}
+
+#endif /* SQLITE_OMIT_AUTHORIZATION */
diff --git a/ext/pdo_sqlite/sqlite/src/btree.c b/ext/pdo_sqlite/sqlite/src/btree.c
new file mode 100644
index 000000000..f1ef6a2a4
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/btree.c
@@ -0,0 +1,5833 @@
+/*
+** 2004 April 6
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** $Id$
+**
+** This file implements a external (disk-based) database using BTrees.
+** For a detailed discussion of BTrees, refer to
+**
+** Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3:
+** "Sorting And Searching", pages 473-480. Addison-Wesley
+** Publishing Company, Reading, Massachusetts.
+**
+** The basic idea is that each page of the file contains N database
+** entries and N+1 pointers to subpages.
+**
+** ----------------------------------------------------------------
+** | Ptr(0) | Key(0) | Ptr(1) | Key(1) | ... | Key(N) | Ptr(N+1) |
+** ----------------------------------------------------------------
+**
+** All of the keys on the page that Ptr(0) points to have values less
+** than Key(0). All of the keys on page Ptr(1) and its subpages have
+** values greater than Key(0) and less than Key(1). All of the keys
+** on Ptr(N+1) and its subpages have values greater than Key(N). And
+** so forth.
+**
+** Finding a particular key requires reading O(log(M)) pages from the
+** disk where M is the number of entries in the tree.
+**
+** In this implementation, a single file can hold one or more separate
+** BTrees. Each BTree is identified by the index of its root page. The
+** key and data for any entry are combined to form the "payload". A
+** fixed amount of payload can be carried directly on the database
+** page. If the payload is larger than the preset amount then surplus
+** bytes are stored on overflow pages. The payload for an entry
+** and the preceding pointer are combined to form a "Cell". Each
+** page has a small header which contains the Ptr(N+1) pointer and other
+** information such as the size of key and data.
+**
+** FORMAT DETAILS
+**
+** The file is divided into pages. The first page is called page 1,
+** the second is page 2, and so forth. A page number of zero indicates
+** "no such page". The page size can be anything between 512 and 65536.
+** Each page can be either a btree page, a freelist page or an overflow
+** page.
+**
+** The first page is always a btree page. The first 100 bytes of the first
+** page contain a special header (the "file header") that describes the file.
+** The format of the file header is as follows:
+**
+** OFFSET SIZE DESCRIPTION
+** 0 16 Header string: "SQLite format 3\000"
+** 16 2 Page size in bytes.
+** 18 1 File format write version
+** 19 1 File format read version
+** 20 1 Bytes of unused space at the end of each page
+** 21 1 Max embedded payload fraction
+** 22 1 Min embedded payload fraction
+** 23 1 Min leaf payload fraction
+** 24 4 File change counter
+** 28 4 Reserved for future use
+** 32 4 First freelist page
+** 36 4 Number of freelist pages in the file
+** 40 60 15 4-byte meta values passed to higher layers
+**
+** All of the integer values are big-endian (most significant byte first).
+**
+** The file change counter is incremented when the database is changed more
+** than once within the same second. This counter, together with the
+** modification time of the file, allows other processes to know
+** when the file has changed and thus when they need to flush their
+** cache.
+**
+** The max embedded payload fraction is the amount of the total usable
+** space in a page that can be consumed by a single cell for standard
+** B-tree (non-LEAFDATA) tables. A value of 255 means 100%. The default
+** is to limit the maximum cell size so that at least 4 cells will fit
+** on one page. Thus the default max embedded payload fraction is 64.
+**
+** If the payload for a cell is larger than the max payload, then extra
+** payload is spilled to overflow pages. Once an overflow page is allocated,
+** as many bytes as possible are moved into the overflow pages without letting
+** the cell size drop below the min embedded payload fraction.
+**
+** The min leaf payload fraction is like the min embedded payload fraction
+** except that it applies to leaf nodes in a LEAFDATA tree. The maximum
+** payload fraction for a LEAFDATA tree is always 100% (or 255) and it
+** not specified in the header.
+**
+** Each btree pages is divided into three sections: The header, the
+** cell pointer array, and the cell area area. Page 1 also has a 100-byte
+** file header that occurs before the page header.
+**
+** |----------------|
+** | file header | 100 bytes. Page 1 only.
+** |----------------|
+** | page header | 8 bytes for leaves. 12 bytes for interior nodes
+** |----------------|
+** | cell pointer | | 2 bytes per cell. Sorted order.
+** | array | | Grows downward
+** | | v
+** |----------------|
+** | unallocated |
+** | space |
+** |----------------| ^ Grows upwards
+** | cell content | | Arbitrary order interspersed with freeblocks.
+** | area | | and free space fragments.
+** |----------------|
+**
+** The page headers looks like this:
+**
+** OFFSET SIZE DESCRIPTION
+** 0 1 Flags. 1: intkey, 2: zerodata, 4: leafdata, 8: leaf
+** 1 2 byte offset to the first freeblock
+** 3 2 number of cells on this page
+** 5 2 first byte of the cell content area
+** 7 1 number of fragmented free bytes
+** 8 4 Right child (the Ptr(N+1) value). Omitted on leaves.
+**
+** The flags define the format of this btree page. The leaf flag means that
+** this page has no children. The zerodata flag means that this page carries
+** only keys and no data. The intkey flag means that the key is a integer
+** which is stored in the key size entry of the cell header rather than in
+** the payload area.
+**
+** The cell pointer array begins on the first byte after the page header.
+** The cell pointer array contains zero or more 2-byte numbers which are
+** offsets from the beginning of the page to the cell content in the cell
+** content area. The cell pointers occur in sorted order. The system strives
+** to keep free space after the last cell pointer so that new cells can
+** be easily added without having to defragment the page.
+**
+** Cell content is stored at the very end of the page and grows toward the
+** beginning of the page.
+**
+** Unused space within the cell content area is collected into a linked list of
+** freeblocks. Each freeblock is at least 4 bytes in size. The byte offset
+** to the first freeblock is given in the header. Freeblocks occur in
+** increasing order. Because a freeblock must be at least 4 bytes in size,
+** any group of 3 or fewer unused bytes in the cell content area cannot
+** exist on the freeblock chain. A group of 3 or fewer free bytes is called
+** a fragment. The total number of bytes in all fragments is recorded.
+** in the page header at offset 7.
+**
+** SIZE DESCRIPTION
+** 2 Byte offset of the next freeblock
+** 2 Bytes in this freeblock
+**
+** Cells are of variable length. Cells are stored in the cell content area at
+** the end of the page. Pointers to the cells are in the cell pointer array
+** that immediately follows the page header. Cells is not necessarily
+** contiguous or in order, but cell pointers are contiguous and in order.
+**
+** Cell content makes use of variable length integers. A variable
+** length integer is 1 to 9 bytes where the lower 7 bits of each
+** byte are used. The integer consists of all bytes that have bit 8 set and
+** the first byte with bit 8 clear. The most significant byte of the integer
+** appears first. A variable-length integer may not be more than 9 bytes long.
+** As a special case, all 8 bytes of the 9th byte are used as data. This
+** allows a 64-bit integer to be encoded in 9 bytes.
+**
+** 0x00 becomes 0x00000000
+** 0x7f becomes 0x0000007f
+** 0x81 0x00 becomes 0x00000080
+** 0x82 0x00 becomes 0x00000100
+** 0x80 0x7f becomes 0x0000007f
+** 0x8a 0x91 0xd1 0xac 0x78 becomes 0x12345678
+** 0x81 0x81 0x81 0x81 0x01 becomes 0x10204081
+**
+** Variable length integers are used for rowids and to hold the number of
+** bytes of key and data in a btree cell.
+**
+** The content of a cell looks like this:
+**
+** SIZE DESCRIPTION
+** 4 Page number of the left child. Omitted if leaf flag is set.
+** var Number of bytes of data. Omitted if the zerodata flag is set.
+** var Number of bytes of key. Or the key itself if intkey flag is set.
+** * Payload
+** 4 First page of the overflow chain. Omitted if no overflow
+**
+** Overflow pages form a linked list. Each page except the last is completely
+** filled with data (pagesize - 4 bytes). The last page can have as little
+** as 1 byte of data.
+**
+** SIZE DESCRIPTION
+** 4 Page number of next overflow page
+** * Data
+**
+** Freelist pages come in two subtypes: trunk pages and leaf pages. The
+** file header points to first in a linked list of trunk page. Each trunk
+** page points to multiple leaf pages. The content of a leaf page is
+** unspecified. A trunk page looks like this:
+**
+** SIZE DESCRIPTION
+** 4 Page number of next trunk page
+** 4 Number of leaf pointers on this page
+** * zero or more pages numbers of leaves
+*/
+#include "sqliteInt.h"
+#include "pager.h"
+#include "btree.h"
+#include "os.h"
+#include <assert.h>
+
+/* Round up a number to the next larger multiple of 8. This is used
+** to force 8-byte alignment on 64-bit architectures.
+*/
+#define ROUND8(x) ((x+7)&~7)
+
+
+/* The following value is the maximum cell size assuming a maximum page
+** size give above.
+*/
+#define MX_CELL_SIZE(pBt) (pBt->pageSize-8)
+
+/* The maximum number of cells on a single page of the database. This
+** assumes a minimum cell size of 3 bytes. Such small cells will be
+** exceedingly rare, but they are possible.
+*/
+#define MX_CELL(pBt) ((pBt->pageSize-8)/3)
+
+/* Forward declarations */
+typedef struct MemPage MemPage;
+
+/*
+** This is a magic string that appears at the beginning of every
+** SQLite database in order to identify the file as a real database.
+**
+** You can change this value at compile-time by specifying a
+** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The
+** header must be exactly 16 bytes including the zero-terminator so
+** the string itself should be 15 characters long. If you change
+** the header, then your custom library will not be able to read
+** databases generated by the standard tools and the standard tools
+** will not be able to read databases created by your custom library.
+*/
+#ifndef SQLITE_FILE_HEADER /* 123456789 123456 */
+# define SQLITE_FILE_HEADER "SQLite format 3"
+#endif
+static const char zMagicHeader[] = SQLITE_FILE_HEADER;
+
+/*
+** Page type flags. An ORed combination of these flags appear as the
+** first byte of every BTree page.
+*/
+#define PTF_INTKEY 0x01
+#define PTF_ZERODATA 0x02
+#define PTF_LEAFDATA 0x04
+#define PTF_LEAF 0x08
+
+/*
+** As each page of the file is loaded into memory, an instance of the following
+** structure is appended and initialized to zero. This structure stores
+** information about the page that is decoded from the raw file page.
+**
+** The pParent field points back to the parent page. This allows us to
+** walk up the BTree from any leaf to the root. Care must be taken to
+** unref() the parent page pointer when this page is no longer referenced.
+** The pageDestructor() routine handles that chore.
+*/
+struct MemPage {
+ u8 isInit; /* True if previously initialized. MUST BE FIRST! */
+ u8 idxShift; /* True if Cell indices have changed */
+ u8 nOverflow; /* Number of overflow cell bodies in aCell[] */
+ u8 intKey; /* True if intkey flag is set */
+ u8 leaf; /* True if leaf flag is set */
+ u8 zeroData; /* True if table stores keys only */
+ u8 leafData; /* True if tables stores data on leaves only */
+ u8 hasData; /* True if this page stores data */
+ u8 hdrOffset; /* 100 for page 1. 0 otherwise */
+ u8 childPtrSize; /* 0 if leaf==1. 4 if leaf==0 */
+ u16 maxLocal; /* Copy of Btree.maxLocal or Btree.maxLeaf */
+ u16 minLocal; /* Copy of Btree.minLocal or Btree.minLeaf */
+ u16 cellOffset; /* Index in aData of first cell pointer */
+ u16 idxParent; /* Index in parent of this node */
+ u16 nFree; /* Number of free bytes on the page */
+ u16 nCell; /* Number of cells on this page, local and ovfl */
+ struct _OvflCell { /* Cells that will not fit on aData[] */
+ u8 *pCell; /* Pointers to the body of the overflow cell */
+ u16 idx; /* Insert this cell before idx-th non-overflow cell */
+ } aOvfl[5];
+ struct Btree *pBt; /* Pointer back to BTree structure */
+ u8 *aData; /* Pointer back to the start of the page */
+ Pgno pgno; /* Page number for this page */
+ MemPage *pParent; /* The parent of this page. NULL for root */
+};
+
+/*
+** The in-memory image of a disk page has the auxiliary information appended
+** to the end. EXTRA_SIZE is the number of bytes of space needed to hold
+** that extra information.
+*/
+#define EXTRA_SIZE sizeof(MemPage)
+
+/*
+** Everything we need to know about an open database
+*/
+struct Btree {
+ Pager *pPager; /* The page cache */
+ BtCursor *pCursor; /* A list of all open cursors */
+ MemPage *pPage1; /* First page of the database */
+ u8 inTrans; /* True if a transaction is in progress */
+ u8 inStmt; /* True if we are in a statement subtransaction */
+ u8 readOnly; /* True if the underlying file is readonly */
+ u8 maxEmbedFrac; /* Maximum payload as % of total page size */
+ u8 minEmbedFrac; /* Minimum payload as % of total page size */
+ u8 minLeafFrac; /* Minimum leaf payload as % of total page size */
+ u8 pageSizeFixed; /* True if the page size can no longer be changed */
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ u8 autoVacuum; /* True if database supports auto-vacuum */
+#endif
+ u16 pageSize; /* Total number of bytes on a page */
+ u16 usableSize; /* Number of usable bytes on each page */
+ int maxLocal; /* Maximum local payload in non-LEAFDATA tables */
+ int minLocal; /* Minimum local payload in non-LEAFDATA tables */
+ int maxLeaf; /* Maximum local payload in a LEAFDATA table */
+ int minLeaf; /* Minimum local payload in a LEAFDATA table */
+ BusyHandler *pBusyHandler; /* Callback for when there is lock contention */
+};
+typedef Btree Bt;
+
+/*
+** Btree.inTrans may take one of the following values.
+*/
+#define TRANS_NONE 0
+#define TRANS_READ 1
+#define TRANS_WRITE 2
+
+/*
+** An instance of the following structure is used to hold information
+** about a cell. The parseCellPtr() function fills in this structure
+** based on information extract from the raw disk page.
+*/
+typedef struct CellInfo CellInfo;
+struct CellInfo {
+ u8 *pCell; /* Pointer to the start of cell content */
+ i64 nKey; /* The key for INTKEY tables, or number of bytes in key */
+ u32 nData; /* Number of bytes of data */
+ u16 nHeader; /* Size of the cell content header in bytes */
+ u16 nLocal; /* Amount of payload held locally */
+ u16 iOverflow; /* Offset to overflow page number. Zero if no overflow */
+ u16 nSize; /* Size of the cell content on the main b-tree page */
+};
+
+/*
+** A cursor is a pointer to a particular entry in the BTree.
+** The entry is identified by its MemPage and the index in
+** MemPage.aCell[] of the entry.
+*/
+struct BtCursor {
+ Btree *pBt; /* The Btree to which this cursor belongs */
+ BtCursor *pNext, *pPrev; /* Forms a linked list of all cursors */
+ int (*xCompare)(void*,int,const void*,int,const void*); /* Key comp func */
+ void *pArg; /* First arg to xCompare() */
+ Pgno pgnoRoot; /* The root page of this tree */
+ MemPage *pPage; /* Page that contains the entry */
+ int idx; /* Index of the entry in pPage->aCell[] */
+ CellInfo info; /* A parse of the cell we are pointing at */
+ u8 wrFlag; /* True if writable */
+ u8 isValid; /* TRUE if points to a valid entry */
+};
+
+/*
+** The TRACE macro will print high-level status information about the
+** btree operation when the global variable sqlite3_btree_trace is
+** enabled.
+*/
+#if SQLITE_TEST
+# define TRACE(X) if( sqlite3_btree_trace )\
+ { sqlite3DebugPrintf X; fflush(stdout); }
+#else
+# define TRACE(X)
+#endif
+int sqlite3_btree_trace=0; /* True to enable tracing */
+
+/*
+** Forward declaration
+*/
+static int checkReadLocks(Btree*,Pgno,BtCursor*);
+
+/*
+** Read or write a two- and four-byte big-endian integer values.
+*/
+static u32 get2byte(unsigned char *p){
+ return (p[0]<<8) | p[1];
+}
+static u32 get4byte(unsigned char *p){
+ return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
+}
+static void put2byte(unsigned char *p, u32 v){
+ p[0] = v>>8;
+ p[1] = v;
+}
+static void put4byte(unsigned char *p, u32 v){
+ p[0] = v>>24;
+ p[1] = v>>16;
+ p[2] = v>>8;
+ p[3] = v;
+}
+
+/*
+** Routines to read and write variable-length integers. These used to
+** be defined locally, but now we use the varint routines in the util.c
+** file.
+*/
+#define getVarint sqlite3GetVarint
+#define getVarint32 sqlite3GetVarint32
+#define putVarint sqlite3PutVarint
+
+/* The database page the PENDING_BYTE occupies. This page is never used.
+** TODO: This macro is very similary to PAGER_MJ_PGNO() in pager.c. They
+** should possibly be consolidated (presumably in pager.h).
+*/
+#define PENDING_BYTE_PAGE(pBt) ((PENDING_BYTE/(pBt)->pageSize)+1)
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+/*
+** These macros define the location of the pointer-map entry for a
+** database page. The first argument to each is the number of usable
+** bytes on each page of the database (often 1024). The second is the
+** page number to look up in the pointer map.
+**
+** PTRMAP_PAGENO returns the database page number of the pointer-map
+** page that stores the required pointer. PTRMAP_PTROFFSET returns
+** the offset of the requested map entry.
+**
+** If the pgno argument passed to PTRMAP_PAGENO is a pointer-map page,
+** then pgno is returned. So (pgno==PTRMAP_PAGENO(pgsz, pgno)) can be
+** used to test if pgno is a pointer-map page. PTRMAP_ISPAGE implements
+** this test.
+*/
+#define PTRMAP_PAGENO(pgsz, pgno) (((pgno-2)/(pgsz/5+1))*(pgsz/5+1)+2)
+#define PTRMAP_PTROFFSET(pgsz, pgno) (((pgno-2)%(pgsz/5+1)-1)*5)
+#define PTRMAP_ISPAGE(pgsz, pgno) (PTRMAP_PAGENO(pgsz,pgno)==pgno)
+
+/*
+** The pointer map is a lookup table that identifies the parent page for
+** each child page in the database file. The parent page is the page that
+** contains a pointer to the child. Every page in the database contains
+** 0 or 1 parent pages. (In this context 'database page' refers
+** to any page that is not part of the pointer map itself.) Each pointer map
+** entry consists of a single byte 'type' and a 4 byte parent page number.
+** The PTRMAP_XXX identifiers below are the valid types.
+**
+** The purpose of the pointer map is to facility moving pages from one
+** position in the file to another as part of autovacuum. When a page
+** is moved, the pointer in its parent must be updated to point to the
+** new location. The pointer map is used to locate the parent page quickly.
+**
+** PTRMAP_ROOTPAGE: The database page is a root-page. The page-number is not
+** used in this case.
+**
+** PTRMAP_FREEPAGE: The database page is an unused (free) page. The page-number
+** is not used in this case.
+**
+** PTRMAP_OVERFLOW1: The database page is the first page in a list of
+** overflow pages. The page number identifies the page that
+** contains the cell with a pointer to this overflow page.
+**
+** PTRMAP_OVERFLOW2: The database page is the second or later page in a list of
+** overflow pages. The page-number identifies the previous
+** page in the overflow page list.
+**
+** PTRMAP_BTREE: The database page is a non-root btree page. The page number
+** identifies the parent page in the btree.
+*/
+#define PTRMAP_ROOTPAGE 1
+#define PTRMAP_FREEPAGE 2
+#define PTRMAP_OVERFLOW1 3
+#define PTRMAP_OVERFLOW2 4
+#define PTRMAP_BTREE 5
+
+/*
+** Write an entry into the pointer map.
+**
+** This routine updates the pointer map entry for page number 'key'
+** so that it maps to type 'eType' and parent page number 'pgno'.
+** An error code is returned if something goes wrong, otherwise SQLITE_OK.
+*/
+static int ptrmapPut(Btree *pBt, Pgno key, u8 eType, Pgno parent){
+ u8 *pPtrmap; /* The pointer map page */
+ Pgno iPtrmap; /* The pointer map page number */
+ int offset; /* Offset in pointer map page */
+ int rc;
+
+ assert( pBt->autoVacuum );
+ if( key==0 ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ iPtrmap = PTRMAP_PAGENO(pBt->usableSize, key);
+ rc = sqlite3pager_get(pBt->pPager, iPtrmap, (void **)&pPtrmap);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ offset = PTRMAP_PTROFFSET(pBt->usableSize, key);
+
+ if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){
+ TRACE(("PTRMAP_UPDATE: %d->(%d,%d)\n", key, eType, parent));
+ rc = sqlite3pager_write(pPtrmap);
+ if( rc==SQLITE_OK ){
+ pPtrmap[offset] = eType;
+ put4byte(&pPtrmap[offset+1], parent);
+ }
+ }
+
+ sqlite3pager_unref(pPtrmap);
+ return rc;
+}
+
+/*
+** Read an entry from the pointer map.
+**
+** This routine retrieves the pointer map entry for page 'key', writing
+** the type and parent page number to *pEType and *pPgno respectively.
+** An error code is returned if something goes wrong, otherwise SQLITE_OK.
+*/
+static int ptrmapGet(Btree *pBt, Pgno key, u8 *pEType, Pgno *pPgno){
+ int iPtrmap; /* Pointer map page index */
+ u8 *pPtrmap; /* Pointer map page data */
+ int offset; /* Offset of entry in pointer map */
+ int rc;
+
+ iPtrmap = PTRMAP_PAGENO(pBt->usableSize, key);
+ rc = sqlite3pager_get(pBt->pPager, iPtrmap, (void **)&pPtrmap);
+ if( rc!=0 ){
+ return rc;
+ }
+
+ offset = PTRMAP_PTROFFSET(pBt->usableSize, key);
+ if( pEType ) *pEType = pPtrmap[offset];
+ if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]);
+
+ sqlite3pager_unref(pPtrmap);
+ if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_BKPT;
+ return SQLITE_OK;
+}
+
+#endif /* SQLITE_OMIT_AUTOVACUUM */
+
+/*
+** Given a btree page and a cell index (0 means the first cell on
+** the page, 1 means the second cell, and so forth) return a pointer
+** to the cell content.
+**
+** This routine works only for pages that do not contain overflow cells.
+*/
+static u8 *findCell(MemPage *pPage, int iCell){
+ u8 *data = pPage->aData;
+ assert( iCell>=0 );
+ assert( iCell<get2byte(&data[pPage->hdrOffset+3]) );
+ return data + get2byte(&data[pPage->cellOffset+2*iCell]);
+}
+
+/*
+** This a more complex version of findCell() that works for
+** pages that do contain overflow cells. See insert
+*/
+static u8 *findOverflowCell(MemPage *pPage, int iCell){
+ int i;
+ for(i=pPage->nOverflow-1; i>=0; i--){
+ int k;
+ struct _OvflCell *pOvfl;
+ pOvfl = &pPage->aOvfl[i];
+ k = pOvfl->idx;
+ if( k<=iCell ){
+ if( k==iCell ){
+ return pOvfl->pCell;
+ }
+ iCell--;
+ }
+ }
+ return findCell(pPage, iCell);
+}
+
+/*
+** Parse a cell content block and fill in the CellInfo structure. There
+** are two versions of this function. parseCell() takes a cell index
+** as the second argument and parseCellPtr() takes a pointer to the
+** body of the cell as its second argument.
+*/
+static void parseCellPtr(
+ MemPage *pPage, /* Page containing the cell */
+ u8 *pCell, /* Pointer to the cell text. */
+ CellInfo *pInfo /* Fill in this structure */
+){
+ int n; /* Number bytes in cell content header */
+ u32 nPayload; /* Number of bytes of cell payload */
+
+ pInfo->pCell = pCell;
+ assert( pPage->leaf==0 || pPage->leaf==1 );
+ n = pPage->childPtrSize;
+ assert( n==4-4*pPage->leaf );
+ if( pPage->hasData ){
+ n += getVarint32(&pCell[n], &nPayload);
+ }else{
+ nPayload = 0;
+ }
+ n += getVarint(&pCell[n], (u64 *)&pInfo->nKey);
+ pInfo->nHeader = n;
+ pInfo->nData = nPayload;
+ if( !pPage->intKey ){
+ nPayload += pInfo->nKey;
+ }
+ if( nPayload<=pPage->maxLocal ){
+ /* This is the (easy) common case where the entire payload fits
+ ** on the local page. No overflow is required.
+ */
+ int nSize; /* Total size of cell content in bytes */
+ pInfo->nLocal = nPayload;
+ pInfo->iOverflow = 0;
+ nSize = nPayload + n;
+ if( nSize<4 ){
+ nSize = 4; /* Minimum cell size is 4 */
+ }
+ pInfo->nSize = nSize;
+ }else{
+ /* If the payload will not fit completely on the local page, we have
+ ** to decide how much to store locally and how much to spill onto
+ ** overflow pages. The strategy is to minimize the amount of unused
+ ** space on overflow pages while keeping the amount of local storage
+ ** in between minLocal and maxLocal.
+ **
+ ** Warning: changing the way overflow payload is distributed in any
+ ** way will result in an incompatible file format.
+ */
+ int minLocal; /* Minimum amount of payload held locally */
+ int maxLocal; /* Maximum amount of payload held locally */
+ int surplus; /* Overflow payload available for local storage */
+
+ minLocal = pPage->minLocal;
+ maxLocal = pPage->maxLocal;
+ surplus = minLocal + (nPayload - minLocal)%(pPage->pBt->usableSize - 4);
+ if( surplus <= maxLocal ){
+ pInfo->nLocal = surplus;
+ }else{
+ pInfo->nLocal = minLocal;
+ }
+ pInfo->iOverflow = pInfo->nLocal + n;
+ pInfo->nSize = pInfo->iOverflow + 4;
+ }
+}
+static void parseCell(
+ MemPage *pPage, /* Page containing the cell */
+ int iCell, /* The cell index. First cell is 0 */
+ CellInfo *pInfo /* Fill in this structure */
+){
+ parseCellPtr(pPage, findCell(pPage, iCell), pInfo);
+}
+
+/*
+** Compute the total number of bytes that a Cell needs in the cell
+** data area of the btree-page. The return number includes the cell
+** data header and the local payload, but not any overflow page or
+** the space used by the cell pointer.
+*/
+#ifndef NDEBUG
+static int cellSize(MemPage *pPage, int iCell){
+ CellInfo info;
+ parseCell(pPage, iCell, &info);
+ return info.nSize;
+}
+#endif
+static int cellSizePtr(MemPage *pPage, u8 *pCell){
+ CellInfo info;
+ parseCellPtr(pPage, pCell, &info);
+ return info.nSize;
+}
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+/*
+** If the cell pCell, part of page pPage contains a pointer
+** to an overflow page, insert an entry into the pointer-map
+** for the overflow page.
+*/
+static int ptrmapPutOvflPtr(MemPage *pPage, u8 *pCell){
+ if( pCell ){
+ CellInfo info;
+ parseCellPtr(pPage, pCell, &info);
+ if( (info.nData+(pPage->intKey?0:info.nKey))>info.nLocal ){
+ Pgno ovfl = get4byte(&pCell[info.iOverflow]);
+ return ptrmapPut(pPage->pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno);
+ }
+ }
+ return SQLITE_OK;
+}
+/*
+** If the cell with index iCell on page pPage contains a pointer
+** to an overflow page, insert an entry into the pointer-map
+** for the overflow page.
+*/
+static int ptrmapPutOvfl(MemPage *pPage, int iCell){
+ u8 *pCell;
+ pCell = findOverflowCell(pPage, iCell);
+ return ptrmapPutOvflPtr(pPage, pCell);
+}
+#endif
+
+
+/*
+** Do sanity checking on a page. Throw an exception if anything is
+** not right.
+**
+** This routine is used for internal error checking only. It is omitted
+** from most builds.
+*/
+#if defined(BTREE_DEBUG) && !defined(NDEBUG) && 0
+static void _pageIntegrity(MemPage *pPage){
+ int usableSize;
+ u8 *data;
+ int i, j, idx, c, pc, hdr, nFree;
+ int cellOffset;
+ int nCell, cellLimit;
+ u8 *used;
+
+ used = sqliteMallocRaw( pPage->pBt->pageSize );
+ if( used==0 ) return;
+ usableSize = pPage->pBt->usableSize;
+ assert( pPage->aData==&((unsigned char*)pPage)[-pPage->pBt->pageSize] );
+ hdr = pPage->hdrOffset;
+ assert( hdr==(pPage->pgno==1 ? 100 : 0) );
+ assert( pPage->pgno==sqlite3pager_pagenumber(pPage->aData) );
+ c = pPage->aData[hdr];
+ if( pPage->isInit ){
+ assert( pPage->leaf == ((c & PTF_LEAF)!=0) );
+ assert( pPage->zeroData == ((c & PTF_ZERODATA)!=0) );
+ assert( pPage->leafData == ((c & PTF_LEAFDATA)!=0) );
+ assert( pPage->intKey == ((c & (PTF_INTKEY|PTF_LEAFDATA))!=0) );
+ assert( pPage->hasData ==
+ !(pPage->zeroData || (!pPage->leaf && pPage->leafData)) );
+ assert( pPage->cellOffset==pPage->hdrOffset+12-4*pPage->leaf );
+ assert( pPage->nCell = get2byte(&pPage->aData[hdr+3]) );
+ }
+ data = pPage->aData;
+ memset(used, 0, usableSize);
+ for(i=0; i<hdr+10-pPage->leaf*4; i++) used[i] = 1;
+ nFree = 0;
+ pc = get2byte(&data[hdr+1]);
+ while( pc ){
+ int size;
+ assert( pc>0 && pc<usableSize-4 );
+ size = get2byte(&data[pc+2]);
+ assert( pc+size<=usableSize );
+ nFree += size;
+ for(i=pc; i<pc+size; i++){
+ assert( used[i]==0 );
+ used[i] = 1;
+ }
+ pc = get2byte(&data[pc]);
+ }
+ idx = 0;
+ nCell = get2byte(&data[hdr+3]);
+ cellLimit = get2byte(&data[hdr+5]);
+ assert( pPage->isInit==0
+ || pPage->nFree==nFree+data[hdr+7]+cellLimit-(cellOffset+2*nCell) );
+ cellOffset = pPage->cellOffset;
+ for(i=0; i<nCell; i++){
+ int size;
+ pc = get2byte(&data[cellOffset+2*i]);
+ assert( pc>0 && pc<usableSize-4 );
+ size = cellSize(pPage, &data[pc]);
+ assert( pc+size<=usableSize );
+ for(j=pc; j<pc+size; j++){
+ assert( used[j]==0 );
+ used[j] = 1;
+ }
+ }
+ for(i=cellOffset+2*nCell; i<cellimit; i++){
+ assert( used[i]==0 );
+ used[i] = 1;
+ }
+ nFree = 0;
+ for(i=0; i<usableSize; i++){
+ assert( used[i]<=1 );
+ if( used[i]==0 ) nFree++;
+ }
+ assert( nFree==data[hdr+7] );
+ sqliteFree(used);
+}
+#define pageIntegrity(X) _pageIntegrity(X)
+#else
+# define pageIntegrity(X)
+#endif
+
+/*
+** Defragment the page given. All Cells are moved to the
+** beginning of the page and all free space is collected
+** into one big FreeBlk at the end of the page.
+*/
+static int defragmentPage(MemPage *pPage){
+ int i; /* Loop counter */
+ int pc; /* Address of a i-th cell */
+ int addr; /* Offset of first byte after cell pointer array */
+ int hdr; /* Offset to the page header */
+ int size; /* Size of a cell */
+ int usableSize; /* Number of usable bytes on a page */
+ int cellOffset; /* Offset to the cell pointer array */
+ int brk; /* Offset to the cell content area */
+ int nCell; /* Number of cells on the page */
+ unsigned char *data; /* The page data */
+ unsigned char *temp; /* Temp area for cell content */
+
+ assert( sqlite3pager_iswriteable(pPage->aData) );
+ assert( pPage->pBt!=0 );
+ assert( pPage->pBt->usableSize <= SQLITE_MAX_PAGE_SIZE );
+ assert( pPage->nOverflow==0 );
+ temp = sqliteMalloc( pPage->pBt->pageSize );
+ if( temp==0 ) return SQLITE_NOMEM;
+ data = pPage->aData;
+ hdr = pPage->hdrOffset;
+ cellOffset = pPage->cellOffset;
+ nCell = pPage->nCell;
+ assert( nCell==get2byte(&data[hdr+3]) );
+ usableSize = pPage->pBt->usableSize;
+ brk = get2byte(&data[hdr+5]);
+ memcpy(&temp[brk], &data[brk], usableSize - brk);
+ brk = usableSize;
+ for(i=0; i<nCell; i++){
+ u8 *pAddr; /* The i-th cell pointer */
+ pAddr = &data[cellOffset + i*2];
+ pc = get2byte(pAddr);
+ assert( pc<pPage->pBt->usableSize );
+ size = cellSizePtr(pPage, &temp[pc]);
+ brk -= size;
+ memcpy(&data[brk], &temp[pc], size);
+ put2byte(pAddr, brk);
+ }
+ assert( brk>=cellOffset+2*nCell );
+ put2byte(&data[hdr+5], brk);
+ data[hdr+1] = 0;
+ data[hdr+2] = 0;
+ data[hdr+7] = 0;
+ addr = cellOffset+2*nCell;
+ memset(&data[addr], 0, brk-addr);
+ sqliteFree(temp);
+ return SQLITE_OK;
+}
+
+/*
+** Allocate nByte bytes of space on a page.
+**
+** Return the index into pPage->aData[] of the first byte of
+** the new allocation. Or return 0 if there is not enough free
+** space on the page to satisfy the allocation request.
+**
+** If the page contains nBytes of free space but does not contain
+** nBytes of contiguous free space, then this routine automatically
+** calls defragementPage() to consolidate all free space before
+** allocating the new chunk.
+*/
+static int allocateSpace(MemPage *pPage, int nByte){
+ int addr, pc, hdr;
+ int size;
+ int nFrag;
+ int top;
+ int nCell;
+ int cellOffset;
+ unsigned char *data;
+
+ data = pPage->aData;
+ assert( sqlite3pager_iswriteable(data) );
+ assert( pPage->pBt );
+ if( nByte<4 ) nByte = 4;
+ if( pPage->nFree<nByte || pPage->nOverflow>0 ) return 0;
+ pPage->nFree -= nByte;
+ hdr = pPage->hdrOffset;
+
+ nFrag = data[hdr+7];
+ if( nFrag<60 ){
+ /* Search the freelist looking for a slot big enough to satisfy the
+ ** space request. */
+ addr = hdr+1;
+ while( (pc = get2byte(&data[addr]))>0 ){
+ size = get2byte(&data[pc+2]);
+ if( size>=nByte ){
+ if( size<nByte+4 ){
+ memcpy(&data[addr], &data[pc], 2);
+ data[hdr+7] = nFrag + size - nByte;
+ return pc;
+ }else{
+ put2byte(&data[pc+2], size-nByte);
+ return pc + size - nByte;
+ }
+ }
+ addr = pc;
+ }
+ }
+
+ /* Allocate memory from the gap in between the cell pointer array
+ ** and the cell content area.
+ */
+ top = get2byte(&data[hdr+5]);
+ nCell = get2byte(&data[hdr+3]);
+ cellOffset = pPage->cellOffset;
+ if( nFrag>=60 || cellOffset + 2*nCell > top - nByte ){
+ if( defragmentPage(pPage) ) return 0;
+ top = get2byte(&data[hdr+5]);
+ }
+ top -= nByte;
+ assert( cellOffset + 2*nCell <= top );
+ put2byte(&data[hdr+5], top);
+ return top;
+}
+
+/*
+** Return a section of the pPage->aData to the freelist.
+** The first byte of the new free block is pPage->aDisk[start]
+** and the size of the block is "size" bytes.
+**
+** Most of the effort here is involved in coalesing adjacent
+** free blocks into a single big free block.
+*/
+static void freeSpace(MemPage *pPage, int start, int size){
+ int addr, pbegin, hdr;
+ unsigned char *data = pPage->aData;
+
+ assert( pPage->pBt!=0 );
+ assert( sqlite3pager_iswriteable(data) );
+ assert( start>=pPage->hdrOffset+6+(pPage->leaf?0:4) );
+ assert( (start + size)<=pPage->pBt->usableSize );
+ if( size<4 ) size = 4;
+
+ /* Add the space back into the linked list of freeblocks */
+ hdr = pPage->hdrOffset;
+ addr = hdr + 1;
+ while( (pbegin = get2byte(&data[addr]))<start && pbegin>0 ){
+ assert( pbegin<=pPage->pBt->usableSize-4 );
+ assert( pbegin>addr );
+ addr = pbegin;
+ }
+ assert( pbegin<=pPage->pBt->usableSize-4 );
+ assert( pbegin>addr || pbegin==0 );
+ put2byte(&data[addr], start);
+ put2byte(&data[start], pbegin);
+ put2byte(&data[start+2], size);
+ pPage->nFree += size;
+
+ /* Coalesce adjacent free blocks */
+ addr = pPage->hdrOffset + 1;
+ while( (pbegin = get2byte(&data[addr]))>0 ){
+ int pnext, psize;
+ assert( pbegin>addr );
+ assert( pbegin<=pPage->pBt->usableSize-4 );
+ pnext = get2byte(&data[pbegin]);
+ psize = get2byte(&data[pbegin+2]);
+ if( pbegin + psize + 3 >= pnext && pnext>0 ){
+ int frag = pnext - (pbegin+psize);
+ assert( frag<=data[pPage->hdrOffset+7] );
+ data[pPage->hdrOffset+7] -= frag;
+ put2byte(&data[pbegin], get2byte(&data[pnext]));
+ put2byte(&data[pbegin+2], pnext+get2byte(&data[pnext+2])-pbegin);
+ }else{
+ addr = pbegin;
+ }
+ }
+
+ /* If the cell content area begins with a freeblock, remove it. */
+ if( data[hdr+1]==data[hdr+5] && data[hdr+2]==data[hdr+6] ){
+ int top;
+ pbegin = get2byte(&data[hdr+1]);
+ memcpy(&data[hdr+1], &data[pbegin], 2);
+ top = get2byte(&data[hdr+5]);
+ put2byte(&data[hdr+5], top + get2byte(&data[pbegin+2]));
+ }
+}
+
+/*
+** Decode the flags byte (the first byte of the header) for a page
+** and initialize fields of the MemPage structure accordingly.
+*/
+static void decodeFlags(MemPage *pPage, int flagByte){
+ Btree *pBt; /* A copy of pPage->pBt */
+
+ assert( pPage->hdrOffset==(pPage->pgno==1 ? 100 : 0) );
+ pPage->intKey = (flagByte & (PTF_INTKEY|PTF_LEAFDATA))!=0;
+ pPage->zeroData = (flagByte & PTF_ZERODATA)!=0;
+ pPage->leaf = (flagByte & PTF_LEAF)!=0;
+ pPage->childPtrSize = 4*(pPage->leaf==0);
+ pBt = pPage->pBt;
+ if( flagByte & PTF_LEAFDATA ){
+ pPage->leafData = 1;
+ pPage->maxLocal = pBt->maxLeaf;
+ pPage->minLocal = pBt->minLeaf;
+ }else{
+ pPage->leafData = 0;
+ pPage->maxLocal = pBt->maxLocal;
+ pPage->minLocal = pBt->minLocal;
+ }
+ pPage->hasData = !(pPage->zeroData || (!pPage->leaf && pPage->leafData));
+}
+
+/*
+** Initialize the auxiliary information for a disk block.
+**
+** The pParent parameter must be a pointer to the MemPage which
+** is the parent of the page being initialized. The root of a
+** BTree has no parent and so for that page, pParent==NULL.
+**
+** Return SQLITE_OK on success. If we see that the page does
+** not contain a well-formed database page, then return
+** SQLITE_CORRUPT. Note that a return of SQLITE_OK does not
+** guarantee that the page is well-formed. It only shows that
+** we failed to detect any corruption.
+*/
+static int initPage(
+ MemPage *pPage, /* The page to be initialized */
+ MemPage *pParent /* The parent. Might be NULL */
+){
+ int pc; /* Address of a freeblock within pPage->aData[] */
+ int hdr; /* Offset to beginning of page header */
+ u8 *data; /* Equal to pPage->aData */
+ Btree *pBt; /* The main btree structure */
+ int usableSize; /* Amount of usable space on each page */
+ int cellOffset; /* Offset from start of page to first cell pointer */
+ int nFree; /* Number of unused bytes on the page */
+ int top; /* First byte of the cell content area */
+
+ pBt = pPage->pBt;
+ assert( pBt!=0 );
+ assert( pParent==0 || pParent->pBt==pBt );
+ assert( pPage->pgno==sqlite3pager_pagenumber(pPage->aData) );
+ assert( pPage->aData == &((unsigned char*)pPage)[-pBt->pageSize] );
+ if( pPage->pParent!=pParent && (pPage->pParent!=0 || pPage->isInit) ){
+ /* The parent page should never change unless the file is corrupt */
+ return SQLITE_CORRUPT_BKPT;
+ }
+ if( pPage->isInit ) return SQLITE_OK;
+ if( pPage->pParent==0 && pParent!=0 ){
+ pPage->pParent = pParent;
+ sqlite3pager_ref(pParent->aData);
+ }
+ hdr = pPage->hdrOffset;
+ data = pPage->aData;
+ decodeFlags(pPage, data[hdr]);
+ pPage->nOverflow = 0;
+ pPage->idxShift = 0;
+ usableSize = pBt->usableSize;
+ pPage->cellOffset = cellOffset = hdr + 12 - 4*pPage->leaf;
+ top = get2byte(&data[hdr+5]);
+ pPage->nCell = get2byte(&data[hdr+3]);
+ if( pPage->nCell>MX_CELL(pBt) ){
+ /* To many cells for a single page. The page must be corrupt */
+ return SQLITE_CORRUPT_BKPT;
+ }
+ if( pPage->nCell==0 && pParent!=0 && pParent->pgno!=1 ){
+ /* All pages must have at least one cell, except for root pages */
+ return SQLITE_CORRUPT_BKPT;
+ }
+
+ /* Compute the total free space on the page */
+ pc = get2byte(&data[hdr+1]);
+ nFree = data[hdr+7] + top - (cellOffset + 2*pPage->nCell);
+ while( pc>0 ){
+ int next, size;
+ if( pc>usableSize-4 ){
+ /* Free block is off the page */
+ return SQLITE_CORRUPT_BKPT;
+ }
+ next = get2byte(&data[pc]);
+ size = get2byte(&data[pc+2]);
+ if( next>0 && next<=pc+size+3 ){
+ /* Free blocks must be in accending order */
+ return SQLITE_CORRUPT_BKPT;
+ }
+ nFree += size;
+ pc = next;
+ }
+ pPage->nFree = nFree;
+ if( nFree>=usableSize ){
+ /* Free space cannot exceed total page size */
+ return SQLITE_CORRUPT_BKPT;
+ }
+
+ pPage->isInit = 1;
+ pageIntegrity(pPage);
+ return SQLITE_OK;
+}
+
+/*
+** Set up a raw page so that it looks like a database page holding
+** no entries.
+*/
+static void zeroPage(MemPage *pPage, int flags){
+ unsigned char *data = pPage->aData;
+ Btree *pBt = pPage->pBt;
+ int hdr = pPage->hdrOffset;
+ int first;
+
+ assert( sqlite3pager_pagenumber(data)==pPage->pgno );
+ assert( &data[pBt->pageSize] == (unsigned char*)pPage );
+ assert( sqlite3pager_iswriteable(data) );
+ memset(&data[hdr], 0, pBt->usableSize - hdr);
+ data[hdr] = flags;
+ first = hdr + 8 + 4*((flags&PTF_LEAF)==0);
+ memset(&data[hdr+1], 0, 4);
+ data[hdr+7] = 0;
+ put2byte(&data[hdr+5], pBt->usableSize);
+ pPage->nFree = pBt->usableSize - first;
+ decodeFlags(pPage, flags);
+ pPage->hdrOffset = hdr;
+ pPage->cellOffset = first;
+ pPage->nOverflow = 0;
+ pPage->idxShift = 0;
+ pPage->nCell = 0;
+ pPage->isInit = 1;
+ pageIntegrity(pPage);
+}
+
+/*
+** Get a page from the pager. Initialize the MemPage.pBt and
+** MemPage.aData elements if needed.
+*/
+static int getPage(Btree *pBt, Pgno pgno, MemPage **ppPage){
+ int rc;
+ unsigned char *aData;
+ MemPage *pPage;
+ rc = sqlite3pager_get(pBt->pPager, pgno, (void**)&aData);
+ if( rc ) return rc;
+ pPage = (MemPage*)&aData[pBt->pageSize];
+ pPage->aData = aData;
+ pPage->pBt = pBt;
+ pPage->pgno = pgno;
+ pPage->hdrOffset = pPage->pgno==1 ? 100 : 0;
+ *ppPage = pPage;
+ return SQLITE_OK;
+}
+
+/*
+** Get a page from the pager and initialize it. This routine
+** is just a convenience wrapper around separate calls to
+** getPage() and initPage().
+*/
+static int getAndInitPage(
+ Btree *pBt, /* The database file */
+ Pgno pgno, /* Number of the page to get */
+ MemPage **ppPage, /* Write the page pointer here */
+ MemPage *pParent /* Parent of the page */
+){
+ int rc;
+ if( pgno==0 ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ rc = getPage(pBt, pgno, ppPage);
+ if( rc==SQLITE_OK && (*ppPage)->isInit==0 ){
+ rc = initPage(*ppPage, pParent);
+ }
+ return rc;
+}
+
+/*
+** Release a MemPage. This should be called once for each prior
+** call to getPage.
+*/
+static void releasePage(MemPage *pPage){
+ if( pPage ){
+ assert( pPage->aData );
+ assert( pPage->pBt );
+ assert( &pPage->aData[pPage->pBt->pageSize]==(unsigned char*)pPage );
+ sqlite3pager_unref(pPage->aData);
+ }
+}
+
+/*
+** This routine is called when the reference count for a page
+** reaches zero. We need to unref the pParent pointer when that
+** happens.
+*/
+static void pageDestructor(void *pData, int pageSize){
+ MemPage *pPage;
+ assert( (pageSize & 7)==0 );
+ pPage = (MemPage*)&((char*)pData)[pageSize];
+ if( pPage->pParent ){
+ MemPage *pParent = pPage->pParent;
+ pPage->pParent = 0;
+ releasePage(pParent);
+ }
+ pPage->isInit = 0;
+}
+
+/*
+** During a rollback, when the pager reloads information into the cache
+** so that the cache is restored to its original state at the start of
+** the transaction, for each page restored this routine is called.
+**
+** This routine needs to reset the extra data section at the end of the
+** page to agree with the restored data.
+*/
+static void pageReinit(void *pData, int pageSize){
+ MemPage *pPage;
+ assert( (pageSize & 7)==0 );
+ pPage = (MemPage*)&((char*)pData)[pageSize];
+ if( pPage->isInit ){
+ pPage->isInit = 0;
+ initPage(pPage, pPage->pParent);
+ }
+}
+
+/*
+** Open a database file.
+**
+** zFilename is the name of the database file. If zFilename is NULL
+** a new database with a random name is created. This randomly named
+** database file will be deleted when sqlite3BtreeClose() is called.
+*/
+int sqlite3BtreeOpen(
+ const char *zFilename, /* Name of the file containing the BTree database */
+ Btree **ppBtree, /* Pointer to new Btree object written here */
+ int flags /* Options */
+){
+ Btree *pBt;
+ int rc;
+ int nReserve;
+ unsigned char zDbHeader[100];
+
+ /*
+ ** The following asserts make sure that structures used by the btree are
+ ** the right size. This is to guard against size changes that result
+ ** when compiling on a different architecture.
+ */
+ assert( sizeof(i64)==8 );
+ assert( sizeof(u64)==8 );
+ assert( sizeof(u32)==4 );
+ assert( sizeof(u16)==2 );
+ assert( sizeof(Pgno)==4 );
+
+ pBt = sqliteMalloc( sizeof(*pBt) );
+ if( pBt==0 ){
+ *ppBtree = 0;
+ return SQLITE_NOMEM;
+ }
+ rc = sqlite3pager_open(&pBt->pPager, zFilename, EXTRA_SIZE, flags);
+ if( rc!=SQLITE_OK ){
+ if( pBt->pPager ) sqlite3pager_close(pBt->pPager);
+ sqliteFree(pBt);
+ *ppBtree = 0;
+ return rc;
+ }
+ sqlite3pager_set_destructor(pBt->pPager, pageDestructor);
+ sqlite3pager_set_reiniter(pBt->pPager, pageReinit);
+ pBt->pCursor = 0;
+ pBt->pPage1 = 0;
+ pBt->readOnly = sqlite3pager_isreadonly(pBt->pPager);
+ sqlite3pager_read_fileheader(pBt->pPager, sizeof(zDbHeader), zDbHeader);
+ pBt->pageSize = get2byte(&zDbHeader[16]);
+ if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE
+ || ((pBt->pageSize-1)&pBt->pageSize)!=0 ){
+ pBt->pageSize = SQLITE_DEFAULT_PAGE_SIZE;
+ pBt->maxEmbedFrac = 64; /* 25% */
+ pBt->minEmbedFrac = 32; /* 12.5% */
+ pBt->minLeafFrac = 32; /* 12.5% */
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ /* If the magic name ":memory:" will create an in-memory database, then
+ ** do not set the auto-vacuum flag, even if SQLITE_DEFAULT_AUTOVACUUM
+ ** is true. On the other hand, if SQLITE_OMIT_MEMORYDB has been defined,
+ ** then ":memory:" is just a regular file-name. Respect the auto-vacuum
+ ** default in this case.
+ */
+#ifndef SQLITE_OMIT_MEMORYDB
+ if( zFilename && strcmp(zFilename,":memory:") ){
+#else
+ if( zFilename ){
+#endif
+ pBt->autoVacuum = SQLITE_DEFAULT_AUTOVACUUM;
+ }
+#endif
+ nReserve = 0;
+ }else{
+ nReserve = zDbHeader[20];
+ pBt->maxEmbedFrac = zDbHeader[21];
+ pBt->minEmbedFrac = zDbHeader[22];
+ pBt->minLeafFrac = zDbHeader[23];
+ pBt->pageSizeFixed = 1;
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ pBt->autoVacuum = (get4byte(&zDbHeader[36 + 4*4])?1:0);
+#endif
+ }
+ pBt->usableSize = pBt->pageSize - nReserve;
+ assert( (pBt->pageSize & 7)==0 ); /* 8-byte alignment of pageSize */
+ sqlite3pager_set_pagesize(pBt->pPager, pBt->pageSize);
+ *ppBtree = pBt;
+ return SQLITE_OK;
+}
+
+/*
+** Close an open database and invalidate all cursors.
+*/
+int sqlite3BtreeClose(Btree *pBt){
+ while( pBt->pCursor ){
+ sqlite3BtreeCloseCursor(pBt->pCursor);
+ }
+ sqlite3pager_close(pBt->pPager);
+ sqliteFree(pBt);
+ return SQLITE_OK;
+}
+
+/*
+** Change the busy handler callback function.
+*/
+int sqlite3BtreeSetBusyHandler(Btree *pBt, BusyHandler *pHandler){
+ pBt->pBusyHandler = pHandler;
+ sqlite3pager_set_busyhandler(pBt->pPager, pHandler);
+ return SQLITE_OK;
+}
+
+/*
+** Change the limit on the number of pages allowed in the cache.
+**
+** The maximum number of cache pages is set to the absolute
+** value of mxPage. If mxPage is negative, the pager will
+** operate asynchronously - it will not stop to do fsync()s
+** to insure data is written to the disk surface before
+** continuing. Transactions still work if synchronous is off,
+** and the database cannot be corrupted if this program
+** crashes. But if the operating system crashes or there is
+** an abrupt power failure when synchronous is off, the database
+** could be left in an inconsistent and unrecoverable state.
+** Synchronous is on by default so database corruption is not
+** normally a worry.
+*/
+int sqlite3BtreeSetCacheSize(Btree *pBt, int mxPage){
+ sqlite3pager_set_cachesize(pBt->pPager, mxPage);
+ return SQLITE_OK;
+}
+
+/*
+** Change the way data is synced to disk in order to increase or decrease
+** how well the database resists damage due to OS crashes and power
+** failures. Level 1 is the same as asynchronous (no syncs() occur and
+** there is a high probability of damage) Level 2 is the default. There
+** is a very low but non-zero probability of damage. Level 3 reduces the
+** probability of damage to near zero but with a write performance reduction.
+*/
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+int sqlite3BtreeSetSafetyLevel(Btree *pBt, int level){
+ sqlite3pager_set_safety_level(pBt->pPager, level);
+ return SQLITE_OK;
+}
+#endif
+
+/*
+** Return TRUE if the given btree is set to safety level 1. In other
+** words, return TRUE if no sync() occurs on the disk files.
+*/
+int sqlite3BtreeSyncDisabled(Btree *pBt){
+ assert( pBt && pBt->pPager );
+ return sqlite3pager_nosync(pBt->pPager);
+}
+
+#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM)
+/*
+** Change the default pages size and the number of reserved bytes per page.
+**
+** The page size must be a power of 2 between 512 and 65536. If the page
+** size supplied does not meet this constraint then the page size is not
+** changed.
+**
+** Page sizes are constrained to be a power of two so that the region
+** of the database file used for locking (beginning at PENDING_BYTE,
+** the first byte past the 1GB boundary, 0x40000000) needs to occur
+** at the beginning of a page.
+**
+** If parameter nReserve is less than zero, then the number of reserved
+** bytes per page is left unchanged.
+*/
+int sqlite3BtreeSetPageSize(Btree *pBt, int pageSize, int nReserve){
+ if( pBt->pageSizeFixed ){
+ return SQLITE_READONLY;
+ }
+ if( nReserve<0 ){
+ nReserve = pBt->pageSize - pBt->usableSize;
+ }
+ if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE &&
+ ((pageSize-1)&pageSize)==0 ){
+ assert( (pageSize & 7)==0 );
+ pBt->pageSize = sqlite3pager_set_pagesize(pBt->pPager, pageSize);
+ }
+ pBt->usableSize = pBt->pageSize - nReserve;
+ return SQLITE_OK;
+}
+
+/*
+** Return the currently defined page size
+*/
+int sqlite3BtreeGetPageSize(Btree *pBt){
+ return pBt->pageSize;
+}
+int sqlite3BtreeGetReserve(Btree *pBt){
+ return pBt->pageSize - pBt->usableSize;
+}
+#endif /* !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) */
+
+/*
+** Change the 'auto-vacuum' property of the database. If the 'autoVacuum'
+** parameter is non-zero, then auto-vacuum mode is enabled. If zero, it
+** is disabled. The default value for the auto-vacuum property is
+** determined by the SQLITE_DEFAULT_AUTOVACUUM macro.
+*/
+int sqlite3BtreeSetAutoVacuum(Btree *pBt, int autoVacuum){
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ return SQLITE_READONLY;
+#else
+ if( pBt->pageSizeFixed ){
+ return SQLITE_READONLY;
+ }
+ pBt->autoVacuum = (autoVacuum?1:0);
+ return SQLITE_OK;
+#endif
+}
+
+/*
+** Return the value of the 'auto-vacuum' property. If auto-vacuum is
+** enabled 1 is returned. Otherwise 0.
+*/
+int sqlite3BtreeGetAutoVacuum(Btree *pBt){
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ return 0;
+#else
+ return pBt->autoVacuum;
+#endif
+}
+
+
+/*
+** Get a reference to pPage1 of the database file. This will
+** also acquire a readlock on that file.
+**
+** SQLITE_OK is returned on success. If the file is not a
+** well-formed database file, then SQLITE_CORRUPT is returned.
+** SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM
+** is returned if we run out of memory. SQLITE_PROTOCOL is returned
+** if there is a locking protocol violation.
+*/
+static int lockBtree(Btree *pBt){
+ int rc, pageSize;
+ MemPage *pPage1;
+ if( pBt->pPage1 ) return SQLITE_OK;
+ rc = getPage(pBt, 1, &pPage1);
+ if( rc!=SQLITE_OK ) return rc;
+
+
+ /* Do some checking to help insure the file we opened really is
+ ** a valid database file.
+ */
+ rc = SQLITE_NOTADB;
+ if( sqlite3pager_pagecount(pBt->pPager)>0 ){
+ u8 *page1 = pPage1->aData;
+ if( memcmp(page1, zMagicHeader, 16)!=0 ){
+ goto page1_init_failed;
+ }
+ if( page1[18]>1 || page1[19]>1 ){
+ goto page1_init_failed;
+ }
+ pageSize = get2byte(&page1[16]);
+ if( ((pageSize-1)&pageSize)!=0 ){
+ goto page1_init_failed;
+ }
+ assert( (pageSize & 7)==0 );
+ pBt->pageSize = pageSize;
+ pBt->usableSize = pageSize - page1[20];
+ if( pBt->usableSize<500 ){
+ goto page1_init_failed;
+ }
+ pBt->maxEmbedFrac = page1[21];
+ pBt->minEmbedFrac = page1[22];
+ pBt->minLeafFrac = page1[23];
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ pBt->autoVacuum = (get4byte(&page1[36 + 4*4])?1:0);
+#endif
+ }
+
+ /* maxLocal is the maximum amount of payload to store locally for
+ ** a cell. Make sure it is small enough so that at least minFanout
+ ** cells can will fit on one page. We assume a 10-byte page header.
+ ** Besides the payload, the cell must store:
+ ** 2-byte pointer to the cell
+ ** 4-byte child pointer
+ ** 9-byte nKey value
+ ** 4-byte nData value
+ ** 4-byte overflow page pointer
+ ** So a cell consists of a 2-byte poiner, a header which is as much as
+ ** 17 bytes long, 0 to N bytes of payload, and an optional 4 byte overflow
+ ** page pointer.
+ */
+ pBt->maxLocal = (pBt->usableSize-12)*pBt->maxEmbedFrac/255 - 23;
+ pBt->minLocal = (pBt->usableSize-12)*pBt->minEmbedFrac/255 - 23;
+ pBt->maxLeaf = pBt->usableSize - 35;
+ pBt->minLeaf = (pBt->usableSize-12)*pBt->minLeafFrac/255 - 23;
+ if( pBt->minLocal>pBt->maxLocal || pBt->maxLocal<0 ){
+ goto page1_init_failed;
+ }
+ assert( pBt->maxLeaf + 23 <= MX_CELL_SIZE(pBt) );
+ pBt->pPage1 = pPage1;
+ return SQLITE_OK;
+
+page1_init_failed:
+ releasePage(pPage1);
+ pBt->pPage1 = 0;
+ return rc;
+}
+
+/*
+** This routine works like lockBtree() except that it also invokes the
+** busy callback if there is lock contention.
+*/
+static int lockBtreeWithRetry(Btree *pBt){
+ int rc = SQLITE_OK;
+ if( pBt->inTrans==TRANS_NONE ){
+ rc = sqlite3BtreeBeginTrans(pBt, 0);
+ pBt->inTrans = TRANS_NONE;
+ }
+ return rc;
+}
+
+
+/*
+** If there are no outstanding cursors and we are not in the middle
+** of a transaction but there is a read lock on the database, then
+** this routine unrefs the first page of the database file which
+** has the effect of releasing the read lock.
+**
+** If there are any outstanding cursors, this routine is a no-op.
+**
+** If there is a transaction in progress, this routine is a no-op.
+*/
+static void unlockBtreeIfUnused(Btree *pBt){
+ if( pBt->inTrans==TRANS_NONE && pBt->pCursor==0 && pBt->pPage1!=0 ){
+ if( pBt->pPage1->aData==0 ){
+ MemPage *pPage = pBt->pPage1;
+ pPage->aData = &((char*)pPage)[-pBt->pageSize];
+ pPage->pBt = pBt;
+ pPage->pgno = 1;
+ }
+ releasePage(pBt->pPage1);
+ pBt->pPage1 = 0;
+ pBt->inStmt = 0;
+ }
+}
+
+/*
+** Create a new database by initializing the first page of the
+** file.
+*/
+static int newDatabase(Btree *pBt){
+ MemPage *pP1;
+ unsigned char *data;
+ int rc;
+ if( sqlite3pager_pagecount(pBt->pPager)>0 ) return SQLITE_OK;
+ pP1 = pBt->pPage1;
+ assert( pP1!=0 );
+ data = pP1->aData;
+ rc = sqlite3pager_write(data);
+ if( rc ) return rc;
+ memcpy(data, zMagicHeader, sizeof(zMagicHeader));
+ assert( sizeof(zMagicHeader)==16 );
+ put2byte(&data[16], pBt->pageSize);
+ data[18] = 1;
+ data[19] = 1;
+ data[20] = pBt->pageSize - pBt->usableSize;
+ data[21] = pBt->maxEmbedFrac;
+ data[22] = pBt->minEmbedFrac;
+ data[23] = pBt->minLeafFrac;
+ memset(&data[24], 0, 100-24);
+ zeroPage(pP1, PTF_INTKEY|PTF_LEAF|PTF_LEAFDATA );
+ pBt->pageSizeFixed = 1;
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ put4byte(&data[36 + 4*4], 1);
+ }
+#endif
+ return SQLITE_OK;
+}
+
+/*
+** Attempt to start a new transaction. A write-transaction
+** is started if the second argument is nonzero, otherwise a read-
+** transaction. If the second argument is 2 or more and exclusive
+** transaction is started, meaning that no other process is allowed
+** to access the database. A preexisting transaction may not be
+** upgraded to exclusive by calling this routine a second time - the
+** exclusivity flag only works for a new transaction.
+**
+** A write-transaction must be started before attempting any
+** changes to the database. None of the following routines
+** will work unless a transaction is started first:
+**
+** sqlite3BtreeCreateTable()
+** sqlite3BtreeCreateIndex()
+** sqlite3BtreeClearTable()
+** sqlite3BtreeDropTable()
+** sqlite3BtreeInsert()
+** sqlite3BtreeDelete()
+** sqlite3BtreeUpdateMeta()
+**
+** If an initial attempt to acquire the lock fails because of lock contention
+** and the database was previously unlocked, then invoke the busy handler
+** if there is one. But if there was previously a read-lock, do not
+** invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is
+** returned when there is already a read-lock in order to avoid a deadlock.
+**
+** Suppose there are two processes A and B. A has a read lock and B has
+** a reserved lock. B tries to promote to exclusive but is blocked because
+** of A's read lock. A tries to promote to reserved but is blocked by B.
+** One or the other of the two processes must give way or there can be
+** no progress. By returning SQLITE_BUSY and not invoking the busy callback
+** when A already has a read lock, we encourage A to give up and let B
+** proceed.
+*/
+int sqlite3BtreeBeginTrans(Btree *pBt, int wrflag){
+ int rc = SQLITE_OK;
+
+ /* If the btree is already in a write-transaction, or it
+ ** is already in a read-transaction and a read-transaction
+ ** is requested, this is a no-op.
+ */
+ if( pBt->inTrans==TRANS_WRITE || (pBt->inTrans==TRANS_READ && !wrflag) ){
+ return SQLITE_OK;
+ }
+
+ /* Write transactions are not possible on a read-only database */
+ if( pBt->readOnly && wrflag ){
+ return SQLITE_READONLY;
+ }
+
+ do {
+ if( pBt->pPage1==0 ){
+ rc = lockBtree(pBt);
+ }
+
+ if( rc==SQLITE_OK && wrflag ){
+ rc = sqlite3pager_begin(pBt->pPage1->aData, wrflag>1);
+ if( rc==SQLITE_OK ){
+ rc = newDatabase(pBt);
+ }
+ }
+
+ if( rc==SQLITE_OK ){
+ pBt->inTrans = (wrflag?TRANS_WRITE:TRANS_READ);
+ if( wrflag ) pBt->inStmt = 0;
+ }else{
+ unlockBtreeIfUnused(pBt);
+ }
+ }while( rc==SQLITE_BUSY && pBt->inTrans==TRANS_NONE &&
+ sqlite3InvokeBusyHandler(pBt->pBusyHandler) );
+ return rc;
+}
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+
+/*
+** Set the pointer-map entries for all children of page pPage. Also, if
+** pPage contains cells that point to overflow pages, set the pointer
+** map entries for the overflow pages as well.
+*/
+static int setChildPtrmaps(MemPage *pPage){
+ int i; /* Counter variable */
+ int nCell; /* Number of cells in page pPage */
+ int rc = SQLITE_OK; /* Return code */
+ Btree *pBt = pPage->pBt;
+ int isInitOrig = pPage->isInit;
+ Pgno pgno = pPage->pgno;
+
+ initPage(pPage, 0);
+ nCell = pPage->nCell;
+
+ for(i=0; i<nCell; i++){
+ u8 *pCell = findCell(pPage, i);
+
+ rc = ptrmapPutOvflPtr(pPage, pCell);
+ if( rc!=SQLITE_OK ){
+ goto set_child_ptrmaps_out;
+ }
+
+ if( !pPage->leaf ){
+ Pgno childPgno = get4byte(pCell);
+ rc = ptrmapPut(pBt, childPgno, PTRMAP_BTREE, pgno);
+ if( rc!=SQLITE_OK ) goto set_child_ptrmaps_out;
+ }
+ }
+
+ if( !pPage->leaf ){
+ Pgno childPgno = get4byte(&pPage->aData[pPage->hdrOffset+8]);
+ rc = ptrmapPut(pBt, childPgno, PTRMAP_BTREE, pgno);
+ }
+
+set_child_ptrmaps_out:
+ pPage->isInit = isInitOrig;
+ return rc;
+}
+
+/*
+** Somewhere on pPage, which is guarenteed to be a btree page, not an overflow
+** page, is a pointer to page iFrom. Modify this pointer so that it points to
+** iTo. Parameter eType describes the type of pointer to be modified, as
+** follows:
+**
+** PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child
+** page of pPage.
+**
+** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow
+** page pointed to by one of the cells on pPage.
+**
+** PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next
+** overflow page in the list.
+*/
+static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){
+ if( eType==PTRMAP_OVERFLOW2 ){
+ /* The pointer is always the first 4 bytes of the page in this case. */
+ if( get4byte(pPage->aData)!=iFrom ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ put4byte(pPage->aData, iTo);
+ }else{
+ int isInitOrig = pPage->isInit;
+ int i;
+ int nCell;
+
+ initPage(pPage, 0);
+ nCell = pPage->nCell;
+
+ for(i=0; i<nCell; i++){
+ u8 *pCell = findCell(pPage, i);
+ if( eType==PTRMAP_OVERFLOW1 ){
+ CellInfo info;
+ parseCellPtr(pPage, pCell, &info);
+ if( info.iOverflow ){
+ if( iFrom==get4byte(&pCell[info.iOverflow]) ){
+ put4byte(&pCell[info.iOverflow], iTo);
+ break;
+ }
+ }
+ }else{
+ if( get4byte(pCell)==iFrom ){
+ put4byte(pCell, iTo);
+ break;
+ }
+ }
+ }
+
+ if( i==nCell ){
+ if( eType!=PTRMAP_BTREE ||
+ get4byte(&pPage->aData[pPage->hdrOffset+8])!=iFrom ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ put4byte(&pPage->aData[pPage->hdrOffset+8], iTo);
+ }
+
+ pPage->isInit = isInitOrig;
+ }
+ return SQLITE_OK;
+}
+
+
+/*
+** Move the open database page pDbPage to location iFreePage in the
+** database. The pDbPage reference remains valid.
+*/
+static int relocatePage(
+ Btree *pBt, /* Btree */
+ MemPage *pDbPage, /* Open page to move */
+ u8 eType, /* Pointer map 'type' entry for pDbPage */
+ Pgno iPtrPage, /* Pointer map 'page-no' entry for pDbPage */
+ Pgno iFreePage /* The location to move pDbPage to */
+){
+ MemPage *pPtrPage; /* The page that contains a pointer to pDbPage */
+ Pgno iDbPage = pDbPage->pgno;
+ Pager *pPager = pBt->pPager;
+ int rc;
+
+ assert( eType==PTRMAP_OVERFLOW2 || eType==PTRMAP_OVERFLOW1 ||
+ eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE );
+
+ /* Move page iDbPage from it's current location to page number iFreePage */
+ TRACE(("AUTOVACUUM: Moving %d to free page %d (ptr page %d type %d)\n",
+ iDbPage, iFreePage, iPtrPage, eType));
+ rc = sqlite3pager_movepage(pPager, pDbPage->aData, iFreePage);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ pDbPage->pgno = iFreePage;
+
+ /* If pDbPage was a btree-page, then it may have child pages and/or cells
+ ** that point to overflow pages. The pointer map entries for all these
+ ** pages need to be changed.
+ **
+ ** If pDbPage is an overflow page, then the first 4 bytes may store a
+ ** pointer to a subsequent overflow page. If this is the case, then
+ ** the pointer map needs to be updated for the subsequent overflow page.
+ */
+ if( eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ){
+ rc = setChildPtrmaps(pDbPage);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ }else{
+ Pgno nextOvfl = get4byte(pDbPage->aData);
+ if( nextOvfl!=0 ){
+ rc = ptrmapPut(pBt, nextOvfl, PTRMAP_OVERFLOW2, iFreePage);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ }
+ }
+
+ /* Fix the database pointer on page iPtrPage that pointed at iDbPage so
+ ** that it points at iFreePage. Also fix the pointer map entry for
+ ** iPtrPage.
+ */
+ if( eType!=PTRMAP_ROOTPAGE ){
+ rc = getPage(pBt, iPtrPage, &pPtrPage);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ rc = sqlite3pager_write(pPtrPage->aData);
+ if( rc!=SQLITE_OK ){
+ releasePage(pPtrPage);
+ return rc;
+ }
+ rc = modifyPagePointer(pPtrPage, iDbPage, iFreePage, eType);
+ releasePage(pPtrPage);
+ if( rc==SQLITE_OK ){
+ rc = ptrmapPut(pBt, iFreePage, eType, iPtrPage);
+ }
+ }
+ return rc;
+}
+
+/* Forward declaration required by autoVacuumCommit(). */
+static int allocatePage(Btree *, MemPage **, Pgno *, Pgno, u8);
+
+/*
+** This routine is called prior to sqlite3pager_commit when a transaction
+** is commited for an auto-vacuum database.
+*/
+static int autoVacuumCommit(Btree *pBt, Pgno *nTrunc){
+ Pager *pPager = pBt->pPager;
+ Pgno nFreeList; /* Number of pages remaining on the free-list. */
+ int nPtrMap; /* Number of pointer-map pages deallocated */
+ Pgno origSize; /* Pages in the database file */
+ Pgno finSize; /* Pages in the database file after truncation */
+ int rc; /* Return code */
+ u8 eType;
+ int pgsz = pBt->pageSize; /* Page size for this database */
+ Pgno iDbPage; /* The database page to move */
+ MemPage *pDbMemPage = 0; /* "" */
+ Pgno iPtrPage; /* The page that contains a pointer to iDbPage */
+ Pgno iFreePage; /* The free-list page to move iDbPage to */
+ MemPage *pFreeMemPage = 0; /* "" */
+
+#ifndef NDEBUG
+ int nRef = *sqlite3pager_stats(pPager);
+#endif
+
+ assert( pBt->autoVacuum );
+ if( PTRMAP_ISPAGE(pgsz, sqlite3pager_pagecount(pPager)) ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+
+ /* Figure out how many free-pages are in the database. If there are no
+ ** free pages, then auto-vacuum is a no-op.
+ */
+ nFreeList = get4byte(&pBt->pPage1->aData[36]);
+ if( nFreeList==0 ){
+ *nTrunc = 0;
+ return SQLITE_OK;
+ }
+
+ origSize = sqlite3pager_pagecount(pPager);
+ nPtrMap = (nFreeList-origSize+PTRMAP_PAGENO(pgsz, origSize)+pgsz/5)/(pgsz/5);
+ finSize = origSize - nFreeList - nPtrMap;
+ if( origSize>=PENDING_BYTE_PAGE(pBt) && finSize<=PENDING_BYTE_PAGE(pBt) ){
+ finSize--;
+ if( PTRMAP_ISPAGE(pBt->usableSize, finSize) ){
+ finSize--;
+ }
+ }
+ TRACE(("AUTOVACUUM: Begin (db size %d->%d)\n", origSize, finSize));
+
+ /* Variable 'finSize' will be the size of the file in pages after
+ ** the auto-vacuum has completed (the current file size minus the number
+ ** of pages on the free list). Loop through the pages that lie beyond
+ ** this mark, and if they are not already on the free list, move them
+ ** to a free page earlier in the file (somewhere before finSize).
+ */
+ for( iDbPage=finSize+1; iDbPage<=origSize; iDbPage++ ){
+ /* If iDbPage is a pointer map page, or the pending-byte page, skip it. */
+ if( PTRMAP_ISPAGE(pgsz, iDbPage) || iDbPage==PENDING_BYTE_PAGE(pBt) ){
+ continue;
+ }
+
+ rc = ptrmapGet(pBt, iDbPage, &eType, &iPtrPage);
+ if( rc!=SQLITE_OK ) goto autovacuum_out;
+ if( eType==PTRMAP_ROOTPAGE ){
+ rc = SQLITE_CORRUPT_BKPT;
+ goto autovacuum_out;
+ }
+
+ /* If iDbPage is free, do not swap it. */
+ if( eType==PTRMAP_FREEPAGE ){
+ continue;
+ }
+ rc = getPage(pBt, iDbPage, &pDbMemPage);
+ if( rc!=SQLITE_OK ) goto autovacuum_out;
+
+ /* Find the next page in the free-list that is not already at the end
+ ** of the file. A page can be pulled off the free list using the
+ ** allocatePage() routine.
+ */
+ do{
+ if( pFreeMemPage ){
+ releasePage(pFreeMemPage);
+ pFreeMemPage = 0;
+ }
+ rc = allocatePage(pBt, &pFreeMemPage, &iFreePage, 0, 0);
+ if( rc!=SQLITE_OK ){
+ releasePage(pDbMemPage);
+ goto autovacuum_out;
+ }
+ assert( iFreePage<=origSize );
+ }while( iFreePage>finSize );
+ releasePage(pFreeMemPage);
+ pFreeMemPage = 0;
+
+ rc = relocatePage(pBt, pDbMemPage, eType, iPtrPage, iFreePage);
+ releasePage(pDbMemPage);
+ if( rc!=SQLITE_OK ) goto autovacuum_out;
+ }
+
+ /* The entire free-list has been swapped to the end of the file. So
+ ** truncate the database file to finSize pages and consider the
+ ** free-list empty.
+ */
+ rc = sqlite3pager_write(pBt->pPage1->aData);
+ if( rc!=SQLITE_OK ) goto autovacuum_out;
+ put4byte(&pBt->pPage1->aData[32], 0);
+ put4byte(&pBt->pPage1->aData[36], 0);
+ if( rc!=SQLITE_OK ) goto autovacuum_out;
+ *nTrunc = finSize;
+
+autovacuum_out:
+ assert( nRef==*sqlite3pager_stats(pPager) );
+ if( rc!=SQLITE_OK ){
+ sqlite3pager_rollback(pPager);
+ }
+ return rc;
+}
+#endif
+
+/*
+** Commit the transaction currently in progress.
+**
+** This will release the write lock on the database file. If there
+** are no active cursors, it also releases the read lock.
+*/
+int sqlite3BtreeCommit(Btree *pBt){
+ int rc = SQLITE_OK;
+ if( pBt->inTrans==TRANS_WRITE ){
+ rc = sqlite3pager_commit(pBt->pPager);
+ }
+ pBt->inTrans = TRANS_NONE;
+ pBt->inStmt = 0;
+ unlockBtreeIfUnused(pBt);
+ return rc;
+}
+
+#ifndef NDEBUG
+/*
+** Return the number of write-cursors open on this handle. This is for use
+** in assert() expressions, so it is only compiled if NDEBUG is not
+** defined.
+*/
+static int countWriteCursors(Btree *pBt){
+ BtCursor *pCur;
+ int r = 0;
+ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){
+ if( pCur->wrFlag ) r++;
+ }
+ return r;
+}
+#endif
+
+#ifdef SQLITE_TEST
+/*
+** Print debugging information about all cursors to standard output.
+*/
+void sqlite3BtreeCursorList(Btree *pBt){
+ BtCursor *pCur;
+ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){
+ MemPage *pPage = pCur->pPage;
+ char *zMode = pCur->wrFlag ? "rw" : "ro";
+ sqlite3DebugPrintf("CURSOR %p rooted at %4d(%s) currently at %d.%d%s\n",
+ pCur, pCur->pgnoRoot, zMode,
+ pPage ? pPage->pgno : 0, pCur->idx,
+ pCur->isValid ? "" : " eof"
+ );
+ }
+}
+#endif
+
+/*
+** Rollback the transaction in progress. All cursors will be
+** invalided by this operation. Any attempt to use a cursor
+** that was open at the beginning of this operation will result
+** in an error.
+**
+** This will release the write lock on the database file. If there
+** are no active cursors, it also releases the read lock.
+*/
+int sqlite3BtreeRollback(Btree *pBt){
+ int rc = SQLITE_OK;
+ MemPage *pPage1;
+ if( pBt->inTrans==TRANS_WRITE ){
+ rc = sqlite3pager_rollback(pBt->pPager);
+ /* The rollback may have destroyed the pPage1->aData value. So
+ ** call getPage() on page 1 again to make sure pPage1->aData is
+ ** set correctly. */
+ if( getPage(pBt, 1, &pPage1)==SQLITE_OK ){
+ releasePage(pPage1);
+ }
+ assert( countWriteCursors(pBt)==0 );
+ }
+ pBt->inTrans = TRANS_NONE;
+ pBt->inStmt = 0;
+ unlockBtreeIfUnused(pBt);
+ return rc;
+}
+
+/*
+** Start a statement subtransaction. The subtransaction can
+** can be rolled back independently of the main transaction.
+** You must start a transaction before starting a subtransaction.
+** The subtransaction is ended automatically if the main transaction
+** commits or rolls back.
+**
+** Only one subtransaction may be active at a time. It is an error to try
+** to start a new subtransaction if another subtransaction is already active.
+**
+** Statement subtransactions are used around individual SQL statements
+** that are contained within a BEGIN...COMMIT block. If a constraint
+** error occurs within the statement, the effect of that one statement
+** can be rolled back without having to rollback the entire transaction.
+*/
+int sqlite3BtreeBeginStmt(Btree *pBt){
+ int rc;
+ if( (pBt->inTrans!=TRANS_WRITE) || pBt->inStmt ){
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
+ }
+ rc = pBt->readOnly ? SQLITE_OK : sqlite3pager_stmt_begin(pBt->pPager);
+ pBt->inStmt = 1;
+ return rc;
+}
+
+
+/*
+** Commit the statment subtransaction currently in progress. If no
+** subtransaction is active, this is a no-op.
+*/
+int sqlite3BtreeCommitStmt(Btree *pBt){
+ int rc;
+ if( pBt->inStmt && !pBt->readOnly ){
+ rc = sqlite3pager_stmt_commit(pBt->pPager);
+ }else{
+ rc = SQLITE_OK;
+ }
+ pBt->inStmt = 0;
+ return rc;
+}
+
+/*
+** Rollback the active statement subtransaction. If no subtransaction
+** is active this routine is a no-op.
+**
+** All cursors will be invalidated by this operation. Any attempt
+** to use a cursor that was open at the beginning of this operation
+** will result in an error.
+*/
+int sqlite3BtreeRollbackStmt(Btree *pBt){
+ int rc;
+ if( pBt->inStmt==0 || pBt->readOnly ) return SQLITE_OK;
+ rc = sqlite3pager_stmt_rollback(pBt->pPager);
+ assert( countWriteCursors(pBt)==0 );
+ pBt->inStmt = 0;
+ return rc;
+}
+
+/*
+** Default key comparison function to be used if no comparison function
+** is specified on the sqlite3BtreeCursor() call.
+*/
+static int dfltCompare(
+ void *NotUsed, /* User data is not used */
+ int n1, const void *p1, /* First key to compare */
+ int n2, const void *p2 /* Second key to compare */
+){
+ int c;
+ c = memcmp(p1, p2, n1<n2 ? n1 : n2);
+ if( c==0 ){
+ c = n1 - n2;
+ }
+ return c;
+}
+
+/*
+** Create a new cursor for the BTree whose root is on the page
+** iTable. The act of acquiring a cursor gets a read lock on
+** the database file.
+**
+** If wrFlag==0, then the cursor can only be used for reading.
+** If wrFlag==1, then the cursor can be used for reading or for
+** writing if other conditions for writing are also met. These
+** are the conditions that must be met in order for writing to
+** be allowed:
+**
+** 1: The cursor must have been opened with wrFlag==1
+**
+** 2: No other cursors may be open with wrFlag==0 on the same table
+**
+** 3: The database must be writable (not on read-only media)
+**
+** 4: There must be an active transaction.
+**
+** Condition 2 warrants further discussion. If any cursor is opened
+** on a table with wrFlag==0, that prevents all other cursors from
+** writing to that table. This is a kind of "read-lock". When a cursor
+** is opened with wrFlag==0 it is guaranteed that the table will not
+** change as long as the cursor is open. This allows the cursor to
+** do a sequential scan of the table without having to worry about
+** entries being inserted or deleted during the scan. Cursors should
+** be opened with wrFlag==0 only if this read-lock property is needed.
+** That is to say, cursors should be opened with wrFlag==0 only if they
+** intend to use the sqlite3BtreeNext() system call. All other cursors
+** should be opened with wrFlag==1 even if they never really intend
+** to write.
+**
+** No checking is done to make sure that page iTable really is the
+** root page of a b-tree. If it is not, then the cursor acquired
+** will not work correctly.
+**
+** The comparison function must be logically the same for every cursor
+** on a particular table. Changing the comparison function will result
+** in incorrect operations. If the comparison function is NULL, a
+** default comparison function is used. The comparison function is
+** always ignored for INTKEY tables.
+*/
+int sqlite3BtreeCursor(
+ Btree *pBt, /* The btree */
+ int iTable, /* Root page of table to open */
+ int wrFlag, /* 1 to write. 0 read-only */
+ int (*xCmp)(void*,int,const void*,int,const void*), /* Key Comparison func */
+ void *pArg, /* First arg to xCompare() */
+ BtCursor **ppCur /* Write new cursor here */
+){
+ int rc;
+ BtCursor *pCur;
+
+ *ppCur = 0;
+ if( wrFlag ){
+ if( pBt->readOnly ){
+ return SQLITE_READONLY;
+ }
+ if( checkReadLocks(pBt, iTable, 0) ){
+ return SQLITE_LOCKED;
+ }
+ }
+ if( pBt->pPage1==0 ){
+ rc = lockBtreeWithRetry(pBt);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ }
+ pCur = sqliteMallocRaw( sizeof(*pCur) );
+ if( pCur==0 ){
+ rc = SQLITE_NOMEM;
+ goto create_cursor_exception;
+ }
+ pCur->pgnoRoot = (Pgno)iTable;
+ pCur->pPage = 0; /* For exit-handler, in case getAndInitPage() fails. */
+ if( iTable==1 && sqlite3pager_pagecount(pBt->pPager)==0 ){
+ rc = SQLITE_EMPTY;
+ goto create_cursor_exception;
+ }
+ rc = getAndInitPage(pBt, pCur->pgnoRoot, &pCur->pPage, 0);
+ if( rc!=SQLITE_OK ){
+ goto create_cursor_exception;
+ }
+ pCur->xCompare = xCmp ? xCmp : dfltCompare;
+ pCur->pArg = pArg;
+ pCur->pBt = pBt;
+ pCur->wrFlag = wrFlag;
+ pCur->idx = 0;
+ memset(&pCur->info, 0, sizeof(pCur->info));
+ pCur->pNext = pBt->pCursor;
+ if( pCur->pNext ){
+ pCur->pNext->pPrev = pCur;
+ }
+ pCur->pPrev = 0;
+ pBt->pCursor = pCur;
+ pCur->isValid = 0;
+ *ppCur = pCur;
+ return SQLITE_OK;
+
+create_cursor_exception:
+ if( pCur ){
+ releasePage(pCur->pPage);
+ sqliteFree(pCur);
+ }
+ unlockBtreeIfUnused(pBt);
+ return rc;
+}
+
+#if 0 /* Not Used */
+/*
+** Change the value of the comparison function used by a cursor.
+*/
+void sqlite3BtreeSetCompare(
+ BtCursor *pCur, /* The cursor to whose comparison function is changed */
+ int(*xCmp)(void*,int,const void*,int,const void*), /* New comparison func */
+ void *pArg /* First argument to xCmp() */
+){
+ pCur->xCompare = xCmp ? xCmp : dfltCompare;
+ pCur->pArg = pArg;
+}
+#endif
+
+/*
+** Close a cursor. The read lock on the database file is released
+** when the last cursor is closed.
+*/
+int sqlite3BtreeCloseCursor(BtCursor *pCur){
+ Btree *pBt = pCur->pBt;
+ if( pCur->pPrev ){
+ pCur->pPrev->pNext = pCur->pNext;
+ }else{
+ pBt->pCursor = pCur->pNext;
+ }
+ if( pCur->pNext ){
+ pCur->pNext->pPrev = pCur->pPrev;
+ }
+ releasePage(pCur->pPage);
+ unlockBtreeIfUnused(pBt);
+ sqliteFree(pCur);
+ return SQLITE_OK;
+}
+
+/*
+** Make a temporary cursor by filling in the fields of pTempCur.
+** The temporary cursor is not on the cursor list for the Btree.
+*/
+static void getTempCursor(BtCursor *pCur, BtCursor *pTempCur){
+ memcpy(pTempCur, pCur, sizeof(*pCur));
+ pTempCur->pNext = 0;
+ pTempCur->pPrev = 0;
+ if( pTempCur->pPage ){
+ sqlite3pager_ref(pTempCur->pPage->aData);
+ }
+}
+
+/*
+** Delete a temporary cursor such as was made by the CreateTemporaryCursor()
+** function above.
+*/
+static void releaseTempCursor(BtCursor *pCur){
+ if( pCur->pPage ){
+ sqlite3pager_unref(pCur->pPage->aData);
+ }
+}
+
+/*
+** Make sure the BtCursor.info field of the given cursor is valid.
+** If it is not already valid, call parseCell() to fill it in.
+**
+** BtCursor.info is a cache of the information in the current cell.
+** Using this cache reduces the number of calls to parseCell().
+*/
+static void getCellInfo(BtCursor *pCur){
+ if( pCur->info.nSize==0 ){
+ parseCell(pCur->pPage, pCur->idx, &pCur->info);
+ }else{
+#ifndef NDEBUG
+ CellInfo info;
+ memset(&info, 0, sizeof(info));
+ parseCell(pCur->pPage, pCur->idx, &info);
+ assert( memcmp(&info, &pCur->info, sizeof(info))==0 );
+#endif
+ }
+}
+
+/*
+** Set *pSize to the size of the buffer needed to hold the value of
+** the key for the current entry. If the cursor is not pointing
+** to a valid entry, *pSize is set to 0.
+**
+** For a table with the INTKEY flag set, this routine returns the key
+** itself, not the number of bytes in the key.
+*/
+int sqlite3BtreeKeySize(BtCursor *pCur, i64 *pSize){
+ if( !pCur->isValid ){
+ *pSize = 0;
+ }else{
+ getCellInfo(pCur);
+ *pSize = pCur->info.nKey;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Set *pSize to the number of bytes of data in the entry the
+** cursor currently points to. Always return SQLITE_OK.
+** Failure is not possible. If the cursor is not currently
+** pointing to an entry (which can happen, for example, if
+** the database is empty) then *pSize is set to 0.
+*/
+int sqlite3BtreeDataSize(BtCursor *pCur, u32 *pSize){
+ if( !pCur->isValid ){
+ /* Not pointing at a valid entry - set *pSize to 0. */
+ *pSize = 0;
+ }else{
+ getCellInfo(pCur);
+ *pSize = pCur->info.nData;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Read payload information from the entry that the pCur cursor is
+** pointing to. Begin reading the payload at "offset" and read
+** a total of "amt" bytes. Put the result in zBuf.
+**
+** This routine does not make a distinction between key and data.
+** It just reads bytes from the payload area. Data might appear
+** on the main page or be scattered out on multiple overflow pages.
+*/
+static int getPayload(
+ BtCursor *pCur, /* Cursor pointing to entry to read from */
+ int offset, /* Begin reading this far into payload */
+ int amt, /* Read this many bytes */
+ unsigned char *pBuf, /* Write the bytes into this buffer */
+ int skipKey /* offset begins at data if this is true */
+){
+ unsigned char *aPayload;
+ Pgno nextPage;
+ int rc;
+ MemPage *pPage;
+ Btree *pBt;
+ int ovflSize;
+ u32 nKey;
+
+ assert( pCur!=0 && pCur->pPage!=0 );
+ assert( pCur->isValid );
+ pBt = pCur->pBt;
+ pPage = pCur->pPage;
+ pageIntegrity(pPage);
+ assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
+ getCellInfo(pCur);
+ aPayload = pCur->info.pCell;
+ aPayload += pCur->info.nHeader;
+ if( pPage->intKey ){
+ nKey = 0;
+ }else{
+ nKey = pCur->info.nKey;
+ }
+ assert( offset>=0 );
+ if( skipKey ){
+ offset += nKey;
+ }
+ if( offset+amt > nKey+pCur->info.nData ){
+ return SQLITE_ERROR;
+ }
+ if( offset<pCur->info.nLocal ){
+ int a = amt;
+ if( a+offset>pCur->info.nLocal ){
+ a = pCur->info.nLocal - offset;
+ }
+ memcpy(pBuf, &aPayload[offset], a);
+ if( a==amt ){
+ return SQLITE_OK;
+ }
+ offset = 0;
+ pBuf += a;
+ amt -= a;
+ }else{
+ offset -= pCur->info.nLocal;
+ }
+ ovflSize = pBt->usableSize - 4;
+ if( amt>0 ){
+ nextPage = get4byte(&aPayload[pCur->info.nLocal]);
+ while( amt>0 && nextPage ){
+ rc = sqlite3pager_get(pBt->pPager, nextPage, (void**)&aPayload);
+ if( rc!=0 ){
+ return rc;
+ }
+ nextPage = get4byte(aPayload);
+ if( offset<ovflSize ){
+ int a = amt;
+ if( a + offset > ovflSize ){
+ a = ovflSize - offset;
+ }
+ memcpy(pBuf, &aPayload[offset+4], a);
+ offset = 0;
+ amt -= a;
+ pBuf += a;
+ }else{
+ offset -= ovflSize;
+ }
+ sqlite3pager_unref(aPayload);
+ }
+ }
+
+ if( amt>0 ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Read part of the key associated with cursor pCur. Exactly
+** "amt" bytes will be transfered into pBuf[]. The transfer
+** begins at "offset".
+**
+** Return SQLITE_OK on success or an error code if anything goes
+** wrong. An error is returned if "offset+amt" is larger than
+** the available payload.
+*/
+int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
+ assert( pCur->isValid );
+ assert( pCur->pPage!=0 );
+ if( pCur->pPage->intKey ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ assert( pCur->pPage->intKey==0 );
+ assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
+ return getPayload(pCur, offset, amt, (unsigned char*)pBuf, 0);
+}
+
+/*
+** Read part of the data associated with cursor pCur. Exactly
+** "amt" bytes will be transfered into pBuf[]. The transfer
+** begins at "offset".
+**
+** Return SQLITE_OK on success or an error code if anything goes
+** wrong. An error is returned if "offset+amt" is larger than
+** the available payload.
+*/
+int sqlite3BtreeData(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
+ assert( pCur->isValid );
+ assert( pCur->pPage!=0 );
+ assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
+ return getPayload(pCur, offset, amt, pBuf, 1);
+}
+
+/*
+** Return a pointer to payload information from the entry that the
+** pCur cursor is pointing to. The pointer is to the beginning of
+** the key if skipKey==0 and it points to the beginning of data if
+** skipKey==1. The number of bytes of available key/data is written
+** into *pAmt. If *pAmt==0, then the value returned will not be
+** a valid pointer.
+**
+** This routine is an optimization. It is common for the entire key
+** and data to fit on the local page and for there to be no overflow
+** pages. When that is so, this routine can be used to access the
+** key and data without making a copy. If the key and/or data spills
+** onto overflow pages, then getPayload() must be used to reassembly
+** the key/data and copy it into a preallocated buffer.
+**
+** The pointer returned by this routine looks directly into the cached
+** page of the database. The data might change or move the next time
+** any btree routine is called.
+*/
+static const unsigned char *fetchPayload(
+ BtCursor *pCur, /* Cursor pointing to entry to read from */
+ int *pAmt, /* Write the number of available bytes here */
+ int skipKey /* read beginning at data if this is true */
+){
+ unsigned char *aPayload;
+ MemPage *pPage;
+ u32 nKey;
+ int nLocal;
+
+ assert( pCur!=0 && pCur->pPage!=0 );
+ assert( pCur->isValid );
+ pPage = pCur->pPage;
+ pageIntegrity(pPage);
+ assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
+ getCellInfo(pCur);
+ aPayload = pCur->info.pCell;
+ aPayload += pCur->info.nHeader;
+ if( pPage->intKey ){
+ nKey = 0;
+ }else{
+ nKey = pCur->info.nKey;
+ }
+ if( skipKey ){
+ aPayload += nKey;
+ nLocal = pCur->info.nLocal - nKey;
+ }else{
+ nLocal = pCur->info.nLocal;
+ if( nLocal>nKey ){
+ nLocal = nKey;
+ }
+ }
+ *pAmt = nLocal;
+ return aPayload;
+}
+
+
+/*
+** For the entry that cursor pCur is point to, return as
+** many bytes of the key or data as are available on the local
+** b-tree page. Write the number of available bytes into *pAmt.
+**
+** The pointer returned is ephemeral. The key/data may move
+** or be destroyed on the next call to any Btree routine.
+**
+** These routines is used to get quick access to key and data
+** in the common case where no overflow pages are used.
+*/
+const void *sqlite3BtreeKeyFetch(BtCursor *pCur, int *pAmt){
+ return (const void*)fetchPayload(pCur, pAmt, 0);
+}
+const void *sqlite3BtreeDataFetch(BtCursor *pCur, int *pAmt){
+ return (const void*)fetchPayload(pCur, pAmt, 1);
+}
+
+
+/*
+** Move the cursor down to a new child page. The newPgno argument is the
+** page number of the child page to move to.
+*/
+static int moveToChild(BtCursor *pCur, u32 newPgno){
+ int rc;
+ MemPage *pNewPage;
+ MemPage *pOldPage;
+ Btree *pBt = pCur->pBt;
+
+ assert( pCur->isValid );
+ rc = getAndInitPage(pBt, newPgno, &pNewPage, pCur->pPage);
+ if( rc ) return rc;
+ pageIntegrity(pNewPage);
+ pNewPage->idxParent = pCur->idx;
+ pOldPage = pCur->pPage;
+ pOldPage->idxShift = 0;
+ releasePage(pOldPage);
+ pCur->pPage = pNewPage;
+ pCur->idx = 0;
+ pCur->info.nSize = 0;
+ if( pNewPage->nCell<1 ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Return true if the page is the virtual root of its table.
+**
+** The virtual root page is the root page for most tables. But
+** for the table rooted on page 1, sometime the real root page
+** is empty except for the right-pointer. In such cases the
+** virtual root page is the page that the right-pointer of page
+** 1 is pointing to.
+*/
+static int isRootPage(MemPage *pPage){
+ MemPage *pParent = pPage->pParent;
+ if( pParent==0 ) return 1;
+ if( pParent->pgno>1 ) return 0;
+ if( get2byte(&pParent->aData[pParent->hdrOffset+3])==0 ) return 1;
+ return 0;
+}
+
+/*
+** Move the cursor up to the parent page.
+**
+** pCur->idx is set to the cell index that contains the pointer
+** to the page we are coming from. If we are coming from the
+** right-most child page then pCur->idx is set to one more than
+** the largest cell index.
+*/
+static void moveToParent(BtCursor *pCur){
+ MemPage *pParent;
+ MemPage *pPage;
+ int idxParent;
+
+ assert( pCur->isValid );
+ pPage = pCur->pPage;
+ assert( pPage!=0 );
+ assert( !isRootPage(pPage) );
+ pageIntegrity(pPage);
+ pParent = pPage->pParent;
+ assert( pParent!=0 );
+ pageIntegrity(pParent);
+ idxParent = pPage->idxParent;
+ sqlite3pager_ref(pParent->aData);
+ releasePage(pPage);
+ pCur->pPage = pParent;
+ pCur->info.nSize = 0;
+ assert( pParent->idxShift==0 );
+ pCur->idx = idxParent;
+}
+
+/*
+** Move the cursor to the root page
+*/
+static int moveToRoot(BtCursor *pCur){
+ MemPage *pRoot;
+ int rc;
+ Btree *pBt = pCur->pBt;
+
+ rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0);
+ if( rc ){
+ pCur->isValid = 0;
+ return rc;
+ }
+ releasePage(pCur->pPage);
+ pageIntegrity(pRoot);
+ pCur->pPage = pRoot;
+ pCur->idx = 0;
+ pCur->info.nSize = 0;
+ if( pRoot->nCell==0 && !pRoot->leaf ){
+ Pgno subpage;
+ assert( pRoot->pgno==1 );
+ subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]);
+ assert( subpage>0 );
+ pCur->isValid = 1;
+ rc = moveToChild(pCur, subpage);
+ }
+ pCur->isValid = pCur->pPage->nCell>0;
+ return rc;
+}
+
+/*
+** Move the cursor down to the left-most leaf entry beneath the
+** entry to which it is currently pointing.
+*/
+static int moveToLeftmost(BtCursor *pCur){
+ Pgno pgno;
+ int rc;
+ MemPage *pPage;
+
+ assert( pCur->isValid );
+ while( !(pPage = pCur->pPage)->leaf ){
+ assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
+ pgno = get4byte(findCell(pPage, pCur->idx));
+ rc = moveToChild(pCur, pgno);
+ if( rc ) return rc;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Move the cursor down to the right-most leaf entry beneath the
+** page to which it is currently pointing. Notice the difference
+** between moveToLeftmost() and moveToRightmost(). moveToLeftmost()
+** finds the left-most entry beneath the *entry* whereas moveToRightmost()
+** finds the right-most entry beneath the *page*.
+*/
+static int moveToRightmost(BtCursor *pCur){
+ Pgno pgno;
+ int rc;
+ MemPage *pPage;
+
+ assert( pCur->isValid );
+ while( !(pPage = pCur->pPage)->leaf ){
+ pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]);
+ pCur->idx = pPage->nCell;
+ rc = moveToChild(pCur, pgno);
+ if( rc ) return rc;
+ }
+ pCur->idx = pPage->nCell - 1;
+ pCur->info.nSize = 0;
+ return SQLITE_OK;
+}
+
+/* Move the cursor to the first entry in the table. Return SQLITE_OK
+** on success. Set *pRes to 0 if the cursor actually points to something
+** or set *pRes to 1 if the table is empty.
+*/
+int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){
+ int rc;
+ rc = moveToRoot(pCur);
+ if( rc ) return rc;
+ if( pCur->isValid==0 ){
+ assert( pCur->pPage->nCell==0 );
+ *pRes = 1;
+ return SQLITE_OK;
+ }
+ assert( pCur->pPage->nCell>0 );
+ *pRes = 0;
+ rc = moveToLeftmost(pCur);
+ return rc;
+}
+
+/* Move the cursor to the last entry in the table. Return SQLITE_OK
+** on success. Set *pRes to 0 if the cursor actually points to something
+** or set *pRes to 1 if the table is empty.
+*/
+int sqlite3BtreeLast(BtCursor *pCur, int *pRes){
+ int rc;
+ rc = moveToRoot(pCur);
+ if( rc ) return rc;
+ if( pCur->isValid==0 ){
+ assert( pCur->pPage->nCell==0 );
+ *pRes = 1;
+ return SQLITE_OK;
+ }
+ assert( pCur->isValid );
+ *pRes = 0;
+ rc = moveToRightmost(pCur);
+ return rc;
+}
+
+/* Move the cursor so that it points to an entry near pKey/nKey.
+** Return a success code.
+**
+** For INTKEY tables, only the nKey parameter is used. pKey is
+** ignored. For other tables, nKey is the number of bytes of data
+** in nKey. The comparison function specified when the cursor was
+** created is used to compare keys.
+**
+** If an exact match is not found, then the cursor is always
+** left pointing at a leaf page which would hold the entry if it
+** were present. The cursor might point to an entry that comes
+** before or after the key.
+**
+** The result of comparing the key with the entry to which the
+** cursor is written to *pRes if pRes!=NULL. The meaning of
+** this value is as follows:
+**
+** *pRes<0 The cursor is left pointing at an entry that
+** is smaller than pKey or if the table is empty
+** and the cursor is therefore left point to nothing.
+**
+** *pRes==0 The cursor is left pointing at an entry that
+** exactly matches pKey.
+**
+** *pRes>0 The cursor is left pointing at an entry that
+** is larger than pKey.
+*/
+int sqlite3BtreeMoveto(BtCursor *pCur, const void *pKey, i64 nKey, int *pRes){
+ int rc;
+ rc = moveToRoot(pCur);
+ if( rc ) return rc;
+ assert( pCur->pPage );
+ assert( pCur->pPage->isInit );
+ if( pCur->isValid==0 ){
+ *pRes = -1;
+ assert( pCur->pPage->nCell==0 );
+ return SQLITE_OK;
+ }
+ for(;;){
+ int lwr, upr;
+ Pgno chldPg;
+ MemPage *pPage = pCur->pPage;
+ int c = -1; /* pRes return if table is empty must be -1 */
+ lwr = 0;
+ upr = pPage->nCell-1;
+ if( !pPage->intKey && pKey==0 ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ pageIntegrity(pPage);
+ while( lwr<=upr ){
+ void *pCellKey;
+ i64 nCellKey;
+ pCur->idx = (lwr+upr)/2;
+ pCur->info.nSize = 0;
+ sqlite3BtreeKeySize(pCur, &nCellKey);
+ if( pPage->intKey ){
+ if( nCellKey<nKey ){
+ c = -1;
+ }else if( nCellKey>nKey ){
+ c = +1;
+ }else{
+ c = 0;
+ }
+ }else{
+ int available;
+ pCellKey = (void *)fetchPayload(pCur, &available, 0);
+ if( available>=nCellKey ){
+ c = pCur->xCompare(pCur->pArg, nCellKey, pCellKey, nKey, pKey);
+ }else{
+ pCellKey = sqliteMallocRaw( nCellKey );
+ if( pCellKey==0 ) return SQLITE_NOMEM;
+ rc = sqlite3BtreeKey(pCur, 0, nCellKey, (void *)pCellKey);
+ c = pCur->xCompare(pCur->pArg, nCellKey, pCellKey, nKey, pKey);
+ sqliteFree(pCellKey);
+ if( rc ) return rc;
+ }
+ }
+ if( c==0 ){
+ if( pPage->leafData && !pPage->leaf ){
+ lwr = pCur->idx;
+ upr = lwr - 1;
+ break;
+ }else{
+ if( pRes ) *pRes = 0;
+ return SQLITE_OK;
+ }
+ }
+ if( c<0 ){
+ lwr = pCur->idx+1;
+ }else{
+ upr = pCur->idx-1;
+ }
+ }
+ assert( lwr==upr+1 );
+ assert( pPage->isInit );
+ if( pPage->leaf ){
+ chldPg = 0;
+ }else if( lwr>=pPage->nCell ){
+ chldPg = get4byte(&pPage->aData[pPage->hdrOffset+8]);
+ }else{
+ chldPg = get4byte(findCell(pPage, lwr));
+ }
+ if( chldPg==0 ){
+ assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
+ if( pRes ) *pRes = c;
+ return SQLITE_OK;
+ }
+ pCur->idx = lwr;
+ pCur->info.nSize = 0;
+ rc = moveToChild(pCur, chldPg);
+ if( rc ){
+ return rc;
+ }
+ }
+ /* NOT REACHED */
+}
+
+/*
+** Return TRUE if the cursor is not pointing at an entry of the table.
+**
+** TRUE will be returned after a call to sqlite3BtreeNext() moves
+** past the last entry in the table or sqlite3BtreePrev() moves past
+** the first entry. TRUE is also returned if the table is empty.
+*/
+int sqlite3BtreeEof(BtCursor *pCur){
+ return pCur->isValid==0;
+}
+
+/*
+** Advance the cursor to the next entry in the database. If
+** successful then set *pRes=0. If the cursor
+** was already pointing to the last entry in the database before
+** this routine was called, then set *pRes=1.
+*/
+int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
+ int rc;
+ MemPage *pPage = pCur->pPage;
+
+ assert( pRes!=0 );
+ if( pCur->isValid==0 ){
+ *pRes = 1;
+ return SQLITE_OK;
+ }
+ assert( pPage->isInit );
+ assert( pCur->idx<pPage->nCell );
+
+ pCur->idx++;
+ pCur->info.nSize = 0;
+ if( pCur->idx>=pPage->nCell ){
+ if( !pPage->leaf ){
+ rc = moveToChild(pCur, get4byte(&pPage->aData[pPage->hdrOffset+8]));
+ if( rc ) return rc;
+ rc = moveToLeftmost(pCur);
+ *pRes = 0;
+ return rc;
+ }
+ do{
+ if( isRootPage(pPage) ){
+ *pRes = 1;
+ pCur->isValid = 0;
+ return SQLITE_OK;
+ }
+ moveToParent(pCur);
+ pPage = pCur->pPage;
+ }while( pCur->idx>=pPage->nCell );
+ *pRes = 0;
+ if( pPage->leafData ){
+ rc = sqlite3BtreeNext(pCur, pRes);
+ }else{
+ rc = SQLITE_OK;
+ }
+ return rc;
+ }
+ *pRes = 0;
+ if( pPage->leaf ){
+ return SQLITE_OK;
+ }
+ rc = moveToLeftmost(pCur);
+ return rc;
+}
+
+/*
+** Step the cursor to the back to the previous entry in the database. If
+** successful then set *pRes=0. If the cursor
+** was already pointing to the first entry in the database before
+** this routine was called, then set *pRes=1.
+*/
+int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
+ int rc;
+ Pgno pgno;
+ MemPage *pPage;
+ if( pCur->isValid==0 ){
+ *pRes = 1;
+ return SQLITE_OK;
+ }
+
+ pPage = pCur->pPage;
+ assert( pPage->isInit );
+ assert( pCur->idx>=0 );
+ if( !pPage->leaf ){
+ pgno = get4byte( findCell(pPage, pCur->idx) );
+ rc = moveToChild(pCur, pgno);
+ if( rc ) return rc;
+ rc = moveToRightmost(pCur);
+ }else{
+ while( pCur->idx==0 ){
+ if( isRootPage(pPage) ){
+ pCur->isValid = 0;
+ *pRes = 1;
+ return SQLITE_OK;
+ }
+ moveToParent(pCur);
+ pPage = pCur->pPage;
+ }
+ pCur->idx--;
+ pCur->info.nSize = 0;
+ if( pPage->leafData && !pPage->leaf ){
+ rc = sqlite3BtreePrevious(pCur, pRes);
+ }else{
+ rc = SQLITE_OK;
+ }
+ }
+ *pRes = 0;
+ return rc;
+}
+
+/*
+** Allocate a new page from the database file.
+**
+** The new page is marked as dirty. (In other words, sqlite3pager_write()
+** has already been called on the new page.) The new page has also
+** been referenced and the calling routine is responsible for calling
+** sqlite3pager_unref() on the new page when it is done.
+**
+** SQLITE_OK is returned on success. Any other return value indicates
+** an error. *ppPage and *pPgno are undefined in the event of an error.
+** Do not invoke sqlite3pager_unref() on *ppPage if an error is returned.
+**
+** If the "nearby" parameter is not 0, then a (feeble) effort is made to
+** locate a page close to the page number "nearby". This can be used in an
+** attempt to keep related pages close to each other in the database file,
+** which in turn can make database access faster.
+**
+** If the "exact" parameter is not 0, and the page-number nearby exists
+** anywhere on the free-list, then it is guarenteed to be returned. This
+** is only used by auto-vacuum databases when allocating a new table.
+*/
+static int allocatePage(
+ Btree *pBt,
+ MemPage **ppPage,
+ Pgno *pPgno,
+ Pgno nearby,
+ u8 exact
+){
+ MemPage *pPage1;
+ int rc;
+ int n; /* Number of pages on the freelist */
+ int k; /* Number of leaves on the trunk of the freelist */
+
+ pPage1 = pBt->pPage1;
+ n = get4byte(&pPage1->aData[36]);
+ if( n>0 ){
+ /* There are pages on the freelist. Reuse one of those pages. */
+ MemPage *pTrunk = 0;
+ Pgno iTrunk;
+ MemPage *pPrevTrunk = 0;
+ u8 searchList = 0; /* If the free-list must be searched for 'nearby' */
+
+ /* If the 'exact' parameter was true and a query of the pointer-map
+ ** shows that the page 'nearby' is somewhere on the free-list, then
+ ** the entire-list will be searched for that page.
+ */
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( exact ){
+ u8 eType;
+ assert( nearby>0 );
+ assert( pBt->autoVacuum );
+ rc = ptrmapGet(pBt, nearby, &eType, 0);
+ if( rc ) return rc;
+ if( eType==PTRMAP_FREEPAGE ){
+ searchList = 1;
+ }
+ *pPgno = nearby;
+ }
+#endif
+
+ /* Decrement the free-list count by 1. Set iTrunk to the index of the
+ ** first free-list trunk page. iPrevTrunk is initially 1.
+ */
+ rc = sqlite3pager_write(pPage1->aData);
+ if( rc ) return rc;
+ put4byte(&pPage1->aData[36], n-1);
+
+ /* The code within this loop is run only once if the 'searchList' variable
+ ** is not true. Otherwise, it runs once for each trunk-page on the
+ ** free-list until the page 'nearby' is located.
+ */
+ do {
+ pPrevTrunk = pTrunk;
+ if( pPrevTrunk ){
+ iTrunk = get4byte(&pPrevTrunk->aData[0]);
+ }else{
+ iTrunk = get4byte(&pPage1->aData[32]);
+ }
+ rc = getPage(pBt, iTrunk, &pTrunk);
+ if( rc ){
+ releasePage(pPrevTrunk);
+ return rc;
+ }
+
+ /* TODO: This should move to after the loop? */
+ rc = sqlite3pager_write(pTrunk->aData);
+ if( rc ){
+ releasePage(pTrunk);
+ releasePage(pPrevTrunk);
+ return rc;
+ }
+
+ k = get4byte(&pTrunk->aData[4]);
+ if( k==0 && !searchList ){
+ /* The trunk has no leaves and the list is not being searched.
+ ** So extract the trunk page itself and use it as the newly
+ ** allocated page */
+ assert( pPrevTrunk==0 );
+ *pPgno = iTrunk;
+ memcpy(&pPage1->aData[32], &pTrunk->aData[0], 4);
+ *ppPage = pTrunk;
+ pTrunk = 0;
+ TRACE(("ALLOCATE: %d trunk - %d free pages left\n", *pPgno, n-1));
+ }else if( k>pBt->usableSize/4 - 8 ){
+ /* Value of k is out of range. Database corruption */
+ return SQLITE_CORRUPT_BKPT;
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ }else if( searchList && nearby==iTrunk ){
+ /* The list is being searched and this trunk page is the page
+ ** to allocate, regardless of whether it has leaves.
+ */
+ assert( *pPgno==iTrunk );
+ *ppPage = pTrunk;
+ searchList = 0;
+ if( k==0 ){
+ if( !pPrevTrunk ){
+ memcpy(&pPage1->aData[32], &pTrunk->aData[0], 4);
+ }else{
+ memcpy(&pPrevTrunk->aData[0], &pTrunk->aData[0], 4);
+ }
+ }else{
+ /* The trunk page is required by the caller but it contains
+ ** pointers to free-list leaves. The first leaf becomes a trunk
+ ** page in this case.
+ */
+ MemPage *pNewTrunk;
+ Pgno iNewTrunk = get4byte(&pTrunk->aData[8]);
+ rc = getPage(pBt, iNewTrunk, &pNewTrunk);
+ if( rc!=SQLITE_OK ){
+ releasePage(pTrunk);
+ releasePage(pPrevTrunk);
+ return rc;
+ }
+ rc = sqlite3pager_write(pNewTrunk->aData);
+ if( rc!=SQLITE_OK ){
+ releasePage(pNewTrunk);
+ releasePage(pTrunk);
+ releasePage(pPrevTrunk);
+ return rc;
+ }
+ memcpy(&pNewTrunk->aData[0], &pTrunk->aData[0], 4);
+ put4byte(&pNewTrunk->aData[4], k-1);
+ memcpy(&pNewTrunk->aData[8], &pTrunk->aData[12], (k-1)*4);
+ if( !pPrevTrunk ){
+ put4byte(&pPage1->aData[32], iNewTrunk);
+ }else{
+ put4byte(&pPrevTrunk->aData[0], iNewTrunk);
+ }
+ releasePage(pNewTrunk);
+ }
+ pTrunk = 0;
+ TRACE(("ALLOCATE: %d trunk - %d free pages left\n", *pPgno, n-1));
+#endif
+ }else{
+ /* Extract a leaf from the trunk */
+ int closest;
+ Pgno iPage;
+ unsigned char *aData = pTrunk->aData;
+ if( nearby>0 ){
+ int i, dist;
+ closest = 0;
+ dist = get4byte(&aData[8]) - nearby;
+ if( dist<0 ) dist = -dist;
+ for(i=1; i<k; i++){
+ int d2 = get4byte(&aData[8+i*4]) - nearby;
+ if( d2<0 ) d2 = -d2;
+ if( d2<dist ){
+ closest = i;
+ dist = d2;
+ }
+ }
+ }else{
+ closest = 0;
+ }
+
+ iPage = get4byte(&aData[8+closest*4]);
+ if( !searchList || iPage==nearby ){
+ *pPgno = iPage;
+ if( *pPgno>sqlite3pager_pagecount(pBt->pPager) ){
+ /* Free page off the end of the file */
+ return SQLITE_CORRUPT_BKPT;
+ }
+ TRACE(("ALLOCATE: %d was leaf %d of %d on trunk %d"
+ ": %d more free pages\n",
+ *pPgno, closest+1, k, pTrunk->pgno, n-1));
+ if( closest<k-1 ){
+ memcpy(&aData[8+closest*4], &aData[4+k*4], 4);
+ }
+ put4byte(&aData[4], k-1);
+ rc = getPage(pBt, *pPgno, ppPage);
+ if( rc==SQLITE_OK ){
+ sqlite3pager_dont_rollback((*ppPage)->aData);
+ rc = sqlite3pager_write((*ppPage)->aData);
+ if( rc!=SQLITE_OK ){
+ releasePage(*ppPage);
+ }
+ }
+ searchList = 0;
+ }
+ }
+ releasePage(pPrevTrunk);
+ }while( searchList );
+ releasePage(pTrunk);
+ }else{
+ /* There are no pages on the freelist, so create a new page at the
+ ** end of the file */
+ *pPgno = sqlite3pager_pagecount(pBt->pPager) + 1;
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt->usableSize, *pPgno) ){
+ /* If *pPgno refers to a pointer-map page, allocate two new pages
+ ** at the end of the file instead of one. The first allocated page
+ ** becomes a new pointer-map page, the second is used by the caller.
+ */
+ TRACE(("ALLOCATE: %d from end of file (pointer-map page)\n", *pPgno));
+ assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
+ (*pPgno)++;
+ }
+#endif
+
+ assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
+ rc = getPage(pBt, *pPgno, ppPage);
+ if( rc ) return rc;
+ rc = sqlite3pager_write((*ppPage)->aData);
+ if( rc!=SQLITE_OK ){
+ releasePage(*ppPage);
+ }
+ TRACE(("ALLOCATE: %d from end of file\n", *pPgno));
+ }
+
+ assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
+ return rc;
+}
+
+/*
+** Add a page of the database file to the freelist.
+**
+** sqlite3pager_unref() is NOT called for pPage.
+*/
+static int freePage(MemPage *pPage){
+ Btree *pBt = pPage->pBt;
+ MemPage *pPage1 = pBt->pPage1;
+ int rc, n, k;
+
+ /* Prepare the page for freeing */
+ assert( pPage->pgno>1 );
+ pPage->isInit = 0;
+ releasePage(pPage->pParent);
+ pPage->pParent = 0;
+
+ /* Increment the free page count on pPage1 */
+ rc = sqlite3pager_write(pPage1->aData);
+ if( rc ) return rc;
+ n = get4byte(&pPage1->aData[36]);
+ put4byte(&pPage1->aData[36], n+1);
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ /* If the database supports auto-vacuum, write an entry in the pointer-map
+ ** to indicate that the page is free.
+ */
+ if( pBt->autoVacuum ){
+ rc = ptrmapPut(pBt, pPage->pgno, PTRMAP_FREEPAGE, 0);
+ if( rc ) return rc;
+ }
+#endif
+
+ if( n==0 ){
+ /* This is the first free page */
+ rc = sqlite3pager_write(pPage->aData);
+ if( rc ) return rc;
+ memset(pPage->aData, 0, 8);
+ put4byte(&pPage1->aData[32], pPage->pgno);
+ TRACE(("FREE-PAGE: %d first\n", pPage->pgno));
+ }else{
+ /* Other free pages already exist. Retrive the first trunk page
+ ** of the freelist and find out how many leaves it has. */
+ MemPage *pTrunk;
+ rc = getPage(pBt, get4byte(&pPage1->aData[32]), &pTrunk);
+ if( rc ) return rc;
+ k = get4byte(&pTrunk->aData[4]);
+ if( k>=pBt->usableSize/4 - 8 ){
+ /* The trunk is full. Turn the page being freed into a new
+ ** trunk page with no leaves. */
+ rc = sqlite3pager_write(pPage->aData);
+ if( rc ) return rc;
+ put4byte(pPage->aData, pTrunk->pgno);
+ put4byte(&pPage->aData[4], 0);
+ put4byte(&pPage1->aData[32], pPage->pgno);
+ TRACE(("FREE-PAGE: %d new trunk page replacing %d\n",
+ pPage->pgno, pTrunk->pgno));
+ }else{
+ /* Add the newly freed page as a leaf on the current trunk */
+ rc = sqlite3pager_write(pTrunk->aData);
+ if( rc ) return rc;
+ put4byte(&pTrunk->aData[4], k+1);
+ put4byte(&pTrunk->aData[8+k*4], pPage->pgno);
+ sqlite3pager_dont_write(pBt->pPager, pPage->pgno);
+ TRACE(("FREE-PAGE: %d leaf on trunk page %d\n",pPage->pgno,pTrunk->pgno));
+ }
+ releasePage(pTrunk);
+ }
+ return rc;
+}
+
+/*
+** Free any overflow pages associated with the given Cell.
+*/
+static int clearCell(MemPage *pPage, unsigned char *pCell){
+ Btree *pBt = pPage->pBt;
+ CellInfo info;
+ Pgno ovflPgno;
+ int rc;
+
+ parseCellPtr(pPage, pCell, &info);
+ if( info.iOverflow==0 ){
+ return SQLITE_OK; /* No overflow pages. Return without doing anything */
+ }
+ ovflPgno = get4byte(&pCell[info.iOverflow]);
+ while( ovflPgno!=0 ){
+ MemPage *pOvfl;
+ if( ovflPgno>sqlite3pager_pagecount(pBt->pPager) ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ rc = getPage(pBt, ovflPgno, &pOvfl);
+ if( rc ) return rc;
+ ovflPgno = get4byte(pOvfl->aData);
+ rc = freePage(pOvfl);
+ sqlite3pager_unref(pOvfl->aData);
+ if( rc ) return rc;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Create the byte sequence used to represent a cell on page pPage
+** and write that byte sequence into pCell[]. Overflow pages are
+** allocated and filled in as necessary. The calling procedure
+** is responsible for making sure sufficient space has been allocated
+** for pCell[].
+**
+** Note that pCell does not necessary need to point to the pPage->aData
+** area. pCell might point to some temporary storage. The cell will
+** be constructed in this temporary area then copied into pPage->aData
+** later.
+*/
+static int fillInCell(
+ MemPage *pPage, /* The page that contains the cell */
+ unsigned char *pCell, /* Complete text of the cell */
+ const void *pKey, i64 nKey, /* The key */
+ const void *pData,int nData, /* The data */
+ int *pnSize /* Write cell size here */
+){
+ int nPayload;
+ const u8 *pSrc;
+ int nSrc, n, rc;
+ int spaceLeft;
+ MemPage *pOvfl = 0;
+ MemPage *pToRelease = 0;
+ unsigned char *pPrior;
+ unsigned char *pPayload;
+ Btree *pBt = pPage->pBt;
+ Pgno pgnoOvfl = 0;
+ int nHeader;
+ CellInfo info;
+
+ /* Fill in the header. */
+ nHeader = 0;
+ if( !pPage->leaf ){
+ nHeader += 4;
+ }
+ if( pPage->hasData ){
+ nHeader += putVarint(&pCell[nHeader], nData);
+ }else{
+ nData = 0;
+ }
+ nHeader += putVarint(&pCell[nHeader], *(u64*)&nKey);
+ parseCellPtr(pPage, pCell, &info);
+ assert( info.nHeader==nHeader );
+ assert( info.nKey==nKey );
+ assert( info.nData==nData );
+
+ /* Fill in the payload */
+ nPayload = nData;
+ if( pPage->intKey ){
+ pSrc = pData;
+ nSrc = nData;
+ nData = 0;
+ }else{
+ nPayload += nKey;
+ pSrc = pKey;
+ nSrc = nKey;
+ }
+ *pnSize = info.nSize;
+ spaceLeft = info.nLocal;
+ pPayload = &pCell[nHeader];
+ pPrior = &pCell[info.iOverflow];
+
+ while( nPayload>0 ){
+ if( spaceLeft==0 ){
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ Pgno pgnoPtrmap = pgnoOvfl; /* Overflow page pointer-map entry page */
+#endif
+ rc = allocatePage(pBt, &pOvfl, &pgnoOvfl, pgnoOvfl, 0);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ /* If the database supports auto-vacuum, and the second or subsequent
+ ** overflow page is being allocated, add an entry to the pointer-map
+ ** for that page now. The entry for the first overflow page will be
+ ** added later, by the insertCell() routine.
+ */
+ if( pBt->autoVacuum && pgnoPtrmap!=0 && rc==SQLITE_OK ){
+ rc = ptrmapPut(pBt, pgnoOvfl, PTRMAP_OVERFLOW2, pgnoPtrmap);
+ }
+#endif
+ if( rc ){
+ releasePage(pToRelease);
+ /* clearCell(pPage, pCell); */
+ return rc;
+ }
+ put4byte(pPrior, pgnoOvfl);
+ releasePage(pToRelease);
+ pToRelease = pOvfl;
+ pPrior = pOvfl->aData;
+ put4byte(pPrior, 0);
+ pPayload = &pOvfl->aData[4];
+ spaceLeft = pBt->usableSize - 4;
+ }
+ n = nPayload;
+ if( n>spaceLeft ) n = spaceLeft;
+ if( n>nSrc ) n = nSrc;
+ memcpy(pPayload, pSrc, n);
+ nPayload -= n;
+ pPayload += n;
+ pSrc += n;
+ nSrc -= n;
+ spaceLeft -= n;
+ if( nSrc==0 ){
+ nSrc = nData;
+ pSrc = pData;
+ }
+ }
+ releasePage(pToRelease);
+ return SQLITE_OK;
+}
+
+/*
+** Change the MemPage.pParent pointer on the page whose number is
+** given in the second argument so that MemPage.pParent holds the
+** pointer in the third argument.
+*/
+static int reparentPage(Btree *pBt, Pgno pgno, MemPage *pNewParent, int idx){
+ MemPage *pThis;
+ unsigned char *aData;
+
+ if( pgno==0 ) return SQLITE_OK;
+ assert( pBt->pPager!=0 );
+ aData = sqlite3pager_lookup(pBt->pPager, pgno);
+ if( aData ){
+ pThis = (MemPage*)&aData[pBt->pageSize];
+ assert( pThis->aData==aData );
+ if( pThis->isInit ){
+ if( pThis->pParent!=pNewParent ){
+ if( pThis->pParent ) sqlite3pager_unref(pThis->pParent->aData);
+ pThis->pParent = pNewParent;
+ if( pNewParent ) sqlite3pager_ref(pNewParent->aData);
+ }
+ pThis->idxParent = idx;
+ }
+ sqlite3pager_unref(aData);
+ }
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ return ptrmapPut(pBt, pgno, PTRMAP_BTREE, pNewParent->pgno);
+ }
+#endif
+ return SQLITE_OK;
+}
+
+
+
+/*
+** Change the pParent pointer of all children of pPage to point back
+** to pPage.
+**
+** In other words, for every child of pPage, invoke reparentPage()
+** to make sure that each child knows that pPage is its parent.
+**
+** This routine gets called after you memcpy() one page into
+** another.
+*/
+static int reparentChildPages(MemPage *pPage){
+ int i;
+ Btree *pBt = pPage->pBt;
+ int rc = SQLITE_OK;
+
+ if( pPage->leaf ) return SQLITE_OK;
+
+ for(i=0; i<pPage->nCell; i++){
+ u8 *pCell = findCell(pPage, i);
+ if( !pPage->leaf ){
+ rc = reparentPage(pBt, get4byte(pCell), pPage, i);
+ if( rc!=SQLITE_OK ) return rc;
+ }
+ }
+ if( !pPage->leaf ){
+ rc = reparentPage(pBt, get4byte(&pPage->aData[pPage->hdrOffset+8]),
+ pPage, i);
+ pPage->idxShift = 0;
+ }
+ return rc;
+}
+
+/*
+** Remove the i-th cell from pPage. This routine effects pPage only.
+** The cell content is not freed or deallocated. It is assumed that
+** the cell content has been copied someplace else. This routine just
+** removes the reference to the cell from pPage.
+**
+** "sz" must be the number of bytes in the cell.
+*/
+static void dropCell(MemPage *pPage, int idx, int sz){
+ int i; /* Loop counter */
+ int pc; /* Offset to cell content of cell being deleted */
+ u8 *data; /* pPage->aData */
+ u8 *ptr; /* Used to move bytes around within data[] */
+
+ assert( idx>=0 && idx<pPage->nCell );
+ assert( sz==cellSize(pPage, idx) );
+ assert( sqlite3pager_iswriteable(pPage->aData) );
+ data = pPage->aData;
+ ptr = &data[pPage->cellOffset + 2*idx];
+ pc = get2byte(ptr);
+ assert( pc>10 && pc+sz<=pPage->pBt->usableSize );
+ freeSpace(pPage, pc, sz);
+ for(i=idx+1; i<pPage->nCell; i++, ptr+=2){
+ ptr[0] = ptr[2];
+ ptr[1] = ptr[3];
+ }
+ pPage->nCell--;
+ put2byte(&data[pPage->hdrOffset+3], pPage->nCell);
+ pPage->nFree += 2;
+ pPage->idxShift = 1;
+}
+
+/*
+** Insert a new cell on pPage at cell index "i". pCell points to the
+** content of the cell.
+**
+** If the cell content will fit on the page, then put it there. If it
+** will not fit, then make a copy of the cell content into pTemp if
+** pTemp is not null. Regardless of pTemp, allocate a new entry
+** in pPage->aOvfl[] and make it point to the cell content (either
+** in pTemp or the original pCell) and also record its index.
+** Allocating a new entry in pPage->aCell[] implies that
+** pPage->nOverflow is incremented.
+**
+** If nSkip is non-zero, then do not copy the first nSkip bytes of the
+** cell. The caller will overwrite them after this function returns. If
+** nSkip is non-zero, then pCell may not point to an invalid memory location
+** (but pCell+nSkip is always valid).
+*/
+static int insertCell(
+ MemPage *pPage, /* Page into which we are copying */
+ int i, /* New cell becomes the i-th cell of the page */
+ u8 *pCell, /* Content of the new cell */
+ int sz, /* Bytes of content in pCell */
+ u8 *pTemp, /* Temp storage space for pCell, if needed */
+ u8 nSkip /* Do not write the first nSkip bytes of the cell */
+){
+ int idx; /* Where to write new cell content in data[] */
+ int j; /* Loop counter */
+ int top; /* First byte of content for any cell in data[] */
+ int end; /* First byte past the last cell pointer in data[] */
+ int ins; /* Index in data[] where new cell pointer is inserted */
+ int hdr; /* Offset into data[] of the page header */
+ int cellOffset; /* Address of first cell pointer in data[] */
+ u8 *data; /* The content of the whole page */
+ u8 *ptr; /* Used for moving information around in data[] */
+
+ assert( i>=0 && i<=pPage->nCell+pPage->nOverflow );
+ assert( sz==cellSizePtr(pPage, pCell) );
+ assert( sqlite3pager_iswriteable(pPage->aData) );
+ if( pPage->nOverflow || sz+2>pPage->nFree ){
+ if( pTemp ){
+ memcpy(pTemp+nSkip, pCell+nSkip, sz-nSkip);
+ pCell = pTemp;
+ }
+ j = pPage->nOverflow++;
+ assert( j<sizeof(pPage->aOvfl)/sizeof(pPage->aOvfl[0]) );
+ pPage->aOvfl[j].pCell = pCell;
+ pPage->aOvfl[j].idx = i;
+ pPage->nFree = 0;
+ }else{
+ data = pPage->aData;
+ hdr = pPage->hdrOffset;
+ top = get2byte(&data[hdr+5]);
+ cellOffset = pPage->cellOffset;
+ end = cellOffset + 2*pPage->nCell + 2;
+ ins = cellOffset + 2*i;
+ if( end > top - sz ){
+ int rc = defragmentPage(pPage);
+ if( rc!=SQLITE_OK ) return rc;
+ top = get2byte(&data[hdr+5]);
+ assert( end + sz <= top );
+ }
+ idx = allocateSpace(pPage, sz);
+ assert( idx>0 );
+ assert( end <= get2byte(&data[hdr+5]) );
+ pPage->nCell++;
+ pPage->nFree -= 2;
+ memcpy(&data[idx+nSkip], pCell+nSkip, sz-nSkip);
+ for(j=end-2, ptr=&data[j]; j>ins; j-=2, ptr-=2){
+ ptr[0] = ptr[-2];
+ ptr[1] = ptr[-1];
+ }
+ put2byte(&data[ins], idx);
+ put2byte(&data[hdr+3], pPage->nCell);
+ pPage->idxShift = 1;
+ pageIntegrity(pPage);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pPage->pBt->autoVacuum ){
+ /* The cell may contain a pointer to an overflow page. If so, write
+ ** the entry for the overflow page into the pointer map.
+ */
+ CellInfo info;
+ parseCellPtr(pPage, pCell, &info);
+ if( (info.nData+(pPage->intKey?0:info.nKey))>info.nLocal ){
+ Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]);
+ int rc = ptrmapPut(pPage->pBt, pgnoOvfl, PTRMAP_OVERFLOW1, pPage->pgno);
+ if( rc!=SQLITE_OK ) return rc;
+ }
+ }
+#endif
+ }
+
+ return SQLITE_OK;
+}
+
+/*
+** Add a list of cells to a page. The page should be initially empty.
+** The cells are guaranteed to fit on the page.
+*/
+static void assemblePage(
+ MemPage *pPage, /* The page to be assemblied */
+ int nCell, /* The number of cells to add to this page */
+ u8 **apCell, /* Pointers to cell bodies */
+ int *aSize /* Sizes of the cells */
+){
+ int i; /* Loop counter */
+ int totalSize; /* Total size of all cells */
+ int hdr; /* Index of page header */
+ int cellptr; /* Address of next cell pointer */
+ int cellbody; /* Address of next cell body */
+ u8 *data; /* Data for the page */
+
+ assert( pPage->nOverflow==0 );
+ totalSize = 0;
+ for(i=0; i<nCell; i++){
+ totalSize += aSize[i];
+ }
+ assert( totalSize+2*nCell<=pPage->nFree );
+ assert( pPage->nCell==0 );
+ cellptr = pPage->cellOffset;
+ data = pPage->aData;
+ hdr = pPage->hdrOffset;
+ put2byte(&data[hdr+3], nCell);
+ if( nCell ){
+ cellbody = allocateSpace(pPage, totalSize);
+ assert( cellbody>0 );
+ assert( pPage->nFree >= 2*nCell );
+ pPage->nFree -= 2*nCell;
+ for(i=0; i<nCell; i++){
+ put2byte(&data[cellptr], cellbody);
+ memcpy(&data[cellbody], apCell[i], aSize[i]);
+ cellptr += 2;
+ cellbody += aSize[i];
+ }
+ assert( cellbody==pPage->pBt->usableSize );
+ }
+ pPage->nCell = nCell;
+}
+
+/*
+** The following parameters determine how many adjacent pages get involved
+** in a balancing operation. NN is the number of neighbors on either side
+** of the page that participate in the balancing operation. NB is the
+** total number of pages that participate, including the target page and
+** NN neighbors on either side.
+**
+** The minimum value of NN is 1 (of course). Increasing NN above 1
+** (to 2 or 3) gives a modest improvement in SELECT and DELETE performance
+** in exchange for a larger degradation in INSERT and UPDATE performance.
+** The value of NN appears to give the best results overall.
+*/
+#define NN 1 /* Number of neighbors on either side of pPage */
+#define NB (NN*2+1) /* Total pages involved in the balance */
+
+/* Forward reference */
+static int balance(MemPage*, int);
+
+#ifndef SQLITE_OMIT_QUICKBALANCE
+/*
+** This version of balance() handles the common special case where
+** a new entry is being inserted on the extreme right-end of the
+** tree, in other words, when the new entry will become the largest
+** entry in the tree.
+**
+** Instead of trying balance the 3 right-most leaf pages, just add
+** a new page to the right-hand side and put the one new entry in
+** that page. This leaves the right side of the tree somewhat
+** unbalanced. But odds are that we will be inserting new entries
+** at the end soon afterwards so the nearly empty page will quickly
+** fill up. On average.
+**
+** pPage is the leaf page which is the right-most page in the tree.
+** pParent is its parent. pPage must have a single overflow entry
+** which is also the right-most entry on the page.
+*/
+static int balance_quick(MemPage *pPage, MemPage *pParent){
+ int rc;
+ MemPage *pNew;
+ Pgno pgnoNew;
+ u8 *pCell;
+ int szCell;
+ CellInfo info;
+ Btree *pBt = pPage->pBt;
+ int parentIdx = pParent->nCell; /* pParent new divider cell index */
+ int parentSize; /* Size of new divider cell */
+ u8 parentCell[64]; /* Space for the new divider cell */
+
+ /* Allocate a new page. Insert the overflow cell from pPage
+ ** into it. Then remove the overflow cell from pPage.
+ */
+ rc = allocatePage(pBt, &pNew, &pgnoNew, 0, 0);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ pCell = pPage->aOvfl[0].pCell;
+ szCell = cellSizePtr(pPage, pCell);
+ zeroPage(pNew, pPage->aData[0]);
+ assemblePage(pNew, 1, &pCell, &szCell);
+ pPage->nOverflow = 0;
+
+ /* Set the parent of the newly allocated page to pParent. */
+ pNew->pParent = pParent;
+ sqlite3pager_ref(pParent->aData);
+
+ /* pPage is currently the right-child of pParent. Change this
+ ** so that the right-child is the new page allocated above and
+ ** pPage is the next-to-right child.
+ */
+ assert( pPage->nCell>0 );
+ parseCellPtr(pPage, findCell(pPage, pPage->nCell-1), &info);
+ rc = fillInCell(pParent, parentCell, 0, info.nKey, 0, 0, &parentSize);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ assert( parentSize<64 );
+ rc = insertCell(pParent, parentIdx, parentCell, parentSize, 0, 4);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ put4byte(findOverflowCell(pParent,parentIdx), pPage->pgno);
+ put4byte(&pParent->aData[pParent->hdrOffset+8], pgnoNew);
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ /* If this is an auto-vacuum database, update the pointer map
+ ** with entries for the new page, and any pointer from the
+ ** cell on the page to an overflow page.
+ */
+ if( pBt->autoVacuum ){
+ rc = ptrmapPut(pBt, pgnoNew, PTRMAP_BTREE, pParent->pgno);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ rc = ptrmapPutOvfl(pNew, 0);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ }
+#endif
+
+ /* Release the reference to the new page and balance the parent page,
+ ** in case the divider cell inserted caused it to become overfull.
+ */
+ releasePage(pNew);
+ return balance(pParent, 0);
+}
+#endif /* SQLITE_OMIT_QUICKBALANCE */
+
+/*
+** The ISAUTOVACUUM macro is used within balance_nonroot() to determine
+** if the database supports auto-vacuum or not. Because it is used
+** within an expression that is an argument to another macro
+** (sqliteMallocRaw), it is not possible to use conditional compilation.
+** So, this macro is defined instead.
+*/
+#ifndef SQLITE_OMIT_AUTOVACUUM
+#define ISAUTOVACUUM (pBt->autoVacuum)
+#else
+#define ISAUTOVACUUM 0
+#endif
+
+/*
+** This routine redistributes Cells on pPage and up to NN*2 siblings
+** of pPage so that all pages have about the same amount of free space.
+** Usually NN siblings on either side of pPage is used in the balancing,
+** though more siblings might come from one side if pPage is the first
+** or last child of its parent. If pPage has fewer than 2*NN siblings
+** (something which can only happen if pPage is the root page or a
+** child of root) then all available siblings participate in the balancing.
+**
+** The number of siblings of pPage might be increased or decreased by one or
+** two in an effort to keep pages nearly full but not over full. The root page
+** is special and is allowed to be nearly empty. If pPage is
+** the root page, then the depth of the tree might be increased
+** or decreased by one, as necessary, to keep the root page from being
+** overfull or completely empty.
+**
+** Note that when this routine is called, some of the Cells on pPage
+** might not actually be stored in pPage->aData[]. This can happen
+** if the page is overfull. Part of the job of this routine is to
+** make sure all Cells for pPage once again fit in pPage->aData[].
+**
+** In the course of balancing the siblings of pPage, the parent of pPage
+** might become overfull or underfull. If that happens, then this routine
+** is called recursively on the parent.
+**
+** If this routine fails for any reason, it might leave the database
+** in a corrupted state. So if this routine fails, the database should
+** be rolled back.
+*/
+static int balance_nonroot(MemPage *pPage){
+ MemPage *pParent; /* The parent of pPage */
+ Btree *pBt; /* The whole database */
+ int nCell = 0; /* Number of cells in apCell[] */
+ int nMaxCells = 0; /* Allocated size of apCell, szCell, aFrom. */
+ int nOld; /* Number of pages in apOld[] */
+ int nNew; /* Number of pages in apNew[] */
+ int nDiv; /* Number of cells in apDiv[] */
+ int i, j, k; /* Loop counters */
+ int idx; /* Index of pPage in pParent->aCell[] */
+ int nxDiv; /* Next divider slot in pParent->aCell[] */
+ int rc; /* The return code */
+ int leafCorrection; /* 4 if pPage is a leaf. 0 if not */
+ int leafData; /* True if pPage is a leaf of a LEAFDATA tree */
+ int usableSpace; /* Bytes in pPage beyond the header */
+ int pageFlags; /* Value of pPage->aData[0] */
+ int subtotal; /* Subtotal of bytes in cells on one page */
+ int iSpace = 0; /* First unused byte of aSpace[] */
+ MemPage *apOld[NB]; /* pPage and up to two siblings */
+ Pgno pgnoOld[NB]; /* Page numbers for each page in apOld[] */
+ MemPage *apCopy[NB]; /* Private copies of apOld[] pages */
+ MemPage *apNew[NB+2]; /* pPage and up to NB siblings after balancing */
+ Pgno pgnoNew[NB+2]; /* Page numbers for each page in apNew[] */
+ int idxDiv[NB]; /* Indices of divider cells in pParent */
+ u8 *apDiv[NB]; /* Divider cells in pParent */
+ int cntNew[NB+2]; /* Index in aCell[] of cell after i-th page */
+ int szNew[NB+2]; /* Combined size of cells place on i-th page */
+ u8 **apCell = 0; /* All cells begin balanced */
+ int *szCell; /* Local size of all cells in apCell[] */
+ u8 *aCopy[NB]; /* Space for holding data of apCopy[] */
+ u8 *aSpace; /* Space to hold copies of dividers cells */
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ u8 *aFrom = 0;
+#endif
+
+ /*
+ ** Find the parent page.
+ */
+ assert( pPage->isInit );
+ assert( sqlite3pager_iswriteable(pPage->aData) );
+ pBt = pPage->pBt;
+ pParent = pPage->pParent;
+ sqlite3pager_write(pParent->aData);
+ assert( pParent );
+ TRACE(("BALANCE: begin page %d child of %d\n", pPage->pgno, pParent->pgno));
+
+#ifndef SQLITE_OMIT_QUICKBALANCE
+ /*
+ ** A special case: If a new entry has just been inserted into a
+ ** table (that is, a btree with integer keys and all data at the leaves)
+ ** and the new entry is the right-most entry in the tree (it has the
+ ** largest key) then use the special balance_quick() routine for
+ ** balancing. balance_quick() is much faster and results in a tighter
+ ** packing of data in the common case.
+ */
+ if( pPage->leaf &&
+ pPage->intKey &&
+ pPage->leafData &&
+ pPage->nOverflow==1 &&
+ pPage->aOvfl[0].idx==pPage->nCell &&
+ pPage->pParent->pgno!=1 &&
+ get4byte(&pParent->aData[pParent->hdrOffset+8])==pPage->pgno
+ ){
+ /*
+ ** TODO: Check the siblings to the left of pPage. It may be that
+ ** they are not full and no new page is required.
+ */
+ return balance_quick(pPage, pParent);
+ }
+#endif
+
+ /*
+ ** Find the cell in the parent page whose left child points back
+ ** to pPage. The "idx" variable is the index of that cell. If pPage
+ ** is the rightmost child of pParent then set idx to pParent->nCell
+ */
+ if( pParent->idxShift ){
+ Pgno pgno;
+ pgno = pPage->pgno;
+ assert( pgno==sqlite3pager_pagenumber(pPage->aData) );
+ for(idx=0; idx<pParent->nCell; idx++){
+ if( get4byte(findCell(pParent, idx))==pgno ){
+ break;
+ }
+ }
+ assert( idx<pParent->nCell
+ || get4byte(&pParent->aData[pParent->hdrOffset+8])==pgno );
+ }else{
+ idx = pPage->idxParent;
+ }
+
+ /*
+ ** Initialize variables so that it will be safe to jump
+ ** directly to balance_cleanup at any moment.
+ */
+ nOld = nNew = 0;
+ sqlite3pager_ref(pParent->aData);
+
+ /*
+ ** Find sibling pages to pPage and the cells in pParent that divide
+ ** the siblings. An attempt is made to find NN siblings on either
+ ** side of pPage. More siblings are taken from one side, however, if
+ ** pPage there are fewer than NN siblings on the other side. If pParent
+ ** has NB or fewer children then all children of pParent are taken.
+ */
+ nxDiv = idx - NN;
+ if( nxDiv + NB > pParent->nCell ){
+ nxDiv = pParent->nCell - NB + 1;
+ }
+ if( nxDiv<0 ){
+ nxDiv = 0;
+ }
+ nDiv = 0;
+ for(i=0, k=nxDiv; i<NB; i++, k++){
+ if( k<pParent->nCell ){
+ idxDiv[i] = k;
+ apDiv[i] = findCell(pParent, k);
+ nDiv++;
+ assert( !pParent->leaf );
+ pgnoOld[i] = get4byte(apDiv[i]);
+ }else if( k==pParent->nCell ){
+ pgnoOld[i] = get4byte(&pParent->aData[pParent->hdrOffset+8]);
+ }else{
+ break;
+ }
+ rc = getAndInitPage(pBt, pgnoOld[i], &apOld[i], pParent);
+ if( rc ) goto balance_cleanup;
+ apOld[i]->idxParent = k;
+ apCopy[i] = 0;
+ assert( i==nOld );
+ nOld++;
+ nMaxCells += 1+apOld[i]->nCell+apOld[i]->nOverflow;
+ }
+
+ /* Make nMaxCells a multiple of 2 in order to preserve 8-byte
+ ** alignment */
+ nMaxCells = (nMaxCells + 1)&~1;
+
+ /*
+ ** Allocate space for memory structures
+ */
+ apCell = sqliteMallocRaw(
+ nMaxCells*sizeof(u8*) /* apCell */
+ + nMaxCells*sizeof(int) /* szCell */
+ + ROUND8(sizeof(MemPage))*NB /* aCopy */
+ + pBt->pageSize*(5+NB) /* aSpace */
+ + (ISAUTOVACUUM ? nMaxCells : 0) /* aFrom */
+ );
+ if( apCell==0 ){
+ rc = SQLITE_NOMEM;
+ goto balance_cleanup;
+ }
+ szCell = (int*)&apCell[nMaxCells];
+ aCopy[0] = (u8*)&szCell[nMaxCells];
+ assert( ((aCopy[0] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */
+ for(i=1; i<NB; i++){
+ aCopy[i] = &aCopy[i-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
+ assert( ((aCopy[i] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */
+ }
+ aSpace = &aCopy[NB-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
+ assert( ((aSpace - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ aFrom = &aSpace[5*pBt->pageSize];
+ }
+#endif
+
+ /*
+ ** Make copies of the content of pPage and its siblings into aOld[].
+ ** The rest of this function will use data from the copies rather
+ ** that the original pages since the original pages will be in the
+ ** process of being overwritten.
+ */
+ for(i=0; i<nOld; i++){
+ MemPage *p = apCopy[i] = (MemPage*)&aCopy[i][pBt->pageSize];
+ p->aData = &((u8*)p)[-pBt->pageSize];
+ memcpy(p->aData, apOld[i]->aData, pBt->pageSize + sizeof(MemPage));
+ /* The memcpy() above changes the value of p->aData so we have to
+ ** set it again. */
+ p->aData = &((u8*)p)[-pBt->pageSize];
+ }
+
+ /*
+ ** Load pointers to all cells on sibling pages and the divider cells
+ ** into the local apCell[] array. Make copies of the divider cells
+ ** into space obtained form aSpace[] and remove the the divider Cells
+ ** from pParent.
+ **
+ ** If the siblings are on leaf pages, then the child pointers of the
+ ** divider cells are stripped from the cells before they are copied
+ ** into aSpace[]. In this way, all cells in apCell[] are without
+ ** child pointers. If siblings are not leaves, then all cell in
+ ** apCell[] include child pointers. Either way, all cells in apCell[]
+ ** are alike.
+ **
+ ** leafCorrection: 4 if pPage is a leaf. 0 if pPage is not a leaf.
+ ** leafData: 1 if pPage holds key+data and pParent holds only keys.
+ */
+ nCell = 0;
+ leafCorrection = pPage->leaf*4;
+ leafData = pPage->leafData && pPage->leaf;
+ for(i=0; i<nOld; i++){
+ MemPage *pOld = apCopy[i];
+ int limit = pOld->nCell+pOld->nOverflow;
+ for(j=0; j<limit; j++){
+ assert( nCell<nMaxCells );
+ apCell[nCell] = findOverflowCell(pOld, j);
+ szCell[nCell] = cellSizePtr(pOld, apCell[nCell]);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ int a;
+ aFrom[nCell] = i;
+ for(a=0; a<pOld->nOverflow; a++){
+ if( pOld->aOvfl[a].pCell==apCell[nCell] ){
+ aFrom[nCell] = 0xFF;
+ break;
+ }
+ }
+ }
+#endif
+ nCell++;
+ }
+ if( i<nOld-1 ){
+ int sz = cellSizePtr(pParent, apDiv[i]);
+ if( leafData ){
+ /* With the LEAFDATA flag, pParent cells hold only INTKEYs that
+ ** are duplicates of keys on the child pages. We need to remove
+ ** the divider cells from pParent, but the dividers cells are not
+ ** added to apCell[] because they are duplicates of child cells.
+ */
+ dropCell(pParent, nxDiv, sz);
+ }else{
+ u8 *pTemp;
+ assert( nCell<nMaxCells );
+ szCell[nCell] = sz;
+ pTemp = &aSpace[iSpace];
+ iSpace += sz;
+ assert( iSpace<=pBt->pageSize*5 );
+ memcpy(pTemp, apDiv[i], sz);
+ apCell[nCell] = pTemp+leafCorrection;
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ aFrom[nCell] = 0xFF;
+ }
+#endif
+ dropCell(pParent, nxDiv, sz);
+ szCell[nCell] -= leafCorrection;
+ assert( get4byte(pTemp)==pgnoOld[i] );
+ if( !pOld->leaf ){
+ assert( leafCorrection==0 );
+ /* The right pointer of the child page pOld becomes the left
+ ** pointer of the divider cell */
+ memcpy(apCell[nCell], &pOld->aData[pOld->hdrOffset+8], 4);
+ }else{
+ assert( leafCorrection==4 );
+ }
+ nCell++;
+ }
+ }
+ }
+
+ /*
+ ** Figure out the number of pages needed to hold all nCell cells.
+ ** Store this number in "k". Also compute szNew[] which is the total
+ ** size of all cells on the i-th page and cntNew[] which is the index
+ ** in apCell[] of the cell that divides page i from page i+1.
+ ** cntNew[k] should equal nCell.
+ **
+ ** Values computed by this block:
+ **
+ ** k: The total number of sibling pages
+ ** szNew[i]: Spaced used on the i-th sibling page.
+ ** cntNew[i]: Index in apCell[] and szCell[] for the first cell to
+ ** the right of the i-th sibling page.
+ ** usableSpace: Number of bytes of space available on each sibling.
+ **
+ */
+ usableSpace = pBt->usableSize - 12 + leafCorrection;
+ for(subtotal=k=i=0; i<nCell; i++){
+ assert( i<nMaxCells );
+ subtotal += szCell[i] + 2;
+ if( subtotal > usableSpace ){
+ szNew[k] = subtotal - szCell[i];
+ cntNew[k] = i;
+ if( leafData ){ i--; }
+ subtotal = 0;
+ k++;
+ }
+ }
+ szNew[k] = subtotal;
+ cntNew[k] = nCell;
+ k++;
+
+ /*
+ ** The packing computed by the previous block is biased toward the siblings
+ ** on the left side. The left siblings are always nearly full, while the
+ ** right-most sibling might be nearly empty. This block of code attempts
+ ** to adjust the packing of siblings to get a better balance.
+ **
+ ** This adjustment is more than an optimization. The packing above might
+ ** be so out of balance as to be illegal. For example, the right-most
+ ** sibling might be completely empty. This adjustment is not optional.
+ */
+ for(i=k-1; i>0; i--){
+ int szRight = szNew[i]; /* Size of sibling on the right */
+ int szLeft = szNew[i-1]; /* Size of sibling on the left */
+ int r; /* Index of right-most cell in left sibling */
+ int d; /* Index of first cell to the left of right sibling */
+
+ r = cntNew[i-1] - 1;
+ d = r + 1 - leafData;
+ assert( d<nMaxCells );
+ assert( r<nMaxCells );
+ while( szRight==0 || szRight+szCell[d]+2<=szLeft-(szCell[r]+2) ){
+ szRight += szCell[d] + 2;
+ szLeft -= szCell[r] + 2;
+ cntNew[i-1]--;
+ r = cntNew[i-1] - 1;
+ d = r + 1 - leafData;
+ }
+ szNew[i] = szRight;
+ szNew[i-1] = szLeft;
+ }
+
+ /* Either we found one or more cells (cntnew[0])>0) or we are the
+ ** a virtual root page. A virtual root page is when the real root
+ ** page is page 1 and we are the only child of that page.
+ */
+ assert( cntNew[0]>0 || (pParent->pgno==1 && pParent->nCell==0) );
+
+ /*
+ ** Allocate k new pages. Reuse old pages where possible.
+ */
+ assert( pPage->pgno>1 );
+ pageFlags = pPage->aData[0];
+ for(i=0; i<k; i++){
+ MemPage *pNew;
+ if( i<nOld ){
+ pNew = apNew[i] = apOld[i];
+ pgnoNew[i] = pgnoOld[i];
+ apOld[i] = 0;
+ rc = sqlite3pager_write(pNew->aData);
+ if( rc ) goto balance_cleanup;
+ }else{
+ rc = allocatePage(pBt, &pNew, &pgnoNew[i], pgnoNew[i-1], 0);
+ if( rc ) goto balance_cleanup;
+ apNew[i] = pNew;
+ }
+ nNew++;
+ zeroPage(pNew, pageFlags);
+ }
+
+ /* Free any old pages that were not reused as new pages.
+ */
+ while( i<nOld ){
+ rc = freePage(apOld[i]);
+ if( rc ) goto balance_cleanup;
+ releasePage(apOld[i]);
+ apOld[i] = 0;
+ i++;
+ }
+
+ /*
+ ** Put the new pages in accending order. This helps to
+ ** keep entries in the disk file in order so that a scan
+ ** of the table is a linear scan through the file. That
+ ** in turn helps the operating system to deliver pages
+ ** from the disk more rapidly.
+ **
+ ** An O(n^2) insertion sort algorithm is used, but since
+ ** n is never more than NB (a small constant), that should
+ ** not be a problem.
+ **
+ ** When NB==3, this one optimization makes the database
+ ** about 25% faster for large insertions and deletions.
+ */
+ for(i=0; i<k-1; i++){
+ int minV = pgnoNew[i];
+ int minI = i;
+ for(j=i+1; j<k; j++){
+ if( pgnoNew[j]<(unsigned)minV ){
+ minI = j;
+ minV = pgnoNew[j];
+ }
+ }
+ if( minI>i ){
+ int t;
+ MemPage *pT;
+ t = pgnoNew[i];
+ pT = apNew[i];
+ pgnoNew[i] = pgnoNew[minI];
+ apNew[i] = apNew[minI];
+ pgnoNew[minI] = t;
+ apNew[minI] = pT;
+ }
+ }
+ TRACE(("BALANCE: old: %d %d %d new: %d(%d) %d(%d) %d(%d) %d(%d) %d(%d)\n",
+ pgnoOld[0],
+ nOld>=2 ? pgnoOld[1] : 0,
+ nOld>=3 ? pgnoOld[2] : 0,
+ pgnoNew[0], szNew[0],
+ nNew>=2 ? pgnoNew[1] : 0, nNew>=2 ? szNew[1] : 0,
+ nNew>=3 ? pgnoNew[2] : 0, nNew>=3 ? szNew[2] : 0,
+ nNew>=4 ? pgnoNew[3] : 0, nNew>=4 ? szNew[3] : 0,
+ nNew>=5 ? pgnoNew[4] : 0, nNew>=5 ? szNew[4] : 0));
+
+ /*
+ ** Evenly distribute the data in apCell[] across the new pages.
+ ** Insert divider cells into pParent as necessary.
+ */
+ j = 0;
+ for(i=0; i<nNew; i++){
+ /* Assemble the new sibling page. */
+ MemPage *pNew = apNew[i];
+ assert( j<nMaxCells );
+ assert( pNew->pgno==pgnoNew[i] );
+ assemblePage(pNew, cntNew[i]-j, &apCell[j], &szCell[j]);
+ assert( pNew->nCell>0 || (nNew==1 && cntNew[0]==0) );
+ assert( pNew->nOverflow==0 );
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ /* If this is an auto-vacuum database, update the pointer map entries
+ ** that point to the siblings that were rearranged. These can be: left
+ ** children of cells, the right-child of the page, or overflow pages
+ ** pointed to by cells.
+ */
+ if( pBt->autoVacuum ){
+ for(k=j; k<cntNew[i]; k++){
+ assert( k<nMaxCells );
+ if( aFrom[k]==0xFF || apCopy[aFrom[k]]->pgno!=pNew->pgno ){
+ rc = ptrmapPutOvfl(pNew, k-j);
+ if( rc!=SQLITE_OK ){
+ goto balance_cleanup;
+ }
+ }
+ }
+ }
+#endif
+
+ j = cntNew[i];
+
+ /* If the sibling page assembled above was not the right-most sibling,
+ ** insert a divider cell into the parent page.
+ */
+ if( i<nNew-1 && j<nCell ){
+ u8 *pCell;
+ u8 *pTemp;
+ int sz;
+
+ assert( j<nMaxCells );
+ pCell = apCell[j];
+ sz = szCell[j] + leafCorrection;
+ if( !pNew->leaf ){
+ memcpy(&pNew->aData[8], pCell, 4);
+ pTemp = 0;
+ }else if( leafData ){
+ /* If the tree is a leaf-data tree, and the siblings are leaves,
+ ** then there is no divider cell in apCell[]. Instead, the divider
+ ** cell consists of the integer key for the right-most cell of
+ ** the sibling-page assembled above only.
+ */
+ CellInfo info;
+ j--;
+ parseCellPtr(pNew, apCell[j], &info);
+ pCell = &aSpace[iSpace];
+ fillInCell(pParent, pCell, 0, info.nKey, 0, 0, &sz);
+ iSpace += sz;
+ assert( iSpace<=pBt->pageSize*5 );
+ pTemp = 0;
+ }else{
+ pCell -= 4;
+ pTemp = &aSpace[iSpace];
+ iSpace += sz;
+ assert( iSpace<=pBt->pageSize*5 );
+ }
+ rc = insertCell(pParent, nxDiv, pCell, sz, pTemp, 4);
+ if( rc!=SQLITE_OK ) goto balance_cleanup;
+ put4byte(findOverflowCell(pParent,nxDiv), pNew->pgno);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ /* If this is an auto-vacuum database, and not a leaf-data tree,
+ ** then update the pointer map with an entry for the overflow page
+ ** that the cell just inserted points to (if any).
+ */
+ if( pBt->autoVacuum && !leafData ){
+ rc = ptrmapPutOvfl(pParent, nxDiv);
+ if( rc!=SQLITE_OK ){
+ goto balance_cleanup;
+ }
+ }
+#endif
+ j++;
+ nxDiv++;
+ }
+ }
+ assert( j==nCell );
+ if( (pageFlags & PTF_LEAF)==0 ){
+ memcpy(&apNew[nNew-1]->aData[8], &apCopy[nOld-1]->aData[8], 4);
+ }
+ if( nxDiv==pParent->nCell+pParent->nOverflow ){
+ /* Right-most sibling is the right-most child of pParent */
+ put4byte(&pParent->aData[pParent->hdrOffset+8], pgnoNew[nNew-1]);
+ }else{
+ /* Right-most sibling is the left child of the first entry in pParent
+ ** past the right-most divider entry */
+ put4byte(findOverflowCell(pParent, nxDiv), pgnoNew[nNew-1]);
+ }
+
+ /*
+ ** Reparent children of all cells.
+ */
+ for(i=0; i<nNew; i++){
+ rc = reparentChildPages(apNew[i]);
+ if( rc!=SQLITE_OK ) goto balance_cleanup;
+ }
+ rc = reparentChildPages(pParent);
+ if( rc!=SQLITE_OK ) goto balance_cleanup;
+
+ /*
+ ** Balance the parent page. Note that the current page (pPage) might
+ ** have been added to the freelist so it might no longer be initialized.
+ ** But the parent page will always be initialized.
+ */
+ assert( pParent->isInit );
+ /* assert( pPage->isInit ); // No! pPage might have been added to freelist */
+ /* pageIntegrity(pPage); // No! pPage might have been added to freelist */
+ rc = balance(pParent, 0);
+
+ /*
+ ** Cleanup before returning.
+ */
+balance_cleanup:
+ sqliteFree(apCell);
+ for(i=0; i<nOld; i++){
+ releasePage(apOld[i]);
+ }
+ for(i=0; i<nNew; i++){
+ releasePage(apNew[i]);
+ }
+ releasePage(pParent);
+ TRACE(("BALANCE: finished with %d: old=%d new=%d cells=%d\n",
+ pPage->pgno, nOld, nNew, nCell));
+ return rc;
+}
+
+/*
+** This routine is called for the root page of a btree when the root
+** page contains no cells. This is an opportunity to make the tree
+** shallower by one level.
+*/
+static int balance_shallower(MemPage *pPage){
+ MemPage *pChild; /* The only child page of pPage */
+ Pgno pgnoChild; /* Page number for pChild */
+ int rc = SQLITE_OK; /* Return code from subprocedures */
+ Btree *pBt; /* The main BTree structure */
+ int mxCellPerPage; /* Maximum number of cells per page */
+ u8 **apCell; /* All cells from pages being balanced */
+ int *szCell; /* Local size of all cells */
+
+ assert( pPage->pParent==0 );
+ assert( pPage->nCell==0 );
+ pBt = pPage->pBt;
+ mxCellPerPage = MX_CELL(pBt);
+ apCell = sqliteMallocRaw( mxCellPerPage*(sizeof(u8*)+sizeof(int)) );
+ if( apCell==0 ) return SQLITE_NOMEM;
+ szCell = (int*)&apCell[mxCellPerPage];
+ if( pPage->leaf ){
+ /* The table is completely empty */
+ TRACE(("BALANCE: empty table %d\n", pPage->pgno));
+ }else{
+ /* The root page is empty but has one child. Transfer the
+ ** information from that one child into the root page if it
+ ** will fit. This reduces the depth of the tree by one.
+ **
+ ** If the root page is page 1, it has less space available than
+ ** its child (due to the 100 byte header that occurs at the beginning
+ ** of the database fle), so it might not be able to hold all of the
+ ** information currently contained in the child. If this is the
+ ** case, then do not do the transfer. Leave page 1 empty except
+ ** for the right-pointer to the child page. The child page becomes
+ ** the virtual root of the tree.
+ */
+ pgnoChild = get4byte(&pPage->aData[pPage->hdrOffset+8]);
+ assert( pgnoChild>0 );
+ assert( pgnoChild<=sqlite3pager_pagecount(pPage->pBt->pPager) );
+ rc = getPage(pPage->pBt, pgnoChild, &pChild);
+ if( rc ) goto end_shallow_balance;
+ if( pPage->pgno==1 ){
+ rc = initPage(pChild, pPage);
+ if( rc ) goto end_shallow_balance;
+ assert( pChild->nOverflow==0 );
+ if( pChild->nFree>=100 ){
+ /* The child information will fit on the root page, so do the
+ ** copy */
+ int i;
+ zeroPage(pPage, pChild->aData[0]);
+ for(i=0; i<pChild->nCell; i++){
+ apCell[i] = findCell(pChild,i);
+ szCell[i] = cellSizePtr(pChild, apCell[i]);
+ }
+ assemblePage(pPage, pChild->nCell, apCell, szCell);
+ /* Copy the right-pointer of the child to the parent. */
+ put4byte(&pPage->aData[pPage->hdrOffset+8],
+ get4byte(&pChild->aData[pChild->hdrOffset+8]));
+ freePage(pChild);
+ TRACE(("BALANCE: child %d transfer to page 1\n", pChild->pgno));
+ }else{
+ /* The child has more information that will fit on the root.
+ ** The tree is already balanced. Do nothing. */
+ TRACE(("BALANCE: child %d will not fit on page 1\n", pChild->pgno));
+ }
+ }else{
+ memcpy(pPage->aData, pChild->aData, pPage->pBt->usableSize);
+ pPage->isInit = 0;
+ pPage->pParent = 0;
+ rc = initPage(pPage, 0);
+ assert( rc==SQLITE_OK );
+ freePage(pChild);
+ TRACE(("BALANCE: transfer child %d into root %d\n",
+ pChild->pgno, pPage->pgno));
+ }
+ rc = reparentChildPages(pPage);
+ assert( pPage->nOverflow==0 );
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ int i;
+ for(i=0; i<pPage->nCell; i++){
+ rc = ptrmapPutOvfl(pPage, i);
+ if( rc!=SQLITE_OK ){
+ goto end_shallow_balance;
+ }
+ }
+ }
+#endif
+ if( rc!=SQLITE_OK ) goto end_shallow_balance;
+ releasePage(pChild);
+ }
+end_shallow_balance:
+ sqliteFree(apCell);
+ return rc;
+}
+
+
+/*
+** The root page is overfull
+**
+** When this happens, Create a new child page and copy the
+** contents of the root into the child. Then make the root
+** page an empty page with rightChild pointing to the new
+** child. Finally, call balance_internal() on the new child
+** to cause it to split.
+*/
+static int balance_deeper(MemPage *pPage){
+ int rc; /* Return value from subprocedures */
+ MemPage *pChild; /* Pointer to a new child page */
+ Pgno pgnoChild; /* Page number of the new child page */
+ Btree *pBt; /* The BTree */
+ int usableSize; /* Total usable size of a page */
+ u8 *data; /* Content of the parent page */
+ u8 *cdata; /* Content of the child page */
+ int hdr; /* Offset to page header in parent */
+ int brk; /* Offset to content of first cell in parent */
+
+ assert( pPage->pParent==0 );
+ assert( pPage->nOverflow>0 );
+ pBt = pPage->pBt;
+ rc = allocatePage(pBt, &pChild, &pgnoChild, pPage->pgno, 0);
+ if( rc ) return rc;
+ assert( sqlite3pager_iswriteable(pChild->aData) );
+ usableSize = pBt->usableSize;
+ data = pPage->aData;
+ hdr = pPage->hdrOffset;
+ brk = get2byte(&data[hdr+5]);
+ cdata = pChild->aData;
+ memcpy(cdata, &data[hdr], pPage->cellOffset+2*pPage->nCell-hdr);
+ memcpy(&cdata[brk], &data[brk], usableSize-brk);
+ assert( pChild->isInit==0 );
+ rc = initPage(pChild, pPage);
+ if( rc ) goto balancedeeper_out;
+ memcpy(pChild->aOvfl, pPage->aOvfl, pPage->nOverflow*sizeof(pPage->aOvfl[0]));
+ pChild->nOverflow = pPage->nOverflow;
+ if( pChild->nOverflow ){
+ pChild->nFree = 0;
+ }
+ assert( pChild->nCell==pPage->nCell );
+ zeroPage(pPage, pChild->aData[0] & ~PTF_LEAF);
+ put4byte(&pPage->aData[pPage->hdrOffset+8], pgnoChild);
+ TRACE(("BALANCE: copy root %d into %d\n", pPage->pgno, pChild->pgno));
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ int i;
+ rc = ptrmapPut(pBt, pChild->pgno, PTRMAP_BTREE, pPage->pgno);
+ if( rc ) goto balancedeeper_out;
+ for(i=0; i<pChild->nCell; i++){
+ rc = ptrmapPutOvfl(pChild, i);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ }
+ }
+#endif
+ rc = balance_nonroot(pChild);
+
+balancedeeper_out:
+ releasePage(pChild);
+ return rc;
+}
+
+/*
+** Decide if the page pPage needs to be balanced. If balancing is
+** required, call the appropriate balancing routine.
+*/
+static int balance(MemPage *pPage, int insert){
+ int rc = SQLITE_OK;
+ if( pPage->pParent==0 ){
+ if( pPage->nOverflow>0 ){
+ rc = balance_deeper(pPage);
+ }
+ if( rc==SQLITE_OK && pPage->nCell==0 ){
+ rc = balance_shallower(pPage);
+ }
+ }else{
+ if( pPage->nOverflow>0 ||
+ (!insert && pPage->nFree>pPage->pBt->usableSize*2/3) ){
+ rc = balance_nonroot(pPage);
+ }
+ }
+ return rc;
+}
+
+/*
+** This routine checks all cursors that point to table pgnoRoot.
+** If any of those cursors other than pExclude were opened with
+** wrFlag==0 then this routine returns SQLITE_LOCKED. If all
+** cursors that point to pgnoRoot were opened with wrFlag==1
+** then this routine returns SQLITE_OK.
+**
+** In addition to checking for read-locks (where a read-lock
+** means a cursor opened with wrFlag==0) this routine also moves
+** all cursors other than pExclude so that they are pointing to the
+** first Cell on root page. This is necessary because an insert
+** or delete might change the number of cells on a page or delete
+** a page entirely and we do not want to leave any cursors
+** pointing to non-existant pages or cells.
+*/
+static int checkReadLocks(Btree *pBt, Pgno pgnoRoot, BtCursor *pExclude){
+ BtCursor *p;
+ for(p=pBt->pCursor; p; p=p->pNext){
+ if( p->pgnoRoot!=pgnoRoot || p==pExclude ) continue;
+ if( p->wrFlag==0 ) return SQLITE_LOCKED;
+ if( p->pPage->pgno!=p->pgnoRoot ){
+ moveToRoot(p);
+ }
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Insert a new record into the BTree. The key is given by (pKey,nKey)
+** and the data is given by (pData,nData). The cursor is used only to
+** define what table the record should be inserted into. The cursor
+** is left pointing at a random location.
+**
+** For an INTKEY table, only the nKey value of the key is used. pKey is
+** ignored. For a ZERODATA table, the pData and nData are both ignored.
+*/
+int sqlite3BtreeInsert(
+ BtCursor *pCur, /* Insert data into the table of this cursor */
+ const void *pKey, i64 nKey, /* The key of the new record */
+ const void *pData, int nData /* The data of the new record */
+){
+ int rc;
+ int loc;
+ int szNew;
+ MemPage *pPage;
+ Btree *pBt = pCur->pBt;
+ unsigned char *oldCell;
+ unsigned char *newCell = 0;
+
+ if( pBt->inTrans!=TRANS_WRITE ){
+ /* Must start a transaction before doing an insert */
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
+ }
+ assert( !pBt->readOnly );
+ if( !pCur->wrFlag ){
+ return SQLITE_PERM; /* Cursor not open for writing */
+ }
+ if( checkReadLocks(pBt, pCur->pgnoRoot, pCur) ){
+ return SQLITE_LOCKED; /* The table pCur points to has a read lock */
+ }
+ rc = sqlite3BtreeMoveto(pCur, pKey, nKey, &loc);
+ if( rc ) return rc;
+ pPage = pCur->pPage;
+ assert( pPage->intKey || nKey>=0 );
+ assert( pPage->leaf || !pPage->leafData );
+ TRACE(("INSERT: table=%d nkey=%lld ndata=%d page=%d %s\n",
+ pCur->pgnoRoot, nKey, nData, pPage->pgno,
+ loc==0 ? "overwrite" : "new entry"));
+ assert( pPage->isInit );
+ rc = sqlite3pager_write(pPage->aData);
+ if( rc ) return rc;
+ newCell = sqliteMallocRaw( MX_CELL_SIZE(pBt) );
+ if( newCell==0 ) return SQLITE_NOMEM;
+ rc = fillInCell(pPage, newCell, pKey, nKey, pData, nData, &szNew);
+ if( rc ) goto end_insert;
+ assert( szNew==cellSizePtr(pPage, newCell) );
+ assert( szNew<=MX_CELL_SIZE(pBt) );
+ if( loc==0 && pCur->isValid ){
+ int szOld;
+ assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
+ oldCell = findCell(pPage, pCur->idx);
+ if( !pPage->leaf ){
+ memcpy(newCell, oldCell, 4);
+ }
+ szOld = cellSizePtr(pPage, oldCell);
+ rc = clearCell(pPage, oldCell);
+ if( rc ) goto end_insert;
+ dropCell(pPage, pCur->idx, szOld);
+ }else if( loc<0 && pPage->nCell>0 ){
+ assert( pPage->leaf );
+ pCur->idx++;
+ pCur->info.nSize = 0;
+ }else{
+ assert( pPage->leaf );
+ }
+ rc = insertCell(pPage, pCur->idx, newCell, szNew, 0, 0);
+ if( rc!=SQLITE_OK ) goto end_insert;
+ rc = balance(pPage, 1);
+ /* sqlite3BtreePageDump(pCur->pBt, pCur->pgnoRoot, 1); */
+ /* fflush(stdout); */
+ if( rc==SQLITE_OK ){
+ moveToRoot(pCur);
+ }
+end_insert:
+ sqliteFree(newCell);
+ return rc;
+}
+
+/*
+** Delete the entry that the cursor is pointing to. The cursor
+** is left pointing at a random location.
+*/
+int sqlite3BtreeDelete(BtCursor *pCur){
+ MemPage *pPage = pCur->pPage;
+ unsigned char *pCell;
+ int rc;
+ Pgno pgnoChild = 0;
+ Btree *pBt = pCur->pBt;
+
+ assert( pPage->isInit );
+ if( pBt->inTrans!=TRANS_WRITE ){
+ /* Must start a transaction before doing a delete */
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
+ }
+ assert( !pBt->readOnly );
+ if( pCur->idx >= pPage->nCell ){
+ return SQLITE_ERROR; /* The cursor is not pointing to anything */
+ }
+ if( !pCur->wrFlag ){
+ return SQLITE_PERM; /* Did not open this cursor for writing */
+ }
+ if( checkReadLocks(pBt, pCur->pgnoRoot, pCur) ){
+ return SQLITE_LOCKED; /* The table pCur points to has a read lock */
+ }
+ rc = sqlite3pager_write(pPage->aData);
+ if( rc ) return rc;
+
+ /* Locate the cell within it's page and leave pCell pointing to the
+ ** data. The clearCell() call frees any overflow pages associated with the
+ ** cell. The cell itself is still intact.
+ */
+ pCell = findCell(pPage, pCur->idx);
+ if( !pPage->leaf ){
+ pgnoChild = get4byte(pCell);
+ }
+ rc = clearCell(pPage, pCell);
+ if( rc ) return rc;
+
+ if( !pPage->leaf ){
+ /*
+ ** The entry we are about to delete is not a leaf so if we do not
+ ** do something we will leave a hole on an internal page.
+ ** We have to fill the hole by moving in a cell from a leaf. The
+ ** next Cell after the one to be deleted is guaranteed to exist and
+ ** to be a leaf so we can use it.
+ */
+ BtCursor leafCur;
+ unsigned char *pNext;
+ int szNext;
+ int notUsed;
+ unsigned char *tempCell = 0;
+ assert( !pPage->leafData );
+ getTempCursor(pCur, &leafCur);
+ rc = sqlite3BtreeNext(&leafCur, &notUsed);
+ if( rc!=SQLITE_OK ){
+ if( rc!=SQLITE_NOMEM ){
+ rc = SQLITE_CORRUPT_BKPT;
+ }
+ }
+ if( rc==SQLITE_OK ){
+ rc = sqlite3pager_write(leafCur.pPage->aData);
+ }
+ if( rc==SQLITE_OK ){
+ TRACE(("DELETE: table=%d delete internal from %d replace from leaf %d\n",
+ pCur->pgnoRoot, pPage->pgno, leafCur.pPage->pgno));
+ dropCell(pPage, pCur->idx, cellSizePtr(pPage, pCell));
+ pNext = findCell(leafCur.pPage, leafCur.idx);
+ szNext = cellSizePtr(leafCur.pPage, pNext);
+ assert( MX_CELL_SIZE(pBt)>=szNext+4 );
+ tempCell = sqliteMallocRaw( MX_CELL_SIZE(pBt) );
+ if( tempCell==0 ){
+ rc = SQLITE_NOMEM;
+ }
+ }
+ if( rc==SQLITE_OK ){
+ rc = insertCell(pPage, pCur->idx, pNext-4, szNext+4, tempCell, 0);
+ }
+ if( rc==SQLITE_OK ){
+ put4byte(findOverflowCell(pPage, pCur->idx), pgnoChild);
+ rc = balance(pPage, 0);
+ }
+ if( rc==SQLITE_OK ){
+ dropCell(leafCur.pPage, leafCur.idx, szNext);
+ rc = balance(leafCur.pPage, 0);
+ }
+ sqliteFree(tempCell);
+ releaseTempCursor(&leafCur);
+ }else{
+ TRACE(("DELETE: table=%d delete from leaf %d\n",
+ pCur->pgnoRoot, pPage->pgno));
+ dropCell(pPage, pCur->idx, cellSizePtr(pPage, pCell));
+ rc = balance(pPage, 0);
+ }
+ if( rc==SQLITE_OK ){
+ moveToRoot(pCur);
+ }
+ return rc;
+}
+
+/*
+** Create a new BTree table. Write into *piTable the page
+** number for the root page of the new table.
+**
+** The type of type is determined by the flags parameter. Only the
+** following values of flags are currently in use. Other values for
+** flags might not work:
+**
+** BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys
+** BTREE_ZERODATA Used for SQL indices
+*/
+int sqlite3BtreeCreateTable(Btree *pBt, int *piTable, int flags){
+ MemPage *pRoot;
+ Pgno pgnoRoot;
+ int rc;
+ if( pBt->inTrans!=TRANS_WRITE ){
+ /* Must start a transaction first */
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
+ }
+ assert( !pBt->readOnly );
+
+ /* It is illegal to create a table if any cursors are open on the
+ ** database. This is because in auto-vacuum mode the backend may
+ ** need to move a database page to make room for the new root-page.
+ ** If an open cursor was using the page a problem would occur.
+ */
+ if( pBt->pCursor ){
+ return SQLITE_LOCKED;
+ }
+
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ rc = allocatePage(pBt, &pRoot, &pgnoRoot, 1, 0);
+ if( rc ) return rc;
+#else
+ if( pBt->autoVacuum ){
+ Pgno pgnoMove; /* Move a page here to make room for the root-page */
+ MemPage *pPageMove; /* The page to move to. */
+
+ /* Read the value of meta[3] from the database to determine where the
+ ** root page of the new table should go. meta[3] is the largest root-page
+ ** created so far, so the new root-page is (meta[3]+1).
+ */
+ rc = sqlite3BtreeGetMeta(pBt, 4, &pgnoRoot);
+ if( rc!=SQLITE_OK ) return rc;
+ pgnoRoot++;
+
+ /* The new root-page may not be allocated on a pointer-map page, or the
+ ** PENDING_BYTE page.
+ */
+ if( pgnoRoot==PTRMAP_PAGENO(pBt->usableSize, pgnoRoot) ||
+ pgnoRoot==PENDING_BYTE_PAGE(pBt) ){
+ pgnoRoot++;
+ }
+ assert( pgnoRoot>=3 );
+
+ /* Allocate a page. The page that currently resides at pgnoRoot will
+ ** be moved to the allocated page (unless the allocated page happens
+ ** to reside at pgnoRoot).
+ */
+ rc = allocatePage(pBt, &pPageMove, &pgnoMove, pgnoRoot, 1);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+
+ if( pgnoMove!=pgnoRoot ){
+ u8 eType;
+ Pgno iPtrPage;
+
+ releasePage(pPageMove);
+ rc = getPage(pBt, pgnoRoot, &pRoot);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ rc = ptrmapGet(pBt, pgnoRoot, &eType, &iPtrPage);
+ if( rc!=SQLITE_OK || eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){
+ releasePage(pRoot);
+ return rc;
+ }
+ assert( eType!=PTRMAP_ROOTPAGE );
+ assert( eType!=PTRMAP_FREEPAGE );
+ rc = sqlite3pager_write(pRoot->aData);
+ if( rc!=SQLITE_OK ){
+ releasePage(pRoot);
+ return rc;
+ }
+ rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove);
+ releasePage(pRoot);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ rc = getPage(pBt, pgnoRoot, &pRoot);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ rc = sqlite3pager_write(pRoot->aData);
+ if( rc!=SQLITE_OK ){
+ releasePage(pRoot);
+ return rc;
+ }
+ }else{
+ pRoot = pPageMove;
+ }
+
+ /* Update the pointer-map and meta-data with the new root-page number. */
+ rc = ptrmapPut(pBt, pgnoRoot, PTRMAP_ROOTPAGE, 0);
+ if( rc ){
+ releasePage(pRoot);
+ return rc;
+ }
+ rc = sqlite3BtreeUpdateMeta(pBt, 4, pgnoRoot);
+ if( rc ){
+ releasePage(pRoot);
+ return rc;
+ }
+
+ }else{
+ rc = allocatePage(pBt, &pRoot, &pgnoRoot, 1, 0);
+ if( rc ) return rc;
+ }
+#endif
+ assert( sqlite3pager_iswriteable(pRoot->aData) );
+ zeroPage(pRoot, flags | PTF_LEAF);
+ sqlite3pager_unref(pRoot->aData);
+ *piTable = (int)pgnoRoot;
+ return SQLITE_OK;
+}
+
+/*
+** Erase the given database page and all its children. Return
+** the page to the freelist.
+*/
+static int clearDatabasePage(
+ Btree *pBt, /* The BTree that contains the table */
+ Pgno pgno, /* Page number to clear */
+ MemPage *pParent, /* Parent page. NULL for the root */
+ int freePageFlag /* Deallocate page if true */
+){
+ MemPage *pPage = 0;
+ int rc;
+ unsigned char *pCell;
+ int i;
+
+ if( pgno>sqlite3pager_pagecount(pBt->pPager) ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+
+ rc = getAndInitPage(pBt, pgno, &pPage, pParent);
+ if( rc ) goto cleardatabasepage_out;
+ rc = sqlite3pager_write(pPage->aData);
+ if( rc ) goto cleardatabasepage_out;
+ for(i=0; i<pPage->nCell; i++){
+ pCell = findCell(pPage, i);
+ if( !pPage->leaf ){
+ rc = clearDatabasePage(pBt, get4byte(pCell), pPage->pParent, 1);
+ if( rc ) goto cleardatabasepage_out;
+ }
+ rc = clearCell(pPage, pCell);
+ if( rc ) goto cleardatabasepage_out;
+ }
+ if( !pPage->leaf ){
+ rc = clearDatabasePage(pBt, get4byte(&pPage->aData[8]), pPage->pParent, 1);
+ if( rc ) goto cleardatabasepage_out;
+ }
+ if( freePageFlag ){
+ rc = freePage(pPage);
+ }else{
+ zeroPage(pPage, pPage->aData[0] | PTF_LEAF);
+ }
+
+cleardatabasepage_out:
+ releasePage(pPage);
+ return rc;
+}
+
+/*
+** Delete all information from a single table in the database. iTable is
+** the page number of the root of the table. After this routine returns,
+** the root page is empty, but still exists.
+**
+** This routine will fail with SQLITE_LOCKED if there are any open
+** read cursors on the table. Open write cursors are moved to the
+** root of the table.
+*/
+int sqlite3BtreeClearTable(Btree *pBt, int iTable){
+ int rc;
+ BtCursor *pCur;
+ if( pBt->inTrans!=TRANS_WRITE ){
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
+ }
+ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){
+ if( pCur->pgnoRoot==(Pgno)iTable ){
+ if( pCur->wrFlag==0 ) return SQLITE_LOCKED;
+ moveToRoot(pCur);
+ }
+ }
+ rc = clearDatabasePage(pBt, (Pgno)iTable, 0, 0);
+ if( rc ){
+ sqlite3BtreeRollback(pBt);
+ }
+ return rc;
+}
+
+/*
+** Erase all information in a table and add the root of the table to
+** the freelist. Except, the root of the principle table (the one on
+** page 1) is never added to the freelist.
+**
+** This routine will fail with SQLITE_LOCKED if there are any open
+** cursors on the table.
+**
+** If AUTOVACUUM is enabled and the page at iTable is not the last
+** root page in the database file, then the last root page
+** in the database file is moved into the slot formerly occupied by
+** iTable and that last slot formerly occupied by the last root page
+** is added to the freelist instead of iTable. In this say, all
+** root pages are kept at the beginning of the database file, which
+** is necessary for AUTOVACUUM to work right. *piMoved is set to the
+** page number that used to be the last root page in the file before
+** the move. If no page gets moved, *piMoved is set to 0.
+** The last root page is recorded in meta[3] and the value of
+** meta[3] is updated by this procedure.
+*/
+int sqlite3BtreeDropTable(Btree *pBt, int iTable, int *piMoved){
+ int rc;
+ MemPage *pPage = 0;
+
+ if( pBt->inTrans!=TRANS_WRITE ){
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
+ }
+
+ /* It is illegal to drop a table if any cursors are open on the
+ ** database. This is because in auto-vacuum mode the backend may
+ ** need to move another root-page to fill a gap left by the deleted
+ ** root page. If an open cursor was using this page a problem would
+ ** occur.
+ */
+ if( pBt->pCursor ){
+ return SQLITE_LOCKED;
+ }
+
+ rc = getPage(pBt, (Pgno)iTable, &pPage);
+ if( rc ) return rc;
+ rc = sqlite3BtreeClearTable(pBt, iTable);
+ if( rc ){
+ releasePage(pPage);
+ return rc;
+ }
+
+ *piMoved = 0;
+
+ if( iTable>1 ){
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ rc = freePage(pPage);
+ releasePage(pPage);
+#else
+ if( pBt->autoVacuum ){
+ Pgno maxRootPgno;
+ rc = sqlite3BtreeGetMeta(pBt, 4, &maxRootPgno);
+ if( rc!=SQLITE_OK ){
+ releasePage(pPage);
+ return rc;
+ }
+
+ if( iTable==maxRootPgno ){
+ /* If the table being dropped is the table with the largest root-page
+ ** number in the database, put the root page on the free list.
+ */
+ rc = freePage(pPage);
+ releasePage(pPage);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ }else{
+ /* The table being dropped does not have the largest root-page
+ ** number in the database. So move the page that does into the
+ ** gap left by the deleted root-page.
+ */
+ MemPage *pMove;
+ releasePage(pPage);
+ rc = getPage(pBt, maxRootPgno, &pMove);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ rc = relocatePage(pBt, pMove, PTRMAP_ROOTPAGE, 0, iTable);
+ releasePage(pMove);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ rc = getPage(pBt, maxRootPgno, &pMove);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ rc = freePage(pMove);
+ releasePage(pMove);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ *piMoved = maxRootPgno;
+ }
+
+ /* Set the new 'max-root-page' value in the database header. This
+ ** is the old value less one, less one more if that happens to
+ ** be a root-page number, less one again if that is the
+ ** PENDING_BYTE_PAGE.
+ */
+ maxRootPgno--;
+ if( maxRootPgno==PENDING_BYTE_PAGE(pBt) ){
+ maxRootPgno--;
+ }
+ if( maxRootPgno==PTRMAP_PAGENO(pBt->usableSize, maxRootPgno) ){
+ maxRootPgno--;
+ }
+ assert( maxRootPgno!=PENDING_BYTE_PAGE(pBt) );
+
+ rc = sqlite3BtreeUpdateMeta(pBt, 4, maxRootPgno);
+ }else{
+ rc = freePage(pPage);
+ releasePage(pPage);
+ }
+#endif
+ }else{
+ /* If sqlite3BtreeDropTable was called on page 1. */
+ zeroPage(pPage, PTF_INTKEY|PTF_LEAF );
+ releasePage(pPage);
+ }
+ return rc;
+}
+
+
+/*
+** Read the meta-information out of a database file. Meta[0]
+** is the number of free pages currently in the database. Meta[1]
+** through meta[15] are available for use by higher layers. Meta[0]
+** is read-only, the others are read/write.
+**
+** The schema layer numbers meta values differently. At the schema
+** layer (and the SetCookie and ReadCookie opcodes) the number of
+** free pages is not visible. So Cookie[0] is the same as Meta[1].
+*/
+int sqlite3BtreeGetMeta(Btree *pBt, int idx, u32 *pMeta){
+ int rc;
+ unsigned char *pP1;
+
+ assert( idx>=0 && idx<=15 );
+ rc = sqlite3pager_get(pBt->pPager, 1, (void**)&pP1);
+ if( rc ) return rc;
+ *pMeta = get4byte(&pP1[36 + idx*4]);
+ sqlite3pager_unref(pP1);
+
+ /* If autovacuumed is disabled in this build but we are trying to
+ ** access an autovacuumed database, then make the database readonly.
+ */
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ if( idx==4 && *pMeta>0 ) pBt->readOnly = 1;
+#endif
+
+ return SQLITE_OK;
+}
+
+/*
+** Write meta-information back into the database. Meta[0] is
+** read-only and may not be written.
+*/
+int sqlite3BtreeUpdateMeta(Btree *pBt, int idx, u32 iMeta){
+ unsigned char *pP1;
+ int rc;
+ assert( idx>=1 && idx<=15 );
+ if( pBt->inTrans!=TRANS_WRITE ){
+ return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
+ }
+ assert( pBt->pPage1!=0 );
+ pP1 = pBt->pPage1->aData;
+ rc = sqlite3pager_write(pP1);
+ if( rc ) return rc;
+ put4byte(&pP1[36 + idx*4], iMeta);
+ return SQLITE_OK;
+}
+
+/*
+** Return the flag byte at the beginning of the page that the cursor
+** is currently pointing to.
+*/
+int sqlite3BtreeFlags(BtCursor *pCur){
+ MemPage *pPage = pCur->pPage;
+ return pPage ? pPage->aData[pPage->hdrOffset] : 0;
+}
+
+#ifdef SQLITE_DEBUG
+/*
+** Print a disassembly of the given page on standard output. This routine
+** is used for debugging and testing only.
+*/
+static int btreePageDump(Btree *pBt, int pgno, int recursive, MemPage *pParent){
+ int rc;
+ MemPage *pPage;
+ int i, j, c;
+ int nFree;
+ u16 idx;
+ int hdr;
+ int nCell;
+ int isInit;
+ unsigned char *data;
+ char range[20];
+ unsigned char payload[20];
+
+ rc = getPage(pBt, (Pgno)pgno, &pPage);
+ isInit = pPage->isInit;
+ if( pPage->isInit==0 ){
+ initPage(pPage, pParent);
+ }
+ if( rc ){
+ return rc;
+ }
+ hdr = pPage->hdrOffset;
+ data = pPage->aData;
+ c = data[hdr];
+ pPage->intKey = (c & (PTF_INTKEY|PTF_LEAFDATA))!=0;
+ pPage->zeroData = (c & PTF_ZERODATA)!=0;
+ pPage->leafData = (c & PTF_LEAFDATA)!=0;
+ pPage->leaf = (c & PTF_LEAF)!=0;
+ pPage->hasData = !(pPage->zeroData || (!pPage->leaf && pPage->leafData));
+ nCell = get2byte(&data[hdr+3]);
+ sqlite3DebugPrintf("PAGE %d: flags=0x%02x frag=%d parent=%d\n", pgno,
+ data[hdr], data[hdr+7],
+ (pPage->isInit && pPage->pParent) ? pPage->pParent->pgno : 0);
+ assert( hdr == (pgno==1 ? 100 : 0) );
+ idx = hdr + 12 - pPage->leaf*4;
+ for(i=0; i<nCell; i++){
+ CellInfo info;
+ Pgno child;
+ unsigned char *pCell;
+ int sz;
+ int addr;
+
+ addr = get2byte(&data[idx + 2*i]);
+ pCell = &data[addr];
+ parseCellPtr(pPage, pCell, &info);
+ sz = info.nSize;
+ sprintf(range,"%d..%d", addr, addr+sz-1);
+ if( pPage->leaf ){
+ child = 0;
+ }else{
+ child = get4byte(pCell);
+ }
+ sz = info.nData;
+ if( !pPage->intKey ) sz += info.nKey;
+ if( sz>sizeof(payload)-1 ) sz = sizeof(payload)-1;
+ memcpy(payload, &pCell[info.nHeader], sz);
+ for(j=0; j<sz; j++){
+ if( payload[j]<0x20 || payload[j]>0x7f ) payload[j] = '.';
+ }
+ payload[sz] = 0;
+ sqlite3DebugPrintf(
+ "cell %2d: i=%-10s chld=%-4d nk=%-4lld nd=%-4d payload=%s\n",
+ i, range, child, info.nKey, info.nData, payload
+ );
+ }
+ if( !pPage->leaf ){
+ sqlite3DebugPrintf("right_child: %d\n", get4byte(&data[hdr+8]));
+ }
+ nFree = 0;
+ i = 0;
+ idx = get2byte(&data[hdr+1]);
+ while( idx>0 && idx<pPage->pBt->usableSize ){
+ int sz = get2byte(&data[idx+2]);
+ sprintf(range,"%d..%d", idx, idx+sz-1);
+ nFree += sz;
+ sqlite3DebugPrintf("freeblock %2d: i=%-10s size=%-4d total=%d\n",
+ i, range, sz, nFree);
+ idx = get2byte(&data[idx]);
+ i++;
+ }
+ if( idx!=0 ){
+ sqlite3DebugPrintf("ERROR: next freeblock index out of range: %d\n", idx);
+ }
+ if( recursive && !pPage->leaf ){
+ for(i=0; i<nCell; i++){
+ unsigned char *pCell = findCell(pPage, i);
+ btreePageDump(pBt, get4byte(pCell), 1, pPage);
+ idx = get2byte(pCell);
+ }
+ btreePageDump(pBt, get4byte(&data[hdr+8]), 1, pPage);
+ }
+ pPage->isInit = isInit;
+ sqlite3pager_unref(data);
+ fflush(stdout);
+ return SQLITE_OK;
+}
+int sqlite3BtreePageDump(Btree *pBt, int pgno, int recursive){
+ return btreePageDump(pBt, pgno, recursive, 0);
+}
+#endif
+
+#ifdef SQLITE_TEST
+/*
+** Fill aResult[] with information about the entry and page that the
+** cursor is pointing to.
+**
+** aResult[0] = The page number
+** aResult[1] = The entry number
+** aResult[2] = Total number of entries on this page
+** aResult[3] = Cell size (local payload + header)
+** aResult[4] = Number of free bytes on this page
+** aResult[5] = Number of free blocks on the page
+** aResult[6] = Total payload size (local + overflow)
+** aResult[7] = Header size in bytes
+** aResult[8] = Local payload size
+** aResult[9] = Parent page number
+**
+** This routine is used for testing and debugging only.
+*/
+int sqlite3BtreeCursorInfo(BtCursor *pCur, int *aResult, int upCnt){
+ int cnt, idx;
+ MemPage *pPage = pCur->pPage;
+ BtCursor tmpCur;
+
+ pageIntegrity(pPage);
+ assert( pPage->isInit );
+ getTempCursor(pCur, &tmpCur);
+ while( upCnt-- ){
+ moveToParent(&tmpCur);
+ }
+ pPage = tmpCur.pPage;
+ pageIntegrity(pPage);
+ aResult[0] = sqlite3pager_pagenumber(pPage->aData);
+ assert( aResult[0]==pPage->pgno );
+ aResult[1] = tmpCur.idx;
+ aResult[2] = pPage->nCell;
+ if( tmpCur.idx>=0 && tmpCur.idx<pPage->nCell ){
+ getCellInfo(&tmpCur);
+ aResult[3] = tmpCur.info.nSize;
+ aResult[6] = tmpCur.info.nData;
+ aResult[7] = tmpCur.info.nHeader;
+ aResult[8] = tmpCur.info.nLocal;
+ }else{
+ aResult[3] = 0;
+ aResult[6] = 0;
+ aResult[7] = 0;
+ aResult[8] = 0;
+ }
+ aResult[4] = pPage->nFree;
+ cnt = 0;
+ idx = get2byte(&pPage->aData[pPage->hdrOffset+1]);
+ while( idx>0 && idx<pPage->pBt->usableSize ){
+ cnt++;
+ idx = get2byte(&pPage->aData[idx]);
+ }
+ aResult[5] = cnt;
+ if( pPage->pParent==0 || isRootPage(pPage) ){
+ aResult[9] = 0;
+ }else{
+ aResult[9] = pPage->pParent->pgno;
+ }
+ releaseTempCursor(&tmpCur);
+ return SQLITE_OK;
+}
+#endif
+
+/*
+** Return the pager associated with a BTree. This routine is used for
+** testing and debugging only.
+*/
+Pager *sqlite3BtreePager(Btree *pBt){
+ return pBt->pPager;
+}
+
+/*
+** This structure is passed around through all the sanity checking routines
+** in order to keep track of some global state information.
+*/
+typedef struct IntegrityCk IntegrityCk;
+struct IntegrityCk {
+ Btree *pBt; /* The tree being checked out */
+ Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */
+ int nPage; /* Number of pages in the database */
+ int *anRef; /* Number of times each page is referenced */
+ char *zErrMsg; /* An error message. NULL of no errors seen. */
+};
+
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
+/*
+** Append a message to the error message string.
+*/
+static void checkAppendMsg(
+ IntegrityCk *pCheck,
+ char *zMsg1,
+ const char *zFormat,
+ ...
+){
+ va_list ap;
+ char *zMsg2;
+ va_start(ap, zFormat);
+ zMsg2 = sqlite3VMPrintf(zFormat, ap);
+ va_end(ap);
+ if( zMsg1==0 ) zMsg1 = "";
+ if( pCheck->zErrMsg ){
+ char *zOld = pCheck->zErrMsg;
+ pCheck->zErrMsg = 0;
+ sqlite3SetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, (char*)0);
+ sqliteFree(zOld);
+ }else{
+ sqlite3SetString(&pCheck->zErrMsg, zMsg1, zMsg2, (char*)0);
+ }
+ sqliteFree(zMsg2);
+}
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
+
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
+/*
+** Add 1 to the reference count for page iPage. If this is the second
+** reference to the page, add an error message to pCheck->zErrMsg.
+** Return 1 if there are 2 ore more references to the page and 0 if
+** if this is the first reference to the page.
+**
+** Also check that the page number is in bounds.
+*/
+static int checkRef(IntegrityCk *pCheck, int iPage, char *zContext){
+ if( iPage==0 ) return 1;
+ if( iPage>pCheck->nPage || iPage<0 ){
+ checkAppendMsg(pCheck, zContext, "invalid page number %d", iPage);
+ return 1;
+ }
+ if( pCheck->anRef[iPage]==1 ){
+ checkAppendMsg(pCheck, zContext, "2nd reference to page %d", iPage);
+ return 1;
+ }
+ return (pCheck->anRef[iPage]++)>1;
+}
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+/*
+** Check that the entry in the pointer-map for page iChild maps to
+** page iParent, pointer type ptrType. If not, append an error message
+** to pCheck.
+*/
+static void checkPtrmap(
+ IntegrityCk *pCheck, /* Integrity check context */
+ Pgno iChild, /* Child page number */
+ u8 eType, /* Expected pointer map type */
+ Pgno iParent, /* Expected pointer map parent page number */
+ char *zContext /* Context description (used for error msg) */
+){
+ int rc;
+ u8 ePtrmapType;
+ Pgno iPtrmapParent;
+
+ rc = ptrmapGet(pCheck->pBt, iChild, &ePtrmapType, &iPtrmapParent);
+ if( rc!=SQLITE_OK ){
+ checkAppendMsg(pCheck, zContext, "Failed to read ptrmap key=%d", iChild);
+ return;
+ }
+
+ if( ePtrmapType!=eType || iPtrmapParent!=iParent ){
+ checkAppendMsg(pCheck, zContext,
+ "Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)",
+ iChild, eType, iParent, ePtrmapType, iPtrmapParent);
+ }
+}
+#endif
+
+/*
+** Check the integrity of the freelist or of an overflow page list.
+** Verify that the number of pages on the list is N.
+*/
+static void checkList(
+ IntegrityCk *pCheck, /* Integrity checking context */
+ int isFreeList, /* True for a freelist. False for overflow page list */
+ int iPage, /* Page number for first page in the list */
+ int N, /* Expected number of pages in the list */
+ char *zContext /* Context for error messages */
+){
+ int i;
+ int expected = N;
+ int iFirst = iPage;
+ while( N-- > 0 ){
+ unsigned char *pOvfl;
+ if( iPage<1 ){
+ checkAppendMsg(pCheck, zContext,
+ "%d of %d pages missing from overflow list starting at %d",
+ N+1, expected, iFirst);
+ break;
+ }
+ if( checkRef(pCheck, iPage, zContext) ) break;
+ if( sqlite3pager_get(pCheck->pPager, (Pgno)iPage, (void**)&pOvfl) ){
+ checkAppendMsg(pCheck, zContext, "failed to get page %d", iPage);
+ break;
+ }
+ if( isFreeList ){
+ int n = get4byte(&pOvfl[4]);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pCheck->pBt->autoVacuum ){
+ checkPtrmap(pCheck, iPage, PTRMAP_FREEPAGE, 0, zContext);
+ }
+#endif
+ if( n>pCheck->pBt->usableSize/4-8 ){
+ checkAppendMsg(pCheck, zContext,
+ "freelist leaf count too big on page %d", iPage);
+ N--;
+ }else{
+ for(i=0; i<n; i++){
+ Pgno iFreePage = get4byte(&pOvfl[8+i*4]);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pCheck->pBt->autoVacuum ){
+ checkPtrmap(pCheck, iFreePage, PTRMAP_FREEPAGE, 0, zContext);
+ }
+#endif
+ checkRef(pCheck, iFreePage, zContext);
+ }
+ N -= n;
+ }
+ }
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ else{
+ /* If this database supports auto-vacuum and iPage is not the last
+ ** page in this overflow list, check that the pointer-map entry for
+ ** the following page matches iPage.
+ */
+ if( pCheck->pBt->autoVacuum && N>0 ){
+ i = get4byte(pOvfl);
+ checkPtrmap(pCheck, i, PTRMAP_OVERFLOW2, iPage, zContext);
+ }
+ }
+#endif
+ iPage = get4byte(pOvfl);
+ sqlite3pager_unref(pOvfl);
+ }
+}
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
+
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
+/*
+** Do various sanity checks on a single page of a tree. Return
+** the tree depth. Root pages return 0. Parents of root pages
+** return 1, and so forth.
+**
+** These checks are done:
+**
+** 1. Make sure that cells and freeblocks do not overlap
+** but combine to completely cover the page.
+** NO 2. Make sure cell keys are in order.
+** NO 3. Make sure no key is less than or equal to zLowerBound.
+** NO 4. Make sure no key is greater than or equal to zUpperBound.
+** 5. Check the integrity of overflow pages.
+** 6. Recursively call checkTreePage on all children.
+** 7. Verify that the depth of all children is the same.
+** 8. Make sure this page is at least 33% full or else it is
+** the root of the tree.
+*/
+static int checkTreePage(
+ IntegrityCk *pCheck, /* Context for the sanity check */
+ int iPage, /* Page number of the page to check */
+ MemPage *pParent, /* Parent page */
+ char *zParentContext, /* Parent context */
+ char *zLowerBound, /* All keys should be greater than this, if not NULL */
+ int nLower, /* Number of characters in zLowerBound */
+ char *zUpperBound, /* All keys should be less than this, if not NULL */
+ int nUpper /* Number of characters in zUpperBound */
+){
+ MemPage *pPage;
+ int i, rc, depth, d2, pgno, cnt;
+ int hdr, cellStart;
+ int nCell;
+ u8 *data;
+ BtCursor cur;
+ Btree *pBt;
+ int usableSize;
+ char zContext[100];
+ char *hit;
+
+ sprintf(zContext, "Page %d: ", iPage);
+
+ /* Check that the page exists
+ */
+ cur.pBt = pBt = pCheck->pBt;
+ usableSize = pBt->usableSize;
+ if( iPage==0 ) return 0;
+ if( checkRef(pCheck, iPage, zParentContext) ) return 0;
+ if( (rc = getPage(pBt, (Pgno)iPage, &pPage))!=0 ){
+ checkAppendMsg(pCheck, zContext,
+ "unable to get the page. error code=%d", rc);
+ return 0;
+ }
+ if( (rc = initPage(pPage, pParent))!=0 ){
+ checkAppendMsg(pCheck, zContext, "initPage() returns error code %d", rc);
+ releasePage(pPage);
+ return 0;
+ }
+
+ /* Check out all the cells.
+ */
+ depth = 0;
+ cur.pPage = pPage;
+ for(i=0; i<pPage->nCell; i++){
+ u8 *pCell;
+ int sz;
+ CellInfo info;
+
+ /* Check payload overflow pages
+ */
+ sprintf(zContext, "On tree page %d cell %d: ", iPage, i);
+ pCell = findCell(pPage,i);
+ parseCellPtr(pPage, pCell, &info);
+ sz = info.nData;
+ if( !pPage->intKey ) sz += info.nKey;
+ if( sz>info.nLocal ){
+ int nPage = (sz - info.nLocal + usableSize - 5)/(usableSize - 4);
+ Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage, zContext);
+ }
+#endif
+ checkList(pCheck, 0, pgnoOvfl, nPage, zContext);
+ }
+
+ /* Check sanity of left child page.
+ */
+ if( !pPage->leaf ){
+ pgno = get4byte(pCell);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext);
+ }
+#endif
+ d2 = checkTreePage(pCheck,pgno,pPage,zContext,0,0,0,0);
+ if( i>0 && d2!=depth ){
+ checkAppendMsg(pCheck, zContext, "Child page depth differs");
+ }
+ depth = d2;
+ }
+ }
+ if( !pPage->leaf ){
+ pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]);
+ sprintf(zContext, "On page %d at right child: ", iPage);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum ){
+ checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, 0);
+ }
+#endif
+ checkTreePage(pCheck, pgno, pPage, zContext,0,0,0,0);
+ }
+
+ /* Check for complete coverage of the page
+ */
+ data = pPage->aData;
+ hdr = pPage->hdrOffset;
+ hit = sqliteMalloc( usableSize );
+ if( hit ){
+ memset(hit, 1, get2byte(&data[hdr+5]));
+ nCell = get2byte(&data[hdr+3]);
+ cellStart = hdr + 12 - 4*pPage->leaf;
+ for(i=0; i<nCell; i++){
+ int pc = get2byte(&data[cellStart+i*2]);
+ int size = cellSizePtr(pPage, &data[pc]);
+ int j;
+ if( (pc+size-1)>=usableSize || pc<0 ){
+ checkAppendMsg(pCheck, 0,
+ "Corruption detected in cell %d on page %d",i,iPage,0);
+ }else{
+ for(j=pc+size-1; j>=pc; j--) hit[j]++;
+ }
+ }
+ for(cnt=0, i=get2byte(&data[hdr+1]); i>0 && i<usableSize && cnt<10000;
+ cnt++){
+ int size = get2byte(&data[i+2]);
+ int j;
+ if( (i+size-1)>=usableSize || i<0 ){
+ checkAppendMsg(pCheck, 0,
+ "Corruption detected in cell %d on page %d",i,iPage,0);
+ }else{
+ for(j=i+size-1; j>=i; j--) hit[j]++;
+ }
+ i = get2byte(&data[i]);
+ }
+ for(i=cnt=0; i<usableSize; i++){
+ if( hit[i]==0 ){
+ cnt++;
+ }else if( hit[i]>1 ){
+ checkAppendMsg(pCheck, 0,
+ "Multiple uses for byte %d of page %d", i, iPage);
+ break;
+ }
+ }
+ if( cnt!=data[hdr+7] ){
+ checkAppendMsg(pCheck, 0,
+ "Fragmented space is %d byte reported as %d on page %d",
+ cnt, data[hdr+7], iPage);
+ }
+ }
+ sqliteFree(hit);
+
+ releasePage(pPage);
+ return depth+1;
+}
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
+
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
+/*
+** This routine does a complete check of the given BTree file. aRoot[] is
+** an array of pages numbers were each page number is the root page of
+** a table. nRoot is the number of entries in aRoot.
+**
+** If everything checks out, this routine returns NULL. If something is
+** amiss, an error message is written into memory obtained from malloc()
+** and a pointer to that error message is returned. The calling function
+** is responsible for freeing the error message when it is done.
+*/
+char *sqlite3BtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){
+ int i;
+ int nRef;
+ IntegrityCk sCheck;
+
+ nRef = *sqlite3pager_stats(pBt->pPager);
+ if( lockBtreeWithRetry(pBt)!=SQLITE_OK ){
+ return sqliteStrDup("Unable to acquire a read lock on the database");
+ }
+ sCheck.pBt = pBt;
+ sCheck.pPager = pBt->pPager;
+ sCheck.nPage = sqlite3pager_pagecount(sCheck.pPager);
+ if( sCheck.nPage==0 ){
+ unlockBtreeIfUnused(pBt);
+ return 0;
+ }
+ sCheck.anRef = sqliteMallocRaw( (sCheck.nPage+1)*sizeof(sCheck.anRef[0]) );
+ if( !sCheck.anRef ){
+ unlockBtreeIfUnused(pBt);
+ return sqlite3MPrintf("Unable to malloc %d bytes",
+ (sCheck.nPage+1)*sizeof(sCheck.anRef[0]));
+ }
+ for(i=0; i<=sCheck.nPage; i++){ sCheck.anRef[i] = 0; }
+ i = PENDING_BYTE_PAGE(pBt);
+ if( i<=sCheck.nPage ){
+ sCheck.anRef[i] = 1;
+ }
+ sCheck.zErrMsg = 0;
+
+ /* Check the integrity of the freelist
+ */
+ checkList(&sCheck, 1, get4byte(&pBt->pPage1->aData[32]),
+ get4byte(&pBt->pPage1->aData[36]), "Main freelist: ");
+
+ /* Check all the tables.
+ */
+ for(i=0; i<nRoot; i++){
+ if( aRoot[i]==0 ) continue;
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( pBt->autoVacuum && aRoot[i]>1 ){
+ checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0, 0);
+ }
+#endif
+ checkTreePage(&sCheck, aRoot[i], 0, "List of tree roots: ", 0,0,0,0);
+ }
+
+ /* Make sure every page in the file is referenced
+ */
+ for(i=1; i<=sCheck.nPage; i++){
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ if( sCheck.anRef[i]==0 ){
+ checkAppendMsg(&sCheck, 0, "Page %d is never used", i);
+ }
+#else
+ /* If the database supports auto-vacuum, make sure no tables contain
+ ** references to pointer-map pages.
+ */
+ if( sCheck.anRef[i]==0 &&
+ (PTRMAP_PAGENO(pBt->usableSize, i)!=i || !pBt->autoVacuum) ){
+ checkAppendMsg(&sCheck, 0, "Page %d is never used", i);
+ }
+ if( sCheck.anRef[i]!=0 &&
+ (PTRMAP_PAGENO(pBt->usableSize, i)==i && pBt->autoVacuum) ){
+ checkAppendMsg(&sCheck, 0, "Pointer map page %d is referenced", i);
+ }
+#endif
+ }
+
+ /* Make sure this analysis did not leave any unref() pages
+ */
+ unlockBtreeIfUnused(pBt);
+ if( nRef != *sqlite3pager_stats(pBt->pPager) ){
+ checkAppendMsg(&sCheck, 0,
+ "Outstanding page count goes from %d to %d during this analysis",
+ nRef, *sqlite3pager_stats(pBt->pPager)
+ );
+ }
+
+ /* Clean up and report errors.
+ */
+ sqliteFree(sCheck.anRef);
+ return sCheck.zErrMsg;
+}
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
+
+/*
+** Return the full pathname of the underlying database file.
+*/
+const char *sqlite3BtreeGetFilename(Btree *pBt){
+ assert( pBt->pPager!=0 );
+ return sqlite3pager_filename(pBt->pPager);
+}
+
+/*
+** Return the pathname of the directory that contains the database file.
+*/
+const char *sqlite3BtreeGetDirname(Btree *pBt){
+ assert( pBt->pPager!=0 );
+ return sqlite3pager_dirname(pBt->pPager);
+}
+
+/*
+** Return the pathname of the journal file for this database. The return
+** value of this routine is the same regardless of whether the journal file
+** has been created or not.
+*/
+const char *sqlite3BtreeGetJournalname(Btree *pBt){
+ assert( pBt->pPager!=0 );
+ return sqlite3pager_journalname(pBt->pPager);
+}
+
+#ifndef SQLITE_OMIT_VACUUM
+/*
+** Copy the complete content of pBtFrom into pBtTo. A transaction
+** must be active for both files.
+**
+** The size of file pBtFrom may be reduced by this operation.
+** If anything goes wrong, the transaction on pBtFrom is rolled back.
+*/
+int sqlite3BtreeCopyFile(Btree *pBtTo, Btree *pBtFrom){
+ int rc = SQLITE_OK;
+ Pgno i, nPage, nToPage, iSkip;
+
+ if( pBtTo->inTrans!=TRANS_WRITE || pBtFrom->inTrans!=TRANS_WRITE ){
+ return SQLITE_ERROR;
+ }
+ if( pBtTo->pCursor ) return SQLITE_BUSY;
+ nToPage = sqlite3pager_pagecount(pBtTo->pPager);
+ nPage = sqlite3pager_pagecount(pBtFrom->pPager);
+ iSkip = PENDING_BYTE_PAGE(pBtTo);
+ for(i=1; rc==SQLITE_OK && i<=nPage; i++){
+ void *pPage;
+ if( i==iSkip ) continue;
+ rc = sqlite3pager_get(pBtFrom->pPager, i, &pPage);
+ if( rc ) break;
+ rc = sqlite3pager_overwrite(pBtTo->pPager, i, pPage);
+ if( rc ) break;
+ sqlite3pager_unref(pPage);
+ }
+ for(i=nPage+1; rc==SQLITE_OK && i<=nToPage; i++){
+ void *pPage;
+ if( i==iSkip ) continue;
+ rc = sqlite3pager_get(pBtTo->pPager, i, &pPage);
+ if( rc ) break;
+ rc = sqlite3pager_write(pPage);
+ sqlite3pager_unref(pPage);
+ sqlite3pager_dont_write(pBtTo->pPager, i);
+ }
+ if( !rc && nPage<nToPage ){
+ rc = sqlite3pager_truncate(pBtTo->pPager, nPage);
+ }
+ if( rc ){
+ sqlite3BtreeRollback(pBtTo);
+ }
+ return rc;
+}
+#endif /* SQLITE_OMIT_VACUUM */
+
+/*
+** Return non-zero if a transaction is active.
+*/
+int sqlite3BtreeIsInTrans(Btree *pBt){
+ return (pBt && (pBt->inTrans==TRANS_WRITE));
+}
+
+/*
+** Return non-zero if a statement transaction is active.
+*/
+int sqlite3BtreeIsInStmt(Btree *pBt){
+ return (pBt && pBt->inStmt);
+}
+
+/*
+** This call is a no-op if no write-transaction is currently active on pBt.
+**
+** Otherwise, sync the database file for the btree pBt. zMaster points to
+** the name of a master journal file that should be written into the
+** individual journal file, or is NULL, indicating no master journal file
+** (single database transaction).
+**
+** When this is called, the master journal should already have been
+** created, populated with this journal pointer and synced to disk.
+**
+** Once this is routine has returned, the only thing required to commit
+** the write-transaction for this database file is to delete the journal.
+*/
+int sqlite3BtreeSync(Btree *pBt, const char *zMaster){
+ if( pBt->inTrans==TRANS_WRITE ){
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ Pgno nTrunc = 0;
+ if( pBt->autoVacuum ){
+ int rc = autoVacuumCommit(pBt, &nTrunc);
+ if( rc!=SQLITE_OK ) return rc;
+ }
+ return sqlite3pager_sync(pBt->pPager, zMaster, nTrunc);
+#endif
+ return sqlite3pager_sync(pBt->pPager, zMaster, 0);
+ }
+ return SQLITE_OK;
+}
+
+#ifndef SQLITE_OMIT_GLOBALRECOVER
+/*
+** Reset the btree and underlying pager after a malloc() failure. Any
+** transaction that was active when malloc() failed is rolled back.
+*/
+int sqlite3BtreeReset(Btree *pBt){
+ if( pBt->pCursor ) return SQLITE_BUSY;
+ pBt->inTrans = TRANS_NONE;
+ unlockBtreeIfUnused(pBt);
+ return sqlite3pager_reset(pBt->pPager);
+}
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/btree.h b/ext/pdo_sqlite/sqlite/src/btree.h
new file mode 100644
index 000000000..9d4401ac8
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/btree.h
@@ -0,0 +1,144 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the interface that the sqlite B-Tree file
+** subsystem. See comments in the source code for a detailed description
+** of what each interface routine does.
+**
+** @(#) $Id$
+*/
+#ifndef _BTREE_H_
+#define _BTREE_H_
+
+/* TODO: This definition is just included so other modules compile. It
+** needs to be revisited.
+*/
+#define SQLITE_N_BTREE_META 10
+
+/*
+** If defined as non-zero, auto-vacuum is enabled by default. Otherwise
+** it must be turned on for each database using "PRAGMA auto_vacuum = 1".
+*/
+#ifndef SQLITE_DEFAULT_AUTOVACUUM
+ #define SQLITE_DEFAULT_AUTOVACUUM 0
+#endif
+
+/*
+** Forward declarations of structure
+*/
+typedef struct Btree Btree;
+typedef struct BtCursor BtCursor;
+
+
+int sqlite3BtreeOpen(
+ const char *zFilename, /* Name of database file to open */
+ Btree **, /* Return open Btree* here */
+ int flags /* Flags */
+);
+
+/* The flags parameter to sqlite3BtreeOpen can be the bitwise or of the
+** following values.
+**
+** NOTE: These values must match the corresponding PAGER_ values in
+** pager.h.
+*/
+#define BTREE_OMIT_JOURNAL 1 /* Do not use journal. No argument */
+#define BTREE_NO_READLOCK 2 /* Omit readlocks on readonly files */
+#define BTREE_MEMORY 4 /* In-memory DB. No argument */
+
+int sqlite3BtreeClose(Btree*);
+int sqlite3BtreeSetBusyHandler(Btree*,BusyHandler*);
+int sqlite3BtreeSetCacheSize(Btree*,int);
+int sqlite3BtreeSetSafetyLevel(Btree*,int);
+int sqlite3BtreeSyncDisabled(Btree*);
+int sqlite3BtreeSetPageSize(Btree*,int,int);
+int sqlite3BtreeGetPageSize(Btree*);
+int sqlite3BtreeGetReserve(Btree*);
+int sqlite3BtreeSetAutoVacuum(Btree *, int);
+int sqlite3BtreeGetAutoVacuum(Btree *);
+int sqlite3BtreeBeginTrans(Btree*,int);
+int sqlite3BtreeCommit(Btree*);
+int sqlite3BtreeRollback(Btree*);
+int sqlite3BtreeBeginStmt(Btree*);
+int sqlite3BtreeCommitStmt(Btree*);
+int sqlite3BtreeRollbackStmt(Btree*);
+int sqlite3BtreeCreateTable(Btree*, int*, int flags);
+int sqlite3BtreeIsInTrans(Btree*);
+int sqlite3BtreeIsInStmt(Btree*);
+int sqlite3BtreeSync(Btree*, const char *zMaster);
+int sqlite3BtreeReset(Btree *);
+
+const char *sqlite3BtreeGetFilename(Btree *);
+const char *sqlite3BtreeGetDirname(Btree *);
+const char *sqlite3BtreeGetJournalname(Btree *);
+int sqlite3BtreeCopyFile(Btree *, Btree *);
+
+/* The flags parameter to sqlite3BtreeCreateTable can be the bitwise OR
+** of the following flags:
+*/
+#define BTREE_INTKEY 1 /* Table has only 64-bit signed integer keys */
+#define BTREE_ZERODATA 2 /* Table has keys only - no data */
+#define BTREE_LEAFDATA 4 /* Data stored in leaves only. Implies INTKEY */
+
+int sqlite3BtreeDropTable(Btree*, int, int*);
+int sqlite3BtreeClearTable(Btree*, int);
+int sqlite3BtreeGetMeta(Btree*, int idx, u32 *pValue);
+int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value);
+
+int sqlite3BtreeCursor(
+ Btree*, /* BTree containing table to open */
+ int iTable, /* Index of root page */
+ int wrFlag, /* 1 for writing. 0 for read-only */
+ int(*)(void*,int,const void*,int,const void*), /* Key comparison function */
+ void*, /* First argument to compare function */
+ BtCursor **ppCursor /* Returned cursor */
+);
+
+void sqlite3BtreeSetCompare(
+ BtCursor *,
+ int(*)(void*,int,const void*,int,const void*),
+ void*
+);
+
+int sqlite3BtreeCloseCursor(BtCursor*);
+int sqlite3BtreeMoveto(BtCursor*, const void *pKey, i64 nKey, int *pRes);
+int sqlite3BtreeDelete(BtCursor*);
+int sqlite3BtreeInsert(BtCursor*, const void *pKey, i64 nKey,
+ const void *pData, int nData);
+int sqlite3BtreeFirst(BtCursor*, int *pRes);
+int sqlite3BtreeLast(BtCursor*, int *pRes);
+int sqlite3BtreeNext(BtCursor*, int *pRes);
+int sqlite3BtreeEof(BtCursor*);
+int sqlite3BtreeFlags(BtCursor*);
+int sqlite3BtreePrevious(BtCursor*, int *pRes);
+int sqlite3BtreeKeySize(BtCursor*, i64 *pSize);
+int sqlite3BtreeKey(BtCursor*, u32 offset, u32 amt, void*);
+const void *sqlite3BtreeKeyFetch(BtCursor*, int *pAmt);
+const void *sqlite3BtreeDataFetch(BtCursor*, int *pAmt);
+int sqlite3BtreeDataSize(BtCursor*, u32 *pSize);
+int sqlite3BtreeData(BtCursor*, u32 offset, u32 amt, void*);
+
+char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot);
+struct Pager *sqlite3BtreePager(Btree*);
+
+
+#ifdef SQLITE_TEST
+int sqlite3BtreeCursorInfo(BtCursor*, int*, int);
+void sqlite3BtreeCursorList(Btree*);
+#endif
+
+#ifdef SQLITE_DEBUG
+int sqlite3BtreePageDump(Btree*, int, int recursive);
+#else
+#define sqlite3BtreePageDump(X,Y,Z) SQLITE_OK
+#endif
+
+#endif /* _BTREE_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/build.c b/ext/pdo_sqlite/sqlite/src/build.c
new file mode 100644
index 000000000..537eede8c
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/build.c
@@ -0,0 +1,2938 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains C code routines that are called by the SQLite parser
+** when syntax rules are reduced. The routines in this file handle the
+** following kinds of SQL syntax:
+**
+** CREATE TABLE
+** DROP TABLE
+** CREATE INDEX
+** DROP INDEX
+** creating ID lists
+** BEGIN TRANSACTION
+** COMMIT
+** ROLLBACK
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include <ctype.h>
+
+/*
+** This routine is called when a new SQL statement is beginning to
+** be parsed. Initialize the pParse structure as needed.
+*/
+void sqlite3BeginParse(Parse *pParse, int explainFlag){
+ pParse->explain = explainFlag;
+ pParse->nVar = 0;
+}
+
+/*
+** This routine is called after a single SQL statement has been
+** parsed and a VDBE program to execute that statement has been
+** prepared. This routine puts the finishing touches on the
+** VDBE program and resets the pParse structure for the next
+** parse.
+**
+** Note that if an error occurred, it might be the case that
+** no VDBE code was generated.
+*/
+void sqlite3FinishCoding(Parse *pParse){
+ sqlite3 *db;
+ Vdbe *v;
+
+ if( sqlite3_malloc_failed ) return;
+ if( pParse->nested ) return;
+ if( !pParse->pVdbe ){
+ if( pParse->rc==SQLITE_OK && pParse->nErr ){
+ pParse->rc = SQLITE_ERROR;
+ }
+ return;
+ }
+
+ /* Begin by generating some termination code at the end of the
+ ** vdbe program
+ */
+ db = pParse->db;
+ v = sqlite3GetVdbe(pParse);
+ if( v ){
+ sqlite3VdbeAddOp(v, OP_Halt, 0, 0);
+
+ /* The cookie mask contains one bit for each database file open.
+ ** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are
+ ** set for each database that is used. Generate code to start a
+ ** transaction on each used database and to verify the schema cookie
+ ** on each used database.
+ */
+ if( pParse->cookieGoto>0 ){
+ u32 mask;
+ int iDb;
+ sqlite3VdbeJumpHere(v, pParse->cookieGoto-1);
+ for(iDb=0, mask=1; iDb<db->nDb; mask<<=1, iDb++){
+ if( (mask & pParse->cookieMask)==0 ) continue;
+ sqlite3VdbeAddOp(v, OP_Transaction, iDb, (mask & pParse->writeMask)!=0);
+ sqlite3VdbeAddOp(v, OP_VerifyCookie, iDb, pParse->cookieValue[iDb]);
+ }
+ sqlite3VdbeAddOp(v, OP_Goto, 0, pParse->cookieGoto);
+ }
+
+#ifndef SQLITE_OMIT_TRACE
+ /* Add a No-op that contains the complete text of the compiled SQL
+ ** statement as its P3 argument. This does not change the functionality
+ ** of the program.
+ **
+ ** This is used to implement sqlite3_trace().
+ */
+ sqlite3VdbeOp3(v, OP_Noop, 0, 0, pParse->zSql, pParse->zTail-pParse->zSql);
+#endif /* SQLITE_OMIT_TRACE */
+ }
+
+
+ /* Get the VDBE program ready for execution
+ */
+ if( v && pParse->nErr==0 ){
+ FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0;
+ sqlite3VdbeTrace(v, trace);
+ sqlite3VdbeMakeReady(v, pParse->nVar, pParse->nMem+3,
+ pParse->nTab+3, pParse->explain);
+ pParse->rc = SQLITE_DONE;
+ pParse->colNamesSet = 0;
+ }else if( pParse->rc==SQLITE_OK ){
+ pParse->rc = SQLITE_ERROR;
+ }
+ pParse->nTab = 0;
+ pParse->nMem = 0;
+ pParse->nSet = 0;
+ pParse->nVar = 0;
+ pParse->cookieMask = 0;
+ pParse->cookieGoto = 0;
+}
+
+/*
+** Run the parser and code generator recursively in order to generate
+** code for the SQL statement given onto the end of the pParse context
+** currently under construction. When the parser is run recursively
+** this way, the final OP_Halt is not appended and other initialization
+** and finalization steps are omitted because those are handling by the
+** outermost parser.
+**
+** Not everything is nestable. This facility is designed to permit
+** INSERT, UPDATE, and DELETE operations against SQLITE_MASTER. Use
+** care if you decide to try to use this routine for some other purposes.
+*/
+void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
+ va_list ap;
+ char *zSql;
+# define SAVE_SZ (sizeof(Parse) - offsetof(Parse,nVar))
+ char saveBuf[SAVE_SZ];
+
+ if( pParse->nErr ) return;
+ assert( pParse->nested<10 ); /* Nesting should only be of limited depth */
+ va_start(ap, zFormat);
+ zSql = sqlite3VMPrintf(zFormat, ap);
+ va_end(ap);
+ if( zSql==0 ){
+ return; /* A malloc must have failed */
+ }
+ pParse->nested++;
+ memcpy(saveBuf, &pParse->nVar, SAVE_SZ);
+ memset(&pParse->nVar, 0, SAVE_SZ);
+ sqlite3RunParser(pParse, zSql, 0);
+ sqliteFree(zSql);
+ memcpy(&pParse->nVar, saveBuf, SAVE_SZ);
+ pParse->nested--;
+}
+
+/*
+** Locate the in-memory structure that describes a particular database
+** table given the name of that table and (optionally) the name of the
+** database containing the table. Return NULL if not found.
+**
+** If zDatabase is 0, all databases are searched for the table and the
+** first matching table is returned. (No checking for duplicate table
+** names is done.) The search order is TEMP first, then MAIN, then any
+** auxiliary databases added using the ATTACH command.
+**
+** See also sqlite3LocateTable().
+*/
+Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){
+ Table *p = 0;
+ int i;
+ assert( zName!=0 );
+ assert( (db->flags & SQLITE_Initialized) || db->init.busy );
+ for(i=OMIT_TEMPDB; i<db->nDb; i++){
+ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
+ if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue;
+ p = sqlite3HashFind(&db->aDb[j].tblHash, zName, strlen(zName)+1);
+ if( p ) break;
+ }
+ return p;
+}
+
+/*
+** Locate the in-memory structure that describes a particular database
+** table given the name of that table and (optionally) the name of the
+** database containing the table. Return NULL if not found. Also leave an
+** error message in pParse->zErrMsg.
+**
+** The difference between this routine and sqlite3FindTable() is that this
+** routine leaves an error message in pParse->zErrMsg where
+** sqlite3FindTable() does not.
+*/
+Table *sqlite3LocateTable(Parse *pParse, const char *zName, const char *zDbase){
+ Table *p;
+
+ /* Read the database schema. If an error occurs, leave an error message
+ ** and code in pParse and return NULL. */
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ return 0;
+ }
+
+ p = sqlite3FindTable(pParse->db, zName, zDbase);
+ if( p==0 ){
+ if( zDbase ){
+ sqlite3ErrorMsg(pParse, "no such table: %s.%s", zDbase, zName);
+ }else{
+ sqlite3ErrorMsg(pParse, "no such table: %s", zName);
+ }
+ pParse->checkSchema = 1;
+ }
+ return p;
+}
+
+/*
+** Locate the in-memory structure that describes
+** a particular index given the name of that index
+** and the name of the database that contains the index.
+** Return NULL if not found.
+**
+** If zDatabase is 0, all databases are searched for the
+** table and the first matching index is returned. (No checking
+** for duplicate index names is done.) The search order is
+** TEMP first, then MAIN, then any auxiliary databases added
+** using the ATTACH command.
+*/
+Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){
+ Index *p = 0;
+ int i;
+ assert( (db->flags & SQLITE_Initialized) || db->init.busy );
+ for(i=OMIT_TEMPDB; i<db->nDb; i++){
+ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
+ if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zName) ) continue;
+ p = sqlite3HashFind(&db->aDb[j].idxHash, zName, strlen(zName)+1);
+ if( p ) break;
+ }
+ return p;
+}
+
+/*
+** Reclaim the memory used by an index
+*/
+static void freeIndex(Index *p){
+ sqliteFree(p->zColAff);
+ sqliteFree(p);
+}
+
+/*
+** Remove the given index from the index hash table, and free
+** its memory structures.
+**
+** The index is removed from the database hash tables but
+** it is not unlinked from the Table that it indexes.
+** Unlinking from the Table must be done by the calling function.
+*/
+static void sqliteDeleteIndex(sqlite3 *db, Index *p){
+ Index *pOld;
+
+ assert( db!=0 && p->zName!=0 );
+ pOld = sqlite3HashInsert(&db->aDb[p->iDb].idxHash, p->zName,
+ strlen(p->zName)+1, 0);
+ assert( pOld==0 || pOld==p );
+ freeIndex(p);
+}
+
+/*
+** For the index called zIdxName which is found in the database iDb,
+** unlike that index from its Table then remove the index from
+** the index hash table and free all memory structures associated
+** with the index.
+*/
+void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){
+ Index *pIndex;
+ int len;
+
+ len = strlen(zIdxName);
+ pIndex = sqlite3HashInsert(&db->aDb[iDb].idxHash, zIdxName, len+1, 0);
+ if( pIndex ){
+ if( pIndex->pTable->pIndex==pIndex ){
+ pIndex->pTable->pIndex = pIndex->pNext;
+ }else{
+ Index *p;
+ for(p=pIndex->pTable->pIndex; p && p->pNext!=pIndex; p=p->pNext){}
+ if( p && p->pNext==pIndex ){
+ p->pNext = pIndex->pNext;
+ }
+ }
+ freeIndex(pIndex);
+ }
+ db->flags |= SQLITE_InternChanges;
+}
+
+/*
+** Erase all schema information from the in-memory hash tables of
+** a single database. This routine is called to reclaim memory
+** before the database closes. It is also called during a rollback
+** if there were schema changes during the transaction or if a
+** schema-cookie mismatch occurs.
+**
+** If iDb<=0 then reset the internal schema tables for all database
+** files. If iDb>=2 then reset the internal schema for only the
+** single file indicated.
+*/
+void sqlite3ResetInternalSchema(sqlite3 *db, int iDb){
+ HashElem *pElem;
+ Hash temp1;
+ Hash temp2;
+ int i, j;
+
+ assert( iDb>=0 && iDb<db->nDb );
+ db->flags &= ~SQLITE_Initialized;
+ for(i=iDb; i<db->nDb; i++){
+ Db *pDb = &db->aDb[i];
+ temp1 = pDb->tblHash;
+ temp2 = pDb->trigHash;
+ sqlite3HashInit(&pDb->trigHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashClear(&pDb->aFKey);
+ sqlite3HashClear(&pDb->idxHash);
+ for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){
+ sqlite3DeleteTrigger((Trigger*)sqliteHashData(pElem));
+ }
+ sqlite3HashClear(&temp2);
+ sqlite3HashInit(&pDb->tblHash, SQLITE_HASH_STRING, 0);
+ for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){
+ Table *pTab = sqliteHashData(pElem);
+ sqlite3DeleteTable(db, pTab);
+ }
+ sqlite3HashClear(&temp1);
+ pDb->pSeqTab = 0;
+ DbClearProperty(db, i, DB_SchemaLoaded);
+ if( iDb>0 ) return;
+ }
+ assert( iDb==0 );
+ db->flags &= ~SQLITE_InternChanges;
+
+ /* If one or more of the auxiliary database files has been closed,
+ ** then remove then from the auxiliary database list. We take the
+ ** opportunity to do this here since we have just deleted all of the
+ ** schema hash tables and therefore do not have to make any changes
+ ** to any of those tables.
+ */
+ for(i=0; i<db->nDb; i++){
+ struct Db *pDb = &db->aDb[i];
+ if( pDb->pBt==0 ){
+ if( pDb->pAux && pDb->xFreeAux ) pDb->xFreeAux(pDb->pAux);
+ pDb->pAux = 0;
+ }
+ }
+ for(i=j=2; i<db->nDb; i++){
+ struct Db *pDb = &db->aDb[i];
+ if( pDb->pBt==0 ){
+ sqliteFree(pDb->zName);
+ pDb->zName = 0;
+ continue;
+ }
+ if( j<i ){
+ db->aDb[j] = db->aDb[i];
+ }
+ j++;
+ }
+ memset(&db->aDb[j], 0, (db->nDb-j)*sizeof(db->aDb[j]));
+ db->nDb = j;
+ if( db->nDb<=2 && db->aDb!=db->aDbStatic ){
+ memcpy(db->aDbStatic, db->aDb, 2*sizeof(db->aDb[0]));
+ sqliteFree(db->aDb);
+ db->aDb = db->aDbStatic;
+ }
+}
+
+/*
+** This routine is called whenever a rollback occurs. If there were
+** schema changes during the transaction, then we have to reset the
+** internal hash tables and reload them from disk.
+*/
+void sqlite3RollbackInternalChanges(sqlite3 *db){
+ if( db->flags & SQLITE_InternChanges ){
+ sqlite3ResetInternalSchema(db, 0);
+ }
+}
+
+/*
+** This routine is called when a commit occurs.
+*/
+void sqlite3CommitInternalChanges(sqlite3 *db){
+ db->flags &= ~SQLITE_InternChanges;
+}
+
+/*
+** Clear the column names from a table or view.
+*/
+static void sqliteResetColumnNames(Table *pTable){
+ int i;
+ Column *pCol;
+ assert( pTable!=0 );
+ if( (pCol = pTable->aCol)!=0 ){
+ for(i=0; i<pTable->nCol; i++, pCol++){
+ sqliteFree(pCol->zName);
+ sqlite3ExprDelete(pCol->pDflt);
+ sqliteFree(pCol->zType);
+ }
+ sqliteFree(pTable->aCol);
+ }
+ pTable->aCol = 0;
+ pTable->nCol = 0;
+}
+
+/*
+** Remove the memory data structures associated with the given
+** Table. No changes are made to disk by this routine.
+**
+** This routine just deletes the data structure. It does not unlink
+** the table data structure from the hash table. Nor does it remove
+** foreign keys from the sqlite.aFKey hash table. But it does destroy
+** memory structures of the indices and foreign keys associated with
+** the table.
+**
+** Indices associated with the table are unlinked from the "db"
+** data structure if db!=NULL. If db==NULL, indices attached to
+** the table are deleted, but it is assumed they have already been
+** unlinked.
+*/
+void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
+ Index *pIndex, *pNext;
+ FKey *pFKey, *pNextFKey;
+
+ if( pTable==0 ) return;
+
+ /* Do not delete the table until the reference count reaches zero. */
+ pTable->nRef--;
+ if( pTable->nRef>0 ){
+ return;
+ }
+ assert( pTable->nRef==0 );
+
+ /* Delete all indices associated with this table
+ */
+ for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
+ pNext = pIndex->pNext;
+ assert( pIndex->iDb==pTable->iDb || (pTable->iDb==0 && pIndex->iDb==1) );
+ sqliteDeleteIndex(db, pIndex);
+ }
+
+#ifndef SQLITE_OMIT_FOREIGN_KEY
+ /* Delete all foreign keys associated with this table. The keys
+ ** should have already been unlinked from the db->aFKey hash table
+ */
+ for(pFKey=pTable->pFKey; pFKey; pFKey=pNextFKey){
+ pNextFKey = pFKey->pNextFrom;
+ assert( pTable->iDb<db->nDb );
+ assert( sqlite3HashFind(&db->aDb[pTable->iDb].aFKey,
+ pFKey->zTo, strlen(pFKey->zTo)+1)!=pFKey );
+ sqliteFree(pFKey);
+ }
+#endif
+
+ /* Delete the Table structure itself.
+ */
+ sqliteResetColumnNames(pTable);
+ sqliteFree(pTable->zName);
+ sqliteFree(pTable->zColAff);
+ sqlite3SelectDelete(pTable->pSelect);
+ sqliteFree(pTable);
+}
+
+/*
+** Unlink the given table from the hash tables and the delete the
+** table structure with all its indices and foreign keys.
+*/
+void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){
+ Table *p;
+ FKey *pF1, *pF2;
+ Db *pDb;
+
+ assert( db!=0 );
+ assert( iDb>=0 && iDb<db->nDb );
+ assert( zTabName && zTabName[0] );
+ pDb = &db->aDb[iDb];
+ p = sqlite3HashInsert(&pDb->tblHash, zTabName, strlen(zTabName)+1, 0);
+ if( p ){
+#ifndef SQLITE_OMIT_FOREIGN_KEY
+ for(pF1=p->pFKey; pF1; pF1=pF1->pNextFrom){
+ int nTo = strlen(pF1->zTo) + 1;
+ pF2 = sqlite3HashFind(&pDb->aFKey, pF1->zTo, nTo);
+ if( pF2==pF1 ){
+ sqlite3HashInsert(&pDb->aFKey, pF1->zTo, nTo, pF1->pNextTo);
+ }else{
+ while( pF2 && pF2->pNextTo!=pF1 ){ pF2=pF2->pNextTo; }
+ if( pF2 ){
+ pF2->pNextTo = pF1->pNextTo;
+ }
+ }
+ }
+#endif
+ sqlite3DeleteTable(db, p);
+ }
+ db->flags |= SQLITE_InternChanges;
+}
+
+/*
+** Given a token, return a string that consists of the text of that
+** token with any quotations removed. Space to hold the returned string
+** is obtained from sqliteMalloc() and must be freed by the calling
+** function.
+**
+** Tokens are often just pointers into the original SQL text and so
+** are not \000 terminated and are not persistent. The returned string
+** is \000 terminated and is persistent.
+*/
+char *sqlite3NameFromToken(Token *pName){
+ char *zName;
+ if( pName ){
+ zName = sqliteStrNDup(pName->z, pName->n);
+ sqlite3Dequote(zName);
+ }else{
+ zName = 0;
+ }
+ return zName;
+}
+
+/*
+** Open the sqlite_master table stored in database number iDb for
+** writing. The table is opened using cursor 0.
+*/
+void sqlite3OpenMasterTable(Vdbe *v, int iDb){
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
+ sqlite3VdbeAddOp(v, OP_OpenWrite, 0, MASTER_ROOT);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, 0, 5); /* sqlite_master has 5 columns */
+}
+
+/*
+** The token *pName contains the name of a database (either "main" or
+** "temp" or the name of an attached db). This routine returns the
+** index of the named database in db->aDb[], or -1 if the named db
+** does not exist.
+*/
+int sqlite3FindDb(sqlite3 *db, Token *pName){
+ int i = -1; /* Database number */
+ int n; /* Number of characters in the name */
+ Db *pDb; /* A database whose name space is being searched */
+ char *zName; /* Name we are searching for */
+
+ zName = sqlite3NameFromToken(pName);
+ if( zName ){
+ n = strlen(zName);
+ for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){
+ if( (!OMIT_TEMPDB || i!=1 ) && n==strlen(pDb->zName) &&
+ 0==sqlite3StrICmp(pDb->zName, zName) ){
+ break;
+ }
+ }
+ sqliteFree(zName);
+ }
+ return i;
+}
+
+/* The table or view or trigger name is passed to this routine via tokens
+** pName1 and pName2. If the table name was fully qualified, for example:
+**
+** CREATE TABLE xxx.yyy (...);
+**
+** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if
+** the table name is not fully qualified, i.e.:
+**
+** CREATE TABLE yyy(...);
+**
+** Then pName1 is set to "yyy" and pName2 is "".
+**
+** This routine sets the *ppUnqual pointer to point at the token (pName1 or
+** pName2) that stores the unqualified table name. The index of the
+** database "xxx" is returned.
+*/
+int sqlite3TwoPartName(
+ Parse *pParse, /* Parsing and code generating context */
+ Token *pName1, /* The "xxx" in the name "xxx.yyy" or "xxx" */
+ Token *pName2, /* The "yyy" in the name "xxx.yyy" */
+ Token **pUnqual /* Write the unqualified object name here */
+){
+ int iDb; /* Database holding the object */
+ sqlite3 *db = pParse->db;
+
+ if( pName2 && pName2->n>0 ){
+ assert( !db->init.busy );
+ *pUnqual = pName2;
+ iDb = sqlite3FindDb(db, pName1);
+ if( iDb<0 ){
+ sqlite3ErrorMsg(pParse, "unknown database %T", pName1);
+ pParse->nErr++;
+ return -1;
+ }
+ }else{
+ assert( db->init.iDb==0 || db->init.busy );
+ iDb = db->init.iDb;
+ *pUnqual = pName1;
+ }
+ return iDb;
+}
+
+/*
+** This routine is used to check if the UTF-8 string zName is a legal
+** unqualified name for a new schema object (table, index, view or
+** trigger). All names are legal except those that begin with the string
+** "sqlite_" (in upper, lower or mixed case). This portion of the namespace
+** is reserved for internal use.
+*/
+int sqlite3CheckObjectName(Parse *pParse, const char *zName){
+ if( !pParse->db->init.busy && pParse->nested==0
+ && (pParse->db->flags & SQLITE_WriteSchema)==0
+ && 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){
+ sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s", zName);
+ return SQLITE_ERROR;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Begin constructing a new table representation in memory. This is
+** the first of several action routines that get called in response
+** to a CREATE TABLE statement. In particular, this routine is called
+** after seeing tokens "CREATE" and "TABLE" and the table name. The
+** pStart token is the CREATE and pName is the table name. The isTemp
+** flag is true if the table should be stored in the auxiliary database
+** file instead of in the main database file. This is normally the case
+** when the "TEMP" or "TEMPORARY" keyword occurs in between
+** CREATE and TABLE.
+**
+** The new table record is initialized and put in pParse->pNewTable.
+** As more of the CREATE TABLE statement is parsed, additional action
+** routines will be called to add more information to this record.
+** At the end of the CREATE TABLE statement, the sqlite3EndTable() routine
+** is called to complete the construction of the new table record.
+*/
+void sqlite3StartTable(
+ Parse *pParse, /* Parser context */
+ Token *pStart, /* The "CREATE" token */
+ Token *pName1, /* First part of the name of the table or view */
+ Token *pName2, /* Second part of the name of the table or view */
+ int isTemp, /* True if this is a TEMP table */
+ int isView /* True if this is a VIEW */
+){
+ Table *pTable;
+ char *zName = 0; /* The name of the new table */
+ sqlite3 *db = pParse->db;
+ Vdbe *v;
+ int iDb; /* Database number to create the table in */
+ Token *pName; /* Unqualified name of the table to create */
+
+ /* The table or view name to create is passed to this routine via tokens
+ ** pName1 and pName2. If the table name was fully qualified, for example:
+ **
+ ** CREATE TABLE xxx.yyy (...);
+ **
+ ** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if
+ ** the table name is not fully qualified, i.e.:
+ **
+ ** CREATE TABLE yyy(...);
+ **
+ ** Then pName1 is set to "yyy" and pName2 is "".
+ **
+ ** The call below sets the pName pointer to point at the token (pName1 or
+ ** pName2) that stores the unqualified table name. The variable iDb is
+ ** set to the index of the database that the table or view is to be
+ ** created in.
+ */
+ iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName);
+ if( iDb<0 ) return;
+ if( !OMIT_TEMPDB && isTemp && iDb>1 ){
+ /* If creating a temp table, the name may not be qualified */
+ sqlite3ErrorMsg(pParse, "temporary table name must be unqualified");
+ return;
+ }
+ if( !OMIT_TEMPDB && isTemp ) iDb = 1;
+
+ pParse->sNameToken = *pName;
+ zName = sqlite3NameFromToken(pName);
+ if( zName==0 ) return;
+ if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ goto begin_table_error;
+ }
+ if( db->init.iDb==1 ) isTemp = 1;
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ assert( (isTemp & 1)==isTemp );
+ {
+ int code;
+ char *zDb = db->aDb[iDb].zName;
+ if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){
+ goto begin_table_error;
+ }
+ if( isView ){
+ if( !OMIT_TEMPDB && isTemp ){
+ code = SQLITE_CREATE_TEMP_VIEW;
+ }else{
+ code = SQLITE_CREATE_VIEW;
+ }
+ }else{
+ if( !OMIT_TEMPDB && isTemp ){
+ code = SQLITE_CREATE_TEMP_TABLE;
+ }else{
+ code = SQLITE_CREATE_TABLE;
+ }
+ }
+ if( sqlite3AuthCheck(pParse, code, zName, 0, zDb) ){
+ goto begin_table_error;
+ }
+ }
+#endif
+
+ /* Make sure the new table name does not collide with an existing
+ ** index or table name in the same database. Issue an error message if
+ ** it does.
+ */
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ goto begin_table_error;
+ }
+ pTable = sqlite3FindTable(db, zName, db->aDb[iDb].zName);
+ if( pTable ){
+ sqlite3ErrorMsg(pParse, "table %T already exists", pName);
+ goto begin_table_error;
+ }
+ if( sqlite3FindIndex(db, zName, 0)!=0 && (iDb==0 || !db->init.busy) ){
+ sqlite3ErrorMsg(pParse, "there is already an index named %s", zName);
+ goto begin_table_error;
+ }
+ pTable = sqliteMalloc( sizeof(Table) );
+ if( pTable==0 ){
+ pParse->rc = SQLITE_NOMEM;
+ pParse->nErr++;
+ goto begin_table_error;
+ }
+ pTable->zName = zName;
+ pTable->nCol = 0;
+ pTable->aCol = 0;
+ pTable->iPKey = -1;
+ pTable->pIndex = 0;
+ pTable->iDb = iDb;
+ pTable->nRef = 1;
+ if( pParse->pNewTable ) sqlite3DeleteTable(db, pParse->pNewTable);
+ pParse->pNewTable = pTable;
+
+ /* If this is the magic sqlite_sequence table used by autoincrement,
+ ** then record a pointer to this table in the main database structure
+ ** so that INSERT can find the table easily.
+ */
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ if( !pParse->nested && strcmp(zName, "sqlite_sequence")==0 ){
+ db->aDb[iDb].pSeqTab = pTable;
+ }
+#endif
+
+ /* Begin generating the code that will insert the table record into
+ ** the SQLITE_MASTER table. Note in particular that we must go ahead
+ ** and allocate the record number for the table entry now. Before any
+ ** PRIMARY KEY or UNIQUE keywords are parsed. Those keywords will cause
+ ** indices to be created and the table record must come before the
+ ** indices. Hence, the record number for the table must be allocated
+ ** now.
+ */
+ if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){
+ int lbl;
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+
+ /* If the file format and encoding in the database have not been set,
+ ** set them now.
+ */
+ sqlite3VdbeAddOp(v, OP_ReadCookie, iDb, 1); /* file_format */
+ lbl = sqlite3VdbeMakeLabel(v);
+ sqlite3VdbeAddOp(v, OP_If, 0, lbl);
+ sqlite3VdbeAddOp(v, OP_Integer, db->file_format, 0);
+ sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 1);
+ sqlite3VdbeAddOp(v, OP_Integer, db->enc, 0);
+ sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 4);
+ sqlite3VdbeResolveLabel(v, lbl);
+
+ /* This just creates a place-holder record in the sqlite_master table.
+ ** The record created does not contain anything yet. It will be replaced
+ ** by the real entry in code generated at sqlite3EndTable().
+ **
+ ** The rowid for the new entry is left on the top of the stack.
+ ** The rowid value is needed by the code that sqlite3EndTable will
+ ** generate.
+ */
+#ifndef SQLITE_OMIT_VIEW
+ if( isView ){
+ sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
+ }else
+#endif
+ {
+ sqlite3VdbeAddOp(v, OP_CreateTable, iDb, 0);
+ }
+ sqlite3OpenMasterTable(v, iDb);
+ sqlite3VdbeAddOp(v, OP_NewRowid, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Insert, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Close, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ }
+
+ /* Normal (non-error) return. */
+ return;
+
+ /* If an error occurs, we jump here */
+begin_table_error:
+ sqliteFree(zName);
+ return;
+}
+
+/*
+** This macro is used to compare two strings in a case-insensitive manner.
+** It is slightly faster than calling sqlite3StrICmp() directly, but
+** produces larger code.
+**
+** WARNING: This macro is not compatible with the strcmp() family. It
+** returns true if the two strings are equal, otherwise false.
+*/
+#define STRICMP(x, y) (\
+sqlite3UpperToLower[*(unsigned char *)(x)]== \
+sqlite3UpperToLower[*(unsigned char *)(y)] \
+&& sqlite3StrICmp((x)+1,(y)+1)==0 )
+
+/*
+** Add a new column to the table currently being constructed.
+**
+** The parser calls this routine once for each column declaration
+** in a CREATE TABLE statement. sqlite3StartTable() gets called
+** first to get things going. Then this routine is called for each
+** column.
+*/
+void sqlite3AddColumn(Parse *pParse, Token *pName){
+ Table *p;
+ int i;
+ char *z;
+ Column *pCol;
+ if( (p = pParse->pNewTable)==0 ) return;
+ z = sqlite3NameFromToken(pName);
+ if( z==0 ) return;
+ for(i=0; i<p->nCol; i++){
+ if( STRICMP(z, p->aCol[i].zName) ){
+ sqlite3ErrorMsg(pParse, "duplicate column name: %s", z);
+ sqliteFree(z);
+ return;
+ }
+ }
+ if( (p->nCol & 0x7)==0 ){
+ Column *aNew;
+ aNew = sqliteRealloc( p->aCol, (p->nCol+8)*sizeof(p->aCol[0]));
+ if( aNew==0 ){
+ sqliteFree(z);
+ return;
+ }
+ p->aCol = aNew;
+ }
+ pCol = &p->aCol[p->nCol];
+ memset(pCol, 0, sizeof(p->aCol[0]));
+ pCol->zName = z;
+
+ /* If there is no type specified, columns have the default affinity
+ ** 'NONE'. If there is a type specified, then sqlite3AddColumnType() will
+ ** be called next to set pCol->affinity correctly.
+ */
+ pCol->affinity = SQLITE_AFF_NONE;
+ pCol->pColl = pParse->db->pDfltColl;
+ p->nCol++;
+}
+
+/*
+** This routine is called by the parser while in the middle of
+** parsing a CREATE TABLE statement. A "NOT NULL" constraint has
+** been seen on a column. This routine sets the notNull flag on
+** the column currently under construction.
+*/
+void sqlite3AddNotNull(Parse *pParse, int onError){
+ Table *p;
+ int i;
+ if( (p = pParse->pNewTable)==0 ) return;
+ i = p->nCol-1;
+ if( i>=0 ) p->aCol[i].notNull = onError;
+}
+
+/*
+** Scan the column type name zType (length nType) and return the
+** associated affinity type.
+**
+** This routine does a case-independent search of zType for the
+** substrings in the following table. If one of the substrings is
+** found, the corresponding affinity is returned. If zType contains
+** more than one of the substrings, entries toward the top of
+** the table take priority. For example, if zType is 'BLOBINT',
+** SQLITE_AFF_INTEGER is returned.
+**
+** Substring | Affinity
+** --------------------------------
+** 'INT' | SQLITE_AFF_INTEGER
+** 'CHAR' | SQLITE_AFF_TEXT
+** 'CLOB' | SQLITE_AFF_TEXT
+** 'TEXT' | SQLITE_AFF_TEXT
+** 'BLOB' | SQLITE_AFF_NONE
+**
+** If none of the substrings in the above table are found,
+** SQLITE_AFF_NUMERIC is returned.
+*/
+char sqlite3AffinityType(const Token *pType){
+ u32 h = 0;
+ char aff = SQLITE_AFF_NUMERIC;
+ const unsigned char *zIn = pType->z;
+ const unsigned char *zEnd = &pType->z[pType->n];
+
+ while( zIn!=zEnd ){
+ h = (h<<8) + sqlite3UpperToLower[*zIn];
+ zIn++;
+ if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){ /* CHAR */
+ aff = SQLITE_AFF_TEXT;
+ }else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){ /* CLOB */
+ aff = SQLITE_AFF_TEXT;
+ }else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){ /* TEXT */
+ aff = SQLITE_AFF_TEXT;
+ }else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b') /* BLOB */
+ && aff==SQLITE_AFF_NUMERIC ){
+ aff = SQLITE_AFF_NONE;
+ }else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){ /* INT */
+ aff = SQLITE_AFF_INTEGER;
+ break;
+ }
+ }
+
+ return aff;
+}
+
+/*
+** This routine is called by the parser while in the middle of
+** parsing a CREATE TABLE statement. The pFirst token is the first
+** token in the sequence of tokens that describe the type of the
+** column currently under construction. pLast is the last token
+** in the sequence. Use this information to construct a string
+** that contains the typename of the column and store that string
+** in zType.
+*/
+void sqlite3AddColumnType(Parse *pParse, Token *pType){
+ Table *p;
+ int i;
+ Column *pCol;
+
+ if( (p = pParse->pNewTable)==0 ) return;
+ i = p->nCol-1;
+ if( i<0 ) return;
+ pCol = &p->aCol[i];
+ sqliteFree(pCol->zType);
+ pCol->zType = sqlite3NameFromToken(pType);
+ pCol->affinity = sqlite3AffinityType(pType);
+}
+
+/*
+** The expression is the default value for the most recently added column
+** of the table currently under construction.
+**
+** Default value expressions must be constant. Raise an exception if this
+** is not the case.
+**
+** This routine is called by the parser while in the middle of
+** parsing a CREATE TABLE statement.
+*/
+void sqlite3AddDefaultValue(Parse *pParse, Expr *pExpr){
+ Table *p;
+ Column *pCol;
+ if( (p = pParse->pNewTable)!=0 ){
+ pCol = &(p->aCol[p->nCol-1]);
+ if( !sqlite3ExprIsConstantOrFunction(pExpr) ){
+ sqlite3ErrorMsg(pParse, "default value of column [%s] is not constant",
+ pCol->zName);
+ }else{
+ sqlite3ExprDelete(pCol->pDflt);
+ pCol->pDflt = sqlite3ExprDup(pExpr);
+ }
+ }
+ sqlite3ExprDelete(pExpr);
+}
+
+/*
+** Designate the PRIMARY KEY for the table. pList is a list of names
+** of columns that form the primary key. If pList is NULL, then the
+** most recently added column of the table is the primary key.
+**
+** A table can have at most one primary key. If the table already has
+** a primary key (and this is the second primary key) then create an
+** error.
+**
+** If the PRIMARY KEY is on a single column whose datatype is INTEGER,
+** then we will try to use that column as the rowid. Set the Table.iPKey
+** field of the table under construction to be the index of the
+** INTEGER PRIMARY KEY column. Table.iPKey is set to -1 if there is
+** no INTEGER PRIMARY KEY.
+**
+** If the key is not an INTEGER PRIMARY KEY, then create a unique
+** index for the key. No index is created for INTEGER PRIMARY KEYs.
+*/
+void sqlite3AddPrimaryKey(
+ Parse *pParse, /* Parsing context */
+ ExprList *pList, /* List of field names to be indexed */
+ int onError, /* What to do with a uniqueness conflict */
+ int autoInc /* True if the AUTOINCREMENT keyword is present */
+){
+ Table *pTab = pParse->pNewTable;
+ char *zType = 0;
+ int iCol = -1, i;
+ if( pTab==0 ) goto primary_key_exit;
+ if( pTab->hasPrimKey ){
+ sqlite3ErrorMsg(pParse,
+ "table \"%s\" has more than one primary key", pTab->zName);
+ goto primary_key_exit;
+ }
+ pTab->hasPrimKey = 1;
+ if( pList==0 ){
+ iCol = pTab->nCol - 1;
+ pTab->aCol[iCol].isPrimKey = 1;
+ }else{
+ for(i=0; i<pList->nExpr; i++){
+ for(iCol=0; iCol<pTab->nCol; iCol++){
+ if( sqlite3StrICmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ){
+ break;
+ }
+ }
+ if( iCol<pTab->nCol ){
+ pTab->aCol[iCol].isPrimKey = 1;
+ }
+ }
+ if( pList->nExpr>1 ) iCol = -1;
+ }
+ if( iCol>=0 && iCol<pTab->nCol ){
+ zType = pTab->aCol[iCol].zType;
+ }
+ if( zType && sqlite3StrICmp(zType, "INTEGER")==0 ){
+ pTab->iPKey = iCol;
+ pTab->keyConf = onError;
+ pTab->autoInc = autoInc;
+ }else if( autoInc ){
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ sqlite3ErrorMsg(pParse, "AUTOINCREMENT is only allowed on an "
+ "INTEGER PRIMARY KEY");
+#endif
+ }else{
+ sqlite3CreateIndex(pParse, 0, 0, 0, pList, onError, 0, 0);
+ pList = 0;
+ }
+
+primary_key_exit:
+ sqlite3ExprListDelete(pList);
+ return;
+}
+
+/*
+** Set the collation function of the most recently parsed table column
+** to the CollSeq given.
+*/
+void sqlite3AddCollateType(Parse *pParse, const char *zType, int nType){
+ Table *p;
+ Index *pIdx;
+ CollSeq *pColl;
+ int i;
+
+ if( (p = pParse->pNewTable)==0 ) return;
+ i = p->nCol-1;
+
+ pColl = sqlite3LocateCollSeq(pParse, zType, nType);
+ p->aCol[i].pColl = pColl;
+
+ /* If the column is declared as "<name> PRIMARY KEY COLLATE <type>",
+ ** then an index may have been created on this column before the
+ ** collation type was added. Correct this if it is the case.
+ */
+ for(pIdx = p->pIndex; pIdx; pIdx=pIdx->pNext){
+ assert( pIdx->nColumn==1 );
+ if( pIdx->aiColumn[0]==i ) pIdx->keyInfo.aColl[0] = pColl;
+ }
+}
+
+/*
+** Call sqlite3CheckCollSeq() for all collating sequences in an index,
+** in order to verify that all the necessary collating sequences are
+** loaded.
+*/
+int sqlite3CheckIndexCollSeq(Parse *pParse, Index *pIdx){
+ if( pIdx ){
+ int i;
+ for(i=0; i<pIdx->nColumn; i++){
+ if( sqlite3CheckCollSeq(pParse, pIdx->keyInfo.aColl[i]) ){
+ return SQLITE_ERROR;
+ }
+ }
+ }
+ return SQLITE_OK;
+}
+
+/*
+** This function returns the collation sequence for database native text
+** encoding identified by the string zName, length nName.
+**
+** If the requested collation sequence is not available, or not available
+** in the database native encoding, the collation factory is invoked to
+** request it. If the collation factory does not supply such a sequence,
+** and the sequence is available in another text encoding, then that is
+** returned instead.
+**
+** If no versions of the requested collations sequence are available, or
+** another error occurs, NULL is returned and an error message written into
+** pParse.
+*/
+CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName){
+ sqlite3 *db = pParse->db;
+ u8 enc = db->enc;
+ u8 initbusy = db->init.busy;
+
+ CollSeq *pColl = sqlite3FindCollSeq(db, enc, zName, nName, initbusy);
+ if( !initbusy && (!pColl || !pColl->xCmp) ){
+ pColl = sqlite3GetCollSeq(db, pColl, zName, nName);
+ if( !pColl ){
+ if( nName<0 ){
+ nName = strlen(zName);
+ }
+ sqlite3ErrorMsg(pParse, "no such collation sequence: %.*s", nName, zName);
+ pColl = 0;
+ }
+ }
+
+ return pColl;
+}
+
+
+/*
+** Generate code that will increment the schema cookie.
+**
+** The schema cookie is used to determine when the schema for the
+** database changes. After each schema change, the cookie value
+** changes. When a process first reads the schema it records the
+** cookie. Thereafter, whenever it goes to access the database,
+** it checks the cookie to make sure the schema has not changed
+** since it was last read.
+**
+** This plan is not completely bullet-proof. It is possible for
+** the schema to change multiple times and for the cookie to be
+** set back to prior value. But schema changes are infrequent
+** and the probability of hitting the same cookie value is only
+** 1 chance in 2^32. So we're safe enough.
+*/
+void sqlite3ChangeCookie(sqlite3 *db, Vdbe *v, int iDb){
+ sqlite3VdbeAddOp(v, OP_Integer, db->aDb[iDb].schema_cookie+1, 0);
+ sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 0);
+}
+
+/*
+** Measure the number of characters needed to output the given
+** identifier. The number returned includes any quotes used
+** but does not include the null terminator.
+**
+** The estimate is conservative. It might be larger that what is
+** really needed.
+*/
+static int identLength(const char *z){
+ int n;
+ for(n=0; *z; n++, z++){
+ if( *z=='"' ){ n++; }
+ }
+ return n + 2;
+}
+
+/*
+** Write an identifier onto the end of the given string. Add
+** quote characters as needed.
+*/
+static void identPut(char *z, int *pIdx, char *zSignedIdent){
+ unsigned char *zIdent = (unsigned char*)zSignedIdent;
+ int i, j, needQuote;
+ i = *pIdx;
+ for(j=0; zIdent[j]; j++){
+ if( !isalnum(zIdent[j]) && zIdent[j]!='_' ) break;
+ }
+ needQuote = zIdent[j]!=0 || isdigit(zIdent[0])
+ || sqlite3KeywordCode(zIdent, j)!=TK_ID;
+ if( needQuote ) z[i++] = '"';
+ for(j=0; zIdent[j]; j++){
+ z[i++] = zIdent[j];
+ if( zIdent[j]=='"' ) z[i++] = '"';
+ }
+ if( needQuote ) z[i++] = '"';
+ z[i] = 0;
+ *pIdx = i;
+}
+
+/*
+** Generate a CREATE TABLE statement appropriate for the given
+** table. Memory to hold the text of the statement is obtained
+** from sqliteMalloc() and must be freed by the calling function.
+*/
+static char *createTableStmt(Table *p){
+ int i, k, n;
+ char *zStmt;
+ char *zSep, *zSep2, *zEnd, *z;
+ Column *pCol;
+ n = 0;
+ for(pCol = p->aCol, i=0; i<p->nCol; i++, pCol++){
+ n += identLength(pCol->zName);
+ z = pCol->zType;
+ if( z ){
+ n += (strlen(z) + 1);
+ }
+ }
+ n += identLength(p->zName);
+ if( n<50 ){
+ zSep = "";
+ zSep2 = ",";
+ zEnd = ")";
+ }else{
+ zSep = "\n ";
+ zSep2 = ",\n ";
+ zEnd = "\n)";
+ }
+ n += 35 + 6*p->nCol;
+ zStmt = sqliteMallocRaw( n );
+ if( zStmt==0 ) return 0;
+ strcpy(zStmt, !OMIT_TEMPDB&&p->iDb==1 ? "CREATE TEMP TABLE ":"CREATE TABLE ");
+ k = strlen(zStmt);
+ identPut(zStmt, &k, p->zName);
+ zStmt[k++] = '(';
+ for(pCol=p->aCol, i=0; i<p->nCol; i++, pCol++){
+ strcpy(&zStmt[k], zSep);
+ k += strlen(&zStmt[k]);
+ zSep = zSep2;
+ identPut(zStmt, &k, pCol->zName);
+ if( (z = pCol->zType)!=0 ){
+ zStmt[k++] = ' ';
+ strcpy(&zStmt[k], z);
+ k += strlen(z);
+ }
+ }
+ strcpy(&zStmt[k], zEnd);
+ return zStmt;
+}
+
+/*
+** This routine is called to report the final ")" that terminates
+** a CREATE TABLE statement.
+**
+** The table structure that other action routines have been building
+** is added to the internal hash tables, assuming no errors have
+** occurred.
+**
+** An entry for the table is made in the master table on disk, unless
+** this is a temporary table or db->init.busy==1. When db->init.busy==1
+** it means we are reading the sqlite_master table because we just
+** connected to the database or because the sqlite_master table has
+** recently changed, so the entry for this table already exists in
+** the sqlite_master table. We do not want to create it again.
+**
+** If the pSelect argument is not NULL, it means that this routine
+** was called to create a table generated from a
+** "CREATE TABLE ... AS SELECT ..." statement. The column names of
+** the new table will match the result set of the SELECT.
+*/
+void sqlite3EndTable(
+ Parse *pParse, /* Parse context */
+ Token *pCons, /* The ',' token after the last column defn. */
+ Token *pEnd, /* The final ')' token in the CREATE TABLE */
+ Select *pSelect /* Select from a "CREATE ... AS SELECT" */
+){
+ Table *p;
+ sqlite3 *db = pParse->db;
+
+ if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite3_malloc_failed ) return;
+ p = pParse->pNewTable;
+ if( p==0 ) return;
+
+ assert( !db->init.busy || !pSelect );
+
+ /* If the db->init.busy is 1 it means we are reading the SQL off the
+ ** "sqlite_master" or "sqlite_temp_master" table on the disk.
+ ** So do not write to the disk again. Extract the root page number
+ ** for the table from the db->init.newTnum field. (The page number
+ ** should have been put there by the sqliteOpenCb routine.)
+ */
+ if( db->init.busy ){
+ p->tnum = db->init.newTnum;
+ }
+
+ /* If not initializing, then create a record for the new table
+ ** in the SQLITE_MASTER table of the database. The record number
+ ** for the new table entry should already be on the stack.
+ **
+ ** If this is a TEMPORARY table, write the entry into the auxiliary
+ ** file instead of into the main database file.
+ */
+ if( !db->init.busy ){
+ int n;
+ Vdbe *v;
+ char *zType; /* "view" or "table" */
+ char *zType2; /* "VIEW" or "TABLE" */
+ char *zStmt; /* Text of the CREATE TABLE or CREATE VIEW statement */
+
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) return;
+
+ sqlite3VdbeAddOp(v, OP_Close, 0, 0);
+
+ /* Create the rootpage for the new table and push it onto the stack.
+ ** A view has no rootpage, so just push a zero onto the stack for
+ ** views. Initialize zType at the same time.
+ */
+ if( p->pSelect==0 ){
+ /* A regular table */
+ zType = "table";
+ zType2 = "TABLE";
+#ifndef SQLITE_OMIT_VIEW
+ }else{
+ /* A view */
+ zType = "view";
+ zType2 = "VIEW";
+#endif
+ }
+
+ /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT
+ ** statement to populate the new table. The root-page number for the
+ ** new table is on the top of the vdbe stack.
+ **
+ ** Once the SELECT has been coded by sqlite3Select(), it is in a
+ ** suitable state to query for the column names and types to be used
+ ** by the new table.
+ */
+ if( pSelect ){
+ Table *pSelTab;
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, p->iDb, 0);
+ sqlite3VdbeAddOp(v, OP_OpenWrite, 1, 0);
+ pParse->nTab = 2;
+ sqlite3Select(pParse, pSelect, SRT_Table, 1, 0, 0, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Close, 1, 0);
+ if( pParse->nErr==0 ){
+ pSelTab = sqlite3ResultSetOfSelect(pParse, 0, pSelect);
+ if( pSelTab==0 ) return;
+ assert( p->aCol==0 );
+ p->nCol = pSelTab->nCol;
+ p->aCol = pSelTab->aCol;
+ pSelTab->nCol = 0;
+ pSelTab->aCol = 0;
+ sqlite3DeleteTable(0, pSelTab);
+ }
+ }
+
+ /* Compute the complete text of the CREATE statement */
+ if( pSelect ){
+ zStmt = createTableStmt(p);
+ }else{
+ n = pEnd->z - pParse->sNameToken.z + 1;
+ zStmt = sqlite3MPrintf("CREATE %s %.*s", zType2, n, pParse->sNameToken.z);
+ }
+
+ /* A slot for the record has already been allocated in the
+ ** SQLITE_MASTER table. We just need to update that slot with all
+ ** the information we've collected. The rowid for the preallocated
+ ** slot is the 2nd item on the stack. The top of the stack is the
+ ** root page for the new table (or a 0 if this is a view).
+ */
+ sqlite3NestedParse(pParse,
+ "UPDATE %Q.%s "
+ "SET type='%s', name=%Q, tbl_name=%Q, rootpage=#0, sql=%Q "
+ "WHERE rowid=#1",
+ db->aDb[p->iDb].zName, SCHEMA_TABLE(p->iDb),
+ zType,
+ p->zName,
+ p->zName,
+ zStmt
+ );
+ sqliteFree(zStmt);
+ sqlite3ChangeCookie(db, v, p->iDb);
+
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ /* Check to see if we need to create an sqlite_sequence table for
+ ** keeping track of autoincrement keys.
+ */
+ if( p->autoInc ){
+ Db *pDb = &db->aDb[p->iDb];
+ if( pDb->pSeqTab==0 ){
+ sqlite3NestedParse(pParse,
+ "CREATE TABLE %Q.sqlite_sequence(name,seq)",
+ pDb->zName
+ );
+ }
+ }
+#endif
+
+ /* Reparse everything to update our internal data structures */
+ sqlite3VdbeOp3(v, OP_ParseSchema, p->iDb, 0,
+ sqlite3MPrintf("tbl_name='%q'",p->zName), P3_DYNAMIC);
+ }
+
+
+ /* Add the table to the in-memory representation of the database.
+ */
+ if( db->init.busy && pParse->nErr==0 ){
+ Table *pOld;
+ FKey *pFKey;
+ Db *pDb = &db->aDb[p->iDb];
+ pOld = sqlite3HashInsert(&pDb->tblHash, p->zName, strlen(p->zName)+1, p);
+ if( pOld ){
+ assert( p==pOld ); /* Malloc must have failed inside HashInsert() */
+ return;
+ }
+#ifndef SQLITE_OMIT_FOREIGN_KEY
+ for(pFKey=p->pFKey; pFKey; pFKey=pFKey->pNextFrom){
+ int nTo = strlen(pFKey->zTo) + 1;
+ pFKey->pNextTo = sqlite3HashFind(&pDb->aFKey, pFKey->zTo, nTo);
+ sqlite3HashInsert(&pDb->aFKey, pFKey->zTo, nTo, pFKey);
+ }
+#endif
+ pParse->pNewTable = 0;
+ db->nTable++;
+ db->flags |= SQLITE_InternChanges;
+
+#ifndef SQLITE_OMIT_ALTERTABLE
+ if( !p->pSelect ){
+ assert( !pSelect && pCons && pEnd );
+ if( pCons->z==0 ) pCons = pEnd;
+ p->addColOffset = 13 + (pCons->z - pParse->sNameToken.z);
+ }
+#endif
+ }
+}
+
+#ifndef SQLITE_OMIT_VIEW
+/*
+** The parser calls this routine in order to create a new VIEW
+*/
+void sqlite3CreateView(
+ Parse *pParse, /* The parsing context */
+ Token *pBegin, /* The CREATE token that begins the statement */
+ Token *pName1, /* The token that holds the name of the view */
+ Token *pName2, /* The token that holds the name of the view */
+ Select *pSelect, /* A SELECT statement that will become the new view */
+ int isTemp /* TRUE for a TEMPORARY view */
+){
+ Table *p;
+ int n;
+ const unsigned char *z;
+ Token sEnd;
+ DbFixer sFix;
+ Token *pName;
+
+ if( pParse->nVar>0 ){
+ sqlite3ErrorMsg(pParse, "parameters are not allowed in views");
+ sqlite3SelectDelete(pSelect);
+ return;
+ }
+ sqlite3StartTable(pParse, pBegin, pName1, pName2, isTemp, 1);
+ p = pParse->pNewTable;
+ if( p==0 || pParse->nErr ){
+ sqlite3SelectDelete(pSelect);
+ return;
+ }
+ sqlite3TwoPartName(pParse, pName1, pName2, &pName);
+ if( sqlite3FixInit(&sFix, pParse, p->iDb, "view", pName)
+ && sqlite3FixSelect(&sFix, pSelect)
+ ){
+ sqlite3SelectDelete(pSelect);
+ return;
+ }
+
+ /* Make a copy of the entire SELECT statement that defines the view.
+ ** This will force all the Expr.token.z values to be dynamically
+ ** allocated rather than point to the input string - which means that
+ ** they will persist after the current sqlite3_exec() call returns.
+ */
+ p->pSelect = sqlite3SelectDup(pSelect);
+ sqlite3SelectDelete(pSelect);
+ if( !pParse->db->init.busy ){
+ sqlite3ViewGetColumnNames(pParse, p);
+ }
+
+ /* Locate the end of the CREATE VIEW statement. Make sEnd point to
+ ** the end.
+ */
+ sEnd = pParse->sLastToken;
+ if( sEnd.z[0]!=0 && sEnd.z[0]!=';' ){
+ sEnd.z += sEnd.n;
+ }
+ sEnd.n = 0;
+ n = sEnd.z - pBegin->z;
+ z = (const unsigned char*)pBegin->z;
+ while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; }
+ sEnd.z = &z[n-1];
+ sEnd.n = 1;
+
+ /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */
+ sqlite3EndTable(pParse, 0, &sEnd, 0);
+ return;
+}
+#endif /* SQLITE_OMIT_VIEW */
+
+#ifndef SQLITE_OMIT_VIEW
+/*
+** The Table structure pTable is really a VIEW. Fill in the names of
+** the columns of the view in the pTable structure. Return the number
+** of errors. If an error is seen leave an error message in pParse->zErrMsg.
+*/
+int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
+ Table *pSelTab; /* A fake table from which we get the result set */
+ Select *pSel; /* Copy of the SELECT that implements the view */
+ int nErr = 0; /* Number of errors encountered */
+ int n; /* Temporarily holds the number of cursors assigned */
+
+ assert( pTable );
+
+ /* A positive nCol means the columns names for this view are
+ ** already known.
+ */
+ if( pTable->nCol>0 ) return 0;
+
+ /* A negative nCol is a special marker meaning that we are currently
+ ** trying to compute the column names. If we enter this routine with
+ ** a negative nCol, it means two or more views form a loop, like this:
+ **
+ ** CREATE VIEW one AS SELECT * FROM two;
+ ** CREATE VIEW two AS SELECT * FROM one;
+ **
+ ** Actually, this error is caught previously and so the following test
+ ** should always fail. But we will leave it in place just to be safe.
+ */
+#if 0
+ if( pTable->nCol<0 ){
+ sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName);
+ return 1;
+ }
+#endif
+ assert( pTable->nCol>=0 );
+
+ /* If we get this far, it means we need to compute the table names.
+ ** Note that the call to sqlite3ResultSetOfSelect() will expand any
+ ** "*" elements in the results set of the view and will assign cursors
+ ** to the elements of the FROM clause. But we do not want these changes
+ ** to be permanent. So the computation is done on a copy of the SELECT
+ ** statement that defines the view.
+ */
+ assert( pTable->pSelect );
+ pSel = sqlite3SelectDup(pTable->pSelect);
+ n = pParse->nTab;
+ sqlite3SrcListAssignCursors(pParse, pSel->pSrc);
+ pTable->nCol = -1;
+ pSelTab = sqlite3ResultSetOfSelect(pParse, 0, pSel);
+ pParse->nTab = n;
+ if( pSelTab ){
+ assert( pTable->aCol==0 );
+ pTable->nCol = pSelTab->nCol;
+ pTable->aCol = pSelTab->aCol;
+ pSelTab->nCol = 0;
+ pSelTab->aCol = 0;
+ sqlite3DeleteTable(0, pSelTab);
+ DbSetProperty(pParse->db, pTable->iDb, DB_UnresetViews);
+ }else{
+ pTable->nCol = 0;
+ nErr++;
+ }
+ sqlite3SelectDelete(pSel);
+ return nErr;
+}
+#endif /* SQLITE_OMIT_VIEW */
+
+#ifndef SQLITE_OMIT_VIEW
+/*
+** Clear the column names from every VIEW in database idx.
+*/
+static void sqliteViewResetAll(sqlite3 *db, int idx){
+ HashElem *i;
+ if( !DbHasProperty(db, idx, DB_UnresetViews) ) return;
+ for(i=sqliteHashFirst(&db->aDb[idx].tblHash); i; i=sqliteHashNext(i)){
+ Table *pTab = sqliteHashData(i);
+ if( pTab->pSelect ){
+ sqliteResetColumnNames(pTab);
+ }
+ }
+ DbClearProperty(db, idx, DB_UnresetViews);
+}
+#else
+# define sqliteViewResetAll(A,B)
+#endif /* SQLITE_OMIT_VIEW */
+
+/*
+** This function is called by the VDBE to adjust the internal schema
+** used by SQLite when the btree layer moves a table root page. The
+** root-page of a table or index in database iDb has changed from iFrom
+** to iTo.
+*/
+#ifndef SQLITE_OMIT_AUTOVACUUM
+void sqlite3RootPageMoved(Db *pDb, int iFrom, int iTo){
+ HashElem *pElem;
+
+ for(pElem=sqliteHashFirst(&pDb->tblHash); pElem; pElem=sqliteHashNext(pElem)){
+ Table *pTab = sqliteHashData(pElem);
+ if( pTab->tnum==iFrom ){
+ pTab->tnum = iTo;
+ return;
+ }
+ }
+ for(pElem=sqliteHashFirst(&pDb->idxHash); pElem; pElem=sqliteHashNext(pElem)){
+ Index *pIdx = sqliteHashData(pElem);
+ if( pIdx->tnum==iFrom ){
+ pIdx->tnum = iTo;
+ return;
+ }
+ }
+ assert(0);
+}
+#endif
+
+/*
+** Write code to erase the table with root-page iTable from database iDb.
+** Also write code to modify the sqlite_master table and internal schema
+** if a root-page of another table is moved by the btree-layer whilst
+** erasing iTable (this can happen with an auto-vacuum database).
+*/
+static void destroyRootPage(Parse *pParse, int iTable, int iDb){
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ sqlite3VdbeAddOp(v, OP_Destroy, iTable, iDb);
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ /* OP_Destroy pushes an integer onto the stack. If this integer
+ ** is non-zero, then it is the root page number of a table moved to
+ ** location iTable. The following code modifies the sqlite_master table to
+ ** reflect this.
+ **
+ ** The "#0" in the SQL is a special constant that means whatever value
+ ** is on the top of the stack. See sqlite3RegisterExpr().
+ */
+ sqlite3NestedParse(pParse,
+ "UPDATE %Q.%s SET rootpage=%d WHERE #0 AND rootpage=#0",
+ pParse->db->aDb[iDb].zName, SCHEMA_TABLE(iDb), iTable);
+#endif
+}
+
+/*
+** Write VDBE code to erase table pTab and all associated indices on disk.
+** Code to update the sqlite_master tables and internal schema definitions
+** in case a root-page belonging to another table is moved by the btree layer
+** is also added (this can happen with an auto-vacuum database).
+*/
+static void destroyTable(Parse *pParse, Table *pTab){
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ Index *pIdx;
+ destroyRootPage(pParse, pTab->tnum, pTab->iDb);
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ destroyRootPage(pParse, pIdx->tnum, pIdx->iDb);
+ }
+#else
+ /* If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM
+ ** is not defined), then it is important to call OP_Destroy on the
+ ** table and index root-pages in order, starting with the numerically
+ ** largest root-page number. This guarantees that none of the root-pages
+ ** to be destroyed is relocated by an earlier OP_Destroy. i.e. if the
+ ** following were coded:
+ **
+ ** OP_Destroy 4 0
+ ** ...
+ ** OP_Destroy 5 0
+ **
+ ** and root page 5 happened to be the largest root-page number in the
+ ** database, then root page 5 would be moved to page 4 by the
+ ** "OP_Destroy 4 0" opcode. The subsequent "OP_Destroy 5 0" would hit
+ ** a free-list page.
+ */
+ int iTab = pTab->tnum;
+ int iDestroyed = 0;
+
+ while( 1 ){
+ Index *pIdx;
+ int iLargest = 0;
+
+ if( iDestroyed==0 || iTab<iDestroyed ){
+ iLargest = iTab;
+ }
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ int iIdx = pIdx->tnum;
+ assert( pIdx->iDb==pTab->iDb );
+ if( (iDestroyed==0 || (iIdx<iDestroyed)) && iIdx>iLargest ){
+ iLargest = iIdx;
+ }
+ }
+ if( iLargest==0 ) return;
+ destroyRootPage(pParse, iLargest, pTab->iDb);
+ iDestroyed = iLargest;
+ }
+#endif
+}
+
+/*
+** This routine is called to do the work of a DROP TABLE statement.
+** pName is the name of the table to be dropped.
+*/
+void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){
+ Table *pTab;
+ Vdbe *v;
+ sqlite3 *db = pParse->db;
+ int iDb;
+
+ if( pParse->nErr || sqlite3_malloc_failed ) goto exit_drop_table;
+ assert( pName->nSrc==1 );
+ pTab = sqlite3LocateTable(pParse, pName->a[0].zName, pName->a[0].zDatabase);
+
+ if( pTab==0 ) goto exit_drop_table;
+ iDb = pTab->iDb;
+ assert( iDb>=0 && iDb<db->nDb );
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ {
+ int code;
+ const char *zTab = SCHEMA_TABLE(pTab->iDb);
+ const char *zDb = db->aDb[pTab->iDb].zName;
+ if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){
+ goto exit_drop_table;
+ }
+ if( isView ){
+ if( !OMIT_TEMPDB && iDb==1 ){
+ code = SQLITE_DROP_TEMP_VIEW;
+ }else{
+ code = SQLITE_DROP_VIEW;
+ }
+ }else{
+ if( !OMIT_TEMPDB && iDb==1 ){
+ code = SQLITE_DROP_TEMP_TABLE;
+ }else{
+ code = SQLITE_DROP_TABLE;
+ }
+ }
+ if( sqlite3AuthCheck(pParse, code, pTab->zName, 0, zDb) ){
+ goto exit_drop_table;
+ }
+ if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
+ goto exit_drop_table;
+ }
+ }
+#endif
+ if( pTab->readOnly || pTab==db->aDb[iDb].pSeqTab ){
+ sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName);
+ goto exit_drop_table;
+ }
+
+#ifndef SQLITE_OMIT_VIEW
+ /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used
+ ** on a table.
+ */
+ if( isView && pTab->pSelect==0 ){
+ sqlite3ErrorMsg(pParse, "use DROP TABLE to delete table %s", pTab->zName);
+ goto exit_drop_table;
+ }
+ if( !isView && pTab->pSelect ){
+ sqlite3ErrorMsg(pParse, "use DROP VIEW to delete view %s", pTab->zName);
+ goto exit_drop_table;
+ }
+#endif
+
+ /* Generate code to remove the table from the master table
+ ** on disk.
+ */
+ v = sqlite3GetVdbe(pParse);
+ if( v ){
+ Trigger *pTrigger;
+ int iDb = pTab->iDb;
+ Db *pDb = &db->aDb[iDb];
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+
+ /* Drop all triggers associated with the table being dropped. Code
+ ** is generated to remove entries from sqlite_master and/or
+ ** sqlite_temp_master if required.
+ */
+ pTrigger = pTab->pTrigger;
+ while( pTrigger ){
+ assert( pTrigger->iDb==iDb || pTrigger->iDb==1 );
+ sqlite3DropTriggerPtr(pParse, pTrigger, 1);
+ pTrigger = pTrigger->pNext;
+ }
+
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ /* Remove any entries of the sqlite_sequence table associated with
+ ** the table being dropped. This is done before the table is dropped
+ ** at the btree level, in case the sqlite_sequence table needs to
+ ** move as a result of the drop (can happen in auto-vacuum mode).
+ */
+ if( pTab->autoInc ){
+ sqlite3NestedParse(pParse,
+ "DELETE FROM %s.sqlite_sequence WHERE name=%Q",
+ pDb->zName, pTab->zName
+ );
+ }
+#endif
+
+ /* Drop all SQLITE_MASTER table and index entries that refer to the
+ ** table. The program name loops through the master table and deletes
+ ** every row that refers to a table of the same name as the one being
+ ** dropped. Triggers are handled seperately because a trigger can be
+ ** created in the temp database that refers to a table in another
+ ** database.
+ */
+ sqlite3NestedParse(pParse,
+ "DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'",
+ pDb->zName, SCHEMA_TABLE(iDb), pTab->zName);
+ if( !isView ){
+ destroyTable(pParse, pTab);
+ }
+
+ /* Remove the table entry from SQLite's internal schema and modify
+ ** the schema cookie.
+ */
+ sqlite3VdbeOp3(v, OP_DropTable, iDb, 0, pTab->zName, 0);
+ sqlite3ChangeCookie(db, v, iDb);
+ }
+ sqliteViewResetAll(db, iDb);
+
+exit_drop_table:
+ sqlite3SrcListDelete(pName);
+}
+
+/*
+** This routine is called to create a new foreign key on the table
+** currently under construction. pFromCol determines which columns
+** in the current table point to the foreign key. If pFromCol==0 then
+** connect the key to the last column inserted. pTo is the name of
+** the table referred to. pToCol is a list of tables in the other
+** pTo table that the foreign key points to. flags contains all
+** information about the conflict resolution algorithms specified
+** in the ON DELETE, ON UPDATE and ON INSERT clauses.
+**
+** An FKey structure is created and added to the table currently
+** under construction in the pParse->pNewTable field. The new FKey
+** is not linked into db->aFKey at this point - that does not happen
+** until sqlite3EndTable().
+**
+** The foreign key is set for IMMEDIATE processing. A subsequent call
+** to sqlite3DeferForeignKey() might change this to DEFERRED.
+*/
+void sqlite3CreateForeignKey(
+ Parse *pParse, /* Parsing context */
+ ExprList *pFromCol, /* Columns in this table that point to other table */
+ Token *pTo, /* Name of the other table */
+ ExprList *pToCol, /* Columns in the other table */
+ int flags /* Conflict resolution algorithms. */
+){
+#ifndef SQLITE_OMIT_FOREIGN_KEY
+ FKey *pFKey = 0;
+ Table *p = pParse->pNewTable;
+ int nByte;
+ int i;
+ int nCol;
+ char *z;
+
+ assert( pTo!=0 );
+ if( p==0 || pParse->nErr ) goto fk_end;
+ if( pFromCol==0 ){
+ int iCol = p->nCol-1;
+ if( iCol<0 ) goto fk_end;
+ if( pToCol && pToCol->nExpr!=1 ){
+ sqlite3ErrorMsg(pParse, "foreign key on %s"
+ " should reference only one column of table %T",
+ p->aCol[iCol].zName, pTo);
+ goto fk_end;
+ }
+ nCol = 1;
+ }else if( pToCol && pToCol->nExpr!=pFromCol->nExpr ){
+ sqlite3ErrorMsg(pParse,
+ "number of columns in foreign key does not match the number of "
+ "columns in the referenced table");
+ goto fk_end;
+ }else{
+ nCol = pFromCol->nExpr;
+ }
+ nByte = sizeof(*pFKey) + nCol*sizeof(pFKey->aCol[0]) + pTo->n + 1;
+ if( pToCol ){
+ for(i=0; i<pToCol->nExpr; i++){
+ nByte += strlen(pToCol->a[i].zName) + 1;
+ }
+ }
+ pFKey = sqliteMalloc( nByte );
+ if( pFKey==0 ) goto fk_end;
+ pFKey->pFrom = p;
+ pFKey->pNextFrom = p->pFKey;
+ z = (char*)&pFKey[1];
+ pFKey->aCol = (struct sColMap*)z;
+ z += sizeof(struct sColMap)*nCol;
+ pFKey->zTo = z;
+ memcpy(z, pTo->z, pTo->n);
+ z[pTo->n] = 0;
+ z += pTo->n+1;
+ pFKey->pNextTo = 0;
+ pFKey->nCol = nCol;
+ if( pFromCol==0 ){
+ pFKey->aCol[0].iFrom = p->nCol-1;
+ }else{
+ for(i=0; i<nCol; i++){
+ int j;
+ for(j=0; j<p->nCol; j++){
+ if( sqlite3StrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){
+ pFKey->aCol[i].iFrom = j;
+ break;
+ }
+ }
+ if( j>=p->nCol ){
+ sqlite3ErrorMsg(pParse,
+ "unknown column \"%s\" in foreign key definition",
+ pFromCol->a[i].zName);
+ goto fk_end;
+ }
+ }
+ }
+ if( pToCol ){
+ for(i=0; i<nCol; i++){
+ int n = strlen(pToCol->a[i].zName);
+ pFKey->aCol[i].zCol = z;
+ memcpy(z, pToCol->a[i].zName, n);
+ z[n] = 0;
+ z += n+1;
+ }
+ }
+ pFKey->isDeferred = 0;
+ pFKey->deleteConf = flags & 0xff;
+ pFKey->updateConf = (flags >> 8 ) & 0xff;
+ pFKey->insertConf = (flags >> 16 ) & 0xff;
+
+ /* Link the foreign key to the table as the last step.
+ */
+ p->pFKey = pFKey;
+ pFKey = 0;
+
+fk_end:
+ sqliteFree(pFKey);
+#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
+ sqlite3ExprListDelete(pFromCol);
+ sqlite3ExprListDelete(pToCol);
+}
+
+/*
+** This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED
+** clause is seen as part of a foreign key definition. The isDeferred
+** parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE.
+** The behavior of the most recently created foreign key is adjusted
+** accordingly.
+*/
+void sqlite3DeferForeignKey(Parse *pParse, int isDeferred){
+#ifndef SQLITE_OMIT_FOREIGN_KEY
+ Table *pTab;
+ FKey *pFKey;
+ if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return;
+ pFKey->isDeferred = isDeferred;
+#endif
+}
+
+/*
+** Generate code that will erase and refill index *pIdx. This is
+** used to initialize a newly created index or to recompute the
+** content of an index in response to a REINDEX command.
+**
+** if memRootPage is not negative, it means that the index is newly
+** created. The memory cell specified by memRootPage contains the
+** root page number of the index. If memRootPage is negative, then
+** the index already exists and must be cleared before being refilled and
+** the root page number of the index is taken from pIndex->tnum.
+*/
+static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
+ Table *pTab = pIndex->pTable; /* The table that is indexed */
+ int iTab = pParse->nTab; /* Btree cursor used for pTab */
+ int iIdx = pParse->nTab+1; /* Btree cursor used for pIndex */
+ int addr1; /* Address of top of loop */
+ int tnum; /* Root page of index */
+ Vdbe *v; /* Generate code into this virtual machine */
+
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0,
+ pParse->db->aDb[pIndex->iDb].zName ) ){
+ return;
+ }
+#endif
+
+ /* Ensure all the required collation sequences are available. This
+ ** routine will invoke the collation-needed callback if necessary (and
+ ** if one has been registered).
+ */
+ if( sqlite3CheckIndexCollSeq(pParse, pIndex) ){
+ return;
+ }
+
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) return;
+ if( memRootPage>=0 ){
+ sqlite3VdbeAddOp(v, OP_MemLoad, memRootPage, 0);
+ tnum = 0;
+ }else{
+ tnum = pIndex->tnum;
+ sqlite3VdbeAddOp(v, OP_Clear, tnum, pIndex->iDb);
+ }
+ sqlite3VdbeAddOp(v, OP_Integer, pIndex->iDb, 0);
+ sqlite3VdbeOp3(v, OP_OpenWrite, iIdx, tnum,
+ (char*)&pIndex->keyInfo, P3_KEYINFO);
+ sqlite3OpenTableForReading(v, iTab, pTab);
+ addr1 = sqlite3VdbeAddOp(v, OP_Rewind, iTab, 0);
+ sqlite3GenerateIndexKey(v, pIndex, iTab);
+ if( pIndex->onError!=OE_None ){
+ int curaddr = sqlite3VdbeCurrentAddr(v);
+ int addr2 = curaddr+4;
+ sqlite3VdbeChangeP2(v, curaddr-1, addr2);
+ sqlite3VdbeAddOp(v, OP_Rowid, iTab, 0);
+ sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
+ sqlite3VdbeAddOp(v, OP_IsUnique, iIdx, addr2);
+ sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, OE_Abort,
+ "indexed columns are not unique", P3_STATIC);
+ assert( addr2==sqlite3VdbeCurrentAddr(v) );
+ }
+ sqlite3VdbeAddOp(v, OP_IdxInsert, iIdx, 0);
+ sqlite3VdbeAddOp(v, OP_Next, iTab, addr1+1);
+ sqlite3VdbeJumpHere(v, addr1);
+ sqlite3VdbeAddOp(v, OP_Close, iTab, 0);
+ sqlite3VdbeAddOp(v, OP_Close, iIdx, 0);
+}
+
+/*
+** Create a new index for an SQL table. pName1.pName2 is the name of the index
+** and pTblList is the name of the table that is to be indexed. Both will
+** be NULL for a primary key or an index that is created to satisfy a
+** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
+** as the table to be indexed. pParse->pNewTable is a table that is
+** currently being constructed by a CREATE TABLE statement.
+**
+** pList is a list of columns to be indexed. pList will be NULL if this
+** is a primary key or unique-constraint on the most recent column added
+** to the table currently under construction.
+*/
+void sqlite3CreateIndex(
+ Parse *pParse, /* All information about this parse */
+ Token *pName1, /* First part of index name. May be NULL */
+ Token *pName2, /* Second part of index name. May be NULL */
+ SrcList *pTblName, /* Table to index. Use pParse->pNewTable if 0 */
+ ExprList *pList, /* A list of columns to be indexed */
+ int onError, /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
+ Token *pStart, /* The CREATE token that begins a CREATE TABLE statement */
+ Token *pEnd /* The ")" that closes the CREATE INDEX statement */
+){
+ Table *pTab = 0; /* Table to be indexed */
+ Index *pIndex = 0; /* The index to be created */
+ char *zName = 0;
+ int i, j;
+ Token nullId; /* Fake token for an empty ID list */
+ DbFixer sFix; /* For assigning database names to pTable */
+ sqlite3 *db = pParse->db;
+
+ int iDb; /* Index of the database that is being written */
+ Token *pName = 0; /* Unqualified name of the index to create */
+
+ if( pParse->nErr || sqlite3_malloc_failed ) goto exit_create_index;
+
+ /*
+ ** Find the table that is to be indexed. Return early if not found.
+ */
+ if( pTblName!=0 ){
+
+ /* Use the two-part index name to determine the database
+ ** to search for the table. 'Fix' the table name to this db
+ ** before looking up the table.
+ */
+ assert( pName1 && pName2 );
+ iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName);
+ if( iDb<0 ) goto exit_create_index;
+
+#ifndef SQLITE_OMIT_TEMPDB
+ /* If the index name was unqualified, check if the the table
+ ** is a temp table. If so, set the database to 1.
+ */
+ pTab = sqlite3SrcListLookup(pParse, pTblName);
+ if( pName2 && pName2->n==0 && pTab && pTab->iDb==1 ){
+ iDb = 1;
+ }
+#endif
+
+ if( sqlite3FixInit(&sFix, pParse, iDb, "index", pName) &&
+ sqlite3FixSrcList(&sFix, pTblName)
+ ){
+ /* Because the parser constructs pTblName from a single identifier,
+ ** sqlite3FixSrcList can never fail. */
+ assert(0);
+ }
+ pTab = sqlite3LocateTable(pParse, pTblName->a[0].zName,
+ pTblName->a[0].zDatabase);
+ if( !pTab ) goto exit_create_index;
+ assert( iDb==pTab->iDb );
+ }else{
+ assert( pName==0 );
+ pTab = pParse->pNewTable;
+ iDb = pTab->iDb;
+ }
+
+ if( pTab==0 || pParse->nErr ) goto exit_create_index;
+ if( pTab->readOnly ){
+ sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
+ goto exit_create_index;
+ }
+#ifndef SQLITE_OMIT_VIEW
+ if( pTab->pSelect ){
+ sqlite3ErrorMsg(pParse, "views may not be indexed");
+ goto exit_create_index;
+ }
+#endif
+
+ /*
+ ** Find the name of the index. Make sure there is not already another
+ ** index or table with the same name.
+ **
+ ** Exception: If we are reading the names of permanent indices from the
+ ** sqlite_master table (because some other process changed the schema) and
+ ** one of the index names collides with the name of a temporary table or
+ ** index, then we will continue to process this index.
+ **
+ ** If pName==0 it means that we are
+ ** dealing with a primary key or UNIQUE constraint. We have to invent our
+ ** own name.
+ */
+ if( pName ){
+ zName = sqlite3NameFromToken(pName);
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ) goto exit_create_index;
+ if( zName==0 ) goto exit_create_index;
+ if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ goto exit_create_index;
+ }
+ if( !db->init.busy ){
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ) goto exit_create_index;
+ if( sqlite3FindIndex(db, zName, db->aDb[iDb].zName)!=0 ){
+ sqlite3ErrorMsg(pParse, "index %s already exists", zName);
+ goto exit_create_index;
+ }
+ if( sqlite3FindTable(db, zName, 0)!=0 ){
+ sqlite3ErrorMsg(pParse, "there is already a table named %s", zName);
+ goto exit_create_index;
+ }
+ }
+ }else{
+ char zBuf[30];
+ int n;
+ Index *pLoop;
+ for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
+ sprintf(zBuf,"_%d",n);
+ zName = 0;
+ sqlite3SetString(&zName, "sqlite_autoindex_", pTab->zName, zBuf, (char*)0);
+ if( zName==0 ) goto exit_create_index;
+ }
+
+ /* Check for authorization to create an index.
+ */
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ {
+ const char *zDb = db->aDb[iDb].zName;
+ if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){
+ goto exit_create_index;
+ }
+ i = SQLITE_CREATE_INDEX;
+ if( !OMIT_TEMPDB && iDb==1 ) i = SQLITE_CREATE_TEMP_INDEX;
+ if( sqlite3AuthCheck(pParse, i, zName, pTab->zName, zDb) ){
+ goto exit_create_index;
+ }
+ }
+#endif
+
+ /* If pList==0, it means this routine was called to make a primary
+ ** key out of the last column added to the table under construction.
+ ** So create a fake list to simulate this.
+ */
+ if( pList==0 ){
+ nullId.z = pTab->aCol[pTab->nCol-1].zName;
+ nullId.n = strlen(nullId.z);
+ pList = sqlite3ExprListAppend(0, 0, &nullId);
+ if( pList==0 ) goto exit_create_index;
+ }
+
+ /*
+ ** Allocate the index structure.
+ */
+ pIndex = sqliteMalloc( sizeof(Index) + strlen(zName) + 1 + sizeof(int) +
+ (sizeof(int)*2 + sizeof(CollSeq*))*pList->nExpr );
+ if( sqlite3_malloc_failed ) goto exit_create_index;
+ pIndex->aiColumn = (int*)&pIndex->keyInfo.aColl[pList->nExpr];
+ pIndex->aiRowEst = (unsigned*)&pIndex->aiColumn[pList->nExpr];
+ pIndex->zName = (char*)&pIndex->aiRowEst[pList->nExpr+1];
+ strcpy(pIndex->zName, zName);
+ pIndex->pTable = pTab;
+ pIndex->nColumn = pList->nExpr;
+ pIndex->onError = onError;
+ pIndex->autoIndex = pName==0;
+ pIndex->iDb = iDb;
+
+ /* Scan the names of the columns of the table to be indexed and
+ ** load the column indices into the Index structure. Report an error
+ ** if any column is not found.
+ */
+ for(i=0; i<pList->nExpr; i++){
+ for(j=0; j<pTab->nCol; j++){
+ if( sqlite3StrICmp(pList->a[i].zName, pTab->aCol[j].zName)==0 ) break;
+ }
+ if( j>=pTab->nCol ){
+ sqlite3ErrorMsg(pParse, "table %s has no column named %s",
+ pTab->zName, pList->a[i].zName);
+ goto exit_create_index;
+ }
+ pIndex->aiColumn[i] = j;
+ if( pList->a[i].pExpr ){
+ assert( pList->a[i].pExpr->pColl );
+ pIndex->keyInfo.aColl[i] = pList->a[i].pExpr->pColl;
+ }else{
+ pIndex->keyInfo.aColl[i] = pTab->aCol[j].pColl;
+ }
+ assert( pIndex->keyInfo.aColl[i] );
+ if( !db->init.busy &&
+ sqlite3CheckCollSeq(pParse, pIndex->keyInfo.aColl[i])
+ ){
+ goto exit_create_index;
+ }
+ }
+ pIndex->keyInfo.nField = pList->nExpr;
+ sqlite3DefaultRowEst(pIndex);
+
+ if( pTab==pParse->pNewTable ){
+ /* This routine has been called to create an automatic index as a
+ ** result of a PRIMARY KEY or UNIQUE clause on a column definition, or
+ ** a PRIMARY KEY or UNIQUE clause following the column definitions.
+ ** i.e. one of:
+ **
+ ** CREATE TABLE t(x PRIMARY KEY, y);
+ ** CREATE TABLE t(x, y, UNIQUE(x, y));
+ **
+ ** Either way, check to see if the table already has such an index. If
+ ** so, don't bother creating this one. This only applies to
+ ** automatically created indices. Users can do as they wish with
+ ** explicit indices.
+ */
+ Index *pIdx;
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ int k;
+ assert( pIdx->onError!=OE_None );
+ assert( pIdx->autoIndex );
+ assert( pIndex->onError!=OE_None );
+
+ if( pIdx->nColumn!=pIndex->nColumn ) continue;
+ for(k=0; k<pIdx->nColumn; k++){
+ if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break;
+ if( pIdx->keyInfo.aColl[k]!=pIndex->keyInfo.aColl[k] ) break;
+ }
+ if( k==pIdx->nColumn ){
+ if( pIdx->onError!=pIndex->onError ){
+ /* This constraint creates the same index as a previous
+ ** constraint specified somewhere in the CREATE TABLE statement.
+ ** However the ON CONFLICT clauses are different. If both this
+ ** constraint and the previous equivalent constraint have explicit
+ ** ON CONFLICT clauses this is an error. Otherwise, use the
+ ** explicitly specified behaviour for the index.
+ */
+ if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){
+ sqlite3ErrorMsg(pParse,
+ "conflicting ON CONFLICT clauses specified", 0);
+ }
+ if( pIdx->onError==OE_Default ){
+ pIdx->onError = pIndex->onError;
+ }
+ }
+ goto exit_create_index;
+ }
+ }
+ }
+
+ /* Link the new Index structure to its table and to the other
+ ** in-memory database structures.
+ */
+ if( db->init.busy ){
+ Index *p;
+ p = sqlite3HashInsert(&db->aDb[pIndex->iDb].idxHash,
+ pIndex->zName, strlen(pIndex->zName)+1, pIndex);
+ if( p ){
+ assert( p==pIndex ); /* Malloc must have failed */
+ goto exit_create_index;
+ }
+ db->flags |= SQLITE_InternChanges;
+ if( pTblName!=0 ){
+ pIndex->tnum = db->init.newTnum;
+ }
+ }
+
+ /* If the db->init.busy is 0 then create the index on disk. This
+ ** involves writing the index into the master table and filling in the
+ ** index with the current table contents.
+ **
+ ** The db->init.busy is 0 when the user first enters a CREATE INDEX
+ ** command. db->init.busy is 1 when a database is opened and
+ ** CREATE INDEX statements are read out of the master table. In
+ ** the latter case the index already exists on disk, which is why
+ ** we don't want to recreate it.
+ **
+ ** If pTblName==0 it means this index is generated as a primary key
+ ** or UNIQUE constraint of a CREATE TABLE statement. Since the table
+ ** has just been created, it contains no data and the index initialization
+ ** step can be skipped.
+ */
+ else if( db->init.busy==0 ){
+ Vdbe *v;
+ char *zStmt;
+ int iMem = pParse->nMem++;
+
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) goto exit_create_index;
+
+ /* Create the rootpage for the index
+ */
+ sqlite3BeginWriteOperation(pParse, 1, iDb);
+ sqlite3VdbeAddOp(v, OP_CreateIndex, iDb, 0);
+ sqlite3VdbeAddOp(v, OP_MemStore, iMem, 0);
+
+ /* Gather the complete text of the CREATE INDEX statement into
+ ** the zStmt variable
+ */
+ if( pStart && pEnd ){
+ /* A named index with an explicit CREATE INDEX statement */
+ zStmt = sqlite3MPrintf("CREATE%s INDEX %.*s",
+ onError==OE_None ? "" : " UNIQUE",
+ pEnd->z - pName->z + 1,
+ pName->z);
+ }else{
+ /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */
+ /* zStmt = sqlite3MPrintf(""); */
+ zStmt = 0;
+ }
+
+ /* Add an entry in sqlite_master for this index
+ */
+ sqlite3NestedParse(pParse,
+ "INSERT INTO %Q.%s VALUES('index',%Q,%Q,#0,%Q);",
+ db->aDb[iDb].zName, SCHEMA_TABLE(iDb),
+ pIndex->zName,
+ pTab->zName,
+ zStmt
+ );
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqliteFree(zStmt);
+
+ /* Fill the index with data and reparse the schema. Code an OP_Expire
+ ** to invalidate all pre-compiled statements.
+ */
+ if( pTblName ){
+ sqlite3RefillIndex(pParse, pIndex, iMem);
+ sqlite3ChangeCookie(db, v, iDb);
+ sqlite3VdbeOp3(v, OP_ParseSchema, iDb, 0,
+ sqlite3MPrintf("name='%q'", pIndex->zName), P3_DYNAMIC);
+ sqlite3VdbeAddOp(v, OP_Expire, 0, 0);
+ }
+ }
+
+ /* When adding an index to the list of indices for a table, make
+ ** sure all indices labeled OE_Replace come after all those labeled
+ ** OE_Ignore. This is necessary for the correct operation of UPDATE
+ ** and INSERT.
+ */
+ if( db->init.busy || pTblName==0 ){
+ if( onError!=OE_Replace || pTab->pIndex==0
+ || pTab->pIndex->onError==OE_Replace){
+ pIndex->pNext = pTab->pIndex;
+ pTab->pIndex = pIndex;
+ }else{
+ Index *pOther = pTab->pIndex;
+ while( pOther->pNext && pOther->pNext->onError!=OE_Replace ){
+ pOther = pOther->pNext;
+ }
+ pIndex->pNext = pOther->pNext;
+ pOther->pNext = pIndex;
+ }
+ pIndex = 0;
+ }
+
+ /* Clean up before exiting */
+exit_create_index:
+ if( pIndex ){
+ freeIndex(pIndex);
+ }
+ sqlite3ExprListDelete(pList);
+ sqlite3SrcListDelete(pTblName);
+ sqliteFree(zName);
+ return;
+}
+
+/*
+** Fill the Index.aiRowEst[] array with default information - information
+** to be used when we have not run the ANALYZE command.
+**
+** aiRowEst[0] is suppose to contain the number of elements in the index.
+** Since we do not know, guess 1 million. aiRowEst[1] is an estimate of the
+** number of rows in the table that match any particular value of the
+** first column of the index. aiRowEst[2] is an estimate of the number
+** of rows that match any particular combiniation of the first 2 columns
+** of the index. And so forth. It must always be the case that
+*
+** aiRowEst[N]<=aiRowEst[N-1]
+** aiRowEst[N]>=1
+**
+** Apart from that, we have little to go on besides intuition as to
+** how aiRowEst[] should be initialized. The numbers generated here
+** are based on typical values found in actual indices.
+*/
+void sqlite3DefaultRowEst(Index *pIdx){
+ unsigned *a = pIdx->aiRowEst;
+ int i;
+ assert( a!=0 );
+ a[0] = 1000000;
+ for(i=pIdx->nColumn; i>=1; i--){
+ a[i] = 10;
+ }
+ if( pIdx->onError!=OE_None ){
+ a[pIdx->nColumn] = 1;
+ }
+}
+
+/*
+** This routine will drop an existing named index. This routine
+** implements the DROP INDEX statement.
+*/
+void sqlite3DropIndex(Parse *pParse, SrcList *pName){
+ Index *pIndex;
+ Vdbe *v;
+ sqlite3 *db = pParse->db;
+
+ if( pParse->nErr || sqlite3_malloc_failed ){
+ goto exit_drop_index;
+ }
+ assert( pName->nSrc==1 );
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ goto exit_drop_index;
+ }
+ pIndex = sqlite3FindIndex(db, pName->a[0].zName, pName->a[0].zDatabase);
+ if( pIndex==0 ){
+ sqlite3ErrorMsg(pParse, "no such index: %S", pName, 0);
+ pParse->checkSchema = 1;
+ goto exit_drop_index;
+ }
+ if( pIndex->autoIndex ){
+ sqlite3ErrorMsg(pParse, "index associated with UNIQUE "
+ "or PRIMARY KEY constraint cannot be dropped", 0);
+ goto exit_drop_index;
+ }
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ {
+ int code = SQLITE_DROP_INDEX;
+ Table *pTab = pIndex->pTable;
+ const char *zDb = db->aDb[pIndex->iDb].zName;
+ const char *zTab = SCHEMA_TABLE(pIndex->iDb);
+ if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
+ goto exit_drop_index;
+ }
+ if( !OMIT_TEMPDB && pIndex->iDb ) code = SQLITE_DROP_TEMP_INDEX;
+ if( sqlite3AuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){
+ goto exit_drop_index;
+ }
+ }
+#endif
+
+ /* Generate code to remove the index and from the master table */
+ v = sqlite3GetVdbe(pParse);
+ if( v ){
+ int iDb = pIndex->iDb;
+ sqlite3NestedParse(pParse,
+ "DELETE FROM %Q.%s WHERE name=%Q",
+ db->aDb[iDb].zName, SCHEMA_TABLE(iDb),
+ pIndex->zName
+ );
+ sqlite3ChangeCookie(db, v, iDb);
+ destroyRootPage(pParse, pIndex->tnum, iDb);
+ sqlite3VdbeOp3(v, OP_DropIndex, iDb, 0, pIndex->zName, 0);
+ }
+
+exit_drop_index:
+ sqlite3SrcListDelete(pName);
+}
+
+/*
+** ppArray points into a structure where there is an array pointer
+** followed by two integers. The first integer is the
+** number of elements in the structure array. The second integer
+** is the number of allocated slots in the array.
+**
+** In other words, the structure looks something like this:
+**
+** struct Example1 {
+** struct subElem *aEntry;
+** int nEntry;
+** int nAlloc;
+** }
+**
+** The pnEntry parameter points to the equivalent of Example1.nEntry.
+**
+** This routine allocates a new slot in the array, zeros it out,
+** and returns its index. If malloc fails a negative number is returned.
+**
+** szEntry is the sizeof of a single array entry. initSize is the
+** number of array entries allocated on the initial allocation.
+*/
+int sqlite3ArrayAllocate(void **ppArray, int szEntry, int initSize){
+ char *p;
+ int *an = (int*)&ppArray[1];
+ if( an[0]>=an[1] ){
+ void *pNew;
+ int newSize;
+ newSize = an[1]*2 + initSize;
+ pNew = sqliteRealloc(*ppArray, newSize*szEntry);
+ if( pNew==0 ){
+ return -1;
+ }
+ an[1] = newSize;
+ *ppArray = pNew;
+ }
+ p = *ppArray;
+ memset(&p[an[0]*szEntry], 0, szEntry);
+ return an[0]++;
+}
+
+/*
+** Append a new element to the given IdList. Create a new IdList if
+** need be.
+**
+** A new IdList is returned, or NULL if malloc() fails.
+*/
+IdList *sqlite3IdListAppend(IdList *pList, Token *pToken){
+ int i;
+ if( pList==0 ){
+ pList = sqliteMalloc( sizeof(IdList) );
+ if( pList==0 ) return 0;
+ pList->nAlloc = 0;
+ }
+ i = sqlite3ArrayAllocate((void**)&pList->a, sizeof(pList->a[0]), 5);
+ if( i<0 ){
+ sqlite3IdListDelete(pList);
+ return 0;
+ }
+ pList->a[i].zName = sqlite3NameFromToken(pToken);
+ return pList;
+}
+
+/*
+** Delete an IdList.
+*/
+void sqlite3IdListDelete(IdList *pList){
+ int i;
+ if( pList==0 ) return;
+ for(i=0; i<pList->nId; i++){
+ sqliteFree(pList->a[i].zName);
+ }
+ sqliteFree(pList->a);
+ sqliteFree(pList);
+}
+
+/*
+** Return the index in pList of the identifier named zId. Return -1
+** if not found.
+*/
+int sqlite3IdListIndex(IdList *pList, const char *zName){
+ int i;
+ if( pList==0 ) return -1;
+ for(i=0; i<pList->nId; i++){
+ if( sqlite3StrICmp(pList->a[i].zName, zName)==0 ) return i;
+ }
+ return -1;
+}
+
+/*
+** Append a new table name to the given SrcList. Create a new SrcList if
+** need be. A new entry is created in the SrcList even if pToken is NULL.
+**
+** A new SrcList is returned, or NULL if malloc() fails.
+**
+** If pDatabase is not null, it means that the table has an optional
+** database name prefix. Like this: "database.table". The pDatabase
+** points to the table name and the pTable points to the database name.
+** The SrcList.a[].zName field is filled with the table name which might
+** come from pTable (if pDatabase is NULL) or from pDatabase.
+** SrcList.a[].zDatabase is filled with the database name from pTable,
+** or with NULL if no database is specified.
+**
+** In other words, if call like this:
+**
+** sqlite3SrcListAppend(A,B,0);
+**
+** Then B is a table name and the database name is unspecified. If called
+** like this:
+**
+** sqlite3SrcListAppend(A,B,C);
+**
+** Then C is the table name and B is the database name.
+*/
+SrcList *sqlite3SrcListAppend(SrcList *pList, Token *pTable, Token *pDatabase){
+ struct SrcList_item *pItem;
+ if( pList==0 ){
+ pList = sqliteMalloc( sizeof(SrcList) );
+ if( pList==0 ) return 0;
+ pList->nAlloc = 1;
+ }
+ if( pList->nSrc>=pList->nAlloc ){
+ SrcList *pNew;
+ pList->nAlloc *= 2;
+ pNew = sqliteRealloc(pList,
+ sizeof(*pList) + (pList->nAlloc-1)*sizeof(pList->a[0]) );
+ if( pNew==0 ){
+ sqlite3SrcListDelete(pList);
+ return 0;
+ }
+ pList = pNew;
+ }
+ pItem = &pList->a[pList->nSrc];
+ memset(pItem, 0, sizeof(pList->a[0]));
+ if( pDatabase && pDatabase->z==0 ){
+ pDatabase = 0;
+ }
+ if( pDatabase && pTable ){
+ Token *pTemp = pDatabase;
+ pDatabase = pTable;
+ pTable = pTemp;
+ }
+ pItem->zName = sqlite3NameFromToken(pTable);
+ pItem->zDatabase = sqlite3NameFromToken(pDatabase);
+ pItem->iCursor = -1;
+ pList->nSrc++;
+ return pList;
+}
+
+/*
+** Assign cursors to all tables in a SrcList
+*/
+void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
+ int i;
+ struct SrcList_item *pItem;
+ for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
+ if( pItem->iCursor>=0 ) break;
+ pItem->iCursor = pParse->nTab++;
+ if( pItem->pSelect ){
+ sqlite3SrcListAssignCursors(pParse, pItem->pSelect->pSrc);
+ }
+ }
+}
+
+/*
+** Add an alias to the last identifier on the given identifier list.
+*/
+void sqlite3SrcListAddAlias(SrcList *pList, Token *pToken){
+ if( pList && pList->nSrc>0 ){
+ pList->a[pList->nSrc-1].zAlias = sqlite3NameFromToken(pToken);
+ }
+}
+
+/*
+** Delete an entire SrcList including all its substructure.
+*/
+void sqlite3SrcListDelete(SrcList *pList){
+ int i;
+ struct SrcList_item *pItem;
+ if( pList==0 ) return;
+ for(pItem=pList->a, i=0; i<pList->nSrc; i++, pItem++){
+ sqliteFree(pItem->zDatabase);
+ sqliteFree(pItem->zName);
+ sqliteFree(pItem->zAlias);
+ sqlite3DeleteTable(0, pItem->pTab);
+ sqlite3SelectDelete(pItem->pSelect);
+ sqlite3ExprDelete(pItem->pOn);
+ sqlite3IdListDelete(pItem->pUsing);
+ }
+ sqliteFree(pList);
+}
+
+/*
+** Begin a transaction
+*/
+void sqlite3BeginTransaction(Parse *pParse, int type){
+ sqlite3 *db;
+ Vdbe *v;
+ int i;
+
+ if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return;
+ if( pParse->nErr || sqlite3_malloc_failed ) return;
+ if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ) return;
+
+ v = sqlite3GetVdbe(pParse);
+ if( !v ) return;
+ if( type!=TK_DEFERRED ){
+ for(i=0; i<db->nDb; i++){
+ sqlite3VdbeAddOp(v, OP_Transaction, i, (type==TK_EXCLUSIVE)+1);
+ }
+ }
+ sqlite3VdbeAddOp(v, OP_AutoCommit, 0, 0);
+}
+
+/*
+** Commit a transaction
+*/
+void sqlite3CommitTransaction(Parse *pParse){
+ sqlite3 *db;
+ Vdbe *v;
+
+ if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return;
+ if( pParse->nErr || sqlite3_malloc_failed ) return;
+ if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "COMMIT", 0, 0) ) return;
+
+ v = sqlite3GetVdbe(pParse);
+ if( v ){
+ sqlite3VdbeAddOp(v, OP_AutoCommit, 1, 0);
+ }
+}
+
+/*
+** Rollback a transaction
+*/
+void sqlite3RollbackTransaction(Parse *pParse){
+ sqlite3 *db;
+ Vdbe *v;
+
+ if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return;
+ if( pParse->nErr || sqlite3_malloc_failed ) return;
+ if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "ROLLBACK", 0, 0) ) return;
+
+ v = sqlite3GetVdbe(pParse);
+ if( v ){
+ sqlite3VdbeAddOp(v, OP_AutoCommit, 1, 1);
+ }
+}
+
+/*
+** Make sure the TEMP database is open and available for use. Return
+** the number of errors. Leave any error messages in the pParse structure.
+*/
+static int sqlite3OpenTempDatabase(Parse *pParse){
+ sqlite3 *db = pParse->db;
+ if( db->aDb[1].pBt==0 && !pParse->explain ){
+ int rc = sqlite3BtreeFactory(db, 0, 0, MAX_PAGES, &db->aDb[1].pBt);
+ if( rc!=SQLITE_OK ){
+ sqlite3ErrorMsg(pParse, "unable to open a temporary database "
+ "file for storing temporary tables");
+ pParse->rc = rc;
+ return 1;
+ }
+ if( db->flags & !db->autoCommit ){
+ rc = sqlite3BtreeBeginTrans(db->aDb[1].pBt, 1);
+ if( rc!=SQLITE_OK ){
+ sqlite3ErrorMsg(pParse, "unable to get a write lock on "
+ "the temporary database file");
+ pParse->rc = rc;
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+/*
+** Generate VDBE code that will verify the schema cookie and start
+** a read-transaction for all named database files.
+**
+** It is important that all schema cookies be verified and all
+** read transactions be started before anything else happens in
+** the VDBE program. But this routine can be called after much other
+** code has been generated. So here is what we do:
+**
+** The first time this routine is called, we code an OP_Goto that
+** will jump to a subroutine at the end of the program. Then we
+** record every database that needs its schema verified in the
+** pParse->cookieMask field. Later, after all other code has been
+** generated, the subroutine that does the cookie verifications and
+** starts the transactions will be coded and the OP_Goto P2 value
+** will be made to point to that subroutine. The generation of the
+** cookie verification subroutine code happens in sqlite3FinishCoding().
+**
+** If iDb<0 then code the OP_Goto only - don't set flag to verify the
+** schema on any databases. This can be used to position the OP_Goto
+** early in the code, before we know if any database tables will be used.
+*/
+void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
+ sqlite3 *db;
+ Vdbe *v;
+ int mask;
+
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) return; /* This only happens if there was a prior error */
+ db = pParse->db;
+ if( pParse->cookieGoto==0 ){
+ pParse->cookieGoto = sqlite3VdbeAddOp(v, OP_Goto, 0, 0)+1;
+ }
+ if( iDb>=0 ){
+ assert( iDb<db->nDb );
+ assert( db->aDb[iDb].pBt!=0 || iDb==1 );
+ assert( iDb<32 );
+ mask = 1<<iDb;
+ if( (pParse->cookieMask & mask)==0 ){
+ pParse->cookieMask |= mask;
+ pParse->cookieValue[iDb] = db->aDb[iDb].schema_cookie;
+ if( !OMIT_TEMPDB && iDb==1 ){
+ sqlite3OpenTempDatabase(pParse);
+ }
+ }
+ }
+}
+
+/*
+** Generate VDBE code that prepares for doing an operation that
+** might change the database.
+**
+** This routine starts a new transaction if we are not already within
+** a transaction. If we are already within a transaction, then a checkpoint
+** is set if the setStatement parameter is true. A checkpoint should
+** be set for operations that might fail (due to a constraint) part of
+** the way through and which will need to undo some writes without having to
+** rollback the whole transaction. For operations where all constraints
+** can be checked before any changes are made to the database, it is never
+** necessary to undo a write and the checkpoint should not be set.
+**
+** Only database iDb and the temp database are made writable by this call.
+** If iDb==0, then the main and temp databases are made writable. If
+** iDb==1 then only the temp database is made writable. If iDb>1 then the
+** specified auxiliary database and the temp database are made writable.
+*/
+void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ if( v==0 ) return;
+ sqlite3CodeVerifySchema(pParse, iDb);
+ pParse->writeMask |= 1<<iDb;
+ if( setStatement && pParse->nested==0 ){
+ sqlite3VdbeAddOp(v, OP_Statement, iDb, 0);
+ }
+ if( (OMIT_TEMPDB || iDb!=1) && pParse->db->aDb[1].pBt!=0 ){
+ sqlite3BeginWriteOperation(pParse, setStatement, 1);
+ }
+}
+
+/*
+** Check to see if pIndex uses the collating sequence pColl. Return
+** true if it does and false if it does not.
+*/
+#ifndef SQLITE_OMIT_REINDEX
+static int collationMatch(CollSeq *pColl, Index *pIndex){
+ int n = pIndex->keyInfo.nField;
+ CollSeq **pp = pIndex->keyInfo.aColl;
+ while( n-- ){
+ if( *pp==pColl ) return 1;
+ pp++;
+ }
+ return 0;
+}
+#endif
+
+/*
+** Recompute all indices of pTab that use the collating sequence pColl.
+** If pColl==0 then recompute all indices of pTab.
+*/
+#ifndef SQLITE_OMIT_REINDEX
+static void reindexTable(Parse *pParse, Table *pTab, CollSeq *pColl){
+ Index *pIndex; /* An index associated with pTab */
+
+ for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){
+ if( pColl==0 || collationMatch(pColl,pIndex) ){
+ sqlite3BeginWriteOperation(pParse, 0, pTab->iDb);
+ sqlite3RefillIndex(pParse, pIndex, -1);
+ }
+ }
+}
+#endif
+
+/*
+** Recompute all indices of all tables in all databases where the
+** indices use the collating sequence pColl. If pColl==0 then recompute
+** all indices everywhere.
+*/
+#ifndef SQLITE_OMIT_REINDEX
+static void reindexDatabases(Parse *pParse, CollSeq *pColl){
+ Db *pDb; /* A single database */
+ int iDb; /* The database index number */
+ sqlite3 *db = pParse->db; /* The database connection */
+ HashElem *k; /* For looping over tables in pDb */
+ Table *pTab; /* A table in the database */
+
+ for(iDb=0, pDb=db->aDb; iDb<db->nDb; iDb++, pDb++){
+ if( pDb==0 ) continue;
+ for(k=sqliteHashFirst(&pDb->tblHash); k; k=sqliteHashNext(k)){
+ pTab = (Table*)sqliteHashData(k);
+ reindexTable(pParse, pTab, pColl);
+ }
+ }
+}
+#endif
+
+/*
+** Generate code for the REINDEX command.
+**
+** REINDEX -- 1
+** REINDEX <collation> -- 2
+** REINDEX ?<database>.?<tablename> -- 3
+** REINDEX ?<database>.?<indexname> -- 4
+**
+** Form 1 causes all indices in all attached databases to be rebuilt.
+** Form 2 rebuilds all indices in all databases that use the named
+** collating function. Forms 3 and 4 rebuild the named index or all
+** indices associated with the named table.
+*/
+#ifndef SQLITE_OMIT_REINDEX
+void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){
+ CollSeq *pColl; /* Collating sequence to be reindexed, or NULL */
+ char *z; /* Name of a table or index */
+ const char *zDb; /* Name of the database */
+ Table *pTab; /* A table in the database */
+ Index *pIndex; /* An index associated with pTab */
+ int iDb; /* The database index number */
+ sqlite3 *db = pParse->db; /* The database connection */
+ Token *pObjName; /* Name of the table or index to be reindexed */
+
+ /* Read the database schema. If an error occurs, leave an error message
+ ** and code in pParse and return NULL. */
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ return;
+ }
+
+ if( pName1==0 || pName1->z==0 ){
+ reindexDatabases(pParse, 0);
+ return;
+ }else if( pName2==0 || pName2->z==0 ){
+ pColl = sqlite3FindCollSeq(db, db->enc, pName1->z, pName1->n, 0);
+ if( pColl ){
+ reindexDatabases(pParse, pColl);
+ return;
+ }
+ }
+ iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pObjName);
+ if( iDb<0 ) return;
+ z = sqlite3NameFromToken(pObjName);
+ zDb = db->aDb[iDb].zName;
+ pTab = sqlite3FindTable(db, z, zDb);
+ if( pTab ){
+ reindexTable(pParse, pTab, 0);
+ sqliteFree(z);
+ return;
+ }
+ pIndex = sqlite3FindIndex(db, z, zDb);
+ sqliteFree(z);
+ if( pIndex ){
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+ sqlite3RefillIndex(pParse, pIndex, -1);
+ return;
+ }
+ sqlite3ErrorMsg(pParse, "unable to identify the object to be reindexed");
+}
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/callback.c b/ext/pdo_sqlite/sqlite/src/callback.c
new file mode 100644
index 000000000..5673b8d61
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/callback.c
@@ -0,0 +1,305 @@
+/*
+** 2005 May 23
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This file contains functions used to access the internal hash tables
+** of user defined functions and collation sequences.
+**
+** $Id: callback.c,v 1.1.2.2 2005/09/26 19:33:24 iliaa Exp $
+*/
+
+#include "sqliteInt.h"
+
+/*
+** Invoke the 'collation needed' callback to request a collation sequence
+** in the database text encoding of name zName, length nName.
+** If the collation sequence
+*/
+static void callCollNeeded(sqlite3 *db, const char *zName, int nName){
+ assert( !db->xCollNeeded || !db->xCollNeeded16 );
+ if( nName<0 ) nName = strlen(zName);
+ if( db->xCollNeeded ){
+ char *zExternal = sqliteStrNDup(zName, nName);
+ if( !zExternal ) return;
+ db->xCollNeeded(db->pCollNeededArg, db, (int)db->enc, zExternal);
+ sqliteFree(zExternal);
+ }
+#ifndef SQLITE_OMIT_UTF16
+ if( db->xCollNeeded16 ){
+ char const *zExternal;
+ sqlite3_value *pTmp = sqlite3GetTransientValue(db);
+ sqlite3ValueSetStr(pTmp, -1, zName, SQLITE_UTF8, SQLITE_STATIC);
+ zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);
+ if( !zExternal ) return;
+ db->xCollNeeded16(db->pCollNeededArg, db, (int)db->enc, zExternal);
+ }
+#endif
+}
+
+/*
+** This routine is called if the collation factory fails to deliver a
+** collation function in the best encoding but there may be other versions
+** of this collation function (for other text encodings) available. Use one
+** of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if
+** possible.
+*/
+static int synthCollSeq(sqlite3 *db, CollSeq *pColl){
+ CollSeq *pColl2;
+ char *z = pColl->zName;
+ int n = strlen(z);
+ int i;
+ static const u8 aEnc[] = { SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8 };
+ for(i=0; i<3; i++){
+ pColl2 = sqlite3FindCollSeq(db, aEnc[i], z, n, 0);
+ if( pColl2->xCmp!=0 ){
+ memcpy(pColl, pColl2, sizeof(CollSeq));
+ return SQLITE_OK;
+ }
+ }
+ return SQLITE_ERROR;
+}
+
+/*
+** This function is responsible for invoking the collation factory callback
+** or substituting a collation sequence of a different encoding when the
+** requested collation sequence is not available in the database native
+** encoding.
+**
+** If it is not NULL, then pColl must point to the database native encoding
+** collation sequence with name zName, length nName.
+**
+** The return value is either the collation sequence to be used in database
+** db for collation type name zName, length nName, or NULL, if no collation
+** sequence can be found.
+*/
+CollSeq *sqlite3GetCollSeq(
+ sqlite3* db,
+ CollSeq *pColl,
+ const char *zName,
+ int nName
+){
+ CollSeq *p;
+
+ p = pColl;
+ if( !p ){
+ p = sqlite3FindCollSeq(db, db->enc, zName, nName, 0);
+ }
+ if( !p || !p->xCmp ){
+ /* No collation sequence of this type for this encoding is registered.
+ ** Call the collation factory to see if it can supply us with one.
+ */
+ callCollNeeded(db, zName, nName);
+ p = sqlite3FindCollSeq(db, db->enc, zName, nName, 0);
+ }
+ if( p && !p->xCmp && synthCollSeq(db, p) ){
+ p = 0;
+ }
+ assert( !p || p->xCmp );
+ return p;
+}
+
+/*
+** This routine is called on a collation sequence before it is used to
+** check that it is defined. An undefined collation sequence exists when
+** a database is loaded that contains references to collation sequences
+** that have not been defined by sqlite3_create_collation() etc.
+**
+** If required, this routine calls the 'collation needed' callback to
+** request a definition of the collating sequence. If this doesn't work,
+** an equivalent collating sequence that uses a text encoding different
+** from the main database is substituted, if one is available.
+*/
+int sqlite3CheckCollSeq(Parse *pParse, CollSeq *pColl){
+ if( pColl ){
+ const char *zName = pColl->zName;
+ CollSeq *p = sqlite3GetCollSeq(pParse->db, pColl, zName, -1);
+ if( !p ){
+ if( pParse->nErr==0 ){
+ sqlite3ErrorMsg(pParse, "no such collation sequence: %s", zName);
+ }
+ pParse->nErr++;
+ return SQLITE_ERROR;
+ }
+ }
+ return SQLITE_OK;
+}
+
+
+
+/*
+** Locate and return an entry from the db.aCollSeq hash table. If the entry
+** specified by zName and nName is not found and parameter 'create' is
+** true, then create a new entry. Otherwise return NULL.
+**
+** Each pointer stored in the sqlite3.aCollSeq hash table contains an
+** array of three CollSeq structures. The first is the collation sequence
+** prefferred for UTF-8, the second UTF-16le, and the third UTF-16be.
+**
+** Stored immediately after the three collation sequences is a copy of
+** the collation sequence name. A pointer to this string is stored in
+** each collation sequence structure.
+*/
+static CollSeq *findCollSeqEntry(
+ sqlite3 *db,
+ const char *zName,
+ int nName,
+ int create
+){
+ CollSeq *pColl;
+ if( nName<0 ) nName = strlen(zName);
+ pColl = sqlite3HashFind(&db->aCollSeq, zName, nName);
+
+ if( 0==pColl && create ){
+ pColl = sqliteMalloc( 3*sizeof(*pColl) + nName + 1 );
+ if( pColl ){
+ CollSeq *pDel = 0;
+ pColl[0].zName = (char*)&pColl[3];
+ pColl[0].enc = SQLITE_UTF8;
+ pColl[1].zName = (char*)&pColl[3];
+ pColl[1].enc = SQLITE_UTF16LE;
+ pColl[2].zName = (char*)&pColl[3];
+ pColl[2].enc = SQLITE_UTF16BE;
+ memcpy(pColl[0].zName, zName, nName);
+ pColl[0].zName[nName] = 0;
+ pDel = sqlite3HashInsert(&db->aCollSeq, pColl[0].zName, nName, pColl);
+
+ /* If a malloc() failure occured in sqlite3HashInsert(), it will
+ ** return the pColl pointer to be deleted (because it wasn't added
+ ** to the hash table).
+ */
+ assert( !pDel || (sqlite3_malloc_failed && pDel==pColl) );
+ sqliteFree(pDel);
+ }
+ }
+ return pColl;
+}
+
+/*
+** Parameter zName points to a UTF-8 encoded string nName bytes long.
+** Return the CollSeq* pointer for the collation sequence named zName
+** for the encoding 'enc' from the database 'db'.
+**
+** If the entry specified is not found and 'create' is true, then create a
+** new entry. Otherwise return NULL.
+*/
+CollSeq *sqlite3FindCollSeq(
+ sqlite3 *db,
+ u8 enc,
+ const char *zName,
+ int nName,
+ int create
+){
+ CollSeq *pColl = findCollSeqEntry(db, zName, nName, create);
+ assert( SQLITE_UTF8==1 && SQLITE_UTF16LE==2 && SQLITE_UTF16BE==3 );
+ assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE );
+ if( pColl ) pColl += enc-1;
+ return pColl;
+}
+
+/*
+** Locate a user function given a name, a number of arguments and a flag
+** indicating whether the function prefers UTF-16 over UTF-8. Return a
+** pointer to the FuncDef structure that defines that function, or return
+** NULL if the function does not exist.
+**
+** If the createFlag argument is true, then a new (blank) FuncDef
+** structure is created and liked into the "db" structure if a
+** no matching function previously existed. When createFlag is true
+** and the nArg parameter is -1, then only a function that accepts
+** any number of arguments will be returned.
+**
+** If createFlag is false and nArg is -1, then the first valid
+** function found is returned. A function is valid if either xFunc
+** or xStep is non-zero.
+**
+** If createFlag is false, then a function with the required name and
+** number of arguments may be returned even if the eTextRep flag does not
+** match that requested.
+*/
+FuncDef *sqlite3FindFunction(
+ sqlite3 *db, /* An open database */
+ const char *zName, /* Name of the function. Not null-terminated */
+ int nName, /* Number of characters in the name */
+ int nArg, /* Number of arguments. -1 means any number */
+ u8 enc, /* Preferred text encoding */
+ int createFlag /* Create new entry if true and does not otherwise exist */
+){
+ FuncDef *p; /* Iterator variable */
+ FuncDef *pFirst; /* First function with this name */
+ FuncDef *pBest = 0; /* Best match found so far */
+ int bestmatch = 0;
+
+
+ assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
+ if( nArg<-1 ) nArg = -1;
+
+ pFirst = (FuncDef*)sqlite3HashFind(&db->aFunc, zName, nName);
+ for(p=pFirst; p; p=p->pNext){
+ /* During the search for the best function definition, bestmatch is set
+ ** as follows to indicate the quality of the match with the definition
+ ** pointed to by pBest:
+ **
+ ** 0: pBest is NULL. No match has been found.
+ ** 1: A variable arguments function that prefers UTF-8 when a UTF-16
+ ** encoding is requested, or vice versa.
+ ** 2: A variable arguments function that uses UTF-16BE when UTF-16LE is
+ ** requested, or vice versa.
+ ** 3: A variable arguments function using the same text encoding.
+ ** 4: A function with the exact number of arguments requested that
+ ** prefers UTF-8 when a UTF-16 encoding is requested, or vice versa.
+ ** 5: A function with the exact number of arguments requested that
+ ** prefers UTF-16LE when UTF-16BE is requested, or vice versa.
+ ** 6: An exact match.
+ **
+ ** A larger value of 'matchqual' indicates a more desirable match.
+ */
+ if( p->nArg==-1 || p->nArg==nArg || nArg==-1 ){
+ int match = 1; /* Quality of this match */
+ if( p->nArg==nArg || nArg==-1 ){
+ match = 4;
+ }
+ if( enc==p->iPrefEnc ){
+ match += 2;
+ }
+ else if( (enc==SQLITE_UTF16LE && p->iPrefEnc==SQLITE_UTF16BE) ||
+ (enc==SQLITE_UTF16BE && p->iPrefEnc==SQLITE_UTF16LE) ){
+ match += 1;
+ }
+
+ if( match>bestmatch ){
+ pBest = p;
+ bestmatch = match;
+ }
+ }
+ }
+
+ /* If the createFlag parameter is true, and the seach did not reveal an
+ ** exact match for the name, number of arguments and encoding, then add a
+ ** new entry to the hash table and return it.
+ */
+ if( createFlag && bestmatch<6 &&
+ (pBest = sqliteMalloc(sizeof(*pBest)+nName)) ){
+ pBest->nArg = nArg;
+ pBest->pNext = pFirst;
+ pBest->iPrefEnc = enc;
+ memcpy(pBest->zName, zName, nName);
+ pBest->zName[nName] = 0;
+ if( pBest==sqlite3HashInsert(&db->aFunc,pBest->zName,nName,(void*)pBest) ){
+ sqliteFree(pBest);
+ return 0;
+ }
+ }
+
+ if( pBest && (pBest->xStep || pBest->xFunc || createFlag) ){
+ return pBest;
+ }
+ return 0;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/date.c b/ext/pdo_sqlite/sqlite/src/date.c
new file mode 100644
index 000000000..7d398df48
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/date.c
@@ -0,0 +1,996 @@
+/*
+** 2003 October 31
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains the C functions that implement date and time
+** functions for SQLite.
+**
+** There is only one exported symbol in this file - the function
+** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
+** All other code has file scope.
+**
+** $Id$
+**
+** NOTES:
+**
+** SQLite processes all times and dates as Julian Day numbers. The
+** dates and times are stored as the number of days since noon
+** in Greenwich on November 24, 4714 B.C. according to the Gregorian
+** calendar system.
+**
+** 1970-01-01 00:00:00 is JD 2440587.5
+** 2000-01-01 00:00:00 is JD 2451544.5
+**
+** This implemention requires years to be expressed as a 4-digit number
+** which means that only dates between 0000-01-01 and 9999-12-31 can
+** be represented, even though julian day numbers allow a much wider
+** range of dates.
+**
+** The Gregorian calendar system is used for all dates and times,
+** even those that predate the Gregorian calendar. Historians usually
+** use the Julian calendar for dates prior to 1582-10-15 and for some
+** dates afterwards, depending on locale. Beware of this difference.
+**
+** The conversion algorithms are implemented based on descriptions
+** in the following text:
+**
+** Jean Meeus
+** Astronomical Algorithms, 2nd Edition, 1998
+** ISBM 0-943396-61-1
+** Willmann-Bell, Inc
+** Richmond, Virginia (USA)
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <time.h>
+
+#ifndef SQLITE_OMIT_DATETIME_FUNCS
+
+/*
+** A structure for holding a single date and time.
+*/
+typedef struct DateTime DateTime;
+struct DateTime {
+ double rJD; /* The julian day number */
+ int Y, M, D; /* Year, month, and day */
+ int h, m; /* Hour and minutes */
+ int tz; /* Timezone offset in minutes */
+ double s; /* Seconds */
+ char validYMD; /* True if Y,M,D are valid */
+ char validHMS; /* True if h,m,s are valid */
+ char validJD; /* True if rJD is valid */
+ char validTZ; /* True if tz is valid */
+};
+
+
+/*
+** Convert zDate into one or more integers. Additional arguments
+** come in groups of 5 as follows:
+**
+** N number of digits in the integer
+** min minimum allowed value of the integer
+** max maximum allowed value of the integer
+** nextC first character after the integer
+** pVal where to write the integers value.
+**
+** Conversions continue until one with nextC==0 is encountered.
+** The function returns the number of successful conversions.
+*/
+static int getDigits(const char *zDate, ...){
+ va_list ap;
+ int val;
+ int N;
+ int min;
+ int max;
+ int nextC;
+ int *pVal;
+ int cnt = 0;
+ va_start(ap, zDate);
+ do{
+ N = va_arg(ap, int);
+ min = va_arg(ap, int);
+ max = va_arg(ap, int);
+ nextC = va_arg(ap, int);
+ pVal = va_arg(ap, int*);
+ val = 0;
+ while( N-- ){
+ if( !isdigit(*(u8*)zDate) ){
+ return cnt;
+ }
+ val = val*10 + *zDate - '0';
+ zDate++;
+ }
+ if( val<min || val>max || (nextC!=0 && nextC!=*zDate) ){
+ return cnt;
+ }
+ *pVal = val;
+ zDate++;
+ cnt++;
+ }while( nextC );
+ return cnt;
+}
+
+/*
+** Read text from z[] and convert into a floating point number. Return
+** the number of digits converted.
+*/
+#define getValue sqlite3AtoF
+
+/*
+** Parse a timezone extension on the end of a date-time.
+** The extension is of the form:
+**
+** (+/-)HH:MM
+**
+** If the parse is successful, write the number of minutes
+** of change in *pnMin and return 0. If a parser error occurs,
+** return 0.
+**
+** A missing specifier is not considered an error.
+*/
+static int parseTimezone(const char *zDate, DateTime *p){
+ int sgn = 0;
+ int nHr, nMn;
+ while( isspace(*(u8*)zDate) ){ zDate++; }
+ p->tz = 0;
+ if( *zDate=='-' ){
+ sgn = -1;
+ }else if( *zDate=='+' ){
+ sgn = +1;
+ }else{
+ return *zDate!=0;
+ }
+ zDate++;
+ if( getDigits(zDate, 2, 0, 14, ':', &nHr, 2, 0, 59, 0, &nMn)!=2 ){
+ return 1;
+ }
+ zDate += 5;
+ p->tz = sgn*(nMn + nHr*60);
+ while( isspace(*(u8*)zDate) ){ zDate++; }
+ return *zDate!=0;
+}
+
+/*
+** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
+** The HH, MM, and SS must each be exactly 2 digits. The
+** fractional seconds FFFF can be one or more digits.
+**
+** Return 1 if there is a parsing error and 0 on success.
+*/
+static int parseHhMmSs(const char *zDate, DateTime *p){
+ int h, m, s;
+ double ms = 0.0;
+ if( getDigits(zDate, 2, 0, 24, ':', &h, 2, 0, 59, 0, &m)!=2 ){
+ return 1;
+ }
+ zDate += 5;
+ if( *zDate==':' ){
+ zDate++;
+ if( getDigits(zDate, 2, 0, 59, 0, &s)!=1 ){
+ return 1;
+ }
+ zDate += 2;
+ if( *zDate=='.' && isdigit((u8)zDate[1]) ){
+ double rScale = 1.0;
+ zDate++;
+ while( isdigit(*(u8*)zDate) ){
+ ms = ms*10.0 + *zDate - '0';
+ rScale *= 10.0;
+ zDate++;
+ }
+ ms /= rScale;
+ }
+ }else{
+ s = 0;
+ }
+ p->validJD = 0;
+ p->validHMS = 1;
+ p->h = h;
+ p->m = m;
+ p->s = s + ms;
+ if( parseTimezone(zDate, p) ) return 1;
+ p->validTZ = p->tz!=0;
+ return 0;
+}
+
+/*
+** Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume
+** that the YYYY-MM-DD is according to the Gregorian calendar.
+**
+** Reference: Meeus page 61
+*/
+static void computeJD(DateTime *p){
+ int Y, M, D, A, B, X1, X2;
+
+ if( p->validJD ) return;
+ if( p->validYMD ){
+ Y = p->Y;
+ M = p->M;
+ D = p->D;
+ }else{
+ Y = 2000; /* If no YMD specified, assume 2000-Jan-01 */
+ M = 1;
+ D = 1;
+ }
+ if( M<=2 ){
+ Y--;
+ M += 12;
+ }
+ A = Y/100;
+ B = 2 - A + (A/4);
+ X1 = 365.25*(Y+4716);
+ X2 = 30.6001*(M+1);
+ p->rJD = X1 + X2 + D + B - 1524.5;
+ p->validJD = 1;
+ p->validYMD = 0;
+ if( p->validHMS ){
+ p->rJD += (p->h*3600.0 + p->m*60.0 + p->s)/86400.0;
+ if( p->validTZ ){
+ p->rJD += p->tz*60/86400.0;
+ p->validHMS = 0;
+ p->validTZ = 0;
+ }
+ }
+}
+
+/*
+** Parse dates of the form
+**
+** YYYY-MM-DD HH:MM:SS.FFF
+** YYYY-MM-DD HH:MM:SS
+** YYYY-MM-DD HH:MM
+** YYYY-MM-DD
+**
+** Write the result into the DateTime structure and return 0
+** on success and 1 if the input string is not a well-formed
+** date.
+*/
+static int parseYyyyMmDd(const char *zDate, DateTime *p){
+ int Y, M, D, neg;
+
+ if( zDate[0]=='-' ){
+ zDate++;
+ neg = 1;
+ }else{
+ neg = 0;
+ }
+ if( getDigits(zDate,4,0,9999,'-',&Y,2,1,12,'-',&M,2,1,31,0,&D)!=3 ){
+ return 1;
+ }
+ zDate += 10;
+ while( isspace(*(u8*)zDate) || 'T'==*(u8*)zDate ){ zDate++; }
+ if( parseHhMmSs(zDate, p)==0 ){
+ /* We got the time */
+ }else if( *zDate==0 ){
+ p->validHMS = 0;
+ }else{
+ return 1;
+ }
+ p->validJD = 0;
+ p->validYMD = 1;
+ p->Y = neg ? -Y : Y;
+ p->M = M;
+ p->D = D;
+ if( p->validTZ ){
+ computeJD(p);
+ }
+ return 0;
+}
+
+/*
+** Attempt to parse the given string into a Julian Day Number. Return
+** the number of errors.
+**
+** The following are acceptable forms for the input string:
+**
+** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM
+** DDDD.DD
+** now
+**
+** In the first form, the +/-HH:MM is always optional. The fractional
+** seconds extension (the ".FFF") is optional. The seconds portion
+** (":SS.FFF") is option. The year and date can be omitted as long
+** as there is a time string. The time string can be omitted as long
+** as there is a year and date.
+*/
+static int parseDateOrTime(const char *zDate, DateTime *p){
+ memset(p, 0, sizeof(*p));
+ if( parseYyyyMmDd(zDate,p)==0 ){
+ return 0;
+ }else if( parseHhMmSs(zDate, p)==0 ){
+ return 0;
+ }else if( sqlite3StrICmp(zDate,"now")==0){
+ double r;
+ sqlite3OsCurrentTime(&r);
+ p->rJD = r;
+ p->validJD = 1;
+ return 0;
+ }else if( sqlite3IsNumber(zDate, 0, SQLITE_UTF8) ){
+ getValue(zDate, &p->rJD);
+ p->validJD = 1;
+ return 0;
+ }
+ return 1;
+}
+
+/*
+** Compute the Year, Month, and Day from the julian day number.
+*/
+static void computeYMD(DateTime *p){
+ int Z, A, B, C, D, E, X1;
+ if( p->validYMD ) return;
+ if( !p->validJD ){
+ p->Y = 2000;
+ p->M = 1;
+ p->D = 1;
+ }else{
+ Z = p->rJD + 0.5;
+ A = (Z - 1867216.25)/36524.25;
+ A = Z + 1 + A - (A/4);
+ B = A + 1524;
+ C = (B - 122.1)/365.25;
+ D = 365.25*C;
+ E = (B-D)/30.6001;
+ X1 = 30.6001*E;
+ p->D = B - D - X1;
+ p->M = E<14 ? E-1 : E-13;
+ p->Y = p->M>2 ? C - 4716 : C - 4715;
+ }
+ p->validYMD = 1;
+}
+
+/*
+** Compute the Hour, Minute, and Seconds from the julian day number.
+*/
+static void computeHMS(DateTime *p){
+ int Z, s;
+ if( p->validHMS ) return;
+ Z = p->rJD + 0.5;
+ s = (p->rJD + 0.5 - Z)*86400000.0 + 0.5;
+ p->s = 0.001*s;
+ s = p->s;
+ p->s -= s;
+ p->h = s/3600;
+ s -= p->h*3600;
+ p->m = s/60;
+ p->s += s - p->m*60;
+ p->validHMS = 1;
+}
+
+/*
+** Compute both YMD and HMS
+*/
+static void computeYMD_HMS(DateTime *p){
+ computeYMD(p);
+ computeHMS(p);
+}
+
+/*
+** Clear the YMD and HMS and the TZ
+*/
+static void clearYMD_HMS_TZ(DateTime *p){
+ p->validYMD = 0;
+ p->validHMS = 0;
+ p->validTZ = 0;
+}
+
+/*
+** Compute the difference (in days) between localtime and UTC (a.k.a. GMT)
+** for the time value p where p is in UTC.
+*/
+static double localtimeOffset(DateTime *p){
+ DateTime x, y;
+ time_t t;
+ struct tm *pTm;
+ x = *p;
+ computeYMD_HMS(&x);
+ if( x.Y<1971 || x.Y>=2038 ){
+ x.Y = 2000;
+ x.M = 1;
+ x.D = 1;
+ x.h = 0;
+ x.m = 0;
+ x.s = 0.0;
+ } else {
+ int s = x.s + 0.5;
+ x.s = s;
+ }
+ x.tz = 0;
+ x.validJD = 0;
+ computeJD(&x);
+ t = (x.rJD-2440587.5)*86400.0 + 0.5;
+ sqlite3OsEnterMutex();
+ pTm = localtime(&t);
+ y.Y = pTm->tm_year + 1900;
+ y.M = pTm->tm_mon + 1;
+ y.D = pTm->tm_mday;
+ y.h = pTm->tm_hour;
+ y.m = pTm->tm_min;
+ y.s = pTm->tm_sec;
+ sqlite3OsLeaveMutex();
+ y.validYMD = 1;
+ y.validHMS = 1;
+ y.validJD = 0;
+ y.validTZ = 0;
+ computeJD(&y);
+ return y.rJD - x.rJD;
+}
+
+/*
+** Process a modifier to a date-time stamp. The modifiers are
+** as follows:
+**
+** NNN days
+** NNN hours
+** NNN minutes
+** NNN.NNNN seconds
+** NNN months
+** NNN years
+** start of month
+** start of year
+** start of week
+** start of day
+** weekday N
+** unixepoch
+** localtime
+** utc
+**
+** Return 0 on success and 1 if there is any kind of error.
+*/
+static int parseModifier(const char *zMod, DateTime *p){
+ int rc = 1;
+ int n;
+ double r;
+ char *z, zBuf[30];
+ z = zBuf;
+ for(n=0; n<sizeof(zBuf)-1 && zMod[n]; n++){
+ z[n] = tolower(zMod[n]);
+ }
+ z[n] = 0;
+ switch( z[0] ){
+ case 'l': {
+ /* localtime
+ **
+ ** Assuming the current time value is UTC (a.k.a. GMT), shift it to
+ ** show local time.
+ */
+ if( strcmp(z, "localtime")==0 ){
+ computeJD(p);
+ p->rJD += localtimeOffset(p);
+ clearYMD_HMS_TZ(p);
+ rc = 0;
+ }
+ break;
+ }
+ case 'u': {
+ /*
+ ** unixepoch
+ **
+ ** Treat the current value of p->rJD as the number of
+ ** seconds since 1970. Convert to a real julian day number.
+ */
+ if( strcmp(z, "unixepoch")==0 && p->validJD ){
+ p->rJD = p->rJD/86400.0 + 2440587.5;
+ clearYMD_HMS_TZ(p);
+ rc = 0;
+ }else if( strcmp(z, "utc")==0 ){
+ double c1;
+ computeJD(p);
+ c1 = localtimeOffset(p);
+ p->rJD -= c1;
+ clearYMD_HMS_TZ(p);
+ p->rJD += c1 - localtimeOffset(p);
+ rc = 0;
+ }
+ break;
+ }
+ case 'w': {
+ /*
+ ** weekday N
+ **
+ ** Move the date to the same time on the next occurrence of
+ ** weekday N where 0==Sunday, 1==Monday, and so forth. If the
+ ** date is already on the appropriate weekday, this is a no-op.
+ */
+ if( strncmp(z, "weekday ", 8)==0 && getValue(&z[8],&r)>0
+ && (n=r)==r && n>=0 && r<7 ){
+ int Z;
+ computeYMD_HMS(p);
+ p->validTZ = 0;
+ p->validJD = 0;
+ computeJD(p);
+ Z = p->rJD + 1.5;
+ Z %= 7;
+ if( Z>n ) Z -= 7;
+ p->rJD += n - Z;
+ clearYMD_HMS_TZ(p);
+ rc = 0;
+ }
+ break;
+ }
+ case 's': {
+ /*
+ ** start of TTTTT
+ **
+ ** Move the date backwards to the beginning of the current day,
+ ** or month or year.
+ */
+ if( strncmp(z, "start of ", 9)!=0 ) break;
+ z += 9;
+ computeYMD(p);
+ p->validHMS = 1;
+ p->h = p->m = 0;
+ p->s = 0.0;
+ p->validTZ = 0;
+ p->validJD = 0;
+ if( strcmp(z,"month")==0 ){
+ p->D = 1;
+ rc = 0;
+ }else if( strcmp(z,"year")==0 ){
+ computeYMD(p);
+ p->M = 1;
+ p->D = 1;
+ rc = 0;
+ }else if( strcmp(z,"day")==0 ){
+ rc = 0;
+ }
+ break;
+ }
+ case '+':
+ case '-':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': {
+ n = getValue(z, &r);
+ if( n<=0 ) break;
+ if( z[n]==':' ){
+ /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the
+ ** specified number of hours, minutes, seconds, and fractional seconds
+ ** to the time. The ".FFF" may be omitted. The ":SS.FFF" may be
+ ** omitted.
+ */
+ const char *z2 = z;
+ DateTime tx;
+ int day;
+ if( !isdigit(*(u8*)z2) ) z2++;
+ memset(&tx, 0, sizeof(tx));
+ if( parseHhMmSs(z2, &tx) ) break;
+ computeJD(&tx);
+ tx.rJD -= 0.5;
+ day = (int)tx.rJD;
+ tx.rJD -= day;
+ if( z[0]=='-' ) tx.rJD = -tx.rJD;
+ computeJD(p);
+ clearYMD_HMS_TZ(p);
+ p->rJD += tx.rJD;
+ rc = 0;
+ break;
+ }
+ z += n;
+ while( isspace(*(u8*)z) ) z++;
+ n = strlen(z);
+ if( n>10 || n<3 ) break;
+ if( z[n-1]=='s' ){ z[n-1] = 0; n--; }
+ computeJD(p);
+ rc = 0;
+ if( n==3 && strcmp(z,"day")==0 ){
+ p->rJD += r;
+ }else if( n==4 && strcmp(z,"hour")==0 ){
+ p->rJD += r/24.0;
+ }else if( n==6 && strcmp(z,"minute")==0 ){
+ p->rJD += r/(24.0*60.0);
+ }else if( n==6 && strcmp(z,"second")==0 ){
+ p->rJD += r/(24.0*60.0*60.0);
+ }else if( n==5 && strcmp(z,"month")==0 ){
+ int x, y;
+ computeYMD_HMS(p);
+ p->M += r;
+ x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
+ p->Y += x;
+ p->M -= x*12;
+ p->validJD = 0;
+ computeJD(p);
+ y = r;
+ if( y!=r ){
+ p->rJD += (r - y)*30.0;
+ }
+ }else if( n==4 && strcmp(z,"year")==0 ){
+ computeYMD_HMS(p);
+ p->Y += r;
+ p->validJD = 0;
+ computeJD(p);
+ }else{
+ rc = 1;
+ }
+ clearYMD_HMS_TZ(p);
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return rc;
+}
+
+/*
+** Process time function arguments. argv[0] is a date-time stamp.
+** argv[1] and following are modifiers. Parse them all and write
+** the resulting time into the DateTime structure p. Return 0
+** on success and 1 if there are any errors.
+*/
+static int isDate(int argc, sqlite3_value **argv, DateTime *p){
+ int i;
+ if( argc==0 ) return 1;
+ if( SQLITE_NULL==sqlite3_value_type(argv[0]) ||
+ parseDateOrTime(sqlite3_value_text(argv[0]), p) ) return 1;
+ for(i=1; i<argc; i++){
+ if( SQLITE_NULL==sqlite3_value_type(argv[i]) ||
+ parseModifier(sqlite3_value_text(argv[i]), p) ) return 1;
+ }
+ return 0;
+}
+
+
+/*
+** The following routines implement the various date and time functions
+** of SQLite.
+*/
+
+/*
+** julianday( TIMESTRING, MOD, MOD, ...)
+**
+** Return the julian day number of the date specified in the arguments
+*/
+static void juliandayFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ if( isDate(argc, argv, &x)==0 ){
+ computeJD(&x);
+ sqlite3_result_double(context, x.rJD);
+ }
+}
+
+/*
+** datetime( TIMESTRING, MOD, MOD, ...)
+**
+** Return YYYY-MM-DD HH:MM:SS
+*/
+static void datetimeFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ if( isDate(argc, argv, &x)==0 ){
+ char zBuf[100];
+ computeYMD_HMS(&x);
+ sprintf(zBuf, "%04d-%02d-%02d %02d:%02d:%02d",x.Y, x.M, x.D, x.h, x.m,
+ (int)(x.s));
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
+ }
+}
+
+/*
+** time( TIMESTRING, MOD, MOD, ...)
+**
+** Return HH:MM:SS
+*/
+static void timeFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ if( isDate(argc, argv, &x)==0 ){
+ char zBuf[100];
+ computeHMS(&x);
+ sprintf(zBuf, "%02d:%02d:%02d", x.h, x.m, (int)x.s);
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
+ }
+}
+
+/*
+** date( TIMESTRING, MOD, MOD, ...)
+**
+** Return YYYY-MM-DD
+*/
+static void dateFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ if( isDate(argc, argv, &x)==0 ){
+ char zBuf[100];
+ computeYMD(&x);
+ sprintf(zBuf, "%04d-%02d-%02d", x.Y, x.M, x.D);
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
+ }
+}
+
+/*
+** strftime( FORMAT, TIMESTRING, MOD, MOD, ...)
+**
+** Return a string described by FORMAT. Conversions as follows:
+**
+** %d day of month
+** %f ** fractional seconds SS.SSS
+** %H hour 00-24
+** %j day of year 000-366
+** %J ** Julian day number
+** %m month 01-12
+** %M minute 00-59
+** %s seconds since 1970-01-01
+** %S seconds 00-59
+** %w day of week 0-6 sunday==0
+** %W week of year 00-53
+** %Y year 0000-9999
+** %% %
+*/
+static void strftimeFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ int n, i, j;
+ char *z;
+ const char *zFmt = sqlite3_value_text(argv[0]);
+ char zBuf[100];
+ if( zFmt==0 || isDate(argc-1, argv+1, &x) ) return;
+ for(i=0, n=1; zFmt[i]; i++, n++){
+ if( zFmt[i]=='%' ){
+ switch( zFmt[i+1] ){
+ case 'd':
+ case 'H':
+ case 'm':
+ case 'M':
+ case 'S':
+ case 'W':
+ n++;
+ /* fall thru */
+ case 'w':
+ case '%':
+ break;
+ case 'f':
+ n += 8;
+ break;
+ case 'j':
+ n += 3;
+ break;
+ case 'Y':
+ n += 8;
+ break;
+ case 's':
+ case 'J':
+ n += 50;
+ break;
+ default:
+ return; /* ERROR. return a NULL */
+ }
+ i++;
+ }
+ }
+ if( n<sizeof(zBuf) ){
+ z = zBuf;
+ }else{
+ z = sqliteMalloc( n );
+ if( z==0 ) return;
+ }
+ computeJD(&x);
+ computeYMD_HMS(&x);
+ for(i=j=0; zFmt[i]; i++){
+ if( zFmt[i]!='%' ){
+ z[j++] = zFmt[i];
+ }else{
+ i++;
+ switch( zFmt[i] ){
+ case 'd': sprintf(&z[j],"%02d",x.D); j+=2; break;
+ case 'f': {
+ int s = x.s;
+ int ms = (x.s - s)*1000.0;
+ sprintf(&z[j],"%02d.%03d",s,ms);
+ j += strlen(&z[j]);
+ break;
+ }
+ case 'H': sprintf(&z[j],"%02d",x.h); j+=2; break;
+ case 'W': /* Fall thru */
+ case 'j': {
+ int n; /* Number of days since 1st day of year */
+ DateTime y = x;
+ y.validJD = 0;
+ y.M = 1;
+ y.D = 1;
+ computeJD(&y);
+ n = x.rJD - y.rJD;
+ if( zFmt[i]=='W' ){
+ int wd; /* 0=Monday, 1=Tuesday, ... 6=Sunday */
+ wd = ((int)(x.rJD+0.5)) % 7;
+ sprintf(&z[j],"%02d",(n+7-wd)/7);
+ j += 2;
+ }else{
+ sprintf(&z[j],"%03d",n+1);
+ j += 3;
+ }
+ break;
+ }
+ case 'J': sprintf(&z[j],"%.16g",x.rJD); j+=strlen(&z[j]); break;
+ case 'm': sprintf(&z[j],"%02d",x.M); j+=2; break;
+ case 'M': sprintf(&z[j],"%02d",x.m); j+=2; break;
+ case 's': {
+ sprintf(&z[j],"%d",(int)((x.rJD-2440587.5)*86400.0 + 0.5));
+ j += strlen(&z[j]);
+ break;
+ }
+ case 'S': sprintf(&z[j],"%02d",(int)(x.s+0.5)); j+=2; break;
+ case 'w': z[j++] = (((int)(x.rJD+1.5)) % 7) + '0'; break;
+ case 'Y': sprintf(&z[j],"%04d",x.Y); j+=strlen(&z[j]); break;
+ case '%': z[j++] = '%'; break;
+ }
+ }
+ }
+ z[j] = 0;
+ sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT);
+ if( z!=zBuf ){
+ sqliteFree(z);
+ }
+}
+
+/*
+** current_time()
+**
+** This function returns the same value as time('now').
+*/
+static void ctimeFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ sqlite3_value *pVal = sqlite3ValueNew();
+ if( pVal ){
+ sqlite3ValueSetStr(pVal, -1, "now", SQLITE_UTF8, SQLITE_STATIC);
+ timeFunc(context, 1, &pVal);
+ sqlite3ValueFree(pVal);
+ }
+}
+
+/*
+** current_date()
+**
+** This function returns the same value as date('now').
+*/
+static void cdateFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ sqlite3_value *pVal = sqlite3ValueNew();
+ if( pVal ){
+ sqlite3ValueSetStr(pVal, -1, "now", SQLITE_UTF8, SQLITE_STATIC);
+ dateFunc(context, 1, &pVal);
+ sqlite3ValueFree(pVal);
+ }
+}
+
+/*
+** current_timestamp()
+**
+** This function returns the same value as datetime('now').
+*/
+static void ctimestampFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ sqlite3_value *pVal = sqlite3ValueNew();
+ if( pVal ){
+ sqlite3ValueSetStr(pVal, -1, "now", SQLITE_UTF8, SQLITE_STATIC);
+ datetimeFunc(context, 1, &pVal);
+ sqlite3ValueFree(pVal);
+ }
+}
+#endif /* !defined(SQLITE_OMIT_DATETIME_FUNCS) */
+
+#ifdef SQLITE_OMIT_DATETIME_FUNCS
+/*
+** If the library is compiled to omit the full-scale date and time
+** handling (to get a smaller binary), the following minimal version
+** of the functions current_time(), current_date() and current_timestamp()
+** are included instead. This is to support column declarations that
+** include "DEFAULT CURRENT_TIME" etc.
+**
+** This function uses the C-library functions time(), gmtime()
+** and strftime(). The format string to pass to strftime() is supplied
+** as the user-data for the function.
+*/
+static void currentTimeFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ time_t t;
+ char *zFormat = (char *)sqlite3_user_data(context);
+ char zBuf[20];
+
+ time(&t);
+#ifdef SQLITE_TEST
+ {
+ extern int sqlite3_current_time; /* See os_XXX.c */
+ if( sqlite3_current_time ){
+ t = sqlite3_current_time;
+ }
+ }
+#endif
+
+ sqlite3OsEnterMutex();
+ strftime(zBuf, 20, zFormat, gmtime(&t));
+ sqlite3OsLeaveMutex();
+
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
+}
+#endif
+
+/*
+** This function registered all of the above C functions as SQL
+** functions. This should be the only routine in this file with
+** external linkage.
+*/
+void sqlite3RegisterDateTimeFunctions(sqlite3 *db){
+#ifndef SQLITE_OMIT_DATETIME_FUNCS
+ static const struct {
+ char *zName;
+ int nArg;
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**);
+ } aFuncs[] = {
+ { "julianday", -1, juliandayFunc },
+ { "date", -1, dateFunc },
+ { "time", -1, timeFunc },
+ { "datetime", -1, datetimeFunc },
+ { "strftime", -1, strftimeFunc },
+ { "current_time", 0, ctimeFunc },
+ { "current_timestamp", 0, ctimestampFunc },
+ { "current_date", 0, cdateFunc },
+ };
+ int i;
+
+ for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
+ sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg,
+ SQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0);
+ }
+#else
+ static const struct {
+ char *zName;
+ char *zFormat;
+ } aFuncs[] = {
+ { "current_time", "%H:%M:%S" },
+ { "current_date", "%Y-%m-%d" },
+ { "current_timestamp", "%Y-%m-%d %H:%M:%S" }
+ };
+ int i;
+
+ for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
+ sqlite3_create_function(db, aFuncs[i].zName, 0, SQLITE_UTF8,
+ aFuncs[i].zFormat, currentTimeFunc, 0, 0);
+ }
+#endif
+}
diff --git a/ext/pdo_sqlite/sqlite/src/delete.c b/ext/pdo_sqlite/sqlite/src/delete.c
new file mode 100644
index 000000000..7eb618b78
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/delete.c
@@ -0,0 +1,445 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains C code routines that are called by the parser
+** in order to generate code for DELETE FROM statements.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+
+/*
+** Look up every table that is named in pSrc. If any table is not found,
+** add an error message to pParse->zErrMsg and return NULL. If all tables
+** are found, return a pointer to the last table.
+*/
+Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
+ Table *pTab = 0;
+ int i;
+ struct SrcList_item *pItem;
+ for(i=0, pItem=pSrc->a; i<pSrc->nSrc; i++, pItem++){
+ pTab = sqlite3LocateTable(pParse, pItem->zName, pItem->zDatabase);
+ sqlite3DeleteTable(pParse->db, pItem->pTab);
+ pItem->pTab = pTab;
+ if( pTab ){
+ pTab->nRef++;
+ }
+ }
+ return pTab;
+}
+
+/*
+** Check to make sure the given table is writable. If it is not
+** writable, generate an error message and return 1. If it is
+** writable return 0;
+*/
+int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){
+ if( pTab->readOnly && (pParse->db->flags & SQLITE_WriteSchema)==0
+ && pParse->nested==0 ){
+ sqlite3ErrorMsg(pParse, "table %s may not be modified", pTab->zName);
+ return 1;
+ }
+#ifndef SQLITE_OMIT_VIEW
+ if( !viewOk && pTab->pSelect ){
+ sqlite3ErrorMsg(pParse,"cannot modify %s because it is a view",pTab->zName);
+ return 1;
+ }
+#endif
+ return 0;
+}
+
+/*
+** Generate code that will open a table for reading.
+*/
+void sqlite3OpenTableForReading(
+ Vdbe *v, /* Generate code into this VDBE */
+ int iCur, /* The cursor number of the table */
+ Table *pTab /* The table to be opened */
+){
+ sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0);
+ VdbeComment((v, "# %s", pTab->zName));
+ sqlite3VdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iCur, pTab->nCol);
+}
+
+
+/*
+** Generate code for a DELETE FROM statement.
+**
+** DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
+** \________/ \________________/
+** pTabList pWhere
+*/
+void sqlite3DeleteFrom(
+ Parse *pParse, /* The parser context */
+ SrcList *pTabList, /* The table from which we should delete things */
+ Expr *pWhere /* The WHERE clause. May be null */
+){
+ Vdbe *v; /* The virtual database engine */
+ Table *pTab; /* The table from which records will be deleted */
+ const char *zDb; /* Name of database holding pTab */
+ int end, addr = 0; /* A couple addresses of generated code */
+ int i; /* Loop counter */
+ WhereInfo *pWInfo; /* Information about the WHERE clause */
+ Index *pIdx; /* For looping over indices of the table */
+ int iCur; /* VDBE Cursor number for pTab */
+ sqlite3 *db; /* Main database structure */
+ AuthContext sContext; /* Authorization context */
+ int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */
+ NameContext sNC; /* Name context to resolve expressions in */
+
+#ifndef SQLITE_OMIT_TRIGGER
+ int isView; /* True if attempting to delete from a view */
+ int triggers_exist = 0; /* True if any triggers exist */
+#endif
+
+ sContext.pParse = 0;
+ if( pParse->nErr || sqlite3_malloc_failed ){
+ goto delete_from_cleanup;
+ }
+ db = pParse->db;
+ assert( pTabList->nSrc==1 );
+
+ /* Locate the table which we want to delete. This table has to be
+ ** put in an SrcList structure because some of the subroutines we
+ ** will be calling are designed to work with multiple tables and expect
+ ** an SrcList* parameter instead of just a Table* parameter.
+ */
+ pTab = sqlite3SrcListLookup(pParse, pTabList);
+ if( pTab==0 ) goto delete_from_cleanup;
+
+ /* Figure out if we have any triggers and if the table being
+ ** deleted from is a view
+ */
+#ifndef SQLITE_OMIT_TRIGGER
+ triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0);
+ isView = pTab->pSelect!=0;
+#else
+# define triggers_exist 0
+# define isView 0
+#endif
+#ifdef SQLITE_OMIT_VIEW
+# undef isView
+# define isView 0
+#endif
+
+ if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){
+ goto delete_from_cleanup;
+ }
+ assert( pTab->iDb<db->nDb );
+ zDb = db->aDb[pTab->iDb].zName;
+ if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
+ goto delete_from_cleanup;
+ }
+
+ /* If pTab is really a view, make sure it has been initialized.
+ */
+ if( isView && sqlite3ViewGetColumnNames(pParse, pTab) ){
+ goto delete_from_cleanup;
+ }
+
+ /* Allocate a cursor used to store the old.* data for a trigger.
+ */
+ if( triggers_exist ){
+ oldIdx = pParse->nTab++;
+ }
+
+ /* Resolve the column names in the WHERE clause.
+ */
+ assert( pTabList->nSrc==1 );
+ iCur = pTabList->a[0].iCursor = pParse->nTab++;
+ memset(&sNC, 0, sizeof(sNC));
+ sNC.pParse = pParse;
+ sNC.pSrcList = pTabList;
+ if( sqlite3ExprResolveNames(&sNC, pWhere) ){
+ goto delete_from_cleanup;
+ }
+
+ /* Start the view context
+ */
+ if( isView ){
+ sqlite3AuthContextPush(pParse, &sContext, pTab->zName);
+ }
+
+ /* Begin generating code.
+ */
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ){
+ goto delete_from_cleanup;
+ }
+ if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
+ sqlite3BeginWriteOperation(pParse, triggers_exist, pTab->iDb);
+
+ /* If we are trying to delete from a view, realize that view into
+ ** a ephemeral table.
+ */
+ if( isView ){
+ Select *pView = sqlite3SelectDup(pTab->pSelect);
+ sqlite3Select(pParse, pView, SRT_VirtualTab, iCur, 0, 0, 0, 0);
+ sqlite3SelectDelete(pView);
+ }
+
+ /* Initialize the counter of the number of rows deleted, if
+ ** we are counting rows.
+ */
+ if( db->flags & SQLITE_CountRows ){
+ sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
+ }
+
+ /* Special case: A DELETE without a WHERE clause deletes everything.
+ ** It is easier just to erase the whole table. Note, however, that
+ ** this means that the row change count will be incorrect.
+ */
+ if( pWhere==0 && !triggers_exist ){
+ if( db->flags & SQLITE_CountRows ){
+ /* If counting rows deleted, just count the total number of
+ ** entries in the table. */
+ int endOfLoop = sqlite3VdbeMakeLabel(v);
+ int addr;
+ if( !isView ){
+ sqlite3OpenTableForReading(v, iCur, pTab);
+ }
+ sqlite3VdbeAddOp(v, OP_Rewind, iCur, sqlite3VdbeCurrentAddr(v)+2);
+ addr = sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Next, iCur, addr);
+ sqlite3VdbeResolveLabel(v, endOfLoop);
+ sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
+ }
+ if( !isView ){
+ sqlite3VdbeAddOp(v, OP_Clear, pTab->tnum, pTab->iDb);
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ sqlite3VdbeAddOp(v, OP_Clear, pIdx->tnum, pIdx->iDb);
+ }
+ }
+ }
+
+ /* The usual case: There is a WHERE clause so we have to scan through
+ ** the table and pick which records to delete.
+ */
+ else{
+ /* Ensure all required collation sequences are available. */
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ if( sqlite3CheckIndexCollSeq(pParse, pIdx) ){
+ goto delete_from_cleanup;
+ }
+ }
+
+ /* Begin the database scan
+ */
+ pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0);
+ if( pWInfo==0 ) goto delete_from_cleanup;
+
+ /* Remember the rowid of every item to be deleted.
+ */
+ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0);
+ if( db->flags & SQLITE_CountRows ){
+ sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
+ }
+
+ /* End the database scan loop.
+ */
+ sqlite3WhereEnd(pWInfo);
+
+ /* Open the pseudo-table used to store OLD if there are triggers.
+ */
+ if( triggers_exist ){
+ sqlite3VdbeAddOp(v, OP_OpenPseudo, oldIdx, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, oldIdx, pTab->nCol);
+ }
+
+ /* Delete every item whose key was written to the list during the
+ ** database scan. We have to delete items after the scan is complete
+ ** because deleting an item can change the scan order.
+ */
+ end = sqlite3VdbeMakeLabel(v);
+
+ /* This is the beginning of the delete loop when there are
+ ** row triggers.
+ */
+ if( triggers_exist ){
+ addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, end);
+ if( !isView ){
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ sqlite3OpenTableForReading(v, iCur, pTab);
+ }
+ sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_RowData, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_Insert, oldIdx, 0);
+ if( !isView ){
+ sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
+ }
+
+ (void)sqlite3CodeRowTrigger(pParse, TK_DELETE, 0, TRIGGER_BEFORE, pTab,
+ -1, oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default,
+ addr);
+ }
+
+ if( !isView ){
+ /* Open cursors for the table we are deleting from and all its
+ ** indices. If there are row triggers, this happens inside the
+ ** OP_FifoRead loop because the cursor have to all be closed
+ ** before the trigger fires. If there are no row triggers, the
+ ** cursors are opened only once on the outside the loop.
+ */
+ sqlite3OpenTableAndIndices(pParse, pTab, iCur, OP_OpenWrite);
+
+ /* This is the beginning of the delete loop when there are no
+ ** row triggers */
+ if( !triggers_exist ){
+ addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, end);
+ }
+
+ /* Delete the row */
+ sqlite3GenerateRowDelete(db, v, pTab, iCur, pParse->nested==0);
+ }
+
+ /* If there are row triggers, close all cursors then invoke
+ ** the AFTER triggers
+ */
+ if( triggers_exist ){
+ if( !isView ){
+ for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
+ sqlite3VdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum);
+ }
+ sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
+ }
+ (void)sqlite3CodeRowTrigger(pParse, TK_DELETE, 0, TRIGGER_AFTER, pTab, -1,
+ oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default,
+ addr);
+ }
+
+ /* End of the delete loop */
+ sqlite3VdbeAddOp(v, OP_Goto, 0, addr);
+ sqlite3VdbeResolveLabel(v, end);
+
+ /* Close the cursors after the loop if there are no row triggers */
+ if( !triggers_exist ){
+ for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
+ sqlite3VdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum);
+ }
+ sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
+ }
+ }
+
+ /*
+ ** Return the number of rows that were deleted. If this routine is
+ ** generating code because of a call to sqlite3NestedParse(), do not
+ ** invoke the callback function.
+ */
+ if( db->flags & SQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){
+ sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
+ sqlite3VdbeSetNumCols(v, 1);
+ sqlite3VdbeSetColName(v, 0, "rows deleted", P3_STATIC);
+ }
+
+delete_from_cleanup:
+ sqlite3AuthContextPop(&sContext);
+ sqlite3SrcListDelete(pTabList);
+ sqlite3ExprDelete(pWhere);
+ return;
+}
+
+/*
+** This routine generates VDBE code that causes a single row of a
+** single table to be deleted.
+**
+** The VDBE must be in a particular state when this routine is called.
+** These are the requirements:
+**
+** 1. A read/write cursor pointing to pTab, the table containing the row
+** to be deleted, must be opened as cursor number "base".
+**
+** 2. Read/write cursors for all indices of pTab must be open as
+** cursor number base+i for the i-th index.
+**
+** 3. The record number of the row to be deleted must be on the top
+** of the stack.
+**
+** This routine pops the top of the stack to remove the record number
+** and then generates code to remove both the table record and all index
+** entries that point to that record.
+*/
+void sqlite3GenerateRowDelete(
+ sqlite3 *db, /* The database containing the index */
+ Vdbe *v, /* Generate code into this VDBE */
+ Table *pTab, /* Table containing the row to be deleted */
+ int iCur, /* Cursor number for the table */
+ int count /* Increment the row change counter */
+){
+ int addr;
+ addr = sqlite3VdbeAddOp(v, OP_NotExists, iCur, 0);
+ sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_Delete, iCur, (count?OPFLAG_NCHANGE:0));
+ sqlite3VdbeJumpHere(v, addr);
+}
+
+/*
+** This routine generates VDBE code that causes the deletion of all
+** index entries associated with a single row of a single table.
+**
+** The VDBE must be in a particular state when this routine is called.
+** These are the requirements:
+**
+** 1. A read/write cursor pointing to pTab, the table containing the row
+** to be deleted, must be opened as cursor number "iCur".
+**
+** 2. Read/write cursors for all indices of pTab must be open as
+** cursor number iCur+i for the i-th index.
+**
+** 3. The "iCur" cursor must be pointing to the row that is to be
+** deleted.
+*/
+void sqlite3GenerateRowIndexDelete(
+ sqlite3 *db, /* The database containing the index */
+ Vdbe *v, /* Generate code into this VDBE */
+ Table *pTab, /* Table containing the row to be deleted */
+ int iCur, /* Cursor number for the table */
+ char *aIdxUsed /* Only delete if aIdxUsed!=0 && aIdxUsed[i]!=0 */
+){
+ int i;
+ Index *pIdx;
+
+ for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
+ if( aIdxUsed!=0 && aIdxUsed[i-1]==0 ) continue;
+ sqlite3GenerateIndexKey(v, pIdx, iCur);
+ sqlite3VdbeAddOp(v, OP_IdxDelete, iCur+i, 0);
+ }
+}
+
+/*
+** Generate code that will assemble an index key and put it on the top
+** of the tack. The key with be for index pIdx which is an index on pTab.
+** iCur is the index of a cursor open on the pTab table and pointing to
+** the entry that needs indexing.
+*/
+void sqlite3GenerateIndexKey(
+ Vdbe *v, /* Generate code into this VDBE */
+ Index *pIdx, /* The index for which to generate a key */
+ int iCur /* Cursor number for the pIdx->pTable table */
+){
+ int j;
+ Table *pTab = pIdx->pTable;
+
+ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ for(j=0; j<pIdx->nColumn; j++){
+ int idx = pIdx->aiColumn[j];
+ if( idx==pTab->iPKey ){
+ sqlite3VdbeAddOp(v, OP_Dup, j, 0);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Column, iCur, idx);
+ sqlite3ColumnDefault(v, pTab, idx);
+ }
+ }
+ sqlite3VdbeAddOp(v, OP_MakeIdxRec, pIdx->nColumn, 0);
+ sqlite3IndexAffinityStr(v, pIdx);
+}
diff --git a/ext/pdo_sqlite/sqlite/src/experimental.c b/ext/pdo_sqlite/sqlite/src/experimental.c
new file mode 100644
index 000000000..cbdcf464a
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/experimental.c
@@ -0,0 +1,37 @@
+/*
+** 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
new file mode 100644
index 000000000..1276fe9f6
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/expr.c
@@ -0,0 +1,2253 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains routines used for analyzing expressions and
+** for generating VDBE code that evaluates expressions in SQLite.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include <ctype.h>
+
+/*
+** Return the 'affinity' of the expression pExpr if any.
+**
+** If pExpr is a column, a reference to a column via an 'AS' alias,
+** or a sub-select with a column as the return value, then the
+** affinity of that column is returned. Otherwise, 0x00 is returned,
+** indicating no affinity for the expression.
+**
+** i.e. the WHERE clause expresssions in the following statements all
+** have an affinity:
+**
+** CREATE TABLE t1(a);
+** SELECT * FROM t1 WHERE a;
+** SELECT a AS b FROM t1 WHERE b;
+** SELECT * FROM t1 WHERE (select a from t1);
+*/
+char sqlite3ExprAffinity(Expr *pExpr){
+ int op = pExpr->op;
+ if( op==TK_AS ){
+ return sqlite3ExprAffinity(pExpr->pLeft);
+ }
+ if( op==TK_SELECT ){
+ return sqlite3ExprAffinity(pExpr->pSelect->pEList->a[0].pExpr);
+ }
+#ifndef SQLITE_OMIT_CAST
+ if( op==TK_CAST ){
+ return sqlite3AffinityType(&pExpr->token);
+ }
+#endif
+ return pExpr->affinity;
+}
+
+/*
+** Return the default collation sequence for the expression pExpr. If
+** there is no default collation type, return 0.
+*/
+CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
+ CollSeq *pColl = 0;
+ if( pExpr ){
+ pColl = pExpr->pColl;
+ if( (pExpr->op==TK_AS || pExpr->op==TK_CAST) && !pColl ){
+ return sqlite3ExprCollSeq(pParse, pExpr->pLeft);
+ }
+ }
+ if( sqlite3CheckCollSeq(pParse, pColl) ){
+ pColl = 0;
+ }
+ return pColl;
+}
+
+/*
+** pExpr is an operand of a comparison operator. aff2 is the
+** type affinity of the other operand. This routine returns the
+** type affinity that should be used for the comparison operator.
+*/
+char sqlite3CompareAffinity(Expr *pExpr, char aff2){
+ char aff1 = sqlite3ExprAffinity(pExpr);
+ if( aff1 && aff2 ){
+ /* Both sides of the comparison are columns. If one has numeric or
+ ** integer affinity, use that. Otherwise use no affinity.
+ */
+ if( aff1==SQLITE_AFF_INTEGER || aff2==SQLITE_AFF_INTEGER ){
+ return SQLITE_AFF_INTEGER;
+ }else if( aff1==SQLITE_AFF_NUMERIC || aff2==SQLITE_AFF_NUMERIC ){
+ return SQLITE_AFF_NUMERIC;
+ }else{
+ return SQLITE_AFF_NONE;
+ }
+ }else if( !aff1 && !aff2 ){
+ /* Neither side of the comparison is a column. Compare the
+ ** results directly.
+ */
+ /* return SQLITE_AFF_NUMERIC; // Ticket #805 */
+ return SQLITE_AFF_NONE;
+ }else{
+ /* One side is a column, the other is not. Use the columns affinity. */
+ assert( aff1==0 || aff2==0 );
+ return (aff1 + aff2);
+ }
+}
+
+/*
+** pExpr is a comparison operator. Return the type affinity that should
+** be applied to both operands prior to doing the comparison.
+*/
+static char comparisonAffinity(Expr *pExpr){
+ char aff;
+ assert( pExpr->op==TK_EQ || pExpr->op==TK_IN || pExpr->op==TK_LT ||
+ pExpr->op==TK_GT || pExpr->op==TK_GE || pExpr->op==TK_LE ||
+ pExpr->op==TK_NE );
+ assert( pExpr->pLeft );
+ aff = sqlite3ExprAffinity(pExpr->pLeft);
+ if( pExpr->pRight ){
+ aff = sqlite3CompareAffinity(pExpr->pRight, aff);
+ }
+ else if( pExpr->pSelect ){
+ aff = sqlite3CompareAffinity(pExpr->pSelect->pEList->a[0].pExpr, aff);
+ }
+ else if( !aff ){
+ aff = SQLITE_AFF_NUMERIC;
+ }
+ return aff;
+}
+
+/*
+** pExpr is a comparison expression, eg. '=', '<', IN(...) etc.
+** idx_affinity is the affinity of an indexed column. Return true
+** if the index with affinity idx_affinity may be used to implement
+** the comparison in pExpr.
+*/
+int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity){
+ char aff = comparisonAffinity(pExpr);
+ return
+ (aff==SQLITE_AFF_NONE) ||
+ (aff==SQLITE_AFF_NUMERIC && idx_affinity==SQLITE_AFF_INTEGER) ||
+ (aff==SQLITE_AFF_INTEGER && idx_affinity==SQLITE_AFF_NUMERIC) ||
+ (aff==idx_affinity);
+}
+
+/*
+** Return the P1 value that should be used for a binary comparison
+** opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2.
+** If jumpIfNull is true, then set the low byte of the returned
+** P1 value to tell the opcode to jump if either expression
+** evaluates to NULL.
+*/
+static int binaryCompareP1(Expr *pExpr1, Expr *pExpr2, int jumpIfNull){
+ char aff = sqlite3ExprAffinity(pExpr2);
+ return ((int)sqlite3CompareAffinity(pExpr1, aff))+(jumpIfNull?0x100:0);
+}
+
+/*
+** Return a pointer to the collation sequence that should be used by
+** a binary comparison operator comparing pLeft and pRight.
+**
+** If the left hand expression has a collating sequence type, then it is
+** used. Otherwise the collation sequence for the right hand expression
+** is used, or the default (BINARY) if neither expression has a collating
+** type.
+*/
+static CollSeq* binaryCompareCollSeq(Parse *pParse, Expr *pLeft, Expr *pRight){
+ CollSeq *pColl = sqlite3ExprCollSeq(pParse, pLeft);
+ if( !pColl ){
+ pColl = sqlite3ExprCollSeq(pParse, pRight);
+ }
+ return pColl;
+}
+
+/*
+** Generate code for a comparison operator.
+*/
+static int codeCompare(
+ Parse *pParse, /* The parsing (and code generating) context */
+ Expr *pLeft, /* The left operand */
+ Expr *pRight, /* The right operand */
+ int opcode, /* The comparison opcode */
+ int dest, /* Jump here if true. */
+ int jumpIfNull /* If true, jump if either operand is NULL */
+){
+ int p1 = binaryCompareP1(pLeft, pRight, jumpIfNull);
+ CollSeq *p3 = binaryCompareCollSeq(pParse, pLeft, pRight);
+ return sqlite3VdbeOp3(pParse->pVdbe, opcode, p1, dest, (void*)p3, P3_COLLSEQ);
+}
+
+/*
+** Construct a new expression node and return a pointer to it. Memory
+** for this node is obtained from sqliteMalloc(). The calling function
+** is responsible for making sure the node eventually gets freed.
+*/
+Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, const Token *pToken){
+ Expr *pNew;
+ pNew = sqliteMalloc( sizeof(Expr) );
+ if( pNew==0 ){
+ /* When malloc fails, delete pLeft and pRight. Expressions passed to
+ ** this function must always be allocated with sqlite3Expr() for this
+ ** reason.
+ */
+ sqlite3ExprDelete(pLeft);
+ sqlite3ExprDelete(pRight);
+ return 0;
+ }
+ pNew->op = op;
+ pNew->pLeft = pLeft;
+ pNew->pRight = pRight;
+ pNew->iAgg = -1;
+ if( pToken ){
+ assert( pToken->dyn==0 );
+ pNew->span = pNew->token = *pToken;
+ }else if( pLeft && pRight ){
+ sqlite3ExprSpan(pNew, &pLeft->span, &pRight->span);
+ }
+ return pNew;
+}
+
+/*
+** When doing a nested parse, you can include terms in an expression
+** that look like this: #0 #1 #2 ... These terms refer to elements
+** on the stack. "#0" means the top of the stack.
+** "#1" means the next down on the stack. And so forth.
+**
+** This routine is called by the parser to deal with on of those terms.
+** It immediately generates code to store the value in a memory location.
+** The returns an expression that will code to extract the value from
+** that memory location as needed.
+*/
+Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
+ Vdbe *v = pParse->pVdbe;
+ Expr *p;
+ int depth;
+ if( pParse->nested==0 ){
+ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", pToken);
+ return 0;
+ }
+ if( v==0 ) return 0;
+ p = sqlite3Expr(TK_REGISTER, 0, 0, pToken);
+ if( p==0 ){
+ return 0; /* Malloc failed */
+ }
+ depth = atoi(&pToken->z[1]);
+ p->iTable = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_Dup, depth, 0);
+ sqlite3VdbeAddOp(v, OP_MemStore, p->iTable, 1);
+ return p;
+}
+
+/*
+** Join two expressions using an AND operator. If either expression is
+** NULL, then just return the other expression.
+*/
+Expr *sqlite3ExprAnd(Expr *pLeft, Expr *pRight){
+ if( pLeft==0 ){
+ return pRight;
+ }else if( pRight==0 ){
+ return pLeft;
+ }else{
+ return sqlite3Expr(TK_AND, pLeft, pRight, 0);
+ }
+}
+
+/*
+** Set the Expr.span field of the given expression to span all
+** text between the two given tokens.
+*/
+void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){
+ assert( pRight!=0 );
+ assert( pLeft!=0 );
+ if( !sqlite3_malloc_failed && pRight->z && pLeft->z ){
+ assert( pLeft->dyn==0 || pLeft->z[pLeft->n]==0 );
+ if( pLeft->dyn==0 && pRight->dyn==0 ){
+ pExpr->span.z = pLeft->z;
+ pExpr->span.n = pRight->n + (pRight->z - pLeft->z);
+ }else{
+ pExpr->span.z = 0;
+ }
+ }
+}
+
+/*
+** Construct a new expression node for a function with multiple
+** arguments.
+*/
+Expr *sqlite3ExprFunction(ExprList *pList, Token *pToken){
+ Expr *pNew;
+ pNew = sqliteMalloc( sizeof(Expr) );
+ if( pNew==0 ){
+ sqlite3ExprListDelete(pList); /* Avoid leaking memory when malloc fails */
+ return 0;
+ }
+ pNew->op = TK_FUNCTION;
+ pNew->pList = pList;
+ if( pToken ){
+ assert( pToken->dyn==0 );
+ pNew->token = *pToken;
+ }else{
+ pNew->token.z = 0;
+ }
+ pNew->span = pNew->token;
+ return pNew;
+}
+
+/*
+** Assign a variable number to an expression that encodes a wildcard
+** in the original SQL statement.
+**
+** Wildcards consisting of a single "?" are assigned the next sequential
+** variable number.
+**
+** Wildcards of the form "?nnn" are assigned the number "nnn". We make
+** sure "nnn" is not too be to avoid a denial of service attack when
+** the SQL statement comes from an external source.
+**
+** Wildcards of the form ":aaa" or "$aaa" are assigned the same number
+** as the previous instance of the same wildcard. Or if this is the first
+** instance of the wildcard, the next sequenial variable number is
+** assigned.
+*/
+void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
+ Token *pToken;
+ if( pExpr==0 ) return;
+ pToken = &pExpr->token;
+ assert( pToken->n>=1 );
+ assert( pToken->z!=0 );
+ assert( pToken->z[0]!=0 );
+ if( pToken->n==1 ){
+ /* Wildcard of the form "?". Assign the next variable number */
+ pExpr->iTable = ++pParse->nVar;
+ }else if( pToken->z[0]=='?' ){
+ /* Wildcard of the form "?nnn". Convert "nnn" to an integer and
+ ** use it as the variable number */
+ int i;
+ pExpr->iTable = i = atoi(&pToken->z[1]);
+ if( i<1 || i>SQLITE_MAX_VARIABLE_NUMBER ){
+ sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d",
+ SQLITE_MAX_VARIABLE_NUMBER);
+ }
+ if( i>pParse->nVar ){
+ pParse->nVar = i;
+ }
+ }else{
+ /* Wildcards of the form ":aaa" or "$aaa". Reuse the same variable
+ ** number as the prior appearance of the same name, or if the name
+ ** has never appeared before, reuse the same variable number
+ */
+ int i, n;
+ n = pToken->n;
+ for(i=0; i<pParse->nVarExpr; i++){
+ Expr *pE;
+ if( (pE = pParse->apVarExpr[i])!=0
+ && pE->token.n==n
+ && memcmp(pE->token.z, pToken->z, n)==0 ){
+ pExpr->iTable = pE->iTable;
+ break;
+ }
+ }
+ if( i>=pParse->nVarExpr ){
+ pExpr->iTable = ++pParse->nVar;
+ if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){
+ pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10;
+ sqlite3ReallocOrFree((void**)&pParse->apVarExpr,
+ pParse->nVarExprAlloc*sizeof(pParse->apVarExpr[0]) );
+ }
+ if( !sqlite3_malloc_failed ){
+ assert( pParse->apVarExpr!=0 );
+ pParse->apVarExpr[pParse->nVarExpr++] = pExpr;
+ }
+ }
+ }
+}
+
+/*
+** Recursively delete an expression tree.
+*/
+void sqlite3ExprDelete(Expr *p){
+ if( p==0 ) return;
+ if( p->span.dyn ) sqliteFree((char*)p->span.z);
+ if( p->token.dyn ) sqliteFree((char*)p->token.z);
+ sqlite3ExprDelete(p->pLeft);
+ sqlite3ExprDelete(p->pRight);
+ sqlite3ExprListDelete(p->pList);
+ sqlite3SelectDelete(p->pSelect);
+ sqliteFree(p);
+}
+
+/*
+** The Expr.token field might be a string literal that is quoted.
+** If so, remove the quotation marks.
+*/
+void sqlite3DequoteExpr(Expr *p){
+ if( ExprHasAnyProperty(p, EP_Dequoted) ){
+ return;
+ }
+ ExprSetProperty(p, EP_Dequoted);
+ if( p->token.dyn==0 ){
+ sqlite3TokenCopy(&p->token, &p->token);
+ }
+ sqlite3Dequote((char*)p->token.z);
+}
+
+
+/*
+** The following group of routines make deep copies of expressions,
+** expression lists, ID lists, and select statements. The copies can
+** be deleted (by being passed to their respective ...Delete() routines)
+** without effecting the originals.
+**
+** The expression list, ID, and source lists return by sqlite3ExprListDup(),
+** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded
+** by subsequent calls to sqlite*ListAppend() routines.
+**
+** Any tables that the SrcList might point to are not duplicated.
+*/
+Expr *sqlite3ExprDup(Expr *p){
+ Expr *pNew;
+ if( p==0 ) return 0;
+ pNew = sqliteMallocRaw( sizeof(*p) );
+ if( pNew==0 ) return 0;
+ memcpy(pNew, p, sizeof(*pNew));
+ if( p->token.z!=0 ){
+ pNew->token.z = sqliteStrNDup(p->token.z, p->token.n);
+ pNew->token.dyn = 1;
+ }else{
+ assert( pNew->token.z==0 );
+ }
+ pNew->span.z = 0;
+ pNew->pLeft = sqlite3ExprDup(p->pLeft);
+ pNew->pRight = sqlite3ExprDup(p->pRight);
+ pNew->pList = sqlite3ExprListDup(p->pList);
+ pNew->pSelect = sqlite3SelectDup(p->pSelect);
+ pNew->pTab = p->pTab;
+ return pNew;
+}
+void sqlite3TokenCopy(Token *pTo, Token *pFrom){
+ if( pTo->dyn ) sqliteFree((char*)pTo->z);
+ if( pFrom->z ){
+ pTo->n = pFrom->n;
+ pTo->z = sqliteStrNDup(pFrom->z, pFrom->n);
+ pTo->dyn = 1;
+ }else{
+ pTo->z = 0;
+ }
+}
+ExprList *sqlite3ExprListDup(ExprList *p){
+ ExprList *pNew;
+ struct ExprList_item *pItem, *pOldItem;
+ int i;
+ if( p==0 ) return 0;
+ pNew = sqliteMalloc( sizeof(*pNew) );
+ if( pNew==0 ) return 0;
+ pNew->nExpr = pNew->nAlloc = p->nExpr;
+ pNew->a = pItem = sqliteMalloc( p->nExpr*sizeof(p->a[0]) );
+ if( pItem==0 ){
+ sqliteFree(pNew);
+ return 0;
+ }
+ pOldItem = p->a;
+ for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){
+ Expr *pNewExpr, *pOldExpr;
+ pItem->pExpr = pNewExpr = sqlite3ExprDup(pOldExpr = pOldItem->pExpr);
+ if( pOldExpr->span.z!=0 && pNewExpr ){
+ /* Always make a copy of the span for top-level expressions in the
+ ** expression list. The logic in SELECT processing that determines
+ ** the names of columns in the result set needs this information */
+ sqlite3TokenCopy(&pNewExpr->span, &pOldExpr->span);
+ }
+ assert( pNewExpr==0 || pNewExpr->span.z!=0
+ || pOldExpr->span.z==0 || sqlite3_malloc_failed );
+ pItem->zName = sqliteStrDup(pOldItem->zName);
+ pItem->sortOrder = pOldItem->sortOrder;
+ pItem->isAgg = pOldItem->isAgg;
+ pItem->done = 0;
+ }
+ return pNew;
+}
+
+/*
+** If cursors, triggers, views and subqueries are all omitted from
+** the build, then none of the following routines, except for
+** sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes
+** called with a NULL argument.
+*/
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER) \
+ || !defined(SQLITE_OMIT_SUBQUERY)
+SrcList *sqlite3SrcListDup(SrcList *p){
+ SrcList *pNew;
+ int i;
+ int nByte;
+ if( p==0 ) return 0;
+ nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
+ pNew = sqliteMallocRaw( nByte );
+ if( pNew==0 ) return 0;
+ pNew->nSrc = pNew->nAlloc = p->nSrc;
+ for(i=0; i<p->nSrc; i++){
+ struct SrcList_item *pNewItem = &pNew->a[i];
+ struct SrcList_item *pOldItem = &p->a[i];
+ Table *pTab;
+ pNewItem->zDatabase = sqliteStrDup(pOldItem->zDatabase);
+ pNewItem->zName = sqliteStrDup(pOldItem->zName);
+ pNewItem->zAlias = sqliteStrDup(pOldItem->zAlias);
+ pNewItem->jointype = pOldItem->jointype;
+ pNewItem->iCursor = pOldItem->iCursor;
+ pTab = pNewItem->pTab = pOldItem->pTab;
+ if( pTab ){
+ pTab->nRef++;
+ }
+ pNewItem->pSelect = sqlite3SelectDup(pOldItem->pSelect);
+ pNewItem->pOn = sqlite3ExprDup(pOldItem->pOn);
+ pNewItem->pUsing = sqlite3IdListDup(pOldItem->pUsing);
+ pNewItem->colUsed = pOldItem->colUsed;
+ }
+ return pNew;
+}
+IdList *sqlite3IdListDup(IdList *p){
+ IdList *pNew;
+ int i;
+ if( p==0 ) return 0;
+ pNew = sqliteMallocRaw( sizeof(*pNew) );
+ if( pNew==0 ) return 0;
+ pNew->nId = pNew->nAlloc = p->nId;
+ pNew->a = sqliteMallocRaw( p->nId*sizeof(p->a[0]) );
+ if( pNew->a==0 ){
+ sqliteFree(pNew);
+ return 0;
+ }
+ for(i=0; i<p->nId; i++){
+ struct IdList_item *pNewItem = &pNew->a[i];
+ struct IdList_item *pOldItem = &p->a[i];
+ pNewItem->zName = sqliteStrDup(pOldItem->zName);
+ pNewItem->idx = pOldItem->idx;
+ }
+ return pNew;
+}
+Select *sqlite3SelectDup(Select *p){
+ Select *pNew;
+ if( p==0 ) return 0;
+ pNew = sqliteMallocRaw( sizeof(*p) );
+ if( pNew==0 ) return 0;
+ pNew->isDistinct = p->isDistinct;
+ pNew->pEList = sqlite3ExprListDup(p->pEList);
+ pNew->pSrc = sqlite3SrcListDup(p->pSrc);
+ pNew->pWhere = sqlite3ExprDup(p->pWhere);
+ pNew->pGroupBy = sqlite3ExprListDup(p->pGroupBy);
+ pNew->pHaving = sqlite3ExprDup(p->pHaving);
+ pNew->pOrderBy = sqlite3ExprListDup(p->pOrderBy);
+ pNew->op = p->op;
+ pNew->pPrior = sqlite3SelectDup(p->pPrior);
+ pNew->pLimit = sqlite3ExprDup(p->pLimit);
+ pNew->pOffset = sqlite3ExprDup(p->pOffset);
+ pNew->iLimit = -1;
+ pNew->iOffset = -1;
+ pNew->isResolved = p->isResolved;
+ pNew->isAgg = p->isAgg;
+ pNew->usesVirt = 0;
+ pNew->disallowOrderBy = 0;
+ pNew->pRightmost = 0;
+ pNew->addrOpenVirt[0] = -1;
+ pNew->addrOpenVirt[1] = -1;
+ pNew->addrOpenVirt[2] = -1;
+ return pNew;
+}
+#else
+Select *sqlite3SelectDup(Select *p){
+ assert( p==0 );
+ return 0;
+}
+#endif
+
+
+/*
+** Add a new element to the end of an expression list. If pList is
+** initially NULL, then create a new expression list.
+*/
+ExprList *sqlite3ExprListAppend(ExprList *pList, Expr *pExpr, Token *pName){
+ if( pList==0 ){
+ pList = sqliteMalloc( sizeof(ExprList) );
+ if( pList==0 ){
+ goto no_mem;
+ }
+ assert( pList->nAlloc==0 );
+ }
+ if( pList->nAlloc<=pList->nExpr ){
+ struct ExprList_item *a;
+ int n = pList->nAlloc*2 + 4;
+ a = sqliteRealloc(pList->a, n*sizeof(pList->a[0]));
+ if( a==0 ){
+ goto no_mem;
+ }
+ pList->a = a;
+ pList->nAlloc = n;
+ }
+ assert( pList->a!=0 );
+ if( pExpr || pName ){
+ struct ExprList_item *pItem = &pList->a[pList->nExpr++];
+ memset(pItem, 0, sizeof(*pItem));
+ pItem->zName = sqlite3NameFromToken(pName);
+ pItem->pExpr = pExpr;
+ }
+ return pList;
+
+no_mem:
+ /* Avoid leaking memory if malloc has failed. */
+ sqlite3ExprDelete(pExpr);
+ sqlite3ExprListDelete(pList);
+ return 0;
+}
+
+/*
+** Delete an entire expression list.
+*/
+void sqlite3ExprListDelete(ExprList *pList){
+ int i;
+ struct ExprList_item *pItem;
+ if( pList==0 ) return;
+ assert( pList->a!=0 || (pList->nExpr==0 && pList->nAlloc==0) );
+ assert( pList->nExpr<=pList->nAlloc );
+ for(pItem=pList->a, i=0; i<pList->nExpr; i++, pItem++){
+ sqlite3ExprDelete(pItem->pExpr);
+ sqliteFree(pItem->zName);
+ }
+ sqliteFree(pList->a);
+ sqliteFree(pList);
+}
+
+/*
+** Walk an expression tree. Call xFunc for each node visited.
+**
+** The return value from xFunc determines whether the tree walk continues.
+** 0 means continue walking the tree. 1 means do not walk children
+** of the current node but continue with siblings. 2 means abandon
+** the tree walk completely.
+**
+** The return value from this routine is 1 to abandon the tree walk
+** and 0 to continue.
+**
+** NOTICE: This routine does *not* descend into subqueries.
+*/
+static int walkExprList(ExprList *, int (*)(void *, Expr*), void *);
+static int walkExprTree(Expr *pExpr, int (*xFunc)(void*,Expr*), void *pArg){
+ int rc;
+ if( pExpr==0 ) return 0;
+ rc = (*xFunc)(pArg, pExpr);
+ if( rc==0 ){
+ if( walkExprTree(pExpr->pLeft, xFunc, pArg) ) return 1;
+ if( walkExprTree(pExpr->pRight, xFunc, pArg) ) return 1;
+ if( walkExprList(pExpr->pList, xFunc, pArg) ) return 1;
+ }
+ return rc>1;
+}
+
+/*
+** Call walkExprTree() for every expression in list p.
+*/
+static int walkExprList(ExprList *p, int (*xFunc)(void *, Expr*), void *pArg){
+ int i;
+ struct ExprList_item *pItem;
+ if( !p ) return 0;
+ for(i=p->nExpr, pItem=p->a; i>0; i--, pItem++){
+ if( walkExprTree(pItem->pExpr, xFunc, pArg) ) return 1;
+ }
+ return 0;
+}
+
+/*
+** Call walkExprTree() for every expression in Select p, not including
+** expressions that are part of sub-selects in any FROM clause or the LIMIT
+** or OFFSET expressions..
+*/
+static int walkSelectExpr(Select *p, int (*xFunc)(void *, Expr*), void *pArg){
+ walkExprList(p->pEList, xFunc, pArg);
+ walkExprTree(p->pWhere, xFunc, pArg);
+ walkExprList(p->pGroupBy, xFunc, pArg);
+ walkExprTree(p->pHaving, xFunc, pArg);
+ walkExprList(p->pOrderBy, xFunc, pArg);
+ return 0;
+}
+
+
+/*
+** This routine is designed as an xFunc for walkExprTree().
+**
+** pArg is really a pointer to an integer. If we can tell by looking
+** at pExpr that the expression that contains pExpr is not a constant
+** expression, then set *pArg to 0 and return 2 to abandon the tree walk.
+** If pExpr does does not disqualify the expression from being a constant
+** then do nothing.
+**
+** After walking the whole tree, if no nodes are found that disqualify
+** the expression as constant, then we assume the whole expression
+** is constant. See sqlite3ExprIsConstant() for additional information.
+*/
+static int exprNodeIsConstant(void *pArg, Expr *pExpr){
+ switch( pExpr->op ){
+ /* Consider functions to be constant if all their arguments are constant
+ ** and *pArg==2 */
+ case TK_FUNCTION:
+ if( *((int*)pArg)==2 ) return 0;
+ /* Fall through */
+ case TK_ID:
+ case TK_COLUMN:
+ case TK_DOT:
+ case TK_AGG_FUNCTION:
+ case TK_AGG_COLUMN:
+#ifndef SQLITE_OMIT_SUBQUERY
+ case TK_SELECT:
+ case TK_EXISTS:
+#endif
+ *((int*)pArg) = 0;
+ return 2;
+ case TK_IN:
+ if( pExpr->pSelect ){
+ *((int*)pArg) = 0;
+ return 2;
+ }
+ default:
+ return 0;
+ }
+}
+
+/*
+** Walk an expression tree. Return 1 if the expression is constant
+** and 0 if it involves variables or function calls.
+**
+** For the purposes of this function, a double-quoted string (ex: "abc")
+** is considered a variable but a single-quoted string (ex: 'abc') is
+** a constant.
+*/
+int sqlite3ExprIsConstant(Expr *p){
+ int isConst = 1;
+ walkExprTree(p, exprNodeIsConstant, &isConst);
+ return isConst;
+}
+
+/*
+** Walk an expression tree. Return 1 if the expression is constant
+** or a function call with constant arguments. Return and 0 if there
+** are any variables.
+**
+** For the purposes of this function, a double-quoted string (ex: "abc")
+** is considered a variable but a single-quoted string (ex: 'abc') is
+** a constant.
+*/
+int sqlite3ExprIsConstantOrFunction(Expr *p){
+ int isConst = 2;
+ walkExprTree(p, exprNodeIsConstant, &isConst);
+ return isConst!=0;
+}
+
+/*
+** If the expression p codes a constant integer that is small enough
+** to fit in a 32-bit integer, return 1 and put the value of the integer
+** in *pValue. If the expression is not an integer or if it is too big
+** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.
+*/
+int sqlite3ExprIsInteger(Expr *p, int *pValue){
+ switch( p->op ){
+ case TK_INTEGER: {
+ if( sqlite3GetInt32(p->token.z, pValue) ){
+ return 1;
+ }
+ break;
+ }
+ case TK_UPLUS: {
+ return sqlite3ExprIsInteger(p->pLeft, pValue);
+ }
+ case TK_UMINUS: {
+ int v;
+ if( sqlite3ExprIsInteger(p->pLeft, &v) ){
+ *pValue = -v;
+ return 1;
+ }
+ break;
+ }
+ default: break;
+ }
+ return 0;
+}
+
+/*
+** Return TRUE if the given string is a row-id column name.
+*/
+int sqlite3IsRowid(const char *z){
+ if( sqlite3StrICmp(z, "_ROWID_")==0 ) return 1;
+ if( sqlite3StrICmp(z, "ROWID")==0 ) return 1;
+ if( sqlite3StrICmp(z, "OID")==0 ) return 1;
+ return 0;
+}
+
+/*
+** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up
+** that name in the set of source tables in pSrcList and make the pExpr
+** expression node refer back to that source column. The following changes
+** are made to pExpr:
+**
+** pExpr->iDb Set the index in db->aDb[] of the database holding
+** the table.
+** pExpr->iTable Set to the cursor number for the table obtained
+** from pSrcList.
+** pExpr->iColumn Set to the column number within the table.
+** pExpr->op Set to TK_COLUMN.
+** pExpr->pLeft Any expression this points to is deleted
+** pExpr->pRight Any expression this points to is deleted.
+**
+** The pDbToken is the name of the database (the "X"). This value may be
+** NULL meaning that name is of the form Y.Z or Z. Any available database
+** can be used. The pTableToken is the name of the table (the "Y"). This
+** value can be NULL if pDbToken is also NULL. If pTableToken is NULL it
+** means that the form of the name is Z and that columns from any table
+** can be used.
+**
+** If the name cannot be resolved unambiguously, leave an error message
+** in pParse and return non-zero. Return zero on success.
+*/
+static int lookupName(
+ Parse *pParse, /* The parsing context */
+ Token *pDbToken, /* Name of the database containing table, or NULL */
+ Token *pTableToken, /* Name of table containing column, or NULL */
+ Token *pColumnToken, /* Name of the column. */
+ NameContext *pNC, /* The name context used to resolve the name */
+ Expr *pExpr /* Make this EXPR node point to the selected column */
+){
+ char *zDb = 0; /* Name of the database. The "X" in X.Y.Z */
+ char *zTab = 0; /* Name of the table. The "Y" in X.Y.Z or Y.Z */
+ char *zCol = 0; /* Name of the column. The "Z" */
+ int i, j; /* Loop counters */
+ int cnt = 0; /* Number of matching column names */
+ int cntTab = 0; /* Number of matching table names */
+ sqlite3 *db = pParse->db; /* The database */
+ struct SrcList_item *pItem; /* Use for looping over pSrcList items */
+ struct SrcList_item *pMatch = 0; /* The matching pSrcList item */
+ NameContext *pTopNC = pNC; /* First namecontext in the list */
+
+ assert( pColumnToken && pColumnToken->z ); /* The Z in X.Y.Z cannot be NULL */
+ zDb = sqlite3NameFromToken(pDbToken);
+ zTab = sqlite3NameFromToken(pTableToken);
+ zCol = sqlite3NameFromToken(pColumnToken);
+ if( sqlite3_malloc_failed ){
+ goto lookupname_end;
+ }
+
+ pExpr->iTable = -1;
+ while( pNC && cnt==0 ){
+ SrcList *pSrcList = pNC->pSrcList;
+ ExprList *pEList = pNC->pEList;
+
+ /* assert( zTab==0 || pEList==0 ); */
+ if( pSrcList ){
+ for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){
+ Table *pTab = pItem->pTab;
+ Column *pCol;
+
+ if( pTab==0 ) continue;
+ assert( pTab->nCol>0 );
+ if( zTab ){
+ if( pItem->zAlias ){
+ char *zTabName = pItem->zAlias;
+ if( sqlite3StrICmp(zTabName, zTab)!=0 ) continue;
+ }else{
+ char *zTabName = pTab->zName;
+ if( zTabName==0 || sqlite3StrICmp(zTabName, zTab)!=0 ) continue;
+ if( zDb!=0 && sqlite3StrICmp(db->aDb[pTab->iDb].zName, zDb)!=0 ){
+ continue;
+ }
+ }
+ }
+ if( 0==(cntTab++) ){
+ pExpr->iTable = pItem->iCursor;
+ pExpr->iDb = pTab->iDb;
+ pMatch = pItem;
+ }
+ for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){
+ if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
+ IdList *pUsing;
+ cnt++;
+ pExpr->iTable = pItem->iCursor;
+ pMatch = pItem;
+ pExpr->iDb = pTab->iDb;
+ /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */
+ pExpr->iColumn = j==pTab->iPKey ? -1 : j;
+ pExpr->affinity = pTab->aCol[j].affinity;
+ pExpr->pColl = pTab->aCol[j].pColl;
+ if( pItem->jointype & JT_NATURAL ){
+ /* If this match occurred in the left table of a natural join,
+ ** then skip the right table to avoid a duplicate match */
+ pItem++;
+ i++;
+ }
+ if( (pUsing = pItem->pUsing)!=0 ){
+ /* If this match occurs on a column that is in the USING clause
+ ** of a join, skip the search of the right table of the join
+ ** to avoid a duplicate match there. */
+ int k;
+ for(k=0; k<pUsing->nId; k++){
+ if( sqlite3StrICmp(pUsing->a[k].zName, zCol)==0 ){
+ pItem++;
+ i++;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+
+#ifndef SQLITE_OMIT_TRIGGER
+ /* If we have not already resolved the name, then maybe
+ ** it is a new.* or old.* trigger argument reference
+ */
+ if( zDb==0 && zTab!=0 && cnt==0 && pParse->trigStack!=0 ){
+ TriggerStack *pTriggerStack = pParse->trigStack;
+ Table *pTab = 0;
+ if( pTriggerStack->newIdx != -1 && sqlite3StrICmp("new", zTab) == 0 ){
+ pExpr->iTable = pTriggerStack->newIdx;
+ assert( pTriggerStack->pTab );
+ pTab = pTriggerStack->pTab;
+ }else if( pTriggerStack->oldIdx != -1 && sqlite3StrICmp("old", zTab)==0 ){
+ pExpr->iTable = pTriggerStack->oldIdx;
+ assert( pTriggerStack->pTab );
+ pTab = pTriggerStack->pTab;
+ }
+
+ if( pTab ){
+ int j;
+ Column *pCol = pTab->aCol;
+
+ pExpr->iDb = pTab->iDb;
+ cntTab++;
+ for(j=0; j < pTab->nCol; j++, pCol++) {
+ if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
+ cnt++;
+ pExpr->iColumn = j==pTab->iPKey ? -1 : j;
+ pExpr->affinity = pTab->aCol[j].affinity;
+ pExpr->pColl = pTab->aCol[j].pColl;
+ pExpr->pTab = pTab;
+ break;
+ }
+ }
+ }
+ }
+#endif /* !defined(SQLITE_OMIT_TRIGGER) */
+
+ /*
+ ** Perhaps the name is a reference to the ROWID
+ */
+ if( cnt==0 && cntTab==1 && sqlite3IsRowid(zCol) ){
+ cnt = 1;
+ pExpr->iColumn = -1;
+ pExpr->affinity = SQLITE_AFF_INTEGER;
+ }
+
+ /*
+ ** If the input is of the form Z (not Y.Z or X.Y.Z) then the name Z
+ ** might refer to an result-set alias. This happens, for example, when
+ ** we are resolving names in the WHERE clause of the following command:
+ **
+ ** SELECT a+b AS x FROM table WHERE x<10;
+ **
+ ** In cases like this, replace pExpr with a copy of the expression that
+ ** forms the result set entry ("a+b" in the example) and return immediately.
+ ** Note that the expression in the result set should have already been
+ ** resolved by the time the WHERE clause is resolved.
+ */
+ if( cnt==0 && pEList!=0 && zTab==0 ){
+ for(j=0; j<pEList->nExpr; j++){
+ char *zAs = pEList->a[j].zName;
+ if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){
+ assert( pExpr->pLeft==0 && pExpr->pRight==0 );
+ pExpr->op = TK_AS;
+ pExpr->iColumn = j;
+ pExpr->pLeft = sqlite3ExprDup(pEList->a[j].pExpr);
+ cnt = 1;
+ assert( zTab==0 && zDb==0 );
+ goto lookupname_end_2;
+ }
+ }
+ }
+
+ /* Advance to the next name context. The loop will exit when either
+ ** we have a match (cnt>0) or when we run out of name contexts.
+ */
+ if( cnt==0 ){
+ pNC = pNC->pNext;
+ }
+ }
+
+ /*
+ ** If X and Y are NULL (in other words if only the column name Z is
+ ** supplied) and the value of Z is enclosed in double-quotes, then
+ ** Z is a string literal if it doesn't match any column names. In that
+ ** case, we need to return right away and not make any changes to
+ ** pExpr.
+ **
+ ** Because no reference was made to outer contexts, the pNC->nRef
+ ** fields are not changed in any context.
+ */
+ if( cnt==0 && zTab==0 && pColumnToken->z[0]=='"' ){
+ sqliteFree(zCol);
+ return 0;
+ }
+
+ /*
+ ** cnt==0 means there was not match. cnt>1 means there were two or
+ ** more matches. Either way, we have an error.
+ */
+ if( cnt!=1 ){
+ char *z = 0;
+ char *zErr;
+ zErr = cnt==0 ? "no such column: %s" : "ambiguous column name: %s";
+ if( zDb ){
+ sqlite3SetString(&z, zDb, ".", zTab, ".", zCol, 0);
+ }else if( zTab ){
+ sqlite3SetString(&z, zTab, ".", zCol, 0);
+ }else{
+ z = sqliteStrDup(zCol);
+ }
+ sqlite3ErrorMsg(pParse, zErr, z);
+ sqliteFree(z);
+ pTopNC->nErr++;
+ }
+
+ /* If a column from a table in pSrcList is referenced, then record
+ ** this fact in the pSrcList.a[].colUsed bitmask. Column 0 causes
+ ** bit 0 to be set. Column 1 sets bit 1. And so forth. If the
+ ** column number is greater than the number of bits in the bitmask
+ ** then set the high-order bit of the bitmask.
+ */
+ if( pExpr->iColumn>=0 && pMatch!=0 ){
+ int n = pExpr->iColumn;
+ if( n>=sizeof(Bitmask)*8 ){
+ n = sizeof(Bitmask)*8-1;
+ }
+ assert( pMatch->iCursor==pExpr->iTable );
+ pMatch->colUsed |= 1<<n;
+ }
+
+lookupname_end:
+ /* Clean up and return
+ */
+ sqliteFree(zDb);
+ sqliteFree(zTab);
+ sqlite3ExprDelete(pExpr->pLeft);
+ pExpr->pLeft = 0;
+ sqlite3ExprDelete(pExpr->pRight);
+ pExpr->pRight = 0;
+ pExpr->op = TK_COLUMN;
+lookupname_end_2:
+ sqliteFree(zCol);
+ if( cnt==1 ){
+ assert( pNC!=0 );
+ sqlite3AuthRead(pParse, pExpr, pNC->pSrcList);
+ if( pMatch && !pMatch->pSelect ){
+ pExpr->pTab = pMatch->pTab;
+ }
+ /* Increment the nRef value on all name contexts from TopNC up to
+ ** the point where the name matched. */
+ for(;;){
+ assert( pTopNC!=0 );
+ pTopNC->nRef++;
+ if( pTopNC==pNC ) break;
+ pTopNC = pTopNC->pNext;
+ }
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+/*
+** This routine is designed as an xFunc for walkExprTree().
+**
+** Resolve symbolic names into TK_COLUMN operators for the current
+** node in the expression tree. Return 0 to continue the search down
+** the tree or 2 to abort the tree walk.
+**
+** This routine also does error checking and name resolution for
+** function names. The operator for aggregate functions is changed
+** to TK_AGG_FUNCTION.
+*/
+static int nameResolverStep(void *pArg, Expr *pExpr){
+ NameContext *pNC = (NameContext*)pArg;
+ SrcList *pSrcList;
+ Parse *pParse;
+
+ if( pExpr==0 ) return 1;
+ assert( pNC!=0 );
+ pSrcList = pNC->pSrcList;
+ pParse = pNC->pParse;
+
+ if( ExprHasAnyProperty(pExpr, EP_Resolved) ) return 1;
+ ExprSetProperty(pExpr, EP_Resolved);
+#ifndef NDEBUG
+ if( pSrcList ){
+ int i;
+ for(i=0; i<pSrcList->nSrc; i++){
+ assert( pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursor<pParse->nTab);
+ }
+ }
+#endif
+ switch( pExpr->op ){
+ /* Double-quoted strings (ex: "abc") are used as identifiers if
+ ** possible. Otherwise they remain as strings. Single-quoted
+ ** strings (ex: 'abc') are always string literals.
+ */
+ case TK_STRING: {
+ if( pExpr->token.z[0]=='\'' ) break;
+ /* Fall thru into the TK_ID case if this is a double-quoted string */
+ }
+ /* A lone identifier is the name of a column.
+ */
+ case TK_ID: {
+ lookupName(pParse, 0, 0, &pExpr->token, pNC, pExpr);
+ return 1;
+ }
+
+ /* A table name and column name: ID.ID
+ ** Or a database, table and column: ID.ID.ID
+ */
+ case TK_DOT: {
+ Token *pColumn;
+ Token *pTable;
+ Token *pDb;
+ Expr *pRight;
+
+ /* if( pSrcList==0 ) break; */
+ pRight = pExpr->pRight;
+ if( pRight->op==TK_ID ){
+ pDb = 0;
+ pTable = &pExpr->pLeft->token;
+ pColumn = &pRight->token;
+ }else{
+ assert( pRight->op==TK_DOT );
+ pDb = &pExpr->pLeft->token;
+ pTable = &pRight->pLeft->token;
+ pColumn = &pRight->pRight->token;
+ }
+ lookupName(pParse, pDb, pTable, pColumn, pNC, pExpr);
+ return 1;
+ }
+
+ /* Resolve function names
+ */
+ case TK_CONST_FUNC:
+ case TK_FUNCTION: {
+ ExprList *pList = pExpr->pList; /* The argument list */
+ int n = pList ? pList->nExpr : 0; /* Number of arguments */
+ int no_such_func = 0; /* True if no such function exists */
+ int wrong_num_args = 0; /* True if wrong number of arguments */
+ int is_agg = 0; /* True if is an aggregate function */
+ int i;
+ int nId; /* Number of characters in function name */
+ const char *zId; /* The function name. */
+ FuncDef *pDef; /* Information about the function */
+ int enc = pParse->db->enc; /* The database encoding */
+
+ zId = pExpr->token.z;
+ nId = pExpr->token.n;
+ pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0);
+ if( pDef==0 ){
+ pDef = sqlite3FindFunction(pParse->db, zId, nId, -1, enc, 0);
+ if( pDef==0 ){
+ no_such_func = 1;
+ }else{
+ wrong_num_args = 1;
+ }
+ }else{
+ is_agg = pDef->xFunc==0;
+ }
+ if( is_agg && !pNC->allowAgg ){
+ sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
+ pNC->nErr++;
+ is_agg = 0;
+ }else if( no_such_func ){
+ sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId);
+ pNC->nErr++;
+ }else if( wrong_num_args ){
+ sqlite3ErrorMsg(pParse,"wrong number of arguments to function %.*s()",
+ nId, zId);
+ pNC->nErr++;
+ }
+ if( is_agg ){
+ pExpr->op = TK_AGG_FUNCTION;
+ pNC->hasAgg = 1;
+ }
+ if( is_agg ) pNC->allowAgg = 0;
+ for(i=0; pNC->nErr==0 && i<n; i++){
+ walkExprTree(pList->a[i].pExpr, nameResolverStep, pNC);
+ }
+ if( is_agg ) pNC->allowAgg = 1;
+ /* FIX ME: Compute pExpr->affinity based on the expected return
+ ** type of the function
+ */
+ return is_agg;
+ }
+#ifndef SQLITE_OMIT_SUBQUERY
+ case TK_SELECT:
+ case TK_EXISTS:
+#endif
+ case TK_IN: {
+ if( pExpr->pSelect ){
+ int nRef = pNC->nRef;
+ sqlite3SelectResolve(pParse, pExpr->pSelect, pNC);
+ assert( pNC->nRef>=nRef );
+ if( nRef!=pNC->nRef ){
+ ExprSetProperty(pExpr, EP_VarSelect);
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+/*
+** This routine walks an expression tree and resolves references to
+** table columns. Nodes of the form ID.ID or ID resolve into an
+** index to the table in the table list and a column offset. The
+** Expr.opcode for such nodes is changed to TK_COLUMN. The Expr.iTable
+** value is changed to the index of the referenced table in pTabList
+** plus the "base" value. The base value will ultimately become the
+** VDBE cursor number for a cursor that is pointing into the referenced
+** table. The Expr.iColumn value is changed to the index of the column
+** of the referenced table. The Expr.iColumn value for the special
+** ROWID column is -1. Any INTEGER PRIMARY KEY column is tried as an
+** alias for ROWID.
+**
+** Also resolve function names and check the functions for proper
+** usage. Make sure all function names are recognized and all functions
+** have the correct number of arguments. Leave an error message
+** in pParse->zErrMsg if anything is amiss. Return the number of errors.
+**
+** If the expression contains aggregate functions then set the EP_Agg
+** property on the expression.
+*/
+int sqlite3ExprResolveNames(
+ NameContext *pNC, /* Namespace to resolve expressions in. */
+ Expr *pExpr /* The expression to be analyzed. */
+){
+ int savedHasAgg;
+ if( pExpr==0 ) return 0;
+ savedHasAgg = pNC->hasAgg;
+ pNC->hasAgg = 0;
+ walkExprTree(pExpr, nameResolverStep, pNC);
+ if( pNC->nErr>0 ){
+ ExprSetProperty(pExpr, EP_Error);
+ }
+ if( pNC->hasAgg ){
+ ExprSetProperty(pExpr, EP_Agg);
+ }else if( savedHasAgg ){
+ pNC->hasAgg = 1;
+ }
+ return ExprHasProperty(pExpr, EP_Error);
+}
+
+/*
+** A pointer instance of this structure is used to pass information
+** through walkExprTree into codeSubqueryStep().
+*/
+typedef struct QueryCoder QueryCoder;
+struct QueryCoder {
+ Parse *pParse; /* The parsing context */
+ NameContext *pNC; /* Namespace of first enclosing query */
+};
+
+
+/*
+** Generate code for subqueries and IN operators.
+**
+** IN operators comes in two forms:
+**
+** expr IN (exprlist)
+** and
+** expr IN (SELECT ...)
+**
+** The first form is handled by creating a set holding the list
+** of allowed values. The second form causes the SELECT to generate
+** a temporary table.
+*/
+#ifndef SQLITE_OMIT_SUBQUERY
+void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
+ int testAddr = 0; /* One-time test address */
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ if( v==0 ) return;
+
+ /* This code must be run in its entirety every time it is encountered
+ ** if any of the following is true:
+ **
+ ** * The right-hand side is a correlated subquery
+ ** * The right-hand side is an expression list containing variables
+ ** * We are inside a trigger
+ **
+ ** If all of the above are false, then we can run this code just once
+ ** save the results, and reuse the same result on subsequent invocations.
+ */
+ if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->trigStack ){
+ int mem = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_MemLoad, mem, 0);
+ testAddr = sqlite3VdbeAddOp(v, OP_If, 0, 0);
+ assert( testAddr>0 || sqlite3_malloc_failed );
+ sqlite3VdbeAddOp(v, OP_MemInt, 1, mem);
+ }
+
+ switch( pExpr->op ){
+ case TK_IN: {
+ char affinity;
+ KeyInfo keyInfo;
+ int addr; /* Address of OP_OpenVirtual instruction */
+
+ affinity = sqlite3ExprAffinity(pExpr->pLeft);
+
+ /* Whether this is an 'x IN(SELECT...)' or an 'x IN(<exprlist>)'
+ ** expression it is handled the same way. A virtual table is
+ ** filled with single-field index keys representing the results
+ ** from the SELECT or the <exprlist>.
+ **
+ ** If the 'x' expression is a column value, or the SELECT...
+ ** statement returns a column value, then the affinity of that
+ ** column is used to build the index keys. If both 'x' and the
+ ** SELECT... statement are columns, then numeric affinity is used
+ ** if either column has NUMERIC or INTEGER affinity. If neither
+ ** 'x' nor the SELECT... statement are columns, then numeric affinity
+ ** is used.
+ */
+ pExpr->iTable = pParse->nTab++;
+ addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, pExpr->iTable, 0);
+ memset(&keyInfo, 0, sizeof(keyInfo));
+ keyInfo.nField = 1;
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, pExpr->iTable, 1);
+
+ if( pExpr->pSelect ){
+ /* Case 1: expr IN (SELECT ...)
+ **
+ ** Generate code to write the results of the select into the temporary
+ ** table allocated and opened above.
+ */
+ int iParm = pExpr->iTable + (((int)affinity)<<16);
+ ExprList *pEList;
+ assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable );
+ sqlite3Select(pParse, pExpr->pSelect, SRT_Set, iParm, 0, 0, 0, 0);
+ pEList = pExpr->pSelect->pEList;
+ if( pEList && pEList->nExpr>0 ){
+ keyInfo.aColl[0] = binaryCompareCollSeq(pParse, pExpr->pLeft,
+ pEList->a[0].pExpr);
+ }
+ }else if( pExpr->pList ){
+ /* Case 2: expr IN (exprlist)
+ **
+ ** For each expression, build an index key from the evaluation and
+ ** store it in the temporary table. If <expr> is a column, then use
+ ** that columns affinity when building index keys. If <expr> is not
+ ** a column, use numeric affinity.
+ */
+ int i;
+ ExprList *pList = pExpr->pList;
+ struct ExprList_item *pItem;
+
+ if( !affinity ){
+ affinity = SQLITE_AFF_NUMERIC;
+ }
+ keyInfo.aColl[0] = pExpr->pLeft->pColl;
+
+ /* Loop through each expression in <exprlist>. */
+ for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
+ Expr *pE2 = pItem->pExpr;
+
+ /* If the expression is not constant then we will need to
+ ** disable the test that was generated above that makes sure
+ ** this code only executes once. Because for a non-constant
+ ** expression we need to rerun this code each time.
+ */
+ if( testAddr>0 && !sqlite3ExprIsConstant(pE2) ){
+ VdbeOp *aOp = sqlite3VdbeGetOp(v, testAddr-1);
+ int i;
+ for(i=0; i<3; i++){
+ aOp[i].opcode = OP_Noop;
+ }
+ testAddr = 0;
+ }
+
+ /* Evaluate the expression and insert it into the temp table */
+ sqlite3ExprCode(pParse, pE2);
+ sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &affinity, 1);
+ sqlite3VdbeAddOp(v, OP_IdxInsert, pExpr->iTable, 0);
+ }
+ }
+ sqlite3VdbeChangeP3(v, addr, (void *)&keyInfo, P3_KEYINFO);
+ break;
+ }
+
+ case TK_EXISTS:
+ case TK_SELECT: {
+ /* This has to be a scalar SELECT. Generate code to put the
+ ** value of this select in a memory cell and record the number
+ ** of the memory cell in iColumn.
+ */
+ int sop;
+ Select *pSel;
+
+ pExpr->iColumn = pParse->nMem++;
+ pSel = pExpr->pSelect;
+ if( pExpr->op==TK_SELECT ){
+ sop = SRT_Mem;
+ }else{
+ static const Token one = { "1", 0, 1 };
+ sop = SRT_Exists;
+ sqlite3ExprListDelete(pSel->pEList);
+ pSel->pEList = sqlite3ExprListAppend(0,
+ sqlite3Expr(TK_INTEGER, 0, 0, &one), 0);
+ }
+ sqlite3Select(pParse, pSel, sop, pExpr->iColumn, 0, 0, 0, 0);
+ break;
+ }
+ }
+
+ if( testAddr ){
+ sqlite3VdbeJumpHere(v, testAddr);
+ }
+ return;
+}
+#endif /* SQLITE_OMIT_SUBQUERY */
+
+/*
+** Generate an instruction that will put the integer describe by
+** text z[0..n-1] on the stack.
+*/
+static void codeInteger(Vdbe *v, const char *z, int n){
+ int i;
+ if( sqlite3GetInt32(z, &i) ){
+ sqlite3VdbeAddOp(v, OP_Integer, i, 0);
+ }else if( sqlite3FitsIn64Bits(z) ){
+ sqlite3VdbeOp3(v, OP_Int64, 0, 0, z, n);
+ }else{
+ sqlite3VdbeOp3(v, OP_Real, 0, 0, z, n);
+ }
+}
+
+/*
+** Generate code into the current Vdbe to evaluate the given
+** expression and leave the result on the top of stack.
+**
+** This code depends on the fact that certain token values (ex: TK_EQ)
+** are the same as opcode values (ex: OP_Eq) that implement the corresponding
+** operation. Special comments in vdbe.c and the mkopcodeh.awk script in
+** the make process cause these values to align. Assert()s in the code
+** below verify that the numbers are aligned correctly.
+*/
+void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
+ Vdbe *v = pParse->pVdbe;
+ int op;
+ if( v==0 ) return;
+ if( pExpr==0 ){
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ return;
+ }
+ op = pExpr->op;
+ switch( op ){
+ case TK_AGG_COLUMN: {
+ AggInfo *pAggInfo = pExpr->pAggInfo;
+ struct AggInfo_col *pCol = &pAggInfo->aCol[pExpr->iAgg];
+ if( !pAggInfo->directMode ){
+ sqlite3VdbeAddOp(v, OP_MemLoad, pCol->iMem, 0);
+ break;
+ }else if( pAggInfo->useSortingIdx ){
+ sqlite3VdbeAddOp(v, OP_Column, pAggInfo->sortingIdx,
+ pCol->iSorterColumn);
+ break;
+ }
+ /* Otherwise, fall thru into the TK_COLUMN case */
+ }
+ case TK_COLUMN: {
+ if( pExpr->iColumn>=0 ){
+ sqlite3VdbeAddOp(v, OP_Column, pExpr->iTable, pExpr->iColumn);
+ sqlite3ColumnDefault(v, pExpr->pTab, pExpr->iColumn);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Rowid, pExpr->iTable, 0);
+ }
+ break;
+ }
+ case TK_INTEGER: {
+ codeInteger(v, pExpr->token.z, pExpr->token.n);
+ break;
+ }
+ case TK_FLOAT:
+ case TK_STRING: {
+ assert( TK_FLOAT==OP_Real );
+ assert( TK_STRING==OP_String8 );
+ sqlite3DequoteExpr(pExpr);
+ sqlite3VdbeOp3(v, op, 0, 0, pExpr->token.z, pExpr->token.n);
+ break;
+ }
+ case TK_NULL: {
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ break;
+ }
+#ifndef SQLITE_OMIT_BLOB_LITERAL
+ case TK_BLOB: {
+ int n;
+ const char *z;
+ assert( TK_BLOB==OP_HexBlob );
+ n = pExpr->token.n - 3;
+ z = pExpr->token.z + 2;
+ assert( n>=0 );
+ if( n==0 ){
+ z = "";
+ }
+ sqlite3VdbeOp3(v, op, 0, 0, z, n);
+ break;
+ }
+#endif
+ case TK_VARIABLE: {
+ sqlite3VdbeAddOp(v, OP_Variable, pExpr->iTable, 0);
+ if( pExpr->token.n>1 ){
+ sqlite3VdbeChangeP3(v, -1, pExpr->token.z, pExpr->token.n);
+ }
+ break;
+ }
+ case TK_REGISTER: {
+ sqlite3VdbeAddOp(v, OP_MemLoad, pExpr->iTable, 0);
+ break;
+ }
+#ifndef SQLITE_OMIT_CAST
+ case TK_CAST: {
+ /* Expressions of the form: CAST(pLeft AS token) */
+ int aff, op;
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ aff = sqlite3AffinityType(&pExpr->token);
+ switch( aff ){
+ case SQLITE_AFF_INTEGER: op = OP_ToInt; break;
+ case SQLITE_AFF_NUMERIC: op = OP_ToNumeric; break;
+ case SQLITE_AFF_TEXT: op = OP_ToText; break;
+ case SQLITE_AFF_NONE: op = OP_ToBlob; break;
+ }
+ sqlite3VdbeAddOp(v, op, 0, 0);
+ break;
+ }
+#endif /* SQLITE_OMIT_CAST */
+ case TK_LT:
+ case TK_LE:
+ case TK_GT:
+ case TK_GE:
+ case TK_NE:
+ case TK_EQ: {
+ assert( TK_LT==OP_Lt );
+ assert( TK_LE==OP_Le );
+ assert( TK_GT==OP_Gt );
+ assert( TK_GE==OP_Ge );
+ assert( TK_EQ==OP_Eq );
+ assert( TK_NE==OP_Ne );
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ sqlite3ExprCode(pParse, pExpr->pRight);
+ codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, 0, 0);
+ break;
+ }
+ case TK_AND:
+ case TK_OR:
+ case TK_PLUS:
+ case TK_STAR:
+ case TK_MINUS:
+ case TK_REM:
+ case TK_BITAND:
+ case TK_BITOR:
+ case TK_SLASH:
+ case TK_LSHIFT:
+ case TK_RSHIFT:
+ case TK_CONCAT: {
+ assert( TK_AND==OP_And );
+ assert( TK_OR==OP_Or );
+ assert( TK_PLUS==OP_Add );
+ assert( TK_MINUS==OP_Subtract );
+ assert( TK_REM==OP_Remainder );
+ assert( TK_BITAND==OP_BitAnd );
+ assert( TK_BITOR==OP_BitOr );
+ assert( TK_SLASH==OP_Divide );
+ assert( TK_LSHIFT==OP_ShiftLeft );
+ assert( TK_RSHIFT==OP_ShiftRight );
+ assert( TK_CONCAT==OP_Concat );
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ sqlite3ExprCode(pParse, pExpr->pRight);
+ sqlite3VdbeAddOp(v, op, 0, 0);
+ break;
+ }
+ case TK_UMINUS: {
+ Expr *pLeft = pExpr->pLeft;
+ assert( pLeft );
+ if( pLeft->op==TK_FLOAT || pLeft->op==TK_INTEGER ){
+ Token *p = &pLeft->token;
+ char *z = sqliteMalloc( p->n + 2 );
+ sprintf(z, "-%.*s", p->n, p->z);
+ if( pLeft->op==TK_FLOAT ){
+ sqlite3VdbeOp3(v, OP_Real, 0, 0, z, p->n+1);
+ }else{
+ codeInteger(v, z, p->n+1);
+ }
+ sqliteFree(z);
+ break;
+ }
+ /* Fall through into TK_NOT */
+ }
+ case TK_BITNOT:
+ case TK_NOT: {
+ assert( TK_BITNOT==OP_BitNot );
+ assert( TK_NOT==OP_Not );
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ sqlite3VdbeAddOp(v, op, 0, 0);
+ break;
+ }
+ case TK_ISNULL:
+ case TK_NOTNULL: {
+ int dest;
+ assert( TK_ISNULL==OP_IsNull );
+ assert( TK_NOTNULL==OP_NotNull );
+ sqlite3VdbeAddOp(v, OP_Integer, 1, 0);
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ dest = sqlite3VdbeCurrentAddr(v) + 2;
+ sqlite3VdbeAddOp(v, op, 1, dest);
+ sqlite3VdbeAddOp(v, OP_AddImm, -1, 0);
+ break;
+ }
+ case TK_AGG_FUNCTION: {
+ AggInfo *pInfo = pExpr->pAggInfo;
+ sqlite3VdbeAddOp(v, OP_MemLoad, pInfo->aFunc[pExpr->iAgg].iMem, 0);
+ break;
+ }
+ case TK_CONST_FUNC:
+ case TK_FUNCTION: {
+ ExprList *pList = pExpr->pList;
+ int nExpr = pList ? pList->nExpr : 0;
+ FuncDef *pDef;
+ int nId;
+ const char *zId;
+ int constMask = 0;
+ int i;
+ u8 enc = pParse->db->enc;
+ CollSeq *pColl = 0;
+ zId = pExpr->token.z;
+ nId = pExpr->token.n;
+ pDef = sqlite3FindFunction(pParse->db, zId, nId, nExpr, enc, 0);
+ assert( pDef!=0 );
+ nExpr = sqlite3ExprCodeExprList(pParse, pList);
+ for(i=0; i<nExpr && i<32; i++){
+ if( sqlite3ExprIsConstant(pList->a[i].pExpr) ){
+ constMask |= (1<<i);
+ }
+ if( pDef->needCollSeq && !pColl ){
+ pColl = sqlite3ExprCollSeq(pParse, pList->a[i].pExpr);
+ }
+ }
+ if( pDef->needCollSeq ){
+ if( !pColl ) pColl = pParse->db->pDfltColl;
+ sqlite3VdbeOp3(v, OP_CollSeq, 0, 0, (char *)pColl, P3_COLLSEQ);
+ }
+ sqlite3VdbeOp3(v, OP_Function, constMask, nExpr, (char*)pDef, P3_FUNCDEF);
+ break;
+ }
+#ifndef SQLITE_OMIT_SUBQUERY
+ case TK_EXISTS:
+ case TK_SELECT: {
+ sqlite3CodeSubselect(pParse, pExpr);
+ sqlite3VdbeAddOp(v, OP_MemLoad, pExpr->iColumn, 0);
+ VdbeComment((v, "# load subquery result"));
+ break;
+ }
+ case TK_IN: {
+ int addr;
+ char affinity;
+ sqlite3CodeSubselect(pParse, pExpr);
+
+ /* Figure out the affinity to use to create a key from the results
+ ** of the expression. affinityStr stores a static string suitable for
+ ** P3 of OP_MakeRecord.
+ */
+ affinity = comparisonAffinity(pExpr);
+
+ sqlite3VdbeAddOp(v, OP_Integer, 1, 0);
+
+ /* Code the <expr> from "<expr> IN (...)". The temporary table
+ ** pExpr->iTable contains the values that make up the (...) set.
+ */
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ addr = sqlite3VdbeCurrentAddr(v);
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, addr+4); /* addr + 0 */
+ sqlite3VdbeAddOp(v, OP_Pop, 2, 0);
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, addr+7);
+ sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &affinity, 1); /* addr + 4 */
+ sqlite3VdbeAddOp(v, OP_Found, pExpr->iTable, addr+7);
+ sqlite3VdbeAddOp(v, OP_AddImm, -1, 0); /* addr + 6 */
+
+ break;
+ }
+#endif
+ case TK_BETWEEN: {
+ Expr *pLeft = pExpr->pLeft;
+ struct ExprList_item *pLItem = pExpr->pList->a;
+ Expr *pRight = pLItem->pExpr;
+ sqlite3ExprCode(pParse, pLeft);
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ sqlite3ExprCode(pParse, pRight);
+ codeCompare(pParse, pLeft, pRight, OP_Ge, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ pLItem++;
+ pRight = pLItem->pExpr;
+ sqlite3ExprCode(pParse, pRight);
+ codeCompare(pParse, pLeft, pRight, OP_Le, 0, 0);
+ sqlite3VdbeAddOp(v, OP_And, 0, 0);
+ break;
+ }
+ case TK_UPLUS:
+ case TK_AS: {
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ break;
+ }
+ case TK_CASE: {
+ int expr_end_label;
+ int jumpInst;
+ int nExpr;
+ int i;
+ ExprList *pEList;
+ struct ExprList_item *aListelem;
+
+ assert(pExpr->pList);
+ assert((pExpr->pList->nExpr % 2) == 0);
+ assert(pExpr->pList->nExpr > 0);
+ pEList = pExpr->pList;
+ aListelem = pEList->a;
+ nExpr = pEList->nExpr;
+ expr_end_label = sqlite3VdbeMakeLabel(v);
+ if( pExpr->pLeft ){
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ }
+ for(i=0; i<nExpr; i=i+2){
+ sqlite3ExprCode(pParse, aListelem[i].pExpr);
+ if( pExpr->pLeft ){
+ sqlite3VdbeAddOp(v, OP_Dup, 1, 1);
+ jumpInst = codeCompare(pParse, pExpr->pLeft, aListelem[i].pExpr,
+ OP_Ne, 0, 1);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ }else{
+ jumpInst = sqlite3VdbeAddOp(v, OP_IfNot, 1, 0);
+ }
+ sqlite3ExprCode(pParse, aListelem[i+1].pExpr);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, expr_end_label);
+ sqlite3VdbeJumpHere(v, jumpInst);
+ }
+ if( pExpr->pLeft ){
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ }
+ if( pExpr->pRight ){
+ sqlite3ExprCode(pParse, pExpr->pRight);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ }
+ sqlite3VdbeResolveLabel(v, expr_end_label);
+ break;
+ }
+#ifndef SQLITE_OMIT_TRIGGER
+ case TK_RAISE: {
+ if( !pParse->trigStack ){
+ sqlite3ErrorMsg(pParse,
+ "RAISE() may only be used within a trigger-program");
+ return;
+ }
+ if( pExpr->iColumn!=OE_Ignore ){
+ assert( pExpr->iColumn==OE_Rollback ||
+ pExpr->iColumn == OE_Abort ||
+ pExpr->iColumn == OE_Fail );
+ sqlite3DequoteExpr(pExpr);
+ sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, pExpr->iColumn,
+ pExpr->token.z, pExpr->token.n);
+ } else {
+ assert( pExpr->iColumn == OE_Ignore );
+ sqlite3VdbeAddOp(v, OP_ContextPop, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, pParse->trigStack->ignoreJump);
+ VdbeComment((v, "# raise(IGNORE)"));
+ }
+ }
+#endif
+ break;
+ }
+}
+
+#ifndef SQLITE_OMIT_TRIGGER
+/*
+** Generate code that evalutes the given expression and leaves the result
+** on the stack. See also sqlite3ExprCode().
+**
+** This routine might also cache the result and modify the pExpr tree
+** so that it will make use of the cached result on subsequent evaluations
+** rather than evaluate the whole expression again. Trivial expressions are
+** not cached. If the expression is cached, its result is stored in a
+** memory location.
+*/
+void sqlite3ExprCodeAndCache(Parse *pParse, Expr *pExpr){
+ Vdbe *v = pParse->pVdbe;
+ int iMem;
+ int addr1, addr2;
+ if( v==0 ) return;
+ addr1 = sqlite3VdbeCurrentAddr(v);
+ sqlite3ExprCode(pParse, pExpr);
+ addr2 = sqlite3VdbeCurrentAddr(v);
+ if( addr2>addr1+1 || sqlite3VdbeGetOp(v, addr1)->opcode==OP_Function ){
+ iMem = pExpr->iTable = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_MemStore, iMem, 0);
+ pExpr->op = TK_REGISTER;
+ }
+}
+#endif
+
+/*
+** Generate code that pushes the value of every element of the given
+** expression list onto the stack.
+**
+** Return the number of elements pushed onto the stack.
+*/
+int sqlite3ExprCodeExprList(
+ Parse *pParse, /* Parsing context */
+ ExprList *pList /* The expression list to be coded */
+){
+ struct ExprList_item *pItem;
+ int i, n;
+ if( pList==0 ) return 0;
+ n = pList->nExpr;
+ for(pItem=pList->a, i=n; i>0; i--, pItem++){
+ sqlite3ExprCode(pParse, pItem->pExpr);
+ }
+ return n;
+}
+
+/*
+** Generate code for a boolean expression such that a jump is made
+** to the label "dest" if the expression is true but execution
+** continues straight thru if the expression is false.
+**
+** If the expression evaluates to NULL (neither true nor false), then
+** take the jump if the jumpIfNull flag is true.
+**
+** This code depends on the fact that certain token values (ex: TK_EQ)
+** are the same as opcode values (ex: OP_Eq) that implement the corresponding
+** operation. Special comments in vdbe.c and the mkopcodeh.awk script in
+** the make process cause these values to align. Assert()s in the code
+** below verify that the numbers are aligned correctly.
+*/
+void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
+ Vdbe *v = pParse->pVdbe;
+ int op = 0;
+ if( v==0 || pExpr==0 ) return;
+ op = pExpr->op;
+ switch( op ){
+ case TK_AND: {
+ int d2 = sqlite3VdbeMakeLabel(v);
+ sqlite3ExprIfFalse(pParse, pExpr->pLeft, d2, !jumpIfNull);
+ sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull);
+ sqlite3VdbeResolveLabel(v, d2);
+ break;
+ }
+ case TK_OR: {
+ sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull);
+ sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull);
+ break;
+ }
+ case TK_NOT: {
+ sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull);
+ break;
+ }
+ case TK_LT:
+ case TK_LE:
+ case TK_GT:
+ case TK_GE:
+ case TK_NE:
+ case TK_EQ: {
+ assert( TK_LT==OP_Lt );
+ assert( TK_LE==OP_Le );
+ assert( TK_GT==OP_Gt );
+ assert( TK_GE==OP_Ge );
+ assert( TK_EQ==OP_Eq );
+ assert( TK_NE==OP_Ne );
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ sqlite3ExprCode(pParse, pExpr->pRight);
+ codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, dest, jumpIfNull);
+ break;
+ }
+ case TK_ISNULL:
+ case TK_NOTNULL: {
+ assert( TK_ISNULL==OP_IsNull );
+ assert( TK_NOTNULL==OP_NotNull );
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ sqlite3VdbeAddOp(v, op, 1, dest);
+ break;
+ }
+ case TK_BETWEEN: {
+ /* The expression "x BETWEEN y AND z" is implemented as:
+ **
+ ** 1 IF (x < y) GOTO 3
+ ** 2 IF (x <= z) GOTO <dest>
+ ** 3 ...
+ */
+ int addr;
+ Expr *pLeft = pExpr->pLeft;
+ Expr *pRight = pExpr->pList->a[0].pExpr;
+ sqlite3ExprCode(pParse, pLeft);
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ sqlite3ExprCode(pParse, pRight);
+ addr = codeCompare(pParse, pLeft, pRight, OP_Lt, 0, !jumpIfNull);
+
+ pRight = pExpr->pList->a[1].pExpr;
+ sqlite3ExprCode(pParse, pRight);
+ codeCompare(pParse, pLeft, pRight, OP_Le, dest, jumpIfNull);
+
+ sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
+ sqlite3VdbeJumpHere(v, addr);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ break;
+ }
+ default: {
+ sqlite3ExprCode(pParse, pExpr);
+ sqlite3VdbeAddOp(v, OP_If, jumpIfNull, dest);
+ break;
+ }
+ }
+}
+
+/*
+** Generate code for a boolean expression such that a jump is made
+** to the label "dest" if the expression is false but execution
+** continues straight thru if the expression is true.
+**
+** If the expression evaluates to NULL (neither true nor false) then
+** jump if jumpIfNull is true or fall through if jumpIfNull is false.
+*/
+void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
+ Vdbe *v = pParse->pVdbe;
+ int op = 0;
+ if( v==0 || pExpr==0 ) return;
+
+ /* The value of pExpr->op and op are related as follows:
+ **
+ ** pExpr->op op
+ ** --------- ----------
+ ** TK_ISNULL OP_NotNull
+ ** TK_NOTNULL OP_IsNull
+ ** TK_NE OP_Eq
+ ** TK_EQ OP_Ne
+ ** TK_GT OP_Le
+ ** TK_LE OP_Gt
+ ** TK_GE OP_Lt
+ ** TK_LT OP_Ge
+ **
+ ** For other values of pExpr->op, op is undefined and unused.
+ ** The value of TK_ and OP_ constants are arranged such that we
+ ** can compute the mapping above using the following expression.
+ ** Assert()s verify that the computation is correct.
+ */
+ op = ((pExpr->op+(TK_ISNULL&1))^1)-(TK_ISNULL&1);
+
+ /* Verify correct alignment of TK_ and OP_ constants
+ */
+ assert( pExpr->op!=TK_ISNULL || op==OP_NotNull );
+ assert( pExpr->op!=TK_NOTNULL || op==OP_IsNull );
+ assert( pExpr->op!=TK_NE || op==OP_Eq );
+ assert( pExpr->op!=TK_EQ || op==OP_Ne );
+ assert( pExpr->op!=TK_LT || op==OP_Ge );
+ assert( pExpr->op!=TK_LE || op==OP_Gt );
+ assert( pExpr->op!=TK_GT || op==OP_Le );
+ assert( pExpr->op!=TK_GE || op==OP_Lt );
+
+ switch( pExpr->op ){
+ case TK_AND: {
+ sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull);
+ sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull);
+ break;
+ }
+ case TK_OR: {
+ int d2 = sqlite3VdbeMakeLabel(v);
+ sqlite3ExprIfTrue(pParse, pExpr->pLeft, d2, !jumpIfNull);
+ sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull);
+ sqlite3VdbeResolveLabel(v, d2);
+ break;
+ }
+ case TK_NOT: {
+ sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull);
+ break;
+ }
+ case TK_LT:
+ case TK_LE:
+ case TK_GT:
+ case TK_GE:
+ case TK_NE:
+ case TK_EQ: {
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ sqlite3ExprCode(pParse, pExpr->pRight);
+ codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, dest, jumpIfNull);
+ break;
+ }
+ case TK_ISNULL:
+ case TK_NOTNULL: {
+ sqlite3ExprCode(pParse, pExpr->pLeft);
+ sqlite3VdbeAddOp(v, op, 1, dest);
+ break;
+ }
+ case TK_BETWEEN: {
+ /* The expression is "x BETWEEN y AND z". It is implemented as:
+ **
+ ** 1 IF (x >= y) GOTO 3
+ ** 2 GOTO <dest>
+ ** 3 IF (x > z) GOTO <dest>
+ */
+ int addr;
+ Expr *pLeft = pExpr->pLeft;
+ Expr *pRight = pExpr->pList->a[0].pExpr;
+ sqlite3ExprCode(pParse, pLeft);
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ sqlite3ExprCode(pParse, pRight);
+ addr = sqlite3VdbeCurrentAddr(v);
+ codeCompare(pParse, pLeft, pRight, OP_Ge, addr+3, !jumpIfNull);
+
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, dest);
+ pRight = pExpr->pList->a[1].pExpr;
+ sqlite3ExprCode(pParse, pRight);
+ codeCompare(pParse, pLeft, pRight, OP_Gt, dest, jumpIfNull);
+ break;
+ }
+ default: {
+ sqlite3ExprCode(pParse, pExpr);
+ sqlite3VdbeAddOp(v, OP_IfNot, jumpIfNull, dest);
+ break;
+ }
+ }
+}
+
+/*
+** Do a deep comparison of two expression trees. Return TRUE (non-zero)
+** if they are identical and return FALSE if they differ in any way.
+*/
+int sqlite3ExprCompare(Expr *pA, Expr *pB){
+ int i;
+ if( pA==0 ){
+ return pB==0;
+ }else if( pB==0 ){
+ return 0;
+ }
+ if( pA->op!=pB->op ) return 0;
+ if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 0;
+ if( !sqlite3ExprCompare(pA->pLeft, pB->pLeft) ) return 0;
+ if( !sqlite3ExprCompare(pA->pRight, pB->pRight) ) return 0;
+ if( pA->pList ){
+ if( pB->pList==0 ) return 0;
+ if( pA->pList->nExpr!=pB->pList->nExpr ) return 0;
+ for(i=0; i<pA->pList->nExpr; i++){
+ if( !sqlite3ExprCompare(pA->pList->a[i].pExpr, pB->pList->a[i].pExpr) ){
+ return 0;
+ }
+ }
+ }else if( pB->pList ){
+ return 0;
+ }
+ if( pA->pSelect || pB->pSelect ) return 0;
+ if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 0;
+ if( pA->token.z ){
+ if( pB->token.z==0 ) return 0;
+ if( pB->token.n!=pA->token.n ) return 0;
+ if( sqlite3StrNICmp(pA->token.z, pB->token.z, pB->token.n)!=0 ) return 0;
+ }
+ return 1;
+}
+
+
+/*
+** Add a new element to the pAggInfo->aCol[] array. Return the index of
+** the new element. Return a negative number if malloc fails.
+*/
+static int addAggInfoColumn(AggInfo *pInfo){
+ int i;
+ i = sqlite3ArrayAllocate((void**)&pInfo->aCol, sizeof(pInfo->aCol[0]), 3);
+ if( i<0 ){
+ return -1;
+ }
+ return i;
+}
+
+/*
+** Add a new element to the pAggInfo->aFunc[] array. Return the index of
+** the new element. Return a negative number if malloc fails.
+*/
+static int addAggInfoFunc(AggInfo *pInfo){
+ int i;
+ i = sqlite3ArrayAllocate((void**)&pInfo->aFunc, sizeof(pInfo->aFunc[0]), 2);
+ if( i<0 ){
+ return -1;
+ }
+ return i;
+}
+
+/*
+** This is an xFunc for walkExprTree() used to implement
+** sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates
+** for additional information.
+**
+** This routine analyzes the aggregate function at pExpr.
+*/
+static int analyzeAggregate(void *pArg, Expr *pExpr){
+ int i;
+ NameContext *pNC = (NameContext *)pArg;
+ Parse *pParse = pNC->pParse;
+ SrcList *pSrcList = pNC->pSrcList;
+ AggInfo *pAggInfo = pNC->pAggInfo;
+
+
+ switch( pExpr->op ){
+ case TK_COLUMN: {
+ /* Check to see if the column is in one of the tables in the FROM
+ ** clause of the aggregate query */
+ if( pSrcList ){
+ struct SrcList_item *pItem = pSrcList->a;
+ for(i=0; i<pSrcList->nSrc; i++, pItem++){
+ struct AggInfo_col *pCol;
+ if( pExpr->iTable==pItem->iCursor ){
+ /* If we reach this point, it means that pExpr refers to a table
+ ** that is in the FROM clause of the aggregate query.
+ **
+ ** Make an entry for the column in pAggInfo->aCol[] if there
+ ** is not an entry there already.
+ */
+ pCol = pAggInfo->aCol;
+ for(i=0; i<pAggInfo->nColumn; i++, pCol++){
+ if( pCol->iTable==pExpr->iTable &&
+ pCol->iColumn==pExpr->iColumn ){
+ break;
+ }
+ }
+ if( i>=pAggInfo->nColumn && (i = addAggInfoColumn(pAggInfo))>=0 ){
+ pCol = &pAggInfo->aCol[i];
+ pCol->iTable = pExpr->iTable;
+ pCol->iColumn = pExpr->iColumn;
+ pCol->iMem = pParse->nMem++;
+ pCol->iSorterColumn = -1;
+ pCol->pExpr = pExpr;
+ if( pAggInfo->pGroupBy ){
+ int j, n;
+ ExprList *pGB = pAggInfo->pGroupBy;
+ struct ExprList_item *pTerm = pGB->a;
+ n = pGB->nExpr;
+ for(j=0; j<n; j++, pTerm++){
+ Expr *pE = pTerm->pExpr;
+ if( pE->op==TK_COLUMN && pE->iTable==pExpr->iTable &&
+ pE->iColumn==pExpr->iColumn ){
+ pCol->iSorterColumn = j;
+ break;
+ }
+ }
+ }
+ if( pCol->iSorterColumn<0 ){
+ pCol->iSorterColumn = pAggInfo->nSortingColumn++;
+ }
+ }
+ /* There is now an entry for pExpr in pAggInfo->aCol[] (either
+ ** because it was there before or because we just created it).
+ ** Convert the pExpr to be a TK_AGG_COLUMN referring to that
+ ** pAggInfo->aCol[] entry.
+ */
+ pExpr->pAggInfo = pAggInfo;
+ pExpr->op = TK_AGG_COLUMN;
+ pExpr->iAgg = i;
+ break;
+ } /* endif pExpr->iTable==pItem->iCursor */
+ } /* end loop over pSrcList */
+ }
+ return 1;
+ }
+ case TK_AGG_FUNCTION: {
+ /* The pNC->nDepth==0 test causes aggregate functions in subqueries
+ ** to be ignored */
+ if( pNC->nDepth==0 ){
+ /* Check to see if pExpr is a duplicate of another aggregate
+ ** function that is already in the pAggInfo structure
+ */
+ struct AggInfo_func *pItem = pAggInfo->aFunc;
+ for(i=0; i<pAggInfo->nFunc; i++, pItem++){
+ if( sqlite3ExprCompare(pItem->pExpr, pExpr) ){
+ break;
+ }
+ }
+ if( i>=pAggInfo->nFunc ){
+ /* pExpr is original. Make a new entry in pAggInfo->aFunc[]
+ */
+ u8 enc = pParse->db->enc;
+ i = addAggInfoFunc(pAggInfo);
+ if( i>=0 ){
+ pItem = &pAggInfo->aFunc[i];
+ pItem->pExpr = pExpr;
+ pItem->iMem = pParse->nMem++;
+ pItem->pFunc = sqlite3FindFunction(pParse->db,
+ pExpr->token.z, pExpr->token.n,
+ pExpr->pList ? pExpr->pList->nExpr : 0, enc, 0);
+ if( pExpr->flags & EP_Distinct ){
+ pItem->iDistinct = pParse->nTab++;
+ }else{
+ pItem->iDistinct = -1;
+ }
+ }
+ }
+ /* Make pExpr point to the appropriate pAggInfo->aFunc[] entry
+ */
+ pExpr->iAgg = i;
+ pExpr->pAggInfo = pAggInfo;
+ return 1;
+ }
+ }
+ }
+
+ /* Recursively walk subqueries looking for TK_COLUMN nodes that need
+ ** to be changed to TK_AGG_COLUMN. But increment nDepth so that
+ ** TK_AGG_FUNCTION nodes in subqueries will be unchanged.
+ */
+ if( pExpr->pSelect ){
+ pNC->nDepth++;
+ walkSelectExpr(pExpr->pSelect, analyzeAggregate, pNC);
+ pNC->nDepth--;
+ }
+ return 0;
+}
+
+/*
+** Analyze the given expression looking for aggregate functions and
+** for variables that need to be added to the pParse->aAgg[] array.
+** Make additional entries to the pParse->aAgg[] array as necessary.
+**
+** This routine should only be called after the expression has been
+** analyzed by sqlite3ExprResolveNames().
+**
+** If errors are seen, leave an error message in zErrMsg and return
+** the number of errors.
+*/
+int sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){
+ int nErr = pNC->pParse->nErr;
+ walkExprTree(pExpr, analyzeAggregate, pNC);
+ return pNC->pParse->nErr - nErr;
+}
+
+/*
+** Call sqlite3ExprAnalyzeAggregates() for every expression in an
+** expression list. Return the number of errors.
+**
+** If an error is found, the analysis is cut short.
+*/
+int sqlite3ExprAnalyzeAggList(NameContext *pNC, ExprList *pList){
+ struct ExprList_item *pItem;
+ int i;
+ int nErr = 0;
+ if( pList ){
+ for(pItem=pList->a, i=0; nErr==0 && i<pList->nExpr; i++, pItem++){
+ nErr += sqlite3ExprAnalyzeAggregates(pNC, pItem->pExpr);
+ }
+ }
+ return nErr;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/func.c b/ext/pdo_sqlite/sqlite/src/func.c
new file mode 100644
index 000000000..cdb674fa2
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/func.c
@@ -0,0 +1,1118 @@
+/*
+** 2002 February 23
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains the C functions that implement various SQL
+** functions of SQLite.
+**
+** There is only one exported symbol in this file - the function
+** sqliteRegisterBuildinFunctions() found at the bottom of the file.
+** All other code has file scope.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include <ctype.h>
+#include <math.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "vdbeInt.h"
+#include "os.h"
+
+/*
+** Return the collating function associated with a function.
+*/
+static CollSeq *sqlite3GetFuncCollSeq(sqlite3_context *context){
+ return context->pColl;
+}
+
+/*
+** Implementation of the non-aggregate min() and max() functions
+*/
+static void minmaxFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ int i;
+ int mask; /* 0 for min() or 0xffffffff for max() */
+ int iBest;
+ CollSeq *pColl;
+
+ if( argc==0 ) return;
+ mask = sqlite3_user_data(context)==0 ? 0 : -1;
+ pColl = sqlite3GetFuncCollSeq(context);
+ assert( pColl );
+ assert( mask==-1 || mask==0 );
+ iBest = 0;
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
+ for(i=1; i<argc; i++){
+ if( sqlite3_value_type(argv[i])==SQLITE_NULL ) return;
+ if( (sqlite3MemCompare(argv[iBest], argv[i], pColl)^mask)>=0 ){
+ iBest = i;
+ }
+ }
+ sqlite3_result_value(context, argv[iBest]);
+}
+
+/*
+** Return the type of the argument.
+*/
+static void typeofFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ const char *z = 0;
+ switch( sqlite3_value_type(argv[0]) ){
+ case SQLITE_NULL: z = "null"; break;
+ case SQLITE_INTEGER: z = "integer"; break;
+ case SQLITE_TEXT: z = "text"; break;
+ case SQLITE_FLOAT: z = "real"; break;
+ case SQLITE_BLOB: z = "blob"; break;
+ }
+ sqlite3_result_text(context, z, -1, SQLITE_STATIC);
+}
+
+
+/*
+** Implementation of the length() function
+*/
+static void lengthFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ int len;
+
+ assert( argc==1 );
+ switch( sqlite3_value_type(argv[0]) ){
+ case SQLITE_BLOB:
+ case SQLITE_INTEGER:
+ case SQLITE_FLOAT: {
+ sqlite3_result_int(context, sqlite3_value_bytes(argv[0]));
+ break;
+ }
+ case SQLITE_TEXT: {
+ const char *z = sqlite3_value_text(argv[0]);
+ for(len=0; *z; z++){ if( (0xc0&*z)!=0x80 ) len++; }
+ sqlite3_result_int(context, len);
+ break;
+ }
+ default: {
+ sqlite3_result_null(context);
+ break;
+ }
+ }
+}
+
+/*
+** Implementation of the abs() function
+*/
+static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
+ assert( argc==1 );
+ switch( sqlite3_value_type(argv[0]) ){
+ case SQLITE_INTEGER: {
+ i64 iVal = sqlite3_value_int64(argv[0]);
+ if( iVal<0 ) iVal = iVal * -1;
+ sqlite3_result_int64(context, iVal);
+ break;
+ }
+ case SQLITE_NULL: {
+ sqlite3_result_null(context);
+ break;
+ }
+ default: {
+ double rVal = sqlite3_value_double(argv[0]);
+ if( rVal<0 ) rVal = rVal * -1.0;
+ sqlite3_result_double(context, rVal);
+ break;
+ }
+ }
+}
+
+/*
+** Implementation of the substr() function
+*/
+static void substrFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ const char *z;
+ const char *z2;
+ int i;
+ int p1, p2, len;
+
+ assert( argc==3 );
+ z = sqlite3_value_text(argv[0]);
+ if( z==0 ) return;
+ p1 = sqlite3_value_int(argv[1]);
+ p2 = sqlite3_value_int(argv[2]);
+ for(len=0, z2=z; *z2; z2++){ if( (0xc0&*z2)!=0x80 ) len++; }
+ if( p1<0 ){
+ p1 += len;
+ if( p1<0 ){
+ p2 += p1;
+ p1 = 0;
+ }
+ }else if( p1>0 ){
+ p1--;
+ }
+ if( p1+p2>len ){
+ p2 = len-p1;
+ }
+ for(i=0; i<p1 && z[i]; i++){
+ if( (z[i]&0xc0)==0x80 ) p1++;
+ }
+ while( z[i] && (z[i]&0xc0)==0x80 ){ i++; p1++; }
+ for(; i<p1+p2 && z[i]; i++){
+ if( (z[i]&0xc0)==0x80 ) p2++;
+ }
+ while( z[i] && (z[i]&0xc0)==0x80 ){ i++; p2++; }
+ if( p2<0 ) p2 = 0;
+ sqlite3_result_text(context, &z[p1], p2, SQLITE_TRANSIENT);
+}
+
+/*
+** Implementation of the round() function
+*/
+static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
+ int n = 0;
+ double r;
+ char zBuf[500]; /* larger than the %f representation of the largest double */
+ assert( argc==1 || argc==2 );
+ if( argc==2 ){
+ if( SQLITE_NULL==sqlite3_value_type(argv[1]) ) return;
+ n = sqlite3_value_int(argv[1]);
+ if( n>30 ) n = 30;
+ if( n<0 ) n = 0;
+ }
+ if( SQLITE_NULL==sqlite3_value_type(argv[0]) ) return;
+ r = sqlite3_value_double(argv[0]);
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%.*f",n,r);
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
+}
+
+/*
+** Implementation of the upper() and lower() SQL functions.
+*/
+static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
+ unsigned char *z;
+ int i;
+ if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return;
+ z = sqliteMalloc(sqlite3_value_bytes(argv[0])+1);
+ if( z==0 ) return;
+ strcpy(z, sqlite3_value_text(argv[0]));
+ for(i=0; z[i]; i++){
+ z[i] = toupper(z[i]);
+ }
+ sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT);
+ sqliteFree(z);
+}
+static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
+ unsigned char *z;
+ int i;
+ if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return;
+ z = sqliteMalloc(sqlite3_value_bytes(argv[0])+1);
+ if( z==0 ) return;
+ strcpy(z, sqlite3_value_text(argv[0]));
+ for(i=0; z[i]; i++){
+ z[i] = tolower(z[i]);
+ }
+ sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT);
+ sqliteFree(z);
+}
+
+/*
+** Implementation of the IFNULL(), NVL(), and COALESCE() functions.
+** All three do the same thing. They return the first non-NULL
+** argument.
+*/
+static void ifnullFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ int i;
+ for(i=0; i<argc; i++){
+ if( SQLITE_NULL!=sqlite3_value_type(argv[i]) ){
+ sqlite3_result_value(context, argv[i]);
+ break;
+ }
+ }
+}
+
+/*
+** Implementation of random(). Return a random integer.
+*/
+static void randomFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ int r;
+ sqlite3Randomness(sizeof(r), &r);
+ sqlite3_result_int(context, r);
+}
+
+/*
+** Implementation of the last_insert_rowid() SQL function. The return
+** value is the same as the sqlite3_last_insert_rowid() API function.
+*/
+static void last_insert_rowid(
+ sqlite3_context *context,
+ int arg,
+ sqlite3_value **argv
+){
+ sqlite3 *db = sqlite3_user_data(context);
+ sqlite3_result_int64(context, sqlite3_last_insert_rowid(db));
+}
+
+/*
+** Implementation of the changes() SQL function. The return value is the
+** same as the sqlite3_changes() API function.
+*/
+static void changes(
+ sqlite3_context *context,
+ int arg,
+ sqlite3_value **argv
+){
+ sqlite3 *db = sqlite3_user_data(context);
+ sqlite3_result_int(context, sqlite3_changes(db));
+}
+
+/*
+** Implementation of the total_changes() SQL function. The return value is
+** the same as the sqlite3_total_changes() API function.
+*/
+static void total_changes(
+ sqlite3_context *context,
+ int arg,
+ sqlite3_value **argv
+){
+ sqlite3 *db = sqlite3_user_data(context);
+ sqlite3_result_int(context, sqlite3_total_changes(db));
+}
+
+/*
+** A structure defining how to do GLOB-style comparisons.
+*/
+struct compareInfo {
+ u8 matchAll;
+ u8 matchOne;
+ u8 matchSet;
+ u8 noCase;
+};
+
+static const struct compareInfo globInfo = { '*', '?', '[', 0 };
+/* The correct SQL-92 behavior is for the LIKE operator to ignore
+** case. Thus 'a' LIKE 'A' would be true. */
+static const struct compareInfo likeInfoNorm = { '%', '_', 0, 1 };
+/* If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator
+** is case sensitive causing 'a' LIKE 'A' to be false */
+static const struct compareInfo likeInfoAlt = { '%', '_', 0, 0 };
+
+/*
+** X is a pointer to the first byte of a UTF-8 character. Increment
+** X so that it points to the next character. This only works right
+** if X points to a well-formed UTF-8 string.
+*/
+#define sqliteNextChar(X) while( (0xc0&*++(X))==0x80 ){}
+#define sqliteCharVal(X) sqlite3ReadUtf8(X)
+
+
+/*
+** Compare two UTF-8 strings for equality where the first string can
+** potentially be a "glob" expression. Return true (1) if they
+** are the same and false (0) if they are different.
+**
+** Globbing rules:
+**
+** '*' Matches any sequence of zero or more characters.
+**
+** '?' Matches exactly one character.
+**
+** [...] Matches one character from the enclosed list of
+** characters.
+**
+** [^...] Matches one character not in the enclosed list.
+**
+** With the [...] and [^...] matching, a ']' character can be included
+** in the list by making it the first character after '[' or '^'. A
+** range of characters can be specified using '-'. Example:
+** "[a-z]" matches any single lower-case letter. To match a '-', make
+** it the last character in the list.
+**
+** This routine is usually quick, but can be N**2 in the worst case.
+**
+** Hints: to match '*' or '?', put them in "[]". Like this:
+**
+** abc[*]xyz Matches "abc*xyz" only
+*/
+static int patternCompare(
+ const u8 *zPattern, /* The glob pattern */
+ const u8 *zString, /* The string to compare against the glob */
+ const struct compareInfo *pInfo, /* Information about how to do the compare */
+ const int esc /* The escape character */
+){
+ register int c;
+ int invert;
+ int seen;
+ int c2;
+ u8 matchOne = pInfo->matchOne;
+ u8 matchAll = pInfo->matchAll;
+ u8 matchSet = pInfo->matchSet;
+ u8 noCase = pInfo->noCase;
+ int prevEscape = 0; /* True if the previous character was 'escape' */
+
+ while( (c = *zPattern)!=0 ){
+ if( !prevEscape && c==matchAll ){
+ while( (c=zPattern[1]) == matchAll || c == matchOne ){
+ if( c==matchOne ){
+ if( *zString==0 ) return 0;
+ sqliteNextChar(zString);
+ }
+ zPattern++;
+ }
+ if( c && esc && sqlite3ReadUtf8(&zPattern[1])==esc ){
+ u8 const *zTemp = &zPattern[1];
+ sqliteNextChar(zTemp);
+ c = *zTemp;
+ }
+ if( c==0 ) return 1;
+ if( c==matchSet ){
+ assert( esc==0 ); /* This is GLOB, not LIKE */
+ while( *zString && patternCompare(&zPattern[1],zString,pInfo,esc)==0 ){
+ sqliteNextChar(zString);
+ }
+ return *zString!=0;
+ }else{
+ while( (c2 = *zString)!=0 ){
+ if( noCase ){
+ c2 = sqlite3UpperToLower[c2];
+ c = sqlite3UpperToLower[c];
+ while( c2 != 0 && c2 != c ){ c2 = sqlite3UpperToLower[*++zString]; }
+ }else{
+ while( c2 != 0 && c2 != c ){ c2 = *++zString; }
+ }
+ if( c2==0 ) return 0;
+ if( patternCompare(&zPattern[1],zString,pInfo,esc) ) return 1;
+ sqliteNextChar(zString);
+ }
+ return 0;
+ }
+ }else if( !prevEscape && c==matchOne ){
+ if( *zString==0 ) return 0;
+ sqliteNextChar(zString);
+ zPattern++;
+ }else if( c==matchSet ){
+ int prior_c = 0;
+ assert( esc==0 ); /* This only occurs for GLOB, not LIKE */
+ seen = 0;
+ invert = 0;
+ c = sqliteCharVal(zString);
+ if( c==0 ) return 0;
+ c2 = *++zPattern;
+ if( c2=='^' ){ invert = 1; c2 = *++zPattern; }
+ if( c2==']' ){
+ if( c==']' ) seen = 1;
+ c2 = *++zPattern;
+ }
+ while( (c2 = sqliteCharVal(zPattern))!=0 && c2!=']' ){
+ if( c2=='-' && zPattern[1]!=']' && zPattern[1]!=0 && prior_c>0 ){
+ zPattern++;
+ c2 = sqliteCharVal(zPattern);
+ if( c>=prior_c && c<=c2 ) seen = 1;
+ prior_c = 0;
+ }else if( c==c2 ){
+ seen = 1;
+ prior_c = c2;
+ }else{
+ prior_c = c2;
+ }
+ sqliteNextChar(zPattern);
+ }
+ if( c2==0 || (seen ^ invert)==0 ) return 0;
+ sqliteNextChar(zString);
+ zPattern++;
+ }else if( esc && !prevEscape && sqlite3ReadUtf8(zPattern)==esc){
+ prevEscape = 1;
+ sqliteNextChar(zPattern);
+ }else{
+ if( noCase ){
+ if( sqlite3UpperToLower[c] != sqlite3UpperToLower[*zString] ) return 0;
+ }else{
+ if( c != *zString ) return 0;
+ }
+ zPattern++;
+ zString++;
+ prevEscape = 0;
+ }
+ }
+ return *zString==0;
+}
+
+/*
+** Count the number of times that the LIKE operator (or GLOB which is
+** just a variation of LIKE) gets called. This is used for testing
+** only.
+*/
+#ifdef SQLITE_TEST
+int sqlite3_like_count = 0;
+#endif
+
+
+/*
+** Implementation of the like() SQL function. This function implements
+** the build-in LIKE operator. The first argument to the function is the
+** pattern and the second argument is the string. So, the SQL statements:
+**
+** A LIKE B
+**
+** is implemented as like(B,A).
+**
+** This same function (with a different compareInfo structure) computes
+** the GLOB operator.
+*/
+static void likeFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ const unsigned char *zA = sqlite3_value_text(argv[0]);
+ const unsigned char *zB = sqlite3_value_text(argv[1]);
+ int escape = 0;
+ if( argc==3 ){
+ /* The escape character string must consist of a single UTF-8 character.
+ ** Otherwise, return an error.
+ */
+ const unsigned char *zEsc = sqlite3_value_text(argv[2]);
+ if( sqlite3utf8CharLen(zEsc, -1)!=1 ){
+ sqlite3_result_error(context,
+ "ESCAPE expression must be a single character", -1);
+ return;
+ }
+ escape = sqlite3ReadUtf8(zEsc);
+ }
+ if( zA && zB ){
+ struct compareInfo *pInfo = sqlite3_user_data(context);
+#ifdef SQLITE_TEST
+ sqlite3_like_count++;
+#endif
+ sqlite3_result_int(context, patternCompare(zA, zB, pInfo, escape));
+ }
+}
+
+/*
+** Implementation of the NULLIF(x,y) function. The result is the first
+** argument if the arguments are different. The result is NULL if the
+** arguments are equal to each other.
+*/
+static void nullifFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ CollSeq *pColl = sqlite3GetFuncCollSeq(context);
+ if( sqlite3MemCompare(argv[0], argv[1], pColl)!=0 ){
+ sqlite3_result_value(context, argv[0]);
+ }
+}
+
+/*
+** Implementation of the VERSION(*) function. The result is the version
+** of the SQLite library that is running.
+*/
+static void versionFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ sqlite3_result_text(context, sqlite3_version, -1, SQLITE_STATIC);
+}
+
+
+/*
+** EXPERIMENTAL - This is not an official function. The interface may
+** change. This function may disappear. Do not write code that depends
+** on this function.
+**
+** Implementation of the QUOTE() function. This function takes a single
+** argument. If the argument is numeric, the return value is the same as
+** the argument. If the argument is NULL, the return value is the string
+** "NULL". Otherwise, the argument is enclosed in single quotes with
+** single-quote escapes.
+*/
+static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
+ if( argc<1 ) return;
+ switch( sqlite3_value_type(argv[0]) ){
+ case SQLITE_NULL: {
+ sqlite3_result_text(context, "NULL", 4, SQLITE_STATIC);
+ break;
+ }
+ case SQLITE_INTEGER:
+ case SQLITE_FLOAT: {
+ sqlite3_result_value(context, argv[0]);
+ break;
+ }
+ case SQLITE_BLOB: {
+ static const char hexdigits[] = {
+ '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
+ };
+ char *zText = 0;
+ int nBlob = sqlite3_value_bytes(argv[0]);
+ char const *zBlob = sqlite3_value_blob(argv[0]);
+
+ zText = (char *)sqliteMalloc((2*nBlob)+4);
+ if( !zText ){
+ sqlite3_result_error(context, "out of memory", -1);
+ }else{
+ int i;
+ for(i=0; i<nBlob; i++){
+ zText[(i*2)+2] = hexdigits[(zBlob[i]>>4)&0x0F];
+ zText[(i*2)+3] = hexdigits[(zBlob[i])&0x0F];
+ }
+ zText[(nBlob*2)+2] = '\'';
+ zText[(nBlob*2)+3] = '\0';
+ zText[0] = 'X';
+ zText[1] = '\'';
+ sqlite3_result_text(context, zText, -1, SQLITE_TRANSIENT);
+ sqliteFree(zText);
+ }
+ break;
+ }
+ case SQLITE_TEXT: {
+ int i,j,n;
+ const char *zArg = sqlite3_value_text(argv[0]);
+ char *z;
+
+ for(i=n=0; zArg[i]; i++){ if( zArg[i]=='\'' ) n++; }
+ z = sqliteMalloc( i+n+3 );
+ if( z==0 ) return;
+ z[0] = '\'';
+ for(i=0, j=1; zArg[i]; i++){
+ z[j++] = zArg[i];
+ if( zArg[i]=='\'' ){
+ z[j++] = '\'';
+ }
+ }
+ z[j++] = '\'';
+ z[j] = 0;
+ sqlite3_result_text(context, z, j, SQLITE_TRANSIENT);
+ sqliteFree(z);
+ }
+ }
+}
+
+#ifdef SQLITE_SOUNDEX
+/*
+** Compute the soundex encoding of a word.
+*/
+static void soundexFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
+ char zResult[8];
+ const u8 *zIn;
+ int i, j;
+ static const unsigned char iCode[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 2, 3, 0, 1, 2, 0, 0, 2, 2, 4, 5, 5, 0,
+ 1, 2, 6, 2, 3, 0, 1, 0, 2, 0, 2, 0, 0, 0, 0, 0,
+ 0, 0, 1, 2, 3, 0, 1, 2, 0, 0, 2, 2, 4, 5, 5, 0,
+ 1, 2, 6, 2, 3, 0, 1, 0, 2, 0, 2, 0, 0, 0, 0, 0,
+ };
+ assert( argc==1 );
+ zIn = (u8*)sqlite3_value_text(argv[0]);
+ for(i=0; zIn[i] && !isalpha(zIn[i]); i++){}
+ if( zIn[i] ){
+ zResult[0] = toupper(zIn[i]);
+ for(j=1; j<4 && zIn[i]; i++){
+ int code = iCode[zIn[i]&0x7f];
+ if( code>0 ){
+ zResult[j++] = code + '0';
+ }
+ }
+ while( j<4 ){
+ zResult[j++] = '0';
+ }
+ zResult[j] = 0;
+ sqlite3_result_text(context, zResult, 4, SQLITE_TRANSIENT);
+ }else{
+ sqlite3_result_text(context, "?000", 4, SQLITE_STATIC);
+ }
+}
+#endif
+
+#ifdef SQLITE_TEST
+/*
+** This function generates a string of random characters. Used for
+** generating test data.
+*/
+static void randStr(sqlite3_context *context, int argc, sqlite3_value **argv){
+ static const unsigned char zSrc[] =
+ "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789"
+ ".-!,:*^+=_|?/<> ";
+ int iMin, iMax, n, r, i;
+ unsigned char zBuf[1000];
+ if( argc>=1 ){
+ iMin = sqlite3_value_int(argv[0]);
+ if( iMin<0 ) iMin = 0;
+ if( iMin>=sizeof(zBuf) ) iMin = sizeof(zBuf)-1;
+ }else{
+ iMin = 1;
+ }
+ if( argc>=2 ){
+ iMax = sqlite3_value_int(argv[1]);
+ if( iMax<iMin ) iMax = iMin;
+ if( iMax>=sizeof(zBuf) ) iMax = sizeof(zBuf)-1;
+ }else{
+ iMax = 50;
+ }
+ n = iMin;
+ if( iMax>iMin ){
+ sqlite3Randomness(sizeof(r), &r);
+ r &= 0x7fffffff;
+ n += r%(iMax + 1 - iMin);
+ }
+ assert( n<sizeof(zBuf) );
+ sqlite3Randomness(n, zBuf);
+ for(i=0; i<n; i++){
+ zBuf[i] = zSrc[zBuf[i]%(sizeof(zSrc)-1)];
+ }
+ zBuf[n] = 0;
+ sqlite3_result_text(context, zBuf, n, SQLITE_TRANSIENT);
+}
+#endif /* SQLITE_TEST */
+
+#ifdef SQLITE_TEST
+/*
+** The following two SQL functions are used to test returning a text
+** result with a destructor. Function 'test_destructor' takes one argument
+** and returns the same argument interpreted as TEXT. A destructor is
+** passed with the sqlite3_result_text() call.
+**
+** SQL function 'test_destructor_count' returns the number of outstanding
+** allocations made by 'test_destructor';
+**
+** WARNING: Not threadsafe.
+*/
+static int test_destructor_count_var = 0;
+static void destructor(void *p){
+ char *zVal = (char *)p;
+ assert(zVal);
+ zVal--;
+ sqliteFree(zVal);
+ test_destructor_count_var--;
+}
+static void test_destructor(
+ sqlite3_context *pCtx,
+ int nArg,
+ sqlite3_value **argv
+){
+ char *zVal;
+ int len;
+ sqlite3 *db = sqlite3_user_data(pCtx);
+
+ test_destructor_count_var++;
+ assert( nArg==1 );
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
+ len = sqlite3ValueBytes(argv[0], db->enc);
+ zVal = sqliteMalloc(len+3);
+ zVal[len] = 0;
+ zVal[len-1] = 0;
+ assert( zVal );
+ zVal++;
+ memcpy(zVal, sqlite3ValueText(argv[0], db->enc), len);
+ if( db->enc==SQLITE_UTF8 ){
+ sqlite3_result_text(pCtx, zVal, -1, destructor);
+#ifndef SQLITE_OMIT_UTF16
+ }else if( db->enc==SQLITE_UTF16LE ){
+ sqlite3_result_text16le(pCtx, zVal, -1, destructor);
+ }else{
+ sqlite3_result_text16be(pCtx, zVal, -1, destructor);
+#endif /* SQLITE_OMIT_UTF16 */
+ }
+}
+static void test_destructor_count(
+ sqlite3_context *pCtx,
+ int nArg,
+ sqlite3_value **argv
+){
+ sqlite3_result_int(pCtx, test_destructor_count_var);
+}
+#endif /* SQLITE_TEST */
+
+#ifdef SQLITE_TEST
+/*
+** Routines for testing the sqlite3_get_auxdata() and sqlite3_set_auxdata()
+** interface.
+**
+** The test_auxdata() SQL function attempts to register each of its arguments
+** as auxiliary data. If there are no prior registrations of aux data for
+** that argument (meaning the argument is not a constant or this is its first
+** call) then the result for that argument is 0. If there is a prior
+** registration, the result for that argument is 1. The overall result
+** is the individual argument results separated by spaces.
+*/
+static void free_test_auxdata(void *p) {sqliteFree(p);}
+static void test_auxdata(
+ sqlite3_context *pCtx,
+ int nArg,
+ sqlite3_value **argv
+){
+ int i;
+ char *zRet = sqliteMalloc(nArg*2);
+ if( !zRet ) return;
+ for(i=0; i<nArg; i++){
+ char const *z = sqlite3_value_text(argv[i]);
+ if( z ){
+ char *zAux = sqlite3_get_auxdata(pCtx, i);
+ if( zAux ){
+ zRet[i*2] = '1';
+ if( strcmp(zAux, z) ){
+ sqlite3_result_error(pCtx, "Auxilary data corruption", -1);
+ return;
+ }
+ }else{
+ zRet[i*2] = '0';
+ zAux = sqliteStrDup(z);
+ sqlite3_set_auxdata(pCtx, i, zAux, free_test_auxdata);
+ }
+ zRet[i*2+1] = ' ';
+ }
+ }
+ sqlite3_result_text(pCtx, zRet, 2*nArg-1, free_test_auxdata);
+}
+#endif /* SQLITE_TEST */
+
+#ifdef SQLITE_TEST
+/*
+** A function to test error reporting from user functions. This function
+** returns a copy of it's first argument as an error.
+*/
+static void test_error(
+ sqlite3_context *pCtx,
+ int nArg,
+ sqlite3_value **argv
+){
+ sqlite3_result_error(pCtx, sqlite3_value_text(argv[0]), 0);
+}
+#endif /* SQLITE_TEST */
+
+/*
+** An instance of the following structure holds the context of a
+** sum() or avg() aggregate computation.
+*/
+typedef struct SumCtx SumCtx;
+struct SumCtx {
+ double sum; /* Sum of terms */
+ int cnt; /* Number of elements summed */
+ u8 seenFloat; /* True if there has been any floating point value */
+};
+
+/*
+** Routines used to compute the sum or average.
+*/
+static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){
+ SumCtx *p;
+ int type;
+ assert( argc==1 );
+ p = sqlite3_aggregate_context(context, sizeof(*p));
+ type = sqlite3_value_type(argv[0]);
+ if( p && type!=SQLITE_NULL ){
+ p->sum += sqlite3_value_double(argv[0]);
+ p->cnt++;
+ if( type==SQLITE_FLOAT ){
+ p->seenFloat = 1;
+ }
+ }
+}
+static void sumFinalize(sqlite3_context *context){
+ SumCtx *p;
+ p = sqlite3_aggregate_context(context, 0);
+ if( p && p->cnt>0 ){
+ if( p->seenFloat ){
+ sqlite3_result_double(context, p->sum);
+ }else{
+ sqlite3_result_int64(context, (i64)p->sum);
+ }
+ }
+}
+static void avgFinalize(sqlite3_context *context){
+ SumCtx *p;
+ p = sqlite3_aggregate_context(context, 0);
+ if( p && p->cnt>0 ){
+ sqlite3_result_double(context, p->sum/(double)p->cnt);
+ }
+}
+
+/*
+** An instance of the following structure holds the context of a
+** variance or standard deviation computation.
+*/
+typedef struct StdDevCtx StdDevCtx;
+struct StdDevCtx {
+ double sum; /* Sum of terms */
+ double sum2; /* Sum of the squares of terms */
+ int cnt; /* Number of terms counted */
+};
+
+/*
+** The following structure keeps track of state information for the
+** count() aggregate function.
+*/
+typedef struct CountCtx CountCtx;
+struct CountCtx {
+ int n;
+};
+
+/*
+** Routines to implement the count() aggregate function.
+*/
+static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){
+ CountCtx *p;
+ p = sqlite3_aggregate_context(context, sizeof(*p));
+ if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){
+ p->n++;
+ }
+}
+static void countFinalize(sqlite3_context *context){
+ CountCtx *p;
+ p = sqlite3_aggregate_context(context, 0);
+ sqlite3_result_int(context, p ? p->n : 0);
+}
+
+/*
+** Routines to implement min() and max() aggregate functions.
+*/
+static void minmaxStep(sqlite3_context *context, int argc, sqlite3_value **argv){
+ Mem *pArg = (Mem *)argv[0];
+ Mem *pBest;
+
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
+ pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest));
+ if( !pBest ) return;
+
+ if( pBest->flags ){
+ int max;
+ int cmp;
+ CollSeq *pColl = sqlite3GetFuncCollSeq(context);
+ /* This step function is used for both the min() and max() aggregates,
+ ** the only difference between the two being that the sense of the
+ ** comparison is inverted. For the max() aggregate, the
+ ** sqlite3_user_data() function returns (void *)-1. For min() it
+ ** returns (void *)db, where db is the sqlite3* database pointer.
+ ** Therefore the next statement sets variable 'max' to 1 for the max()
+ ** aggregate, or 0 for min().
+ */
+ max = ((sqlite3_user_data(context)==(void *)-1)?1:0);
+ cmp = sqlite3MemCompare(pBest, pArg, pColl);
+ if( (max && cmp<0) || (!max && cmp>0) ){
+ sqlite3VdbeMemCopy(pBest, pArg);
+ }
+ }else{
+ sqlite3VdbeMemCopy(pBest, pArg);
+ }
+}
+static void minMaxFinalize(sqlite3_context *context){
+ sqlite3_value *pRes;
+ pRes = (sqlite3_value *)sqlite3_aggregate_context(context, 0);
+ if( pRes ){
+ if( pRes->flags ){
+ sqlite3_result_value(context, pRes);
+ }
+ sqlite3VdbeMemRelease(pRes);
+ }
+}
+
+
+/*
+** This function registered all of the above C functions as SQL
+** functions. This should be the only routine in this file with
+** external linkage.
+*/
+void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
+ static const struct {
+ char *zName;
+ signed char nArg;
+ u8 argType; /* 0: none. 1: db 2: (-1) */
+ u8 eTextRep; /* 1: UTF-16. 0: UTF-8 */
+ u8 needCollSeq;
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value **);
+ } aFuncs[] = {
+ { "min", -1, 0, SQLITE_UTF8, 1, minmaxFunc },
+ { "min", 0, 0, SQLITE_UTF8, 1, 0 },
+ { "max", -1, 2, SQLITE_UTF8, 1, minmaxFunc },
+ { "max", 0, 2, SQLITE_UTF8, 1, 0 },
+ { "typeof", 1, 0, SQLITE_UTF8, 0, typeofFunc },
+ { "length", 1, 0, SQLITE_UTF8, 0, lengthFunc },
+ { "substr", 3, 0, SQLITE_UTF8, 0, substrFunc },
+#ifndef SQLITE_OMIT_UTF16
+ { "substr", 3, 0, SQLITE_UTF16LE, 0, sqlite3utf16Substr },
+#endif
+ { "abs", 1, 0, SQLITE_UTF8, 0, absFunc },
+ { "round", 1, 0, SQLITE_UTF8, 0, roundFunc },
+ { "round", 2, 0, SQLITE_UTF8, 0, roundFunc },
+ { "upper", 1, 0, SQLITE_UTF8, 0, upperFunc },
+ { "lower", 1, 0, SQLITE_UTF8, 0, lowerFunc },
+ { "coalesce", -1, 0, SQLITE_UTF8, 0, ifnullFunc },
+ { "coalesce", 0, 0, SQLITE_UTF8, 0, 0 },
+ { "coalesce", 1, 0, SQLITE_UTF8, 0, 0 },
+ { "ifnull", 2, 0, SQLITE_UTF8, 1, ifnullFunc },
+ { "random", -1, 0, SQLITE_UTF8, 0, randomFunc },
+ { "nullif", 2, 0, SQLITE_UTF8, 1, nullifFunc },
+ { "sqlite_version", 0, 0, SQLITE_UTF8, 0, versionFunc},
+ { "quote", 1, 0, SQLITE_UTF8, 0, quoteFunc },
+ { "last_insert_rowid", 0, 1, SQLITE_UTF8, 0, last_insert_rowid },
+ { "changes", 0, 1, SQLITE_UTF8, 0, changes },
+ { "total_changes", 0, 1, SQLITE_UTF8, 0, total_changes },
+#ifdef SQLITE_SOUNDEX
+ { "soundex", 1, 0, SQLITE_UTF8, 0, soundexFunc},
+#endif
+#ifdef SQLITE_TEST
+ { "randstr", 2, 0, SQLITE_UTF8, 0, randStr },
+ { "test_destructor", 1, 1, SQLITE_UTF8, 0, test_destructor},
+ { "test_destructor_count", 0, 0, SQLITE_UTF8, 0, test_destructor_count},
+ { "test_auxdata", -1, 0, SQLITE_UTF8, 0, test_auxdata},
+ { "test_error", 1, 0, SQLITE_UTF8, 0, test_error},
+#endif
+ };
+ static const struct {
+ char *zName;
+ signed char nArg;
+ u8 argType;
+ u8 needCollSeq;
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**);
+ void (*xFinalize)(sqlite3_context*);
+ } aAggs[] = {
+ { "min", 1, 0, 1, minmaxStep, minMaxFinalize },
+ { "max", 1, 2, 1, minmaxStep, minMaxFinalize },
+ { "sum", 1, 0, 0, sumStep, sumFinalize },
+ { "avg", 1, 0, 0, sumStep, avgFinalize },
+ { "count", 0, 0, 0, countStep, countFinalize },
+ { "count", 1, 0, 0, countStep, countFinalize },
+ };
+ int i;
+
+ for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
+ void *pArg = 0;
+ switch( aFuncs[i].argType ){
+ case 1: pArg = db; break;
+ case 2: pArg = (void *)(-1); break;
+ }
+ sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg,
+ aFuncs[i].eTextRep, pArg, aFuncs[i].xFunc, 0, 0);
+ if( aFuncs[i].needCollSeq ){
+ FuncDef *pFunc = sqlite3FindFunction(db, aFuncs[i].zName,
+ strlen(aFuncs[i].zName), aFuncs[i].nArg, aFuncs[i].eTextRep, 0);
+ if( pFunc && aFuncs[i].needCollSeq ){
+ pFunc->needCollSeq = 1;
+ }
+ }
+ }
+#ifndef SQLITE_OMIT_ALTERTABLE
+ sqlite3AlterFunctions(db);
+#endif
+ for(i=0; i<sizeof(aAggs)/sizeof(aAggs[0]); i++){
+ void *pArg = 0;
+ switch( aAggs[i].argType ){
+ case 1: pArg = db; break;
+ case 2: pArg = (void *)(-1); break;
+ }
+ sqlite3_create_function(db, aAggs[i].zName, aAggs[i].nArg, SQLITE_UTF8,
+ pArg, 0, aAggs[i].xStep, aAggs[i].xFinalize);
+ if( aAggs[i].needCollSeq ){
+ FuncDef *pFunc = sqlite3FindFunction( db, aAggs[i].zName,
+ strlen(aAggs[i].zName), aAggs[i].nArg, SQLITE_UTF8, 0);
+ if( pFunc && aAggs[i].needCollSeq ){
+ pFunc->needCollSeq = 1;
+ }
+ }
+ }
+ sqlite3RegisterDateTimeFunctions(db);
+#ifdef SQLITE_SSE
+ sqlite3SseFunctions(db);
+#endif
+#ifdef SQLITE_CASE_SENSITIVE_LIKE
+ sqlite3RegisterLikeFunctions(db, 1);
+#else
+ sqlite3RegisterLikeFunctions(db, 0);
+#endif
+}
+
+/*
+** Set the LIKEOPT flag on the 2-argument function with the given name.
+*/
+static void setLikeOptFlag(sqlite3 *db, const char *zName, int flagVal){
+ FuncDef *pDef;
+ pDef = sqlite3FindFunction(db, zName, strlen(zName), 2, SQLITE_UTF8, 0);
+ if( pDef ){
+ pDef->flags = flagVal;
+ }
+}
+
+/*
+** Register the built-in LIKE and GLOB functions. The caseSensitive
+** parameter determines whether or not the LIKE operator is case
+** sensitive. GLOB is always case sensitive.
+*/
+void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){
+ struct compareInfo *pInfo;
+ if( caseSensitive ){
+ pInfo = (struct compareInfo*)&likeInfoAlt;
+ }else{
+ pInfo = (struct compareInfo*)&likeInfoNorm;
+ }
+ sqlite3_create_function(db, "like", 2, SQLITE_UTF8, pInfo, likeFunc, 0, 0);
+ sqlite3_create_function(db, "like", 3, SQLITE_UTF8, pInfo, likeFunc, 0, 0);
+ sqlite3_create_function(db, "glob", 2, SQLITE_UTF8,
+ (struct compareInfo*)&globInfo, likeFunc, 0,0);
+ setLikeOptFlag(db, "glob", SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE);
+ setLikeOptFlag(db, "like",
+ caseSensitive ? (SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE) : SQLITE_FUNC_LIKE);
+}
+
+/*
+** pExpr points to an expression which implements a function. If
+** it is appropriate to apply the LIKE optimization to that function
+** then set aWc[0] through aWc[2] to the wildcard characters and
+** return TRUE. If the function is not a LIKE-style function then
+** return FALSE.
+*/
+int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){
+ FuncDef *pDef;
+ if( pExpr->op!=TK_FUNCTION ){
+ return 0;
+ }
+ if( pExpr->pList->nExpr!=2 ){
+ return 0;
+ }
+ pDef = sqlite3FindFunction(db, pExpr->token.z, pExpr->token.n, 2,
+ SQLITE_UTF8, 0);
+ if( pDef==0 || (pDef->flags & SQLITE_FUNC_LIKE)==0 ){
+ return 0;
+ }
+
+ /* The memcpy() statement assumes that the wildcard characters are
+ ** the first three statements in the compareInfo structure. The
+ ** asserts() that follow verify that assumption
+ */
+ memcpy(aWc, pDef->pUserData, 3);
+ assert( (char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll );
+ assert( &((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne );
+ assert( &((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet );
+ *pIsNocase = (pDef->flags & SQLITE_FUNC_CASE)==0;
+ return 1;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/hash.c b/ext/pdo_sqlite/sqlite/src/hash.c
new file mode 100644
index 000000000..e01aae716
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/hash.c
@@ -0,0 +1,387 @@
+/*
+** 2001 September 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This is the implementation of generic hash-tables
+** used in SQLite.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include <assert.h>
+
+/* Turn bulk memory into a hash table object by initializing the
+** fields of the Hash structure.
+**
+** "pNew" is a pointer to the hash table that is to be initialized.
+** keyClass is one of the constants SQLITE_HASH_INT, SQLITE_HASH_POINTER,
+** SQLITE_HASH_BINARY, or SQLITE_HASH_STRING. The value of keyClass
+** determines what kind of key the hash table will use. "copyKey" is
+** true if the hash table should make its own private copy of keys and
+** false if it should just use the supplied pointer. CopyKey only makes
+** sense for SQLITE_HASH_STRING and SQLITE_HASH_BINARY and is ignored
+** for other key classes.
+*/
+void sqlite3HashInit(Hash *pNew, int keyClass, int copyKey){
+ assert( pNew!=0 );
+ assert( keyClass>=SQLITE_HASH_STRING && keyClass<=SQLITE_HASH_BINARY );
+ pNew->keyClass = keyClass;
+#if 0
+ if( keyClass==SQLITE_HASH_POINTER || keyClass==SQLITE_HASH_INT ) copyKey = 0;
+#endif
+ pNew->copyKey = copyKey;
+ pNew->first = 0;
+ pNew->count = 0;
+ pNew->htsize = 0;
+ pNew->ht = 0;
+}
+
+/* Remove all entries from a hash table. Reclaim all memory.
+** Call this routine to delete a hash table or to reset a hash table
+** to the empty state.
+*/
+void sqlite3HashClear(Hash *pH){
+ HashElem *elem; /* For looping over all elements of the table */
+
+ assert( pH!=0 );
+ elem = pH->first;
+ pH->first = 0;
+ if( pH->ht ) sqliteFree(pH->ht);
+ pH->ht = 0;
+ pH->htsize = 0;
+ while( elem ){
+ HashElem *next_elem = elem->next;
+ if( pH->copyKey && elem->pKey ){
+ sqliteFree(elem->pKey);
+ }
+ sqliteFree(elem);
+ elem = next_elem;
+ }
+ pH->count = 0;
+}
+
+#if 0 /* NOT USED */
+/*
+** Hash and comparison functions when the mode is SQLITE_HASH_INT
+*/
+static int intHash(const void *pKey, int nKey){
+ return nKey ^ (nKey<<8) ^ (nKey>>8);
+}
+static int intCompare(const void *pKey1, int n1, const void *pKey2, int n2){
+ return n2 - n1;
+}
+#endif
+
+#if 0 /* NOT USED */
+/*
+** Hash and comparison functions when the mode is SQLITE_HASH_POINTER
+*/
+static int ptrHash(const void *pKey, int nKey){
+ uptr x = Addr(pKey);
+ return x ^ (x<<8) ^ (x>>8);
+}
+static int ptrCompare(const void *pKey1, int n1, const void *pKey2, int n2){
+ if( pKey1==pKey2 ) return 0;
+ if( pKey1<pKey2 ) return -1;
+ return 1;
+}
+#endif
+
+/*
+** Hash and comparison functions when the mode is SQLITE_HASH_STRING
+*/
+static int strHash(const void *pKey, int nKey){
+ const char *z = (const char *)pKey;
+ int h = 0;
+ if( nKey<=0 ) nKey = strlen(z);
+ while( nKey > 0 ){
+ h = (h<<3) ^ h ^ sqlite3UpperToLower[(unsigned char)*z++];
+ nKey--;
+ }
+ return h & 0x7fffffff;
+}
+static int strCompare(const void *pKey1, int n1, const void *pKey2, int n2){
+ if( n1!=n2 ) return 1;
+ return sqlite3StrNICmp((const char*)pKey1,(const char*)pKey2,n1);
+}
+
+/*
+** Hash and comparison functions when the mode is SQLITE_HASH_BINARY
+*/
+static int binHash(const void *pKey, int nKey){
+ int h = 0;
+ const char *z = (const char *)pKey;
+ while( nKey-- > 0 ){
+ h = (h<<3) ^ h ^ *(z++);
+ }
+ return h & 0x7fffffff;
+}
+static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){
+ if( n1!=n2 ) return 1;
+ return memcmp(pKey1,pKey2,n1);
+}
+
+/*
+** Return a pointer to the appropriate hash function given the key class.
+**
+** The C syntax in this function definition may be unfamilar to some
+** programmers, so we provide the following additional explanation:
+**
+** The name of the function is "hashFunction". The function takes a
+** single parameter "keyClass". The return value of hashFunction()
+** is a pointer to another function. Specifically, the return value
+** of hashFunction() is a pointer to a function that takes two parameters
+** with types "const void*" and "int" and returns an "int".
+*/
+static int (*hashFunction(int keyClass))(const void*,int){
+#if 0 /* HASH_INT and HASH_POINTER are never used */
+ switch( keyClass ){
+ case SQLITE_HASH_INT: return &intHash;
+ case SQLITE_HASH_POINTER: return &ptrHash;
+ case SQLITE_HASH_STRING: return &strHash;
+ case SQLITE_HASH_BINARY: return &binHash;;
+ default: break;
+ }
+ return 0;
+#else
+ if( keyClass==SQLITE_HASH_STRING ){
+ return &strHash;
+ }else{
+ assert( keyClass==SQLITE_HASH_BINARY );
+ return &binHash;
+ }
+#endif
+}
+
+/*
+** Return a pointer to the appropriate hash function given the key class.
+**
+** For help in interpreted the obscure C code in the function definition,
+** see the header comment on the previous function.
+*/
+static int (*compareFunction(int keyClass))(const void*,int,const void*,int){
+#if 0 /* HASH_INT and HASH_POINTER are never used */
+ switch( keyClass ){
+ case SQLITE_HASH_INT: return &intCompare;
+ case SQLITE_HASH_POINTER: return &ptrCompare;
+ case SQLITE_HASH_STRING: return &strCompare;
+ case SQLITE_HASH_BINARY: return &binCompare;
+ default: break;
+ }
+ return 0;
+#else
+ if( keyClass==SQLITE_HASH_STRING ){
+ return &strCompare;
+ }else{
+ assert( keyClass==SQLITE_HASH_BINARY );
+ return &binCompare;
+ }
+#endif
+}
+
+/* Link an element into the hash table
+*/
+static void insertElement(
+ Hash *pH, /* The complete hash table */
+ struct _ht *pEntry, /* The entry into which pNew is inserted */
+ HashElem *pNew /* The element to be inserted */
+){
+ HashElem *pHead; /* First element already in pEntry */
+ pHead = pEntry->chain;
+ if( pHead ){
+ pNew->next = pHead;
+ pNew->prev = pHead->prev;
+ if( pHead->prev ){ pHead->prev->next = pNew; }
+ else { pH->first = pNew; }
+ pHead->prev = pNew;
+ }else{
+ pNew->next = pH->first;
+ if( pH->first ){ pH->first->prev = pNew; }
+ pNew->prev = 0;
+ pH->first = pNew;
+ }
+ pEntry->count++;
+ pEntry->chain = pNew;
+}
+
+
+/* Resize the hash table so that it cantains "new_size" buckets.
+** "new_size" must be a power of 2. The hash table might fail
+** to resize if sqliteMalloc() fails.
+*/
+static void rehash(Hash *pH, int new_size){
+ struct _ht *new_ht; /* The new hash table */
+ HashElem *elem, *next_elem; /* For looping over existing elements */
+ int (*xHash)(const void*,int); /* The hash function */
+
+ assert( (new_size & (new_size-1))==0 );
+ new_ht = (struct _ht *)sqliteMalloc( new_size*sizeof(struct _ht) );
+ if( new_ht==0 ) return;
+ if( pH->ht ) sqliteFree(pH->ht);
+ pH->ht = new_ht;
+ pH->htsize = new_size;
+ xHash = hashFunction(pH->keyClass);
+ for(elem=pH->first, pH->first=0; elem; elem = next_elem){
+ int h = (*xHash)(elem->pKey, elem->nKey) & (new_size-1);
+ next_elem = elem->next;
+ insertElement(pH, &new_ht[h], elem);
+ }
+}
+
+/* This function (for internal use only) locates an element in an
+** hash table that matches the given key. The hash for this key has
+** already been computed and is passed as the 4th parameter.
+*/
+static HashElem *findElementGivenHash(
+ const Hash *pH, /* The pH to be searched */
+ const void *pKey, /* The key we are searching for */
+ int nKey,
+ int h /* The hash for this key. */
+){
+ HashElem *elem; /* Used to loop thru the element list */
+ int count; /* Number of elements left to test */
+ int (*xCompare)(const void*,int,const void*,int); /* comparison function */
+
+ if( pH->ht ){
+ struct _ht *pEntry = &pH->ht[h];
+ elem = pEntry->chain;
+ count = pEntry->count;
+ xCompare = compareFunction(pH->keyClass);
+ while( count-- && elem ){
+ if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){
+ return elem;
+ }
+ elem = elem->next;
+ }
+ }
+ return 0;
+}
+
+/* Remove a single entry from the hash table given a pointer to that
+** element and a hash on the element's key.
+*/
+static void removeElementGivenHash(
+ Hash *pH, /* The pH containing "elem" */
+ HashElem* elem, /* The element to be removed from the pH */
+ int h /* Hash value for the element */
+){
+ struct _ht *pEntry;
+ if( elem->prev ){
+ elem->prev->next = elem->next;
+ }else{
+ pH->first = elem->next;
+ }
+ if( elem->next ){
+ elem->next->prev = elem->prev;
+ }
+ pEntry = &pH->ht[h];
+ if( pEntry->chain==elem ){
+ pEntry->chain = elem->next;
+ }
+ pEntry->count--;
+ if( pEntry->count<=0 ){
+ pEntry->chain = 0;
+ }
+ if( pH->copyKey && elem->pKey ){
+ sqliteFree(elem->pKey);
+ }
+ sqliteFree( elem );
+ pH->count--;
+}
+
+/* Attempt to locate an element of the hash table pH with a key
+** that matches pKey,nKey. Return the data for this element if it is
+** found, or NULL if there is no match.
+*/
+void *sqlite3HashFind(const Hash *pH, const void *pKey, int nKey){
+ int h; /* A hash on key */
+ HashElem *elem; /* The element that matches key */
+ int (*xHash)(const void*,int); /* The hash function */
+
+ if( pH==0 || pH->ht==0 ) return 0;
+ xHash = hashFunction(pH->keyClass);
+ assert( xHash!=0 );
+ h = (*xHash)(pKey,nKey);
+ assert( (pH->htsize & (pH->htsize-1))==0 );
+ elem = findElementGivenHash(pH,pKey,nKey, h & (pH->htsize-1));
+ return elem ? elem->data : 0;
+}
+
+/* Insert an element into the hash table pH. The key is pKey,nKey
+** and the data is "data".
+**
+** If no element exists with a matching key, then a new
+** element is created. A copy of the key is made if the copyKey
+** flag is set. NULL is returned.
+**
+** If another element already exists with the same key, then the
+** new data replaces the old data and the old data is returned.
+** The key is not copied in this instance. If a malloc fails, then
+** the new data is returned and the hash table is unchanged.
+**
+** If the "data" parameter to this function is NULL, then the
+** element corresponding to "key" is removed from the hash table.
+*/
+void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){
+ int hraw; /* Raw hash value of the key */
+ int h; /* the hash of the key modulo hash table size */
+ HashElem *elem; /* Used to loop thru the element list */
+ HashElem *new_elem; /* New element added to the pH */
+ int (*xHash)(const void*,int); /* The hash function */
+
+ assert( pH!=0 );
+ xHash = hashFunction(pH->keyClass);
+ assert( xHash!=0 );
+ hraw = (*xHash)(pKey, nKey);
+ assert( (pH->htsize & (pH->htsize-1))==0 );
+ h = hraw & (pH->htsize-1);
+ elem = findElementGivenHash(pH,pKey,nKey,h);
+ if( elem ){
+ void *old_data = elem->data;
+ if( data==0 ){
+ removeElementGivenHash(pH,elem,h);
+ }else{
+ elem->data = data;
+ }
+ return old_data;
+ }
+ if( data==0 ) return 0;
+ new_elem = (HashElem*)sqliteMalloc( sizeof(HashElem) );
+ if( new_elem==0 ) return data;
+ if( pH->copyKey && pKey!=0 ){
+ new_elem->pKey = sqliteMallocRaw( nKey );
+ if( new_elem->pKey==0 ){
+ sqliteFree(new_elem);
+ return data;
+ }
+ memcpy((void*)new_elem->pKey, pKey, nKey);
+ }else{
+ new_elem->pKey = (void*)pKey;
+ }
+ new_elem->nKey = nKey;
+ pH->count++;
+ if( pH->htsize==0 ){
+ rehash(pH,8);
+ if( pH->htsize==0 ){
+ pH->count = 0;
+ sqliteFree(new_elem);
+ return data;
+ }
+ }
+ if( pH->count > pH->htsize ){
+ rehash(pH,pH->htsize*2);
+ }
+ assert( pH->htsize>0 );
+ assert( (pH->htsize & (pH->htsize-1))==0 );
+ h = hraw & (pH->htsize-1);
+ insertElement(pH, &pH->ht[h], new_elem);
+ new_elem->data = data;
+ return 0;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/hash.h b/ext/pdo_sqlite/sqlite/src/hash.h
new file mode 100644
index 000000000..cf004ddc5
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/hash.h
@@ -0,0 +1,109 @@
+/*
+** 2001 September 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This is the header file for the generic hash-table implemenation
+** used in SQLite.
+**
+** $Id$
+*/
+#ifndef _SQLITE_HASH_H_
+#define _SQLITE_HASH_H_
+
+/* Forward declarations of structures. */
+typedef struct Hash Hash;
+typedef struct HashElem HashElem;
+
+/* A complete hash table is an instance of the following structure.
+** The internals of this structure are intended to be opaque -- client
+** code should not attempt to access or modify the fields of this structure
+** directly. Change this structure only by using the routines below.
+** However, many of the "procedures" and "functions" for modifying and
+** accessing this structure are really macros, so we can't really make
+** this structure opaque.
+*/
+struct Hash {
+ char keyClass; /* SQLITE_HASH_INT, _POINTER, _STRING, _BINARY */
+ char copyKey; /* True if copy of key made on insert */
+ int count; /* Number of entries in this table */
+ HashElem *first; /* The first element of the array */
+ int htsize; /* Number of buckets in the hash table */
+ struct _ht { /* the hash table */
+ int count; /* Number of entries with this hash */
+ HashElem *chain; /* Pointer to first entry with this hash */
+ } *ht;
+};
+
+/* Each element in the hash table is an instance of the following
+** structure. All elements are stored on a single doubly-linked list.
+**
+** Again, this structure is intended to be opaque, but it can't really
+** be opaque because it is used by macros.
+*/
+struct HashElem {
+ HashElem *next, *prev; /* Next and previous elements in the table */
+ void *data; /* Data associated with this element */
+ void *pKey; int nKey; /* Key associated with this element */
+};
+
+/*
+** There are 4 different modes of operation for a hash table:
+**
+** SQLITE_HASH_INT nKey is used as the key and pKey is ignored.
+**
+** SQLITE_HASH_POINTER pKey is used as the key and nKey is ignored.
+**
+** SQLITE_HASH_STRING pKey points to a string that is nKey bytes long
+** (including the null-terminator, if any). Case
+** is ignored in comparisons.
+**
+** SQLITE_HASH_BINARY pKey points to binary data nKey bytes long.
+** memcmp() is used to compare keys.
+**
+** A copy of the key is made for SQLITE_HASH_STRING and SQLITE_HASH_BINARY
+** if the copyKey parameter to HashInit is 1.
+*/
+/* #define SQLITE_HASH_INT 1 // NOT USED */
+/* #define SQLITE_HASH_POINTER 2 // NOT USED */
+#define SQLITE_HASH_STRING 3
+#define SQLITE_HASH_BINARY 4
+
+/*
+** Access routines. To delete, insert a NULL pointer.
+*/
+void sqlite3HashInit(Hash*, int keytype, int copyKey);
+void *sqlite3HashInsert(Hash*, const void *pKey, int nKey, void *pData);
+void *sqlite3HashFind(const Hash*, const void *pKey, int nKey);
+void sqlite3HashClear(Hash*);
+
+/*
+** Macros for looping over all elements of a hash table. The idiom is
+** like this:
+**
+** Hash h;
+** HashElem *p;
+** ...
+** for(p=sqliteHashFirst(&h); p; p=sqliteHashNext(p)){
+** SomeStructure *pData = sqliteHashData(p);
+** // do something with pData
+** }
+*/
+#define sqliteHashFirst(H) ((H)->first)
+#define sqliteHashNext(E) ((E)->next)
+#define sqliteHashData(E) ((E)->data)
+#define sqliteHashKey(E) ((E)->pKey)
+#define sqliteHashKeysize(E) ((E)->nKey)
+
+/*
+** Number of entries in a hash table
+*/
+#define sqliteHashCount(H) ((H)->count)
+
+#endif /* _SQLITE_HASH_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/insert.c b/ext/pdo_sqlite/sqlite/src/insert.c
new file mode 100644
index 000000000..37f9f4ee5
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/insert.c
@@ -0,0 +1,1107 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains C code routines that are called by the parser
+** to handle INSERT statements in SQLite.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+
+/*
+** Set P3 of the most recently inserted opcode to a column affinity
+** string for index pIdx. A column affinity string has one character
+** for each column in the table, according to the affinity of the column:
+**
+** Character Column affinity
+** ------------------------------
+** 'n' NUMERIC
+** 'i' INTEGER
+** 't' TEXT
+** 'o' NONE
+*/
+void sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
+ if( !pIdx->zColAff ){
+ /* The first time a column affinity string for a particular index is
+ ** required, it is allocated and populated here. It is then stored as
+ ** a member of the Index structure for subsequent use.
+ **
+ ** The column affinity string will eventually be deleted by
+ ** sqliteDeleteIndex() when the Index structure itself is cleaned
+ ** up.
+ */
+ int n;
+ Table *pTab = pIdx->pTable;
+ pIdx->zColAff = (char *)sqliteMalloc(pIdx->nColumn+1);
+ if( !pIdx->zColAff ){
+ return;
+ }
+ for(n=0; n<pIdx->nColumn; n++){
+ pIdx->zColAff[n] = pTab->aCol[pIdx->aiColumn[n]].affinity;
+ }
+ pIdx->zColAff[pIdx->nColumn] = '\0';
+ }
+
+ sqlite3VdbeChangeP3(v, -1, pIdx->zColAff, 0);
+}
+
+/*
+** Set P3 of the most recently inserted opcode to a column affinity
+** string for table pTab. A column affinity string has one character
+** for each column indexed by the index, according to the affinity of the
+** column:
+**
+** Character Column affinity
+** ------------------------------
+** 'n' NUMERIC
+** 'i' INTEGER
+** 't' TEXT
+** 'o' NONE
+*/
+void sqlite3TableAffinityStr(Vdbe *v, Table *pTab){
+ /* The first time a column affinity string for a particular table
+ ** is required, it is allocated and populated here. It is then
+ ** stored as a member of the Table structure for subsequent use.
+ **
+ ** The column affinity string will eventually be deleted by
+ ** sqlite3DeleteTable() when the Table structure itself is cleaned up.
+ */
+ if( !pTab->zColAff ){
+ char *zColAff;
+ int i;
+
+ zColAff = (char *)sqliteMalloc(pTab->nCol+1);
+ if( !zColAff ){
+ return;
+ }
+
+ for(i=0; i<pTab->nCol; i++){
+ zColAff[i] = pTab->aCol[i].affinity;
+ }
+ zColAff[pTab->nCol] = '\0';
+
+ pTab->zColAff = zColAff;
+ }
+
+ sqlite3VdbeChangeP3(v, -1, pTab->zColAff, 0);
+}
+
+/*
+** Return non-zero if SELECT statement p opens the table with rootpage
+** iTab in database iDb. This is used to see if a statement of the form
+** "INSERT INTO <iDb, iTab> SELECT ..." can run without using temporary
+** table for the results of the SELECT.
+**
+** No checking is done for sub-selects that are part of expressions.
+*/
+static int selectReadsTable(Select *p, int iDb, int iTab){
+ int i;
+ struct SrcList_item *pItem;
+ if( p->pSrc==0 ) return 0;
+ for(i=0, pItem=p->pSrc->a; i<p->pSrc->nSrc; i++, pItem++){
+ if( pItem->pSelect ){
+ if( selectReadsTable(pItem->pSelect, iDb, iTab) ) return 1;
+ }else{
+ if( pItem->pTab->iDb==iDb && pItem->pTab->tnum==iTab ) return 1;
+ }
+ }
+ return 0;
+}
+
+/*
+** This routine is call to handle SQL of the following forms:
+**
+** insert into TABLE (IDLIST) values(EXPRLIST)
+** insert into TABLE (IDLIST) select
+**
+** The IDLIST following the table name is always optional. If omitted,
+** then a list of all columns for the table is substituted. The IDLIST
+** appears in the pColumn parameter. pColumn is NULL if IDLIST is omitted.
+**
+** The pList parameter holds EXPRLIST in the first form of the INSERT
+** statement above, and pSelect is NULL. For the second form, pList is
+** NULL and pSelect is a pointer to the select statement used to generate
+** data for the insert.
+**
+** The code generated follows one of three templates. For a simple
+** select with data coming from a VALUES clause, the code executes
+** once straight down through. The template looks like this:
+**
+** open write cursor to <table> and its indices
+** puts VALUES clause expressions onto the stack
+** write the resulting record into <table>
+** cleanup
+**
+** If the statement is of the form
+**
+** INSERT INTO <table> SELECT ...
+**
+** And the SELECT clause does not read from <table> at any time, then
+** the generated code follows this template:
+**
+** goto B
+** A: setup for the SELECT
+** loop over the tables in the SELECT
+** gosub C
+** end loop
+** cleanup after the SELECT
+** goto D
+** B: open write cursor to <table> and its indices
+** goto A
+** C: insert the select result into <table>
+** return
+** D: cleanup
+**
+** The third template is used if the insert statement takes its
+** values from a SELECT but the data is being inserted into a table
+** that is also read as part of the SELECT. In the third form,
+** we have to use a intermediate table to store the results of
+** the select. The template is like this:
+**
+** goto B
+** A: setup for the SELECT
+** loop over the tables in the SELECT
+** gosub C
+** end loop
+** cleanup after the SELECT
+** goto D
+** C: insert the select result into the intermediate table
+** return
+** B: open a cursor to an intermediate table
+** goto A
+** D: open write cursor to <table> and its indices
+** loop over the intermediate table
+** transfer values form intermediate table into <table>
+** end the loop
+** cleanup
+*/
+void sqlite3Insert(
+ Parse *pParse, /* Parser context */
+ SrcList *pTabList, /* Name of table into which we are inserting */
+ ExprList *pList, /* List of values to be inserted */
+ Select *pSelect, /* A SELECT statement to use as the data source */
+ IdList *pColumn, /* Column names corresponding to IDLIST. */
+ int onError /* How to handle constraint errors */
+){
+ Table *pTab; /* The table to insert into */
+ char *zTab; /* Name of the table into which we are inserting */
+ const char *zDb; /* Name of the database holding this table */
+ int i, j, idx; /* Loop counters */
+ Vdbe *v; /* Generate code into this virtual machine */
+ Index *pIdx; /* For looping over indices of the table */
+ int nColumn; /* Number of columns in the data */
+ int base = 0; /* VDBE Cursor number for pTab */
+ int iCont=0,iBreak=0; /* Beginning and end of the loop over srcTab */
+ sqlite3 *db; /* The main database structure */
+ int keyColumn = -1; /* Column that is the INTEGER PRIMARY KEY */
+ int endOfLoop; /* Label for the end of the insertion loop */
+ int useTempTable = 0; /* Store SELECT results in intermediate table */
+ int srcTab = 0; /* Data comes from this temporary cursor if >=0 */
+ int iSelectLoop = 0; /* Address of code that implements the SELECT */
+ int iCleanup = 0; /* Address of the cleanup code */
+ int iInsertBlock = 0; /* Address of the subroutine used to insert data */
+ int iCntMem = 0; /* Memory cell used for the row counter */
+ int newIdx = -1; /* Cursor for the NEW table */
+ Db *pDb; /* The database containing table being inserted into */
+ int counterMem = 0; /* Memory cell holding AUTOINCREMENT counter */
+
+#ifndef SQLITE_OMIT_TRIGGER
+ int isView; /* True if attempting to insert into a view */
+ int triggers_exist = 0; /* True if there are FOR EACH ROW triggers */
+#endif
+
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ int counterRowid; /* Memory cell holding rowid of autoinc counter */
+#endif
+
+ if( pParse->nErr || sqlite3_malloc_failed ) goto insert_cleanup;
+ db = pParse->db;
+
+ /* Locate the table into which we will be inserting new information.
+ */
+ assert( pTabList->nSrc==1 );
+ zTab = pTabList->a[0].zName;
+ if( zTab==0 ) goto insert_cleanup;
+ pTab = sqlite3SrcListLookup(pParse, pTabList);
+ if( pTab==0 ){
+ goto insert_cleanup;
+ }
+ assert( pTab->iDb<db->nDb );
+ pDb = &db->aDb[pTab->iDb];
+ zDb = pDb->zName;
+ if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ){
+ goto insert_cleanup;
+ }
+
+ /* Figure out if we have any triggers and if the table being
+ ** inserted into is a view
+ */
+#ifndef SQLITE_OMIT_TRIGGER
+ triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_INSERT, 0);
+ isView = pTab->pSelect!=0;
+#else
+# define triggers_exist 0
+# define isView 0
+#endif
+#ifdef SQLITE_OMIT_VIEW
+# undef isView
+# define isView 0
+#endif
+
+ /* Ensure that:
+ * (a) the table is not read-only,
+ * (b) that if it is a view then ON INSERT triggers exist
+ */
+ if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){
+ goto insert_cleanup;
+ }
+ if( pTab==0 ) goto insert_cleanup;
+
+ /* If pTab is really a view, make sure it has been initialized.
+ */
+ if( isView && sqlite3ViewGetColumnNames(pParse, pTab) ){
+ goto insert_cleanup;
+ }
+
+ /* Ensure all required collation sequences are available. */
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ if( sqlite3CheckIndexCollSeq(pParse, pIdx) ){
+ goto insert_cleanup;
+ }
+ }
+
+ /* Allocate a VDBE
+ */
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) goto insert_cleanup;
+ if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
+ sqlite3BeginWriteOperation(pParse, pSelect || triggers_exist, pTab->iDb);
+
+ /* if there are row triggers, allocate a temp table for new.* references. */
+ if( triggers_exist ){
+ newIdx = pParse->nTab++;
+ }
+
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ /* If this is an AUTOINCREMENT table, look up the sequence number in the
+ ** sqlite_sequence table and store it in memory cell counterMem. Also
+ ** remember the rowid of the sqlite_sequence table entry in memory cell
+ ** counterRowid.
+ */
+ if( pTab->autoInc ){
+ int iCur = pParse->nTab;
+ int base = sqlite3VdbeCurrentAddr(v);
+ counterRowid = pParse->nMem++;
+ counterMem = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0);
+ sqlite3VdbeAddOp(v, OP_OpenRead, iCur, pDb->pSeqTab->tnum);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iCur, 2);
+ sqlite3VdbeAddOp(v, OP_Rewind, iCur, base+13);
+ sqlite3VdbeAddOp(v, OP_Column, iCur, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0);
+ sqlite3VdbeAddOp(v, OP_Ne, 28417, base+12);
+ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_MemStore, counterRowid, 1);
+ sqlite3VdbeAddOp(v, OP_Column, iCur, 1);
+ sqlite3VdbeAddOp(v, OP_MemStore, counterMem, 1);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, base+13);
+ sqlite3VdbeAddOp(v, OP_Next, iCur, base+4);
+ sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
+ }
+#endif /* SQLITE_OMIT_AUTOINCREMENT */
+
+ /* Figure out how many columns of data are supplied. If the data
+ ** is coming from a SELECT statement, then this step also generates
+ ** all the code to implement the SELECT statement and invoke a subroutine
+ ** to process each row of the result. (Template 2.) If the SELECT
+ ** statement uses the the table that is being inserted into, then the
+ ** subroutine is also coded here. That subroutine stores the SELECT
+ ** results in a temporary table. (Template 3.)
+ */
+ if( pSelect ){
+ /* Data is coming from a SELECT. Generate code to implement that SELECT
+ */
+ int rc, iInitCode;
+ iInitCode = sqlite3VdbeAddOp(v, OP_Goto, 0, 0);
+ iSelectLoop = sqlite3VdbeCurrentAddr(v);
+ iInsertBlock = sqlite3VdbeMakeLabel(v);
+
+ /* Resolve the expressions in the SELECT statement and execute it. */
+ rc = sqlite3Select(pParse, pSelect, SRT_Subroutine, iInsertBlock,0,0,0,0);
+ if( rc || pParse->nErr || sqlite3_malloc_failed ) goto insert_cleanup;
+
+ iCleanup = sqlite3VdbeMakeLabel(v);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, iCleanup);
+ assert( pSelect->pEList );
+ nColumn = pSelect->pEList->nExpr;
+
+ /* Set useTempTable to TRUE if the result of the SELECT statement
+ ** should be written into a temporary table. Set to FALSE if each
+ ** row of the SELECT can be written directly into the result table.
+ **
+ ** A temp table must be used if the table being updated is also one
+ ** of the tables being read by the SELECT statement. Also use a
+ ** temp table in the case of row triggers.
+ */
+ if( triggers_exist || selectReadsTable(pSelect, pTab->iDb, pTab->tnum) ){
+ useTempTable = 1;
+ }
+
+ if( useTempTable ){
+ /* Generate the subroutine that SELECT calls to process each row of
+ ** the result. Store the result in a temporary table
+ */
+ srcTab = pParse->nTab++;
+ sqlite3VdbeResolveLabel(v, iInsertBlock);
+ sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
+ sqlite3TableAffinityStr(v, pTab);
+ sqlite3VdbeAddOp(v, OP_NewRowid, srcTab, 0);
+ sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Insert, srcTab, 0);
+ sqlite3VdbeAddOp(v, OP_Return, 0, 0);
+
+ /* The following code runs first because the GOTO at the very top
+ ** of the program jumps to it. Create the temporary table, then jump
+ ** back up and execute the SELECT code above.
+ */
+ sqlite3VdbeJumpHere(v, iInitCode);
+ sqlite3VdbeAddOp(v, OP_OpenVirtual, srcTab, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, srcTab, nColumn);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, iSelectLoop);
+ sqlite3VdbeResolveLabel(v, iCleanup);
+ }else{
+ sqlite3VdbeJumpHere(v, iInitCode);
+ }
+ }else{
+ /* This is the case if the data for the INSERT is coming from a VALUES
+ ** clause
+ */
+ NameContext sNC;
+ memset(&sNC, 0, sizeof(sNC));
+ sNC.pParse = pParse;
+ assert( pList!=0 );
+ srcTab = -1;
+ useTempTable = 0;
+ assert( pList );
+ nColumn = pList->nExpr;
+ for(i=0; i<nColumn; i++){
+ if( sqlite3ExprResolveNames(&sNC, pList->a[i].pExpr) ){
+ goto insert_cleanup;
+ }
+ }
+ }
+
+ /* Make sure the number of columns in the source data matches the number
+ ** of columns to be inserted into the table.
+ */
+ if( pColumn==0 && nColumn!=pTab->nCol ){
+ sqlite3ErrorMsg(pParse,
+ "table %S has %d columns but %d values were supplied",
+ pTabList, 0, pTab->nCol, nColumn);
+ goto insert_cleanup;
+ }
+ if( pColumn!=0 && nColumn!=pColumn->nId ){
+ sqlite3ErrorMsg(pParse, "%d values for %d columns", nColumn, pColumn->nId);
+ goto insert_cleanup;
+ }
+
+ /* If the INSERT statement included an IDLIST term, then make sure
+ ** all elements of the IDLIST really are columns of the table and
+ ** remember the column indices.
+ **
+ ** If the table has an INTEGER PRIMARY KEY column and that column
+ ** is named in the IDLIST, then record in the keyColumn variable
+ ** the index into IDLIST of the primary key column. keyColumn is
+ ** the index of the primary key as it appears in IDLIST, not as
+ ** is appears in the original table. (The index of the primary
+ ** key in the original table is pTab->iPKey.)
+ */
+ if( pColumn ){
+ for(i=0; i<pColumn->nId; i++){
+ pColumn->a[i].idx = -1;
+ }
+ for(i=0; i<pColumn->nId; i++){
+ for(j=0; j<pTab->nCol; j++){
+ if( sqlite3StrICmp(pColumn->a[i].zName, pTab->aCol[j].zName)==0 ){
+ pColumn->a[i].idx = j;
+ if( j==pTab->iPKey ){
+ keyColumn = i;
+ }
+ break;
+ }
+ }
+ if( j>=pTab->nCol ){
+ if( sqlite3IsRowid(pColumn->a[i].zName) ){
+ keyColumn = i;
+ }else{
+ sqlite3ErrorMsg(pParse, "table %S has no column named %s",
+ pTabList, 0, pColumn->a[i].zName);
+ pParse->nErr++;
+ goto insert_cleanup;
+ }
+ }
+ }
+ }
+
+ /* If there is no IDLIST term but the table has an integer primary
+ ** key, the set the keyColumn variable to the primary key column index
+ ** in the original table definition.
+ */
+ if( pColumn==0 ){
+ keyColumn = pTab->iPKey;
+ }
+
+ /* Open the temp table for FOR EACH ROW triggers
+ */
+ if( triggers_exist ){
+ sqlite3VdbeAddOp(v, OP_OpenPseudo, newIdx, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, newIdx, pTab->nCol);
+ }
+
+ /* Initialize the count of rows to be inserted
+ */
+ if( db->flags & SQLITE_CountRows ){
+ iCntMem = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, iCntMem);
+ }
+
+ /* Open tables and indices if there are no row triggers */
+ if( !triggers_exist ){
+ base = pParse->nTab;
+ sqlite3OpenTableAndIndices(pParse, pTab, base, OP_OpenWrite);
+ }
+
+ /* If the data source is a temporary table, then we have to create
+ ** a loop because there might be multiple rows of data. If the data
+ ** source is a subroutine call from the SELECT statement, then we need
+ ** to launch the SELECT statement processing.
+ */
+ if( useTempTable ){
+ iBreak = sqlite3VdbeMakeLabel(v);
+ sqlite3VdbeAddOp(v, OP_Rewind, srcTab, iBreak);
+ iCont = sqlite3VdbeCurrentAddr(v);
+ }else if( pSelect ){
+ sqlite3VdbeAddOp(v, OP_Goto, 0, iSelectLoop);
+ sqlite3VdbeResolveLabel(v, iInsertBlock);
+ }
+
+ /* Run the BEFORE and INSTEAD OF triggers, if there are any
+ */
+ endOfLoop = sqlite3VdbeMakeLabel(v);
+ if( triggers_exist & TRIGGER_BEFORE ){
+
+ /* build the NEW.* reference row. Note that if there is an INTEGER
+ ** PRIMARY KEY into which a NULL is being inserted, that NULL will be
+ ** translated into a unique ID for the row. But on a BEFORE trigger,
+ ** we do not know what the unique ID will be (because the insert has
+ ** not happened yet) so we substitute a rowid of -1
+ */
+ if( keyColumn<0 ){
+ sqlite3VdbeAddOp(v, OP_Integer, -1, 0);
+ }else if( useTempTable ){
+ sqlite3VdbeAddOp(v, OP_Column, srcTab, keyColumn);
+ }else{
+ assert( pSelect==0 ); /* Otherwise useTempTable is true */
+ sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr);
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, -1, 0);
+ sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0);
+ }
+
+ /* Create the new column data
+ */
+ for(i=0; i<pTab->nCol; i++){
+ if( pColumn==0 ){
+ j = i;
+ }else{
+ for(j=0; j<pColumn->nId; j++){
+ if( pColumn->a[j].idx==i ) break;
+ }
+ }
+ if( pColumn && j>=pColumn->nId ){
+ sqlite3ExprCode(pParse, pTab->aCol[i].pDflt);
+ }else if( useTempTable ){
+ sqlite3VdbeAddOp(v, OP_Column, srcTab, j);
+ }else{
+ assert( pSelect==0 ); /* Otherwise useTempTable is true */
+ sqlite3ExprCodeAndCache(pParse, pList->a[j].pExpr);
+ }
+ }
+ sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0);
+
+ /* If this is an INSERT on a view with an INSTEAD OF INSERT trigger,
+ ** do not attempt any conversions before assembling the record.
+ ** If this is a real table, attempt conversions as required by the
+ ** table column affinities.
+ */
+ if( !isView ){
+ sqlite3TableAffinityStr(v, pTab);
+ }
+ sqlite3VdbeAddOp(v, OP_Insert, newIdx, 0);
+
+ /* Fire BEFORE or INSTEAD OF triggers */
+ if( sqlite3CodeRowTrigger(pParse, TK_INSERT, 0, TRIGGER_BEFORE, pTab,
+ newIdx, -1, onError, endOfLoop) ){
+ goto insert_cleanup;
+ }
+ }
+
+ /* If any triggers exists, the opening of tables and indices is deferred
+ ** until now.
+ */
+ if( triggers_exist && !isView ){
+ base = pParse->nTab;
+ sqlite3OpenTableAndIndices(pParse, pTab, base, OP_OpenWrite);
+ }
+
+ /* Push the record number for the new entry onto the stack. The
+ ** record number is a randomly generate integer created by NewRowid
+ ** except when the table has an INTEGER PRIMARY KEY column, in which
+ ** case the record number is the same as that column.
+ */
+ if( !isView ){
+ if( keyColumn>=0 ){
+ if( useTempTable ){
+ sqlite3VdbeAddOp(v, OP_Column, srcTab, keyColumn);
+ }else if( pSelect ){
+ sqlite3VdbeAddOp(v, OP_Dup, nColumn - keyColumn - 1, 1);
+ }else{
+ sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr);
+ }
+ /* If the PRIMARY KEY expression is NULL, then use OP_NewRowid
+ ** to generate a unique primary key value.
+ */
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_NewRowid, base, counterMem);
+ sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0);
+ }else{
+ sqlite3VdbeAddOp(v, OP_NewRowid, base, counterMem);
+ }
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ if( pTab->autoInc ){
+ sqlite3VdbeAddOp(v, OP_MemMax, counterMem, 0);
+ }
+#endif /* SQLITE_OMIT_AUTOINCREMENT */
+
+ /* Push onto the stack, data for all columns of the new entry, beginning
+ ** with the first column.
+ */
+ for(i=0; i<pTab->nCol; i++){
+ if( i==pTab->iPKey ){
+ /* The value of the INTEGER PRIMARY KEY column is always a NULL.
+ ** Whenever this column is read, the record number will be substituted
+ ** in its place. So will fill this column with a NULL to avoid
+ ** taking up data space with information that will never be used. */
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ continue;
+ }
+ if( pColumn==0 ){
+ j = i;
+ }else{
+ for(j=0; j<pColumn->nId; j++){
+ if( pColumn->a[j].idx==i ) break;
+ }
+ }
+ if( pColumn && j>=pColumn->nId ){
+ sqlite3ExprCode(pParse, pTab->aCol[i].pDflt);
+ }else if( useTempTable ){
+ sqlite3VdbeAddOp(v, OP_Column, srcTab, j);
+ }else if( pSelect ){
+ sqlite3VdbeAddOp(v, OP_Dup, i+nColumn-j, 1);
+ }else{
+ sqlite3ExprCode(pParse, pList->a[j].pExpr);
+ }
+ }
+
+ /* Generate code to check constraints and generate index keys and
+ ** do the insertion.
+ */
+ sqlite3GenerateConstraintChecks(pParse, pTab, base, 0, keyColumn>=0,
+ 0, onError, endOfLoop);
+ sqlite3CompleteInsertion(pParse, pTab, base, 0,0,0,
+ (triggers_exist & TRIGGER_AFTER)!=0 ? newIdx : -1);
+ }
+
+ /* Update the count of rows that are inserted
+ */
+ if( (db->flags & SQLITE_CountRows)!=0 ){
+ sqlite3VdbeAddOp(v, OP_MemIncr, iCntMem, 0);
+ }
+
+ if( triggers_exist ){
+ /* Close all tables opened */
+ if( !isView ){
+ sqlite3VdbeAddOp(v, OP_Close, base, 0);
+ for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){
+ sqlite3VdbeAddOp(v, OP_Close, idx+base, 0);
+ }
+ }
+
+ /* Code AFTER triggers */
+ if( sqlite3CodeRowTrigger(pParse, TK_INSERT, 0, TRIGGER_AFTER, pTab,
+ newIdx, -1, onError, endOfLoop) ){
+ goto insert_cleanup;
+ }
+ }
+
+ /* The bottom of the loop, if the data source is a SELECT statement
+ */
+ sqlite3VdbeResolveLabel(v, endOfLoop);
+ if( useTempTable ){
+ sqlite3VdbeAddOp(v, OP_Next, srcTab, iCont);
+ sqlite3VdbeResolveLabel(v, iBreak);
+ sqlite3VdbeAddOp(v, OP_Close, srcTab, 0);
+ }else if( pSelect ){
+ sqlite3VdbeAddOp(v, OP_Pop, nColumn, 0);
+ sqlite3VdbeAddOp(v, OP_Return, 0, 0);
+ sqlite3VdbeResolveLabel(v, iCleanup);
+ }
+
+ if( !triggers_exist ){
+ /* Close all tables opened */
+ sqlite3VdbeAddOp(v, OP_Close, base, 0);
+ for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){
+ sqlite3VdbeAddOp(v, OP_Close, idx+base, 0);
+ }
+ }
+
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ /* Update the sqlite_sequence table by storing the content of the
+ ** counter value in memory counterMem back into the sqlite_sequence
+ ** table.
+ */
+ if( pTab->autoInc ){
+ int iCur = pParse->nTab;
+ int base = sqlite3VdbeCurrentAddr(v);
+ sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0);
+ sqlite3VdbeAddOp(v, OP_OpenWrite, iCur, pDb->pSeqTab->tnum);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iCur, 2);
+ sqlite3VdbeAddOp(v, OP_MemLoad, counterRowid, 0);
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, base+7);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_NewRowid, iCur, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0);
+ sqlite3VdbeAddOp(v, OP_MemLoad, counterMem, 0);
+ sqlite3VdbeAddOp(v, OP_MakeRecord, 2, 0);
+ sqlite3VdbeAddOp(v, OP_Insert, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
+ }
+#endif
+
+ /*
+ ** Return the number of rows inserted. If this routine is
+ ** generating code because of a call to sqlite3NestedParse(), do not
+ ** invoke the callback function.
+ */
+ if( db->flags & SQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){
+ sqlite3VdbeAddOp(v, OP_MemLoad, iCntMem, 0);
+ sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
+ sqlite3VdbeSetNumCols(v, 1);
+ sqlite3VdbeSetColName(v, 0, "rows inserted", P3_STATIC);
+ }
+
+insert_cleanup:
+ sqlite3SrcListDelete(pTabList);
+ sqlite3ExprListDelete(pList);
+ sqlite3SelectDelete(pSelect);
+ sqlite3IdListDelete(pColumn);
+}
+
+/*
+** Generate code to do a constraint check prior to an INSERT or an UPDATE.
+**
+** When this routine is called, the stack contains (from bottom to top)
+** the following values:
+**
+** 1. The rowid of the row to be updated before the update. This
+** value is omitted unless we are doing an UPDATE that involves a
+** change to the record number.
+**
+** 2. The rowid of the row after the update.
+**
+** 3. The data in the first column of the entry after the update.
+**
+** i. Data from middle columns...
+**
+** N. The data in the last column of the entry after the update.
+**
+** The old rowid shown as entry (1) above is omitted unless both isUpdate
+** and rowidChng are 1. isUpdate is true for UPDATEs and false for
+** INSERTs and rowidChng is true if the record number is being changed.
+**
+** The code generated by this routine pushes additional entries onto
+** the stack which are the keys for new index entries for the new record.
+** The order of index keys is the same as the order of the indices on
+** the pTable->pIndex list. A key is only created for index i if
+** aIdxUsed!=0 and aIdxUsed[i]!=0.
+**
+** This routine also generates code to check constraints. NOT NULL,
+** CHECK, and UNIQUE constraints are all checked. If a constraint fails,
+** then the appropriate action is performed. There are five possible
+** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
+**
+** Constraint type Action What Happens
+** --------------- ---------- ----------------------------------------
+** any ROLLBACK The current transaction is rolled back and
+** sqlite3_exec() returns immediately with a
+** return code of SQLITE_CONSTRAINT.
+**
+** any ABORT Back out changes from the current command
+** only (do not do a complete rollback) then
+** cause sqlite3_exec() to return immediately
+** with SQLITE_CONSTRAINT.
+**
+** any FAIL Sqlite_exec() returns immediately with a
+** return code of SQLITE_CONSTRAINT. The
+** transaction is not rolled back and any
+** prior changes are retained.
+**
+** any IGNORE The record number and data is popped from
+** the stack and there is an immediate jump
+** to label ignoreDest.
+**
+** NOT NULL REPLACE The NULL value is replace by the default
+** value for that column. If the default value
+** is NULL, the action is the same as ABORT.
+**
+** UNIQUE REPLACE The other row that conflicts with the row
+** being inserted is removed.
+**
+** CHECK REPLACE Illegal. The results in an exception.
+**
+** Which action to take is determined by the overrideError parameter.
+** Or if overrideError==OE_Default, then the pParse->onError parameter
+** is used. Or if pParse->onError==OE_Default then the onError value
+** for the constraint is used.
+**
+** The calling routine must open a read/write cursor for pTab with
+** cursor number "base". All indices of pTab must also have open
+** read/write cursors with cursor number base+i for the i-th cursor.
+** Except, if there is no possibility of a REPLACE action then
+** cursors do not need to be open for indices where aIdxUsed[i]==0.
+**
+** If the isUpdate flag is true, it means that the "base" cursor is
+** initially pointing to an entry that is being updated. The isUpdate
+** flag causes extra code to be generated so that the "base" cursor
+** is still pointing at the same entry after the routine returns.
+** Without the isUpdate flag, the "base" cursor might be moved.
+*/
+void sqlite3GenerateConstraintChecks(
+ Parse *pParse, /* The parser context */
+ Table *pTab, /* the table into which we are inserting */
+ int base, /* Index of a read/write cursor pointing at pTab */
+ char *aIdxUsed, /* Which indices are used. NULL means all are used */
+ int rowidChng, /* True if the record number will change */
+ int isUpdate, /* True for UPDATE, False for INSERT */
+ int overrideError, /* Override onError to this if not OE_Default */
+ int ignoreDest /* Jump to this label on an OE_Ignore resolution */
+){
+ int i;
+ Vdbe *v;
+ int nCol;
+ int onError;
+ int addr;
+ int extra;
+ int iCur;
+ Index *pIdx;
+ int seenReplace = 0;
+ int jumpInst1=0, jumpInst2;
+ int hasTwoRowids = (isUpdate && rowidChng);
+
+ v = sqlite3GetVdbe(pParse);
+ assert( v!=0 );
+ assert( pTab->pSelect==0 ); /* This table is not a VIEW */
+ nCol = pTab->nCol;
+
+ /* Test all NOT NULL constraints.
+ */
+ for(i=0; i<nCol; i++){
+ if( i==pTab->iPKey ){
+ continue;
+ }
+ onError = pTab->aCol[i].notNull;
+ if( onError==OE_None ) continue;
+ if( overrideError!=OE_Default ){
+ onError = overrideError;
+ }else if( onError==OE_Default ){
+ onError = OE_Abort;
+ }
+ if( onError==OE_Replace && pTab->aCol[i].pDflt==0 ){
+ onError = OE_Abort;
+ }
+ sqlite3VdbeAddOp(v, OP_Dup, nCol-1-i, 1);
+ addr = sqlite3VdbeAddOp(v, OP_NotNull, 1, 0);
+ assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail
+ || onError==OE_Ignore || onError==OE_Replace );
+ switch( onError ){
+ case OE_Rollback:
+ case OE_Abort:
+ case OE_Fail: {
+ char *zMsg = 0;
+ sqlite3VdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError);
+ sqlite3SetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName,
+ " may not be NULL", (char*)0);
+ sqlite3VdbeChangeP3(v, -1, zMsg, P3_DYNAMIC);
+ break;
+ }
+ case OE_Ignore: {
+ sqlite3VdbeAddOp(v, OP_Pop, nCol+1+hasTwoRowids, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, ignoreDest);
+ break;
+ }
+ case OE_Replace: {
+ sqlite3ExprCode(pParse, pTab->aCol[i].pDflt);
+ sqlite3VdbeAddOp(v, OP_Push, nCol-i, 0);
+ break;
+ }
+ }
+ sqlite3VdbeJumpHere(v, addr);
+ }
+
+ /* Test all CHECK constraints
+ */
+ /**** TBD ****/
+
+ /* If we have an INTEGER PRIMARY KEY, make sure the primary key
+ ** of the new record does not previously exist. Except, if this
+ ** is an UPDATE and the primary key is not changing, that is OK.
+ */
+ if( rowidChng ){
+ onError = pTab->keyConf;
+ if( overrideError!=OE_Default ){
+ onError = overrideError;
+ }else if( onError==OE_Default ){
+ onError = OE_Abort;
+ }
+
+ if( isUpdate ){
+ sqlite3VdbeAddOp(v, OP_Dup, nCol+1, 1);
+ sqlite3VdbeAddOp(v, OP_Dup, nCol+1, 1);
+ jumpInst1 = sqlite3VdbeAddOp(v, OP_Eq, 0, 0);
+ }
+ sqlite3VdbeAddOp(v, OP_Dup, nCol, 1);
+ jumpInst2 = sqlite3VdbeAddOp(v, OP_NotExists, base, 0);
+ switch( onError ){
+ default: {
+ onError = OE_Abort;
+ /* Fall thru into the next case */
+ }
+ case OE_Rollback:
+ case OE_Abort:
+ case OE_Fail: {
+ sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError,
+ "PRIMARY KEY must be unique", P3_STATIC);
+ break;
+ }
+ case OE_Replace: {
+ sqlite3GenerateRowIndexDelete(pParse->db, v, pTab, base, 0);
+ if( isUpdate ){
+ sqlite3VdbeAddOp(v, OP_Dup, nCol+hasTwoRowids, 1);
+ sqlite3VdbeAddOp(v, OP_MoveGe, base, 0);
+ }
+ seenReplace = 1;
+ break;
+ }
+ case OE_Ignore: {
+ assert( seenReplace==0 );
+ sqlite3VdbeAddOp(v, OP_Pop, nCol+1+hasTwoRowids, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, ignoreDest);
+ break;
+ }
+ }
+ sqlite3VdbeJumpHere(v, jumpInst2);
+ if( isUpdate ){
+ sqlite3VdbeJumpHere(v, jumpInst1);
+ sqlite3VdbeAddOp(v, OP_Dup, nCol+1, 1);
+ sqlite3VdbeAddOp(v, OP_MoveGe, base, 0);
+ }
+ }
+
+ /* Test all UNIQUE constraints by creating entries for each UNIQUE
+ ** index and making sure that duplicate entries do not already exist.
+ ** Add the new records to the indices as we go.
+ */
+ extra = -1;
+ for(iCur=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, iCur++){
+ if( aIdxUsed && aIdxUsed[iCur]==0 ) continue; /* Skip unused indices */
+ extra++;
+
+ /* Create a key for accessing the index entry */
+ sqlite3VdbeAddOp(v, OP_Dup, nCol+extra, 1);
+ for(i=0; i<pIdx->nColumn; i++){
+ int idx = pIdx->aiColumn[i];
+ if( idx==pTab->iPKey ){
+ sqlite3VdbeAddOp(v, OP_Dup, i+extra+nCol+1, 1);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Dup, i+extra+nCol-idx, 1);
+ }
+ }
+ jumpInst1 = sqlite3VdbeAddOp(v, OP_MakeIdxRec, pIdx->nColumn, 0);
+ sqlite3IndexAffinityStr(v, pIdx);
+
+ /* Find out what action to take in case there is an indexing conflict */
+ onError = pIdx->onError;
+ if( onError==OE_None ) continue; /* pIdx is not a UNIQUE index */
+ if( overrideError!=OE_Default ){
+ onError = overrideError;
+ }else if( onError==OE_Default ){
+ onError = OE_Abort;
+ }
+ if( seenReplace ){
+ if( onError==OE_Ignore ) onError = OE_Replace;
+ else if( onError==OE_Fail ) onError = OE_Abort;
+ }
+
+
+ /* Check to see if the new index entry will be unique */
+ sqlite3VdbeAddOp(v, OP_Dup, extra+nCol+1+hasTwoRowids, 1);
+ jumpInst2 = sqlite3VdbeAddOp(v, OP_IsUnique, base+iCur+1, 0);
+
+ /* Generate code that executes if the new index entry is not unique */
+ assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail
+ || onError==OE_Ignore || onError==OE_Replace );
+ switch( onError ){
+ case OE_Rollback:
+ case OE_Abort:
+ case OE_Fail: {
+ int j, n1, n2;
+ char zErrMsg[200];
+ strcpy(zErrMsg, pIdx->nColumn>1 ? "columns " : "column ");
+ n1 = strlen(zErrMsg);
+ for(j=0; j<pIdx->nColumn && n1<sizeof(zErrMsg)-30; j++){
+ char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName;
+ n2 = strlen(zCol);
+ if( j>0 ){
+ strcpy(&zErrMsg[n1], ", ");
+ n1 += 2;
+ }
+ if( n1+n2>sizeof(zErrMsg)-30 ){
+ strcpy(&zErrMsg[n1], "...");
+ n1 += 3;
+ break;
+ }else{
+ strcpy(&zErrMsg[n1], zCol);
+ n1 += n2;
+ }
+ }
+ strcpy(&zErrMsg[n1],
+ pIdx->nColumn>1 ? " are not unique" : " is not unique");
+ sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, onError, zErrMsg, 0);
+ break;
+ }
+ case OE_Ignore: {
+ assert( seenReplace==0 );
+ sqlite3VdbeAddOp(v, OP_Pop, nCol+extra+3+hasTwoRowids, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, ignoreDest);
+ break;
+ }
+ case OE_Replace: {
+ sqlite3GenerateRowDelete(pParse->db, v, pTab, base, 0);
+ if( isUpdate ){
+ sqlite3VdbeAddOp(v, OP_Dup, nCol+extra+1+hasTwoRowids, 1);
+ sqlite3VdbeAddOp(v, OP_MoveGe, base, 0);
+ }
+ seenReplace = 1;
+ break;
+ }
+ }
+#if NULL_DISTINCT_FOR_UNIQUE
+ sqlite3VdbeJumpHere(v, jumpInst1);
+#endif
+ sqlite3VdbeJumpHere(v, jumpInst2);
+ }
+}
+
+/*
+** This routine generates code to finish the INSERT or UPDATE operation
+** that was started by a prior call to sqlite3GenerateConstraintChecks.
+** The stack must contain keys for all active indices followed by data
+** and the rowid for the new entry. This routine creates the new
+** entries in all indices and in the main table.
+**
+** The arguments to this routine should be the same as the first six
+** arguments to sqlite3GenerateConstraintChecks.
+*/
+void sqlite3CompleteInsertion(
+ Parse *pParse, /* The parser context */
+ Table *pTab, /* the table into which we are inserting */
+ int base, /* Index of a read/write cursor pointing at pTab */
+ char *aIdxUsed, /* Which indices are used. NULL means all are used */
+ int rowidChng, /* True if the record number will change */
+ int isUpdate, /* True for UPDATE, False for INSERT */
+ int newIdx /* Index of NEW table for triggers. -1 if none */
+){
+ int i;
+ Vdbe *v;
+ int nIdx;
+ Index *pIdx;
+ int pik_flags;
+
+ v = sqlite3GetVdbe(pParse);
+ assert( v!=0 );
+ assert( pTab->pSelect==0 ); /* This table is not a VIEW */
+ for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){}
+ for(i=nIdx-1; i>=0; i--){
+ if( aIdxUsed && aIdxUsed[i]==0 ) continue;
+ sqlite3VdbeAddOp(v, OP_IdxInsert, base+i+1, 0);
+ }
+ sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0);
+ sqlite3TableAffinityStr(v, pTab);
+#ifndef SQLITE_OMIT_TRIGGER
+ if( newIdx>=0 ){
+ sqlite3VdbeAddOp(v, OP_Dup, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Dup, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Insert, newIdx, 0);
+ }
+#endif
+ if( pParse->nested ){
+ pik_flags = 0;
+ }else{
+ pik_flags = (OPFLAG_NCHANGE|(isUpdate?0:OPFLAG_LASTROWID));
+ }
+ sqlite3VdbeAddOp(v, OP_Insert, base, pik_flags);
+
+ if( isUpdate && rowidChng ){
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ }
+}
+
+/*
+** Generate code that will open cursors for a table and for all
+** indices of that table. The "base" parameter is the cursor number used
+** for the table. Indices are opened on subsequent cursors.
+*/
+void sqlite3OpenTableAndIndices(
+ Parse *pParse, /* Parsing context */
+ Table *pTab, /* Table to be opened */
+ int base, /* Cursor number assigned to the table */
+ int op /* OP_OpenRead or OP_OpenWrite */
+){
+ int i;
+ Index *pIdx;
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ assert( v!=0 );
+ sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0);
+ VdbeComment((v, "# %s", pTab->zName));
+ sqlite3VdbeAddOp(v, op, base, pTab->tnum);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, base, pTab->nCol);
+ for(i=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
+ sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
+ VdbeComment((v, "# %s", pIdx->zName));
+ sqlite3VdbeOp3(v, op, i+base, pIdx->tnum,
+ (char*)&pIdx->keyInfo, P3_KEYINFO);
+ }
+ if( pParse->nTab<=base+i ){
+ pParse->nTab = base+i;
+ }
+}
diff --git a/ext/pdo_sqlite/sqlite/src/keywordhash.h b/ext/pdo_sqlite/sqlite/src/keywordhash.h
new file mode 100644
index 000000000..f825ba977
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/keywordhash.h
@@ -0,0 +1,97 @@
+/* Hash score: 156 */
+static int keywordCode(const char *z, int n){
+ static const char zText[526] =
+ "ABORTABLEFTEMPORARYADDATABASELECTHENDEFAULTRANSACTIONATURALTER"
+ "AISEACHECKEYAFTEREFERENCESCAPELSEXCEPTRIGGEREGEXPLAINITIALLYANALYZE"
+ "XCLUSIVEXISTSTATEMENTANDEFERRABLEATTACHAVINGLOBEFOREIGNOREINDEX"
+ "AUTOINCREMENTBEGINNERENAMEBETWEENOTNULLIKEBYCASCADEFERREDELETE"
+ "CASECASTCOLLATECOLUMNCOMMITCONFLICTCONSTRAINTERSECTCREATECROSS"
+ "CURRENT_DATECURRENT_TIMESTAMPRAGMATCHDESCDETACHDISTINCTDROPRIMARY"
+ "FAILIMITFROMFULLGROUPDATEIMMEDIATEINSERTINSTEADINTOFFSETISNULL"
+ "JOINORDEREPLACEOUTERESTRICTRIGHTROLLBACKROWHENUNIONUNIQUEUSING"
+ "VACUUMVALUESVIEWHERE";
+ static const unsigned char aHash[127] = {
+ 91, 81, 104, 90, 0, 4, 0, 0, 111, 0, 77, 0, 0,
+ 94, 44, 0, 92, 0, 103, 106, 96, 0, 0, 10, 0, 0,
+ 110, 0, 107, 102, 0, 28, 48, 0, 41, 0, 0, 65, 71,
+ 0, 63, 19, 0, 0, 36, 83, 0, 105, 74, 0, 0, 33,
+ 0, 61, 37, 0, 8, 0, 112, 38, 12, 0, 78, 40, 25,
+ 66, 0, 0, 31, 82, 53, 30, 50, 20, 88, 0, 34, 0,
+ 75, 26, 0, 72, 0, 0, 0, 64, 47, 67, 22, 87, 29,
+ 69, 86, 0, 1, 0, 9, 100, 58, 18, 0, 109, 76, 98,
+ 54, 6, 85, 0, 0, 49, 93, 0, 101, 0, 70, 0, 0,
+ 15, 0, 113, 51, 56, 0, 2, 55, 0, 108,
+ };
+ static const unsigned char aNext[113] = {
+ 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0,
+ 0, 11, 0, 0, 0, 0, 5, 13, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
+ 0, 0, 16, 0, 23, 52, 0, 0, 0, 0, 45, 0, 59,
+ 0, 0, 0, 0, 0, 0, 0, 0, 73, 42, 0, 0, 24,
+ 60, 21, 0, 80, 32, 68, 0, 0, 84, 46, 0, 0, 0,
+ 0, 0, 0, 0, 39, 95, 97, 0, 0, 99, 0, 14, 27,
+ 79, 0, 57, 89, 0, 35, 0, 62, 0,
+ };
+ static const unsigned char aLen[113] = {
+ 5, 5, 4, 4, 9, 2, 3, 8, 2, 6, 4, 3, 7,
+ 11, 2, 7, 5, 5, 4, 5, 3, 5, 10, 6, 4, 6,
+ 7, 6, 7, 9, 3, 7, 9, 6, 9, 3, 10, 6, 6,
+ 4, 6, 3, 7, 6, 7, 5, 13, 2, 2, 5, 5, 6,
+ 7, 3, 7, 4, 4, 2, 7, 3, 8, 6, 4, 4, 7,
+ 6, 6, 8, 10, 9, 6, 5, 12, 12, 17, 6, 5, 4,
+ 6, 8, 2, 4, 7, 4, 5, 4, 4, 5, 6, 9, 6,
+ 7, 4, 2, 6, 3, 6, 4, 5, 7, 5, 8, 5, 8,
+ 3, 4, 5, 6, 5, 6, 6, 4, 5,
+ };
+ static const unsigned short int aOffset[113] = {
+ 0, 4, 7, 10, 10, 14, 19, 21, 26, 27, 32, 34, 36,
+ 42, 51, 52, 57, 61, 65, 67, 71, 74, 78, 86, 91, 94,
+ 99, 105, 108, 113, 118, 122, 128, 136, 141, 150, 152, 162, 167,
+ 172, 175, 177, 177, 181, 185, 187, 192, 194, 196, 205, 208, 212,
+ 218, 224, 224, 227, 230, 234, 236, 237, 241, 248, 254, 258, 262,
+ 269, 275, 281, 289, 296, 305, 311, 316, 328, 328, 344, 348, 353,
+ 357, 363, 364, 371, 374, 381, 384, 389, 393, 397, 400, 406, 415,
+ 421, 428, 431, 431, 434, 437, 443, 447, 451, 458, 462, 470, 475,
+ 483, 485, 489, 494, 500, 505, 511, 517, 520,
+ };
+ static const unsigned char aCode[113] = {
+ TK_ABORT, TK_TABLE, TK_JOIN_KW, TK_TEMP, TK_TEMP,
+ TK_OR, TK_ADD, TK_DATABASE, TK_AS, TK_SELECT,
+ TK_THEN, TK_END, TK_DEFAULT, TK_TRANSACTION,TK_ON,
+ TK_JOIN_KW, TK_ALTER, TK_RAISE, TK_EACH, TK_CHECK,
+ TK_KEY, TK_AFTER, TK_REFERENCES, TK_ESCAPE, TK_ELSE,
+ TK_EXCEPT, TK_TRIGGER, TK_LIKE_KW, TK_EXPLAIN, TK_INITIALLY,
+ TK_ALL, TK_ANALYZE, TK_EXCLUSIVE, TK_EXISTS, TK_STATEMENT,
+ TK_AND, TK_DEFERRABLE, TK_ATTACH, TK_HAVING, TK_LIKE_KW,
+ TK_BEFORE, TK_FOR, TK_FOREIGN, TK_IGNORE, TK_REINDEX,
+ TK_INDEX, TK_AUTOINCR, TK_TO, TK_IN, TK_BEGIN,
+ TK_JOIN_KW, TK_RENAME, TK_BETWEEN, TK_NOT, TK_NOTNULL,
+ TK_NULL, TK_LIKE_KW, TK_BY, TK_CASCADE, TK_ASC,
+ TK_DEFERRED, TK_DELETE, TK_CASE, TK_CAST, TK_COLLATE,
+ TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_CONSTRAINT, TK_INTERSECT,
+ TK_CREATE, TK_JOIN_KW, TK_CTIME_KW, TK_CTIME_KW, TK_CTIME_KW,
+ TK_PRAGMA, TK_MATCH, TK_DESC, TK_DETACH, TK_DISTINCT,
+ TK_IS, TK_DROP, TK_PRIMARY, TK_FAIL, TK_LIMIT,
+ TK_FROM, TK_JOIN_KW, TK_GROUP, TK_UPDATE, TK_IMMEDIATE,
+ TK_INSERT, TK_INSTEAD, TK_INTO, TK_OF, TK_OFFSET,
+ TK_SET, TK_ISNULL, TK_JOIN, TK_ORDER, TK_REPLACE,
+ TK_JOIN_KW, TK_RESTRICT, TK_JOIN_KW, TK_ROLLBACK, TK_ROW,
+ TK_WHEN, TK_UNION, TK_UNIQUE, TK_USING, TK_VACUUM,
+ TK_VALUES, TK_VIEW, TK_WHERE,
+ };
+ int h, i;
+ if( n<2 ) return TK_ID;
+ h = ((sqlite3UpperToLower[((unsigned char*)z)[0]]*4) ^
+ (sqlite3UpperToLower[((unsigned char*)z)[n-1]]*3) ^
+ n) % 127;
+ for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){
+ if( aLen[i]==n && sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){
+ return aCode[i];
+ }
+ }
+ return TK_ID;
+}
+int sqlite3KeywordCode(const char *z, int n){
+ return keywordCode(z, n);
+}
diff --git a/ext/pdo_sqlite/sqlite/src/legacy.c b/ext/pdo_sqlite/sqlite/src/legacy.c
new file mode 100644
index 000000000..f575f1f0c
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/legacy.c
@@ -0,0 +1,138 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Main file for the SQLite library. The routines in this file
+** implement the programmer interface to the library. Routines in
+** other files are for internal use by SQLite and should not be
+** accessed by users of the library.
+**
+** $Id$
+*/
+
+#include "sqliteInt.h"
+#include "os.h"
+#include <ctype.h>
+
+/*
+** Execute SQL code. Return one of the SQLITE_ success/failure
+** codes. Also write an error message into memory obtained from
+** malloc() and make *pzErrMsg point to that message.
+**
+** If the SQL is a query, then for each row in the query result
+** the xCallback() function is called. pArg becomes the first
+** argument to xCallback(). If xCallback=NULL then no callback
+** is invoked, even for queries.
+*/
+int sqlite3_exec(
+ sqlite3 *db, /* The database on which the SQL executes */
+ const char *zSql, /* The SQL to be executed */
+ sqlite3_callback xCallback, /* Invoke this callback routine */
+ void *pArg, /* First argument to xCallback() */
+ char **pzErrMsg /* Write error messages here */
+){
+ int rc = SQLITE_OK;
+ const char *zLeftover;
+ sqlite3_stmt *pStmt = 0;
+ char **azCols = 0;
+
+ int nRetry = 0;
+ int nChange = 0;
+ int nCallback;
+
+ if( zSql==0 ) return SQLITE_OK;
+ while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){
+ int nCol;
+ char **azVals = 0;
+
+ pStmt = 0;
+ rc = sqlite3_prepare(db, zSql, -1, &pStmt, &zLeftover);
+ if( rc!=SQLITE_OK ){
+ if( pStmt ) sqlite3_finalize(pStmt);
+ continue;
+ }
+ if( !pStmt ){
+ /* this happens for a comment or white-space */
+ zSql = zLeftover;
+ continue;
+ }
+
+ db->nChange += nChange;
+ nCallback = 0;
+
+ nCol = sqlite3_column_count(pStmt);
+ azCols = sqliteMalloc(2*nCol*sizeof(const char *));
+ if( nCol && !azCols ){
+ rc = SQLITE_NOMEM;
+ goto exec_out;
+ }
+
+ while( 1 ){
+ int i;
+ rc = sqlite3_step(pStmt);
+
+ /* Invoke the callback function if required */
+ if( xCallback && (SQLITE_ROW==rc ||
+ (SQLITE_DONE==rc && !nCallback && db->flags&SQLITE_NullCallback)) ){
+ if( 0==nCallback ){
+ for(i=0; i<nCol; i++){
+ azCols[i] = (char *)sqlite3_column_name(pStmt, i);
+ }
+ nCallback++;
+ }
+ if( rc==SQLITE_ROW ){
+ azVals = &azCols[nCol];
+ for(i=0; i<nCol; i++){
+ azVals[i] = (char *)sqlite3_column_text(pStmt, i);
+ }
+ }
+ if( xCallback(pArg, nCol, azVals, azCols) ){
+ rc = SQLITE_ABORT;
+ goto exec_out;
+ }
+ }
+
+ if( rc!=SQLITE_ROW ){
+ rc = sqlite3_finalize(pStmt);
+ pStmt = 0;
+ if( db->pVdbe==0 ){
+ nChange = db->nChange;
+ }
+ if( rc!=SQLITE_SCHEMA ){
+ nRetry = 0;
+ zSql = zLeftover;
+ while( isspace((unsigned char)zSql[0]) ) zSql++;
+ }
+ break;
+ }
+ }
+
+ sqliteFree(azCols);
+ azCols = 0;
+ }
+
+exec_out:
+ if( pStmt ) sqlite3_finalize(pStmt);
+ if( azCols ) sqliteFree(azCols);
+
+ if( sqlite3_malloc_failed ){
+ rc = SQLITE_NOMEM;
+ }
+ if( rc!=SQLITE_OK && rc==sqlite3_errcode(db) && pzErrMsg ){
+ *pzErrMsg = malloc(1+strlen(sqlite3_errmsg(db)));
+ if( *pzErrMsg ){
+ strcpy(*pzErrMsg, sqlite3_errmsg(db));
+ }
+ }else if( pzErrMsg ){
+ *pzErrMsg = 0;
+ }
+
+ return rc;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/main.c b/ext/pdo_sqlite/sqlite/src/main.c
new file mode 100644
index 000000000..c42df158e
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/main.c
@@ -0,0 +1,1060 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Main file for the SQLite library. The routines in this file
+** implement the programmer interface to the library. Routines in
+** other files are for internal use by SQLite and should not be
+** accessed by users of the library.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#include <ctype.h>
+
+/*
+** The following constant value is used by the SQLITE_BIGENDIAN and
+** SQLITE_LITTLEENDIAN macros.
+*/
+const int sqlite3one = 1;
+
+#ifndef SQLITE_OMIT_GLOBALRECOVER
+/*
+** Linked list of all open database handles. This is used by the
+** sqlite3_global_recover() function. Entries are added to the list
+** by openDatabase() and removed by sqlite3_close().
+*/
+static sqlite3 *pDbList = 0;
+#endif
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** Return the transient sqlite3_value object used for encoding conversions
+** during SQL compilation.
+*/
+sqlite3_value *sqlite3GetTransientValue(sqlite3 *db){
+ if( !db->pValue ){
+ db->pValue = sqlite3ValueNew();
+ }
+ return db->pValue;
+}
+#endif
+
+/*
+** The version of the library
+*/
+const char rcsid3[] = "@(#) \044Id: SQLite version " SQLITE_VERSION " $";
+const char sqlite3_version[] = SQLITE_VERSION;
+const char *sqlite3_libversion(void){ return sqlite3_version; }
+int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
+
+/*
+** This is the default collating function named "BINARY" which is always
+** available.
+*/
+static int binCollFunc(
+ void *NotUsed,
+ int nKey1, const void *pKey1,
+ int nKey2, const void *pKey2
+){
+ int rc, n;
+ n = nKey1<nKey2 ? nKey1 : nKey2;
+ rc = memcmp(pKey1, pKey2, n);
+ if( rc==0 ){
+ rc = nKey1 - nKey2;
+ }
+ return rc;
+}
+
+/*
+** Another built-in collating sequence: NOCASE.
+**
+** This collating sequence is intended to be used for "case independant
+** comparison". SQLite's knowledge of upper and lower case equivalents
+** extends only to the 26 characters used in the English language.
+**
+** At the moment there is only a UTF-8 implementation.
+*/
+static int nocaseCollatingFunc(
+ void *NotUsed,
+ int nKey1, const void *pKey1,
+ int nKey2, const void *pKey2
+){
+ int r = sqlite3StrNICmp(
+ (const char *)pKey1, (const char *)pKey2, (nKey1<nKey2)?nKey1:nKey2);
+ if( 0==r ){
+ r = nKey1-nKey2;
+ }
+ return r;
+}
+
+/*
+** Return the ROWID of the most recent insert
+*/
+sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){
+ return db->lastRowid;
+}
+
+/*
+** Return the number of changes in the most recent call to sqlite3_exec().
+*/
+int sqlite3_changes(sqlite3 *db){
+ return db->nChange;
+}
+
+/*
+** Return the number of changes since the database handle was opened.
+*/
+int sqlite3_total_changes(sqlite3 *db){
+ return db->nTotalChange;
+}
+
+/*
+** Close an existing SQLite database
+*/
+int sqlite3_close(sqlite3 *db){
+ HashElem *i;
+ int j;
+
+ if( !db ){
+ return SQLITE_OK;
+ }
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+
+#ifdef SQLITE_SSE
+ sqlite3_finalize(db->pFetch);
+#endif
+
+ /* If there are any outstanding VMs, return SQLITE_BUSY. */
+ if( db->pVdbe ){
+ sqlite3Error(db, SQLITE_BUSY,
+ "Unable to close due to unfinalised statements");
+ return SQLITE_BUSY;
+ }
+ assert( !sqlite3SafetyCheck(db) );
+
+ /* FIX ME: db->magic may be set to SQLITE_MAGIC_CLOSED if the database
+ ** cannot be opened for some reason. So this routine needs to run in
+ ** that case. But maybe there should be an extra magic value for the
+ ** "failed to open" state.
+ */
+ if( db->magic!=SQLITE_MAGIC_CLOSED && sqlite3SafetyOn(db) ){
+ /* printf("DID NOT CLOSE\n"); fflush(stdout); */
+ return SQLITE_ERROR;
+ }
+
+ for(j=0; j<db->nDb; j++){
+ struct Db *pDb = &db->aDb[j];
+ if( pDb->pBt ){
+ sqlite3BtreeClose(pDb->pBt);
+ pDb->pBt = 0;
+ }
+ }
+ sqlite3ResetInternalSchema(db, 0);
+ assert( db->nDb<=2 );
+ assert( db->aDb==db->aDbStatic );
+ for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){
+ FuncDef *pFunc, *pNext;
+ for(pFunc = (FuncDef*)sqliteHashData(i); pFunc; pFunc=pNext){
+ pNext = pFunc->pNext;
+ sqliteFree(pFunc);
+ }
+ }
+
+ for(i=sqliteHashFirst(&db->aCollSeq); i; i=sqliteHashNext(i)){
+ CollSeq *pColl = (CollSeq *)sqliteHashData(i);
+ sqliteFree(pColl);
+ }
+ sqlite3HashClear(&db->aCollSeq);
+
+ sqlite3HashClear(&db->aFunc);
+ sqlite3Error(db, SQLITE_OK, 0); /* Deallocates any cached error strings. */
+ if( db->pValue ){
+ sqlite3ValueFree(db->pValue);
+ }
+ if( db->pErr ){
+ sqlite3ValueFree(db->pErr);
+ }
+
+#ifndef SQLITE_OMIT_GLOBALRECOVER
+ {
+ sqlite3 *pPrev;
+ sqlite3OsEnterMutex();
+ pPrev = pDbList;
+ while( pPrev && pPrev->pNext!=db ){
+ pPrev = pPrev->pNext;
+ }
+ if( pPrev ){
+ pPrev->pNext = db->pNext;
+ }else{
+ assert( pDbList==db );
+ pDbList = db->pNext;
+ }
+ sqlite3OsLeaveMutex();
+ }
+#endif
+
+ db->magic = SQLITE_MAGIC_ERROR;
+ sqliteFree(db);
+ return SQLITE_OK;
+}
+
+/*
+** Rollback all database files.
+*/
+void sqlite3RollbackAll(sqlite3 *db){
+ int i;
+ for(i=0; i<db->nDb; i++){
+ if( db->aDb[i].pBt ){
+ sqlite3BtreeRollback(db->aDb[i].pBt);
+ db->aDb[i].inTrans = 0;
+ }
+ }
+ sqlite3ResetInternalSchema(db, 0);
+}
+
+/*
+** Return a static string that describes the kind of error specified in the
+** argument.
+*/
+const char *sqlite3ErrStr(int rc){
+ const char *z;
+ switch( rc ){
+ case SQLITE_ROW:
+ case SQLITE_DONE:
+ case SQLITE_OK: z = "not an error"; break;
+ case SQLITE_ERROR: z = "SQL logic error or missing database"; break;
+ case SQLITE_PERM: z = "access permission denied"; break;
+ case SQLITE_ABORT: z = "callback requested query abort"; break;
+ case SQLITE_BUSY: z = "database is locked"; break;
+ case SQLITE_LOCKED: z = "database table is locked"; break;
+ case SQLITE_NOMEM: z = "out of memory"; break;
+ case SQLITE_READONLY: z = "attempt to write a readonly database"; break;
+ case SQLITE_INTERRUPT: z = "interrupted"; break;
+ case SQLITE_IOERR: z = "disk I/O error"; break;
+ case SQLITE_CORRUPT: z = "database disk image is malformed"; break;
+ case SQLITE_FULL: z = "database or disk is full"; break;
+ case SQLITE_CANTOPEN: z = "unable to open database file"; break;
+ case SQLITE_PROTOCOL: z = "database locking protocol failure"; break;
+ case SQLITE_EMPTY: z = "table contains no data"; break;
+ case SQLITE_SCHEMA: z = "database schema has changed"; break;
+ case SQLITE_CONSTRAINT: z = "constraint failed"; break;
+ case SQLITE_MISMATCH: z = "datatype mismatch"; break;
+ case SQLITE_MISUSE: z = "library routine called out of sequence";break;
+ case SQLITE_NOLFS: z = "kernel lacks large file support"; break;
+ case SQLITE_AUTH: z = "authorization denied"; break;
+ case SQLITE_FORMAT: z = "auxiliary database format error"; break;
+ case SQLITE_RANGE: z = "bind or column index out of range"; break;
+ case SQLITE_NOTADB: z = "file is encrypted or is not a database";break;
+ default: z = "unknown error"; break;
+ }
+ return z;
+}
+
+/*
+** This routine implements a busy callback that sleeps and tries
+** again until a timeout value is reached. The timeout value is
+** an integer number of milliseconds passed in as the first
+** argument.
+*/
+static int sqliteDefaultBusyCallback(
+ void *ptr, /* Database connection */
+ int count /* Number of times table has been busy */
+){
+#if SQLITE_MIN_SLEEP_MS==1
+ static const u8 delays[] =
+ { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 };
+ static const u8 totals[] =
+ { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 };
+# define NDELAY (sizeof(delays)/sizeof(delays[0]))
+ int timeout = ((sqlite3 *)ptr)->busyTimeout;
+ int delay, prior;
+
+ assert( count>=0 );
+ if( count < NDELAY ){
+ delay = delays[count];
+ prior = totals[count];
+ }else{
+ delay = delays[NDELAY-1];
+ prior = totals[NDELAY-1] + delay*(count-(NDELAY-1));
+ }
+ if( prior + delay > timeout ){
+ delay = timeout - prior;
+ if( delay<=0 ) return 0;
+ }
+ sqlite3OsSleep(delay);
+ return 1;
+#else
+ int timeout = ((sqlite3 *)ptr)->busyTimeout;
+ if( (count+1)*1000 > timeout ){
+ return 0;
+ }
+ sqlite3OsSleep(1000);
+ return 1;
+#endif
+}
+
+/*
+** Invoke the given busy handler.
+**
+** This routine is called when an operation failed with a lock.
+** If this routine returns non-zero, the lock is retried. If it
+** returns 0, the operation aborts with an SQLITE_BUSY error.
+*/
+int sqlite3InvokeBusyHandler(BusyHandler *p){
+ int rc;
+ if( p==0 || p->xFunc==0 || p->nBusy<0 ) return 0;
+ rc = p->xFunc(p->pArg, p->nBusy);
+ if( rc==0 ){
+ p->nBusy = -1;
+ }else{
+ p->nBusy++;
+ }
+ return rc;
+}
+
+/*
+** This routine sets the busy callback for an Sqlite database to the
+** given callback function with the given argument.
+*/
+int sqlite3_busy_handler(
+ sqlite3 *db,
+ int (*xBusy)(void*,int),
+ void *pArg
+){
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+ db->busyHandler.xFunc = xBusy;
+ db->busyHandler.pArg = pArg;
+ db->busyHandler.nBusy = 0;
+ return SQLITE_OK;
+}
+
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
+/*
+** This routine sets the progress callback for an Sqlite database to the
+** given callback function with the given argument. The progress callback will
+** be invoked every nOps opcodes.
+*/
+void sqlite3_progress_handler(
+ sqlite3 *db,
+ int nOps,
+ int (*xProgress)(void*),
+ void *pArg
+){
+ if( !sqlite3SafetyCheck(db) ){
+ if( nOps>0 ){
+ db->xProgress = xProgress;
+ db->nProgressOps = nOps;
+ db->pProgressArg = pArg;
+ }else{
+ db->xProgress = 0;
+ db->nProgressOps = 0;
+ db->pProgressArg = 0;
+ }
+ }
+}
+#endif
+
+
+/*
+** This routine installs a default busy handler that waits for the
+** specified number of milliseconds before returning 0.
+*/
+int sqlite3_busy_timeout(sqlite3 *db, int ms){
+ if( ms>0 ){
+ db->busyTimeout = ms;
+ sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
+ }else{
+ sqlite3_busy_handler(db, 0, 0);
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Cause any pending operation to stop at its earliest opportunity.
+*/
+void sqlite3_interrupt(sqlite3 *db){
+ if( !sqlite3SafetyCheck(db) ){
+ db->flags |= SQLITE_Interrupt;
+ }
+}
+
+/*
+** Windows systems should call this routine to free memory that
+** is returned in the in the errmsg parameter of sqlite3_open() when
+** SQLite is a DLL. For some reason, it does not work to call free()
+** directly.
+**
+** Note that we need to call free() not sqliteFree() here.
+*/
+void sqlite3_free(char *p){ free(p); }
+
+/*
+** Create new user functions.
+*/
+int sqlite3_create_function(
+ sqlite3 *db,
+ const char *zFunctionName,
+ int nArg,
+ int enc,
+ void *pUserData,
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value **),
+ void (*xStep)(sqlite3_context*,int,sqlite3_value **),
+ void (*xFinal)(sqlite3_context*)
+){
+ FuncDef *p;
+ int nName;
+
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+ if( zFunctionName==0 ||
+ (xFunc && (xFinal || xStep)) ||
+ (!xFunc && (xFinal && !xStep)) ||
+ (!xFunc && (!xFinal && xStep)) ||
+ (nArg<-1 || nArg>127) ||
+ (255<(nName = strlen(zFunctionName))) ){
+ return SQLITE_ERROR;
+ }
+
+#ifndef SQLITE_OMIT_UTF16
+ /* If SQLITE_UTF16 is specified as the encoding type, transform this
+ ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the
+ ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally.
+ **
+ ** If SQLITE_ANY is specified, add three versions of the function
+ ** to the hash table.
+ */
+ if( enc==SQLITE_UTF16 ){
+ enc = SQLITE_UTF16NATIVE;
+ }else if( enc==SQLITE_ANY ){
+ int rc;
+ rc = sqlite3_create_function(db, zFunctionName, nArg, SQLITE_UTF8,
+ pUserData, xFunc, xStep, xFinal);
+ if( rc!=SQLITE_OK ) return rc;
+ rc = sqlite3_create_function(db, zFunctionName, nArg, SQLITE_UTF16LE,
+ pUserData, xFunc, xStep, xFinal);
+ if( rc!=SQLITE_OK ) return rc;
+ enc = SQLITE_UTF16BE;
+ }
+#else
+ enc = SQLITE_UTF8;
+#endif
+
+ /* Check if an existing function is being overridden or deleted. If so,
+ ** and there are active VMs, then return SQLITE_BUSY. If a function
+ ** is being overridden/deleted but there are no active VMs, allow the
+ ** operation to continue but invalidate all precompiled statements.
+ */
+ p = sqlite3FindFunction(db, zFunctionName, nName, nArg, enc, 0);
+ if( p && p->iPrefEnc==enc && p->nArg==nArg ){
+ if( db->activeVdbeCnt ){
+ sqlite3Error(db, SQLITE_BUSY,
+ "Unable to delete/modify user-function due to active statements");
+ return SQLITE_BUSY;
+ }else{
+ sqlite3ExpirePreparedStatements(db);
+ }
+ }
+
+ p = sqlite3FindFunction(db, zFunctionName, nName, nArg, enc, 1);
+ if( p==0 ) return SQLITE_NOMEM;
+ p->flags = 0;
+ p->xFunc = xFunc;
+ p->xStep = xStep;
+ p->xFinalize = xFinal;
+ p->pUserData = pUserData;
+ return SQLITE_OK;
+}
+#ifndef SQLITE_OMIT_UTF16
+int sqlite3_create_function16(
+ sqlite3 *db,
+ const void *zFunctionName,
+ int nArg,
+ int eTextRep,
+ void *pUserData,
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+ void (*xFinal)(sqlite3_context*)
+){
+ int rc;
+ char const *zFunc8;
+ sqlite3_value *pTmp;
+
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+ pTmp = sqlite3GetTransientValue(db);
+ sqlite3ValueSetStr(pTmp, -1, zFunctionName, SQLITE_UTF16NATIVE,SQLITE_STATIC);
+ zFunc8 = sqlite3ValueText(pTmp, SQLITE_UTF8);
+
+ if( !zFunc8 ){
+ return SQLITE_NOMEM;
+ }
+ rc = sqlite3_create_function(db, zFunc8, nArg, eTextRep,
+ pUserData, xFunc, xStep, xFinal);
+ return rc;
+}
+#endif
+
+#ifndef SQLITE_OMIT_TRACE
+/*
+** Register a trace function. The pArg from the previously registered trace
+** is returned.
+**
+** A NULL trace function means that no tracing is executes. A non-NULL
+** trace is a pointer to a function that is invoked at the start of each
+** SQL statement.
+*/
+void *sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){
+ void *pOld = db->pTraceArg;
+ db->xTrace = xTrace;
+ db->pTraceArg = pArg;
+ return pOld;
+}
+/*
+** Register a profile function. The pArg from the previously registered
+** profile function is returned.
+**
+** A NULL profile function means that no profiling is executes. A non-NULL
+** profile is a pointer to a function that is invoked at the conclusion of
+** each SQL statement that is run.
+*/
+void *sqlite3_profile(
+ sqlite3 *db,
+ void (*xProfile)(void*,const char*,sqlite_uint64),
+ void *pArg
+){
+ void *pOld = db->pProfileArg;
+ db->xProfile = xProfile;
+ db->pProfileArg = pArg;
+ return pOld;
+}
+#endif /* SQLITE_OMIT_TRACE */
+
+/*** EXPERIMENTAL ***
+**
+** Register a function to be invoked when a transaction comments.
+** If either function returns non-zero, then the commit becomes a
+** rollback.
+*/
+void *sqlite3_commit_hook(
+ sqlite3 *db, /* Attach the hook to this database */
+ int (*xCallback)(void*), /* Function to invoke on each commit */
+ void *pArg /* Argument to the function */
+){
+ void *pOld = db->pCommitArg;
+ db->xCommitCallback = xCallback;
+ db->pCommitArg = pArg;
+ return pOld;
+}
+
+
+/*
+** This routine is called to create a connection to a database BTree
+** driver. If zFilename is the name of a file, then that file is
+** opened and used. If zFilename is the magic name ":memory:" then
+** the database is stored in memory (and is thus forgotten as soon as
+** the connection is closed.) If zFilename is NULL then the database
+** is a "virtual" database for transient use only and is deleted as
+** soon as the connection is closed.
+**
+** A virtual database can be either a disk file (that is automatically
+** deleted when the file is closed) or it an be held entirely in memory,
+** depending on the values of the TEMP_STORE compile-time macro and the
+** db->temp_store variable, according to the following chart:
+**
+** TEMP_STORE db->temp_store Location of temporary database
+** ---------- -------------- ------------------------------
+** 0 any file
+** 1 1 file
+** 1 2 memory
+** 1 0 file
+** 2 1 file
+** 2 2 memory
+** 2 0 memory
+** 3 any memory
+*/
+int sqlite3BtreeFactory(
+ const sqlite3 *db, /* Main database when opening aux otherwise 0 */
+ const char *zFilename, /* Name of the file containing the BTree database */
+ int omitJournal, /* if TRUE then do not journal this file */
+ int nCache, /* How many pages in the page cache */
+ Btree **ppBtree /* Pointer to new Btree object written here */
+){
+ int btree_flags = 0;
+ int rc;
+
+ assert( ppBtree != 0);
+ if( omitJournal ){
+ btree_flags |= BTREE_OMIT_JOURNAL;
+ }
+ if( db->flags & SQLITE_NoReadlock ){
+ btree_flags |= BTREE_NO_READLOCK;
+ }
+ if( zFilename==0 ){
+#if TEMP_STORE==0
+ /* Do nothing */
+#endif
+#ifndef SQLITE_OMIT_MEMORYDB
+#if TEMP_STORE==1
+ if( db->temp_store==2 ) zFilename = ":memory:";
+#endif
+#if TEMP_STORE==2
+ if( db->temp_store!=1 ) zFilename = ":memory:";
+#endif
+#if TEMP_STORE==3
+ zFilename = ":memory:";
+#endif
+#endif /* SQLITE_OMIT_MEMORYDB */
+ }
+
+ rc = sqlite3BtreeOpen(zFilename, ppBtree, btree_flags);
+ if( rc==SQLITE_OK ){
+ sqlite3BtreeSetBusyHandler(*ppBtree, (void*)&db->busyHandler);
+ sqlite3BtreeSetCacheSize(*ppBtree, nCache);
+ }
+ return rc;
+}
+
+/*
+** Return UTF-8 encoded English language explanation of the most recent
+** error.
+*/
+const char *sqlite3_errmsg(sqlite3 *db){
+ const char *z;
+ if( sqlite3_malloc_failed ){
+ return sqlite3ErrStr(SQLITE_NOMEM);
+ }
+ if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){
+ return sqlite3ErrStr(SQLITE_MISUSE);
+ }
+ z = sqlite3_value_text(db->pErr);
+ if( z==0 ){
+ z = sqlite3ErrStr(db->errCode);
+ }
+ return z;
+}
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** Return UTF-16 encoded English language explanation of the most recent
+** error.
+*/
+const void *sqlite3_errmsg16(sqlite3 *db){
+ /* Because all the characters in the string are in the unicode
+ ** range 0x00-0xFF, if we pad the big-endian string with a
+ ** zero byte, we can obtain the little-endian string with
+ ** &big_endian[1].
+ */
+ static const char outOfMemBe[] = {
+ 0, 'o', 0, 'u', 0, 't', 0, ' ',
+ 0, 'o', 0, 'f', 0, ' ',
+ 0, 'm', 0, 'e', 0, 'm', 0, 'o', 0, 'r', 0, 'y', 0, 0, 0
+ };
+ static const char misuseBe [] = {
+ 0, 'l', 0, 'i', 0, 'b', 0, 'r', 0, 'a', 0, 'r', 0, 'y', 0, ' ',
+ 0, 'r', 0, 'o', 0, 'u', 0, 't', 0, 'i', 0, 'n', 0, 'e', 0, ' ',
+ 0, 'c', 0, 'a', 0, 'l', 0, 'l', 0, 'e', 0, 'd', 0, ' ',
+ 0, 'o', 0, 'u', 0, 't', 0, ' ',
+ 0, 'o', 0, 'f', 0, ' ',
+ 0, 's', 0, 'e', 0, 'q', 0, 'u', 0, 'e', 0, 'n', 0, 'c', 0, 'e', 0, 0, 0
+ };
+
+ const void *z;
+ if( sqlite3_malloc_failed ){
+ return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
+ }
+ if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){
+ return (void *)(&misuseBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
+ }
+ z = sqlite3_value_text16(db->pErr);
+ if( z==0 ){
+ sqlite3ValueSetStr(db->pErr, -1, sqlite3ErrStr(db->errCode),
+ SQLITE_UTF8, SQLITE_STATIC);
+ z = sqlite3_value_text16(db->pErr);
+ }
+ return z;
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+/*
+** Return the most recent error code generated by an SQLite routine.
+*/
+int sqlite3_errcode(sqlite3 *db){
+ if( sqlite3_malloc_failed ){
+ return SQLITE_NOMEM;
+ }
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+ return db->errCode;
+}
+
+/*
+** This routine does the work of opening a database on behalf of
+** sqlite3_open() and sqlite3_open16(). The database filename "zFilename"
+** is UTF-8 encoded.
+*/
+static int openDatabase(
+ const char *zFilename, /* Database filename UTF-8 encoded */
+ sqlite3 **ppDb /* OUT: Returned database handle */
+){
+ sqlite3 *db;
+ int rc, i;
+ CollSeq *pColl;
+
+ /* Allocate the sqlite data structure */
+ db = sqliteMalloc( sizeof(sqlite3) );
+ if( db==0 ) goto opendb_out;
+ db->priorNewRowid = 0;
+ db->magic = SQLITE_MAGIC_BUSY;
+ db->nDb = 2;
+ db->aDb = db->aDbStatic;
+ db->enc = SQLITE_UTF8;
+ db->autoCommit = 1;
+ db->flags |= SQLITE_ShortColNames;
+ sqlite3HashInit(&db->aFunc, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&db->aCollSeq, SQLITE_HASH_STRING, 0);
+ for(i=0; i<db->nDb; i++){
+ sqlite3HashInit(&db->aDb[i].tblHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&db->aDb[i].idxHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&db->aDb[i].trigHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&db->aDb[i].aFKey, SQLITE_HASH_STRING, 1);
+ }
+
+ /* Add the default collation sequence BINARY. BINARY works for both UTF-8
+ ** and UTF-16, so add a version for each to avoid any unnecessary
+ ** conversions. The only error that can occur here is a malloc() failure.
+ */
+ if( sqlite3_create_collation(db, "BINARY", SQLITE_UTF8, 0,binCollFunc) ||
+ sqlite3_create_collation(db, "BINARY", SQLITE_UTF16, 0,binCollFunc) ||
+ !(db->pDfltColl = sqlite3FindCollSeq(db, db->enc, "BINARY", 6, 0)) ){
+ rc = db->errCode;
+ assert( rc!=SQLITE_OK );
+ db->magic = SQLITE_MAGIC_CLOSED;
+ goto opendb_out;
+ }
+
+ /* Also add a UTF-8 case-insensitive collation sequence. */
+ sqlite3_create_collation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc);
+
+ /* Set flags on the built-in collating sequences */
+ db->pDfltColl->type = SQLITE_COLL_BINARY;
+ pColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "NOCASE", 6, 0);
+ if( pColl ){
+ pColl->type = SQLITE_COLL_NOCASE;
+ }
+
+ /* Open the backend database driver */
+ rc = sqlite3BtreeFactory(db, zFilename, 0, MAX_PAGES, &db->aDb[0].pBt);
+ if( rc!=SQLITE_OK ){
+ sqlite3Error(db, rc, 0);
+ db->magic = SQLITE_MAGIC_CLOSED;
+ goto opendb_out;
+ }
+
+ /* The default safety_level for the main database is 'full'; for the temp
+ ** database it is 'NONE'. This matches the pager layer defaults.
+ */
+ db->aDb[0].zName = "main";
+ db->aDb[0].safety_level = 3;
+#ifndef SQLITE_OMIT_TEMPDB
+ db->aDb[1].zName = "temp";
+ db->aDb[1].safety_level = 1;
+#endif
+
+
+ /* Register all built-in functions, but do not attempt to read the
+ ** database schema yet. This is delayed until the first time the database
+ ** is accessed.
+ */
+ sqlite3RegisterBuiltinFunctions(db);
+ sqlite3Error(db, SQLITE_OK, 0);
+ db->magic = SQLITE_MAGIC_OPEN;
+
+opendb_out:
+ if( sqlite3_errcode(db)==SQLITE_OK && sqlite3_malloc_failed ){
+ sqlite3Error(db, SQLITE_NOMEM, 0);
+ }
+ *ppDb = db;
+#ifndef SQLITE_OMIT_GLOBALRECOVER
+ if( db ){
+ sqlite3OsEnterMutex();
+ db->pNext = pDbList;
+ pDbList = db;
+ sqlite3OsLeaveMutex();
+ }
+#endif
+ return sqlite3_errcode(db);
+}
+
+/*
+** Open a new database handle.
+*/
+int sqlite3_open(
+ const char *zFilename,
+ sqlite3 **ppDb
+){
+ return openDatabase(zFilename, ppDb);
+}
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** Open a new database handle.
+*/
+int sqlite3_open16(
+ const void *zFilename,
+ sqlite3 **ppDb
+){
+ char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
+ int rc = SQLITE_NOMEM;
+ sqlite3_value *pVal;
+
+ assert( ppDb );
+ *ppDb = 0;
+ pVal = sqlite3ValueNew();
+ sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);
+ zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8);
+ if( zFilename8 ){
+ rc = openDatabase(zFilename8, ppDb);
+ if( rc==SQLITE_OK && *ppDb ){
+ sqlite3_exec(*ppDb, "PRAGMA encoding = 'UTF-16'", 0, 0, 0);
+ }
+ }
+ if( pVal ){
+ sqlite3ValueFree(pVal);
+ }
+
+ return rc;
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+/*
+** The following routine destroys a virtual machine that is created by
+** the sqlite3_compile() routine. The integer returned is an SQLITE_
+** success/failure code that describes the result of executing the virtual
+** machine.
+**
+** This routine sets the error code and string returned by
+** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
+*/
+int sqlite3_finalize(sqlite3_stmt *pStmt){
+ int rc;
+ if( pStmt==0 ){
+ rc = SQLITE_OK;
+ }else{
+ rc = sqlite3VdbeFinalize((Vdbe*)pStmt);
+ }
+ return rc;
+}
+
+/*
+** Terminate the current execution of an SQL statement and reset it
+** back to its starting state so that it can be reused. A success code from
+** the prior execution is returned.
+**
+** This routine sets the error code and string returned by
+** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
+*/
+int sqlite3_reset(sqlite3_stmt *pStmt){
+ int rc;
+ if( pStmt==0 ){
+ rc = SQLITE_OK;
+ }else{
+ rc = sqlite3VdbeReset((Vdbe*)pStmt);
+ sqlite3VdbeMakeReady((Vdbe*)pStmt, -1, 0, 0, 0);
+ }
+ return rc;
+}
+
+/*
+** Register a new collation sequence with the database handle db.
+*/
+int sqlite3_create_collation(
+ sqlite3* db,
+ const char *zName,
+ int enc,
+ void* pCtx,
+ int(*xCompare)(void*,int,const void*,int,const void*)
+){
+ CollSeq *pColl;
+ int rc = SQLITE_OK;
+
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+
+ /* If SQLITE_UTF16 is specified as the encoding type, transform this
+ ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the
+ ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally.
+ */
+ if( enc==SQLITE_UTF16 ){
+ enc = SQLITE_UTF16NATIVE;
+ }
+
+ if( enc!=SQLITE_UTF8 && enc!=SQLITE_UTF16LE && enc!=SQLITE_UTF16BE ){
+ sqlite3Error(db, SQLITE_ERROR,
+ "Param 3 to sqlite3_create_collation() must be one of "
+ "SQLITE_UTF8, SQLITE_UTF16, SQLITE_UTF16LE or SQLITE_UTF16BE"
+ );
+ return SQLITE_ERROR;
+ }
+
+ /* Check if this call is removing or replacing an existing collation
+ ** sequence. If so, and there are active VMs, return busy. If there
+ ** are no active VMs, invalidate any pre-compiled statements.
+ */
+ pColl = sqlite3FindCollSeq(db, (u8)enc, zName, strlen(zName), 0);
+ if( pColl && pColl->xCmp ){
+ if( db->activeVdbeCnt ){
+ sqlite3Error(db, SQLITE_BUSY,
+ "Unable to delete/modify collation sequence due to active statements");
+ return SQLITE_BUSY;
+ }
+ sqlite3ExpirePreparedStatements(db);
+ }
+
+ pColl = sqlite3FindCollSeq(db, (u8)enc, zName, strlen(zName), 1);
+ if( 0==pColl ){
+ rc = SQLITE_NOMEM;
+ }else{
+ pColl->xCmp = xCompare;
+ pColl->pUser = pCtx;
+ pColl->enc = enc;
+ }
+ sqlite3Error(db, rc, 0);
+ return rc;
+}
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** Register a new collation sequence with the database handle db.
+*/
+int sqlite3_create_collation16(
+ sqlite3* db,
+ const char *zName,
+ int enc,
+ void* pCtx,
+ int(*xCompare)(void*,int,const void*,int,const void*)
+){
+ char const *zName8;
+ sqlite3_value *pTmp;
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+ pTmp = sqlite3GetTransientValue(db);
+ sqlite3ValueSetStr(pTmp, -1, zName, SQLITE_UTF16NATIVE, SQLITE_STATIC);
+ zName8 = sqlite3ValueText(pTmp, SQLITE_UTF8);
+ return sqlite3_create_collation(db, zName8, enc, pCtx, xCompare);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+/*
+** Register a collation sequence factory callback with the database handle
+** db. Replace any previously installed collation sequence factory.
+*/
+int sqlite3_collation_needed(
+ sqlite3 *db,
+ void *pCollNeededArg,
+ void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
+){
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+ db->xCollNeeded = xCollNeeded;
+ db->xCollNeeded16 = 0;
+ db->pCollNeededArg = pCollNeededArg;
+ return SQLITE_OK;
+}
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** Register a collation sequence factory callback with the database handle
+** db. Replace any previously installed collation sequence factory.
+*/
+int sqlite3_collation_needed16(
+ sqlite3 *db,
+ void *pCollNeededArg,
+ void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
+){
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+ db->xCollNeeded = 0;
+ db->xCollNeeded16 = xCollNeeded16;
+ db->pCollNeededArg = pCollNeededArg;
+ return SQLITE_OK;
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+#ifndef SQLITE_OMIT_GLOBALRECOVER
+/*
+** This function is called to recover from a malloc failure that occured
+** within SQLite.
+**
+** This function is *not* threadsafe. Calling this from within a threaded
+** application when threads other than the caller have used SQLite is
+** dangerous and will almost certainly result in malfunctions.
+*/
+int sqlite3_global_recover(){
+ int rc = SQLITE_OK;
+
+ if( sqlite3_malloc_failed ){
+ sqlite3 *db;
+ int i;
+ sqlite3_malloc_failed = 0;
+ for(db=pDbList; db; db=db->pNext ){
+ sqlite3ExpirePreparedStatements(db);
+ for(i=0; i<db->nDb; i++){
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt && (rc=sqlite3BtreeReset(pBt)) ){
+ goto recover_out;
+ }
+ }
+ db->autoCommit = 1;
+ }
+ }
+
+recover_out:
+ if( rc!=SQLITE_OK ){
+ sqlite3_malloc_failed = 1;
+ }
+ return rc;
+}
+#endif
+
+/*
+** Test to see whether or not the database connection is in autocommit
+** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
+** by default. Autocommit is disabled by a BEGIN statement and reenabled
+** by the next COMMIT or ROLLBACK.
+**
+******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ******
+*/
+int sqlite3_get_autocommit(sqlite3 *db){
+ return db->autoCommit;
+}
+
+#ifdef SQLITE_DEBUG
+/*
+** The following routine is subtituted for constant SQLITE_CORRUPT in
+** debugging builds. This provides a way to set a breakpoint for when
+** corruption is first detected.
+*/
+int sqlite3Corrupt(void){
+ return SQLITE_CORRUPT;
+}
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/md5.c b/ext/pdo_sqlite/sqlite/src/md5.c
new file mode 100644
index 000000000..32fcb6b68
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/md5.c
@@ -0,0 +1,387 @@
+/*
+** SQLite uses this code for testing only. It is not a part of
+** the SQLite library. This file implements two new TCL commands
+** "md5" and "md5file" that compute md5 checksums on arbitrary text
+** and on complete files. These commands are used by the "testfixture"
+** program to help verify the correct operation of the SQLite library.
+**
+** The original use of these TCL commands was to test the ROLLBACK
+** feature of SQLite. First compute the MD5-checksum of the database.
+** Then make some changes but rollback the changes rather than commit
+** them. Compute a second MD5-checksum of the file and verify that the
+** two checksums are the same. Such is the original use of this code.
+** New uses may have been added since this comment was written.
+*/
+/*
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest. This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MD5Context structure, pass it to MD5Init, call MD5Update as
+ * needed on buffers full of bytes, and then call MD5Final, which
+ * will fill a supplied 16-byte array with the digest.
+ */
+#include <tcl.h>
+#include <string.h>
+#include "sqlite3.h"
+
+/*
+ * If compiled on a machine that doesn't have a 32-bit integer,
+ * you just set "uint32" to the appropriate datatype for an
+ * unsigned 32-bit integer. For example:
+ *
+ * cc -Duint32='unsigned long' md5.c
+ *
+ */
+#ifndef uint32
+# define uint32 unsigned int
+#endif
+
+struct Context {
+ uint32 buf[4];
+ uint32 bits[2];
+ unsigned char in[64];
+};
+typedef char MD5Context[88];
+
+/*
+ * Note: this code is harmless on little-endian machines.
+ */
+static void byteReverse (unsigned char *buf, unsigned longs){
+ uint32 t;
+ do {
+ t = (uint32)((unsigned)buf[3]<<8 | buf[2]) << 16 |
+ ((unsigned)buf[1]<<8 | buf[0]);
+ *(uint32 *)buf = t;
+ buf += 4;
+ } while (--longs);
+}
+/* The four core functions - F1 is optimized somewhat */
+
+/* #define F1(x, y, z) (x & y | ~x & z) */
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+
+/* This is the central step in the MD5 algorithm. */
+#define MD5STEP(f, w, x, y, z, data, s) \
+ ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
+
+/*
+ * The core of the MD5 algorithm, this alters an existing MD5 hash to
+ * reflect the addition of 16 longwords of new data. MD5Update blocks
+ * the data and converts bytes into longwords for this routine.
+ */
+static void MD5Transform(uint32 buf[4], const uint32 in[16]){
+ register uint32 a, b, c, d;
+
+ a = buf[0];
+ b = buf[1];
+ c = buf[2];
+ d = buf[3];
+
+ MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478, 7);
+ MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12);
+ MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17);
+ MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22);
+ MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf, 7);
+ MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12);
+ MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17);
+ MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22);
+ MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8, 7);
+ MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12);
+ MD5STEP(F1, c, d, a, b, in[10]+0xffff5bb1, 17);
+ MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22);
+ MD5STEP(F1, a, b, c, d, in[12]+0x6b901122, 7);
+ MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12);
+ MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17);
+ MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22);
+
+ MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562, 5);
+ MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340, 9);
+ MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14);
+ MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20);
+ MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d, 5);
+ MD5STEP(F2, d, a, b, c, in[10]+0x02441453, 9);
+ MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14);
+ MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20);
+ MD5STEP(F2, a, b, c, d, in[ 9]+0x21e1cde6, 5);
+ MD5STEP(F2, d, a, b, c, in[14]+0xc33707d6, 9);
+ MD5STEP(F2, c, d, a, b, in[ 3]+0xf4d50d87, 14);
+ MD5STEP(F2, b, c, d, a, in[ 8]+0x455a14ed, 20);
+ MD5STEP(F2, a, b, c, d, in[13]+0xa9e3e905, 5);
+ MD5STEP(F2, d, a, b, c, in[ 2]+0xfcefa3f8, 9);
+ MD5STEP(F2, c, d, a, b, in[ 7]+0x676f02d9, 14);
+ MD5STEP(F2, b, c, d, a, in[12]+0x8d2a4c8a, 20);
+
+ MD5STEP(F3, a, b, c, d, in[ 5]+0xfffa3942, 4);
+ MD5STEP(F3, d, a, b, c, in[ 8]+0x8771f681, 11);
+ MD5STEP(F3, c, d, a, b, in[11]+0x6d9d6122, 16);
+ MD5STEP(F3, b, c, d, a, in[14]+0xfde5380c, 23);
+ MD5STEP(F3, a, b, c, d, in[ 1]+0xa4beea44, 4);
+ MD5STEP(F3, d, a, b, c, in[ 4]+0x4bdecfa9, 11);
+ MD5STEP(F3, c, d, a, b, in[ 7]+0xf6bb4b60, 16);
+ MD5STEP(F3, b, c, d, a, in[10]+0xbebfbc70, 23);
+ MD5STEP(F3, a, b, c, d, in[13]+0x289b7ec6, 4);
+ MD5STEP(F3, d, a, b, c, in[ 0]+0xeaa127fa, 11);
+ MD5STEP(F3, c, d, a, b, in[ 3]+0xd4ef3085, 16);
+ MD5STEP(F3, b, c, d, a, in[ 6]+0x04881d05, 23);
+ MD5STEP(F3, a, b, c, d, in[ 9]+0xd9d4d039, 4);
+ MD5STEP(F3, d, a, b, c, in[12]+0xe6db99e5, 11);
+ MD5STEP(F3, c, d, a, b, in[15]+0x1fa27cf8, 16);
+ MD5STEP(F3, b, c, d, a, in[ 2]+0xc4ac5665, 23);
+
+ MD5STEP(F4, a, b, c, d, in[ 0]+0xf4292244, 6);
+ MD5STEP(F4, d, a, b, c, in[ 7]+0x432aff97, 10);
+ MD5STEP(F4, c, d, a, b, in[14]+0xab9423a7, 15);
+ MD5STEP(F4, b, c, d, a, in[ 5]+0xfc93a039, 21);
+ MD5STEP(F4, a, b, c, d, in[12]+0x655b59c3, 6);
+ MD5STEP(F4, d, a, b, c, in[ 3]+0x8f0ccc92, 10);
+ MD5STEP(F4, c, d, a, b, in[10]+0xffeff47d, 15);
+ MD5STEP(F4, b, c, d, a, in[ 1]+0x85845dd1, 21);
+ MD5STEP(F4, a, b, c, d, in[ 8]+0x6fa87e4f, 6);
+ MD5STEP(F4, d, a, b, c, in[15]+0xfe2ce6e0, 10);
+ MD5STEP(F4, c, d, a, b, in[ 6]+0xa3014314, 15);
+ MD5STEP(F4, b, c, d, a, in[13]+0x4e0811a1, 21);
+ MD5STEP(F4, a, b, c, d, in[ 4]+0xf7537e82, 6);
+ MD5STEP(F4, d, a, b, c, in[11]+0xbd3af235, 10);
+ MD5STEP(F4, c, d, a, b, in[ 2]+0x2ad7d2bb, 15);
+ MD5STEP(F4, b, c, d, a, in[ 9]+0xeb86d391, 21);
+
+ buf[0] += a;
+ buf[1] += b;
+ buf[2] += c;
+ buf[3] += d;
+}
+
+/*
+ * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
+ * initialization constants.
+ */
+static void MD5Init(MD5Context *pCtx){
+ struct Context *ctx = (struct Context *)pCtx;
+ ctx->buf[0] = 0x67452301;
+ ctx->buf[1] = 0xefcdab89;
+ ctx->buf[2] = 0x98badcfe;
+ ctx->buf[3] = 0x10325476;
+ ctx->bits[0] = 0;
+ ctx->bits[1] = 0;
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+static
+void MD5Update(MD5Context *pCtx, const unsigned char *buf, unsigned int len){
+ struct Context *ctx = (struct Context *)pCtx;
+ uint32 t;
+
+ /* Update bitcount */
+
+ t = ctx->bits[0];
+ if ((ctx->bits[0] = t + ((uint32)len << 3)) < t)
+ ctx->bits[1]++; /* Carry from low to high */
+ ctx->bits[1] += len >> 29;
+
+ t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
+
+ /* Handle any leading odd-sized chunks */
+
+ if ( t ) {
+ unsigned char *p = (unsigned char *)ctx->in + t;
+
+ t = 64-t;
+ if (len < t) {
+ memcpy(p, buf, len);
+ return;
+ }
+ memcpy(p, buf, t);
+ byteReverse(ctx->in, 16);
+ MD5Transform(ctx->buf, (uint32 *)ctx->in);
+ buf += t;
+ len -= t;
+ }
+
+ /* Process data in 64-byte chunks */
+
+ while (len >= 64) {
+ memcpy(ctx->in, buf, 64);
+ byteReverse(ctx->in, 16);
+ MD5Transform(ctx->buf, (uint32 *)ctx->in);
+ buf += 64;
+ len -= 64;
+ }
+
+ /* Handle any remaining bytes of data. */
+
+ memcpy(ctx->in, buf, len);
+}
+
+/*
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * 1 0* (64-bit count of bits processed, MSB-first)
+ */
+static void MD5Final(unsigned char digest[16], MD5Context *pCtx){
+ struct Context *ctx = (struct Context *)pCtx;
+ unsigned count;
+ unsigned char *p;
+
+ /* Compute number of bytes mod 64 */
+ count = (ctx->bits[0] >> 3) & 0x3F;
+
+ /* Set the first char of padding to 0x80. This is safe since there is
+ always at least one byte free */
+ p = ctx->in + count;
+ *p++ = 0x80;
+
+ /* Bytes of padding needed to make 64 bytes */
+ count = 64 - 1 - count;
+
+ /* Pad out to 56 mod 64 */
+ if (count < 8) {
+ /* Two lots of padding: Pad the first block to 64 bytes */
+ memset(p, 0, count);
+ byteReverse(ctx->in, 16);
+ MD5Transform(ctx->buf, (uint32 *)ctx->in);
+
+ /* Now fill the next block with 56 bytes */
+ memset(ctx->in, 0, 56);
+ } else {
+ /* Pad block to 56 bytes */
+ memset(p, 0, count-8);
+ }
+ byteReverse(ctx->in, 14);
+
+ /* Append length in bits and transform */
+ ((uint32 *)ctx->in)[ 14 ] = ctx->bits[0];
+ ((uint32 *)ctx->in)[ 15 ] = ctx->bits[1];
+
+ MD5Transform(ctx->buf, (uint32 *)ctx->in);
+ byteReverse((unsigned char *)ctx->buf, 4);
+ memcpy(digest, ctx->buf, 16);
+ memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
+}
+
+/*
+** Convert a digest into base-16. digest should be declared as
+** "unsigned char digest[16]" in the calling function. The MD5
+** digest is stored in the first 16 bytes. zBuf should
+** be "char zBuf[33]".
+*/
+static void DigestToBase16(unsigned char *digest, char *zBuf){
+ static char const zEncode[] = "0123456789abcdef";
+ int i, j;
+
+ for(j=i=0; i<16; i++){
+ int a = digest[i];
+ zBuf[j++] = zEncode[(a>>4)&0xf];
+ zBuf[j++] = zEncode[a & 0xf];
+ }
+ zBuf[j] = 0;
+}
+
+/*
+** A TCL command for md5. The argument is the text to be hashed. The
+** Result is the hash in base64.
+*/
+static int md5_cmd(void*cd, Tcl_Interp *interp, int argc, const char **argv){
+ MD5Context ctx;
+ unsigned char digest[16];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp,"wrong # args: should be \"", argv[0],
+ " TEXT\"", 0);
+ return TCL_ERROR;
+ }
+ MD5Init(&ctx);
+ MD5Update(&ctx, (unsigned char*)argv[1], (unsigned)strlen(argv[1]));
+ MD5Final(digest, &ctx);
+ DigestToBase16(digest, interp->result);
+ return TCL_OK;
+}
+
+/*
+** A TCL command to take the md5 hash of a file. The argument is the
+** name of the file.
+*/
+static int md5file_cmd(void*cd, Tcl_Interp*interp, int argc, const char **argv){
+ FILE *in;
+ MD5Context ctx;
+ unsigned char digest[16];
+ char zBuf[10240];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp,"wrong # args: should be \"", argv[0],
+ " FILENAME\"", 0);
+ return TCL_ERROR;
+ }
+ in = fopen(argv[1],"rb");
+ if( in==0 ){
+ Tcl_AppendResult(interp,"unable to open file \"", argv[1],
+ "\" for reading", 0);
+ return TCL_ERROR;
+ }
+ MD5Init(&ctx);
+ for(;;){
+ int n;
+ n = fread(zBuf, 1, sizeof(zBuf), in);
+ if( n<=0 ) break;
+ MD5Update(&ctx, (unsigned char*)zBuf, (unsigned)n);
+ }
+ fclose(in);
+ MD5Final(digest, &ctx);
+ DigestToBase16(digest, interp->result);
+ return TCL_OK;
+}
+
+/*
+** Register the two TCL commands above with the TCL interpreter.
+*/
+int Md5_Init(Tcl_Interp *interp){
+ Tcl_CreateCommand(interp, "md5", (Tcl_CmdProc*)md5_cmd, 0, 0);
+ Tcl_CreateCommand(interp, "md5file", (Tcl_CmdProc*)md5file_cmd, 0, 0);
+ return TCL_OK;
+}
+
+/*
+** During testing, the special md5sum() aggregate function is available.
+** inside SQLite. The following routines implement that function.
+*/
+static void md5step(sqlite3_context *context, int argc, sqlite3_value **argv){
+ MD5Context *p;
+ int i;
+ if( argc<1 ) return;
+ p = sqlite3_aggregate_context(context, sizeof(*p));
+ if( p==0 ) return;
+ if( sqlite3_aggregate_count(context)==1 ){
+ MD5Init(p);
+ }
+ for(i=0; i<argc; i++){
+ const char *zData = sqlite3_value_text(argv[i]);
+ if( zData ){
+ MD5Update(p, zData, strlen(zData));
+ }
+ }
+}
+static void md5finalize(sqlite3_context *context){
+ MD5Context *p;
+ unsigned char digest[16];
+ char zBuf[33];
+ p = sqlite3_aggregate_context(context, sizeof(*p));
+ MD5Final(digest,p);
+ DigestToBase16(digest, zBuf);
+ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
+}
+void Md5_Register(sqlite3 *db){
+ sqlite3_create_function(db, "md5sum", -1, SQLITE_UTF8, 0, 0,
+ md5step, md5finalize);
+}
diff --git a/ext/pdo_sqlite/sqlite/src/opcodes.c b/ext/pdo_sqlite/sqlite/src/opcodes.c
new file mode 100644
index 000000000..734d1a540
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/opcodes.c
@@ -0,0 +1,137 @@
+/* Automatically generated. Do not edit */
+/* See the mkopcodec.awk script for details. */
+#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
+const char *const sqlite3OpcodeNames[] = { "?",
+ /* 1 */ "MemLoad",
+ /* 2 */ "Column",
+ /* 3 */ "SetCookie",
+ /* 4 */ "IfMemPos",
+ /* 5 */ "MoveGt",
+ /* 6 */ "AggFocus",
+ /* 7 */ "RowKey",
+ /* 8 */ "IdxRecno",
+ /* 9 */ "AggNext",
+ /* 10 */ "OpenWrite",
+ /* 11 */ "If",
+ /* 12 */ "PutStrKey",
+ /* 13 */ "Pop",
+ /* 14 */ "SortPut",
+ /* 15 */ "AggContextPush",
+ /* 16 */ "CollSeq",
+ /* 17 */ "OpenRead",
+ /* 18 */ "Expire",
+ /* 19 */ "SortReset",
+ /* 20 */ "AutoCommit",
+ /* 21 */ "Sort",
+ /* 22 */ "ListRewind",
+ /* 23 */ "IntegrityCk",
+ /* 24 */ "Function",
+ /* 25 */ "Noop",
+ /* 26 */ "Return",
+ /* 27 */ "Variable",
+ /* 28 */ "String",
+ /* 29 */ "ParseSchema",
+ /* 30 */ "PutIntKey",
+ /* 31 */ "AggFunc",
+ /* 32 */ "Close",
+ /* 33 */ "ListWrite",
+ /* 34 */ "CreateIndex",
+ /* 35 */ "IsUnique",
+ /* 36 */ "IdxIsNull",
+ /* 37 */ "NotFound",
+ /* 38 */ "MustBeInt",
+ /* 39 */ "Halt",
+ /* 40 */ "IdxLT",
+ /* 41 */ "AddImm",
+ /* 42 */ "Statement",
+ /* 43 */ "RowData",
+ /* 44 */ "MemMax",
+ /* 45 */ "Push",
+ /* 46 */ "KeyAsData",
+ /* 47 */ "NotExists",
+ /* 48 */ "OpenTemp",
+ /* 49 */ "MemIncr",
+ /* 50 */ "Gosub",
+ /* 51 */ "AggSet",
+ /* 52 */ "Integer",
+ /* 53 */ "SortNext",
+ /* 54 */ "Prev",
+ /* 55 */ "CreateTable",
+ /* 56 */ "Last",
+ /* 57 */ "ResetCount",
+ /* 58 */ "Callback",
+ /* 59 */ "ContextPush",
+ /* 60 */ "DropTrigger",
+ /* 61 */ "DropIndex",
+ /* 62 */ "FullKey",
+ /* 63 */ "IdxGE",
+ /* 64 */ "Or",
+ /* 65 */ "And",
+ /* 66 */ "Not",
+ /* 67 */ "IdxDelete",
+ /* 68 */ "Vacuum",
+ /* 69 */ "MoveLe",
+ /* 70 */ "IsNull",
+ /* 71 */ "NotNull",
+ /* 72 */ "Ne",
+ /* 73 */ "Eq",
+ /* 74 */ "Gt",
+ /* 75 */ "Le",
+ /* 76 */ "Lt",
+ /* 77 */ "Ge",
+ /* 78 */ "IfNot",
+ /* 79 */ "BitAnd",
+ /* 80 */ "BitOr",
+ /* 81 */ "ShiftLeft",
+ /* 82 */ "ShiftRight",
+ /* 83 */ "Add",
+ /* 84 */ "Subtract",
+ /* 85 */ "Multiply",
+ /* 86 */ "Divide",
+ /* 87 */ "Remainder",
+ /* 88 */ "Concat",
+ /* 89 */ "Negative",
+ /* 90 */ "DropTable",
+ /* 91 */ "BitNot",
+ /* 92 */ "String8",
+ /* 93 */ "MakeRecord",
+ /* 94 */ "Delete",
+ /* 95 */ "AggContextPop",
+ /* 96 */ "ListRead",
+ /* 97 */ "ListReset",
+ /* 98 */ "Dup",
+ /* 99 */ "Goto",
+ /* 100 */ "Clear",
+ /* 101 */ "IdxGT",
+ /* 102 */ "MoveLt",
+ /* 103 */ "VerifyCookie",
+ /* 104 */ "Pull",
+ /* 105 */ "SetNumColumns",
+ /* 106 */ "AbsValue",
+ /* 107 */ "Transaction",
+ /* 108 */ "AggGet",
+ /* 109 */ "ContextPop",
+ /* 110 */ "Next",
+ /* 111 */ "AggInit",
+ /* 112 */ "Distinct",
+ /* 113 */ "NewRecno",
+ /* 114 */ "AggReset",
+ /* 115 */ "Destroy",
+ /* 116 */ "ReadCookie",
+ /* 117 */ "ForceInt",
+ /* 118 */ "Recno",
+ /* 119 */ "OpenPseudo",
+ /* 120 */ "Blob",
+ /* 121 */ "MemStore",
+ /* 122 */ "Rewind",
+ /* 123 */ "MoveGe",
+ /* 124 */ "IdxPut",
+ /* 125 */ "Found",
+ /* 126 */ "NullRow",
+ /* 127 */ "NotUsed_127",
+ /* 128 */ "NotUsed_128",
+ /* 129 */ "NotUsed_129",
+ /* 130 */ "Real",
+ /* 131 */ "HexBlob",
+};
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/opcodes.h b/ext/pdo_sqlite/sqlite/src/opcodes.h
new file mode 100644
index 000000000..4db3ec163
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/opcodes.h
@@ -0,0 +1,149 @@
+/* Automatically generated. Do not edit */
+/* See the mkopcodeh.awk script for details */
+#define OP_MemLoad 1
+#define OP_HexBlob 134 /* same as TK_BLOB */
+#define OP_Column 2
+#define OP_SetCookie 3
+#define OP_IfMemPos 4
+#define OP_Real 133 /* same as TK_FLOAT */
+#define OP_Sequence 5
+#define OP_MoveGt 6
+#define OP_Ge 80 /* same as TK_GE */
+#define OP_RowKey 7
+#define OP_Eq 76 /* same as TK_EQ */
+#define OP_OpenWrite 8
+#define OP_NotNull 74 /* same as TK_NOTNULL */
+#define OP_If 9
+#define OP_ToInt 10
+#define OP_String8 95 /* same as TK_STRING */
+#define OP_Pop 11
+#define OP_CollSeq 12
+#define OP_OpenRead 13
+#define OP_Expire 14
+#define OP_AutoCommit 15
+#define OP_Gt 77 /* same as TK_GT */
+#define OP_IntegrityCk 16
+#define OP_Sort 17
+#define OP_Function 18
+#define OP_And 68 /* same as TK_AND */
+#define OP_Subtract 87 /* same as TK_MINUS */
+#define OP_Noop 19
+#define OP_Return 20
+#define OP_Remainder 90 /* same as TK_REM */
+#define OP_NewRowid 21
+#define OP_Multiply 88 /* same as TK_STAR */
+#define OP_Variable 22
+#define OP_String 23
+#define OP_ParseSchema 24
+#define OP_Close 25
+#define OP_CreateIndex 26
+#define OP_IsUnique 27
+#define OP_IdxIsNull 28
+#define OP_NotFound 29
+#define OP_Int64 30
+#define OP_MustBeInt 31
+#define OP_Halt 32
+#define OP_Rowid 33
+#define OP_IdxLT 34
+#define OP_AddImm 35
+#define OP_Statement 36
+#define OP_RowData 37
+#define OP_MemMax 38
+#define OP_Push 39
+#define OP_Or 67 /* same as TK_OR */
+#define OP_NotExists 40
+#define OP_MemIncr 41
+#define OP_Gosub 42
+#define OP_Divide 89 /* same as TK_SLASH */
+#define OP_Integer 43
+#define OP_ToNumeric 44
+#define OP_MemInt 45
+#define OP_Prev 46
+#define OP_Concat 91 /* same as TK_CONCAT */
+#define OP_BitAnd 82 /* same as TK_BITAND */
+#define OP_CreateTable 47
+#define OP_Last 48
+#define OP_IsNull 73 /* same as TK_ISNULL */
+#define OP_IdxRowid 49
+#define OP_MakeIdxRec 50
+#define OP_ShiftRight 85 /* same as TK_RSHIFT */
+#define OP_ResetCount 51
+#define OP_FifoWrite 52
+#define OP_Callback 53
+#define OP_ContextPush 54
+#define OP_DropTrigger 55
+#define OP_DropIndex 56
+#define OP_IdxGE 57
+#define OP_IdxDelete 58
+#define OP_Vacuum 59
+#define OP_MoveLe 60
+#define OP_IfNot 61
+#define OP_DropTable 62
+#define OP_MakeRecord 63
+#define OP_ToBlob 64
+#define OP_Delete 65
+#define OP_AggFinal 66
+#define OP_ShiftLeft 84 /* same as TK_LSHIFT */
+#define OP_Dup 70
+#define OP_Goto 71
+#define OP_FifoRead 72
+#define OP_Clear 81
+#define OP_IdxGT 93
+#define OP_MoveLt 96
+#define OP_Le 78 /* same as TK_LE */
+#define OP_VerifyCookie 97
+#define OP_AggStep 98
+#define OP_Pull 99
+#define OP_ToText 100
+#define OP_Not 69 /* same as TK_NOT */
+#define OP_SetNumColumns 101
+#define OP_AbsValue 102
+#define OP_Transaction 103
+#define OP_Negative 92 /* same as TK_UMINUS */
+#define OP_Ne 75 /* same as TK_NE */
+#define OP_ContextPop 104
+#define OP_BitOr 83 /* same as TK_BITOR */
+#define OP_Next 105
+#define OP_IdxInsert 106
+#define OP_Distinct 107
+#define OP_Lt 79 /* same as TK_LT */
+#define OP_Insert 108
+#define OP_Destroy 109
+#define OP_ReadCookie 110
+#define OP_ForceInt 111
+#define OP_LoadAnalysis 112
+#define OP_OpenVirtual 113
+#define OP_Explain 114
+#define OP_OpenPseudo 115
+#define OP_Null 116
+#define OP_Blob 117
+#define OP_Add 86 /* same as TK_PLUS */
+#define OP_MemStore 118
+#define OP_Rewind 119
+#define OP_MoveGe 120
+#define OP_BitNot 94 /* same as TK_BITNOT */
+#define OP_MemMove 121
+#define OP_MemNull 122
+#define OP_Found 123
+#define OP_NullRow 124
+
+/* The following opcode values are never used */
+#define OP_NotUsed_125 125
+#define OP_NotUsed_126 126
+#define OP_NotUsed_127 127
+#define OP_NotUsed_128 128
+#define OP_NotUsed_129 129
+#define OP_NotUsed_130 130
+#define OP_NotUsed_131 131
+#define OP_NotUsed_132 132
+
+#define NOPUSH_MASK_0 65368
+#define NOPUSH_MASK_1 47898
+#define NOPUSH_MASK_2 22493
+#define NOPUSH_MASK_3 32761
+#define NOPUSH_MASK_4 65215
+#define NOPUSH_MASK_5 30719
+#define NOPUSH_MASK_6 40895
+#define NOPUSH_MASK_7 6603
+#define NOPUSH_MASK_8 0
+#define NOPUSH_MASK_9 0
diff --git a/ext/pdo_sqlite/sqlite/src/os.h b/ext/pdo_sqlite/sqlite/src/os.h
new file mode 100644
index 000000000..a161d134a
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os.h
@@ -0,0 +1,207 @@
+/*
+** 2001 September 16
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This header file (together with is companion C source-code file
+** "os.c") attempt to abstract the underlying operating system so that
+** the SQLite library will work on both POSIX and windows systems.
+*/
+#ifndef _SQLITE_OS_H_
+#define _SQLITE_OS_H_
+
+/*
+** Figure out if we are dealing with Unix, Windows or MacOS.
+**
+** N.B. MacOS means Mac Classic (or Carbon). Treat Darwin (OS X) as Unix.
+** The MacOS build is designed to use CodeWarrior (tested with v8)
+*/
+#if !defined(OS_UNIX) && !defined(OS_TEST) && !defined(OS_OTHER)
+# define OS_OTHER 0
+# ifndef OS_WIN
+# if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
+# define OS_WIN 1
+# define OS_UNIX 0
+# else
+# define OS_WIN 0
+# define OS_UNIX 1
+# endif
+# else
+# define OS_UNIX 0
+# endif
+#else
+# ifndef OS_WIN
+# define OS_WIN 0
+# endif
+#endif
+
+/*
+** Invoke the appropriate operating-system specific header file.
+*/
+#if OS_TEST
+# include "os_test.h"
+#endif
+#if OS_UNIX
+# include "os_unix.h"
+#endif
+#if OS_WIN
+# include "os_win.h"
+#endif
+
+/* os_other.c and os_other.h are not delivered with SQLite. These files
+** are place-holders that can be filled in by third-party developers to
+** implement backends to their on proprietary operating systems.
+*/
+#if OS_OTHER
+# include "os_other.h"
+#endif
+
+/* If the SET_FULLSYNC macro is not defined above, then make it
+** a no-op
+*/
+#ifndef SET_FULLSYNC
+# define SET_FULLSYNC(x,y)
+#endif
+
+/*
+** Temporary files are named starting with this prefix followed by 16 random
+** alphanumeric characters, and no file extension. They are stored in the
+** OS's standard temporary file directory, and are deleted prior to exit.
+** If sqlite is being embedded in another program, you may wish to change the
+** prefix to reflect your program's name, so that if your program exits
+** prematurely, old temporary files can be easily identified. This can be done
+** using -DTEMP_FILE_PREFIX=myprefix_ on the compiler command line.
+*/
+#ifndef TEMP_FILE_PREFIX
+# define TEMP_FILE_PREFIX "sqlite_"
+#endif
+
+/*
+** The following values may be passed as the second argument to
+** sqlite3OsLock(). The various locks exhibit the following semantics:
+**
+** SHARED: Any number of processes may hold a SHARED lock simultaneously.
+** RESERVED: A single process may hold a RESERVED lock on a file at
+** any time. Other processes may hold and obtain new SHARED locks.
+** PENDING: A single process may hold a PENDING lock on a file at
+** any one time. Existing SHARED locks may persist, but no new
+** SHARED locks may be obtained by other processes.
+** EXCLUSIVE: An EXCLUSIVE lock precludes all other locks.
+**
+** PENDING_LOCK may not be passed directly to sqlite3OsLock(). Instead, a
+** process that requests an EXCLUSIVE lock may actually obtain a PENDING
+** lock. This can be upgraded to an EXCLUSIVE lock by a subsequent call to
+** sqlite3OsLock().
+*/
+#define NO_LOCK 0
+#define SHARED_LOCK 1
+#define RESERVED_LOCK 2
+#define PENDING_LOCK 3
+#define EXCLUSIVE_LOCK 4
+
+/*
+** File Locking Notes: (Mostly about windows but also some info for Unix)
+**
+** We cannot use LockFileEx() or UnlockFileEx() on Win95/98/ME because
+** those functions are not available. So we use only LockFile() and
+** UnlockFile().
+**
+** LockFile() prevents not just writing but also reading by other processes.
+** A SHARED_LOCK is obtained by locking a single randomly-chosen
+** byte out of a specific range of bytes. The lock byte is obtained at
+** random so two separate readers can probably access the file at the
+** same time, unless they are unlucky and choose the same lock byte.
+** An EXCLUSIVE_LOCK is obtained by locking all bytes in the range.
+** There can only be one writer. A RESERVED_LOCK is obtained by locking
+** a single byte of the file that is designated as the reserved lock byte.
+** A PENDING_LOCK is obtained by locking a designated byte different from
+** the RESERVED_LOCK byte.
+**
+** On WinNT/2K/XP systems, LockFileEx() and UnlockFileEx() are available,
+** which means we can use reader/writer locks. When reader/writer locks
+** are used, the lock is placed on the same range of bytes that is used
+** for probabilistic locking in Win95/98/ME. Hence, the locking scheme
+** will support two or more Win95 readers or two or more WinNT readers.
+** But a single Win95 reader will lock out all WinNT readers and a single
+** WinNT reader will lock out all other Win95 readers.
+**
+** The following #defines specify the range of bytes used for locking.
+** SHARED_SIZE is the number of bytes available in the pool from which
+** a random byte is selected for a shared lock. The pool of bytes for
+** shared locks begins at SHARED_FIRST.
+**
+** These #defines are available in os.h so that Unix can use the same
+** byte ranges for locking. This leaves open the possiblity of having
+** clients on win95, winNT, and unix all talking to the same shared file
+** and all locking correctly. To do so would require that samba (or whatever
+** tool is being used for file sharing) implements locks correctly between
+** windows and unix. I'm guessing that isn't likely to happen, but by
+** using the same locking range we are at least open to the possibility.
+**
+** Locking in windows is manditory. For this reason, we cannot store
+** actual data in the bytes used for locking. The pager never allocates
+** the pages involved in locking therefore. SHARED_SIZE is selected so
+** that all locks will fit on a single page even at the minimum page size.
+** PENDING_BYTE defines the beginning of the locks. By default PENDING_BYTE
+** is set high so that we don't have to allocate an unused page except
+** for very large databases. But one should test the page skipping logic
+** by setting PENDING_BYTE low and running the entire regression suite.
+**
+** Changing the value of PENDING_BYTE results in a subtly incompatible
+** file format. Depending on how it is changed, you might not notice
+** the incompatibility right away, even running a full regression test.
+** The default location of PENDING_BYTE is the first byte past the
+** 1GB boundary.
+**
+*/
+#ifndef SQLITE_TEST
+#define PENDING_BYTE 0x40000000 /* First byte past the 1GB boundary */
+#else
+extern unsigned int sqlite3_pending_byte;
+#define PENDING_BYTE sqlite3_pending_byte
+#endif
+
+#define RESERVED_BYTE (PENDING_BYTE+1)
+#define SHARED_FIRST (PENDING_BYTE+2)
+#define SHARED_SIZE 510
+
+
+int sqlite3OsDelete(const char*);
+int sqlite3OsFileExists(const char*);
+int sqlite3OsOpenReadWrite(const char*, OsFile*, int*);
+int sqlite3OsOpenExclusive(const char*, OsFile*, int);
+int sqlite3OsOpenReadOnly(const char*, OsFile*);
+int sqlite3OsOpenDirectory(const char*, OsFile*);
+int sqlite3OsSyncDirectory(const char*);
+int sqlite3OsTempFileName(char*);
+int sqlite3OsIsDirWritable(char*);
+int sqlite3OsClose(OsFile*);
+int sqlite3OsRead(OsFile*, void*, int amt);
+int sqlite3OsWrite(OsFile*, const void*, int amt);
+int sqlite3OsSeek(OsFile*, i64 offset);
+int sqlite3OsSync(OsFile*, int);
+int sqlite3OsTruncate(OsFile*, i64 size);
+int sqlite3OsFileSize(OsFile*, i64 *pSize);
+char *sqlite3OsFullPathname(const char*);
+int sqlite3OsLock(OsFile*, int);
+int sqlite3OsUnlock(OsFile*, int);
+int sqlite3OsCheckReservedLock(OsFile *id);
+
+
+/* The interface for file I/O is above. Other miscellaneous functions
+** are below */
+
+int sqlite3OsRandomSeed(char*);
+int sqlite3OsSleep(int ms);
+int sqlite3OsCurrentTime(double*);
+void sqlite3OsEnterMutex(void);
+void sqlite3OsLeaveMutex(void);
+
+#endif /* _SQLITE_OS_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/os_common.h b/ext/pdo_sqlite/sqlite/src/os_common.h
new file mode 100644
index 000000000..b19ff0590
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os_common.h
@@ -0,0 +1,123 @@
+/*
+** 2004 May 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This file contains macros and a little bit of code that is common to
+** all of the platform-specific files (os_*.c) and is #included into those
+** files.
+**
+** This file should be #included by the os_*.c files only. It is not a
+** general purpose header file.
+*/
+
+/*
+** At least two bugs have slipped in because we changed the MEMORY_DEBUG
+** macro to SQLITE_DEBUG and some older makefiles have not yet made the
+** switch. The following code should catch this problem at compile-time.
+*/
+#ifdef MEMORY_DEBUG
+# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
+#endif
+
+
+/*
+ * When testing, this global variable stores the location of the
+ * pending-byte in the database file.
+ */
+#ifdef SQLITE_TEST
+unsigned int sqlite3_pending_byte = 0x40000000;
+#endif
+
+int sqlite3_os_trace = 0;
+#ifdef SQLITE_DEBUG
+static int last_page = 0;
+#define SEEK(X) last_page=(X)
+#define TRACE1(X) if( sqlite3_os_trace ) sqlite3DebugPrintf(X)
+#define TRACE2(X,Y) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y)
+#define TRACE3(X,Y,Z) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z)
+#define TRACE4(X,Y,Z,A) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z,A)
+#define TRACE5(X,Y,Z,A,B) if( sqlite3_os_trace ) sqlite3DebugPrintf(X,Y,Z,A,B)
+#define TRACE6(X,Y,Z,A,B,C) if(sqlite3_os_trace) sqlite3DebugPrintf(X,Y,Z,A,B,C)
+#define TRACE7(X,Y,Z,A,B,C,D) \
+ if(sqlite3_os_trace) sqlite3DebugPrintf(X,Y,Z,A,B,C,D)
+#else
+#define SEEK(X)
+#define TRACE1(X)
+#define TRACE2(X,Y)
+#define TRACE3(X,Y,Z)
+#define TRACE4(X,Y,Z,A)
+#define TRACE5(X,Y,Z,A,B)
+#define TRACE6(X,Y,Z,A,B,C)
+#define TRACE7(X,Y,Z,A,B,C,D)
+#endif
+
+/*
+** Macros for performance tracing. Normally turned off. Only works
+** on i486 hardware.
+*/
+#ifdef SQLITE_PERFORMANCE_TRACE
+__inline__ unsigned long long int hwtime(void){
+ unsigned long long int x;
+ __asm__("rdtsc\n\t"
+ "mov %%edx, %%ecx\n\t"
+ :"=A" (x));
+ return x;
+}
+static unsigned long long int g_start;
+static unsigned int elapse;
+#define TIMER_START g_start=hwtime()
+#define TIMER_END elapse=hwtime()-g_start
+#define TIMER_ELAPSED elapse
+#else
+#define TIMER_START
+#define TIMER_END
+#define TIMER_ELAPSED 0
+#endif
+
+/*
+** If we compile with the SQLITE_TEST macro set, then the following block
+** of code will give us the ability to simulate a disk I/O error. This
+** is used for testing the I/O recovery logic.
+*/
+#ifdef SQLITE_TEST
+int sqlite3_io_error_pending = 0;
+int sqlite3_diskfull_pending = 0;
+int sqlite3_diskfull = 0;
+#define SimulateIOError(A) \
+ if( sqlite3_io_error_pending ) \
+ if( sqlite3_io_error_pending-- == 1 ){ local_ioerr(); return A; }
+static void local_ioerr(){
+ sqlite3_io_error_pending = 0; /* Really just a place to set a breakpoint */
+}
+#define SimulateDiskfullError \
+ if( sqlite3_diskfull_pending ){ \
+ if( sqlite3_diskfull_pending == 1 ){ \
+ local_ioerr(); \
+ sqlite3_diskfull = 1; \
+ return SQLITE_FULL; \
+ }else{ \
+ sqlite3_diskfull_pending--; \
+ } \
+ }
+#else
+#define SimulateIOError(A)
+#define SimulateDiskfullError
+#endif
+
+/*
+** When testing, keep a count of the number of open files.
+*/
+#ifdef SQLITE_TEST
+int sqlite3_open_file_count = 0;
+#define OpenCounter(X) sqlite3_open_file_count+=(X)
+#else
+#define OpenCounter(X)
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/os_mac.c b/ext/pdo_sqlite/sqlite/src/os_mac.c
new file mode 100644
index 000000000..f84c168d4
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os_mac.c
@@ -0,0 +1,738 @@
+/*
+** 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
new file mode 100644
index 000000000..5b60f8183
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os_mac.h
@@ -0,0 +1,41 @@
+/*
+** 2004 May 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This header file defines OS-specific features of classic Mac.
+** OS X uses the os_unix.h file, not this one.
+*/
+#ifndef _SQLITE_OS_MAC_H_
+#define _SQLITE_OS_MAC_H_
+
+
+#include <unistd.h>
+#include <Files.h>
+#define SQLITE_TEMPNAME_SIZE _MAX_PATH
+#define SQLITE_MIN_SLEEP_MS 17
+
+/*
+** The OsFile structure is a operating-system independing representation
+** of an open file handle. It is defined differently for each architecture.
+**
+** This is the definition for class Mac.
+*/
+typedef struct OsFile OsFile;
+struct OsFile {
+ SInt16 refNum; /* Data fork/file reference number */
+ SInt16 refNumRF; /* Resource fork reference number (for locking) */
+ int locked; /* 0: unlocked, <0: write lock, >0: read lock */
+ int delOnClose; /* True if file is to be deleted on close */
+ char *pathToDel; /* Name of file to delete on close */
+};
+
+
+#endif /* _SQLITE_OS_MAC_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/os_test.c b/ext/pdo_sqlite/sqlite/src/os_test.c
new file mode 100644
index 000000000..9b1c0e206
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os_test.c
@@ -0,0 +1,463 @@
+/*
+** 2004 May 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This file contains code that is specific to Unix systems. It is used
+** for testing SQLite only.
+*/
+#if OS_TEST /* This file is used for the test backend only */
+#include "sqliteInt.h"
+#include "os.h" /* Must be first to enable large file support */
+
+#define sqlite3OsOpenReadWrite sqlite3RealOpenReadWrite
+#define sqlite3OsOpenExclusive sqlite3RealOpenExclusive
+#define sqlite3OsOpenReadOnly sqlite3RealOpenReadOnly
+#define sqlite3OsOpenDirectory sqlite3RealOpenDirectory
+#define sqlite3OsClose sqlite3RealClose
+#define sqlite3OsRead sqlite3RealRead
+#define sqlite3OsWrite sqlite3RealWrite
+#define sqlite3OsSeek sqlite3RealSeek
+#define sqlite3OsSync sqlite3RealSync
+#define sqlite3OsTruncate sqlite3RealTruncate
+#define sqlite3OsFileSize sqlite3RealFileSize
+#define sqlite3OsLock sqlite3RealLock
+#define sqlite3OsUnlock sqlite3RealUnlock
+#define sqlite3OsCheckReservedLock sqlite3RealCheckReservedLock
+
+#define OsFile OsRealFile
+#define OS_UNIX 1
+#include "os_unix.c"
+#undef OS_UNIX
+#undef OsFile
+
+#undef sqlite3OsOpenReadWrite
+#undef sqlite3OsOpenExclusive
+#undef sqlite3OsOpenReadOnly
+#undef sqlite3OsOpenDirectory
+#undef sqlite3OsClose
+#undef sqlite3OsRead
+#undef sqlite3OsWrite
+#undef sqlite3OsSeek
+#undef sqlite3OsSync
+#undef sqlite3OsTruncate
+#undef sqlite3OsFileSize
+#undef sqlite3OsLock
+#undef sqlite3OsUnlock
+#undef sqlite3OsCheckReservedLock
+
+#define BLOCKSIZE 512
+#define BLOCK_OFFSET(x) ((x) * BLOCKSIZE)
+
+
+/*
+** The following variables control when a simulated crash occurs.
+**
+** If iCrashDelay is non-zero, then zCrashFile contains (full path) name of
+** a file that SQLite will call sqlite3OsSync() on. Each time this happens
+** iCrashDelay is decremented. If iCrashDelay is zero after being
+** decremented, a "crash" occurs during the sync() operation.
+**
+** In other words, a crash occurs the iCrashDelay'th time zCrashFile is
+** synced.
+*/
+static int iCrashDelay = 0;
+char zCrashFile[256];
+
+/*
+** Set the value of the two crash parameters.
+*/
+void sqlite3SetCrashParams(int iDelay, char const *zFile){
+ sqlite3OsEnterMutex();
+ assert( strlen(zFile)<256 );
+ strcpy(zCrashFile, zFile);
+ iCrashDelay = iDelay;
+ sqlite3OsLeaveMutex();
+}
+
+/*
+** File zPath is being sync()ed. Return non-zero if this should
+** cause a crash.
+*/
+static int crashRequired(char const *zPath){
+ int r;
+ int n;
+ sqlite3OsEnterMutex();
+ n = strlen(zCrashFile);
+ if( zCrashFile[n-1]=='*' ){
+ n--;
+ }else if( strlen(zPath)>n ){
+ n = strlen(zPath);
+ }
+ r = 0;
+ if( iCrashDelay>0 && strncmp(zPath, zCrashFile, n)==0 ){
+ iCrashDelay--;
+ if( iCrashDelay<=0 ){
+ r = 1;
+ }
+ }
+ sqlite3OsLeaveMutex();
+ return r;
+}
+
+
+static OsTestFile *pAllFiles = 0;
+
+/*
+** Initialise the os_test.c specific fields of pFile.
+*/
+static void initFile(OsFile *id, char const *zName){
+ OsTestFile *pFile = (OsTestFile *)
+ sqliteMalloc(sizeof(OsTestFile) + strlen(zName)+1);
+ pFile->nMaxWrite = 0;
+ pFile->nBlk = 0;
+ pFile->apBlk = 0;
+ pFile->zName = (char *)(&pFile[1]);
+ strcpy(pFile->zName, zName);
+ *id = pFile;
+ pFile->pNext = pAllFiles;
+ pAllFiles = pFile;
+}
+
+/*
+** Undo the work done by initFile. Delete the OsTestFile structure
+** and unlink the structure from the pAllFiles list.
+*/
+static void closeFile(OsFile *id){
+ OsTestFile *pFile = *id;
+ if( pFile==pAllFiles ){
+ pAllFiles = pFile->pNext;
+ }else{
+ OsTestFile *p;
+ for(p=pAllFiles; p->pNext!=pFile; p=p->pNext ){
+ assert( p );
+ }
+ p->pNext = pFile->pNext;
+ }
+ sqliteFree(pFile);
+ *id = 0;
+}
+
+/*
+** Return the current seek offset from the start of the file. This
+** is unix-only code.
+*/
+static i64 osTell(OsTestFile *pFile){
+ return lseek(pFile->fd.h, 0, SEEK_CUR);
+}
+
+/*
+** Load block 'blk' into the cache of pFile.
+*/
+static int cacheBlock(OsTestFile *pFile, int blk){
+ if( blk>=pFile->nBlk ){
+ int n = ((pFile->nBlk * 2) + 100 + blk);
+ /* if( pFile->nBlk==0 ){ printf("DIRTY %s\n", pFile->zName); } */
+ pFile->apBlk = (u8 **)sqliteRealloc(pFile->apBlk, n * sizeof(u8*));
+ if( !pFile->apBlk ) return SQLITE_NOMEM;
+ memset(&pFile->apBlk[pFile->nBlk], 0, (n - pFile->nBlk)*sizeof(u8*));
+ pFile->nBlk = n;
+ }
+
+ if( !pFile->apBlk[blk] ){
+ i64 filesize;
+ int rc;
+
+ u8 *p = sqliteMalloc(BLOCKSIZE);
+ if( !p ) return SQLITE_NOMEM;
+ pFile->apBlk[blk] = p;
+
+ rc = sqlite3RealFileSize(&pFile->fd, &filesize);
+ if( rc!=SQLITE_OK ) return rc;
+
+ if( BLOCK_OFFSET(blk)<filesize ){
+ int len = BLOCKSIZE;
+ rc = sqlite3RealSeek(&pFile->fd, blk*BLOCKSIZE);
+ if( BLOCK_OFFSET(blk+1)>filesize ){
+ len = filesize - BLOCK_OFFSET(blk);
+ }
+ if( rc!=SQLITE_OK ) return rc;
+ rc = sqlite3RealRead(&pFile->fd, p, len);
+ if( rc!=SQLITE_OK ) return rc;
+ }
+ }
+
+ return SQLITE_OK;
+}
+
+/* #define TRACE_WRITECACHE */
+
+/*
+** Write the cache of pFile to disk. If crash is non-zero, randomly
+** skip blocks when writing. The cache is deleted before returning.
+*/
+static int writeCache2(OsTestFile *pFile, int crash){
+ int i;
+ int nMax = pFile->nMaxWrite;
+ i64 offset;
+ int rc = SQLITE_OK;
+
+ offset = osTell(pFile);
+ for(i=0; i<pFile->nBlk; i++){
+ u8 *p = pFile->apBlk[i];
+ if( p ){
+ int skip = 0;
+ int trash = 0;
+ if( crash ){
+ char random;
+ sqlite3Randomness(1, &random);
+ if( random & 0x01 ){
+ if( random & 0x02 ){
+ trash = 1;
+#ifdef TRACE_WRITECACHE
+printf("Trashing block %d of %s\n", i, pFile->zName);
+#endif
+ }else{
+ skip = 1;
+#ifdef TRACE_WRITECACHE
+printf("Skiping block %d of %s\n", i, pFile->zName);
+#endif
+ }
+ }else{
+#ifdef TRACE_WRITECACHE
+printf("Writing block %d of %s\n", i, pFile->zName);
+#endif
+ }
+ }
+ if( rc==SQLITE_OK ){
+ rc = sqlite3RealSeek(&pFile->fd, BLOCK_OFFSET(i));
+ }
+ if( rc==SQLITE_OK && !skip ){
+ int len = BLOCKSIZE;
+ if( BLOCK_OFFSET(i+1)>nMax ){
+ len = nMax-BLOCK_OFFSET(i);
+ }
+ if( len>0 ){
+ if( trash ){
+ sqlite3Randomness(len, p);
+ }
+ rc = sqlite3RealWrite(&pFile->fd, p, len);
+ }
+ }
+ sqliteFree(p);
+ }
+ }
+ sqliteFree(pFile->apBlk);
+ pFile->nBlk = 0;
+ pFile->apBlk = 0;
+ pFile->nMaxWrite = 0;
+
+ if( rc==SQLITE_OK ){
+ rc = sqlite3RealSeek(&pFile->fd, offset);
+ }
+ return rc;
+}
+
+/*
+** Write the cache to disk.
+*/
+static int writeCache(OsTestFile *pFile){
+ if( pFile->apBlk ){
+ int c = crashRequired(pFile->zName);
+ if( c ){
+ OsTestFile *p;
+#ifdef TRACE_WRITECACHE
+ printf("\nCrash during sync of %s\n", pFile->zName);
+#endif
+ for(p=pAllFiles; p; p=p->pNext){
+ writeCache2(p, 1);
+ }
+ exit(-1);
+ }else{
+ return writeCache2(pFile, 0);
+ }
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Close the file.
+*/
+int sqlite3OsClose(OsFile *id){
+ if( !(*id) ) return SQLITE_OK;
+ if( (*id)->fd.isOpen ){
+ /* printf("CLOSE %s (%d blocks)\n", (*id)->zName, (*id)->nBlk); */
+ writeCache(*id);
+ sqlite3RealClose(&(*id)->fd);
+ }
+ closeFile(id);
+ return SQLITE_OK;
+}
+
+int sqlite3OsRead(OsFile *id, void *pBuf, int amt){
+ i64 offset; /* The current offset from the start of the file */
+ i64 end; /* The byte just past the last byte read */
+ int blk; /* Block number the read starts on */
+ int i;
+ u8 *zCsr;
+ int rc = SQLITE_OK;
+ OsTestFile *pFile = *id;
+
+ offset = osTell(pFile);
+ end = offset+amt;
+ blk = (offset/BLOCKSIZE);
+
+ zCsr = (u8 *)pBuf;
+ for(i=blk; i*BLOCKSIZE<end; i++){
+ int off = 0;
+ int len = 0;
+
+
+ if( BLOCK_OFFSET(i) < offset ){
+ off = offset-BLOCK_OFFSET(i);
+ }
+ len = BLOCKSIZE - off;
+ if( BLOCK_OFFSET(i+1) > end ){
+ len = len - (BLOCK_OFFSET(i+1)-end);
+ }
+
+ if( i<pFile->nBlk && pFile->apBlk[i]){
+ u8 *pBlk = pFile->apBlk[i];
+ memcpy(zCsr, &pBlk[off], len);
+ }else{
+ rc = sqlite3RealSeek(&pFile->fd, BLOCK_OFFSET(i) + off);
+ if( rc!=SQLITE_OK ) return rc;
+ rc = sqlite3RealRead(&pFile->fd, zCsr, len);
+ if( rc!=SQLITE_OK ) return rc;
+ }
+
+ zCsr += len;
+ }
+ assert( zCsr==&((u8 *)pBuf)[amt] );
+
+ rc = sqlite3RealSeek(&pFile->fd, end);
+ return rc;
+}
+
+int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){
+ i64 offset; /* The current offset from the start of the file */
+ i64 end; /* The byte just past the last byte written */
+ int blk; /* Block number the write starts on */
+ int i;
+ const u8 *zCsr;
+ int rc = SQLITE_OK;
+ OsTestFile *pFile = *id;
+
+ offset = osTell(pFile);
+ end = offset+amt;
+ blk = (offset/BLOCKSIZE);
+
+ zCsr = (u8 *)pBuf;
+ for(i=blk; i*BLOCKSIZE<end; i++){
+ u8 *pBlk;
+ int off = 0;
+ int len = 0;
+
+ /* Make sure the block is in the cache */
+ rc = cacheBlock(pFile, i);
+ if( rc!=SQLITE_OK ) return rc;
+
+ /* Write into the cache */
+ pBlk = pFile->apBlk[i];
+ assert( pBlk );
+
+ if( BLOCK_OFFSET(i) < offset ){
+ off = offset-BLOCK_OFFSET(i);
+ }
+ len = BLOCKSIZE - off;
+ if( BLOCK_OFFSET(i+1) > end ){
+ len = len - (BLOCK_OFFSET(i+1)-end);
+ }
+ memcpy(&pBlk[off], zCsr, len);
+ zCsr += len;
+ }
+ if( pFile->nMaxWrite<end ){
+ pFile->nMaxWrite = end;
+ }
+ assert( zCsr==&((u8 *)pBuf)[amt] );
+
+ rc = sqlite3RealSeek(&pFile->fd, end);
+ return rc;
+}
+
+/*
+** Sync the file. First flush the write-cache to disk, then call the
+** real sync() function.
+*/
+int sqlite3OsSync(OsFile *id, int dataOnly){
+ int rc;
+ /* printf("SYNC %s (%d blocks)\n", (*id)->zName, (*id)->nBlk); */
+ rc = writeCache(*id);
+ if( rc!=SQLITE_OK ) return rc;
+ rc = sqlite3RealSync(&(*id)->fd, dataOnly);
+ return rc;
+}
+
+/*
+** Truncate the file. Set the internal OsFile.nMaxWrite variable to the new
+** file size to ensure that nothing in the write-cache past this point
+** is written to disk.
+*/
+int sqlite3OsTruncate(OsFile *id, i64 nByte){
+ (*id)->nMaxWrite = nByte;
+ return sqlite3RealTruncate(&(*id)->fd, nByte);
+}
+
+/*
+** Return the size of the file. If the cache contains a write that extended
+** the file, then return this size instead of the on-disk size.
+*/
+int sqlite3OsFileSize(OsFile *id, i64 *pSize){
+ int rc = sqlite3RealFileSize(&(*id)->fd, pSize);
+ if( rc==SQLITE_OK && pSize && *pSize<(*id)->nMaxWrite ){
+ *pSize = (*id)->nMaxWrite;
+ }
+ return rc;
+}
+
+/*
+** The three functions used to open files. All that is required is to
+** initialise the os_test.c specific fields and then call the corresponding
+** os_unix.c function to really open the file.
+*/
+int sqlite3OsOpenReadWrite(const char *zFilename, OsFile *id, int *pReadonly){
+ initFile(id, zFilename);
+ return sqlite3RealOpenReadWrite(zFilename, &(*id)->fd, pReadonly);
+}
+int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
+ initFile(id, zFilename);
+ return sqlite3RealOpenExclusive(zFilename, &(*id)->fd, delFlag);
+}
+int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){
+ initFile(id, zFilename);
+ return sqlite3RealOpenReadOnly(zFilename, &(*id)->fd);
+}
+
+/*
+** These six function calls are passed straight through to the os_unix.c
+** backend.
+*/
+int sqlite3OsSeek(OsFile *id, i64 offset){
+ return sqlite3RealSeek(&(*id)->fd, offset);
+}
+int sqlite3OsCheckReservedLock(OsFile *id){
+ return sqlite3RealCheckReservedLock(&(*id)->fd);
+}
+int sqlite3OsLock(OsFile *id, int locktype){
+ return sqlite3RealLock(&(*id)->fd, locktype);
+}
+int sqlite3OsUnlock(OsFile *id, int locktype){
+ return sqlite3RealUnlock(&(*id)->fd, locktype);
+}
+int sqlite3OsOpenDirectory(const char *zDirname, OsFile *id){
+ return sqlite3RealOpenDirectory(zDirname, &(*id)->fd);
+}
+
+#endif /* OS_TEST */
diff --git a/ext/pdo_sqlite/sqlite/src/os_test.h b/ext/pdo_sqlite/sqlite/src/os_test.h
new file mode 100644
index 000000000..dc0a04aae
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os_test.h
@@ -0,0 +1,40 @@
+/*
+** 2004 May 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+*/
+#ifndef _SQLITE_OS_TEST_H_
+#define _SQLITE_OS_TEST_H_
+
+#define OsFile OsRealFile
+#define OS_UNIX 1
+#include "os_unix.h"
+#undef OS_UNIX
+#undef OsFile
+#undef SET_FULLSYNC
+
+/* Include sqliteInt.h now to get the type u8. */
+#include "sqliteInt.h"
+
+typedef struct OsTestFile* OsFile;
+typedef struct OsTestFile OsTestFile;
+struct OsTestFile {
+ u8 **apBlk; /* Array of blocks that have been written to. */
+ int nBlk; /* Size of apBlock. */
+ int nMaxWrite; /* Largest offset written to. */
+ char *zName; /* File name */
+ OsRealFile fd;
+ OsTestFile *pNext;
+};
+
+void sqlite3SetCrashParams(int iDelay, char const *zFile);
+
+#endif /* _SQLITE_OS_UNIX_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/os_unix.c b/ext/pdo_sqlite/sqlite/src/os_unix.c
new file mode 100644
index 000000000..f4e09b536
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os_unix.c
@@ -0,0 +1,1460 @@
+/*
+** 2004 May 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This file contains code that is specific to Unix systems.
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#if OS_UNIX /* This file is used on unix only */
+
+
+#include <time.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <unistd.h>
+
+/*
+** Do not include any of the File I/O interface procedures if the
+** SQLITE_OMIT_DISKIO macro is defined (indicating that there database
+** will be in-memory only)
+*/
+#ifndef SQLITE_OMIT_DISKIO
+
+
+/*
+** Define various macros that are missing from some systems.
+*/
+#ifndef O_LARGEFILE
+# define O_LARGEFILE 0
+#endif
+#ifdef SQLITE_DISABLE_LFS
+# undef O_LARGEFILE
+# define O_LARGEFILE 0
+#endif
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
+/*
+** The DJGPP compiler environment looks mostly like Unix, but it
+** lacks the fcntl() system call. So redefine fcntl() to be something
+** that always succeeds. This means that locking does not occur under
+** DJGPP. But its DOS - what did you expect?
+*/
+#ifdef __DJGPP__
+# define fcntl(A,B,C) 0
+#endif
+
+/*
+** Include code that is common to all os_*.c files
+*/
+#include "os_common.h"
+
+/*
+** The threadid macro resolves to the thread-id or to 0. Used for
+** testing and debugging only.
+*/
+#ifdef SQLITE_UNIX_THREADS
+#define threadid pthread_self()
+#else
+#define threadid 0
+#endif
+
+/*
+** Set or check the OsFile.tid field. This field is set when an OsFile
+** is first opened. All subsequent uses of the OsFile verify that the
+** same thread is operating on the OsFile. Some operating systems do
+** not allow locks to be overridden by other threads and that restriction
+** means that sqlite3* database handles cannot be moved from one thread
+** to another. This logic makes sure a user does not try to do that
+** by mistake.
+*/
+#ifdef SQLITE_UNIX_THREADS
+# define SET_THREADID(X) X->tid = pthread_self()
+# define CHECK_THREADID(X) (!pthread_equal(X->tid, pthread_self()))
+#else
+# define SET_THREADID(X)
+# define CHECK_THREADID(X) 0
+#endif
+
+/*
+** Here is the dirt on POSIX advisory locks: ANSI STD 1003.1 (1996)
+** section 6.5.2.2 lines 483 through 490 specify that when a process
+** sets or clears a lock, that operation overrides any prior locks set
+** by the same process. It does not explicitly say so, but this implies
+** that it overrides locks set by the same process using a different
+** file descriptor. Consider this test case:
+**
+** int fd1 = open("./file1", O_RDWR|O_CREAT, 0644);
+** int fd2 = open("./file2", O_RDWR|O_CREAT, 0644);
+**
+** Suppose ./file1 and ./file2 are really the same file (because
+** one is a hard or symbolic link to the other) then if you set
+** an exclusive lock on fd1, then try to get an exclusive lock
+** on fd2, it works. I would have expected the second lock to
+** fail since there was already a lock on the file due to fd1.
+** But not so. Since both locks came from the same process, the
+** second overrides the first, even though they were on different
+** file descriptors opened on different file names.
+**
+** Bummer. If you ask me, this is broken. Badly broken. It means
+** that we cannot use POSIX locks to synchronize file access among
+** competing threads of the same process. POSIX locks will work fine
+** to synchronize access for threads in separate processes, but not
+** threads within the same process.
+**
+** To work around the problem, SQLite has to manage file locks internally
+** on its own. Whenever a new database is opened, we have to find the
+** specific inode of the database file (the inode is determined by the
+** st_dev and st_ino fields of the stat structure that fstat() fills in)
+** and check for locks already existing on that inode. When locks are
+** created or removed, we have to look at our own internal record of the
+** locks to see if another thread has previously set a lock on that same
+** inode.
+**
+** The OsFile structure for POSIX is no longer just an integer file
+** descriptor. It is now a structure that holds the integer file
+** descriptor and a pointer to a structure that describes the internal
+** locks on the corresponding inode. There is one locking structure
+** per inode, so if the same inode is opened twice, both OsFile structures
+** point to the same locking structure. The locking structure keeps
+** a reference count (so we will know when to delete it) and a "cnt"
+** field that tells us its internal lock status. cnt==0 means the
+** file is unlocked. cnt==-1 means the file has an exclusive lock.
+** cnt>0 means there are cnt shared locks on the file.
+**
+** Any attempt to lock or unlock a file first checks the locking
+** structure. The fcntl() system call is only invoked to set a
+** POSIX lock if the internal lock structure transitions between
+** a locked and an unlocked state.
+**
+** 2004-Jan-11:
+** More recent discoveries about POSIX advisory locks. (The more
+** I discover, the more I realize the a POSIX advisory locks are
+** an abomination.)
+**
+** If you close a file descriptor that points to a file that has locks,
+** all locks on that file that are owned by the current process are
+** released. To work around this problem, each OsFile structure contains
+** a pointer to an openCnt structure. There is one openCnt structure
+** per open inode, which means that multiple OsFiles can point to a single
+** openCnt. When an attempt is made to close an OsFile, if there are
+** other OsFiles open on the same inode that are holding locks, the call
+** to close() the file descriptor is deferred until all of the locks clear.
+** The openCnt structure keeps a list of file descriptors that need to
+** be closed and that list is walked (and cleared) when the last lock
+** clears.
+**
+** First, under Linux threads, because each thread has a separate
+** process ID, lock operations in one thread do not override locks
+** to the same file in other threads. Linux threads behave like
+** separate processes in this respect. But, if you close a file
+** descriptor in linux threads, all locks are cleared, even locks
+** on other threads and even though the other threads have different
+** process IDs. Linux threads is inconsistent in this respect.
+** (I'm beginning to think that linux threads is an abomination too.)
+** The consequence of this all is that the hash table for the lockInfo
+** structure has to include the process id as part of its key because
+** locks in different threads are treated as distinct. But the
+** openCnt structure should not include the process id in its
+** key because close() clears lock on all threads, not just the current
+** thread. Were it not for this goofiness in linux threads, we could
+** combine the lockInfo and openCnt structures into a single structure.
+**
+** 2004-Jun-28:
+** On some versions of linux, threads can override each others locks.
+** On others not. Sometimes you can change the behavior on the same
+** system by setting the LD_ASSUME_KERNEL environment variable. The
+** POSIX standard is silent as to which behavior is correct, as far
+** as I can tell, so other versions of unix might show the same
+** inconsistency. There is no little doubt in my mind that posix
+** advisory locks and linux threads are profoundly broken.
+**
+** To work around the inconsistencies, we have to test at runtime
+** whether or not threads can override each others locks. This test
+** is run once, the first time any lock is attempted. A static
+** variable is set to record the results of this test for future
+** use.
+*/
+
+/*
+** An instance of the following structure serves as the key used
+** to locate a particular lockInfo structure given its inode.
+**
+** If threads cannot override each others locks, then we set the
+** lockKey.tid field to the thread ID. If threads can override
+** each others locks then tid is always set to zero. tid is also
+** set to zero if we compile without threading support.
+*/
+struct lockKey {
+ dev_t dev; /* Device number */
+ ino_t ino; /* Inode number */
+#ifdef SQLITE_UNIX_THREADS
+ pthread_t tid; /* Thread ID or zero if threads cannot override each other */
+#endif
+};
+
+/*
+** An instance of the following structure is allocated for each open
+** inode on each thread with a different process ID. (Threads have
+** different process IDs on linux, but not on most other unixes.)
+**
+** A single inode can have multiple file descriptors, so each OsFile
+** structure contains a pointer to an instance of this object and this
+** object keeps a count of the number of OsFiles pointing to it.
+*/
+struct lockInfo {
+ struct lockKey key; /* The lookup key */
+ int cnt; /* Number of SHARED locks held */
+ int locktype; /* One of SHARED_LOCK, RESERVED_LOCK etc. */
+ int nRef; /* Number of pointers to this structure */
+};
+
+/*
+** An instance of the following structure serves as the key used
+** to locate a particular openCnt structure given its inode. This
+** is the same as the lockKey except that the thread ID is omitted.
+*/
+struct openKey {
+ dev_t dev; /* Device number */
+ ino_t ino; /* Inode number */
+};
+
+/*
+** An instance of the following structure is allocated for each open
+** inode. This structure keeps track of the number of locks on that
+** inode. If a close is attempted against an inode that is holding
+** locks, the close is deferred until all locks clear by adding the
+** file descriptor to be closed to the pending list.
+*/
+struct openCnt {
+ struct openKey key; /* The lookup key */
+ int nRef; /* Number of pointers to this structure */
+ int nLock; /* Number of outstanding locks */
+ int nPending; /* Number of pending close() operations */
+ int *aPending; /* Malloced space holding fd's awaiting a close() */
+};
+
+/*
+** These hash table maps inodes and process IDs into lockInfo and openCnt
+** structures. Access to these hash tables must be protected by a mutex.
+*/
+static Hash lockHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 };
+static Hash openHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 };
+
+
+#ifdef SQLITE_UNIX_THREADS
+/*
+** This variable records whether or not threads can override each others
+** locks.
+**
+** 0: No. Threads cannot override each others locks.
+** 1: Yes. Threads can override each others locks.
+** -1: We don't know yet.
+*/
+static int threadsOverrideEachOthersLocks = -1;
+
+/*
+** This structure holds information passed into individual test
+** threads by the testThreadLockingBehavior() routine.
+*/
+struct threadTestData {
+ int fd; /* File to be locked */
+ struct flock lock; /* The locking operation */
+ int result; /* Result of the locking operation */
+};
+
+#ifdef SQLITE_LOCK_TRACE
+/*
+** Print out information about all locking operations.
+**
+** This routine is used for troubleshooting locks on multithreaded
+** platforms. Enable by compiling with the -DSQLITE_LOCK_TRACE
+** command-line option on the compiler. This code is normally
+** turnned off.
+*/
+static int lockTrace(int fd, int op, struct flock *p){
+ char *zOpName, *zType;
+ int s;
+ int savedErrno;
+ if( op==F_GETLK ){
+ zOpName = "GETLK";
+ }else if( op==F_SETLK ){
+ zOpName = "SETLK";
+ }else{
+ s = fcntl(fd, op, p);
+ sqlite3DebugPrintf("fcntl unknown %d %d %d\n", fd, op, s);
+ return s;
+ }
+ if( p->l_type==F_RDLCK ){
+ zType = "RDLCK";
+ }else if( p->l_type==F_WRLCK ){
+ zType = "WRLCK";
+ }else if( p->l_type==F_UNLCK ){
+ zType = "UNLCK";
+ }else{
+ assert( 0 );
+ }
+ assert( p->l_whence==SEEK_SET );
+ s = fcntl(fd, op, p);
+ savedErrno = errno;
+ sqlite3DebugPrintf("fcntl %d %d %s %s %d %d %d %d\n",
+ threadid, fd, zOpName, zType, (int)p->l_start, (int)p->l_len,
+ (int)p->l_pid, s);
+ if( s && op==F_SETLK && (p->l_type==F_RDLCK || p->l_type==F_WRLCK) ){
+ struct flock l2;
+ l2 = *p;
+ fcntl(fd, F_GETLK, &l2);
+ if( l2.l_type==F_RDLCK ){
+ zType = "RDLCK";
+ }else if( l2.l_type==F_WRLCK ){
+ zType = "WRLCK";
+ }else if( l2.l_type==F_UNLCK ){
+ zType = "UNLCK";
+ }else{
+ assert( 0 );
+ }
+ sqlite3DebugPrintf("fcntl-failure-reason: %s %d %d %d\n",
+ zType, (int)l2.l_start, (int)l2.l_len, (int)l2.l_pid);
+ }
+ errno = savedErrno;
+ return s;
+}
+#define fcntl lockTrace
+#endif /* SQLITE_LOCK_TRACE */
+
+/*
+** The testThreadLockingBehavior() routine launches two separate
+** threads on this routine. This routine attempts to lock a file
+** descriptor then returns. The success or failure of that attempt
+** allows the testThreadLockingBehavior() procedure to determine
+** whether or not threads can override each others locks.
+*/
+static void *threadLockingTest(void *pArg){
+ struct threadTestData *pData = (struct threadTestData*)pArg;
+ pData->result = fcntl(pData->fd, F_SETLK, &pData->lock);
+ return pArg;
+}
+
+/*
+** This procedure attempts to determine whether or not threads
+** can override each others locks then sets the
+** threadsOverrideEachOthersLocks variable appropriately.
+*/
+static void testThreadLockingBehavior(fd_orig){
+ int fd;
+ struct threadTestData d[2];
+ pthread_t t[2];
+
+ fd = dup(fd_orig);
+ if( fd<0 ) return;
+ memset(d, 0, sizeof(d));
+ d[0].fd = fd;
+ d[0].lock.l_type = F_RDLCK;
+ d[0].lock.l_len = 1;
+ d[0].lock.l_start = 0;
+ d[0].lock.l_whence = SEEK_SET;
+ d[1] = d[0];
+ d[1].lock.l_type = F_WRLCK;
+ pthread_create(&t[0], 0, threadLockingTest, &d[0]);
+ pthread_create(&t[1], 0, threadLockingTest, &d[1]);
+ pthread_join(t[0], 0);
+ pthread_join(t[1], 0);
+ close(fd);
+ threadsOverrideEachOthersLocks = d[0].result==0 && d[1].result==0;
+}
+#endif /* SQLITE_UNIX_THREADS */
+
+/*
+** Release a lockInfo structure previously allocated by findLockInfo().
+*/
+static void releaseLockInfo(struct lockInfo *pLock){
+ pLock->nRef--;
+ if( pLock->nRef==0 ){
+ sqlite3HashInsert(&lockHash, &pLock->key, sizeof(pLock->key), 0);
+ sqliteFree(pLock);
+ }
+}
+
+/*
+** Release a openCnt structure previously allocated by findLockInfo().
+*/
+static void releaseOpenCnt(struct openCnt *pOpen){
+ pOpen->nRef--;
+ if( pOpen->nRef==0 ){
+ sqlite3HashInsert(&openHash, &pOpen->key, sizeof(pOpen->key), 0);
+ sqliteFree(pOpen->aPending);
+ sqliteFree(pOpen);
+ }
+}
+
+/*
+** Given a file descriptor, locate lockInfo and openCnt structures that
+** describes that file descriptor. Create a new ones if necessary. The
+** return values might be unset if an error occurs.
+**
+** Return the number of errors.
+*/
+static int findLockInfo(
+ int fd, /* The file descriptor used in the key */
+ struct lockInfo **ppLock, /* Return the lockInfo structure here */
+ struct openCnt **ppOpen /* Return the openCnt structure here */
+){
+ int rc;
+ struct lockKey key1;
+ struct openKey key2;
+ struct stat statbuf;
+ struct lockInfo *pLock;
+ struct openCnt *pOpen;
+ rc = fstat(fd, &statbuf);
+ if( rc!=0 ) return 1;
+ memset(&key1, 0, sizeof(key1));
+ key1.dev = statbuf.st_dev;
+ key1.ino = statbuf.st_ino;
+#ifdef SQLITE_UNIX_THREADS
+ if( threadsOverrideEachOthersLocks<0 ){
+ testThreadLockingBehavior(fd);
+ }
+ key1.tid = threadsOverrideEachOthersLocks ? 0 : pthread_self();
+#endif
+ memset(&key2, 0, sizeof(key2));
+ key2.dev = statbuf.st_dev;
+ key2.ino = statbuf.st_ino;
+ pLock = (struct lockInfo*)sqlite3HashFind(&lockHash, &key1, sizeof(key1));
+ if( pLock==0 ){
+ struct lockInfo *pOld;
+ pLock = sqliteMallocRaw( sizeof(*pLock) );
+ if( pLock==0 ) return 1;
+ pLock->key = key1;
+ pLock->nRef = 1;
+ pLock->cnt = 0;
+ pLock->locktype = 0;
+ pOld = sqlite3HashInsert(&lockHash, &pLock->key, sizeof(key1), pLock);
+ if( pOld!=0 ){
+ assert( pOld==pLock );
+ sqliteFree(pLock);
+ return 1;
+ }
+ }else{
+ pLock->nRef++;
+ }
+ *ppLock = pLock;
+ pOpen = (struct openCnt*)sqlite3HashFind(&openHash, &key2, sizeof(key2));
+ if( pOpen==0 ){
+ struct openCnt *pOld;
+ pOpen = sqliteMallocRaw( sizeof(*pOpen) );
+ if( pOpen==0 ){
+ releaseLockInfo(pLock);
+ return 1;
+ }
+ pOpen->key = key2;
+ pOpen->nRef = 1;
+ pOpen->nLock = 0;
+ pOpen->nPending = 0;
+ pOpen->aPending = 0;
+ pOld = sqlite3HashInsert(&openHash, &pOpen->key, sizeof(key2), pOpen);
+ if( pOld!=0 ){
+ assert( pOld==pOpen );
+ sqliteFree(pOpen);
+ releaseLockInfo(pLock);
+ return 1;
+ }
+ }else{
+ pOpen->nRef++;
+ }
+ *ppOpen = pOpen;
+ return 0;
+}
+
+/*
+** Delete the named file
+*/
+int sqlite3OsDelete(const char *zFilename){
+ unlink(zFilename);
+ return SQLITE_OK;
+}
+
+/*
+** Return TRUE if the named file exists.
+*/
+int sqlite3OsFileExists(const char *zFilename){
+ return access(zFilename, 0)==0;
+}
+
+/*
+** Attempt to open a file for both reading and writing. If that
+** fails, try opening it read-only. If the file does not exist,
+** try to create it.
+**
+** On success, a handle for the open file is written to *id
+** and *pReadonly is set to 0 if the file was opened for reading and
+** writing or 1 if the file was opened read-only. The function returns
+** SQLITE_OK.
+**
+** On failure, the function returns SQLITE_CANTOPEN and leaves
+** *id and *pReadonly unchanged.
+*/
+int sqlite3OsOpenReadWrite(
+ const char *zFilename,
+ OsFile *id,
+ int *pReadonly
+){
+ int rc;
+ assert( !id->isOpen );
+ id->dirfd = -1;
+ SET_THREADID(id);
+ id->h = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY,
+ SQLITE_DEFAULT_FILE_PERMISSIONS);
+ if( id->h<0 ){
+#ifdef EISDIR
+ if( errno==EISDIR ){
+ return SQLITE_CANTOPEN;
+ }
+#endif
+ id->h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
+ if( id->h<0 ){
+ return SQLITE_CANTOPEN;
+ }
+ *pReadonly = 1;
+ }else{
+ *pReadonly = 0;
+ }
+ sqlite3OsEnterMutex();
+ rc = findLockInfo(id->h, &id->pLock, &id->pOpen);
+ sqlite3OsLeaveMutex();
+ if( rc ){
+ close(id->h);
+ return SQLITE_NOMEM;
+ }
+ id->locktype = 0;
+ id->isOpen = 1;
+ TRACE3("OPEN %-3d %s\n", id->h, zFilename);
+ OpenCounter(+1);
+ return SQLITE_OK;
+}
+
+
+/*
+** Attempt to open a new file for exclusive access by this process.
+** The file will be opened for both reading and writing. To avoid
+** a potential security problem, we do not allow the file to have
+** previously existed. Nor do we allow the file to be a symbolic
+** link.
+**
+** If delFlag is true, then make arrangements to automatically delete
+** the file when it is closed.
+**
+** On success, write the file handle into *id and return SQLITE_OK.
+**
+** On failure, return SQLITE_CANTOPEN.
+*/
+int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
+ int rc;
+ assert( !id->isOpen );
+ if( access(zFilename, 0)==0 ){
+ return SQLITE_CANTOPEN;
+ }
+ SET_THREADID(id);
+ id->dirfd = -1;
+ id->h = open(zFilename,
+ O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_LARGEFILE|O_BINARY,
+ SQLITE_DEFAULT_FILE_PERMISSIONS);
+ if( id->h<0 ){
+ return SQLITE_CANTOPEN;
+ }
+ sqlite3OsEnterMutex();
+ rc = findLockInfo(id->h, &id->pLock, &id->pOpen);
+ sqlite3OsLeaveMutex();
+ if( rc ){
+ close(id->h);
+ unlink(zFilename);
+ return SQLITE_NOMEM;
+ }
+ id->locktype = 0;
+ id->isOpen = 1;
+ if( delFlag ){
+ unlink(zFilename);
+ }
+ TRACE3("OPEN-EX %-3d %s\n", id->h, zFilename);
+ OpenCounter(+1);
+ return SQLITE_OK;
+}
+
+/*
+** Attempt to open a new file for read-only access.
+**
+** On success, write the file handle into *id and return SQLITE_OK.
+**
+** On failure, return SQLITE_CANTOPEN.
+*/
+int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){
+ int rc;
+ assert( !id->isOpen );
+ SET_THREADID(id);
+ id->dirfd = -1;
+ id->h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
+ if( id->h<0 ){
+ return SQLITE_CANTOPEN;
+ }
+ sqlite3OsEnterMutex();
+ rc = findLockInfo(id->h, &id->pLock, &id->pOpen);
+ sqlite3OsLeaveMutex();
+ if( rc ){
+ close(id->h);
+ return SQLITE_NOMEM;
+ }
+ id->locktype = 0;
+ id->isOpen = 1;
+ TRACE3("OPEN-RO %-3d %s\n", id->h, zFilename);
+ OpenCounter(+1);
+ return SQLITE_OK;
+}
+
+/*
+** Attempt to open a file descriptor for the directory that contains a
+** file. This file descriptor can be used to fsync() the directory
+** in order to make sure the creation of a new file is actually written
+** to disk.
+**
+** This routine is only meaningful for Unix. It is a no-op under
+** windows since windows does not support hard links.
+**
+** On success, a handle for a previously open file is at *id is
+** updated with the new directory file descriptor and SQLITE_OK is
+** returned.
+**
+** On failure, the function returns SQLITE_CANTOPEN and leaves
+** *id unchanged.
+*/
+int sqlite3OsOpenDirectory(
+ const char *zDirname,
+ OsFile *id
+){
+ if( !id->isOpen ){
+ /* Do not open the directory if the corresponding file is not already
+ ** open. */
+ return SQLITE_CANTOPEN;
+ }
+ SET_THREADID(id);
+ assert( id->dirfd<0 );
+ id->dirfd = open(zDirname, O_RDONLY|O_BINARY, 0);
+ if( id->dirfd<0 ){
+ return SQLITE_CANTOPEN;
+ }
+ TRACE3("OPENDIR %-3d %s\n", id->dirfd, zDirname);
+ return SQLITE_OK;
+}
+
+/*
+** If the following global variable points to a string which is the
+** name of a directory, then that directory will be used to store
+** temporary files.
+*/
+char *sqlite3_temp_directory = 0;
+
+/*
+** Create a temporary file name in zBuf. zBuf must be big enough to
+** hold at least SQLITE_TEMPNAME_SIZE characters.
+*/
+int sqlite3OsTempFileName(char *zBuf){
+ static const char *azDirs[] = {
+ 0,
+ "/var/tmp",
+ "/usr/tmp",
+ "/tmp",
+ ".",
+ };
+ static const unsigned char zChars[] =
+ "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789";
+ int i, j;
+ struct stat buf;
+ const char *zDir = ".";
+ azDirs[0] = sqlite3_temp_directory;
+ for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){
+ if( azDirs[i]==0 ) continue;
+ if( stat(azDirs[i], &buf) ) continue;
+ if( !S_ISDIR(buf.st_mode) ) continue;
+ if( access(azDirs[i], 07) ) continue;
+ zDir = azDirs[i];
+ break;
+ }
+ do{
+ sprintf(zBuf, "%s/"TEMP_FILE_PREFIX, zDir);
+ j = strlen(zBuf);
+ sqlite3Randomness(15, &zBuf[j]);
+ for(i=0; i<15; i++, j++){
+ zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
+ }
+ zBuf[j] = 0;
+ }while( access(zBuf,0)==0 );
+ return SQLITE_OK;
+}
+
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+/*
+** Check that a given pathname is a directory and is writable
+**
+*/
+int sqlite3OsIsDirWritable(char *zBuf){
+ struct stat buf;
+ if( zBuf==0 ) return 0;
+ if( zBuf[0]==0 ) return 0;
+ if( stat(zBuf, &buf) ) return 0;
+ if( !S_ISDIR(buf.st_mode) ) return 0;
+ if( access(zBuf, 07) ) return 0;
+ return 1;
+}
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
+
+/*
+** Read data from a file into a buffer. Return SQLITE_OK if all
+** bytes were read successfully and SQLITE_IOERR if anything goes
+** wrong.
+*/
+int sqlite3OsRead(OsFile *id, void *pBuf, int amt){
+ int got;
+ assert( id->isOpen );
+ SimulateIOError(SQLITE_IOERR);
+ TIMER_START;
+ got = read(id->h, pBuf, amt);
+ TIMER_END;
+ TRACE5("READ %-3d %5d %7d %d\n", id->h, got, last_page, TIMER_ELAPSED);
+ SEEK(0);
+ /* if( got<0 ) got = 0; */
+ if( got==amt ){
+ return SQLITE_OK;
+ }else{
+ return SQLITE_IOERR;
+ }
+}
+
+/*
+** Write data from a buffer into a file. Return SQLITE_OK on success
+** or some other error code on failure.
+*/
+int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){
+ int wrote = 0;
+ assert( id->isOpen );
+ assert( amt>0 );
+ SimulateIOError(SQLITE_IOERR);
+ SimulateDiskfullError;
+ TIMER_START;
+ while( amt>0 && (wrote = write(id->h, pBuf, amt))>0 ){
+ amt -= wrote;
+ pBuf = &((char*)pBuf)[wrote];
+ }
+ TIMER_END;
+ TRACE5("WRITE %-3d %5d %7d %d\n", id->h, wrote, last_page, TIMER_ELAPSED);
+ SEEK(0);
+ if( amt>0 ){
+ return SQLITE_FULL;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Move the read/write pointer in a file.
+*/
+int sqlite3OsSeek(OsFile *id, i64 offset){
+ assert( id->isOpen );
+ SEEK(offset/1024 + 1);
+#ifdef SQLITE_TEST
+ if( offset ) SimulateDiskfullError
+#endif
+ lseek(id->h, offset, SEEK_SET);
+ return SQLITE_OK;
+}
+
+#ifdef SQLITE_TEST
+/*
+** Count the number of fullsyncs and normal syncs. This is used to test
+** that syncs and fullsyncs are occuring at the right times.
+*/
+int sqlite3_sync_count = 0;
+int sqlite3_fullsync_count = 0;
+#endif
+
+
+/*
+** The fsync() system call does not work as advertised on many
+** unix systems. The following procedure is an attempt to make
+** it work better.
+**
+** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful
+** for testing when we want to run through the test suite quickly.
+** You are strongly advised *not* to deploy with SQLITE_NO_SYNC
+** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash
+** or power failure will likely corrupt the database file.
+*/
+static int full_fsync(int fd, int fullSync, int dataOnly){
+ int rc;
+
+ /* Record the number of times that we do a normal fsync() and
+ ** FULLSYNC. This is used during testing to verify that this procedure
+ ** gets called with the correct arguments.
+ */
+#ifdef SQLITE_TEST
+ if( fullSync ) sqlite3_fullsync_count++;
+ sqlite3_sync_count++;
+#endif
+
+ /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a
+ ** no-op
+ */
+#ifdef SQLITE_NO_SYNC
+ rc = SQLITE_OK;
+#else
+
+#ifdef F_FULLFSYNC
+ if( fullSync ){
+ rc = fcntl(fd, F_FULLFSYNC, 0);
+ }else{
+ rc = 1;
+ }
+ /* If the FULLSYNC failed, try to do a normal fsync() */
+ if( rc ) rc = fsync(fd);
+
+#else /* if !defined(F_FULLSYNC) */
+#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO>0
+ if( dataOnly ){
+ rc = fdatasync(fd);
+ }else
+#endif /* _POSIX_SYNCHRONIZED_IO > 0 */
+ {
+ rc = fsync(fd);
+ }
+#endif /* defined(F_FULLFSYNC) */
+#endif /* defined(SQLITE_NO_SYNC) */
+
+ return rc;
+}
+
+/*
+** Make sure all writes to a particular file are committed to disk.
+**
+** If dataOnly==0 then both the file itself and its metadata (file
+** size, access time, etc) are synced. If dataOnly!=0 then only the
+** file data is synced.
+**
+** Under Unix, also make sure that the directory entry for the file
+** has been created by fsync-ing the directory that contains the file.
+** If we do not do this and we encounter a power failure, the directory
+** entry for the journal might not exist after we reboot. The next
+** SQLite to access the file will not know that the journal exists (because
+** the directory entry for the journal was never created) and the transaction
+** will not roll back - possibly leading to database corruption.
+*/
+int sqlite3OsSync(OsFile *id, int dataOnly){
+ assert( id->isOpen );
+ SimulateIOError(SQLITE_IOERR);
+ TRACE2("SYNC %-3d\n", id->h);
+ if( full_fsync(id->h, id->fullSync, dataOnly) ){
+ return SQLITE_IOERR;
+ }
+ if( id->dirfd>=0 ){
+ TRACE2("DIRSYNC %-3d\n", id->dirfd);
+ full_fsync(id->dirfd, id->fullSync, 0);
+ close(id->dirfd); /* Only need to sync once, so close the directory */
+ id->dirfd = -1; /* when we are done. */
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Sync the directory zDirname. This is a no-op on operating systems other
+** than UNIX.
+**
+** This is used to make sure the master journal file has truely been deleted
+** before making changes to individual journals on a multi-database commit.
+** The F_FULLFSYNC option is not needed here.
+*/
+int sqlite3OsSyncDirectory(const char *zDirname){
+ int fd;
+ int r;
+ SimulateIOError(SQLITE_IOERR);
+ fd = open(zDirname, O_RDONLY|O_BINARY, 0);
+ TRACE3("DIRSYNC %-3d (%s)\n", fd, zDirname);
+ if( fd<0 ){
+ return SQLITE_CANTOPEN;
+ }
+ r = fsync(fd);
+ close(fd);
+ return ((r==0)?SQLITE_OK:SQLITE_IOERR);
+}
+
+/*
+** Truncate an open file to a specified size
+*/
+int sqlite3OsTruncate(OsFile *id, i64 nByte){
+ assert( id->isOpen );
+ SimulateIOError(SQLITE_IOERR);
+ return ftruncate(id->h, nByte)==0 ? SQLITE_OK : SQLITE_IOERR;
+}
+
+/*
+** Determine the current size of a file in bytes
+*/
+int sqlite3OsFileSize(OsFile *id, i64 *pSize){
+ struct stat buf;
+ assert( id->isOpen );
+ SimulateIOError(SQLITE_IOERR);
+ if( fstat(id->h, &buf)!=0 ){
+ return SQLITE_IOERR;
+ }
+ *pSize = buf.st_size;
+ return SQLITE_OK;
+}
+
+/*
+** This routine checks if there is a RESERVED lock held on the specified
+** file by this or any other process. If such a lock is held, return
+** non-zero. If the file is unlocked or holds only SHARED locks, then
+** return zero.
+*/
+int sqlite3OsCheckReservedLock(OsFile *id){
+ int r = 0;
+
+ assert( id->isOpen );
+ if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
+ sqlite3OsEnterMutex(); /* Needed because id->pLock is shared across threads */
+
+ /* Check if a thread in this process holds such a lock */
+ if( id->pLock->locktype>SHARED_LOCK ){
+ r = 1;
+ }
+
+ /* Otherwise see if some other process holds it.
+ */
+ if( !r ){
+ struct flock lock;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = RESERVED_BYTE;
+ lock.l_len = 1;
+ lock.l_type = F_WRLCK;
+ fcntl(id->h, F_GETLK, &lock);
+ if( lock.l_type!=F_UNLCK ){
+ r = 1;
+ }
+ }
+
+ sqlite3OsLeaveMutex();
+ TRACE3("TEST WR-LOCK %d %d\n", id->h, r);
+
+ return r;
+}
+
+#ifdef SQLITE_DEBUG
+/*
+** Helper function for printing out trace information from debugging
+** binaries. This returns the string represetation of the supplied
+** integer lock-type.
+*/
+static const char * locktypeName(int locktype){
+ switch( locktype ){
+ case NO_LOCK: return "NONE";
+ case SHARED_LOCK: return "SHARED";
+ case RESERVED_LOCK: return "RESERVED";
+ case PENDING_LOCK: return "PENDING";
+ case EXCLUSIVE_LOCK: return "EXCLUSIVE";
+ }
+ return "ERROR";
+}
+#endif
+
+/*
+** Lock the file with the lock specified by parameter locktype - one
+** of the following:
+**
+** (1) SHARED_LOCK
+** (2) RESERVED_LOCK
+** (3) PENDING_LOCK
+** (4) EXCLUSIVE_LOCK
+**
+** Sometimes when requesting one lock state, additional lock states
+** are inserted in between. The locking might fail on one of the later
+** transitions leaving the lock state different from what it started but
+** still short of its goal. The following chart shows the allowed
+** transitions and the inserted intermediate states:
+**
+** UNLOCKED -> SHARED
+** SHARED -> RESERVED
+** SHARED -> (PENDING) -> EXCLUSIVE
+** RESERVED -> (PENDING) -> EXCLUSIVE
+** PENDING -> EXCLUSIVE
+**
+** This routine will only increase a lock. Use the sqlite3OsUnlock()
+** routine to lower a locking level.
+*/
+int sqlite3OsLock(OsFile *id, int locktype){
+ /* The following describes the implementation of the various locks and
+ ** lock transitions in terms of the POSIX advisory shared and exclusive
+ ** lock primitives (called read-locks and write-locks below, to avoid
+ ** confusion with SQLite lock names). The algorithms are complicated
+ ** slightly in order to be compatible with windows systems simultaneously
+ ** accessing the same database file, in case that is ever required.
+ **
+ ** Symbols defined in os.h indentify the 'pending byte' and the 'reserved
+ ** byte', each single bytes at well known offsets, and the 'shared byte
+ ** range', a range of 510 bytes at a well known offset.
+ **
+ ** To obtain a SHARED lock, a read-lock is obtained on the 'pending
+ ** byte'. If this is successful, a random byte from the 'shared byte
+ ** range' is read-locked and the lock on the 'pending byte' released.
+ **
+ ** A process may only obtain a RESERVED lock after it has a SHARED lock.
+ ** A RESERVED lock is implemented by grabbing a write-lock on the
+ ** 'reserved byte'.
+ **
+ ** A process may only obtain a PENDING lock after it has obtained a
+ ** SHARED lock. A PENDING lock is implemented by obtaining a write-lock
+ ** on the 'pending byte'. This ensures that no new SHARED locks can be
+ ** obtained, but existing SHARED locks are allowed to persist. A process
+ ** does not have to obtain a RESERVED lock on the way to a PENDING lock.
+ ** This property is used by the algorithm for rolling back a journal file
+ ** after a crash.
+ **
+ ** An EXCLUSIVE lock, obtained after a PENDING lock is held, is
+ ** implemented by obtaining a write-lock on the entire 'shared byte
+ ** range'. Since all other locks require a read-lock on one of the bytes
+ ** within this range, this ensures that no other locks are held on the
+ ** database.
+ **
+ ** The reason a single byte cannot be used instead of the 'shared byte
+ ** range' is that some versions of windows do not support read-locks. By
+ ** locking a random byte from a range, concurrent SHARED locks may exist
+ ** even if the locking primitive used is always a write-lock.
+ */
+ int rc = SQLITE_OK;
+ struct lockInfo *pLock = id->pLock;
+ struct flock lock;
+ int s;
+
+ assert( id->isOpen );
+ TRACE7("LOCK %d %s was %s(%s,%d) pid=%d\n", id->h, locktypeName(locktype),
+ locktypeName(id->locktype), locktypeName(pLock->locktype), pLock->cnt
+ ,getpid() );
+ if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
+
+ /* If there is already a lock of this type or more restrictive on the
+ ** OsFile, do nothing. Don't use the end_lock: exit path, as
+ ** sqlite3OsEnterMutex() hasn't been called yet.
+ */
+ if( id->locktype>=locktype ){
+ TRACE3("LOCK %d %s ok (already held)\n", id->h, locktypeName(locktype));
+ return SQLITE_OK;
+ }
+
+ /* Make sure the locking sequence is correct
+ */
+ assert( id->locktype!=NO_LOCK || locktype==SHARED_LOCK );
+ assert( locktype!=PENDING_LOCK );
+ assert( locktype!=RESERVED_LOCK || id->locktype==SHARED_LOCK );
+
+ /* This mutex is needed because id->pLock is shared across threads
+ */
+ sqlite3OsEnterMutex();
+
+ /* If some thread using this PID has a lock via a different OsFile*
+ ** handle that precludes the requested lock, return BUSY.
+ */
+ if( (id->locktype!=pLock->locktype &&
+ (pLock->locktype>=PENDING_LOCK || locktype>SHARED_LOCK))
+ ){
+ rc = SQLITE_BUSY;
+ goto end_lock;
+ }
+
+ /* If a SHARED lock is requested, and some thread using this PID already
+ ** has a SHARED or RESERVED lock, then increment reference counts and
+ ** return SQLITE_OK.
+ */
+ if( locktype==SHARED_LOCK &&
+ (pLock->locktype==SHARED_LOCK || pLock->locktype==RESERVED_LOCK) ){
+ assert( locktype==SHARED_LOCK );
+ assert( id->locktype==0 );
+ assert( pLock->cnt>0 );
+ id->locktype = SHARED_LOCK;
+ pLock->cnt++;
+ id->pOpen->nLock++;
+ goto end_lock;
+ }
+
+ lock.l_len = 1L;
+
+ lock.l_whence = SEEK_SET;
+
+ /* A PENDING lock is needed before acquiring a SHARED lock and before
+ ** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will
+ ** be released.
+ */
+ if( locktype==SHARED_LOCK
+ || (locktype==EXCLUSIVE_LOCK && id->locktype<PENDING_LOCK)
+ ){
+ lock.l_type = (locktype==SHARED_LOCK?F_RDLCK:F_WRLCK);
+ lock.l_start = PENDING_BYTE;
+ s = fcntl(id->h, F_SETLK, &lock);
+ if( s ){
+ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY;
+ goto end_lock;
+ }
+ }
+
+
+ /* If control gets to this point, then actually go ahead and make
+ ** operating system calls for the specified lock.
+ */
+ if( locktype==SHARED_LOCK ){
+ assert( pLock->cnt==0 );
+ assert( pLock->locktype==0 );
+
+ /* Now get the read-lock */
+ lock.l_start = SHARED_FIRST;
+ lock.l_len = SHARED_SIZE;
+ s = fcntl(id->h, F_SETLK, &lock);
+
+ /* Drop the temporary PENDING lock */
+ lock.l_start = PENDING_BYTE;
+ lock.l_len = 1L;
+ lock.l_type = F_UNLCK;
+ if( fcntl(id->h, F_SETLK, &lock)!=0 ){
+ rc = SQLITE_IOERR; /* This should never happen */
+ goto end_lock;
+ }
+ if( s ){
+ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY;
+ }else{
+ id->locktype = SHARED_LOCK;
+ id->pOpen->nLock++;
+ pLock->cnt = 1;
+ }
+ }else if( locktype==EXCLUSIVE_LOCK && pLock->cnt>1 ){
+ /* We are trying for an exclusive lock but another thread in this
+ ** same process is still holding a shared lock. */
+ rc = SQLITE_BUSY;
+ }else{
+ /* The request was for a RESERVED or EXCLUSIVE lock. It is
+ ** assumed that there is a SHARED or greater lock on the file
+ ** already.
+ */
+ assert( 0!=id->locktype );
+ lock.l_type = F_WRLCK;
+ switch( locktype ){
+ case RESERVED_LOCK:
+ lock.l_start = RESERVED_BYTE;
+ break;
+ case EXCLUSIVE_LOCK:
+ lock.l_start = SHARED_FIRST;
+ lock.l_len = SHARED_SIZE;
+ break;
+ default:
+ assert(0);
+ }
+ s = fcntl(id->h, F_SETLK, &lock);
+ if( s ){
+ rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY;
+ }
+ }
+
+ if( rc==SQLITE_OK ){
+ id->locktype = locktype;
+ pLock->locktype = locktype;
+ }else if( locktype==EXCLUSIVE_LOCK ){
+ id->locktype = PENDING_LOCK;
+ pLock->locktype = PENDING_LOCK;
+ }
+
+end_lock:
+ sqlite3OsLeaveMutex();
+ TRACE4("LOCK %d %s %s\n", id->h, locktypeName(locktype),
+ rc==SQLITE_OK ? "ok" : "failed");
+ return rc;
+}
+
+/*
+** Lower the locking level on file descriptor id to locktype. locktype
+** must be either NO_LOCK or SHARED_LOCK.
+**
+** If the locking level of the file descriptor is already at or below
+** the requested locking level, this routine is a no-op.
+**
+** It is not possible for this routine to fail if the second argument
+** is NO_LOCK. If the second argument is SHARED_LOCK, this routine
+** might return SQLITE_IOERR instead of SQLITE_OK.
+*/
+int sqlite3OsUnlock(OsFile *id, int locktype){
+ struct lockInfo *pLock;
+ struct flock lock;
+ int rc = SQLITE_OK;
+
+ assert( id->isOpen );
+ TRACE7("UNLOCK %d %d was %d(%d,%d) pid=%d\n", id->h, locktype, id->locktype,
+ id->pLock->locktype, id->pLock->cnt, getpid());
+ if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
+
+ assert( locktype<=SHARED_LOCK );
+ if( id->locktype<=locktype ){
+ return SQLITE_OK;
+ }
+ sqlite3OsEnterMutex();
+ pLock = id->pLock;
+ assert( pLock->cnt!=0 );
+ if( id->locktype>SHARED_LOCK ){
+ assert( pLock->locktype==id->locktype );
+ if( locktype==SHARED_LOCK ){
+ lock.l_type = F_RDLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = SHARED_FIRST;
+ lock.l_len = SHARED_SIZE;
+ if( fcntl(id->h, F_SETLK, &lock)!=0 ){
+ /* This should never happen */
+ rc = SQLITE_IOERR;
+ }
+ }
+ lock.l_type = F_UNLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = PENDING_BYTE;
+ lock.l_len = 2L; assert( PENDING_BYTE+1==RESERVED_BYTE );
+ if( fcntl(id->h, F_SETLK, &lock)==0 ){
+ pLock->locktype = SHARED_LOCK;
+ }else{
+ rc = SQLITE_IOERR; /* This should never happen */
+ }
+ }
+ if( locktype==NO_LOCK ){
+ struct openCnt *pOpen;
+
+ /* Decrement the shared lock counter. Release the lock using an
+ ** OS call only when all threads in this same process have released
+ ** the lock.
+ */
+ pLock->cnt--;
+ if( pLock->cnt==0 ){
+ lock.l_type = F_UNLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = lock.l_len = 0L;
+ if( fcntl(id->h, F_SETLK, &lock)==0 ){
+ pLock->locktype = NO_LOCK;
+ }else{
+ rc = SQLITE_IOERR; /* This should never happen */
+ }
+ }
+
+ /* Decrement the count of locks against this same file. When the
+ ** count reaches zero, close any other file descriptors whose close
+ ** was deferred because of outstanding locks.
+ */
+ pOpen = id->pOpen;
+ pOpen->nLock--;
+ assert( pOpen->nLock>=0 );
+ if( pOpen->nLock==0 && pOpen->nPending>0 ){
+ int i;
+ for(i=0; i<pOpen->nPending; i++){
+ close(pOpen->aPending[i]);
+ }
+ sqliteFree(pOpen->aPending);
+ pOpen->nPending = 0;
+ pOpen->aPending = 0;
+ }
+ }
+ sqlite3OsLeaveMutex();
+ id->locktype = locktype;
+ return rc;
+}
+
+/*
+** Close a file.
+*/
+int sqlite3OsClose(OsFile *id){
+ if( !id->isOpen ) return SQLITE_OK;
+ if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
+ sqlite3OsUnlock(id, NO_LOCK);
+ if( id->dirfd>=0 ) close(id->dirfd);
+ id->dirfd = -1;
+ sqlite3OsEnterMutex();
+ if( id->pOpen->nLock ){
+ /* If there are outstanding locks, do not actually close the file just
+ ** yet because that would clear those locks. Instead, add the file
+ ** descriptor to pOpen->aPending. It will be automatically closed when
+ ** the last lock is cleared.
+ */
+ int *aNew;
+ struct openCnt *pOpen = id->pOpen;
+ aNew = sqliteRealloc( pOpen->aPending, (pOpen->nPending+1)*sizeof(int) );
+ if( aNew==0 ){
+ /* If a malloc fails, just leak the file descriptor */
+ }else{
+ pOpen->aPending = aNew;
+ pOpen->aPending[pOpen->nPending] = id->h;
+ pOpen->nPending++;
+ }
+ }else{
+ /* There are no outstanding locks so we can close the file immediately */
+ close(id->h);
+ }
+ releaseLockInfo(id->pLock);
+ releaseOpenCnt(id->pOpen);
+ sqlite3OsLeaveMutex();
+ id->isOpen = 0;
+ TRACE2("CLOSE %-3d\n", id->h);
+ OpenCounter(-1);
+ return SQLITE_OK;
+}
+
+/*
+** Turn a relative pathname into a full pathname. Return a pointer
+** to the full pathname stored in space obtained from sqliteMalloc().
+** The calling function is responsible for freeing this space once it
+** is no longer needed.
+*/
+char *sqlite3OsFullPathname(const char *zRelative){
+ char *zFull = 0;
+ if( zRelative[0]=='/' ){
+ sqlite3SetString(&zFull, zRelative, (char*)0);
+ }else{
+ char *zBuf = sqliteMalloc(5000);
+ if( zBuf==0 ){
+ return 0;
+ }
+ zBuf[0] = 0;
+ sqlite3SetString(&zFull, getcwd(zBuf, 5000), "/", zRelative,
+ (char*)0);
+ sqliteFree(zBuf);
+ }
+ return zFull;
+}
+
+
+#endif /* SQLITE_OMIT_DISKIO */
+/***************************************************************************
+** Everything above deals with file I/O. Everything that follows deals
+** with other miscellanous aspects of the operating system interface
+****************************************************************************/
+
+
+/*
+** Get information to seed the random number generator. The seed
+** is written into the buffer zBuf[256]. The calling function must
+** supply a sufficiently large buffer.
+*/
+int sqlite3OsRandomSeed(char *zBuf){
+ /* We have to initialize zBuf to prevent valgrind from reporting
+ ** errors. The reports issued by valgrind are incorrect - we would
+ ** prefer that the randomness be increased by making use of the
+ ** uninitialized space in zBuf - but valgrind errors tend to worry
+ ** some users. Rather than argue, it seems easier just to initialize
+ ** the whole array and silence valgrind, even if that means less randomness
+ ** in the random seed.
+ **
+ ** When testing, initializing zBuf[] to zero is all we do. That means
+ ** that we always use the same random number sequence.* This makes the
+ ** tests repeatable.
+ */
+ memset(zBuf, 0, 256);
+#if !defined(SQLITE_TEST)
+ {
+ int pid, fd;
+ fd = open("/dev/urandom", O_RDONLY);
+ if( fd<0 ){
+ time((time_t*)zBuf);
+ pid = getpid();
+ memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));
+ }else{
+ read(fd, zBuf, 256);
+ close(fd);
+ }
+ }
+#endif
+ return SQLITE_OK;
+}
+
+/*
+** Sleep for a little while. Return the amount of time slept.
+*/
+int sqlite3OsSleep(int ms){
+#if defined(HAVE_USLEEP) && HAVE_USLEEP
+ usleep(ms*1000);
+ return ms;
+#else
+ sleep((ms+999)/1000);
+ return 1000*((ms+999)/1000);
+#endif
+}
+
+/*
+** Static variables used for thread synchronization
+*/
+static int inMutex = 0;
+#ifdef SQLITE_UNIX_THREADS
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+/*
+** The following pair of routine implement mutual exclusion for
+** multi-threaded processes. Only a single thread is allowed to
+** executed code that is surrounded by EnterMutex() and LeaveMutex().
+**
+** SQLite uses only a single Mutex. There is not much critical
+** code and what little there is executes quickly and without blocking.
+*/
+void sqlite3OsEnterMutex(){
+#ifdef SQLITE_UNIX_THREADS
+ pthread_mutex_lock(&mutex);
+#endif
+ assert( !inMutex );
+ inMutex = 1;
+}
+void sqlite3OsLeaveMutex(){
+ assert( inMutex );
+ inMutex = 0;
+#ifdef SQLITE_UNIX_THREADS
+ pthread_mutex_unlock(&mutex);
+#endif
+}
+
+/*
+** The following variable, if set to a non-zero value, becomes the result
+** returned from sqlite3OsCurrentTime(). This is used for testing.
+*/
+#ifdef SQLITE_TEST
+int sqlite3_current_time = 0;
+#endif
+
+/*
+** Find the current time (in Universal Coordinated Time). Write the
+** current time and date as a Julian Day number into *prNow and
+** return 0. Return 1 if the time and date cannot be found.
+*/
+int sqlite3OsCurrentTime(double *prNow){
+#ifdef NO_GETTOD
+ time_t t;
+ time(&t);
+ *prNow = t/86400.0 + 2440587.5;
+#else
+ struct timeval sNow;
+ struct timezone sTz; /* Not used */
+ gettimeofday(&sNow, &sTz);
+ *prNow = 2440587.5 + sNow.tv_sec/86400.0 + sNow.tv_usec/86400000000.0;
+#endif
+#ifdef SQLITE_TEST
+ if( sqlite3_current_time ){
+ *prNow = sqlite3_current_time/86400.0 + 2440587.5;
+ }
+#endif
+ return 0;
+}
+
+#endif /* OS_UNIX */
diff --git a/ext/pdo_sqlite/sqlite/src/os_unix.h b/ext/pdo_sqlite/sqlite/src/os_unix.h
new file mode 100644
index 000000000..5fdfc2ff4
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os_unix.h
@@ -0,0 +1,116 @@
+/*
+** 2004 May 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This header file defined OS-specific features for Unix.
+*/
+#ifndef _SQLITE_OS_UNIX_H_
+#define _SQLITE_OS_UNIX_H_
+
+/*
+** Helpful hint: To get this to compile on HP/UX, add -D_INCLUDE_POSIX_SOURCE
+** to the compiler command line.
+*/
+
+/*
+** These #defines should enable >2GB file support on Posix if the
+** underlying operating system supports it. If the OS lacks
+** large file support, or if the OS is windows, these should be no-ops.
+**
+** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
+** on the compiler command line. This is necessary if you are compiling
+** on a recent machine (ex: RedHat 7.2) but you want your code to work
+** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2
+** without this option, LFS is enable. But LFS does not exist in the kernel
+** in RedHat 6.0, so the code won't work. Hence, for maximum binary
+** portability you should omit LFS.
+**
+** Similar is true for MacOS. LFS is only supported on MacOS 9 and later.
+*/
+#ifndef SQLITE_DISABLE_LFS
+# define _LARGE_FILE 1
+# ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
+# endif
+# define _LARGEFILE_SOURCE 1
+#endif
+
+/*
+** standard include files.
+*/
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/*
+** Macros used to determine whether or not to use threads. The
+** SQLITE_UNIX_THREADS macro is defined if we are synchronizing for
+** Posix threads and SQLITE_W32_THREADS is defined if we are
+** synchronizing using Win32 threads.
+*/
+#if defined(THREADSAFE) && THREADSAFE
+# include <pthread.h>
+# define SQLITE_UNIX_THREADS 1
+#endif
+
+/*
+** The OsFile structure is a operating-system independing representation
+** of an open file handle. It is defined differently for each architecture.
+**
+** This is the definition for Unix.
+**
+** OsFile.locktype takes one of the values SHARED_LOCK, RESERVED_LOCK,
+** PENDING_LOCK or EXCLUSIVE_LOCK.
+*/
+typedef struct OsFile OsFile;
+struct OsFile {
+ struct Pager *pPager; /* The pager that owns this OsFile. Might be 0 */
+ struct openCnt *pOpen; /* Info about all open fd's on this inode */
+ struct lockInfo *pLock; /* Info about locks on this inode */
+ int h; /* The file descriptor */
+ unsigned char locktype; /* The type of lock held on this fd */
+ unsigned char isOpen; /* True if needs to be closed */
+ unsigned char fullSync; /* Use F_FULLSYNC if available */
+ int dirfd; /* File descriptor for the directory */
+#ifdef SQLITE_UNIX_THREADS
+ pthread_t tid; /* The thread authorized to use this OsFile */
+#endif
+};
+
+/*
+** A macro to set the OsFile.fullSync flag, if it exists.
+*/
+#define SET_FULLSYNC(x,y) ((x).fullSync = (y))
+
+/*
+** Maximum number of characters in a temporary file name
+*/
+#define SQLITE_TEMPNAME_SIZE 200
+
+/*
+** Minimum interval supported by sqlite3OsSleep().
+*/
+#if defined(HAVE_USLEEP) && HAVE_USLEEP
+# define SQLITE_MIN_SLEEP_MS 1
+#else
+# define SQLITE_MIN_SLEEP_MS 1000
+#endif
+
+/*
+** Default permissions when creating a new file
+*/
+#ifndef SQLITE_DEFAULT_FILE_PERMISSIONS
+# define SQLITE_DEFAULT_FILE_PERMISSIONS 0644
+#endif
+
+
+#endif /* _SQLITE_OS_UNIX_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/os_win.c b/ext/pdo_sqlite/sqlite/src/os_win.c
new file mode 100644
index 000000000..ad874ae63
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os_win.c
@@ -0,0 +1,940 @@
+/*
+** 2004 May 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This file contains code that is specific to windows.
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#if OS_WIN /* This file is used for windows only */
+
+#include <winbase.h>
+
+#ifdef __CYGWIN__
+# include <sys/cygwin.h>
+#endif
+
+/*
+** Macros used to determine whether or not to use threads.
+*/
+#if defined(THREADSAFE) && THREADSAFE
+# define SQLITE_W32_THREADS 1
+#endif
+
+/*
+** Include code that is common to all os_*.c files
+*/
+#include "os_common.h"
+
+/*
+** Do not include any of the File I/O interface procedures if the
+** SQLITE_OMIT_DISKIO macro is defined (indicating that there database
+** will be in-memory only)
+*/
+#ifndef SQLITE_OMIT_DISKIO
+
+/*
+** The following variable is (normally) set once and never changes
+** thereafter. It records whether the operating system is Win95
+** or WinNT.
+**
+** 0: Operating system unknown.
+** 1: Operating system is Win95.
+** 2: Operating system is WinNT.
+**
+** In order to facilitate testing on a WinNT system, the test fixture
+** can manually set this value to 1 to emulate Win98 behavior.
+*/
+int sqlite3_os_type = 0;
+
+/*
+** Return true (non-zero) if we are running under WinNT, Win2K or WinXP.
+** Return false (zero) for Win95, Win98, or WinME.
+**
+** Here is an interesting observation: Win95, Win98, and WinME lack
+** the LockFileEx() API. But we can still statically link against that
+** API as long as we don't call it win running Win95/98/ME. A call to
+** this routine is used to determine if the host is Win95/98/ME or
+** WinNT/2K/XP so that we will know whether or not we can safely call
+** the LockFileEx() API.
+*/
+static int isNT(void){
+ if( sqlite3_os_type==0 ){
+ OSVERSIONINFO sInfo;
+ sInfo.dwOSVersionInfoSize = sizeof(sInfo);
+ GetVersionEx(&sInfo);
+ sqlite3_os_type = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT ? 2 : 1;
+ }
+ return sqlite3_os_type==2;
+}
+
+/*
+** Convert a UTF-8 string to UTF-32. Space to hold the returned string
+** is obtained from sqliteMalloc.
+*/
+static WCHAR *utf8ToUnicode(const char *zFilename){
+ int nByte;
+ WCHAR *zWideFilename;
+
+ if( !isNT() ){
+ return 0;
+ }
+ nByte = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0)*sizeof(WCHAR);
+ zWideFilename = sqliteMalloc( nByte*sizeof(zWideFilename[0]) );
+ if( zWideFilename==0 ){
+ return 0;
+ }
+ nByte = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, zWideFilename, nByte);
+ if( nByte==0 ){
+ sqliteFree(zWideFilename);
+ zWideFilename = 0;
+ }
+ return zWideFilename;
+}
+
+/*
+** Convert UTF-32 to UTF-8. Space to hold the returned string is
+** obtained from sqliteMalloc().
+*/
+static char *unicodeToUtf8(const WCHAR *zWideFilename){
+ int nByte;
+ char *zFilename;
+
+ nByte = WideCharToMultiByte(CP_UTF8, 0, zWideFilename, -1, 0, 0, 0, 0);
+ zFilename = sqliteMalloc( nByte );
+ if( zFilename==0 ){
+ return 0;
+ }
+ nByte = WideCharToMultiByte(CP_UTF8, 0, zWideFilename, -1, zFilename, nByte,
+ 0, 0);
+ if( nByte == 0 ){
+ sqliteFree(zFilename);
+ zFilename = 0;
+ }
+ return zFilename;
+}
+
+
+/*
+** Delete the named file
+*/
+int sqlite3OsDelete(const char *zFilename){
+ WCHAR *zWide = utf8ToUnicode(zFilename);
+ if( zWide ){
+ DeleteFileW(zWide);
+ sqliteFree(zWide);
+ }else{
+ DeleteFileA(zFilename);
+ }
+ TRACE2("DELETE \"%s\"\n", zFilename);
+ return SQLITE_OK;
+}
+
+/*
+** Return TRUE if the named file exists.
+*/
+int sqlite3OsFileExists(const char *zFilename){
+ int exists = 0;
+ WCHAR *zWide = utf8ToUnicode(zFilename);
+ if( zWide ){
+ exists = GetFileAttributesW(zWide) != 0xffffffff;
+ sqliteFree(zWide);
+ }else{
+ exists = GetFileAttributesA(zFilename) != 0xffffffff;
+ }
+ return exists;
+}
+
+/*
+** Attempt to open a file for both reading and writing. If that
+** fails, try opening it read-only. If the file does not exist,
+** try to create it.
+**
+** On success, a handle for the open file is written to *id
+** and *pReadonly is set to 0 if the file was opened for reading and
+** writing or 1 if the file was opened read-only. The function returns
+** SQLITE_OK.
+**
+** On failure, the function returns SQLITE_CANTOPEN and leaves
+** *id and *pReadonly unchanged.
+*/
+int sqlite3OsOpenReadWrite(
+ const char *zFilename,
+ OsFile *id,
+ int *pReadonly
+){
+ HANDLE h;
+ WCHAR *zWide = utf8ToUnicode(zFilename);
+ assert( !id->isOpen );
+ if( zWide ){
+ h = CreateFileW(zWide,
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
+ NULL
+ );
+ if( h==INVALID_HANDLE_VALUE ){
+ h = CreateFileW(zWide,
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
+ NULL
+ );
+ if( h==INVALID_HANDLE_VALUE ){
+ sqliteFree(zWide);
+ return SQLITE_CANTOPEN;
+ }
+ *pReadonly = 1;
+ }else{
+ *pReadonly = 0;
+ }
+ sqliteFree(zWide);
+ }else{
+ h = CreateFileA(zFilename,
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
+ NULL
+ );
+ if( h==INVALID_HANDLE_VALUE ){
+ h = CreateFileA(zFilename,
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
+ NULL
+ );
+ if( h==INVALID_HANDLE_VALUE ){
+ return SQLITE_CANTOPEN;
+ }
+ *pReadonly = 1;
+ }else{
+ *pReadonly = 0;
+ }
+ }
+ id->h = h;
+ id->locktype = NO_LOCK;
+ id->sharedLockByte = 0;
+ id->isOpen = 1;
+ OpenCounter(+1);
+ TRACE3("OPEN R/W %d \"%s\"\n", h, zFilename);
+ return SQLITE_OK;
+}
+
+
+/*
+** Attempt to open a new file for exclusive access by this process.
+** The file will be opened for both reading and writing. To avoid
+** a potential security problem, we do not allow the file to have
+** previously existed. Nor do we allow the file to be a symbolic
+** link.
+**
+** If delFlag is true, then make arrangements to automatically delete
+** the file when it is closed.
+**
+** On success, write the file handle into *id and return SQLITE_OK.
+**
+** On failure, return SQLITE_CANTOPEN.
+*/
+int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
+ HANDLE h;
+ int fileflags;
+ WCHAR *zWide = utf8ToUnicode(zFilename);
+ assert( !id->isOpen );
+ if( delFlag ){
+ fileflags = FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_RANDOM_ACCESS
+ | FILE_FLAG_DELETE_ON_CLOSE;
+ }else{
+ fileflags = FILE_FLAG_RANDOM_ACCESS;
+ }
+ if( zWide ){
+ h = CreateFileW(zWide,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ fileflags,
+ NULL
+ );
+ sqliteFree(zWide);
+ }else{
+ h = CreateFileA(zFilename,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ fileflags,
+ NULL
+ );
+ }
+ if( h==INVALID_HANDLE_VALUE ){
+ return SQLITE_CANTOPEN;
+ }
+ id->h = h;
+ id->locktype = NO_LOCK;
+ id->sharedLockByte = 0;
+ id->isOpen = 1;
+ OpenCounter(+1);
+ TRACE3("OPEN EX %d \"%s\"\n", h, zFilename);
+ return SQLITE_OK;
+}
+
+/*
+** Attempt to open a new file for read-only access.
+**
+** On success, write the file handle into *id and return SQLITE_OK.
+**
+** On failure, return SQLITE_CANTOPEN.
+*/
+int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){
+ HANDLE h;
+ WCHAR *zWide = utf8ToUnicode(zFilename);
+ assert( !id->isOpen );
+ if( zWide ){
+ h = CreateFileW(zWide,
+ GENERIC_READ,
+ 0,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
+ NULL
+ );
+ sqliteFree(zWide);
+ }else{
+ h = CreateFileA(zFilename,
+ GENERIC_READ,
+ 0,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
+ NULL
+ );
+ }
+ if( h==INVALID_HANDLE_VALUE ){
+ return SQLITE_CANTOPEN;
+ }
+ id->h = h;
+ id->locktype = NO_LOCK;
+ id->sharedLockByte = 0;
+ id->isOpen = 1;
+ OpenCounter(+1);
+ TRACE3("OPEN RO %d \"%s\"\n", h, zFilename);
+ return SQLITE_OK;
+}
+
+/*
+** Attempt to open a file descriptor for the directory that contains a
+** file. This file descriptor can be used to fsync() the directory
+** in order to make sure the creation of a new file is actually written
+** to disk.
+**
+** This routine is only meaningful for Unix. It is a no-op under
+** windows since windows does not support hard links.
+**
+** On success, a handle for a previously open file is at *id is
+** updated with the new directory file descriptor and SQLITE_OK is
+** returned.
+**
+** On failure, the function returns SQLITE_CANTOPEN and leaves
+** *id unchanged.
+*/
+int sqlite3OsOpenDirectory(
+ const char *zDirname,
+ OsFile *id
+){
+ return SQLITE_OK;
+}
+
+/*
+** If the following global variable points to a string which is the
+** name of a directory, then that directory will be used to store
+** temporary files.
+*/
+char *sqlite3_temp_directory = 0;
+
+/*
+** Create a temporary file name in zBuf. zBuf must be big enough to
+** hold at least SQLITE_TEMPNAME_SIZE characters.
+*/
+int sqlite3OsTempFileName(char *zBuf){
+ static char zChars[] =
+ "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789";
+ int i, j;
+ char zTempPath[SQLITE_TEMPNAME_SIZE];
+ if( sqlite3_temp_directory ){
+ strncpy(zTempPath, sqlite3_temp_directory, SQLITE_TEMPNAME_SIZE-30);
+ zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0;
+ }else if( isNT() ){
+ char *zMulti;
+ WCHAR zWidePath[SQLITE_TEMPNAME_SIZE];
+ GetTempPathW(SQLITE_TEMPNAME_SIZE-30, zWidePath);
+ zMulti = unicodeToUtf8(zWidePath);
+ if( zMulti ){
+ strncpy(zTempPath, zMulti, SQLITE_TEMPNAME_SIZE-30);
+ zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0;
+ sqliteFree(zMulti);
+ }
+ }else{
+ GetTempPathA(SQLITE_TEMPNAME_SIZE-30, zTempPath);
+ }
+ for(i=strlen(zTempPath); i>0 && zTempPath[i-1]=='\\'; i--){}
+ zTempPath[i] = 0;
+ for(;;){
+ sprintf(zBuf, "%s\\"TEMP_FILE_PREFIX, zTempPath);
+ j = strlen(zBuf);
+ sqlite3Randomness(15, &zBuf[j]);
+ for(i=0; i<15; i++, j++){
+ zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
+ }
+ zBuf[j] = 0;
+ if( !sqlite3OsFileExists(zBuf) ) break;
+ }
+ TRACE2("TEMP FILENAME: %s\n", zBuf);
+ return SQLITE_OK;
+}
+
+/*
+** Close a file.
+*/
+int sqlite3OsClose(OsFile *id){
+ if( id->isOpen ){
+ TRACE2("CLOSE %d\n", id->h);
+ CloseHandle(id->h);
+ OpenCounter(-1);
+ id->isOpen = 0;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Read data from a file into a buffer. Return SQLITE_OK if all
+** bytes were read successfully and SQLITE_IOERR if anything goes
+** wrong.
+*/
+int sqlite3OsRead(OsFile *id, void *pBuf, int amt){
+ DWORD got;
+ assert( id->isOpen );
+ SimulateIOError(SQLITE_IOERR);
+ TRACE3("READ %d lock=%d\n", id->h, id->locktype);
+ if( !ReadFile(id->h, pBuf, amt, &got, 0) ){
+ got = 0;
+ }
+ if( got==(DWORD)amt ){
+ return SQLITE_OK;
+ }else{
+ return SQLITE_IOERR;
+ }
+}
+
+/*
+** Write data from a buffer into a file. Return SQLITE_OK on success
+** or some other error code on failure.
+*/
+int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){
+ int rc = 0;
+ DWORD wrote;
+ assert( id->isOpen );
+ SimulateIOError(SQLITE_IOERR);
+ SimulateDiskfullError;
+ TRACE3("WRITE %d lock=%d\n", id->h, id->locktype);
+ assert( amt>0 );
+ while( amt>0 && (rc = WriteFile(id->h, pBuf, amt, &wrote, 0))!=0 && wrote>0 ){
+ amt -= wrote;
+ pBuf = &((char*)pBuf)[wrote];
+ }
+ if( !rc || amt>(int)wrote ){
+ return SQLITE_FULL;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Some microsoft compilers lack this definition.
+*/
+#ifndef INVALID_SET_FILE_POINTER
+# define INVALID_SET_FILE_POINTER ((DWORD)-1)
+#endif
+
+/*
+** Move the read/write pointer in a file.
+*/
+int sqlite3OsSeek(OsFile *id, i64 offset){
+ LONG upperBits = offset>>32;
+ LONG lowerBits = offset & 0xffffffff;
+ DWORD rc;
+ assert( id->isOpen );
+#ifdef SQLITE_TEST
+ if( offset ) SimulateDiskfullError
+#endif
+ SEEK(offset/1024 + 1);
+ rc = SetFilePointer(id->h, lowerBits, &upperBits, FILE_BEGIN);
+ TRACE3("SEEK %d %lld\n", id->h, offset);
+ if( rc==INVALID_SET_FILE_POINTER && GetLastError()!=NO_ERROR ){
+ return SQLITE_FULL;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Make sure all writes to a particular file are committed to disk.
+*/
+int sqlite3OsSync(OsFile *id, int dataOnly){
+ assert( id->isOpen );
+ TRACE3("SYNC %d lock=%d\n", id->h, id->locktype);
+ if( FlushFileBuffers(id->h) ){
+ return SQLITE_OK;
+ }else{
+ return SQLITE_IOERR;
+ }
+}
+
+/*
+** Sync the directory zDirname. This is a no-op on operating systems other
+** than UNIX.
+*/
+int sqlite3OsSyncDirectory(const char *zDirname){
+ SimulateIOError(SQLITE_IOERR);
+ return SQLITE_OK;
+}
+
+/*
+** Truncate an open file to a specified size
+*/
+int sqlite3OsTruncate(OsFile *id, i64 nByte){
+ LONG upperBits = nByte>>32;
+ assert( id->isOpen );
+ TRACE3("TRUNCATE %d %lld\n", id->h, nByte);
+ SimulateIOError(SQLITE_IOERR);
+ SetFilePointer(id->h, nByte, &upperBits, FILE_BEGIN);
+ SetEndOfFile(id->h);
+ return SQLITE_OK;
+}
+
+/*
+** Determine the current size of a file in bytes
+*/
+int sqlite3OsFileSize(OsFile *id, i64 *pSize){
+ DWORD upperBits, lowerBits;
+ assert( id->isOpen );
+ SimulateIOError(SQLITE_IOERR);
+ lowerBits = GetFileSize(id->h, &upperBits);
+ *pSize = (((i64)upperBits)<<32) + lowerBits;
+ return SQLITE_OK;
+}
+
+/*
+** Acquire a reader lock.
+** Different API routines are called depending on whether or not this
+** is Win95 or WinNT.
+*/
+static int getReadLock(OsFile *id){
+ int res;
+ if( isNT() ){
+ OVERLAPPED ovlp;
+ ovlp.Offset = SHARED_FIRST;
+ ovlp.OffsetHigh = 0;
+ ovlp.hEvent = 0;
+ res = LockFileEx(id->h, LOCKFILE_FAIL_IMMEDIATELY, 0, SHARED_SIZE,0,&ovlp);
+ }else{
+ int lk;
+ sqlite3Randomness(sizeof(lk), &lk);
+ id->sharedLockByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1);
+ res = LockFile(id->h, SHARED_FIRST+id->sharedLockByte, 0, 1, 0);
+ }
+ return res;
+}
+
+/*
+** Undo a readlock
+*/
+static int unlockReadLock(OsFile *id){
+ int res;
+ if( isNT() ){
+ res = UnlockFile(id->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
+ }else{
+ res = UnlockFile(id->h, SHARED_FIRST + id->sharedLockByte, 0, 1, 0);
+ }
+ return res;
+}
+
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+/*
+** Check that a given pathname is a directory and is writable
+**
+*/
+int sqlite3OsIsDirWritable(char *zDirname){
+ int fileAttr;
+ WCHAR *zWide;
+ if( zDirname==0 ) return 0;
+ if( !isNT() && strlen(zDirname)>MAX_PATH ) return 0;
+ zWide = utf8ToUnicode(zDirname);
+ if( zWide ){
+ fileAttr = GetFileAttributesW(zWide);
+ sqliteFree(zWide);
+ }else{
+ fileAttr = GetFileAttributesA(zDirname);
+ }
+ if( fileAttr == 0xffffffff ) return 0;
+ if( (fileAttr & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY ){
+ return 0;
+ }
+ return 1;
+}
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
+
+/*
+** Lock the file with the lock specified by parameter locktype - one
+** of the following:
+**
+** (1) SHARED_LOCK
+** (2) RESERVED_LOCK
+** (3) PENDING_LOCK
+** (4) EXCLUSIVE_LOCK
+**
+** Sometimes when requesting one lock state, additional lock states
+** are inserted in between. The locking might fail on one of the later
+** transitions leaving the lock state different from what it started but
+** still short of its goal. The following chart shows the allowed
+** transitions and the inserted intermediate states:
+**
+** UNLOCKED -> SHARED
+** SHARED -> RESERVED
+** SHARED -> (PENDING) -> EXCLUSIVE
+** RESERVED -> (PENDING) -> EXCLUSIVE
+** PENDING -> EXCLUSIVE
+**
+** This routine will only increase a lock. The sqlite3OsUnlock() routine
+** erases all locks at once and returns us immediately to locking level 0.
+** It is not possible to lower the locking level one step at a time. You
+** must go straight to locking level 0.
+*/
+int sqlite3OsLock(OsFile *id, int locktype){
+ int rc = SQLITE_OK; /* Return code from subroutines */
+ int res = 1; /* Result of a windows lock call */
+ int newLocktype; /* Set id->locktype to this value before exiting */
+ int gotPendingLock = 0;/* True if we acquired a PENDING lock this time */
+
+ assert( id->isOpen );
+ TRACE5("LOCK %d %d was %d(%d)\n",
+ id->h, locktype, id->locktype, id->sharedLockByte);
+
+ /* If there is already a lock of this type or more restrictive on the
+ ** OsFile, do nothing. Don't use the end_lock: exit path, as
+ ** sqlite3OsEnterMutex() hasn't been called yet.
+ */
+ if( id->locktype>=locktype ){
+ return SQLITE_OK;
+ }
+
+ /* Make sure the locking sequence is correct
+ */
+ assert( id->locktype!=NO_LOCK || locktype==SHARED_LOCK );
+ assert( locktype!=PENDING_LOCK );
+ assert( locktype!=RESERVED_LOCK || id->locktype==SHARED_LOCK );
+
+ /* Lock the PENDING_LOCK byte if we need to acquire a PENDING lock or
+ ** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of
+ ** the PENDING_LOCK byte is temporary.
+ */
+ newLocktype = id->locktype;
+ if( id->locktype==NO_LOCK
+ || (locktype==EXCLUSIVE_LOCK && id->locktype==RESERVED_LOCK)
+ ){
+ int cnt = 3;
+ while( cnt-->0 && (res = LockFile(id->h, PENDING_BYTE, 0, 1, 0))==0 ){
+ /* Try 3 times to get the pending lock. The pending lock might be
+ ** held by another reader process who will release it momentarily.
+ */
+ TRACE2("could not get a PENDING lock. cnt=%d\n", cnt);
+ Sleep(1);
+ }
+ gotPendingLock = res;
+ }
+
+ /* Acquire a shared lock
+ */
+ if( locktype==SHARED_LOCK && res ){
+ assert( id->locktype==NO_LOCK );
+ res = getReadLock(id);
+ if( res ){
+ newLocktype = SHARED_LOCK;
+ }
+ }
+
+ /* Acquire a RESERVED lock
+ */
+ if( locktype==RESERVED_LOCK && res ){
+ assert( id->locktype==SHARED_LOCK );
+ res = LockFile(id->h, RESERVED_BYTE, 0, 1, 0);
+ if( res ){
+ newLocktype = RESERVED_LOCK;
+ }
+ }
+
+ /* Acquire a PENDING lock
+ */
+ if( locktype==EXCLUSIVE_LOCK && res ){
+ newLocktype = PENDING_LOCK;
+ gotPendingLock = 0;
+ }
+
+ /* Acquire an EXCLUSIVE lock
+ */
+ if( locktype==EXCLUSIVE_LOCK && res ){
+ assert( id->locktype>=SHARED_LOCK );
+ res = unlockReadLock(id);
+ TRACE2("unreadlock = %d\n", res);
+ res = LockFile(id->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
+ if( res ){
+ newLocktype = EXCLUSIVE_LOCK;
+ }else{
+ TRACE2("error-code = %d\n", GetLastError());
+ }
+ }
+
+ /* If we are holding a PENDING lock that ought to be released, then
+ ** release it now.
+ */
+ if( gotPendingLock && locktype==SHARED_LOCK ){
+ UnlockFile(id->h, PENDING_BYTE, 0, 1, 0);
+ }
+
+ /* Update the state of the lock has held in the file descriptor then
+ ** return the appropriate result code.
+ */
+ if( res ){
+ rc = SQLITE_OK;
+ }else{
+ TRACE4("LOCK FAILED %d trying for %d but got %d\n", id->h,
+ locktype, newLocktype);
+ rc = SQLITE_BUSY;
+ }
+ id->locktype = newLocktype;
+ return rc;
+}
+
+/*
+** This routine checks if there is a RESERVED lock held on the specified
+** file by this or any other process. If such a lock is held, return
+** non-zero, otherwise zero.
+*/
+int sqlite3OsCheckReservedLock(OsFile *id){
+ int rc;
+ assert( id->isOpen );
+ if( id->locktype>=RESERVED_LOCK ){
+ rc = 1;
+ TRACE3("TEST WR-LOCK %d %d (local)\n", id->h, rc);
+ }else{
+ rc = LockFile(id->h, RESERVED_BYTE, 0, 1, 0);
+ if( rc ){
+ UnlockFile(id->h, RESERVED_BYTE, 0, 1, 0);
+ }
+ rc = !rc;
+ TRACE3("TEST WR-LOCK %d %d (remote)\n", id->h, rc);
+ }
+ return rc;
+}
+
+/*
+** Lower the locking level on file descriptor id to locktype. locktype
+** must be either NO_LOCK or SHARED_LOCK.
+**
+** If the locking level of the file descriptor is already at or below
+** the requested locking level, this routine is a no-op.
+**
+** It is not possible for this routine to fail if the second argument
+** is NO_LOCK. If the second argument is SHARED_LOCK then this routine
+** might return SQLITE_IOERR;
+*/
+int sqlite3OsUnlock(OsFile *id, int locktype){
+ int type;
+ int rc = SQLITE_OK;
+ assert( id->isOpen );
+ assert( locktype<=SHARED_LOCK );
+ TRACE5("UNLOCK %d to %d was %d(%d)\n", id->h, locktype,
+ id->locktype, id->sharedLockByte);
+ type = id->locktype;
+ if( type>=EXCLUSIVE_LOCK ){
+ UnlockFile(id->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
+ if( locktype==SHARED_LOCK && !getReadLock(id) ){
+ /* This should never happen. We should always be able to
+ ** reacquire the read lock */
+ rc = SQLITE_IOERR;
+ }
+ }
+ if( type>=RESERVED_LOCK ){
+ UnlockFile(id->h, RESERVED_BYTE, 0, 1, 0);
+ }
+ if( locktype==NO_LOCK && type>=SHARED_LOCK ){
+ unlockReadLock(id);
+ }
+ if( type>=PENDING_LOCK ){
+ UnlockFile(id->h, PENDING_BYTE, 0, 1, 0);
+ }
+ id->locktype = locktype;
+ return rc;
+}
+
+/*
+** Turn a relative pathname into a full pathname. Return a pointer
+** to the full pathname stored in space obtained from sqliteMalloc().
+** The calling function is responsible for freeing this space once it
+** is no longer needed.
+*/
+char *sqlite3OsFullPathname(const char *zRelative){
+ char *zNotUsed;
+ char *zFull;
+ WCHAR *zWide;
+ int nByte;
+#ifdef __CYGWIN__
+ nByte = strlen(zRelative) + MAX_PATH + 1001;
+ zFull = sqliteMalloc( nByte );
+ if( zFull==0 ) return 0;
+ if( cygwin_conv_to_full_win32_path(zRelative, zFull) ) return 0;
+#else
+ zWide = utf8ToUnicode(zRelative);
+ if( zWide ){
+ WCHAR *zTemp, *zNotUsedW;
+ nByte = GetFullPathNameW(zWide, 0, 0, &zNotUsedW) + 1;
+ zTemp = sqliteMalloc( nByte*sizeof(zTemp[0]) );
+ if( zTemp==0 ) return 0;
+ GetFullPathNameW(zWide, nByte, zTemp, &zNotUsedW);
+ sqliteFree(zWide);
+ zFull = unicodeToUtf8(zTemp);
+ sqliteFree(zTemp);
+ }else{
+ nByte = GetFullPathNameA(zRelative, 0, 0, &zNotUsed) + 1;
+ zFull = sqliteMalloc( nByte*sizeof(zFull[0]) );
+ if( zFull==0 ) return 0;
+ GetFullPathNameA(zRelative, nByte, zFull, &zNotUsed);
+ }
+#endif
+ return zFull;
+}
+
+#endif /* SQLITE_OMIT_DISKIO */
+/***************************************************************************
+** Everything above deals with file I/O. Everything that follows deals
+** with other miscellanous aspects of the operating system interface
+****************************************************************************/
+
+/*
+** Get information to seed the random number generator. The seed
+** is written into the buffer zBuf[256]. The calling function must
+** supply a sufficiently large buffer.
+*/
+int sqlite3OsRandomSeed(char *zBuf){
+ /* We have to initialize zBuf to prevent valgrind from reporting
+ ** errors. The reports issued by valgrind are incorrect - we would
+ ** prefer that the randomness be increased by making use of the
+ ** uninitialized space in zBuf - but valgrind errors tend to worry
+ ** some users. Rather than argue, it seems easier just to initialize
+ ** the whole array and silence valgrind, even if that means less randomness
+ ** in the random seed.
+ **
+ ** When testing, initializing zBuf[] to zero is all we do. That means
+ ** that we always use the same random number sequence.* This makes the
+ ** tests repeatable.
+ */
+ memset(zBuf, 0, 256);
+ GetSystemTime((LPSYSTEMTIME)zBuf);
+ return SQLITE_OK;
+}
+
+/*
+** Sleep for a little while. Return the amount of time slept.
+*/
+int sqlite3OsSleep(int ms){
+ Sleep(ms);
+ return ms;
+}
+
+/*
+** Static variables used for thread synchronization
+*/
+static int inMutex = 0;
+#ifdef SQLITE_W32_THREADS
+ static CRITICAL_SECTION cs;
+#endif
+
+/*
+** The following pair of routine implement mutual exclusion for
+** multi-threaded processes. Only a single thread is allowed to
+** executed code that is surrounded by EnterMutex() and LeaveMutex().
+**
+** SQLite uses only a single Mutex. There is not much critical
+** code and what little there is executes quickly and without blocking.
+*/
+void sqlite3OsEnterMutex(){
+#ifdef SQLITE_W32_THREADS
+ static int isInit = 0;
+ while( !isInit ){
+ static long lock = 0;
+ if( InterlockedIncrement(&lock)==1 ){
+ InitializeCriticalSection(&cs);
+ isInit = 1;
+ }else{
+ Sleep(1);
+ }
+ }
+ EnterCriticalSection(&cs);
+#endif
+ assert( !inMutex );
+ inMutex = 1;
+}
+void sqlite3OsLeaveMutex(){
+ assert( inMutex );
+ inMutex = 0;
+#ifdef SQLITE_W32_THREADS
+ LeaveCriticalSection(&cs);
+#endif
+}
+
+/*
+** The following variable, if set to a non-zero value, becomes the result
+** returned from sqlite3OsCurrentTime(). This is used for testing.
+*/
+#ifdef SQLITE_TEST
+int sqlite3_current_time = 0;
+#endif
+
+/*
+** Find the current time (in Universal Coordinated Time). Write the
+** current time and date as a Julian Day number into *prNow and
+** return 0. Return 1 if the time and date cannot be found.
+*/
+int sqlite3OsCurrentTime(double *prNow){
+ FILETIME ft;
+ /* FILETIME structure is a 64-bit value representing the number of
+ 100-nanosecond intervals since January 1, 1601 (= JD 2305813.5).
+ */
+ double now;
+ GetSystemTimeAsFileTime( &ft );
+ now = ((double)ft.dwHighDateTime) * 4294967296.0;
+ *prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5;
+#ifdef SQLITE_TEST
+ if( sqlite3_current_time ){
+ *prNow = sqlite3_current_time/86400.0 + 2440587.5;
+ }
+#endif
+ return 0;
+}
+
+#endif /* OS_WIN */
diff --git a/ext/pdo_sqlite/sqlite/src/os_win.h b/ext/pdo_sqlite/sqlite/src/os_win.h
new file mode 100644
index 000000000..baf937b21
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os_win.h
@@ -0,0 +1,40 @@
+/*
+** 2004 May 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This header file defines OS-specific features for Win32
+*/
+#ifndef _SQLITE_OS_WIN_H_
+#define _SQLITE_OS_WIN_H_
+
+#include <windows.h>
+#include <winbase.h>
+
+/*
+** The OsFile structure is a operating-system independing representation
+** of an open file handle. It is defined differently for each architecture.
+**
+** This is the definition for Win32.
+*/
+typedef struct OsFile OsFile;
+struct OsFile {
+ HANDLE h; /* Handle for accessing the file */
+ unsigned char locktype; /* Type of lock currently held on this file */
+ unsigned char isOpen; /* True if needs to be closed */
+ short sharedLockByte; /* Randomly chosen byte used as a shared lock */
+};
+
+
+#define SQLITE_TEMPNAME_SIZE (MAX_PATH+50)
+#define SQLITE_MIN_SLEEP_MS 1
+
+
+#endif /* _SQLITE_OS_WIN_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/pager.c b/ext/pdo_sqlite/sqlite/src/pager.c
new file mode 100644
index 000000000..1edfbb4e7
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/pager.c
@@ -0,0 +1,3634 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This is the implementation of the page cache subsystem or "pager".
+**
+** The pager is used to access a database disk file. It implements
+** atomic commit and rollback through the use of a journal file that
+** is separate from the database file. The pager also implements file
+** locking to prevent two processes from writing the same database
+** file simultaneously, or one process from reading the database while
+** another is writing.
+**
+** @(#) $Id$
+*/
+#ifndef SQLITE_OMIT_DISKIO
+#include "sqliteInt.h"
+#include "os.h"
+#include "pager.h"
+#include <assert.h>
+#include <string.h>
+
+/*
+** Macros for troubleshooting. Normally turned off
+*/
+#if 0
+#define TRACE1(X) sqlite3DebugPrintf(X)
+#define TRACE2(X,Y) sqlite3DebugPrintf(X,Y)
+#define TRACE3(X,Y,Z) sqlite3DebugPrintf(X,Y,Z)
+#define TRACE4(X,Y,Z,W) sqlite3DebugPrintf(X,Y,Z,W)
+#define TRACE5(X,Y,Z,W,V) sqlite3DebugPrintf(X,Y,Z,W,V)
+#else
+#define TRACE1(X)
+#define TRACE2(X,Y)
+#define TRACE3(X,Y,Z)
+#define TRACE4(X,Y,Z,W)
+#define TRACE5(X,Y,Z,W,V)
+#endif
+
+/*
+** The following two macros are used within the TRACEX() macros above
+** to print out file-descriptors. They are required so that tracing
+** can be turned on when using both the regular os_unix.c and os_test.c
+** backends.
+**
+** PAGERID() takes a pointer to a Pager struct as it's argument. The
+** associated file-descriptor is returned. FILEHANDLEID() takes an OsFile
+** struct as it's argument.
+*/
+#ifdef OS_TEST
+#define PAGERID(p) (p->fd->fd.h)
+#define FILEHANDLEID(fd) (fd->fd.h)
+#else
+#define PAGERID(p) (p->fd.h)
+#define FILEHANDLEID(fd) (fd.h)
+#endif
+
+/*
+** The page cache as a whole is always in one of the following
+** states:
+**
+** PAGER_UNLOCK The page cache is not currently reading or
+** writing the database file. There is no
+** data held in memory. This is the initial
+** state.
+**
+** PAGER_SHARED The page cache is reading the database.
+** Writing is not permitted. There can be
+** multiple readers accessing the same database
+** file at the same time.
+**
+** PAGER_RESERVED This process has reserved the database for writing
+** but has not yet made any changes. Only one process
+** at a time can reserve the database. The original
+** database file has not been modified so other
+** processes may still be reading the on-disk
+** database file.
+**
+** PAGER_EXCLUSIVE The page cache is writing the database.
+** Access is exclusive. No other processes or
+** threads can be reading or writing while one
+** process is writing.
+**
+** PAGER_SYNCED The pager moves to this state from PAGER_EXCLUSIVE
+** after all dirty pages have been written to the
+** database file and the file has been synced to
+** disk. All that remains to do is to remove the
+** journal file and the transaction will be
+** committed.
+**
+** The page cache comes up in PAGER_UNLOCK. The first time a
+** sqlite3pager_get() occurs, the state transitions to PAGER_SHARED.
+** After all pages have been released using sqlite_page_unref(),
+** the state transitions back to PAGER_UNLOCK. The first time
+** that sqlite3pager_write() is called, the state transitions to
+** PAGER_RESERVED. (Note that sqlite_page_write() can only be
+** called on an outstanding page which means that the pager must
+** be in PAGER_SHARED before it transitions to PAGER_RESERVED.)
+** The transition to PAGER_EXCLUSIVE occurs when before any changes
+** are made to the database file. After an sqlite3pager_rollback()
+** or sqlite_pager_commit(), the state goes back to PAGER_SHARED.
+*/
+#define PAGER_UNLOCK 0
+#define PAGER_SHARED 1 /* same as SHARED_LOCK */
+#define PAGER_RESERVED 2 /* same as RESERVED_LOCK */
+#define PAGER_EXCLUSIVE 4 /* same as EXCLUSIVE_LOCK */
+#define PAGER_SYNCED 5
+
+/*
+** If the SQLITE_BUSY_RESERVED_LOCK macro is set to true at compile-time,
+** then failed attempts to get a reserved lock will invoke the busy callback.
+** This is off by default. To see why, consider the following scenario:
+**
+** Suppose thread A already has a shared lock and wants a reserved lock.
+** Thread B already has a reserved lock and wants an exclusive lock. If
+** both threads are using their busy callbacks, it might be a long time
+** be for one of the threads give up and allows the other to proceed.
+** But if the thread trying to get the reserved lock gives up quickly
+** (if it never invokes its busy callback) then the contention will be
+** resolved quickly.
+*/
+#ifndef SQLITE_BUSY_RESERVED_LOCK
+# define SQLITE_BUSY_RESERVED_LOCK 0
+#endif
+
+/*
+** This macro rounds values up so that if the value is an address it
+** is guaranteed to be an address that is aligned to an 8-byte boundary.
+*/
+#define FORCE_ALIGNMENT(X) (((X)+7)&~7)
+
+/*
+** Each in-memory image of a page begins with the following header.
+** This header is only visible to this pager module. The client
+** code that calls pager sees only the data that follows the header.
+**
+** Client code should call sqlite3pager_write() on a page prior to making
+** any modifications to that page. The first time sqlite3pager_write()
+** is called, the original page contents are written into the rollback
+** journal and PgHdr.inJournal and PgHdr.needSync are set. Later, once
+** the journal page has made it onto the disk surface, PgHdr.needSync
+** is cleared. The modified page cannot be written back into the original
+** database file until the journal pages has been synced to disk and the
+** PgHdr.needSync has been cleared.
+**
+** The PgHdr.dirty flag is set when sqlite3pager_write() is called and
+** is cleared again when the page content is written back to the original
+** database file.
+*/
+typedef struct PgHdr PgHdr;
+struct PgHdr {
+ Pager *pPager; /* The pager to which this page belongs */
+ Pgno pgno; /* The page number for this page */
+ PgHdr *pNextHash, *pPrevHash; /* Hash collision chain for PgHdr.pgno */
+ PgHdr *pNextFree, *pPrevFree; /* Freelist of pages where nRef==0 */
+ PgHdr *pNextAll; /* A list of all pages */
+ PgHdr *pNextStmt, *pPrevStmt; /* List of pages in the statement journal */
+ u8 inJournal; /* TRUE if has been written to journal */
+ u8 inStmt; /* TRUE if in the statement subjournal */
+ u8 dirty; /* TRUE if we need to write back changes */
+ u8 needSync; /* Sync journal before writing this page */
+ u8 alwaysRollback; /* Disable dont_rollback() for this page */
+ short int nRef; /* Number of users of this page */
+ PgHdr *pDirty; /* Dirty pages sorted by PgHdr.pgno */
+#ifdef SQLITE_CHECK_PAGES
+ u32 pageHash;
+#endif
+ /* pPager->pageSize bytes of page data follow this header */
+ /* Pager.nExtra bytes of local data follow the page data */
+};
+
+/*
+** For an in-memory only database, some extra information is recorded about
+** each page so that changes can be rolled back. (Journal files are not
+** used for in-memory databases.) The following information is added to
+** the end of every EXTRA block for in-memory databases.
+**
+** This information could have been added directly to the PgHdr structure.
+** But then it would take up an extra 8 bytes of storage on every PgHdr
+** even for disk-based databases. Splitting it out saves 8 bytes. This
+** is only a savings of 0.8% but those percentages add up.
+*/
+typedef struct PgHistory PgHistory;
+struct PgHistory {
+ u8 *pOrig; /* Original page text. Restore to this on a full rollback */
+ u8 *pStmt; /* Text as it was at the beginning of the current statement */
+};
+
+/*
+** A macro used for invoking the codec if there is one
+*/
+#ifdef SQLITE_HAS_CODEC
+# define CODEC(P,D,N,X) if( P->xCodec ){ P->xCodec(P->pCodecArg,D,N,X); }
+#else
+# define CODEC(P,D,N,X)
+#endif
+
+/*
+** Convert a pointer to a PgHdr into a pointer to its data
+** and back again.
+*/
+#define PGHDR_TO_DATA(P) ((void*)(&(P)[1]))
+#define DATA_TO_PGHDR(D) (&((PgHdr*)(D))[-1])
+#define PGHDR_TO_EXTRA(G,P) ((void*)&((char*)(&(G)[1]))[(P)->pageSize])
+#define PGHDR_TO_HIST(P,PGR) \
+ ((PgHistory*)&((char*)(&(P)[1]))[(PGR)->pageSize+(PGR)->nExtra])
+
+/*
+** How big to make the hash table used for locating in-memory pages
+** by page number. This macro looks a little silly, but is evaluated
+** at compile-time, not run-time (at least for gcc this is true).
+*/
+#define N_PG_HASH (\
+ (MAX_PAGES>1024)?2048: \
+ (MAX_PAGES>512)?1024: \
+ (MAX_PAGES>256)?512: \
+ (MAX_PAGES>128)?256: \
+ (MAX_PAGES>64)?128:64 \
+)
+
+/*
+** Hash a page number
+*/
+#define pager_hash(PN) ((PN)&(N_PG_HASH-1))
+
+/*
+** A open page cache is an instance of the following structure.
+*/
+struct Pager {
+ u8 journalOpen; /* True if journal file descriptors is valid */
+ u8 journalStarted; /* True if header of journal is synced */
+ u8 useJournal; /* Use a rollback journal on this file */
+ u8 noReadlock; /* Do not bother to obtain readlocks */
+ u8 stmtOpen; /* True if the statement subjournal is open */
+ u8 stmtInUse; /* True we are in a statement subtransaction */
+ u8 stmtAutoopen; /* Open stmt journal when main journal is opened*/
+ u8 noSync; /* Do not sync the journal if true */
+ u8 fullSync; /* Do extra syncs of the journal for robustness */
+ u8 state; /* PAGER_UNLOCK, _SHARED, _RESERVED, etc. */
+ u8 errMask; /* One of several kinds of errors */
+ u8 tempFile; /* zFilename is a temporary file */
+ u8 readOnly; /* True for a read-only database */
+ u8 needSync; /* True if an fsync() is needed on the journal */
+ u8 dirtyCache; /* True if cached pages have changed */
+ u8 alwaysRollback; /* Disable dont_rollback() for all pages */
+ u8 memDb; /* True to inhibit all file I/O */
+ u8 setMaster; /* True if a m-j name has been written to jrnl */
+ int dbSize; /* Number of pages in the file */
+ int origDbSize; /* dbSize before the current change */
+ int stmtSize; /* Size of database (in pages) at stmt_begin() */
+ int nRec; /* Number of pages written to the journal */
+ u32 cksumInit; /* Quasi-random value added to every checksum */
+ int stmtNRec; /* Number of records in stmt subjournal */
+ int nExtra; /* Add this many bytes to each in-memory page */
+ int pageSize; /* Number of bytes in a page */
+ int nPage; /* Total number of in-memory pages */
+ int nMaxPage; /* High water mark of nPage */
+ int nRef; /* Number of in-memory pages with PgHdr.nRef>0 */
+ int mxPage; /* Maximum number of pages to hold in cache */
+ u8 *aInJournal; /* One bit for each page in the database file */
+ u8 *aInStmt; /* One bit for each page in the database */
+ char *zFilename; /* Name of the database file */
+ char *zJournal; /* Name of the journal file */
+ char *zDirectory; /* Directory hold database and journal files */
+ OsFile fd, jfd; /* File descriptors for database and journal */
+ OsFile stfd; /* File descriptor for the statement subjournal*/
+ BusyHandler *pBusyHandler; /* Pointer to sqlite.busyHandler */
+ PgHdr *pFirst, *pLast; /* List of free pages */
+ PgHdr *pFirstSynced; /* First free page with PgHdr.needSync==0 */
+ PgHdr *pAll; /* List of all pages */
+ PgHdr *pStmt; /* List of pages in the statement subjournal */
+ i64 journalOff; /* Current byte offset in the journal file */
+ i64 journalHdr; /* Byte offset to previous journal header */
+ i64 stmtHdrOff; /* First journal header written this statement */
+ i64 stmtCksum; /* cksumInit when statement was started */
+ i64 stmtJSize; /* Size of journal at stmt_begin() */
+ int sectorSize; /* Assumed sector size during rollback */
+#ifdef SQLITE_TEST
+ int nHit, nMiss, nOvfl; /* Cache hits, missing, and LRU overflows */
+ int nRead,nWrite; /* Database pages read/written */
+#endif
+ void (*xDestructor)(void*,int); /* Call this routine when freeing pages */
+ void (*xReiniter)(void*,int); /* Call this routine when reloading pages */
+ void (*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */
+ void *pCodecArg; /* First argument to xCodec() */
+ PgHdr *aHash[N_PG_HASH]; /* Hash table to map page number to PgHdr */
+};
+
+/*
+** If SQLITE_TEST is defined then increment the variable given in
+** the argument
+*/
+#ifdef SQLITE_TEST
+# define TEST_INCR(x) x++
+#else
+# define TEST_INCR(x)
+#endif
+
+/*
+** These are bits that can be set in Pager.errMask.
+*/
+#define PAGER_ERR_FULL 0x01 /* a write() failed */
+#define PAGER_ERR_MEM 0x02 /* malloc() failed */
+#define PAGER_ERR_LOCK 0x04 /* error in the locking protocol */
+#define PAGER_ERR_CORRUPT 0x08 /* database or journal corruption */
+#define PAGER_ERR_DISK 0x10 /* general disk I/O error - bad hard drive? */
+
+/*
+** Journal files begin with the following magic string. The data
+** was obtained from /dev/random. It is used only as a sanity check.
+**
+** Since version 2.8.0, the journal format contains additional sanity
+** checking information. If the power fails while the journal is begin
+** written, semi-random garbage data might appear in the journal
+** file after power is restored. If an attempt is then made
+** to roll the journal back, the database could be corrupted. The additional
+** sanity checking data is an attempt to discover the garbage in the
+** journal and ignore it.
+**
+** The sanity checking information for the new journal format consists
+** of a 32-bit checksum on each page of data. The checksum covers both
+** the page number and the pPager->pageSize bytes of data for the page.
+** This cksum is initialized to a 32-bit random value that appears in the
+** journal file right after the header. The random initializer is important,
+** because garbage data that appears at the end of a journal is likely
+** data that was once in other files that have now been deleted. If the
+** garbage data came from an obsolete journal file, the checksums might
+** be correct. But by initializing the checksum to random value which
+** is different for every journal, we minimize that risk.
+*/
+static const unsigned char aJournalMagic[] = {
+ 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd7,
+};
+
+/*
+** The size of the header and of each page in the journal is determined
+** by the following macros.
+*/
+#define JOURNAL_PG_SZ(pPager) ((pPager->pageSize) + 8)
+
+/*
+** The journal header size for this pager. In the future, this could be
+** set to some value read from the disk controller. The important
+** characteristic is that it is the same size as a disk sector.
+*/
+#define JOURNAL_HDR_SZ(pPager) (pPager->sectorSize)
+
+/*
+** The macro MEMDB is true if we are dealing with an in-memory database.
+** We do this as a macro so that if the SQLITE_OMIT_MEMORYDB macro is set,
+** the value of MEMDB will be a constant and the compiler will optimize
+** out code that would never execute.
+*/
+#ifdef SQLITE_OMIT_MEMORYDB
+# define MEMDB 0
+#else
+# define MEMDB pPager->memDb
+#endif
+
+/*
+** The default size of a disk sector
+*/
+#define PAGER_SECTOR_SIZE 512
+
+/*
+** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is
+** reserved for working around a windows/posix incompatibility). It is
+** used in the journal to signify that the remainder of the journal file
+** is devoted to storing a master journal name - there are no more pages to
+** roll back. See comments for function writeMasterJournal() for details.
+*/
+/* #define PAGER_MJ_PGNO(x) (PENDING_BYTE/((x)->pageSize)) */
+#define PAGER_MJ_PGNO(x) ((PENDING_BYTE/((x)->pageSize))+1)
+
+/*
+** The maximum legal page number is (2^31 - 1).
+*/
+#define PAGER_MAX_PGNO 2147483647
+
+/*
+** Enable reference count tracking (for debugging) here:
+*/
+#ifdef SQLITE_DEBUG
+ int pager3_refinfo_enable = 0;
+ static void pager_refinfo(PgHdr *p){
+ static int cnt = 0;
+ if( !pager3_refinfo_enable ) return;
+ sqlite3DebugPrintf(
+ "REFCNT: %4d addr=%p nRef=%d\n",
+ p->pgno, PGHDR_TO_DATA(p), p->nRef
+ );
+ cnt++; /* Something to set a breakpoint on */
+ }
+# define REFINFO(X) pager_refinfo(X)
+#else
+# define REFINFO(X)
+#endif
+
+/*
+** Read a 32-bit integer from the given file descriptor. Store the integer
+** that is read in *pRes. Return SQLITE_OK if everything worked, or an
+** error code is something goes wrong.
+**
+** All values are stored on disk as big-endian.
+*/
+static int read32bits(OsFile *fd, u32 *pRes){
+ u32 res;
+ int rc;
+ rc = sqlite3OsRead(fd, &res, sizeof(res));
+ if( rc==SQLITE_OK ){
+ unsigned char ac[4];
+ memcpy(ac, &res, 4);
+ res = (ac[0]<<24) | (ac[1]<<16) | (ac[2]<<8) | ac[3];
+ }
+ *pRes = res;
+ return rc;
+}
+
+/*
+** Write a 32-bit integer into the given file descriptor. Return SQLITE_OK
+** on success or an error code is something goes wrong.
+*/
+static int write32bits(OsFile *fd, u32 val){
+ unsigned char ac[4];
+ ac[0] = (val>>24) & 0xff;
+ ac[1] = (val>>16) & 0xff;
+ ac[2] = (val>>8) & 0xff;
+ ac[3] = val & 0xff;
+ return sqlite3OsWrite(fd, ac, 4);
+}
+
+/*
+** Write the 32-bit integer 'val' into the page identified by page header
+** 'p' at offset 'offset'.
+*/
+static void store32bits(u32 val, PgHdr *p, int offset){
+ unsigned char *ac;
+ ac = &((unsigned char*)PGHDR_TO_DATA(p))[offset];
+ ac[0] = (val>>24) & 0xff;
+ ac[1] = (val>>16) & 0xff;
+ ac[2] = (val>>8) & 0xff;
+ ac[3] = val & 0xff;
+}
+
+/*
+** Read a 32-bit integer at offset 'offset' from the page identified by
+** page header 'p'.
+*/
+static u32 retrieve32bits(PgHdr *p, int offset){
+ unsigned char *ac;
+ ac = &((unsigned char*)PGHDR_TO_DATA(p))[offset];
+ return (ac[0]<<24) | (ac[1]<<16) | (ac[2]<<8) | ac[3];
+}
+
+
+/*
+** Convert the bits in the pPager->errMask into an approprate
+** return code.
+*/
+static int pager_errcode(Pager *pPager){
+ int rc = SQLITE_OK;
+ if( pPager->errMask & PAGER_ERR_LOCK ) rc = SQLITE_PROTOCOL;
+ if( pPager->errMask & PAGER_ERR_DISK ) rc = SQLITE_IOERR;
+ if( pPager->errMask & PAGER_ERR_FULL ) rc = SQLITE_FULL;
+ if( pPager->errMask & PAGER_ERR_MEM ) rc = SQLITE_NOMEM;
+ if( pPager->errMask & PAGER_ERR_CORRUPT ) rc = SQLITE_CORRUPT;
+ return rc;
+}
+
+#ifdef SQLITE_CHECK_PAGES
+/*
+** Return a 32-bit hash of the page data for pPage.
+*/
+static u32 pager_pagehash(PgHdr *pPage){
+ u32 hash = 0;
+ int i;
+ unsigned char *pData = (unsigned char *)PGHDR_TO_DATA(pPage);
+ for(i=0; i<pPage->pPager->pageSize; i++){
+ hash = (hash+i)^pData[i];
+ }
+ return hash;
+}
+
+/*
+** The CHECK_PAGE macro takes a PgHdr* as an argument. If SQLITE_CHECK_PAGES
+** is defined, and NDEBUG is not defined, an assert() statement checks
+** that the page is either dirty or still matches the calculated page-hash.
+*/
+#define CHECK_PAGE(x) checkPage(x)
+static void checkPage(PgHdr *pPg){
+ Pager *pPager = pPg->pPager;
+ assert( !pPg->pageHash || pPager->errMask || MEMDB || pPg->dirty ||
+ pPg->pageHash==pager_pagehash(pPg) );
+}
+
+#else
+#define CHECK_PAGE(x)
+#endif
+
+/*
+** When this is called the journal file for pager pPager must be open.
+** The master journal file name is read from the end of the file and
+** written into memory obtained from sqliteMalloc(). *pzMaster is
+** set to point at the memory and SQLITE_OK returned. The caller must
+** sqliteFree() *pzMaster.
+**
+** If no master journal file name is present *pzMaster is set to 0 and
+** SQLITE_OK returned.
+*/
+static int readMasterJournal(OsFile *pJrnl, char **pzMaster){
+ int rc;
+ u32 len;
+ i64 szJ;
+ u32 cksum;
+ int i;
+ unsigned char aMagic[8]; /* A buffer to hold the magic header */
+
+ *pzMaster = 0;
+
+ rc = sqlite3OsFileSize(pJrnl, &szJ);
+ if( rc!=SQLITE_OK || szJ<16 ) return rc;
+
+ rc = sqlite3OsSeek(pJrnl, szJ-16);
+ if( rc!=SQLITE_OK ) return rc;
+
+ rc = read32bits(pJrnl, &len);
+ if( rc!=SQLITE_OK ) return rc;
+
+ rc = read32bits(pJrnl, &cksum);
+ if( rc!=SQLITE_OK ) return rc;
+
+ rc = sqlite3OsRead(pJrnl, aMagic, 8);
+ if( rc!=SQLITE_OK || memcmp(aMagic, aJournalMagic, 8) ) return rc;
+
+ rc = sqlite3OsSeek(pJrnl, szJ-16-len);
+ if( rc!=SQLITE_OK ) return rc;
+
+ *pzMaster = (char *)sqliteMalloc(len+1);
+ if( !*pzMaster ){
+ return SQLITE_NOMEM;
+ }
+ rc = sqlite3OsRead(pJrnl, *pzMaster, len);
+ if( rc!=SQLITE_OK ){
+ sqliteFree(*pzMaster);
+ *pzMaster = 0;
+ return rc;
+ }
+
+ /* See if the checksum matches the master journal name */
+ for(i=0; i<len; i++){
+ cksum -= (*pzMaster)[i];
+ }
+ if( cksum ){
+ /* If the checksum doesn't add up, then one or more of the disk sectors
+ ** containing the master journal filename is corrupted. This means
+ ** definitely roll back, so just return SQLITE_OK and report a (nul)
+ ** master-journal filename.
+ */
+ sqliteFree(*pzMaster);
+ *pzMaster = 0;
+ }else{
+ (*pzMaster)[len] = '\0';
+ }
+
+ return SQLITE_OK;
+}
+
+/*
+** Seek the journal file descriptor to the next sector boundary where a
+** journal header may be read or written. Pager.journalOff is updated with
+** the new seek offset.
+**
+** i.e for a sector size of 512:
+**
+** Input Offset Output Offset
+** ---------------------------------------
+** 0 0
+** 512 512
+** 100 512
+** 2000 2048
+**
+*/
+static int seekJournalHdr(Pager *pPager){
+ i64 offset = 0;
+ i64 c = pPager->journalOff;
+ if( c ){
+ offset = ((c-1)/JOURNAL_HDR_SZ(pPager) + 1) * JOURNAL_HDR_SZ(pPager);
+ }
+ assert( offset%JOURNAL_HDR_SZ(pPager)==0 );
+ assert( offset>=c );
+ assert( (offset-c)<JOURNAL_HDR_SZ(pPager) );
+ pPager->journalOff = offset;
+ return sqlite3OsSeek(&pPager->jfd, pPager->journalOff);
+}
+
+/*
+** The journal file must be open when this routine is called. A journal
+** header (JOURNAL_HDR_SZ bytes) is written into the journal file at the
+** current location.
+**
+** The format for the journal header is as follows:
+** - 8 bytes: Magic identifying journal format.
+** - 4 bytes: Number of records in journal, or -1 no-sync mode is on.
+** - 4 bytes: Random number used for page hash.
+** - 4 bytes: Initial database page count.
+** - 4 bytes: Sector size used by the process that wrote this journal.
+**
+** Followed by (JOURNAL_HDR_SZ - 24) bytes of unused space.
+*/
+static int writeJournalHdr(Pager *pPager){
+
+ int rc = seekJournalHdr(pPager);
+ if( rc ) return rc;
+
+ pPager->journalHdr = pPager->journalOff;
+ if( pPager->stmtHdrOff==0 ){
+ pPager->stmtHdrOff = pPager->journalHdr;
+ }
+ pPager->journalOff += JOURNAL_HDR_SZ(pPager);
+
+ /* FIX ME:
+ **
+ ** Possibly for a pager not in no-sync mode, the journal magic should not
+ ** be written until nRec is filled in as part of next syncJournal().
+ **
+ ** Actually maybe the whole journal header should be delayed until that
+ ** point. Think about this.
+ */
+ rc = sqlite3OsWrite(&pPager->jfd, aJournalMagic, sizeof(aJournalMagic));
+
+ if( rc==SQLITE_OK ){
+ /* The nRec Field. 0xFFFFFFFF for no-sync journals. */
+ rc = write32bits(&pPager->jfd, pPager->noSync ? 0xffffffff : 0);
+ }
+ if( rc==SQLITE_OK ){
+ /* The random check-hash initialiser */
+ sqlite3Randomness(sizeof(pPager->cksumInit), &pPager->cksumInit);
+ rc = write32bits(&pPager->jfd, pPager->cksumInit);
+ }
+ if( rc==SQLITE_OK ){
+ /* The initial database size */
+ rc = write32bits(&pPager->jfd, pPager->dbSize);
+ }
+ if( rc==SQLITE_OK ){
+ /* The assumed sector size for this process */
+ rc = write32bits(&pPager->jfd, pPager->sectorSize);
+ }
+
+ /* The journal header has been written successfully. Seek the journal
+ ** file descriptor to the end of the journal header sector.
+ */
+ if( rc==SQLITE_OK ){
+ rc = sqlite3OsSeek(&pPager->jfd, pPager->journalOff-1);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3OsWrite(&pPager->jfd, "\000", 1);
+ }
+ }
+ return rc;
+}
+
+/*
+** The journal file must be open when this is called. A journal header file
+** (JOURNAL_HDR_SZ bytes) is read from the current location in the journal
+** file. See comments above function writeJournalHdr() for a description of
+** the journal header format.
+**
+** If the header is read successfully, *nRec is set to the number of
+** page records following this header and *dbSize is set to the size of the
+** database before the transaction began, in pages. Also, pPager->cksumInit
+** is set to the value read from the journal header. SQLITE_OK is returned
+** in this case.
+**
+** If the journal header file appears to be corrupted, SQLITE_DONE is
+** returned and *nRec and *dbSize are not set. If JOURNAL_HDR_SZ bytes
+** cannot be read from the journal file an error code is returned.
+*/
+static int readJournalHdr(
+ Pager *pPager,
+ i64 journalSize,
+ u32 *pNRec,
+ u32 *pDbSize
+){
+ int rc;
+ unsigned char aMagic[8]; /* A buffer to hold the magic header */
+
+ rc = seekJournalHdr(pPager);
+ if( rc ) return rc;
+
+ if( pPager->journalOff+JOURNAL_HDR_SZ(pPager) > journalSize ){
+ return SQLITE_DONE;
+ }
+
+ rc = sqlite3OsRead(&pPager->jfd, aMagic, sizeof(aMagic));
+ if( rc ) return rc;
+
+ if( memcmp(aMagic, aJournalMagic, sizeof(aMagic))!=0 ){
+ return SQLITE_DONE;
+ }
+
+ rc = read32bits(&pPager->jfd, pNRec);
+ if( rc ) return rc;
+
+ rc = read32bits(&pPager->jfd, &pPager->cksumInit);
+ if( rc ) return rc;
+
+ rc = read32bits(&pPager->jfd, pDbSize);
+ if( rc ) return rc;
+
+ /* Update the assumed sector-size to match the value used by
+ ** the process that created this journal. If this journal was
+ ** created by a process other than this one, then this routine
+ ** is being called from within pager_playback(). The local value
+ ** of Pager.sectorSize is restored at the end of that routine.
+ */
+ rc = read32bits(&pPager->jfd, (u32 *)&pPager->sectorSize);
+ if( rc ) return rc;
+
+ pPager->journalOff += JOURNAL_HDR_SZ(pPager);
+ rc = sqlite3OsSeek(&pPager->jfd, pPager->journalOff);
+ return rc;
+}
+
+
+/*
+** Write the supplied master journal name into the journal file for pager
+** pPager at the current location. The master journal name must be the last
+** thing written to a journal file. If the pager is in full-sync mode, the
+** journal file descriptor is advanced to the next sector boundary before
+** anything is written. The format is:
+**
+** + 4 bytes: PAGER_MJ_PGNO.
+** + N bytes: length of master journal name.
+** + 4 bytes: N
+** + 4 bytes: Master journal name checksum.
+** + 8 bytes: aJournalMagic[].
+**
+** The master journal page checksum is the sum of the bytes in the master
+** journal name.
+*/
+static int writeMasterJournal(Pager *pPager, const char *zMaster){
+ int rc;
+ int len;
+ int i;
+ u32 cksum = 0;
+
+ if( !zMaster || pPager->setMaster) return SQLITE_OK;
+ pPager->setMaster = 1;
+
+ len = strlen(zMaster);
+ for(i=0; i<len; i++){
+ cksum += zMaster[i];
+ }
+
+ /* If in full-sync mode, advance to the next disk sector before writing
+ ** the master journal name. This is in case the previous page written to
+ ** the journal has already been synced.
+ */
+ if( pPager->fullSync ){
+ rc = seekJournalHdr(pPager);
+ if( rc!=SQLITE_OK ) return rc;
+ }
+ pPager->journalOff += (len+20);
+
+ rc = write32bits(&pPager->jfd, PAGER_MJ_PGNO(pPager));
+ if( rc!=SQLITE_OK ) return rc;
+
+ rc = sqlite3OsWrite(&pPager->jfd, zMaster, len);
+ if( rc!=SQLITE_OK ) return rc;
+
+ rc = write32bits(&pPager->jfd, len);
+ if( rc!=SQLITE_OK ) return rc;
+
+ rc = write32bits(&pPager->jfd, cksum);
+ if( rc!=SQLITE_OK ) return rc;
+
+ rc = sqlite3OsWrite(&pPager->jfd, aJournalMagic, sizeof(aJournalMagic));
+ pPager->needSync = !pPager->noSync;
+ return rc;
+}
+
+/*
+** Add or remove a page from the list of all pages that are in the
+** statement journal.
+**
+** The Pager keeps a separate list of pages that are currently in
+** the statement journal. This helps the sqlite3pager_stmt_commit()
+** routine run MUCH faster for the common case where there are many
+** pages in memory but only a few are in the statement journal.
+*/
+static void page_add_to_stmt_list(PgHdr *pPg){
+ Pager *pPager = pPg->pPager;
+ if( pPg->inStmt ) return;
+ assert( pPg->pPrevStmt==0 && pPg->pNextStmt==0 );
+ pPg->pPrevStmt = 0;
+ if( pPager->pStmt ){
+ pPager->pStmt->pPrevStmt = pPg;
+ }
+ pPg->pNextStmt = pPager->pStmt;
+ pPager->pStmt = pPg;
+ pPg->inStmt = 1;
+}
+static void page_remove_from_stmt_list(PgHdr *pPg){
+ if( !pPg->inStmt ) return;
+ if( pPg->pPrevStmt ){
+ assert( pPg->pPrevStmt->pNextStmt==pPg );
+ pPg->pPrevStmt->pNextStmt = pPg->pNextStmt;
+ }else{
+ assert( pPg->pPager->pStmt==pPg );
+ pPg->pPager->pStmt = pPg->pNextStmt;
+ }
+ if( pPg->pNextStmt ){
+ assert( pPg->pNextStmt->pPrevStmt==pPg );
+ pPg->pNextStmt->pPrevStmt = pPg->pPrevStmt;
+ }
+ pPg->pNextStmt = 0;
+ pPg->pPrevStmt = 0;
+ pPg->inStmt = 0;
+}
+
+/*
+** Find a page in the hash table given its page number. Return
+** a pointer to the page or NULL if not found.
+*/
+static PgHdr *pager_lookup(Pager *pPager, Pgno pgno){
+ PgHdr *p = pPager->aHash[pager_hash(pgno)];
+ while( p && p->pgno!=pgno ){
+ p = p->pNextHash;
+ }
+ return p;
+}
+
+/*
+** Unlock the database and clear the in-memory cache. This routine
+** sets the state of the pager back to what it was when it was first
+** opened. Any outstanding pages are invalidated and subsequent attempts
+** to access those pages will likely result in a coredump.
+*/
+static void pager_reset(Pager *pPager){
+ PgHdr *pPg, *pNext;
+ if( pPager->errMask ) return;
+ for(pPg=pPager->pAll; pPg; pPg=pNext){
+ pNext = pPg->pNextAll;
+ sqliteFree(pPg);
+ }
+ pPager->pFirst = 0;
+ pPager->pFirstSynced = 0;
+ pPager->pLast = 0;
+ pPager->pAll = 0;
+ memset(pPager->aHash, 0, sizeof(pPager->aHash));
+ pPager->nPage = 0;
+ if( pPager->state>=PAGER_RESERVED ){
+ sqlite3pager_rollback(pPager);
+ }
+ sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ pPager->state = PAGER_UNLOCK;
+ pPager->dbSize = -1;
+ pPager->nRef = 0;
+ assert( pPager->journalOpen==0 );
+}
+
+/*
+** This function is used to reset the pager after a malloc() failure. This
+** doesn't work with in-memory databases. If a malloc() fails when an
+** in-memory database is in use it is not possible to recover.
+**
+** If a transaction or statement transaction is active, it is rolled back.
+**
+** It is an error to call this function if any pages are in use.
+*/
+#ifndef SQLITE_OMIT_GLOBALRECOVER
+int sqlite3pager_reset(Pager *pPager){
+ if( pPager ){
+ if( pPager->nRef || MEMDB ){
+ return SQLITE_ERROR;
+ }
+ pPager->errMask &= ~(PAGER_ERR_MEM);
+ pager_reset(pPager);
+ }
+ return SQLITE_OK;
+}
+#endif
+
+
+/*
+** When this routine is called, the pager has the journal file open and
+** a RESERVED or EXCLUSIVE lock on the database. This routine releases
+** the database lock and acquires a SHARED lock in its place. The journal
+** file is deleted and closed.
+**
+** TODO: Consider keeping the journal file open for temporary databases.
+** This might give a performance improvement on windows where opening
+** a file is an expensive operation.
+*/
+static int pager_unwritelock(Pager *pPager){
+ PgHdr *pPg;
+ int rc;
+ assert( !MEMDB );
+ if( pPager->state<PAGER_RESERVED ){
+ return SQLITE_OK;
+ }
+ sqlite3pager_stmt_commit(pPager);
+ if( pPager->stmtOpen ){
+ sqlite3OsClose(&pPager->stfd);
+ pPager->stmtOpen = 0;
+ }
+ if( pPager->journalOpen ){
+ sqlite3OsClose(&pPager->jfd);
+ pPager->journalOpen = 0;
+ sqlite3OsDelete(pPager->zJournal);
+ sqliteFree( pPager->aInJournal );
+ pPager->aInJournal = 0;
+ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
+ pPg->inJournal = 0;
+ pPg->dirty = 0;
+ pPg->needSync = 0;
+#ifdef SQLITE_CHECK_PAGES
+ pPg->pageHash = pager_pagehash(pPg);
+#endif
+ }
+ pPager->dirtyCache = 0;
+ pPager->nRec = 0;
+ }else{
+ assert( pPager->aInJournal==0 );
+ assert( pPager->dirtyCache==0 || pPager->useJournal==0 );
+ }
+ rc = sqlite3OsUnlock(&pPager->fd, SHARED_LOCK);
+ pPager->state = PAGER_SHARED;
+ pPager->origDbSize = 0;
+ pPager->setMaster = 0;
+ return rc;
+}
+
+/*
+** Compute and return a checksum for the page of data.
+**
+** This is not a real checksum. It is really just the sum of the
+** random initial value and the page number. We experimented with
+** a checksum of the entire data, but that was found to be too slow.
+**
+** Note that the page number is stored at the beginning of data and
+** the checksum is stored at the end. This is important. If journal
+** corruption occurs due to a power failure, the most likely scenario
+** is that one end or the other of the record will be changed. It is
+** much less likely that the two ends of the journal record will be
+** correct and the middle be corrupt. Thus, this "checksum" scheme,
+** though fast and simple, catches the mostly likely kind of corruption.
+**
+** FIX ME: Consider adding every 200th (or so) byte of the data to the
+** checksum. That way if a single page spans 3 or more disk sectors and
+** only the middle sector is corrupt, we will still have a reasonable
+** chance of failing the checksum and thus detecting the problem.
+*/
+static u32 pager_cksum(Pager *pPager, Pgno pgno, const char *aData){
+ u32 cksum = pPager->cksumInit;
+ int i = pPager->pageSize-200;
+ while( i>0 ){
+ cksum += aData[i];
+ i -= 200;
+ }
+ return cksum;
+}
+
+/*
+** Read a single page from the journal file opened on file descriptor
+** jfd. Playback this one page.
+**
+** If useCksum==0 it means this journal does not use checksums. Checksums
+** are not used in statement journals because statement journals do not
+** need to survive power failures.
+*/
+static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
+ int rc;
+ PgHdr *pPg; /* An existing page in the cache */
+ Pgno pgno; /* The page number of a page in journal */
+ u32 cksum; /* Checksum used for sanity checking */
+ u8 aData[SQLITE_MAX_PAGE_SIZE]; /* Temp storage for a page */
+
+ /* useCksum should be true for the main journal and false for
+ ** statement journals. Verify that this is always the case
+ */
+ assert( jfd == (useCksum ? &pPager->jfd : &pPager->stfd) );
+
+
+ rc = read32bits(jfd, &pgno);
+ if( rc!=SQLITE_OK ) return rc;
+ rc = sqlite3OsRead(jfd, &aData, pPager->pageSize);
+ if( rc!=SQLITE_OK ) return rc;
+ pPager->journalOff += pPager->pageSize + 4;
+
+ /* Sanity checking on the page. This is more important that I originally
+ ** thought. If a power failure occurs while the journal is being written,
+ ** it could cause invalid data to be written into the journal. We need to
+ ** detect this invalid data (with high probability) and ignore it.
+ */
+ if( pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){
+ return SQLITE_DONE;
+ }
+ if( pgno>(unsigned)pPager->dbSize ){
+ return SQLITE_OK;
+ }
+ if( useCksum ){
+ rc = read32bits(jfd, &cksum);
+ if( rc ) return rc;
+ pPager->journalOff += 4;
+ if( pager_cksum(pPager, pgno, aData)!=cksum ){
+ return SQLITE_DONE;
+ }
+ }
+
+ assert( pPager->state==PAGER_RESERVED || pPager->state>=PAGER_EXCLUSIVE );
+
+ /* If the pager is in RESERVED state, then there must be a copy of this
+ ** page in the pager cache. In this case just update the pager cache,
+ ** not the database file. The page is left marked dirty in this case.
+ **
+ ** If in EXCLUSIVE state, then we update the pager cache if it exists
+ ** and the main file. The page is then marked not dirty.
+ **
+ ** Ticket #1171: The statement journal might contain page content that is
+ ** different from the page content at the start of the transaction.
+ ** This occurs when a page is changed prior to the start of a statement
+ ** then changed again within the statement. When rolling back such a
+ ** statement we must not write to the original database unless we know
+ ** for certain that original page contents are in the main rollback
+ ** journal. Otherwise, if a full ROLLBACK occurs after the statement
+ ** rollback the full ROLLBACK will not restore the page to its original
+ ** content. Two conditions must be met before writing to the database
+ ** files. (1) the database must be locked. (2) we know that the original
+ ** page content is in the main journal either because the page is not in
+ ** cache or else it is marked as needSync==0.
+ */
+ pPg = pager_lookup(pPager, pgno);
+ assert( pPager->state>=PAGER_EXCLUSIVE || pPg!=0 );
+ TRACE3("PLAYBACK %d page %d\n", PAGERID(pPager), pgno);
+ if( pPager->state>=PAGER_EXCLUSIVE && (pPg==0 || pPg->needSync==0) ){
+ rc = sqlite3OsSeek(&pPager->fd, (pgno-1)*(i64)pPager->pageSize);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3OsWrite(&pPager->fd, aData, pPager->pageSize);
+ }
+ if( pPg ) pPg->dirty = 0;
+ }
+ if( pPg ){
+ /* No page should ever be explicitly rolled back that is in use, except
+ ** for page 1 which is held in use in order to keep the lock on the
+ ** database active. However such a page may be rolled back as a result
+ ** of an internal error resulting in an automatic call to
+ ** sqlite3pager_rollback().
+ */
+ void *pData;
+ /* assert( pPg->nRef==0 || pPg->pgno==1 ); */
+ pData = PGHDR_TO_DATA(pPg);
+ memcpy(pData, aData, pPager->pageSize);
+ if( pPager->xDestructor ){ /*** FIX ME: Should this be xReinit? ***/
+ pPager->xDestructor(pData, pPager->pageSize);
+ }
+#ifdef SQLITE_CHECK_PAGES
+ pPg->pageHash = pager_pagehash(pPg);
+#endif
+ CODEC(pPager, pData, pPg->pgno, 3);
+ }
+ return rc;
+}
+
+/*
+** Parameter zMaster is the name of a master journal file. A single journal
+** file that referred to the master journal file has just been rolled back.
+** This routine checks if it is possible to delete the master journal file,
+** and does so if it is.
+**
+** The master journal file contains the names of all child journals.
+** To tell if a master journal can be deleted, check to each of the
+** children. If all children are either missing or do not refer to
+** a different master journal, then this master journal can be deleted.
+*/
+static int pager_delmaster(const char *zMaster){
+ int rc;
+ int master_open = 0;
+ OsFile master;
+ char *zMasterJournal = 0; /* Contents of master journal file */
+ i64 nMasterJournal; /* Size of master journal file */
+
+ /* Open the master journal file exclusively in case some other process
+ ** is running this routine also. Not that it makes too much difference.
+ */
+ memset(&master, 0, sizeof(master));
+ rc = sqlite3OsOpenReadOnly(zMaster, &master);
+ if( rc!=SQLITE_OK ) goto delmaster_out;
+ master_open = 1;
+ rc = sqlite3OsFileSize(&master, &nMasterJournal);
+ if( rc!=SQLITE_OK ) goto delmaster_out;
+
+ if( nMasterJournal>0 ){
+ char *zJournal;
+ char *zMasterPtr = 0;
+
+ /* Load the entire master journal file into space obtained from
+ ** sqliteMalloc() and pointed to by zMasterJournal.
+ */
+ zMasterJournal = (char *)sqliteMalloc(nMasterJournal);
+ if( !zMasterJournal ){
+ rc = SQLITE_NOMEM;
+ goto delmaster_out;
+ }
+ rc = sqlite3OsRead(&master, zMasterJournal, nMasterJournal);
+ if( rc!=SQLITE_OK ) goto delmaster_out;
+
+ zJournal = zMasterJournal;
+ while( (zJournal-zMasterJournal)<nMasterJournal ){
+ if( sqlite3OsFileExists(zJournal) ){
+ /* One of the journals pointed to by the master journal exists.
+ ** Open it and check if it points at the master journal. If
+ ** so, return without deleting the master journal file.
+ */
+ OsFile journal;
+ int c;
+
+ memset(&journal, 0, sizeof(journal));
+ rc = sqlite3OsOpenReadOnly(zJournal, &journal);
+ if( rc!=SQLITE_OK ){
+ goto delmaster_out;
+ }
+
+ rc = readMasterJournal(&journal, &zMasterPtr);
+ sqlite3OsClose(&journal);
+ if( rc!=SQLITE_OK ){
+ goto delmaster_out;
+ }
+
+ c = zMasterPtr!=0 && strcmp(zMasterPtr, zMaster)==0;
+ sqliteFree(zMasterPtr);
+ if( c ){
+ /* We have a match. Do not delete the master journal file. */
+ goto delmaster_out;
+ }
+ }
+ zJournal += (strlen(zJournal)+1);
+ }
+ }
+
+ sqlite3OsDelete(zMaster);
+
+delmaster_out:
+ if( zMasterJournal ){
+ sqliteFree(zMasterJournal);
+ }
+ if( master_open ){
+ sqlite3OsClose(&master);
+ }
+ return rc;
+}
+
+/*
+** Make every page in the cache agree with what is on disk. In other words,
+** reread the disk to reset the state of the cache.
+**
+** This routine is called after a rollback in which some of the dirty cache
+** pages had never been written out to disk. We need to roll back the
+** cache content and the easiest way to do that is to reread the old content
+** back from the disk.
+*/
+static int pager_reload_cache(Pager *pPager){
+ PgHdr *pPg;
+ int rc = SQLITE_OK;
+ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
+ char zBuf[SQLITE_MAX_PAGE_SIZE];
+ if( !pPg->dirty ) continue;
+ if( (int)pPg->pgno <= pPager->origDbSize ){
+ rc = sqlite3OsSeek(&pPager->fd, pPager->pageSize*(i64)(pPg->pgno-1));
+ if( rc==SQLITE_OK ){
+ rc = sqlite3OsRead(&pPager->fd, zBuf, pPager->pageSize);
+ }
+ TRACE3("REFETCH %d page %d\n", PAGERID(pPager), pPg->pgno);
+ if( rc ) break;
+ CODEC(pPager, zBuf, pPg->pgno, 2);
+ }else{
+ memset(zBuf, 0, pPager->pageSize);
+ }
+ if( pPg->nRef==0 || memcmp(zBuf, PGHDR_TO_DATA(pPg), pPager->pageSize) ){
+ memcpy(PGHDR_TO_DATA(pPg), zBuf, pPager->pageSize);
+ if( pPager->xReiniter ){
+ pPager->xReiniter(PGHDR_TO_DATA(pPg), pPager->pageSize);
+ }else{
+ memset(PGHDR_TO_EXTRA(pPg, pPager), 0, pPager->nExtra);
+ }
+ }
+ pPg->needSync = 0;
+ pPg->dirty = 0;
+#ifdef SQLITE_CHECK_PAGES
+ pPg->pageHash = pager_pagehash(pPg);
+#endif
+ }
+ return rc;
+}
+
+/*
+** Truncate the main file of the given pager to the number of pages
+** indicated.
+*/
+static int pager_truncate(Pager *pPager, int nPage){
+ assert( pPager->state>=PAGER_EXCLUSIVE );
+ return sqlite3OsTruncate(&pPager->fd, pPager->pageSize*(i64)nPage);
+}
+
+/*
+** Playback the journal and thus restore the database file to
+** the state it was in before we started making changes.
+**
+** The journal file format is as follows:
+**
+** (1) 8 byte prefix. A copy of aJournalMagic[].
+** (2) 4 byte big-endian integer which is the number of valid page records
+** in the journal. If this value is 0xffffffff, then compute the
+** number of page records from the journal size.
+** (3) 4 byte big-endian integer which is the initial value for the
+** sanity checksum.
+** (4) 4 byte integer which is the number of pages to truncate the
+** database to during a rollback.
+** (5) 4 byte integer which is the number of bytes in the master journal
+** name. The value may be zero (indicate that there is no master
+** journal.)
+** (6) N bytes of the master journal name. The name will be nul-terminated
+** and might be shorter than the value read from (5). If the first byte
+** of the name is \000 then there is no master journal. The master
+** journal name is stored in UTF-8.
+** (7) Zero or more pages instances, each as follows:
+** + 4 byte page number.
+** + pPager->pageSize bytes of data.
+** + 4 byte checksum
+**
+** When we speak of the journal header, we mean the first 6 items above.
+** Each entry in the journal is an instance of the 7th item.
+**
+** Call the value from the second bullet "nRec". nRec is the number of
+** valid page entries in the journal. In most cases, you can compute the
+** value of nRec from the size of the journal file. But if a power
+** failure occurred while the journal was being written, it could be the
+** case that the size of the journal file had already been increased but
+** the extra entries had not yet made it safely to disk. In such a case,
+** the value of nRec computed from the file size would be too large. For
+** that reason, we always use the nRec value in the header.
+**
+** If the nRec value is 0xffffffff it means that nRec should be computed
+** from the file size. This value is used when the user selects the
+** no-sync option for the journal. A power failure could lead to corruption
+** in this case. But for things like temporary table (which will be
+** deleted when the power is restored) we don't care.
+**
+** If the file opened as the journal file is not a well-formed
+** journal file then all pages up to the first corrupted page are rolled
+** back (or no pages if the journal header is corrupted). The journal file
+** is then deleted and SQLITE_OK returned, just as if no corruption had
+** been encountered.
+**
+** If an I/O or malloc() error occurs, the journal-file is not deleted
+** and an error code is returned.
+*/
+static int pager_playback(Pager *pPager){
+ i64 szJ; /* Size of the journal file in bytes */
+ u32 nRec; /* Number of Records in the journal */
+ int i; /* Loop counter */
+ Pgno mxPg = 0; /* Size of the original file in pages */
+ int rc; /* Result code of a subroutine */
+ char *zMaster = 0; /* Name of master journal file if any */
+
+ /* Figure out how many records are in the journal. Abort early if
+ ** the journal is empty.
+ */
+ assert( pPager->journalOpen );
+ rc = sqlite3OsFileSize(&pPager->jfd, &szJ);
+ if( rc!=SQLITE_OK ){
+ goto end_playback;
+ }
+
+ /* Read the master journal name from the journal, if it is present.
+ ** If a master journal file name is specified, but the file is not
+ ** present on disk, then the journal is not hot and does not need to be
+ ** played back.
+ */
+ rc = readMasterJournal(&pPager->jfd, &zMaster);
+ assert( rc!=SQLITE_DONE );
+ if( rc!=SQLITE_OK || (zMaster && !sqlite3OsFileExists(zMaster)) ){
+ sqliteFree(zMaster);
+ zMaster = 0;
+ if( rc==SQLITE_DONE ) rc = SQLITE_OK;
+ goto end_playback;
+ }
+ sqlite3OsSeek(&pPager->jfd, 0);
+ pPager->journalOff = 0;
+
+ /* This loop terminates either when the readJournalHdr() call returns
+ ** SQLITE_DONE or an IO error occurs. */
+ while( 1 ){
+
+ /* Read the next journal header from the journal file. If there are
+ ** not enough bytes left in the journal file for a complete header, or
+ ** it is corrupted, then a process must of failed while writing it.
+ ** This indicates nothing more needs to be rolled back.
+ */
+ rc = readJournalHdr(pPager, szJ, &nRec, &mxPg);
+ if( rc!=SQLITE_OK ){
+ if( rc==SQLITE_DONE ){
+ rc = SQLITE_OK;
+ }
+ goto end_playback;
+ }
+
+ /* If nRec is 0xffffffff, then this journal was created by a process
+ ** working in no-sync mode. This means that the rest of the journal
+ ** file consists of pages, there are no more journal headers. Compute
+ ** the value of nRec based on this assumption.
+ */
+ if( nRec==0xffffffff ){
+ assert( pPager->journalOff==JOURNAL_HDR_SZ(pPager) );
+ nRec = (szJ - JOURNAL_HDR_SZ(pPager))/JOURNAL_PG_SZ(pPager);
+ }
+
+ /* If this is the first header read from the journal, truncate the
+ ** database file back to it's original size.
+ */
+ if( pPager->state>=PAGER_EXCLUSIVE &&
+ pPager->journalOff==JOURNAL_HDR_SZ(pPager) ){
+ assert( pPager->origDbSize==0 || pPager->origDbSize==mxPg );
+ rc = pager_truncate(pPager, mxPg);
+ if( rc!=SQLITE_OK ){
+ goto end_playback;
+ }
+ pPager->dbSize = mxPg;
+ }
+
+ /* rc = sqlite3OsSeek(&pPager->jfd, JOURNAL_HDR_SZ(pPager)); */
+ if( rc!=SQLITE_OK ) goto end_playback;
+
+ /* Copy original pages out of the journal and back into the database file.
+ */
+ for(i=0; i<nRec; i++){
+ rc = pager_playback_one_page(pPager, &pPager->jfd, 1);
+ if( rc!=SQLITE_OK ){
+ if( rc==SQLITE_DONE ){
+ rc = SQLITE_OK;
+ pPager->journalOff = szJ;
+ break;
+ }else{
+ goto end_playback;
+ }
+ }
+ }
+ }
+
+ /* Pages that have been written to the journal but never synced
+ ** where not restored by the loop above. We have to restore those
+ ** pages by reading them back from the original database.
+ */
+ assert( rc==SQLITE_OK );
+ pager_reload_cache(pPager);
+
+end_playback:
+ if( rc==SQLITE_OK ){
+ rc = pager_unwritelock(pPager);
+ }
+ if( zMaster ){
+ /* If there was a master journal and this routine will return true,
+ ** see if it is possible to delete the master journal.
+ */
+ if( rc==SQLITE_OK ){
+ rc = pager_delmaster(zMaster);
+ }
+ sqliteFree(zMaster);
+ }
+
+ /* The Pager.sectorSize variable may have been updated while rolling
+ ** back a journal created by a process with a different PAGER_SECTOR_SIZE
+ ** value. Reset it to the correct value for this process.
+ */
+ pPager->sectorSize = PAGER_SECTOR_SIZE;
+ return rc;
+}
+
+/*
+** Playback the statement journal.
+**
+** This is similar to playing back the transaction journal but with
+** a few extra twists.
+**
+** (1) The number of pages in the database file at the start of
+** the statement is stored in pPager->stmtSize, not in the
+** journal file itself.
+**
+** (2) In addition to playing back the statement journal, also
+** playback all pages of the transaction journal beginning
+** at offset pPager->stmtJSize.
+*/
+static int pager_stmt_playback(Pager *pPager){
+ i64 szJ; /* Size of the full journal */
+ i64 hdrOff;
+ int nRec; /* Number of Records */
+ int i; /* Loop counter */
+ int rc;
+
+ szJ = pPager->journalOff;
+#ifndef NDEBUG
+ {
+ i64 os_szJ;
+ rc = sqlite3OsFileSize(&pPager->jfd, &os_szJ);
+ if( rc!=SQLITE_OK ) return rc;
+ assert( szJ==os_szJ );
+ }
+#endif
+
+ /* Set hdrOff to be the offset to the first journal header written
+ ** this statement transaction, or the end of the file if no journal
+ ** header was written.
+ */
+ hdrOff = pPager->stmtHdrOff;
+ assert( pPager->fullSync || !hdrOff );
+ if( !hdrOff ){
+ hdrOff = szJ;
+ }
+
+ /* Truncate the database back to its original size.
+ */
+ if( pPager->state>=PAGER_EXCLUSIVE ){
+ rc = pager_truncate(pPager, pPager->stmtSize);
+ }
+ pPager->dbSize = pPager->stmtSize;
+
+ /* Figure out how many records are in the statement journal.
+ */
+ assert( pPager->stmtInUse && pPager->journalOpen );
+ sqlite3OsSeek(&pPager->stfd, 0);
+ nRec = pPager->stmtNRec;
+
+ /* Copy original pages out of the statement journal and back into the
+ ** database file. Note that the statement journal omits checksums from
+ ** each record since power-failure recovery is not important to statement
+ ** journals.
+ */
+ for(i=nRec-1; i>=0; i--){
+ rc = pager_playback_one_page(pPager, &pPager->stfd, 0);
+ assert( rc!=SQLITE_DONE );
+ if( rc!=SQLITE_OK ) goto end_stmt_playback;
+ }
+
+ /* Now roll some pages back from the transaction journal. Pager.stmtJSize
+ ** was the size of the journal file when this statement was started, so
+ ** everything after that needs to be rolled back, either into the
+ ** database, the memory cache, or both.
+ **
+ ** If it is not zero, then Pager.stmtHdrOff is the offset to the start
+ ** of the first journal header written during this statement transaction.
+ */
+ rc = sqlite3OsSeek(&pPager->jfd, pPager->stmtJSize);
+ if( rc!=SQLITE_OK ){
+ goto end_stmt_playback;
+ }
+ pPager->journalOff = pPager->stmtJSize;
+ pPager->cksumInit = pPager->stmtCksum;
+ assert( JOURNAL_HDR_SZ(pPager)<(pPager->pageSize+8) );
+ while( pPager->journalOff <= (hdrOff-(pPager->pageSize+8)) ){
+ rc = pager_playback_one_page(pPager, &pPager->jfd, 1);
+ assert( rc!=SQLITE_DONE );
+ if( rc!=SQLITE_OK ) goto end_stmt_playback;
+ }
+
+ while( pPager->journalOff < szJ ){
+ u32 nRec;
+ u32 dummy;
+ rc = readJournalHdr(pPager, szJ, &nRec, &dummy);
+ if( rc!=SQLITE_OK ){
+ assert( rc!=SQLITE_DONE );
+ goto end_stmt_playback;
+ }
+ if( nRec==0 ){
+ nRec = (szJ - pPager->journalOff) / (pPager->pageSize+8);
+ }
+ for(i=nRec-1; i>=0 && pPager->journalOff < szJ; i--){
+ rc = pager_playback_one_page(pPager, &pPager->jfd, 1);
+ assert( rc!=SQLITE_DONE );
+ if( rc!=SQLITE_OK ) goto end_stmt_playback;
+ }
+ }
+
+ pPager->journalOff = szJ;
+
+end_stmt_playback:
+ if( rc!=SQLITE_OK ){
+ pPager->errMask |= PAGER_ERR_CORRUPT;
+ rc = SQLITE_CORRUPT;
+ }else{
+ pPager->journalOff = szJ;
+ /* pager_reload_cache(pPager); */
+ }
+ return rc;
+}
+
+/*
+** Change the maximum number of in-memory pages that are allowed.
+*/
+void sqlite3pager_set_cachesize(Pager *pPager, int mxPage){
+ if( mxPage>10 ){
+ pPager->mxPage = mxPage;
+ }else{
+ pPager->mxPage = 10;
+ }
+}
+
+/*
+** Adjust the robustness of the database to damage due to OS crashes
+** or power failures by changing the number of syncs()s when writing
+** the rollback journal. There are three levels:
+**
+** OFF sqlite3OsSync() is never called. This is the default
+** for temporary and transient files.
+**
+** NORMAL The journal is synced once before writes begin on the
+** database. This is normally adequate protection, but
+** it is theoretically possible, though very unlikely,
+** that an inopertune power failure could leave the journal
+** in a state which would cause damage to the database
+** when it is rolled back.
+**
+** FULL The journal is synced twice before writes begin on the
+** database (with some additional information - the nRec field
+** of the journal header - being written in between the two
+** syncs). If we assume that writing a
+** single disk sector is atomic, then this mode provides
+** assurance that the journal will not be corrupted to the
+** point of causing damage to the database during rollback.
+**
+** Numeric values associated with these states are OFF==1, NORMAL=2,
+** and FULL=3.
+*/
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+void sqlite3pager_set_safety_level(Pager *pPager, int level){
+ pPager->noSync = level==1 || pPager->tempFile;
+ pPager->fullSync = level==3 && !pPager->tempFile;
+ if( pPager->noSync ) pPager->needSync = 0;
+}
+#endif
+
+/*
+** The following global variable is incremented whenever the library
+** attempts to open a temporary file. This information is used for
+** testing and analysis only.
+*/
+int sqlite3_opentemp_count = 0;
+
+/*
+** Open a temporary file. Write the name of the file into zFile
+** (zFile must be at least SQLITE_TEMPNAME_SIZE bytes long.) Write
+** the file descriptor into *fd. Return SQLITE_OK on success or some
+** other error code if we fail.
+**
+** The OS will automatically delete the temporary file when it is
+** closed.
+*/
+static int sqlite3pager_opentemp(char *zFile, OsFile *fd){
+ int cnt = 8;
+ int rc;
+ sqlite3_opentemp_count++; /* Used for testing and analysis only */
+ do{
+ cnt--;
+ sqlite3OsTempFileName(zFile);
+ rc = sqlite3OsOpenExclusive(zFile, fd, 1);
+ }while( cnt>0 && rc!=SQLITE_OK && rc!=SQLITE_NOMEM );
+ return rc;
+}
+
+/*
+** Create a new page cache and put a pointer to the page cache in *ppPager.
+** The file to be cached need not exist. The file is not locked until
+** the first call to sqlite3pager_get() and is only held open until the
+** last page is released using sqlite3pager_unref().
+**
+** If zFilename is NULL then a randomly-named temporary file is created
+** and used as the file to be cached. The file will be deleted
+** automatically when it is closed.
+**
+** If zFilename is ":memory:" then all information is held in cache.
+** It is never written to disk. This can be used to implement an
+** in-memory database.
+*/
+int sqlite3pager_open(
+ Pager **ppPager, /* Return the Pager structure here */
+ const char *zFilename, /* Name of the database file to open */
+ int nExtra, /* Extra bytes append to each in-memory page */
+ int flags /* flags controlling this file */
+){
+ Pager *pPager;
+ char *zFullPathname = 0;
+ int nameLen;
+ OsFile fd;
+ int rc = SQLITE_OK;
+ int i;
+ int tempFile = 0;
+ int memDb = 0;
+ int readOnly = 0;
+ int useJournal = (flags & PAGER_OMIT_JOURNAL)==0;
+ int noReadlock = (flags & PAGER_NO_READLOCK)!=0;
+ char zTemp[SQLITE_TEMPNAME_SIZE];
+
+ *ppPager = 0;
+ memset(&fd, 0, sizeof(fd));
+ if( sqlite3_malloc_failed ){
+ return SQLITE_NOMEM;
+ }
+ if( zFilename && zFilename[0] ){
+#ifndef SQLITE_OMIT_MEMORYDB
+ if( strcmp(zFilename,":memory:")==0 ){
+ memDb = 1;
+ zFullPathname = sqliteStrDup("");
+ rc = SQLITE_OK;
+ }else
+#endif
+ {
+ zFullPathname = sqlite3OsFullPathname(zFilename);
+ if( zFullPathname ){
+ rc = sqlite3OsOpenReadWrite(zFullPathname, &fd, &readOnly);
+ }
+ }
+ }else{
+ rc = sqlite3pager_opentemp(zTemp, &fd);
+ zFilename = zTemp;
+ zFullPathname = sqlite3OsFullPathname(zFilename);
+ if( rc==SQLITE_OK ){
+ tempFile = 1;
+ }
+ }
+ if( !zFullPathname ){
+ sqlite3OsClose(&fd);
+ return SQLITE_NOMEM;
+ }
+ if( rc!=SQLITE_OK ){
+ sqlite3OsClose(&fd);
+ sqliteFree(zFullPathname);
+ return rc;
+ }
+ nameLen = strlen(zFullPathname);
+ pPager = sqliteMalloc( sizeof(*pPager) + nameLen*3 + 30 );
+ if( pPager==0 ){
+ sqlite3OsClose(&fd);
+ sqliteFree(zFullPathname);
+ return SQLITE_NOMEM;
+ }
+ TRACE3("OPEN %d %s\n", FILEHANDLEID(fd), zFullPathname);
+ pPager->zFilename = (char*)&pPager[1];
+ pPager->zDirectory = &pPager->zFilename[nameLen+1];
+ pPager->zJournal = &pPager->zDirectory[nameLen+1];
+ strcpy(pPager->zFilename, zFullPathname);
+ strcpy(pPager->zDirectory, zFullPathname);
+ for(i=nameLen; i>0 && pPager->zDirectory[i-1]!='/'; i--){}
+ if( i>0 ) pPager->zDirectory[i-1] = 0;
+ strcpy(pPager->zJournal, zFullPathname);
+ sqliteFree(zFullPathname);
+ strcpy(&pPager->zJournal[nameLen], "-journal");
+ pPager->fd = fd;
+#if OS_UNIX
+ pPager->fd.pPager = pPager;
+#endif
+ pPager->journalOpen = 0;
+ pPager->useJournal = useJournal && !memDb;
+ pPager->noReadlock = noReadlock && readOnly;
+ pPager->stmtOpen = 0;
+ pPager->stmtInUse = 0;
+ pPager->nRef = 0;
+ pPager->dbSize = memDb-1;
+ pPager->pageSize = SQLITE_DEFAULT_PAGE_SIZE;
+ pPager->stmtSize = 0;
+ pPager->stmtJSize = 0;
+ pPager->nPage = 0;
+ pPager->nMaxPage = 0;
+ pPager->mxPage = 100;
+ pPager->state = PAGER_UNLOCK;
+ pPager->errMask = 0;
+ pPager->tempFile = tempFile;
+ pPager->memDb = memDb;
+ pPager->readOnly = readOnly;
+ pPager->needSync = 0;
+ pPager->noSync = pPager->tempFile || !useJournal;
+ pPager->fullSync = (pPager->noSync?0:1);
+ pPager->pFirst = 0;
+ pPager->pFirstSynced = 0;
+ pPager->pLast = 0;
+ pPager->nExtra = FORCE_ALIGNMENT(nExtra);
+ pPager->sectorSize = PAGER_SECTOR_SIZE;
+ pPager->pBusyHandler = 0;
+ memset(pPager->aHash, 0, sizeof(pPager->aHash));
+ *ppPager = pPager;
+ return SQLITE_OK;
+}
+
+/*
+** Set the busy handler function.
+*/
+void sqlite3pager_set_busyhandler(Pager *pPager, BusyHandler *pBusyHandler){
+ pPager->pBusyHandler = pBusyHandler;
+}
+
+/*
+** Set the destructor for this pager. If not NULL, the destructor is called
+** when the reference count on each page reaches zero. The destructor can
+** be used to clean up information in the extra segment appended to each page.
+**
+** The destructor is not called as a result sqlite3pager_close().
+** Destructors are only called by sqlite3pager_unref().
+*/
+void sqlite3pager_set_destructor(Pager *pPager, void (*xDesc)(void*,int)){
+ pPager->xDestructor = xDesc;
+}
+
+/*
+** Set the reinitializer for this pager. If not NULL, the reinitializer
+** is called when the content of a page in cache is restored to its original
+** value as a result of a rollback. The callback gives higher-level code
+** an opportunity to restore the EXTRA section to agree with the restored
+** page data.
+*/
+void sqlite3pager_set_reiniter(Pager *pPager, void (*xReinit)(void*,int)){
+ pPager->xReiniter = xReinit;
+}
+
+/*
+** Set the page size. Return the new size. If the suggest new page
+** size is inappropriate, then an alternative page size is selected
+** and returned.
+*/
+int sqlite3pager_set_pagesize(Pager *pPager, int pageSize){
+ assert( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE );
+ if( !pPager->memDb ){
+ pPager->pageSize = pageSize;
+ }
+ return pPager->pageSize;
+}
+
+/*
+** Read the first N bytes from the beginning of the file into memory
+** that pDest points to. No error checking is done.
+*/
+void sqlite3pager_read_fileheader(Pager *pPager, int N, unsigned char *pDest){
+ memset(pDest, 0, N);
+ if( MEMDB==0 ){
+ sqlite3OsSeek(&pPager->fd, 0);
+ sqlite3OsRead(&pPager->fd, pDest, N);
+ }
+}
+
+/*
+** Return the total number of pages in the disk file associated with
+** pPager.
+**
+** If the PENDING_BYTE lies on the page directly after the end of the
+** file, then consider this page part of the file too. For example, if
+** PENDING_BYTE is byte 4096 (the first byte of page 5) and the size of the
+** file is 4096 bytes, 5 is returned instead of 4.
+*/
+int sqlite3pager_pagecount(Pager *pPager){
+ i64 n;
+ assert( pPager!=0 );
+ if( pPager->dbSize>=0 ){
+ n = pPager->dbSize;
+ } else {
+ if( sqlite3OsFileSize(&pPager->fd, &n)!=SQLITE_OK ){
+ pPager->errMask |= PAGER_ERR_DISK;
+ return 0;
+ }
+ if( n>0 && n<pPager->pageSize ){
+ n = 1;
+ }else{
+ n /= pPager->pageSize;
+ }
+ if( pPager->state!=PAGER_UNLOCK ){
+ pPager->dbSize = n;
+ }
+ }
+ if( n==(PENDING_BYTE/pPager->pageSize) ){
+ n++;
+ }
+ return n;
+}
+
+/*
+** Forward declaration
+*/
+static int syncJournal(Pager*);
+
+
+/*
+** Unlink pPg from it's hash chain. Also set the page number to 0 to indicate
+** that the page is not part of any hash chain. This is required because the
+** sqlite3pager_movepage() routine can leave a page in the
+** pNextFree/pPrevFree list that is not a part of any hash-chain.
+*/
+static void unlinkHashChain(Pager *pPager, PgHdr *pPg){
+ if( pPg->pgno==0 ){
+ /* If the page number is zero, then this page is not in any hash chain. */
+ return;
+ }
+ if( pPg->pNextHash ){
+ pPg->pNextHash->pPrevHash = pPg->pPrevHash;
+ }
+ if( pPg->pPrevHash ){
+ assert( pPager->aHash[pager_hash(pPg->pgno)]!=pPg );
+ pPg->pPrevHash->pNextHash = pPg->pNextHash;
+ }else{
+ int h = pager_hash(pPg->pgno);
+ assert( pPager->aHash[h]==pPg );
+ pPager->aHash[h] = pPg->pNextHash;
+ }
+
+ pPg->pgno = 0;
+ pPg->pNextHash = pPg->pPrevHash = 0;
+}
+
+/*
+** Unlink a page from the free list (the list of all pages where nRef==0)
+** and from its hash collision chain.
+*/
+static void unlinkPage(PgHdr *pPg){
+ Pager *pPager = pPg->pPager;
+
+ /* Keep the pFirstSynced pointer pointing at the first synchronized page */
+ if( pPg==pPager->pFirstSynced ){
+ PgHdr *p = pPg->pNextFree;
+ while( p && p->needSync ){ p = p->pNextFree; }
+ pPager->pFirstSynced = p;
+ }
+
+ /* Unlink from the freelist */
+ if( pPg->pPrevFree ){
+ pPg->pPrevFree->pNextFree = pPg->pNextFree;
+ }else{
+ assert( pPager->pFirst==pPg );
+ pPager->pFirst = pPg->pNextFree;
+ }
+ if( pPg->pNextFree ){
+ pPg->pNextFree->pPrevFree = pPg->pPrevFree;
+ }else{
+ assert( pPager->pLast==pPg );
+ pPager->pLast = pPg->pPrevFree;
+ }
+ pPg->pNextFree = pPg->pPrevFree = 0;
+
+ /* Unlink from the pgno hash table */
+ unlinkHashChain(pPager, pPg);
+}
+
+#ifndef SQLITE_OMIT_MEMORYDB
+/*
+** This routine is used to truncate an in-memory database. Delete
+** all pages whose pgno is larger than pPager->dbSize and is unreferenced.
+** Referenced pages larger than pPager->dbSize are zeroed.
+*/
+static void memoryTruncate(Pager *pPager){
+ PgHdr *pPg;
+ PgHdr **ppPg;
+ int dbSize = pPager->dbSize;
+
+ ppPg = &pPager->pAll;
+ while( (pPg = *ppPg)!=0 ){
+ if( pPg->pgno<=dbSize ){
+ ppPg = &pPg->pNextAll;
+ }else if( pPg->nRef>0 ){
+ memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize);
+ ppPg = &pPg->pNextAll;
+ }else{
+ *ppPg = pPg->pNextAll;
+ unlinkPage(pPg);
+ sqliteFree(pPg);
+ pPager->nPage--;
+ }
+ }
+}
+#else
+#define memoryTruncate(p)
+#endif
+
+/*
+** Try to obtain a lock on a file. Invoke the busy callback if the lock
+** is currently not available. Repeat until the busy callback returns
+** false or until the lock succeeds.
+**
+** Return SQLITE_OK on success and an error code if we cannot obtain
+** the lock.
+*/
+static int pager_wait_on_lock(Pager *pPager, int locktype){
+ int rc;
+ assert( PAGER_SHARED==SHARED_LOCK );
+ assert( PAGER_RESERVED==RESERVED_LOCK );
+ assert( PAGER_EXCLUSIVE==EXCLUSIVE_LOCK );
+ if( pPager->state>=locktype ){
+ rc = SQLITE_OK;
+ }else{
+ do {
+ rc = sqlite3OsLock(&pPager->fd, locktype);
+ }while( rc==SQLITE_BUSY && sqlite3InvokeBusyHandler(pPager->pBusyHandler) );
+ if( rc==SQLITE_OK ){
+ pPager->state = locktype;
+ }
+ }
+ return rc;
+}
+
+/*
+** Truncate the file to the number of pages specified.
+*/
+int sqlite3pager_truncate(Pager *pPager, Pgno nPage){
+ int rc;
+ sqlite3pager_pagecount(pPager);
+ if( pPager->errMask!=0 ){
+ rc = pager_errcode(pPager);
+ return rc;
+ }
+ if( nPage>=(unsigned)pPager->dbSize ){
+ return SQLITE_OK;
+ }
+ if( MEMDB ){
+ pPager->dbSize = nPage;
+ memoryTruncate(pPager);
+ return SQLITE_OK;
+ }
+ rc = syncJournal(pPager);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+
+ /* Get an exclusive lock on the database before truncating. */
+ rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+
+ rc = pager_truncate(pPager, nPage);
+ if( rc==SQLITE_OK ){
+ pPager->dbSize = nPage;
+ }
+ return rc;
+}
+
+/*
+** Shutdown the page cache. Free all memory and close all files.
+**
+** If a transaction was in progress when this routine is called, that
+** transaction is rolled back. All outstanding pages are invalidated
+** and their memory is freed. Any attempt to use a page associated
+** with this page cache after this function returns will likely
+** result in a coredump.
+*/
+int sqlite3pager_close(Pager *pPager){
+ PgHdr *pPg, *pNext;
+ switch( pPager->state ){
+ case PAGER_RESERVED:
+ case PAGER_SYNCED:
+ case PAGER_EXCLUSIVE: {
+ /* We ignore any IO errors that occur during the rollback
+ ** operation. So disable IO error simulation so that testing
+ ** works more easily.
+ */
+#if defined(SQLITE_TEST) && (defined(OS_UNIX) || defined(OS_WIN))
+ extern int sqlite3_io_error_pending;
+ int ioerr_cnt = sqlite3_io_error_pending;
+ sqlite3_io_error_pending = -1;
+#endif
+ sqlite3pager_rollback(pPager);
+#if defined(SQLITE_TEST) && (defined(OS_UNIX) || defined(OS_WIN))
+ sqlite3_io_error_pending = ioerr_cnt;
+#endif
+ if( !MEMDB ){
+ sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ }
+ assert( pPager->errMask || pPager->journalOpen==0 );
+ break;
+ }
+ case PAGER_SHARED: {
+ if( !MEMDB ){
+ sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ }
+ break;
+ }
+ default: {
+ /* Do nothing */
+ break;
+ }
+ }
+ for(pPg=pPager->pAll; pPg; pPg=pNext){
+#ifndef NDEBUG
+ if( MEMDB ){
+ PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager);
+ assert( !pPg->alwaysRollback );
+ assert( !pHist->pOrig );
+ assert( !pHist->pStmt );
+ }
+#endif
+ pNext = pPg->pNextAll;
+ sqliteFree(pPg);
+ }
+ TRACE2("CLOSE %d\n", PAGERID(pPager));
+ assert( pPager->errMask || (pPager->journalOpen==0 && pPager->stmtOpen==0) );
+ if( pPager->journalOpen ){
+ sqlite3OsClose(&pPager->jfd);
+ }
+ sqliteFree(pPager->aInJournal);
+ if( pPager->stmtOpen ){
+ sqlite3OsClose(&pPager->stfd);
+ }
+ sqlite3OsClose(&pPager->fd);
+ /* Temp files are automatically deleted by the OS
+ ** if( pPager->tempFile ){
+ ** sqlite3OsDelete(pPager->zFilename);
+ ** }
+ */
+
+ sqliteFree(pPager);
+ return SQLITE_OK;
+}
+
+/*
+** Return the page number for the given page data.
+*/
+Pgno sqlite3pager_pagenumber(void *pData){
+ PgHdr *p = DATA_TO_PGHDR(pData);
+ return p->pgno;
+}
+
+/*
+** The page_ref() function increments the reference count for a page.
+** If the page is currently on the freelist (the reference count is zero) then
+** remove it from the freelist.
+**
+** For non-test systems, page_ref() is a macro that calls _page_ref()
+** online of the reference count is zero. For test systems, page_ref()
+** is a real function so that we can set breakpoints and trace it.
+*/
+static void _page_ref(PgHdr *pPg){
+ if( pPg->nRef==0 ){
+ /* The page is currently on the freelist. Remove it. */
+ if( pPg==pPg->pPager->pFirstSynced ){
+ PgHdr *p = pPg->pNextFree;
+ while( p && p->needSync ){ p = p->pNextFree; }
+ pPg->pPager->pFirstSynced = p;
+ }
+ if( pPg->pPrevFree ){
+ pPg->pPrevFree->pNextFree = pPg->pNextFree;
+ }else{
+ pPg->pPager->pFirst = pPg->pNextFree;
+ }
+ if( pPg->pNextFree ){
+ pPg->pNextFree->pPrevFree = pPg->pPrevFree;
+ }else{
+ pPg->pPager->pLast = pPg->pPrevFree;
+ }
+ pPg->pPager->nRef++;
+ }
+ pPg->nRef++;
+ REFINFO(pPg);
+}
+#ifdef SQLITE_DEBUG
+ static void page_ref(PgHdr *pPg){
+ if( pPg->nRef==0 ){
+ _page_ref(pPg);
+ }else{
+ pPg->nRef++;
+ REFINFO(pPg);
+ }
+ }
+#else
+# define page_ref(P) ((P)->nRef==0?_page_ref(P):(void)(P)->nRef++)
+#endif
+
+/*
+** Increment the reference count for a page. The input pointer is
+** a reference to the page data.
+*/
+int sqlite3pager_ref(void *pData){
+ PgHdr *pPg = DATA_TO_PGHDR(pData);
+ page_ref(pPg);
+ return SQLITE_OK;
+}
+
+/*
+** Sync the journal. In other words, make sure all the pages that have
+** been written to the journal have actually reached the surface of the
+** disk. It is not safe to modify the original database file until after
+** the journal has been synced. If the original database is modified before
+** the journal is synced and a power failure occurs, the unsynced journal
+** data would be lost and we would be unable to completely rollback the
+** database changes. Database corruption would occur.
+**
+** This routine also updates the nRec field in the header of the journal.
+** (See comments on the pager_playback() routine for additional information.)
+** If the sync mode is FULL, two syncs will occur. First the whole journal
+** is synced, then the nRec field is updated, then a second sync occurs.
+**
+** For temporary databases, we do not care if we are able to rollback
+** after a power failure, so sync occurs.
+**
+** This routine clears the needSync field of every page current held in
+** memory.
+*/
+static int syncJournal(Pager *pPager){
+ PgHdr *pPg;
+ int rc = SQLITE_OK;
+
+ /* Sync the journal before modifying the main database
+ ** (assuming there is a journal and it needs to be synced.)
+ */
+ if( pPager->needSync ){
+ if( !pPager->tempFile ){
+ assert( pPager->journalOpen );
+ /* assert( !pPager->noSync ); // noSync might be set if synchronous
+ ** was turned off after the transaction was started. Ticket #615 */
+#ifndef NDEBUG
+ {
+ /* Make sure the pPager->nRec counter we are keeping agrees
+ ** with the nRec computed from the size of the journal file.
+ */
+ i64 jSz;
+ rc = sqlite3OsFileSize(&pPager->jfd, &jSz);
+ if( rc!=0 ) return rc;
+ assert( pPager->journalOff==jSz );
+ }
+#endif
+ {
+ /* Write the nRec value into the journal file header. If in
+ ** full-synchronous mode, sync the journal first. This ensures that
+ ** all data has really hit the disk before nRec is updated to mark
+ ** it as a candidate for rollback.
+ */
+ if( pPager->fullSync ){
+ TRACE2("SYNC journal of %d\n", PAGERID(pPager));
+ rc = sqlite3OsSync(&pPager->jfd, 0);
+ if( rc!=0 ) return rc;
+ }
+ rc = sqlite3OsSeek(&pPager->jfd,
+ pPager->journalHdr + sizeof(aJournalMagic));
+ if( rc ) return rc;
+ rc = write32bits(&pPager->jfd, pPager->nRec);
+ if( rc ) return rc;
+
+ rc = sqlite3OsSeek(&pPager->jfd, pPager->journalOff);
+ if( rc ) return rc;
+ }
+ TRACE2("SYNC journal of %d\n", PAGERID(pPager));
+ rc = sqlite3OsSync(&pPager->jfd, pPager->fullSync);
+ if( rc!=0 ) return rc;
+ pPager->journalStarted = 1;
+ }
+ pPager->needSync = 0;
+
+ /* Erase the needSync flag from every page.
+ */
+ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
+ pPg->needSync = 0;
+ }
+ pPager->pFirstSynced = pPager->pFirst;
+ }
+
+#ifndef NDEBUG
+ /* If the Pager.needSync flag is clear then the PgHdr.needSync
+ ** flag must also be clear for all pages. Verify that this
+ ** invariant is true.
+ */
+ else{
+ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
+ assert( pPg->needSync==0 );
+ }
+ assert( pPager->pFirstSynced==pPager->pFirst );
+ }
+#endif
+
+ return rc;
+}
+
+/*
+** Given a list of pages (connected by the PgHdr.pDirty pointer) write
+** every one of those pages out to the database file and mark them all
+** as clean.
+*/
+static int pager_write_pagelist(PgHdr *pList){
+ Pager *pPager;
+ int rc;
+
+ if( pList==0 ) return SQLITE_OK;
+ pPager = pList->pPager;
+
+ /* At this point there may be either a RESERVED or EXCLUSIVE lock on the
+ ** database file. If there is already an EXCLUSIVE lock, the following
+ ** calls to sqlite3OsLock() are no-ops.
+ **
+ ** Moving the lock from RESERVED to EXCLUSIVE actually involves going
+ ** through an intermediate state PENDING. A PENDING lock prevents new
+ ** readers from attaching to the database but is unsufficient for us to
+ ** write. The idea of a PENDING lock is to prevent new readers from
+ ** coming in while we wait for existing readers to clear.
+ **
+ ** While the pager is in the RESERVED state, the original database file
+ ** is unchanged and we can rollback without having to playback the
+ ** journal into the original database file. Once we transition to
+ ** EXCLUSIVE, it means the database file has been changed and any rollback
+ ** will require a journal playback.
+ */
+ rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+
+ while( pList ){
+ assert( pList->dirty );
+ rc = sqlite3OsSeek(&pPager->fd, (pList->pgno-1)*(i64)pPager->pageSize);
+ if( rc ) return rc;
+ /* If there are dirty pages in the page cache with page numbers greater
+ ** than Pager.dbSize, this means sqlite3pager_truncate() was called to
+ ** make the file smaller (presumably by auto-vacuum code). Do not write
+ ** any such pages to the file.
+ */
+ if( pList->pgno<=pPager->dbSize ){
+ CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 6);
+ TRACE3("STORE %d page %d\n", PAGERID(pPager), pList->pgno);
+ rc = sqlite3OsWrite(&pPager->fd, PGHDR_TO_DATA(pList), pPager->pageSize);
+ CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 0);
+ TEST_INCR(pPager->nWrite);
+ }
+#ifndef NDEBUG
+ else{
+ TRACE3("NOSTORE %d page %d\n", PAGERID(pPager), pList->pgno);
+ }
+#endif
+ if( rc ) return rc;
+ pList->dirty = 0;
+#ifdef SQLITE_CHECK_PAGES
+ pList->pageHash = pager_pagehash(pList);
+#endif
+ pList = pList->pDirty;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Collect every dirty page into a dirty list and
+** return a pointer to the head of that list. All pages are
+** collected even if they are still in use.
+*/
+static PgHdr *pager_get_all_dirty_pages(Pager *pPager){
+ PgHdr *p, *pList;
+ pList = 0;
+ for(p=pPager->pAll; p; p=p->pNextAll){
+ if( p->dirty ){
+ p->pDirty = pList;
+ pList = p;
+ }
+ }
+ return pList;
+}
+
+/*
+** Return TRUE if there is a hot journal on the given pager.
+** A hot journal is one that needs to be played back.
+**
+** If the current size of the database file is 0 but a journal file
+** exists, that is probably an old journal left over from a prior
+** database with the same name. Just delete the journal.
+*/
+static int hasHotJournal(Pager *pPager){
+ if( !pPager->useJournal ) return 0;
+ if( !sqlite3OsFileExists(pPager->zJournal) ) return 0;
+ if( sqlite3OsCheckReservedLock(&pPager->fd) ) return 0;
+ if( sqlite3pager_pagecount(pPager)==0 ){
+ sqlite3OsDelete(pPager->zJournal);
+ return 0;
+ }else{
+ return 1;
+ }
+}
+
+/*
+** Acquire a page.
+**
+** A read lock on the disk file is obtained when the first page is acquired.
+** This read lock is dropped when the last page is released.
+**
+** A _get works for any page number greater than 0. If the database
+** file is smaller than the requested page, then no actual disk
+** read occurs and the memory image of the page is initialized to
+** all zeros. The extra data appended to a page is always initialized
+** to zeros the first time a page is loaded into memory.
+**
+** The acquisition might fail for several reasons. In all cases,
+** an appropriate error code is returned and *ppPage is set to NULL.
+**
+** See also sqlite3pager_lookup(). Both this routine and _lookup() attempt
+** to find a page in the in-memory cache first. If the page is not already
+** in memory, this routine goes to disk to read it in whereas _lookup()
+** just returns 0. This routine acquires a read-lock the first time it
+** has to go to disk, and could also playback an old journal if necessary.
+** Since _lookup() never goes to disk, it never has to deal with locks
+** or journal files.
+*/
+int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
+ PgHdr *pPg;
+ int rc;
+
+ /* The maximum page number is 2^31. Return SQLITE_CORRUPT if a page
+ ** number greater than this, or zero, is requested.
+ */
+ if( pgno>PAGER_MAX_PGNO || pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+
+ /* Make sure we have not hit any critical errors.
+ */
+ assert( pPager!=0 );
+ *ppPage = 0;
+ if( pPager->errMask & ~(PAGER_ERR_FULL) ){
+ return pager_errcode(pPager);
+ }
+
+ /* If this is the first page accessed, then get a SHARED lock
+ ** on the database file.
+ */
+ if( pPager->nRef==0 && !MEMDB ){
+ if( !pPager->noReadlock ){
+ rc = pager_wait_on_lock(pPager, SHARED_LOCK);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ }
+
+ /* If a journal file exists, and there is no RESERVED lock on the
+ ** database file, then it either needs to be played back or deleted.
+ */
+ if( hasHotJournal(pPager) ){
+ int rc;
+
+ /* Get an EXCLUSIVE lock on the database file. At this point it is
+ ** important that a RESERVED lock is not obtained on the way to the
+ ** EXCLUSIVE lock. If it were, another process might open the
+ ** database file, detect the RESERVED lock, and conclude that the
+ ** database is safe to read while this process is still rolling it
+ ** back.
+ **
+ ** Because the intermediate RESERVED lock is not requested, the
+ ** second process will get to this point in the code and fail to
+ ** obtain it's own EXCLUSIVE lock on the database file.
+ */
+ rc = sqlite3OsLock(&pPager->fd, EXCLUSIVE_LOCK);
+ if( rc!=SQLITE_OK ){
+ sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ pPager->state = PAGER_UNLOCK;
+ return rc;
+ }
+ pPager->state = PAGER_EXCLUSIVE;
+
+ /* Open the journal for reading only. Return SQLITE_BUSY if
+ ** we are unable to open the journal file.
+ **
+ ** The journal file does not need to be locked itself. The
+ ** journal file is never open unless the main database file holds
+ ** a write lock, so there is never any chance of two or more
+ ** processes opening the journal at the same time.
+ */
+ rc = sqlite3OsOpenReadOnly(pPager->zJournal, &pPager->jfd);
+ if( rc!=SQLITE_OK ){
+ sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ pPager->state = PAGER_UNLOCK;
+ return SQLITE_BUSY;
+ }
+ pPager->journalOpen = 1;
+ pPager->journalStarted = 0;
+ pPager->journalOff = 0;
+ pPager->setMaster = 0;
+ pPager->journalHdr = 0;
+
+ /* Playback and delete the journal. Drop the database write
+ ** lock and reacquire the read lock.
+ */
+ rc = pager_playback(pPager);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ }
+ pPg = 0;
+ }else{
+ /* Search for page in cache */
+ pPg = pager_lookup(pPager, pgno);
+ if( MEMDB && pPager->state==PAGER_UNLOCK ){
+ pPager->state = PAGER_SHARED;
+ }
+ }
+ if( pPg==0 ){
+ /* The requested page is not in the page cache. */
+ int h;
+ TEST_INCR(pPager->nMiss);
+ if( pPager->nPage<pPager->mxPage || pPager->pFirst==0 || MEMDB ){
+ /* Create a new page */
+ pPg = sqliteMallocRaw( sizeof(*pPg) + pPager->pageSize
+ + sizeof(u32) + pPager->nExtra
+ + MEMDB*sizeof(PgHistory) );
+ if( pPg==0 ){
+ pPager->errMask |= PAGER_ERR_MEM;
+ return SQLITE_NOMEM;
+ }
+ memset(pPg, 0, sizeof(*pPg));
+ if( MEMDB ){
+ memset(PGHDR_TO_HIST(pPg, pPager), 0, sizeof(PgHistory));
+ }
+ pPg->pPager = pPager;
+ pPg->pNextAll = pPager->pAll;
+ pPager->pAll = pPg;
+ pPager->nPage++;
+ if( pPager->nPage>pPager->nMaxPage ){
+ assert( pPager->nMaxPage==(pPager->nPage-1) );
+ pPager->nMaxPage++;
+ }
+ }else{
+ /* Find a page to recycle. Try to locate a page that does not
+ ** require us to do an fsync() on the journal.
+ */
+ pPg = pPager->pFirstSynced;
+
+ /* If we could not find a page that does not require an fsync()
+ ** on the journal file then fsync the journal file. This is a
+ ** very slow operation, so we work hard to avoid it. But sometimes
+ ** it can't be helped.
+ */
+ if( pPg==0 ){
+ int rc = syncJournal(pPager);
+ if( rc!=0 ){
+ sqlite3pager_rollback(pPager);
+ return SQLITE_IOERR;
+ }
+ if( pPager->fullSync ){
+ /* If in full-sync mode, write a new journal header into the
+ ** journal file. This is done to avoid ever modifying a journal
+ ** header that is involved in the rollback of pages that have
+ ** already been written to the database (in case the header is
+ ** trashed when the nRec field is updated).
+ */
+ pPager->nRec = 0;
+ assert( pPager->journalOff > 0 );
+ rc = writeJournalHdr(pPager);
+ if( rc!=0 ){
+ sqlite3pager_rollback(pPager);
+ return SQLITE_IOERR;
+ }
+ }
+ pPg = pPager->pFirst;
+ }
+ assert( pPg->nRef==0 );
+
+ /* Write the page to the database file if it is dirty.
+ */
+ if( pPg->dirty ){
+ assert( pPg->needSync==0 );
+ pPg->pDirty = 0;
+ rc = pager_write_pagelist( pPg );
+ if( rc!=SQLITE_OK ){
+ sqlite3pager_rollback(pPager);
+ return SQLITE_IOERR;
+ }
+ }
+ assert( pPg->dirty==0 );
+
+ /* If the page we are recycling is marked as alwaysRollback, then
+ ** set the global alwaysRollback flag, thus disabling the
+ ** sqlite_dont_rollback() optimization for the rest of this transaction.
+ ** It is necessary to do this because the page marked alwaysRollback
+ ** might be reloaded at a later time but at that point we won't remember
+ ** that is was marked alwaysRollback. This means that all pages must
+ ** be marked as alwaysRollback from here on out.
+ */
+ if( pPg->alwaysRollback ){
+ pPager->alwaysRollback = 1;
+ }
+
+ /* Unlink the old page from the free list and the hash table
+ */
+ unlinkPage(pPg);
+ TEST_INCR(pPager->nOvfl);
+ }
+ pPg->pgno = pgno;
+ if( pPager->aInJournal && (int)pgno<=pPager->origDbSize ){
+ sqlite3CheckMemory(pPager->aInJournal, pgno/8);
+ assert( pPager->journalOpen );
+ pPg->inJournal = (pPager->aInJournal[pgno/8] & (1<<(pgno&7)))!=0;
+ pPg->needSync = 0;
+ }else{
+ pPg->inJournal = 0;
+ pPg->needSync = 0;
+ }
+ if( pPager->aInStmt && (int)pgno<=pPager->stmtSize
+ && (pPager->aInStmt[pgno/8] & (1<<(pgno&7)))!=0 ){
+ page_add_to_stmt_list(pPg);
+ }else{
+ page_remove_from_stmt_list(pPg);
+ }
+ pPg->dirty = 0;
+ pPg->nRef = 1;
+ REFINFO(pPg);
+ pPager->nRef++;
+ h = pager_hash(pgno);
+ pPg->pNextHash = pPager->aHash[h];
+ pPager->aHash[h] = pPg;
+ if( pPg->pNextHash ){
+ assert( pPg->pNextHash->pPrevHash==0 );
+ pPg->pNextHash->pPrevHash = pPg;
+ }
+ if( pPager->nExtra>0 ){
+ memset(PGHDR_TO_EXTRA(pPg, pPager), 0, pPager->nExtra);
+ }
+ if( pPager->errMask!=0 ){
+ sqlite3pager_unref(PGHDR_TO_DATA(pPg));
+ rc = pager_errcode(pPager);
+ return rc;
+ }
+ if( sqlite3pager_pagecount(pPager)<(int)pgno ){
+ memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize);
+ }else{
+ int rc;
+ assert( MEMDB==0 );
+ rc = sqlite3OsSeek(&pPager->fd, (pgno-1)*(i64)pPager->pageSize);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3OsRead(&pPager->fd, PGHDR_TO_DATA(pPg), pPager->pageSize);
+ }
+ TRACE3("FETCH %d page %d\n", PAGERID(pPager), pPg->pgno);
+ CODEC(pPager, PGHDR_TO_DATA(pPg), pPg->pgno, 3);
+ if( rc!=SQLITE_OK ){
+ i64 fileSize;
+ if( sqlite3OsFileSize(&pPager->fd,&fileSize)!=SQLITE_OK
+ || fileSize>=pgno*pPager->pageSize ){
+ sqlite3pager_unref(PGHDR_TO_DATA(pPg));
+ return rc;
+ }else{
+ memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize);
+ }
+ }else{
+ TEST_INCR(pPager->nRead);
+ }
+ }
+#ifdef SQLITE_CHECK_PAGES
+ pPg->pageHash = pager_pagehash(pPg);
+#endif
+ }else{
+ /* The requested page is in the page cache. */
+ TEST_INCR(pPager->nHit);
+ page_ref(pPg);
+ }
+ *ppPage = PGHDR_TO_DATA(pPg);
+ return SQLITE_OK;
+}
+
+/*
+** Acquire a page if it is already in the in-memory cache. Do
+** not read the page from disk. Return a pointer to the page,
+** or 0 if the page is not in cache.
+**
+** See also sqlite3pager_get(). The difference between this routine
+** and sqlite3pager_get() is that _get() will go to the disk and read
+** in the page if the page is not already in cache. This routine
+** returns NULL if the page is not in cache or if a disk I/O error
+** has ever happened.
+*/
+void *sqlite3pager_lookup(Pager *pPager, Pgno pgno){
+ PgHdr *pPg;
+
+ assert( pPager!=0 );
+ assert( pgno!=0 );
+ if( pPager->errMask & ~(PAGER_ERR_FULL) ){
+ return 0;
+ }
+ pPg = pager_lookup(pPager, pgno);
+ if( pPg==0 ) return 0;
+ page_ref(pPg);
+ return PGHDR_TO_DATA(pPg);
+}
+
+/*
+** Release a page.
+**
+** If the number of references to the page drop to zero, then the
+** page is added to the LRU list. When all references to all pages
+** are released, a rollback occurs and the lock on the database is
+** removed.
+*/
+int sqlite3pager_unref(void *pData){
+ PgHdr *pPg;
+
+ /* Decrement the reference count for this page
+ */
+ pPg = DATA_TO_PGHDR(pData);
+ assert( pPg->nRef>0 );
+ pPg->nRef--;
+ REFINFO(pPg);
+
+ CHECK_PAGE(pPg);
+
+ /* When the number of references to a page reach 0, call the
+ ** destructor and add the page to the freelist.
+ */
+ if( pPg->nRef==0 ){
+ Pager *pPager;
+ pPager = pPg->pPager;
+ pPg->pNextFree = 0;
+ pPg->pPrevFree = pPager->pLast;
+ pPager->pLast = pPg;
+ if( pPg->pPrevFree ){
+ pPg->pPrevFree->pNextFree = pPg;
+ }else{
+ pPager->pFirst = pPg;
+ }
+ if( pPg->needSync==0 && pPager->pFirstSynced==0 ){
+ pPager->pFirstSynced = pPg;
+ }
+ if( pPager->xDestructor ){
+ pPager->xDestructor(pData, pPager->pageSize);
+ }
+
+ /* When all pages reach the freelist, drop the read lock from
+ ** the database file.
+ */
+ pPager->nRef--;
+ assert( pPager->nRef>=0 );
+ if( pPager->nRef==0 && !MEMDB ){
+ pager_reset(pPager);
+ }
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Create a journal file for pPager. There should already be a RESERVED
+** or EXCLUSIVE lock on the database file when this routine is called.
+**
+** Return SQLITE_OK if everything. Return an error code and release the
+** write lock if anything goes wrong.
+*/
+static int pager_open_journal(Pager *pPager){
+ int rc;
+ assert( !MEMDB );
+ assert( pPager->state>=PAGER_RESERVED );
+ assert( pPager->journalOpen==0 );
+ assert( pPager->useJournal );
+ assert( pPager->aInJournal==0 );
+ sqlite3pager_pagecount(pPager);
+ pPager->aInJournal = sqliteMalloc( pPager->dbSize/8 + 1 );
+ if( pPager->aInJournal==0 ){
+ rc = SQLITE_NOMEM;
+ goto failed_to_open_journal;
+ }
+ rc = sqlite3OsOpenExclusive(pPager->zJournal, &pPager->jfd,pPager->tempFile);
+ pPager->journalOff = 0;
+ pPager->setMaster = 0;
+ pPager->journalHdr = 0;
+ if( rc!=SQLITE_OK ){
+ goto failed_to_open_journal;
+ }
+ SET_FULLSYNC(pPager->jfd, pPager->fullSync);
+ SET_FULLSYNC(pPager->fd, pPager->fullSync);
+ sqlite3OsOpenDirectory(pPager->zDirectory, &pPager->jfd);
+ pPager->journalOpen = 1;
+ pPager->journalStarted = 0;
+ pPager->needSync = 0;
+ pPager->alwaysRollback = 0;
+ pPager->nRec = 0;
+ if( pPager->errMask!=0 ){
+ rc = pager_errcode(pPager);
+ goto failed_to_open_journal;
+ }
+ pPager->origDbSize = pPager->dbSize;
+
+ rc = writeJournalHdr(pPager);
+
+ if( pPager->stmtAutoopen && rc==SQLITE_OK ){
+ rc = sqlite3pager_stmt_begin(pPager);
+ }
+ if( rc!=SQLITE_OK ){
+ rc = pager_unwritelock(pPager);
+ if( rc==SQLITE_OK ){
+ rc = SQLITE_FULL;
+ }
+ }
+ return rc;
+
+failed_to_open_journal:
+ sqliteFree(pPager->aInJournal);
+ pPager->aInJournal = 0;
+ sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ pPager->state = PAGER_UNLOCK;
+ return rc;
+}
+
+/*
+** Acquire a write-lock on the database. The lock is removed when
+** the any of the following happen:
+**
+** * sqlite3pager_commit() is called.
+** * sqlite3pager_rollback() is called.
+** * sqlite3pager_close() is called.
+** * sqlite3pager_unref() is called to on every outstanding page.
+**
+** The first parameter to this routine is a pointer to any open page of the
+** database file. Nothing changes about the page - it is used merely to
+** acquire a pointer to the Pager structure and as proof that there is
+** already a read-lock on the database.
+**
+** The second parameter indicates how much space in bytes to reserve for a
+** master journal file-name at the start of the journal when it is created.
+**
+** A journal file is opened if this is not a temporary file. For temporary
+** files, the opening of the journal file is deferred until there is an
+** actual need to write to the journal.
+**
+** If the database is already reserved for writing, this routine is a no-op.
+**
+** If exFlag is true, go ahead and get an EXCLUSIVE lock on the file
+** immediately instead of waiting until we try to flush the cache. The
+** exFlag is ignored if a transaction is already active.
+*/
+int sqlite3pager_begin(void *pData, int exFlag){
+ PgHdr *pPg = DATA_TO_PGHDR(pData);
+ Pager *pPager = pPg->pPager;
+ int rc = SQLITE_OK;
+ assert( pPg->nRef>0 );
+ assert( pPager->state!=PAGER_UNLOCK );
+ if( pPager->state==PAGER_SHARED ){
+ assert( pPager->aInJournal==0 );
+ if( MEMDB ){
+ pPager->state = PAGER_EXCLUSIVE;
+ pPager->origDbSize = pPager->dbSize;
+ }else{
+ rc = sqlite3OsLock(&pPager->fd, RESERVED_LOCK);
+ if( rc==SQLITE_OK ){
+ pPager->state = PAGER_RESERVED;
+ if( exFlag ){
+ rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
+ }
+ }
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ pPager->dirtyCache = 0;
+ TRACE2("TRANSACTION %d\n", PAGERID(pPager));
+ if( pPager->useJournal && !pPager->tempFile ){
+ rc = pager_open_journal(pPager);
+ }
+ }
+ }
+ return rc;
+}
+
+/*
+** Mark a data page as writeable. The page is written into the journal
+** if it is not there already. This routine must be called before making
+** changes to a page.
+**
+** The first time this routine is called, the pager creates a new
+** journal and acquires a RESERVED lock on the database. If the RESERVED
+** lock could not be acquired, this routine returns SQLITE_BUSY. The
+** calling routine must check for that return value and be careful not to
+** change any page data until this routine returns SQLITE_OK.
+**
+** If the journal file could not be written because the disk is full,
+** then this routine returns SQLITE_FULL and does an immediate rollback.
+** All subsequent write attempts also return SQLITE_FULL until there
+** is a call to sqlite3pager_commit() or sqlite3pager_rollback() to
+** reset.
+*/
+int sqlite3pager_write(void *pData){
+ PgHdr *pPg = DATA_TO_PGHDR(pData);
+ Pager *pPager = pPg->pPager;
+ int rc = SQLITE_OK;
+
+ /* Check for errors
+ */
+ if( pPager->errMask ){
+ return pager_errcode(pPager);
+ }
+ if( pPager->readOnly ){
+ return SQLITE_PERM;
+ }
+
+ assert( !pPager->setMaster );
+
+ CHECK_PAGE(pPg);
+
+ /* Mark the page as dirty. If the page has already been written
+ ** to the journal then we can return right away.
+ */
+ pPg->dirty = 1;
+ if( pPg->inJournal && (pPg->inStmt || pPager->stmtInUse==0) ){
+ pPager->dirtyCache = 1;
+ }else{
+
+ /* If we get this far, it means that the page needs to be
+ ** written to the transaction journal or the ckeckpoint journal
+ ** or both.
+ **
+ ** First check to see that the transaction journal exists and
+ ** create it if it does not.
+ */
+ assert( pPager->state!=PAGER_UNLOCK );
+ rc = sqlite3pager_begin(pData, 0);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ assert( pPager->state>=PAGER_RESERVED );
+ if( !pPager->journalOpen && pPager->useJournal ){
+ rc = pager_open_journal(pPager);
+ if( rc!=SQLITE_OK ) return rc;
+ }
+ assert( pPager->journalOpen || !pPager->useJournal );
+ pPager->dirtyCache = 1;
+
+ /* The transaction journal now exists and we have a RESERVED or an
+ ** EXCLUSIVE lock on the main database file. Write the current page to
+ ** the transaction journal if it is not there already.
+ */
+ if( !pPg->inJournal && (pPager->useJournal || MEMDB) ){
+ if( (int)pPg->pgno <= pPager->origDbSize ){
+ int szPg;
+ u32 saved;
+ if( MEMDB ){
+ PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager);
+ TRACE3("JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno);
+ assert( pHist->pOrig==0 );
+ pHist->pOrig = sqliteMallocRaw( pPager->pageSize );
+ if( pHist->pOrig ){
+ memcpy(pHist->pOrig, PGHDR_TO_DATA(pPg), pPager->pageSize);
+ }
+ }else{
+ u32 cksum;
+ /* We should never write to the journal file the page that
+ ** contains the database locks. The following assert verifies
+ ** that we do not. */
+ assert( pPg->pgno!=PAGER_MJ_PGNO(pPager) );
+ CODEC(pPager, pData, pPg->pgno, 7);
+ cksum = pager_cksum(pPager, pPg->pgno, pData);
+ saved = *(u32*)PGHDR_TO_EXTRA(pPg, pPager);
+ store32bits(cksum, pPg, pPager->pageSize);
+ szPg = pPager->pageSize+8;
+ store32bits(pPg->pgno, pPg, -4);
+ rc = sqlite3OsWrite(&pPager->jfd, &((char*)pData)[-4], szPg);
+ pPager->journalOff += szPg;
+ TRACE4("JOURNAL %d page %d needSync=%d\n",
+ PAGERID(pPager), pPg->pgno, pPg->needSync);
+ CODEC(pPager, pData, pPg->pgno, 0);
+ *(u32*)PGHDR_TO_EXTRA(pPg, pPager) = saved;
+ if( rc!=SQLITE_OK ){
+ sqlite3pager_rollback(pPager);
+ pPager->errMask |= PAGER_ERR_FULL;
+ return rc;
+ }
+ pPager->nRec++;
+ assert( pPager->aInJournal!=0 );
+ pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7);
+ pPg->needSync = !pPager->noSync;
+ if( pPager->stmtInUse ){
+ pPager->aInStmt[pPg->pgno/8] |= 1<<(pPg->pgno&7);
+ page_add_to_stmt_list(pPg);
+ }
+ }
+ }else{
+ pPg->needSync = !pPager->journalStarted && !pPager->noSync;
+ TRACE4("APPEND %d page %d needSync=%d\n",
+ PAGERID(pPager), pPg->pgno, pPg->needSync);
+ }
+ if( pPg->needSync ){
+ pPager->needSync = 1;
+ }
+ pPg->inJournal = 1;
+ }
+
+ /* If the statement journal is open and the page is not in it,
+ ** then write the current page to the statement journal. Note that
+ ** the statement journal format differs from the standard journal format
+ ** in that it omits the checksums and the header.
+ */
+ if( pPager->stmtInUse && !pPg->inStmt && (int)pPg->pgno<=pPager->stmtSize ){
+ assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize );
+ if( MEMDB ){
+ PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager);
+ assert( pHist->pStmt==0 );
+ pHist->pStmt = sqliteMallocRaw( pPager->pageSize );
+ if( pHist->pStmt ){
+ memcpy(pHist->pStmt, PGHDR_TO_DATA(pPg), pPager->pageSize);
+ }
+ TRACE3("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno);
+ }else{
+ store32bits(pPg->pgno, pPg, -4);
+ CODEC(pPager, pData, pPg->pgno, 7);
+ rc = sqlite3OsWrite(&pPager->stfd,((char*)pData)-4, pPager->pageSize+4);
+ TRACE3("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno);
+ CODEC(pPager, pData, pPg->pgno, 0);
+ if( rc!=SQLITE_OK ){
+ sqlite3pager_rollback(pPager);
+ pPager->errMask |= PAGER_ERR_FULL;
+ return rc;
+ }
+ pPager->stmtNRec++;
+ assert( pPager->aInStmt!=0 );
+ pPager->aInStmt[pPg->pgno/8] |= 1<<(pPg->pgno&7);
+ }
+ page_add_to_stmt_list(pPg);
+ }
+ }
+
+ /* Update the database size and return.
+ */
+ if( pPager->dbSize<(int)pPg->pgno ){
+ pPager->dbSize = pPg->pgno;
+ if( !MEMDB && pPager->dbSize==PENDING_BYTE/pPager->pageSize ){
+ pPager->dbSize++;
+ }
+ }
+ return rc;
+}
+
+/*
+** Return TRUE if the page given in the argument was previously passed
+** to sqlite3pager_write(). In other words, return TRUE if it is ok
+** to change the content of the page.
+*/
+int sqlite3pager_iswriteable(void *pData){
+ PgHdr *pPg = DATA_TO_PGHDR(pData);
+ return pPg->dirty;
+}
+
+#ifndef SQLITE_OMIT_VACUUM
+/*
+** Replace the content of a single page with the information in the third
+** argument.
+*/
+int sqlite3pager_overwrite(Pager *pPager, Pgno pgno, void *pData){
+ void *pPage;
+ int rc;
+
+ rc = sqlite3pager_get(pPager, pgno, &pPage);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3pager_write(pPage);
+ if( rc==SQLITE_OK ){
+ memcpy(pPage, pData, pPager->pageSize);
+ }
+ sqlite3pager_unref(pPage);
+ }
+ return rc;
+}
+#endif
+
+/*
+** A call to this routine tells the pager that it is not necessary to
+** write the information on page "pgno" back to the disk, even though
+** that page might be marked as dirty.
+**
+** The overlying software layer calls this routine when all of the data
+** on the given page is unused. The pager marks the page as clean so
+** that it does not get written to disk.
+**
+** Tests show that this optimization, together with the
+** sqlite3pager_dont_rollback() below, more than double the speed
+** of large INSERT operations and quadruple the speed of large DELETEs.
+**
+** When this routine is called, set the alwaysRollback flag to true.
+** Subsequent calls to sqlite3pager_dont_rollback() for the same page
+** will thereafter be ignored. This is necessary to avoid a problem
+** where a page with data is added to the freelist during one part of
+** a transaction then removed from the freelist during a later part
+** of the same transaction and reused for some other purpose. When it
+** is first added to the freelist, this routine is called. When reused,
+** the dont_rollback() routine is called. But because the page contains
+** critical data, we still need to be sure it gets rolled back in spite
+** of the dont_rollback() call.
+*/
+void sqlite3pager_dont_write(Pager *pPager, Pgno pgno){
+ PgHdr *pPg;
+
+ if( MEMDB ) return;
+
+ pPg = pager_lookup(pPager, pgno);
+ pPg->alwaysRollback = 1;
+ if( pPg && pPg->dirty ){
+ if( pPager->dbSize==(int)pPg->pgno && pPager->origDbSize<pPager->dbSize ){
+ /* If this pages is the last page in the file and the file has grown
+ ** during the current transaction, then do NOT mark the page as clean.
+ ** When the database file grows, we must make sure that the last page
+ ** gets written at least once so that the disk file will be the correct
+ ** size. If you do not write this page and the size of the file
+ ** on the disk ends up being too small, that can lead to database
+ ** corruption during the next transaction.
+ */
+ }else{
+ TRACE3("DONT_WRITE page %d of %d\n", pgno, PAGERID(pPager));
+ pPg->dirty = 0;
+#ifdef SQLITE_CHECK_PAGES
+ pPg->pageHash = pager_pagehash(pPg);
+#endif
+ }
+ }
+}
+
+/*
+** A call to this routine tells the pager that if a rollback occurs,
+** it is not necessary to restore the data on the given page. This
+** means that the pager does not have to record the given page in the
+** rollback journal.
+*/
+void sqlite3pager_dont_rollback(void *pData){
+ PgHdr *pPg = DATA_TO_PGHDR(pData);
+ Pager *pPager = pPg->pPager;
+
+ if( pPager->state!=PAGER_EXCLUSIVE || pPager->journalOpen==0 ) return;
+ if( pPg->alwaysRollback || pPager->alwaysRollback || MEMDB ) return;
+ if( !pPg->inJournal && (int)pPg->pgno <= pPager->origDbSize ){
+ assert( pPager->aInJournal!=0 );
+ pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7);
+ pPg->inJournal = 1;
+ if( pPager->stmtInUse ){
+ pPager->aInStmt[pPg->pgno/8] |= 1<<(pPg->pgno&7);
+ page_add_to_stmt_list(pPg);
+ }
+ TRACE3("DONT_ROLLBACK page %d of %d\n", pPg->pgno, PAGERID(pPager));
+ }
+ if( pPager->stmtInUse && !pPg->inStmt && (int)pPg->pgno<=pPager->stmtSize ){
+ assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize );
+ assert( pPager->aInStmt!=0 );
+ pPager->aInStmt[pPg->pgno/8] |= 1<<(pPg->pgno&7);
+ page_add_to_stmt_list(pPg);
+ }
+}
+
+
+#ifndef SQLITE_OMIT_MEMORYDB
+/*
+** Clear a PgHistory block
+*/
+static void clearHistory(PgHistory *pHist){
+ sqliteFree(pHist->pOrig);
+ sqliteFree(pHist->pStmt);
+ pHist->pOrig = 0;
+ pHist->pStmt = 0;
+}
+#else
+#define clearHistory(x)
+#endif
+
+/*
+** Commit all changes to the database and release the write lock.
+**
+** If the commit fails for any reason, a rollback attempt is made
+** and an error code is returned. If the commit worked, SQLITE_OK
+** is returned.
+*/
+int sqlite3pager_commit(Pager *pPager){
+ int rc;
+ PgHdr *pPg;
+
+ if( pPager->errMask==PAGER_ERR_FULL ){
+ rc = sqlite3pager_rollback(pPager);
+ if( rc==SQLITE_OK ){
+ rc = SQLITE_FULL;
+ }
+ return rc;
+ }
+ if( pPager->errMask!=0 ){
+ rc = pager_errcode(pPager);
+ return rc;
+ }
+ if( pPager->state<PAGER_RESERVED ){
+ return SQLITE_ERROR;
+ }
+ TRACE2("COMMIT %d\n", PAGERID(pPager));
+ if( MEMDB ){
+ pPg = pager_get_all_dirty_pages(pPager);
+ while( pPg ){
+ clearHistory(PGHDR_TO_HIST(pPg, pPager));
+ pPg->dirty = 0;
+ pPg->inJournal = 0;
+ pPg->inStmt = 0;
+ pPg->pPrevStmt = pPg->pNextStmt = 0;
+ pPg = pPg->pDirty;
+ }
+#ifndef NDEBUG
+ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
+ PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager);
+ assert( !pPg->alwaysRollback );
+ assert( !pHist->pOrig );
+ assert( !pHist->pStmt );
+ }
+#endif
+ pPager->pStmt = 0;
+ pPager->state = PAGER_SHARED;
+ return SQLITE_OK;
+ }
+ if( pPager->dirtyCache==0 ){
+ /* Exit early (without doing the time-consuming sqlite3OsSync() calls)
+ ** if there have been no changes to the database file. */
+ assert( pPager->needSync==0 );
+ rc = pager_unwritelock(pPager);
+ pPager->dbSize = -1;
+ return rc;
+ }
+ assert( pPager->journalOpen );
+ rc = sqlite3pager_sync(pPager, 0, 0);
+ if( rc!=SQLITE_OK ){
+ goto commit_abort;
+ }
+ rc = pager_unwritelock(pPager);
+ pPager->dbSize = -1;
+ return rc;
+
+ /* Jump here if anything goes wrong during the commit process.
+ */
+commit_abort:
+ sqlite3pager_rollback(pPager);
+ return rc;
+}
+
+/*
+** Rollback all changes. The database falls back to PAGER_SHARED mode.
+** All in-memory cache pages revert to their original data contents.
+** The journal is deleted.
+**
+** This routine cannot fail unless some other process is not following
+** the correct locking protocol (SQLITE_PROTOCOL) or unless some other
+** process is writing trash into the journal file (SQLITE_CORRUPT) or
+** unless a prior malloc() failed (SQLITE_NOMEM). Appropriate error
+** codes are returned for all these occasions. Otherwise,
+** SQLITE_OK is returned.
+*/
+int sqlite3pager_rollback(Pager *pPager){
+ int rc;
+ TRACE2("ROLLBACK %d\n", PAGERID(pPager));
+ if( MEMDB ){
+ PgHdr *p;
+ for(p=pPager->pAll; p; p=p->pNextAll){
+ PgHistory *pHist;
+ assert( !p->alwaysRollback );
+ if( !p->dirty ){
+ assert( !((PgHistory *)PGHDR_TO_HIST(p, pPager))->pOrig );
+ assert( !((PgHistory *)PGHDR_TO_HIST(p, pPager))->pStmt );
+ continue;
+ }
+
+ pHist = PGHDR_TO_HIST(p, pPager);
+ if( pHist->pOrig ){
+ memcpy(PGHDR_TO_DATA(p), pHist->pOrig, pPager->pageSize);
+ TRACE3("ROLLBACK-PAGE %d of %d\n", p->pgno, PAGERID(pPager));
+ }else{
+ TRACE3("PAGE %d is clean on %d\n", p->pgno, PAGERID(pPager));
+ }
+ clearHistory(pHist);
+ p->dirty = 0;
+ p->inJournal = 0;
+ p->inStmt = 0;
+ p->pPrevStmt = p->pNextStmt = 0;
+
+ if( pPager->xReiniter ){
+ pPager->xReiniter(PGHDR_TO_DATA(p), pPager->pageSize);
+ }
+
+ }
+ pPager->pStmt = 0;
+ pPager->dbSize = pPager->origDbSize;
+ memoryTruncate(pPager);
+ pPager->stmtInUse = 0;
+ pPager->state = PAGER_SHARED;
+ return SQLITE_OK;
+ }
+
+ if( !pPager->dirtyCache || !pPager->journalOpen ){
+ rc = pager_unwritelock(pPager);
+ pPager->dbSize = -1;
+ return rc;
+ }
+
+ if( pPager->errMask!=0 && pPager->errMask!=PAGER_ERR_FULL ){
+ if( pPager->state>=PAGER_EXCLUSIVE ){
+ pager_playback(pPager);
+ }
+ return pager_errcode(pPager);
+ }
+ if( pPager->state==PAGER_RESERVED ){
+ int rc2;
+ rc = pager_reload_cache(pPager);
+ rc2 = pager_unwritelock(pPager);
+ if( rc==SQLITE_OK ){
+ rc = rc2;
+ }
+ }else{
+ rc = pager_playback(pPager);
+ }
+ if( rc!=SQLITE_OK ){
+ rc = SQLITE_CORRUPT_BKPT;
+ pPager->errMask |= PAGER_ERR_CORRUPT;
+ }
+ pPager->dbSize = -1;
+ return rc;
+}
+
+/*
+** Return TRUE if the database file is opened read-only. Return FALSE
+** if the database is (in theory) writable.
+*/
+int sqlite3pager_isreadonly(Pager *pPager){
+ return pPager->readOnly;
+}
+
+/*
+** This routine is used for testing and analysis only.
+*/
+int *sqlite3pager_stats(Pager *pPager){
+ static int a[11];
+ a[0] = pPager->nRef;
+ a[1] = pPager->nPage;
+ a[2] = pPager->mxPage;
+ a[3] = pPager->dbSize;
+ a[4] = pPager->state;
+ a[5] = pPager->errMask;
+#ifdef SQLITE_TEST
+ a[6] = pPager->nHit;
+ a[7] = pPager->nMiss;
+ a[8] = pPager->nOvfl;
+ a[9] = pPager->nRead;
+ a[10] = pPager->nWrite;
+#endif
+ return a;
+}
+
+/*
+** Set the statement rollback point.
+**
+** This routine should be called with the transaction journal already
+** open. A new statement journal is created that can be used to rollback
+** changes of a single SQL command within a larger transaction.
+*/
+int sqlite3pager_stmt_begin(Pager *pPager){
+ int rc;
+ char zTemp[SQLITE_TEMPNAME_SIZE];
+ assert( !pPager->stmtInUse );
+ assert( pPager->dbSize>=0 );
+ TRACE2("STMT-BEGIN %d\n", PAGERID(pPager));
+ if( MEMDB ){
+ pPager->stmtInUse = 1;
+ pPager->stmtSize = pPager->dbSize;
+ return SQLITE_OK;
+ }
+ if( !pPager->journalOpen ){
+ pPager->stmtAutoopen = 1;
+ return SQLITE_OK;
+ }
+ assert( pPager->journalOpen );
+ pPager->aInStmt = sqliteMalloc( pPager->dbSize/8 + 1 );
+ if( pPager->aInStmt==0 ){
+ sqlite3OsLock(&pPager->fd, SHARED_LOCK);
+ return SQLITE_NOMEM;
+ }
+#ifndef NDEBUG
+ rc = sqlite3OsFileSize(&pPager->jfd, &pPager->stmtJSize);
+ if( rc ) goto stmt_begin_failed;
+ assert( pPager->stmtJSize == pPager->journalOff );
+#endif
+ pPager->stmtJSize = pPager->journalOff;
+ pPager->stmtSize = pPager->dbSize;
+ pPager->stmtHdrOff = 0;
+ pPager->stmtCksum = pPager->cksumInit;
+ if( !pPager->stmtOpen ){
+ rc = sqlite3pager_opentemp(zTemp, &pPager->stfd);
+ if( rc ) goto stmt_begin_failed;
+ pPager->stmtOpen = 1;
+ pPager->stmtNRec = 0;
+ }
+ pPager->stmtInUse = 1;
+ return SQLITE_OK;
+
+stmt_begin_failed:
+ if( pPager->aInStmt ){
+ sqliteFree(pPager->aInStmt);
+ pPager->aInStmt = 0;
+ }
+ return rc;
+}
+
+/*
+** Commit a statement.
+*/
+int sqlite3pager_stmt_commit(Pager *pPager){
+ if( pPager->stmtInUse ){
+ PgHdr *pPg, *pNext;
+ TRACE2("STMT-COMMIT %d\n", PAGERID(pPager));
+ if( !MEMDB ){
+ sqlite3OsSeek(&pPager->stfd, 0);
+ /* sqlite3OsTruncate(&pPager->stfd, 0); */
+ sqliteFree( pPager->aInStmt );
+ pPager->aInStmt = 0;
+ }
+ for(pPg=pPager->pStmt; pPg; pPg=pNext){
+ pNext = pPg->pNextStmt;
+ assert( pPg->inStmt );
+ pPg->inStmt = 0;
+ pPg->pPrevStmt = pPg->pNextStmt = 0;
+ if( MEMDB ){
+ PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager);
+ sqliteFree(pHist->pStmt);
+ pHist->pStmt = 0;
+ }
+ }
+ pPager->stmtNRec = 0;
+ pPager->stmtInUse = 0;
+ pPager->pStmt = 0;
+ }
+ pPager->stmtAutoopen = 0;
+ return SQLITE_OK;
+}
+
+/*
+** Rollback a statement.
+*/
+int sqlite3pager_stmt_rollback(Pager *pPager){
+ int rc;
+ if( pPager->stmtInUse ){
+ TRACE2("STMT-ROLLBACK %d\n", PAGERID(pPager));
+ if( MEMDB ){
+ PgHdr *pPg;
+ for(pPg=pPager->pStmt; pPg; pPg=pPg->pNextStmt){
+ PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager);
+ if( pHist->pStmt ){
+ memcpy(PGHDR_TO_DATA(pPg), pHist->pStmt, pPager->pageSize);
+ sqliteFree(pHist->pStmt);
+ pHist->pStmt = 0;
+ }
+ }
+ pPager->dbSize = pPager->stmtSize;
+ memoryTruncate(pPager);
+ rc = SQLITE_OK;
+ }else{
+ rc = pager_stmt_playback(pPager);
+ }
+ sqlite3pager_stmt_commit(pPager);
+ }else{
+ rc = SQLITE_OK;
+ }
+ pPager->stmtAutoopen = 0;
+ return rc;
+}
+
+/*
+** Return the full pathname of the database file.
+*/
+const char *sqlite3pager_filename(Pager *pPager){
+ return pPager->zFilename;
+}
+
+/*
+** Return the directory of the database file.
+*/
+const char *sqlite3pager_dirname(Pager *pPager){
+ return pPager->zDirectory;
+}
+
+/*
+** Return the full pathname of the journal file.
+*/
+const char *sqlite3pager_journalname(Pager *pPager){
+ return pPager->zJournal;
+}
+
+/*
+** Return true if fsync() calls are disabled for this pager. Return FALSE
+** if fsync()s are executed normally.
+*/
+int sqlite3pager_nosync(Pager *pPager){
+ return pPager->noSync;
+}
+
+/*
+** Set the codec for this pager
+*/
+void sqlite3pager_set_codec(
+ Pager *pPager,
+ void (*xCodec)(void*,void*,Pgno,int),
+ void *pCodecArg
+){
+ pPager->xCodec = xCodec;
+ pPager->pCodecArg = pCodecArg;
+}
+
+/*
+** This routine is called to increment the database file change-counter,
+** stored at byte 24 of the pager file.
+*/
+static int pager_incr_changecounter(Pager *pPager){
+ void *pPage;
+ PgHdr *pPgHdr;
+ u32 change_counter;
+ int rc;
+
+ /* Open page 1 of the file for writing. */
+ rc = sqlite3pager_get(pPager, 1, &pPage);
+ if( rc!=SQLITE_OK ) return rc;
+ rc = sqlite3pager_write(pPage);
+ if( rc!=SQLITE_OK ) return rc;
+
+ /* Read the current value at byte 24. */
+ pPgHdr = DATA_TO_PGHDR(pPage);
+ change_counter = retrieve32bits(pPgHdr, 24);
+
+ /* Increment the value just read and write it back to byte 24. */
+ change_counter++;
+ store32bits(change_counter, pPgHdr, 24);
+
+ /* Release the page reference. */
+ sqlite3pager_unref(pPage);
+ return SQLITE_OK;
+}
+
+/*
+** Sync the database file for the pager pPager. zMaster points to the name
+** of a master journal file that should be written into the individual
+** journal file. zMaster may be NULL, which is interpreted as no master
+** journal (a single database transaction).
+**
+** This routine ensures that the journal is synced, all dirty pages written
+** to the database file and the database file synced. The only thing that
+** remains to commit the transaction is to delete the journal file (or
+** master journal file if specified).
+**
+** Note that if zMaster==NULL, this does not overwrite a previous value
+** passed to an sqlite3pager_sync() call.
+**
+** If parameter nTrunc is non-zero, then the pager file is truncated to
+** nTrunc pages (this is used by auto-vacuum databases).
+*/
+int sqlite3pager_sync(Pager *pPager, const char *zMaster, Pgno nTrunc){
+ int rc = SQLITE_OK;
+
+ TRACE4("DATABASE SYNC: File=%s zMaster=%s nTrunc=%d\n",
+ pPager->zFilename, zMaster, nTrunc);
+
+ /* If this is an in-memory db, or no pages have been written to, or this
+ ** function has already been called, it is a no-op.
+ */
+ if( pPager->state!=PAGER_SYNCED && !MEMDB && pPager->dirtyCache ){
+ PgHdr *pPg;
+ assert( pPager->journalOpen );
+
+ /* If a master journal file name has already been written to the
+ ** journal file, then no sync is required. This happens when it is
+ ** written, then the process fails to upgrade from a RESERVED to an
+ ** EXCLUSIVE lock. The next time the process tries to commit the
+ ** transaction the m-j name will have already been written.
+ */
+ if( !pPager->setMaster ){
+ rc = pager_incr_changecounter(pPager);
+ if( rc!=SQLITE_OK ) goto sync_exit;
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( nTrunc!=0 ){
+ /* If this transaction has made the database smaller, then all pages
+ ** being discarded by the truncation must be written to the journal
+ ** file.
+ */
+ Pgno i;
+ void *pPage;
+ int iSkip = PAGER_MJ_PGNO(pPager);
+ for( i=nTrunc+1; i<=pPager->origDbSize; i++ ){
+ if( !(pPager->aInJournal[i/8] & (1<<(i&7))) && i!=iSkip ){
+ rc = sqlite3pager_get(pPager, i, &pPage);
+ if( rc!=SQLITE_OK ) goto sync_exit;
+ rc = sqlite3pager_write(pPage);
+ sqlite3pager_unref(pPage);
+ if( rc!=SQLITE_OK ) goto sync_exit;
+ }
+ }
+ }
+#endif
+ rc = writeMasterJournal(pPager, zMaster);
+ if( rc!=SQLITE_OK ) goto sync_exit;
+ rc = syncJournal(pPager);
+ if( rc!=SQLITE_OK ) goto sync_exit;
+ }
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( nTrunc!=0 ){
+ rc = sqlite3pager_truncate(pPager, nTrunc);
+ if( rc!=SQLITE_OK ) goto sync_exit;
+ }
+#endif
+
+ /* Write all dirty pages to the database file */
+ pPg = pager_get_all_dirty_pages(pPager);
+ rc = pager_write_pagelist(pPg);
+ if( rc!=SQLITE_OK ) goto sync_exit;
+
+ /* Sync the database file. */
+ if( !pPager->noSync ){
+ rc = sqlite3OsSync(&pPager->fd, 0);
+ }
+
+ pPager->state = PAGER_SYNCED;
+ }
+
+sync_exit:
+ return rc;
+}
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+/*
+** Move the page identified by pData to location pgno in the file.
+**
+** There must be no references to the current page pgno. If current page
+** pgno is not already in the rollback journal, it is not written there by
+** by this routine. The same applies to the page pData refers to on entry to
+** this routine.
+**
+** References to the page refered to by pData remain valid. Updating any
+** meta-data associated with page pData (i.e. data stored in the nExtra bytes
+** allocated along with the page) is the responsibility of the caller.
+**
+** A transaction must be active when this routine is called. It used to be
+** required that a statement transaction was not active, but this restriction
+** has been removed (CREATE INDEX needs to move a page when a statement
+** transaction is active).
+*/
+int sqlite3pager_movepage(Pager *pPager, void *pData, Pgno pgno){
+ PgHdr *pPg = DATA_TO_PGHDR(pData);
+ PgHdr *pPgOld;
+ int h;
+ Pgno needSyncPgno = 0;
+
+ assert( pPg->nRef>0 );
+
+ TRACE5("MOVE %d page %d (needSync=%d) moves to %d\n",
+ PAGERID(pPager), pPg->pgno, pPg->needSync, pgno);
+
+ if( pPg->needSync ){
+ needSyncPgno = pPg->pgno;
+ assert( pPg->inJournal );
+ assert( pPg->dirty );
+ assert( pPager->needSync );
+ }
+
+ /* Unlink pPg from it's hash-chain */
+ unlinkHashChain(pPager, pPg);
+
+ /* If the cache contains a page with page-number pgno, remove it
+ ** from it's hash chain. Also, if the PgHdr.needSync was set for
+ ** page pgno before the 'move' operation, it needs to be retained
+ ** for the page moved there.
+ */
+ pPgOld = pager_lookup(pPager, pgno);
+ if( pPgOld ){
+ assert( pPgOld->nRef==0 );
+ unlinkHashChain(pPager, pPgOld);
+ pPgOld->dirty = 0;
+ if( pPgOld->needSync ){
+ assert( pPgOld->inJournal );
+ pPg->inJournal = 1;
+ pPg->needSync = 1;
+ assert( pPager->needSync );
+ }
+ }
+
+ /* Change the page number for pPg and insert it into the new hash-chain. */
+ pPg->pgno = pgno;
+ h = pager_hash(pgno);
+ if( pPager->aHash[h] ){
+ assert( pPager->aHash[h]->pPrevHash==0 );
+ pPager->aHash[h]->pPrevHash = pPg;
+ }
+ pPg->pNextHash = pPager->aHash[h];
+ pPager->aHash[h] = pPg;
+ pPg->pPrevHash = 0;
+
+ pPg->dirty = 1;
+ pPager->dirtyCache = 1;
+
+ if( needSyncPgno ){
+ /* If needSyncPgno is non-zero, then the journal file needs to be
+ ** sync()ed before any data is written to database file page needSyncPgno.
+ ** Currently, no such page exists in the page-cache and the
+ ** Pager.aInJournal bit has been set. This needs to be remedied by loading
+ ** the page into the pager-cache and setting the PgHdr.needSync flag.
+ **
+ ** The sqlite3pager_get() call may cause the journal to sync. So make
+ ** sure the Pager.needSync flag is set too.
+ */
+ int rc;
+ void *pNeedSync;
+ assert( pPager->needSync );
+ rc = sqlite3pager_get(pPager, needSyncPgno, &pNeedSync);
+ if( rc!=SQLITE_OK ) return rc;
+ pPager->needSync = 1;
+ DATA_TO_PGHDR(pNeedSync)->needSync = 1;
+ DATA_TO_PGHDR(pNeedSync)->inJournal = 1;
+ DATA_TO_PGHDR(pNeedSync)->dirty = 1;
+ sqlite3pager_unref(pNeedSync);
+ }
+
+ return SQLITE_OK;
+}
+#endif
+
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
+/*
+** Return the current state of the file lock for the given pager.
+** The return value is one of NO_LOCK, SHARED_LOCK, RESERVED_LOCK,
+** PENDING_LOCK, or EXCLUSIVE_LOCK.
+*/
+int sqlite3pager_lockstate(Pager *pPager){
+#ifdef OS_TEST
+ return pPager->fd->fd.locktype;
+#else
+ return pPager->fd.locktype;
+#endif
+}
+#endif
+
+#ifdef SQLITE_DEBUG
+/*
+** Print a listing of all referenced pages and their ref count.
+*/
+void sqlite3pager_refdump(Pager *pPager){
+ PgHdr *pPg;
+ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
+ if( pPg->nRef<=0 ) continue;
+ sqlite3DebugPrintf("PAGE %3d addr=%p nRef=%d\n",
+ pPg->pgno, PGHDR_TO_DATA(pPg), pPg->nRef);
+ }
+}
+#endif
+
+#endif /* SQLITE_OMIT_DISKIO */
diff --git a/ext/pdo_sqlite/sqlite/src/pager.h b/ext/pdo_sqlite/sqlite/src/pager.h
new file mode 100644
index 000000000..feba78a7a
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/pager.h
@@ -0,0 +1,116 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the interface that the sqlite page cache
+** subsystem. The page cache subsystem reads and writes a file a page
+** at a time and provides a journal for rollback.
+**
+** @(#) $Id$
+*/
+
+/*
+** The default size of a database page.
+*/
+#ifndef SQLITE_DEFAULT_PAGE_SIZE
+# define SQLITE_DEFAULT_PAGE_SIZE 1024
+#endif
+
+/* Maximum page size. The upper bound on this value is 32768. This a limit
+** imposed by necessity of storing the value in a 2-byte unsigned integer
+** and the fact that the page size must be a power of 2.
+**
+** This value is used to initialize certain arrays on the stack at
+** various places in the code. On embedded machines where stack space
+** is limited and the flexibility of having large pages is not needed,
+** it makes good sense to reduce the maximum page size to something more
+** reasonable, like 1024.
+*/
+#ifndef SQLITE_MAX_PAGE_SIZE
+# define SQLITE_MAX_PAGE_SIZE 32768
+#endif
+
+/*
+** Maximum number of pages in one database.
+*/
+#define SQLITE_MAX_PAGE 1073741823
+
+/*
+** The type used to represent a page number. The first page in a file
+** is called page 1. 0 is used to represent "not a page".
+*/
+typedef unsigned int Pgno;
+
+/*
+** Each open file is managed by a separate instance of the "Pager" structure.
+*/
+typedef struct Pager Pager;
+
+/*
+** Allowed values for the flags parameter to sqlite3pager_open().
+**
+** NOTE: This values must match the corresponding BTREE_ values in btree.h.
+*/
+#define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */
+#define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */
+
+
+/*
+** See source code comments for a detailed description of the following
+** routines:
+*/
+int sqlite3pager_open(Pager **ppPager, const char *zFilename,
+ int nExtra, int flags);
+void sqlite3pager_set_busyhandler(Pager*, BusyHandler *pBusyHandler);
+void sqlite3pager_set_destructor(Pager*, void(*)(void*,int));
+void sqlite3pager_set_reiniter(Pager*, void(*)(void*,int));
+int sqlite3pager_set_pagesize(Pager*, int);
+void sqlite3pager_read_fileheader(Pager*, int, unsigned char*);
+void sqlite3pager_set_cachesize(Pager*, int);
+int sqlite3pager_close(Pager *pPager);
+int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage);
+void *sqlite3pager_lookup(Pager *pPager, Pgno pgno);
+int sqlite3pager_ref(void*);
+int sqlite3pager_unref(void*);
+Pgno sqlite3pager_pagenumber(void*);
+int sqlite3pager_write(void*);
+int sqlite3pager_iswriteable(void*);
+int sqlite3pager_overwrite(Pager *pPager, Pgno pgno, void*);
+int sqlite3pager_pagecount(Pager*);
+int sqlite3pager_truncate(Pager*,Pgno);
+int sqlite3pager_begin(void*, int exFlag);
+int sqlite3pager_commit(Pager*);
+int sqlite3pager_sync(Pager*,const char *zMaster, Pgno);
+int sqlite3pager_rollback(Pager*);
+int sqlite3pager_isreadonly(Pager*);
+int sqlite3pager_stmt_begin(Pager*);
+int sqlite3pager_stmt_commit(Pager*);
+int sqlite3pager_stmt_rollback(Pager*);
+void sqlite3pager_dont_rollback(void*);
+void sqlite3pager_dont_write(Pager*, Pgno);
+int *sqlite3pager_stats(Pager*);
+void sqlite3pager_set_safety_level(Pager*,int);
+const char *sqlite3pager_filename(Pager*);
+const char *sqlite3pager_dirname(Pager*);
+const char *sqlite3pager_journalname(Pager*);
+int sqlite3pager_nosync(Pager*);
+int sqlite3pager_rename(Pager*, const char *zNewName);
+void sqlite3pager_set_codec(Pager*,void(*)(void*,void*,Pgno,int),void*);
+int sqlite3pager_movepage(Pager*,void*,Pgno);
+int sqlite3pager_reset(Pager*);
+
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
+int sqlite3pager_lockstate(Pager*);
+#endif
+
+#ifdef SQLITE_TEST
+void sqlite3pager_refdump(Pager*);
+int pager3_refinfo_enable;
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/parse.c b/ext/pdo_sqlite/sqlite/src/parse.c
new file mode 100644
index 000000000..8fe3ccde6
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/parse.c
@@ -0,0 +1,3449 @@
+/* Driver template for the LEMON parser generator.
+** The author disclaims copyright to this source code.
+*/
+/* First off, code is include which follows the "include" declaration
+** in the input file. */
+#include <stdio.h>
+#line 51 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+
+#include "sqliteInt.h"
+#include "parse.h"
+
+/*
+** An instance of this structure holds information about the
+** LIMIT clause of a SELECT statement.
+*/
+struct LimitVal {
+ Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
+ Expr *pOffset; /* The OFFSET expression. NULL if there is none */
+};
+
+/*
+** An instance of this structure is used to store the LIKE,
+** GLOB, NOT LIKE, and NOT GLOB operators.
+*/
+struct LikeOp {
+ Token operator; /* "like" or "glob" or "regexp" */
+ int not; /* True if the NOT keyword is present */
+};
+
+/*
+** An instance of the following structure describes the event of a
+** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
+** TK_DELETE, or TK_INSTEAD. If the event is of the form
+**
+** UPDATE ON (a,b,c)
+**
+** Then the "b" IdList records the list "a,b,c".
+*/
+struct TrigEvent { int a; IdList * b; };
+
+/*
+** An instance of this structure holds the ATTACH key and the key type.
+*/
+struct AttachKey { int type; Token key; };
+
+#line 48 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+/* Next is all token values, in a form suitable for use by makeheaders.
+** This section will be null unless lemon is run with the -m switch.
+*/
+/*
+** These constants (all generated automatically by the parser generator)
+** specify the various kinds of tokens (terminals) that the parser
+** understands.
+**
+** Each symbol here is a terminal symbol in the grammar.
+*/
+/* Make sure the INTERFACE macro is defined.
+*/
+#ifndef INTERFACE
+# define INTERFACE 1
+#endif
+/* The next thing included is series of defines which control
+** various aspects of the generated parser.
+** YYCODETYPE is the data type used for storing terminal
+** and nonterminal numbers. "unsigned char" is
+** used if there are fewer than 250 terminals
+** and nonterminals. "int" is used otherwise.
+** YYNOCODE is a number of type YYCODETYPE which corresponds
+** to no legal terminal or nonterminal number. This
+** number is used to fill in empty slots of the hash
+** table.
+** YYFALLBACK If defined, this indicates that one or more tokens
+** have fall-back values which should be used if the
+** original value of the token will not parse.
+** YYACTIONTYPE is the data type used for storing terminal
+** and nonterminal numbers. "unsigned char" is
+** used if there are fewer than 250 rules and
+** states combined. "int" is used otherwise.
+** sqlite3ParserTOKENTYPE is the data type used for minor tokens given
+** directly to the parser from the tokenizer.
+** YYMINORTYPE is the data type used for all minor tokens.
+** This is typically a union of many types, one of
+** which is sqlite3ParserTOKENTYPE. The entry in the union
+** for base tokens is called "yy0".
+** YYSTACKDEPTH is the maximum depth of the parser's stack.
+** sqlite3ParserARG_SDECL A static variable declaration for the %extra_argument
+** sqlite3ParserARG_PDECL A parameter declaration for the %extra_argument
+** sqlite3ParserARG_STORE Code to store %extra_argument into yypParser
+** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser
+** YYNSTATE the combined number of states.
+** YYNRULE the number of rules in the grammar
+** YYERRORSYMBOL is the code number of the error symbol. If not
+** defined, then do no error processing.
+*/
+#define YYCODETYPE unsigned char
+#define YYNOCODE 247
+#define YYACTIONTYPE unsigned short int
+#define sqlite3ParserTOKENTYPE Token
+typedef union {
+ sqlite3ParserTOKENTYPE yy0;
+ struct TrigEvent yy30;
+ Expr* yy62;
+ SrcList* yy151;
+ Token yy198;
+ struct LimitVal yy220;
+ struct LikeOp yy222;
+ IdList* yy240;
+ int yy280;
+ struct {int value; int mask;} yy359;
+ TriggerStep* yy360;
+ struct AttachKey yy361;
+ Select* yy375;
+ ExprList* yy418;
+ int yy493;
+} YYMINORTYPE;
+#define YYSTACKDEPTH 100
+#define sqlite3ParserARG_SDECL Parse *pParse;
+#define sqlite3ParserARG_PDECL ,Parse *pParse
+#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
+#define sqlite3ParserARG_STORE yypParser->pParse = pParse
+#define YYNSTATE 581
+#define YYNRULE 311
+#define YYERRORSYMBOL 146
+#define YYERRSYMDT yy493
+#define YYFALLBACK 1
+#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
+#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
+#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
+
+/* Next are that tables used to determine what action to take based on the
+** current state and lookahead token. These tables are used to implement
+** functions that take a state number and lookahead value and return an
+** action integer.
+**
+** Suppose the action integer is N. Then the action is determined as
+** follows
+**
+** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
+** token onto the stack and goto state N.
+**
+** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
+**
+** N == YYNSTATE+YYNRULE A syntax error has occurred.
+**
+** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
+**
+** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
+** slots in the yy_action[] table.
+**
+** The action table is constructed as a single large table named yy_action[].
+** Given state S and lookahead X, the action is computed as
+**
+** yy_action[ yy_shift_ofst[S] + X ]
+**
+** If the index value yy_shift_ofst[S]+X is out of range or if the value
+** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
+** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
+** and that yy_default[S] should be used instead.
+**
+** The formula above is for computing the action when the lookahead is
+** a terminal symbol. If the lookahead is a non-terminal (as occurs after
+** a reduce action) then the yy_reduce_ofst[] array is used in place of
+** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
+** YY_SHIFT_USE_DFLT.
+**
+** The following are the tables generated in this section:
+**
+** yy_action[] A single table containing all actions.
+** yy_lookahead[] A table containing the lookahead for each entry in
+** yy_action. Used to detect hash collisions.
+** yy_shift_ofst[] For each state, the offset into yy_action for
+** shifting terminals.
+** yy_reduce_ofst[] For each state, the offset into yy_action for
+** shifting non-terminals after a reduce.
+** yy_default[] Default action for each state.
+*/
+static const YYACTIONTYPE yy_action[] = {
+ /* 0 */ 286, 584, 113, 140, 142, 138, 144, 581, 150, 152,
+ /* 10 */ 154, 156, 158, 160, 162, 164, 166, 168, 3, 577,
+ /* 20 */ 740, 170, 178, 150, 152, 154, 156, 158, 160, 162,
+ /* 30 */ 164, 166, 168, 158, 160, 162, 164, 166, 168, 135,
+ /* 40 */ 97, 171, 181, 186, 191, 180, 185, 146, 148, 140,
+ /* 50 */ 142, 138, 144, 51, 150, 152, 154, 156, 158, 160,
+ /* 60 */ 162, 164, 166, 168, 16, 17, 18, 114, 7, 248,
+ /* 70 */ 150, 152, 154, 156, 158, 160, 162, 164, 166, 168,
+ /* 80 */ 13, 37, 362, 40, 59, 67, 69, 326, 357, 170,
+ /* 90 */ 6, 5, 331, 95, 364, 359, 25, 374, 258, 893,
+ /* 100 */ 1, 580, 514, 13, 4, 575, 33, 135, 97, 171,
+ /* 110 */ 181, 186, 191, 180, 185, 146, 148, 140, 142, 138,
+ /* 120 */ 144, 9, 150, 152, 154, 156, 158, 160, 162, 164,
+ /* 130 */ 166, 168, 374, 136, 592, 80, 112, 99, 269, 34,
+ /* 140 */ 32, 33, 132, 373, 115, 14, 15, 378, 333, 99,
+ /* 150 */ 380, 387, 392, 13, 367, 370, 194, 170, 78, 500,
+ /* 160 */ 525, 315, 395, 369, 375, 408, 10, 98, 14, 15,
+ /* 170 */ 78, 200, 286, 864, 113, 135, 97, 171, 181, 186,
+ /* 180 */ 191, 180, 185, 146, 148, 140, 142, 138, 144, 80,
+ /* 190 */ 150, 152, 154, 156, 158, 160, 162, 164, 166, 168,
+ /* 200 */ 104, 105, 106, 661, 496, 376, 374, 170, 467, 13,
+ /* 210 */ 2, 28, 237, 4, 409, 33, 3, 577, 14, 15,
+ /* 220 */ 51, 132, 133, 115, 241, 135, 97, 171, 181, 186,
+ /* 230 */ 191, 180, 185, 146, 148, 140, 142, 138, 144, 114,
+ /* 240 */ 150, 152, 154, 156, 158, 160, 162, 164, 166, 168,
+ /* 250 */ 40, 59, 67, 69, 326, 357, 136, 44, 45, 501,
+ /* 260 */ 473, 463, 359, 36, 361, 130, 128, 660, 275, 31,
+ /* 270 */ 84, 99, 356, 378, 14, 15, 380, 387, 392, 52,
+ /* 280 */ 170, 117, 122, 123, 113, 541, 369, 643, 395, 348,
+ /* 290 */ 98, 54, 78, 200, 302, 57, 58, 819, 135, 97,
+ /* 300 */ 171, 181, 186, 191, 180, 185, 146, 148, 140, 142,
+ /* 310 */ 138, 144, 861, 150, 152, 154, 156, 158, 160, 162,
+ /* 320 */ 164, 166, 168, 104, 105, 106, 817, 80, 48, 316,
+ /* 330 */ 162, 164, 166, 168, 319, 277, 12, 49, 99, 303,
+ /* 340 */ 283, 818, 99, 124, 304, 99, 241, 172, 593, 114,
+ /* 350 */ 50, 193, 46, 378, 170, 13, 380, 387, 392, 78,
+ /* 360 */ 260, 276, 47, 78, 200, 64, 78, 260, 395, 174,
+ /* 370 */ 175, 221, 135, 97, 171, 181, 186, 191, 180, 185,
+ /* 380 */ 146, 148, 140, 142, 138, 144, 199, 150, 152, 154,
+ /* 390 */ 156, 158, 160, 162, 164, 166, 168, 173, 252, 261,
+ /* 400 */ 120, 122, 123, 212, 170, 268, 254, 130, 128, 288,
+ /* 410 */ 590, 176, 246, 187, 192, 414, 195, 241, 197, 198,
+ /* 420 */ 14, 15, 135, 97, 171, 181, 186, 191, 180, 185,
+ /* 430 */ 146, 148, 140, 142, 138, 144, 433, 150, 152, 154,
+ /* 440 */ 156, 158, 160, 162, 164, 166, 168, 311, 99, 707,
+ /* 450 */ 99, 422, 708, 417, 275, 81, 318, 598, 99, 219,
+ /* 460 */ 13, 231, 124, 13, 176, 48, 187, 192, 20, 78,
+ /* 470 */ 317, 78, 214, 195, 49, 197, 198, 462, 170, 78,
+ /* 480 */ 200, 116, 27, 13, 410, 113, 591, 50, 80, 225,
+ /* 490 */ 195, 11, 197, 198, 506, 235, 135, 97, 171, 181,
+ /* 500 */ 186, 191, 180, 185, 146, 148, 140, 142, 138, 144,
+ /* 510 */ 80, 150, 152, 154, 156, 158, 160, 162, 164, 166,
+ /* 520 */ 168, 277, 215, 324, 606, 14, 15, 301, 14, 15,
+ /* 530 */ 512, 13, 508, 240, 196, 486, 195, 685, 197, 198,
+ /* 540 */ 22, 834, 445, 331, 462, 170, 444, 276, 14, 15,
+ /* 550 */ 114, 468, 278, 394, 599, 280, 470, 288, 446, 680,
+ /* 560 */ 13, 321, 404, 135, 97, 171, 181, 186, 191, 180,
+ /* 570 */ 185, 146, 148, 140, 142, 138, 144, 80, 150, 152,
+ /* 580 */ 154, 156, 158, 160, 162, 164, 166, 168, 74, 99,
+ /* 590 */ 540, 366, 73, 99, 352, 289, 14, 15, 176, 333,
+ /* 600 */ 187, 192, 486, 869, 359, 273, 283, 542, 543, 867,
+ /* 610 */ 78, 500, 510, 170, 78, 323, 682, 176, 472, 187,
+ /* 620 */ 192, 746, 118, 470, 119, 14, 15, 195, 346, 197,
+ /* 630 */ 198, 135, 97, 171, 181, 186, 191, 180, 185, 146,
+ /* 640 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156,
+ /* 650 */ 158, 160, 162, 164, 166, 168, 532, 334, 341, 343,
+ /* 660 */ 841, 39, 195, 170, 197, 198, 78, 94, 124, 356,
+ /* 670 */ 271, 353, 439, 441, 440, 544, 883, 428, 72, 862,
+ /* 680 */ 288, 135, 97, 171, 181, 186, 191, 180, 185, 146,
+ /* 690 */ 148, 140, 142, 138, 144, 13, 150, 152, 154, 156,
+ /* 700 */ 158, 160, 162, 164, 166, 168, 195, 99, 197, 198,
+ /* 710 */ 406, 330, 195, 170, 197, 198, 568, 405, 306, 195,
+ /* 720 */ 42, 197, 198, 65, 195, 539, 197, 198, 78, 96,
+ /* 730 */ 66, 135, 97, 171, 181, 186, 191, 180, 185, 146,
+ /* 740 */ 148, 140, 142, 138, 144, 885, 150, 152, 154, 156,
+ /* 750 */ 158, 160, 162, 164, 166, 168, 99, 740, 99, 298,
+ /* 760 */ 14, 15, 272, 170, 13, 74, 572, 86, 600, 73,
+ /* 770 */ 126, 127, 614, 709, 309, 478, 24, 78, 247, 78,
+ /* 780 */ 111, 135, 97, 171, 181, 186, 191, 180, 185, 146,
+ /* 790 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156,
+ /* 800 */ 158, 160, 162, 164, 166, 168, 99, 238, 113, 239,
+ /* 810 */ 295, 26, 296, 170, 338, 337, 78, 137, 294, 320,
+ /* 820 */ 347, 239, 348, 390, 211, 348, 30, 78, 139, 14,
+ /* 830 */ 15, 135, 189, 171, 181, 186, 191, 180, 185, 146,
+ /* 840 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156,
+ /* 850 */ 158, 160, 162, 164, 166, 168, 99, 80, 99, 372,
+ /* 860 */ 399, 442, 348, 170, 298, 243, 78, 141, 363, 601,
+ /* 870 */ 428, 437, 438, 114, 411, 269, 605, 78, 143, 78,
+ /* 880 */ 145, 448, 97, 171, 181, 186, 191, 180, 185, 146,
+ /* 890 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156,
+ /* 900 */ 158, 160, 162, 164, 166, 168, 99, 80, 99, 430,
+ /* 910 */ 99, 296, 555, 170, 413, 856, 78, 147, 672, 457,
+ /* 920 */ 352, 348, 298, 443, 465, 45, 35, 78, 149, 78,
+ /* 930 */ 151, 78, 153, 171, 181, 186, 191, 180, 185, 146,
+ /* 940 */ 148, 140, 142, 138, 144, 99, 150, 152, 154, 156,
+ /* 950 */ 158, 160, 162, 164, 166, 168, 99, 459, 99, 29,
+ /* 960 */ 79, 464, 183, 483, 71, 339, 78, 155, 709, 421,
+ /* 970 */ 428, 79, 109, 99, 491, 71, 296, 78, 157, 78,
+ /* 980 */ 159, 490, 243, 109, 99, 340, 99, 449, 857, 223,
+ /* 990 */ 99, 460, 182, 709, 78, 161, 99, 349, 827, 136,
+ /* 1000 */ 223, 99, 80, 201, 99, 78, 163, 78, 165, 507,
+ /* 1010 */ 136, 78, 167, 42, 201, 38, 493, 78, 169, 569,
+ /* 1020 */ 207, 205, 78, 177, 674, 78, 179, 477, 203, 76,
+ /* 1030 */ 77, 207, 205, 98, 99, 84, 99, 42, 336, 203,
+ /* 1040 */ 76, 77, 99, 43, 98, 41, 428, 79, 494, 80,
+ /* 1050 */ 428, 71, 84, 99, 352, 78, 188, 78, 190, 109,
+ /* 1060 */ 499, 428, 497, 78, 202, 60, 104, 105, 106, 107,
+ /* 1070 */ 108, 209, 213, 99, 78, 204, 223, 104, 105, 106,
+ /* 1080 */ 107, 108, 209, 213, 820, 509, 136, 53, 383, 511,
+ /* 1090 */ 201, 99, 56, 61, 78, 206, 55, 428, 428, 889,
+ /* 1100 */ 513, 99, 243, 99, 352, 99, 79, 207, 205, 312,
+ /* 1110 */ 71, 99, 78, 208, 483, 203, 76, 77, 109, 533,
+ /* 1120 */ 98, 497, 78, 220, 78, 222, 78, 232, 84, 99,
+ /* 1130 */ 428, 353, 78, 234, 352, 223, 517, 521, 389, 99,
+ /* 1140 */ 62, 530, 99, 64, 63, 136, 68, 529, 70, 201,
+ /* 1150 */ 78, 236, 352, 104, 105, 106, 107, 108, 209, 213,
+ /* 1160 */ 78, 249, 99, 78, 265, 877, 207, 205, 398, 527,
+ /* 1170 */ 99, 615, 616, 313, 203, 76, 77, 99, 523, 98,
+ /* 1180 */ 80, 353, 8, 78, 270, 99, 456, 19, 21, 23,
+ /* 1190 */ 412, 78, 300, 75, 78, 310, 82, 84, 78, 365,
+ /* 1200 */ 563, 83, 547, 99, 87, 553, 78, 393, 85, 557,
+ /* 1210 */ 99, 353, 104, 105, 106, 107, 108, 209, 213, 99,
+ /* 1220 */ 269, 536, 99, 467, 78, 434, 88, 266, 534, 353,
+ /* 1230 */ 560, 78, 481, 566, 264, 89, 250, 90, 93, 91,
+ /* 1240 */ 78, 485, 101, 78, 498, 92, 100, 102, 103, 110,
+ /* 1250 */ 131, 121, 134, 125, 129, 168, 184, 242, 686, 687,
+ /* 1260 */ 688, 210, 233, 218, 224, 216, 227, 226, 217, 229,
+ /* 1270 */ 228, 230, 243, 251, 515, 519, 463, 245, 253, 244,
+ /* 1280 */ 505, 257, 255, 256, 258, 84, 259, 262, 263, 239,
+ /* 1290 */ 267, 279, 274, 281, 282, 299, 285, 292, 284, 287,
+ /* 1300 */ 290, 293, 297, 305, 314, 291, 307, 322, 308, 325,
+ /* 1310 */ 327, 345, 329, 328, 332, 350, 354, 330, 358, 335,
+ /* 1320 */ 342, 379, 381, 382, 344, 351, 368, 385, 355, 371,
+ /* 1330 */ 388, 360, 396, 397, 400, 401, 415, 54, 416, 386,
+ /* 1340 */ 384, 391, 418, 402, 407, 419, 377, 420, 423, 424,
+ /* 1350 */ 403, 426, 425, 427, 429, 435, 431, 849, 436, 854,
+ /* 1360 */ 432, 855, 450, 447, 451, 452, 454, 453, 825, 455,
+ /* 1370 */ 458, 826, 469, 461, 466, 747, 748, 848, 471, 464,
+ /* 1380 */ 863, 480, 474, 475, 476, 482, 865, 479, 487, 484,
+ /* 1390 */ 489, 488, 492, 866, 495, 868, 504, 679, 502, 681,
+ /* 1400 */ 833, 875, 518, 503, 516, 739, 520, 524, 522, 742,
+ /* 1410 */ 745, 531, 526, 835, 535, 528, 538, 537, 836, 837,
+ /* 1420 */ 838, 839, 545, 546, 840, 550, 876, 556, 551, 878,
+ /* 1430 */ 548, 549, 554, 879, 559, 882, 884, 562, 886, 561,
+ /* 1440 */ 552, 558, 564, 567, 570, 565, 571, 887, 576, 574,
+ /* 1450 */ 573, 888, 578, 559, 559, 579,
+};
+static const YYCODETYPE yy_lookahead[] = {
+ /* 0 */ 28, 11, 30, 77, 78, 79, 80, 0, 82, 83,
+ /* 10 */ 84, 85, 86, 87, 88, 89, 90, 91, 11, 12,
+ /* 20 */ 11, 49, 81, 82, 83, 84, 85, 86, 87, 88,
+ /* 30 */ 89, 90, 91, 86, 87, 88, 89, 90, 91, 67,
+ /* 40 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ /* 50 */ 78, 79, 80, 69, 82, 83, 84, 85, 86, 87,
+ /* 60 */ 88, 89, 90, 91, 17, 18, 19, 95, 11, 29,
+ /* 70 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ /* 80 */ 30, 97, 98, 99, 100, 101, 102, 103, 104, 49,
+ /* 90 */ 150, 151, 50, 53, 26, 111, 156, 155, 30, 147,
+ /* 100 */ 148, 149, 162, 30, 152, 163, 164, 67, 68, 69,
+ /* 110 */ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ /* 120 */ 80, 153, 82, 83, 84, 85, 86, 87, 88, 89,
+ /* 130 */ 90, 91, 155, 65, 11, 195, 28, 155, 129, 165,
+ /* 140 */ 163, 164, 168, 169, 170, 95, 96, 97, 106, 155,
+ /* 150 */ 100, 101, 102, 30, 86, 87, 162, 49, 176, 177,
+ /* 160 */ 220, 88, 112, 95, 187, 188, 154, 99, 95, 96,
+ /* 170 */ 176, 177, 28, 21, 30, 67, 68, 69, 70, 71,
+ /* 180 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 195,
+ /* 190 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ /* 200 */ 132, 133, 134, 27, 222, 29, 155, 49, 56, 30,
+ /* 210 */ 149, 160, 218, 152, 163, 164, 11, 12, 95, 96,
+ /* 220 */ 69, 168, 169, 170, 230, 67, 68, 69, 70, 71,
+ /* 230 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 95,
+ /* 240 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ /* 250 */ 99, 100, 101, 102, 103, 104, 65, 192, 193, 107,
+ /* 260 */ 108, 109, 111, 174, 175, 86, 87, 27, 29, 29,
+ /* 270 */ 118, 155, 183, 97, 95, 96, 100, 101, 102, 99,
+ /* 280 */ 49, 171, 172, 173, 30, 106, 95, 27, 112, 29,
+ /* 290 */ 99, 111, 176, 177, 162, 17, 18, 139, 67, 68,
+ /* 300 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
+ /* 310 */ 79, 80, 15, 82, 83, 84, 85, 86, 87, 88,
+ /* 320 */ 89, 90, 91, 132, 133, 134, 21, 195, 22, 27,
+ /* 330 */ 88, 89, 90, 91, 218, 96, 155, 31, 155, 207,
+ /* 340 */ 208, 21, 155, 233, 212, 155, 230, 49, 11, 95,
+ /* 350 */ 44, 26, 46, 97, 49, 30, 100, 101, 102, 176,
+ /* 360 */ 177, 122, 56, 176, 177, 105, 176, 177, 112, 71,
+ /* 370 */ 72, 140, 67, 68, 69, 70, 71, 72, 73, 74,
+ /* 380 */ 75, 76, 77, 78, 79, 80, 27, 82, 83, 84,
+ /* 390 */ 85, 86, 87, 88, 89, 90, 91, 99, 215, 216,
+ /* 400 */ 171, 172, 173, 27, 49, 218, 216, 86, 87, 168,
+ /* 410 */ 11, 223, 224, 225, 226, 24, 114, 230, 116, 117,
+ /* 420 */ 95, 96, 67, 68, 69, 70, 71, 72, 73, 74,
+ /* 430 */ 75, 76, 77, 78, 79, 80, 139, 82, 83, 84,
+ /* 440 */ 85, 86, 87, 88, 89, 90, 91, 206, 155, 27,
+ /* 450 */ 155, 60, 27, 62, 29, 162, 27, 11, 155, 139,
+ /* 460 */ 30, 141, 233, 30, 223, 22, 225, 226, 154, 176,
+ /* 470 */ 177, 176, 177, 114, 31, 116, 117, 162, 49, 176,
+ /* 480 */ 177, 26, 26, 30, 28, 30, 11, 44, 195, 46,
+ /* 490 */ 114, 16, 116, 117, 24, 140, 67, 68, 69, 70,
+ /* 500 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ /* 510 */ 195, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+ /* 520 */ 91, 96, 227, 27, 11, 95, 96, 26, 95, 96,
+ /* 530 */ 60, 30, 62, 230, 115, 220, 114, 118, 116, 117,
+ /* 540 */ 154, 11, 32, 50, 162, 49, 36, 122, 95, 96,
+ /* 550 */ 95, 236, 122, 178, 11, 122, 241, 168, 48, 11,
+ /* 560 */ 30, 88, 69, 67, 68, 69, 70, 71, 72, 73,
+ /* 570 */ 74, 75, 76, 77, 78, 79, 80, 195, 82, 83,
+ /* 580 */ 84, 85, 86, 87, 88, 89, 90, 91, 115, 155,
+ /* 590 */ 155, 27, 119, 155, 155, 206, 95, 96, 223, 106,
+ /* 600 */ 225, 226, 220, 11, 111, 207, 208, 172, 173, 11,
+ /* 610 */ 176, 177, 142, 49, 176, 177, 11, 223, 236, 225,
+ /* 620 */ 226, 11, 27, 241, 29, 95, 96, 114, 189, 116,
+ /* 630 */ 117, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ /* 640 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85,
+ /* 650 */ 86, 87, 88, 89, 90, 91, 222, 107, 108, 109,
+ /* 660 */ 11, 175, 114, 49, 116, 117, 176, 177, 233, 183,
+ /* 670 */ 29, 232, 107, 108, 109, 26, 11, 155, 26, 15,
+ /* 680 */ 168, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ /* 690 */ 76, 77, 78, 79, 80, 30, 82, 83, 84, 85,
+ /* 700 */ 86, 87, 88, 89, 90, 91, 114, 155, 116, 117,
+ /* 710 */ 183, 184, 114, 49, 116, 117, 194, 190, 206, 114,
+ /* 720 */ 106, 116, 117, 34, 114, 76, 116, 117, 176, 177,
+ /* 730 */ 41, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ /* 740 */ 76, 77, 78, 79, 80, 11, 82, 83, 84, 85,
+ /* 750 */ 86, 87, 88, 89, 90, 91, 155, 11, 155, 155,
+ /* 760 */ 95, 96, 121, 49, 30, 115, 244, 198, 11, 119,
+ /* 770 */ 132, 133, 120, 28, 205, 29, 154, 176, 177, 176,
+ /* 780 */ 177, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ /* 790 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85,
+ /* 800 */ 86, 87, 88, 89, 90, 91, 155, 27, 30, 29,
+ /* 810 */ 27, 157, 29, 49, 98, 99, 176, 177, 214, 27,
+ /* 820 */ 27, 29, 29, 27, 162, 29, 27, 176, 177, 95,
+ /* 830 */ 96, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ /* 840 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85,
+ /* 850 */ 86, 87, 88, 89, 90, 91, 155, 195, 155, 167,
+ /* 860 */ 27, 52, 29, 49, 155, 120, 176, 177, 176, 11,
+ /* 870 */ 155, 58, 59, 95, 162, 129, 11, 176, 177, 176,
+ /* 880 */ 177, 25, 68, 69, 70, 71, 72, 73, 74, 75,
+ /* 890 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85,
+ /* 900 */ 86, 87, 88, 89, 90, 91, 155, 195, 155, 194,
+ /* 910 */ 155, 29, 134, 49, 158, 106, 176, 177, 11, 27,
+ /* 920 */ 155, 29, 155, 214, 192, 193, 166, 176, 177, 176,
+ /* 930 */ 177, 176, 177, 69, 70, 71, 72, 73, 74, 75,
+ /* 940 */ 76, 77, 78, 79, 80, 155, 82, 83, 84, 85,
+ /* 950 */ 86, 87, 88, 89, 90, 91, 155, 101, 155, 161,
+ /* 960 */ 26, 67, 69, 155, 30, 37, 176, 177, 106, 162,
+ /* 970 */ 155, 26, 38, 155, 27, 30, 29, 176, 177, 176,
+ /* 980 */ 177, 214, 120, 38, 155, 57, 155, 231, 106, 55,
+ /* 990 */ 155, 235, 99, 11, 176, 177, 155, 232, 142, 65,
+ /* 1000 */ 55, 155, 195, 69, 155, 176, 177, 176, 177, 194,
+ /* 1010 */ 65, 176, 177, 106, 69, 155, 162, 176, 177, 64,
+ /* 1020 */ 86, 87, 176, 177, 130, 176, 177, 219, 94, 95,
+ /* 1030 */ 96, 86, 87, 99, 155, 118, 155, 106, 110, 94,
+ /* 1040 */ 95, 96, 155, 39, 99, 178, 155, 26, 131, 195,
+ /* 1050 */ 155, 30, 118, 155, 155, 176, 177, 176, 177, 38,
+ /* 1060 */ 27, 155, 29, 176, 177, 51, 132, 133, 134, 135,
+ /* 1070 */ 136, 137, 138, 155, 176, 177, 55, 132, 133, 134,
+ /* 1080 */ 135, 136, 137, 138, 139, 194, 65, 178, 189, 194,
+ /* 1090 */ 69, 155, 47, 179, 176, 177, 186, 155, 155, 144,
+ /* 1100 */ 194, 155, 120, 155, 155, 155, 26, 86, 87, 88,
+ /* 1110 */ 30, 155, 176, 177, 155, 94, 95, 96, 38, 27,
+ /* 1120 */ 99, 29, 176, 177, 176, 177, 176, 177, 118, 155,
+ /* 1130 */ 155, 232, 176, 177, 155, 55, 194, 194, 189, 155,
+ /* 1140 */ 178, 131, 155, 105, 180, 65, 178, 162, 26, 69,
+ /* 1150 */ 176, 177, 155, 132, 133, 134, 135, 136, 137, 138,
+ /* 1160 */ 176, 177, 155, 176, 177, 11, 86, 87, 189, 194,
+ /* 1170 */ 155, 120, 120, 155, 94, 95, 96, 155, 219, 99,
+ /* 1180 */ 195, 232, 15, 176, 177, 155, 189, 20, 21, 22,
+ /* 1190 */ 23, 176, 177, 197, 176, 177, 196, 118, 176, 177,
+ /* 1200 */ 33, 195, 35, 155, 199, 51, 176, 177, 197, 42,
+ /* 1210 */ 155, 232, 132, 133, 134, 135, 136, 137, 138, 155,
+ /* 1220 */ 129, 54, 155, 56, 176, 177, 200, 126, 61, 232,
+ /* 1230 */ 63, 176, 177, 66, 127, 201, 124, 202, 128, 203,
+ /* 1240 */ 176, 177, 155, 176, 177, 204, 120, 120, 155, 26,
+ /* 1250 */ 168, 27, 27, 234, 234, 91, 99, 155, 118, 118,
+ /* 1260 */ 118, 26, 139, 21, 26, 228, 193, 27, 229, 155,
+ /* 1270 */ 29, 27, 120, 125, 107, 108, 109, 159, 29, 155,
+ /* 1280 */ 113, 104, 217, 179, 30, 118, 167, 217, 179, 29,
+ /* 1290 */ 125, 155, 209, 155, 122, 106, 159, 123, 155, 155,
+ /* 1300 */ 210, 26, 155, 27, 120, 211, 210, 27, 211, 178,
+ /* 1310 */ 155, 26, 182, 181, 155, 217, 217, 184, 167, 185,
+ /* 1320 */ 185, 155, 51, 26, 185, 179, 176, 27, 179, 176,
+ /* 1330 */ 26, 186, 51, 26, 103, 155, 155, 111, 159, 178,
+ /* 1340 */ 180, 178, 155, 181, 188, 159, 188, 28, 155, 159,
+ /* 1350 */ 182, 238, 237, 106, 159, 45, 239, 15, 43, 106,
+ /* 1360 */ 240, 106, 142, 52, 155, 159, 155, 106, 11, 26,
+ /* 1370 */ 178, 142, 21, 15, 191, 130, 130, 11, 11, 67,
+ /* 1380 */ 21, 76, 191, 155, 110, 200, 11, 155, 130, 76,
+ /* 1390 */ 26, 155, 221, 11, 26, 11, 200, 11, 121, 11,
+ /* 1400 */ 11, 11, 200, 155, 121, 11, 191, 200, 110, 11,
+ /* 1410 */ 11, 26, 130, 11, 155, 221, 159, 155, 11, 11,
+ /* 1420 */ 11, 11, 155, 27, 11, 28, 11, 40, 155, 11,
+ /* 1430 */ 242, 168, 168, 11, 155, 11, 11, 159, 11, 155,
+ /* 1440 */ 243, 242, 155, 24, 143, 159, 155, 11, 145, 245,
+ /* 1450 */ 144, 11, 13, 246, 246, 14,
+};
+#define YY_SHIFT_USE_DFLT (-75)
+static const short yy_shift_ofst[] = {
+ /* 0 */ 205, 7, -75, -75, 1167, -10, 57, -75, 47, 475,
+ /* 10 */ 399, 123, 337, -75, -75, -75, -75, -75, -75, 475,
+ /* 20 */ 446, 475, 543, 475, 757, 456, 858, 453, 240, 799,
+ /* 30 */ 865, 50, -75, 254, -75, -16, -75, 453, 151, -75,
+ /* 40 */ 931, -75, 1004, 306, -75, -75, -75, -75, -75, -75,
+ /* 50 */ -75, 180, 931, -75, 1045, -75, 278, -75, -75, 1014,
+ /* 60 */ 689, 931, 1038, -75, -75, -75, -75, 931, -75, 1122,
+ /* 70 */ 1080, 652, 473, -75, -75, 1080, 1051, 1052, -75, 934,
+ /* 80 */ -75, 302, 1079, -75, 650, -75, 641, 1091, 1101, 1107,
+ /* 90 */ 1112, 1110, -75, 1080, 40, 1080, 714, 1080, -75, 1126,
+ /* 100 */ 453, 1127, 453, -75, -75, -75, -75, -75, -75, 1223,
+ /* 110 */ 1080, 108, 254, -75, -75, 455, 321, 595, -75, 321,
+ /* 120 */ 1224, -75, -75, -75, 638, -75, -75, -75, 638, -75,
+ /* 130 */ -75, -75, -75, 1225, -75, 1080, -75, 814, 1080, -12,
+ /* 140 */ 1080, -12, 1080, -12, 1080, -12, 1080, -74, 1080, -74,
+ /* 150 */ 1080, -53, 1080, -53, 1080, -53, 1080, -53, 1080, 242,
+ /* 160 */ 1080, 242, 1080, 1164, 1080, 1164, 1080, 1164, 1080, -75,
+ /* 170 */ -75, 298, -75, -75, -75, -75, 1080, -59, 1080, -12,
+ /* 180 */ -75, 893, -75, 1157, -75, -75, -75, 1080, 764, 1080,
+ /* 190 */ -74, -75, 325, 934, 359, 419, 1140, 1141, 1142, -75,
+ /* 200 */ 714, 1080, 864, 1080, -75, 1080, -75, 1080, -75, 1235,
+ /* 210 */ 1079, 376, -75, 945, 158, 1123, 320, 1242, -75, 1080,
+ /* 220 */ 231, 1080, 714, 1238, 443, 1240, -75, 1241, 453, 1244,
+ /* 230 */ -75, 1080, 305, 1080, 355, 1080, 714, 780, -75, 1080,
+ /* 240 */ -75, -75, 1152, 453, -75, -75, -75, 864, 1080, 714,
+ /* 250 */ 1148, 1080, 1249, 1080, 1177, 689, -75, 1254, -75, -75,
+ /* 260 */ 714, 1177, 689, -75, 1080, 714, 1165, 1080, 1260, 1080,
+ /* 270 */ 714, -75, -75, 239, -75, -75, -75, 430, -75, 433,
+ /* 280 */ -75, 1172, -75, 501, 1152, 144, 453, -75, -75, 1189,
+ /* 290 */ 1174, -75, 1275, 453, 783, -75, 453, -75, -75, 1080,
+ /* 300 */ 714, 1079, 422, 425, 1276, 144, 1189, 1174, -75, 1021,
+ /* 310 */ -28, -75, -75, 1184, 73, -75, -75, 429, -75, 792,
+ /* 320 */ -75, 1280, -75, 496, 931, -75, 453, 1285, -75, 42,
+ /* 330 */ -75, 453, -75, 550, 928, -75, 716, -75, -75, -75,
+ /* 340 */ -75, 928, -75, 928, -75, 453, 793, -75, 453, 1177,
+ /* 350 */ 689, -75, -75, 1177, 689, -75, -75, 1254, -75, 1045,
+ /* 360 */ -75, -75, 68, -75, 1080, 564, -75, 191, -75, -75,
+ /* 370 */ 191, -75, -75, -75, -75, 176, 256, -75, 453, -75,
+ /* 380 */ 1271, 1297, 453, 260, 1300, 931, -75, 1304, 453, 796,
+ /* 390 */ 931, -75, 1080, 614, -75, 1281, 1307, 453, 833, 1231,
+ /* 400 */ 453, 1285, -75, 493, 1226, -75, -75, -75, -75, -75,
+ /* 410 */ 1079, 513, 856, 391, 453, 1152, -75, 453, 745, 1319,
+ /* 420 */ 1079, 548, 453, 1152, 510, 565, 1247, 453, 1152, -75,
+ /* 430 */ 1310, 297, 1342, 1080, 664, 1315, 813, -75, -75, 1253,
+ /* 440 */ 1255, 809, 453, 882, -75, -75, 1311, -75, -75, 1220,
+ /* 450 */ 453, 862, 1261, 453, 1343, 453, 892, 907, 1357, 1229,
+ /* 460 */ 1358, 152, 592, 894, 306, -75, 1245, 1246, 1351, 1366,
+ /* 470 */ 1367, 152, 1359, 1312, 453, 1274, 453, 746, 453, 1305,
+ /* 480 */ 1080, 714, 1375, 1313, 1080, 714, 1258, 453, 1364, 453,
+ /* 490 */ 947, -75, 917, 598, 1368, 1080, 1033, 1080, 714, 1382,
+ /* 500 */ 714, 1277, 453, 9, 1384, 470, 453, 1386, 453, 1388,
+ /* 510 */ 453, 1389, 453, 1390, 605, 1283, 453, 9, 1394, 1312,
+ /* 520 */ 453, 1298, 453, 746, 1398, 1282, 453, 1364, 1010, 610,
+ /* 530 */ 1385, 1080, 1092, 1399, 530, 1402, 453, 1152, 649, 179,
+ /* 540 */ 1407, 1408, 1409, 1410, 453, 1396, 1413, 1387, 254, 1397,
+ /* 550 */ 453, 1154, 1415, 778, 1418, 1422, -75, 1387, 453, 1424,
+ /* 560 */ 665, 982, 1425, 734, 982, 1427, 1419, 453, 955, 1301,
+ /* 570 */ 453, 1436, 1306, 1303, 453, 1440, -75, 1439, 1441, -75,
+ /* 580 */ -75,
+};
+#define YY_REDUCE_USE_DFLT (-61)
+static const short yy_reduce_ofst[] = {
+ /* 0 */ -48, 61, -61, -61, -60, -61, -61, -61, -32, 12,
+ /* 10 */ -61, 181, -61, -61, -61, -61, -61, -61, -61, 314,
+ /* 20 */ -61, 386, -61, 622, -61, 654, -61, 51, 798, -61,
+ /* 30 */ -61, -23, -61, -26, 760, 89, -61, 860, 486, -61,
+ /* 40 */ 867, -61, -61, 65, -61, -61, -61, -61, -61, -61,
+ /* 50 */ -61, -61, 909, -61, 910, -61, -61, -61, -61, -61,
+ /* 60 */ 914, 962, 964, -61, -61, -61, -61, 968, -61, -61,
+ /* 70 */ 438, -61, 996, -61, -61, 116, -61, -61, -61, 293,
+ /* 80 */ -61, 1000, 1006, -61, 1011, 569, 1005, 1026, 1034, 1035,
+ /* 90 */ 1036, 1041, -61, 490, 394, 552, 394, 601, -61, -61,
+ /* 100 */ 1087, -61, 1093, -61, -61, -61, -61, -61, -61, -61,
+ /* 110 */ 603, 394, 53, -61, -61, 1082, 110, -61, -61, 229,
+ /* 120 */ -61, -61, -61, -61, 1019, -61, -61, -61, 1020, -61,
+ /* 130 */ -61, -61, -61, -61, -61, 640, -61, 394, 651, 394,
+ /* 140 */ 690, 394, 701, 394, 703, 394, 740, 394, 751, 394,
+ /* 150 */ 753, 394, 755, 394, 790, 394, 801, 394, 803, 394,
+ /* 160 */ 818, 394, 829, 394, 831, 394, 835, 394, 841, 394,
+ /* 170 */ -61, -61, -61, -61, -61, -61, 846, 188, 849, 394,
+ /* 180 */ -61, -61, -61, -61, -61, -61, -61, 879, 394, 881,
+ /* 190 */ 394, -61, 1102, -6, 1000, -61, -61, -61, -61, -61,
+ /* 200 */ 394, 887, 394, 898, 394, 918, 394, 936, 394, -61,
+ /* 210 */ 662, 1000, -61, 295, 394, 1037, 1039, -61, -61, 946,
+ /* 220 */ 394, 948, 394, -61, 1073, -61, -61, -61, 1114, -61,
+ /* 230 */ -61, 950, 394, 956, 394, 974, 394, -61, -61, 303,
+ /* 240 */ -61, -61, 1118, 1124, -61, -61, -61, 394, 984, 394,
+ /* 250 */ -61, 183, -61, 190, 1065, 1104, -61, 1119, -61, -61,
+ /* 260 */ 394, 1070, 1109, -61, 987, 394, -61, 187, -61, 1007,
+ /* 270 */ 394, -61, 398, 1083, -61, -61, -61, 1136, -61, 1138,
+ /* 280 */ -61, -61, -61, 1143, 1137, 389, 1144, -61, -61, 1090,
+ /* 290 */ 1094, -61, -61, 604, -61, -61, 1147, -61, -61, 1015,
+ /* 300 */ 394, 132, 1000, 1083, -61, 512, 1096, 1097, -61, 1018,
+ /* 310 */ 241, -61, -61, -61, 1087, -61, -61, 394, -61, -61,
+ /* 320 */ -61, -61, -61, 394, 1131, -61, 1155, 1132, 1130, 1133,
+ /* 330 */ -61, 1159, -61, -61, 1134, -61, -61, -61, -61, -61,
+ /* 340 */ -61, 1135, -61, 1139, -61, 439, -61, -61, 765, 1098,
+ /* 350 */ 1146, -61, -61, 1099, 1149, -61, -61, 1151, -61, 1145,
+ /* 360 */ -61, -61, 692, -61, 1022, 394, -61, 1150, -61, -61,
+ /* 370 */ 1153, -61, -61, -61, -61, 1156, 1158, -61, 1166, -61,
+ /* 380 */ -61, -61, 899, 1160, -61, 1161, -61, -61, 949, -61,
+ /* 390 */ 1163, -61, 1030, 375, -61, -61, -61, 979, -61, -61,
+ /* 400 */ 1180, 1162, 1168, 527, -61, -61, -61, -61, -61, -61,
+ /* 410 */ 712, 1000, 756, -61, 1181, 1179, -61, 1187, 1186, -61,
+ /* 420 */ 807, 1000, 1193, 1190, 1115, 1113, -61, 715, 1195, -61,
+ /* 430 */ 1117, 1120, -61, 1048, 394, -61, -61, -61, -61, -61,
+ /* 440 */ -61, -61, 709, -61, -61, -61, -61, -61, -61, -61,
+ /* 450 */ 1209, 1206, -61, 1211, -61, 997, -61, 1192, -61, -61,
+ /* 460 */ -61, 315, 1000, 1183, 732, -61, -61, -61, -61, -61,
+ /* 470 */ -61, 382, -61, 1191, 1228, -61, 808, 1185, 1232, -61,
+ /* 480 */ 1055, 394, -61, -61, 1064, 394, -61, 1236, 1171, 767,
+ /* 490 */ -61, -61, 854, 1000, -61, -18, -61, 1067, 394, -61,
+ /* 500 */ 394, -61, 1248, 1196, -61, -61, 815, -61, 891, -61,
+ /* 510 */ 895, -61, 906, -61, 1000, -61, 942, 1202, -61, 1215,
+ /* 520 */ 943, -61, 959, 1207, -61, -61, 975, 1194, 985, 1000,
+ /* 530 */ -61, 434, -61, -61, 1259, -61, 1262, 1257, -61, 435,
+ /* 540 */ -61, -61, -61, -61, 1267, -61, -61, 1188, 1263, -61,
+ /* 550 */ 1273, 1197, -61, 1264, -61, -61, -61, 1199, 1279, -61,
+ /* 560 */ 1284, 1278, -61, 1287, 1286, -61, -61, 522, -61, -61,
+ /* 570 */ 1291, -61, -61, 1204, -58, -61, -61, -61, -61, -61,
+ /* 580 */ -61,
+};
+static const YYACTIONTYPE yy_default[] = {
+ /* 0 */ 587, 587, 582, 585, 892, 892, 892, 586, 594, 892,
+ /* 10 */ 892, 892, 892, 614, 615, 616, 595, 596, 597, 892,
+ /* 20 */ 892, 892, 892, 892, 892, 892, 892, 892, 892, 892,
+ /* 30 */ 892, 892, 607, 617, 627, 609, 626, 892, 892, 628,
+ /* 40 */ 672, 635, 892, 892, 673, 676, 677, 678, 872, 873,
+ /* 50 */ 874, 892, 672, 636, 657, 655, 892, 658, 659, 892,
+ /* 60 */ 728, 672, 643, 637, 644, 726, 727, 672, 638, 892,
+ /* 70 */ 892, 758, 692, 690, 691, 824, 764, 759, 755, 892,
+ /* 80 */ 683, 892, 892, 684, 692, 694, 701, 740, 731, 733,
+ /* 90 */ 721, 735, 689, 892, 736, 892, 737, 892, 757, 892,
+ /* 100 */ 892, 760, 892, 761, 762, 763, 765, 766, 767, 892,
+ /* 110 */ 892, 892, 892, 612, 613, 619, 847, 892, 620, 847,
+ /* 120 */ 892, 621, 624, 625, 892, 842, 844, 845, 892, 843,
+ /* 130 */ 846, 623, 622, 892, 768, 892, 771, 773, 892, 774,
+ /* 140 */ 892, 775, 892, 776, 892, 777, 892, 778, 892, 779,
+ /* 150 */ 892, 780, 892, 781, 892, 782, 892, 783, 892, 784,
+ /* 160 */ 892, 785, 892, 786, 892, 787, 892, 788, 892, 789,
+ /* 170 */ 790, 892, 791, 798, 805, 808, 892, 793, 892, 792,
+ /* 180 */ 795, 892, 796, 892, 799, 797, 804, 892, 892, 892,
+ /* 190 */ 806, 807, 892, 824, 892, 892, 892, 892, 892, 811,
+ /* 200 */ 823, 892, 800, 892, 801, 892, 802, 892, 803, 892,
+ /* 210 */ 892, 892, 813, 892, 892, 892, 892, 892, 814, 892,
+ /* 220 */ 892, 892, 815, 892, 892, 892, 870, 892, 892, 892,
+ /* 230 */ 871, 892, 892, 892, 892, 892, 816, 892, 809, 824,
+ /* 240 */ 821, 822, 709, 892, 710, 812, 794, 772, 892, 738,
+ /* 250 */ 892, 892, 722, 892, 729, 728, 723, 892, 611, 730,
+ /* 260 */ 725, 729, 728, 724, 892, 734, 892, 824, 732, 892,
+ /* 270 */ 741, 693, 704, 702, 703, 712, 713, 892, 714, 892,
+ /* 280 */ 715, 892, 716, 892, 709, 700, 892, 698, 699, 718,
+ /* 290 */ 720, 705, 892, 892, 892, 719, 892, 753, 754, 892,
+ /* 300 */ 717, 704, 892, 892, 892, 700, 718, 720, 706, 892,
+ /* 310 */ 700, 695, 696, 892, 892, 697, 810, 892, 756, 892,
+ /* 320 */ 769, 892, 770, 892, 672, 639, 892, 828, 645, 640,
+ /* 330 */ 646, 892, 647, 892, 892, 648, 892, 651, 652, 653,
+ /* 340 */ 654, 892, 649, 892, 650, 892, 892, 829, 892, 729,
+ /* 350 */ 728, 830, 832, 729, 728, 831, 641, 892, 642, 657,
+ /* 360 */ 656, 629, 892, 630, 892, 892, 631, 892, 632, 764,
+ /* 370 */ 892, 633, 634, 618, 610, 892, 892, 662, 892, 665,
+ /* 380 */ 892, 892, 892, 892, 892, 672, 666, 892, 892, 892,
+ /* 390 */ 672, 667, 892, 672, 668, 892, 892, 892, 892, 892,
+ /* 400 */ 892, 828, 645, 670, 892, 669, 671, 663, 664, 608,
+ /* 410 */ 892, 892, 604, 892, 892, 709, 602, 892, 892, 892,
+ /* 420 */ 892, 892, 892, 709, 853, 892, 892, 892, 709, 711,
+ /* 430 */ 858, 892, 892, 892, 892, 892, 892, 859, 860, 892,
+ /* 440 */ 892, 892, 892, 892, 850, 851, 892, 852, 603, 892,
+ /* 450 */ 892, 892, 892, 892, 892, 892, 892, 892, 892, 892,
+ /* 460 */ 892, 892, 892, 892, 892, 675, 892, 892, 892, 892,
+ /* 470 */ 892, 892, 892, 674, 892, 892, 892, 892, 892, 892,
+ /* 480 */ 892, 743, 892, 892, 892, 744, 892, 892, 751, 892,
+ /* 490 */ 892, 752, 892, 892, 892, 892, 892, 892, 749, 892,
+ /* 500 */ 750, 892, 892, 892, 892, 892, 892, 892, 892, 892,
+ /* 510 */ 892, 892, 892, 892, 892, 892, 892, 892, 892, 674,
+ /* 520 */ 892, 892, 892, 892, 892, 892, 892, 751, 892, 892,
+ /* 530 */ 892, 892, 892, 892, 892, 892, 892, 709, 892, 847,
+ /* 540 */ 892, 892, 892, 892, 892, 892, 892, 881, 892, 892,
+ /* 550 */ 892, 892, 892, 892, 892, 892, 880, 881, 892, 892,
+ /* 560 */ 892, 892, 892, 892, 892, 892, 892, 892, 892, 892,
+ /* 570 */ 892, 892, 892, 890, 892, 892, 891, 588, 892, 589,
+ /* 580 */ 583,
+};
+#define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0]))
+
+/* The next table maps tokens into fallback tokens. If a construct
+** like the following:
+**
+** %fallback ID X Y Z.
+**
+** appears in the grammer, then ID becomes a fallback token for X, Y,
+** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
+** but it does not parse, the type of the token is changed to ID and
+** the parse is retried before an error is thrown.
+*/
+#ifdef YYFALLBACK
+static const YYCODETYPE yyFallback[] = {
+ 0, /* $ => nothing */
+ 0, /* END_OF_FILE => nothing */
+ 0, /* ILLEGAL => nothing */
+ 0, /* SPACE => nothing */
+ 0, /* UNCLOSED_STRING => nothing */
+ 0, /* COMMENT => nothing */
+ 0, /* FUNCTION => nothing */
+ 0, /* COLUMN => nothing */
+ 0, /* AGG_FUNCTION => nothing */
+ 0, /* AGG_COLUMN => nothing */
+ 0, /* CONST_FUNC => nothing */
+ 0, /* SEMI => nothing */
+ 30, /* EXPLAIN => ID */
+ 30, /* QUERY => ID */
+ 30, /* PLAN => ID */
+ 30, /* BEGIN => ID */
+ 0, /* TRANSACTION => nothing */
+ 30, /* DEFERRED => ID */
+ 30, /* IMMEDIATE => ID */
+ 30, /* EXCLUSIVE => ID */
+ 0, /* COMMIT => nothing */
+ 30, /* END => ID */
+ 0, /* ROLLBACK => nothing */
+ 0, /* CREATE => nothing */
+ 0, /* TABLE => nothing */
+ 30, /* TEMP => ID */
+ 0, /* LP => nothing */
+ 0, /* RP => nothing */
+ 0, /* AS => nothing */
+ 0, /* COMMA => nothing */
+ 0, /* ID => nothing */
+ 30, /* ABORT => ID */
+ 30, /* AFTER => ID */
+ 30, /* ANALYZE => ID */
+ 30, /* ASC => ID */
+ 30, /* ATTACH => ID */
+ 30, /* BEFORE => ID */
+ 30, /* CASCADE => ID */
+ 30, /* CAST => ID */
+ 30, /* CONFLICT => ID */
+ 30, /* DATABASE => ID */
+ 30, /* DESC => ID */
+ 30, /* DETACH => ID */
+ 30, /* EACH => ID */
+ 30, /* FAIL => ID */
+ 30, /* FOR => ID */
+ 30, /* IGNORE => ID */
+ 30, /* INITIALLY => ID */
+ 30, /* INSTEAD => ID */
+ 30, /* LIKE_KW => ID */
+ 30, /* MATCH => ID */
+ 30, /* KEY => ID */
+ 30, /* OF => ID */
+ 30, /* OFFSET => ID */
+ 30, /* PRAGMA => ID */
+ 30, /* RAISE => ID */
+ 30, /* REPLACE => ID */
+ 30, /* RESTRICT => ID */
+ 30, /* ROW => ID */
+ 30, /* STATEMENT => ID */
+ 30, /* TRIGGER => ID */
+ 30, /* VACUUM => ID */
+ 30, /* VIEW => ID */
+ 30, /* REINDEX => ID */
+ 30, /* RENAME => ID */
+ 30, /* CTIME_KW => ID */
+ 30, /* ALTER => ID */
+ 0, /* OR => nothing */
+ 0, /* AND => nothing */
+ 0, /* NOT => nothing */
+ 0, /* IS => nothing */
+ 0, /* BETWEEN => nothing */
+ 0, /* IN => nothing */
+ 0, /* ISNULL => nothing */
+ 0, /* NOTNULL => nothing */
+ 0, /* NE => nothing */
+ 0, /* EQ => nothing */
+ 0, /* GT => nothing */
+ 0, /* LE => nothing */
+ 0, /* LT => nothing */
+ 0, /* GE => nothing */
+ 0, /* ESCAPE => nothing */
+ 0, /* BITAND => nothing */
+ 0, /* BITOR => nothing */
+ 0, /* LSHIFT => nothing */
+ 0, /* RSHIFT => nothing */
+ 0, /* PLUS => nothing */
+ 0, /* MINUS => nothing */
+ 0, /* STAR => nothing */
+ 0, /* SLASH => nothing */
+ 0, /* REM => nothing */
+ 0, /* CONCAT => nothing */
+ 0, /* UMINUS => nothing */
+ 0, /* UPLUS => nothing */
+ 0, /* BITNOT => nothing */
+ 0, /* STRING => nothing */
+ 0, /* JOIN_KW => nothing */
+ 0, /* CONSTRAINT => nothing */
+ 0, /* DEFAULT => nothing */
+ 0, /* NULL => nothing */
+ 0, /* PRIMARY => nothing */
+ 0, /* UNIQUE => nothing */
+ 0, /* CHECK => nothing */
+ 0, /* REFERENCES => nothing */
+ 0, /* COLLATE => nothing */
+ 0, /* AUTOINCR => nothing */
+ 0, /* ON => nothing */
+ 0, /* DELETE => nothing */
+ 0, /* UPDATE => nothing */
+ 0, /* INSERT => nothing */
+ 0, /* SET => nothing */
+ 0, /* DEFERRABLE => nothing */
+ 0, /* FOREIGN => nothing */
+ 0, /* DROP => nothing */
+ 0, /* UNION => nothing */
+ 0, /* ALL => nothing */
+ 0, /* INTERSECT => nothing */
+ 0, /* EXCEPT => nothing */
+ 0, /* SELECT => nothing */
+ 0, /* DISTINCT => nothing */
+ 0, /* DOT => nothing */
+ 0, /* FROM => nothing */
+ 0, /* JOIN => nothing */
+ 0, /* USING => nothing */
+ 0, /* ORDER => nothing */
+ 0, /* BY => nothing */
+ 0, /* GROUP => nothing */
+ 0, /* HAVING => nothing */
+ 0, /* LIMIT => nothing */
+ 0, /* WHERE => nothing */
+ 0, /* INTO => nothing */
+ 0, /* VALUES => nothing */
+ 0, /* INTEGER => nothing */
+ 0, /* FLOAT => nothing */
+ 0, /* BLOB => nothing */
+ 0, /* REGISTER => nothing */
+ 0, /* VARIABLE => nothing */
+ 0, /* EXISTS => nothing */
+ 0, /* CASE => nothing */
+ 0, /* WHEN => nothing */
+ 0, /* THEN => nothing */
+ 0, /* ELSE => nothing */
+ 0, /* INDEX => nothing */
+ 0, /* TO => nothing */
+ 0, /* ADD => nothing */
+ 0, /* COLUMNKW => nothing */
+};
+#endif /* YYFALLBACK */
+
+/* The following structure represents a single element of the
+** parser's stack. Information stored includes:
+**
+** + The state number for the parser at this level of the stack.
+**
+** + The value of the token stored at this level of the stack.
+** (In other words, the "major" token.)
+**
+** + The semantic value stored at this level of the stack. This is
+** the information used by the action routines in the grammar.
+** It is sometimes called the "minor" token.
+*/
+struct yyStackEntry {
+ int stateno; /* The state-number */
+ int major; /* The major token value. This is the code
+ ** number for the token at this stack level */
+ YYMINORTYPE minor; /* The user-supplied minor token value. This
+ ** is the value of the token */
+};
+typedef struct yyStackEntry yyStackEntry;
+
+/* The state of the parser is completely contained in an instance of
+** the following structure */
+struct yyParser {
+ int yyidx; /* Index of top element in stack */
+ int yyerrcnt; /* Shifts left before out of the error */
+ sqlite3ParserARG_SDECL /* A place to hold %extra_argument */
+ yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
+};
+typedef struct yyParser yyParser;
+
+#ifndef NDEBUG
+#include <stdio.h>
+static FILE *yyTraceFILE = 0;
+static char *yyTracePrompt = 0;
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/*
+** Turn parser tracing on by giving a stream to which to write the trace
+** and a prompt to preface each trace message. Tracing is turned off
+** by making either argument NULL
+**
+** Inputs:
+** <ul>
+** <li> A FILE* to which trace output should be written.
+** If NULL, then tracing is turned off.
+** <li> A prefix string written at the beginning of every
+** line of trace output. If NULL, then tracing is
+** turned off.
+** </ul>
+**
+** Outputs:
+** None.
+*/
+void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
+ yyTraceFILE = TraceFILE;
+ yyTracePrompt = zTracePrompt;
+ if( yyTraceFILE==0 ) yyTracePrompt = 0;
+ else if( yyTracePrompt==0 ) yyTraceFILE = 0;
+}
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/* For tracing shifts, the names of all terminals and nonterminals
+** are required. The following table supplies these names */
+static const char *const yyTokenName[] = {
+ "$", "END_OF_FILE", "ILLEGAL", "SPACE",
+ "UNCLOSED_STRING", "COMMENT", "FUNCTION", "COLUMN",
+ "AGG_FUNCTION", "AGG_COLUMN", "CONST_FUNC", "SEMI",
+ "EXPLAIN", "QUERY", "PLAN", "BEGIN",
+ "TRANSACTION", "DEFERRED", "IMMEDIATE", "EXCLUSIVE",
+ "COMMIT", "END", "ROLLBACK", "CREATE",
+ "TABLE", "TEMP", "LP", "RP",
+ "AS", "COMMA", "ID", "ABORT",
+ "AFTER", "ANALYZE", "ASC", "ATTACH",
+ "BEFORE", "CASCADE", "CAST", "CONFLICT",
+ "DATABASE", "DESC", "DETACH", "EACH",
+ "FAIL", "FOR", "IGNORE", "INITIALLY",
+ "INSTEAD", "LIKE_KW", "MATCH", "KEY",
+ "OF", "OFFSET", "PRAGMA", "RAISE",
+ "REPLACE", "RESTRICT", "ROW", "STATEMENT",
+ "TRIGGER", "VACUUM", "VIEW", "REINDEX",
+ "RENAME", "CTIME_KW", "ALTER", "OR",
+ "AND", "NOT", "IS", "BETWEEN",
+ "IN", "ISNULL", "NOTNULL", "NE",
+ "EQ", "GT", "LE", "LT",
+ "GE", "ESCAPE", "BITAND", "BITOR",
+ "LSHIFT", "RSHIFT", "PLUS", "MINUS",
+ "STAR", "SLASH", "REM", "CONCAT",
+ "UMINUS", "UPLUS", "BITNOT", "STRING",
+ "JOIN_KW", "CONSTRAINT", "DEFAULT", "NULL",
+ "PRIMARY", "UNIQUE", "CHECK", "REFERENCES",
+ "COLLATE", "AUTOINCR", "ON", "DELETE",
+ "UPDATE", "INSERT", "SET", "DEFERRABLE",
+ "FOREIGN", "DROP", "UNION", "ALL",
+ "INTERSECT", "EXCEPT", "SELECT", "DISTINCT",
+ "DOT", "FROM", "JOIN", "USING",
+ "ORDER", "BY", "GROUP", "HAVING",
+ "LIMIT", "WHERE", "INTO", "VALUES",
+ "INTEGER", "FLOAT", "BLOB", "REGISTER",
+ "VARIABLE", "EXISTS", "CASE", "WHEN",
+ "THEN", "ELSE", "INDEX", "TO",
+ "ADD", "COLUMNKW", "error", "input",
+ "cmdlist", "ecmd", "cmdx", "cmd",
+ "explain", "transtype", "trans_opt", "nm",
+ "create_table", "create_table_args", "temp", "dbnm",
+ "columnlist", "conslist_opt", "select", "column",
+ "columnid", "type", "carglist", "id",
+ "ids", "typetoken", "typename", "signed",
+ "plus_num", "minus_num", "carg", "ccons",
+ "term", "expr", "onconf", "sortorder",
+ "autoinc", "idxlist_opt", "refargs", "defer_subclause",
+ "refarg", "refact", "init_deferred_pred_opt", "conslist",
+ "tcons", "idxlist", "defer_subclause_opt", "orconf",
+ "resolvetype", "raisetype", "fullname", "oneselect",
+ "multiselect_op", "distinct", "selcollist", "from",
+ "where_opt", "groupby_opt", "having_opt", "orderby_opt",
+ "limit_opt", "sclp", "as", "seltablist",
+ "stl_prefix", "joinop", "on_opt", "using_opt",
+ "seltablist_paren", "joinop2", "inscollist", "sortlist",
+ "sortitem", "collate", "exprlist", "setlist",
+ "insert_cmd", "inscollist_opt", "itemlist", "likeop",
+ "escape", "between_op", "in_op", "case_operand",
+ "case_exprlist", "case_else", "expritem", "uniqueflag",
+ "idxitem", "plus_opt", "number", "trigger_decl",
+ "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause",
+ "when_clause", "trigger_cmd", "database_kw_opt", "key_opt",
+ "add_column_fullname", "kwcolumn_opt",
+};
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/* For tracing reduce actions, the names of all rules are required.
+*/
+static const char *const yyRuleName[] = {
+ /* 0 */ "input ::= cmdlist",
+ /* 1 */ "cmdlist ::= cmdlist ecmd",
+ /* 2 */ "cmdlist ::= ecmd",
+ /* 3 */ "cmdx ::= cmd",
+ /* 4 */ "ecmd ::= SEMI",
+ /* 5 */ "ecmd ::= explain cmdx SEMI",
+ /* 6 */ "explain ::=",
+ /* 7 */ "explain ::= EXPLAIN",
+ /* 8 */ "explain ::= EXPLAIN QUERY PLAN",
+ /* 9 */ "cmd ::= BEGIN transtype trans_opt",
+ /* 10 */ "trans_opt ::=",
+ /* 11 */ "trans_opt ::= TRANSACTION",
+ /* 12 */ "trans_opt ::= TRANSACTION nm",
+ /* 13 */ "transtype ::=",
+ /* 14 */ "transtype ::= DEFERRED",
+ /* 15 */ "transtype ::= IMMEDIATE",
+ /* 16 */ "transtype ::= EXCLUSIVE",
+ /* 17 */ "cmd ::= COMMIT trans_opt",
+ /* 18 */ "cmd ::= END trans_opt",
+ /* 19 */ "cmd ::= ROLLBACK trans_opt",
+ /* 20 */ "cmd ::= create_table create_table_args",
+ /* 21 */ "create_table ::= CREATE temp TABLE nm dbnm",
+ /* 22 */ "temp ::= TEMP",
+ /* 23 */ "temp ::=",
+ /* 24 */ "create_table_args ::= LP columnlist conslist_opt RP",
+ /* 25 */ "create_table_args ::= AS select",
+ /* 26 */ "columnlist ::= columnlist COMMA column",
+ /* 27 */ "columnlist ::= column",
+ /* 28 */ "column ::= columnid type carglist",
+ /* 29 */ "columnid ::= nm",
+ /* 30 */ "id ::= ID",
+ /* 31 */ "ids ::= ID",
+ /* 32 */ "ids ::= STRING",
+ /* 33 */ "nm ::= ID",
+ /* 34 */ "nm ::= STRING",
+ /* 35 */ "nm ::= JOIN_KW",
+ /* 36 */ "type ::=",
+ /* 37 */ "type ::= typetoken",
+ /* 38 */ "typetoken ::= typename",
+ /* 39 */ "typetoken ::= typename LP signed RP",
+ /* 40 */ "typetoken ::= typename LP signed COMMA signed RP",
+ /* 41 */ "typename ::= ids",
+ /* 42 */ "typename ::= typename ids",
+ /* 43 */ "signed ::= plus_num",
+ /* 44 */ "signed ::= minus_num",
+ /* 45 */ "carglist ::= carglist carg",
+ /* 46 */ "carglist ::=",
+ /* 47 */ "carg ::= CONSTRAINT nm ccons",
+ /* 48 */ "carg ::= ccons",
+ /* 49 */ "carg ::= DEFAULT term",
+ /* 50 */ "carg ::= DEFAULT LP expr RP",
+ /* 51 */ "carg ::= DEFAULT PLUS term",
+ /* 52 */ "carg ::= DEFAULT MINUS term",
+ /* 53 */ "carg ::= DEFAULT id",
+ /* 54 */ "ccons ::= NULL onconf",
+ /* 55 */ "ccons ::= NOT NULL onconf",
+ /* 56 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
+ /* 57 */ "ccons ::= UNIQUE onconf",
+ /* 58 */ "ccons ::= CHECK LP expr RP onconf",
+ /* 59 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
+ /* 60 */ "ccons ::= defer_subclause",
+ /* 61 */ "ccons ::= COLLATE id",
+ /* 62 */ "autoinc ::=",
+ /* 63 */ "autoinc ::= AUTOINCR",
+ /* 64 */ "refargs ::=",
+ /* 65 */ "refargs ::= refargs refarg",
+ /* 66 */ "refarg ::= MATCH nm",
+ /* 67 */ "refarg ::= ON DELETE refact",
+ /* 68 */ "refarg ::= ON UPDATE refact",
+ /* 69 */ "refarg ::= ON INSERT refact",
+ /* 70 */ "refact ::= SET NULL",
+ /* 71 */ "refact ::= SET DEFAULT",
+ /* 72 */ "refact ::= CASCADE",
+ /* 73 */ "refact ::= RESTRICT",
+ /* 74 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
+ /* 75 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
+ /* 76 */ "init_deferred_pred_opt ::=",
+ /* 77 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
+ /* 78 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
+ /* 79 */ "conslist_opt ::=",
+ /* 80 */ "conslist_opt ::= COMMA conslist",
+ /* 81 */ "conslist ::= conslist COMMA tcons",
+ /* 82 */ "conslist ::= conslist tcons",
+ /* 83 */ "conslist ::= tcons",
+ /* 84 */ "tcons ::= CONSTRAINT nm",
+ /* 85 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
+ /* 86 */ "tcons ::= UNIQUE LP idxlist RP onconf",
+ /* 87 */ "tcons ::= CHECK expr onconf",
+ /* 88 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
+ /* 89 */ "defer_subclause_opt ::=",
+ /* 90 */ "defer_subclause_opt ::= defer_subclause",
+ /* 91 */ "onconf ::=",
+ /* 92 */ "onconf ::= ON CONFLICT resolvetype",
+ /* 93 */ "orconf ::=",
+ /* 94 */ "orconf ::= OR resolvetype",
+ /* 95 */ "resolvetype ::= raisetype",
+ /* 96 */ "resolvetype ::= IGNORE",
+ /* 97 */ "resolvetype ::= REPLACE",
+ /* 98 */ "cmd ::= DROP TABLE fullname",
+ /* 99 */ "cmd ::= CREATE temp VIEW nm dbnm AS select",
+ /* 100 */ "cmd ::= DROP VIEW fullname",
+ /* 101 */ "cmd ::= select",
+ /* 102 */ "select ::= oneselect",
+ /* 103 */ "select ::= select multiselect_op oneselect",
+ /* 104 */ "multiselect_op ::= UNION",
+ /* 105 */ "multiselect_op ::= UNION ALL",
+ /* 106 */ "multiselect_op ::= INTERSECT",
+ /* 107 */ "multiselect_op ::= EXCEPT",
+ /* 108 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
+ /* 109 */ "distinct ::= DISTINCT",
+ /* 110 */ "distinct ::= ALL",
+ /* 111 */ "distinct ::=",
+ /* 112 */ "sclp ::= selcollist COMMA",
+ /* 113 */ "sclp ::=",
+ /* 114 */ "selcollist ::= sclp expr as",
+ /* 115 */ "selcollist ::= sclp STAR",
+ /* 116 */ "selcollist ::= sclp nm DOT STAR",
+ /* 117 */ "as ::= AS nm",
+ /* 118 */ "as ::= ids",
+ /* 119 */ "as ::=",
+ /* 120 */ "from ::=",
+ /* 121 */ "from ::= FROM seltablist",
+ /* 122 */ "stl_prefix ::= seltablist joinop",
+ /* 123 */ "stl_prefix ::=",
+ /* 124 */ "seltablist ::= stl_prefix nm dbnm as on_opt using_opt",
+ /* 125 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt",
+ /* 126 */ "seltablist_paren ::= select",
+ /* 127 */ "seltablist_paren ::= seltablist",
+ /* 128 */ "dbnm ::=",
+ /* 129 */ "dbnm ::= DOT nm",
+ /* 130 */ "fullname ::= nm dbnm",
+ /* 131 */ "joinop ::= COMMA",
+ /* 132 */ "joinop ::= JOIN",
+ /* 133 */ "joinop ::= JOIN_KW JOIN",
+ /* 134 */ "joinop ::= JOIN_KW nm JOIN",
+ /* 135 */ "joinop ::= JOIN_KW nm nm JOIN",
+ /* 136 */ "on_opt ::= ON expr",
+ /* 137 */ "on_opt ::=",
+ /* 138 */ "using_opt ::= USING LP inscollist RP",
+ /* 139 */ "using_opt ::=",
+ /* 140 */ "orderby_opt ::=",
+ /* 141 */ "orderby_opt ::= ORDER BY sortlist",
+ /* 142 */ "sortlist ::= sortlist COMMA sortitem collate sortorder",
+ /* 143 */ "sortlist ::= sortitem collate sortorder",
+ /* 144 */ "sortitem ::= expr",
+ /* 145 */ "sortorder ::= ASC",
+ /* 146 */ "sortorder ::= DESC",
+ /* 147 */ "sortorder ::=",
+ /* 148 */ "collate ::=",
+ /* 149 */ "collate ::= COLLATE id",
+ /* 150 */ "groupby_opt ::=",
+ /* 151 */ "groupby_opt ::= GROUP BY exprlist",
+ /* 152 */ "having_opt ::=",
+ /* 153 */ "having_opt ::= HAVING expr",
+ /* 154 */ "limit_opt ::=",
+ /* 155 */ "limit_opt ::= LIMIT expr",
+ /* 156 */ "limit_opt ::= LIMIT expr OFFSET expr",
+ /* 157 */ "limit_opt ::= LIMIT expr COMMA expr",
+ /* 158 */ "cmd ::= DELETE FROM fullname where_opt",
+ /* 159 */ "where_opt ::=",
+ /* 160 */ "where_opt ::= WHERE expr",
+ /* 161 */ "cmd ::= UPDATE orconf fullname SET setlist where_opt",
+ /* 162 */ "setlist ::= setlist COMMA nm EQ expr",
+ /* 163 */ "setlist ::= nm EQ expr",
+ /* 164 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP",
+ /* 165 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
+ /* 166 */ "insert_cmd ::= INSERT orconf",
+ /* 167 */ "insert_cmd ::= REPLACE",
+ /* 168 */ "itemlist ::= itemlist COMMA expr",
+ /* 169 */ "itemlist ::= expr",
+ /* 170 */ "inscollist_opt ::=",
+ /* 171 */ "inscollist_opt ::= LP inscollist RP",
+ /* 172 */ "inscollist ::= inscollist COMMA nm",
+ /* 173 */ "inscollist ::= nm",
+ /* 174 */ "expr ::= term",
+ /* 175 */ "expr ::= LP expr RP",
+ /* 176 */ "term ::= NULL",
+ /* 177 */ "expr ::= ID",
+ /* 178 */ "expr ::= JOIN_KW",
+ /* 179 */ "expr ::= nm DOT nm",
+ /* 180 */ "expr ::= nm DOT nm DOT nm",
+ /* 181 */ "term ::= INTEGER",
+ /* 182 */ "term ::= FLOAT",
+ /* 183 */ "term ::= STRING",
+ /* 184 */ "term ::= BLOB",
+ /* 185 */ "expr ::= REGISTER",
+ /* 186 */ "expr ::= VARIABLE",
+ /* 187 */ "expr ::= CAST LP expr AS typetoken RP",
+ /* 188 */ "expr ::= ID LP distinct exprlist RP",
+ /* 189 */ "expr ::= ID LP STAR RP",
+ /* 190 */ "term ::= CTIME_KW",
+ /* 191 */ "expr ::= expr AND expr",
+ /* 192 */ "expr ::= expr OR expr",
+ /* 193 */ "expr ::= expr LT expr",
+ /* 194 */ "expr ::= expr GT expr",
+ /* 195 */ "expr ::= expr LE expr",
+ /* 196 */ "expr ::= expr GE expr",
+ /* 197 */ "expr ::= expr NE expr",
+ /* 198 */ "expr ::= expr EQ expr",
+ /* 199 */ "expr ::= expr BITAND expr",
+ /* 200 */ "expr ::= expr BITOR expr",
+ /* 201 */ "expr ::= expr LSHIFT expr",
+ /* 202 */ "expr ::= expr RSHIFT expr",
+ /* 203 */ "expr ::= expr PLUS expr",
+ /* 204 */ "expr ::= expr MINUS expr",
+ /* 205 */ "expr ::= expr STAR expr",
+ /* 206 */ "expr ::= expr SLASH expr",
+ /* 207 */ "expr ::= expr REM expr",
+ /* 208 */ "expr ::= expr CONCAT expr",
+ /* 209 */ "likeop ::= LIKE_KW",
+ /* 210 */ "likeop ::= NOT LIKE_KW",
+ /* 211 */ "escape ::= ESCAPE expr",
+ /* 212 */ "escape ::=",
+ /* 213 */ "expr ::= expr likeop expr escape",
+ /* 214 */ "expr ::= expr ISNULL",
+ /* 215 */ "expr ::= expr IS NULL",
+ /* 216 */ "expr ::= expr NOTNULL",
+ /* 217 */ "expr ::= expr NOT NULL",
+ /* 218 */ "expr ::= expr IS NOT NULL",
+ /* 219 */ "expr ::= NOT expr",
+ /* 220 */ "expr ::= BITNOT expr",
+ /* 221 */ "expr ::= MINUS expr",
+ /* 222 */ "expr ::= PLUS expr",
+ /* 223 */ "between_op ::= BETWEEN",
+ /* 224 */ "between_op ::= NOT BETWEEN",
+ /* 225 */ "expr ::= expr between_op expr AND expr",
+ /* 226 */ "in_op ::= IN",
+ /* 227 */ "in_op ::= NOT IN",
+ /* 228 */ "expr ::= expr in_op LP exprlist RP",
+ /* 229 */ "expr ::= LP select RP",
+ /* 230 */ "expr ::= expr in_op LP select RP",
+ /* 231 */ "expr ::= expr in_op nm dbnm",
+ /* 232 */ "expr ::= EXISTS LP select RP",
+ /* 233 */ "expr ::= CASE case_operand case_exprlist case_else END",
+ /* 234 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
+ /* 235 */ "case_exprlist ::= WHEN expr THEN expr",
+ /* 236 */ "case_else ::= ELSE expr",
+ /* 237 */ "case_else ::=",
+ /* 238 */ "case_operand ::= expr",
+ /* 239 */ "case_operand ::=",
+ /* 240 */ "exprlist ::= exprlist COMMA expritem",
+ /* 241 */ "exprlist ::= expritem",
+ /* 242 */ "expritem ::= expr",
+ /* 243 */ "expritem ::=",
+ /* 244 */ "cmd ::= CREATE uniqueflag INDEX nm dbnm ON nm LP idxlist RP onconf",
+ /* 245 */ "uniqueflag ::= UNIQUE",
+ /* 246 */ "uniqueflag ::=",
+ /* 247 */ "idxlist_opt ::=",
+ /* 248 */ "idxlist_opt ::= LP idxlist RP",
+ /* 249 */ "idxlist ::= idxlist COMMA idxitem collate sortorder",
+ /* 250 */ "idxlist ::= idxitem collate sortorder",
+ /* 251 */ "idxitem ::= nm",
+ /* 252 */ "cmd ::= DROP INDEX fullname",
+ /* 253 */ "cmd ::= VACUUM",
+ /* 254 */ "cmd ::= VACUUM nm",
+ /* 255 */ "cmd ::= PRAGMA nm dbnm EQ nm",
+ /* 256 */ "cmd ::= PRAGMA nm dbnm EQ ON",
+ /* 257 */ "cmd ::= PRAGMA nm dbnm EQ plus_num",
+ /* 258 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
+ /* 259 */ "cmd ::= PRAGMA nm dbnm LP nm RP",
+ /* 260 */ "cmd ::= PRAGMA nm dbnm",
+ /* 261 */ "plus_num ::= plus_opt number",
+ /* 262 */ "minus_num ::= MINUS number",
+ /* 263 */ "number ::= INTEGER",
+ /* 264 */ "number ::= FLOAT",
+ /* 265 */ "plus_opt ::= PLUS",
+ /* 266 */ "plus_opt ::=",
+ /* 267 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END",
+ /* 268 */ "trigger_decl ::= temp TRIGGER nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
+ /* 269 */ "trigger_time ::= BEFORE",
+ /* 270 */ "trigger_time ::= AFTER",
+ /* 271 */ "trigger_time ::= INSTEAD OF",
+ /* 272 */ "trigger_time ::=",
+ /* 273 */ "trigger_event ::= DELETE",
+ /* 274 */ "trigger_event ::= INSERT",
+ /* 275 */ "trigger_event ::= UPDATE",
+ /* 276 */ "trigger_event ::= UPDATE OF inscollist",
+ /* 277 */ "foreach_clause ::=",
+ /* 278 */ "foreach_clause ::= FOR EACH ROW",
+ /* 279 */ "foreach_clause ::= FOR EACH STATEMENT",
+ /* 280 */ "when_clause ::=",
+ /* 281 */ "when_clause ::= WHEN expr",
+ /* 282 */ "trigger_cmd_list ::= trigger_cmd SEMI trigger_cmd_list",
+ /* 283 */ "trigger_cmd_list ::=",
+ /* 284 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt",
+ /* 285 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP",
+ /* 286 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select",
+ /* 287 */ "trigger_cmd ::= DELETE FROM nm where_opt",
+ /* 288 */ "trigger_cmd ::= select",
+ /* 289 */ "expr ::= RAISE LP IGNORE RP",
+ /* 290 */ "expr ::= RAISE LP raisetype COMMA nm RP",
+ /* 291 */ "raisetype ::= ROLLBACK",
+ /* 292 */ "raisetype ::= ABORT",
+ /* 293 */ "raisetype ::= FAIL",
+ /* 294 */ "cmd ::= DROP TRIGGER fullname",
+ /* 295 */ "cmd ::= ATTACH database_kw_opt ids AS nm key_opt",
+ /* 296 */ "key_opt ::=",
+ /* 297 */ "key_opt ::= KEY ids",
+ /* 298 */ "key_opt ::= KEY BLOB",
+ /* 299 */ "database_kw_opt ::= DATABASE",
+ /* 300 */ "database_kw_opt ::=",
+ /* 301 */ "cmd ::= DETACH database_kw_opt nm",
+ /* 302 */ "cmd ::= REINDEX",
+ /* 303 */ "cmd ::= REINDEX nm dbnm",
+ /* 304 */ "cmd ::= ANALYZE",
+ /* 305 */ "cmd ::= ANALYZE nm dbnm",
+ /* 306 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
+ /* 307 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
+ /* 308 */ "add_column_fullname ::= fullname",
+ /* 309 */ "kwcolumn_opt ::=",
+ /* 310 */ "kwcolumn_opt ::= COLUMNKW",
+};
+#endif /* NDEBUG */
+
+/*
+** This function returns the symbolic name associated with a token
+** value.
+*/
+const char *sqlite3ParserTokenName(int tokenType){
+#ifndef NDEBUG
+ if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
+ return yyTokenName[tokenType];
+ }else{
+ return "Unknown";
+ }
+#else
+ return "";
+#endif
+}
+
+/*
+** This function allocates a new parser.
+** The only argument is a pointer to a function which works like
+** malloc.
+**
+** Inputs:
+** A pointer to the function used to allocate memory.
+**
+** Outputs:
+** A pointer to a parser. This pointer is used in subsequent calls
+** to sqlite3Parser and sqlite3ParserFree.
+*/
+void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){
+ yyParser *pParser;
+ pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
+ if( pParser ){
+ pParser->yyidx = -1;
+ }
+ return pParser;
+}
+
+/* The following function deletes the value associated with a
+** symbol. The symbol can be either a terminal or nonterminal.
+** "yymajor" is the symbol code, and "yypminor" is a pointer to
+** the value.
+*/
+static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
+ switch( yymajor ){
+ /* Here is inserted the actions which take place when a
+ ** terminal or non-terminal is destroyed. This can happen
+ ** when the symbol is popped from the stack during a
+ ** reduce or during error processing or when a parser is
+ ** being destroyed before it is finished parsing.
+ **
+ ** Note: during a reduce, the only symbols destroyed are those
+ ** which appear on the RHS of the rule, but which are not used
+ ** inside the C code.
+ */
+ case 162:
+ case 195:
+ case 212:
+#line 370 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3SelectDelete((yypminor->yy375));}
+#line 1332 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 176:
+ case 177:
+ case 200:
+ case 202:
+ case 210:
+ case 216:
+ case 230:
+#line 629 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3ExprDelete((yypminor->yy62));}
+#line 1343 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 181:
+ case 189:
+ case 198:
+ case 201:
+ case 203:
+ case 205:
+ case 215:
+ case 218:
+ case 219:
+ case 222:
+ case 228:
+#line 876 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3ExprListDelete((yypminor->yy418));}
+#line 1358 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 194:
+ case 199:
+ case 207:
+ case 208:
+#line 499 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3SrcListDelete((yypminor->yy151));}
+#line 1366 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 204:
+#line 561 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3ExprDelete((yypminor->yy220).pLimit);
+ sqlite3ExprDelete((yypminor->yy220).pOffset);
+}
+#line 1374 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 211:
+ case 214:
+ case 221:
+#line 517 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3IdListDelete((yypminor->yy240));}
+#line 1381 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 236:
+ case 241:
+#line 969 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3DeleteTriggerStep((yypminor->yy360));}
+#line 1387 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 238:
+#line 953 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3IdListDelete((yypminor->yy30).b);}
+#line 1392 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ default: break; /* If no destructor action specified: do nothing */
+ }
+}
+
+/*
+** Pop the parser's stack once.
+**
+** If there is a destructor routine associated with the token which
+** is popped from the stack, then call it.
+**
+** Return the major token number for the symbol popped.
+*/
+static int yy_pop_parser_stack(yyParser *pParser){
+ YYCODETYPE yymajor;
+ yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
+
+ if( pParser->yyidx<0 ) return 0;
+#ifndef NDEBUG
+ if( yyTraceFILE && pParser->yyidx>=0 ){
+ fprintf(yyTraceFILE,"%sPopping %s\n",
+ yyTracePrompt,
+ yyTokenName[yytos->major]);
+ }
+#endif
+ yymajor = yytos->major;
+ yy_destructor( yymajor, &yytos->minor);
+ pParser->yyidx--;
+ return yymajor;
+}
+
+/*
+** Deallocate and destroy a parser. Destructors are all called for
+** all stack elements before shutting the parser down.
+**
+** Inputs:
+** <ul>
+** <li> A pointer to the parser. This should be a pointer
+** obtained from sqlite3ParserAlloc.
+** <li> A pointer to a function used to reclaim memory obtained
+** from malloc.
+** </ul>
+*/
+void sqlite3ParserFree(
+ void *p, /* The parser to be deleted */
+ void (*freeProc)(void*) /* Function used to reclaim memory */
+){
+ yyParser *pParser = (yyParser*)p;
+ if( pParser==0 ) return;
+ while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
+ (*freeProc)((void*)pParser);
+}
+
+/*
+** Find the appropriate action for a parser given the terminal
+** look-ahead token iLookAhead.
+**
+** If the look-ahead token is YYNOCODE, then check to see if the action is
+** independent of the look-ahead. If it is, return the action, otherwise
+** return YY_NO_ACTION.
+*/
+static int yy_find_shift_action(
+ yyParser *pParser, /* The parser */
+ int iLookAhead /* The look-ahead token */
+){
+ int i;
+ int stateno = pParser->yystack[pParser->yyidx].stateno;
+
+ /* if( pParser->yyidx<0 ) return YY_NO_ACTION; */
+ i = yy_shift_ofst[stateno];
+ if( i==YY_SHIFT_USE_DFLT ){
+ return yy_default[stateno];
+ }
+ if( iLookAhead==YYNOCODE ){
+ return YY_NO_ACTION;
+ }
+ i += iLookAhead;
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+#ifdef YYFALLBACK
+ int iFallback; /* Fallback token */
+ if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
+ && (iFallback = yyFallback[iLookAhead])!=0 ){
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
+ yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
+ }
+#endif
+ return yy_find_shift_action(pParser, iFallback);
+ }
+#endif
+ return yy_default[stateno];
+ }else{
+ return yy_action[i];
+ }
+}
+
+/*
+** Find the appropriate action for a parser given the non-terminal
+** look-ahead token iLookAhead.
+**
+** If the look-ahead token is YYNOCODE, then check to see if the action is
+** independent of the look-ahead. If it is, return the action, otherwise
+** return YY_NO_ACTION.
+*/
+static int yy_find_reduce_action(
+ int stateno, /* Current state number */
+ int iLookAhead /* The look-ahead token */
+){
+ int i;
+ /* int stateno = pParser->yystack[pParser->yyidx].stateno; */
+
+ i = yy_reduce_ofst[stateno];
+ if( i==YY_REDUCE_USE_DFLT ){
+ return yy_default[stateno];
+ }
+ if( iLookAhead==YYNOCODE ){
+ return YY_NO_ACTION;
+ }
+ i += iLookAhead;
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ return yy_default[stateno];
+ }else{
+ return yy_action[i];
+ }
+}
+
+/*
+** Perform a shift action.
+*/
+static void yy_shift(
+ yyParser *yypParser, /* The parser to be shifted */
+ int yyNewState, /* The new state to shift in */
+ int yyMajor, /* The major token to shift in */
+ YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */
+){
+ yyStackEntry *yytos;
+ yypParser->yyidx++;
+ if( yypParser->yyidx>=YYSTACKDEPTH ){
+ sqlite3ParserARG_FETCH;
+ yypParser->yyidx--;
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
+ }
+#endif
+ while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
+ /* Here code is inserted which will execute if the parser
+ ** stack every overflows */
+ sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
+ return;
+ }
+ yytos = &yypParser->yystack[yypParser->yyidx];
+ yytos->stateno = yyNewState;
+ yytos->major = yyMajor;
+ yytos->minor = *yypMinor;
+#ifndef NDEBUG
+ if( yyTraceFILE && yypParser->yyidx>0 ){
+ int i;
+ fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
+ fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
+ for(i=1; i<=yypParser->yyidx; i++)
+ fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
+ fprintf(yyTraceFILE,"\n");
+ }
+#endif
+}
+
+/* The following table contains information about every rule that
+** is used during the reduce.
+*/
+static const struct {
+ YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
+ unsigned char nrhs; /* Number of right-hand side symbols in the rule */
+} yyRuleInfo[] = {
+ { 147, 1 },
+ { 148, 2 },
+ { 148, 1 },
+ { 150, 1 },
+ { 149, 1 },
+ { 149, 3 },
+ { 152, 0 },
+ { 152, 1 },
+ { 152, 3 },
+ { 151, 3 },
+ { 154, 0 },
+ { 154, 1 },
+ { 154, 2 },
+ { 153, 0 },
+ { 153, 1 },
+ { 153, 1 },
+ { 153, 1 },
+ { 151, 2 },
+ { 151, 2 },
+ { 151, 2 },
+ { 151, 2 },
+ { 156, 5 },
+ { 158, 1 },
+ { 158, 0 },
+ { 157, 4 },
+ { 157, 2 },
+ { 160, 3 },
+ { 160, 1 },
+ { 163, 3 },
+ { 164, 1 },
+ { 167, 1 },
+ { 168, 1 },
+ { 168, 1 },
+ { 155, 1 },
+ { 155, 1 },
+ { 155, 1 },
+ { 165, 0 },
+ { 165, 1 },
+ { 169, 1 },
+ { 169, 4 },
+ { 169, 6 },
+ { 170, 1 },
+ { 170, 2 },
+ { 171, 1 },
+ { 171, 1 },
+ { 166, 2 },
+ { 166, 0 },
+ { 174, 3 },
+ { 174, 1 },
+ { 174, 2 },
+ { 174, 4 },
+ { 174, 3 },
+ { 174, 3 },
+ { 174, 2 },
+ { 175, 2 },
+ { 175, 3 },
+ { 175, 5 },
+ { 175, 2 },
+ { 175, 5 },
+ { 175, 4 },
+ { 175, 1 },
+ { 175, 2 },
+ { 180, 0 },
+ { 180, 1 },
+ { 182, 0 },
+ { 182, 2 },
+ { 184, 2 },
+ { 184, 3 },
+ { 184, 3 },
+ { 184, 3 },
+ { 185, 2 },
+ { 185, 2 },
+ { 185, 1 },
+ { 185, 1 },
+ { 183, 3 },
+ { 183, 2 },
+ { 186, 0 },
+ { 186, 2 },
+ { 186, 2 },
+ { 161, 0 },
+ { 161, 2 },
+ { 187, 3 },
+ { 187, 2 },
+ { 187, 1 },
+ { 188, 2 },
+ { 188, 7 },
+ { 188, 5 },
+ { 188, 3 },
+ { 188, 10 },
+ { 190, 0 },
+ { 190, 1 },
+ { 178, 0 },
+ { 178, 3 },
+ { 191, 0 },
+ { 191, 2 },
+ { 192, 1 },
+ { 192, 1 },
+ { 192, 1 },
+ { 151, 3 },
+ { 151, 7 },
+ { 151, 3 },
+ { 151, 1 },
+ { 162, 1 },
+ { 162, 3 },
+ { 196, 1 },
+ { 196, 2 },
+ { 196, 1 },
+ { 196, 1 },
+ { 195, 9 },
+ { 197, 1 },
+ { 197, 1 },
+ { 197, 0 },
+ { 205, 2 },
+ { 205, 0 },
+ { 198, 3 },
+ { 198, 2 },
+ { 198, 4 },
+ { 206, 2 },
+ { 206, 1 },
+ { 206, 0 },
+ { 199, 0 },
+ { 199, 2 },
+ { 208, 2 },
+ { 208, 0 },
+ { 207, 6 },
+ { 207, 7 },
+ { 212, 1 },
+ { 212, 1 },
+ { 159, 0 },
+ { 159, 2 },
+ { 194, 2 },
+ { 209, 1 },
+ { 209, 1 },
+ { 209, 2 },
+ { 209, 3 },
+ { 209, 4 },
+ { 210, 2 },
+ { 210, 0 },
+ { 211, 4 },
+ { 211, 0 },
+ { 203, 0 },
+ { 203, 3 },
+ { 215, 5 },
+ { 215, 3 },
+ { 216, 1 },
+ { 179, 1 },
+ { 179, 1 },
+ { 179, 0 },
+ { 217, 0 },
+ { 217, 2 },
+ { 201, 0 },
+ { 201, 3 },
+ { 202, 0 },
+ { 202, 2 },
+ { 204, 0 },
+ { 204, 2 },
+ { 204, 4 },
+ { 204, 4 },
+ { 151, 4 },
+ { 200, 0 },
+ { 200, 2 },
+ { 151, 6 },
+ { 219, 5 },
+ { 219, 3 },
+ { 151, 8 },
+ { 151, 5 },
+ { 220, 2 },
+ { 220, 1 },
+ { 222, 3 },
+ { 222, 1 },
+ { 221, 0 },
+ { 221, 3 },
+ { 214, 3 },
+ { 214, 1 },
+ { 177, 1 },
+ { 177, 3 },
+ { 176, 1 },
+ { 177, 1 },
+ { 177, 1 },
+ { 177, 3 },
+ { 177, 5 },
+ { 176, 1 },
+ { 176, 1 },
+ { 176, 1 },
+ { 176, 1 },
+ { 177, 1 },
+ { 177, 1 },
+ { 177, 6 },
+ { 177, 5 },
+ { 177, 4 },
+ { 176, 1 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 177, 3 },
+ { 223, 1 },
+ { 223, 2 },
+ { 224, 2 },
+ { 224, 0 },
+ { 177, 4 },
+ { 177, 2 },
+ { 177, 3 },
+ { 177, 2 },
+ { 177, 3 },
+ { 177, 4 },
+ { 177, 2 },
+ { 177, 2 },
+ { 177, 2 },
+ { 177, 2 },
+ { 225, 1 },
+ { 225, 2 },
+ { 177, 5 },
+ { 226, 1 },
+ { 226, 2 },
+ { 177, 5 },
+ { 177, 3 },
+ { 177, 5 },
+ { 177, 4 },
+ { 177, 4 },
+ { 177, 5 },
+ { 228, 5 },
+ { 228, 4 },
+ { 229, 2 },
+ { 229, 0 },
+ { 227, 1 },
+ { 227, 0 },
+ { 218, 3 },
+ { 218, 1 },
+ { 230, 1 },
+ { 230, 0 },
+ { 151, 11 },
+ { 231, 1 },
+ { 231, 0 },
+ { 181, 0 },
+ { 181, 3 },
+ { 189, 5 },
+ { 189, 3 },
+ { 232, 1 },
+ { 151, 3 },
+ { 151, 1 },
+ { 151, 2 },
+ { 151, 5 },
+ { 151, 5 },
+ { 151, 5 },
+ { 151, 5 },
+ { 151, 6 },
+ { 151, 3 },
+ { 172, 2 },
+ { 173, 2 },
+ { 234, 1 },
+ { 234, 1 },
+ { 233, 1 },
+ { 233, 0 },
+ { 151, 5 },
+ { 235, 10 },
+ { 237, 1 },
+ { 237, 1 },
+ { 237, 2 },
+ { 237, 0 },
+ { 238, 1 },
+ { 238, 1 },
+ { 238, 1 },
+ { 238, 3 },
+ { 239, 0 },
+ { 239, 3 },
+ { 239, 3 },
+ { 240, 0 },
+ { 240, 2 },
+ { 236, 3 },
+ { 236, 0 },
+ { 241, 6 },
+ { 241, 8 },
+ { 241, 5 },
+ { 241, 4 },
+ { 241, 1 },
+ { 177, 4 },
+ { 177, 6 },
+ { 193, 1 },
+ { 193, 1 },
+ { 193, 1 },
+ { 151, 3 },
+ { 151, 6 },
+ { 243, 0 },
+ { 243, 2 },
+ { 243, 2 },
+ { 242, 1 },
+ { 242, 0 },
+ { 151, 3 },
+ { 151, 1 },
+ { 151, 3 },
+ { 151, 1 },
+ { 151, 3 },
+ { 151, 6 },
+ { 151, 6 },
+ { 244, 1 },
+ { 245, 0 },
+ { 245, 1 },
+};
+
+static void yy_accept(yyParser*); /* Forward Declaration */
+
+/*
+** Perform a reduce action and the shift that must immediately
+** follow the reduce.
+*/
+static void yy_reduce(
+ yyParser *yypParser, /* The parser */
+ int yyruleno /* Number of the rule by which to reduce */
+){
+ int yygoto; /* The next state */
+ int yyact; /* The next action */
+ YYMINORTYPE yygotominor; /* The LHS of the rule reduced */
+ yyStackEntry *yymsp; /* The top of the parser's stack */
+ int yysize; /* Amount to pop the stack */
+ sqlite3ParserARG_FETCH;
+ yymsp = &yypParser->yystack[yypParser->yyidx];
+#ifndef NDEBUG
+ if( yyTraceFILE && yyruleno>=0
+ && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
+ fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
+ yyRuleName[yyruleno]);
+ }
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+ /* Silence complaints from purify about yygotominor being uninitialized
+ ** in some cases when it is copied into the stack after the following
+ ** switch. yygotominor is uninitialized when a rule reduces that does
+ ** not set the value of its left-hand side nonterminal. Leaving the
+ ** value of the nonterminal uninitialized is utterly harmless as long
+ ** as the value is never used. So really the only thing this code
+ ** accomplishes is to quieten purify.
+ */
+ memset(&yygotominor, 0, sizeof(yygotominor));
+#endif
+
+ switch( yyruleno ){
+ /* Beginning here are the reduction cases. A typical example
+ ** follows:
+ ** case 0:
+ ** #line <lineno> <grammarfile>
+ ** { ... } // User supplied code
+ ** #line <lineno> <thisfile>
+ ** break;
+ */
+ case 3:
+#line 102 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ sqlite3FinishCoding(pParse); }
+#line 1930 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 6:
+#line 105 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ sqlite3BeginParse(pParse, 0); }
+#line 1935 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 7:
+#line 107 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ sqlite3BeginParse(pParse, 1); }
+#line 1940 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 8:
+#line 108 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ sqlite3BeginParse(pParse, 2); }
+#line 1945 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 9:
+#line 114 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy280);}
+#line 1950 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 13:
+#line 119 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = TK_DEFERRED;}
+#line 1955 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 14:
+ case 15:
+ case 16:
+ case 104:
+ case 106:
+ case 107:
+#line 120 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = yymsp[0].major;}
+#line 1965 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 17:
+ case 18:
+#line 123 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3CommitTransaction(pParse);}
+#line 1971 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 19:
+#line 125 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3RollbackTransaction(pParse);}
+#line 1976 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 21:
+#line 130 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3StartTable(pParse,&yymsp[-4].minor.yy0,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198,yymsp[-3].minor.yy280,0);
+}
+#line 1983 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 22:
+ case 63:
+ case 77:
+ case 109:
+ case 224:
+ case 227:
+#line 135 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = 1;}
+#line 1993 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 23:
+ case 62:
+ case 76:
+ case 78:
+ case 89:
+ case 110:
+ case 111:
+ case 223:
+ case 226:
+#line 137 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = 0;}
+#line 2006 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 24:
+#line 138 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3EndTable(pParse,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy0,0);
+}
+#line 2013 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 25:
+#line 141 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy375);
+ sqlite3SelectDelete(yymsp[0].minor.yy375);
+}
+#line 2021 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 28:
+#line 153 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy198.z = yymsp[-2].minor.yy198.z;
+ yygotominor.yy198.n = (pParse->sLastToken.z-yymsp[-2].minor.yy198.z) + pParse->sLastToken.n;
+}
+#line 2029 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 29:
+#line 157 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3AddColumn(pParse,&yymsp[0].minor.yy198);
+ yygotominor.yy198 = yymsp[0].minor.yy198;
+}
+#line 2037 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 30:
+ case 31:
+ case 32:
+ case 33:
+ case 34:
+ case 35:
+ case 263:
+ case 264:
+#line 167 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy198 = yymsp[0].minor.yy0;}
+#line 2049 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 37:
+#line 227 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy198);}
+#line 2054 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 38:
+ case 41:
+ case 117:
+ case 118:
+ case 129:
+ case 149:
+ case 251:
+ case 261:
+ case 262:
+#line 228 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy198 = yymsp[0].minor.yy198;}
+#line 2067 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 39:
+#line 229 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy198.z = yymsp[-3].minor.yy198.z;
+ yygotominor.yy198.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy198.z;
+}
+#line 2075 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 40:
+#line 233 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy198.z = yymsp[-5].minor.yy198.z;
+ yygotominor.yy198.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy198.z;
+}
+#line 2083 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 42:
+#line 239 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy198.z=yymsp[-1].minor.yy198.z; yygotominor.yy198.n=yymsp[0].minor.yy198.n+(yymsp[0].minor.yy198.z-yymsp[-1].minor.yy198.z);}
+#line 2088 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 43:
+#line 241 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = atoi(yymsp[0].minor.yy198.z); }
+#line 2093 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 44:
+#line 242 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = -atoi(yymsp[0].minor.yy198.z); }
+#line 2098 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 49:
+ case 51:
+#line 251 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy62);}
+#line 2104 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 50:
+#line 252 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy62);}
+#line 2109 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 52:
+#line 254 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Expr *p = sqlite3Expr(TK_UMINUS, yymsp[0].minor.yy62, 0, 0);
+ sqlite3AddDefaultValue(pParse,p);
+}
+#line 2117 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 53:
+#line 258 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Expr *p = sqlite3Expr(TK_STRING, 0, 0, &yymsp[0].minor.yy198);
+ sqlite3AddDefaultValue(pParse,p);
+}
+#line 2125 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 55:
+#line 267 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddNotNull(pParse, yymsp[0].minor.yy280);}
+#line 2130 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 56:
+#line 269 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy280,yymsp[0].minor.yy280);}
+#line 2135 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 57:
+#line 270 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy280,0,0);}
+#line 2140 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 58:
+#line 271 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3ExprDelete(yymsp[-2].minor.yy62);}
+#line 2145 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 59:
+#line 273 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy198,yymsp[-1].minor.yy418,yymsp[0].minor.yy280);}
+#line 2150 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 60:
+#line 274 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy280);}
+#line 2155 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 61:
+#line 275 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddCollateType(pParse, yymsp[0].minor.yy198.z, yymsp[0].minor.yy198.n);}
+#line 2160 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 64:
+#line 288 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = OE_Restrict * 0x010101; }
+#line 2165 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 65:
+#line 289 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = (yymsp[-1].minor.yy280 & yymsp[0].minor.yy359.mask) | yymsp[0].minor.yy359.value; }
+#line 2170 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 66:
+#line 291 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy359.value = 0; yygotominor.yy359.mask = 0x000000; }
+#line 2175 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 67:
+#line 292 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy359.value = yymsp[0].minor.yy280; yygotominor.yy359.mask = 0x0000ff; }
+#line 2180 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 68:
+#line 293 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy359.value = yymsp[0].minor.yy280<<8; yygotominor.yy359.mask = 0x00ff00; }
+#line 2185 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 69:
+#line 294 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy359.value = yymsp[0].minor.yy280<<16; yygotominor.yy359.mask = 0xff0000; }
+#line 2190 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 70:
+#line 296 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = OE_SetNull; }
+#line 2195 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 71:
+#line 297 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = OE_SetDflt; }
+#line 2200 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 72:
+#line 298 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = OE_Cascade; }
+#line 2205 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 73:
+#line 299 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = OE_Restrict; }
+#line 2210 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 74:
+ case 75:
+ case 90:
+ case 92:
+ case 94:
+ case 95:
+ case 166:
+#line 301 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = yymsp[0].minor.yy280;}
+#line 2221 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 79:
+#line 311 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy198.n = 0; yygotominor.yy198.z = 0;}
+#line 2226 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 80:
+#line 312 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy198 = yymsp[-1].minor.yy0;}
+#line 2231 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 85:
+#line 318 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy418,yymsp[0].minor.yy280,yymsp[-2].minor.yy280);}
+#line 2236 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 86:
+#line 320 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy418,yymsp[0].minor.yy280,0,0);}
+#line 2241 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 88:
+#line 323 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy418, &yymsp[-3].minor.yy198, yymsp[-2].minor.yy418, yymsp[-1].minor.yy280);
+ sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy280);
+}
+#line 2249 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 91:
+ case 93:
+#line 337 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = OE_Default;}
+#line 2255 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 96:
+#line 342 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = OE_Ignore;}
+#line 2260 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 97:
+ case 167:
+#line 343 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = OE_Replace;}
+#line 2266 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 98:
+#line 347 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3DropTable(pParse, yymsp[0].minor.yy151, 0);
+}
+#line 2273 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 99:
+#line 354 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3CreateView(pParse, &yymsp[-6].minor.yy0, &yymsp[-3].minor.yy198, &yymsp[-2].minor.yy198, yymsp[0].minor.yy375, yymsp[-5].minor.yy280);
+}
+#line 2280 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 100:
+#line 357 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3DropTable(pParse, yymsp[0].minor.yy151, 1);
+}
+#line 2287 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 101:
+#line 364 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3Select(pParse, yymsp[0].minor.yy375, SRT_Callback, 0, 0, 0, 0, 0);
+ sqlite3SelectDelete(yymsp[0].minor.yy375);
+}
+#line 2295 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 102:
+ case 126:
+#line 374 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy375 = yymsp[0].minor.yy375;}
+#line 2301 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 103:
+#line 376 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ if( yymsp[0].minor.yy375 ){
+ yymsp[0].minor.yy375->op = yymsp[-1].minor.yy280;
+ yymsp[0].minor.yy375->pPrior = yymsp[-2].minor.yy375;
+ }
+ yygotominor.yy375 = yymsp[0].minor.yy375;
+}
+#line 2312 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 105:
+#line 385 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = TK_ALL;}
+#line 2317 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 108:
+#line 390 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy375 = sqlite3SelectNew(yymsp[-6].minor.yy418,yymsp[-5].minor.yy151,yymsp[-4].minor.yy62,yymsp[-3].minor.yy418,yymsp[-2].minor.yy62,yymsp[-1].minor.yy418,yymsp[-7].minor.yy280,yymsp[0].minor.yy220.pLimit,yymsp[0].minor.yy220.pOffset);
+}
+#line 2324 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 112:
+ case 248:
+#line 411 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy418 = yymsp[-1].minor.yy418;}
+#line 2330 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 113:
+ case 140:
+ case 150:
+ case 247:
+#line 412 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy418 = 0;}
+#line 2338 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 114:
+#line 413 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-2].minor.yy418,yymsp[-1].minor.yy62,yymsp[0].minor.yy198.n?&yymsp[0].minor.yy198:0);
+}
+#line 2345 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 115:
+#line 416 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-1].minor.yy418, sqlite3Expr(TK_ALL, 0, 0, 0), 0);
+}
+#line 2352 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 116:
+#line 419 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Expr *pRight = sqlite3Expr(TK_ALL, 0, 0, 0);
+ Expr *pLeft = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy198);
+ yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-3].minor.yy418, sqlite3Expr(TK_DOT, pLeft, pRight, 0), 0);
+}
+#line 2361 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 119:
+#line 431 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy198.n = 0;}
+#line 2366 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 120:
+#line 443 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy151 = sqliteMalloc(sizeof(*yygotominor.yy151));}
+#line 2371 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 121:
+#line 444 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy151 = yymsp[0].minor.yy151;}
+#line 2376 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 122:
+#line 449 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy151 = yymsp[-1].minor.yy151;
+ if( yygotominor.yy151 && yygotominor.yy151->nSrc>0 ) yygotominor.yy151->a[yygotominor.yy151->nSrc-1].jointype = yymsp[0].minor.yy280;
+}
+#line 2384 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 123:
+#line 453 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy151 = 0;}
+#line 2389 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 124:
+#line 454 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy151 = sqlite3SrcListAppend(yymsp[-5].minor.yy151,&yymsp[-4].minor.yy198,&yymsp[-3].minor.yy198);
+ if( yymsp[-2].minor.yy198.n ) sqlite3SrcListAddAlias(yygotominor.yy151,&yymsp[-2].minor.yy198);
+ if( yymsp[-1].minor.yy62 ){
+ if( yygotominor.yy151 && yygotominor.yy151->nSrc>1 ){ yygotominor.yy151->a[yygotominor.yy151->nSrc-2].pOn = yymsp[-1].minor.yy62; }
+ else { sqlite3ExprDelete(yymsp[-1].minor.yy62); }
+ }
+ if( yymsp[0].minor.yy240 ){
+ if( yygotominor.yy151 && yygotominor.yy151->nSrc>1 ){ yygotominor.yy151->a[yygotominor.yy151->nSrc-2].pUsing = yymsp[0].minor.yy240; }
+ else { sqlite3IdListDelete(yymsp[0].minor.yy240); }
+ }
+}
+#line 2405 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 125:
+#line 468 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy151 = sqlite3SrcListAppend(yymsp[-6].minor.yy151,0,0);
+ yygotominor.yy151->a[yygotominor.yy151->nSrc-1].pSelect = yymsp[-4].minor.yy375;
+ if( yymsp[-2].minor.yy198.n ) sqlite3SrcListAddAlias(yygotominor.yy151,&yymsp[-2].minor.yy198);
+ if( yymsp[-1].minor.yy62 ){
+ if( yygotominor.yy151 && yygotominor.yy151->nSrc>1 ){ yygotominor.yy151->a[yygotominor.yy151->nSrc-2].pOn = yymsp[-1].minor.yy62; }
+ else { sqlite3ExprDelete(yymsp[-1].minor.yy62); }
+ }
+ if( yymsp[0].minor.yy240 ){
+ if( yygotominor.yy151 && yygotominor.yy151->nSrc>1 ){ yygotominor.yy151->a[yygotominor.yy151->nSrc-2].pUsing = yymsp[0].minor.yy240; }
+ else { sqlite3IdListDelete(yymsp[0].minor.yy240); }
+ }
+ }
+#line 2422 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 127:
+#line 489 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy375 = sqlite3SelectNew(0,yymsp[0].minor.yy151,0,0,0,0,0,0,0);
+ }
+#line 2429 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 128:
+#line 495 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy198.z=0; yygotominor.yy198.n=0;}
+#line 2434 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 130:
+#line 500 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy151 = sqlite3SrcListAppend(0,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198);}
+#line 2439 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 131:
+ case 132:
+#line 504 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = JT_INNER; }
+#line 2445 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 133:
+#line 506 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
+#line 2450 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 134:
+#line 507 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy198,0); }
+#line 2455 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 135:
+#line 509 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy198,&yymsp[-1].minor.yy198); }
+#line 2460 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 136:
+ case 144:
+ case 153:
+ case 160:
+ case 174:
+ case 211:
+ case 236:
+ case 238:
+ case 242:
+#line 513 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy62 = yymsp[0].minor.yy62;}
+#line 2473 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 137:
+ case 152:
+ case 159:
+ case 212:
+ case 237:
+ case 239:
+ case 243:
+#line 514 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy62 = 0;}
+#line 2484 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 138:
+ case 171:
+#line 518 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy240 = yymsp[-1].minor.yy240;}
+#line 2490 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 139:
+ case 170:
+#line 519 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy240 = 0;}
+#line 2496 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 141:
+ case 151:
+#line 530 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy418 = yymsp[0].minor.yy418;}
+#line 2502 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 142:
+#line 531 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418,yymsp[-2].minor.yy62,yymsp[-1].minor.yy198.n>0?&yymsp[-1].minor.yy198:0);
+ if( yygotominor.yy418 ) yygotominor.yy418->a[yygotominor.yy418->nExpr-1].sortOrder = yymsp[0].minor.yy280;
+}
+#line 2510 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 143:
+#line 535 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy418 = sqlite3ExprListAppend(0,yymsp[-2].minor.yy62,yymsp[-1].minor.yy198.n>0?&yymsp[-1].minor.yy198:0);
+ if( yygotominor.yy418 && yygotominor.yy418->a ) yygotominor.yy418->a[0].sortOrder = yymsp[0].minor.yy280;
+}
+#line 2518 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 145:
+ case 147:
+#line 544 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = SQLITE_SO_ASC;}
+#line 2524 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 146:
+#line 545 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = SQLITE_SO_DESC;}
+#line 2529 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 148:
+#line 547 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy198.z = 0; yygotominor.yy198.n = 0;}
+#line 2534 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 154:
+#line 565 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy220.pLimit = 0; yygotominor.yy220.pOffset = 0;}
+#line 2539 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 155:
+#line 566 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy220.pLimit = yymsp[0].minor.yy62; yygotominor.yy220.pOffset = 0;}
+#line 2544 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 156:
+#line 568 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy220.pLimit = yymsp[-2].minor.yy62; yygotominor.yy220.pOffset = yymsp[0].minor.yy62;}
+#line 2549 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 157:
+#line 570 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy220.pOffset = yymsp[-2].minor.yy62; yygotominor.yy220.pLimit = yymsp[0].minor.yy62;}
+#line 2554 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 158:
+#line 574 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3DeleteFrom(pParse,yymsp[-1].minor.yy151,yymsp[0].minor.yy62);}
+#line 2559 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 161:
+#line 585 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Update(pParse,yymsp[-3].minor.yy151,yymsp[-1].minor.yy418,yymsp[0].minor.yy62,yymsp[-4].minor.yy280);}
+#line 2564 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 162:
+#line 591 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418,yymsp[0].minor.yy62,&yymsp[-2].minor.yy198);}
+#line 2569 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 163:
+#line 592 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy418 = sqlite3ExprListAppend(0,yymsp[0].minor.yy62,&yymsp[-2].minor.yy198);}
+#line 2574 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 164:
+#line 598 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Insert(pParse, yymsp[-5].minor.yy151, yymsp[-1].minor.yy418, 0, yymsp[-4].minor.yy240, yymsp[-7].minor.yy280);}
+#line 2579 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 165:
+#line 600 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Insert(pParse, yymsp[-2].minor.yy151, 0, yymsp[0].minor.yy375, yymsp[-1].minor.yy240, yymsp[-4].minor.yy280);}
+#line 2584 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 168:
+ case 240:
+#line 610 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-2].minor.yy418,yymsp[0].minor.yy62,0);}
+#line 2590 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 169:
+ case 241:
+#line 611 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy418 = sqlite3ExprListAppend(0,yymsp[0].minor.yy62,0);}
+#line 2596 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 172:
+#line 620 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy240 = sqlite3IdListAppend(yymsp[-2].minor.yy240,&yymsp[0].minor.yy198);}
+#line 2601 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 173:
+#line 621 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy240 = sqlite3IdListAppend(0,&yymsp[0].minor.yy198);}
+#line 2606 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 175:
+#line 632 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy62 = yymsp[-1].minor.yy62; sqlite3ExprSpan(yygotominor.yy62,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); }
+#line 2611 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 176:
+ case 181:
+ case 182:
+ case 183:
+ case 184:
+#line 633 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy62 = sqlite3Expr(yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);}
+#line 2620 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 177:
+ case 178:
+#line 634 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy62 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy0);}
+#line 2626 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 179:
+#line 636 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy198);
+ Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy198);
+ yygotominor.yy62 = sqlite3Expr(TK_DOT, temp1, temp2, 0);
+}
+#line 2635 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 180:
+#line 641 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-4].minor.yy198);
+ Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy198);
+ Expr *temp3 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy198);
+ Expr *temp4 = sqlite3Expr(TK_DOT, temp2, temp3, 0);
+ yygotominor.yy62 = sqlite3Expr(TK_DOT, temp1, temp4, 0);
+}
+#line 2646 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 185:
+#line 652 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy62 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);}
+#line 2651 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 186:
+#line 653 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Token *pToken = &yymsp[0].minor.yy0;
+ Expr *pExpr = yygotominor.yy62 = sqlite3Expr(TK_VARIABLE, 0, 0, pToken);
+ sqlite3ExprAssignVarNumber(pParse, pExpr);
+}
+#line 2660 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 187:
+#line 659 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_CAST, yymsp[-3].minor.yy62, 0, &yymsp[-1].minor.yy198);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
+}
+#line 2668 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 188:
+#line 664 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3ExprFunction(yymsp[-1].minor.yy418, &yymsp[-4].minor.yy0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
+ if( yymsp[-2].minor.yy280 ){
+ yygotominor.yy62->flags |= EP_Distinct;
+ }
+}
+#line 2679 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 189:
+#line 671 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3ExprFunction(0, &yymsp[-3].minor.yy0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
+}
+#line 2687 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 190:
+#line 675 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
+ ** treated as functions that return constants */
+ yygotominor.yy62 = sqlite3ExprFunction(0,&yymsp[0].minor.yy0);
+ if( yygotominor.yy62 ) yygotominor.yy62->op = TK_CONST_FUNC;
+}
+#line 2697 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 191:
+ case 192:
+ case 193:
+ case 194:
+ case 195:
+ case 196:
+ case 197:
+ case 198:
+ case 199:
+ case 200:
+ case 201:
+ case 202:
+ case 203:
+ case 204:
+ case 205:
+ case 206:
+ case 207:
+ case 208:
+#line 681 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy62 = sqlite3Expr(yymsp[-1].major, yymsp[-2].minor.yy62, yymsp[0].minor.yy62, 0);}
+#line 2719 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 209:
+#line 700 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy222.operator = yymsp[0].minor.yy0; yygotominor.yy222.not = 0;}
+#line 2724 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 210:
+#line 701 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy222.operator = yymsp[0].minor.yy0; yygotominor.yy222.not = 1;}
+#line 2729 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 213:
+#line 705 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ ExprList *pList = sqlite3ExprListAppend(0, yymsp[-1].minor.yy62, 0);
+ pList = sqlite3ExprListAppend(pList, yymsp[-3].minor.yy62, 0);
+ if( yymsp[0].minor.yy62 ){
+ pList = sqlite3ExprListAppend(pList, yymsp[0].minor.yy62, 0);
+ }
+ yygotominor.yy62 = sqlite3ExprFunction(pList, &yymsp[-2].minor.yy222.operator);
+ if( yymsp[-2].minor.yy222.not ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62, &yymsp[-3].minor.yy62->span, &yymsp[-1].minor.yy62->span);
+}
+#line 2743 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 214:
+#line 716 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_ISNULL, yymsp[-1].minor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy62->span,&yymsp[0].minor.yy0);
+}
+#line 2751 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 215:
+#line 720 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_ISNULL, yymsp[-2].minor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-2].minor.yy62->span,&yymsp[0].minor.yy0);
+}
+#line 2759 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 216:
+#line 724 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_NOTNULL, yymsp[-1].minor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy62->span,&yymsp[0].minor.yy0);
+}
+#line 2767 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 217:
+#line 728 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_NOTNULL, yymsp[-2].minor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-2].minor.yy62->span,&yymsp[0].minor.yy0);
+}
+#line 2775 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 218:
+#line 732 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_NOTNULL, yymsp[-3].minor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-3].minor.yy62->span,&yymsp[0].minor.yy0);
+}
+#line 2783 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 219:
+ case 220:
+#line 736 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(yymsp[-1].major, yymsp[0].minor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy62->span);
+}
+#line 2792 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 221:
+#line 744 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_UMINUS, yymsp[0].minor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy62->span);
+}
+#line 2800 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 222:
+#line 748 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_UPLUS, yymsp[0].minor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy62->span);
+}
+#line 2808 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 225:
+#line 755 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ ExprList *pList = sqlite3ExprListAppend(0, yymsp[-2].minor.yy62, 0);
+ pList = sqlite3ExprListAppend(pList, yymsp[0].minor.yy62, 0);
+ yygotominor.yy62 = sqlite3Expr(TK_BETWEEN, yymsp[-4].minor.yy62, 0, 0);
+ if( yygotominor.yy62 ){
+ yygotominor.yy62->pList = pList;
+ }else{
+ sqlite3ExprListDelete(pList);
+ }
+ if( yymsp[-3].minor.yy280 ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-4].minor.yy62->span,&yymsp[0].minor.yy62->span);
+}
+#line 2824 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 228:
+#line 771 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_IN, yymsp[-4].minor.yy62, 0, 0);
+ if( yygotominor.yy62 ){
+ yygotominor.yy62->pList = yymsp[-1].minor.yy418;
+ }else{
+ sqlite3ExprListDelete(yymsp[-1].minor.yy418);
+ }
+ if( yymsp[-3].minor.yy280 ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-4].minor.yy62->span,&yymsp[0].minor.yy0);
+ }
+#line 2838 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 229:
+#line 781 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_SELECT, 0, 0, 0);
+ if( yygotominor.yy62 ){
+ yygotominor.yy62->pSelect = yymsp[-1].minor.yy375;
+ }else{
+ sqlite3SelectDelete(yymsp[-1].minor.yy375);
+ }
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
+ }
+#line 2851 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 230:
+#line 790 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_IN, yymsp[-4].minor.yy62, 0, 0);
+ if( yygotominor.yy62 ){
+ yygotominor.yy62->pSelect = yymsp[-1].minor.yy375;
+ }else{
+ sqlite3SelectDelete(yymsp[-1].minor.yy375);
+ }
+ if( yymsp[-3].minor.yy280 ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-4].minor.yy62->span,&yymsp[0].minor.yy0);
+ }
+#line 2865 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 231:
+#line 800 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ SrcList *pSrc = sqlite3SrcListAppend(0,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198);
+ yygotominor.yy62 = sqlite3Expr(TK_IN, yymsp[-3].minor.yy62, 0, 0);
+ if( yygotominor.yy62 ){
+ yygotominor.yy62->pSelect = sqlite3SelectNew(0,pSrc,0,0,0,0,0,0,0);
+ }else{
+ sqlite3SrcListDelete(pSrc);
+ }
+ if( yymsp[-2].minor.yy280 ) yygotominor.yy62 = sqlite3Expr(TK_NOT, yygotominor.yy62, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy62,&yymsp[-3].minor.yy62->span,yymsp[0].minor.yy198.z?&yymsp[0].minor.yy198:&yymsp[-1].minor.yy198);
+ }
+#line 2880 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 232:
+#line 811 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Expr *p = yygotominor.yy62 = sqlite3Expr(TK_EXISTS, 0, 0, 0);
+ if( p ){
+ p->pSelect = yymsp[-1].minor.yy375;
+ sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
+ }else{
+ sqlite3SelectDelete(yymsp[-1].minor.yy375);
+ }
+ }
+#line 2893 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 233:
+#line 823 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_CASE, yymsp[-3].minor.yy62, yymsp[-1].minor.yy62, 0);
+ if( yygotominor.yy62 ){
+ yygotominor.yy62->pList = yymsp[-2].minor.yy418;
+ }else{
+ sqlite3ExprListDelete(yymsp[-2].minor.yy418);
+ }
+ sqlite3ExprSpan(yygotominor.yy62, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
+}
+#line 2906 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 234:
+#line 834 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418, yymsp[-2].minor.yy62, 0);
+ yygotominor.yy418 = sqlite3ExprListAppend(yygotominor.yy418, yymsp[0].minor.yy62, 0);
+}
+#line 2914 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 235:
+#line 838 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy418 = sqlite3ExprListAppend(0, yymsp[-2].minor.yy62, 0);
+ yygotominor.yy418 = sqlite3ExprListAppend(yygotominor.yy418, yymsp[0].minor.yy62, 0);
+}
+#line 2922 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 244:
+#line 863 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ if( yymsp[-9].minor.yy280!=OE_None ) yymsp[-9].minor.yy280 = yymsp[0].minor.yy280;
+ if( yymsp[-9].minor.yy280==OE_Default) yymsp[-9].minor.yy280 = OE_Abort;
+ sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy198, &yymsp[-6].minor.yy198, sqlite3SrcListAppend(0,&yymsp[-4].minor.yy198,0),yymsp[-2].minor.yy418,yymsp[-9].minor.yy280, &yymsp[-10].minor.yy0, &yymsp[-1].minor.yy0);
+}
+#line 2931 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 245:
+ case 292:
+#line 870 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = OE_Abort;}
+#line 2937 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 246:
+#line 871 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = OE_None;}
+#line 2942 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 249:
+#line 881 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Expr *p = 0;
+ if( yymsp[-1].minor.yy198.n>0 ){
+ p = sqlite3Expr(TK_COLUMN, 0, 0, 0);
+ if( p ) p->pColl = sqlite3LocateCollSeq(pParse, yymsp[-1].minor.yy198.z, yymsp[-1].minor.yy198.n);
+ }
+ yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418, p, &yymsp[-2].minor.yy198);
+}
+#line 2954 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 250:
+#line 889 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Expr *p = 0;
+ if( yymsp[-1].minor.yy198.n>0 ){
+ p = sqlite3Expr(TK_COLUMN, 0, 0, 0);
+ if( p ) p->pColl = sqlite3LocateCollSeq(pParse, yymsp[-1].minor.yy198.z, yymsp[-1].minor.yy198.n);
+ }
+ yygotominor.yy418 = sqlite3ExprListAppend(0, p, &yymsp[-2].minor.yy198);
+}
+#line 2966 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 252:
+#line 902 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3DropIndex(pParse, yymsp[0].minor.yy151);}
+#line 2971 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 253:
+ case 254:
+#line 906 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Vacuum(pParse,0);}
+#line 2977 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 255:
+ case 257:
+#line 912 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Pragma(pParse,&yymsp[-3].minor.yy198,&yymsp[-2].minor.yy198,&yymsp[0].minor.yy198,0);}
+#line 2983 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 256:
+#line 913 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Pragma(pParse,&yymsp[-3].minor.yy198,&yymsp[-2].minor.yy198,&yymsp[0].minor.yy0,0);}
+#line 2988 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 258:
+#line 915 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3Pragma(pParse,&yymsp[-3].minor.yy198,&yymsp[-2].minor.yy198,&yymsp[0].minor.yy198,1);
+}
+#line 2995 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 259:
+#line 918 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Pragma(pParse,&yymsp[-4].minor.yy198,&yymsp[-3].minor.yy198,&yymsp[-1].minor.yy198,0);}
+#line 3000 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 260:
+#line 919 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Pragma(pParse,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198,0,0);}
+#line 3005 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 267:
+#line 932 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ Token all;
+ all.z = yymsp[-3].minor.yy198.z;
+ all.n = (yymsp[0].minor.yy0.z - yymsp[-3].minor.yy198.z) + yymsp[0].minor.yy0.n;
+ sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy360, &all);
+}
+#line 3015 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 268:
+#line 941 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy198, &yymsp[-6].minor.yy198, yymsp[-5].minor.yy280, yymsp[-4].minor.yy30.a, yymsp[-4].minor.yy30.b, yymsp[-2].minor.yy151, yymsp[-1].minor.yy280, yymsp[0].minor.yy62, yymsp[-9].minor.yy280);
+ yygotominor.yy198 = (yymsp[-6].minor.yy198.n==0?yymsp[-7].minor.yy198:yymsp[-6].minor.yy198);
+}
+#line 3023 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 269:
+ case 272:
+#line 947 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = TK_BEFORE; }
+#line 3029 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 270:
+#line 948 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = TK_AFTER; }
+#line 3034 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 271:
+#line 949 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = TK_INSTEAD;}
+#line 3039 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 273:
+ case 274:
+ case 275:
+#line 954 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy30.a = yymsp[0].major; yygotominor.yy30.b = 0;}
+#line 3046 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 276:
+#line 957 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy30.a = TK_UPDATE; yygotominor.yy30.b = yymsp[0].minor.yy240;}
+#line 3051 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 277:
+ case 278:
+#line 960 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = TK_ROW; }
+#line 3057 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 279:
+#line 962 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy280 = TK_STATEMENT; }
+#line 3062 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 280:
+#line 965 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy62 = 0; }
+#line 3067 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 281:
+#line 966 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy62 = yymsp[0].minor.yy62; }
+#line 3072 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 282:
+#line 970 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yymsp[-2].minor.yy360->pNext = yymsp[0].minor.yy360;
+ yygotominor.yy360 = yymsp[-2].minor.yy360;
+}
+#line 3080 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 283:
+#line 974 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy360 = 0; }
+#line 3085 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 284:
+#line 980 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy360 = sqlite3TriggerUpdateStep(&yymsp[-3].minor.yy198, yymsp[-1].minor.yy418, yymsp[0].minor.yy62, yymsp[-4].minor.yy280); }
+#line 3090 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 285:
+#line 985 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy360 = sqlite3TriggerInsertStep(&yymsp[-5].minor.yy198, yymsp[-4].minor.yy240, yymsp[-1].minor.yy418, 0, yymsp[-7].minor.yy280);}
+#line 3095 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 286:
+#line 988 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy360 = sqlite3TriggerInsertStep(&yymsp[-2].minor.yy198, yymsp[-1].minor.yy240, 0, yymsp[0].minor.yy375, yymsp[-4].minor.yy280);}
+#line 3100 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 287:
+#line 992 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy360 = sqlite3TriggerDeleteStep(&yymsp[-1].minor.yy198, yymsp[0].minor.yy62);}
+#line 3105 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 288:
+#line 995 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy360 = sqlite3TriggerSelectStep(yymsp[0].minor.yy375); }
+#line 3110 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 289:
+#line 998 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_RAISE, 0, 0, 0);
+ yygotominor.yy62->iColumn = OE_Ignore;
+ sqlite3ExprSpan(yygotominor.yy62, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
+}
+#line 3119 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 290:
+#line 1003 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy62 = sqlite3Expr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy198);
+ yygotominor.yy62->iColumn = yymsp[-3].minor.yy280;
+ sqlite3ExprSpan(yygotominor.yy62, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
+}
+#line 3128 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 291:
+#line 1011 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = OE_Rollback;}
+#line 3133 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 293:
+#line 1013 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy280 = OE_Fail;}
+#line 3138 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 294:
+#line 1018 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3DropTrigger(pParse,yymsp[0].minor.yy151);
+}
+#line 3145 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 295:
+#line 1024 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3Attach(pParse, &yymsp[-3].minor.yy198, &yymsp[-1].minor.yy198, yymsp[0].minor.yy361.type, &yymsp[0].minor.yy361.key);
+}
+#line 3152 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 296:
+#line 1028 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy361.type = 0; }
+#line 3157 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 297:
+#line 1029 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy361.type=1; yygotominor.yy361.key = yymsp[0].minor.yy198; }
+#line 3162 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 298:
+#line 1030 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy361.type=2; yygotominor.yy361.key = yymsp[0].minor.yy0; }
+#line 3167 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 301:
+#line 1036 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3Detach(pParse, &yymsp[0].minor.yy198);
+}
+#line 3174 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 302:
+#line 1042 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Reindex(pParse, 0, 0);}
+#line 3179 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 303:
+#line 1043 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Reindex(pParse, &yymsp[-1].minor.yy198, &yymsp[0].minor.yy198);}
+#line 3184 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 304:
+#line 1048 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Analyze(pParse, 0, 0);}
+#line 3189 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 305:
+#line 1049 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Analyze(pParse, &yymsp[-1].minor.yy198, &yymsp[0].minor.yy198);}
+#line 3194 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 306:
+#line 1054 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy151,&yymsp[0].minor.yy198);
+}
+#line 3201 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 307:
+#line 1057 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy198);
+}
+#line 3208 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 308:
+#line 1060 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy151);
+}
+#line 3215 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ };
+ yygoto = yyRuleInfo[yyruleno].lhs;
+ yysize = yyRuleInfo[yyruleno].nrhs;
+ yypParser->yyidx -= yysize;
+ yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto);
+ if( yyact < YYNSTATE ){
+#ifdef NDEBUG
+ /* If we are not debugging and the reduce action popped at least
+ ** one element off the stack, then we can push the new element back
+ ** onto the stack here, and skip the stack overflow test in yy_shift().
+ ** That gives a significant speed improvement. */
+ if( yysize ){
+ yypParser->yyidx++;
+ yymsp -= yysize-1;
+ yymsp->stateno = yyact;
+ yymsp->major = yygoto;
+ yymsp->minor = yygotominor;
+ }else
+#endif
+ {
+ yy_shift(yypParser,yyact,yygoto,&yygotominor);
+ }
+ }else if( yyact == YYNSTATE + YYNRULE + 1 ){
+ yy_accept(yypParser);
+ }
+}
+
+/*
+** The following code executes when the parse fails
+*/
+static void yy_parse_failed(
+ yyParser *yypParser /* The parser */
+){
+ sqlite3ParserARG_FETCH;
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
+ }
+#endif
+ while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
+ /* Here code is inserted which will be executed whenever the
+ ** parser fails */
+ sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
+}
+
+/*
+** The following code executes when a syntax error first occurs.
+*/
+static void yy_syntax_error(
+ yyParser *yypParser, /* The parser */
+ int yymajor, /* The major type of the error token */
+ YYMINORTYPE yyminor /* The minor type of the error token */
+){
+ sqlite3ParserARG_FETCH;
+#define TOKEN (yyminor.yy0)
+#line 34 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.y"
+
+ if( pParse->zErrMsg==0 ){
+ if( TOKEN.z[0] ){
+ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
+ }else{
+ sqlite3ErrorMsg(pParse, "incomplete SQL statement");
+ }
+ }
+#line 3282 "/home/rei/php_dev/php5.1/ext/pdo_sqlite/sqlite/src/parse.c"
+ sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
+}
+
+/*
+** The following is executed when the parser accepts
+*/
+static void yy_accept(
+ yyParser *yypParser /* The parser */
+){
+ sqlite3ParserARG_FETCH;
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
+ }
+#endif
+ while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
+ /* Here code is inserted which will be executed whenever the
+ ** parser accepts */
+ sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
+}
+
+/* The main parser program.
+** The first argument is a pointer to a structure obtained from
+** "sqlite3ParserAlloc" which describes the current state of the parser.
+** The second argument is the major token number. The third is
+** the minor token. The fourth optional argument is whatever the
+** user wants (and specified in the grammar) and is available for
+** use by the action routines.
+**
+** Inputs:
+** <ul>
+** <li> A pointer to the parser (an opaque structure.)
+** <li> The major token number.
+** <li> The minor token number.
+** <li> An option argument of a grammar-specified type.
+** </ul>
+**
+** Outputs:
+** None.
+*/
+void sqlite3Parser(
+ void *yyp, /* The parser */
+ int yymajor, /* The major token code number */
+ sqlite3ParserTOKENTYPE yyminor /* The value for the token */
+ sqlite3ParserARG_PDECL /* Optional %extra_argument parameter */
+){
+ YYMINORTYPE yyminorunion;
+ int yyact; /* The parser action. */
+ int yyendofinput; /* True if we are at the end of input */
+ int yyerrorhit = 0; /* True if yymajor has invoked an error */
+ yyParser *yypParser; /* The parser */
+
+ /* (re)initialize the parser, if necessary */
+ yypParser = (yyParser*)yyp;
+ if( yypParser->yyidx<0 ){
+ /* if( yymajor==0 ) return; // not sure why this was here... */
+ yypParser->yyidx = 0;
+ yypParser->yyerrcnt = -1;
+ yypParser->yystack[0].stateno = 0;
+ yypParser->yystack[0].major = 0;
+ }
+ yyminorunion.yy0 = yyminor;
+ yyendofinput = (yymajor==0);
+ sqlite3ParserARG_STORE;
+
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
+ }
+#endif
+
+ do{
+ yyact = yy_find_shift_action(yypParser,yymajor);
+ if( yyact<YYNSTATE ){
+ yy_shift(yypParser,yyact,yymajor,&yyminorunion);
+ yypParser->yyerrcnt--;
+ if( yyendofinput && yypParser->yyidx>=0 ){
+ yymajor = 0;
+ }else{
+ yymajor = YYNOCODE;
+ }
+ }else if( yyact < YYNSTATE + YYNRULE ){
+ yy_reduce(yypParser,yyact-YYNSTATE);
+ }else if( yyact == YY_ERROR_ACTION ){
+ int yymx;
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
+ }
+#endif
+#ifdef YYERRORSYMBOL
+ /* A syntax error has occurred.
+ ** The response to an error depends upon whether or not the
+ ** grammar defines an error token "ERROR".
+ **
+ ** This is what we do if the grammar does define ERROR:
+ **
+ ** * Call the %syntax_error function.
+ **
+ ** * Begin popping the stack until we enter a state where
+ ** it is legal to shift the error symbol, then shift
+ ** the error symbol.
+ **
+ ** * Set the error count to three.
+ **
+ ** * Begin accepting and shifting new tokens. No new error
+ ** processing will occur until three tokens have been
+ ** shifted successfully.
+ **
+ */
+ if( yypParser->yyerrcnt<0 ){
+ yy_syntax_error(yypParser,yymajor,yyminorunion);
+ }
+ yymx = yypParser->yystack[yypParser->yyidx].major;
+ if( yymx==YYERRORSYMBOL || yyerrorhit ){
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sDiscard input token %s\n",
+ yyTracePrompt,yyTokenName[yymajor]);
+ }
+#endif
+ yy_destructor(yymajor,&yyminorunion);
+ yymajor = YYNOCODE;
+ }else{
+ while(
+ yypParser->yyidx >= 0 &&
+ yymx != YYERRORSYMBOL &&
+ (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE
+ ){
+ yy_pop_parser_stack(yypParser);
+ }
+ if( yypParser->yyidx < 0 || yymajor==0 ){
+ yy_destructor(yymajor,&yyminorunion);
+ yy_parse_failed(yypParser);
+ yymajor = YYNOCODE;
+ }else if( yymx!=YYERRORSYMBOL ){
+ YYMINORTYPE u2;
+ u2.YYERRSYMDT = 0;
+ yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
+ }
+ }
+ yypParser->yyerrcnt = 3;
+ yyerrorhit = 1;
+#else /* YYERRORSYMBOL is not defined */
+ /* This is what we do if the grammar does not define ERROR:
+ **
+ ** * Report an error message, and throw away the input token.
+ **
+ ** * If the input token is $, then fail the parse.
+ **
+ ** As before, subsequent error messages are suppressed until
+ ** three input tokens have been successfully shifted.
+ */
+ if( yypParser->yyerrcnt<=0 ){
+ yy_syntax_error(yypParser,yymajor,yyminorunion);
+ }
+ yypParser->yyerrcnt = 3;
+ yy_destructor(yymajor,&yyminorunion);
+ if( yyendofinput ){
+ yy_parse_failed(yypParser);
+ }
+ yymajor = YYNOCODE;
+#endif
+ }else{
+ yy_accept(yypParser);
+ yymajor = YYNOCODE;
+ }
+ }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
+ return;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/parse.h b/ext/pdo_sqlite/sqlite/src/parse.h
new file mode 100644
index 000000000..fcedda589
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/parse.h
@@ -0,0 +1,145 @@
+#define TK_END_OF_FILE 1
+#define TK_ILLEGAL 2
+#define TK_SPACE 3
+#define TK_UNCLOSED_STRING 4
+#define TK_COMMENT 5
+#define TK_FUNCTION 6
+#define TK_COLUMN 7
+#define TK_AGG_FUNCTION 8
+#define TK_AGG_COLUMN 9
+#define TK_CONST_FUNC 10
+#define TK_SEMI 11
+#define TK_EXPLAIN 12
+#define TK_QUERY 13
+#define TK_PLAN 14
+#define TK_BEGIN 15
+#define TK_TRANSACTION 16
+#define TK_DEFERRED 17
+#define TK_IMMEDIATE 18
+#define TK_EXCLUSIVE 19
+#define TK_COMMIT 20
+#define TK_END 21
+#define TK_ROLLBACK 22
+#define TK_CREATE 23
+#define TK_TABLE 24
+#define TK_TEMP 25
+#define TK_LP 26
+#define TK_RP 27
+#define TK_AS 28
+#define TK_COMMA 29
+#define TK_ID 30
+#define TK_ABORT 31
+#define TK_AFTER 32
+#define TK_ANALYZE 33
+#define TK_ASC 34
+#define TK_ATTACH 35
+#define TK_BEFORE 36
+#define TK_CASCADE 37
+#define TK_CAST 38
+#define TK_CONFLICT 39
+#define TK_DATABASE 40
+#define TK_DESC 41
+#define TK_DETACH 42
+#define TK_EACH 43
+#define TK_FAIL 44
+#define TK_FOR 45
+#define TK_IGNORE 46
+#define TK_INITIALLY 47
+#define TK_INSTEAD 48
+#define TK_LIKE_KW 49
+#define TK_MATCH 50
+#define TK_KEY 51
+#define TK_OF 52
+#define TK_OFFSET 53
+#define TK_PRAGMA 54
+#define TK_RAISE 55
+#define TK_REPLACE 56
+#define TK_RESTRICT 57
+#define TK_ROW 58
+#define TK_STATEMENT 59
+#define TK_TRIGGER 60
+#define TK_VACUUM 61
+#define TK_VIEW 62
+#define TK_REINDEX 63
+#define TK_RENAME 64
+#define TK_CTIME_KW 65
+#define TK_ALTER 66
+#define TK_OR 67
+#define TK_AND 68
+#define TK_NOT 69
+#define TK_IS 70
+#define TK_BETWEEN 71
+#define TK_IN 72
+#define TK_ISNULL 73
+#define TK_NOTNULL 74
+#define TK_NE 75
+#define TK_EQ 76
+#define TK_GT 77
+#define TK_LE 78
+#define TK_LT 79
+#define TK_GE 80
+#define TK_ESCAPE 81
+#define TK_BITAND 82
+#define TK_BITOR 83
+#define TK_LSHIFT 84
+#define TK_RSHIFT 85
+#define TK_PLUS 86
+#define TK_MINUS 87
+#define TK_STAR 88
+#define TK_SLASH 89
+#define TK_REM 90
+#define TK_CONCAT 91
+#define TK_UMINUS 92
+#define TK_UPLUS 93
+#define TK_BITNOT 94
+#define TK_STRING 95
+#define TK_JOIN_KW 96
+#define TK_CONSTRAINT 97
+#define TK_DEFAULT 98
+#define TK_NULL 99
+#define TK_PRIMARY 100
+#define TK_UNIQUE 101
+#define TK_CHECK 102
+#define TK_REFERENCES 103
+#define TK_COLLATE 104
+#define TK_AUTOINCR 105
+#define TK_ON 106
+#define TK_DELETE 107
+#define TK_UPDATE 108
+#define TK_INSERT 109
+#define TK_SET 110
+#define TK_DEFERRABLE 111
+#define TK_FOREIGN 112
+#define TK_DROP 113
+#define TK_UNION 114
+#define TK_ALL 115
+#define TK_INTERSECT 116
+#define TK_EXCEPT 117
+#define TK_SELECT 118
+#define TK_DISTINCT 119
+#define TK_DOT 120
+#define TK_FROM 121
+#define TK_JOIN 122
+#define TK_USING 123
+#define TK_ORDER 124
+#define TK_BY 125
+#define TK_GROUP 126
+#define TK_HAVING 127
+#define TK_LIMIT 128
+#define TK_WHERE 129
+#define TK_INTO 130
+#define TK_VALUES 131
+#define TK_INTEGER 132
+#define TK_FLOAT 133
+#define TK_BLOB 134
+#define TK_REGISTER 135
+#define TK_VARIABLE 136
+#define TK_EXISTS 137
+#define TK_CASE 138
+#define TK_WHEN 139
+#define TK_THEN 140
+#define TK_ELSE 141
+#define TK_INDEX 142
+#define TK_TO 143
+#define TK_ADD 144
+#define TK_COLUMNKW 145
diff --git a/ext/pdo_sqlite/sqlite/src/parse.y b/ext/pdo_sqlite/sqlite/src/parse.y
new file mode 100644
index 000000000..1f16c20a8
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/parse.y
@@ -0,0 +1,1065 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains SQLite's grammar for SQL. Process this file
+** using the lemon parser generator to generate C code that runs
+** the parser. Lemon will also generate a header file containing
+** numeric codes for all of the tokens.
+**
+** @(#) $Id$
+*/
+
+// All token codes are small integers with #defines that begin with "TK_"
+%token_prefix TK_
+
+// The type of the data attached to each token is Token. This is also the
+// default type for non-terminals.
+//
+%token_type {Token}
+%default_type {Token}
+
+// The generated parser function takes a 4th argument as follows:
+%extra_argument {Parse *pParse}
+
+// This code runs whenever there is a syntax error
+//
+%syntax_error {
+ if( pParse->zErrMsg==0 ){
+ if( TOKEN.z[0] ){
+ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
+ }else{
+ sqlite3ErrorMsg(pParse, "incomplete SQL statement");
+ }
+ }
+}
+
+// The name of the generated procedure that implements the parser
+// is as follows:
+%name sqlite3Parser
+
+// The following text is included near the beginning of the C source
+// code file that implements the parser.
+//
+%include {
+#include "sqliteInt.h"
+#include "parse.h"
+
+/*
+** An instance of this structure holds information about the
+** LIMIT clause of a SELECT statement.
+*/
+struct LimitVal {
+ Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
+ Expr *pOffset; /* The OFFSET expression. NULL if there is none */
+};
+
+/*
+** An instance of this structure is used to store the LIKE,
+** GLOB, NOT LIKE, and NOT GLOB operators.
+*/
+struct LikeOp {
+ Token operator; /* "like" or "glob" or "regexp" */
+ int not; /* True if the NOT keyword is present */
+};
+
+/*
+** An instance of the following structure describes the event of a
+** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
+** TK_DELETE, or TK_INSTEAD. If the event is of the form
+**
+** UPDATE ON (a,b,c)
+**
+** Then the "b" IdList records the list "a,b,c".
+*/
+struct TrigEvent { int a; IdList * b; };
+
+/*
+** An instance of this structure holds the ATTACH key and the key type.
+*/
+struct AttachKey { int type; Token key; };
+
+} // end %include
+
+// These are extra tokens used by the lexer but never seen by the
+// parser. We put them in a rule so that the parser generator will
+// add them to the parse.h output file.
+//
+%nonassoc END_OF_FILE ILLEGAL SPACE UNCLOSED_STRING COMMENT FUNCTION
+ COLUMN AGG_FUNCTION AGG_COLUMN CONST_FUNC.
+
+// Input is a single SQL command
+input ::= cmdlist.
+cmdlist ::= cmdlist ecmd.
+cmdlist ::= ecmd.
+cmdx ::= cmd. { sqlite3FinishCoding(pParse); }
+ecmd ::= SEMI.
+ecmd ::= explain cmdx SEMI.
+explain ::= . { sqlite3BeginParse(pParse, 0); }
+%ifndef SQLITE_OMIT_EXPLAIN
+explain ::= EXPLAIN. { sqlite3BeginParse(pParse, 1); }
+explain ::= EXPLAIN QUERY PLAN. { sqlite3BeginParse(pParse, 2); }
+%endif
+
+///////////////////// Begin and end transactions. ////////////////////////////
+//
+
+cmd ::= BEGIN transtype(Y) trans_opt. {sqlite3BeginTransaction(pParse, Y);}
+trans_opt ::= .
+trans_opt ::= TRANSACTION.
+trans_opt ::= TRANSACTION nm.
+%type transtype {int}
+transtype(A) ::= . {A = TK_DEFERRED;}
+transtype(A) ::= DEFERRED(X). {A = @X;}
+transtype(A) ::= IMMEDIATE(X). {A = @X;}
+transtype(A) ::= EXCLUSIVE(X). {A = @X;}
+cmd ::= COMMIT trans_opt. {sqlite3CommitTransaction(pParse);}
+cmd ::= END trans_opt. {sqlite3CommitTransaction(pParse);}
+cmd ::= ROLLBACK trans_opt. {sqlite3RollbackTransaction(pParse);}
+
+///////////////////// The CREATE TABLE statement ////////////////////////////
+//
+cmd ::= create_table create_table_args.
+create_table ::= CREATE(X) temp(T) TABLE nm(Y) dbnm(Z). {
+ sqlite3StartTable(pParse,&X,&Y,&Z,T,0);
+}
+%type temp {int}
+%ifndef SQLITE_OMIT_TEMPDB
+temp(A) ::= TEMP. {A = 1;}
+%endif
+temp(A) ::= . {A = 0;}
+create_table_args ::= LP columnlist conslist_opt(X) RP(Y). {
+ sqlite3EndTable(pParse,&X,&Y,0);
+}
+create_table_args ::= AS select(S). {
+ sqlite3EndTable(pParse,0,0,S);
+ sqlite3SelectDelete(S);
+}
+columnlist ::= columnlist COMMA column.
+columnlist ::= column.
+
+// A "column" is a complete description of a single column in a
+// CREATE TABLE statement. This includes the column name, its
+// datatype, and other keywords such as PRIMARY KEY, UNIQUE, REFERENCES,
+// NOT NULL and so forth.
+//
+column(A) ::= columnid(X) type carglist. {
+ A.z = X.z;
+ A.n = (pParse->sLastToken.z-X.z) + pParse->sLastToken.n;
+}
+columnid(A) ::= nm(X). {
+ sqlite3AddColumn(pParse,&X);
+ A = X;
+}
+
+
+// An IDENTIFIER can be a generic identifier, or one of several
+// keywords. Any non-standard keyword can also be an identifier.
+//
+%type id {Token}
+id(A) ::= ID(X). {A = X;}
+
+// The following directive causes tokens ABORT, AFTER, ASC, etc. to
+// fallback to ID if they will not parse as their original value.
+// This obviates the need for the "id" nonterminal.
+//
+%fallback ID
+ ABORT AFTER ANALYZE ASC ATTACH BEFORE BEGIN CASCADE CAST CONFLICT
+ DATABASE DEFERRED DESC DETACH EACH END EXCLUSIVE EXPLAIN FAIL FOR
+ IGNORE IMMEDIATE INITIALLY INSTEAD LIKE_KW MATCH PLAN QUERY KEY
+ OF OFFSET PRAGMA RAISE REPLACE RESTRICT ROW STATEMENT
+ TEMP TRIGGER VACUUM VIEW
+%ifdef SQLITE_OMIT_COMPOUND_SELECT
+ EXCEPT INTERSECT UNION
+%endif
+ REINDEX RENAME CTIME_KW ALTER
+ .
+
+// Define operator precedence early so that this is the first occurance
+// of the operator tokens in the grammer. Keeping the operators together
+// causes them to be assigned integer values that are close together,
+// which keeps parser tables smaller.
+//
+// The token values assigned to these symbols is determined by the order
+// in which lemon first sees them. It must be the case that ISNULL/NOTNULL,
+// NE/EQ, GT/LE, and GE/LT are separated by only a single value. See
+// the sqlite3ExprIfFalse() routine for additional information on this
+// constraint.
+//
+%left OR.
+%left AND.
+%right NOT.
+%left IS LIKE_KW BETWEEN IN ISNULL NOTNULL NE EQ.
+%left GT LE LT GE.
+%right ESCAPE.
+%left BITAND BITOR LSHIFT RSHIFT.
+%left PLUS MINUS.
+%left STAR SLASH REM.
+%left CONCAT.
+%right UMINUS UPLUS BITNOT.
+
+// And "ids" is an identifer-or-string.
+//
+%type ids {Token}
+ids(A) ::= ID(X). {A = X;}
+ids(A) ::= STRING(X). {A = X;}
+
+// The name of a column or table can be any of the following:
+//
+%type nm {Token}
+nm(A) ::= ID(X). {A = X;}
+nm(A) ::= STRING(X). {A = X;}
+nm(A) ::= JOIN_KW(X). {A = X;}
+
+// A typetoken is really one or more tokens that form a type name such
+// as can be found after the column name in a CREATE TABLE statement.
+// Multiple tokens are concatenated to form the value of the typetoken.
+//
+%type typetoken {Token}
+type ::= .
+type ::= typetoken(X). {sqlite3AddColumnType(pParse,&X);}
+typetoken(A) ::= typename(X). {A = X;}
+typetoken(A) ::= typename(X) LP signed RP(Y). {
+ A.z = X.z;
+ A.n = &Y.z[Y.n] - X.z;
+}
+typetoken(A) ::= typename(X) LP signed COMMA signed RP(Y). {
+ A.z = X.z;
+ A.n = &Y.z[Y.n] - X.z;
+}
+%type typename {Token}
+typename(A) ::= ids(X). {A = X;}
+typename(A) ::= typename(X) ids(Y). {A.z=X.z; A.n=Y.n+(Y.z-X.z);}
+%type signed {int}
+signed(A) ::= plus_num(X). { A = atoi(X.z); }
+signed(A) ::= minus_num(X). { A = -atoi(X.z); }
+
+// "carglist" is a list of additional constraints that come after the
+// column name and column type in a CREATE TABLE statement.
+//
+carglist ::= carglist carg.
+carglist ::= .
+carg ::= CONSTRAINT nm ccons.
+carg ::= ccons.
+carg ::= DEFAULT term(X). {sqlite3AddDefaultValue(pParse,X);}
+carg ::= DEFAULT LP expr(X) RP. {sqlite3AddDefaultValue(pParse,X);}
+carg ::= DEFAULT PLUS term(X). {sqlite3AddDefaultValue(pParse,X);}
+carg ::= DEFAULT MINUS term(X). {
+ Expr *p = sqlite3Expr(TK_UMINUS, X, 0, 0);
+ sqlite3AddDefaultValue(pParse,p);
+}
+carg ::= DEFAULT id(X). {
+ Expr *p = sqlite3Expr(TK_STRING, 0, 0, &X);
+ sqlite3AddDefaultValue(pParse,p);
+}
+
+// In addition to the type name, we also care about the primary key and
+// UNIQUE constraints.
+//
+ccons ::= NULL onconf.
+ccons ::= NOT NULL onconf(R). {sqlite3AddNotNull(pParse, R);}
+ccons ::= PRIMARY KEY sortorder onconf(R) autoinc(I).
+ {sqlite3AddPrimaryKey(pParse,0,R,I);}
+ccons ::= UNIQUE onconf(R). {sqlite3CreateIndex(pParse,0,0,0,0,R,0,0);}
+ccons ::= CHECK LP expr(X) RP onconf. {sqlite3ExprDelete(X);}
+ccons ::= REFERENCES nm(T) idxlist_opt(TA) refargs(R).
+ {sqlite3CreateForeignKey(pParse,0,&T,TA,R);}
+ccons ::= defer_subclause(D). {sqlite3DeferForeignKey(pParse,D);}
+ccons ::= COLLATE id(C). {sqlite3AddCollateType(pParse, C.z, C.n);}
+
+// The optional AUTOINCREMENT keyword
+%type autoinc {int}
+autoinc(X) ::= . {X = 0;}
+autoinc(X) ::= AUTOINCR. {X = 1;}
+
+// The next group of rules parses the arguments to a REFERENCES clause
+// that determine if the referential integrity checking is deferred or
+// or immediate and which determine what action to take if a ref-integ
+// check fails.
+//
+%type refargs {int}
+refargs(A) ::= . { A = OE_Restrict * 0x010101; }
+refargs(A) ::= refargs(X) refarg(Y). { A = (X & Y.mask) | Y.value; }
+%type refarg {struct {int value; int mask;}}
+refarg(A) ::= MATCH nm. { A.value = 0; A.mask = 0x000000; }
+refarg(A) ::= ON DELETE refact(X). { A.value = X; A.mask = 0x0000ff; }
+refarg(A) ::= ON UPDATE refact(X). { A.value = X<<8; A.mask = 0x00ff00; }
+refarg(A) ::= ON INSERT refact(X). { A.value = X<<16; A.mask = 0xff0000; }
+%type refact {int}
+refact(A) ::= SET NULL. { A = OE_SetNull; }
+refact(A) ::= SET DEFAULT. { A = OE_SetDflt; }
+refact(A) ::= CASCADE. { A = OE_Cascade; }
+refact(A) ::= RESTRICT. { A = OE_Restrict; }
+%type defer_subclause {int}
+defer_subclause(A) ::= NOT DEFERRABLE init_deferred_pred_opt(X). {A = X;}
+defer_subclause(A) ::= DEFERRABLE init_deferred_pred_opt(X). {A = X;}
+%type init_deferred_pred_opt {int}
+init_deferred_pred_opt(A) ::= . {A = 0;}
+init_deferred_pred_opt(A) ::= INITIALLY DEFERRED. {A = 1;}
+init_deferred_pred_opt(A) ::= INITIALLY IMMEDIATE. {A = 0;}
+
+// For the time being, the only constraint we care about is the primary
+// key and UNIQUE. Both create indices.
+//
+conslist_opt(A) ::= . {A.n = 0; A.z = 0;}
+conslist_opt(A) ::= COMMA(X) conslist. {A = X;}
+conslist ::= conslist COMMA tcons.
+conslist ::= conslist tcons.
+conslist ::= tcons.
+tcons ::= CONSTRAINT nm.
+tcons ::= PRIMARY KEY LP idxlist(X) autoinc(I) RP onconf(R).
+ {sqlite3AddPrimaryKey(pParse,X,R,I);}
+tcons ::= UNIQUE LP idxlist(X) RP onconf(R).
+ {sqlite3CreateIndex(pParse,0,0,0,X,R,0,0);}
+tcons ::= CHECK expr onconf.
+tcons ::= FOREIGN KEY LP idxlist(FA) RP
+ REFERENCES nm(T) idxlist_opt(TA) refargs(R) defer_subclause_opt(D). {
+ sqlite3CreateForeignKey(pParse, FA, &T, TA, R);
+ sqlite3DeferForeignKey(pParse, D);
+}
+%type defer_subclause_opt {int}
+defer_subclause_opt(A) ::= . {A = 0;}
+defer_subclause_opt(A) ::= defer_subclause(X). {A = X;}
+
+// The following is a non-standard extension that allows us to declare the
+// default behavior when there is a constraint conflict.
+//
+%type onconf {int}
+%type orconf {int}
+%type resolvetype {int}
+onconf(A) ::= . {A = OE_Default;}
+onconf(A) ::= ON CONFLICT resolvetype(X). {A = X;}
+orconf(A) ::= . {A = OE_Default;}
+orconf(A) ::= OR resolvetype(X). {A = X;}
+resolvetype(A) ::= raisetype(X). {A = X;}
+resolvetype(A) ::= IGNORE. {A = OE_Ignore;}
+resolvetype(A) ::= REPLACE. {A = OE_Replace;}
+
+////////////////////////// The DROP TABLE /////////////////////////////////////
+//
+cmd ::= DROP TABLE fullname(X). {
+ sqlite3DropTable(pParse, X, 0);
+}
+
+///////////////////// The CREATE VIEW statement /////////////////////////////
+//
+%ifndef SQLITE_OMIT_VIEW
+cmd ::= CREATE(X) temp(T) VIEW nm(Y) dbnm(Z) AS select(S). {
+ sqlite3CreateView(pParse, &X, &Y, &Z, S, T);
+}
+cmd ::= DROP VIEW fullname(X). {
+ sqlite3DropTable(pParse, X, 1);
+}
+%endif // SQLITE_OMIT_VIEW
+
+//////////////////////// The SELECT statement /////////////////////////////////
+//
+cmd ::= select(X). {
+ sqlite3Select(pParse, X, SRT_Callback, 0, 0, 0, 0, 0);
+ sqlite3SelectDelete(X);
+}
+
+%type select {Select*}
+%destructor select {sqlite3SelectDelete($$);}
+%type oneselect {Select*}
+%destructor oneselect {sqlite3SelectDelete($$);}
+
+select(A) ::= oneselect(X). {A = X;}
+%ifndef SQLITE_OMIT_COMPOUND_SELECT
+select(A) ::= select(X) multiselect_op(Y) oneselect(Z). {
+ if( Z ){
+ Z->op = Y;
+ Z->pPrior = X;
+ }
+ A = Z;
+}
+%type multiselect_op {int}
+multiselect_op(A) ::= UNION(OP). {A = @OP;}
+multiselect_op(A) ::= UNION ALL. {A = TK_ALL;}
+multiselect_op(A) ::= INTERSECT(OP). {A = @OP;}
+multiselect_op(A) ::= EXCEPT(OP). {A = @OP;}
+%endif // SQLITE_OMIT_COMPOUND_SELECT
+oneselect(A) ::= SELECT distinct(D) selcollist(W) from(X) where_opt(Y)
+ groupby_opt(P) having_opt(Q) orderby_opt(Z) limit_opt(L). {
+ A = sqlite3SelectNew(W,X,Y,P,Q,Z,D,L.pLimit,L.pOffset);
+}
+
+// The "distinct" nonterminal is true (1) if the DISTINCT keyword is
+// present and false (0) if it is not.
+//
+%type distinct {int}
+distinct(A) ::= DISTINCT. {A = 1;}
+distinct(A) ::= ALL. {A = 0;}
+distinct(A) ::= . {A = 0;}
+
+// selcollist is a list of expressions that are to become the return
+// values of the SELECT statement. The "*" in statements like
+// "SELECT * FROM ..." is encoded as a special expression with an
+// opcode of TK_ALL.
+//
+%type selcollist {ExprList*}
+%destructor selcollist {sqlite3ExprListDelete($$);}
+%type sclp {ExprList*}
+%destructor sclp {sqlite3ExprListDelete($$);}
+sclp(A) ::= selcollist(X) COMMA. {A = X;}
+sclp(A) ::= . {A = 0;}
+selcollist(A) ::= sclp(P) expr(X) as(Y). {
+ A = sqlite3ExprListAppend(P,X,Y.n?&Y:0);
+}
+selcollist(A) ::= sclp(P) STAR. {
+ A = sqlite3ExprListAppend(P, sqlite3Expr(TK_ALL, 0, 0, 0), 0);
+}
+selcollist(A) ::= sclp(P) nm(X) DOT STAR. {
+ Expr *pRight = sqlite3Expr(TK_ALL, 0, 0, 0);
+ Expr *pLeft = sqlite3Expr(TK_ID, 0, 0, &X);
+ A = sqlite3ExprListAppend(P, sqlite3Expr(TK_DOT, pLeft, pRight, 0), 0);
+}
+
+// An option "AS <id>" phrase that can follow one of the expressions that
+// define the result set, or one of the tables in the FROM clause.
+//
+%type as {Token}
+as(X) ::= AS nm(Y). {X = Y;}
+as(X) ::= ids(Y). {X = Y;}
+as(X) ::= . {X.n = 0;}
+
+
+%type seltablist {SrcList*}
+%destructor seltablist {sqlite3SrcListDelete($$);}
+%type stl_prefix {SrcList*}
+%destructor stl_prefix {sqlite3SrcListDelete($$);}
+%type from {SrcList*}
+%destructor from {sqlite3SrcListDelete($$);}
+
+// A complete FROM clause.
+//
+from(A) ::= . {A = sqliteMalloc(sizeof(*A));}
+from(A) ::= FROM seltablist(X). {A = X;}
+
+// "seltablist" is a "Select Table List" - the content of the FROM clause
+// in a SELECT statement. "stl_prefix" is a prefix of this list.
+//
+stl_prefix(A) ::= seltablist(X) joinop(Y). {
+ A = X;
+ if( A && A->nSrc>0 ) A->a[A->nSrc-1].jointype = Y;
+}
+stl_prefix(A) ::= . {A = 0;}
+seltablist(A) ::= stl_prefix(X) nm(Y) dbnm(D) as(Z) on_opt(N) using_opt(U). {
+ A = sqlite3SrcListAppend(X,&Y,&D);
+ if( Z.n ) sqlite3SrcListAddAlias(A,&Z);
+ if( N ){
+ if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pOn = N; }
+ else { sqlite3ExprDelete(N); }
+ }
+ if( U ){
+ if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pUsing = U; }
+ else { sqlite3IdListDelete(U); }
+ }
+}
+%ifndef SQLITE_OMIT_SUBQUERY
+ seltablist(A) ::= stl_prefix(X) LP seltablist_paren(S) RP
+ as(Z) on_opt(N) using_opt(U). {
+ A = sqlite3SrcListAppend(X,0,0);
+ A->a[A->nSrc-1].pSelect = S;
+ if( Z.n ) sqlite3SrcListAddAlias(A,&Z);
+ if( N ){
+ if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pOn = N; }
+ else { sqlite3ExprDelete(N); }
+ }
+ if( U ){
+ if( A && A->nSrc>1 ){ A->a[A->nSrc-2].pUsing = U; }
+ else { sqlite3IdListDelete(U); }
+ }
+ }
+
+ // A seltablist_paren nonterminal represents anything in a FROM that
+ // is contained inside parentheses. This can be either a subquery or
+ // a grouping of table and subqueries.
+ //
+ %type seltablist_paren {Select*}
+ %destructor seltablist_paren {sqlite3SelectDelete($$);}
+ seltablist_paren(A) ::= select(S). {A = S;}
+ seltablist_paren(A) ::= seltablist(F). {
+ A = sqlite3SelectNew(0,F,0,0,0,0,0,0,0);
+ }
+%endif // SQLITE_OMIT_SUBQUERY
+
+%type dbnm {Token}
+dbnm(A) ::= . {A.z=0; A.n=0;}
+dbnm(A) ::= DOT nm(X). {A = X;}
+
+%type fullname {SrcList*}
+%destructor fullname {sqlite3SrcListDelete($$);}
+fullname(A) ::= nm(X) dbnm(Y). {A = sqlite3SrcListAppend(0,&X,&Y);}
+
+%type joinop {int}
+%type joinop2 {int}
+joinop(X) ::= COMMA. { X = JT_INNER; }
+joinop(X) ::= JOIN. { X = JT_INNER; }
+joinop(X) ::= JOIN_KW(A) JOIN. { X = sqlite3JoinType(pParse,&A,0,0); }
+joinop(X) ::= JOIN_KW(A) nm(B) JOIN. { X = sqlite3JoinType(pParse,&A,&B,0); }
+joinop(X) ::= JOIN_KW(A) nm(B) nm(C) JOIN.
+ { X = sqlite3JoinType(pParse,&A,&B,&C); }
+
+%type on_opt {Expr*}
+%destructor on_opt {sqlite3ExprDelete($$);}
+on_opt(N) ::= ON expr(E). {N = E;}
+on_opt(N) ::= . {N = 0;}
+
+%type using_opt {IdList*}
+%destructor using_opt {sqlite3IdListDelete($$);}
+using_opt(U) ::= USING LP inscollist(L) RP. {U = L;}
+using_opt(U) ::= . {U = 0;}
+
+
+%type orderby_opt {ExprList*}
+%destructor orderby_opt {sqlite3ExprListDelete($$);}
+%type sortlist {ExprList*}
+%destructor sortlist {sqlite3ExprListDelete($$);}
+%type sortitem {Expr*}
+%destructor sortitem {sqlite3ExprDelete($$);}
+
+orderby_opt(A) ::= . {A = 0;}
+orderby_opt(A) ::= ORDER BY sortlist(X). {A = X;}
+sortlist(A) ::= sortlist(X) COMMA sortitem(Y) collate(C) sortorder(Z). {
+ A = sqlite3ExprListAppend(X,Y,C.n>0?&C:0);
+ if( A ) A->a[A->nExpr-1].sortOrder = Z;
+}
+sortlist(A) ::= sortitem(Y) collate(C) sortorder(Z). {
+ A = sqlite3ExprListAppend(0,Y,C.n>0?&C:0);
+ if( A && A->a ) A->a[0].sortOrder = Z;
+}
+sortitem(A) ::= expr(X). {A = X;}
+
+%type sortorder {int}
+%type collate {Token}
+
+sortorder(A) ::= ASC. {A = SQLITE_SO_ASC;}
+sortorder(A) ::= DESC. {A = SQLITE_SO_DESC;}
+sortorder(A) ::= . {A = SQLITE_SO_ASC;}
+collate(C) ::= . {C.z = 0; C.n = 0;}
+collate(C) ::= COLLATE id(X). {C = X;}
+
+%type groupby_opt {ExprList*}
+%destructor groupby_opt {sqlite3ExprListDelete($$);}
+groupby_opt(A) ::= . {A = 0;}
+groupby_opt(A) ::= GROUP BY exprlist(X). {A = X;}
+
+%type having_opt {Expr*}
+%destructor having_opt {sqlite3ExprDelete($$);}
+having_opt(A) ::= . {A = 0;}
+having_opt(A) ::= HAVING expr(X). {A = X;}
+
+%type limit_opt {struct LimitVal}
+%destructor limit_opt {
+ sqlite3ExprDelete($$.pLimit);
+ sqlite3ExprDelete($$.pOffset);
+}
+limit_opt(A) ::= . {A.pLimit = 0; A.pOffset = 0;}
+limit_opt(A) ::= LIMIT expr(X). {A.pLimit = X; A.pOffset = 0;}
+limit_opt(A) ::= LIMIT expr(X) OFFSET expr(Y).
+ {A.pLimit = X; A.pOffset = Y;}
+limit_opt(A) ::= LIMIT expr(X) COMMA expr(Y).
+ {A.pOffset = X; A.pLimit = Y;}
+
+/////////////////////////// The DELETE statement /////////////////////////////
+//
+cmd ::= DELETE FROM fullname(X) where_opt(Y). {sqlite3DeleteFrom(pParse,X,Y);}
+
+%type where_opt {Expr*}
+%destructor where_opt {sqlite3ExprDelete($$);}
+
+where_opt(A) ::= . {A = 0;}
+where_opt(A) ::= WHERE expr(X). {A = X;}
+
+////////////////////////// The UPDATE command ////////////////////////////////
+//
+cmd ::= UPDATE orconf(R) fullname(X) SET setlist(Y) where_opt(Z).
+ {sqlite3Update(pParse,X,Y,Z,R);}
+
+%type setlist {ExprList*}
+%destructor setlist {sqlite3ExprListDelete($$);}
+
+setlist(A) ::= setlist(Z) COMMA nm(X) EQ expr(Y).
+ {A = sqlite3ExprListAppend(Z,Y,&X);}
+setlist(A) ::= nm(X) EQ expr(Y). {A = sqlite3ExprListAppend(0,Y,&X);}
+
+////////////////////////// The INSERT command /////////////////////////////////
+//
+cmd ::= insert_cmd(R) INTO fullname(X) inscollist_opt(F)
+ VALUES LP itemlist(Y) RP.
+ {sqlite3Insert(pParse, X, Y, 0, F, R);}
+cmd ::= insert_cmd(R) INTO fullname(X) inscollist_opt(F) select(S).
+ {sqlite3Insert(pParse, X, 0, S, F, R);}
+
+%type insert_cmd {int}
+insert_cmd(A) ::= INSERT orconf(R). {A = R;}
+insert_cmd(A) ::= REPLACE. {A = OE_Replace;}
+
+
+%type itemlist {ExprList*}
+%destructor itemlist {sqlite3ExprListDelete($$);}
+
+itemlist(A) ::= itemlist(X) COMMA expr(Y). {A = sqlite3ExprListAppend(X,Y,0);}
+itemlist(A) ::= expr(X). {A = sqlite3ExprListAppend(0,X,0);}
+
+%type inscollist_opt {IdList*}
+%destructor inscollist_opt {sqlite3IdListDelete($$);}
+%type inscollist {IdList*}
+%destructor inscollist {sqlite3IdListDelete($$);}
+
+inscollist_opt(A) ::= . {A = 0;}
+inscollist_opt(A) ::= LP inscollist(X) RP. {A = X;}
+inscollist(A) ::= inscollist(X) COMMA nm(Y). {A = sqlite3IdListAppend(X,&Y);}
+inscollist(A) ::= nm(Y). {A = sqlite3IdListAppend(0,&Y);}
+
+/////////////////////////// Expression Processing /////////////////////////////
+//
+
+%type expr {Expr*}
+%destructor expr {sqlite3ExprDelete($$);}
+%type term {Expr*}
+%destructor term {sqlite3ExprDelete($$);}
+
+expr(A) ::= term(X). {A = X;}
+expr(A) ::= LP(B) expr(X) RP(E). {A = X; sqlite3ExprSpan(A,&B,&E); }
+term(A) ::= NULL(X). {A = sqlite3Expr(@X, 0, 0, &X);}
+expr(A) ::= ID(X). {A = sqlite3Expr(TK_ID, 0, 0, &X);}
+expr(A) ::= JOIN_KW(X). {A = sqlite3Expr(TK_ID, 0, 0, &X);}
+expr(A) ::= nm(X) DOT nm(Y). {
+ Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &X);
+ Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &Y);
+ A = sqlite3Expr(TK_DOT, temp1, temp2, 0);
+}
+expr(A) ::= nm(X) DOT nm(Y) DOT nm(Z). {
+ Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &X);
+ Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &Y);
+ Expr *temp3 = sqlite3Expr(TK_ID, 0, 0, &Z);
+ Expr *temp4 = sqlite3Expr(TK_DOT, temp2, temp3, 0);
+ A = sqlite3Expr(TK_DOT, temp1, temp4, 0);
+}
+term(A) ::= INTEGER(X). {A = sqlite3Expr(@X, 0, 0, &X);}
+term(A) ::= FLOAT(X). {A = sqlite3Expr(@X, 0, 0, &X);}
+term(A) ::= STRING(X). {A = sqlite3Expr(@X, 0, 0, &X);}
+term(A) ::= BLOB(X). {A = sqlite3Expr(@X, 0, 0, &X);}
+expr(A) ::= REGISTER(X). {A = sqlite3RegisterExpr(pParse, &X);}
+expr(A) ::= VARIABLE(X). {
+ Token *pToken = &X;
+ Expr *pExpr = A = sqlite3Expr(TK_VARIABLE, 0, 0, pToken);
+ sqlite3ExprAssignVarNumber(pParse, pExpr);
+}
+%ifndef SQLITE_OMIT_CAST
+expr(A) ::= CAST(X) LP expr(E) AS typetoken(T) RP(Y). {
+ A = sqlite3Expr(TK_CAST, E, 0, &T);
+ sqlite3ExprSpan(A,&X,&Y);
+}
+%endif // SQLITE_OMIT_CAST
+expr(A) ::= ID(X) LP distinct(D) exprlist(Y) RP(E). {
+ A = sqlite3ExprFunction(Y, &X);
+ sqlite3ExprSpan(A,&X,&E);
+ if( D ){
+ A->flags |= EP_Distinct;
+ }
+}
+expr(A) ::= ID(X) LP STAR RP(E). {
+ A = sqlite3ExprFunction(0, &X);
+ sqlite3ExprSpan(A,&X,&E);
+}
+term(A) ::= CTIME_KW(OP). {
+ /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
+ ** treated as functions that return constants */
+ A = sqlite3ExprFunction(0,&OP);
+ if( A ) A->op = TK_CONST_FUNC;
+}
+expr(A) ::= expr(X) AND(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) OR(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) LT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) GT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) LE(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) GE(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) NE(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) EQ(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) BITAND(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) BITOR(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) LSHIFT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) RSHIFT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) PLUS(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) MINUS(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) STAR(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) SLASH(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) REM(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) CONCAT(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+%type likeop {struct LikeOp}
+likeop(A) ::= LIKE_KW(X). {A.operator = X; A.not = 0;}
+likeop(A) ::= NOT LIKE_KW(X). {A.operator = X; A.not = 1;}
+%type escape {Expr*}
+escape(X) ::= ESCAPE expr(A). [ESCAPE] {X = A;}
+escape(X) ::= . [ESCAPE] {X = 0;}
+expr(A) ::= expr(X) likeop(OP) expr(Y) escape(E). [LIKE_KW] {
+ ExprList *pList = sqlite3ExprListAppend(0, Y, 0);
+ pList = sqlite3ExprListAppend(pList, X, 0);
+ if( E ){
+ pList = sqlite3ExprListAppend(pList, E, 0);
+ }
+ A = sqlite3ExprFunction(pList, &OP.operator);
+ if( OP.not ) A = sqlite3Expr(TK_NOT, A, 0, 0);
+ sqlite3ExprSpan(A, &X->span, &Y->span);
+}
+
+expr(A) ::= expr(X) ISNULL(E). {
+ A = sqlite3Expr(TK_ISNULL, X, 0, 0);
+ sqlite3ExprSpan(A,&X->span,&E);
+}
+expr(A) ::= expr(X) IS NULL(E). {
+ A = sqlite3Expr(TK_ISNULL, X, 0, 0);
+ sqlite3ExprSpan(A,&X->span,&E);
+}
+expr(A) ::= expr(X) NOTNULL(E). {
+ A = sqlite3Expr(TK_NOTNULL, X, 0, 0);
+ sqlite3ExprSpan(A,&X->span,&E);
+}
+expr(A) ::= expr(X) NOT NULL(E). {
+ A = sqlite3Expr(TK_NOTNULL, X, 0, 0);
+ sqlite3ExprSpan(A,&X->span,&E);
+}
+expr(A) ::= expr(X) IS NOT NULL(E). {
+ A = sqlite3Expr(TK_NOTNULL, X, 0, 0);
+ sqlite3ExprSpan(A,&X->span,&E);
+}
+expr(A) ::= NOT(B) expr(X). {
+ A = sqlite3Expr(@B, X, 0, 0);
+ sqlite3ExprSpan(A,&B,&X->span);
+}
+expr(A) ::= BITNOT(B) expr(X). {
+ A = sqlite3Expr(@B, X, 0, 0);
+ sqlite3ExprSpan(A,&B,&X->span);
+}
+expr(A) ::= MINUS(B) expr(X). [UMINUS] {
+ A = sqlite3Expr(TK_UMINUS, X, 0, 0);
+ sqlite3ExprSpan(A,&B,&X->span);
+}
+expr(A) ::= PLUS(B) expr(X). [UPLUS] {
+ A = sqlite3Expr(TK_UPLUS, X, 0, 0);
+ sqlite3ExprSpan(A,&B,&X->span);
+}
+%type between_op {int}
+between_op(A) ::= BETWEEN. {A = 0;}
+between_op(A) ::= NOT BETWEEN. {A = 1;}
+expr(A) ::= expr(W) between_op(N) expr(X) AND expr(Y). [BETWEEN] {
+ ExprList *pList = sqlite3ExprListAppend(0, X, 0);
+ pList = sqlite3ExprListAppend(pList, Y, 0);
+ A = sqlite3Expr(TK_BETWEEN, W, 0, 0);
+ if( A ){
+ A->pList = pList;
+ }else{
+ sqlite3ExprListDelete(pList);
+ }
+ if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0);
+ sqlite3ExprSpan(A,&W->span,&Y->span);
+}
+%ifndef SQLITE_OMIT_SUBQUERY
+ %type in_op {int}
+ in_op(A) ::= IN. {A = 0;}
+ in_op(A) ::= NOT IN. {A = 1;}
+ expr(A) ::= expr(X) in_op(N) LP exprlist(Y) RP(E). [IN] {
+ A = sqlite3Expr(TK_IN, X, 0, 0);
+ if( A ){
+ A->pList = Y;
+ }else{
+ sqlite3ExprListDelete(Y);
+ }
+ if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0);
+ sqlite3ExprSpan(A,&X->span,&E);
+ }
+ expr(A) ::= LP(B) select(X) RP(E). {
+ A = sqlite3Expr(TK_SELECT, 0, 0, 0);
+ if( A ){
+ A->pSelect = X;
+ }else{
+ sqlite3SelectDelete(X);
+ }
+ sqlite3ExprSpan(A,&B,&E);
+ }
+ expr(A) ::= expr(X) in_op(N) LP select(Y) RP(E). [IN] {
+ A = sqlite3Expr(TK_IN, X, 0, 0);
+ if( A ){
+ A->pSelect = Y;
+ }else{
+ sqlite3SelectDelete(Y);
+ }
+ if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0);
+ sqlite3ExprSpan(A,&X->span,&E);
+ }
+ expr(A) ::= expr(X) in_op(N) nm(Y) dbnm(Z). [IN] {
+ SrcList *pSrc = sqlite3SrcListAppend(0,&Y,&Z);
+ A = sqlite3Expr(TK_IN, X, 0, 0);
+ if( A ){
+ A->pSelect = sqlite3SelectNew(0,pSrc,0,0,0,0,0,0,0);
+ }else{
+ sqlite3SrcListDelete(pSrc);
+ }
+ if( N ) A = sqlite3Expr(TK_NOT, A, 0, 0);
+ sqlite3ExprSpan(A,&X->span,Z.z?&Z:&Y);
+ }
+ expr(A) ::= EXISTS(B) LP select(Y) RP(E). {
+ Expr *p = A = sqlite3Expr(TK_EXISTS, 0, 0, 0);
+ if( p ){
+ p->pSelect = Y;
+ sqlite3ExprSpan(p,&B,&E);
+ }else{
+ sqlite3SelectDelete(Y);
+ }
+ }
+%endif // SQLITE_OMIT_SUBQUERY
+
+/* CASE expressions */
+expr(A) ::= CASE(C) case_operand(X) case_exprlist(Y) case_else(Z) END(E). {
+ A = sqlite3Expr(TK_CASE, X, Z, 0);
+ if( A ){
+ A->pList = Y;
+ }else{
+ sqlite3ExprListDelete(Y);
+ }
+ sqlite3ExprSpan(A, &C, &E);
+}
+%type case_exprlist {ExprList*}
+%destructor case_exprlist {sqlite3ExprListDelete($$);}
+case_exprlist(A) ::= case_exprlist(X) WHEN expr(Y) THEN expr(Z). {
+ A = sqlite3ExprListAppend(X, Y, 0);
+ A = sqlite3ExprListAppend(A, Z, 0);
+}
+case_exprlist(A) ::= WHEN expr(Y) THEN expr(Z). {
+ A = sqlite3ExprListAppend(0, Y, 0);
+ A = sqlite3ExprListAppend(A, Z, 0);
+}
+%type case_else {Expr*}
+case_else(A) ::= ELSE expr(X). {A = X;}
+case_else(A) ::= . {A = 0;}
+%type case_operand {Expr*}
+case_operand(A) ::= expr(X). {A = X;}
+case_operand(A) ::= . {A = 0;}
+
+%type exprlist {ExprList*}
+%destructor exprlist {sqlite3ExprListDelete($$);}
+%type expritem {Expr*}
+%destructor expritem {sqlite3ExprDelete($$);}
+
+exprlist(A) ::= exprlist(X) COMMA expritem(Y).
+ {A = sqlite3ExprListAppend(X,Y,0);}
+exprlist(A) ::= expritem(X). {A = sqlite3ExprListAppend(0,X,0);}
+expritem(A) ::= expr(X). {A = X;}
+expritem(A) ::= . {A = 0;}
+
+///////////////////////////// The CREATE INDEX command ///////////////////////
+//
+cmd ::= CREATE(S) uniqueflag(U) INDEX nm(X) dbnm(D)
+ ON nm(Y) LP idxlist(Z) RP(E) onconf(R). {
+ if( U!=OE_None ) U = R;
+ if( U==OE_Default) U = OE_Abort;
+ sqlite3CreateIndex(pParse, &X, &D, sqlite3SrcListAppend(0,&Y,0),Z,U, &S, &E);
+}
+
+%type uniqueflag {int}
+uniqueflag(A) ::= UNIQUE. {A = OE_Abort;}
+uniqueflag(A) ::= . {A = OE_None;}
+
+%type idxlist {ExprList*}
+%destructor idxlist {sqlite3ExprListDelete($$);}
+%type idxlist_opt {ExprList*}
+%destructor idxlist_opt {sqlite3ExprListDelete($$);}
+%type idxitem {Token}
+
+idxlist_opt(A) ::= . {A = 0;}
+idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;}
+idxlist(A) ::= idxlist(X) COMMA idxitem(Y) collate(C) sortorder. {
+ Expr *p = 0;
+ if( C.n>0 ){
+ p = sqlite3Expr(TK_COLUMN, 0, 0, 0);
+ if( p ) p->pColl = sqlite3LocateCollSeq(pParse, C.z, C.n);
+ }
+ A = sqlite3ExprListAppend(X, p, &Y);
+}
+idxlist(A) ::= idxitem(Y) collate(C) sortorder. {
+ Expr *p = 0;
+ if( C.n>0 ){
+ p = sqlite3Expr(TK_COLUMN, 0, 0, 0);
+ if( p ) p->pColl = sqlite3LocateCollSeq(pParse, C.z, C.n);
+ }
+ A = sqlite3ExprListAppend(0, p, &Y);
+}
+idxitem(A) ::= nm(X). {A = X;}
+
+
+///////////////////////////// The DROP INDEX command /////////////////////////
+//
+cmd ::= DROP INDEX fullname(X). {sqlite3DropIndex(pParse, X);}
+
+///////////////////////////// The VACUUM command /////////////////////////////
+//
+cmd ::= VACUUM. {sqlite3Vacuum(pParse,0);}
+cmd ::= VACUUM nm. {sqlite3Vacuum(pParse,0);}
+
+///////////////////////////// The PRAGMA command /////////////////////////////
+//
+%ifndef SQLITE_OMIT_PRAGMA
+cmd ::= PRAGMA nm(X) dbnm(Z) EQ nm(Y). {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
+cmd ::= PRAGMA nm(X) dbnm(Z) EQ ON(Y). {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
+cmd ::= PRAGMA nm(X) dbnm(Z) EQ plus_num(Y). {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
+cmd ::= PRAGMA nm(X) dbnm(Z) EQ minus_num(Y). {
+ sqlite3Pragma(pParse,&X,&Z,&Y,1);
+}
+cmd ::= PRAGMA nm(X) dbnm(Z) LP nm(Y) RP. {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
+cmd ::= PRAGMA nm(X) dbnm(Z). {sqlite3Pragma(pParse,&X,&Z,0,0);}
+%endif // SQLITE_OMIT_PRAGMA
+plus_num(A) ::= plus_opt number(X). {A = X;}
+minus_num(A) ::= MINUS number(X). {A = X;}
+number(A) ::= INTEGER(X). {A = X;}
+number(A) ::= FLOAT(X). {A = X;}
+plus_opt ::= PLUS.
+plus_opt ::= .
+
+//////////////////////////// The CREATE TRIGGER command /////////////////////
+
+%ifndef SQLITE_OMIT_TRIGGER
+
+cmd ::= CREATE trigger_decl(A) BEGIN trigger_cmd_list(S) END(Z). {
+ Token all;
+ all.z = A.z;
+ all.n = (Z.z - A.z) + Z.n;
+ sqlite3FinishTrigger(pParse, S, &all);
+}
+
+trigger_decl(A) ::= temp(T) TRIGGER nm(B) dbnm(Z) trigger_time(C)
+ trigger_event(D)
+ ON fullname(E) foreach_clause(F) when_clause(G). {
+ sqlite3BeginTrigger(pParse, &B, &Z, C, D.a, D.b, E, F, G, T);
+ A = (Z.n==0?B:Z);
+}
+
+%type trigger_time {int}
+trigger_time(A) ::= BEFORE. { A = TK_BEFORE; }
+trigger_time(A) ::= AFTER. { A = TK_AFTER; }
+trigger_time(A) ::= INSTEAD OF. { A = TK_INSTEAD;}
+trigger_time(A) ::= . { A = TK_BEFORE; }
+
+%type trigger_event {struct TrigEvent}
+%destructor trigger_event {sqlite3IdListDelete($$.b);}
+trigger_event(A) ::= DELETE(OP). {A.a = @OP; A.b = 0;}
+trigger_event(A) ::= INSERT(OP). {A.a = @OP; A.b = 0;}
+trigger_event(A) ::= UPDATE(OP). {A.a = @OP; A.b = 0;}
+trigger_event(A) ::= UPDATE OF inscollist(X). {A.a = TK_UPDATE; A.b = X;}
+
+%type foreach_clause {int}
+foreach_clause(A) ::= . { A = TK_ROW; }
+foreach_clause(A) ::= FOR EACH ROW. { A = TK_ROW; }
+foreach_clause(A) ::= FOR EACH STATEMENT. { A = TK_STATEMENT; }
+
+%type when_clause {Expr*}
+when_clause(A) ::= . { A = 0; }
+when_clause(A) ::= WHEN expr(X). { A = X; }
+
+%type trigger_cmd_list {TriggerStep*}
+%destructor trigger_cmd_list {sqlite3DeleteTriggerStep($$);}
+trigger_cmd_list(A) ::= trigger_cmd(X) SEMI trigger_cmd_list(Y). {
+ X->pNext = Y;
+ A = X;
+}
+trigger_cmd_list(A) ::= . { A = 0; }
+
+%type trigger_cmd {TriggerStep*}
+%destructor trigger_cmd {sqlite3DeleteTriggerStep($$);}
+// UPDATE
+trigger_cmd(A) ::= UPDATE orconf(R) nm(X) SET setlist(Y) where_opt(Z).
+ { A = sqlite3TriggerUpdateStep(&X, Y, Z, R); }
+
+// INSERT
+trigger_cmd(A) ::= insert_cmd(R) INTO nm(X) inscollist_opt(F)
+ VALUES LP itemlist(Y) RP.
+ {A = sqlite3TriggerInsertStep(&X, F, Y, 0, R);}
+
+trigger_cmd(A) ::= insert_cmd(R) INTO nm(X) inscollist_opt(F) select(S).
+ {A = sqlite3TriggerInsertStep(&X, F, 0, S, R);}
+
+// DELETE
+trigger_cmd(A) ::= DELETE FROM nm(X) where_opt(Y).
+ {A = sqlite3TriggerDeleteStep(&X, Y);}
+
+// SELECT
+trigger_cmd(A) ::= select(X). {A = sqlite3TriggerSelectStep(X); }
+
+// The special RAISE expression that may occur in trigger programs
+expr(A) ::= RAISE(X) LP IGNORE RP(Y). {
+ A = sqlite3Expr(TK_RAISE, 0, 0, 0);
+ A->iColumn = OE_Ignore;
+ sqlite3ExprSpan(A, &X, &Y);
+}
+expr(A) ::= RAISE(X) LP raisetype(T) COMMA nm(Z) RP(Y). {
+ A = sqlite3Expr(TK_RAISE, 0, 0, &Z);
+ A->iColumn = T;
+ sqlite3ExprSpan(A, &X, &Y);
+}
+%endif // !SQLITE_OMIT_TRIGGER
+
+%type raisetype {int}
+raisetype(A) ::= ROLLBACK. {A = OE_Rollback;}
+raisetype(A) ::= ABORT. {A = OE_Abort;}
+raisetype(A) ::= FAIL. {A = OE_Fail;}
+
+
+//////////////////////// DROP TRIGGER statement //////////////////////////////
+%ifndef SQLITE_OMIT_TRIGGER
+cmd ::= DROP TRIGGER fullname(X). {
+ sqlite3DropTrigger(pParse,X);
+}
+%endif // !SQLITE_OMIT_TRIGGER
+
+//////////////////////// ATTACH DATABASE file AS name /////////////////////////
+cmd ::= ATTACH database_kw_opt ids(F) AS nm(D) key_opt(K). {
+ sqlite3Attach(pParse, &F, &D, K.type, &K.key);
+}
+%type key_opt {struct AttachKey}
+key_opt(A) ::= . { A.type = 0; }
+key_opt(A) ::= KEY ids(X). { A.type=1; A.key = X; }
+key_opt(A) ::= KEY BLOB(X). { A.type=2; A.key = X; }
+
+database_kw_opt ::= DATABASE.
+database_kw_opt ::= .
+
+//////////////////////// DETACH DATABASE name /////////////////////////////////
+cmd ::= DETACH database_kw_opt nm(D). {
+ sqlite3Detach(pParse, &D);
+}
+
+////////////////////////// REINDEX collation //////////////////////////////////
+%ifndef SQLITE_OMIT_REINDEX
+cmd ::= REINDEX. {sqlite3Reindex(pParse, 0, 0);}
+cmd ::= REINDEX nm(X) dbnm(Y). {sqlite3Reindex(pParse, &X, &Y);}
+%endif
+
+/////////////////////////////////// ANALYZE ///////////////////////////////////
+%ifndef SQLITE_OMIT_ANALYZE
+cmd ::= ANALYZE. {sqlite3Analyze(pParse, 0, 0);}
+cmd ::= ANALYZE nm(X) dbnm(Y). {sqlite3Analyze(pParse, &X, &Y);}
+%endif
+
+//////////////////////// ALTER TABLE table ... ////////////////////////////////
+%ifndef SQLITE_OMIT_ALTERTABLE
+cmd ::= ALTER TABLE fullname(X) RENAME TO nm(Z). {
+ sqlite3AlterRenameTable(pParse,X,&Z);
+}
+cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column(Y). {
+ sqlite3AlterFinishAddColumn(pParse, &Y);
+}
+add_column_fullname ::= fullname(X). {
+ sqlite3AlterBeginAddColumn(pParse, X);
+}
+kwcolumn_opt ::= .
+kwcolumn_opt ::= COLUMNKW.
+%endif
diff --git a/ext/pdo_sqlite/sqlite/src/pragma.c b/ext/pdo_sqlite/sqlite/src/pragma.c
new file mode 100644
index 000000000..e366401d2
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/pragma.c
@@ -0,0 +1,935 @@
+/*
+** 2003 April 6
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains code used to implement the PRAGMA command.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#include <ctype.h>
+
+/* Ignore this whole file if pragmas are disabled
+*/
+#if !defined(SQLITE_OMIT_PRAGMA) && !defined(SQLITE_OMIT_PARSER)
+
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
+# include "pager.h"
+# include "btree.h"
+#endif
+
+/*
+** Interpret the given string as a safety level. Return 0 for OFF,
+** 1 for ON or NORMAL and 2 for FULL. Return 1 for an empty or
+** unrecognized string argument.
+**
+** Note that the values returned are one less that the values that
+** should be passed into sqlite3BtreeSetSafetyLevel(). The is done
+** to support legacy SQL code. The safety level used to be boolean
+** and older scripts may have used numbers 0 for OFF and 1 for ON.
+*/
+static int getSafetyLevel(const u8 *z){
+ /* 123456789 123456789 */
+ static const char zText[] = "onoffalseyestruefull";
+ static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16};
+ static const u8 iLength[] = {2, 2, 3, 5, 3, 4, 4};
+ static const u8 iValue[] = {1, 0, 0, 0, 1, 1, 2};
+ int i, n;
+ if( isdigit(*z) ){
+ return atoi(z);
+ }
+ n = strlen(z);
+ for(i=0; i<sizeof(iLength); i++){
+ if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 ){
+ return iValue[i];
+ }
+ }
+ return 1;
+}
+
+/*
+** Interpret the given string as a boolean value.
+*/
+static int getBoolean(const u8 *z){
+ return getSafetyLevel(z)&1;
+}
+
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+/*
+** Interpret the given string as a temp db location. Return 1 for file
+** backed temporary databases, 2 for the Red-Black tree in memory database
+** and 0 to use the compile-time default.
+*/
+static int getTempStore(const char *z){
+ if( z[0]>='0' && z[0]<='2' ){
+ return z[0] - '0';
+ }else if( sqlite3StrICmp(z, "file")==0 ){
+ return 1;
+ }else if( sqlite3StrICmp(z, "memory")==0 ){
+ return 2;
+ }else{
+ return 0;
+ }
+}
+#endif /* SQLITE_PAGER_PRAGMAS */
+
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+/*
+** Invalidate temp storage, either when the temp storage is changed
+** from default, or when 'file' and the temp_store_directory has changed
+*/
+static int invalidateTempStorage(Parse *pParse){
+ sqlite3 *db = pParse->db;
+ if( db->aDb[1].pBt!=0 ){
+ if( db->flags & SQLITE_InTrans ){
+ sqlite3ErrorMsg(pParse, "temporary storage cannot be changed "
+ "from within a transaction");
+ return SQLITE_ERROR;
+ }
+ sqlite3BtreeClose(db->aDb[1].pBt);
+ db->aDb[1].pBt = 0;
+ sqlite3ResetInternalSchema(db, 0);
+ }
+ return SQLITE_OK;
+}
+#endif /* SQLITE_PAGER_PRAGMAS */
+
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+/*
+** If the TEMP database is open, close it and mark the database schema
+** as needing reloading. This must be done when using the TEMP_STORE
+** or DEFAULT_TEMP_STORE pragmas.
+*/
+static int changeTempStorage(Parse *pParse, const char *zStorageType){
+ int ts = getTempStore(zStorageType);
+ sqlite3 *db = pParse->db;
+ if( db->temp_store==ts ) return SQLITE_OK;
+ if( invalidateTempStorage( pParse ) != SQLITE_OK ){
+ return SQLITE_ERROR;
+ }
+ db->temp_store = ts;
+ return SQLITE_OK;
+}
+#endif /* SQLITE_PAGER_PRAGMAS */
+
+/*
+** Generate code to return a single integer value.
+*/
+static void returnSingleInt(Parse *pParse, const char *zLabel, int value){
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ sqlite3VdbeAddOp(v, OP_Integer, value, 0);
+ if( pParse->explain==0 ){
+ sqlite3VdbeSetNumCols(v, 1);
+ sqlite3VdbeSetColName(v, 0, zLabel, P3_STATIC);
+ }
+ sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
+}
+
+#ifndef SQLITE_OMIT_FLAG_PRAGMAS
+/*
+** Check to see if zRight and zLeft refer to a pragma that queries
+** or changes one of the flags in db->flags. Return 1 if so and 0 if not.
+** Also, implement the pragma.
+*/
+static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
+ static const struct sPragmaType {
+ const char *zName; /* Name of the pragma */
+ int mask; /* Mask for the db->flags value */
+ } aPragma[] = {
+ { "vdbe_trace", SQLITE_VdbeTrace },
+ { "sql_trace", SQLITE_SqlTrace },
+ { "vdbe_listing", SQLITE_VdbeListing },
+ { "full_column_names", SQLITE_FullColNames },
+ { "short_column_names", SQLITE_ShortColNames },
+ { "count_changes", SQLITE_CountRows },
+ { "empty_result_callbacks", SQLITE_NullCallback },
+ /* The following is VERY experimental */
+ { "writable_schema", SQLITE_WriteSchema },
+ { "omit_readlock", SQLITE_NoReadlock },
+ };
+ int i;
+ const struct sPragmaType *p;
+ for(i=0, p=aPragma; i<sizeof(aPragma)/sizeof(aPragma[0]); i++, p++){
+ if( sqlite3StrICmp(zLeft, p->zName)==0 ){
+ sqlite3 *db = pParse->db;
+ Vdbe *v;
+ v = sqlite3GetVdbe(pParse);
+ if( v ){
+ if( zRight==0 ){
+ returnSingleInt(pParse, p->zName, (db->flags & p->mask)!=0 );
+ }else{
+ if( getBoolean(zRight) ){
+ db->flags |= p->mask;
+ }else{
+ db->flags &= ~p->mask;
+ }
+ }
+ /* If one of these pragmas is executed, any prepared statements
+ ** need to be recompiled.
+ */
+ sqlite3VdbeAddOp(v, OP_Expire, 0, 0);
+ }
+ return 1;
+ }
+ }
+ return 0;
+}
+#endif /* SQLITE_OMIT_FLAG_PRAGMAS */
+
+/*
+** Process a pragma statement.
+**
+** Pragmas are of this form:
+**
+** PRAGMA [database.]id [= value]
+**
+** The identifier might also be a string. The value is a string, and
+** identifier, or a number. If minusFlag is true, then the value is
+** a number that was preceded by a minus sign.
+**
+** If the left side is "database.id" then pId1 is the database name
+** and pId2 is the id. If the left side is just "id" then pId1 is the
+** id and pId2 is any empty string.
+*/
+void sqlite3Pragma(
+ Parse *pParse,
+ Token *pId1, /* First part of [database.]id field */
+ Token *pId2, /* Second part of [database.]id field, or NULL */
+ Token *pValue, /* Token for <value>, or NULL */
+ int minusFlag /* True if a '-' sign preceded <value> */
+){
+ char *zLeft = 0; /* Nul-terminated UTF-8 string <id> */
+ char *zRight = 0; /* Nul-terminated UTF-8 string <value>, or NULL */
+ const char *zDb = 0; /* The database name */
+ Token *pId; /* Pointer to <id> token */
+ int iDb; /* Database index for <database> */
+ sqlite3 *db = pParse->db;
+ Db *pDb;
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ if( v==0 ) return;
+
+ /* Interpret the [database.] part of the pragma statement. iDb is the
+ ** index of the database this pragma is being applied to in db.aDb[]. */
+ iDb = sqlite3TwoPartName(pParse, pId1, pId2, &pId);
+ if( iDb<0 ) return;
+ pDb = &db->aDb[iDb];
+
+ zLeft = sqlite3NameFromToken(pId);
+ if( !zLeft ) return;
+ if( minusFlag ){
+ zRight = sqlite3MPrintf("-%T", pValue);
+ }else{
+ zRight = sqlite3NameFromToken(pValue);
+ }
+
+ zDb = ((iDb>0)?pDb->zName:0);
+ if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){
+ goto pragma_out;
+ }
+
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+ /*
+ ** PRAGMA [database.]default_cache_size
+ ** PRAGMA [database.]default_cache_size=N
+ **
+ ** The first form reports the current persistent setting for the
+ ** page cache size. The value returned is the maximum number of
+ ** pages in the page cache. The second form sets both the current
+ ** page cache size value and the persistent page cache size value
+ ** stored in the database file.
+ **
+ ** The default cache size is stored in meta-value 2 of page 1 of the
+ ** database file. The cache size is actually the absolute value of
+ ** this memory location. The sign of meta-value 2 determines the
+ ** synchronous setting. A negative value means synchronous is off
+ ** and a positive value means synchronous is on.
+ */
+ if( sqlite3StrICmp(zLeft,"default_cache_size")==0 ){
+ static const VdbeOpList getCacheSize[] = {
+ { OP_ReadCookie, 0, 2, 0}, /* 0 */
+ { OP_AbsValue, 0, 0, 0},
+ { OP_Dup, 0, 0, 0},
+ { OP_Integer, 0, 0, 0},
+ { OP_Ne, 0, 6, 0},
+ { OP_Integer, 0, 0, 0}, /* 5 */
+ { OP_Callback, 1, 0, 0},
+ };
+ int addr;
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ if( !zRight ){
+ sqlite3VdbeSetNumCols(v, 1);
+ sqlite3VdbeSetColName(v, 0, "cache_size", P3_STATIC);
+ addr = sqlite3VdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize);
+ sqlite3VdbeChangeP1(v, addr, iDb);
+ sqlite3VdbeChangeP1(v, addr+5, MAX_PAGES);
+ }else{
+ int size = atoi(zRight);
+ if( size<0 ) size = -size;
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+ sqlite3VdbeAddOp(v, OP_Integer, size, 0);
+ sqlite3VdbeAddOp(v, OP_ReadCookie, iDb, 2);
+ addr = sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Ge, 0, addr+3);
+ sqlite3VdbeAddOp(v, OP_Negative, 0, 0);
+ sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 2);
+ pDb->cache_size = size;
+ sqlite3BtreeSetCacheSize(pDb->pBt, pDb->cache_size);
+ }
+ }else
+
+ /*
+ ** PRAGMA [database.]page_size
+ ** PRAGMA [database.]page_size=N
+ **
+ ** The first form reports the current setting for the
+ ** database page size in bytes. The second form sets the
+ ** database page size value. The value can only be set if
+ ** the database has not yet been created.
+ */
+ if( sqlite3StrICmp(zLeft,"page_size")==0 ){
+ Btree *pBt = pDb->pBt;
+ if( !zRight ){
+ int size = pBt ? sqlite3BtreeGetPageSize(pBt) : 0;
+ returnSingleInt(pParse, "page_size", size);
+ }else{
+ sqlite3BtreeSetPageSize(pBt, atoi(zRight), -1);
+ }
+ }else
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
+
+ /*
+ ** PRAGMA [database.]auto_vacuum
+ ** PRAGMA [database.]auto_vacuum=N
+ **
+ ** Get or set the (boolean) value of the database 'auto-vacuum' parameter.
+ */
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ if( sqlite3StrICmp(zLeft,"auto_vacuum")==0 ){
+ Btree *pBt = pDb->pBt;
+ if( !zRight ){
+ int auto_vacuum =
+ pBt ? sqlite3BtreeGetAutoVacuum(pBt) : SQLITE_DEFAULT_AUTOVACUUM;
+ returnSingleInt(pParse, "auto_vacuum", auto_vacuum);
+ }else{
+ sqlite3BtreeSetAutoVacuum(pBt, getBoolean(zRight));
+ }
+ }else
+#endif
+
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+ /*
+ ** PRAGMA [database.]cache_size
+ ** PRAGMA [database.]cache_size=N
+ **
+ ** The first form reports the current local setting for the
+ ** page cache size. The local setting can be different from
+ ** the persistent cache size value that is stored in the database
+ ** file itself. The value returned is the maximum number of
+ ** pages in the page cache. The second form sets the local
+ ** page cache size value. It does not change the persistent
+ ** cache size stored on the disk so the cache size will revert
+ ** to its default value when the database is closed and reopened.
+ ** N should be a positive integer.
+ */
+ if( sqlite3StrICmp(zLeft,"cache_size")==0 ){
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ if( !zRight ){
+ returnSingleInt(pParse, "cache_size", pDb->cache_size);
+ }else{
+ int size = atoi(zRight);
+ if( size<0 ) size = -size;
+ pDb->cache_size = size;
+ sqlite3BtreeSetCacheSize(pDb->pBt, pDb->cache_size);
+ }
+ }else
+
+ /*
+ ** PRAGMA temp_store
+ ** PRAGMA temp_store = "default"|"memory"|"file"
+ **
+ ** Return or set the local value of the temp_store flag. Changing
+ ** the local value does not make changes to the disk file and the default
+ ** value will be restored the next time the database is opened.
+ **
+ ** Note that it is possible for the library compile-time options to
+ ** override this setting
+ */
+ if( sqlite3StrICmp(zLeft, "temp_store")==0 ){
+ if( !zRight ){
+ returnSingleInt(pParse, "temp_store", db->temp_store);
+ }else{
+ changeTempStorage(pParse, zRight);
+ }
+ }else
+
+ /*
+ ** PRAGMA temp_store_directory
+ ** PRAGMA temp_store_directory = ""|"directory_name"
+ **
+ ** Return or set the local value of the temp_store_directory flag. Changing
+ ** the value sets a specific directory to be used for temporary files.
+ ** Setting to a null string reverts to the default temporary directory search.
+ ** If temporary directory is changed, then invalidateTempStorage.
+ **
+ */
+ if( sqlite3StrICmp(zLeft, "temp_store_directory")==0 ){
+ if( !zRight ){
+ if( sqlite3_temp_directory ){
+ sqlite3VdbeSetNumCols(v, 1);
+ sqlite3VdbeSetColName(v, 0, "temp_store_directory", P3_STATIC);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, sqlite3_temp_directory, 0);
+ sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
+ }
+ }else{
+ if( zRight[0] && !sqlite3OsIsDirWritable(zRight) ){
+ sqlite3ErrorMsg(pParse, "not a writable directory");
+ goto pragma_out;
+ }
+ if( TEMP_STORE==0
+ || (TEMP_STORE==1 && db->temp_store<=1)
+ || (TEMP_STORE==2 && db->temp_store==1)
+ ){
+ invalidateTempStorage(pParse);
+ }
+ sqliteFree(sqlite3_temp_directory);
+ if( zRight[0] ){
+ sqlite3_temp_directory = zRight;
+ zRight = 0;
+ }else{
+ sqlite3_temp_directory = 0;
+ }
+ }
+ }else
+
+ /*
+ ** PRAGMA [database.]synchronous
+ ** PRAGMA [database.]synchronous=OFF|ON|NORMAL|FULL
+ **
+ ** Return or set the local value of the synchronous flag. Changing
+ ** the local value does not make changes to the disk file and the
+ ** default value will be restored the next time the database is
+ ** opened.
+ */
+ if( sqlite3StrICmp(zLeft,"synchronous")==0 ){
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ if( !zRight ){
+ returnSingleInt(pParse, "synchronous", pDb->safety_level-1);
+ }else{
+ if( !db->autoCommit ){
+ sqlite3ErrorMsg(pParse,
+ "Safety level may not be changed inside a transaction");
+ }else{
+ pDb->safety_level = getSafetyLevel(zRight)+1;
+ sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level);
+ }
+ }
+ }else
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
+
+#ifndef SQLITE_OMIT_FLAG_PRAGMAS
+ if( flagPragma(pParse, zLeft, zRight) ){
+ /* The flagPragma() subroutine also generates any necessary code
+ ** there is nothing more to do here */
+ }else
+#endif /* SQLITE_OMIT_FLAG_PRAGMAS */
+
+#ifndef SQLITE_OMIT_SCHEMA_PRAGMAS
+ /*
+ ** PRAGMA table_info(<table>)
+ **
+ ** Return a single row for each column of the named table. The columns of
+ ** the returned data set are:
+ **
+ ** cid: Column id (numbered from left to right, starting at 0)
+ ** name: Column name
+ ** type: Column declaration type.
+ ** notnull: True if 'NOT NULL' is part of column declaration
+ ** dflt_value: The default value for the column, if any.
+ */
+ if( sqlite3StrICmp(zLeft, "table_info")==0 && zRight ){
+ Table *pTab;
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ pTab = sqlite3FindTable(db, zRight, zDb);
+ if( pTab ){
+ int i;
+ sqlite3VdbeSetNumCols(v, 6);
+ sqlite3VdbeSetColName(v, 0, "cid", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, "name", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, "type", P3_STATIC);
+ sqlite3VdbeSetColName(v, 3, "notnull", P3_STATIC);
+ sqlite3VdbeSetColName(v, 4, "dflt_value", P3_STATIC);
+ sqlite3VdbeSetColName(v, 5, "pk", P3_STATIC);
+ sqlite3ViewGetColumnNames(pParse, pTab);
+ for(i=0; i<pTab->nCol; i++){
+ sqlite3VdbeAddOp(v, OP_Integer, i, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[i].zName, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0,
+ pTab->aCol[i].zType ? pTab->aCol[i].zType : "numeric", 0);
+ sqlite3VdbeAddOp(v, OP_Integer, pTab->aCol[i].notNull, 0);
+ sqlite3ExprCode(pParse, pTab->aCol[i].pDflt);
+ sqlite3VdbeAddOp(v, OP_Integer, pTab->aCol[i].isPrimKey, 0);
+ sqlite3VdbeAddOp(v, OP_Callback, 6, 0);
+ }
+ }
+ }else
+
+ if( sqlite3StrICmp(zLeft, "index_info")==0 && zRight ){
+ Index *pIdx;
+ Table *pTab;
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ pIdx = sqlite3FindIndex(db, zRight, zDb);
+ if( pIdx ){
+ int i;
+ pTab = pIdx->pTable;
+ sqlite3VdbeSetNumCols(v, 3);
+ sqlite3VdbeSetColName(v, 0, "seqno", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, "cid", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, "name", P3_STATIC);
+ for(i=0; i<pIdx->nColumn; i++){
+ int cnum = pIdx->aiColumn[i];
+ sqlite3VdbeAddOp(v, OP_Integer, i, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, cnum, 0);
+ assert( pTab->nCol>cnum );
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[cnum].zName, 0);
+ sqlite3VdbeAddOp(v, OP_Callback, 3, 0);
+ }
+ }
+ }else
+
+ if( sqlite3StrICmp(zLeft, "index_list")==0 && zRight ){
+ Index *pIdx;
+ Table *pTab;
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ pTab = sqlite3FindTable(db, zRight, zDb);
+ if( pTab ){
+ v = sqlite3GetVdbe(pParse);
+ pIdx = pTab->pIndex;
+ if( pIdx ){
+ int i = 0;
+ sqlite3VdbeSetNumCols(v, 3);
+ sqlite3VdbeSetColName(v, 0, "seq", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, "name", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, "unique", P3_STATIC);
+ while(pIdx){
+ sqlite3VdbeAddOp(v, OP_Integer, i, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pIdx->zName, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, pIdx->onError!=OE_None, 0);
+ sqlite3VdbeAddOp(v, OP_Callback, 3, 0);
+ ++i;
+ pIdx = pIdx->pNext;
+ }
+ }
+ }
+ }else
+
+ if( sqlite3StrICmp(zLeft, "database_list")==0 ){
+ int i;
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ sqlite3VdbeSetNumCols(v, 3);
+ sqlite3VdbeSetColName(v, 0, "seq", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, "name", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, "file", P3_STATIC);
+ for(i=0; i<db->nDb; i++){
+ if( db->aDb[i].pBt==0 ) continue;
+ assert( db->aDb[i].zName!=0 );
+ sqlite3VdbeAddOp(v, OP_Integer, i, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, db->aDb[i].zName, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0,
+ sqlite3BtreeGetFilename(db->aDb[i].pBt), 0);
+ sqlite3VdbeAddOp(v, OP_Callback, 3, 0);
+ }
+ }else
+
+ if( sqlite3StrICmp(zLeft, "collation_list")==0 ){
+ int i = 0;
+ HashElem *p;
+ sqlite3VdbeSetNumCols(v, 2);
+ sqlite3VdbeSetColName(v, 0, "seq", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, "name", P3_STATIC);
+ for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){
+ CollSeq *pColl = (CollSeq *)sqliteHashData(p);
+ sqlite3VdbeAddOp(v, OP_Integer, i++, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pColl->zName, 0);
+ sqlite3VdbeAddOp(v, OP_Callback, 2, 0);
+ }
+ }else
+#endif /* SQLITE_OMIT_SCHEMA_PRAGMAS */
+
+#ifndef SQLITE_OMIT_FOREIGN_KEY
+ if( sqlite3StrICmp(zLeft, "foreign_key_list")==0 && zRight ){
+ FKey *pFK;
+ Table *pTab;
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ pTab = sqlite3FindTable(db, zRight, zDb);
+ if( pTab ){
+ v = sqlite3GetVdbe(pParse);
+ pFK = pTab->pFKey;
+ if( pFK ){
+ int i = 0;
+ sqlite3VdbeSetNumCols(v, 5);
+ sqlite3VdbeSetColName(v, 0, "id", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, "seq", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, "table", P3_STATIC);
+ sqlite3VdbeSetColName(v, 3, "from", P3_STATIC);
+ sqlite3VdbeSetColName(v, 4, "to", P3_STATIC);
+ while(pFK){
+ int j;
+ for(j=0; j<pFK->nCol; j++){
+ char *zCol = pFK->aCol[j].zCol;
+ sqlite3VdbeAddOp(v, OP_Integer, i, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, j, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pFK->zTo, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0,
+ pTab->aCol[pFK->aCol[j].iFrom].zName, 0);
+ sqlite3VdbeOp3(v, zCol ? OP_String8 : OP_Null, 0, 0, zCol, 0);
+ sqlite3VdbeAddOp(v, OP_Callback, 5, 0);
+ }
+ ++i;
+ pFK = pFK->pNextFrom;
+ }
+ }
+ }
+ }else
+#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
+
+#ifndef NDEBUG
+ if( sqlite3StrICmp(zLeft, "parser_trace")==0 ){
+ extern void sqlite3ParserTrace(FILE*, char *);
+ if( zRight ){
+ if( getBoolean(zRight) ){
+ sqlite3ParserTrace(stderr, "parser: ");
+ }else{
+ sqlite3ParserTrace(0, 0);
+ }
+ }
+ }else
+#endif
+
+ /* Reinstall the LIKE and GLOB functions. The variant of LIKE
+ ** used will be case sensitive or not depending on the RHS.
+ */
+ if( sqlite3StrICmp(zLeft, "case_sensitive_like")==0 ){
+ if( zRight ){
+ sqlite3RegisterLikeFunctions(db, getBoolean(zRight));
+ }
+ }else
+
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
+ if( sqlite3StrICmp(zLeft, "integrity_check")==0 ){
+ int i, j, addr;
+
+ /* Code that appears at the end of the integrity check. If no error
+ ** messages have been generated, output OK. Otherwise output the
+ ** error message
+ */
+ static const VdbeOpList endCode[] = {
+ { OP_MemLoad, 0, 0, 0},
+ { OP_Integer, 0, 0, 0},
+ { OP_Ne, 0, 0, 0}, /* 2 */
+ { OP_String8, 0, 0, "ok"},
+ { OP_Callback, 1, 0, 0},
+ };
+
+ /* Initialize the VDBE program */
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ sqlite3VdbeSetNumCols(v, 1);
+ sqlite3VdbeSetColName(v, 0, "integrity_check", P3_STATIC);
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, 0); /* Initialize error count to 0 */
+
+ /* Do an integrity check on each database file */
+ for(i=0; i<db->nDb; i++){
+ HashElem *x;
+ int cnt = 0;
+
+ if( OMIT_TEMPDB && i==1 ) continue;
+
+ sqlite3CodeVerifySchema(pParse, i);
+
+ /* Do an integrity check of the B-Tree
+ */
+ for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){
+ Table *pTab = sqliteHashData(x);
+ Index *pIdx;
+ sqlite3VdbeAddOp(v, OP_Integer, pTab->tnum, 0);
+ cnt++;
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ if( sqlite3CheckIndexCollSeq(pParse, pIdx) ) goto pragma_out;
+ sqlite3VdbeAddOp(v, OP_Integer, pIdx->tnum, 0);
+ cnt++;
+ }
+ }
+ assert( cnt>0 );
+ sqlite3VdbeAddOp(v, OP_IntegrityCk, cnt, i);
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 1);
+ addr = sqlite3VdbeOp3(v, OP_String8, 0, 0, "ok", P3_STATIC);
+ sqlite3VdbeAddOp(v, OP_Eq, 0, addr+6);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0,
+ sqlite3MPrintf("*** in database %s ***\n", db->aDb[i].zName),
+ P3_DYNAMIC);
+ sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Concat, 0, 1);
+ sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
+
+ /* Make sure all the indices are constructed correctly.
+ */
+ sqlite3CodeVerifySchema(pParse, i);
+ for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){
+ Table *pTab = sqliteHashData(x);
+ Index *pIdx;
+ int loopTop;
+
+ if( pTab->pIndex==0 ) continue;
+ sqlite3OpenTableAndIndices(pParse, pTab, 1, OP_OpenRead);
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, 1);
+ loopTop = sqlite3VdbeAddOp(v, OP_Rewind, 1, 0);
+ sqlite3VdbeAddOp(v, OP_MemIncr, 1, 0);
+ for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
+ int jmp2;
+ static const VdbeOpList idxErr[] = {
+ { OP_MemIncr, 0, 0, 0},
+ { OP_String8, 0, 0, "rowid "},
+ { OP_Rowid, 1, 0, 0},
+ { OP_String8, 0, 0, " missing from index "},
+ { OP_String8, 0, 0, 0}, /* 4 */
+ { OP_Concat, 2, 0, 0},
+ { OP_Callback, 1, 0, 0},
+ };
+ sqlite3GenerateIndexKey(v, pIdx, 1);
+ jmp2 = sqlite3VdbeAddOp(v, OP_Found, j+2, 0);
+ addr = sqlite3VdbeAddOpList(v, ArraySize(idxErr), idxErr);
+ sqlite3VdbeChangeP3(v, addr+4, pIdx->zName, P3_STATIC);
+ sqlite3VdbeJumpHere(v, jmp2);
+ }
+ sqlite3VdbeAddOp(v, OP_Next, 1, loopTop+1);
+ sqlite3VdbeJumpHere(v, loopTop);
+ for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
+ static const VdbeOpList cntIdx[] = {
+ { OP_MemInt, 0, 2, 0},
+ { OP_Rewind, 0, 0, 0}, /* 1 */
+ { OP_MemIncr, 2, 0, 0},
+ { OP_Next, 0, 0, 0}, /* 3 */
+ { OP_MemLoad, 1, 0, 0},
+ { OP_MemLoad, 2, 0, 0},
+ { OP_Eq, 0, 0, 0}, /* 6 */
+ { OP_MemIncr, 0, 0, 0},
+ { OP_String8, 0, 0, "wrong # of entries in index "},
+ { OP_String8, 0, 0, 0}, /* 9 */
+ { OP_Concat, 0, 0, 0},
+ { OP_Callback, 1, 0, 0},
+ };
+ if( pIdx->tnum==0 ) continue;
+ addr = sqlite3VdbeAddOpList(v, ArraySize(cntIdx), cntIdx);
+ sqlite3VdbeChangeP1(v, addr+1, j+2);
+ sqlite3VdbeChangeP2(v, addr+1, addr+4);
+ sqlite3VdbeChangeP1(v, addr+3, j+2);
+ sqlite3VdbeChangeP2(v, addr+3, addr+2);
+ sqlite3VdbeJumpHere(v, addr+6);
+ sqlite3VdbeChangeP3(v, addr+9, pIdx->zName, P3_STATIC);
+ }
+ }
+ }
+ addr = sqlite3VdbeAddOpList(v, ArraySize(endCode), endCode);
+ sqlite3VdbeJumpHere(v, addr+2);
+ }else
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
+
+#ifndef SQLITE_OMIT_UTF16
+ /*
+ ** PRAGMA encoding
+ ** PRAGMA encoding = "utf-8"|"utf-16"|"utf-16le"|"utf-16be"
+ **
+ ** In it's first form, this pragma returns the encoding of the main
+ ** database. If the database is not initialized, it is initialized now.
+ **
+ ** The second form of this pragma is a no-op if the main database file
+ ** has not already been initialized. In this case it sets the default
+ ** encoding that will be used for the main database file if a new file
+ ** is created. If an existing main database file is opened, then the
+ ** default text encoding for the existing database is used.
+ **
+ ** In all cases new databases created using the ATTACH command are
+ ** created to use the same default text encoding as the main database. If
+ ** the main database has not been initialized and/or created when ATTACH
+ ** is executed, this is done before the ATTACH operation.
+ **
+ ** In the second form this pragma sets the text encoding to be used in
+ ** new database files created using this database handle. It is only
+ ** useful if invoked immediately after the main database i
+ */
+ if( sqlite3StrICmp(zLeft, "encoding")==0 ){
+ static struct EncName {
+ char *zName;
+ u8 enc;
+ } encnames[] = {
+ { "UTF-8", SQLITE_UTF8 },
+ { "UTF8", SQLITE_UTF8 },
+ { "UTF-16le", SQLITE_UTF16LE },
+ { "UTF16le", SQLITE_UTF16LE },
+ { "UTF-16be", SQLITE_UTF16BE },
+ { "UTF16be", SQLITE_UTF16BE },
+ { "UTF-16", 0 /* Filled in at run-time */ },
+ { "UTF16", 0 /* Filled in at run-time */ },
+ { 0, 0 }
+ };
+ struct EncName *pEnc;
+ encnames[6].enc = encnames[7].enc = SQLITE_UTF16NATIVE;
+ if( !zRight ){ /* "PRAGMA encoding" */
+ if( sqlite3ReadSchema(pParse) ) goto pragma_out;
+ sqlite3VdbeSetNumCols(v, 1);
+ sqlite3VdbeSetColName(v, 0, "encoding", P3_STATIC);
+ sqlite3VdbeAddOp(v, OP_String8, 0, 0);
+ for(pEnc=&encnames[0]; pEnc->zName; pEnc++){
+ if( pEnc->enc==pParse->db->enc ){
+ sqlite3VdbeChangeP3(v, -1, pEnc->zName, P3_STATIC);
+ break;
+ }
+ }
+ sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
+ }else{ /* "PRAGMA encoding = XXX" */
+ /* Only change the value of sqlite.enc if the database handle is not
+ ** initialized. If the main database exists, the new sqlite.enc value
+ ** will be overwritten when the schema is next loaded. If it does not
+ ** already exists, it will be created to use the new encoding value.
+ */
+ if( !(pParse->db->flags&SQLITE_Initialized) ){
+ for(pEnc=&encnames[0]; pEnc->zName; pEnc++){
+ if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){
+ pParse->db->enc = pEnc->enc;
+ break;
+ }
+ }
+ if( !pEnc->zName ){
+ sqlite3ErrorMsg(pParse, "unsupported encoding: %s", zRight);
+ }
+ }
+ }
+ }else
+#endif /* SQLITE_OMIT_UTF16 */
+
+#ifndef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
+ /*
+ ** PRAGMA [database.]schema_version
+ ** PRAGMA [database.]schema_version = <integer>
+ **
+ ** PRAGMA [database.]user_version
+ ** PRAGMA [database.]user_version = <integer>
+ **
+ ** The pragma's schema_version and user_version are used to set or get
+ ** the value of the schema-version and user-version, respectively. Both
+ ** the schema-version and the user-version are 32-bit signed integers
+ ** stored in the database header.
+ **
+ ** The schema-cookie is usually only manipulated internally by SQLite. It
+ ** is incremented by SQLite whenever the database schema is modified (by
+ ** creating or dropping a table or index). The schema version is used by
+ ** SQLite each time a query is executed to ensure that the internal cache
+ ** of the schema used when compiling the SQL query matches the schema of
+ ** the database against which the compiled query is actually executed.
+ ** Subverting this mechanism by using "PRAGMA schema_version" to modify
+ ** the schema-version is potentially dangerous and may lead to program
+ ** crashes or database corruption. Use with caution!
+ **
+ ** The user-version is not used internally by SQLite. It may be used by
+ ** applications for any purpose.
+ */
+ if( sqlite3StrICmp(zLeft, "schema_version")==0 ||
+ sqlite3StrICmp(zLeft, "user_version")==0 ){
+
+ int iCookie; /* Cookie index. 0 for schema-cookie, 6 for user-cookie. */
+ if( zLeft[0]=='s' || zLeft[0]=='S' ){
+ iCookie = 0;
+ }else{
+ iCookie = 5;
+ }
+
+ if( zRight ){
+ /* Write the specified cookie value */
+ static const VdbeOpList setCookie[] = {
+ { OP_Transaction, 0, 1, 0}, /* 0 */
+ { OP_Integer, 0, 0, 0}, /* 1 */
+ { OP_SetCookie, 0, 0, 0}, /* 2 */
+ };
+ int addr = sqlite3VdbeAddOpList(v, ArraySize(setCookie), setCookie);
+ sqlite3VdbeChangeP1(v, addr, iDb);
+ sqlite3VdbeChangeP1(v, addr+1, atoi(zRight));
+ sqlite3VdbeChangeP1(v, addr+2, iDb);
+ sqlite3VdbeChangeP2(v, addr+2, iCookie);
+ }else{
+ /* Read the specified cookie value */
+ static const VdbeOpList readCookie[] = {
+ { OP_ReadCookie, 0, 0, 0}, /* 0 */
+ { OP_Callback, 1, 0, 0}
+ };
+ int addr = sqlite3VdbeAddOpList(v, ArraySize(readCookie), readCookie);
+ sqlite3VdbeChangeP1(v, addr, iDb);
+ sqlite3VdbeChangeP2(v, addr, iCookie);
+ sqlite3VdbeSetNumCols(v, 1);
+ }
+ }
+#endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */
+
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
+ /*
+ ** Report the current state of file logs for all databases
+ */
+ if( sqlite3StrICmp(zLeft, "lock_status")==0 ){
+ static const char *const azLockName[] = {
+ "unlocked", "shared", "reserved", "pending", "exclusive"
+ };
+ int i;
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ sqlite3VdbeSetNumCols(v, 2);
+ sqlite3VdbeSetColName(v, 0, "database", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, "status", P3_STATIC);
+ for(i=0; i<db->nDb; i++){
+ Btree *pBt;
+ Pager *pPager;
+ if( db->aDb[i].zName==0 ) continue;
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, db->aDb[i].zName, P3_STATIC);
+ pBt = db->aDb[i].pBt;
+ if( pBt==0 || (pPager = sqlite3BtreePager(pBt))==0 ){
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, "closed", P3_STATIC);
+ }else{
+ int j = sqlite3pager_lockstate(pPager);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0,
+ (j>=0 && j<=4) ? azLockName[j] : "unknown", P3_STATIC);
+ }
+ sqlite3VdbeAddOp(v, OP_Callback, 2, 0);
+ }
+ }else
+#endif
+
+#ifdef SQLITE_SSE
+ /*
+ ** Check to see if the sqlite_statements table exists. Create it
+ ** if it does not.
+ */
+ if( sqlite3StrICmp(zLeft, "create_sqlite_statement_table")==0 ){
+ extern int sqlite3CreateStatementsTable(Parse*);
+ sqlite3CreateStatementsTable(pParse);
+ }else
+#endif
+
+ {}
+
+ if( v ){
+ /* Code an OP_Expire at the end of each PRAGMA program to cause
+ ** the VDBE implementing the pragma to expire. Most (all?) pragmas
+ ** are only valid for a single execution.
+ */
+ sqlite3VdbeAddOp(v, OP_Expire, 1, 0);
+ }
+pragma_out:
+ sqliteFree(zLeft);
+ sqliteFree(zRight);
+}
+
+#endif /* SQLITE_OMIT_PRAGMA || SQLITE_OMIT_PARSER */
diff --git a/ext/pdo_sqlite/sqlite/src/prepare.c b/ext/pdo_sqlite/sqlite/src/prepare.c
new file mode 100644
index 000000000..c9266eb74
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/prepare.c
@@ -0,0 +1,540 @@
+/*
+** 2005 May 25
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains the implementation of the sqlite3_prepare()
+** interface, and routines that contribute to loading the database schema
+** from disk.
+**
+** $Id: prepare.c,v 1.1.2.2 2005/09/26 19:33:25 iliaa Exp $
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#include <ctype.h>
+
+/*
+** Fill the InitData structure with an error message that indicates
+** that the database is corrupt.
+*/
+static void corruptSchema(InitData *pData, const char *zExtra){
+ if( !sqlite3_malloc_failed ){
+ sqlite3SetString(pData->pzErrMsg, "malformed database schema",
+ zExtra!=0 && zExtra[0]!=0 ? " - " : (char*)0, zExtra, (char*)0);
+ }
+}
+
+/*
+** This is the callback routine for the code that initializes the
+** database. See sqlite3Init() below for additional information.
+** This routine is also called from the OP_ParseSchema opcode of the VDBE.
+**
+** Each callback contains the following information:
+**
+** argv[0] = name of thing being created
+** argv[1] = root page number for table or index. NULL for trigger or view.
+** argv[2] = SQL text for the CREATE statement.
+** argv[3] = "1" for temporary files, "0" for main database, "2" or more
+** for auxiliary database files.
+**
+*/
+int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){
+ InitData *pData = (InitData*)pInit;
+ sqlite3 *db = pData->db;
+ int iDb;
+
+ assert( argc==4 );
+ if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */
+ if( argv[1]==0 || argv[3]==0 ){
+ corruptSchema(pData, 0);
+ return 1;
+ }
+ iDb = atoi(argv[3]);
+ assert( iDb>=0 && iDb<db->nDb );
+ if( argv[2] && argv[2][0] ){
+ /* Call the parser to process a CREATE TABLE, INDEX or VIEW.
+ ** But because db->init.busy is set to 1, no VDBE code is generated
+ ** or executed. All the parser does is build the internal data
+ ** structures that describe the table, index, or view.
+ */
+ char *zErr;
+ int rc;
+ assert( db->init.busy );
+ db->init.iDb = iDb;
+ db->init.newTnum = atoi(argv[1]);
+ rc = sqlite3_exec(db, argv[2], 0, 0, &zErr);
+ db->init.iDb = 0;
+ if( SQLITE_OK!=rc ){
+ corruptSchema(pData, zErr);
+ sqlite3_free(zErr);
+ return rc;
+ }
+ }else{
+ /* If the SQL column is blank it means this is an index that
+ ** was created to be the PRIMARY KEY or to fulfill a UNIQUE
+ ** constraint for a CREATE TABLE. The index should have already
+ ** been created when we processed the CREATE TABLE. All we have
+ ** to do here is record the root page number for that index.
+ */
+ Index *pIndex;
+ pIndex = sqlite3FindIndex(db, argv[0], db->aDb[iDb].zName);
+ if( pIndex==0 || pIndex->tnum!=0 ){
+ /* This can occur if there exists an index on a TEMP table which
+ ** has the same name as another index on a permanent index. Since
+ ** the permanent table is hidden by the TEMP table, we can also
+ ** safely ignore the index on the permanent table.
+ */
+ /* Do Nothing */;
+ }else{
+ pIndex->tnum = atoi(argv[1]);
+ }
+ }
+ return 0;
+}
+
+/*
+** Attempt to read the database schema and initialize internal
+** data structures for a single database file. The index of the
+** database file is given by iDb. iDb==0 is used for the main
+** database. iDb==1 should never be used. iDb>=2 is used for
+** auxiliary databases. Return one of the SQLITE_ error codes to
+** indicate success or failure.
+*/
+static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
+ int rc;
+ BtCursor *curMain;
+ int size;
+ Table *pTab;
+ char const *azArg[5];
+ char zDbNum[30];
+ int meta[10];
+ InitData initData;
+ char const *zMasterSchema;
+ char const *zMasterName = SCHEMA_TABLE(iDb);
+
+ /*
+ ** The master database table has a structure like this
+ */
+ static const char master_schema[] =
+ "CREATE TABLE sqlite_master(\n"
+ " type text,\n"
+ " name text,\n"
+ " tbl_name text,\n"
+ " rootpage integer,\n"
+ " sql text\n"
+ ")"
+ ;
+#ifndef SQLITE_OMIT_TEMPDB
+ static const char temp_master_schema[] =
+ "CREATE TEMP TABLE sqlite_temp_master(\n"
+ " type text,\n"
+ " name text,\n"
+ " tbl_name text,\n"
+ " rootpage integer,\n"
+ " sql text\n"
+ ")"
+ ;
+#else
+ #define temp_master_schema 0
+#endif
+
+ assert( iDb>=0 && iDb<db->nDb );
+
+ /* zMasterSchema and zInitScript are set to point at the master schema
+ ** and initialisation script appropriate for the database being
+ ** initialised. zMasterName is the name of the master table.
+ */
+ if( !OMIT_TEMPDB && iDb==1 ){
+ zMasterSchema = temp_master_schema;
+ }else{
+ zMasterSchema = master_schema;
+ }
+ zMasterName = SCHEMA_TABLE(iDb);
+
+ /* Construct the schema tables. */
+ sqlite3SafetyOff(db);
+ azArg[0] = zMasterName;
+ azArg[1] = "1";
+ azArg[2] = zMasterSchema;
+ sprintf(zDbNum, "%d", iDb);
+ azArg[3] = zDbNum;
+ azArg[4] = 0;
+ initData.db = db;
+ initData.pzErrMsg = pzErrMsg;
+ rc = sqlite3InitCallback(&initData, 4, (char **)azArg, 0);
+ if( rc!=SQLITE_OK ){
+ sqlite3SafetyOn(db);
+ return rc;
+ }
+ pTab = sqlite3FindTable(db, zMasterName, db->aDb[iDb].zName);
+ if( pTab ){
+ pTab->readOnly = 1;
+ }
+ sqlite3SafetyOn(db);
+
+ /* Create a cursor to hold the database open
+ */
+ if( db->aDb[iDb].pBt==0 ){
+ if( !OMIT_TEMPDB && iDb==1 ) DbSetProperty(db, 1, DB_SchemaLoaded);
+ return SQLITE_OK;
+ }
+ rc = sqlite3BtreeCursor(db->aDb[iDb].pBt, MASTER_ROOT, 0, 0, 0, &curMain);
+ if( rc!=SQLITE_OK && rc!=SQLITE_EMPTY ){
+ sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0);
+ return rc;
+ }
+
+ /* Get the database meta information.
+ **
+ ** Meta values are as follows:
+ ** meta[0] Schema cookie. Changes with each schema change.
+ ** meta[1] File format of schema layer.
+ ** meta[2] Size of the page cache.
+ ** meta[3] Use freelist if 0. Autovacuum if greater than zero.
+ ** meta[4] Db text encoding. 1:UTF-8 3:UTF-16 LE 4:UTF-16 BE
+ ** meta[5] The user cookie. Used by the application.
+ ** meta[6]
+ ** meta[7]
+ ** meta[8]
+ ** meta[9]
+ **
+ ** Note: The hash defined SQLITE_UTF* symbols in sqliteInt.h correspond to
+ ** the possible values of meta[4].
+ */
+ if( rc==SQLITE_OK ){
+ int i;
+ for(i=0; rc==SQLITE_OK && i<sizeof(meta)/sizeof(meta[0]); i++){
+ rc = sqlite3BtreeGetMeta(db->aDb[iDb].pBt, i+1, (u32 *)&meta[i]);
+ }
+ if( rc ){
+ sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0);
+ sqlite3BtreeCloseCursor(curMain);
+ return rc;
+ }
+ }else{
+ memset(meta, 0, sizeof(meta));
+ }
+ db->aDb[iDb].schema_cookie = meta[0];
+
+ /* If opening a non-empty database, check the text encoding. For the
+ ** main database, set sqlite3.enc to the encoding of the main database.
+ ** For an attached db, it is an error if the encoding is not the same
+ ** as sqlite3.enc.
+ */
+ if( meta[4] ){ /* text encoding */
+ if( iDb==0 ){
+ /* If opening the main database, set db->enc. */
+ db->enc = (u8)meta[4];
+ db->pDfltColl = sqlite3FindCollSeq(db, db->enc, "BINARY", 6, 0);
+ }else{
+ /* If opening an attached database, the encoding much match db->enc */
+ if( meta[4]!=db->enc ){
+ sqlite3BtreeCloseCursor(curMain);
+ sqlite3SetString(pzErrMsg, "attached databases must use the same"
+ " text encoding as main database", (char*)0);
+ return SQLITE_ERROR;
+ }
+ }
+ }
+
+ size = meta[2];
+ if( size==0 ){ size = MAX_PAGES; }
+ db->aDb[iDb].cache_size = size;
+
+ if( iDb==0 ){
+ db->file_format = meta[1];
+ if( db->file_format==0 ){
+ /* This happens if the database was initially empty */
+ db->file_format = 1;
+ }
+
+ if( db->file_format==2 || db->file_format==3 ){
+ /* File format 2 is treated exactly as file format 1. New
+ ** databases are created with file format 1.
+ */
+ db->file_format = 1;
+ }
+ }
+
+ /*
+ ** file_format==1 Version 3.0.0.
+ ** file_format==2 Version 3.1.3.
+ ** file_format==3 Version 3.1.4.
+ **
+ ** Version 3.0 can only use files with file_format==1. Version 3.1.3
+ ** can read and write files with file_format==1 or file_format==2.
+ ** Version 3.1.4 can read and write file formats 1, 2 and 3.
+ */
+ if( meta[1]>3 ){
+ sqlite3BtreeCloseCursor(curMain);
+ sqlite3SetString(pzErrMsg, "unsupported file format", (char*)0);
+ return SQLITE_ERROR;
+ }
+
+ sqlite3BtreeSetCacheSize(db->aDb[iDb].pBt, db->aDb[iDb].cache_size);
+
+ /* Read the schema information out of the schema tables
+ */
+ assert( db->init.busy );
+ if( rc==SQLITE_EMPTY ){
+ /* For an empty database, there is nothing to read */
+ rc = SQLITE_OK;
+ }else{
+ char *zSql;
+ zSql = sqlite3MPrintf(
+ "SELECT name, rootpage, sql, '%s' FROM '%q'.%s",
+ zDbNum, db->aDb[iDb].zName, zMasterName);
+ sqlite3SafetyOff(db);
+ rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0);
+ sqlite3SafetyOn(db);
+ sqliteFree(zSql);
+#ifndef SQLITE_OMIT_ANALYZE
+ if( rc==SQLITE_OK ){
+ sqlite3AnalysisLoad(db, iDb);
+ }
+#endif
+ sqlite3BtreeCloseCursor(curMain);
+ }
+ if( sqlite3_malloc_failed ){
+ sqlite3SetString(pzErrMsg, "out of memory", (char*)0);
+ rc = SQLITE_NOMEM;
+ sqlite3ResetInternalSchema(db, 0);
+ }
+ if( rc==SQLITE_OK ){
+ DbSetProperty(db, iDb, DB_SchemaLoaded);
+ }else{
+ sqlite3ResetInternalSchema(db, iDb);
+ }
+ return rc;
+}
+
+/*
+** Initialize all database files - the main database file, the file
+** used to store temporary tables, and any additional database files
+** created using ATTACH statements. Return a success code. If an
+** error occurs, write an error message into *pzErrMsg.
+**
+** After the database is initialized, the SQLITE_Initialized
+** bit is set in the flags field of the sqlite structure.
+*/
+int sqlite3Init(sqlite3 *db, char **pzErrMsg){
+ int i, rc;
+
+ if( db->init.busy ) return SQLITE_OK;
+ assert( (db->flags & SQLITE_Initialized)==0 );
+ rc = SQLITE_OK;
+ db->init.busy = 1;
+ for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
+ if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue;
+ rc = sqlite3InitOne(db, i, pzErrMsg);
+ if( rc ){
+ sqlite3ResetInternalSchema(db, i);
+ }
+ }
+
+ /* Once all the other databases have been initialised, load the schema
+ ** for the TEMP database. This is loaded last, as the TEMP database
+ ** schema may contain references to objects in other databases.
+ */
+#ifndef SQLITE_OMIT_TEMPDB
+ if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){
+ rc = sqlite3InitOne(db, 1, pzErrMsg);
+ if( rc ){
+ sqlite3ResetInternalSchema(db, 1);
+ }
+ }
+#endif
+
+ db->init.busy = 0;
+ if( rc==SQLITE_OK ){
+ db->flags |= SQLITE_Initialized;
+ sqlite3CommitInternalChanges(db);
+ }
+
+ if( rc!=SQLITE_OK ){
+ db->flags &= ~SQLITE_Initialized;
+ }
+ return rc;
+}
+
+/*
+** This routine is a no-op if the database schema is already initialised.
+** Otherwise, the schema is loaded. An error code is returned.
+*/
+int sqlite3ReadSchema(Parse *pParse){
+ int rc = SQLITE_OK;
+ sqlite3 *db = pParse->db;
+ if( !db->init.busy ){
+ if( (db->flags & SQLITE_Initialized)==0 ){
+ rc = sqlite3Init(db, &pParse->zErrMsg);
+ }
+ }
+ assert( rc!=SQLITE_OK || (db->flags & SQLITE_Initialized) || db->init.busy );
+ if( rc!=SQLITE_OK ){
+ pParse->rc = rc;
+ pParse->nErr++;
+ }
+ return rc;
+}
+
+
+/*
+** Check schema cookies in all databases. If any cookie is out
+** of date, return 0. If all schema cookies are current, return 1.
+*/
+static int schemaIsValid(sqlite3 *db){
+ int iDb;
+ int rc;
+ BtCursor *curTemp;
+ int cookie;
+ int allOk = 1;
+
+ for(iDb=0; allOk && iDb<db->nDb; iDb++){
+ Btree *pBt;
+ pBt = db->aDb[iDb].pBt;
+ if( pBt==0 ) continue;
+ rc = sqlite3BtreeCursor(pBt, MASTER_ROOT, 0, 0, 0, &curTemp);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3BtreeGetMeta(pBt, 1, (u32 *)&cookie);
+ if( rc==SQLITE_OK && cookie!=db->aDb[iDb].schema_cookie ){
+ allOk = 0;
+ }
+ sqlite3BtreeCloseCursor(curTemp);
+ }
+ }
+ return allOk;
+}
+
+/*
+** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
+*/
+int sqlite3_prepare(
+ sqlite3 *db, /* Database handle. */
+ const char *zSql, /* UTF-8 encoded SQL statement. */
+ int nBytes, /* Length of zSql in bytes. */
+ sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
+ const char** pzTail /* OUT: End of parsed string */
+){
+ Parse sParse;
+ char *zErrMsg = 0;
+ int rc = SQLITE_OK;
+
+ if( sqlite3_malloc_failed ){
+ return SQLITE_NOMEM;
+ }
+
+ assert( ppStmt );
+ *ppStmt = 0;
+ if( sqlite3SafetyOn(db) ){
+ return SQLITE_MISUSE;
+ }
+
+ memset(&sParse, 0, sizeof(sParse));
+ sParse.db = db;
+ sqlite3RunParser(&sParse, zSql, &zErrMsg);
+
+ if( sqlite3_malloc_failed ){
+ rc = SQLITE_NOMEM;
+ sqlite3RollbackAll(db);
+ sqlite3ResetInternalSchema(db, 0);
+ db->flags &= ~SQLITE_InTrans;
+ goto prepare_out;
+ }
+ if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK;
+ if( sParse.rc!=SQLITE_OK && sParse.checkSchema && !schemaIsValid(db) ){
+ sParse.rc = SQLITE_SCHEMA;
+ }
+ if( sParse.rc==SQLITE_SCHEMA ){
+ sqlite3ResetInternalSchema(db, 0);
+ }
+ if( pzTail ) *pzTail = sParse.zTail;
+ rc = sParse.rc;
+
+#ifndef SQLITE_OMIT_EXPLAIN
+ if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){
+ if( sParse.explain==2 ){
+ sqlite3VdbeSetNumCols(sParse.pVdbe, 3);
+ sqlite3VdbeSetColName(sParse.pVdbe, 0, "order", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 1, "from", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 2, "detail", P3_STATIC);
+ }else{
+ sqlite3VdbeSetNumCols(sParse.pVdbe, 5);
+ sqlite3VdbeSetColName(sParse.pVdbe, 0, "addr", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 1, "opcode", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 2, "p1", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 3, "p2", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 4, "p3", P3_STATIC);
+ }
+ }
+#endif
+
+prepare_out:
+ if( sqlite3SafetyOff(db) ){
+ rc = SQLITE_MISUSE;
+ }
+ if( rc==SQLITE_OK ){
+ *ppStmt = (sqlite3_stmt*)sParse.pVdbe;
+ }else if( sParse.pVdbe ){
+ sqlite3_finalize((sqlite3_stmt*)sParse.pVdbe);
+ }
+
+ if( zErrMsg ){
+ sqlite3Error(db, rc, "%s", zErrMsg);
+ sqliteFree(zErrMsg);
+ }else{
+ sqlite3Error(db, rc, 0);
+ }
+ return rc;
+}
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** Compile the UTF-16 encoded SQL statement zSql into a statement handle.
+*/
+int sqlite3_prepare16(
+ sqlite3 *db, /* Database handle. */
+ const void *zSql, /* UTF-8 encoded SQL statement. */
+ int nBytes, /* Length of zSql in bytes. */
+ sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
+ const void **pzTail /* OUT: End of parsed string */
+){
+ /* This function currently works by first transforming the UTF-16
+ ** encoded string to UTF-8, then invoking sqlite3_prepare(). The
+ ** tricky bit is figuring out the pointer to return in *pzTail.
+ */
+ char const *zSql8 = 0;
+ char const *zTail8 = 0;
+ int rc;
+ sqlite3_value *pTmp;
+
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
+ pTmp = sqlite3GetTransientValue(db);
+ sqlite3ValueSetStr(pTmp, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
+ zSql8 = sqlite3ValueText(pTmp, SQLITE_UTF8);
+ if( !zSql8 ){
+ sqlite3Error(db, SQLITE_NOMEM, 0);
+ return SQLITE_NOMEM;
+ }
+ rc = sqlite3_prepare(db, zSql8, -1, ppStmt, &zTail8);
+
+ if( zTail8 && pzTail ){
+ /* If sqlite3_prepare returns a tail pointer, we calculate the
+ ** equivalent pointer into the UTF-16 string by counting the unicode
+ ** characters between zSql8 and zTail8, and then returning a pointer
+ ** the same number of characters into the UTF-16 string.
+ */
+ int chars_parsed = sqlite3utf8CharLen(zSql8, zTail8-zSql8);
+ *pzTail = (u8 *)zSql + sqlite3utf16ByteLen(zSql, chars_parsed);
+ }
+
+ return rc;
+}
+#endif /* SQLITE_OMIT_UTF16 */
diff --git a/ext/pdo_sqlite/sqlite/src/printf.c b/ext/pdo_sqlite/sqlite/src/printf.c
new file mode 100644
index 000000000..a669eb8d4
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/printf.c
@@ -0,0 +1,866 @@
+/*
+** The "printf" code that follows dates from the 1980's. It is in
+** the public domain. The original comments are included here for
+** completeness. They are very out-of-date but might be useful as
+** an historical reference. Most of the "enhancements" have been backed
+** out so that the functionality is now the same as standard printf().
+**
+**************************************************************************
+**
+** The following modules is an enhanced replacement for the "printf" subroutines
+** found in the standard C library. The following enhancements are
+** supported:
+**
+** + Additional functions. The standard set of "printf" functions
+** includes printf, fprintf, sprintf, vprintf, vfprintf, and
+** vsprintf. This module adds the following:
+**
+** * snprintf -- Works like sprintf, but has an extra argument
+** which is the size of the buffer written to.
+**
+** * mprintf -- Similar to sprintf. Writes output to memory
+** obtained from malloc.
+**
+** * xprintf -- Calls a function to dispose of output.
+**
+** * nprintf -- No output, but returns the number of characters
+** that would have been output by printf.
+**
+** * A v- version (ex: vsnprintf) of every function is also
+** supplied.
+**
+** + A few extensions to the formatting notation are supported:
+**
+** * The "=" flag (similar to "-") causes the output to be
+** be centered in the appropriately sized field.
+**
+** * The %b field outputs an integer in binary notation.
+**
+** * The %c field now accepts a precision. The character output
+** is repeated by the number of times the precision specifies.
+**
+** * The %' field works like %c, but takes as its character the
+** next character of the format string, instead of the next
+** argument. For example, printf("%.78'-") prints 78 minus
+** signs, the same as printf("%.78c",'-').
+**
+** + When compiled using GCC on a SPARC, this version of printf is
+** faster than the library printf for SUN OS 4.1.
+**
+** + All functions are fully reentrant.
+**
+*/
+#include "sqliteInt.h"
+
+/*
+** Conversion types fall into various categories as defined by the
+** following enumeration.
+*/
+#define etRADIX 1 /* Integer types. %d, %x, %o, and so forth */
+#define etFLOAT 2 /* Floating point. %f */
+#define etEXP 3 /* Exponentional notation. %e and %E */
+#define etGENERIC 4 /* Floating or exponential, depending on exponent. %g */
+#define etSIZE 5 /* Return number of characters processed so far. %n */
+#define etSTRING 6 /* Strings. %s */
+#define etDYNSTRING 7 /* Dynamically allocated strings. %z */
+#define etPERCENT 8 /* Percent symbol. %% */
+#define etCHARX 9 /* Characters. %c */
+#define etERROR 10 /* Used to indicate no such conversion type */
+/* The rest are extensions, not normally found in printf() */
+#define etCHARLIT 11 /* Literal characters. %' */
+#define etSQLESCAPE 12 /* Strings with '\'' doubled. %q */
+#define etSQLESCAPE2 13 /* Strings with '\'' doubled and enclosed in '',
+ NULL pointers replaced by SQL NULL. %Q */
+#define etTOKEN 14 /* a pointer to a Token structure */
+#define etSRCLIST 15 /* a pointer to a SrcList */
+#define etPOINTER 16 /* The %p conversion */
+
+
+/*
+** An "etByte" is an 8-bit unsigned value.
+*/
+typedef unsigned char etByte;
+
+/*
+** Each builtin conversion character (ex: the 'd' in "%d") is described
+** by an instance of the following structure
+*/
+typedef struct et_info { /* Information about each format field */
+ char fmttype; /* The format field code letter */
+ etByte base; /* The base for radix conversion */
+ etByte flags; /* One or more of FLAG_ constants below */
+ etByte type; /* Conversion paradigm */
+ etByte charset; /* Offset into aDigits[] of the digits string */
+ etByte prefix; /* Offset into aPrefix[] of the prefix string */
+} et_info;
+
+/*
+** Allowed values for et_info.flags
+*/
+#define FLAG_SIGNED 1 /* True if the value to convert is signed */
+#define FLAG_INTERN 2 /* True if for internal use only */
+#define FLAG_STRING 4 /* Allow infinity precision */
+
+
+/*
+** The following table is searched linearly, so it is good to put the
+** most frequently used conversion types first.
+*/
+static const char aDigits[] = "0123456789ABCDEF0123456789abcdef";
+static const char aPrefix[] = "-x0\000X0";
+static const et_info fmtinfo[] = {
+ { 'd', 10, 1, etRADIX, 0, 0 },
+ { 's', 0, 4, etSTRING, 0, 0 },
+ { 'g', 0, 1, etGENERIC, 30, 0 },
+ { 'z', 0, 6, etDYNSTRING, 0, 0 },
+ { 'q', 0, 4, etSQLESCAPE, 0, 0 },
+ { 'Q', 0, 4, etSQLESCAPE2, 0, 0 },
+ { 'c', 0, 0, etCHARX, 0, 0 },
+ { 'o', 8, 0, etRADIX, 0, 2 },
+ { 'u', 10, 0, etRADIX, 0, 0 },
+ { 'x', 16, 0, etRADIX, 16, 1 },
+ { 'X', 16, 0, etRADIX, 0, 4 },
+ { 'f', 0, 1, etFLOAT, 0, 0 },
+ { 'e', 0, 1, etEXP, 30, 0 },
+ { 'E', 0, 1, etEXP, 14, 0 },
+ { 'G', 0, 1, etGENERIC, 14, 0 },
+ { 'i', 10, 1, etRADIX, 0, 0 },
+ { 'n', 0, 0, etSIZE, 0, 0 },
+ { '%', 0, 0, etPERCENT, 0, 0 },
+ { 'p', 16, 0, etPOINTER, 0, 1 },
+ { 'T', 0, 2, etTOKEN, 0, 0 },
+ { 'S', 0, 2, etSRCLIST, 0, 0 },
+};
+#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0]))
+
+/*
+** If NOFLOATINGPOINT is defined, then none of the floating point
+** conversions will work.
+*/
+#ifndef etNOFLOATINGPOINT
+/*
+** "*val" is a double such that 0.1 <= *val < 10.0
+** Return the ascii code for the leading digit of *val, then
+** multiply "*val" by 10.0 to renormalize.
+**
+** Example:
+** input: *val = 3.14159
+** output: *val = 1.4159 function return = '3'
+**
+** The counter *cnt is incremented each time. After counter exceeds
+** 16 (the number of significant digits in a 64-bit float) '0' is
+** always returned.
+*/
+static int et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){
+ int digit;
+ LONGDOUBLE_TYPE d;
+ if( (*cnt)++ >= 16 ) return '0';
+ digit = (int)*val;
+ d = digit;
+ digit += '0';
+ *val = (*val - d)*10.0;
+ return digit;
+}
+#endif
+
+/*
+** On machines with a small stack size, you can redefine the
+** SQLITE_PRINT_BUF_SIZE to be less than 350. But beware - for
+** smaller values some %f conversions may go into an infinite loop.
+*/
+#ifndef SQLITE_PRINT_BUF_SIZE
+# define SQLITE_PRINT_BUF_SIZE 350
+#endif
+#define etBUFSIZE SQLITE_PRINT_BUF_SIZE /* Size of the output buffer */
+
+/*
+** The root program. All variations call this core.
+**
+** INPUTS:
+** func This is a pointer to a function taking three arguments
+** 1. A pointer to anything. Same as the "arg" parameter.
+** 2. A pointer to the list of characters to be output
+** (Note, this list is NOT null terminated.)
+** 3. An integer number of characters to be output.
+** (Note: This number might be zero.)
+**
+** arg This is the pointer to anything which will be passed as the
+** first argument to "func". Use it for whatever you like.
+**
+** fmt This is the format string, as in the usual print.
+**
+** ap This is a pointer to a list of arguments. Same as in
+** vfprint.
+**
+** OUTPUTS:
+** The return value is the total number of characters sent to
+** the function "func". Returns -1 on a error.
+**
+** Note that the order in which automatic variables are declared below
+** seems to make a big difference in determining how fast this beast
+** will run.
+*/
+static int vxprintf(
+ void (*func)(void*,const char*,int), /* Consumer of text */
+ void *arg, /* First argument to the consumer */
+ int useExtended, /* Allow extended %-conversions */
+ const char *fmt, /* Format string */
+ va_list ap /* arguments */
+){
+ int c; /* Next character in the format string */
+ char *bufpt; /* Pointer to the conversion buffer */
+ int precision; /* Precision of the current field */
+ int length; /* Length of the field */
+ int idx; /* A general purpose loop counter */
+ int count; /* Total number of characters output */
+ int width; /* Width of the current field */
+ etByte flag_leftjustify; /* True if "-" flag is present */
+ etByte flag_plussign; /* True if "+" flag is present */
+ etByte flag_blanksign; /* True if " " flag is present */
+ etByte flag_alternateform; /* True if "#" flag is present */
+ etByte flag_altform2; /* True if "!" flag is present */
+ etByte flag_zeropad; /* True if field width constant starts with zero */
+ etByte flag_long; /* True if "l" flag is present */
+ etByte flag_longlong; /* True if the "ll" flag is present */
+ etByte done; /* Loop termination flag */
+ UINT64_TYPE longvalue; /* Value for integer types */
+ LONGDOUBLE_TYPE realvalue; /* Value for real types */
+ const et_info *infop; /* Pointer to the appropriate info structure */
+ char buf[etBUFSIZE]; /* Conversion buffer */
+ char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
+ etByte errorflag = 0; /* True if an error is encountered */
+ etByte xtype; /* Conversion paradigm */
+ char *zExtra; /* Extra memory used for etTCLESCAPE conversions */
+ static const char spaces[] =
+ " ";
+#define etSPACESIZE (sizeof(spaces)-1)
+#ifndef etNOFLOATINGPOINT
+ int exp, e2; /* exponent of real numbers */
+ double rounder; /* Used for rounding floating point values */
+ etByte flag_dp; /* True if decimal point should be shown */
+ etByte flag_rtz; /* True if trailing zeros should be removed */
+ etByte flag_exp; /* True to force display of the exponent */
+ int nsd; /* Number of significant digits returned */
+#endif
+
+ func(arg,"",0);
+ count = length = 0;
+ bufpt = 0;
+ for(; (c=(*fmt))!=0; ++fmt){
+ if( c!='%' ){
+ int amt;
+ bufpt = (char *)fmt;
+ amt = 1;
+ while( (c=(*++fmt))!='%' && c!=0 ) amt++;
+ (*func)(arg,bufpt,amt);
+ count += amt;
+ if( c==0 ) break;
+ }
+ if( (c=(*++fmt))==0 ){
+ errorflag = 1;
+ (*func)(arg,"%",1);
+ count++;
+ break;
+ }
+ /* Find out what flags are present */
+ flag_leftjustify = flag_plussign = flag_blanksign =
+ flag_alternateform = flag_altform2 = flag_zeropad = 0;
+ done = 0;
+ do{
+ switch( c ){
+ case '-': flag_leftjustify = 1; break;
+ case '+': flag_plussign = 1; break;
+ case ' ': flag_blanksign = 1; break;
+ case '#': flag_alternateform = 1; break;
+ case '!': flag_altform2 = 1; break;
+ case '0': flag_zeropad = 1; break;
+ default: done = 1; break;
+ }
+ }while( !done && (c=(*++fmt))!=0 );
+ /* Get the field width */
+ width = 0;
+ if( c=='*' ){
+ width = va_arg(ap,int);
+ if( width<0 ){
+ flag_leftjustify = 1;
+ width = -width;
+ }
+ c = *++fmt;
+ }else{
+ while( c>='0' && c<='9' ){
+ width = width*10 + c - '0';
+ c = *++fmt;
+ }
+ }
+ if( width > etBUFSIZE-10 ){
+ width = etBUFSIZE-10;
+ }
+ /* Get the precision */
+ if( c=='.' ){
+ precision = 0;
+ c = *++fmt;
+ if( c=='*' ){
+ precision = va_arg(ap,int);
+ if( precision<0 ) precision = -precision;
+ c = *++fmt;
+ }else{
+ while( c>='0' && c<='9' ){
+ precision = precision*10 + c - '0';
+ c = *++fmt;
+ }
+ }
+ }else{
+ precision = -1;
+ }
+ /* Get the conversion type modifier */
+ if( c=='l' ){
+ flag_long = 1;
+ c = *++fmt;
+ if( c=='l' ){
+ flag_longlong = 1;
+ c = *++fmt;
+ }else{
+ flag_longlong = 0;
+ }
+ }else{
+ flag_long = flag_longlong = 0;
+ }
+ /* Fetch the info entry for the field */
+ infop = 0;
+ xtype = etERROR;
+ for(idx=0; idx<etNINFO; idx++){
+ if( c==fmtinfo[idx].fmttype ){
+ infop = &fmtinfo[idx];
+ if( useExtended || (infop->flags & FLAG_INTERN)==0 ){
+ xtype = infop->type;
+ }
+ break;
+ }
+ }
+ zExtra = 0;
+
+ /* Limit the precision to prevent overflowing buf[] during conversion */
+ if( precision>etBUFSIZE-40 && (infop->flags & FLAG_STRING)==0 ){
+ precision = etBUFSIZE-40;
+ }
+
+ /*
+ ** At this point, variables are initialized as follows:
+ **
+ ** flag_alternateform TRUE if a '#' is present.
+ ** flag_altform2 TRUE if a '!' is present.
+ ** flag_plussign TRUE if a '+' is present.
+ ** flag_leftjustify TRUE if a '-' is present or if the
+ ** field width was negative.
+ ** flag_zeropad TRUE if the width began with 0.
+ ** flag_long TRUE if the letter 'l' (ell) prefixed
+ ** the conversion character.
+ ** flag_longlong TRUE if the letter 'll' (ell ell) prefixed
+ ** the conversion character.
+ ** flag_blanksign TRUE if a ' ' is present.
+ ** width The specified field width. This is
+ ** always non-negative. Zero is the default.
+ ** precision The specified precision. The default
+ ** is -1.
+ ** xtype The class of the conversion.
+ ** infop Pointer to the appropriate info struct.
+ */
+ switch( xtype ){
+ case etPOINTER:
+ flag_longlong = sizeof(char*)==sizeof(i64);
+ flag_long = sizeof(char*)==sizeof(long int);
+ /* Fall through into the next case */
+ case etRADIX:
+ if( infop->flags & FLAG_SIGNED ){
+ i64 v;
+ if( flag_longlong ) v = va_arg(ap,i64);
+ else if( flag_long ) v = va_arg(ap,long int);
+ else v = va_arg(ap,int);
+ if( v<0 ){
+ longvalue = -v;
+ prefix = '-';
+ }else{
+ longvalue = v;
+ if( flag_plussign ) prefix = '+';
+ else if( flag_blanksign ) prefix = ' ';
+ else prefix = 0;
+ }
+ }else{
+ if( flag_longlong ) longvalue = va_arg(ap,u64);
+ else if( flag_long ) longvalue = va_arg(ap,unsigned long int);
+ else longvalue = va_arg(ap,unsigned int);
+ prefix = 0;
+ }
+ if( longvalue==0 ) flag_alternateform = 0;
+ if( flag_zeropad && precision<width-(prefix!=0) ){
+ precision = width-(prefix!=0);
+ }
+ bufpt = &buf[etBUFSIZE-1];
+ {
+ register const char *cset; /* Use registers for speed */
+ register int base;
+ cset = &aDigits[infop->charset];
+ base = infop->base;
+ do{ /* Convert to ascii */
+ *(--bufpt) = cset[longvalue%base];
+ longvalue = longvalue/base;
+ }while( longvalue>0 );
+ }
+ length = &buf[etBUFSIZE-1]-bufpt;
+ for(idx=precision-length; idx>0; idx--){
+ *(--bufpt) = '0'; /* Zero pad */
+ }
+ if( prefix ) *(--bufpt) = prefix; /* Add sign */
+ if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
+ const char *pre;
+ char x;
+ pre = &aPrefix[infop->prefix];
+ if( *bufpt!=pre[0] ){
+ for(; (x=(*pre))!=0; pre++) *(--bufpt) = x;
+ }
+ }
+ length = &buf[etBUFSIZE-1]-bufpt;
+ break;
+ case etFLOAT:
+ case etEXP:
+ case etGENERIC:
+ realvalue = va_arg(ap,double);
+#ifndef etNOFLOATINGPOINT
+ if( precision<0 ) precision = 6; /* Set default precision */
+ if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10;
+ if( realvalue<0.0 ){
+ realvalue = -realvalue;
+ prefix = '-';
+ }else{
+ if( flag_plussign ) prefix = '+';
+ else if( flag_blanksign ) prefix = ' ';
+ else prefix = 0;
+ }
+ if( xtype==etGENERIC && precision>0 ) precision--;
+#if 0
+ /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */
+ for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1);
+#else
+ /* It makes more sense to use 0.5 */
+ for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1);
+#endif
+ if( xtype==etFLOAT ) realvalue += rounder;
+ /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
+ exp = 0;
+ if( realvalue>0.0 ){
+ while( realvalue>=1e32 && exp<=350 ){ realvalue *= 1e-32; exp+=32; }
+ while( realvalue>=1e8 && exp<=350 ){ realvalue *= 1e-8; exp+=8; }
+ while( realvalue>=10.0 && exp<=350 ){ realvalue *= 0.1; exp++; }
+ while( realvalue<1e-8 && exp>=-350 ){ realvalue *= 1e8; exp-=8; }
+ while( realvalue<1.0 && exp>=-350 ){ realvalue *= 10.0; exp--; }
+ if( exp>350 || exp<-350 ){
+ bufpt = "NaN";
+ length = 3;
+ break;
+ }
+ }
+ bufpt = buf;
+ /*
+ ** If the field type is etGENERIC, then convert to either etEXP
+ ** or etFLOAT, as appropriate.
+ */
+ flag_exp = xtype==etEXP;
+ if( xtype!=etFLOAT ){
+ realvalue += rounder;
+ if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
+ }
+ if( xtype==etGENERIC ){
+ flag_rtz = !flag_alternateform;
+ if( exp<-4 || exp>precision ){
+ xtype = etEXP;
+ }else{
+ precision = precision - exp;
+ xtype = etFLOAT;
+ }
+ }else{
+ flag_rtz = 0;
+ }
+ if( xtype==etEXP ){
+ e2 = 0;
+ }else{
+ e2 = exp;
+ }
+ nsd = 0;
+ flag_dp = (precision>0) | flag_alternateform | flag_altform2;
+ /* The sign in front of the number */
+ if( prefix ){
+ *(bufpt++) = prefix;
+ }
+ /* Digits prior to the decimal point */
+ if( e2<0 ){
+ *(bufpt++) = '0';
+ }else{
+ for(; e2>=0; e2--){
+ *(bufpt++) = et_getdigit(&realvalue,&nsd);
+ }
+ }
+ /* The decimal point */
+ if( flag_dp ){
+ *(bufpt++) = '.';
+ }
+ /* "0" digits after the decimal point but before the first
+ ** significant digit of the number */
+ for(e2++; e2<0 && precision>0; precision--, e2++){
+ *(bufpt++) = '0';
+ }
+ /* Significant digits after the decimal point */
+ while( (precision--)>0 ){
+ *(bufpt++) = et_getdigit(&realvalue,&nsd);
+ }
+ /* Remove trailing zeros and the "." if no digits follow the "." */
+ if( flag_rtz && flag_dp ){
+ while( bufpt[-1]=='0' ) *(--bufpt) = 0;
+ assert( bufpt>buf );
+ if( bufpt[-1]=='.' ){
+ if( flag_altform2 ){
+ *(bufpt++) = '0';
+ }else{
+ *(--bufpt) = 0;
+ }
+ }
+ }
+ /* Add the "eNNN" suffix */
+ if( flag_exp || (xtype==etEXP && exp) ){
+ *(bufpt++) = aDigits[infop->charset];
+ if( exp<0 ){
+ *(bufpt++) = '-'; exp = -exp;
+ }else{
+ *(bufpt++) = '+';
+ }
+ if( exp>=100 ){
+ *(bufpt++) = (exp/100)+'0'; /* 100's digit */
+ exp %= 100;
+ }
+ *(bufpt++) = exp/10+'0'; /* 10's digit */
+ *(bufpt++) = exp%10+'0'; /* 1's digit */
+ }
+ *bufpt = 0;
+
+ /* The converted number is in buf[] and zero terminated. Output it.
+ ** Note that the number is in the usual order, not reversed as with
+ ** integer conversions. */
+ length = bufpt-buf;
+ bufpt = buf;
+
+ /* Special case: Add leading zeros if the flag_zeropad flag is
+ ** set and we are not left justified */
+ if( flag_zeropad && !flag_leftjustify && length < width){
+ int i;
+ int nPad = width - length;
+ for(i=width; i>=nPad; i--){
+ bufpt[i] = bufpt[i-nPad];
+ }
+ i = prefix!=0;
+ while( nPad-- ) bufpt[i++] = '0';
+ length = width;
+ }
+#endif
+ break;
+ case etSIZE:
+ *(va_arg(ap,int*)) = count;
+ length = width = 0;
+ break;
+ case etPERCENT:
+ buf[0] = '%';
+ bufpt = buf;
+ length = 1;
+ break;
+ case etCHARLIT:
+ case etCHARX:
+ c = buf[0] = (xtype==etCHARX ? va_arg(ap,int) : *++fmt);
+ if( precision>=0 ){
+ for(idx=1; idx<precision; idx++) buf[idx] = c;
+ length = precision;
+ }else{
+ length =1;
+ }
+ bufpt = buf;
+ break;
+ case etSTRING:
+ case etDYNSTRING:
+ bufpt = va_arg(ap,char*);
+ if( bufpt==0 ){
+ bufpt = "";
+ }else if( xtype==etDYNSTRING ){
+ zExtra = bufpt;
+ }
+ length = strlen(bufpt);
+ if( precision>=0 && precision<length ) length = precision;
+ break;
+ case etSQLESCAPE:
+ case etSQLESCAPE2: {
+ int i, j, n, c, isnull;
+ int needQuote;
+ char *arg = va_arg(ap,char*);
+ isnull = arg==0;
+ if( isnull ) arg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
+ for(i=n=0; (c=arg[i])!=0; i++){
+ if( c=='\'' ) n++;
+ }
+ needQuote = !isnull && xtype==etSQLESCAPE2;
+ n += i + 1 + needQuote*2;
+ if( n>etBUFSIZE ){
+ bufpt = zExtra = sqliteMalloc( n );
+ if( bufpt==0 ) return -1;
+ }else{
+ bufpt = buf;
+ }
+ j = 0;
+ if( needQuote ) bufpt[j++] = '\'';
+ for(i=0; (c=arg[i])!=0; i++){
+ bufpt[j++] = c;
+ if( c=='\'' ) bufpt[j++] = c;
+ }
+ if( needQuote ) bufpt[j++] = '\'';
+ bufpt[j] = 0;
+ length = j;
+ if( precision>=0 && precision<length ) length = precision;
+ break;
+ }
+ case etTOKEN: {
+ Token *pToken = va_arg(ap, Token*);
+ if( pToken && pToken->z ){
+ (*func)(arg, pToken->z, pToken->n);
+ }
+ length = width = 0;
+ break;
+ }
+ case etSRCLIST: {
+ SrcList *pSrc = va_arg(ap, SrcList*);
+ int k = va_arg(ap, int);
+ struct SrcList_item *pItem = &pSrc->a[k];
+ assert( k>=0 && k<pSrc->nSrc );
+ if( pItem->zDatabase && pItem->zDatabase[0] ){
+ (*func)(arg, pItem->zDatabase, strlen(pItem->zDatabase));
+ (*func)(arg, ".", 1);
+ }
+ (*func)(arg, pItem->zName, strlen(pItem->zName));
+ length = width = 0;
+ break;
+ }
+ case etERROR:
+ buf[0] = '%';
+ buf[1] = c;
+ errorflag = 0;
+ idx = 1+(c!=0);
+ (*func)(arg,"%",idx);
+ count += idx;
+ if( c==0 ) fmt--;
+ break;
+ }/* End switch over the format type */
+ /*
+ ** The text of the conversion is pointed to by "bufpt" and is
+ ** "length" characters long. The field width is "width". Do
+ ** the output.
+ */
+ if( !flag_leftjustify ){
+ register int nspace;
+ nspace = width-length;
+ if( nspace>0 ){
+ count += nspace;
+ while( nspace>=etSPACESIZE ){
+ (*func)(arg,spaces,etSPACESIZE);
+ nspace -= etSPACESIZE;
+ }
+ if( nspace>0 ) (*func)(arg,spaces,nspace);
+ }
+ }
+ if( length>0 ){
+ (*func)(arg,bufpt,length);
+ count += length;
+ }
+ if( flag_leftjustify ){
+ register int nspace;
+ nspace = width-length;
+ if( nspace>0 ){
+ count += nspace;
+ while( nspace>=etSPACESIZE ){
+ (*func)(arg,spaces,etSPACESIZE);
+ nspace -= etSPACESIZE;
+ }
+ if( nspace>0 ) (*func)(arg,spaces,nspace);
+ }
+ }
+ if( zExtra ){
+ sqliteFree(zExtra);
+ }
+ }/* End for loop over the format string */
+ return errorflag ? -1 : count;
+} /* End of function */
+
+
+/* This structure is used to store state information about the
+** write to memory that is currently in progress.
+*/
+struct sgMprintf {
+ char *zBase; /* A base allocation */
+ char *zText; /* The string collected so far */
+ int nChar; /* Length of the string so far */
+ int nTotal; /* Output size if unconstrained */
+ int nAlloc; /* Amount of space allocated in zText */
+ void *(*xRealloc)(void*,int); /* Function used to realloc memory */
+};
+
+/*
+** This function implements the callback from vxprintf.
+**
+** This routine add nNewChar characters of text in zNewText to
+** the sgMprintf structure pointed to by "arg".
+*/
+static void mout(void *arg, const char *zNewText, int nNewChar){
+ struct sgMprintf *pM = (struct sgMprintf*)arg;
+ pM->nTotal += nNewChar;
+ if( pM->nChar + nNewChar + 1 > pM->nAlloc ){
+ if( pM->xRealloc==0 ){
+ nNewChar = pM->nAlloc - pM->nChar - 1;
+ }else{
+ pM->nAlloc = pM->nChar + nNewChar*2 + 1;
+ if( pM->zText==pM->zBase ){
+ pM->zText = pM->xRealloc(0, pM->nAlloc);
+ if( pM->zText && pM->nChar ){
+ memcpy(pM->zText, pM->zBase, pM->nChar);
+ }
+ }else{
+ char *zNew;
+ zNew = pM->xRealloc(pM->zText, pM->nAlloc);
+ if( zNew ){
+ pM->zText = zNew;
+ }
+ }
+ }
+ }
+ if( pM->zText ){
+ if( nNewChar>0 ){
+ memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
+ pM->nChar += nNewChar;
+ }
+ pM->zText[pM->nChar] = 0;
+ }
+}
+
+/*
+** This routine is a wrapper around xprintf() that invokes mout() as
+** the consumer.
+*/
+static char *base_vprintf(
+ void *(*xRealloc)(void*,int), /* Routine to realloc memory. May be NULL */
+ int useInternal, /* Use internal %-conversions if true */
+ char *zInitBuf, /* Initially write here, before mallocing */
+ int nInitBuf, /* Size of zInitBuf[] */
+ const char *zFormat, /* format string */
+ va_list ap /* arguments */
+){
+ struct sgMprintf sM;
+ sM.zBase = sM.zText = zInitBuf;
+ sM.nChar = sM.nTotal = 0;
+ sM.nAlloc = nInitBuf;
+ sM.xRealloc = xRealloc;
+ vxprintf(mout, &sM, useInternal, zFormat, ap);
+ if( xRealloc ){
+ if( sM.zText==sM.zBase ){
+ sM.zText = xRealloc(0, sM.nChar+1);
+ if( sM.zText ){
+ memcpy(sM.zText, sM.zBase, sM.nChar+1);
+ }
+ }else if( sM.nAlloc>sM.nChar+10 ){
+ char *zNew = xRealloc(sM.zText, sM.nChar+1);
+ if( zNew ){
+ sM.zText = zNew;
+ }
+ }
+ }
+ return sM.zText;
+}
+
+/*
+** Realloc that is a real function, not a macro.
+*/
+static void *printf_realloc(void *old, int size){
+ return sqliteRealloc(old,size);
+}
+
+/*
+** Print into memory obtained from sqliteMalloc(). Use the internal
+** %-conversion extensions.
+*/
+char *sqlite3VMPrintf(const char *zFormat, va_list ap){
+ char zBase[SQLITE_PRINT_BUF_SIZE];
+ return base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap);
+}
+
+/*
+** Print into memory obtained from sqliteMalloc(). Use the internal
+** %-conversion extensions.
+*/
+char *sqlite3MPrintf(const char *zFormat, ...){
+ va_list ap;
+ char *z;
+ char zBase[SQLITE_PRINT_BUF_SIZE];
+ va_start(ap, zFormat);
+ z = base_vprintf(printf_realloc, 1, zBase, sizeof(zBase), zFormat, ap);
+ va_end(ap);
+ return z;
+}
+
+/*
+** Print into memory obtained from malloc(). Do not use the internal
+** %-conversion extensions. This routine is for use by external users.
+*/
+char *sqlite3_mprintf(const char *zFormat, ...){
+ va_list ap;
+ char *z;
+ char zBuf[200];
+
+ va_start(ap,zFormat);
+ z = base_vprintf((void*(*)(void*,int))realloc, 0,
+ zBuf, sizeof(zBuf), zFormat, ap);
+ va_end(ap);
+ return z;
+}
+
+/* This is the varargs version of sqlite3_mprintf.
+*/
+char *sqlite3_vmprintf(const char *zFormat, va_list ap){
+ char zBuf[200];
+ return base_vprintf((void*(*)(void*,int))realloc, 0,
+ zBuf, sizeof(zBuf), zFormat, ap);
+}
+
+/*
+** sqlite3_snprintf() works like snprintf() except that it ignores the
+** current locale settings. This is important for SQLite because we
+** are not able to use a "," as the decimal point in place of "." as
+** specified by some locales.
+*/
+char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
+ char *z;
+ va_list ap;
+
+ va_start(ap,zFormat);
+ z = base_vprintf(0, 0, zBuf, n, zFormat, ap);
+ va_end(ap);
+ return z;
+}
+
+#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
+/*
+** A version of printf() that understands %lld. Used for debugging.
+** The printf() built into some versions of windows does not understand %lld
+** and segfaults if you give it a long long int.
+*/
+void sqlite3DebugPrintf(const char *zFormat, ...){
+ extern int getpid(void);
+ va_list ap;
+ char zBuf[500];
+ va_start(ap, zFormat);
+ base_vprintf(0, 0, zBuf, sizeof(zBuf), zFormat, ap);
+ va_end(ap);
+ fprintf(stdout,"%d: %s", getpid(), zBuf);
+ fflush(stdout);
+}
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/random.c b/ext/pdo_sqlite/sqlite/src/random.c
new file mode 100644
index 000000000..51d5d72e7
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/random.c
@@ -0,0 +1,100 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains code to implement a pseudo-random number
+** generator (PRNG) for SQLite.
+**
+** Random numbers are used by some of the database backends in order
+** to generate random integer keys for tables or random filenames.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "os.h"
+
+
+/*
+** Get a single 8-bit random value from the RC4 PRNG. The Mutex
+** must be held while executing this routine.
+**
+** Why not just use a library random generator like lrand48() for this?
+** Because the OP_NewRowid opcode in the VDBE depends on having a very
+** good source of random numbers. The lrand48() library function may
+** well be good enough. But maybe not. Or maybe lrand48() has some
+** subtle problems on some systems that could cause problems. It is hard
+** to know. To minimize the risk of problems due to bad lrand48()
+** implementations, SQLite uses this random number generator based
+** on RC4, which we know works very well.
+**
+** (Later): Actually, OP_NewRowid does not depend on a good source of
+** randomness any more. But we will leave this code in all the same.
+*/
+static int randomByte(){
+ unsigned char t;
+
+ /* All threads share a single random number generator.
+ ** This structure is the current state of the generator.
+ */
+ static struct {
+ unsigned char isInit; /* True if initialized */
+ unsigned char i, j; /* State variables */
+ unsigned char s[256]; /* State variables */
+ } prng;
+
+ /* Initialize the state of the random number generator once,
+ ** the first time this routine is called. The seed value does
+ ** not need to contain a lot of randomness since we are not
+ ** trying to do secure encryption or anything like that...
+ **
+ ** Nothing in this file or anywhere else in SQLite does any kind of
+ ** encryption. The RC4 algorithm is being used as a PRNG (pseudo-random
+ ** number generator) not as an encryption device.
+ */
+ if( !prng.isInit ){
+ int i;
+ char k[256];
+ prng.j = 0;
+ prng.i = 0;
+ sqlite3OsRandomSeed(k);
+ for(i=0; i<256; i++){
+ prng.s[i] = i;
+ }
+ for(i=0; i<256; i++){
+ prng.j += prng.s[i] + k[i];
+ t = prng.s[prng.j];
+ prng.s[prng.j] = prng.s[i];
+ prng.s[i] = t;
+ }
+ prng.isInit = 1;
+ }
+
+ /* Generate and return single random byte
+ */
+ prng.i++;
+ t = prng.s[prng.i];
+ prng.j += t;
+ prng.s[prng.i] = prng.s[prng.j];
+ prng.s[prng.j] = t;
+ t += prng.s[prng.i];
+ return prng.s[t];
+}
+
+/*
+** Return N random bytes.
+*/
+void sqlite3Randomness(int N, void *pBuf){
+ unsigned char *zBuf = pBuf;
+ sqlite3OsEnterMutex();
+ while( N-- ){
+ *(zBuf++) = randomByte();
+ }
+ sqlite3OsLeaveMutex();
+}
diff --git a/ext/pdo_sqlite/sqlite/src/select.c b/ext/pdo_sqlite/sqlite/src/select.c
new file mode 100644
index 000000000..8a51208d7
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/select.c
@@ -0,0 +1,3127 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains C code routines that are called by the parser
+** to handle SELECT statements in SQLite.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+
+
+/*
+** Allocate a new Select structure and return a pointer to that
+** structure.
+*/
+Select *sqlite3SelectNew(
+ ExprList *pEList, /* which columns to include in the result */
+ SrcList *pSrc, /* the FROM clause -- which tables to scan */
+ Expr *pWhere, /* the WHERE clause */
+ ExprList *pGroupBy, /* the GROUP BY clause */
+ Expr *pHaving, /* the HAVING clause */
+ ExprList *pOrderBy, /* the ORDER BY clause */
+ int isDistinct, /* true if the DISTINCT keyword is present */
+ Expr *pLimit, /* LIMIT value. NULL means not used */
+ Expr *pOffset /* OFFSET value. NULL means no offset */
+){
+ Select *pNew;
+ pNew = sqliteMalloc( sizeof(*pNew) );
+ assert( !pOffset || pLimit ); /* Can't have OFFSET without LIMIT. */
+ if( pNew==0 ){
+ sqlite3ExprListDelete(pEList);
+ sqlite3SrcListDelete(pSrc);
+ sqlite3ExprDelete(pWhere);
+ sqlite3ExprListDelete(pGroupBy);
+ sqlite3ExprDelete(pHaving);
+ sqlite3ExprListDelete(pOrderBy);
+ sqlite3ExprDelete(pLimit);
+ sqlite3ExprDelete(pOffset);
+ }else{
+ if( pEList==0 ){
+ pEList = sqlite3ExprListAppend(0, sqlite3Expr(TK_ALL,0,0,0), 0);
+ }
+ pNew->pEList = pEList;
+ pNew->pSrc = pSrc;
+ pNew->pWhere = pWhere;
+ pNew->pGroupBy = pGroupBy;
+ pNew->pHaving = pHaving;
+ pNew->pOrderBy = pOrderBy;
+ pNew->isDistinct = isDistinct;
+ pNew->op = TK_SELECT;
+ pNew->pLimit = pLimit;
+ pNew->pOffset = pOffset;
+ pNew->iLimit = -1;
+ pNew->iOffset = -1;
+ pNew->addrOpenVirt[0] = -1;
+ pNew->addrOpenVirt[1] = -1;
+ pNew->addrOpenVirt[2] = -1;
+ }
+ return pNew;
+}
+
+/*
+** Given 1 to 3 identifiers preceeding the JOIN keyword, determine the
+** type of join. Return an integer constant that expresses that type
+** in terms of the following bit values:
+**
+** JT_INNER
+** JT_CROSS
+** JT_OUTER
+** JT_NATURAL
+** JT_LEFT
+** JT_RIGHT
+**
+** A full outer join is the combination of JT_LEFT and JT_RIGHT.
+**
+** If an illegal or unsupported join type is seen, then still return
+** a join type, but put an error in the pParse structure.
+*/
+int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
+ int jointype = 0;
+ Token *apAll[3];
+ Token *p;
+ static const struct {
+ const char zKeyword[8];
+ u8 nChar;
+ u8 code;
+ } keywords[] = {
+ { "natural", 7, JT_NATURAL },
+ { "left", 4, JT_LEFT|JT_OUTER },
+ { "right", 5, JT_RIGHT|JT_OUTER },
+ { "full", 4, JT_LEFT|JT_RIGHT|JT_OUTER },
+ { "outer", 5, JT_OUTER },
+ { "inner", 5, JT_INNER },
+ { "cross", 5, JT_INNER|JT_CROSS },
+ };
+ int i, j;
+ apAll[0] = pA;
+ apAll[1] = pB;
+ apAll[2] = pC;
+ for(i=0; i<3 && apAll[i]; i++){
+ p = apAll[i];
+ for(j=0; j<sizeof(keywords)/sizeof(keywords[0]); j++){
+ if( p->n==keywords[j].nChar
+ && sqlite3StrNICmp(p->z, keywords[j].zKeyword, p->n)==0 ){
+ jointype |= keywords[j].code;
+ break;
+ }
+ }
+ if( j>=sizeof(keywords)/sizeof(keywords[0]) ){
+ jointype |= JT_ERROR;
+ break;
+ }
+ }
+ if(
+ (jointype & (JT_INNER|JT_OUTER))==(JT_INNER|JT_OUTER) ||
+ (jointype & JT_ERROR)!=0
+ ){
+ const char *zSp1 = " ";
+ const char *zSp2 = " ";
+ if( pB==0 ){ zSp1++; }
+ if( pC==0 ){ zSp2++; }
+ sqlite3ErrorMsg(pParse, "unknown or unsupported join type: "
+ "%T%s%T%s%T", pA, zSp1, pB, zSp2, pC);
+ jointype = JT_INNER;
+ }else if( jointype & JT_RIGHT ){
+ sqlite3ErrorMsg(pParse,
+ "RIGHT and FULL OUTER JOINs are not currently supported");
+ jointype = JT_INNER;
+ }
+ return jointype;
+}
+
+/*
+** Return the index of a column in a table. Return -1 if the column
+** is not contained in the table.
+*/
+static int columnIndex(Table *pTab, const char *zCol){
+ int i;
+ for(i=0; i<pTab->nCol; i++){
+ if( sqlite3StrICmp(pTab->aCol[i].zName, zCol)==0 ) return i;
+ }
+ return -1;
+}
+
+/*
+** Set the value of a token to a '\000'-terminated string.
+*/
+static void setToken(Token *p, const char *z){
+ p->z = z;
+ p->n = strlen(z);
+ p->dyn = 0;
+}
+
+/*
+** Create an expression node for an identifier with the name of zName
+*/
+static Expr *createIdExpr(const char *zName){
+ Token dummy;
+ setToken(&dummy, zName);
+ return sqlite3Expr(TK_ID, 0, 0, &dummy);
+}
+
+
+/*
+** Add a term to the WHERE expression in *ppExpr that requires the
+** zCol column to be equal in the two tables pTab1 and pTab2.
+*/
+static void addWhereTerm(
+ const char *zCol, /* Name of the column */
+ const Table *pTab1, /* First table */
+ const char *zAlias1, /* Alias for first table. May be NULL */
+ const Table *pTab2, /* Second table */
+ const char *zAlias2, /* Alias for second table. May be NULL */
+ int iRightJoinTable, /* VDBE cursor for the right table */
+ Expr **ppExpr /* Add the equality term to this expression */
+){
+ Expr *pE1a, *pE1b, *pE1c;
+ Expr *pE2a, *pE2b, *pE2c;
+ Expr *pE;
+
+ pE1a = createIdExpr(zCol);
+ pE2a = createIdExpr(zCol);
+ if( zAlias1==0 ){
+ zAlias1 = pTab1->zName;
+ }
+ pE1b = createIdExpr(zAlias1);
+ if( zAlias2==0 ){
+ zAlias2 = pTab2->zName;
+ }
+ pE2b = createIdExpr(zAlias2);
+ pE1c = sqlite3Expr(TK_DOT, pE1b, pE1a, 0);
+ pE2c = sqlite3Expr(TK_DOT, pE2b, pE2a, 0);
+ pE = sqlite3Expr(TK_EQ, pE1c, pE2c, 0);
+ ExprSetProperty(pE, EP_FromJoin);
+ pE->iRightJoinTable = iRightJoinTable;
+ *ppExpr = sqlite3ExprAnd(*ppExpr, pE);
+}
+
+/*
+** Set the EP_FromJoin property on all terms of the given expression.
+** And set the Expr.iRightJoinTable to iTable for every term in the
+** expression.
+**
+** The EP_FromJoin property is used on terms of an expression to tell
+** the LEFT OUTER JOIN processing logic that this term is part of the
+** join restriction specified in the ON or USING clause and not a part
+** of the more general WHERE clause. These terms are moved over to the
+** WHERE clause during join processing but we need to remember that they
+** originated in the ON or USING clause.
+**
+** The Expr.iRightJoinTable tells the WHERE clause processing that the
+** expression depends on table iRightJoinTable even if that table is not
+** explicitly mentioned in the expression. That information is needed
+** for cases like this:
+**
+** SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5
+**
+** The where clause needs to defer the handling of the t1.x=5
+** term until after the t2 loop of the join. In that way, a
+** NULL t2 row will be inserted whenever t1.x!=5. If we do not
+** defer the handling of t1.x=5, it will be processed immediately
+** after the t1 loop and rows with t1.x!=5 will never appear in
+** the output, which is incorrect.
+*/
+static void setJoinExpr(Expr *p, int iTable){
+ while( p ){
+ ExprSetProperty(p, EP_FromJoin);
+ p->iRightJoinTable = iTable;
+ setJoinExpr(p->pLeft, iTable);
+ p = p->pRight;
+ }
+}
+
+/*
+** This routine processes the join information for a SELECT statement.
+** ON and USING clauses are converted into extra terms of the WHERE clause.
+** NATURAL joins also create extra WHERE clause terms.
+**
+** The terms of a FROM clause are contained in the Select.pSrc structure.
+** The left most table is the first entry in Select.pSrc. The right-most
+** table is the last entry. The join operator is held in the entry to
+** the left. Thus entry 0 contains the join operator for the join between
+** entries 0 and 1. Any ON or USING clauses associated with the join are
+** also attached to the left entry.
+**
+** This routine returns the number of errors encountered.
+*/
+static int sqliteProcessJoin(Parse *pParse, Select *p){
+ SrcList *pSrc; /* All tables in the FROM clause */
+ int i, j; /* Loop counters */
+ struct SrcList_item *pLeft; /* Left table being joined */
+ struct SrcList_item *pRight; /* Right table being joined */
+
+ pSrc = p->pSrc;
+ pLeft = &pSrc->a[0];
+ pRight = &pLeft[1];
+ for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){
+ Table *pLeftTab = pLeft->pTab;
+ Table *pRightTab = pRight->pTab;
+
+ if( pLeftTab==0 || pRightTab==0 ) continue;
+
+ /* When the NATURAL keyword is present, add WHERE clause terms for
+ ** every column that the two tables have in common.
+ */
+ if( pLeft->jointype & JT_NATURAL ){
+ if( pLeft->pOn || pLeft->pUsing ){
+ sqlite3ErrorMsg(pParse, "a NATURAL join may not have "
+ "an ON or USING clause", 0);
+ return 1;
+ }
+ for(j=0; j<pLeftTab->nCol; j++){
+ char *zName = pLeftTab->aCol[j].zName;
+ if( columnIndex(pRightTab, zName)>=0 ){
+ addWhereTerm(zName, pLeftTab, pLeft->zAlias,
+ pRightTab, pRight->zAlias,
+ pRight->iCursor, &p->pWhere);
+
+ }
+ }
+ }
+
+ /* Disallow both ON and USING clauses in the same join
+ */
+ if( pLeft->pOn && pLeft->pUsing ){
+ sqlite3ErrorMsg(pParse, "cannot have both ON and USING "
+ "clauses in the same join");
+ return 1;
+ }
+
+ /* Add the ON clause to the end of the WHERE clause, connected by
+ ** an AND operator.
+ */
+ if( pLeft->pOn ){
+ setJoinExpr(pLeft->pOn, pRight->iCursor);
+ p->pWhere = sqlite3ExprAnd(p->pWhere, pLeft->pOn);
+ pLeft->pOn = 0;
+ }
+
+ /* Create extra terms on the WHERE clause for each column named
+ ** in the USING clause. Example: If the two tables to be joined are
+ ** A and B and the USING clause names X, Y, and Z, then add this
+ ** to the WHERE clause: A.X=B.X AND A.Y=B.Y AND A.Z=B.Z
+ ** Report an error if any column mentioned in the USING clause is
+ ** not contained in both tables to be joined.
+ */
+ if( pLeft->pUsing ){
+ IdList *pList = pLeft->pUsing;
+ for(j=0; j<pList->nId; j++){
+ char *zName = pList->a[j].zName;
+ if( columnIndex(pLeftTab, zName)<0 || columnIndex(pRightTab, zName)<0 ){
+ sqlite3ErrorMsg(pParse, "cannot join using column %s - column "
+ "not present in both tables", zName);
+ return 1;
+ }
+ addWhereTerm(zName, pLeftTab, pLeft->zAlias,
+ pRightTab, pRight->zAlias,
+ pRight->iCursor, &p->pWhere);
+ }
+ }
+ }
+ return 0;
+}
+
+/*
+** Delete the given Select structure and all of its substructures.
+*/
+void sqlite3SelectDelete(Select *p){
+ if( p==0 ) return;
+ sqlite3ExprListDelete(p->pEList);
+ sqlite3SrcListDelete(p->pSrc);
+ sqlite3ExprDelete(p->pWhere);
+ sqlite3ExprListDelete(p->pGroupBy);
+ sqlite3ExprDelete(p->pHaving);
+ sqlite3ExprListDelete(p->pOrderBy);
+ sqlite3SelectDelete(p->pPrior);
+ sqlite3ExprDelete(p->pLimit);
+ sqlite3ExprDelete(p->pOffset);
+ sqliteFree(p);
+}
+
+/*
+** Insert code into "v" that will push the record on the top of the
+** stack into the sorter.
+*/
+static void pushOntoSorter(Parse *pParse, Vdbe *v, ExprList *pOrderBy){
+ sqlite3ExprCodeExprList(pParse, pOrderBy);
+ sqlite3VdbeAddOp(v, OP_Sequence, pOrderBy->iECursor, 0);
+ sqlite3VdbeAddOp(v, OP_Pull, pOrderBy->nExpr + 1, 0);
+ sqlite3VdbeAddOp(v, OP_MakeRecord, pOrderBy->nExpr + 2, 0);
+ sqlite3VdbeAddOp(v, OP_IdxInsert, pOrderBy->iECursor, 0);
+}
+
+/*
+** Add code to implement the OFFSET and LIMIT
+*/
+static void codeLimiter(
+ Vdbe *v, /* Generate code into this VM */
+ Select *p, /* The SELECT statement being coded */
+ int iContinue, /* Jump here to skip the current record */
+ int iBreak, /* Jump here to end the loop */
+ int nPop /* Number of times to pop stack when jumping */
+){
+ if( p->iOffset>=0 && iContinue!=0 ){
+ int addr = sqlite3VdbeCurrentAddr(v) + 3;
+ if( nPop>0 ) addr++;
+ sqlite3VdbeAddOp(v, OP_MemIncr, p->iOffset, 0);
+ sqlite3VdbeAddOp(v, OP_IfMemPos, p->iOffset, addr);
+ if( nPop>0 ){
+ sqlite3VdbeAddOp(v, OP_Pop, nPop, 0);
+ }
+ sqlite3VdbeAddOp(v, OP_Goto, 0, iContinue);
+ VdbeComment((v, "# skip OFFSET records"));
+ }
+ if( p->iLimit>=0 && iBreak!=0 ){
+ sqlite3VdbeAddOp(v, OP_MemIncr, p->iLimit, iBreak);
+ VdbeComment((v, "# exit when LIMIT reached"));
+ }
+}
+
+/*
+** Add code that will check to make sure the top N elements of the
+** stack are distinct. iTab is a sorting index that holds previously
+** seen combinations of the N values. A new entry is made in iTab
+** if the current N values are new.
+**
+** A jump to addrRepeat is made and the K values are popped from the
+** stack if the top N elements are not distinct.
+*/
+static void codeDistinct(
+ Vdbe *v, /* Generate code into this VM */
+ int iTab, /* A sorting index used to test for distinctness */
+ int addrRepeat, /* Jump to here if not distinct */
+ int N, /* The top N elements of the stack must be distinct */
+ int K /* Pop K elements from the stack if indistinct */
+){
+#if NULL_ALWAYS_DISTINCT
+ sqlite3VdbeAddOp(v, OP_IsNull, -N, sqlite3VdbeCurrentAddr(v)+6);
+#endif
+ sqlite3VdbeAddOp(v, OP_MakeRecord, -N, 0);
+ sqlite3VdbeAddOp(v, OP_Distinct, iTab, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_Pop, K, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, addrRepeat);
+ VdbeComment((v, "# skip indistinct records"));
+ sqlite3VdbeAddOp(v, OP_IdxInsert, iTab, 0);
+}
+
+
+/*
+** This routine generates the code for the inside of the inner loop
+** of a SELECT.
+**
+** If srcTab and nColumn are both zero, then the pEList expressions
+** are evaluated in order to get the data for this row. If nColumn>0
+** then data is pulled from srcTab and pEList is used only to get the
+** datatypes for each column.
+*/
+static int selectInnerLoop(
+ Parse *pParse, /* The parser context */
+ Select *p, /* The complete select statement being coded */
+ ExprList *pEList, /* List of values being extracted */
+ int srcTab, /* Pull data from this table */
+ int nColumn, /* Number of columns in the source table */
+ ExprList *pOrderBy, /* If not NULL, sort results using this key */
+ int distinct, /* If >=0, make sure results are distinct */
+ int eDest, /* How to dispose of the results */
+ int iParm, /* An argument to the disposal method */
+ int iContinue, /* Jump here to continue with next row */
+ int iBreak, /* Jump here to break out of the inner loop */
+ char *aff /* affinity string if eDest is SRT_Union */
+){
+ Vdbe *v = pParse->pVdbe;
+ int i;
+ int hasDistinct; /* True if the DISTINCT keyword is present */
+
+ if( v==0 ) return 0;
+ assert( pEList!=0 );
+
+ /* If there was a LIMIT clause on the SELECT statement, then do the check
+ ** to see if this row should be output.
+ */
+ hasDistinct = distinct>=0 && pEList && pEList->nExpr>0;
+ if( pOrderBy==0 && !hasDistinct ){
+ codeLimiter(v, p, iContinue, iBreak, 0);
+ }
+
+ /* Pull the requested columns.
+ */
+ if( nColumn>0 ){
+ for(i=0; i<nColumn; i++){
+ sqlite3VdbeAddOp(v, OP_Column, srcTab, i);
+ }
+ }else{
+ nColumn = pEList->nExpr;
+ sqlite3ExprCodeExprList(pParse, pEList);
+ }
+
+ /* If the DISTINCT keyword was present on the SELECT statement
+ ** and this row has been seen before, then do not make this row
+ ** part of the result.
+ */
+ if( hasDistinct ){
+ int n = pEList->nExpr;
+ codeDistinct(v, distinct, iContinue, n, n+1);
+ if( pOrderBy==0 ){
+ codeLimiter(v, p, iContinue, iBreak, nColumn);
+ }
+ }
+
+ switch( eDest ){
+ /* In this mode, write each query result to the key of the temporary
+ ** table iParm.
+ */
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
+ case SRT_Union: {
+ sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT);
+ if( aff ){
+ sqlite3VdbeChangeP3(v, -1, aff, P3_STATIC);
+ }
+ sqlite3VdbeAddOp(v, OP_IdxInsert, iParm, 0);
+ break;
+ }
+
+ /* Construct a record from the query result, but instead of
+ ** saving that record, use it as a key to delete elements from
+ ** the temporary table iParm.
+ */
+ case SRT_Except: {
+ int addr;
+ addr = sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT);
+ sqlite3VdbeChangeP3(v, -1, aff, P3_STATIC);
+ sqlite3VdbeAddOp(v, OP_NotFound, iParm, addr+3);
+ sqlite3VdbeAddOp(v, OP_Delete, iParm, 0);
+ break;
+ }
+#endif
+
+ /* Store the result as data using a unique key.
+ */
+ case SRT_Table:
+ case SRT_VirtualTab: {
+ sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
+ if( pOrderBy ){
+ pushOntoSorter(pParse, v, pOrderBy);
+ }else{
+ sqlite3VdbeAddOp(v, OP_NewRowid, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Insert, iParm, 0);
+ }
+ break;
+ }
+
+#ifndef SQLITE_OMIT_SUBQUERY
+ /* If we are creating a set for an "expr IN (SELECT ...)" construct,
+ ** then there should be a single item on the stack. Write this
+ ** item into the set table with bogus data.
+ */
+ case SRT_Set: {
+ int addr1 = sqlite3VdbeCurrentAddr(v);
+ int addr2;
+
+ assert( nColumn==1 );
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, addr1+3);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ addr2 = sqlite3VdbeAddOp(v, OP_Goto, 0, 0);
+ if( pOrderBy ){
+ /* At first glance you would think we could optimize out the
+ ** ORDER BY in this case since the order of entries in the set
+ ** does not matter. But there might be a LIMIT clause, in which
+ ** case the order does matter */
+ pushOntoSorter(pParse, v, pOrderBy);
+ }else{
+ char aff = (iParm>>16)&0xFF;
+ aff = sqlite3CompareAffinity(pEList->a[0].pExpr, aff);
+ sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &aff, 1);
+ sqlite3VdbeAddOp(v, OP_IdxInsert, (iParm&0x0000FFFF), 0);
+ }
+ sqlite3VdbeJumpHere(v, addr2);
+ break;
+ }
+
+ /* If this is a scalar select that is part of an expression, then
+ ** store the results in the appropriate memory cell and break out
+ ** of the scan loop.
+ */
+ case SRT_Exists:
+ case SRT_Mem: {
+ assert( nColumn==1 );
+ if( pOrderBy ){
+ pushOntoSorter(pParse, v, pOrderBy);
+ }else{
+ sqlite3VdbeAddOp(v, OP_MemStore, iParm, 1);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, iBreak);
+ }
+ break;
+ }
+#endif /* #ifndef SQLITE_OMIT_SUBQUERY */
+
+ /* Send the data to the callback function or to a subroutine. In the
+ ** case of a subroutine, the subroutine itself is responsible for
+ ** popping the data from the stack.
+ */
+ case SRT_Subroutine:
+ case SRT_Callback: {
+ if( pOrderBy ){
+ sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
+ pushOntoSorter(pParse, v, pOrderBy);
+ }else if( eDest==SRT_Subroutine ){
+ sqlite3VdbeAddOp(v, OP_Gosub, 0, iParm);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Callback, nColumn, 0);
+ }
+ break;
+ }
+
+#if !defined(SQLITE_OMIT_TRIGGER)
+ /* Discard the results. This is used for SELECT statements inside
+ ** the body of a TRIGGER. The purpose of such selects is to call
+ ** user-defined functions that have side effects. We do not care
+ ** about the actual results of the select.
+ */
+ default: {
+ assert( eDest==SRT_Discard );
+ sqlite3VdbeAddOp(v, OP_Pop, nColumn, 0);
+ break;
+ }
+#endif
+ }
+ return 0;
+}
+
+/*
+** Given an expression list, generate a KeyInfo structure that records
+** the collating sequence for each expression in that expression list.
+**
+** If the ExprList is an ORDER BY or GROUP BY clause then the resulting
+** KeyInfo structure is appropriate for initializing a virtual index to
+** implement that clause. If the ExprList is the result set of a SELECT
+** then the KeyInfo structure is appropriate for initializing a virtual
+** index to implement a DISTINCT test.
+**
+** Space to hold the KeyInfo structure is obtain from malloc. The calling
+** function is responsible for seeing that this structure is eventually
+** freed. Add the KeyInfo structure to the P3 field of an opcode using
+** P3_KEYINFO_HANDOFF is the usual way of dealing with this.
+*/
+static KeyInfo *keyInfoFromExprList(Parse *pParse, ExprList *pList){
+ sqlite3 *db = pParse->db;
+ int nExpr;
+ KeyInfo *pInfo;
+ struct ExprList_item *pItem;
+ int i;
+
+ nExpr = pList->nExpr;
+ pInfo = sqliteMalloc( sizeof(*pInfo) + nExpr*(sizeof(CollSeq*)+1) );
+ if( pInfo ){
+ pInfo->aSortOrder = (char*)&pInfo->aColl[nExpr];
+ pInfo->nField = nExpr;
+ pInfo->enc = db->enc;
+ for(i=0, pItem=pList->a; i<nExpr; i++, pItem++){
+ CollSeq *pColl;
+ pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr);
+ if( !pColl ){
+ pColl = db->pDfltColl;
+ }
+ pInfo->aColl[i] = pColl;
+ pInfo->aSortOrder[i] = pItem->sortOrder;
+ }
+ }
+ return pInfo;
+}
+
+
+/*
+** If the inner loop was generated using a non-null pOrderBy argument,
+** then the results were placed in a sorter. After the loop is terminated
+** we need to run the sorter and output the results. The following
+** routine generates the code needed to do that.
+*/
+static void generateSortTail(
+ Parse *pParse, /* The parsing context */
+ Select *p, /* The SELECT statement */
+ Vdbe *v, /* Generate code into this VDBE */
+ int nColumn, /* Number of columns of data */
+ int eDest, /* Write the sorted results here */
+ int iParm /* Optional parameter associated with eDest */
+){
+ int brk = sqlite3VdbeMakeLabel(v);
+ int cont = sqlite3VdbeMakeLabel(v);
+ int addr;
+ int iTab;
+ ExprList *pOrderBy = p->pOrderBy;
+
+ iTab = pOrderBy->iECursor;
+ addr = 1 + sqlite3VdbeAddOp(v, OP_Sort, iTab, brk);
+ codeLimiter(v, p, cont, brk, 0);
+ sqlite3VdbeAddOp(v, OP_Column, iTab, pOrderBy->nExpr + 1);
+ switch( eDest ){
+ case SRT_Table:
+ case SRT_VirtualTab: {
+ sqlite3VdbeAddOp(v, OP_NewRowid, iParm, 0);
+ sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Insert, iParm, 0);
+ break;
+ }
+#ifndef SQLITE_OMIT_SUBQUERY
+ case SRT_Set: {
+ assert( nColumn==1 );
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, "n", P3_STATIC);
+ sqlite3VdbeAddOp(v, OP_IdxInsert, (iParm&0x0000FFFF), 0);
+ break;
+ }
+ case SRT_Exists:
+ case SRT_Mem: {
+ assert( nColumn==1 );
+ sqlite3VdbeAddOp(v, OP_MemStore, iParm, 1);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, brk);
+ break;
+ }
+#endif
+ case SRT_Callback:
+ case SRT_Subroutine: {
+ int i;
+ sqlite3VdbeAddOp(v, OP_Integer, p->pEList->nExpr, 0);
+ sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ for(i=0; i<nColumn; i++){
+ sqlite3VdbeAddOp(v, OP_Column, -1-i, i);
+ }
+ if( eDest==SRT_Callback ){
+ sqlite3VdbeAddOp(v, OP_Callback, nColumn, 0);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Gosub, 0, iParm);
+ }
+ sqlite3VdbeAddOp(v, OP_Pop, 2, 0);
+ break;
+ }
+ default: {
+ /* Do nothing */
+ break;
+ }
+ }
+ sqlite3VdbeResolveLabel(v, cont);
+ sqlite3VdbeAddOp(v, OP_Next, iTab, addr);
+ sqlite3VdbeResolveLabel(v, brk);
+}
+
+/*
+** Return a pointer to a string containing the 'declaration type' of the
+** expression pExpr. The string may be treated as static by the caller.
+**
+** If the declaration type is the exact datatype definition extracted from
+** the original CREATE TABLE statement if the expression is a column.
+**
+** The declaration type for an expression is either TEXT, NUMERIC or ANY.
+** The declaration type for a ROWID field is INTEGER.
+*/
+static const char *columnType(NameContext *pNC, Expr *pExpr){
+ char const *zType;
+ int j;
+ if( pExpr==0 || pNC->pSrcList==0 ) return 0;
+
+ /* The TK_AS operator can only occur in ORDER BY, GROUP BY, HAVING,
+ ** and LIMIT clauses. But pExpr originates in the result set of a
+ ** SELECT. So pExpr can never contain an AS operator.
+ */
+ assert( pExpr->op!=TK_AS );
+
+ switch( pExpr->op ){
+ case TK_COLUMN: {
+ Table *pTab = 0;
+ int iCol = pExpr->iColumn;
+ while( pNC && !pTab ){
+ SrcList *pTabList = pNC->pSrcList;
+ for(j=0;j<pTabList->nSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++);
+ if( j<pTabList->nSrc ){
+ pTab = pTabList->a[j].pTab;
+ }else{
+ pNC = pNC->pNext;
+ }
+ }
+ if( pTab==0 ){
+ /* FIX ME:
+ ** This can occurs if you have something like "SELECT new.x;" inside
+ ** a trigger. In other words, if you reference the special "new"
+ ** table in the result set of a select. We do not have a good way
+ ** to find the actual table type, so call it "TEXT". This is really
+ ** something of a bug, but I do not know how to fix it.
+ **
+ ** This code does not produce the correct answer - it just prevents
+ ** a segfault. See ticket #1229.
+ */
+ zType = "TEXT";
+ break;
+ }
+ assert( pTab );
+ if( iCol<0 ) iCol = pTab->iPKey;
+ assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
+ if( iCol<0 ){
+ zType = "INTEGER";
+ }else{
+ zType = pTab->aCol[iCol].zType;
+ }
+ break;
+ }
+#ifndef SQLITE_OMIT_SUBQUERY
+ case TK_SELECT: {
+ NameContext sNC;
+ Select *pS = pExpr->pSelect;
+ sNC.pSrcList = pExpr->pSelect->pSrc;
+ sNC.pNext = pNC;
+ zType = columnType(&sNC, pS->pEList->a[0].pExpr);
+ break;
+ }
+#endif
+ default:
+ zType = 0;
+ }
+
+ return zType;
+}
+
+/*
+** Generate code that will tell the VDBE the declaration types of columns
+** in the result set.
+*/
+static void generateColumnTypes(
+ Parse *pParse, /* Parser context */
+ SrcList *pTabList, /* List of tables */
+ ExprList *pEList /* Expressions defining the result set */
+){
+ Vdbe *v = pParse->pVdbe;
+ int i;
+ NameContext sNC;
+ sNC.pSrcList = pTabList;
+ for(i=0; i<pEList->nExpr; i++){
+ Expr *p = pEList->a[i].pExpr;
+ const char *zType = columnType(&sNC, p);
+ if( zType==0 ) continue;
+ /* The vdbe must make it's own copy of the column-type, in case the
+ ** schema is reset before this virtual machine is deleted.
+ */
+ sqlite3VdbeSetColName(v, i+pEList->nExpr, zType, strlen(zType));
+ }
+}
+
+/*
+** Generate code that will tell the VDBE the names of columns
+** in the result set. This information is used to provide the
+** azCol[] values in the callback.
+*/
+static void generateColumnNames(
+ Parse *pParse, /* Parser context */
+ SrcList *pTabList, /* List of tables */
+ ExprList *pEList /* Expressions defining the result set */
+){
+ Vdbe *v = pParse->pVdbe;
+ int i, j;
+ sqlite3 *db = pParse->db;
+ int fullNames, shortNames;
+
+#ifndef SQLITE_OMIT_EXPLAIN
+ /* If this is an EXPLAIN, skip this step */
+ if( pParse->explain ){
+ return;
+ }
+#endif
+
+ assert( v!=0 );
+ if( pParse->colNamesSet || v==0 || sqlite3_malloc_failed ) return;
+ pParse->colNamesSet = 1;
+ fullNames = (db->flags & SQLITE_FullColNames)!=0;
+ shortNames = (db->flags & SQLITE_ShortColNames)!=0;
+ sqlite3VdbeSetNumCols(v, pEList->nExpr);
+ for(i=0; i<pEList->nExpr; i++){
+ Expr *p;
+ p = pEList->a[i].pExpr;
+ if( p==0 ) continue;
+ if( pEList->a[i].zName ){
+ char *zName = pEList->a[i].zName;
+ sqlite3VdbeSetColName(v, i, zName, strlen(zName));
+ continue;
+ }
+ if( p->op==TK_COLUMN && pTabList ){
+ Table *pTab;
+ char *zCol;
+ int iCol = p->iColumn;
+ for(j=0; j<pTabList->nSrc && pTabList->a[j].iCursor!=p->iTable; j++){}
+ assert( j<pTabList->nSrc );
+ pTab = pTabList->a[j].pTab;
+ if( iCol<0 ) iCol = pTab->iPKey;
+ assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
+ if( iCol<0 ){
+ zCol = "rowid";
+ }else{
+ zCol = pTab->aCol[iCol].zName;
+ }
+ if( !shortNames && !fullNames && p->span.z && p->span.z[0] ){
+ sqlite3VdbeSetColName(v, i, p->span.z, p->span.n);
+ }else if( fullNames || (!shortNames && pTabList->nSrc>1) ){
+ char *zName = 0;
+ char *zTab;
+
+ zTab = pTabList->a[j].zAlias;
+ if( fullNames || zTab==0 ) zTab = pTab->zName;
+ sqlite3SetString(&zName, zTab, ".", zCol, 0);
+ sqlite3VdbeSetColName(v, i, zName, P3_DYNAMIC);
+ }else{
+ sqlite3VdbeSetColName(v, i, zCol, strlen(zCol));
+ }
+ }else if( p->span.z && p->span.z[0] ){
+ sqlite3VdbeSetColName(v, i, p->span.z, p->span.n);
+ /* sqlite3VdbeCompressSpace(v, addr); */
+ }else{
+ char zName[30];
+ assert( p->op!=TK_COLUMN || pTabList==0 );
+ sprintf(zName, "column%d", i+1);
+ sqlite3VdbeSetColName(v, i, zName, 0);
+ }
+ }
+ generateColumnTypes(pParse, pTabList, pEList);
+}
+
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
+/*
+** Name of the connection operator, used for error messages.
+*/
+static const char *selectOpName(int id){
+ char *z;
+ switch( id ){
+ case TK_ALL: z = "UNION ALL"; break;
+ case TK_INTERSECT: z = "INTERSECT"; break;
+ case TK_EXCEPT: z = "EXCEPT"; break;
+ default: z = "UNION"; break;
+ }
+ return z;
+}
+#endif /* SQLITE_OMIT_COMPOUND_SELECT */
+
+/*
+** Forward declaration
+*/
+static int prepSelectStmt(Parse*, Select*);
+
+/*
+** Given a SELECT statement, generate a Table structure that describes
+** the result set of that SELECT.
+*/
+Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
+ Table *pTab;
+ int i, j;
+ ExprList *pEList;
+ Column *aCol, *pCol;
+
+ if( prepSelectStmt(pParse, pSelect) ){
+ return 0;
+ }
+ if( sqlite3SelectResolve(pParse, pSelect, 0) ){
+ return 0;
+ }
+ pTab = sqliteMalloc( sizeof(Table) );
+ if( pTab==0 ){
+ return 0;
+ }
+ pTab->nRef = 1;
+ pTab->zName = zTabName ? sqliteStrDup(zTabName) : 0;
+ pEList = pSelect->pEList;
+ pTab->nCol = pEList->nExpr;
+ assert( pTab->nCol>0 );
+ pTab->aCol = aCol = sqliteMalloc( sizeof(pTab->aCol[0])*pTab->nCol );
+ for(i=0, pCol=aCol; i<pTab->nCol; i++, pCol++){
+ Expr *p, *pR;
+ char *zType;
+ char *zName;
+ char *zBasename;
+ int cnt;
+ NameContext sNC;
+
+ /* Get an appropriate name for the column
+ */
+ p = pEList->a[i].pExpr;
+ assert( p->pRight==0 || p->pRight->token.z==0 || p->pRight->token.z[0]!=0 );
+ if( (zName = pEList->a[i].zName)!=0 ){
+ /* If the column contains an "AS <name>" phrase, use <name> as the name */
+ zName = sqliteStrDup(zName);
+ }else if( p->op==TK_DOT
+ && (pR=p->pRight)!=0 && pR->token.z && pR->token.z[0] ){
+ /* For columns of the from A.B use B as the name */
+ zName = sqlite3MPrintf("%T", &pR->token);
+ }else if( p->span.z && p->span.z[0] ){
+ /* Use the original text of the column expression as its name */
+ zName = sqlite3MPrintf("%T", &p->span);
+ }else{
+ /* If all else fails, make up a name */
+ zName = sqlite3MPrintf("column%d", i+1);
+ }
+ sqlite3Dequote(zName);
+ if( sqlite3_malloc_failed ){
+ sqliteFree(zName);
+ sqlite3DeleteTable(0, pTab);
+ return 0;
+ }
+
+ /* Make sure the column name is unique. If the name is not unique,
+ ** append a integer to the name so that it becomes unique.
+ */
+ zBasename = zName;
+ for(j=cnt=0; j<i; j++){
+ if( sqlite3StrICmp(aCol[j].zName, zName)==0 ){
+ zName = sqlite3MPrintf("%s:%d", zBasename, ++cnt);
+ j = -1;
+ if( zName==0 ) break;
+ }
+ }
+ if( zBasename!=zName ){
+ sqliteFree(zBasename);
+ }
+ pCol->zName = zName;
+
+ /* Get the typename, type affinity, and collating sequence for the
+ ** column.
+ */
+ memset(&sNC, 0, sizeof(sNC));
+ sNC.pSrcList = pSelect->pSrc;
+ zType = sqliteStrDup(columnType(&sNC, p));
+ pCol->zType = zType;
+ pCol->affinity = sqlite3ExprAffinity(p);
+ pCol->pColl = sqlite3ExprCollSeq(pParse, p);
+ if( !pCol->pColl ){
+ pCol->pColl = pParse->db->pDfltColl;
+ }
+ }
+ pTab->iPKey = -1;
+ return pTab;
+}
+
+/*
+** Prepare a SELECT statement for processing by doing the following
+** things:
+**
+** (1) Make sure VDBE cursor numbers have been assigned to every
+** element of the FROM clause.
+**
+** (2) Fill in the pTabList->a[].pTab fields in the SrcList that
+** defines FROM clause. When views appear in the FROM clause,
+** fill pTabList->a[].pSelect with a copy of the SELECT statement
+** that implements the view. A copy is made of the view's SELECT
+** statement so that we can freely modify or delete that statement
+** without worrying about messing up the presistent representation
+** of the view.
+**
+** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword
+** on joins and the ON and USING clause of joins.
+**
+** (4) Scan the list of columns in the result set (pEList) looking
+** for instances of the "*" operator or the TABLE.* operator.
+** If found, expand each "*" to be every column in every table
+** and TABLE.* to be every column in TABLE.
+**
+** Return 0 on success. If there are problems, leave an error message
+** in pParse and return non-zero.
+*/
+static int prepSelectStmt(Parse *pParse, Select *p){
+ int i, j, k, rc;
+ SrcList *pTabList;
+ ExprList *pEList;
+ Table *pTab;
+ struct SrcList_item *pFrom;
+
+ if( p==0 || p->pSrc==0 || sqlite3_malloc_failed ) return 1;
+ pTabList = p->pSrc;
+ pEList = p->pEList;
+
+ /* Make sure cursor numbers have been assigned to all entries in
+ ** the FROM clause of the SELECT statement.
+ */
+ sqlite3SrcListAssignCursors(pParse, p->pSrc);
+
+ /* Look up every table named in the FROM clause of the select. If
+ ** an entry of the FROM clause is a subquery instead of a table or view,
+ ** then create a transient table structure to describe the subquery.
+ */
+ for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
+ if( pFrom->pTab!=0 ){
+ /* This statement has already been prepared. There is no need
+ ** to go further. */
+ assert( i==0 );
+ return 0;
+ }
+ if( pFrom->zName==0 ){
+#ifndef SQLITE_OMIT_SUBQUERY
+ /* A sub-query in the FROM clause of a SELECT */
+ assert( pFrom->pSelect!=0 );
+ if( pFrom->zAlias==0 ){
+ pFrom->zAlias =
+ sqlite3MPrintf("sqlite_subquery_%p_", (void*)pFrom->pSelect);
+ }
+ assert( pFrom->pTab==0 );
+ pFrom->pTab = pTab =
+ sqlite3ResultSetOfSelect(pParse, pFrom->zAlias, pFrom->pSelect);
+ if( pTab==0 ){
+ return 1;
+ }
+ /* The isTransient flag indicates that the Table structure has been
+ ** dynamically allocated and may be freed at any time. In other words,
+ ** pTab is not pointing to a persistent table structure that defines
+ ** part of the schema. */
+ pTab->isTransient = 1;
+#endif
+ }else{
+ /* An ordinary table or view name in the FROM clause */
+ assert( pFrom->pTab==0 );
+ pFrom->pTab = pTab =
+ sqlite3LocateTable(pParse,pFrom->zName,pFrom->zDatabase);
+ if( pTab==0 ){
+ return 1;
+ }
+ pTab->nRef++;
+#ifndef SQLITE_OMIT_VIEW
+ if( pTab->pSelect ){
+ /* We reach here if the named table is a really a view */
+ if( sqlite3ViewGetColumnNames(pParse, pTab) ){
+ return 1;
+ }
+ /* If pFrom->pSelect!=0 it means we are dealing with a
+ ** view within a view. The SELECT structure has already been
+ ** copied by the outer view so we can skip the copy step here
+ ** in the inner view.
+ */
+ if( pFrom->pSelect==0 ){
+ pFrom->pSelect = sqlite3SelectDup(pTab->pSelect);
+ }
+ }
+#endif
+ }
+ }
+
+ /* Process NATURAL keywords, and ON and USING clauses of joins.
+ */
+ if( sqliteProcessJoin(pParse, p) ) return 1;
+
+ /* For every "*" that occurs in the column list, insert the names of
+ ** all columns in all tables. And for every TABLE.* insert the names
+ ** of all columns in TABLE. The parser inserted a special expression
+ ** with the TK_ALL operator for each "*" that it found in the column list.
+ ** The following code just has to locate the TK_ALL expressions and expand
+ ** each one to the list of all columns in all tables.
+ **
+ ** The first loop just checks to see if there are any "*" operators
+ ** that need expanding.
+ */
+ for(k=0; k<pEList->nExpr; k++){
+ Expr *pE = pEList->a[k].pExpr;
+ if( pE->op==TK_ALL ) break;
+ if( pE->op==TK_DOT && pE->pRight && pE->pRight->op==TK_ALL
+ && pE->pLeft && pE->pLeft->op==TK_ID ) break;
+ }
+ rc = 0;
+ if( k<pEList->nExpr ){
+ /*
+ ** If we get here it means the result set contains one or more "*"
+ ** operators that need to be expanded. Loop through each expression
+ ** in the result set and expand them one by one.
+ */
+ struct ExprList_item *a = pEList->a;
+ ExprList *pNew = 0;
+ int flags = pParse->db->flags;
+ int longNames = (flags & SQLITE_FullColNames)!=0 &&
+ (flags & SQLITE_ShortColNames)==0;
+
+ for(k=0; k<pEList->nExpr; k++){
+ Expr *pE = a[k].pExpr;
+ if( pE->op!=TK_ALL &&
+ (pE->op!=TK_DOT || pE->pRight==0 || pE->pRight->op!=TK_ALL) ){
+ /* This particular expression does not need to be expanded.
+ */
+ pNew = sqlite3ExprListAppend(pNew, a[k].pExpr, 0);
+ pNew->a[pNew->nExpr-1].zName = a[k].zName;
+ a[k].pExpr = 0;
+ a[k].zName = 0;
+ }else{
+ /* This expression is a "*" or a "TABLE.*" and needs to be
+ ** expanded. */
+ int tableSeen = 0; /* Set to 1 when TABLE matches */
+ char *zTName; /* text of name of TABLE */
+ if( pE->op==TK_DOT && pE->pLeft ){
+ zTName = sqlite3NameFromToken(&pE->pLeft->token);
+ }else{
+ zTName = 0;
+ }
+ for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
+ Table *pTab = pFrom->pTab;
+ char *zTabName = pFrom->zAlias;
+ if( zTabName==0 || zTabName[0]==0 ){
+ zTabName = pTab->zName;
+ }
+ if( zTName && (zTabName==0 || zTabName[0]==0 ||
+ sqlite3StrICmp(zTName, zTabName)!=0) ){
+ continue;
+ }
+ tableSeen = 1;
+ for(j=0; j<pTab->nCol; j++){
+ Expr *pExpr, *pLeft, *pRight;
+ char *zName = pTab->aCol[j].zName;
+
+ if( i>0 ){
+ struct SrcList_item *pLeft = &pTabList->a[i-1];
+ if( (pLeft->jointype & JT_NATURAL)!=0 &&
+ columnIndex(pLeft->pTab, zName)>=0 ){
+ /* In a NATURAL join, omit the join columns from the
+ ** table on the right */
+ continue;
+ }
+ if( sqlite3IdListIndex(pLeft->pUsing, zName)>=0 ){
+ /* In a join with a USING clause, omit columns in the
+ ** using clause from the table on the right. */
+ continue;
+ }
+ }
+ pRight = sqlite3Expr(TK_ID, 0, 0, 0);
+ if( pRight==0 ) break;
+ setToken(&pRight->token, zName);
+ if( zTabName && (longNames || pTabList->nSrc>1) ){
+ pLeft = sqlite3Expr(TK_ID, 0, 0, 0);
+ pExpr = sqlite3Expr(TK_DOT, pLeft, pRight, 0);
+ if( pExpr==0 ) break;
+ setToken(&pLeft->token, zTabName);
+ setToken(&pExpr->span, sqlite3MPrintf("%s.%s", zTabName, zName));
+ pExpr->span.dyn = 1;
+ pExpr->token.z = 0;
+ pExpr->token.n = 0;
+ pExpr->token.dyn = 0;
+ }else{
+ pExpr = pRight;
+ pExpr->span = pExpr->token;
+ }
+ if( longNames ){
+ pNew = sqlite3ExprListAppend(pNew, pExpr, &pExpr->span);
+ }else{
+ pNew = sqlite3ExprListAppend(pNew, pExpr, &pRight->token);
+ }
+ }
+ }
+ if( !tableSeen ){
+ if( zTName ){
+ sqlite3ErrorMsg(pParse, "no such table: %s", zTName);
+ }else{
+ sqlite3ErrorMsg(pParse, "no tables specified");
+ }
+ rc = 1;
+ }
+ sqliteFree(zTName);
+ }
+ }
+ sqlite3ExprListDelete(pEList);
+ p->pEList = pNew;
+ }
+ return rc;
+}
+
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
+/*
+** This routine associates entries in an ORDER BY expression list with
+** columns in a result. For each ORDER BY expression, the opcode of
+** the top-level node is changed to TK_COLUMN and the iColumn value of
+** the top-level node is filled in with column number and the iTable
+** value of the top-level node is filled with iTable parameter.
+**
+** If there are prior SELECT clauses, they are processed first. A match
+** in an earlier SELECT takes precedence over a later SELECT.
+**
+** Any entry that does not match is flagged as an error. The number
+** of errors is returned.
+*/
+static int matchOrderbyToColumn(
+ Parse *pParse, /* A place to leave error messages */
+ Select *pSelect, /* Match to result columns of this SELECT */
+ ExprList *pOrderBy, /* The ORDER BY values to match against columns */
+ int iTable, /* Insert this value in iTable */
+ int mustComplete /* If TRUE all ORDER BYs must match */
+){
+ int nErr = 0;
+ int i, j;
+ ExprList *pEList;
+
+ if( pSelect==0 || pOrderBy==0 ) return 1;
+ if( mustComplete ){
+ for(i=0; i<pOrderBy->nExpr; i++){ pOrderBy->a[i].done = 0; }
+ }
+ if( prepSelectStmt(pParse, pSelect) ){
+ return 1;
+ }
+ if( pSelect->pPrior ){
+ if( matchOrderbyToColumn(pParse, pSelect->pPrior, pOrderBy, iTable, 0) ){
+ return 1;
+ }
+ }
+ pEList = pSelect->pEList;
+ for(i=0; i<pOrderBy->nExpr; i++){
+ Expr *pE = pOrderBy->a[i].pExpr;
+ int iCol = -1;
+ if( pOrderBy->a[i].done ) continue;
+ if( sqlite3ExprIsInteger(pE, &iCol) ){
+ if( iCol<=0 || iCol>pEList->nExpr ){
+ sqlite3ErrorMsg(pParse,
+ "ORDER BY position %d should be between 1 and %d",
+ iCol, pEList->nExpr);
+ nErr++;
+ break;
+ }
+ if( !mustComplete ) continue;
+ iCol--;
+ }
+ for(j=0; iCol<0 && j<pEList->nExpr; j++){
+ if( pEList->a[j].zName && (pE->op==TK_ID || pE->op==TK_STRING) ){
+ char *zName, *zLabel;
+ zName = pEList->a[j].zName;
+ zLabel = sqlite3NameFromToken(&pE->token);
+ assert( zLabel!=0 );
+ if( sqlite3StrICmp(zName, zLabel)==0 ){
+ iCol = j;
+ }
+ sqliteFree(zLabel);
+ }
+ if( iCol<0 && sqlite3ExprCompare(pE, pEList->a[j].pExpr) ){
+ iCol = j;
+ }
+ }
+ if( iCol>=0 ){
+ pE->op = TK_COLUMN;
+ pE->iColumn = iCol;
+ pE->iTable = iTable;
+ pE->iAgg = -1;
+ pOrderBy->a[i].done = 1;
+ }
+ if( iCol<0 && mustComplete ){
+ sqlite3ErrorMsg(pParse,
+ "ORDER BY term number %d does not match any result column", i+1);
+ nErr++;
+ break;
+ }
+ }
+ return nErr;
+}
+#endif /* #ifndef SQLITE_OMIT_COMPOUND_SELECT */
+
+/*
+** Get a VDBE for the given parser context. Create a new one if necessary.
+** If an error occurs, return NULL and leave a message in pParse.
+*/
+Vdbe *sqlite3GetVdbe(Parse *pParse){
+ Vdbe *v = pParse->pVdbe;
+ if( v==0 ){
+ v = pParse->pVdbe = sqlite3VdbeCreate(pParse->db);
+ }
+ return v;
+}
+
+/*
+** Compute the iLimit and iOffset fields of the SELECT based on the
+** pLimit and pOffset expressions. nLimit and nOffset hold the expressions
+** that appear in the original SQL statement after the LIMIT and OFFSET
+** keywords. Or NULL if those keywords are omitted. iLimit and iOffset
+** are the integer memory register numbers for counters used to compute
+** the limit and offset. If there is no limit and/or offset, then
+** iLimit and iOffset are negative.
+**
+** This routine changes the values if iLimit and iOffset only if
+** a limit or offset is defined by nLimit and nOffset. iLimit and
+** iOffset should have been preset to appropriate default values
+** (usually but not always -1) prior to calling this routine.
+** Only if nLimit>=0 or nOffset>0 do the limit registers get
+** redefined. The UNION ALL operator uses this property to force
+** the reuse of the same limit and offset registers across multiple
+** SELECT statements.
+*/
+static void computeLimitRegisters(Parse *pParse, Select *p){
+ /*
+ ** "LIMIT -1" always shows all rows. There is some
+ ** contraversy about what the correct behavior should be.
+ ** The current implementation interprets "LIMIT 0" to mean
+ ** no rows.
+ */
+ if( p->pLimit ){
+ int iMem = pParse->nMem++;
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ if( v==0 ) return;
+ sqlite3ExprCode(pParse, p->pLimit);
+ sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Negative, 0, 0);
+ sqlite3VdbeAddOp(v, OP_MemStore, iMem, 1);
+ VdbeComment((v, "# LIMIT counter"));
+ p->iLimit = iMem;
+ }
+ if( p->pOffset ){
+ int iMem = pParse->nMem++;
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ if( v==0 ) return;
+ sqlite3ExprCode(pParse, p->pOffset);
+ sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Negative, 0, 0);
+ sqlite3VdbeAddOp(v, OP_MemStore, iMem, 1);
+ VdbeComment((v, "# OFFSET counter"));
+ p->iOffset = iMem;
+ }
+}
+
+/*
+** Allocate a virtual index to use for sorting.
+*/
+static void createSortingIndex(Parse *pParse, Select *p, ExprList *pOrderBy){
+ if( pOrderBy ){
+ int addr;
+ assert( pOrderBy->iECursor==0 );
+ pOrderBy->iECursor = pParse->nTab++;
+ addr = sqlite3VdbeAddOp(pParse->pVdbe, OP_OpenVirtual,
+ pOrderBy->iECursor, pOrderBy->nExpr+1);
+ assert( p->addrOpenVirt[2] == -1 );
+ p->addrOpenVirt[2] = addr;
+ }
+}
+
+/*
+** The opcode at addr is an OP_OpenVirtual that created a sorting
+** index tha we ended up not needing. This routine changes that
+** opcode to OP_Noop.
+*/
+static void uncreateSortingIndex(Parse *pParse, int addr){
+ Vdbe *v = pParse->pVdbe;
+ VdbeOp *pOp = sqlite3VdbeGetOp(v, addr);
+ sqlite3VdbeChangeP3(v, addr, 0, 0);
+ pOp->opcode = OP_Noop;
+ pOp->p1 = 0;
+ pOp->p2 = 0;
+}
+
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
+/*
+** Return the appropriate collating sequence for the iCol-th column of
+** the result set for the compound-select statement "p". Return NULL if
+** the column has no default collating sequence.
+**
+** The collating sequence for the compound select is taken from the
+** left-most term of the select that has a collating sequence.
+*/
+static CollSeq *multiSelectCollSeq(Parse *pParse, Select *p, int iCol){
+ CollSeq *pRet;
+ if( p->pPrior ){
+ pRet = multiSelectCollSeq(pParse, p->pPrior, iCol);
+ }else{
+ pRet = 0;
+ }
+ if( pRet==0 ){
+ pRet = sqlite3ExprCollSeq(pParse, p->pEList->a[iCol].pExpr);
+ }
+ return pRet;
+}
+#endif /* SQLITE_OMIT_COMPOUND_SELECT */
+
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
+/*
+** This routine is called to process a query that is really the union
+** or intersection of two or more separate queries.
+**
+** "p" points to the right-most of the two queries. the query on the
+** left is p->pPrior. The left query could also be a compound query
+** in which case this routine will be called recursively.
+**
+** The results of the total query are to be written into a destination
+** of type eDest with parameter iParm.
+**
+** Example 1: Consider a three-way compound SQL statement.
+**
+** SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3
+**
+** This statement is parsed up as follows:
+**
+** SELECT c FROM t3
+** |
+** `-----> SELECT b FROM t2
+** |
+** `------> SELECT a FROM t1
+**
+** The arrows in the diagram above represent the Select.pPrior pointer.
+** So if this routine is called with p equal to the t3 query, then
+** pPrior will be the t2 query. p->op will be TK_UNION in this case.
+**
+** Notice that because of the way SQLite parses compound SELECTs, the
+** individual selects always group from left to right.
+*/
+static int multiSelect(
+ Parse *pParse, /* Parsing context */
+ Select *p, /* The right-most of SELECTs to be coded */
+ int eDest, /* \___ Store query results as specified */
+ int iParm, /* / by these two parameters. */
+ char *aff /* If eDest is SRT_Union, the affinity string */
+){
+ int rc = SQLITE_OK; /* Success code from a subroutine */
+ Select *pPrior; /* Another SELECT immediately to our left */
+ Vdbe *v; /* Generate code to this VDBE */
+ int nCol; /* Number of columns in the result set */
+ ExprList *pOrderBy; /* The ORDER BY clause on p */
+ int aSetP2[2]; /* Set P2 value of these op to number of columns */
+ int nSetP2 = 0; /* Number of slots in aSetP2[] used */
+
+ /* Make sure there is no ORDER BY or LIMIT clause on prior SELECTs. Only
+ ** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT.
+ */
+ if( p==0 || p->pPrior==0 ){
+ rc = 1;
+ goto multi_select_end;
+ }
+ pPrior = p->pPrior;
+ assert( pPrior->pRightmost!=pPrior );
+ assert( pPrior->pRightmost==p->pRightmost );
+ if( pPrior->pOrderBy ){
+ sqlite3ErrorMsg(pParse,"ORDER BY clause should come after %s not before",
+ selectOpName(p->op));
+ rc = 1;
+ goto multi_select_end;
+ }
+ if( pPrior->pLimit ){
+ sqlite3ErrorMsg(pParse,"LIMIT clause should come after %s not before",
+ selectOpName(p->op));
+ rc = 1;
+ goto multi_select_end;
+ }
+
+ /* Make sure we have a valid query engine. If not, create a new one.
+ */
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ){
+ rc = 1;
+ goto multi_select_end;
+ }
+
+ /* Create the destination temporary table if necessary
+ */
+ if( eDest==SRT_VirtualTab ){
+ assert( p->pEList );
+ assert( nSetP2<sizeof(aSetP2)/sizeof(aSetP2[0]) );
+ aSetP2[nSetP2++] = sqlite3VdbeAddOp(v, OP_OpenVirtual, iParm, 0);
+ eDest = SRT_Table;
+ }
+
+ /* Generate code for the left and right SELECT statements.
+ */
+ pOrderBy = p->pOrderBy;
+ switch( p->op ){
+ case TK_ALL: {
+ if( pOrderBy==0 ){
+ assert( !pPrior->pLimit );
+ pPrior->pLimit = p->pLimit;
+ pPrior->pOffset = p->pOffset;
+ rc = sqlite3Select(pParse, pPrior, eDest, iParm, 0, 0, 0, aff);
+ if( rc ){
+ goto multi_select_end;
+ }
+ p->pPrior = 0;
+ p->iLimit = pPrior->iLimit;
+ p->iOffset = pPrior->iOffset;
+ p->pLimit = 0;
+ p->pOffset = 0;
+ rc = sqlite3Select(pParse, p, eDest, iParm, 0, 0, 0, aff);
+ p->pPrior = pPrior;
+ if( rc ){
+ goto multi_select_end;
+ }
+ break;
+ }
+ /* For UNION ALL ... ORDER BY fall through to the next case */
+ }
+ case TK_EXCEPT:
+ case TK_UNION: {
+ int unionTab; /* Cursor number of the temporary table holding result */
+ int op = 0; /* One of the SRT_ operations to apply to self */
+ int priorOp; /* The SRT_ operation to apply to prior selects */
+ Expr *pLimit, *pOffset; /* Saved values of p->nLimit and p->nOffset */
+ int addr;
+
+ priorOp = p->op==TK_ALL ? SRT_Table : SRT_Union;
+ if( eDest==priorOp && pOrderBy==0 && !p->pLimit && !p->pOffset ){
+ /* We can reuse a temporary table generated by a SELECT to our
+ ** right.
+ */
+ unionTab = iParm;
+ }else{
+ /* We will need to create our own temporary table to hold the
+ ** intermediate results.
+ */
+ unionTab = pParse->nTab++;
+ if( pOrderBy && matchOrderbyToColumn(pParse, p, pOrderBy, unionTab,1) ){
+ rc = 1;
+ goto multi_select_end;
+ }
+ addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, unionTab, 0);
+ if( priorOp==SRT_Table ){
+ assert( nSetP2<sizeof(aSetP2)/sizeof(aSetP2[0]) );
+ aSetP2[nSetP2++] = addr;
+ }else{
+ assert( p->addrOpenVirt[0] == -1 );
+ p->addrOpenVirt[0] = addr;
+ p->pRightmost->usesVirt = 1;
+ }
+ createSortingIndex(pParse, p, pOrderBy);
+ assert( p->pEList );
+ }
+
+ /* Code the SELECT statements to our left
+ */
+ assert( !pPrior->pOrderBy );
+ rc = sqlite3Select(pParse, pPrior, priorOp, unionTab, 0, 0, 0, aff);
+ if( rc ){
+ goto multi_select_end;
+ }
+
+ /* Code the current SELECT statement
+ */
+ switch( p->op ){
+ case TK_EXCEPT: op = SRT_Except; break;
+ case TK_UNION: op = SRT_Union; break;
+ case TK_ALL: op = SRT_Table; break;
+ }
+ p->pPrior = 0;
+ p->pOrderBy = 0;
+ p->disallowOrderBy = pOrderBy!=0;
+ pLimit = p->pLimit;
+ p->pLimit = 0;
+ pOffset = p->pOffset;
+ p->pOffset = 0;
+ rc = sqlite3Select(pParse, p, op, unionTab, 0, 0, 0, aff);
+ p->pPrior = pPrior;
+ p->pOrderBy = pOrderBy;
+ sqlite3ExprDelete(p->pLimit);
+ p->pLimit = pLimit;
+ p->pOffset = pOffset;
+ p->iLimit = -1;
+ p->iOffset = -1;
+ if( rc ){
+ goto multi_select_end;
+ }
+
+
+ /* Convert the data in the temporary table into whatever form
+ ** it is that we currently need.
+ */
+ if( eDest!=priorOp || unionTab!=iParm ){
+ int iCont, iBreak, iStart;
+ assert( p->pEList );
+ if( eDest==SRT_Callback ){
+ generateColumnNames(pParse, 0, p->pEList);
+ }
+ iBreak = sqlite3VdbeMakeLabel(v);
+ iCont = sqlite3VdbeMakeLabel(v);
+ sqlite3VdbeAddOp(v, OP_Rewind, unionTab, iBreak);
+ computeLimitRegisters(pParse, p);
+ iStart = sqlite3VdbeCurrentAddr(v);
+ rc = selectInnerLoop(pParse, p, p->pEList, unionTab, p->pEList->nExpr,
+ pOrderBy, -1, eDest, iParm,
+ iCont, iBreak, 0);
+ if( rc ){
+ rc = 1;
+ goto multi_select_end;
+ }
+ sqlite3VdbeResolveLabel(v, iCont);
+ sqlite3VdbeAddOp(v, OP_Next, unionTab, iStart);
+ sqlite3VdbeResolveLabel(v, iBreak);
+ sqlite3VdbeAddOp(v, OP_Close, unionTab, 0);
+ }
+ break;
+ }
+ case TK_INTERSECT: {
+ int tab1, tab2;
+ int iCont, iBreak, iStart;
+ Expr *pLimit, *pOffset;
+ int addr;
+
+ /* INTERSECT is different from the others since it requires
+ ** two temporary tables. Hence it has its own case. Begin
+ ** by allocating the tables we will need.
+ */
+ tab1 = pParse->nTab++;
+ tab2 = pParse->nTab++;
+ if( pOrderBy && matchOrderbyToColumn(pParse,p,pOrderBy,tab1,1) ){
+ rc = 1;
+ goto multi_select_end;
+ }
+ createSortingIndex(pParse, p, pOrderBy);
+
+ addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, tab1, 0);
+ assert( p->addrOpenVirt[0] == -1 );
+ p->addrOpenVirt[0] = addr;
+ p->pRightmost->usesVirt = 1;
+ assert( p->pEList );
+
+ /* Code the SELECTs to our left into temporary table "tab1".
+ */
+ rc = sqlite3Select(pParse, pPrior, SRT_Union, tab1, 0, 0, 0, aff);
+ if( rc ){
+ goto multi_select_end;
+ }
+
+ /* Code the current SELECT into temporary table "tab2"
+ */
+ addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, tab2, 0);
+ assert( p->addrOpenVirt[1] == -1 );
+ p->addrOpenVirt[1] = addr;
+ p->pPrior = 0;
+ pLimit = p->pLimit;
+ p->pLimit = 0;
+ pOffset = p->pOffset;
+ p->pOffset = 0;
+ rc = sqlite3Select(pParse, p, SRT_Union, tab2, 0, 0, 0, aff);
+ p->pPrior = pPrior;
+ sqlite3ExprDelete(p->pLimit);
+ p->pLimit = pLimit;
+ p->pOffset = pOffset;
+ if( rc ){
+ goto multi_select_end;
+ }
+
+ /* Generate code to take the intersection of the two temporary
+ ** tables.
+ */
+ assert( p->pEList );
+ if( eDest==SRT_Callback ){
+ generateColumnNames(pParse, 0, p->pEList);
+ }
+ iBreak = sqlite3VdbeMakeLabel(v);
+ iCont = sqlite3VdbeMakeLabel(v);
+ sqlite3VdbeAddOp(v, OP_Rewind, tab1, iBreak);
+ computeLimitRegisters(pParse, p);
+ iStart = sqlite3VdbeAddOp(v, OP_RowKey, tab1, 0);
+ sqlite3VdbeAddOp(v, OP_NotFound, tab2, iCont);
+ rc = selectInnerLoop(pParse, p, p->pEList, tab1, p->pEList->nExpr,
+ pOrderBy, -1, eDest, iParm,
+ iCont, iBreak, 0);
+ if( rc ){
+ rc = 1;
+ goto multi_select_end;
+ }
+ sqlite3VdbeResolveLabel(v, iCont);
+ sqlite3VdbeAddOp(v, OP_Next, tab1, iStart);
+ sqlite3VdbeResolveLabel(v, iBreak);
+ sqlite3VdbeAddOp(v, OP_Close, tab2, 0);
+ sqlite3VdbeAddOp(v, OP_Close, tab1, 0);
+ break;
+ }
+ }
+
+ /* Make sure all SELECTs in the statement have the same number of elements
+ ** in their result sets.
+ */
+ assert( p->pEList && pPrior->pEList );
+ if( p->pEList->nExpr!=pPrior->pEList->nExpr ){
+ sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s"
+ " do not have the same number of result columns", selectOpName(p->op));
+ rc = 1;
+ goto multi_select_end;
+ }
+
+ /* Set the number of columns in temporary tables
+ */
+ nCol = p->pEList->nExpr;
+ while( nSetP2 ){
+ sqlite3VdbeChangeP2(v, aSetP2[--nSetP2], nCol);
+ }
+
+ /* Compute collating sequences used by either the ORDER BY clause or
+ ** by any temporary tables needed to implement the compound select.
+ ** Attach the KeyInfo structure to all temporary tables. Invoke the
+ ** ORDER BY processing if there is an ORDER BY clause.
+ **
+ ** This section is run by the right-most SELECT statement only.
+ ** SELECT statements to the left always skip this part. The right-most
+ ** SELECT might also skip this part if it has no ORDER BY clause and
+ ** no temp tables are required.
+ */
+ if( pOrderBy || p->usesVirt ){
+ int i; /* Loop counter */
+ KeyInfo *pKeyInfo; /* Collating sequence for the result set */
+ Select *pLoop; /* For looping through SELECT statements */
+ CollSeq **apColl;
+ CollSeq **aCopy;
+
+ assert( p->pRightmost==p );
+ pKeyInfo = sqliteMalloc(sizeof(*pKeyInfo)+nCol*2*sizeof(CollSeq*) + nCol);
+ if( !pKeyInfo ){
+ rc = SQLITE_NOMEM;
+ goto multi_select_end;
+ }
+
+ pKeyInfo->enc = pParse->db->enc;
+ pKeyInfo->nField = nCol;
+
+ for(i=0, apColl=pKeyInfo->aColl; i<nCol; i++, apColl++){
+ *apColl = multiSelectCollSeq(pParse, p, i);
+ if( 0==*apColl ){
+ *apColl = pParse->db->pDfltColl;
+ }
+ }
+
+ for(pLoop=p; pLoop; pLoop=pLoop->pPrior){
+ for(i=0; i<2; i++){
+ int addr = pLoop->addrOpenVirt[i];
+ if( addr<0 ){
+ /* If [0] is unused then [1] is also unused. So we can
+ ** always safely abort as soon as the first unused slot is found */
+ assert( pLoop->addrOpenVirt[1]<0 );
+ break;
+ }
+ sqlite3VdbeChangeP2(v, addr, nCol);
+ sqlite3VdbeChangeP3(v, addr, (char*)pKeyInfo, P3_KEYINFO);
+ }
+ }
+
+ if( pOrderBy ){
+ struct ExprList_item *pOTerm = pOrderBy->a;
+ int nExpr = pOrderBy->nExpr;
+ int addr;
+ u8 *pSortOrder;
+
+ aCopy = (CollSeq**)&pKeyInfo[1];
+ pSortOrder = pKeyInfo->aSortOrder = (u8*)&aCopy[nExpr];
+ memcpy(aCopy, pKeyInfo->aColl, nCol*sizeof(CollSeq*));
+ apColl = pKeyInfo->aColl;
+ for(i=0; i<pOrderBy->nExpr; i++, pOTerm++, apColl++, pSortOrder++){
+ Expr *pExpr = pOTerm->pExpr;
+ char *zName = pOTerm->zName;
+ assert( pExpr->op==TK_COLUMN && pExpr->iColumn<nCol );
+ if( zName ){
+ *apColl = sqlite3LocateCollSeq(pParse, zName, -1);
+ }else{
+ *apColl = aCopy[pExpr->iColumn];
+ }
+ *pSortOrder = pOTerm->sortOrder;
+ }
+ assert( p->pRightmost==p );
+ assert( p->addrOpenVirt[2]>=0 );
+ addr = p->addrOpenVirt[2];
+ sqlite3VdbeChangeP2(v, addr, p->pEList->nExpr+2);
+ pKeyInfo->nField = pOrderBy->nExpr;
+ sqlite3VdbeChangeP3(v, addr, (char*)pKeyInfo, P3_KEYINFO_HANDOFF);
+ pKeyInfo = 0;
+ generateSortTail(pParse, p, v, p->pEList->nExpr, eDest, iParm);
+ }
+
+ sqliteFree(pKeyInfo);
+ }
+
+multi_select_end:
+ return rc;
+}
+#endif /* SQLITE_OMIT_COMPOUND_SELECT */
+
+#ifndef SQLITE_OMIT_VIEW
+/*
+** Scan through the expression pExpr. Replace every reference to
+** a column in table number iTable with a copy of the iColumn-th
+** entry in pEList. (But leave references to the ROWID column
+** unchanged.)
+**
+** This routine is part of the flattening procedure. A subquery
+** whose result set is defined by pEList appears as entry in the
+** FROM clause of a SELECT such that the VDBE cursor assigned to that
+** FORM clause entry is iTable. This routine make the necessary
+** changes to pExpr so that it refers directly to the source table
+** of the subquery rather the result set of the subquery.
+*/
+static void substExprList(ExprList*,int,ExprList*); /* Forward Decl */
+static void substSelect(Select *, int, ExprList *); /* Forward Decl */
+static void substExpr(Expr *pExpr, int iTable, ExprList *pEList){
+ if( pExpr==0 ) return;
+ if( pExpr->op==TK_COLUMN && pExpr->iTable==iTable ){
+ if( pExpr->iColumn<0 ){
+ pExpr->op = TK_NULL;
+ }else{
+ Expr *pNew;
+ assert( pEList!=0 && pExpr->iColumn<pEList->nExpr );
+ assert( pExpr->pLeft==0 && pExpr->pRight==0 && pExpr->pList==0 );
+ pNew = pEList->a[pExpr->iColumn].pExpr;
+ assert( pNew!=0 );
+ pExpr->op = pNew->op;
+ assert( pExpr->pLeft==0 );
+ pExpr->pLeft = sqlite3ExprDup(pNew->pLeft);
+ assert( pExpr->pRight==0 );
+ pExpr->pRight = sqlite3ExprDup(pNew->pRight);
+ assert( pExpr->pList==0 );
+ pExpr->pList = sqlite3ExprListDup(pNew->pList);
+ pExpr->iTable = pNew->iTable;
+ pExpr->iColumn = pNew->iColumn;
+ pExpr->iAgg = pNew->iAgg;
+ sqlite3TokenCopy(&pExpr->token, &pNew->token);
+ sqlite3TokenCopy(&pExpr->span, &pNew->span);
+ pExpr->pSelect = sqlite3SelectDup(pNew->pSelect);
+ pExpr->flags = pNew->flags;
+ }
+ }else{
+ substExpr(pExpr->pLeft, iTable, pEList);
+ substExpr(pExpr->pRight, iTable, pEList);
+ substSelect(pExpr->pSelect, iTable, pEList);
+ substExprList(pExpr->pList, iTable, pEList);
+ }
+}
+static void substExprList(ExprList *pList, int iTable, ExprList *pEList){
+ int i;
+ if( pList==0 ) return;
+ for(i=0; i<pList->nExpr; i++){
+ substExpr(pList->a[i].pExpr, iTable, pEList);
+ }
+}
+static void substSelect(Select *p, int iTable, ExprList *pEList){
+ if( !p ) return;
+ substExprList(p->pEList, iTable, pEList);
+ substExprList(p->pGroupBy, iTable, pEList);
+ substExprList(p->pOrderBy, iTable, pEList);
+ substExpr(p->pHaving, iTable, pEList);
+ substExpr(p->pWhere, iTable, pEList);
+}
+#endif /* !defined(SQLITE_OMIT_VIEW) */
+
+#ifndef SQLITE_OMIT_VIEW
+/*
+** This routine attempts to flatten subqueries in order to speed
+** execution. It returns 1 if it makes changes and 0 if no flattening
+** occurs.
+**
+** To understand the concept of flattening, consider the following
+** query:
+**
+** SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5
+**
+** The default way of implementing this query is to execute the
+** subquery first and store the results in a temporary table, then
+** run the outer query on that temporary table. This requires two
+** passes over the data. Furthermore, because the temporary table
+** has no indices, the WHERE clause on the outer query cannot be
+** optimized.
+**
+** This routine attempts to rewrite queries such as the above into
+** a single flat select, like this:
+**
+** SELECT x+y AS a FROM t1 WHERE z<100 AND a>5
+**
+** The code generated for this simpification gives the same result
+** but only has to scan the data once. And because indices might
+** exist on the table t1, a complete scan of the data might be
+** avoided.
+**
+** Flattening is only attempted if all of the following are true:
+**
+** (1) The subquery and the outer query do not both use aggregates.
+**
+** (2) The subquery is not an aggregate or the outer query is not a join.
+**
+** (3) The subquery is not the right operand of a left outer join, or
+** the subquery is not itself a join. (Ticket #306)
+**
+** (4) The subquery is not DISTINCT or the outer query is not a join.
+**
+** (5) The subquery is not DISTINCT or the outer query does not use
+** aggregates.
+**
+** (6) The subquery does not use aggregates or the outer query is not
+** DISTINCT.
+**
+** (7) The subquery has a FROM clause.
+**
+** (8) The subquery does not use LIMIT or the outer query is not a join.
+**
+** (9) The subquery does not use LIMIT or the outer query does not use
+** aggregates.
+**
+** (10) The subquery does not use aggregates or the outer query does not
+** use LIMIT.
+**
+** (11) The subquery and the outer query do not both have ORDER BY clauses.
+**
+** (12) The subquery is not the right term of a LEFT OUTER JOIN or the
+** subquery has no WHERE clause. (added by ticket #350)
+**
+** In this routine, the "p" parameter is a pointer to the outer query.
+** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query
+** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
+**
+** If flattening is not attempted, this routine is a no-op and returns 0.
+** If flattening is attempted this routine returns 1.
+**
+** All of the expression analysis must occur on both the outer query and
+** the subquery before this routine runs.
+*/
+static int flattenSubquery(
+ Parse *pParse, /* The parsing context */
+ Select *p, /* The parent or outer SELECT statement */
+ int iFrom, /* Index in p->pSrc->a[] of the inner subquery */
+ int isAgg, /* True if outer SELECT uses aggregate functions */
+ int subqueryIsAgg /* True if the subquery uses aggregate functions */
+){
+ Select *pSub; /* The inner query or "subquery" */
+ SrcList *pSrc; /* The FROM clause of the outer query */
+ SrcList *pSubSrc; /* The FROM clause of the subquery */
+ ExprList *pList; /* The result set of the outer query */
+ int iParent; /* VDBE cursor number of the pSub result set temp table */
+ int i; /* Loop counter */
+ Expr *pWhere; /* The WHERE clause */
+ struct SrcList_item *pSubitem; /* The subquery */
+
+ /* Check to see if flattening is permitted. Return 0 if not.
+ */
+ if( p==0 ) return 0;
+ pSrc = p->pSrc;
+ assert( pSrc && iFrom>=0 && iFrom<pSrc->nSrc );
+ pSubitem = &pSrc->a[iFrom];
+ pSub = pSubitem->pSelect;
+ assert( pSub!=0 );
+ if( isAgg && subqueryIsAgg ) return 0;
+ if( subqueryIsAgg && pSrc->nSrc>1 ) return 0;
+ pSubSrc = pSub->pSrc;
+ assert( pSubSrc );
+ if( (pSub->pLimit && p->pLimit) || pSub->pOffset ||
+ (pSub->pLimit && isAgg) ) return 0;
+ if( pSubSrc->nSrc==0 ) return 0;
+ if( pSub->isDistinct && (pSrc->nSrc>1 || isAgg) ){
+ return 0;
+ }
+ if( p->isDistinct && subqueryIsAgg ) return 0;
+ if( (p->disallowOrderBy || p->pOrderBy) && pSub->pOrderBy ) return 0;
+
+ /* Restriction 3: If the subquery is a join, make sure the subquery is
+ ** not used as the right operand of an outer join. Examples of why this
+ ** is not allowed:
+ **
+ ** t1 LEFT OUTER JOIN (t2 JOIN t3)
+ **
+ ** If we flatten the above, we would get
+ **
+ ** (t1 LEFT OUTER JOIN t2) JOIN t3
+ **
+ ** which is not at all the same thing.
+ */
+ if( pSubSrc->nSrc>1 && iFrom>0 && (pSrc->a[iFrom-1].jointype & JT_OUTER)!=0 ){
+ return 0;
+ }
+
+ /* Restriction 12: If the subquery is the right operand of a left outer
+ ** join, make sure the subquery has no WHERE clause.
+ ** An examples of why this is not allowed:
+ **
+ ** t1 LEFT OUTER JOIN (SELECT * FROM t2 WHERE t2.x>0)
+ **
+ ** If we flatten the above, we would get
+ **
+ ** (t1 LEFT OUTER JOIN t2) WHERE t2.x>0
+ **
+ ** But the t2.x>0 test will always fail on a NULL row of t2, which
+ ** effectively converts the OUTER JOIN into an INNER JOIN.
+ */
+ if( iFrom>0 && (pSrc->a[iFrom-1].jointype & JT_OUTER)!=0
+ && pSub->pWhere!=0 ){
+ return 0;
+ }
+
+ /* If we reach this point, it means flattening is permitted for the
+ ** iFrom-th entry of the FROM clause in the outer query.
+ */
+
+ /* Move all of the FROM elements of the subquery into the
+ ** the FROM clause of the outer query. Before doing this, remember
+ ** the cursor number for the original outer query FROM element in
+ ** iParent. The iParent cursor will never be used. Subsequent code
+ ** will scan expressions looking for iParent references and replace
+ ** those references with expressions that resolve to the subquery FROM
+ ** elements we are now copying in.
+ */
+ iParent = pSubitem->iCursor;
+ {
+ int nSubSrc = pSubSrc->nSrc;
+ int jointype = pSubitem->jointype;
+
+ sqlite3DeleteTable(0, pSubitem->pTab);
+ sqliteFree(pSubitem->zDatabase);
+ sqliteFree(pSubitem->zName);
+ sqliteFree(pSubitem->zAlias);
+ if( nSubSrc>1 ){
+ int extra = nSubSrc - 1;
+ for(i=1; i<nSubSrc; i++){
+ pSrc = sqlite3SrcListAppend(pSrc, 0, 0);
+ }
+ p->pSrc = pSrc;
+ for(i=pSrc->nSrc-1; i-extra>=iFrom; i--){
+ pSrc->a[i] = pSrc->a[i-extra];
+ }
+ }
+ for(i=0; i<nSubSrc; i++){
+ pSrc->a[i+iFrom] = pSubSrc->a[i];
+ memset(&pSubSrc->a[i], 0, sizeof(pSubSrc->a[i]));
+ }
+ pSrc->a[iFrom+nSubSrc-1].jointype = jointype;
+ }
+
+ /* Now begin substituting subquery result set expressions for
+ ** references to the iParent in the outer query.
+ **
+ ** Example:
+ **
+ ** SELECT a+5, b*10 FROM (SELECT x*3 AS a, y+10 AS b FROM t1) WHERE a>b;
+ ** \ \_____________ subquery __________/ /
+ ** \_____________________ outer query ______________________________/
+ **
+ ** We look at every expression in the outer query and every place we see
+ ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10".
+ */
+ substExprList(p->pEList, iParent, pSub->pEList);
+ pList = p->pEList;
+ for(i=0; i<pList->nExpr; i++){
+ Expr *pExpr;
+ if( pList->a[i].zName==0 && (pExpr = pList->a[i].pExpr)->span.z!=0 ){
+ pList->a[i].zName = sqliteStrNDup(pExpr->span.z, pExpr->span.n);
+ }
+ }
+ if( isAgg ){
+ substExprList(p->pGroupBy, iParent, pSub->pEList);
+ substExpr(p->pHaving, iParent, pSub->pEList);
+ }
+ if( pSub->pOrderBy ){
+ assert( p->pOrderBy==0 );
+ p->pOrderBy = pSub->pOrderBy;
+ pSub->pOrderBy = 0;
+ }else if( p->pOrderBy ){
+ substExprList(p->pOrderBy, iParent, pSub->pEList);
+ }
+ if( pSub->pWhere ){
+ pWhere = sqlite3ExprDup(pSub->pWhere);
+ }else{
+ pWhere = 0;
+ }
+ if( subqueryIsAgg ){
+ assert( p->pHaving==0 );
+ p->pHaving = p->pWhere;
+ p->pWhere = pWhere;
+ substExpr(p->pHaving, iParent, pSub->pEList);
+ p->pHaving = sqlite3ExprAnd(p->pHaving, sqlite3ExprDup(pSub->pHaving));
+ assert( p->pGroupBy==0 );
+ p->pGroupBy = sqlite3ExprListDup(pSub->pGroupBy);
+ }else{
+ substExpr(p->pWhere, iParent, pSub->pEList);
+ p->pWhere = sqlite3ExprAnd(p->pWhere, pWhere);
+ }
+
+ /* The flattened query is distinct if either the inner or the
+ ** outer query is distinct.
+ */
+ p->isDistinct = p->isDistinct || pSub->isDistinct;
+
+ /*
+ ** SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y;
+ */
+ if( pSub->pLimit ){
+ p->pLimit = pSub->pLimit;
+ pSub->pLimit = 0;
+ }
+
+ /* Finially, delete what is left of the subquery and return
+ ** success.
+ */
+ sqlite3SelectDelete(pSub);
+ return 1;
+}
+#endif /* SQLITE_OMIT_VIEW */
+
+/*
+** Analyze the SELECT statement passed in as an argument to see if it
+** is a simple min() or max() query. If it is and this query can be
+** satisfied using a single seek to the beginning or end of an index,
+** then generate the code for this SELECT and return 1. If this is not a
+** simple min() or max() query, then return 0;
+**
+** A simply min() or max() query looks like this:
+**
+** SELECT min(a) FROM table;
+** SELECT max(a) FROM table;
+**
+** The query may have only a single table in its FROM argument. There
+** can be no GROUP BY or HAVING or WHERE clauses. The result set must
+** be the min() or max() of a single column of the table. The column
+** in the min() or max() function must be indexed.
+**
+** The parameters to this routine are the same as for sqlite3Select().
+** See the header comment on that routine for additional information.
+*/
+static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
+ Expr *pExpr;
+ int iCol;
+ Table *pTab;
+ Index *pIdx;
+ int base;
+ Vdbe *v;
+ int seekOp;
+ int cont;
+ ExprList *pEList, *pList, eList;
+ struct ExprList_item eListItem;
+ SrcList *pSrc;
+
+ /* Check to see if this query is a simple min() or max() query. Return
+ ** zero if it is not.
+ */
+ if( p->pGroupBy || p->pHaving || p->pWhere ) return 0;
+ pSrc = p->pSrc;
+ if( pSrc->nSrc!=1 ) return 0;
+ pEList = p->pEList;
+ if( pEList->nExpr!=1 ) return 0;
+ pExpr = pEList->a[0].pExpr;
+ if( pExpr->op!=TK_AGG_FUNCTION ) return 0;
+ pList = pExpr->pList;
+ if( pList==0 || pList->nExpr!=1 ) return 0;
+ if( pExpr->token.n!=3 ) return 0;
+ if( sqlite3StrNICmp(pExpr->token.z,"min",3)==0 ){
+ seekOp = OP_Rewind;
+ }else if( sqlite3StrNICmp(pExpr->token.z,"max",3)==0 ){
+ seekOp = OP_Last;
+ }else{
+ return 0;
+ }
+ pExpr = pList->a[0].pExpr;
+ if( pExpr->op!=TK_COLUMN ) return 0;
+ iCol = pExpr->iColumn;
+ pTab = pSrc->a[0].pTab;
+
+ /* If we get to here, it means the query is of the correct form.
+ ** Check to make sure we have an index and make pIdx point to the
+ ** appropriate index. If the min() or max() is on an INTEGER PRIMARY
+ ** key column, no index is necessary so set pIdx to NULL. If no
+ ** usable index is found, return 0.
+ */
+ if( iCol<0 ){
+ pIdx = 0;
+ }else{
+ CollSeq *pColl = sqlite3ExprCollSeq(pParse, pExpr);
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ assert( pIdx->nColumn>=1 );
+ if( pIdx->aiColumn[0]==iCol && pIdx->keyInfo.aColl[0]==pColl ) break;
+ }
+ if( pIdx==0 ) return 0;
+ }
+
+ /* Identify column types if we will be using the callback. This
+ ** step is skipped if the output is going to a table or a memory cell.
+ ** The column names have already been generated in the calling function.
+ */
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) return 0;
+
+ /* If the output is destined for a temporary table, open that table.
+ */
+ if( eDest==SRT_VirtualTab ){
+ sqlite3VdbeAddOp(v, OP_OpenVirtual, iParm, 1);
+ }
+
+ /* Generating code to find the min or the max. Basically all we have
+ ** to do is find the first or the last entry in the chosen index. If
+ ** the min() or max() is on the INTEGER PRIMARY KEY, then find the first
+ ** or last entry in the main table.
+ */
+ sqlite3CodeVerifySchema(pParse, pTab->iDb);
+ base = pSrc->a[0].iCursor;
+ computeLimitRegisters(pParse, p);
+ if( pSrc->a[0].pSelect==0 ){
+ sqlite3OpenTableForReading(v, base, pTab);
+ }
+ cont = sqlite3VdbeMakeLabel(v);
+ if( pIdx==0 ){
+ sqlite3VdbeAddOp(v, seekOp, base, 0);
+ }else{
+ /* Even though the cursor used to open the index here is closed
+ ** as soon as a single value has been read from it, allocate it
+ ** using (pParse->nTab++) to prevent the cursor id from being
+ ** reused. This is important for statements of the form
+ ** "INSERT INTO x SELECT max() FROM x".
+ */
+ int iIdx;
+ iIdx = pParse->nTab++;
+ sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
+ sqlite3VdbeOp3(v, OP_OpenRead, iIdx, pIdx->tnum,
+ (char*)&pIdx->keyInfo, P3_KEYINFO);
+ if( seekOp==OP_Rewind ){
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ sqlite3VdbeAddOp(v, OP_MakeRecord, 1, 0);
+ seekOp = OP_MoveGt;
+ }
+ sqlite3VdbeAddOp(v, seekOp, iIdx, 0);
+ sqlite3VdbeAddOp(v, OP_IdxRowid, iIdx, 0);
+ sqlite3VdbeAddOp(v, OP_Close, iIdx, 0);
+ sqlite3VdbeAddOp(v, OP_MoveGe, base, 0);
+ }
+ eList.nExpr = 1;
+ memset(&eListItem, 0, sizeof(eListItem));
+ eList.a = &eListItem;
+ eList.a[0].pExpr = pExpr;
+ selectInnerLoop(pParse, p, &eList, 0, 0, 0, -1, eDest, iParm, cont, cont, 0);
+ sqlite3VdbeResolveLabel(v, cont);
+ sqlite3VdbeAddOp(v, OP_Close, base, 0);
+
+ return 1;
+}
+
+/*
+** Analyze and ORDER BY or GROUP BY clause in a SELECT statement. Return
+** the number of errors seen.
+**
+** An ORDER BY or GROUP BY is a list of expressions. If any expression
+** is an integer constant, then that expression is replaced by the
+** corresponding entry in the result set.
+*/
+static int processOrderGroupBy(
+ NameContext *pNC, /* Name context of the SELECT statement. */
+ ExprList *pOrderBy, /* The ORDER BY or GROUP BY clause to be processed */
+ const char *zType /* Either "ORDER" or "GROUP", as appropriate */
+){
+ int i;
+ ExprList *pEList = pNC->pEList; /* The result set of the SELECT */
+ Parse *pParse = pNC->pParse; /* The result set of the SELECT */
+ assert( pEList );
+
+ if( pOrderBy==0 ) return 0;
+ for(i=0; i<pOrderBy->nExpr; i++){
+ int iCol;
+ Expr *pE = pOrderBy->a[i].pExpr;
+ if( sqlite3ExprIsInteger(pE, &iCol) ){
+ if( iCol>0 && iCol<=pEList->nExpr ){
+ sqlite3ExprDelete(pE);
+ pE = pOrderBy->a[i].pExpr = sqlite3ExprDup(pEList->a[iCol-1].pExpr);
+ }else{
+ sqlite3ErrorMsg(pParse,
+ "%s BY column number %d out of range - should be "
+ "between 1 and %d", zType, iCol, pEList->nExpr);
+ return 1;
+ }
+ }
+ if( sqlite3ExprResolveNames(pNC, pE) ){
+ return 1;
+ }
+ if( sqlite3ExprIsConstant(pE) ){
+ sqlite3ErrorMsg(pParse,
+ "%s BY terms must not be non-integer constants", zType);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/*
+** This routine resolves any names used in the result set of the
+** supplied SELECT statement. If the SELECT statement being resolved
+** is a sub-select, then pOuterNC is a pointer to the NameContext
+** of the parent SELECT.
+*/
+int sqlite3SelectResolve(
+ Parse *pParse, /* The parser context */
+ Select *p, /* The SELECT statement being coded. */
+ NameContext *pOuterNC /* The outer name context. May be NULL. */
+){
+ ExprList *pEList; /* Result set. */
+ int i; /* For-loop variable used in multiple places */
+ NameContext sNC; /* Local name-context */
+ ExprList *pGroupBy; /* The group by clause */
+
+ /* If this routine has run before, return immediately. */
+ if( p->isResolved ){
+ assert( !pOuterNC );
+ return SQLITE_OK;
+ }
+ p->isResolved = 1;
+
+ /* If there have already been errors, do nothing. */
+ if( pParse->nErr>0 ){
+ return SQLITE_ERROR;
+ }
+
+ /* Prepare the select statement. This call will allocate all cursors
+ ** required to handle the tables and subqueries in the FROM clause.
+ */
+ if( prepSelectStmt(pParse, p) ){
+ return SQLITE_ERROR;
+ }
+
+ /* Resolve the expressions in the LIMIT and OFFSET clauses. These
+ ** are not allowed to refer to any names, so pass an empty NameContext.
+ */
+ sNC.pParse = pParse;
+ sNC.hasAgg = 0;
+ sNC.nErr = 0;
+ sNC.nRef = 0;
+ sNC.pEList = 0;
+ sNC.allowAgg = 0;
+ sNC.pSrcList = 0;
+ sNC.pNext = 0;
+ if( sqlite3ExprResolveNames(&sNC, p->pLimit) ||
+ sqlite3ExprResolveNames(&sNC, p->pOffset) ){
+ return SQLITE_ERROR;
+ }
+
+ /* Set up the local name-context to pass to ExprResolveNames() to
+ ** resolve the expression-list.
+ */
+ sNC.allowAgg = 1;
+ sNC.pSrcList = p->pSrc;
+ sNC.pNext = pOuterNC;
+
+ /* Resolve names in the result set. */
+ pEList = p->pEList;
+ if( !pEList ) return SQLITE_ERROR;
+ for(i=0; i<pEList->nExpr; i++){
+ Expr *pX = pEList->a[i].pExpr;
+ if( sqlite3ExprResolveNames(&sNC, pX) ){
+ return SQLITE_ERROR;
+ }
+ }
+
+ /* If there are no aggregate functions in the result-set, and no GROUP BY
+ ** expression, do not allow aggregates in any of the other expressions.
+ */
+ assert( !p->isAgg );
+ pGroupBy = p->pGroupBy;
+ if( pGroupBy || sNC.hasAgg ){
+ p->isAgg = 1;
+ }else{
+ sNC.allowAgg = 0;
+ }
+
+ /* If a HAVING clause is present, then there must be a GROUP BY clause.
+ */
+ if( p->pHaving && !pGroupBy ){
+ sqlite3ErrorMsg(pParse, "a GROUP BY clause is required before HAVING");
+ return SQLITE_ERROR;
+ }
+
+ /* Add the expression list to the name-context before parsing the
+ ** other expressions in the SELECT statement. This is so that
+ ** expressions in the WHERE clause (etc.) can refer to expressions by
+ ** aliases in the result set.
+ **
+ ** Minor point: If this is the case, then the expression will be
+ ** re-evaluated for each reference to it.
+ */
+ sNC.pEList = p->pEList;
+ if( sqlite3ExprResolveNames(&sNC, p->pWhere) ||
+ sqlite3ExprResolveNames(&sNC, p->pHaving) ||
+ processOrderGroupBy(&sNC, p->pOrderBy, "ORDER") ||
+ processOrderGroupBy(&sNC, pGroupBy, "GROUP")
+ ){
+ return SQLITE_ERROR;
+ }
+
+ /* Make sure the GROUP BY clause does not contain aggregate functions.
+ */
+ if( pGroupBy ){
+ struct ExprList_item *pItem;
+
+ for(i=0, pItem=pGroupBy->a; i<pGroupBy->nExpr; i++, pItem++){
+ if( ExprHasProperty(pItem->pExpr, EP_Agg) ){
+ sqlite3ErrorMsg(pParse, "aggregate functions are not allowed in "
+ "the GROUP BY clause");
+ return SQLITE_ERROR;
+ }
+ }
+ }
+
+ return SQLITE_OK;
+}
+
+/*
+** Reset the aggregate accumulator.
+**
+** The aggregate accumulator is a set of memory cells that hold
+** intermediate results while calculating an aggregate. This
+** routine simply stores NULLs in all of those memory cells.
+*/
+static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){
+ Vdbe *v = pParse->pVdbe;
+ int i;
+ struct AggInfo_func *pFunc;
+ if( pAggInfo->nFunc+pAggInfo->nColumn==0 ){
+ return;
+ }
+ for(i=0; i<pAggInfo->nColumn; i++){
+ sqlite3VdbeAddOp(v, OP_MemNull, pAggInfo->aCol[i].iMem, 0);
+ }
+ for(pFunc=pAggInfo->aFunc, i=0; i<pAggInfo->nFunc; i++, pFunc++){
+ sqlite3VdbeAddOp(v, OP_MemNull, pFunc->iMem, 0);
+ if( pFunc->iDistinct>=0 ){
+ Expr *pE = pFunc->pExpr;
+ if( pE->pList==0 || pE->pList->nExpr!=1 ){
+ sqlite3ErrorMsg(pParse, "DISTINCT in aggregate must be followed "
+ "by an expression");
+ pFunc->iDistinct = -1;
+ }else{
+ KeyInfo *pKeyInfo = keyInfoFromExprList(pParse, pE->pList);
+ sqlite3VdbeOp3(v, OP_OpenVirtual, pFunc->iDistinct, 0,
+ (char*)pKeyInfo, P3_KEYINFO_HANDOFF);
+ }
+ }
+ }
+}
+
+/*
+** Invoke the OP_AggFinalize opcode for every aggregate function
+** in the AggInfo structure.
+*/
+static void finalizeAggFunctions(Parse *pParse, AggInfo *pAggInfo){
+ Vdbe *v = pParse->pVdbe;
+ int i;
+ struct AggInfo_func *pF;
+ for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){
+ ExprList *pList = pF->pExpr->pList;
+ sqlite3VdbeOp3(v, OP_AggFinal, pF->iMem, pList ? pList->nExpr : 0,
+ (void*)pF->pFunc, P3_FUNCDEF);
+ }
+}
+
+/*
+** Update the accumulator memory cells for an aggregate based on
+** the current cursor position.
+*/
+static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){
+ Vdbe *v = pParse->pVdbe;
+ int i;
+ struct AggInfo_func *pF;
+ struct AggInfo_col *pC;
+
+ pAggInfo->directMode = 1;
+ for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){
+ int nArg;
+ int addrNext = 0;
+ ExprList *pList = pF->pExpr->pList;
+ if( pList ){
+ nArg = pList->nExpr;
+ sqlite3ExprCodeExprList(pParse, pList);
+ }else{
+ nArg = 0;
+ }
+ if( pF->iDistinct>=0 ){
+ addrNext = sqlite3VdbeMakeLabel(v);
+ assert( nArg==1 );
+ codeDistinct(v, pF->iDistinct, addrNext, 1, 2);
+ }
+ if( pF->pFunc->needCollSeq ){
+ CollSeq *pColl = 0;
+ struct ExprList_item *pItem;
+ int j;
+ for(j=0, pItem=pList->a; !pColl && j<pList->nExpr; j++, pItem++){
+ pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr);
+ }
+ if( !pColl ){
+ pColl = pParse->db->pDfltColl;
+ }
+ sqlite3VdbeOp3(v, OP_CollSeq, 0, 0, (char *)pColl, P3_COLLSEQ);
+ }
+ sqlite3VdbeOp3(v, OP_AggStep, pF->iMem, nArg, (void*)pF->pFunc, P3_FUNCDEF);
+ if( addrNext ){
+ sqlite3VdbeResolveLabel(v, addrNext);
+ }
+ }
+ for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){
+ sqlite3ExprCode(pParse, pC->pExpr);
+ sqlite3VdbeAddOp(v, OP_MemStore, pC->iMem, 1);
+ }
+ pAggInfo->directMode = 0;
+}
+
+
+/*
+** Generate code for the given SELECT statement.
+**
+** The results are distributed in various ways depending on the
+** value of eDest and iParm.
+**
+** eDest Value Result
+** ------------ -------------------------------------------
+** SRT_Callback Invoke the callback for each row of the result.
+**
+** SRT_Mem Store first result in memory cell iParm
+**
+** SRT_Set Store results as keys of table iParm.
+**
+** SRT_Union Store results as a key in a temporary table iParm
+**
+** SRT_Except Remove results from the temporary table iParm.
+**
+** SRT_Table Store results in temporary table iParm
+**
+** The table above is incomplete. Additional eDist value have be added
+** since this comment was written. See the selectInnerLoop() function for
+** a complete listing of the allowed values of eDest and their meanings.
+**
+** This routine returns the number of errors. If any errors are
+** encountered, then an appropriate error message is left in
+** pParse->zErrMsg.
+**
+** This routine does NOT free the Select structure passed in. The
+** calling function needs to do that.
+**
+** The pParent, parentTab, and *pParentAgg fields are filled in if this
+** SELECT is a subquery. This routine may try to combine this SELECT
+** with its parent to form a single flat query. In so doing, it might
+** change the parent query from a non-aggregate to an aggregate query.
+** For that reason, the pParentAgg flag is passed as a pointer, so it
+** can be changed.
+**
+** Example 1: The meaning of the pParent parameter.
+**
+** SELECT * FROM t1 JOIN (SELECT x, count(*) FROM t2) JOIN t3;
+** \ \_______ subquery _______/ /
+** \ /
+** \____________________ outer query ___________________/
+**
+** This routine is called for the outer query first. For that call,
+** pParent will be NULL. During the processing of the outer query, this
+** routine is called recursively to handle the subquery. For the recursive
+** call, pParent will point to the outer query. Because the subquery is
+** the second element in a three-way join, the parentTab parameter will
+** be 1 (the 2nd value of a 0-indexed array.)
+*/
+int sqlite3Select(
+ Parse *pParse, /* The parser context */
+ Select *p, /* The SELECT statement being coded. */
+ int eDest, /* How to dispose of the results */
+ int iParm, /* A parameter used by the eDest disposal method */
+ Select *pParent, /* Another SELECT for which this is a sub-query */
+ int parentTab, /* Index in pParent->pSrc of this query */
+ int *pParentAgg, /* True if pParent uses aggregate functions */
+ char *aff /* If eDest is SRT_Union, the affinity string */
+){
+ int i, j; /* Loop counters */
+ WhereInfo *pWInfo; /* Return from sqlite3WhereBegin() */
+ Vdbe *v; /* The virtual machine under construction */
+ int isAgg; /* True for select lists like "count(*)" */
+ ExprList *pEList; /* List of columns to extract. */
+ SrcList *pTabList; /* List of tables to select from */
+ Expr *pWhere; /* The WHERE clause. May be NULL */
+ ExprList *pOrderBy; /* The ORDER BY clause. May be NULL */
+ ExprList *pGroupBy; /* The GROUP BY clause. May be NULL */
+ Expr *pHaving; /* The HAVING clause. May be NULL */
+ int isDistinct; /* True if the DISTINCT keyword is present */
+ int distinct; /* Table to use for the distinct set */
+ int rc = 1; /* Value to return from this function */
+ int addrSortIndex; /* Address of an OP_OpenVirtual instruction */
+ AggInfo sAggInfo; /* Information used by aggregate queries */
+
+ if( sqlite3_malloc_failed || pParse->nErr || p==0 ) return 1;
+ if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
+ memset(&sAggInfo, 0, sizeof(sAggInfo));
+
+#ifndef SQLITE_OMIT_COMPOUND_SELECT
+ /* If there is are a sequence of queries, do the earlier ones first.
+ */
+ if( p->pPrior ){
+ if( p->pRightmost==0 ){
+ Select *pLoop;
+ for(pLoop=p; pLoop; pLoop=pLoop->pPrior){
+ pLoop->pRightmost = p;
+ }
+ }
+ return multiSelect(pParse, p, eDest, iParm, aff);
+ }
+#endif
+
+ pOrderBy = p->pOrderBy;
+ if( IgnorableOrderby(eDest) ){
+ p->pOrderBy = 0;
+ }
+ if( sqlite3SelectResolve(pParse, p, 0) ){
+ goto select_end;
+ }
+ p->pOrderBy = pOrderBy;
+
+ /* Make local copies of the parameters for this query.
+ */
+ pTabList = p->pSrc;
+ pWhere = p->pWhere;
+ pGroupBy = p->pGroupBy;
+ pHaving = p->pHaving;
+ isAgg = p->isAgg;
+ isDistinct = p->isDistinct;
+ pEList = p->pEList;
+ if( pEList==0 ) goto select_end;
+
+ /*
+ ** Do not even attempt to generate any code if we have already seen
+ ** errors before this routine starts.
+ */
+ if( pParse->nErr>0 ) goto select_end;
+
+ /* If writing to memory or generating a set
+ ** only a single column may be output.
+ */
+ assert( eDest!=SRT_Exists || pEList->nExpr==1 );
+#ifndef SQLITE_OMIT_SUBQUERY
+ if( (eDest==SRT_Mem || eDest==SRT_Set) && pEList->nExpr>1 ){
+ sqlite3ErrorMsg(pParse, "only a single result allowed for "
+ "a SELECT that is part of an expression");
+ goto select_end;
+ }
+#endif
+
+ /* ORDER BY is ignored for some destinations.
+ */
+ if( IgnorableOrderby(eDest) ){
+ pOrderBy = 0;
+ }
+
+ /* Begin generating code.
+ */
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) goto select_end;
+
+ /* Identify column names if we will be using them in a callback. This
+ ** step is skipped if the output is going to some other destination.
+ */
+ if( eDest==SRT_Callback ){
+ generateColumnNames(pParse, pTabList, pEList);
+ }
+
+ /* Generate code for all sub-queries in the FROM clause
+ */
+#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
+ for(i=0; i<pTabList->nSrc; i++){
+ const char *zSavedAuthContext = 0;
+ int needRestoreContext;
+ struct SrcList_item *pItem = &pTabList->a[i];
+
+ if( pItem->pSelect==0 ) continue;
+ if( pItem->zName!=0 ){
+ zSavedAuthContext = pParse->zAuthContext;
+ pParse->zAuthContext = pItem->zName;
+ needRestoreContext = 1;
+ }else{
+ needRestoreContext = 0;
+ }
+ sqlite3Select(pParse, pItem->pSelect, SRT_VirtualTab,
+ pItem->iCursor, p, i, &isAgg, 0);
+ if( needRestoreContext ){
+ pParse->zAuthContext = zSavedAuthContext;
+ }
+ pTabList = p->pSrc;
+ pWhere = p->pWhere;
+ if( !IgnorableOrderby(eDest) ){
+ pOrderBy = p->pOrderBy;
+ }
+ pGroupBy = p->pGroupBy;
+ pHaving = p->pHaving;
+ isDistinct = p->isDistinct;
+ }
+#endif
+
+ /* Check for the special case of a min() or max() function by itself
+ ** in the result set.
+ */
+ if( simpleMinMaxQuery(pParse, p, eDest, iParm) ){
+ rc = 0;
+ goto select_end;
+ }
+
+ /* Check to see if this is a subquery that can be "flattened" into its parent.
+ ** If flattening is a possiblity, do so and return immediately.
+ */
+#ifndef SQLITE_OMIT_VIEW
+ if( pParent && pParentAgg &&
+ flattenSubquery(pParse, pParent, parentTab, *pParentAgg, isAgg) ){
+ if( isAgg ) *pParentAgg = 1;
+ goto select_end;
+ }
+#endif
+
+ /* If there is an ORDER BY clause, resolve any collation sequences
+ ** names that have been explicitly specified and create a sorting index.
+ **
+ ** This sorting index might end up being unused if the data can be
+ ** extracted in pre-sorted order. If that is the case, then the
+ ** OP_OpenVirtual instruction will be changed to an OP_Noop once
+ ** we figure out that the sorting index is not needed. The addrSortIndex
+ ** variable is used to facilitate that change.
+ */
+ if( pOrderBy ){
+ struct ExprList_item *pTerm;
+ KeyInfo *pKeyInfo;
+ for(i=0, pTerm=pOrderBy->a; i<pOrderBy->nExpr; i++, pTerm++){
+ if( pTerm->zName ){
+ pTerm->pExpr->pColl = sqlite3LocateCollSeq(pParse, pTerm->zName, -1);
+ }
+ }
+ if( pParse->nErr ){
+ goto select_end;
+ }
+ pKeyInfo = keyInfoFromExprList(pParse, pOrderBy);
+ pOrderBy->iECursor = pParse->nTab++;
+ p->addrOpenVirt[2] = addrSortIndex =
+ sqlite3VdbeOp3(v, OP_OpenVirtual, pOrderBy->iECursor, pOrderBy->nExpr+2,
+ (char*)pKeyInfo, P3_KEYINFO_HANDOFF);
+ }else{
+ addrSortIndex = -1;
+ }
+
+ /* Set the limiter.
+ */
+ computeLimitRegisters(pParse, p);
+
+ /* If the output is destined for a temporary table, open that table.
+ */
+ if( eDest==SRT_VirtualTab ){
+ sqlite3VdbeAddOp(v, OP_OpenVirtual, iParm, pEList->nExpr);
+ }
+
+
+ /* Initialize the memory cell to NULL for SRT_Mem or 0 for SRT_Exists
+ */
+ if( eDest==SRT_Mem ){
+ sqlite3VdbeAddOp(v, OP_MemNull, iParm, 0);
+ }else if( eDest==SRT_Exists ){
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, iParm);
+ }
+
+ /* Open a virtual index to use for the distinct set.
+ */
+ if( isDistinct ){
+ KeyInfo *pKeyInfo;
+ distinct = pParse->nTab++;
+ pKeyInfo = keyInfoFromExprList(pParse, p->pEList);
+ sqlite3VdbeOp3(v, OP_OpenVirtual, distinct, 0,
+ (char*)pKeyInfo, P3_KEYINFO_HANDOFF);
+ }else{
+ distinct = -1;
+ }
+
+ /* Aggregate and non-aggregate queries are handled differently */
+ if( !isAgg && pGroupBy==0 ){
+ /* This case is for non-aggregate queries
+ ** Begin the database scan
+ */
+ pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pOrderBy);
+ if( pWInfo==0 ) goto select_end;
+
+ /* If sorting index that was created by a prior OP_OpenVirtual
+ ** instruction ended up not being needed, then change the OP_OpenVirtual
+ ** into an OP_Noop.
+ */
+ if( addrSortIndex>=0 && pOrderBy==0 ){
+ uncreateSortingIndex(pParse, addrSortIndex);
+ p->addrOpenVirt[2] = -1;
+ }
+
+ /* Use the standard inner loop
+ */
+ if( selectInnerLoop(pParse, p, pEList, 0, 0, pOrderBy, distinct, eDest,
+ iParm, pWInfo->iContinue, pWInfo->iBreak, aff) ){
+ goto select_end;
+ }
+
+ /* End the database scan loop.
+ */
+ sqlite3WhereEnd(pWInfo);
+ }else{
+ /* This is the processing for aggregate queries */
+ NameContext sNC; /* Name context for processing aggregate information */
+ int iAMem; /* First Mem address for storing current GROUP BY */
+ int iBMem; /* First Mem address for previous GROUP BY */
+ int iUseFlag; /* Mem address holding flag indicating that at least
+ ** one row of the input to the aggregator has been
+ ** processed */
+ int iAbortFlag; /* Mem address which causes query abort if positive */
+ int groupBySort; /* Rows come from source in GROUP BY order */
+
+
+ /* The following variables hold addresses or labels for parts of the
+ ** virtual machine program we are putting together */
+ int addrOutputRow; /* Start of subroutine that outputs a result row */
+ int addrSetAbort; /* Set the abort flag and return */
+ int addrInitializeLoop; /* Start of code that initializes the input loop */
+ int addrTopOfLoop; /* Top of the input loop */
+ int addrGroupByChange; /* Code that runs when any GROUP BY term changes */
+ int addrProcessRow; /* Code to process a single input row */
+ int addrEnd; /* End of all processing */
+ int addrSortingIdx; /* The OP_OpenVirtual for the sorting index */
+ int addrReset; /* Subroutine for resetting the accumulator */
+
+ addrEnd = sqlite3VdbeMakeLabel(v);
+
+ /* Convert TK_COLUMN nodes into TK_AGG_COLUMN and make entries in
+ ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the
+ ** SELECT statement.
+ */
+ memset(&sNC, 0, sizeof(sNC));
+ sNC.pParse = pParse;
+ sNC.pSrcList = pTabList;
+ sNC.pAggInfo = &sAggInfo;
+ sAggInfo.nSortingColumn = pGroupBy ? pGroupBy->nExpr+1 : 0;
+ sAggInfo.pGroupBy = pGroupBy;
+ if( sqlite3ExprAnalyzeAggList(&sNC, pEList) ){
+ goto select_end;
+ }
+ if( sqlite3ExprAnalyzeAggList(&sNC, pOrderBy) ){
+ goto select_end;
+ }
+ if( pHaving && sqlite3ExprAnalyzeAggregates(&sNC, pHaving) ){
+ goto select_end;
+ }
+ sAggInfo.nAccumulator = sAggInfo.nColumn;
+ for(i=0; i<sAggInfo.nFunc; i++){
+ if( sqlite3ExprAnalyzeAggList(&sNC, sAggInfo.aFunc[i].pExpr->pList) ){
+ goto select_end;
+ }
+ }
+ if( sqlite3_malloc_failed ) goto select_end;
+
+ /* Processing for aggregates with GROUP BY is very different and
+ ** much more complex tha aggregates without a GROUP BY.
+ */
+ if( pGroupBy ){
+ KeyInfo *pKeyInfo; /* Keying information for the group by clause */
+
+ /* Create labels that we will be needing
+ */
+
+ addrInitializeLoop = sqlite3VdbeMakeLabel(v);
+ addrGroupByChange = sqlite3VdbeMakeLabel(v);
+ addrProcessRow = sqlite3VdbeMakeLabel(v);
+
+ /* If there is a GROUP BY clause we might need a sorting index to
+ ** implement it. Allocate that sorting index now. If it turns out
+ ** that we do not need it after all, the OpenVirtual instruction
+ ** will be converted into a Noop.
+ */
+ sAggInfo.sortingIdx = pParse->nTab++;
+ pKeyInfo = keyInfoFromExprList(pParse, pGroupBy);
+ addrSortingIdx =
+ sqlite3VdbeOp3(v, OP_OpenVirtual, sAggInfo.sortingIdx,
+ sAggInfo.nSortingColumn,
+ (char*)pKeyInfo, P3_KEYINFO_HANDOFF);
+
+ /* Initialize memory locations used by GROUP BY aggregate processing
+ */
+ iUseFlag = pParse->nMem++;
+ iAbortFlag = pParse->nMem++;
+ iAMem = pParse->nMem;
+ pParse->nMem += pGroupBy->nExpr;
+ iBMem = pParse->nMem;
+ pParse->nMem += pGroupBy->nExpr;
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, iAbortFlag);
+ VdbeComment((v, "# clear abort flag"));
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, iUseFlag);
+ VdbeComment((v, "# indicate accumulator empty"));
+ sqlite3VdbeAddOp(v, OP_Goto, 0, addrInitializeLoop);
+
+ /* Generate a subroutine that outputs a single row of the result
+ ** set. This subroutine first looks at the iUseFlag. If iUseFlag
+ ** is less than or equal to zero, the subroutine is a no-op. If
+ ** the processing calls for the query to abort, this subroutine
+ ** increments the iAbortFlag memory location before returning in
+ ** order to signal the caller to abort.
+ */
+ addrSetAbort = sqlite3VdbeCurrentAddr(v);
+ sqlite3VdbeAddOp(v, OP_MemInt, 1, iAbortFlag);
+ VdbeComment((v, "# set abort flag"));
+ sqlite3VdbeAddOp(v, OP_Return, 0, 0);
+ addrOutputRow = sqlite3VdbeCurrentAddr(v);
+ sqlite3VdbeAddOp(v, OP_IfMemPos, iUseFlag, addrOutputRow+2);
+ VdbeComment((v, "# Groupby result generator entry point"));
+ sqlite3VdbeAddOp(v, OP_Return, 0, 0);
+ finalizeAggFunctions(pParse, &sAggInfo);
+ if( pHaving ){
+ sqlite3ExprIfFalse(pParse, pHaving, addrOutputRow+1, 1);
+ }
+ rc = selectInnerLoop(pParse, p, p->pEList, 0, 0, pOrderBy,
+ distinct, eDest, iParm,
+ addrOutputRow+1, addrSetAbort, aff);
+ if( rc ){
+ goto select_end;
+ }
+ sqlite3VdbeAddOp(v, OP_Return, 0, 0);
+ VdbeComment((v, "# end groupby result generator"));
+
+ /* Generate a subroutine that will reset the group-by accumulator
+ */
+ addrReset = sqlite3VdbeCurrentAddr(v);
+ resetAccumulator(pParse, &sAggInfo);
+ sqlite3VdbeAddOp(v, OP_Return, 0, 0);
+
+ /* Begin a loop that will extract all source rows in GROUP BY order.
+ ** This might involve two separate loops with an OP_Sort in between, or
+ ** it might be a single loop that uses an index to extract information
+ ** in the right order to begin with.
+ */
+ sqlite3VdbeResolveLabel(v, addrInitializeLoop);
+ sqlite3VdbeAddOp(v, OP_Gosub, 0, addrReset);
+ pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pGroupBy);
+ if( pWInfo==0 ) goto select_end;
+ if( pGroupBy==0 ){
+ /* The optimizer is able to deliver rows in group by order so
+ ** we do not have to sort. The OP_OpenVirtual table will be
+ ** cancelled later because we still need to use the pKeyInfo
+ */
+ pGroupBy = p->pGroupBy;
+ groupBySort = 0;
+ }else{
+ /* Rows are coming out in undetermined order. We have to push
+ ** each row into a sorting index, terminate the first loop,
+ ** then loop over the sorting index in order to get the output
+ ** in sorted order
+ */
+ groupBySort = 1;
+ sqlite3ExprCodeExprList(pParse, pGroupBy);
+ sqlite3VdbeAddOp(v, OP_Sequence, sAggInfo.sortingIdx, 0);
+ j = pGroupBy->nExpr+1;
+ for(i=0; i<sAggInfo.nColumn; i++){
+ struct AggInfo_col *pCol = &sAggInfo.aCol[i];
+ if( pCol->iSorterColumn<j ) continue;
+ if( pCol->iColumn<0 ){
+ sqlite3VdbeAddOp(v, OP_Rowid, pCol->iTable, 0);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Column, pCol->iTable, pCol->iColumn);
+ }
+ j++;
+ }
+ sqlite3VdbeAddOp(v, OP_MakeRecord, j, 0);
+ sqlite3VdbeAddOp(v, OP_IdxInsert, sAggInfo.sortingIdx, 0);
+ sqlite3WhereEnd(pWInfo);
+ sqlite3VdbeAddOp(v, OP_Sort, sAggInfo.sortingIdx, addrEnd);
+ VdbeComment((v, "# GROUP BY sort"));
+ sAggInfo.useSortingIdx = 1;
+ }
+
+ /* Evaluate the current GROUP BY terms and store in b0, b1, b2...
+ ** (b0 is memory location iBMem+0, b1 is iBMem+1, and so forth)
+ ** Then compare the current GROUP BY terms against the GROUP BY terms
+ ** from the previous row currently stored in a0, a1, a2...
+ */
+ addrTopOfLoop = sqlite3VdbeCurrentAddr(v);
+ for(j=0; j<pGroupBy->nExpr; j++){
+ if( groupBySort ){
+ sqlite3VdbeAddOp(v, OP_Column, sAggInfo.sortingIdx, j);
+ }else{
+ sAggInfo.directMode = 1;
+ sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr);
+ }
+ sqlite3VdbeAddOp(v, OP_MemStore, iBMem+j, j<pGroupBy->nExpr-1);
+ }
+ for(j=pGroupBy->nExpr-1; j>=0; j--){
+ if( j<pGroupBy->nExpr-1 ){
+ sqlite3VdbeAddOp(v, OP_MemLoad, iBMem+j, 0);
+ }
+ sqlite3VdbeAddOp(v, OP_MemLoad, iAMem+j, 0);
+ if( j==0 ){
+ sqlite3VdbeAddOp(v, OP_Eq, 0x200, addrProcessRow);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Ne, 0x200, addrGroupByChange);
+ }
+ sqlite3VdbeChangeP3(v, -1, (void*)pKeyInfo->aColl[j], P3_COLLSEQ);
+ }
+
+ /* Generate code that runs whenever the GROUP BY changes.
+ ** Change in the GROUP BY are detected by the previous code
+ ** block. If there were no changes, this block is skipped.
+ **
+ ** This code copies current group by terms in b0,b1,b2,...
+ ** over to a0,a1,a2. It then calls the output subroutine
+ ** and resets the aggregate accumulator registers in preparation
+ ** for the next GROUP BY batch.
+ */
+ sqlite3VdbeResolveLabel(v, addrGroupByChange);
+ for(j=0; j<pGroupBy->nExpr; j++){
+ sqlite3VdbeAddOp(v, OP_MemMove, iAMem+j, iBMem+j);
+ }
+ sqlite3VdbeAddOp(v, OP_Gosub, 0, addrOutputRow);
+ VdbeComment((v, "# output one row"));
+ sqlite3VdbeAddOp(v, OP_IfMemPos, iAbortFlag, addrEnd);
+ VdbeComment((v, "# check abort flag"));
+ sqlite3VdbeAddOp(v, OP_Gosub, 0, addrReset);
+ VdbeComment((v, "# reset accumulator"));
+
+ /* Update the aggregate accumulators based on the content of
+ ** the current row
+ */
+ sqlite3VdbeResolveLabel(v, addrProcessRow);
+ updateAccumulator(pParse, &sAggInfo);
+ sqlite3VdbeAddOp(v, OP_MemInt, 1, iUseFlag);
+ VdbeComment((v, "# indicate data in accumulator"));
+
+ /* End of the loop
+ */
+ if( groupBySort ){
+ sqlite3VdbeAddOp(v, OP_Next, sAggInfo.sortingIdx, addrTopOfLoop);
+ }else{
+ sqlite3WhereEnd(pWInfo);
+ uncreateSortingIndex(pParse, addrSortingIdx);
+ }
+
+ /* Output the final row of result
+ */
+ sqlite3VdbeAddOp(v, OP_Gosub, 0, addrOutputRow);
+ VdbeComment((v, "# output final row"));
+
+ } /* endif pGroupBy */
+ else {
+ /* This case runs if the aggregate has no GROUP BY clause. The
+ ** processing is much simpler since there is only a single row
+ ** of output.
+ */
+ resetAccumulator(pParse, &sAggInfo);
+ pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0);
+ if( pWInfo==0 ) goto select_end;
+ updateAccumulator(pParse, &sAggInfo);
+ sqlite3WhereEnd(pWInfo);
+ finalizeAggFunctions(pParse, &sAggInfo);
+ pOrderBy = 0;
+ if( pHaving ){
+ sqlite3ExprIfFalse(pParse, pHaving, addrEnd, 1);
+ }
+ selectInnerLoop(pParse, p, p->pEList, 0, 0, 0, -1,
+ eDest, iParm, addrEnd, addrEnd, aff);
+ }
+ sqlite3VdbeResolveLabel(v, addrEnd);
+
+ } /* endif aggregate query */
+
+ /* If there is an ORDER BY clause, then we need to sort the results
+ ** and send them to the callback one by one.
+ */
+ if( pOrderBy ){
+ generateSortTail(pParse, p, v, pEList->nExpr, eDest, iParm);
+ }
+
+#ifndef SQLITE_OMIT_SUBQUERY
+ /* If this was a subquery, we have now converted the subquery into a
+ ** temporary table. So delete the subquery structure from the parent
+ ** to prevent this subquery from being evaluated again and to force the
+ ** the use of the temporary table.
+ */
+ if( pParent ){
+ assert( pParent->pSrc->nSrc>parentTab );
+ assert( pParent->pSrc->a[parentTab].pSelect==p );
+ sqlite3SelectDelete(p);
+ pParent->pSrc->a[parentTab].pSelect = 0;
+ }
+#endif
+
+ /* The SELECT was successfully coded. Set the return code to 0
+ ** to indicate no errors.
+ */
+ rc = 0;
+
+ /* Control jumps to here if an error is encountered above, or upon
+ ** successful coding of the SELECT.
+ */
+select_end:
+ sqliteFree(sAggInfo.aCol);
+ sqliteFree(sAggInfo.aFunc);
+ return rc;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/shell.c b/ext/pdo_sqlite/sqlite/src/shell.c
new file mode 100644
index 000000000..61ff2482d
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/shell.c
@@ -0,0 +1,1813 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains code to implement the "sqlite" command line
+** utility for accessing SQLite databases.
+**
+** $Id$
+*/
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include "sqlite3.h"
+#include <ctype.h>
+
+#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__)
+# include <signal.h>
+# include <pwd.h>
+# include <unistd.h>
+# include <sys/types.h>
+#endif
+
+#ifdef __MACOS__
+# include <console.h>
+# include <signal.h>
+# include <unistd.h>
+# include <extras.h>
+# include <Files.h>
+# include <Folders.h>
+#endif
+
+#if defined(HAVE_READLINE) && HAVE_READLINE==1
+# include <readline/readline.h>
+# include <readline/history.h>
+#else
+# define readline(p) local_getline(p,stdin)
+# define add_history(X)
+# define read_history(X)
+# define write_history(X)
+# define stifle_history(X)
+#endif
+
+/* Make sure isatty() has a prototype.
+*/
+extern int isatty();
+
+/*
+** The following is the open SQLite database. We make a pointer
+** to this database a static variable so that it can be accessed
+** by the SIGINT handler to interrupt database processing.
+*/
+static sqlite3 *db = 0;
+
+/*
+** True if an interrupt (Control-C) has been received.
+*/
+static int seenInterrupt = 0;
+
+/*
+** This is the name of our program. It is set in main(), used
+** in a number of other places, mostly for error messages.
+*/
+static char *Argv0;
+
+/*
+** Prompt strings. Initialized in main. Settable with
+** .prompt main continue
+*/
+static char mainPrompt[20]; /* First line prompt. default: "sqlite> "*/
+static char continuePrompt[20]; /* Continuation prompt. default: " ...> " */
+
+
+/*
+** Determines if a string is a number of not.
+*/
+static int isNumber(const unsigned char *z, int *realnum){
+ if( *z=='-' || *z=='+' ) z++;
+ if( !isdigit(*z) ){
+ return 0;
+ }
+ z++;
+ if( realnum ) *realnum = 0;
+ while( isdigit(*z) ){ z++; }
+ if( *z=='.' ){
+ z++;
+ if( !isdigit(*z) ) return 0;
+ while( isdigit(*z) ){ z++; }
+ if( realnum ) *realnum = 1;
+ }
+ if( *z=='e' || *z=='E' ){
+ z++;
+ if( *z=='+' || *z=='-' ) z++;
+ if( !isdigit(*z) ) return 0;
+ while( isdigit(*z) ){ z++; }
+ if( realnum ) *realnum = 1;
+ }
+ return *z==0;
+}
+
+/*
+** A global char* and an SQL function to access its current value
+** from within an SQL statement. This program used to use the
+** sqlite_exec_printf() API to substitue a string into an SQL statement.
+** The correct way to do this with sqlite3 is to use the bind API, but
+** since the shell is built around the callback paradigm it would be a lot
+** of work. Instead just use this hack, which is quite harmless.
+*/
+static const char *zShellStatic = 0;
+static void shellstaticFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ assert( 0==argc );
+ assert( zShellStatic );
+ sqlite3_result_text(context, zShellStatic, -1, SQLITE_STATIC);
+}
+
+
+/*
+** This routine reads a line of text from FILE in, stores
+** the text in memory obtained from malloc() and returns a pointer
+** to the text. NULL is returned at end of file, or if malloc()
+** fails.
+**
+** The interface is like "readline" but no command-line editing
+** is done.
+*/
+static char *local_getline(char *zPrompt, FILE *in){
+ char *zLine;
+ int nLine;
+ int n;
+ int eol;
+
+ if( zPrompt && *zPrompt ){
+ printf("%s",zPrompt);
+ fflush(stdout);
+ }
+ nLine = 100;
+ zLine = malloc( nLine );
+ if( zLine==0 ) return 0;
+ n = 0;
+ eol = 0;
+ while( !eol ){
+ if( n+100>nLine ){
+ nLine = nLine*2 + 100;
+ zLine = realloc(zLine, nLine);
+ if( zLine==0 ) return 0;
+ }
+ if( fgets(&zLine[n], nLine - n, in)==0 ){
+ if( n==0 ){
+ free(zLine);
+ return 0;
+ }
+ zLine[n] = 0;
+ eol = 1;
+ break;
+ }
+ while( zLine[n] ){ n++; }
+ if( n>0 && zLine[n-1]=='\n' ){
+ n--;
+ zLine[n] = 0;
+ eol = 1;
+ }
+ }
+ zLine = realloc( zLine, n+1 );
+ return zLine;
+}
+
+/*
+** Retrieve a single line of input text. "isatty" is true if text
+** is coming from a terminal. In that case, we issue a prompt and
+** attempt to use "readline" for command-line editing. If "isatty"
+** is false, use "local_getline" instead of "readline" and issue no prompt.
+**
+** zPrior is a string of prior text retrieved. If not the empty
+** string, then issue a continuation prompt.
+*/
+static char *one_input_line(const char *zPrior, FILE *in){
+ char *zPrompt;
+ char *zResult;
+ if( in!=0 ){
+ return local_getline(0, in);
+ }
+ if( zPrior && zPrior[0] ){
+ zPrompt = continuePrompt;
+ }else{
+ zPrompt = mainPrompt;
+ }
+ zResult = readline(zPrompt);
+#if defined(HAVE_READLINE) && HAVE_READLINE==1
+ if( zResult ) add_history(zResult);
+#endif
+ return zResult;
+}
+
+struct previous_mode_data {
+ int valid; /* Is there legit data in here? */
+ int mode;
+ int showHeader;
+ int colWidth[100];
+};
+/*
+** An pointer to an instance of this structure is passed from
+** the main program to the callback. This is used to communicate
+** state and mode information.
+*/
+struct callback_data {
+ sqlite3 *db; /* The database */
+ int echoOn; /* True to echo input commands */
+ int cnt; /* Number of records displayed so far */
+ FILE *out; /* Write results here */
+ int mode; /* An output mode setting */
+ int showHeader; /* True to show column names in List or Column mode */
+ char *zDestTable; /* Name of destination table when MODE_Insert */
+ char separator[20]; /* Separator character for MODE_List */
+ int colWidth[100]; /* Requested width of each column when in column mode*/
+ int actualWidth[100]; /* Actual width of each column */
+ char nullvalue[20]; /* The text to print when a NULL comes back from
+ ** the database */
+ struct previous_mode_data explainPrev;
+ /* Holds the mode information just before
+ ** .explain ON */
+ char outfile[FILENAME_MAX]; /* Filename for *out */
+ const char *zDbFilename; /* name of the database file */
+ char *zKey; /* Encryption key */
+};
+
+/*
+** These are the allowed modes.
+*/
+#define MODE_Line 0 /* One column per line. Blank line between records */
+#define MODE_Column 1 /* One record per line in neat columns */
+#define MODE_List 2 /* One record per line with a separator */
+#define MODE_Semi 3 /* Same as MODE_List but append ";" to each line */
+#define MODE_Html 4 /* Generate an XHTML table */
+#define MODE_Insert 5 /* Generate SQL "insert" statements */
+#define MODE_Tcl 6 /* Generate ANSI-C or TCL quoted elements */
+#define MODE_Csv 7 /* Quote strings, numbers are plain */
+#define MODE_NUM_OF 8 /* The number of modes (not a mode itself) */
+
+char *modeDescr[MODE_NUM_OF] = {
+ "line",
+ "column",
+ "list",
+ "semi",
+ "html",
+ "insert",
+ "tcl",
+ "csv",
+};
+
+/*
+** Number of elements in an array
+*/
+#define ArraySize(X) (sizeof(X)/sizeof(X[0]))
+
+/*
+** Output the given string as a quoted string using SQL quoting conventions.
+*/
+static void output_quoted_string(FILE *out, const char *z){
+ int i;
+ int nSingle = 0;
+ for(i=0; z[i]; i++){
+ if( z[i]=='\'' ) nSingle++;
+ }
+ if( nSingle==0 ){
+ fprintf(out,"'%s'",z);
+ }else{
+ fprintf(out,"'");
+ while( *z ){
+ for(i=0; z[i] && z[i]!='\''; i++){}
+ if( i==0 ){
+ fprintf(out,"''");
+ z++;
+ }else if( z[i]=='\'' ){
+ fprintf(out,"%.*s''",i,z);
+ z += i+1;
+ }else{
+ fprintf(out,"%s",z);
+ break;
+ }
+ }
+ fprintf(out,"'");
+ }
+}
+
+/*
+** Output the given string as a quoted according to C or TCL quoting rules.
+*/
+static void output_c_string(FILE *out, const char *z){
+ unsigned int c;
+ fputc('"', out);
+ while( (c = *(z++))!=0 ){
+ if( c=='\\' ){
+ fputc(c, out);
+ fputc(c, out);
+ }else if( c=='\t' ){
+ fputc('\\', out);
+ fputc('t', out);
+ }else if( c=='\n' ){
+ fputc('\\', out);
+ fputc('n', out);
+ }else if( c=='\r' ){
+ fputc('\\', out);
+ fputc('r', out);
+ }else if( !isprint(c) ){
+ fprintf(out, "\\%03o", c&0xff);
+ }else{
+ fputc(c, out);
+ }
+ }
+ fputc('"', out);
+}
+
+/*
+** Output the given string with characters that are special to
+** HTML escaped.
+*/
+static void output_html_string(FILE *out, const char *z){
+ int i;
+ while( *z ){
+ for(i=0; z[i] && z[i]!='<' && z[i]!='&'; i++){}
+ if( i>0 ){
+ fprintf(out,"%.*s",i,z);
+ }
+ if( z[i]=='<' ){
+ fprintf(out,"&lt;");
+ }else if( z[i]=='&' ){
+ fprintf(out,"&amp;");
+ }else{
+ break;
+ }
+ z += i + 1;
+ }
+}
+
+/*
+** Output a single term of CSV. Actually, p->separator is used for
+** the separator, which may or may not be a comma. p->nullvalue is
+** the null value. Strings are quoted using ANSI-C rules. Numbers
+** appear outside of quotes.
+*/
+static void output_csv(struct callback_data *p, const char *z, int bSep){
+ if( z==0 ){
+ fprintf(p->out,"%s",p->nullvalue);
+ }else if( isNumber(z, 0) ){
+ fprintf(p->out,"%s",z);
+ }else{
+ output_c_string(p->out, z);
+ }
+ if( bSep ){
+ fprintf(p->out, p->separator);
+ }
+}
+
+#ifdef SIGINT
+/*
+** This routine runs when the user presses Ctrl-C
+*/
+static void interrupt_handler(int NotUsed){
+ seenInterrupt = 1;
+ if( db ) sqlite3_interrupt(db);
+}
+#endif
+
+/*
+** This is the callback routine that the SQLite library
+** invokes for each row of a query result.
+*/
+static int callback(void *pArg, int nArg, char **azArg, char **azCol){
+ int i;
+ struct callback_data *p = (struct callback_data*)pArg;
+ switch( p->mode ){
+ case MODE_Line: {
+ int w = 5;
+ if( azArg==0 ) break;
+ for(i=0; i<nArg; i++){
+ int len = strlen(azCol[i]);
+ if( len>w ) w = len;
+ }
+ if( p->cnt++>0 ) fprintf(p->out,"\n");
+ for(i=0; i<nArg; i++){
+ fprintf(p->out,"%*s = %s\n", w, azCol[i],
+ azArg[i] ? azArg[i] : p->nullvalue);
+ }
+ break;
+ }
+ case MODE_Column: {
+ if( p->cnt++==0 ){
+ for(i=0; i<nArg; i++){
+ int w, n;
+ if( i<ArraySize(p->colWidth) ){
+ w = p->colWidth[i];
+ }else{
+ w = 0;
+ }
+ if( w<=0 ){
+ w = strlen(azCol[i] ? azCol[i] : "");
+ if( w<10 ) w = 10;
+ n = strlen(azArg && azArg[i] ? azArg[i] : p->nullvalue);
+ if( w<n ) w = n;
+ }
+ if( i<ArraySize(p->actualWidth) ){
+ p->actualWidth[i] = w;
+ }
+ if( p->showHeader ){
+ fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " ");
+ }
+ }
+ if( p->showHeader ){
+ for(i=0; i<nArg; i++){
+ int w;
+ if( i<ArraySize(p->actualWidth) ){
+ w = p->actualWidth[i];
+ }else{
+ w = 10;
+ }
+ fprintf(p->out,"%-*.*s%s",w,w,"-----------------------------------"
+ "----------------------------------------------------------",
+ i==nArg-1 ? "\n": " ");
+ }
+ }
+ }
+ if( azArg==0 ) break;
+ for(i=0; i<nArg; i++){
+ int w;
+ if( i<ArraySize(p->actualWidth) ){
+ w = p->actualWidth[i];
+ }else{
+ w = 10;
+ }
+ fprintf(p->out,"%-*.*s%s",w,w,
+ azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " ");
+ }
+ break;
+ }
+ case MODE_Semi:
+ case MODE_List: {
+ if( p->cnt++==0 && p->showHeader ){
+ for(i=0; i<nArg; i++){
+ fprintf(p->out,"%s%s",azCol[i], i==nArg-1 ? "\n" : p->separator);
+ }
+ }
+ if( azArg==0 ) break;
+ for(i=0; i<nArg; i++){
+ char *z = azArg[i];
+ if( z==0 ) z = p->nullvalue;
+ fprintf(p->out, "%s", z);
+ if( i<nArg-1 ){
+ fprintf(p->out, "%s", p->separator);
+ }else if( p->mode==MODE_Semi ){
+ fprintf(p->out, ";\n");
+ }else{
+ fprintf(p->out, "\n");
+ }
+ }
+ break;
+ }
+ case MODE_Html: {
+ if( p->cnt++==0 && p->showHeader ){
+ fprintf(p->out,"<TR>");
+ for(i=0; i<nArg; i++){
+ fprintf(p->out,"<TH>%s</TH>",azCol[i]);
+ }
+ fprintf(p->out,"</TR>\n");
+ }
+ if( azArg==0 ) break;
+ fprintf(p->out,"<TR>");
+ for(i=0; i<nArg; i++){
+ fprintf(p->out,"<TD>");
+ output_html_string(p->out, azArg[i] ? azArg[i] : p->nullvalue);
+ fprintf(p->out,"</TD>\n");
+ }
+ fprintf(p->out,"</TR>\n");
+ break;
+ }
+ case MODE_Tcl: {
+ if( p->cnt++==0 && p->showHeader ){
+ for(i=0; i<nArg; i++){
+ output_c_string(p->out,azCol[i]);
+ fprintf(p->out, "%s", p->separator);
+ }
+ fprintf(p->out,"\n");
+ }
+ if( azArg==0 ) break;
+ for(i=0; i<nArg; i++){
+ output_c_string(p->out, azArg[i] ? azArg[i] : p->nullvalue);
+ fprintf(p->out, "%s", p->separator);
+ }
+ fprintf(p->out,"\n");
+ break;
+ }
+ case MODE_Csv: {
+ if( p->cnt++==0 && p->showHeader ){
+ for(i=0; i<nArg; i++){
+ output_csv(p, azCol[i], i<nArg-1);
+ }
+ fprintf(p->out,"\n");
+ }
+ if( azArg==0 ) break;
+ for(i=0; i<nArg; i++){
+ output_csv(p, azArg[i], i<nArg-1);
+ }
+ fprintf(p->out,"\n");
+ break;
+ }
+ case MODE_Insert: {
+ if( azArg==0 ) break;
+ fprintf(p->out,"INSERT INTO %s VALUES(",p->zDestTable);
+ for(i=0; i<nArg; i++){
+ char *zSep = i>0 ? ",": "";
+ if( azArg[i]==0 ){
+ fprintf(p->out,"%sNULL",zSep);
+ }else if( isNumber(azArg[i], 0) ){
+ fprintf(p->out,"%s%s",zSep, azArg[i]);
+ }else{
+ if( zSep[0] ) fprintf(p->out,"%s",zSep);
+ output_quoted_string(p->out, azArg[i]);
+ }
+ }
+ fprintf(p->out,");\n");
+ break;
+ }
+ }
+ return 0;
+}
+
+/*
+** Set the destination table field of the callback_data structure to
+** the name of the table given. Escape any quote characters in the
+** table name.
+*/
+static void set_table_name(struct callback_data *p, const char *zName){
+ int i, n;
+ int needQuote;
+ char *z;
+
+ if( p->zDestTable ){
+ free(p->zDestTable);
+ p->zDestTable = 0;
+ }
+ if( zName==0 ) return;
+ needQuote = !isalpha((unsigned char)*zName) && *zName!='_';
+ for(i=n=0; zName[i]; i++, n++){
+ if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ){
+ needQuote = 1;
+ if( zName[i]=='\'' ) n++;
+ }
+ }
+ if( needQuote ) n += 2;
+ z = p->zDestTable = malloc( n+1 );
+ if( z==0 ){
+ fprintf(stderr,"Out of memory!\n");
+ exit(1);
+ }
+ n = 0;
+ if( needQuote ) z[n++] = '\'';
+ for(i=0; zName[i]; i++){
+ z[n++] = zName[i];
+ if( zName[i]=='\'' ) z[n++] = '\'';
+ }
+ if( needQuote ) z[n++] = '\'';
+ z[n] = 0;
+}
+
+/* zIn is either a pointer to a NULL-terminated string in memory obtained
+** from malloc(), or a NULL pointer. The string pointed to by zAppend is
+** added to zIn, and the result returned in memory obtained from malloc().
+** zIn, if it was not NULL, is freed.
+**
+** If the third argument, quote, is not '\0', then it is used as a
+** quote character for zAppend.
+*/
+static char * appendText(char *zIn, char const *zAppend, char quote){
+ int len;
+ int i;
+ int nAppend = strlen(zAppend);
+ int nIn = (zIn?strlen(zIn):0);
+
+ len = nAppend+nIn+1;
+ if( quote ){
+ len += 2;
+ for(i=0; i<nAppend; i++){
+ if( zAppend[i]==quote ) len++;
+ }
+ }
+
+ zIn = (char *)realloc(zIn, len);
+ if( !zIn ){
+ return 0;
+ }
+
+ if( quote ){
+ char *zCsr = &zIn[nIn];
+ *zCsr++ = quote;
+ for(i=0; i<nAppend; i++){
+ *zCsr++ = zAppend[i];
+ if( zAppend[i]==quote ) *zCsr++ = quote;
+ }
+ *zCsr++ = quote;
+ *zCsr++ = '\0';
+ assert( (zCsr-zIn)==len );
+ }else{
+ memcpy(&zIn[nIn], zAppend, nAppend);
+ zIn[len-1] = '\0';
+ }
+
+ return zIn;
+}
+
+
+/*
+** Execute a query statement that has a single result column. Print
+** that result column on a line by itself with a semicolon terminator.
+*/
+static int run_table_dump_query(FILE *out, sqlite3 *db, const char *zSelect){
+ sqlite3_stmt *pSelect;
+ int rc;
+ rc = sqlite3_prepare(db, zSelect, -1, &pSelect, 0);
+ if( rc!=SQLITE_OK || !pSelect ){
+ return rc;
+ }
+ rc = sqlite3_step(pSelect);
+ while( rc==SQLITE_ROW ){
+ fprintf(out, "%s;\n", sqlite3_column_text(pSelect, 0));
+ rc = sqlite3_step(pSelect);
+ }
+ return sqlite3_finalize(pSelect);
+}
+
+
+/*
+** This is a different callback routine used for dumping the database.
+** Each row received by this callback consists of a table name,
+** the table type ("index" or "table") and SQL to create the table.
+** This routine should print text sufficient to recreate the table.
+*/
+static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){
+ int rc;
+ const char *zTable;
+ const char *zType;
+ const char *zSql;
+ struct callback_data *p = (struct callback_data *)pArg;
+
+ if( nArg!=3 ) return 1;
+ zTable = azArg[0];
+ zType = azArg[1];
+ zSql = azArg[2];
+
+ if( strcmp(zTable, "sqlite_sequence")==0 ){
+ fprintf(p->out, "DELETE FROM sqlite_sequence;\n");
+ }else if( strcmp(zTable, "sqlite_stat1")==0 ){
+ fprintf(p->out, "ANALYZE sqlite_master;\n");
+ }else if( strncmp(zTable, "sqlite_", 7)==0 ){
+ return 0;
+ }else{
+ fprintf(p->out, "%s;\n", zSql);
+ }
+
+ if( strcmp(zType, "table")==0 ){
+ sqlite3_stmt *pTableInfo = 0;
+ char *zSelect = 0;
+ char *zTableInfo = 0;
+ char *zTmp = 0;
+
+ zTableInfo = appendText(zTableInfo, "PRAGMA table_info(", 0);
+ zTableInfo = appendText(zTableInfo, zTable, '"');
+ zTableInfo = appendText(zTableInfo, ");", 0);
+
+ rc = sqlite3_prepare(p->db, zTableInfo, -1, &pTableInfo, 0);
+ if( zTableInfo ) free(zTableInfo);
+ if( rc!=SQLITE_OK || !pTableInfo ){
+ return 1;
+ }
+
+ zSelect = appendText(zSelect, "SELECT 'INSERT INTO ' || ", 0);
+ zTmp = appendText(zTmp, zTable, '"');
+ if( zTmp ){
+ zSelect = appendText(zSelect, zTmp, '\'');
+ }
+ zSelect = appendText(zSelect, " || ' VALUES(' || ", 0);
+ rc = sqlite3_step(pTableInfo);
+ while( rc==SQLITE_ROW ){
+ zSelect = appendText(zSelect, "quote(", 0);
+ zSelect = appendText(zSelect, sqlite3_column_text(pTableInfo, 1), '"');
+ rc = sqlite3_step(pTableInfo);
+ if( rc==SQLITE_ROW ){
+ zSelect = appendText(zSelect, ") || ', ' || ", 0);
+ }else{
+ zSelect = appendText(zSelect, ") ", 0);
+ }
+ }
+ rc = sqlite3_finalize(pTableInfo);
+ if( rc!=SQLITE_OK ){
+ if( zSelect ) free(zSelect);
+ return 1;
+ }
+ zSelect = appendText(zSelect, "|| ')' FROM ", 0);
+ zSelect = appendText(zSelect, zTable, '"');
+
+ rc = run_table_dump_query(p->out, p->db, zSelect);
+ if( rc==SQLITE_CORRUPT ){
+ zSelect = appendText(zSelect, " ORDER BY rowid DESC", 0);
+ rc = run_table_dump_query(p->out, p->db, zSelect);
+ }
+ if( zSelect ) free(zSelect);
+ if( rc!=SQLITE_OK ){
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/*
+** Run zQuery. Update dump_callback() as the callback routine.
+** If we get a SQLITE_CORRUPT error, rerun the query after appending
+** "ORDER BY rowid DESC" to the end.
+*/
+static int run_schema_dump_query(
+ struct callback_data *p,
+ const char *zQuery,
+ char **pzErrMsg
+){
+ int rc;
+ rc = sqlite3_exec(p->db, zQuery, dump_callback, p, pzErrMsg);
+ if( rc==SQLITE_CORRUPT ){
+ char *zQ2;
+ int len = strlen(zQuery);
+ if( pzErrMsg ) sqlite3_free(*pzErrMsg);
+ zQ2 = malloc( len+100 );
+ if( zQ2==0 ) return rc;
+ sprintf(zQ2, "%s ORDER BY rowid DESC", zQuery);
+ rc = sqlite3_exec(p->db, zQ2, dump_callback, p, pzErrMsg);
+ free(zQ2);
+ }
+ return rc;
+}
+
+/*
+** Text of a help message
+*/
+static char zHelp[] =
+ ".databases List names and files of attached databases\n"
+ ".dump ?TABLE? ... Dump the database in an SQL text format\n"
+ ".echo ON|OFF Turn command echo on or off\n"
+ ".exit Exit this program\n"
+ ".explain ON|OFF Turn output mode suitable for EXPLAIN on or off.\n"
+ ".header(s) ON|OFF Turn display of headers on or off\n"
+ ".help Show this message\n"
+ ".import FILE TABLE Import data from FILE into TABLE\n"
+ ".indices TABLE Show names of all indices on TABLE\n"
+ ".mode MODE ?TABLE? Set output mode where MODE is one of:\n"
+ " csv Comma-separated values\n"
+ " column Left-aligned columns. (See .width)\n"
+ " html HTML <table> code\n"
+ " insert SQL insert statements for TABLE\n"
+ " line One value per line\n"
+ " list Values delimited by .separator string\n"
+ " tabs Tab-separated values\n"
+ " tcl TCL list elements\n"
+ ".nullvalue STRING Print STRING in place of NULL values\n"
+ ".output FILENAME Send output to FILENAME\n"
+ ".output stdout Send output to the screen\n"
+ ".prompt MAIN CONTINUE Replace the standard prompts\n"
+ ".quit Exit this program\n"
+ ".read FILENAME Execute SQL in FILENAME\n"
+#ifdef SQLITE_HAS_CODEC
+ ".rekey OLD NEW NEW Change the encryption key\n"
+#endif
+ ".schema ?TABLE? Show the CREATE statements\n"
+ ".separator STRING Change separator used by output mode and .import\n"
+ ".show Show the current values for various settings\n"
+ ".tables ?PATTERN? List names of tables matching a LIKE pattern\n"
+ ".timeout MS Try opening locked tables for MS milliseconds\n"
+ ".width NUM NUM ... Set column widths for \"column\" mode\n"
+;
+
+/* Forward reference */
+static void process_input(struct callback_data *p, FILE *in);
+
+/*
+** Make sure the database is open. If it is not, then open it. If
+** the database fails to open, print an error message and exit.
+*/
+static void open_db(struct callback_data *p){
+ if( p->db==0 ){
+ sqlite3_open(p->zDbFilename, &p->db);
+ db = p->db;
+#ifdef SQLITE_HAS_CODEC
+ sqlite3_key(p->db, p->zKey, p->zKey ? strlen(p->zKey) : 0);
+#endif
+ sqlite3_create_function(db, "shellstatic", 0, SQLITE_UTF8, 0,
+ shellstaticFunc, 0, 0);
+ if( SQLITE_OK!=sqlite3_errcode(db) ){
+ fprintf(stderr,"Unable to open database \"%s\": %s\n",
+ p->zDbFilename, sqlite3_errmsg(db));
+ exit(1);
+ }
+ }
+}
+
+/*
+** Do C-language style dequoting.
+**
+** \t -> tab
+** \n -> newline
+** \r -> carriage return
+** \NNN -> ascii character NNN in octal
+** \\ -> backslash
+*/
+static void resolve_backslashes(char *z){
+ int i, j, c;
+ for(i=j=0; (c = z[i])!=0; i++, j++){
+ if( c=='\\' ){
+ c = z[++i];
+ if( c=='n' ){
+ c = '\n';
+ }else if( c=='t' ){
+ c = '\t';
+ }else if( c=='r' ){
+ c = '\r';
+ }else if( c>='0' && c<='7' ){
+ c =- '0';
+ if( z[i+1]>='0' && z[i+1]<='7' ){
+ i++;
+ c = (c<<3) + z[i] - '0';
+ if( z[i+1]>='0' && z[i+1]<='7' ){
+ i++;
+ c = (c<<3) + z[i] - '0';
+ }
+ }
+ }
+ }
+ z[j] = c;
+ }
+ z[j] = 0;
+}
+
+/*
+** If an input line begins with "." then invoke this routine to
+** process that line.
+**
+** Return 1 to exit and 0 to continue.
+*/
+static int do_meta_command(char *zLine, struct callback_data *p){
+ int i = 1;
+ int nArg = 0;
+ int n, c;
+ int rc = 0;
+ char *azArg[50];
+
+ /* Parse the input line into tokens.
+ */
+ while( zLine[i] && nArg<ArraySize(azArg) ){
+ while( isspace((unsigned char)zLine[i]) ){ i++; }
+ if( zLine[i]==0 ) break;
+ if( zLine[i]=='\'' || zLine[i]=='"' ){
+ int delim = zLine[i++];
+ azArg[nArg++] = &zLine[i];
+ while( zLine[i] && zLine[i]!=delim ){ i++; }
+ if( zLine[i]==delim ){
+ zLine[i++] = 0;
+ }
+ if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
+ }else{
+ azArg[nArg++] = &zLine[i];
+ while( zLine[i] && !isspace((unsigned char)zLine[i]) ){ i++; }
+ if( zLine[i] ) zLine[i++] = 0;
+ resolve_backslashes(azArg[nArg-1]);
+ }
+ }
+
+ /* Process the input line.
+ */
+ if( nArg==0 ) return rc;
+ n = strlen(azArg[0]);
+ c = azArg[0][0];
+ if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){
+ struct callback_data data;
+ char *zErrMsg = 0;
+ open_db(p);
+ memcpy(&data, p, sizeof(data));
+ data.showHeader = 1;
+ data.mode = MODE_Column;
+ data.colWidth[0] = 3;
+ data.colWidth[1] = 15;
+ data.colWidth[2] = 58;
+ data.cnt = 0;
+ sqlite3_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg);
+ if( zErrMsg ){
+ fprintf(stderr,"Error: %s\n", zErrMsg);
+ sqlite3_free(zErrMsg);
+ }
+ }else
+
+ if( c=='d' && strncmp(azArg[0], "dump", n)==0 ){
+ char *zErrMsg = 0;
+ open_db(p);
+ fprintf(p->out, "BEGIN TRANSACTION;\n");
+ if( nArg==1 ){
+ run_schema_dump_query(p,
+ "SELECT name, type, sql FROM sqlite_master "
+ "WHERE sql NOT NULL AND type=='table'", 0
+ );
+ run_schema_dump_query(p,
+ "SELECT name, type, sql FROM sqlite_master "
+ "WHERE sql NOT NULL AND type!='table' AND type!='meta'", 0
+ );
+ }else{
+ int i;
+ for(i=1; i<nArg; i++){
+ zShellStatic = azArg[i];
+ run_schema_dump_query(p,
+ "SELECT name, type, sql FROM sqlite_master "
+ "WHERE tbl_name LIKE shellstatic() AND type=='table'"
+ " AND sql NOT NULL", 0);
+ run_schema_dump_query(p,
+ "SELECT name, type, sql FROM sqlite_master "
+ "WHERE tbl_name LIKE shellstatic() AND type!='table'"
+ " AND type!='meta' AND sql NOT NULL", 0);
+ zShellStatic = 0;
+ }
+ }
+ if( zErrMsg ){
+ fprintf(stderr,"Error: %s\n", zErrMsg);
+ sqlite3_free(zErrMsg);
+ }else{
+ fprintf(p->out, "COMMIT;\n");
+ }
+ }else
+
+ if( c=='e' && strncmp(azArg[0], "echo", n)==0 && nArg>1 ){
+ int j;
+ char *z = azArg[1];
+ int val = atoi(azArg[1]);
+ for(j=0; z[j]; j++){
+ z[j] = tolower((unsigned char)z[j]);
+ }
+ if( strcmp(z,"on")==0 ){
+ val = 1;
+ }else if( strcmp(z,"yes")==0 ){
+ val = 1;
+ }
+ p->echoOn = val;
+ }else
+
+ if( c=='e' && strncmp(azArg[0], "exit", n)==0 ){
+ rc = 1;
+ }else
+
+ if( c=='e' && strncmp(azArg[0], "explain", n)==0 ){
+ int j;
+ static char zOne[] = "1";
+ char *z = nArg>=2 ? azArg[1] : zOne;
+ int val = atoi(z);
+ for(j=0; z[j]; j++){
+ z[j] = tolower((unsigned char)z[j]);
+ }
+ if( strcmp(z,"on")==0 ){
+ val = 1;
+ }else if( strcmp(z,"yes")==0 ){
+ val = 1;
+ }
+ if(val == 1) {
+ if(!p->explainPrev.valid) {
+ p->explainPrev.valid = 1;
+ p->explainPrev.mode = p->mode;
+ p->explainPrev.showHeader = p->showHeader;
+ memcpy(p->explainPrev.colWidth,p->colWidth,sizeof(p->colWidth));
+ }
+ /* We could put this code under the !p->explainValid
+ ** condition so that it does not execute if we are already in
+ ** explain mode. However, always executing it allows us an easy
+ ** was to reset to explain mode in case the user previously
+ ** did an .explain followed by a .width, .mode or .header
+ ** command.
+ */
+ p->mode = MODE_Column;
+ p->showHeader = 1;
+ memset(p->colWidth,0,ArraySize(p->colWidth));
+ p->colWidth[0] = 4;
+ p->colWidth[1] = 14;
+ p->colWidth[2] = 10;
+ p->colWidth[3] = 10;
+ p->colWidth[4] = 33;
+ }else if (p->explainPrev.valid) {
+ p->explainPrev.valid = 0;
+ p->mode = p->explainPrev.mode;
+ p->showHeader = p->explainPrev.showHeader;
+ memcpy(p->colWidth,p->explainPrev.colWidth,sizeof(p->colWidth));
+ }
+ }else
+
+ if( c=='h' && (strncmp(azArg[0], "header", n)==0
+ ||
+ strncmp(azArg[0], "headers", n)==0 )&& nArg>1 ){
+ int j;
+ char *z = azArg[1];
+ int val = atoi(azArg[1]);
+ for(j=0; z[j]; j++){
+ z[j] = tolower((unsigned char)z[j]);
+ }
+ if( strcmp(z,"on")==0 ){
+ val = 1;
+ }else if( strcmp(z,"yes")==0 ){
+ val = 1;
+ }
+ p->showHeader = val;
+ }else
+
+ if( c=='h' && strncmp(azArg[0], "help", n)==0 ){
+ fprintf(stderr,zHelp);
+ }else
+
+ if( c=='i' && strncmp(azArg[0], "import", n)==0 && nArg>=3 ){
+ char *zTable = azArg[2]; /* Insert data into this table */
+ char *zFile = azArg[1]; /* The file from which to extract data */
+ sqlite3_stmt *pStmt; /* A statement */
+ int rc; /* Result code */
+ int nCol; /* Number of columns in the table */
+ int nByte; /* Number of bytes in an SQL string */
+ int i, j; /* Loop counters */
+ int nSep; /* Number of bytes in p->separator[] */
+ char *zSql; /* An SQL statement */
+ char *zLine; /* A single line of input from the file */
+ char **azCol; /* zLine[] broken up into columns */
+ char *zCommit; /* How to commit changes */
+ FILE *in; /* The input file */
+ int lineno = 0; /* Line number of input file */
+
+ nSep = strlen(p->separator);
+ if( nSep==0 ){
+ fprintf(stderr, "non-null separator required for import\n");
+ return 0;
+ }
+ zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable);
+ if( zSql==0 ) return 0;
+ nByte = strlen(zSql);
+ rc = sqlite3_prepare(p->db, zSql, 0, &pStmt, 0);
+ sqlite3_free(zSql);
+ if( rc ){
+ fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db));
+ nCol = 0;
+ }else{
+ nCol = sqlite3_column_count(pStmt);
+ }
+ sqlite3_finalize(pStmt);
+ if( nCol==0 ) return 0;
+ zSql = malloc( nByte + 20 + nCol*2 );
+ if( zSql==0 ) return 0;
+ sqlite3_snprintf(nByte+20, zSql, "INSERT INTO '%q' VALUES(?", zTable);
+ j = strlen(zSql);
+ for(i=1; i<nCol; i++){
+ zSql[j++] = ',';
+ zSql[j++] = '?';
+ }
+ zSql[j++] = ')';
+ zSql[j] = 0;
+ rc = sqlite3_prepare(p->db, zSql, 0, &pStmt, 0);
+ free(zSql);
+ if( rc ){
+ fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db));
+ sqlite3_finalize(pStmt);
+ return 0;
+ }
+ in = fopen(zFile, "rb");
+ if( in==0 ){
+ fprintf(stderr, "cannot open file: %s\n", zFile);
+ sqlite3_finalize(pStmt);
+ return 0;
+ }
+ azCol = malloc( sizeof(azCol[0])*(nCol+1) );
+ if( azCol==0 ) return 0;
+ sqlite3_exec(p->db, "BEGIN", 0, 0, 0);
+ zCommit = "COMMIT";
+ while( (zLine = local_getline(0, in))!=0 ){
+ char *z;
+ i = 0;
+ lineno++;
+ azCol[0] = zLine;
+ for(i=0, z=zLine; *z && *z!='\n' && *z!='\r'; z++){
+ if( *z==p->separator[0] && strncmp(z, p->separator, nSep)==0 ){
+ *z = 0;
+ i++;
+ if( i<nCol ){
+ azCol[i] = &z[nSep];
+ z += nSep-1;
+ }
+ }
+ }
+ *z = 0;
+ if( i+1!=nCol ){
+ fprintf(stderr,"%s line %d: expected %d columns of data but found %d\n",
+ zFile, lineno, nCol, i+1);
+ zCommit = "ROLLBACK";
+ break;
+ }
+ for(i=0; i<nCol; i++){
+ sqlite3_bind_text(pStmt, i+1, azCol[i], -1, SQLITE_STATIC);
+ }
+ sqlite3_step(pStmt);
+ rc = sqlite3_reset(pStmt);
+ free(zLine);
+ if( rc!=SQLITE_OK ){
+ fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db));
+ zCommit = "ROLLBACK";
+ break;
+ }
+ }
+ free(azCol);
+ fclose(in);
+ sqlite3_finalize(pStmt);
+ sqlite3_exec(p->db, zCommit, 0, 0, 0);
+ }else
+
+ if( c=='i' && strncmp(azArg[0], "indices", n)==0 && nArg>1 ){
+ struct callback_data data;
+ char *zErrMsg = 0;
+ open_db(p);
+ memcpy(&data, p, sizeof(data));
+ data.showHeader = 0;
+ data.mode = MODE_List;
+ zShellStatic = azArg[1];
+ sqlite3_exec(p->db,
+ "SELECT name FROM sqlite_master "
+ "WHERE type='index' AND tbl_name LIKE shellstatic() "
+ "UNION ALL "
+ "SELECT name FROM sqlite_temp_master "
+ "WHERE type='index' AND tbl_name LIKE shellstatic() "
+ "ORDER BY 1",
+ callback, &data, &zErrMsg
+ );
+ zShellStatic = 0;
+ if( zErrMsg ){
+ fprintf(stderr,"Error: %s\n", zErrMsg);
+ sqlite3_free(zErrMsg);
+ }
+ }else
+
+ if( c=='m' && strncmp(azArg[0], "mode", n)==0 && nArg>=2 ){
+ int n2 = strlen(azArg[1]);
+ if( strncmp(azArg[1],"line",n2)==0
+ ||
+ strncmp(azArg[1],"lines",n2)==0 ){
+ p->mode = MODE_Line;
+ }else if( strncmp(azArg[1],"column",n2)==0
+ ||
+ strncmp(azArg[1],"columns",n2)==0 ){
+ p->mode = MODE_Column;
+ }else if( strncmp(azArg[1],"list",n2)==0 ){
+ p->mode = MODE_List;
+ }else if( strncmp(azArg[1],"html",n2)==0 ){
+ p->mode = MODE_Html;
+ }else if( strncmp(azArg[1],"tcl",n2)==0 ){
+ p->mode = MODE_Tcl;
+ }else if( strncmp(azArg[1],"csv",n2)==0 ){
+ p->mode = MODE_Csv;
+ strcpy(p->separator, ",");
+ }else if( strncmp(azArg[1],"tabs",n2)==0 ){
+ p->mode = MODE_List;
+ strcpy(p->separator, "\t");
+ }else if( strncmp(azArg[1],"insert",n2)==0 ){
+ p->mode = MODE_Insert;
+ if( nArg>=3 ){
+ set_table_name(p, azArg[2]);
+ }else{
+ set_table_name(p, "table");
+ }
+ }else {
+ fprintf(stderr,"mode should be on of: "
+ "column csv html insert line list tabs tcl\n");
+ }
+ }else
+
+ if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 && nArg==2 ) {
+ sprintf(p->nullvalue, "%.*s", (int)ArraySize(p->nullvalue)-1, azArg[1]);
+ }else
+
+ if( c=='o' && strncmp(azArg[0], "output", n)==0 && nArg==2 ){
+ if( p->out!=stdout ){
+ fclose(p->out);
+ }
+ if( strcmp(azArg[1],"stdout")==0 ){
+ p->out = stdout;
+ strcpy(p->outfile,"stdout");
+ }else{
+ p->out = fopen(azArg[1], "wb");
+ if( p->out==0 ){
+ fprintf(stderr,"can't write to \"%s\"\n", azArg[1]);
+ p->out = stdout;
+ } else {
+ strcpy(p->outfile,azArg[1]);
+ }
+ }
+ }else
+
+ if( c=='p' && strncmp(azArg[0], "prompt", n)==0 && (nArg==2 || nArg==3)){
+ if( nArg >= 2) {
+ strncpy(mainPrompt,azArg[1],(int)ArraySize(mainPrompt)-1);
+ }
+ if( nArg >= 3) {
+ strncpy(continuePrompt,azArg[2],(int)ArraySize(continuePrompt)-1);
+ }
+ }else
+
+ if( c=='q' && strncmp(azArg[0], "quit", n)==0 ){
+ rc = 1;
+ }else
+
+ if( c=='r' && strncmp(azArg[0], "read", n)==0 && nArg==2 ){
+ FILE *alt = fopen(azArg[1], "rb");
+ if( alt==0 ){
+ fprintf(stderr,"can't open \"%s\"\n", azArg[1]);
+ }else{
+ process_input(p, alt);
+ fclose(alt);
+ }
+ }else
+
+#ifdef SQLITE_HAS_CODEC
+ if( c=='r' && strncmp(azArg[0],"rekey", n)==0 && nArg==4 ){
+ char *zOld = p->zKey;
+ if( zOld==0 ) zOld = "";
+ if( strcmp(azArg[1],zOld) ){
+ fprintf(stderr,"old key is incorrect\n");
+ }else if( strcmp(azArg[2], azArg[3]) ){
+ fprintf(stderr,"2nd copy of new key does not match the 1st\n");
+ }else{
+ sqlite3_free(p->zKey);
+ p->zKey = sqlite3_mprintf("%s", azArg[2]);
+ sqlite3_rekey(p->db, p->zKey, strlen(p->zKey));
+ }
+ }else
+#endif
+
+ if( c=='s' && strncmp(azArg[0], "schema", n)==0 ){
+ struct callback_data data;
+ char *zErrMsg = 0;
+ open_db(p);
+ memcpy(&data, p, sizeof(data));
+ data.showHeader = 0;
+ data.mode = MODE_Semi;
+ if( nArg>1 ){
+ int i;
+ for(i=0; azArg[1][i]; i++) azArg[1][i] = tolower(azArg[1][i]);
+ if( strcmp(azArg[1],"sqlite_master")==0 ){
+ char *new_argv[2], *new_colv[2];
+ new_argv[0] = "CREATE TABLE sqlite_master (\n"
+ " type text,\n"
+ " name text,\n"
+ " tbl_name text,\n"
+ " rootpage integer,\n"
+ " sql text\n"
+ ")";
+ new_argv[1] = 0;
+ new_colv[0] = "sql";
+ new_colv[1] = 0;
+ callback(&data, 1, new_argv, new_colv);
+ }else if( strcmp(azArg[1],"sqlite_temp_master")==0 ){
+ char *new_argv[2], *new_colv[2];
+ new_argv[0] = "CREATE TEMP TABLE sqlite_temp_master (\n"
+ " type text,\n"
+ " name text,\n"
+ " tbl_name text,\n"
+ " rootpage integer,\n"
+ " sql text\n"
+ ")";
+ new_argv[1] = 0;
+ new_colv[0] = "sql";
+ new_colv[1] = 0;
+ callback(&data, 1, new_argv, new_colv);
+ }else{
+ zShellStatic = azArg[1];
+ sqlite3_exec(p->db,
+ "SELECT sql FROM "
+ " (SELECT * FROM sqlite_master UNION ALL"
+ " SELECT * FROM sqlite_temp_master) "
+ "WHERE tbl_name LIKE shellstatic() AND type!='meta' AND sql NOTNULL "
+ "ORDER BY substr(type,2,1), name",
+ callback, &data, &zErrMsg);
+ zShellStatic = 0;
+ }
+ }else{
+ sqlite3_exec(p->db,
+ "SELECT sql FROM "
+ " (SELECT * FROM sqlite_master UNION ALL"
+ " SELECT * FROM sqlite_temp_master) "
+ "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'"
+ "ORDER BY substr(type,2,1), name",
+ callback, &data, &zErrMsg
+ );
+ }
+ if( zErrMsg ){
+ fprintf(stderr,"Error: %s\n", zErrMsg);
+ sqlite3_free(zErrMsg);
+ }
+ }else
+
+ if( c=='s' && strncmp(azArg[0], "separator", n)==0 && nArg==2 ){
+ sprintf(p->separator, "%.*s", (int)ArraySize(p->separator)-1, azArg[1]);
+ }else
+
+ if( c=='s' && strncmp(azArg[0], "show", n)==0){
+ int i;
+ fprintf(p->out,"%9.9s: %s\n","echo", p->echoOn ? "on" : "off");
+ fprintf(p->out,"%9.9s: %s\n","explain", p->explainPrev.valid ? "on" :"off");
+ fprintf(p->out,"%9.9s: %s\n","headers", p->showHeader ? "on" : "off");
+ fprintf(p->out,"%9.9s: %s\n","mode", modeDescr[p->mode]);
+ fprintf(p->out,"%9.9s: ", "nullvalue");
+ output_c_string(p->out, p->nullvalue);
+ fprintf(p->out, "\n");
+ fprintf(p->out,"%9.9s: %s\n","output",
+ strlen(p->outfile) ? p->outfile : "stdout");
+ fprintf(p->out,"%9.9s: ", "separator");
+ output_c_string(p->out, p->separator);
+ fprintf(p->out, "\n");
+ fprintf(p->out,"%9.9s: ","width");
+ for (i=0;i<(int)ArraySize(p->colWidth) && p->colWidth[i] != 0;i++) {
+ fprintf(p->out,"%d ",p->colWidth[i]);
+ }
+ fprintf(p->out,"\n");
+ }else
+
+ if( c=='t' && n>1 && strncmp(azArg[0], "tables", n)==0 ){
+ char **azResult;
+ int nRow, rc;
+ char *zErrMsg;
+ open_db(p);
+ if( nArg==1 ){
+ rc = sqlite3_get_table(p->db,
+ "SELECT name FROM sqlite_master "
+ "WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%'"
+ "UNION ALL "
+ "SELECT name FROM sqlite_temp_master "
+ "WHERE type IN ('table','view') "
+ "ORDER BY 1",
+ &azResult, &nRow, 0, &zErrMsg
+ );
+ }else{
+ zShellStatic = azArg[1];
+ rc = sqlite3_get_table(p->db,
+ "SELECT name FROM sqlite_master "
+ "WHERE type IN ('table','view') AND name LIKE '%'||shellstatic()||'%' "
+ "UNION ALL "
+ "SELECT name FROM sqlite_temp_master "
+ "WHERE type IN ('table','view') AND name LIKE '%'||shellstatic()||'%' "
+ "ORDER BY 1",
+ &azResult, &nRow, 0, &zErrMsg
+ );
+ zShellStatic = 0;
+ }
+ if( zErrMsg ){
+ fprintf(stderr,"Error: %s\n", zErrMsg);
+ sqlite3_free(zErrMsg);
+ }
+ if( rc==SQLITE_OK ){
+ int len, maxlen = 0;
+ int i, j;
+ int nPrintCol, nPrintRow;
+ for(i=1; i<=nRow; i++){
+ if( azResult[i]==0 ) continue;
+ len = strlen(azResult[i]);
+ if( len>maxlen ) maxlen = len;
+ }
+ nPrintCol = 80/(maxlen+2);
+ if( nPrintCol<1 ) nPrintCol = 1;
+ nPrintRow = (nRow + nPrintCol - 1)/nPrintCol;
+ for(i=0; i<nPrintRow; i++){
+ for(j=i+1; j<=nRow; j+=nPrintRow){
+ char *zSp = j<=nPrintRow ? "" : " ";
+ printf("%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : "");
+ }
+ printf("\n");
+ }
+ }
+ sqlite3_free_table(azResult);
+ }else
+
+ if( c=='t' && n>1 && strncmp(azArg[0], "timeout", n)==0 && nArg>=2 ){
+ open_db(p);
+ sqlite3_busy_timeout(p->db, atoi(azArg[1]));
+ }else
+
+ if( c=='w' && strncmp(azArg[0], "width", n)==0 ){
+ int j;
+ for(j=1; j<nArg && j<ArraySize(p->colWidth); j++){
+ p->colWidth[j-1] = atoi(azArg[j]);
+ }
+ }else
+
+ {
+ fprintf(stderr, "unknown command or invalid arguments: "
+ " \"%s\". Enter \".help\" for help\n", azArg[0]);
+ }
+
+ return rc;
+}
+
+/*
+** Return TRUE if the last non-whitespace character in z[] is a semicolon.
+** z[] is N characters long.
+*/
+static int _ends_with_semicolon(const char *z, int N){
+ while( N>0 && isspace((unsigned char)z[N-1]) ){ N--; }
+ return N>0 && z[N-1]==';';
+}
+
+/*
+** Test to see if a line consists entirely of whitespace.
+*/
+static int _all_whitespace(const char *z){
+ for(; *z; z++){
+ if( isspace(*(unsigned char*)z) ) continue;
+ if( *z=='/' && z[1]=='*' ){
+ z += 2;
+ while( *z && (*z!='*' || z[1]!='/') ){ z++; }
+ if( *z==0 ) return 0;
+ z++;
+ continue;
+ }
+ if( *z=='-' && z[1]=='-' ){
+ z += 2;
+ while( *z && *z!='\n' ){ z++; }
+ if( *z==0 ) return 1;
+ continue;
+ }
+ return 0;
+ }
+ return 1;
+}
+
+/*
+** Return TRUE if the line typed in is an SQL command terminator other
+** than a semi-colon. The SQL Server style "go" command is understood
+** as is the Oracle "/".
+*/
+static int _is_command_terminator(const char *zLine){
+ while( isspace(*(unsigned char*)zLine) ){ zLine++; };
+ if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ) return 1; /* Oracle */
+ if( tolower(zLine[0])=='g' && tolower(zLine[1])=='o'
+ && _all_whitespace(&zLine[2]) ){
+ return 1; /* SQL Server */
+ }
+ return 0;
+}
+
+/*
+** Read input from *in and process it. If *in==0 then input
+** is interactive - the user is typing it it. Otherwise, input
+** is coming from a file or device. A prompt is issued and history
+** is saved only if input is interactive. An interrupt signal will
+** cause this routine to exit immediately, unless input is interactive.
+*/
+static void process_input(struct callback_data *p, FILE *in){
+ char *zLine;
+ char *zSql = 0;
+ int nSql = 0;
+ char *zErrMsg;
+ int rc;
+ while( fflush(p->out), (zLine = one_input_line(zSql, in))!=0 ){
+ if( seenInterrupt ){
+ if( in!=0 ) break;
+ seenInterrupt = 0;
+ }
+ if( p->echoOn ) printf("%s\n", zLine);
+ if( (zSql==0 || zSql[0]==0) && _all_whitespace(zLine) ) continue;
+ if( zLine && zLine[0]=='.' && nSql==0 ){
+ int rc = do_meta_command(zLine, p);
+ free(zLine);
+ if( rc ) break;
+ continue;
+ }
+ if( _is_command_terminator(zLine) ){
+ strcpy(zLine,";");
+ }
+ if( zSql==0 ){
+ int i;
+ for(i=0; zLine[i] && isspace((unsigned char)zLine[i]); i++){}
+ if( zLine[i]!=0 ){
+ nSql = strlen(zLine);
+ zSql = malloc( nSql+1 );
+ strcpy(zSql, zLine);
+ }
+ }else{
+ int len = strlen(zLine);
+ zSql = realloc( zSql, nSql + len + 2 );
+ if( zSql==0 ){
+ fprintf(stderr,"%s: out of memory!\n", Argv0);
+ exit(1);
+ }
+ strcpy(&zSql[nSql++], "\n");
+ strcpy(&zSql[nSql], zLine);
+ nSql += len;
+ }
+ free(zLine);
+ if( zSql && _ends_with_semicolon(zSql, nSql) && sqlite3_complete(zSql) ){
+ p->cnt = 0;
+ open_db(p);
+ rc = sqlite3_exec(p->db, zSql, callback, p, &zErrMsg);
+ if( rc || zErrMsg ){
+ if( in!=0 && !p->echoOn ) printf("%s\n",zSql);
+ if( zErrMsg!=0 ){
+ printf("SQL error: %s\n", zErrMsg);
+ sqlite3_free(zErrMsg);
+ zErrMsg = 0;
+ }else{
+ printf("SQL error: %s\n", sqlite3_errmsg(p->db));
+ }
+ }
+ free(zSql);
+ zSql = 0;
+ nSql = 0;
+ }
+ }
+ if( zSql ){
+ if( !_all_whitespace(zSql) ) printf("Incomplete SQL: %s\n", zSql);
+ free(zSql);
+ }
+}
+
+/*
+** Return a pathname which is the user's home directory. A
+** 0 return indicates an error of some kind. Space to hold the
+** resulting string is obtained from malloc(). The calling
+** function should free the result.
+*/
+static char *find_home_dir(void){
+ char *home_dir = NULL;
+
+#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__)
+ struct passwd *pwent;
+ uid_t uid = getuid();
+ if( (pwent=getpwuid(uid)) != NULL) {
+ home_dir = pwent->pw_dir;
+ }
+#endif
+
+#ifdef __MACOS__
+ char home_path[_MAX_PATH+1];
+ home_dir = getcwd(home_path, _MAX_PATH);
+#endif
+
+ if (!home_dir) {
+ home_dir = getenv("HOME");
+ if (!home_dir) {
+ home_dir = getenv("HOMEPATH"); /* Windows? */
+ }
+ }
+
+#if defined(_WIN32) || defined(WIN32)
+ if (!home_dir) {
+ home_dir = "c:";
+ }
+#endif
+
+ if( home_dir ){
+ char *z = malloc( strlen(home_dir)+1 );
+ if( z ) strcpy(z, home_dir);
+ home_dir = z;
+ }
+
+ return home_dir;
+}
+
+/*
+** Read input from the file given by sqliterc_override. Or if that
+** parameter is NULL, take input from ~/.sqliterc
+*/
+static void process_sqliterc(
+ struct callback_data *p, /* Configuration data */
+ const char *sqliterc_override /* Name of config file. NULL to use default */
+){
+ char *home_dir = NULL;
+ const char *sqliterc = sqliterc_override;
+ char *zBuf;
+ FILE *in = NULL;
+
+ if (sqliterc == NULL) {
+ home_dir = find_home_dir();
+ if( home_dir==0 ){
+ fprintf(stderr,"%s: cannot locate your home directory!\n", Argv0);
+ return;
+ }
+ zBuf = malloc(strlen(home_dir) + 15);
+ if( zBuf==0 ){
+ fprintf(stderr,"%s: out of memory!\n", Argv0);
+ exit(1);
+ }
+ sprintf(zBuf,"%s/.sqliterc",home_dir);
+ free(home_dir);
+ sqliterc = (const char*)zBuf;
+ }
+ in = fopen(sqliterc,"rb");
+ if( in ){
+ if( isatty(fileno(stdout)) ){
+ printf("Loading resources from %s\n",sqliterc);
+ }
+ process_input(p,in);
+ fclose(in);
+ }
+ return;
+}
+
+/*
+** Show available command line options
+*/
+static const char zOptions[] =
+ " -init filename read/process named file\n"
+ " -echo print commands before execution\n"
+ " -[no]header turn headers on or off\n"
+ " -column set output mode to 'column'\n"
+ " -html set output mode to HTML\n"
+#ifdef SQLITE_HAS_CODEC
+ " -key KEY encryption key\n"
+#endif
+ " -line set output mode to 'line'\n"
+ " -list set output mode to 'list'\n"
+ " -separator 'x' set output field separator (|)\n"
+ " -nullvalue 'text' set text string for NULL values\n"
+ " -version show SQLite version\n"
+ " -help show this text, also show dot-commands\n"
+;
+static void usage(int showDetail){
+ fprintf(stderr, "Usage: %s [OPTIONS] FILENAME [SQL]\n", Argv0);
+ if( showDetail ){
+ fprintf(stderr, "Options are:\n%s", zOptions);
+ }else{
+ fprintf(stderr, "Use the -help option for additional information\n");
+ }
+ exit(1);
+}
+
+/*
+** Initialize the state information in data
+*/
+void main_init(struct callback_data *data) {
+ memset(data, 0, sizeof(*data));
+ data->mode = MODE_List;
+ strcpy(data->separator,"|");
+ data->showHeader = 0;
+ strcpy(mainPrompt,"sqlite> ");
+ strcpy(continuePrompt," ...> ");
+}
+
+int main(int argc, char **argv){
+ char *zErrMsg = 0;
+ struct callback_data data;
+ const char *zInitFile = 0;
+ char *zFirstCmd = 0;
+ int i;
+
+#ifdef __MACOS__
+ argc = ccommand(&argv);
+#endif
+
+ Argv0 = argv[0];
+ main_init(&data);
+
+ /* Make sure we have a valid signal handler early, before anything
+ ** else is done.
+ */
+#ifdef SIGINT
+ signal(SIGINT, interrupt_handler);
+#endif
+
+ /* Do an initial pass through the command-line argument to locate
+ ** the name of the database file, the name of the initialization file,
+ ** and the first command to execute.
+ */
+ for(i=1; i<argc-1; i++){
+ if( argv[i][0]!='-' ) break;
+ if( strcmp(argv[i],"-separator")==0 || strcmp(argv[i],"-nullvalue")==0 ){
+ i++;
+ }else if( strcmp(argv[i],"-init")==0 ){
+ i++;
+ zInitFile = argv[i];
+ }else if( strcmp(argv[i],"-key")==0 ){
+ i++;
+ data.zKey = sqlite3_mprintf("%s",argv[i]);
+ }
+ }
+ if( i<argc ){
+ data.zDbFilename = argv[i++];
+ }else{
+#ifndef SQLITE_OMIT_MEMORYDB
+ data.zDbFilename = ":memory:";
+#else
+ data.zDbFilename = 0;
+#endif
+ }
+ if( i<argc ){
+ zFirstCmd = argv[i++];
+ }
+ data.out = stdout;
+
+#ifdef SQLITE_OMIT_MEMORYDB
+ if( data.zDbFilename==0 ){
+ fprintf(stderr,"%s: no database filename specified\n", argv[0]);
+ exit(1);
+ }
+#endif
+
+ /* Go ahead and open the database file if it already exists. If the
+ ** file does not exist, delay opening it. This prevents empty database
+ ** files from being created if a user mistypes the database name argument
+ ** to the sqlite command-line tool.
+ */
+ if( access(data.zDbFilename, 0)==0 ){
+ open_db(&data);
+ }
+
+ /* Process the initialization file if there is one. If no -init option
+ ** is given on the command line, look for a file named ~/.sqliterc and
+ ** try to process it.
+ */
+ process_sqliterc(&data,zInitFile);
+
+ /* Make a second pass through the command-line argument and set
+ ** options. This second pass is delayed until after the initialization
+ ** file is processed so that the command-line arguments will override
+ ** settings in the initialization file.
+ */
+ for(i=1; i<argc && argv[i][0]=='-'; i++){
+ char *z = argv[i];
+ if( strcmp(z,"-init")==0 || strcmp(z,"-key")==0 ){
+ i++;
+ }else if( strcmp(z,"-html")==0 ){
+ data.mode = MODE_Html;
+ }else if( strcmp(z,"-list")==0 ){
+ data.mode = MODE_List;
+ }else if( strcmp(z,"-line")==0 ){
+ data.mode = MODE_Line;
+ }else if( strcmp(z,"-column")==0 ){
+ data.mode = MODE_Column;
+ }else if( strcmp(z,"-separator")==0 ){
+ i++;
+ sprintf(data.separator,"%.*s",(int)sizeof(data.separator)-1,argv[i]);
+ }else if( strcmp(z,"-nullvalue")==0 ){
+ i++;
+ sprintf(data.nullvalue,"%.*s",(int)sizeof(data.nullvalue)-1,argv[i]);
+ }else if( strcmp(z,"-header")==0 ){
+ data.showHeader = 1;
+ }else if( strcmp(z,"-noheader")==0 ){
+ data.showHeader = 0;
+ }else if( strcmp(z,"-echo")==0 ){
+ data.echoOn = 1;
+ }else if( strcmp(z,"-version")==0 ){
+ printf("%s\n", sqlite3_libversion());
+ return 1;
+ }else if( strcmp(z,"-help")==0 ){
+ usage(1);
+ }else{
+ fprintf(stderr,"%s: unknown option: %s\n", Argv0, z);
+ fprintf(stderr,"Use -help for a list of options.\n");
+ return 1;
+ }
+ }
+
+ if( zFirstCmd ){
+ /* Run just the command that follows the database name
+ */
+ if( zFirstCmd[0]=='.' ){
+ do_meta_command(zFirstCmd, &data);
+ exit(0);
+ }else{
+ int rc;
+ open_db(&data);
+ rc = sqlite3_exec(data.db, zFirstCmd, callback, &data, &zErrMsg);
+ if( rc!=0 && zErrMsg!=0 ){
+ fprintf(stderr,"SQL error: %s\n", zErrMsg);
+ exit(1);
+ }
+ }
+ }else{
+ /* Run commands received from standard input
+ */
+ if( isatty(fileno(stdout)) && isatty(fileno(stdin)) ){
+ char *zHome;
+ char *zHistory = 0;
+ printf(
+ "SQLite version %s\n"
+ "Enter \".help\" for instructions\n",
+ sqlite3_libversion()
+ );
+ zHome = find_home_dir();
+ if( zHome && (zHistory = malloc(strlen(zHome)+20))!=0 ){
+ sprintf(zHistory,"%s/.sqlite_history", zHome);
+ }
+#if defined(HAVE_READLINE) && HAVE_READLINE==1
+ if( zHistory ) read_history(zHistory);
+#endif
+ process_input(&data, 0);
+ if( zHistory ){
+ stifle_history(100);
+ write_history(zHistory);
+ }
+ }else{
+ process_input(&data, stdin);
+ }
+ }
+ set_table_name(&data, 0);
+ if( db ) sqlite3_close(db);
+ return 0;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/sqlite.h.in b/ext/pdo_sqlite/sqlite/src/sqlite.h.in
new file mode 100644
index 000000000..6b2dd551d
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/sqlite.h.in
@@ -0,0 +1,1275 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the interface that the SQLite library
+** presents to client programs.
+**
+** @(#) $Id$
+*/
+#ifndef _SQLITE3_H_
+#define _SQLITE3_H_
+#include <stdarg.h> /* Needed for the definition of va_list */
+
+/*
+** Make sure we can call this stuff from C++.
+*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** The version of the SQLite library.
+*/
+#ifdef SQLITE_VERSION
+# undef SQLITE_VERSION
+#endif
+#define SQLITE_VERSION "--VERS--"
+
+/*
+** The format of the version string is "X.Y.Z<trailing string>", where
+** X is the major version number, Y is the minor version number and Z
+** is the release number. The trailing string is often "alpha" or "beta".
+** For example "3.1.1beta".
+**
+** The SQLITE_VERSION_NUMBER is an integer with the value
+** (X*100000 + Y*1000 + Z). For example, for version "3.1.1beta",
+** SQLITE_VERSION_NUMBER is set to 3001001. To detect if they are using
+** version 3.1.1 or greater at compile time, programs may use the test
+** (SQLITE_VERSION_NUMBER>=3001001).
+*/
+#ifdef SQLITE_VERSION_NUMBER
+# undef SQLITE_VERSION_NUMBER
+#endif
+#define SQLITE_VERSION_NUMBER --VERSION-NUMBER--
+
+/*
+** The version string is also compiled into the library so that a program
+** can check to make sure that the lib*.a file and the *.h file are from
+** the same version. The sqlite3_libversion() function returns a pointer
+** to the sqlite3_version variable - useful in DLLs which cannot access
+** global variables.
+*/
+extern const char sqlite3_version[];
+const char *sqlite3_libversion(void);
+
+/*
+** Return the value of the SQLITE_VERSION_NUMBER macro when the
+** library was compiled.
+*/
+int sqlite3_libversion_number(void);
+
+/*
+** Each open sqlite database is represented by an instance of the
+** following opaque structure.
+*/
+typedef struct sqlite3 sqlite3;
+
+
+/*
+** Some compilers do not support the "long long" datatype. So we have
+** to do a typedef that for 64-bit integers that depends on what compiler
+** is being used.
+*/
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+ typedef __int64 sqlite_int64;
+ typedef unsigned __int64 sqlite_uint64;
+#else
+ typedef long long int sqlite_int64;
+ typedef unsigned long long int sqlite_uint64;
+#endif
+
+
+/*
+** A function to close the database.
+**
+** Call this function with a pointer to a structure that was previously
+** returned from sqlite3_open() and the corresponding database will by closed.
+**
+** All SQL statements prepared using sqlite3_prepare() or
+** sqlite3_prepare16() must be deallocated using sqlite3_finalize() before
+** this routine is called. Otherwise, SQLITE_BUSY is returned and the
+** database connection remains open.
+*/
+int sqlite3_close(sqlite3 *);
+
+/*
+** The type for a callback function.
+*/
+typedef int (*sqlite3_callback)(void*,int,char**, char**);
+
+/*
+** A function to executes one or more statements of SQL.
+**
+** If one or more of the SQL statements are queries, then
+** the callback function specified by the 3rd parameter is
+** invoked once for each row of the query result. This callback
+** should normally return 0. If the callback returns a non-zero
+** value then the query is aborted, all subsequent SQL statements
+** are skipped and the sqlite3_exec() function returns the SQLITE_ABORT.
+**
+** The 4th parameter is an arbitrary pointer that is passed
+** to the callback function as its first parameter.
+**
+** The 2nd parameter to the callback function is the number of
+** columns in the query result. The 3rd parameter to the callback
+** is an array of strings holding the values for each column.
+** The 4th parameter to the callback is an array of strings holding
+** the names of each column.
+**
+** The callback function may be NULL, even for queries. A NULL
+** callback is not an error. It just means that no callback
+** will be invoked.
+**
+** If an error occurs while parsing or evaluating the SQL (but
+** not while executing the callback) then an appropriate error
+** message is written into memory obtained from malloc() and
+** *errmsg is made to point to that message. The calling function
+** is responsible for freeing the memory that holds the error
+** message. Use sqlite3_free() for this. If errmsg==NULL,
+** then no error message is ever written.
+**
+** The return value is is SQLITE_OK if there are no errors and
+** some other return code if there is an error. The particular
+** return value depends on the type of error.
+**
+** If the query could not be executed because a database file is
+** locked or busy, then this function returns SQLITE_BUSY. (This
+** behavior can be modified somewhat using the sqlite3_busy_handler()
+** and sqlite3_busy_timeout() functions below.)
+*/
+int sqlite3_exec(
+ sqlite3*, /* An open database */
+ const char *sql, /* SQL to be executed */
+ sqlite3_callback, /* Callback function */
+ void *, /* 1st argument to callback function */
+ char **errmsg /* Error msg written here */
+);
+
+/*
+** Return values for sqlite3_exec() and sqlite3_step()
+*/
+#define SQLITE_OK 0 /* Successful result */
+#define SQLITE_ERROR 1 /* SQL error or missing database */
+#define SQLITE_INTERNAL 2 /* NOT USED. Internal logic error in SQLite */
+#define SQLITE_PERM 3 /* Access permission denied */
+#define SQLITE_ABORT 4 /* Callback routine requested an abort */
+#define SQLITE_BUSY 5 /* The database file is locked */
+#define SQLITE_LOCKED 6 /* A table in the database is locked */
+#define SQLITE_NOMEM 7 /* A malloc() failed */
+#define SQLITE_READONLY 8 /* Attempt to write a readonly database */
+#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/
+#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
+#define SQLITE_CORRUPT 11 /* The database disk image is malformed */
+#define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */
+#define SQLITE_FULL 13 /* Insertion failed because database is full */
+#define SQLITE_CANTOPEN 14 /* Unable to open the database file */
+#define SQLITE_PROTOCOL 15 /* Database lock protocol error */
+#define SQLITE_EMPTY 16 /* Database is empty */
+#define SQLITE_SCHEMA 17 /* The database schema changed */
+#define SQLITE_TOOBIG 18 /* NOT USED. Too much data for one row */
+#define SQLITE_CONSTRAINT 19 /* Abort due to contraint violation */
+#define SQLITE_MISMATCH 20 /* Data type mismatch */
+#define SQLITE_MISUSE 21 /* Library used incorrectly */
+#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */
+#define SQLITE_AUTH 23 /* Authorization denied */
+#define SQLITE_FORMAT 24 /* Auxiliary database format error */
+#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
+#define SQLITE_NOTADB 26 /* File opened that is not a database file */
+#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */
+#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */
+
+/*
+** Each entry in an SQLite table has a unique integer key. (The key is
+** the value of the INTEGER PRIMARY KEY column if there is such a column,
+** otherwise the key is generated at random. The unique key is always
+** available as the ROWID, OID, or _ROWID_ column.) The following routine
+** returns the integer key of the most recent insert in the database.
+**
+** This function is similar to the mysql_insert_id() function from MySQL.
+*/
+sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
+
+/*
+** This function returns the number of database rows that were changed
+** (or inserted or deleted) by the most recent called sqlite3_exec().
+**
+** All changes are counted, even if they were later undone by a
+** ROLLBACK or ABORT. Except, changes associated with creating and
+** dropping tables are not counted.
+**
+** If a callback invokes sqlite3_exec() recursively, then the changes
+** in the inner, recursive call are counted together with the changes
+** in the outer call.
+**
+** SQLite implements the command "DELETE FROM table" without a WHERE clause
+** by dropping and recreating the table. (This is much faster than going
+** through and deleting individual elements form the table.) Because of
+** this optimization, the change count for "DELETE FROM table" will be
+** zero regardless of the number of elements that were originally in the
+** table. To get an accurate count of the number of rows deleted, use
+** "DELETE FROM table WHERE 1" instead.
+*/
+int sqlite3_changes(sqlite3*);
+
+/*
+** This function returns the number of database rows that have been
+** modified by INSERT, UPDATE or DELETE statements since the database handle
+** was opened. This includes UPDATE, INSERT and DELETE statements executed
+** as part of trigger programs. All changes are counted as soon as the
+** statement that makes them is completed (when the statement handle is
+** passed to sqlite3_reset() or sqlite_finalise()).
+**
+** SQLite implements the command "DELETE FROM table" without a WHERE clause
+** by dropping and recreating the table. (This is much faster than going
+** through and deleting individual elements form the table.) Because of
+** this optimization, the change count for "DELETE FROM table" will be
+** zero regardless of the number of elements that were originally in the
+** table. To get an accurate count of the number of rows deleted, use
+** "DELETE FROM table WHERE 1" instead.
+*/
+int sqlite3_total_changes(sqlite3*);
+
+/* This function causes any pending database operation to abort and
+** return at its earliest opportunity. This routine is typically
+** called in response to a user action such as pressing "Cancel"
+** or Ctrl-C where the user wants a long query operation to halt
+** immediately.
+*/
+void sqlite3_interrupt(sqlite3*);
+
+
+/* These functions return true if the given input string comprises
+** one or more complete SQL statements. For the sqlite3_complete() call,
+** the parameter must be a nul-terminated UTF-8 string. For
+** sqlite3_complete16(), a nul-terminated machine byte order UTF-16 string
+** is required.
+**
+** The algorithm is simple. If the last token other than spaces
+** and comments is a semicolon, then return true. otherwise return
+** false.
+*/
+int sqlite3_complete(const char *sql);
+int sqlite3_complete16(const void *sql);
+
+/*
+** This routine identifies a callback function that is invoked
+** whenever an attempt is made to open a database table that is
+** currently locked by another process or thread. If the busy callback
+** is NULL, then sqlite3_exec() returns SQLITE_BUSY immediately if
+** it finds a locked table. If the busy callback is not NULL, then
+** sqlite3_exec() invokes the callback with three arguments. The
+** second argument is the name of the locked table and the third
+** argument is the number of times the table has been busy. If the
+** busy callback returns 0, then sqlite3_exec() immediately returns
+** SQLITE_BUSY. If the callback returns non-zero, then sqlite3_exec()
+** tries to open the table again and the cycle repeats.
+**
+** The default busy callback is NULL.
+**
+** Sqlite is re-entrant, so the busy handler may start a new query.
+** (It is not clear why anyone would every want to do this, but it
+** is allowed, in theory.) But the busy handler may not close the
+** database. Closing the database from a busy handler will delete
+** data structures out from under the executing query and will
+** probably result in a coredump.
+*/
+int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
+
+/*
+** This routine sets a busy handler that sleeps for a while when a
+** table is locked. The handler will sleep multiple times until
+** at least "ms" milleseconds of sleeping have been done. After
+** "ms" milleseconds of sleeping, the handler returns 0 which
+** causes sqlite3_exec() to return SQLITE_BUSY.
+**
+** Calling this routine with an argument less than or equal to zero
+** turns off all busy handlers.
+*/
+int sqlite3_busy_timeout(sqlite3*, int ms);
+
+/*
+** This next routine is really just a wrapper around sqlite3_exec().
+** Instead of invoking a user-supplied callback for each row of the
+** result, this routine remembers each row of the result in memory
+** obtained from malloc(), then returns all of the result after the
+** query has finished.
+**
+** As an example, suppose the query result where this table:
+**
+** Name | Age
+** -----------------------
+** Alice | 43
+** Bob | 28
+** Cindy | 21
+**
+** If the 3rd argument were &azResult then after the function returns
+** azResult will contain the following data:
+**
+** azResult[0] = "Name";
+** azResult[1] = "Age";
+** azResult[2] = "Alice";
+** azResult[3] = "43";
+** azResult[4] = "Bob";
+** azResult[5] = "28";
+** azResult[6] = "Cindy";
+** azResult[7] = "21";
+**
+** Notice that there is an extra row of data containing the column
+** headers. But the *nrow return value is still 3. *ncolumn is
+** set to 2. In general, the number of values inserted into azResult
+** will be ((*nrow) + 1)*(*ncolumn).
+**
+** After the calling function has finished using the result, it should
+** pass the result data pointer to sqlite3_free_table() in order to
+** release the memory that was malloc-ed. Because of the way the
+** malloc() happens, the calling function must not try to call
+** free() directly. Only sqlite3_free_table() is able to release
+** the memory properly and safely.
+**
+** The return value of this routine is the same as from sqlite3_exec().
+*/
+int sqlite3_get_table(
+ sqlite3*, /* An open database */
+ const char *sql, /* SQL to be executed */
+ char ***resultp, /* Result written to a char *[] that this points to */
+ int *nrow, /* Number of result rows written here */
+ int *ncolumn, /* Number of result columns written here */
+ char **errmsg /* Error msg written here */
+);
+
+/*
+** Call this routine to free the memory that sqlite3_get_table() allocated.
+*/
+void sqlite3_free_table(char **result);
+
+/*
+** The following routines are variants of the "sprintf()" from the
+** standard C library. The resulting string is written into memory
+** obtained from malloc() so that there is never a possiblity of buffer
+** overflow. These routines also implement some additional formatting
+** options that are useful for constructing SQL statements.
+**
+** The strings returned by these routines should be freed by calling
+** sqlite3_free().
+**
+** All of the usual printf formatting options apply. In addition, there
+** is a "%q" option. %q works like %s in that it substitutes a null-terminated
+** string from the argument list. But %q also doubles every '\'' character.
+** %q is designed for use inside a string literal. By doubling each '\''
+** character it escapes that character and allows it to be inserted into
+** the string.
+**
+** For example, so some string variable contains text as follows:
+**
+** char *zText = "It's a happy day!";
+**
+** We can use this text in an SQL statement as follows:
+**
+** char *z = sqlite3_mprintf("INSERT INTO TABLES('%q')", zText);
+** sqlite3_exec(db, z, callback1, 0, 0);
+** sqlite3_free(z);
+**
+** Because the %q format string is used, the '\'' character in zText
+** is escaped and the SQL generated is as follows:
+**
+** INSERT INTO table1 VALUES('It''s a happy day!')
+**
+** This is correct. Had we used %s instead of %q, the generated SQL
+** would have looked like this:
+**
+** INSERT INTO table1 VALUES('It's a happy day!');
+**
+** This second example is an SQL syntax error. As a general rule you
+** should always use %q instead of %s when inserting text into a string
+** literal.
+*/
+char *sqlite3_mprintf(const char*,...);
+char *sqlite3_vmprintf(const char*, va_list);
+void sqlite3_free(char *z);
+char *sqlite3_snprintf(int,char*,const char*, ...);
+
+#ifndef SQLITE_OMIT_AUTHORIZATION
+/*
+** This routine registers a callback with the SQLite library. The
+** callback is invoked (at compile-time, not at run-time) for each
+** attempt to access a column of a table in the database. The callback
+** returns SQLITE_OK if access is allowed, SQLITE_DENY if the entire
+** SQL statement should be aborted with an error and SQLITE_IGNORE
+** if the column should be treated as a NULL value.
+*/
+int sqlite3_set_authorizer(
+ sqlite3*,
+ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
+ void *pUserData
+);
+#endif
+
+/*
+** The second parameter to the access authorization function above will
+** be one of the values below. These values signify what kind of operation
+** is to be authorized. The 3rd and 4th parameters to the authorization
+** function will be parameters or NULL depending on which of the following
+** codes is used as the second parameter. The 5th parameter is the name
+** of the database ("main", "temp", etc.) if applicable. The 6th parameter
+** is the name of the inner-most trigger or view that is responsible for
+** the access attempt or NULL if this access attempt is directly from
+** input SQL code.
+**
+** Arg-3 Arg-4
+*/
+#define SQLITE_COPY 0 /* Table Name File Name */
+#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */
+#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */
+#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */
+#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */
+#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */
+#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */
+#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */
+#define SQLITE_CREATE_VIEW 8 /* View Name NULL */
+#define SQLITE_DELETE 9 /* Table Name NULL */
+#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */
+#define SQLITE_DROP_TABLE 11 /* Table Name NULL */
+#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */
+#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */
+#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */
+#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */
+#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */
+#define SQLITE_DROP_VIEW 17 /* View Name NULL */
+#define SQLITE_INSERT 18 /* Table Name NULL */
+#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */
+#define SQLITE_READ 20 /* Table Name Column Name */
+#define SQLITE_SELECT 21 /* NULL NULL */
+#define SQLITE_TRANSACTION 22 /* NULL NULL */
+#define SQLITE_UPDATE 23 /* Table Name Column Name */
+#define SQLITE_ATTACH 24 /* Filename NULL */
+#define SQLITE_DETACH 25 /* Database Name NULL */
+#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */
+#define SQLITE_REINDEX 27 /* Index Name NULL */
+#define SQLITE_ANALYZE 28 /* Table Name NULL */
+
+
+/*
+** The return value of the authorization function should be one of the
+** following constants:
+*/
+/* #define SQLITE_OK 0 // Allow access (This is actually defined above) */
+#define SQLITE_DENY 1 /* Abort the SQL statement with an error */
+#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */
+
+/*
+** Register a function for tracing SQL command evaluation. The function
+** registered by sqlite3_trace() is invoked at the first sqlite3_step()
+** for the evaluation of an SQL statement. The function registered by
+** sqlite3_profile() runs at the end of each SQL statement and includes
+** information on how long that statement ran.
+**
+** The sqlite3_profile() API is currently considered experimental and
+** is subject to change.
+*/
+void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
+void *sqlite3_profile(sqlite3*,
+ void(*xProfile)(void*,const char*,sqlite_uint64), void*);
+
+/*
+** This routine configures a callback function - the progress callback - that
+** is invoked periodically during long running calls to sqlite3_exec(),
+** sqlite3_step() and sqlite3_get_table(). An example use for this API is to
+** keep a GUI updated during a large query.
+**
+** The progress callback is invoked once for every N virtual machine opcodes,
+** where N is the second argument to this function. The progress callback
+** itself is identified by the third argument to this function. The fourth
+** argument to this function is a void pointer passed to the progress callback
+** function each time it is invoked.
+**
+** If a call to sqlite3_exec(), sqlite3_step() or sqlite3_get_table() results
+** in less than N opcodes being executed, then the progress callback is not
+** invoked.
+**
+** To remove the progress callback altogether, pass NULL as the third
+** argument to this function.
+**
+** If the progress callback returns a result other than 0, then the current
+** query is immediately terminated and any database changes rolled back. If the
+** query was part of a larger transaction, then the transaction is not rolled
+** back and remains active. The sqlite3_exec() call returns SQLITE_ABORT.
+**
+******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ******
+*/
+void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
+
+/*
+** Register a callback function to be invoked whenever a new transaction
+** is committed. The pArg argument is passed through to the callback.
+** callback. If the callback function returns non-zero, then the commit
+** is converted into a rollback.
+**
+** If another function was previously registered, its pArg value is returned.
+** Otherwise NULL is returned.
+**
+** Registering a NULL function disables the callback.
+**
+******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ******
+*/
+void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
+
+/*
+** Open the sqlite database file "filename". The "filename" is UTF-8
+** encoded for sqlite3_open() and UTF-16 encoded in the native byte order
+** for sqlite3_open16(). An sqlite3* handle is returned in *ppDb, even
+** if an error occurs. If the database is opened (or created) successfully,
+** then SQLITE_OK is returned. Otherwise an error code is returned. The
+** sqlite3_errmsg() or sqlite3_errmsg16() routines can be used to obtain
+** an English language description of the error.
+**
+** If the database file does not exist, then a new database is created.
+** The encoding for the database is UTF-8 if sqlite3_open() is called and
+** UTF-16 if sqlite3_open16 is used.
+**
+** Whether or not an error occurs when it is opened, resources associated
+** with the sqlite3* handle should be released by passing it to
+** sqlite3_close() when it is no longer required.
+*/
+int sqlite3_open(
+ const char *filename, /* Database filename (UTF-8) */
+ sqlite3 **ppDb /* OUT: SQLite db handle */
+);
+int sqlite3_open16(
+ const void *filename, /* Database filename (UTF-16) */
+ sqlite3 **ppDb /* OUT: SQLite db handle */
+);
+
+/*
+** Return the error code for the most recent sqlite3_* API call associated
+** with sqlite3 handle 'db'. SQLITE_OK is returned if the most recent
+** API call was successful.
+**
+** Calls to many sqlite3_* functions set the error code and string returned
+** by sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16()
+** (overwriting the previous values). Note that calls to sqlite3_errcode(),
+** sqlite3_errmsg() and sqlite3_errmsg16() themselves do not affect the
+** results of future invocations.
+**
+** Assuming no other intervening sqlite3_* API calls are made, the error
+** code returned by this function is associated with the same error as
+** the strings returned by sqlite3_errmsg() and sqlite3_errmsg16().
+*/
+int sqlite3_errcode(sqlite3 *db);
+
+/*
+** Return a pointer to a UTF-8 encoded string describing in english the
+** error condition for the most recent sqlite3_* API call. The returned
+** string is always terminated by an 0x00 byte.
+**
+** The string "not an error" is returned when the most recent API call was
+** successful.
+*/
+const char *sqlite3_errmsg(sqlite3*);
+
+/*
+** Return a pointer to a UTF-16 native byte order encoded string describing
+** in english the error condition for the most recent sqlite3_* API call.
+** The returned string is always terminated by a pair of 0x00 bytes.
+**
+** The string "not an error" is returned when the most recent API call was
+** successful.
+*/
+const void *sqlite3_errmsg16(sqlite3*);
+
+/*
+** An instance of the following opaque structure is used to represent
+** a compiled SQL statment.
+*/
+typedef struct sqlite3_stmt sqlite3_stmt;
+
+/*
+** To execute an SQL query, it must first be compiled into a byte-code
+** program using one of the following routines. The only difference between
+** them is that the second argument, specifying the SQL statement to
+** compile, is assumed to be encoded in UTF-8 for the sqlite3_prepare()
+** function and UTF-16 for sqlite3_prepare16().
+**
+** The first parameter "db" is an SQLite database handle. The second
+** parameter "zSql" is the statement to be compiled, encoded as either
+** UTF-8 or UTF-16 (see above). If the next parameter, "nBytes", is less
+** than zero, then zSql is read up to the first nul terminator. If
+** "nBytes" is not less than zero, then it is the length of the string zSql
+** in bytes (not characters).
+**
+** *pzTail is made to point to the first byte past the end of the first
+** SQL statement in zSql. This routine only compiles the first statement
+** in zSql, so *pzTail is left pointing to what remains uncompiled.
+**
+** *ppStmt is left pointing to a compiled SQL statement that can be
+** executed using sqlite3_step(). Or if there is an error, *ppStmt may be
+** set to NULL. If the input text contained no SQL (if the input is and
+** empty string or a comment) then *ppStmt is set to NULL.
+**
+** On success, SQLITE_OK is returned. Otherwise an error code is returned.
+*/
+int sqlite3_prepare(
+ sqlite3 *db, /* Database handle */
+ const char *zSql, /* SQL statement, UTF-8 encoded */
+ int nBytes, /* Length of zSql in bytes. */
+ sqlite3_stmt **ppStmt, /* OUT: Statement handle */
+ const char **pzTail /* OUT: Pointer to unused portion of zSql */
+);
+int sqlite3_prepare16(
+ sqlite3 *db, /* Database handle */
+ const void *zSql, /* SQL statement, UTF-16 encoded */
+ int nBytes, /* Length of zSql in bytes. */
+ sqlite3_stmt **ppStmt, /* OUT: Statement handle */
+ const void **pzTail /* OUT: Pointer to unused portion of zSql */
+);
+
+/*
+** Pointers to the following two opaque structures are used to communicate
+** with the implementations of user-defined functions.
+*/
+typedef struct sqlite3_context sqlite3_context;
+typedef struct Mem sqlite3_value;
+
+/*
+** In the SQL strings input to sqlite3_prepare() and sqlite3_prepare16(),
+** one or more literals can be replace by parameters "?" or ":AAA" or
+** "$VVV" where AAA is an identifer and VVV is a variable name according
+** to the syntax rules of the TCL programming language.
+** The value of these parameters (also called "host parameter names") can
+** be set using the routines listed below.
+**
+** In every case, the first parameter is a pointer to the sqlite3_stmt
+** structure returned from sqlite3_prepare(). The second parameter is the
+** index of the parameter. The first parameter as an index of 1. For
+** named parameters (":AAA" or "$VVV") you can use
+** sqlite3_bind_parameter_index() to get the correct index value given
+** the parameters name. If the same named parameter occurs more than
+** once, it is assigned the same index each time.
+**
+** The fifth parameter to sqlite3_bind_blob(), sqlite3_bind_text(), and
+** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or
+** text after SQLite has finished with it. If the fifth argument is the
+** special value SQLITE_STATIC, then the library assumes that the information
+** is in static, unmanaged space and does not need to be freed. If the
+** fifth argument has the value SQLITE_TRANSIENT, then SQLite makes its
+** own private copy of the data.
+**
+** The sqlite3_bind_* routine must be called before sqlite3_step() after
+** an sqlite3_prepare() or sqlite3_reset(). Unbound parameterss are
+** interpreted as NULL.
+*/
+int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
+int sqlite3_bind_double(sqlite3_stmt*, int, double);
+int sqlite3_bind_int(sqlite3_stmt*, int, int);
+int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64);
+int sqlite3_bind_null(sqlite3_stmt*, int);
+int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));
+int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
+int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
+
+/*
+** Return the number of parameters in a compiled SQL statement. This
+** routine was added to support DBD::SQLite.
+*/
+int sqlite3_bind_parameter_count(sqlite3_stmt*);
+
+/*
+** Return the name of the i-th parameter. Ordinary parameters "?" are
+** nameless and a NULL is returned. For parameters of the form :AAA or
+** $VVV the complete text of the parameter name is returned, including
+** the initial ":" or "$". NULL is returned if the index is out of range.
+*/
+const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
+
+/*
+** Return the index of a parameter with the given name. The name
+** must match exactly. If no parameter with the given name is found,
+** return 0.
+*/
+int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
+
+/*
+** Set all the parameters in the compiled SQL statement to NULL.
+*/
+int sqlite3_clear_bindings(sqlite3_stmt*);
+
+/*
+** Return the number of columns in the result set returned by the compiled
+** SQL statement. This routine returns 0 if pStmt is an SQL statement
+** that does not return data (for example an UPDATE).
+*/
+int sqlite3_column_count(sqlite3_stmt *pStmt);
+
+/*
+** The first parameter is a compiled SQL statement. This function returns
+** the column heading for the Nth column of that statement, where N is the
+** second function parameter. The string returned is UTF-8 for
+** sqlite3_column_name() and UTF-16 for sqlite3_column_name16().
+*/
+const char *sqlite3_column_name(sqlite3_stmt*,int);
+const void *sqlite3_column_name16(sqlite3_stmt*,int);
+
+/*
+** The first parameter is a compiled SQL statement. If this statement
+** is a SELECT statement, the Nth column of the returned result set
+** of the SELECT is a table column then the declared type of the table
+** column is returned. If the Nth column of the result set is not at table
+** column, then a NULL pointer is returned. The returned string is always
+** UTF-8 encoded. For example, in the database schema:
+**
+** CREATE TABLE t1(c1 VARIANT);
+**
+** And the following statement compiled:
+**
+** SELECT c1 + 1, 0 FROM t1;
+**
+** Then this routine would return the string "VARIANT" for the second
+** result column (i==1), and a NULL pointer for the first result column
+** (i==0).
+*/
+const char *sqlite3_column_decltype(sqlite3_stmt *, int i);
+
+/*
+** The first parameter is a compiled SQL statement. If this statement
+** is a SELECT statement, the Nth column of the returned result set
+** of the SELECT is a table column then the declared type of the table
+** column is returned. If the Nth column of the result set is not at table
+** column, then a NULL pointer is returned. The returned string is always
+** UTF-16 encoded. For example, in the database schema:
+**
+** CREATE TABLE t1(c1 INTEGER);
+**
+** And the following statement compiled:
+**
+** SELECT c1 + 1, 0 FROM t1;
+**
+** Then this routine would return the string "INTEGER" for the second
+** result column (i==1), and a NULL pointer for the first result column
+** (i==0).
+*/
+const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
+
+/*
+** After an SQL query has been compiled with a call to either
+** sqlite3_prepare() or sqlite3_prepare16(), then this function must be
+** called one or more times to execute the statement.
+**
+** The return value will be either SQLITE_BUSY, SQLITE_DONE,
+** SQLITE_ROW, SQLITE_ERROR, or SQLITE_MISUSE.
+**
+** SQLITE_BUSY means that the database engine attempted to open
+** a locked database and there is no busy callback registered.
+** Call sqlite3_step() again to retry the open.
+**
+** SQLITE_DONE means that the statement has finished executing
+** successfully. sqlite3_step() should not be called again on this virtual
+** machine.
+**
+** If the SQL statement being executed returns any data, then
+** SQLITE_ROW is returned each time a new row of data is ready
+** for processing by the caller. The values may be accessed using
+** the sqlite3_column_*() functions described below. sqlite3_step()
+** is called again to retrieve the next row of data.
+**
+** SQLITE_ERROR means that a run-time error (such as a constraint
+** violation) has occurred. sqlite3_step() should not be called again on
+** the VM. More information may be found by calling sqlite3_errmsg().
+**
+** SQLITE_MISUSE means that the this routine was called inappropriately.
+** Perhaps it was called on a virtual machine that had already been
+** finalized or on one that had previously returned SQLITE_ERROR or
+** SQLITE_DONE. Or it could be the case the the same database connection
+** is being used simulataneously by two or more threads.
+*/
+int sqlite3_step(sqlite3_stmt*);
+
+/*
+** Return the number of values in the current row of the result set.
+**
+** After a call to sqlite3_step() that returns SQLITE_ROW, this routine
+** will return the same value as the sqlite3_column_count() function.
+** After sqlite3_step() has returned an SQLITE_DONE, SQLITE_BUSY or
+** error code, or before sqlite3_step() has been called on a
+** compiled SQL statement, this routine returns zero.
+*/
+int sqlite3_data_count(sqlite3_stmt *pStmt);
+
+/*
+** Values are stored in the database in one of the following fundamental
+** types.
+*/
+#define SQLITE_INTEGER 1
+#define SQLITE_FLOAT 2
+/* #define SQLITE_TEXT 3 // See below */
+#define SQLITE_BLOB 4
+#define SQLITE_NULL 5
+
+/*
+** SQLite version 2 defines SQLITE_TEXT differently. To allow both
+** version 2 and version 3 to be included, undefine them both if a
+** conflict is seen. Define SQLITE3_TEXT to be the version 3 value.
+*/
+#ifdef SQLITE_TEXT
+# undef SQLITE_TEXT
+#else
+# define SQLITE_TEXT 3
+#endif
+#define SQLITE3_TEXT 3
+
+/*
+** The next group of routines returns information about the information
+** in a single column of the current result row of a query. In every
+** case the first parameter is a pointer to the SQL statement that is being
+** executed (the sqlite_stmt* that was returned from sqlite3_prepare()) and
+** the second argument is the index of the column for which information
+** should be returned. iCol is zero-indexed. The left-most column as an
+** index of 0.
+**
+** If the SQL statement is not currently point to a valid row, or if the
+** the colulmn index is out of range, the result is undefined.
+**
+** These routines attempt to convert the value where appropriate. For
+** example, if the internal representation is FLOAT and a text result
+** is requested, sprintf() is used internally to do the conversion
+** automatically. The following table details the conversions that
+** are applied:
+**
+** Internal Type Requested Type Conversion
+** ------------- -------------- --------------------------
+** NULL INTEGER Result is 0
+** NULL FLOAT Result is 0.0
+** NULL TEXT Result is an empty string
+** NULL BLOB Result is a zero-length BLOB
+** INTEGER FLOAT Convert from integer to float
+** INTEGER TEXT ASCII rendering of the integer
+** INTEGER BLOB Same as for INTEGER->TEXT
+** FLOAT INTEGER Convert from float to integer
+** FLOAT TEXT ASCII rendering of the float
+** FLOAT BLOB Same as FLOAT->TEXT
+** TEXT INTEGER Use atoi()
+** TEXT FLOAT Use atof()
+** TEXT BLOB No change
+** BLOB INTEGER Convert to TEXT then use atoi()
+** BLOB FLOAT Convert to TEXT then use atof()
+** BLOB TEXT Add a \000 terminator if needed
+**
+** The following access routines are provided:
+**
+** _type() Return the datatype of the result. This is one of
+** SQLITE_INTEGER, SQLITE_FLOAT, SQLITE_TEXT, SQLITE_BLOB,
+** or SQLITE_NULL.
+** _blob() Return the value of a BLOB.
+** _bytes() Return the number of bytes in a BLOB value or the number
+** of bytes in a TEXT value represented as UTF-8. The \000
+** terminator is included in the byte count for TEXT values.
+** _bytes16() Return the number of bytes in a BLOB value or the number
+** of bytes in a TEXT value represented as UTF-16. The \u0000
+** terminator is included in the byte count for TEXT values.
+** _double() Return a FLOAT value.
+** _int() Return an INTEGER value in the host computer's native
+** integer representation. This might be either a 32- or 64-bit
+** integer depending on the host.
+** _int64() Return an INTEGER value as a 64-bit signed integer.
+** _text() Return the value as UTF-8 text.
+** _text16() Return the value as UTF-16 text.
+*/
+const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);
+int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
+int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
+double sqlite3_column_double(sqlite3_stmt*, int iCol);
+int sqlite3_column_int(sqlite3_stmt*, int iCol);
+sqlite_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
+const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
+const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
+int sqlite3_column_type(sqlite3_stmt*, int iCol);
+
+/*
+** The sqlite3_finalize() function is called to delete a compiled
+** SQL statement obtained by a previous call to sqlite3_prepare()
+** or sqlite3_prepare16(). If the statement was executed successfully, or
+** not executed at all, then SQLITE_OK is returned. If execution of the
+** statement failed then an error code is returned.
+**
+** This routine can be called at any point during the execution of the
+** virtual machine. If the virtual machine has not completed execution
+** when this routine is called, that is like encountering an error or
+** an interrupt. (See sqlite3_interrupt().) Incomplete updates may be
+** rolled back and transactions cancelled, depending on the circumstances,
+** and the result code returned will be SQLITE_ABORT.
+*/
+int sqlite3_finalize(sqlite3_stmt *pStmt);
+
+/*
+** The sqlite3_reset() function is called to reset a compiled SQL
+** statement obtained by a previous call to sqlite3_prepare() or
+** sqlite3_prepare16() back to it's initial state, ready to be re-executed.
+** Any SQL statement variables that had values bound to them using
+** the sqlite3_bind_*() API retain their values.
+*/
+int sqlite3_reset(sqlite3_stmt *pStmt);
+
+/*
+** The following two functions are used to add user functions or aggregates
+** implemented in C to the SQL langauge interpreted by SQLite. The
+** difference only between the two is that the second parameter, the
+** name of the (scalar) function or aggregate, is encoded in UTF-8 for
+** sqlite3_create_function() and UTF-16 for sqlite3_create_function16().
+**
+** The first argument is the database handle that the new function or
+** aggregate is to be added to. If a single program uses more than one
+** database handle internally, then user functions or aggregates must
+** be added individually to each database handle with which they will be
+** used.
+**
+** The third parameter is the number of arguments that the function or
+** aggregate takes. If this parameter is negative, then the function or
+** aggregate may take any number of arguments.
+**
+** The fourth parameter is one of SQLITE_UTF* values defined below,
+** indicating the encoding that the function is most likely to handle
+** values in. This does not change the behaviour of the programming
+** interface. However, if two versions of the same function are registered
+** with different encoding values, SQLite invokes the version likely to
+** minimize conversions between text encodings.
+**
+** The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are
+** pointers to user implemented C functions that implement the user
+** function or aggregate. A scalar function requires an implementation of
+** the xFunc callback only, NULL pointers should be passed as the xStep
+** and xFinal parameters. An aggregate function requires an implementation
+** of xStep and xFinal, but NULL should be passed for xFunc. To delete an
+** existing user function or aggregate, pass NULL for all three function
+** callback. Specifying an inconstent set of callback values, such as an
+** xFunc and an xFinal, or an xStep but no xFinal, SQLITE_ERROR is
+** returned.
+*/
+int sqlite3_create_function(
+ sqlite3 *,
+ const char *zFunctionName,
+ int nArg,
+ int eTextRep,
+ void*,
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+ void (*xFinal)(sqlite3_context*)
+);
+int sqlite3_create_function16(
+ sqlite3*,
+ const void *zFunctionName,
+ int nArg,
+ int eTextRep,
+ void*,
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+ void (*xFinal)(sqlite3_context*)
+);
+
+/*
+** The next routine returns the number of calls to xStep for a particular
+** aggregate function instance. The current call to xStep counts so this
+** routine always returns at least 1.
+*/
+int sqlite3_aggregate_count(sqlite3_context*);
+
+/*
+** The next group of routines returns information about parameters to
+** a user-defined function. Function implementations use these routines
+** to access their parameters. These routines are the same as the
+** sqlite3_column_* routines except that these routines take a single
+** sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
+** column number.
+*/
+const void *sqlite3_value_blob(sqlite3_value*);
+int sqlite3_value_bytes(sqlite3_value*);
+int sqlite3_value_bytes16(sqlite3_value*);
+double sqlite3_value_double(sqlite3_value*);
+int sqlite3_value_int(sqlite3_value*);
+sqlite_int64 sqlite3_value_int64(sqlite3_value*);
+const unsigned char *sqlite3_value_text(sqlite3_value*);
+const void *sqlite3_value_text16(sqlite3_value*);
+const void *sqlite3_value_text16le(sqlite3_value*);
+const void *sqlite3_value_text16be(sqlite3_value*);
+int sqlite3_value_type(sqlite3_value*);
+
+/*
+** Aggregate functions use the following routine to allocate
+** a structure for storing their state. The first time this routine
+** is called for a particular aggregate, a new structure of size nBytes
+** is allocated, zeroed, and returned. On subsequent calls (for the
+** same aggregate instance) the same buffer is returned. The implementation
+** of the aggregate can use the returned buffer to accumulate data.
+**
+** The buffer allocated is freed automatically by SQLite.
+*/
+void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);
+
+/*
+** The pUserData parameter to the sqlite3_create_function()
+** routine used to register user functions is available to
+** the implementation of the function using this call.
+*/
+void *sqlite3_user_data(sqlite3_context*);
+
+/*
+** The following two functions may be used by scalar user functions to
+** associate meta-data with argument values. If the same value is passed to
+** multiple invocations of the user-function during query execution, under
+** some circumstances the associated meta-data may be preserved. This may
+** be used, for example, to add a regular-expression matching scalar
+** function. The compiled version of the regular expression is stored as
+** meta-data associated with the SQL value passed as the regular expression
+** pattern.
+**
+** Calling sqlite3_get_auxdata() returns a pointer to the meta data
+** associated with the Nth argument value to the current user function
+** call, where N is the second parameter. If no meta-data has been set for
+** that value, then a NULL pointer is returned.
+**
+** The sqlite3_set_auxdata() is used to associate meta data with a user
+** function argument. The third parameter is a pointer to the meta data
+** to be associated with the Nth user function argument value. The fourth
+** parameter specifies a 'delete function' that will be called on the meta
+** data pointer to release it when it is no longer required. If the delete
+** function pointer is NULL, it is not invoked.
+**
+** In practice, meta-data is preserved between function calls for
+** expressions that are constant at compile time. This includes literal
+** values and SQL variables.
+*/
+void *sqlite3_get_auxdata(sqlite3_context*, int);
+void sqlite3_set_auxdata(sqlite3_context*, int, void*, void (*)(void*));
+
+
+/*
+** These are special value for the destructor that is passed in as the
+** final argument to routines like sqlite3_result_blob(). If the destructor
+** argument is SQLITE_STATIC, it means that the content pointer is constant
+** and will never change. It does not need to be destroyed. The
+** SQLITE_TRANSIENT value means that the content will likely change in
+** the near future and that SQLite should make its own private copy of
+** the content before returning.
+*/
+#define SQLITE_STATIC ((void(*)(void *))0)
+#define SQLITE_TRANSIENT ((void(*)(void *))-1)
+
+/*
+** User-defined functions invoke the following routines in order to
+** set their return value.
+*/
+void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
+void sqlite3_result_double(sqlite3_context*, double);
+void sqlite3_result_error(sqlite3_context*, const char*, int);
+void sqlite3_result_error16(sqlite3_context*, const void*, int);
+void sqlite3_result_int(sqlite3_context*, int);
+void sqlite3_result_int64(sqlite3_context*, sqlite_int64);
+void sqlite3_result_null(sqlite3_context*);
+void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
+void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
+void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
+void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
+void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
+
+/*
+** These are the allowed values for the eTextRep argument to
+** sqlite3_create_collation and sqlite3_create_function.
+*/
+#define SQLITE_UTF8 1
+#define SQLITE_UTF16LE 2
+#define SQLITE_UTF16BE 3
+#define SQLITE_UTF16 4 /* Use native byte order */
+#define SQLITE_ANY 5 /* sqlite3_create_function only */
+
+/*
+** These two functions are used to add new collation sequences to the
+** sqlite3 handle specified as the first argument.
+**
+** The name of the new collation sequence is specified as a UTF-8 string
+** for sqlite3_create_collation() and a UTF-16 string for
+** sqlite3_create_collation16(). In both cases the name is passed as the
+** second function argument.
+**
+** The third argument must be one of the constants SQLITE_UTF8,
+** SQLITE_UTF16LE or SQLITE_UTF16BE, indicating that the user-supplied
+** routine expects to be passed pointers to strings encoded using UTF-8,
+** UTF-16 little-endian or UTF-16 big-endian respectively.
+**
+** A pointer to the user supplied routine must be passed as the fifth
+** argument. If it is NULL, this is the same as deleting the collation
+** sequence (so that SQLite cannot call it anymore). Each time the user
+** supplied function is invoked, it is passed a copy of the void* passed as
+** the fourth argument to sqlite3_create_collation() or
+** sqlite3_create_collation16() as its first parameter.
+**
+** The remaining arguments to the user-supplied routine are two strings,
+** each represented by a [length, data] pair and encoded in the encoding
+** that was passed as the third argument when the collation sequence was
+** registered. The user routine should return negative, zero or positive if
+** the first string is less than, equal to, or greater than the second
+** string. i.e. (STRING1 - STRING2).
+*/
+int sqlite3_create_collation(
+ sqlite3*,
+ const char *zName,
+ int eTextRep,
+ void*,
+ int(*xCompare)(void*,int,const void*,int,const void*)
+);
+int sqlite3_create_collation16(
+ sqlite3*,
+ const char *zName,
+ int eTextRep,
+ void*,
+ int(*xCompare)(void*,int,const void*,int,const void*)
+);
+
+/*
+** To avoid having to register all collation sequences before a database
+** can be used, a single callback function may be registered with the
+** database handle to be called whenever an undefined collation sequence is
+** required.
+**
+** If the function is registered using the sqlite3_collation_needed() API,
+** then it is passed the names of undefined collation sequences as strings
+** encoded in UTF-8. If sqlite3_collation_needed16() is used, the names
+** are passed as UTF-16 in machine native byte order. A call to either
+** function replaces any existing callback.
+**
+** When the user-function is invoked, the first argument passed is a copy
+** of the second argument to sqlite3_collation_needed() or
+** sqlite3_collation_needed16(). The second argument is the database
+** handle. The third argument is one of SQLITE_UTF8, SQLITE_UTF16BE or
+** SQLITE_UTF16LE, indicating the most desirable form of the collation
+** sequence function required. The fourth parameter is the name of the
+** required collation sequence.
+**
+** The collation sequence is returned to SQLite by a collation-needed
+** callback using the sqlite3_create_collation() or
+** sqlite3_create_collation16() APIs, described above.
+*/
+int sqlite3_collation_needed(
+ sqlite3*,
+ void*,
+ void(*)(void*,sqlite3*,int eTextRep,const char*)
+);
+int sqlite3_collation_needed16(
+ sqlite3*,
+ void*,
+ void(*)(void*,sqlite3*,int eTextRep,const void*)
+);
+
+/*
+** Specify the key for an encrypted database. This routine should be
+** called right after sqlite3_open().
+**
+** The code to implement this API is not available in the public release
+** of SQLite.
+*/
+int sqlite3_key(
+ sqlite3 *db, /* Database to be rekeyed */
+ const void *pKey, int nKey /* The key */
+);
+
+/*
+** Change the key on an open database. If the current database is not
+** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the
+** database is decrypted.
+**
+** The code to implement this API is not available in the public release
+** of SQLite.
+*/
+int sqlite3_rekey(
+ sqlite3 *db, /* Database to be rekeyed */
+ const void *pKey, int nKey /* The new key */
+);
+
+/*
+** Sleep for a little while. The second parameter is the number of
+** miliseconds to sleep for.
+**
+** If the operating system does not support sleep requests with
+** milisecond time resolution, then the time will be rounded up to
+** the nearest second. The number of miliseconds of sleep actually
+** requested from the operating system is returned.
+*/
+int sqlite3_sleep(int);
+
+/*
+** Return TRUE (non-zero) if the statement supplied as an argument needs
+** to be recompiled. A statement needs to be recompiled whenever the
+** execution environment changes in a way that would alter the program
+** that sqlite3_prepare() generates. For example, if new functions or
+** collating sequences are registered or if an authorizer function is
+** added or changed.
+**
+*/
+int sqlite3_expired(sqlite3_stmt*);
+
+/*
+** Move all bindings from the first prepared statement over to the second.
+** This routine is useful, for example, if the first prepared statement
+** fails with an SQLITE_SCHEMA error. The same SQL can be prepared into
+** the second prepared statement then all of the bindings transfered over
+** to the second statement before the first statement is finalized.
+*/
+int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
+
+/*
+** If the following global variable is made to point to a
+** string which is the name of a directory, then all temporary files
+** created by SQLite will be placed in that directory. If this variable
+** is NULL pointer, then SQLite does a search for an appropriate temporary
+** file directory.
+**
+** Once sqlite3_open() has been called, changing this variable will invalidate
+** the current temporary database, if any.
+*/
+extern char *sqlite3_temp_directory;
+
+/*
+** This function is called to recover from a malloc() failure that occured
+** within the SQLite library. Normally, after a single malloc() fails the
+** library refuses to function (all major calls return SQLITE_NOMEM).
+** This function restores the library state so that it can be used again.
+**
+** All existing statements (sqlite3_stmt pointers) must be finalized or
+** reset before this call is made. Otherwise, SQLITE_BUSY is returned.
+** If any in-memory databases are in use, either as a main or TEMP
+** database, SQLITE_ERROR is returned. In either of these cases, the
+** library is not reset and remains unusable.
+**
+** This function is *not* threadsafe. Calling this from within a threaded
+** application when threads other than the caller have used SQLite is
+** dangerous and will almost certainly result in malfunctions.
+**
+** This functionality can be omitted from a build by defining the
+** SQLITE_OMIT_GLOBALRECOVER at compile time.
+*/
+int sqlite3_global_recover();
+
+/*
+** Test to see whether or not the database connection is in autocommit
+** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
+** by default. Autocommit is disabled by a BEGIN statement and reenabled
+** by the next COMMIT or ROLLBACK.
+*/
+int sqlite3_get_autocommit(sqlite3*);
+
+/*
+** Return the sqlite3* database handle to which the prepared statement given
+** in the argument belongs. This is the same database handle that was
+** the first argument to the sqlite3_prepare() that was used to create
+** the statement in the first place.
+*/
+sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
+
+#ifdef __cplusplus
+} /* End of the 'extern "C"' block */
+#endif
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/sqliteInt.h b/ext/pdo_sqlite/sqlite/src/sqliteInt.h
new file mode 100644
index 000000000..1635369c4
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/sqliteInt.h
@@ -0,0 +1,1664 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Internal interface definitions for SQLite.
+**
+** @(#) $Id$
+*/
+#ifndef _SQLITEINT_H_
+#define _SQLITEINT_H_
+
+/*
+** Many people are failing to set -DNDEBUG=1 when compiling SQLite.
+** Setting NDEBUG makes the code smaller and run faster. So the following
+** lines are added to automatically set NDEBUG unless the -DSQLITE_DEBUG=1
+** option is set. Thus NDEBUG becomes an opt-in rather than an opt-out
+** feature.
+*/
+#if !defined(NDEBUG) && !defined(SQLITE_DEBUG)
+# define NDEBUG 1
+#endif
+
+/*
+** These #defines should enable >2GB file support on Posix if the
+** underlying operating system supports it. If the OS lacks
+** large file support, or if the OS is windows, these should be no-ops.
+**
+** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
+** on the compiler command line. This is necessary if you are compiling
+** on a recent machine (ex: RedHat 7.2) but you want your code to work
+** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2
+** without this option, LFS is enable. But LFS does not exist in the kernel
+** in RedHat 6.0, so the code won't work. Hence, for maximum binary
+** portability you should omit LFS.
+**
+** Similar is true for MacOS. LFS is only supported on MacOS 9 and later.
+*/
+#ifndef SQLITE_DISABLE_LFS
+# define _LARGE_FILE 1
+# ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
+# endif
+# define _LARGEFILE_SOURCE 1
+#endif
+
+#include "sqlite3.h"
+#include "hash.h"
+#include "parse.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <stddef.h>
+
+/*
+** The maximum number of in-memory pages to use for the main database
+** table and for temporary tables. Internally, the MAX_PAGES and
+** TEMP_PAGES macros are used. To override the default values at
+** compilation time, the SQLITE_DEFAULT_CACHE_SIZE and
+** SQLITE_DEFAULT_TEMP_CACHE_SIZE macros should be set.
+*/
+#ifdef SQLITE_DEFAULT_CACHE_SIZE
+# define MAX_PAGES SQLITE_DEFAULT_CACHE_SIZE
+#else
+# define MAX_PAGES 2000
+#endif
+#ifdef SQLITE_DEFAULT_TEMP_CACHE_SIZE
+# define TEMP_PAGES SQLITE_DEFAULT_TEMP_CACHE_SIZE
+#else
+# define TEMP_PAGES 500
+#endif
+
+/*
+** OMIT_TEMPDB is set to 1 if SQLITE_OMIT_TEMPDB is defined, or 0
+** afterward. Having this macro allows us to cause the C compiler
+** to omit code used by TEMP tables without messy #ifndef statements.
+*/
+#ifdef SQLITE_OMIT_TEMPDB
+#define OMIT_TEMPDB 1
+#else
+#define OMIT_TEMPDB 0
+#endif
+
+/*
+** If the following macro is set to 1, then NULL values are considered
+** distinct for the SELECT DISTINCT statement and for UNION or EXCEPT
+** compound queries. No other SQL database engine (among those tested)
+** works this way except for OCELOT. But the SQL92 spec implies that
+** this is how things should work.
+**
+** If the following macro is set to 0, then NULLs are indistinct for
+** SELECT DISTINCT and for UNION.
+*/
+#define NULL_ALWAYS_DISTINCT 0
+
+/*
+** If the following macro is set to 1, then NULL values are considered
+** distinct when determining whether or not two entries are the same
+** in a UNIQUE index. This is the way PostgreSQL, Oracle, DB2, MySQL,
+** OCELOT, and Firebird all work. The SQL92 spec explicitly says this
+** is the way things are suppose to work.
+**
+** If the following macro is set to 0, the NULLs are indistinct for
+** a UNIQUE index. In this mode, you can only have a single NULL entry
+** for a column declared UNIQUE. This is the way Informix and SQL Server
+** work.
+*/
+#define NULL_DISTINCT_FOR_UNIQUE 1
+
+/*
+** The maximum number of attached databases. This must be at least 2
+** in order to support the main database file (0) and the file used to
+** hold temporary tables (1). And it must be less than 32 because
+** we use a bitmask of databases with a u32 in places (for example
+** the Parse.cookieMask field).
+*/
+#define MAX_ATTACHED 10
+
+/*
+** The maximum value of a ?nnn wildcard that the parser will accept.
+*/
+#define SQLITE_MAX_VARIABLE_NUMBER 999
+
+/*
+** When building SQLite for embedded systems where memory is scarce,
+** you can define one or more of the following macros to omit extra
+** features of the library and thus keep the size of the library to
+** a minimum.
+*/
+/* #define SQLITE_OMIT_AUTHORIZATION 1 */
+/* #define SQLITE_OMIT_MEMORYDB 1 */
+/* #define SQLITE_OMIT_VACUUM 1 */
+/* #define SQLITE_OMIT_DATETIME_FUNCS 1 */
+/* #define SQLITE_OMIT_PROGRESS_CALLBACK 1 */
+/* #define SQLITE_OMIT_AUTOVACUUM */
+/* #define SQLITE_OMIT_ALTERTABLE */
+
+/*
+** Provide a default value for TEMP_STORE in case it is not specified
+** on the command-line
+*/
+#ifndef TEMP_STORE
+# define TEMP_STORE 1
+#endif
+
+/*
+** GCC does not define the offsetof() macro so we'll have to do it
+** ourselves.
+*/
+#ifndef offsetof
+#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
+#endif
+
+/*
+** Integers of known sizes. These typedefs might change for architectures
+** where the sizes very. Preprocessor macros are available so that the
+** types can be conveniently redefined at compile-type. Like this:
+**
+** cc '-DUINTPTR_TYPE=long long int' ...
+*/
+#ifndef UINT64_TYPE
+# if defined(_MSC_VER) || defined(__BORLANDC__)
+# define UINT64_TYPE unsigned __int64
+# else
+# define UINT64_TYPE unsigned long long int
+# endif
+#endif
+#ifndef UINT32_TYPE
+# define UINT32_TYPE unsigned int
+#endif
+#ifndef UINT16_TYPE
+# define UINT16_TYPE unsigned short int
+#endif
+#ifndef INT16_TYPE
+# define INT16_TYPE short int
+#endif
+#ifndef UINT8_TYPE
+# define UINT8_TYPE unsigned char
+#endif
+#ifndef INT8_TYPE
+# define INT8_TYPE signed char
+#endif
+#ifndef LONGDOUBLE_TYPE
+# define LONGDOUBLE_TYPE long double
+#endif
+typedef sqlite_int64 i64; /* 8-byte signed integer */
+typedef UINT64_TYPE u64; /* 8-byte unsigned integer */
+typedef UINT32_TYPE u32; /* 4-byte unsigned integer */
+typedef UINT16_TYPE u16; /* 2-byte unsigned integer */
+typedef INT16_TYPE i16; /* 2-byte signed integer */
+typedef UINT8_TYPE u8; /* 1-byte unsigned integer */
+typedef UINT8_TYPE i8; /* 1-byte signed integer */
+
+/*
+** Macros to determine whether the machine is big or little endian,
+** evaluated at runtime.
+*/
+extern const int sqlite3one;
+#define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0)
+#define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
+
+/*
+** An instance of the following structure is used to store the busy-handler
+** callback for a given sqlite handle.
+**
+** The sqlite.busyHandler member of the sqlite struct contains the busy
+** callback for the database handle. Each pager opened via the sqlite
+** handle is passed a pointer to sqlite.busyHandler. The busy-handler
+** callback is currently invoked only from within pager.c.
+*/
+typedef struct BusyHandler BusyHandler;
+struct BusyHandler {
+ int (*xFunc)(void *,int); /* The busy callback */
+ void *pArg; /* First arg to busy callback */
+ int nBusy; /* Incremented with each busy call */
+};
+
+/*
+** Defer sourcing vdbe.h and btree.h until after the "u8" and
+** "BusyHandler typedefs.
+*/
+#include "vdbe.h"
+#include "btree.h"
+
+/*
+** This macro casts a pointer to an integer. Useful for doing
+** pointer arithmetic.
+*/
+#define Addr(X) ((uptr)X)
+
+/*
+** If memory allocation problems are found, recompile with
+**
+** -DSQLITE_DEBUG=1
+**
+** to enable some sanity checking on malloc() and free(). To
+** check for memory leaks, recompile with
+**
+** -DSQLITE_DEBUG=2
+**
+** and a line of text will be written to standard error for
+** each malloc() and free(). This output can be analyzed
+** by an AWK script to determine if there are any leaks.
+*/
+#ifdef SQLITE_MEMDEBUG
+# define sqliteMalloc(X) sqlite3Malloc_(X,1,__FILE__,__LINE__)
+# define sqliteMallocRaw(X) sqlite3Malloc_(X,0,__FILE__,__LINE__)
+# define sqliteFree(X) sqlite3Free_(X,__FILE__,__LINE__)
+# define sqliteRealloc(X,Y) sqlite3Realloc_(X,Y,__FILE__,__LINE__)
+# define sqliteStrDup(X) sqlite3StrDup_(X,__FILE__,__LINE__)
+# define sqliteStrNDup(X,Y) sqlite3StrNDup_(X,Y,__FILE__,__LINE__)
+#else
+# define sqliteFree sqlite3FreeX
+# define sqliteMalloc sqlite3Malloc
+# define sqliteMallocRaw sqlite3MallocRaw
+# define sqliteRealloc sqlite3Realloc
+# define sqliteStrDup sqlite3StrDup
+# define sqliteStrNDup sqlite3StrNDup
+#endif
+
+/*
+** This variable gets set if malloc() ever fails. After it gets set,
+** the SQLite library shuts down permanently.
+*/
+extern int sqlite3_malloc_failed;
+
+/*
+** The following global variables are used for testing and debugging
+** only. They only work if SQLITE_DEBUG is defined.
+*/
+#ifdef SQLITE_MEMDEBUG
+extern int sqlite3_nMalloc; /* Number of sqliteMalloc() calls */
+extern int sqlite3_nFree; /* Number of sqliteFree() calls */
+extern int sqlite3_iMallocFail; /* Fail sqliteMalloc() after this many calls */
+extern int sqlite3_iMallocReset; /* Set iMallocFail to this when it reaches 0 */
+#endif
+
+/*
+** Name of the master database table. The master database table
+** is a special table that holds the names and attributes of all
+** user tables and indices.
+*/
+#define MASTER_NAME "sqlite_master"
+#define TEMP_MASTER_NAME "sqlite_temp_master"
+
+/*
+** The root-page of the master database table.
+*/
+#define MASTER_ROOT 1
+
+/*
+** The name of the schema table.
+*/
+#define SCHEMA_TABLE(x) ((!OMIT_TEMPDB)&&(x==1)?TEMP_MASTER_NAME:MASTER_NAME)
+
+/*
+** A convenience macro that returns the number of elements in
+** an array.
+*/
+#define ArraySize(X) (sizeof(X)/sizeof(X[0]))
+
+/*
+** Forward references to structures
+*/
+typedef struct AggInfo AggInfo;
+typedef struct AuthContext AuthContext;
+typedef struct CollSeq CollSeq;
+typedef struct Column Column;
+typedef struct Db Db;
+typedef struct Expr Expr;
+typedef struct ExprList ExprList;
+typedef struct FKey FKey;
+typedef struct FuncDef FuncDef;
+typedef struct IdList IdList;
+typedef struct Index Index;
+typedef struct KeyClass KeyClass;
+typedef struct KeyInfo KeyInfo;
+typedef struct NameContext NameContext;
+typedef struct Parse Parse;
+typedef struct Select Select;
+typedef struct SrcList SrcList;
+typedef struct Table Table;
+typedef struct Token Token;
+typedef struct TriggerStack TriggerStack;
+typedef struct TriggerStep TriggerStep;
+typedef struct Trigger Trigger;
+typedef struct WhereInfo WhereInfo;
+typedef struct WhereLevel WhereLevel;
+
+/*
+** Each database file to be accessed by the system is an instance
+** of the following structure. There are normally two of these structures
+** in the sqlite.aDb[] array. aDb[0] is the main database file and
+** aDb[1] is the database file used to hold temporary tables. Additional
+** databases may be attached.
+*/
+struct Db {
+ char *zName; /* Name of this database */
+ Btree *pBt; /* The B*Tree structure for this database file */
+ int schema_cookie; /* Database schema version number for this file */
+ Hash tblHash; /* All tables indexed by name */
+ Hash idxHash; /* All (named) indices indexed by name */
+ Hash trigHash; /* All triggers indexed by name */
+ Hash aFKey; /* Foreign keys indexed by to-table */
+ u16 flags; /* Flags associated with this database */
+ u8 inTrans; /* 0: not writable. 1: Transaction. 2: Checkpoint */
+ u8 safety_level; /* How aggressive at synching data to disk */
+ int cache_size; /* Number of pages to use in the cache */
+ Table *pSeqTab; /* The sqlite_sequence table used by AUTOINCREMENT */
+ void *pAux; /* Auxiliary data. Usually NULL */
+ void (*xFreeAux)(void*); /* Routine to free pAux */
+};
+
+/*
+** These macros can be used to test, set, or clear bits in the
+** Db.flags field.
+*/
+#define DbHasProperty(D,I,P) (((D)->aDb[I].flags&(P))==(P))
+#define DbHasAnyProperty(D,I,P) (((D)->aDb[I].flags&(P))!=0)
+#define DbSetProperty(D,I,P) (D)->aDb[I].flags|=(P)
+#define DbClearProperty(D,I,P) (D)->aDb[I].flags&=~(P)
+
+/*
+** Allowed values for the DB.flags field.
+**
+** The DB_SchemaLoaded flag is set after the database schema has been
+** read into internal hash tables.
+**
+** DB_UnresetViews means that one or more views have column names that
+** have been filled out. If the schema changes, these column names might
+** changes and so the view will need to be reset.
+*/
+#define DB_SchemaLoaded 0x0001 /* The schema has been loaded */
+#define DB_UnresetViews 0x0002 /* Some views have defined column names */
+
+#define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)
+
+/*
+** Each database is an instance of the following structure.
+**
+** The sqlite.lastRowid records the last insert rowid generated by an
+** insert statement. Inserts on views do not affect its value. Each
+** trigger has its own context, so that lastRowid can be updated inside
+** triggers as usual. The previous value will be restored once the trigger
+** exits. Upon entering a before or instead of trigger, lastRowid is no
+** longer (since after version 2.8.12) reset to -1.
+**
+** The sqlite.nChange does not count changes within triggers and keeps no
+** context. It is reset at start of sqlite3_exec.
+** The sqlite.lsChange represents the number of changes made by the last
+** insert, update, or delete statement. It remains constant throughout the
+** length of a statement and is then updated by OP_SetCounts. It keeps a
+** context stack just like lastRowid so that the count of changes
+** within a trigger is not seen outside the trigger. Changes to views do not
+** affect the value of lsChange.
+** The sqlite.csChange keeps track of the number of current changes (since
+** the last statement) and is used to update sqlite_lsChange.
+**
+** The member variables sqlite.errCode, sqlite.zErrMsg and sqlite.zErrMsg16
+** store the most recent error code and, if applicable, string. The
+** internal function sqlite3Error() is used to set these variables
+** consistently.
+*/
+struct sqlite3 {
+ int nDb; /* Number of backends currently in use */
+ Db *aDb; /* All backends */
+ int flags; /* Miscellanous flags. See below */
+ int errCode; /* Most recent error code (SQLITE_*) */
+ u8 enc; /* Text encoding for this database. */
+ u8 autoCommit; /* The auto-commit flag. */
+ u8 file_format; /* What file format version is this database? */
+ u8 temp_store; /* 1: file 2: memory 0: default */
+ int nTable; /* Number of tables in the database */
+ CollSeq *pDfltColl; /* The default collating sequence (BINARY) */
+ i64 lastRowid; /* ROWID of most recent insert (see above) */
+ i64 priorNewRowid; /* Last randomly generated ROWID */
+ int magic; /* Magic number for detect library misuse */
+ int nChange; /* Value returned by sqlite3_changes() */
+ int nTotalChange; /* Value returned by sqlite3_total_changes() */
+ struct sqlite3InitInfo { /* Information used during initialization */
+ int iDb; /* When back is being initialized */
+ int newTnum; /* Rootpage of table being initialized */
+ u8 busy; /* TRUE if currently initializing */
+ } init;
+ struct Vdbe *pVdbe; /* List of active virtual machines */
+ int activeVdbeCnt; /* Number of vdbes currently executing */
+ void (*xTrace)(void*,const char*); /* Trace function */
+ void *pTraceArg; /* Argument to the trace function */
+ void (*xProfile)(void*,const char*,u64); /* Profiling function */
+ void *pProfileArg; /* Argument to profile function */
+ void *pCommitArg; /* Argument to xCommitCallback() */
+ int (*xCommitCallback)(void*);/* Invoked at every commit. */
+ void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*);
+ void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*);
+ void *pCollNeededArg;
+ sqlite3_value *pValue; /* Value used for transient conversions */
+ sqlite3_value *pErr; /* Most recent error message */
+ char *zErrMsg; /* Most recent error message (UTF-8 encoded) */
+ char *zErrMsg16; /* Most recent error message (UTF-16 encoded) */
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*);
+ /* Access authorization function */
+ void *pAuthArg; /* 1st argument to the access auth function */
+#endif
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
+ int (*xProgress)(void *); /* The progress callback */
+ void *pProgressArg; /* Argument to the progress callback */
+ int nProgressOps; /* Number of opcodes for progress callback */
+#endif
+#ifndef SQLITE_OMIT_GLOBALRECOVER
+ sqlite3 *pNext; /* Linked list of open db handles. */
+#endif
+ Hash aFunc; /* All functions that can be in SQL exprs */
+ Hash aCollSeq; /* All collating sequences */
+ BusyHandler busyHandler; /* Busy callback */
+ int busyTimeout; /* Busy handler timeout, in msec */
+ Db aDbStatic[2]; /* Static space for the 2 default backends */
+#ifdef SQLITE_SSE
+ sqlite3_stmt *pFetch; /* Used by SSE to fetch stored statements */
+#endif
+};
+
+/*
+** Possible values for the sqlite.flags and or Db.flags fields.
+**
+** On sqlite.flags, the SQLITE_InTrans value means that we have
+** executed a BEGIN. On Db.flags, SQLITE_InTrans means a statement
+** transaction is active on that particular database file.
+*/
+#define SQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */
+#define SQLITE_Initialized 0x00000002 /* True after initialization */
+#define SQLITE_Interrupt 0x00000004 /* Cancel current operation */
+#define SQLITE_InTrans 0x00000008 /* True if in a transaction */
+#define SQLITE_InternChanges 0x00000010 /* Uncommitted Hash table changes */
+#define SQLITE_FullColNames 0x00000020 /* Show full column names on SELECT */
+#define SQLITE_ShortColNames 0x00000040 /* Show short columns names */
+#define SQLITE_CountRows 0x00000080 /* Count rows changed by INSERT, */
+ /* DELETE, or UPDATE and return */
+ /* the count using a callback. */
+#define SQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */
+ /* result set is empty */
+#define SQLITE_SqlTrace 0x00000200 /* Debug print SQL as it executes */
+#define SQLITE_VdbeListing 0x00000400 /* Debug listings of VDBE programs */
+#define SQLITE_WriteSchema 0x00000800 /* OK to update SQLITE_MASTER */
+#define SQLITE_NoReadlock 0x00001000 /* Readlocks are omitted when
+ ** accessing read-only databases */
+
+/*
+** Possible values for the sqlite.magic field.
+** The numbers are obtained at random and have no special meaning, other
+** than being distinct from one another.
+*/
+#define SQLITE_MAGIC_OPEN 0xa029a697 /* Database is open */
+#define SQLITE_MAGIC_CLOSED 0x9f3c2d33 /* Database is closed */
+#define SQLITE_MAGIC_BUSY 0xf03b7906 /* Database currently in use */
+#define SQLITE_MAGIC_ERROR 0xb5357930 /* An SQLITE_MISUSE error occurred */
+
+/*
+** Each SQL function is defined by an instance of the following
+** structure. A pointer to this structure is stored in the sqlite.aFunc
+** hash table. When multiple functions have the same name, the hash table
+** points to a linked list of these structures.
+*/
+struct FuncDef {
+ i16 nArg; /* Number of arguments. -1 means unlimited */
+ u8 iPrefEnc; /* Preferred text encoding (SQLITE_UTF8, 16LE, 16BE) */
+ u8 needCollSeq; /* True if sqlite3GetFuncCollSeq() might be called */
+ u8 flags; /* Some combination of SQLITE_FUNC_* */
+ void *pUserData; /* User data parameter */
+ FuncDef *pNext; /* Next function with same name */
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**); /* Regular function */
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**); /* Aggregate step */
+ void (*xFinalize)(sqlite3_context*); /* Aggregate finializer */
+ char zName[1]; /* SQL name of the function. MUST BE LAST */
+};
+
+/*
+** Possible values for FuncDef.flags
+*/
+#define SQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */
+#define SQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */
+
+/*
+** information about each column of an SQL table is held in an instance
+** of this structure.
+*/
+struct Column {
+ char *zName; /* Name of this column */
+ Expr *pDflt; /* Default value of this column */
+ char *zType; /* Data type for this column */
+ CollSeq *pColl; /* Collating sequence. If NULL, use the default */
+ u8 notNull; /* True if there is a NOT NULL constraint */
+ u8 isPrimKey; /* True if this column is part of the PRIMARY KEY */
+ char affinity; /* One of the SQLITE_AFF_... values */
+};
+
+/*
+** A "Collating Sequence" is defined by an instance of the following
+** structure. Conceptually, a collating sequence consists of a name and
+** a comparison routine that defines the order of that sequence.
+**
+** There may two seperate implementations of the collation function, one
+** that processes text in UTF-8 encoding (CollSeq.xCmp) and another that
+** processes text encoded in UTF-16 (CollSeq.xCmp16), using the machine
+** native byte order. When a collation sequence is invoked, SQLite selects
+** the version that will require the least expensive encoding
+** transalations, if any.
+**
+** The CollSeq.pUser member variable is an extra parameter that passed in
+** as the first argument to the UTF-8 comparison function, xCmp.
+** CollSeq.pUser16 is the equivalent for the UTF-16 comparison function,
+** xCmp16.
+**
+** If both CollSeq.xCmp and CollSeq.xCmp16 are NULL, it means that the
+** collating sequence is undefined. Indices built on an undefined
+** collating sequence may not be read or written.
+*/
+struct CollSeq {
+ char *zName; /* Name of the collating sequence, UTF-8 encoded */
+ u8 enc; /* Text encoding handled by xCmp() */
+ u8 type; /* One of the SQLITE_COLL_... values below */
+ void *pUser; /* First argument to xCmp() */
+ int (*xCmp)(void*,int, const void*, int, const void*);
+};
+
+/*
+** Allowed values of CollSeq flags:
+*/
+#define SQLITE_COLL_BINARY 1 /* The default memcmp() collating sequence */
+#define SQLITE_COLL_NOCASE 2 /* The built-in NOCASE collating sequence */
+#define SQLITE_COLL_REVERSE 3 /* The built-in REVERSE collating sequence */
+#define SQLITE_COLL_USER 0 /* Any other user-defined collating sequence */
+
+/*
+** A sort order can be either ASC or DESC.
+*/
+#define SQLITE_SO_ASC 0 /* Sort in ascending order */
+#define SQLITE_SO_DESC 1 /* Sort in ascending order */
+
+/*
+** Column affinity types.
+*/
+#define SQLITE_AFF_INTEGER 'i'
+#define SQLITE_AFF_NUMERIC 'n'
+#define SQLITE_AFF_TEXT 't'
+#define SQLITE_AFF_NONE 'o'
+
+
+/*
+** Each SQL table is represented in memory by an instance of the
+** following structure.
+**
+** Table.zName is the name of the table. The case of the original
+** CREATE TABLE statement is stored, but case is not significant for
+** comparisons.
+**
+** Table.nCol is the number of columns in this table. Table.aCol is a
+** pointer to an array of Column structures, one for each column.
+**
+** If the table has an INTEGER PRIMARY KEY, then Table.iPKey is the index of
+** the column that is that key. Otherwise Table.iPKey is negative. Note
+** that the datatype of the PRIMARY KEY must be INTEGER for this field to
+** be set. An INTEGER PRIMARY KEY is used as the rowid for each row of
+** the table. If a table has no INTEGER PRIMARY KEY, then a random rowid
+** is generated for each row of the table. Table.hasPrimKey is true if
+** the table has any PRIMARY KEY, INTEGER or otherwise.
+**
+** Table.tnum is the page number for the root BTree page of the table in the
+** database file. If Table.iDb is the index of the database table backend
+** in sqlite.aDb[]. 0 is for the main database and 1 is for the file that
+** holds temporary tables and indices. If Table.isTransient
+** is true, then the table is stored in a file that is automatically deleted
+** when the VDBE cursor to the table is closed. In this case Table.tnum
+** refers VDBE cursor number that holds the table open, not to the root
+** page number. Transient tables are used to hold the results of a
+** sub-query that appears instead of a real table name in the FROM clause
+** of a SELECT statement.
+*/
+struct Table {
+ char *zName; /* Name of the table */
+ int nCol; /* Number of columns in this table */
+ Column *aCol; /* Information about each column */
+ int iPKey; /* If not less then 0, use aCol[iPKey] as the primary key */
+ Index *pIndex; /* List of SQL indexes on this table. */
+ int tnum; /* Root BTree node for this table (see note above) */
+ Select *pSelect; /* NULL for tables. Points to definition if a view. */
+ u8 readOnly; /* True if this table should not be written by the user */
+ u8 iDb; /* Index into sqlite.aDb[] of the backend for this table */
+ u8 isTransient; /* True if automatically deleted when VDBE finishes */
+ u8 hasPrimKey; /* True if there exists a primary key */
+ u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */
+ u8 autoInc; /* True if the integer primary key is autoincrement */
+ int nRef; /* Number of pointers to this Table */
+ Trigger *pTrigger; /* List of SQL triggers on this table */
+ FKey *pFKey; /* Linked list of all foreign keys in this table */
+ char *zColAff; /* String defining the affinity of each column */
+#ifndef SQLITE_OMIT_ALTERTABLE
+ int addColOffset; /* Offset in CREATE TABLE statement to add a new column */
+#endif
+};
+
+/*
+** Each foreign key constraint is an instance of the following structure.
+**
+** A foreign key is associated with two tables. The "from" table is
+** the table that contains the REFERENCES clause that creates the foreign
+** key. The "to" table is the table that is named in the REFERENCES clause.
+** Consider this example:
+**
+** CREATE TABLE ex1(
+** a INTEGER PRIMARY KEY,
+** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x)
+** );
+**
+** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2".
+**
+** Each REFERENCES clause generates an instance of the following structure
+** which is attached to the from-table. The to-table need not exist when
+** the from-table is created. The existance of the to-table is not checked
+** until an attempt is made to insert data into the from-table.
+**
+** The sqlite.aFKey hash table stores pointers to this structure
+** given the name of a to-table. For each to-table, all foreign keys
+** associated with that table are on a linked list using the FKey.pNextTo
+** field.
+*/
+struct FKey {
+ Table *pFrom; /* The table that constains the REFERENCES clause */
+ FKey *pNextFrom; /* Next foreign key in pFrom */
+ char *zTo; /* Name of table that the key points to */
+ FKey *pNextTo; /* Next foreign key that points to zTo */
+ int nCol; /* Number of columns in this key */
+ struct sColMap { /* Mapping of columns in pFrom to columns in zTo */
+ int iFrom; /* Index of column in pFrom */
+ char *zCol; /* Name of column in zTo. If 0 use PRIMARY KEY */
+ } *aCol; /* One entry for each of nCol column s */
+ u8 isDeferred; /* True if constraint checking is deferred till COMMIT */
+ u8 updateConf; /* How to resolve conflicts that occur on UPDATE */
+ u8 deleteConf; /* How to resolve conflicts that occur on DELETE */
+ u8 insertConf; /* How to resolve conflicts that occur on INSERT */
+};
+
+/*
+** SQLite supports many different ways to resolve a contraint
+** error. ROLLBACK processing means that a constraint violation
+** causes the operation in process to fail and for the current transaction
+** to be rolled back. ABORT processing means the operation in process
+** fails and any prior changes from that one operation are backed out,
+** but the transaction is not rolled back. FAIL processing means that
+** the operation in progress stops and returns an error code. But prior
+** changes due to the same operation are not backed out and no rollback
+** occurs. IGNORE means that the particular row that caused the constraint
+** error is not inserted or updated. Processing continues and no error
+** is returned. REPLACE means that preexisting database rows that caused
+** a UNIQUE constraint violation are removed so that the new insert or
+** update can proceed. Processing continues and no error is reported.
+**
+** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
+** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the
+** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign
+** key is set to NULL. CASCADE means that a DELETE or UPDATE of the
+** referenced table row is propagated into the row that holds the
+** foreign key.
+**
+** The following symbolic values are used to record which type
+** of action to take.
+*/
+#define OE_None 0 /* There is no constraint to check */
+#define OE_Rollback 1 /* Fail the operation and rollback the transaction */
+#define OE_Abort 2 /* Back out changes but do no rollback transaction */
+#define OE_Fail 3 /* Stop the operation but leave all prior changes */
+#define OE_Ignore 4 /* Ignore the error. Do not do the INSERT or UPDATE */
+#define OE_Replace 5 /* Delete existing record, then do INSERT or UPDATE */
+
+#define OE_Restrict 6 /* OE_Abort for IMMEDIATE, OE_Rollback for DEFERRED */
+#define OE_SetNull 7 /* Set the foreign key value to NULL */
+#define OE_SetDflt 8 /* Set the foreign key value to its default */
+#define OE_Cascade 9 /* Cascade the changes */
+
+#define OE_Default 99 /* Do whatever the default action is */
+
+
+/*
+** An instance of the following structure is passed as the first
+** argument to sqlite3VdbeKeyCompare and is used to control the
+** comparison of the two index keys.
+**
+** If the KeyInfo.incrKey value is true and the comparison would
+** otherwise be equal, then return a result as if the second key
+** were larger.
+*/
+struct KeyInfo {
+ u8 enc; /* Text encoding - one of the TEXT_Utf* values */
+ u8 incrKey; /* Increase 2nd key by epsilon before comparison */
+ int nField; /* Number of entries in aColl[] */
+ u8 *aSortOrder; /* If defined an aSortOrder[i] is true, sort DESC */
+ CollSeq *aColl[1]; /* Collating sequence for each term of the key */
+};
+
+/*
+** Each SQL index is represented in memory by an
+** instance of the following structure.
+**
+** The columns of the table that are to be indexed are described
+** by the aiColumn[] field of this structure. For example, suppose
+** we have the following table and index:
+**
+** CREATE TABLE Ex1(c1 int, c2 int, c3 text);
+** CREATE INDEX Ex2 ON Ex1(c3,c1);
+**
+** In the Table structure describing Ex1, nCol==3 because there are
+** three columns in the table. In the Index structure describing
+** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed.
+** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the
+** first column to be indexed (c3) has an index of 2 in Ex1.aCol[].
+** The second column to be indexed (c1) has an index of 0 in
+** Ex1.aCol[], hence Ex2.aiColumn[1]==0.
+**
+** The Index.onError field determines whether or not the indexed columns
+** must be unique and what to do if they are not. When Index.onError=OE_None,
+** it means this is not a unique index. Otherwise it is a unique index
+** and the value of Index.onError indicate the which conflict resolution
+** algorithm to employ whenever an attempt is made to insert a non-unique
+** element.
+*/
+struct Index {
+ char *zName; /* Name of this index */
+ int nColumn; /* Number of columns in the table used by this index */
+ int *aiColumn; /* Which columns are used by this index. 1st is 0 */
+ unsigned *aiRowEst; /* Result of ANALYZE: Est. rows selected by each column */
+ Table *pTable; /* The SQL table being indexed */
+ int tnum; /* Page containing root of this index in database file */
+ u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
+ u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */
+ u8 iDb; /* Index in sqlite.aDb[] of where this index is stored */
+ char *zColAff; /* String defining the affinity of each column */
+ Index *pNext; /* The next index associated with the same table */
+ KeyInfo keyInfo; /* Info on how to order keys. MUST BE LAST */
+};
+
+/*
+** Each token coming out of the lexer is an instance of
+** this structure. Tokens are also used as part of an expression.
+**
+** Note if Token.z==0 then Token.dyn and Token.n are undefined and
+** may contain random values. Do not make any assuptions about Token.dyn
+** and Token.n when Token.z==0.
+*/
+struct Token {
+ const unsigned char *z; /* Text of the token. Not NULL-terminated! */
+ unsigned dyn : 1; /* True for malloced memory, false for static */
+ unsigned n : 31; /* Number of characters in this token */
+};
+
+/*
+** An instance of this structure contains information needed to generate
+** code for a SELECT that contains aggregate functions.
+**
+** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a
+** pointer to this structure. The Expr.iColumn field is the index in
+** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate
+** code for that node.
+**
+** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the
+** original Select structure that describes the SELECT statement. These
+** fields do not need to be freed when deallocating the AggInfo structure.
+*/
+struct AggInfo {
+ u8 directMode; /* Direct rendering mode means take data directly
+ ** from source tables rather than from accumulators */
+ u8 useSortingIdx; /* In direct mode, reference the sorting index rather
+ ** than the source table */
+ int sortingIdx; /* Cursor number of the sorting index */
+ ExprList *pGroupBy; /* The group by clause */
+ int nSortingColumn; /* Number of columns in the sorting index */
+ struct AggInfo_col { /* For each column used in source tables */
+ int iTable; /* Cursor number of the source table */
+ int iColumn; /* Column number within the source table */
+ int iSorterColumn; /* Column number in the sorting index */
+ int iMem; /* Memory location that acts as accumulator */
+ Expr *pExpr; /* The original expression */
+ } *aCol;
+ int nColumn; /* Number of used entries in aCol[] */
+ int nColumnAlloc; /* Number of slots allocated for aCol[] */
+ int nAccumulator; /* Number of columns that show through to the output.
+ ** Additional columns are used only as parameters to
+ ** aggregate functions */
+ struct AggInfo_func { /* For each aggregate function */
+ Expr *pExpr; /* Expression encoding the function */
+ FuncDef *pFunc; /* The aggregate function implementation */
+ int iMem; /* Memory location that acts as accumulator */
+ int iDistinct; /* Virtual table used to enforce DISTINCT */
+ } *aFunc;
+ int nFunc; /* Number of entries in aFunc[] */
+ int nFuncAlloc; /* Number of slots allocated for aFunc[] */
+};
+
+/*
+** Each node of an expression in the parse tree is an instance
+** of this structure.
+**
+** Expr.op is the opcode. The integer parser token codes are reused
+** as opcodes here. For example, the parser defines TK_GE to be an integer
+** code representing the ">=" operator. This same integer code is reused
+** to represent the greater-than-or-equal-to operator in the expression
+** tree.
+**
+** Expr.pRight and Expr.pLeft are subexpressions. Expr.pList is a list
+** of argument if the expression is a function.
+**
+** Expr.token is the operator token for this node. For some expressions
+** that have subexpressions, Expr.token can be the complete text that gave
+** rise to the Expr. In the latter case, the token is marked as being
+** a compound token.
+**
+** An expression of the form ID or ID.ID refers to a column in a table.
+** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is
+** the integer cursor number of a VDBE cursor pointing to that table and
+** Expr.iColumn is the column number for the specific column. If the
+** expression is used as a result in an aggregate SELECT, then the
+** value is also stored in the Expr.iAgg column in the aggregate so that
+** it can be accessed after all aggregates are computed.
+**
+** If the expression is a function, the Expr.iTable is an integer code
+** representing which function. If the expression is an unbound variable
+** marker (a question mark character '?' in the original SQL) then the
+** Expr.iTable holds the index number for that variable.
+**
+** If the expression is a subquery then Expr.iColumn holds an integer
+** register number containing the result of the subquery. If the
+** subquery gives a constant result, then iTable is -1. If the subquery
+** gives a different answer at different times during statement processing
+** then iTable is the address of a subroutine that computes the subquery.
+**
+** The Expr.pSelect field points to a SELECT statement. The SELECT might
+** be the right operand of an IN operator. Or, if a scalar SELECT appears
+** in an expression the opcode is TK_SELECT and Expr.pSelect is the only
+** operand.
+**
+** If the Expr is of type OP_Column, and the table it is selecting from
+** is a disk table or the "old.*" pseudo-table, then pTab points to the
+** corresponding table definition.
+*/
+struct Expr {
+ u8 op; /* Operation performed by this node */
+ char affinity; /* The affinity of the column or 0 if not a column */
+ u8 iDb; /* Database referenced by this expression */
+ u8 flags; /* Various flags. See below */
+ CollSeq *pColl; /* The collation type of the column or 0 */
+ Expr *pLeft, *pRight; /* Left and right subnodes */
+ ExprList *pList; /* A list of expressions used as function arguments
+ ** or in "<expr> IN (<expr-list)" */
+ Token token; /* An operand token */
+ Token span; /* Complete text of the expression */
+ int iTable, iColumn; /* When op==TK_COLUMN, then this expr node means the
+ ** iColumn-th field of the iTable-th table. */
+ AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */
+ int iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */
+ int iRightJoinTable; /* If EP_FromJoin, the right table of the join */
+ Select *pSelect; /* When the expression is a sub-select. Also the
+ ** right side of "<expr> IN (<select>)" */
+ Table *pTab; /* Table for OP_Column expressions. */
+};
+
+/*
+** The following are the meanings of bits in the Expr.flags field.
+*/
+#define EP_FromJoin 0x01 /* Originated in ON or USING clause of a join */
+#define EP_Agg 0x02 /* Contains one or more aggregate functions */
+#define EP_Resolved 0x04 /* IDs have been resolved to COLUMNs */
+#define EP_Error 0x08 /* Expression contains one or more errors */
+#define EP_Distinct 0x10 /* Aggregate function with DISTINCT keyword */
+#define EP_VarSelect 0x20 /* pSelect is correlated, not constant */
+#define EP_Dequoted 0x40 /* True if the string has been dequoted */
+
+/*
+** These macros can be used to test, set, or clear bits in the
+** Expr.flags field.
+*/
+#define ExprHasProperty(E,P) (((E)->flags&(P))==(P))
+#define ExprHasAnyProperty(E,P) (((E)->flags&(P))!=0)
+#define ExprSetProperty(E,P) (E)->flags|=(P)
+#define ExprClearProperty(E,P) (E)->flags&=~(P)
+
+/*
+** A list of expressions. Each expression may optionally have a
+** name. An expr/name combination can be used in several ways, such
+** as the list of "expr AS ID" fields following a "SELECT" or in the
+** list of "ID = expr" items in an UPDATE. A list of expressions can
+** also be used as the argument to a function, in which case the a.zName
+** field is not used.
+*/
+struct ExprList {
+ int nExpr; /* Number of expressions on the list */
+ int nAlloc; /* Number of entries allocated below */
+ int iECursor; /* VDBE Cursor associated with this ExprList */
+ struct ExprList_item {
+ Expr *pExpr; /* The list of expressions */
+ char *zName; /* Token associated with this expression */
+ u8 sortOrder; /* 1 for DESC or 0 for ASC */
+ u8 isAgg; /* True if this is an aggregate like count(*) */
+ u8 done; /* A flag to indicate when processing is finished */
+ } *a; /* One entry for each expression */
+};
+
+/*
+** An instance of this structure can hold a simple list of identifiers,
+** such as the list "a,b,c" in the following statements:
+**
+** INSERT INTO t(a,b,c) VALUES ...;
+** CREATE INDEX idx ON t(a,b,c);
+** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...;
+**
+** The IdList.a.idx field is used when the IdList represents the list of
+** column names after a table name in an INSERT statement. In the statement
+**
+** INSERT INTO t(a,b,c) ...
+**
+** If "a" is the k-th column of table "t", then IdList.a[0].idx==k.
+*/
+struct IdList {
+ struct IdList_item {
+ char *zName; /* Name of the identifier */
+ int idx; /* Index in some Table.aCol[] of a column named zName */
+ } *a;
+ int nId; /* Number of identifiers on the list */
+ int nAlloc; /* Number of entries allocated for a[] below */
+};
+
+/*
+** The bitmask datatype defined below is used for various optimizations.
+*/
+typedef unsigned int Bitmask;
+
+/*
+** The following structure describes the FROM clause of a SELECT statement.
+** Each table or subquery in the FROM clause is a separate element of
+** the SrcList.a[] array.
+**
+** With the addition of multiple database support, the following structure
+** can also be used to describe a particular table such as the table that
+** is modified by an INSERT, DELETE, or UPDATE statement. In standard SQL,
+** such a table must be a simple name: ID. But in SQLite, the table can
+** now be identified by a database name, a dot, then the table name: ID.ID.
+*/
+struct SrcList {
+ i16 nSrc; /* Number of tables or subqueries in the FROM clause */
+ i16 nAlloc; /* Number of entries allocated in a[] below */
+ struct SrcList_item {
+ char *zDatabase; /* Name of database holding this table */
+ char *zName; /* Name of the table */
+ char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
+ Table *pTab; /* An SQL table corresponding to zName */
+ Select *pSelect; /* A SELECT statement used in place of a table name */
+ u8 jointype; /* Type of join between this table and the next */
+ i16 iCursor; /* The VDBE cursor number used to access this table */
+ Expr *pOn; /* The ON clause of a join */
+ IdList *pUsing; /* The USING clause of a join */
+ Bitmask colUsed; /* Bit N (1<<N) set if column N or pTab is used */
+ } a[1]; /* One entry for each identifier on the list */
+};
+
+/*
+** Permitted values of the SrcList.a.jointype field
+*/
+#define JT_INNER 0x0001 /* Any kind of inner or cross join */
+#define JT_CROSS 0x0002 /* Explicit use of the CROSS keyword */
+#define JT_NATURAL 0x0004 /* True for a "natural" join */
+#define JT_LEFT 0x0008 /* Left outer join */
+#define JT_RIGHT 0x0010 /* Right outer join */
+#define JT_OUTER 0x0020 /* The "OUTER" keyword is present */
+#define JT_ERROR 0x0040 /* unknown or unsupported join type */
+
+/*
+** For each nested loop in a WHERE clause implementation, the WhereInfo
+** structure contains a single instance of this structure. This structure
+** is intended to be private the the where.c module and should not be
+** access or modified by other modules.
+*/
+struct WhereLevel {
+ int iFrom; /* Which entry in the FROM clause */
+ int flags; /* Flags associated with this level */
+ int iMem; /* First memory cell used by this level */
+ int iLeftJoin; /* Memory cell used to implement LEFT OUTER JOIN */
+ Index *pIdx; /* Index used. NULL if no index */
+ int iTabCur; /* The VDBE cursor used to access the table */
+ int iIdxCur; /* The VDBE cursor used to acesss pIdx */
+ int brk; /* Jump here to break out of the loop */
+ int cont; /* Jump here to continue with the next loop cycle */
+ int top; /* First instruction of interior of the loop */
+ int op, p1, p2; /* Opcode used to terminate the loop */
+ int nEq; /* Number of == or IN constraints on this loop */
+ int nIn; /* Number of IN operators constraining this loop */
+ int *aInLoop; /* Loop terminators for IN operators */
+};
+
+/*
+** The WHERE clause processing routine has two halves. The
+** first part does the start of the WHERE loop and the second
+** half does the tail of the WHERE loop. An instance of
+** this structure is returned by the first half and passed
+** into the second half to give some continuity.
+*/
+struct WhereInfo {
+ Parse *pParse;
+ SrcList *pTabList; /* List of tables in the join */
+ int iTop; /* The very beginning of the WHERE loop */
+ int iContinue; /* Jump here to continue with next record */
+ int iBreak; /* Jump here to break out of the loop */
+ int nLevel; /* Number of nested loop */
+ WhereLevel a[1]; /* Information about each nest loop in the WHERE */
+};
+
+/*
+** A NameContext defines a context in which to resolve table and column
+** names. The context consists of a list of tables (the pSrcList) field and
+** a list of named expression (pEList). The named expression list may
+** be NULL. The pSrc corresponds to the FROM clause of a SELECT or
+** to the table being operated on by INSERT, UPDATE, or DELETE. The
+** pEList corresponds to the result set of a SELECT and is NULL for
+** other statements.
+**
+** NameContexts can be nested. When resolving names, the inner-most
+** context is searched first. If no match is found, the next outer
+** context is checked. If there is still no match, the next context
+** is checked. This process continues until either a match is found
+** or all contexts are check. When a match is found, the nRef member of
+** the context containing the match is incremented.
+**
+** Each subquery gets a new NameContext. The pNext field points to the
+** NameContext in the parent query. Thus the process of scanning the
+** NameContext list corresponds to searching through successively outer
+** subqueries looking for a match.
+*/
+struct NameContext {
+ Parse *pParse; /* The parser */
+ SrcList *pSrcList; /* One or more tables used to resolve names */
+ ExprList *pEList; /* Optional list of named expressions */
+ int nRef; /* Number of names resolved by this context */
+ int nErr; /* Number of errors encountered while resolving names */
+ u8 allowAgg; /* Aggregate functions allowed here */
+ u8 hasAgg; /* True if aggregates are seen */
+ int nDepth; /* Depth of subquery recursion. 1 for no recursion */
+ AggInfo *pAggInfo; /* Information about aggregates at this level */
+ NameContext *pNext; /* Next outer name context. NULL for outermost */
+};
+
+/*
+** An instance of the following structure contains all information
+** needed to generate code for a single SELECT statement.
+**
+** nLimit is set to -1 if there is no LIMIT clause. nOffset is set to 0.
+** If there is a LIMIT clause, the parser sets nLimit to the value of the
+** limit and nOffset to the value of the offset (or 0 if there is not
+** offset). But later on, nLimit and nOffset become the memory locations
+** in the VDBE that record the limit and offset counters.
+**
+** addrOpenVirt[] entries contain the address of OP_OpenVirtual opcodes.
+** These addresses must be stored so that we can go back and fill in
+** the P3_KEYINFO and P2 parameters later. Neither the KeyInfo nor
+** the number of columns in P2 can be computed at the same time
+** as the OP_OpenVirtual instruction is coded because not
+** enough information about the compound query is known at that point.
+** The KeyInfo for addrOpenVirt[0] and [1] contains collating sequences
+** for the result set. The KeyInfo for addrOpenVirt[2] contains collating
+** sequences for the ORDER BY clause.
+*/
+struct Select {
+ ExprList *pEList; /* The fields of the result */
+ u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */
+ u8 isDistinct; /* True if the DISTINCT keyword is present */
+ u8 isResolved; /* True once sqlite3SelectResolve() has run. */
+ u8 isAgg; /* True if this is an aggregate query */
+ u8 usesVirt; /* True if uses an OpenVirtual opcode */
+ u8 disallowOrderBy; /* Do not allow an ORDER BY to be attached if TRUE */
+ SrcList *pSrc; /* The FROM clause */
+ Expr *pWhere; /* The WHERE clause */
+ ExprList *pGroupBy; /* The GROUP BY clause */
+ Expr *pHaving; /* The HAVING clause */
+ ExprList *pOrderBy; /* The ORDER BY clause */
+ Select *pPrior; /* Prior select in a compound select statement */
+ Select *pRightmost; /* Right-most select in a compound select statement */
+ Expr *pLimit; /* LIMIT expression. NULL means not used. */
+ Expr *pOffset; /* OFFSET expression. NULL means not used. */
+ int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */
+ int addrOpenVirt[3]; /* OP_OpenVirtual opcodes related to this select */
+};
+
+/*
+** The results of a select can be distributed in several ways.
+*/
+#define SRT_Union 1 /* Store result as keys in an index */
+#define SRT_Except 2 /* Remove result from a UNION index */
+#define SRT_Discard 3 /* Do not save the results anywhere */
+
+/* The ORDER BY clause is ignored for all of the above */
+#define IgnorableOrderby(X) (X<=SRT_Discard)
+
+#define SRT_Callback 4 /* Invoke a callback with each row of result */
+#define SRT_Mem 5 /* Store result in a memory cell */
+#define SRT_Set 6 /* Store non-null results as keys in an index */
+#define SRT_Table 7 /* Store result as data with an automatic rowid */
+#define SRT_VirtualTab 8 /* Create virtual table and store like SRT_Table */
+#define SRT_Subroutine 9 /* Call a subroutine to handle results */
+#define SRT_Exists 10 /* Put 0 or 1 in a memory cell */
+
+/*
+** An SQL parser context. A copy of this structure is passed through
+** the parser and down into all the parser action routine in order to
+** carry around information that is global to the entire parse.
+**
+** The structure is divided into two parts. When the parser and code
+** generate call themselves recursively, the first part of the structure
+** is constant but the second part is reset at the beginning and end of
+** each recursion.
+*/
+struct Parse {
+ sqlite3 *db; /* The main database structure */
+ int rc; /* Return code from execution */
+ char *zErrMsg; /* An error message */
+ Vdbe *pVdbe; /* An engine for executing database bytecode */
+ u8 colNamesSet; /* TRUE after OP_ColumnName has been issued to pVdbe */
+ u8 nameClash; /* A permanent table name clashes with temp table name */
+ u8 checkSchema; /* Causes schema cookie check after an error */
+ u8 nested; /* Number of nested calls to the parser/code generator */
+ int nErr; /* Number of errors seen */
+ int nTab; /* Number of previously allocated VDBE cursors */
+ int nMem; /* Number of memory cells used so far */
+ int nSet; /* Number of sets used so far */
+ u32 writeMask; /* Start a write transaction on these databases */
+ u32 cookieMask; /* Bitmask of schema verified databases */
+ int cookieGoto; /* Address of OP_Goto to cookie verifier subroutine */
+ int cookieValue[MAX_ATTACHED+2]; /* Values of cookies to verify */
+
+ /* Above is constant between recursions. Below is reset before and after
+ ** each recursion */
+
+ int nVar; /* Number of '?' variables seen in the SQL so far */
+ int nVarExpr; /* Number of used slots in apVarExpr[] */
+ int nVarExprAlloc; /* Number of allocated slots in apVarExpr[] */
+ Expr **apVarExpr; /* Pointers to :aaa and $aaaa wildcard expressions */
+ u8 explain; /* True if the EXPLAIN flag is found on the query */
+ Token sErrToken; /* The token at which the error occurred */
+ Token sNameToken; /* Token with unqualified schema object name */
+ Token sLastToken; /* The last token parsed */
+ const char *zSql; /* All SQL text */
+ const char *zTail; /* All SQL text past the last semicolon parsed */
+ Table *pNewTable; /* A table being constructed by CREATE TABLE */
+ Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */
+ TriggerStack *trigStack; /* Trigger actions being coded */
+ const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
+};
+
+/*
+** An instance of the following structure can be declared on a stack and used
+** to save the Parse.zAuthContext value so that it can be restored later.
+*/
+struct AuthContext {
+ const char *zAuthContext; /* Put saved Parse.zAuthContext here */
+ Parse *pParse; /* The Parse structure */
+};
+
+/*
+** Bitfield flags for P2 value in OP_Insert and OP_Delete
+*/
+#define OPFLAG_NCHANGE 1 /* Set to update db->nChange */
+#define OPFLAG_LASTROWID 2 /* Set to update db->lastRowid */
+
+/*
+ * Each trigger present in the database schema is stored as an instance of
+ * struct Trigger.
+ *
+ * Pointers to instances of struct Trigger are stored in two ways.
+ * 1. In the "trigHash" hash table (part of the sqlite3* that represents the
+ * database). This allows Trigger structures to be retrieved by name.
+ * 2. All triggers associated with a single table form a linked list, using the
+ * pNext member of struct Trigger. A pointer to the first element of the
+ * linked list is stored as the "pTrigger" member of the associated
+ * struct Table.
+ *
+ * The "step_list" member points to the first element of a linked list
+ * containing the SQL statements specified as the trigger program.
+ */
+struct Trigger {
+ char *name; /* The name of the trigger */
+ char *table; /* The table or view to which the trigger applies */
+ u8 iDb; /* Database containing this trigger */
+ u8 iTabDb; /* Database containing Trigger.table */
+ u8 op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT */
+ u8 tr_tm; /* One of TRIGGER_BEFORE, TRIGGER_AFTER */
+ Expr *pWhen; /* The WHEN clause of the expresion (may be NULL) */
+ IdList *pColumns; /* If this is an UPDATE OF <column-list> trigger,
+ the <column-list> is stored here */
+ int foreach; /* One of TK_ROW or TK_STATEMENT */
+ Token nameToken; /* Token containing zName. Use during parsing only */
+
+ TriggerStep *step_list; /* Link list of trigger program steps */
+ Trigger *pNext; /* Next trigger associated with the table */
+};
+
+/*
+** A trigger is either a BEFORE or an AFTER trigger. The following constants
+** determine which.
+**
+** If there are multiple triggers, you might of some BEFORE and some AFTER.
+** In that cases, the constants below can be ORed together.
+*/
+#define TRIGGER_BEFORE 1
+#define TRIGGER_AFTER 2
+
+/*
+ * An instance of struct TriggerStep is used to store a single SQL statement
+ * that is a part of a trigger-program.
+ *
+ * Instances of struct TriggerStep are stored in a singly linked list (linked
+ * using the "pNext" member) referenced by the "step_list" member of the
+ * associated struct Trigger instance. The first element of the linked list is
+ * the first step of the trigger-program.
+ *
+ * The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or
+ * "SELECT" statement. The meanings of the other members is determined by the
+ * value of "op" as follows:
+ *
+ * (op == TK_INSERT)
+ * orconf -> stores the ON CONFLICT algorithm
+ * pSelect -> If this is an INSERT INTO ... SELECT ... statement, then
+ * this stores a pointer to the SELECT statement. Otherwise NULL.
+ * target -> A token holding the name of the table to insert into.
+ * pExprList -> If this is an INSERT INTO ... VALUES ... statement, then
+ * this stores values to be inserted. Otherwise NULL.
+ * pIdList -> If this is an INSERT INTO ... (<column-names>) VALUES ...
+ * statement, then this stores the column-names to be
+ * inserted into.
+ *
+ * (op == TK_DELETE)
+ * target -> A token holding the name of the table to delete from.
+ * pWhere -> The WHERE clause of the DELETE statement if one is specified.
+ * Otherwise NULL.
+ *
+ * (op == TK_UPDATE)
+ * target -> A token holding the name of the table to update rows of.
+ * pWhere -> The WHERE clause of the UPDATE statement if one is specified.
+ * Otherwise NULL.
+ * pExprList -> A list of the columns to update and the expressions to update
+ * them to. See sqlite3Update() documentation of "pChanges"
+ * argument.
+ *
+ */
+struct TriggerStep {
+ int op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT, TK_SELECT */
+ int orconf; /* OE_Rollback etc. */
+ Trigger *pTrig; /* The trigger that this step is a part of */
+
+ Select *pSelect; /* Valid for SELECT and sometimes
+ INSERT steps (when pExprList == 0) */
+ Token target; /* Valid for DELETE, UPDATE, INSERT steps */
+ Expr *pWhere; /* Valid for DELETE, UPDATE steps */
+ ExprList *pExprList; /* Valid for UPDATE statements and sometimes
+ INSERT steps (when pSelect == 0) */
+ IdList *pIdList; /* Valid for INSERT statements only */
+
+ TriggerStep * pNext; /* Next in the link-list */
+};
+
+/*
+ * An instance of struct TriggerStack stores information required during code
+ * generation of a single trigger program. While the trigger program is being
+ * coded, its associated TriggerStack instance is pointed to by the
+ * "pTriggerStack" member of the Parse structure.
+ *
+ * The pTab member points to the table that triggers are being coded on. The
+ * newIdx member contains the index of the vdbe cursor that points at the temp
+ * table that stores the new.* references. If new.* references are not valid
+ * for the trigger being coded (for example an ON DELETE trigger), then newIdx
+ * is set to -1. The oldIdx member is analogous to newIdx, for old.* references.
+ *
+ * The ON CONFLICT policy to be used for the trigger program steps is stored
+ * as the orconf member. If this is OE_Default, then the ON CONFLICT clause
+ * specified for individual triggers steps is used.
+ *
+ * struct TriggerStack has a "pNext" member, to allow linked lists to be
+ * constructed. When coding nested triggers (triggers fired by other triggers)
+ * each nested trigger stores its parent trigger's TriggerStack as the "pNext"
+ * pointer. Once the nested trigger has been coded, the pNext value is restored
+ * to the pTriggerStack member of the Parse stucture and coding of the parent
+ * trigger continues.
+ *
+ * Before a nested trigger is coded, the linked list pointed to by the
+ * pTriggerStack is scanned to ensure that the trigger is not about to be coded
+ * recursively. If this condition is detected, the nested trigger is not coded.
+ */
+struct TriggerStack {
+ Table *pTab; /* Table that triggers are currently being coded on */
+ int newIdx; /* Index of vdbe cursor to "new" temp table */
+ int oldIdx; /* Index of vdbe cursor to "old" temp table */
+ int orconf; /* Current orconf policy */
+ int ignoreJump; /* where to jump to for a RAISE(IGNORE) */
+ Trigger *pTrigger; /* The trigger currently being coded */
+ TriggerStack *pNext; /* Next trigger down on the trigger stack */
+};
+
+/*
+** The following structure contains information used by the sqliteFix...
+** routines as they walk the parse tree to make database references
+** explicit.
+*/
+typedef struct DbFixer DbFixer;
+struct DbFixer {
+ Parse *pParse; /* The parsing context. Error messages written here */
+ const char *zDb; /* Make sure all objects are contained in this database */
+ const char *zType; /* Type of the container - used for error messages */
+ const Token *pName; /* Name of the container - used for error messages */
+};
+
+/*
+** A pointer to this structure is used to communicate information
+** from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback.
+*/
+typedef struct {
+ sqlite3 *db; /* The database being initialized */
+ char **pzErrMsg; /* Error message stored here */
+} InitData;
+
+/*
+ * This global flag is set for performance testing of triggers. When it is set
+ * SQLite will perform the overhead of building new and old trigger references
+ * even when no triggers exist
+ */
+extern int sqlite3_always_code_trigger_setup;
+
+/*
+** The SQLITE_CORRUPT_BKPT macro can be either a constant (for production
+** builds) or a function call (for debugging). If it is a function call,
+** it allows the operator to set a breakpoint at the spot where database
+** corruption is first detected.
+*/
+#ifdef SQLITE_DEBUG
+ extern int sqlite3Corrupt(void);
+# define SQLITE_CORRUPT_BKPT sqlite3Corrupt()
+#else
+# define SQLITE_CORRUPT_BKPT SQLITE_CORRUPT
+#endif
+
+/*
+** Internal function prototypes
+*/
+int sqlite3StrICmp(const char *, const char *);
+int sqlite3StrNICmp(const char *, const char *, int);
+int sqlite3HashNoCase(const char *, int);
+int sqlite3IsNumber(const char*, int*, u8);
+int sqlite3Compare(const char *, const char *);
+int sqlite3SortCompare(const char *, const char *);
+void sqlite3RealToSortable(double r, char *);
+#ifdef SQLITE_MEMDEBUG
+ void *sqlite3Malloc_(int,int,char*,int);
+ void sqlite3Free_(void*,char*,int);
+ void *sqlite3Realloc_(void*,int,char*,int);
+ char *sqlite3StrDup_(const char*,char*,int);
+ char *sqlite3StrNDup_(const char*, int,char*,int);
+ void sqlite3CheckMemory(void*,int);
+#else
+ void *sqlite3Malloc(int);
+ void *sqlite3MallocRaw(int);
+ void sqlite3Free(void*);
+ void *sqlite3Realloc(void*,int);
+ char *sqlite3StrDup(const char*);
+ char *sqlite3StrNDup(const char*, int);
+# define sqlite3CheckMemory(a,b)
+# define sqlite3MallocX sqlite3Malloc
+#endif
+void sqlite3ReallocOrFree(void**,int);
+void sqlite3FreeX(void*);
+void *sqlite3MallocX(int);
+char *sqlite3MPrintf(const char*, ...);
+char *sqlite3VMPrintf(const char*, va_list);
+void sqlite3DebugPrintf(const char*, ...);
+void *sqlite3TextToPtr(const char*);
+void sqlite3SetString(char **, ...);
+void sqlite3ErrorMsg(Parse*, const char*, ...);
+void sqlite3Dequote(char*);
+void sqlite3DequoteExpr(Expr*);
+int sqlite3KeywordCode(const char*, int);
+int sqlite3RunParser(Parse*, const char*, char **);
+void sqlite3FinishCoding(Parse*);
+Expr *sqlite3Expr(int, Expr*, Expr*, const Token*);
+Expr *sqlite3RegisterExpr(Parse*,Token*);
+Expr *sqlite3ExprAnd(Expr*, Expr*);
+void sqlite3ExprSpan(Expr*,Token*,Token*);
+Expr *sqlite3ExprFunction(ExprList*, Token*);
+void sqlite3ExprAssignVarNumber(Parse*, Expr*);
+void sqlite3ExprDelete(Expr*);
+ExprList *sqlite3ExprListAppend(ExprList*,Expr*,Token*);
+void sqlite3ExprListDelete(ExprList*);
+int sqlite3Init(sqlite3*, char**);
+int sqlite3InitCallback(void*, int, char**, char**);
+void sqlite3Pragma(Parse*,Token*,Token*,Token*,int);
+void sqlite3ResetInternalSchema(sqlite3*, int);
+void sqlite3BeginParse(Parse*,int);
+void sqlite3RollbackInternalChanges(sqlite3*);
+void sqlite3CommitInternalChanges(sqlite3*);
+Table *sqlite3ResultSetOfSelect(Parse*,char*,Select*);
+void sqlite3OpenMasterTable(Vdbe *v, int);
+void sqlite3StartTable(Parse*,Token*,Token*,Token*,int,int);
+void sqlite3AddColumn(Parse*,Token*);
+void sqlite3AddNotNull(Parse*, int);
+void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int);
+void sqlite3AddColumnType(Parse*,Token*);
+void sqlite3AddDefaultValue(Parse*,Expr*);
+void sqlite3AddCollateType(Parse*, const char*, int);
+void sqlite3EndTable(Parse*,Token*,Token*,Select*);
+
+#ifndef SQLITE_OMIT_VIEW
+ void sqlite3CreateView(Parse*,Token*,Token*,Token*,Select*,int);
+ int sqlite3ViewGetColumnNames(Parse*,Table*);
+#else
+# define sqlite3ViewGetColumnNames(A,B) 0
+#endif
+
+void sqlite3DropTable(Parse*, SrcList*, int);
+void sqlite3DeleteTable(sqlite3*, Table*);
+void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int);
+int sqlite3ArrayAllocate(void**,int,int);
+IdList *sqlite3IdListAppend(IdList*, Token*);
+int sqlite3IdListIndex(IdList*,const char*);
+SrcList *sqlite3SrcListAppend(SrcList*, Token*, Token*);
+void sqlite3SrcListAddAlias(SrcList*, Token*);
+void sqlite3SrcListAssignCursors(Parse*, SrcList*);
+void sqlite3IdListDelete(IdList*);
+void sqlite3SrcListDelete(SrcList*);
+void sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*,
+ Token*);
+void sqlite3DropIndex(Parse*, SrcList*);
+void sqlite3AddKeyType(Vdbe*, ExprList*);
+void sqlite3AddIdxKeyType(Vdbe*, Index*);
+int sqlite3Select(Parse*, Select*, int, int, Select*, int, int*, char *aff);
+Select *sqlite3SelectNew(ExprList*,SrcList*,Expr*,ExprList*,Expr*,ExprList*,
+ int,Expr*,Expr*);
+void sqlite3SelectDelete(Select*);
+void sqlite3SelectUnbind(Select*);
+Table *sqlite3SrcListLookup(Parse*, SrcList*);
+int sqlite3IsReadOnly(Parse*, Table*, int);
+void sqlite3OpenTableForReading(Vdbe*, int iCur, Table*);
+void sqlite3OpenTable(Vdbe*, int iCur, Table*, int);
+void sqlite3DeleteFrom(Parse*, SrcList*, Expr*);
+void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int);
+WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**);
+void sqlite3WhereEnd(WhereInfo*);
+void sqlite3ExprCode(Parse*, Expr*);
+void sqlite3ExprCodeAndCache(Parse*, Expr*);
+int sqlite3ExprCodeExprList(Parse*, ExprList*);
+void sqlite3ExprIfTrue(Parse*, Expr*, int, int);
+void sqlite3ExprIfFalse(Parse*, Expr*, int, int);
+void sqlite3NextedParse(Parse*, const char*, ...);
+Table *sqlite3FindTable(sqlite3*,const char*, const char*);
+Table *sqlite3LocateTable(Parse*,const char*, const char*);
+Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
+void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
+void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
+void sqlite3Vacuum(Parse*, Token*);
+int sqlite3RunVacuum(char**, sqlite3*);
+char *sqlite3NameFromToken(Token*);
+int sqlite3ExprCheck(Parse*, Expr*, int, int*);
+int sqlite3ExprCompare(Expr*, Expr*);
+int sqliteFuncId(Token*);
+int sqlite3ExprResolveNames(NameContext *, Expr *);
+int sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
+int sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
+Vdbe *sqlite3GetVdbe(Parse*);
+void sqlite3Randomness(int, void*);
+void sqlite3RollbackAll(sqlite3*);
+void sqlite3CodeVerifySchema(Parse*, int);
+void sqlite3BeginTransaction(Parse*, int);
+void sqlite3CommitTransaction(Parse*);
+void sqlite3RollbackTransaction(Parse*);
+int sqlite3ExprIsConstant(Expr*);
+int sqlite3ExprIsConstantOrFunction(Expr*);
+int sqlite3ExprIsInteger(Expr*, int*);
+int sqlite3IsRowid(const char*);
+void sqlite3GenerateRowDelete(sqlite3*, Vdbe*, Table*, int, int);
+void sqlite3GenerateRowIndexDelete(sqlite3*, Vdbe*, Table*, int, char*);
+void sqlite3GenerateIndexKey(Vdbe*, Index*, int);
+void sqlite3GenerateConstraintChecks(Parse*,Table*,int,char*,int,int,int,int);
+void sqlite3CompleteInsertion(Parse*, Table*, int, char*, int, int, int);
+void sqlite3OpenTableAndIndices(Parse*, Table*, int, int);
+void sqlite3BeginWriteOperation(Parse*, int, int);
+Expr *sqlite3ExprDup(Expr*);
+void sqlite3TokenCopy(Token*, Token*);
+ExprList *sqlite3ExprListDup(ExprList*);
+SrcList *sqlite3SrcListDup(SrcList*);
+IdList *sqlite3IdListDup(IdList*);
+Select *sqlite3SelectDup(Select*);
+FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int);
+void sqlite3RegisterBuiltinFunctions(sqlite3*);
+void sqlite3RegisterDateTimeFunctions(sqlite3*);
+int sqlite3SafetyOn(sqlite3*);
+int sqlite3SafetyOff(sqlite3*);
+int sqlite3SafetyCheck(sqlite3*);
+void sqlite3ChangeCookie(sqlite3*, Vdbe*, int);
+
+#ifndef SQLITE_OMIT_TRIGGER
+ void sqlite3BeginTrigger(Parse*, Token*,Token*,int,int,IdList*,SrcList*,
+ int,Expr*,int);
+ void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*);
+ void sqlite3DropTrigger(Parse*, SrcList*);
+ void sqlite3DropTriggerPtr(Parse*, Trigger*, int);
+ int sqlite3TriggersExist(Parse*, Table*, int, ExprList*);
+ int sqlite3CodeRowTrigger(Parse*, int, ExprList*, int, Table *, int, int,
+ int, int);
+ void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
+ void sqlite3DeleteTriggerStep(TriggerStep*);
+ TriggerStep *sqlite3TriggerSelectStep(Select*);
+ TriggerStep *sqlite3TriggerInsertStep(Token*, IdList*, ExprList*,Select*,int);
+ TriggerStep *sqlite3TriggerUpdateStep(Token*, ExprList*, Expr*, int);
+ TriggerStep *sqlite3TriggerDeleteStep(Token*, Expr*);
+ void sqlite3DeleteTrigger(Trigger*);
+ void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
+#else
+# define sqlite3TriggersExist(A,B,C,D,E,F) 0
+# define sqlite3DeleteTrigger(A)
+# define sqlite3DropTriggerPtr(A,B,C)
+# define sqlite3UnlinkAndDeleteTrigger(A,B,C)
+# define sqlite3CodeRowTrigger(A,B,C,D,E,F,G,H,I) 0
+#endif
+
+int sqlite3JoinType(Parse*, Token*, Token*, Token*);
+void sqlite3CreateForeignKey(Parse*, ExprList*, Token*, ExprList*, int);
+void sqlite3DeferForeignKey(Parse*, int);
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ void sqlite3AuthRead(Parse*,Expr*,SrcList*);
+ int sqlite3AuthCheck(Parse*,int, const char*, const char*, const char*);
+ void sqlite3AuthContextPush(Parse*, AuthContext*, const char*);
+ void sqlite3AuthContextPop(AuthContext*);
+#else
+# define sqlite3AuthRead(a,b,c)
+# define sqlite3AuthCheck(a,b,c,d,e) SQLITE_OK
+# define sqlite3AuthContextPush(a,b,c)
+# define sqlite3AuthContextPop(a) ((void)(a))
+#endif
+void sqlite3Attach(Parse*, Token*, Token*, int, Token*);
+void sqlite3Detach(Parse*, Token*);
+int sqlite3BtreeFactory(const sqlite3 *db, const char *zFilename,
+ int omitJournal, int nCache, Btree **ppBtree);
+int sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*);
+int sqlite3FixSrcList(DbFixer*, SrcList*);
+int sqlite3FixSelect(DbFixer*, Select*);
+int sqlite3FixExpr(DbFixer*, Expr*);
+int sqlite3FixExprList(DbFixer*, ExprList*);
+int sqlite3FixTriggerStep(DbFixer*, TriggerStep*);
+int sqlite3AtoF(const char *z, double*);
+char *sqlite3_snprintf(int,char*,const char*,...);
+int sqlite3GetInt32(const char *, int*);
+int sqlite3FitsIn64Bits(const char *);
+int sqlite3utf16ByteLen(const void *pData, int nChar);
+int sqlite3utf8CharLen(const char *pData, int nByte);
+int sqlite3ReadUtf8(const unsigned char *);
+int sqlite3PutVarint(unsigned char *, u64);
+int sqlite3GetVarint(const unsigned char *, u64 *);
+int sqlite3GetVarint32(const unsigned char *, u32 *);
+int sqlite3VarintLen(u64 v);
+void sqlite3IndexAffinityStr(Vdbe *, Index *);
+void sqlite3TableAffinityStr(Vdbe *, Table *);
+char sqlite3CompareAffinity(Expr *pExpr, char aff2);
+int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity);
+char sqlite3ExprAffinity(Expr *pExpr);
+int sqlite3atoi64(const char*, i64*);
+void sqlite3Error(sqlite3*, int, const char*,...);
+void *sqlite3HexToBlob(const char *z);
+int sqlite3TwoPartName(Parse *, Token *, Token *, Token **);
+const char *sqlite3ErrStr(int);
+int sqlite3ReadUniChar(const char *zStr, int *pOffset, u8 *pEnc, int fold);
+int sqlite3ReadSchema(Parse *pParse);
+CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char *,int,int);
+CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName);
+CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr);
+int sqlite3CheckCollSeq(Parse *, CollSeq *);
+int sqlite3CheckIndexCollSeq(Parse *, Index *);
+int sqlite3CheckObjectName(Parse *, const char *);
+void sqlite3VdbeSetChanges(sqlite3 *, int);
+void sqlite3utf16Substr(sqlite3_context *,int,sqlite3_value **);
+
+const void *sqlite3ValueText(sqlite3_value*, u8);
+int sqlite3ValueBytes(sqlite3_value*, u8);
+void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*));
+void sqlite3ValueFree(sqlite3_value*);
+sqlite3_value *sqlite3ValueNew(void);
+sqlite3_value *sqlite3GetTransientValue(sqlite3*db);
+int sqlite3ValueFromExpr(Expr *, u8, u8, sqlite3_value **);
+void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8);
+extern const unsigned char sqlite3UpperToLower[];
+void sqlite3RootPageMoved(Db*, int, int);
+void sqlite3Reindex(Parse*, Token*, Token*);
+void sqlite3AlterFunctions(sqlite3*);
+void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
+int sqlite3GetToken(const unsigned char *, int *);
+void sqlite3NestedParse(Parse*, const char*, ...);
+void sqlite3ExpirePreparedStatements(sqlite3*);
+void sqlite3CodeSubselect(Parse *, Expr *);
+int sqlite3SelectResolve(Parse *, Select *, NameContext *);
+void sqlite3ColumnDefault(Vdbe *, Table *, int);
+void sqlite3AlterFinishAddColumn(Parse *, Token *);
+void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
+const char *sqlite3TestErrorName(int);
+CollSeq *sqlite3GetCollSeq(sqlite3*, CollSeq *, const char *, int);
+char sqlite3AffinityType(const Token*);
+void sqlite3Analyze(Parse*, Token*, Token*);
+int sqlite3InvokeBusyHandler(BusyHandler*);
+int sqlite3FindDb(sqlite3*, Token*);
+void sqlite3AnalysisLoad(sqlite3*,int iDB);
+void sqlite3DefaultRowEst(Index*);
+void sqlite3RegisterLikeFunctions(sqlite3*, int);
+int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*);
+
+#ifdef SQLITE_SSE
+#include "sseInt.h"
+#endif
+
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/sqlite_config.w32.h b/ext/pdo_sqlite/sqlite/src/sqlite_config.w32.h
new file mode 100644
index 000000000..3903ffe95
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/sqlite_config.w32.h
@@ -0,0 +1,8 @@
+#include "config.w32.h"
+#if ZTS
+# define THREADSAFE 1
+#endif
+#if !ZEND_DEBUG && !defined(NDEBUG)
+# define NDEBUG
+#endif
+#define SQLITE_PTR_SZ 4 \ No newline at end of file
diff --git a/ext/pdo_sqlite/sqlite/src/table.c b/ext/pdo_sqlite/sqlite/src/table.c
new file mode 100644
index 000000000..d4ef2c8a7
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/table.c
@@ -0,0 +1,195 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains the sqlite3_get_table() and sqlite3_free_table()
+** interface routines. These are just wrappers around the main
+** interface routine of sqlite3_exec().
+**
+** These routines are in a separate files so that they will not be linked
+** if they are not used.
+*/
+#include <stdlib.h>
+#include <string.h>
+#include "sqliteInt.h"
+
+/*
+** This structure is used to pass data from sqlite3_get_table() through
+** to the callback function is uses to build the result.
+*/
+typedef struct TabResult {
+ char **azResult;
+ char *zErrMsg;
+ int nResult;
+ int nAlloc;
+ int nRow;
+ int nColumn;
+ int nData;
+ int rc;
+} TabResult;
+
+/*
+** This routine is called once for each row in the result table. Its job
+** is to fill in the TabResult structure appropriately, allocating new
+** memory as necessary.
+*/
+static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
+ TabResult *p = (TabResult*)pArg;
+ int need;
+ int i;
+ char *z;
+
+ /* Make sure there is enough space in p->azResult to hold everything
+ ** we need to remember from this invocation of the callback.
+ */
+ if( p->nRow==0 && argv!=0 ){
+ need = nCol*2;
+ }else{
+ need = nCol;
+ }
+ if( p->nData + need >= p->nAlloc ){
+ char **azNew;
+ p->nAlloc = p->nAlloc*2 + need + 1;
+ azNew = realloc( p->azResult, sizeof(char*)*p->nAlloc );
+ if( azNew==0 ) goto malloc_failed;
+ p->azResult = azNew;
+ }
+
+ /* If this is the first row, then generate an extra row containing
+ ** the names of all columns.
+ */
+ if( p->nRow==0 ){
+ p->nColumn = nCol;
+ for(i=0; i<nCol; i++){
+ if( colv[i]==0 ){
+ z = 0;
+ }else{
+ z = malloc( strlen(colv[i])+1 );
+ if( z==0 ) goto malloc_failed;
+ strcpy(z, colv[i]);
+ }
+ p->azResult[p->nData++] = z;
+ }
+ }else if( p->nColumn!=nCol ){
+ sqlite3SetString(&p->zErrMsg,
+ "sqlite3_get_table() called with two or more incompatible queries",
+ (char*)0);
+ p->rc = SQLITE_ERROR;
+ return 1;
+ }
+
+ /* Copy over the row data
+ */
+ if( argv!=0 ){
+ for(i=0; i<nCol; i++){
+ if( argv[i]==0 ){
+ z = 0;
+ }else{
+ z = malloc( strlen(argv[i])+1 );
+ if( z==0 ) goto malloc_failed;
+ strcpy(z, argv[i]);
+ }
+ p->azResult[p->nData++] = z;
+ }
+ p->nRow++;
+ }
+ return 0;
+
+malloc_failed:
+ p->rc = SQLITE_NOMEM;
+ return 1;
+}
+
+/*
+** Query the database. But instead of invoking a callback for each row,
+** malloc() for space to hold the result and return the entire results
+** at the conclusion of the call.
+**
+** The result that is written to ***pazResult is held in memory obtained
+** from malloc(). But the caller cannot free this memory directly.
+** Instead, the entire table should be passed to sqlite3_free_table() when
+** the calling procedure is finished using it.
+*/
+int sqlite3_get_table(
+ sqlite3 *db, /* The database on which the SQL executes */
+ const char *zSql, /* The SQL to be executed */
+ char ***pazResult, /* Write the result table here */
+ int *pnRow, /* Write the number of rows in the result here */
+ int *pnColumn, /* Write the number of columns of result here */
+ char **pzErrMsg /* Write error messages here */
+){
+ int rc;
+ TabResult res;
+ if( pazResult==0 ){ return SQLITE_ERROR; }
+ *pazResult = 0;
+ if( pnColumn ) *pnColumn = 0;
+ if( pnRow ) *pnRow = 0;
+ res.zErrMsg = 0;
+ res.nResult = 0;
+ res.nRow = 0;
+ res.nColumn = 0;
+ res.nData = 1;
+ res.nAlloc = 20;
+ res.rc = SQLITE_OK;
+ res.azResult = malloc( sizeof(char*)*res.nAlloc );
+ if( res.azResult==0 ) return SQLITE_NOMEM;
+ res.azResult[0] = 0;
+ rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg);
+ if( res.azResult ){
+ res.azResult[0] = (char*)res.nData;
+ }
+ if( rc==SQLITE_ABORT ){
+ sqlite3_free_table(&res.azResult[1]);
+ if( res.zErrMsg ){
+ if( pzErrMsg ){
+ free(*pzErrMsg);
+ *pzErrMsg = sqlite3_mprintf("%s",res.zErrMsg);
+ }
+ sqliteFree(res.zErrMsg);
+ }
+ db->errCode = res.rc;
+ return res.rc;
+ }
+ sqliteFree(res.zErrMsg);
+ if( rc!=SQLITE_OK ){
+ sqlite3_free_table(&res.azResult[1]);
+ return rc;
+ }
+ if( res.nAlloc>res.nData ){
+ char **azNew;
+ azNew = realloc( res.azResult, sizeof(char*)*(res.nData+1) );
+ if( azNew==0 ){
+ sqlite3_free_table(&res.azResult[1]);
+ return SQLITE_NOMEM;
+ }
+ res.nAlloc = res.nData+1;
+ res.azResult = azNew;
+ }
+ *pazResult = &res.azResult[1];
+ if( pnColumn ) *pnColumn = res.nColumn;
+ if( pnRow ) *pnRow = res.nRow;
+ return rc;
+}
+
+/*
+** This routine frees the space the sqlite3_get_table() malloced.
+*/
+void sqlite3_free_table(
+ char **azResult /* Result returned from from sqlite3_get_table() */
+){
+ if( azResult ){
+ int i, n;
+ azResult--;
+ if( azResult==0 ) return;
+ n = (int)azResult[0];
+ for(i=1; i<n; i++){ if( azResult[i] ) free(azResult[i]); }
+ free(azResult);
+ }
+}
diff --git a/ext/pdo_sqlite/sqlite/src/tclsqlite.c b/ext/pdo_sqlite/sqlite/src/tclsqlite.c
new file mode 100644
index 000000000..9a8b823b7
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/tclsqlite.c
@@ -0,0 +1,2079 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** A TCL Interface to SQLite
+**
+** $Id$
+*/
+#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
+
+#include "sqliteInt.h"
+#include "hash.h"
+#include "tcl.h"
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <ctype.h>
+
+#define NUM_PREPARED_STMTS 10
+#define MAX_PREPARED_STMTS 100
+
+/*
+** If TCL uses UTF-8 and SQLite is configured to use iso8859, then we
+** have to do a translation when going between the two. Set the
+** UTF_TRANSLATION_NEEDED macro to indicate that we need to do
+** this translation.
+*/
+#if defined(TCL_UTF_MAX) && !defined(SQLITE_UTF8)
+# define UTF_TRANSLATION_NEEDED 1
+#endif
+
+/*
+** New SQL functions can be created as TCL scripts. Each such function
+** is described by an instance of the following structure.
+*/
+typedef struct SqlFunc SqlFunc;
+struct SqlFunc {
+ Tcl_Interp *interp; /* The TCL interpret to execute the function */
+ Tcl_Obj *pScript; /* The Tcl_Obj representation of the script */
+ int useEvalObjv; /* True if it is safe to use Tcl_EvalObjv */
+ char *zName; /* Name of this function */
+ SqlFunc *pNext; /* Next function on the list of them all */
+};
+
+/*
+** New collation sequences function can be created as TCL scripts. Each such
+** function is described by an instance of the following structure.
+*/
+typedef struct SqlCollate SqlCollate;
+struct SqlCollate {
+ Tcl_Interp *interp; /* The TCL interpret to execute the function */
+ char *zScript; /* The script to be run */
+ SqlCollate *pNext; /* Next function on the list of them all */
+};
+
+/*
+** Prepared statements are cached for faster execution. Each prepared
+** statement is described by an instance of the following structure.
+*/
+typedef struct SqlPreparedStmt SqlPreparedStmt;
+struct SqlPreparedStmt {
+ SqlPreparedStmt *pNext; /* Next in linked list */
+ SqlPreparedStmt *pPrev; /* Previous on the list */
+ sqlite3_stmt *pStmt; /* The prepared statement */
+ int nSql; /* chars in zSql[] */
+ char zSql[1]; /* Text of the SQL statement */
+};
+
+/*
+** There is one instance of this structure for each SQLite database
+** that has been opened by the SQLite TCL interface.
+*/
+typedef struct SqliteDb SqliteDb;
+struct SqliteDb {
+ sqlite3 *db; /* The "real" database structure */
+ Tcl_Interp *interp; /* The interpreter used for this database */
+ char *zBusy; /* The busy callback routine */
+ char *zCommit; /* The commit hook callback routine */
+ char *zTrace; /* The trace callback routine */
+ char *zProfile; /* The profile callback routine */
+ char *zProgress; /* The progress callback routine */
+ char *zAuth; /* The authorization callback routine */
+ char *zNull; /* Text to substitute for an SQL NULL value */
+ SqlFunc *pFunc; /* List of SQL functions */
+ SqlCollate *pCollate; /* List of SQL collation functions */
+ int rc; /* Return code of most recent sqlite3_exec() */
+ Tcl_Obj *pCollateNeeded; /* Collation needed script */
+ SqlPreparedStmt *stmtList; /* List of prepared statements*/
+ SqlPreparedStmt *stmtLast; /* Last statement in the list */
+ int maxStmt; /* The next maximum number of stmtList */
+ int nStmt; /* Number of statements in stmtList */
+};
+
+/*
+** Look at the script prefix in pCmd. We will be executing this script
+** after first appending one or more arguments. This routine analyzes
+** the script to see if it is safe to use Tcl_EvalObjv() on the script
+** rather than the more general Tcl_EvalEx(). Tcl_EvalObjv() is much
+** faster.
+**
+** Scripts that are safe to use with Tcl_EvalObjv() consists of a
+** command name followed by zero or more arguments with no [...] or $
+** or {...} or ; to be seen anywhere. Most callback scripts consist
+** of just a single procedure name and they meet this requirement.
+*/
+static int safeToUseEvalObjv(Tcl_Interp *interp, Tcl_Obj *pCmd){
+ /* We could try to do something with Tcl_Parse(). But we will instead
+ ** just do a search for forbidden characters. If any of the forbidden
+ ** characters appear in pCmd, we will report the string as unsafe.
+ */
+ const char *z;
+ int n;
+ z = Tcl_GetStringFromObj(pCmd, &n);
+ while( n-- > 0 ){
+ int c = *(z++);
+ if( c=='$' || c=='[' || c==';' ) return 0;
+ }
+ return 1;
+}
+
+/*
+** Find an SqlFunc structure with the given name. Or create a new
+** one if an existing one cannot be found. Return a pointer to the
+** structure.
+*/
+static SqlFunc *findSqlFunc(SqliteDb *pDb, const char *zName){
+ SqlFunc *p, *pNew;
+ int i;
+ pNew = (SqlFunc*)Tcl_Alloc( sizeof(*pNew) + strlen(zName) + 1 );
+ pNew->zName = (char*)&pNew[1];
+ for(i=0; zName[i]; i++){ pNew->zName[i] = tolower(zName[i]); }
+ pNew->zName[i] = 0;
+ for(p=pDb->pFunc; p; p=p->pNext){
+ if( strcmp(p->zName, pNew->zName)==0 ){
+ Tcl_Free((char*)pNew);
+ return p;
+ }
+ }
+ pNew->interp = pDb->interp;
+ pNew->pScript = 0;
+ pNew->pNext = pDb->pFunc;
+ pDb->pFunc = pNew;
+ return pNew;
+}
+
+/*
+** Finalize and free a list of prepared statements
+*/
+static void flushStmtCache( SqliteDb *pDb ){
+ SqlPreparedStmt *pPreStmt;
+
+ while( pDb->stmtList ){
+ sqlite3_finalize( pDb->stmtList->pStmt );
+ pPreStmt = pDb->stmtList;
+ pDb->stmtList = pDb->stmtList->pNext;
+ Tcl_Free( (char*)pPreStmt );
+ }
+ pDb->nStmt = 0;
+ pDb->stmtLast = 0;
+}
+
+/*
+** TCL calls this procedure when an sqlite3 database command is
+** deleted.
+*/
+static void DbDeleteCmd(void *db){
+ SqliteDb *pDb = (SqliteDb*)db;
+ flushStmtCache(pDb);
+ sqlite3_close(pDb->db);
+ while( pDb->pFunc ){
+ SqlFunc *pFunc = pDb->pFunc;
+ pDb->pFunc = pFunc->pNext;
+ Tcl_DecrRefCount(pFunc->pScript);
+ Tcl_Free((char*)pFunc);
+ }
+ while( pDb->pCollate ){
+ SqlCollate *pCollate = pDb->pCollate;
+ pDb->pCollate = pCollate->pNext;
+ Tcl_Free((char*)pCollate);
+ }
+ if( pDb->zBusy ){
+ Tcl_Free(pDb->zBusy);
+ }
+ if( pDb->zTrace ){
+ Tcl_Free(pDb->zTrace);
+ }
+ if( pDb->zProfile ){
+ Tcl_Free(pDb->zProfile);
+ }
+ if( pDb->zAuth ){
+ Tcl_Free(pDb->zAuth);
+ }
+ if( pDb->zNull ){
+ Tcl_Free(pDb->zNull);
+ }
+ Tcl_Free((char*)pDb);
+}
+
+/*
+** This routine is called when a database file is locked while trying
+** to execute SQL.
+*/
+static int DbBusyHandler(void *cd, int nTries){
+ SqliteDb *pDb = (SqliteDb*)cd;
+ int rc;
+ char zVal[30];
+
+ sprintf(zVal, "%d", nTries);
+ rc = Tcl_VarEval(pDb->interp, pDb->zBusy, " ", zVal, (char*)0);
+ if( rc!=TCL_OK || atoi(Tcl_GetStringResult(pDb->interp)) ){
+ return 0;
+ }
+ return 1;
+}
+
+/*
+** This routine is invoked as the 'progress callback' for the database.
+*/
+static int DbProgressHandler(void *cd){
+ SqliteDb *pDb = (SqliteDb*)cd;
+ int rc;
+
+ assert( pDb->zProgress );
+ rc = Tcl_Eval(pDb->interp, pDb->zProgress);
+ if( rc!=TCL_OK || atoi(Tcl_GetStringResult(pDb->interp)) ){
+ return 1;
+ }
+ return 0;
+}
+
+/*
+** This routine is called by the SQLite trace handler whenever a new
+** block of SQL is executed. The TCL script in pDb->zTrace is executed.
+*/
+static void DbTraceHandler(void *cd, const char *zSql){
+ SqliteDb *pDb = (SqliteDb*)cd;
+ Tcl_DString str;
+
+ Tcl_DStringInit(&str);
+ Tcl_DStringAppend(&str, pDb->zTrace, -1);
+ Tcl_DStringAppendElement(&str, zSql);
+ Tcl_Eval(pDb->interp, Tcl_DStringValue(&str));
+ Tcl_DStringFree(&str);
+ Tcl_ResetResult(pDb->interp);
+}
+
+/*
+** This routine is called by the SQLite profile handler after a statement
+** SQL has executed. The TCL script in pDb->zProfile is evaluated.
+*/
+static void DbProfileHandler(void *cd, const char *zSql, sqlite_uint64 tm){
+ SqliteDb *pDb = (SqliteDb*)cd;
+ Tcl_DString str;
+ char zTm[100];
+
+ sqlite3_snprintf(sizeof(zTm)-1, zTm, "%lld", tm);
+ Tcl_DStringInit(&str);
+ Tcl_DStringAppend(&str, pDb->zProfile, -1);
+ Tcl_DStringAppendElement(&str, zSql);
+ Tcl_DStringAppendElement(&str, zTm);
+ Tcl_Eval(pDb->interp, Tcl_DStringValue(&str));
+ Tcl_DStringFree(&str);
+ Tcl_ResetResult(pDb->interp);
+}
+
+/*
+** This routine is called when a transaction is committed. The
+** TCL script in pDb->zCommit is executed. If it returns non-zero or
+** if it throws an exception, the transaction is rolled back instead
+** of being committed.
+*/
+static int DbCommitHandler(void *cd){
+ SqliteDb *pDb = (SqliteDb*)cd;
+ int rc;
+
+ rc = Tcl_Eval(pDb->interp, pDb->zCommit);
+ if( rc!=TCL_OK || atoi(Tcl_GetStringResult(pDb->interp)) ){
+ return 1;
+ }
+ return 0;
+}
+
+static void tclCollateNeeded(
+ void *pCtx,
+ sqlite3 *db,
+ int enc,
+ const char *zName
+){
+ SqliteDb *pDb = (SqliteDb *)pCtx;
+ Tcl_Obj *pScript = Tcl_DuplicateObj(pDb->pCollateNeeded);
+ Tcl_IncrRefCount(pScript);
+ Tcl_ListObjAppendElement(0, pScript, Tcl_NewStringObj(zName, -1));
+ Tcl_EvalObjEx(pDb->interp, pScript, 0);
+ Tcl_DecrRefCount(pScript);
+}
+
+/*
+** This routine is called to evaluate an SQL collation function implemented
+** using TCL script.
+*/
+static int tclSqlCollate(
+ void *pCtx,
+ int nA,
+ const void *zA,
+ int nB,
+ const void *zB
+){
+ SqlCollate *p = (SqlCollate *)pCtx;
+ Tcl_Obj *pCmd;
+
+ pCmd = Tcl_NewStringObj(p->zScript, -1);
+ Tcl_IncrRefCount(pCmd);
+ Tcl_ListObjAppendElement(p->interp, pCmd, Tcl_NewStringObj(zA, nA));
+ Tcl_ListObjAppendElement(p->interp, pCmd, Tcl_NewStringObj(zB, nB));
+ Tcl_EvalObjEx(p->interp, pCmd, TCL_EVAL_DIRECT);
+ Tcl_DecrRefCount(pCmd);
+ return (atoi(Tcl_GetStringResult(p->interp)));
+}
+
+/*
+** This routine is called to evaluate an SQL function implemented
+** using TCL script.
+*/
+static void tclSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv){
+ SqlFunc *p = sqlite3_user_data(context);
+ Tcl_Obj *pCmd;
+ int i;
+ int rc;
+
+ if( argc==0 ){
+ /* If there are no arguments to the function, call Tcl_EvalObjEx on the
+ ** script object directly. This allows the TCL compiler to generate
+ ** bytecode for the command on the first invocation and thus make
+ ** subsequent invocations much faster. */
+ pCmd = p->pScript;
+ Tcl_IncrRefCount(pCmd);
+ rc = Tcl_EvalObjEx(p->interp, pCmd, 0);
+ Tcl_DecrRefCount(pCmd);
+ }else{
+ /* If there are arguments to the function, make a shallow copy of the
+ ** script object, lappend the arguments, then evaluate the copy.
+ **
+ ** By "shallow" copy, we mean a only the outer list Tcl_Obj is duplicated.
+ ** The new Tcl_Obj contains pointers to the original list elements.
+ ** That way, when Tcl_EvalObjv() is run and shimmers the first element
+ ** of the list to tclCmdNameType, that alternate representation will
+ ** be preserved and reused on the next invocation.
+ */
+ Tcl_Obj **aArg;
+ int nArg;
+ if( Tcl_ListObjGetElements(p->interp, p->pScript, &nArg, &aArg) ){
+ sqlite3_result_error(context, Tcl_GetStringResult(p->interp), -1);
+ return;
+ }
+ pCmd = Tcl_NewListObj(nArg, aArg);
+ Tcl_IncrRefCount(pCmd);
+ for(i=0; i<argc; i++){
+ sqlite3_value *pIn = argv[i];
+ Tcl_Obj *pVal;
+
+ /* Set pVal to contain the i'th column of this row. */
+ switch( sqlite3_value_type(pIn) ){
+ case SQLITE_BLOB: {
+ int bytes = sqlite3_value_bytes(pIn);
+ pVal = Tcl_NewByteArrayObj(sqlite3_value_blob(pIn), bytes);
+ break;
+ }
+ case SQLITE_INTEGER: {
+ sqlite_int64 v = sqlite3_value_int64(pIn);
+ if( v>=-2147483647 && v<=2147483647 ){
+ pVal = Tcl_NewIntObj(v);
+ }else{
+ pVal = Tcl_NewWideIntObj(v);
+ }
+ break;
+ }
+ case SQLITE_FLOAT: {
+ double r = sqlite3_value_double(pIn);
+ pVal = Tcl_NewDoubleObj(r);
+ break;
+ }
+ case SQLITE_NULL: {
+ pVal = Tcl_NewStringObj("", 0);
+ break;
+ }
+ default: {
+ int bytes = sqlite3_value_bytes(pIn);
+ pVal = Tcl_NewStringObj(sqlite3_value_text(pIn), bytes);
+ break;
+ }
+ }
+ rc = Tcl_ListObjAppendElement(p->interp, pCmd, pVal);
+ if( rc ){
+ Tcl_DecrRefCount(pCmd);
+ sqlite3_result_error(context, Tcl_GetStringResult(p->interp), -1);
+ return;
+ }
+ }
+ if( !p->useEvalObjv ){
+ /* Tcl_EvalObjEx() will automatically call Tcl_EvalObjv() if pCmd
+ ** is a list without a string representation. To prevent this from
+ ** happening, make sure pCmd has a valid string representation */
+ Tcl_GetString(pCmd);
+ }
+ rc = Tcl_EvalObjEx(p->interp, pCmd, TCL_EVAL_DIRECT);
+ Tcl_DecrRefCount(pCmd);
+ }
+
+ if( rc && rc!=TCL_RETURN ){
+ sqlite3_result_error(context, Tcl_GetStringResult(p->interp), -1);
+ }else{
+ Tcl_Obj *pVar = Tcl_GetObjResult(p->interp);
+ int n;
+ u8 *data;
+ char *zType = pVar->typePtr ? pVar->typePtr->name : "";
+ char c = zType[0];
+ if( c=='b' && strcmp(zType,"bytearray")==0 && pVar->bytes==0 ){
+ /* Only return a BLOB type if the Tcl variable is a bytearray and
+ ** has no string representation. */
+ data = Tcl_GetByteArrayFromObj(pVar, &n);
+ sqlite3_result_blob(context, data, n, SQLITE_TRANSIENT);
+ }else if( (c=='b' && strcmp(zType,"boolean")==0) ||
+ (c=='i' && strcmp(zType,"int")==0) ){
+ Tcl_GetIntFromObj(0, pVar, &n);
+ sqlite3_result_int(context, n);
+ }else if( c=='d' && strcmp(zType,"double")==0 ){
+ double r;
+ Tcl_GetDoubleFromObj(0, pVar, &r);
+ sqlite3_result_double(context, r);
+ }else if( c=='w' && strcmp(zType,"wideInt")==0 ){
+ Tcl_WideInt v;
+ Tcl_GetWideIntFromObj(0, pVar, &v);
+ sqlite3_result_int64(context, v);
+ }else{
+ data = Tcl_GetStringFromObj(pVar, &n);
+ sqlite3_result_text(context, data, n, SQLITE_TRANSIENT);
+ }
+ }
+}
+
+#ifndef SQLITE_OMIT_AUTHORIZATION
+/*
+** This is the authentication function. It appends the authentication
+** type code and the two arguments to zCmd[] then invokes the result
+** on the interpreter. The reply is examined to determine if the
+** authentication fails or succeeds.
+*/
+static int auth_callback(
+ void *pArg,
+ int code,
+ const char *zArg1,
+ const char *zArg2,
+ const char *zArg3,
+ const char *zArg4
+){
+ char *zCode;
+ Tcl_DString str;
+ int rc;
+ const char *zReply;
+ SqliteDb *pDb = (SqliteDb*)pArg;
+
+ switch( code ){
+ case SQLITE_COPY : zCode="SQLITE_COPY"; break;
+ case SQLITE_CREATE_INDEX : zCode="SQLITE_CREATE_INDEX"; break;
+ case SQLITE_CREATE_TABLE : zCode="SQLITE_CREATE_TABLE"; break;
+ case SQLITE_CREATE_TEMP_INDEX : zCode="SQLITE_CREATE_TEMP_INDEX"; break;
+ case SQLITE_CREATE_TEMP_TABLE : zCode="SQLITE_CREATE_TEMP_TABLE"; break;
+ case SQLITE_CREATE_TEMP_TRIGGER: zCode="SQLITE_CREATE_TEMP_TRIGGER"; break;
+ case SQLITE_CREATE_TEMP_VIEW : zCode="SQLITE_CREATE_TEMP_VIEW"; break;
+ case SQLITE_CREATE_TRIGGER : zCode="SQLITE_CREATE_TRIGGER"; break;
+ case SQLITE_CREATE_VIEW : zCode="SQLITE_CREATE_VIEW"; break;
+ case SQLITE_DELETE : zCode="SQLITE_DELETE"; break;
+ case SQLITE_DROP_INDEX : zCode="SQLITE_DROP_INDEX"; break;
+ case SQLITE_DROP_TABLE : zCode="SQLITE_DROP_TABLE"; break;
+ case SQLITE_DROP_TEMP_INDEX : zCode="SQLITE_DROP_TEMP_INDEX"; break;
+ case SQLITE_DROP_TEMP_TABLE : zCode="SQLITE_DROP_TEMP_TABLE"; break;
+ case SQLITE_DROP_TEMP_TRIGGER : zCode="SQLITE_DROP_TEMP_TRIGGER"; break;
+ case SQLITE_DROP_TEMP_VIEW : zCode="SQLITE_DROP_TEMP_VIEW"; break;
+ case SQLITE_DROP_TRIGGER : zCode="SQLITE_DROP_TRIGGER"; break;
+ case SQLITE_DROP_VIEW : zCode="SQLITE_DROP_VIEW"; break;
+ case SQLITE_INSERT : zCode="SQLITE_INSERT"; break;
+ case SQLITE_PRAGMA : zCode="SQLITE_PRAGMA"; break;
+ case SQLITE_READ : zCode="SQLITE_READ"; break;
+ case SQLITE_SELECT : zCode="SQLITE_SELECT"; break;
+ case SQLITE_TRANSACTION : zCode="SQLITE_TRANSACTION"; break;
+ case SQLITE_UPDATE : zCode="SQLITE_UPDATE"; break;
+ case SQLITE_ATTACH : zCode="SQLITE_ATTACH"; break;
+ case SQLITE_DETACH : zCode="SQLITE_DETACH"; break;
+ case SQLITE_ALTER_TABLE : zCode="SQLITE_ALTER_TABLE"; break;
+ case SQLITE_REINDEX : zCode="SQLITE_REINDEX"; break;
+ case SQLITE_ANALYZE : zCode="SQLITE_ANALYZE"; break;
+ default : zCode="????"; break;
+ }
+ Tcl_DStringInit(&str);
+ Tcl_DStringAppend(&str, pDb->zAuth, -1);
+ Tcl_DStringAppendElement(&str, zCode);
+ Tcl_DStringAppendElement(&str, zArg1 ? zArg1 : "");
+ Tcl_DStringAppendElement(&str, zArg2 ? zArg2 : "");
+ Tcl_DStringAppendElement(&str, zArg3 ? zArg3 : "");
+ Tcl_DStringAppendElement(&str, zArg4 ? zArg4 : "");
+ rc = Tcl_GlobalEval(pDb->interp, Tcl_DStringValue(&str));
+ Tcl_DStringFree(&str);
+ zReply = Tcl_GetStringResult(pDb->interp);
+ if( strcmp(zReply,"SQLITE_OK")==0 ){
+ rc = SQLITE_OK;
+ }else if( strcmp(zReply,"SQLITE_DENY")==0 ){
+ rc = SQLITE_DENY;
+ }else if( strcmp(zReply,"SQLITE_IGNORE")==0 ){
+ rc = SQLITE_IGNORE;
+ }else{
+ rc = 999;
+ }
+ return rc;
+}
+#endif /* SQLITE_OMIT_AUTHORIZATION */
+
+/*
+** zText is a pointer to text obtained via an sqlite3_result_text()
+** or similar interface. This routine returns a Tcl string object,
+** reference count set to 0, containing the text. If a translation
+** between iso8859 and UTF-8 is required, it is preformed.
+*/
+static Tcl_Obj *dbTextToObj(char const *zText){
+ Tcl_Obj *pVal;
+#ifdef UTF_TRANSLATION_NEEDED
+ Tcl_DString dCol;
+ Tcl_DStringInit(&dCol);
+ Tcl_ExternalToUtfDString(NULL, zText, -1, &dCol);
+ pVal = Tcl_NewStringObj(Tcl_DStringValue(&dCol), -1);
+ Tcl_DStringFree(&dCol);
+#else
+ pVal = Tcl_NewStringObj(zText, -1);
+#endif
+ return pVal;
+}
+
+/*
+** This routine reads a line of text from FILE in, stores
+** the text in memory obtained from malloc() and returns a pointer
+** to the text. NULL is returned at end of file, or if malloc()
+** fails.
+**
+** The interface is like "readline" but no command-line editing
+** is done.
+**
+** copied from shell.c from '.import' command
+*/
+static char *local_getline(char *zPrompt, FILE *in){
+ char *zLine;
+ int nLine;
+ int n;
+ int eol;
+
+ nLine = 100;
+ zLine = malloc( nLine );
+ if( zLine==0 ) return 0;
+ n = 0;
+ eol = 0;
+ while( !eol ){
+ if( n+100>nLine ){
+ nLine = nLine*2 + 100;
+ zLine = realloc(zLine, nLine);
+ if( zLine==0 ) return 0;
+ }
+ if( fgets(&zLine[n], nLine - n, in)==0 ){
+ if( n==0 ){
+ free(zLine);
+ return 0;
+ }
+ zLine[n] = 0;
+ eol = 1;
+ break;
+ }
+ while( zLine[n] ){ n++; }
+ if( n>0 && zLine[n-1]=='\n' ){
+ n--;
+ zLine[n] = 0;
+ eol = 1;
+ }
+ }
+ zLine = realloc( zLine, n+1 );
+ return zLine;
+}
+
+/*
+** The "sqlite" command below creates a new Tcl command for each
+** connection it opens to an SQLite database. This routine is invoked
+** whenever one of those connection-specific commands is executed
+** in Tcl. For example, if you run Tcl code like this:
+**
+** sqlite3 db1 "my_database"
+** db1 close
+**
+** The first command opens a connection to the "my_database" database
+** and calls that connection "db1". The second command causes this
+** subroutine to be invoked.
+*/
+static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
+ SqliteDb *pDb = (SqliteDb*)cd;
+ int choice;
+ int rc = TCL_OK;
+ static const char *DB_strs[] = {
+ "authorizer", "busy", "cache",
+ "changes", "close", "collate",
+ "collation_needed", "commit_hook", "complete",
+ "copy", "errorcode", "eval",
+ "function", "last_insert_rowid", "nullvalue",
+ "onecolumn", "profile", "progress",
+ "rekey", "timeout", "total_changes",
+ "trace", "transaction", "version",
+ 0
+ };
+ enum DB_enum {
+ DB_AUTHORIZER, DB_BUSY, DB_CACHE,
+ DB_CHANGES, DB_CLOSE, DB_COLLATE,
+ DB_COLLATION_NEEDED, DB_COMMIT_HOOK, DB_COMPLETE,
+ DB_COPY, DB_ERRORCODE, DB_EVAL,
+ DB_FUNCTION, DB_LAST_INSERT_ROWID,DB_NULLVALUE,
+ DB_ONECOLUMN, DB_PROFILE, DB_PROGRESS,
+ DB_REKEY, DB_TIMEOUT, DB_TOTAL_CHANGES,
+ DB_TRACE, DB_TRANSACTION, DB_VERSION
+ };
+ /* don't leave trailing commas on DB_enum, it confuses the AIX xlc compiler */
+
+ if( objc<2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "SUBCOMMAND ...");
+ return TCL_ERROR;
+ }
+ if( Tcl_GetIndexFromObj(interp, objv[1], DB_strs, "option", 0, &choice) ){
+ return TCL_ERROR;
+ }
+
+ switch( (enum DB_enum)choice ){
+
+ /* $db authorizer ?CALLBACK?
+ **
+ ** Invoke the given callback to authorize each SQL operation as it is
+ ** compiled. 5 arguments are appended to the callback before it is
+ ** invoked:
+ **
+ ** (1) The authorization type (ex: SQLITE_CREATE_TABLE, SQLITE_INSERT, ...)
+ ** (2) First descriptive name (depends on authorization type)
+ ** (3) Second descriptive name
+ ** (4) Name of the database (ex: "main", "temp")
+ ** (5) Name of trigger that is doing the access
+ **
+ ** The callback should return on of the following strings: SQLITE_OK,
+ ** SQLITE_IGNORE, or SQLITE_DENY. Any other return value is an error.
+ **
+ ** If this method is invoked with no arguments, the current authorization
+ ** callback string is returned.
+ */
+ case DB_AUTHORIZER: {
+#ifdef SQLITE_OMIT_AUTHORIZATION
+ Tcl_AppendResult(interp, "authorization not available in this build", 0);
+ return TCL_ERROR;
+#else
+ if( objc>3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "?CALLBACK?");
+ return TCL_ERROR;
+ }else if( objc==2 ){
+ if( pDb->zAuth ){
+ Tcl_AppendResult(interp, pDb->zAuth, 0);
+ }
+ }else{
+ char *zAuth;
+ int len;
+ if( pDb->zAuth ){
+ Tcl_Free(pDb->zAuth);
+ }
+ zAuth = Tcl_GetStringFromObj(objv[2], &len);
+ if( zAuth && len>0 ){
+ pDb->zAuth = Tcl_Alloc( len + 1 );
+ strcpy(pDb->zAuth, zAuth);
+ }else{
+ pDb->zAuth = 0;
+ }
+ if( pDb->zAuth ){
+ pDb->interp = interp;
+ sqlite3_set_authorizer(pDb->db, auth_callback, pDb);
+ }else{
+ sqlite3_set_authorizer(pDb->db, 0, 0);
+ }
+ }
+#endif
+ break;
+ }
+
+ /* $db busy ?CALLBACK?
+ **
+ ** Invoke the given callback if an SQL statement attempts to open
+ ** a locked database file.
+ */
+ case DB_BUSY: {
+ if( objc>3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "CALLBACK");
+ return TCL_ERROR;
+ }else if( objc==2 ){
+ if( pDb->zBusy ){
+ Tcl_AppendResult(interp, pDb->zBusy, 0);
+ }
+ }else{
+ char *zBusy;
+ int len;
+ if( pDb->zBusy ){
+ Tcl_Free(pDb->zBusy);
+ }
+ zBusy = Tcl_GetStringFromObj(objv[2], &len);
+ if( zBusy && len>0 ){
+ pDb->zBusy = Tcl_Alloc( len + 1 );
+ strcpy(pDb->zBusy, zBusy);
+ }else{
+ pDb->zBusy = 0;
+ }
+ if( pDb->zBusy ){
+ pDb->interp = interp;
+ sqlite3_busy_handler(pDb->db, DbBusyHandler, pDb);
+ }else{
+ sqlite3_busy_handler(pDb->db, 0, 0);
+ }
+ }
+ break;
+ }
+
+ /* $db cache flush
+ ** $db cache size n
+ **
+ ** Flush the prepared statement cache, or set the maximum number of
+ ** cached statements.
+ */
+ case DB_CACHE: {
+ char *subCmd;
+ int n;
+
+ if( objc<=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "cache option ?arg?");
+ return TCL_ERROR;
+ }
+ subCmd = Tcl_GetStringFromObj( objv[2], 0 );
+ if( *subCmd=='f' && strcmp(subCmd,"flush")==0 ){
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "flush");
+ return TCL_ERROR;
+ }else{
+ flushStmtCache( pDb );
+ }
+ }else if( *subCmd=='s' && strcmp(subCmd,"size")==0 ){
+ if( objc!=4 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "size n");
+ return TCL_ERROR;
+ }else{
+ if( TCL_ERROR==Tcl_GetIntFromObj(interp, objv[3], &n) ){
+ Tcl_AppendResult( interp, "cannot convert \"",
+ Tcl_GetStringFromObj(objv[3],0), "\" to integer", 0);
+ return TCL_ERROR;
+ }else{
+ if( n<0 ){
+ flushStmtCache( pDb );
+ n = 0;
+ }else if( n>MAX_PREPARED_STMTS ){
+ n = MAX_PREPARED_STMTS;
+ }
+ pDb->maxStmt = n;
+ }
+ }
+ }else{
+ Tcl_AppendResult( interp, "bad option \"",
+ Tcl_GetStringFromObj(objv[0],0), "\": must be flush or size", 0);
+ return TCL_ERROR;
+ }
+ break;
+ }
+
+ /* $db changes
+ **
+ ** Return the number of rows that were modified, inserted, or deleted by
+ ** the most recent INSERT, UPDATE or DELETE statement, not including
+ ** any changes made by trigger programs.
+ */
+ case DB_CHANGES: {
+ Tcl_Obj *pResult;
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "");
+ return TCL_ERROR;
+ }
+ pResult = Tcl_GetObjResult(interp);
+ Tcl_SetIntObj(pResult, sqlite3_changes(pDb->db));
+ break;
+ }
+
+ /* $db close
+ **
+ ** Shutdown the database
+ */
+ case DB_CLOSE: {
+ Tcl_DeleteCommand(interp, Tcl_GetStringFromObj(objv[0], 0));
+ break;
+ }
+
+ /*
+ ** $db collate NAME SCRIPT
+ **
+ ** Create a new SQL collation function called NAME. Whenever
+ ** that function is called, invoke SCRIPT to evaluate the function.
+ */
+ case DB_COLLATE: {
+ SqlCollate *pCollate;
+ char *zName;
+ char *zScript;
+ int nScript;
+ if( objc!=4 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "NAME SCRIPT");
+ return TCL_ERROR;
+ }
+ zName = Tcl_GetStringFromObj(objv[2], 0);
+ zScript = Tcl_GetStringFromObj(objv[3], &nScript);
+ pCollate = (SqlCollate*)Tcl_Alloc( sizeof(*pCollate) + nScript + 1 );
+ if( pCollate==0 ) return TCL_ERROR;
+ pCollate->interp = interp;
+ pCollate->pNext = pDb->pCollate;
+ pCollate->zScript = (char*)&pCollate[1];
+ pDb->pCollate = pCollate;
+ strcpy(pCollate->zScript, zScript);
+ if( sqlite3_create_collation(pDb->db, zName, SQLITE_UTF8,
+ pCollate, tclSqlCollate) ){
+ Tcl_SetResult(interp, (char *)sqlite3_errmsg(pDb->db), TCL_VOLATILE);
+ return TCL_ERROR;
+ }
+ break;
+ }
+
+ /*
+ ** $db collation_needed SCRIPT
+ **
+ ** Create a new SQL collation function called NAME. Whenever
+ ** that function is called, invoke SCRIPT to evaluate the function.
+ */
+ case DB_COLLATION_NEEDED: {
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "SCRIPT");
+ return TCL_ERROR;
+ }
+ if( pDb->pCollateNeeded ){
+ Tcl_DecrRefCount(pDb->pCollateNeeded);
+ }
+ pDb->pCollateNeeded = Tcl_DuplicateObj(objv[2]);
+ Tcl_IncrRefCount(pDb->pCollateNeeded);
+ sqlite3_collation_needed(pDb->db, pDb, tclCollateNeeded);
+ break;
+ }
+
+ /* $db commit_hook ?CALLBACK?
+ **
+ ** Invoke the given callback just before committing every SQL transaction.
+ ** If the callback throws an exception or returns non-zero, then the
+ ** transaction is aborted. If CALLBACK is an empty string, the callback
+ ** is disabled.
+ */
+ case DB_COMMIT_HOOK: {
+ if( objc>3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "?CALLBACK?");
+ return TCL_ERROR;
+ }else if( objc==2 ){
+ if( pDb->zCommit ){
+ Tcl_AppendResult(interp, pDb->zCommit, 0);
+ }
+ }else{
+ char *zCommit;
+ int len;
+ if( pDb->zCommit ){
+ Tcl_Free(pDb->zCommit);
+ }
+ zCommit = Tcl_GetStringFromObj(objv[2], &len);
+ if( zCommit && len>0 ){
+ pDb->zCommit = Tcl_Alloc( len + 1 );
+ strcpy(pDb->zCommit, zCommit);
+ }else{
+ pDb->zCommit = 0;
+ }
+ if( pDb->zCommit ){
+ pDb->interp = interp;
+ sqlite3_commit_hook(pDb->db, DbCommitHandler, pDb);
+ }else{
+ sqlite3_commit_hook(pDb->db, 0, 0);
+ }
+ }
+ break;
+ }
+
+ /* $db complete SQL
+ **
+ ** Return TRUE if SQL is a complete SQL statement. Return FALSE if
+ ** additional lines of input are needed. This is similar to the
+ ** built-in "info complete" command of Tcl.
+ */
+ case DB_COMPLETE: {
+#ifndef SQLITE_OMIT_COMPLETE
+ Tcl_Obj *pResult;
+ int isComplete;
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "SQL");
+ return TCL_ERROR;
+ }
+ isComplete = sqlite3_complete( Tcl_GetStringFromObj(objv[2], 0) );
+ pResult = Tcl_GetObjResult(interp);
+ Tcl_SetBooleanObj(pResult, isComplete);
+#endif
+ break;
+ }
+
+ /* $db copy conflict-algorithm table filename ?SEPARATOR? ?NULLINDICATOR?
+ **
+ ** Copy data into table from filename, optionally using SEPARATOR
+ ** as column separators. If a column contains a null string, or the
+ ** value of NULLINDICATOR, a NULL is inserted for the column.
+ ** conflict-algorithm is one of the sqlite conflict algorithms:
+ ** rollback, abort, fail, ignore, replace
+ ** On success, return the number of lines processed, not necessarily same
+ ** as 'db changes' due to conflict-algorithm selected.
+ **
+ ** This code is basically an implementation/enhancement of
+ ** the sqlite3 shell.c ".import" command.
+ **
+ ** This command usage is equivalent to the sqlite2.x COPY statement,
+ ** which imports file data into a table using the PostgreSQL COPY file format:
+ ** $db copy $conflit_algo $table_name $filename \t \\N
+ */
+ case DB_COPY: {
+ char *zTable; /* Insert data into this table */
+ char *zFile; /* The file from which to extract data */
+ char *zConflict; /* The conflict algorithm to use */
+ sqlite3_stmt *pStmt; /* A statement */
+ int rc; /* Result code */
+ int nCol; /* Number of columns in the table */
+ int nByte; /* Number of bytes in an SQL string */
+ int i, j; /* Loop counters */
+ int nSep; /* Number of bytes in zSep[] */
+ int nNull; /* Number of bytes in zNull[] */
+ char *zSql; /* An SQL statement */
+ char *zLine; /* A single line of input from the file */
+ char **azCol; /* zLine[] broken up into columns */
+ char *zCommit; /* How to commit changes */
+ FILE *in; /* The input file */
+ int lineno = 0; /* Line number of input file */
+ char zLineNum[80]; /* Line number print buffer */
+ Tcl_Obj *pResult; /* interp result */
+
+ char *zSep;
+ char *zNull;
+ if( objc<5 || objc>7 ){
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "CONFLICT-ALGORITHM TABLE FILENAME ?SEPARATOR? ?NULLINDICATOR?");
+ return TCL_ERROR;
+ }
+ if( objc>=6 ){
+ zSep = Tcl_GetStringFromObj(objv[5], 0);
+ }else{
+ zSep = "\t";
+ }
+ if( objc>=7 ){
+ zNull = Tcl_GetStringFromObj(objv[6], 0);
+ }else{
+ zNull = "";
+ }
+ zConflict = Tcl_GetStringFromObj(objv[2], 0);
+ zTable = Tcl_GetStringFromObj(objv[3], 0);
+ zFile = Tcl_GetStringFromObj(objv[4], 0);
+ nSep = strlen(zSep);
+ nNull = strlen(zNull);
+ if( nSep==0 ){
+ Tcl_AppendResult(interp, "Error: non-null separator required for copy", 0);
+ return TCL_ERROR;
+ }
+ if(sqlite3StrICmp(zConflict, "rollback") != 0 &&
+ sqlite3StrICmp(zConflict, "abort" ) != 0 &&
+ sqlite3StrICmp(zConflict, "fail" ) != 0 &&
+ sqlite3StrICmp(zConflict, "ignore" ) != 0 &&
+ sqlite3StrICmp(zConflict, "replace" ) != 0 ) {
+ Tcl_AppendResult(interp, "Error: \"", zConflict,
+ "\", conflict-algorithm must be one of: rollback, "
+ "abort, fail, ignore, or replace", 0);
+ return TCL_ERROR;
+ }
+ zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable);
+ if( zSql==0 ){
+ Tcl_AppendResult(interp, "Error: no such table: ", zTable, 0);
+ return TCL_ERROR;
+ }
+ nByte = strlen(zSql);
+ rc = sqlite3_prepare(pDb->db, zSql, 0, &pStmt, 0);
+ sqlite3_free(zSql);
+ if( rc ){
+ Tcl_AppendResult(interp, "Error: ", sqlite3_errmsg(pDb->db), 0);
+ nCol = 0;
+ }else{
+ nCol = sqlite3_column_count(pStmt);
+ }
+ sqlite3_finalize(pStmt);
+ if( nCol==0 ) {
+ return TCL_ERROR;
+ }
+ zSql = malloc( nByte + 50 + nCol*2 );
+ if( zSql==0 ) {
+ Tcl_AppendResult(interp, "Error: can't malloc()", 0);
+ return TCL_ERROR;
+ }
+ sqlite3_snprintf(nByte+50, zSql, "INSERT OR %q INTO '%q' VALUES(?",
+ zConflict, zTable);
+ j = strlen(zSql);
+ for(i=1; i<nCol; i++){
+ zSql[j++] = ',';
+ zSql[j++] = '?';
+ }
+ zSql[j++] = ')';
+ zSql[j] = 0;
+ rc = sqlite3_prepare(pDb->db, zSql, 0, &pStmt, 0);
+ free(zSql);
+ if( rc ){
+ Tcl_AppendResult(interp, "Error: ", sqlite3_errmsg(pDb->db), 0);
+ sqlite3_finalize(pStmt);
+ return TCL_ERROR;
+ }
+ in = fopen(zFile, "rb");
+ if( in==0 ){
+ Tcl_AppendResult(interp, "Error: cannot open file: ", zFile, NULL);
+ sqlite3_finalize(pStmt);
+ return TCL_ERROR;
+ }
+ azCol = malloc( sizeof(azCol[0])*(nCol+1) );
+ if( azCol==0 ) {
+ Tcl_AppendResult(interp, "Error: can't malloc()", 0);
+ return TCL_ERROR;
+ }
+ sqlite3_exec(pDb->db, "BEGIN", 0, 0, 0);
+ zCommit = "COMMIT";
+ while( (zLine = local_getline(0, in))!=0 ){
+ char *z;
+ i = 0;
+ lineno++;
+ azCol[0] = zLine;
+ for(i=0, z=zLine; *z; z++){
+ if( *z==zSep[0] && strncmp(z, zSep, nSep)==0 ){
+ *z = 0;
+ i++;
+ if( i<nCol ){
+ azCol[i] = &z[nSep];
+ z += nSep-1;
+ }
+ }
+ }
+ if( i+1!=nCol ){
+ char *zErr;
+ zErr = malloc(200 + strlen(zFile));
+ sprintf(zErr,"Error: %s line %d: expected %d columns of data but found %d",
+ zFile, lineno, nCol, i+1);
+ Tcl_AppendResult(interp, zErr, 0);
+ free(zErr);
+ zCommit = "ROLLBACK";
+ break;
+ }
+ for(i=0; i<nCol; i++){
+ /* check for null data, if so, bind as null */
+ if ((nNull>0 && strcmp(azCol[i], zNull)==0) || strlen(azCol[i])==0) {
+ sqlite3_bind_null(pStmt, i+1);
+ }else{
+ sqlite3_bind_text(pStmt, i+1, azCol[i], -1, SQLITE_STATIC);
+ }
+ }
+ sqlite3_step(pStmt);
+ rc = sqlite3_reset(pStmt);
+ free(zLine);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp,"Error: ", sqlite3_errmsg(pDb->db), 0);
+ zCommit = "ROLLBACK";
+ break;
+ }
+ }
+ free(azCol);
+ fclose(in);
+ sqlite3_finalize(pStmt);
+ sqlite3_exec(pDb->db, zCommit, 0, 0, 0);
+
+ if( zCommit[0] == 'C' ){
+ /* success, set result as number of lines processed */
+ pResult = Tcl_GetObjResult(interp);
+ Tcl_SetIntObj(pResult, lineno);
+ rc = TCL_OK;
+ }else{
+ /* failure, append lineno where failed */
+ sprintf(zLineNum,"%d",lineno);
+ Tcl_AppendResult(interp,", failed while processing line: ",zLineNum,0);
+ rc = TCL_ERROR;
+ }
+ break;
+ }
+
+ /*
+ ** $db errorcode
+ **
+ ** Return the numeric error code that was returned by the most recent
+ ** call to sqlite3_exec().
+ */
+ case DB_ERRORCODE: {
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_errcode(pDb->db)));
+ break;
+ }
+
+ /*
+ ** $db eval $sql ?array? ?{ ...code... }?
+ ** $db onecolumn $sql
+ **
+ ** The SQL statement in $sql is evaluated. For each row, the values are
+ ** placed in elements of the array named "array" and ...code... is executed.
+ ** If "array" and "code" are omitted, then no callback is every invoked.
+ ** If "array" is an empty string, then the values are placed in variables
+ ** that have the same name as the fields extracted by the query.
+ **
+ ** The onecolumn method is the equivalent of:
+ ** lindex [$db eval $sql] 0
+ */
+ case DB_ONECOLUMN:
+ case DB_EVAL: {
+ char const *zSql; /* Next SQL statement to execute */
+ char const *zLeft; /* What is left after first stmt in zSql */
+ sqlite3_stmt *pStmt; /* Compiled SQL statment */
+ Tcl_Obj *pArray; /* Name of array into which results are written */
+ Tcl_Obj *pScript; /* Script to run for each result set */
+ Tcl_Obj **apParm; /* Parameters that need a Tcl_DecrRefCount() */
+ int nParm; /* Number of entries used in apParm[] */
+ Tcl_Obj *aParm[10]; /* Static space for apParm[] in the common case */
+ Tcl_Obj *pRet; /* Value to be returned */
+ SqlPreparedStmt *pPreStmt; /* Pointer to a prepared statement */
+ int rc2;
+
+ if( choice==DB_ONECOLUMN ){
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "SQL");
+ return TCL_ERROR;
+ }
+ pRet = 0;
+ }else{
+ if( objc<3 || objc>5 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "SQL ?ARRAY-NAME? ?SCRIPT?");
+ return TCL_ERROR;
+ }
+ pRet = Tcl_NewObj();
+ Tcl_IncrRefCount(pRet);
+ }
+ if( objc==3 ){
+ pArray = pScript = 0;
+ }else if( objc==4 ){
+ pArray = 0;
+ pScript = objv[3];
+ }else{
+ pArray = objv[3];
+ if( Tcl_GetString(pArray)[0]==0 ) pArray = 0;
+ pScript = objv[4];
+ }
+
+ Tcl_IncrRefCount(objv[2]);
+ zSql = Tcl_GetStringFromObj(objv[2], 0);
+ while( rc==TCL_OK && zSql[0] ){
+ int i; /* Loop counter */
+ int nVar; /* Number of bind parameters in the pStmt */
+ int nCol; /* Number of columns in the result set */
+ Tcl_Obj **apColName = 0; /* Array of column names */
+ int len; /* String length of zSql */
+
+ /* Try to find a SQL statement that has already been compiled and
+ ** which matches the next sequence of SQL.
+ */
+ pStmt = 0;
+ pPreStmt = pDb->stmtList;
+ len = strlen(zSql);
+ if( pPreStmt && sqlite3_expired(pPreStmt->pStmt) ){
+ flushStmtCache(pDb);
+ pPreStmt = 0;
+ }
+ for(; pPreStmt; pPreStmt=pPreStmt->pNext){
+ int n = pPreStmt->nSql;
+ if( len>=n
+ && memcmp(pPreStmt->zSql, zSql, n)==0
+ && (zSql[n]==0 || zSql[n-1]==';')
+ ){
+ pStmt = pPreStmt->pStmt;
+ zLeft = &zSql[pPreStmt->nSql];
+
+ /* When a prepared statement is found, unlink it from the
+ ** cache list. It will later be added back to the beginning
+ ** of the cache list in order to implement LRU replacement.
+ */
+ if( pPreStmt->pPrev ){
+ pPreStmt->pPrev->pNext = pPreStmt->pNext;
+ }else{
+ pDb->stmtList = pPreStmt->pNext;
+ }
+ if( pPreStmt->pNext ){
+ pPreStmt->pNext->pPrev = pPreStmt->pPrev;
+ }else{
+ pDb->stmtLast = pPreStmt->pPrev;
+ }
+ pDb->nStmt--;
+ break;
+ }
+ }
+
+ /* If no prepared statement was found. Compile the SQL text
+ */
+ if( pStmt==0 ){
+ if( SQLITE_OK!=sqlite3_prepare(pDb->db, zSql, -1, &pStmt, &zLeft) ){
+ Tcl_SetObjResult(interp, dbTextToObj(sqlite3_errmsg(pDb->db)));
+ rc = TCL_ERROR;
+ break;
+ }
+ if( pStmt==0 ){
+ if( SQLITE_OK!=sqlite3_errcode(pDb->db) ){
+ /* A compile-time error in the statement
+ */
+ Tcl_SetObjResult(interp, dbTextToObj(sqlite3_errmsg(pDb->db)));
+ rc = TCL_ERROR;
+ break;
+ }else{
+ /* The statement was a no-op. Continue to the next statement
+ ** in the SQL string.
+ */
+ zSql = zLeft;
+ continue;
+ }
+ }
+ assert( pPreStmt==0 );
+ }
+
+ /* Bind values to parameters that begin with $ or :
+ */
+ nVar = sqlite3_bind_parameter_count(pStmt);
+ nParm = 0;
+ if( nVar>sizeof(aParm)/sizeof(aParm[0]) ){
+ apParm = (Tcl_Obj**)Tcl_Alloc(nVar*sizeof(apParm[0]));
+ }else{
+ apParm = aParm;
+ }
+ for(i=1; i<=nVar; i++){
+ const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
+ if( zVar!=0 && (zVar[0]=='$' || zVar[0]==':') ){
+ Tcl_Obj *pVar = Tcl_GetVar2Ex(interp, &zVar[1], 0, 0);
+ if( pVar ){
+ int n;
+ u8 *data;
+ char *zType = pVar->typePtr ? pVar->typePtr->name : "";
+ char c = zType[0];
+ if( c=='b' && strcmp(zType,"bytearray")==0 && pVar->bytes==0 ){
+ /* Only load a BLOB type if the Tcl variable is a bytearray and
+ ** has no string representation. */
+ data = Tcl_GetByteArrayFromObj(pVar, &n);
+ sqlite3_bind_blob(pStmt, i, data, n, SQLITE_STATIC);
+ Tcl_IncrRefCount(pVar);
+ apParm[nParm++] = pVar;
+ }else if( (c=='b' && strcmp(zType,"boolean")==0) ||
+ (c=='i' && strcmp(zType,"int")==0) ){
+ Tcl_GetIntFromObj(interp, pVar, &n);
+ sqlite3_bind_int(pStmt, i, n);
+ }else if( c=='d' && strcmp(zType,"double")==0 ){
+ double r;
+ Tcl_GetDoubleFromObj(interp, pVar, &r);
+ sqlite3_bind_double(pStmt, i, r);
+ }else if( c=='w' && strcmp(zType,"wideInt")==0 ){
+ Tcl_WideInt v;
+ Tcl_GetWideIntFromObj(interp, pVar, &v);
+ sqlite3_bind_int64(pStmt, i, v);
+ }else{
+ data = Tcl_GetStringFromObj(pVar, &n);
+ sqlite3_bind_text(pStmt, i, data, n, SQLITE_STATIC);
+ Tcl_IncrRefCount(pVar);
+ apParm[nParm++] = pVar;
+ }
+ }else{
+ sqlite3_bind_null( pStmt, i );
+ }
+ }
+ }
+
+ /* Compute column names */
+ nCol = sqlite3_column_count(pStmt);
+ if( pScript ){
+ apColName = (Tcl_Obj**)Tcl_Alloc( sizeof(Tcl_Obj*)*nCol );
+ if( apColName==0 ) break;
+ for(i=0; i<nCol; i++){
+ apColName[i] = dbTextToObj(sqlite3_column_name(pStmt,i));
+ Tcl_IncrRefCount(apColName[i]);
+ }
+ }
+
+ /* If results are being stored in an array variable, then create
+ ** the array(*) entry for that array
+ */
+ if( pArray ){
+ Tcl_Obj *pColList = Tcl_NewObj();
+ Tcl_Obj *pStar = Tcl_NewStringObj("*", -1);
+ Tcl_IncrRefCount(pColList);
+ for(i=0; i<nCol; i++){
+ Tcl_ListObjAppendElement(interp, pColList, apColName[i]);
+ }
+ Tcl_ObjSetVar2(interp, pArray, pStar, pColList,0);
+ Tcl_DecrRefCount(pColList);
+ Tcl_DecrRefCount(pStar);
+ }
+
+ /* Execute the SQL
+ */
+ while( rc==TCL_OK && pStmt && SQLITE_ROW==sqlite3_step(pStmt) ){
+ for(i=0; i<nCol; i++){
+ Tcl_Obj *pVal;
+
+ /* Set pVal to contain the i'th column of this row. */
+ switch( sqlite3_column_type(pStmt, i) ){
+ case SQLITE_BLOB: {
+ int bytes = sqlite3_column_bytes(pStmt, i);
+ pVal = Tcl_NewByteArrayObj(sqlite3_column_blob(pStmt, i), bytes);
+ break;
+ }
+ case SQLITE_INTEGER: {
+ sqlite_int64 v = sqlite3_column_int64(pStmt, i);
+ if( v>=-2147483647 && v<=2147483647 ){
+ pVal = Tcl_NewIntObj(v);
+ }else{
+ pVal = Tcl_NewWideIntObj(v);
+ }
+ break;
+ }
+ case SQLITE_FLOAT: {
+ double r = sqlite3_column_double(pStmt, i);
+ pVal = Tcl_NewDoubleObj(r);
+ break;
+ }
+ case SQLITE_NULL: {
+ pVal = dbTextToObj(pDb->zNull);
+ break;
+ }
+ default: {
+ pVal = dbTextToObj(sqlite3_column_text(pStmt, i));
+ break;
+ }
+ }
+
+ if( pScript ){
+ if( pArray==0 ){
+ Tcl_ObjSetVar2(interp, apColName[i], 0, pVal, 0);
+ }else{
+ Tcl_ObjSetVar2(interp, pArray, apColName[i], pVal, 0);
+ }
+ }else if( choice==DB_ONECOLUMN ){
+ if( pRet==0 ){
+ pRet = pVal;
+ Tcl_IncrRefCount(pRet);
+ }
+ rc = TCL_BREAK;
+ }else{
+ Tcl_ListObjAppendElement(interp, pRet, pVal);
+ }
+ }
+
+ if( pScript ){
+ rc = Tcl_EvalObjEx(interp, pScript, 0);
+ if( rc==TCL_CONTINUE ){
+ rc = TCL_OK;
+ }
+ }
+ }
+ if( rc==TCL_BREAK ){
+ rc = TCL_OK;
+ }
+
+ /* Free the column name objects */
+ if( pScript ){
+ for(i=0; i<nCol; i++){
+ Tcl_DecrRefCount(apColName[i]);
+ }
+ Tcl_Free((char*)apColName);
+ }
+
+ /* Free the bound string and blob parameters */
+ for(i=0; i<nParm; i++){
+ Tcl_DecrRefCount(apParm[i]);
+ }
+ if( apParm!=aParm ){
+ Tcl_Free((char*)apParm);
+ }
+
+ /* Reset the statement. If the result code is SQLITE_SCHEMA, then
+ ** flush the statement cache and try the statement again.
+ */
+ rc2 = sqlite3_reset(pStmt);
+ if( SQLITE_SCHEMA==rc2 ){
+ /* After a schema change, flush the cache and try to run the
+ ** statement again
+ */
+ flushStmtCache( pDb );
+ sqlite3_finalize(pStmt);
+ if( pPreStmt ) Tcl_Free((char*)pPreStmt);
+ continue;
+ }else if( SQLITE_OK!=rc2 ){
+ /* If a run-time error occurs, report the error and stop reading
+ ** the SQL
+ */
+ Tcl_SetObjResult(interp, dbTextToObj(sqlite3_errmsg(pDb->db)));
+ sqlite3_finalize(pStmt);
+ rc = TCL_ERROR;
+ if( pPreStmt ) Tcl_Free((char*)pPreStmt);
+ break;
+ }else if( pDb->maxStmt<=0 ){
+ /* If the cache is turned off, deallocated the statement */
+ if( pPreStmt ) Tcl_Free((char*)pPreStmt);
+ sqlite3_finalize(pStmt);
+ }else{
+ /* Everything worked and the cache is operational.
+ ** Create a new SqlPreparedStmt structure if we need one.
+ ** (If we already have one we can just reuse it.)
+ */
+ if( pPreStmt==0 ){
+ len = zLeft - zSql;
+ pPreStmt = (SqlPreparedStmt*)Tcl_Alloc( sizeof(*pPreStmt) + len );
+ if( pPreStmt==0 ) return TCL_ERROR;
+ pPreStmt->pStmt = pStmt;
+ pPreStmt->nSql = len;
+ memcpy(pPreStmt->zSql, zSql, len);
+ pPreStmt->zSql[len] = 0;
+ }
+
+ /* Add the prepared statement to the beginning of the cache list
+ */
+ pPreStmt->pNext = pDb->stmtList;
+ pPreStmt->pPrev = 0;
+ if( pDb->stmtList ){
+ pDb->stmtList->pPrev = pPreStmt;
+ }
+ pDb->stmtList = pPreStmt;
+ if( pDb->stmtLast==0 ){
+ assert( pDb->nStmt==0 );
+ pDb->stmtLast = pPreStmt;
+ }else{
+ assert( pDb->nStmt>0 );
+ }
+ pDb->nStmt++;
+
+ /* If we have too many statement in cache, remove the surplus from the
+ ** end of the cache list.
+ */
+ while( pDb->nStmt>pDb->maxStmt ){
+ sqlite3_finalize(pDb->stmtLast->pStmt);
+ pDb->stmtLast = pDb->stmtLast->pPrev;
+ Tcl_Free((char*)pDb->stmtLast->pNext);
+ pDb->stmtLast->pNext = 0;
+ pDb->nStmt--;
+ }
+ }
+
+ /* Proceed to the next statement */
+ zSql = zLeft;
+ }
+ Tcl_DecrRefCount(objv[2]);
+
+ if( pRet ){
+ if( rc==TCL_OK ){
+ Tcl_SetObjResult(interp, pRet);
+ }
+ Tcl_DecrRefCount(pRet);
+ }
+ break;
+ }
+
+ /*
+ ** $db function NAME SCRIPT
+ **
+ ** Create a new SQL function called NAME. Whenever that function is
+ ** called, invoke SCRIPT to evaluate the function.
+ */
+ case DB_FUNCTION: {
+ SqlFunc *pFunc;
+ Tcl_Obj *pScript;
+ char *zName;
+ if( objc!=4 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "NAME SCRIPT");
+ return TCL_ERROR;
+ }
+ zName = Tcl_GetStringFromObj(objv[2], 0);
+ pScript = objv[3];
+ pFunc = findSqlFunc(pDb, zName);
+ if( pFunc==0 ) return TCL_ERROR;
+ if( pFunc->pScript ){
+ Tcl_DecrRefCount(pFunc->pScript);
+ }
+ pFunc->pScript = pScript;
+ Tcl_IncrRefCount(pScript);
+ pFunc->useEvalObjv = safeToUseEvalObjv(interp, pScript);
+ rc = sqlite3_create_function(pDb->db, zName, -1, SQLITE_UTF8,
+ pFunc, tclSqlFunc, 0, 0);
+ if( rc!=SQLITE_OK ){
+ rc = TCL_ERROR;
+ Tcl_SetResult(interp, (char *)sqlite3_errmsg(pDb->db), TCL_VOLATILE);
+ }else{
+ /* Must flush any cached statements */
+ flushStmtCache( pDb );
+ }
+ break;
+ }
+
+ /*
+ ** $db nullvalue ?STRING?
+ **
+ ** Change text used when a NULL comes back from the database. If ?STRING?
+ ** is not present, then the current string used for NULL is returned.
+ ** If STRING is present, then STRING is returned.
+ **
+ */
+ case DB_NULLVALUE: {
+ if( objc!=2 && objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "NULLVALUE");
+ return TCL_ERROR;
+ }
+ if( objc==3 ){
+ int len;
+ char *zNull = Tcl_GetStringFromObj(objv[2], &len);
+ if( pDb->zNull ){
+ Tcl_Free(pDb->zNull);
+ }
+ if( zNull && len>0 ){
+ pDb->zNull = Tcl_Alloc( len + 1 );
+ strncpy(pDb->zNull, zNull, len);
+ pDb->zNull[len] = '\0';
+ }else{
+ pDb->zNull = 0;
+ }
+ }
+ Tcl_SetObjResult(interp, dbTextToObj(pDb->zNull));
+ break;
+ }
+
+ /*
+ ** $db last_insert_rowid
+ **
+ ** Return an integer which is the ROWID for the most recent insert.
+ */
+ case DB_LAST_INSERT_ROWID: {
+ Tcl_Obj *pResult;
+ int rowid;
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "");
+ return TCL_ERROR;
+ }
+ rowid = sqlite3_last_insert_rowid(pDb->db);
+ pResult = Tcl_GetObjResult(interp);
+ Tcl_SetIntObj(pResult, rowid);
+ break;
+ }
+
+ /*
+ ** The DB_ONECOLUMN method is implemented together with DB_EVAL.
+ */
+
+ /* $db progress ?N CALLBACK?
+ **
+ ** Invoke the given callback every N virtual machine opcodes while executing
+ ** queries.
+ */
+ case DB_PROGRESS: {
+ if( objc==2 ){
+ if( pDb->zProgress ){
+ Tcl_AppendResult(interp, pDb->zProgress, 0);
+ }
+ }else if( objc==4 ){
+ char *zProgress;
+ int len;
+ int N;
+ if( TCL_OK!=Tcl_GetIntFromObj(interp, objv[2], &N) ){
+ return TCL_ERROR;
+ };
+ if( pDb->zProgress ){
+ Tcl_Free(pDb->zProgress);
+ }
+ zProgress = Tcl_GetStringFromObj(objv[3], &len);
+ if( zProgress && len>0 ){
+ pDb->zProgress = Tcl_Alloc( len + 1 );
+ strcpy(pDb->zProgress, zProgress);
+ }else{
+ pDb->zProgress = 0;
+ }
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
+ if( pDb->zProgress ){
+ pDb->interp = interp;
+ sqlite3_progress_handler(pDb->db, N, DbProgressHandler, pDb);
+ }else{
+ sqlite3_progress_handler(pDb->db, 0, 0, 0);
+ }
+#endif
+ }else{
+ Tcl_WrongNumArgs(interp, 2, objv, "N CALLBACK");
+ return TCL_ERROR;
+ }
+ break;
+ }
+
+ /* $db profile ?CALLBACK?
+ **
+ ** Make arrangements to invoke the CALLBACK routine after each SQL statement
+ ** that has run. The text of the SQL and the amount of elapse time are
+ ** appended to CALLBACK before the script is run.
+ */
+ case DB_PROFILE: {
+ if( objc>3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "?CALLBACK?");
+ return TCL_ERROR;
+ }else if( objc==2 ){
+ if( pDb->zProfile ){
+ Tcl_AppendResult(interp, pDb->zProfile, 0);
+ }
+ }else{
+ char *zProfile;
+ int len;
+ if( pDb->zProfile ){
+ Tcl_Free(pDb->zProfile);
+ }
+ zProfile = Tcl_GetStringFromObj(objv[2], &len);
+ if( zProfile && len>0 ){
+ pDb->zProfile = Tcl_Alloc( len + 1 );
+ strcpy(pDb->zProfile, zProfile);
+ }else{
+ pDb->zProfile = 0;
+ }
+#ifndef SQLITE_OMIT_TRACE
+ if( pDb->zProfile ){
+ pDb->interp = interp;
+ sqlite3_profile(pDb->db, DbProfileHandler, pDb);
+ }else{
+ sqlite3_profile(pDb->db, 0, 0);
+ }
+#endif
+ }
+ break;
+ }
+
+ /*
+ ** $db rekey KEY
+ **
+ ** Change the encryption key on the currently open database.
+ */
+ case DB_REKEY: {
+ int nKey;
+ void *pKey;
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "KEY");
+ return TCL_ERROR;
+ }
+ pKey = Tcl_GetByteArrayFromObj(objv[2], &nKey);
+#ifdef SQLITE_HAS_CODEC
+ rc = sqlite3_rekey(pDb->db, pKey, nKey);
+ if( rc ){
+ Tcl_AppendResult(interp, sqlite3ErrStr(rc), 0);
+ rc = TCL_ERROR;
+ }
+#endif
+ break;
+ }
+
+ /*
+ ** $db timeout MILLESECONDS
+ **
+ ** Delay for the number of milliseconds specified when a file is locked.
+ */
+ case DB_TIMEOUT: {
+ int ms;
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "MILLISECONDS");
+ return TCL_ERROR;
+ }
+ if( Tcl_GetIntFromObj(interp, objv[2], &ms) ) return TCL_ERROR;
+ sqlite3_busy_timeout(pDb->db, ms);
+ break;
+ }
+
+ /*
+ ** $db total_changes
+ **
+ ** Return the number of rows that were modified, inserted, or deleted
+ ** since the database handle was created.
+ */
+ case DB_TOTAL_CHANGES: {
+ Tcl_Obj *pResult;
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "");
+ return TCL_ERROR;
+ }
+ pResult = Tcl_GetObjResult(interp);
+ Tcl_SetIntObj(pResult, sqlite3_total_changes(pDb->db));
+ break;
+ }
+
+ /* $db trace ?CALLBACK?
+ **
+ ** Make arrangements to invoke the CALLBACK routine for each SQL statement
+ ** that is executed. The text of the SQL is appended to CALLBACK before
+ ** it is executed.
+ */
+ case DB_TRACE: {
+ if( objc>3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "?CALLBACK?");
+ return TCL_ERROR;
+ }else if( objc==2 ){
+ if( pDb->zTrace ){
+ Tcl_AppendResult(interp, pDb->zTrace, 0);
+ }
+ }else{
+ char *zTrace;
+ int len;
+ if( pDb->zTrace ){
+ Tcl_Free(pDb->zTrace);
+ }
+ zTrace = Tcl_GetStringFromObj(objv[2], &len);
+ if( zTrace && len>0 ){
+ pDb->zTrace = Tcl_Alloc( len + 1 );
+ strcpy(pDb->zTrace, zTrace);
+ }else{
+ pDb->zTrace = 0;
+ }
+#ifndef SQLITE_OMIT_TRACE
+ if( pDb->zTrace ){
+ pDb->interp = interp;
+ sqlite3_trace(pDb->db, DbTraceHandler, pDb);
+ }else{
+ sqlite3_trace(pDb->db, 0, 0);
+ }
+#endif
+ }
+ break;
+ }
+
+ /* $db transaction [-deferred|-immediate|-exclusive] SCRIPT
+ **
+ ** Start a new transaction (if we are not already in the midst of a
+ ** transaction) and execute the TCL script SCRIPT. After SCRIPT
+ ** completes, either commit the transaction or roll it back if SCRIPT
+ ** throws an exception. Or if no new transation was started, do nothing.
+ ** pass the exception on up the stack.
+ **
+ ** This command was inspired by Dave Thomas's talk on Ruby at the
+ ** 2005 O'Reilly Open Source Convention (OSCON).
+ */
+ case DB_TRANSACTION: {
+ int inTrans;
+ Tcl_Obj *pScript;
+ const char *zBegin = "BEGIN";
+ if( objc!=3 && objc!=4 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "[TYPE] SCRIPT");
+ return TCL_ERROR;
+ }
+ if( objc==3 ){
+ pScript = objv[2];
+ } else {
+ static const char *TTYPE_strs[] = {
+ "deferred", "exclusive", "immediate", 0
+ };
+ enum TTYPE_enum {
+ TTYPE_DEFERRED, TTYPE_EXCLUSIVE, TTYPE_IMMEDIATE
+ };
+ int ttype;
+ if( Tcl_GetIndexFromObj(interp, objv[2], TTYPE_strs, "transaction type",
+ 0, &ttype) ){
+ return TCL_ERROR;
+ }
+ switch( (enum TTYPE_enum)ttype ){
+ case TTYPE_DEFERRED: /* no-op */; break;
+ case TTYPE_EXCLUSIVE: zBegin = "BEGIN EXCLUSIVE"; break;
+ case TTYPE_IMMEDIATE: zBegin = "BEGIN IMMEDIATE"; break;
+ }
+ pScript = objv[3];
+ }
+ inTrans = !sqlite3_get_autocommit(pDb->db);
+ if( !inTrans ){
+ sqlite3_exec(pDb->db, zBegin, 0, 0, 0);
+ }
+ rc = Tcl_EvalObjEx(interp, pScript, 0);
+ if( !inTrans ){
+ const char *zEnd;
+ if( rc==TCL_ERROR ){
+ zEnd = "ROLLBACK";
+ } else {
+ zEnd = "COMMIT";
+ }
+ sqlite3_exec(pDb->db, zEnd, 0, 0, 0);
+ }
+ break;
+ }
+
+ /* $db version
+ **
+ ** Return the version string for this database.
+ */
+ case DB_VERSION: {
+ Tcl_SetResult(interp, (char *)sqlite3_libversion(), TCL_STATIC);
+ break;
+ }
+
+
+ } /* End of the SWITCH statement */
+ return rc;
+}
+
+/*
+** sqlite3 DBNAME FILENAME ?MODE? ?-key KEY?
+**
+** This is the main Tcl command. When the "sqlite" Tcl command is
+** invoked, this routine runs to process that command.
+**
+** The first argument, DBNAME, is an arbitrary name for a new
+** database connection. This command creates a new command named
+** DBNAME that is used to control that connection. The database
+** connection is deleted when the DBNAME command is deleted.
+**
+** The second argument is the name of the directory that contains
+** the sqlite database that is to be accessed.
+**
+** For testing purposes, we also support the following:
+**
+** sqlite3 -encoding
+**
+** Return the encoding used by LIKE and GLOB operators. Choices
+** are UTF-8 and iso8859.
+**
+** sqlite3 -version
+**
+** Return the version number of the SQLite library.
+**
+** sqlite3 -tcl-uses-utf
+**
+** Return "1" if compiled with a Tcl uses UTF-8. Return "0" if
+** not. Used by tests to make sure the library was compiled
+** correctly.
+*/
+static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
+ SqliteDb *p;
+ void *pKey = 0;
+ int nKey = 0;
+ const char *zArg;
+ char *zErrMsg;
+ const char *zFile;
+ char zBuf[80];
+ if( objc==2 ){
+ zArg = Tcl_GetStringFromObj(objv[1], 0);
+ if( strcmp(zArg,"-version")==0 ){
+ Tcl_AppendResult(interp,sqlite3_version,0);
+ return TCL_OK;
+ }
+ if( strcmp(zArg,"-has-codec")==0 ){
+#ifdef SQLITE_HAS_CODEC
+ Tcl_AppendResult(interp,"1",0);
+#else
+ Tcl_AppendResult(interp,"0",0);
+#endif
+ return TCL_OK;
+ }
+ if( strcmp(zArg,"-tcl-uses-utf")==0 ){
+#ifdef TCL_UTF_MAX
+ Tcl_AppendResult(interp,"1",0);
+#else
+ Tcl_AppendResult(interp,"0",0);
+#endif
+ return TCL_OK;
+ }
+ }
+ if( objc==5 || objc==6 ){
+ zArg = Tcl_GetStringFromObj(objv[objc-2], 0);
+ if( strcmp(zArg,"-key")==0 ){
+ pKey = Tcl_GetByteArrayFromObj(objv[objc-1], &nKey);
+ objc -= 2;
+ }
+ }
+ if( objc!=3 && objc!=4 ){
+ Tcl_WrongNumArgs(interp, 1, objv,
+#ifdef SQLITE_HAS_CODEC
+ "HANDLE FILENAME ?-key CODEC-KEY?"
+#else
+ "HANDLE FILENAME ?MODE?"
+#endif
+ );
+ return TCL_ERROR;
+ }
+ zErrMsg = 0;
+ p = (SqliteDb*)Tcl_Alloc( sizeof(*p) );
+ if( p==0 ){
+ Tcl_SetResult(interp, "malloc failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ memset(p, 0, sizeof(*p));
+ zFile = Tcl_GetStringFromObj(objv[2], 0);
+ sqlite3_open(zFile, &p->db);
+ if( SQLITE_OK!=sqlite3_errcode(p->db) ){
+ zErrMsg = strdup(sqlite3_errmsg(p->db));
+ sqlite3_close(p->db);
+ p->db = 0;
+ }
+#ifdef SQLITE_HAS_CODEC
+ sqlite3_key(p->db, pKey, nKey);
+#endif
+ if( p->db==0 ){
+ Tcl_SetResult(interp, zErrMsg, TCL_VOLATILE);
+ Tcl_Free((char*)p);
+ free(zErrMsg);
+ return TCL_ERROR;
+ }
+ p->maxStmt = NUM_PREPARED_STMTS;
+ zArg = Tcl_GetStringFromObj(objv[1], 0);
+ Tcl_CreateObjCommand(interp, zArg, DbObjCmd, (char*)p, DbDeleteCmd);
+
+ /* The return value is the value of the sqlite* pointer
+ */
+ sprintf(zBuf, "%p", p->db);
+ if( strncmp(zBuf,"0x",2) ){
+ sprintf(zBuf, "0x%p", p->db);
+ }
+ Tcl_AppendResult(interp, zBuf, 0);
+
+ /* If compiled with SQLITE_TEST turned on, then register the "md5sum"
+ ** SQL function.
+ */
+#ifdef SQLITE_TEST
+ {
+ extern void Md5_Register(sqlite3*);
+#ifdef SQLITE_MEMDEBUG
+ int mallocfail = sqlite3_iMallocFail;
+ sqlite3_iMallocFail = 0;
+#endif
+ Md5_Register(p->db);
+#ifdef SQLITE_MEMDEBUG
+ sqlite3_iMallocFail = mallocfail;
+#endif
+ }
+#endif
+ p->interp = interp;
+ return TCL_OK;
+}
+
+/*
+** Provide a dummy Tcl_InitStubs if we are using this as a static
+** library.
+*/
+#ifndef USE_TCL_STUBS
+# undef Tcl_InitStubs
+# define Tcl_InitStubs(a,b,c)
+#endif
+
+/*
+** Initialize this module.
+**
+** This Tcl module contains only a single new Tcl command named "sqlite".
+** (Hence there is no namespace. There is no point in using a namespace
+** if the extension only supplies one new name!) The "sqlite" command is
+** used to open a new SQLite database. See the DbMain() routine above
+** for additional information.
+*/
+int Sqlite3_Init(Tcl_Interp *interp){
+ Tcl_InitStubs(interp, "8.4", 0);
+ Tcl_CreateObjCommand(interp, "sqlite3", (Tcl_ObjCmdProc*)DbMain, 0, 0);
+ Tcl_PkgProvide(interp, "sqlite3", "3.0");
+ Tcl_CreateObjCommand(interp, "sqlite", (Tcl_ObjCmdProc*)DbMain, 0, 0);
+ Tcl_PkgProvide(interp, "sqlite", "3.0");
+ return TCL_OK;
+}
+int Tclsqlite3_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); }
+int Sqlite3_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
+int Tclsqlite3_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
+
+#ifndef SQLITE_3_SUFFIX_ONLY
+int Sqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); }
+int Tclsqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); }
+int Sqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
+int Tclsqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
+#endif
+
+#ifdef TCLSH
+/*****************************************************************************
+** The code that follows is used to build standalone TCL interpreters
+*/
+
+/*
+** If the macro TCLSH is one, then put in code this for the
+** "main" routine that will initialize Tcl and take input from
+** standard input.
+*/
+#if TCLSH==1
+static char zMainloop[] =
+ "set line {}\n"
+ "while {![eof stdin]} {\n"
+ "if {$line!=\"\"} {\n"
+ "puts -nonewline \"> \"\n"
+ "} else {\n"
+ "puts -nonewline \"% \"\n"
+ "}\n"
+ "flush stdout\n"
+ "append line [gets stdin]\n"
+ "if {[info complete $line]} {\n"
+ "if {[catch {uplevel #0 $line} result]} {\n"
+ "puts stderr \"Error: $result\"\n"
+ "} elseif {$result!=\"\"} {\n"
+ "puts $result\n"
+ "}\n"
+ "set line {}\n"
+ "} else {\n"
+ "append line \\n\n"
+ "}\n"
+ "}\n"
+;
+#endif
+
+/*
+** If the macro TCLSH is two, then get the main loop code out of
+** the separate file "spaceanal_tcl.h".
+*/
+#if TCLSH==2
+static char zMainloop[] =
+#include "spaceanal_tcl.h"
+;
+#endif
+
+#define TCLSH_MAIN main /* Needed to fake out mktclapp */
+int TCLSH_MAIN(int argc, char **argv){
+ Tcl_Interp *interp;
+ Tcl_FindExecutable(argv[0]);
+ interp = Tcl_CreateInterp();
+ Sqlite3_Init(interp);
+#ifdef SQLITE_TEST
+ {
+ extern int Sqlitetest1_Init(Tcl_Interp*);
+ extern int Sqlitetest2_Init(Tcl_Interp*);
+ extern int Sqlitetest3_Init(Tcl_Interp*);
+ extern int Sqlitetest4_Init(Tcl_Interp*);
+ extern int Sqlitetest5_Init(Tcl_Interp*);
+ extern int Md5_Init(Tcl_Interp*);
+ extern int Sqlitetestsse_Init(Tcl_Interp*);
+
+ Sqlitetest1_Init(interp);
+ Sqlitetest2_Init(interp);
+ Sqlitetest3_Init(interp);
+ Sqlitetest4_Init(interp);
+ Sqlitetest5_Init(interp);
+ Md5_Init(interp);
+#ifdef SQLITE_SSE
+ Sqlitetestsse_Init(interp);
+#endif
+ }
+#endif
+ if( argc>=2 || TCLSH==2 ){
+ int i;
+ Tcl_SetVar(interp,"argv0",argv[1],TCL_GLOBAL_ONLY);
+ Tcl_SetVar(interp,"argv", "", TCL_GLOBAL_ONLY);
+ for(i=3-TCLSH; i<argc; i++){
+ Tcl_SetVar(interp, "argv", argv[i],
+ TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT | TCL_APPEND_VALUE);
+ }
+ if( TCLSH==1 && Tcl_EvalFile(interp, argv[1])!=TCL_OK ){
+ const char *zInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
+ if( zInfo==0 ) zInfo = interp->result;
+ fprintf(stderr,"%s: %s\n", *argv, zInfo);
+ return 1;
+ }
+ }
+ if( argc<=1 || TCLSH==2 ){
+ Tcl_GlobalEval(interp, zMainloop);
+ }
+ return 0;
+}
+#endif /* TCLSH */
+
+#endif /* !defined(NO_TCL) */
diff --git a/ext/pdo_sqlite/sqlite/src/test1.c b/ext/pdo_sqlite/sqlite/src/test1.c
new file mode 100644
index 000000000..ceac5cd6d
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/test1.c
@@ -0,0 +1,3254 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Code for testing the printf() interface to SQLite. This code
+** is not included in the SQLite library. It is used for automated
+** testing of the SQLite library.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "tcl.h"
+#include "os.h"
+#include <stdlib.h>
+#include <string.h>
+
+const char *sqlite3TestErrorName(int rc){
+ const char *zName = 0;
+ switch( rc ){
+ case SQLITE_OK: zName = "SQLITE_OK"; break;
+ case SQLITE_ERROR: zName = "SQLITE_ERROR"; break;
+ case SQLITE_PERM: zName = "SQLITE_PERM"; break;
+ case SQLITE_ABORT: zName = "SQLITE_ABORT"; break;
+ case SQLITE_BUSY: zName = "SQLITE_BUSY"; break;
+ case SQLITE_LOCKED: zName = "SQLITE_LOCKED"; break;
+ case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break;
+ case SQLITE_READONLY: zName = "SQLITE_READONLY"; break;
+ case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break;
+ case SQLITE_IOERR: zName = "SQLITE_IOERR"; break;
+ case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break;
+ case SQLITE_FULL: zName = "SQLITE_FULL"; break;
+ case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break;
+ case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break;
+ case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break;
+ case SQLITE_SCHEMA: zName = "SQLITE_SCHEMA"; break;
+ case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break;
+ case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break;
+ case SQLITE_MISUSE: zName = "SQLITE_MISUSE"; break;
+ case SQLITE_NOLFS: zName = "SQLITE_NOLFS"; break;
+ case SQLITE_AUTH: zName = "SQLITE_AUTH"; break;
+ case SQLITE_FORMAT: zName = "SQLITE_FORMAT"; break;
+ case SQLITE_RANGE: zName = "SQLITE_RANGE"; break;
+ case SQLITE_ROW: zName = "SQLITE_ROW"; break;
+ case SQLITE_DONE: zName = "SQLITE_DONE"; break;
+ case SQLITE_NOTADB: zName = "SQLITE_NOTADB"; break;
+ default: zName = "SQLITE_Unknown"; break;
+ }
+ return zName;
+}
+#define errorName sqlite3TestErrorName
+
+/*
+** Convert an sqlite3_stmt* into an sqlite3*. This depends on the
+** fact that the sqlite3* is the first field in the Vdbe structure.
+*/
+#define StmtToDb(X) sqlite3_db_handle(X)
+
+/*
+** Check a return value to make sure it agrees with the results
+** from sqlite3_errcode.
+*/
+int sqlite3TestErrCode(Tcl_Interp *interp, sqlite3 *db, int rc){
+ if( rc!=SQLITE_MISUSE && rc!=SQLITE_OK && sqlite3_errcode(db)!=rc ){
+ char zBuf[200];
+ int r2 = sqlite3_errcode(db);
+ sprintf(zBuf, "error code %s (%d) does not match sqlite3_errcode %s (%d)",
+ errorName(rc), rc, errorName(r2), r2);
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return 1;
+ }
+ return 0;
+}
+
+/*
+** Decode a pointer to an sqlite3 object.
+*/
+static int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb){
+ *ppDb = (sqlite3*)sqlite3TextToPtr(zA);
+ return TCL_OK;
+}
+
+/*
+** Decode a pointer to an sqlite3_stmt object.
+*/
+static int getStmtPointer(
+ Tcl_Interp *interp,
+ const char *zArg,
+ sqlite3_stmt **ppStmt
+){
+ *ppStmt = (sqlite3_stmt*)sqlite3TextToPtr(zArg);
+ return TCL_OK;
+}
+
+/*
+** Decode a pointer to an sqlite3_stmt object.
+*/
+static int getFilePointer(
+ Tcl_Interp *interp,
+ const char *zArg,
+ OsFile **ppFile
+){
+ *ppFile = (OsFile*)sqlite3TextToPtr(zArg);
+ return TCL_OK;
+}
+
+/*
+** Generate a text representation of a pointer that can be understood
+** by the getDbPointer and getVmPointer routines above.
+**
+** The problem is, on some machines (Solaris) if you do a printf with
+** "%p" you cannot turn around and do a scanf with the same "%p" and
+** get your pointer back. You have to prepend a "0x" before it will
+** work. Or at least that is what is reported to me (drh). But this
+** behavior varies from machine to machine. The solution used her is
+** to test the string right after it is generated to see if it can be
+** understood by scanf, and if not, try prepending an "0x" to see if
+** that helps. If nothing works, a fatal error is generated.
+*/
+static int makePointerStr(Tcl_Interp *interp, char *zPtr, void *p){
+ sqlite3_snprintf(100, zPtr, "%p", p);
+ return TCL_OK;
+}
+
+/*
+** The callback routine for sqlite3_exec_printf().
+*/
+static int exec_printf_cb(void *pArg, int argc, char **argv, char **name){
+ Tcl_DString *str = (Tcl_DString*)pArg;
+ int i;
+
+ if( Tcl_DStringLength(str)==0 ){
+ for(i=0; i<argc; i++){
+ Tcl_DStringAppendElement(str, name[i] ? name[i] : "NULL");
+ }
+ }
+ for(i=0; i<argc; i++){
+ Tcl_DStringAppendElement(str, argv[i] ? argv[i] : "NULL");
+ }
+ return 0;
+}
+
+/*
+** Usage: sqlite3_exec_printf DB FORMAT STRING
+**
+** Invoke the sqlite3_exec_printf() interface using the open database
+** DB. The SQL is the string FORMAT. The format string should contain
+** one %s or %q. STRING is the value inserted into %s or %q.
+*/
+static int test_exec_printf(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ sqlite3 *db;
+ Tcl_DString str;
+ int rc;
+ char *zErr = 0;
+ char *zSql;
+ char zBuf[30];
+ if( argc!=4 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB FORMAT STRING", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ Tcl_DStringInit(&str);
+ zSql = sqlite3_mprintf(argv[2], argv[3]);
+ rc = sqlite3_exec(db, zSql, exec_printf_cb, &str, &zErr);
+ sqlite3_free(zSql);
+ sprintf(zBuf, "%d", rc);
+ Tcl_AppendElement(interp, zBuf);
+ Tcl_AppendElement(interp, rc==SQLITE_OK ? Tcl_DStringValue(&str) : zErr);
+ Tcl_DStringFree(&str);
+ if( zErr ) free(zErr);
+ if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_mprintf_z_test SEPARATOR ARG0 ARG1 ...
+**
+** Test the %z format of mprintf(). Use multiple mprintf() calls to
+** concatenate arg0 through argn using separator as the separator.
+** Return the result.
+*/
+static int test_mprintf_z(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ char *zResult = 0;
+ int i;
+
+ for(i=2; i<argc; i++){
+ zResult = sqlite3MPrintf("%z%s%s", zResult, argv[1], argv[i]);
+ }
+ Tcl_AppendResult(interp, zResult, 0);
+ sqliteFree(zResult);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_get_table_printf DB FORMAT STRING
+**
+** Invoke the sqlite3_get_table_printf() interface using the open database
+** DB. The SQL is the string FORMAT. The format string should contain
+** one %s or %q. STRING is the value inserted into %s or %q.
+*/
+static int test_get_table_printf(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ sqlite3 *db;
+ Tcl_DString str;
+ int rc;
+ char *zErr = 0;
+ int nRow, nCol;
+ char **aResult;
+ int i;
+ char zBuf[30];
+ char *zSql;
+ if( argc!=4 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB FORMAT STRING", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ Tcl_DStringInit(&str);
+ zSql = sqlite3_mprintf(argv[2],argv[3]);
+ rc = sqlite3_get_table(db, zSql, &aResult, &nRow, &nCol, &zErr);
+ sqlite3_free(zSql);
+ sprintf(zBuf, "%d", rc);
+ Tcl_AppendElement(interp, zBuf);
+ if( rc==SQLITE_OK ){
+ sprintf(zBuf, "%d", nRow);
+ Tcl_AppendElement(interp, zBuf);
+ sprintf(zBuf, "%d", nCol);
+ Tcl_AppendElement(interp, zBuf);
+ for(i=0; i<(nRow+1)*nCol; i++){
+ Tcl_AppendElement(interp, aResult[i] ? aResult[i] : "NULL");
+ }
+ }else{
+ Tcl_AppendElement(interp, zErr);
+ }
+ sqlite3_free_table(aResult);
+ if( zErr ) free(zErr);
+ if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ return TCL_OK;
+}
+
+
+/*
+** Usage: sqlite3_last_insert_rowid DB
+**
+** Returns the integer ROWID of the most recent insert.
+*/
+static int test_last_rowid(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ sqlite3 *db;
+ char zBuf[30];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB\"", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ sprintf(zBuf, "%lld", sqlite3_last_insert_rowid(db));
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: sqlite3_key DB KEY
+**
+** Set the codec key.
+*/
+static int test_key(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ sqlite3 *db;
+ const char *zKey;
+ int nKey;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FILENAME\"", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ zKey = argv[2];
+ nKey = strlen(zKey);
+#ifdef SQLITE_HAS_CODEC
+ sqlite3_key(db, zKey, nKey);
+#endif
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_rekey DB KEY
+**
+** Change the codec key.
+*/
+static int test_rekey(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ sqlite3 *db;
+ const char *zKey;
+ int nKey;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FILENAME\"", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ zKey = argv[2];
+ nKey = strlen(zKey);
+#ifdef SQLITE_HAS_CODEC
+ sqlite3_rekey(db, zKey, nKey);
+#endif
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_close DB
+**
+** Closes the database opened by sqlite3_open.
+*/
+static int sqlite_test_close(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ sqlite3 *db;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FILENAME\"", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ rc = sqlite3_close(db);
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ return TCL_OK;
+}
+
+/*
+** Implementation of the x_coalesce() function.
+** Return the first argument non-NULL argument.
+*/
+static void ifnullFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
+ int i;
+ for(i=0; i<argc; i++){
+ if( SQLITE_NULL!=sqlite3_value_type(argv[i]) ){
+ sqlite3_result_text(context, sqlite3_value_text(argv[i]), -1,
+ SQLITE_TRANSIENT);
+ break;
+ }
+ }
+}
+
+/*
+** A structure into which to accumulate text.
+*/
+struct dstr {
+ int nAlloc; /* Space allocated */
+ int nUsed; /* Space used */
+ char *z; /* The space */
+};
+
+/*
+** Append text to a dstr
+*/
+static void dstrAppend(struct dstr *p, const char *z, int divider){
+ int n = strlen(z);
+ if( p->nUsed + n + 2 > p->nAlloc ){
+ char *zNew;
+ p->nAlloc = p->nAlloc*2 + n + 200;
+ zNew = sqliteRealloc(p->z, p->nAlloc);
+ if( zNew==0 ){
+ sqliteFree(p->z);
+ memset(p, 0, sizeof(*p));
+ return;
+ }
+ p->z = zNew;
+ }
+ if( divider && p->nUsed>0 ){
+ p->z[p->nUsed++] = divider;
+ }
+ memcpy(&p->z[p->nUsed], z, n+1);
+ p->nUsed += n;
+}
+
+/*
+** Invoked for each callback from sqlite3ExecFunc
+*/
+static int execFuncCallback(void *pData, int argc, char **argv, char **NotUsed){
+ struct dstr *p = (struct dstr*)pData;
+ int i;
+ for(i=0; i<argc; i++){
+ if( argv[i]==0 ){
+ dstrAppend(p, "NULL", ' ');
+ }else{
+ dstrAppend(p, argv[i], ' ');
+ }
+ }
+ return 0;
+}
+
+/*
+** Implementation of the x_sqlite_exec() function. This function takes
+** a single argument and attempts to execute that argument as SQL code.
+** This is illegal and should set the SQLITE_MISUSE flag on the database.
+**
+** 2004-Jan-07: We have changed this to make it legal to call sqlite3_exec()
+** from within a function call.
+**
+** This routine simulates the effect of having two threads attempt to
+** use the same database at the same time.
+*/
+static void sqlite3ExecFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ struct dstr x;
+ memset(&x, 0, sizeof(x));
+ sqlite3_exec((sqlite3*)sqlite3_user_data(context),
+ sqlite3_value_text(argv[0]),
+ execFuncCallback, &x, 0);
+ sqlite3_result_text(context, x.z, x.nUsed, SQLITE_TRANSIENT);
+ sqliteFree(x.z);
+}
+
+/*
+** Usage: sqlite_test_create_function DB
+**
+** Call the sqlite3_create_function API on the given database in order
+** to create a function named "x_coalesce". This function does the same thing
+** as the "coalesce" function. This function also registers an SQL function
+** named "x_sqlite_exec" that invokes sqlite3_exec(). Invoking sqlite3_exec()
+** in this way is illegal recursion and should raise an SQLITE_MISUSE error.
+** The effect is similar to trying to use the same database connection from
+** two threads at the same time.
+**
+** The original motivation for this routine was to be able to call the
+** sqlite3_create_function function while a query is in progress in order
+** to test the SQLITE_MISUSE detection logic.
+*/
+static int test_create_function(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ int rc;
+ sqlite3 *db;
+ extern void Md5_Register(sqlite3*);
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB\"", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ rc = sqlite3_create_function(db, "x_coalesce", -1, SQLITE_ANY, 0,
+ ifnullFunc, 0, 0);
+
+#ifndef SQLITE_OMIT_UTF16
+ /* Use the sqlite3_create_function16() API here. Mainly for fun, but also
+ ** because it is not tested anywhere else. */
+ if( rc==SQLITE_OK ){
+ sqlite3_value *pVal;
+ pVal = sqlite3ValueNew();
+ sqlite3ValueSetStr(pVal, -1, "x_sqlite_exec", SQLITE_UTF8, SQLITE_STATIC);
+ rc = sqlite3_create_function16(db,
+ sqlite3ValueText(pVal, SQLITE_UTF16NATIVE),
+ 1, SQLITE_UTF16, db, sqlite3ExecFunc, 0, 0);
+ sqlite3ValueFree(pVal);
+ }
+#endif
+
+ if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ Tcl_SetResult(interp, (char *)errorName(rc), 0);
+ return TCL_OK;
+}
+
+/*
+** Routines to implement the x_count() aggregate function.
+*/
+typedef struct CountCtx CountCtx;
+struct CountCtx {
+ int n;
+};
+static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){
+ CountCtx *p;
+ p = sqlite3_aggregate_context(context, sizeof(*p));
+ if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0]) ) && p ){
+ p->n++;
+ }
+}
+static void countFinalize(sqlite3_context *context){
+ CountCtx *p;
+ p = sqlite3_aggregate_context(context, sizeof(*p));
+ sqlite3_result_int(context, p ? p->n : 0);
+}
+
+/*
+** Usage: sqlite_test_create_aggregate DB
+**
+** Call the sqlite3_create_function API on the given database in order
+** to create a function named "x_count". This function does the same thing
+** as the "md5sum" function.
+**
+** The original motivation for this routine was to be able to call the
+** sqlite3_create_aggregate function while a query is in progress in order
+** to test the SQLITE_MISUSE detection logic.
+*/
+static int test_create_aggregate(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ sqlite3 *db;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FILENAME\"", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ rc = sqlite3_create_function(db, "x_count", 0, SQLITE_UTF8, 0, 0,
+ countStep,countFinalize);
+ if( rc==SQLITE_OK ){
+ sqlite3_create_function(db, "x_count", 1, SQLITE_UTF8, 0, 0,
+ countStep,countFinalize);
+ }
+ if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ return TCL_OK;
+}
+
+
+
+/*
+** Usage: sqlite3_mprintf_int FORMAT INTEGER INTEGER INTEGER
+**
+** Call mprintf with three integer arguments
+*/
+static int sqlite3_mprintf_int(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ int a[3], i;
+ char *z;
+ if( argc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FORMAT INT INT INT\"", 0);
+ return TCL_ERROR;
+ }
+ for(i=2; i<5; i++){
+ if( Tcl_GetInt(interp, argv[i], &a[i-2]) ) return TCL_ERROR;
+ }
+ z = sqlite3_mprintf(argv[1], a[0], a[1], a[2]);
+ Tcl_AppendResult(interp, z, 0);
+ sqlite3_free(z);
+ return TCL_OK;
+}
+
+/*
+** If zNum represents an integer that will fit in 64-bits, then set
+** *pValue to that integer and return true. Otherwise return false.
+*/
+static int sqlite3GetInt64(const char *zNum, i64 *pValue){
+ if( sqlite3FitsIn64Bits(zNum) ){
+ sqlite3atoi64(zNum, pValue);
+ return 1;
+ }
+ return 0;
+}
+
+/*
+** Usage: sqlite3_mprintf_int64 FORMAT INTEGER INTEGER INTEGER
+**
+** Call mprintf with three 64-bit integer arguments
+*/
+static int sqlite3_mprintf_int64(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ int i;
+ sqlite_int64 a[3];
+ char *z;
+ if( argc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FORMAT INT INT INT\"", 0);
+ return TCL_ERROR;
+ }
+ for(i=2; i<5; i++){
+ if( !sqlite3GetInt64(argv[i], &a[i-2]) ){
+ Tcl_AppendResult(interp, "argument is not a valid 64-bit integer", 0);
+ return TCL_ERROR;
+ }
+ }
+ z = sqlite3_mprintf(argv[1], a[0], a[1], a[2]);
+ Tcl_AppendResult(interp, z, 0);
+ sqlite3_free(z);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_mprintf_str FORMAT INTEGER INTEGER STRING
+**
+** Call mprintf with two integer arguments and one string argument
+*/
+static int sqlite3_mprintf_str(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ int a[3], i;
+ char *z;
+ if( argc<4 || argc>5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FORMAT INT INT ?STRING?\"", 0);
+ return TCL_ERROR;
+ }
+ for(i=2; i<4; i++){
+ if( Tcl_GetInt(interp, argv[i], &a[i-2]) ) return TCL_ERROR;
+ }
+ z = sqlite3_mprintf(argv[1], a[0], a[1], argc>4 ? argv[4] : NULL);
+ Tcl_AppendResult(interp, z, 0);
+ sqlite3_free(z);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_mprintf_double FORMAT INTEGER INTEGER DOUBLE
+**
+** Call mprintf with two integer arguments and one double argument
+*/
+static int sqlite3_mprintf_double(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ int a[3], i;
+ double r;
+ char *z;
+ if( argc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FORMAT INT INT DOUBLE\"", 0);
+ return TCL_ERROR;
+ }
+ for(i=2; i<4; i++){
+ if( Tcl_GetInt(interp, argv[i], &a[i-2]) ) return TCL_ERROR;
+ }
+ if( Tcl_GetDouble(interp, argv[4], &r) ) return TCL_ERROR;
+ z = sqlite3_mprintf(argv[1], a[0], a[1], r);
+ Tcl_AppendResult(interp, z, 0);
+ sqlite3_free(z);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_mprintf_scaled FORMAT DOUBLE DOUBLE
+**
+** Call mprintf with a single double argument which is the product of the
+** two arguments given above. This is used to generate overflow and underflow
+** doubles to test that they are converted properly.
+*/
+static int sqlite3_mprintf_scaled(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ int i;
+ double r[2];
+ char *z;
+ if( argc!=4 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FORMAT DOUBLE DOUBLE\"", 0);
+ return TCL_ERROR;
+ }
+ for(i=2; i<4; i++){
+ if( Tcl_GetDouble(interp, argv[i], &r[i-2]) ) return TCL_ERROR;
+ }
+ z = sqlite3_mprintf(argv[1], r[0]*r[1]);
+ Tcl_AppendResult(interp, z, 0);
+ sqlite3_free(z);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_mprintf_stronly FORMAT STRING
+**
+** Call mprintf with a single double argument which is the product of the
+** two arguments given above. This is used to generate overflow and underflow
+** doubles to test that they are converted properly.
+*/
+static int sqlite3_mprintf_stronly(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ char *z;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FORMAT STRING\"", 0);
+ return TCL_ERROR;
+ }
+ z = sqlite3_mprintf(argv[1], argv[2]);
+ Tcl_AppendResult(interp, z, 0);
+ sqlite3_free(z);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_mprintf_hexdouble FORMAT HEX
+**
+** Call mprintf with a single double argument which is derived from the
+** hexadecimal encoding of an IEEE double.
+*/
+static int sqlite3_mprintf_hexdouble(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ char *z;
+ double r;
+ unsigned x1, x2;
+ long long unsigned d;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FORMAT STRING\"", 0);
+ return TCL_ERROR;
+ }
+ if( sscanf(argv[2], "%08x%08x", &x2, &x1)!=2 ){
+ Tcl_AppendResult(interp, "2nd argument should be 16-characters of hex", 0);
+ return TCL_ERROR;
+ }
+ d = x2;
+ d = (d<<32) + x1;
+ memcpy(&r, &d, sizeof(r));
+ z = sqlite3_mprintf(argv[1], r);
+ Tcl_AppendResult(interp, z, 0);
+ sqlite3_free(z);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite_malloc_fail N ?REPEAT-INTERVAL?
+**
+** Rig sqliteMalloc() to fail on the N-th call and every REPEAT-INTERVAL call
+** after that. If REPEAT-INTERVAL is 0 or is omitted, then only a single
+** malloc will fail. If REPEAT-INTERVAL is 1 then all mallocs after the
+** first failure will continue to fail on every call. If REPEAT-INTERVAL is
+** 2 then every other malloc will fail. And so forth.
+**
+** Turn off this mechanism and reset the sqlite3_malloc_failed variable is N==0.
+*/
+#ifdef SQLITE_MEMDEBUG
+static int sqlite_malloc_fail(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ int n;
+ int rep;
+ if( argc!=2 && argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " N\"", 0);
+ return TCL_ERROR;
+ }
+ if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR;
+ if( argc==3 ){
+ if( Tcl_GetInt(interp, argv[2], &rep) ) return TCL_ERROR;
+ }else{
+ rep = 0;
+ }
+ sqlite3_iMallocFail = n;
+ sqlite3_iMallocReset = rep;
+ sqlite3_malloc_failed = 0;
+ return TCL_OK;
+}
+#endif
+
+/*
+** Usage: sqlite_malloc_stat
+**
+** Return the number of prior calls to sqliteMalloc() and sqliteFree().
+*/
+#ifdef SQLITE_MEMDEBUG
+static int sqlite_malloc_stat(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ char zBuf[200];
+ sprintf(zBuf, "%d %d %d", sqlite3_nMalloc, sqlite3_nFree, sqlite3_iMallocFail);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+#endif
+
+/*
+** Usage: sqlite_abort
+**
+** Shutdown the process immediately. This is not a clean shutdown.
+** This command is used to test the recoverability of a database in
+** the event of a program crash.
+*/
+static int sqlite_abort(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ assert( interp==0 ); /* This will always fail */
+ return TCL_OK;
+}
+
+/*
+** The following routine is a user-defined SQL function whose purpose
+** is to test the sqlite_set_result() API.
+*/
+static void testFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
+ while( argc>=2 ){
+ const char *zArg0 = sqlite3_value_text(argv[0]);
+ if( zArg0 ){
+ if( 0==sqlite3StrICmp(zArg0, "int") ){
+ sqlite3_result_int(context, sqlite3_value_int(argv[1]));
+ }else if( sqlite3StrICmp(zArg0,"int64")==0 ){
+ sqlite3_result_int64(context, sqlite3_value_int64(argv[1]));
+ }else if( sqlite3StrICmp(zArg0,"string")==0 ){
+ sqlite3_result_text(context, sqlite3_value_text(argv[1]), -1,
+ SQLITE_TRANSIENT);
+ }else if( sqlite3StrICmp(zArg0,"double")==0 ){
+ sqlite3_result_double(context, sqlite3_value_double(argv[1]));
+ }else if( sqlite3StrICmp(zArg0,"null")==0 ){
+ sqlite3_result_null(context);
+ }else if( sqlite3StrICmp(zArg0,"value")==0 ){
+ sqlite3_result_value(context, argv[sqlite3_value_int(argv[1])]);
+ }else{
+ goto error_out;
+ }
+ }else{
+ goto error_out;
+ }
+ argc -= 2;
+ argv += 2;
+ }
+ return;
+
+error_out:
+ sqlite3_result_error(context,"first argument should be one of: "
+ "int int64 string double null value", -1);
+}
+
+/*
+** Usage: sqlite_register_test_function DB NAME
+**
+** Register the test SQL function on the database DB under the name NAME.
+*/
+static int test_register_func(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ sqlite3 *db;
+ int rc;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB FUNCTION-NAME", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ rc = sqlite3_create_function(db, argv[2], -1, SQLITE_UTF8, 0,
+ testFunc, 0, 0);
+ if( rc!=0 ){
+ Tcl_AppendResult(interp, sqlite3ErrStr(rc), 0);
+ return TCL_ERROR;
+ }
+ if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_finalize STMT
+**
+** Finalize a statement handle.
+*/
+static int test_finalize(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int rc;
+ sqlite3 *db;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " <STMT>", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+
+ if( pStmt ){
+ db = StmtToDb(pStmt);
+ }
+ rc = sqlite3_finalize(pStmt);
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ if( db && sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_reset STMT
+**
+** Finalize a statement handle.
+*/
+static int test_reset(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int rc;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " <STMT>", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+
+ rc = sqlite3_reset(pStmt);
+ if( pStmt &&
+ sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ if( rc ){
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_expired STMT
+**
+** Return TRUE if a recompilation of the statement is recommended.
+*/
+static int test_expired(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " <STMT>", 0);
+ return TCL_ERROR;
+ }
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(sqlite3_expired(pStmt)));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_transfer_bindings FROMSTMT TOSTMT
+**
+** Transfer all bindings from FROMSTMT over to TOSTMT
+*/
+static int test_transfer_bind(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt1, *pStmt2;
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " FROM-STMT TO-STMT", 0);
+ return TCL_ERROR;
+ }
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt1)) return TCL_ERROR;
+ if( getStmtPointer(interp, Tcl_GetString(objv[2]), &pStmt2)) return TCL_ERROR;
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(sqlite3_transfer_bindings(pStmt1,pStmt2)));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_changes DB
+**
+** Return the number of changes made to the database by the last SQL
+** execution.
+*/
+static int test_changes(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3 *db;
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " DB", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_changes(db)));
+ return TCL_OK;
+}
+
+/*
+** This is the "static_bind_value" that variables are bound to when
+** the FLAG option of sqlite3_bind is "static"
+*/
+static char *sqlite_static_bind_value = 0;
+
+/*
+** Usage: sqlite3_bind VM IDX VALUE FLAGS
+**
+** Sets the value of the IDX-th occurance of "?" in the original SQL
+** string. VALUE is the new value. If FLAGS=="null" then VALUE is
+** ignored and the value is set to NULL. If FLAGS=="static" then
+** the value is set to the value of a static variable named
+** "sqlite_static_bind_value". If FLAGS=="normal" then a copy
+** of the VALUE is made.
+*/
+static int test_bind(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ sqlite3_stmt *pStmt;
+ int rc;
+ int idx;
+ if( argc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " VM IDX VALUE (null|static|normal)\"", 0);
+ return TCL_ERROR;
+ }
+ if( getStmtPointer(interp, argv[1], &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetInt(interp, argv[2], &idx) ) return TCL_ERROR;
+ if( strcmp(argv[4],"null")==0 ){
+ rc = sqlite3_bind_null(pStmt, idx);
+ }else if( strcmp(argv[4],"static")==0 ){
+ rc = sqlite3_bind_text(pStmt, idx, sqlite_static_bind_value, -1, 0);
+ }else if( strcmp(argv[4],"normal")==0 ){
+ rc = sqlite3_bind_text(pStmt, idx, argv[3], -1, SQLITE_TRANSIENT);
+ }else{
+ Tcl_AppendResult(interp, "4th argument should be "
+ "\"null\" or \"static\" or \"normal\"", 0);
+ return TCL_ERROR;
+ }
+ if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
+ if( rc ){
+ char zBuf[50];
+ sprintf(zBuf, "(%d) ", rc);
+ Tcl_AppendResult(interp, zBuf, sqlite3ErrStr(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** Usage: add_test_collate <db ptr> <utf8> <utf16le> <utf16be>
+**
+** This function is used to test that SQLite selects the correct collation
+** sequence callback when multiple versions (for different text encodings)
+** are available.
+**
+** Calling this routine registers the collation sequence "test_collate"
+** with database handle <db>. The second argument must be a list of three
+** boolean values. If the first is true, then a version of test_collate is
+** registered for UTF-8, if the second is true, a version is registered for
+** UTF-16le, if the third is true, a UTF-16be version is available.
+** Previous versions of test_collate are deleted.
+**
+** The collation sequence test_collate is implemented by calling the
+** following TCL script:
+**
+** "test_collate <enc> <lhs> <rhs>"
+**
+** The <lhs> and <rhs> are the two values being compared, encoded in UTF-8.
+** The <enc> parameter is the encoding of the collation function that
+** SQLite selected to call. The TCL test script implements the
+** "test_collate" proc.
+**
+** Note that this will only work with one intepreter at a time, as the
+** interp pointer to use when evaluating the TCL script is stored in
+** pTestCollateInterp.
+*/
+static Tcl_Interp* pTestCollateInterp;
+static int test_collate_func(
+ void *pCtx,
+ int nA, const void *zA,
+ int nB, const void *zB
+){
+ Tcl_Interp *i = pTestCollateInterp;
+ int encin = (int)pCtx;
+ int res;
+ int n;
+
+ sqlite3_value *pVal;
+ Tcl_Obj *pX;
+
+ pX = Tcl_NewStringObj("test_collate", -1);
+ Tcl_IncrRefCount(pX);
+
+ switch( encin ){
+ case SQLITE_UTF8:
+ Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj("UTF-8",-1));
+ break;
+ case SQLITE_UTF16LE:
+ Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj("UTF-16LE",-1));
+ break;
+ case SQLITE_UTF16BE:
+ Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj("UTF-16BE",-1));
+ break;
+ default:
+ assert(0);
+ }
+
+ pVal = sqlite3ValueNew();
+ sqlite3ValueSetStr(pVal, nA, zA, encin, SQLITE_STATIC);
+ n = sqlite3_value_bytes(pVal);
+ Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj(sqlite3_value_text(pVal),n));
+ sqlite3ValueSetStr(pVal, nB, zB, encin, SQLITE_STATIC);
+ n = sqlite3_value_bytes(pVal);
+ Tcl_ListObjAppendElement(i,pX,Tcl_NewStringObj(sqlite3_value_text(pVal),n));
+ sqlite3ValueFree(pVal);
+
+ Tcl_EvalObjEx(i, pX, 0);
+ Tcl_DecrRefCount(pX);
+ Tcl_GetIntFromObj(i, Tcl_GetObjResult(i), &res);
+ return res;
+}
+static int test_collate(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3 *db;
+ int val;
+ sqlite3_value *pVal;
+ int rc;
+
+ if( objc!=5 ) goto bad_args;
+ pTestCollateInterp = interp;
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+
+ if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[2], &val) ) return TCL_ERROR;
+ rc = sqlite3_create_collation(db, "test_collate", SQLITE_UTF8,
+ (void *)SQLITE_UTF8, val?test_collate_func:0);
+ if( rc==SQLITE_OK ){
+ if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[3], &val) ) return TCL_ERROR;
+ rc = sqlite3_create_collation(db, "test_collate", SQLITE_UTF16LE,
+ (void *)SQLITE_UTF16LE, val?test_collate_func:0);
+ if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[4], &val) ) return TCL_ERROR;
+
+ pVal = sqlite3ValueNew();
+ sqlite3ValueSetStr(pVal, -1, "test_collate", SQLITE_UTF8, SQLITE_STATIC);
+ sqlite3_create_collation16(db, sqlite3ValueText(pVal, SQLITE_UTF16NATIVE),
+ SQLITE_UTF16BE, (void *)SQLITE_UTF16BE, val?test_collate_func:0);
+ sqlite3ValueFree(pVal);
+ }
+ if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ return TCL_OK;
+
+bad_args:
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " <DB> <utf8> <utf16le> <utf16be>", 0);
+ return TCL_ERROR;
+}
+
+static void test_collate_needed_cb(
+ void *pCtx,
+ sqlite3 *db,
+ int eTextRep,
+ const void *notUsed
+){
+ int enc = db->enc;
+ sqlite3_create_collation(
+ db, "test_collate", db->enc, (void *)enc, test_collate_func);
+}
+
+/*
+** Usage: add_test_collate_needed DB
+*/
+static int test_collate_needed(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3 *db;
+ int rc;
+
+ if( objc!=2 ) goto bad_args;
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+ rc = sqlite3_collation_needed16(db, 0, test_collate_needed_cb);
+ if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ return TCL_OK;
+
+bad_args:
+ Tcl_WrongNumArgs(interp, 1, objv, "DB");
+ return TCL_ERROR;
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+/*
+** Usage: add_test_function <db ptr> <utf8> <utf16le> <utf16be>
+**
+** This function is used to test that SQLite selects the correct user
+** function callback when multiple versions (for different text encodings)
+** are available.
+**
+** Calling this routine registers up to three versions of the user function
+** "test_function" with database handle <db>. If the second argument is
+** true, then a version of test_function is registered for UTF-8, if the
+** third is true, a version is registered for UTF-16le, if the fourth is
+** true, a UTF-16be version is available. Previous versions of
+** test_function are deleted.
+**
+** The user function is implemented by calling the following TCL script:
+**
+** "test_function <enc> <arg>"
+**
+** Where <enc> is one of UTF-8, UTF-16LE or UTF16BE, and <arg> is the
+** single argument passed to the SQL function. The value returned by
+** the TCL script is used as the return value of the SQL function. It
+** is passed to SQLite using UTF-16BE for a UTF-8 test_function(), UTF-8
+** for a UTF-16LE test_function(), and UTF-16LE for an implementation that
+** prefers UTF-16BE.
+*/
+#ifndef SQLITE_OMIT_UTF16
+static void test_function_utf8(
+ sqlite3_context *pCtx,
+ int nArg,
+ sqlite3_value **argv
+){
+ Tcl_Interp *interp;
+ Tcl_Obj *pX;
+ sqlite3_value *pVal;
+ interp = (Tcl_Interp *)sqlite3_user_data(pCtx);
+ pX = Tcl_NewStringObj("test_function", -1);
+ Tcl_IncrRefCount(pX);
+ Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj("UTF-8", -1));
+ Tcl_ListObjAppendElement(interp, pX,
+ Tcl_NewStringObj(sqlite3_value_text(argv[0]), -1));
+ Tcl_EvalObjEx(interp, pX, 0);
+ Tcl_DecrRefCount(pX);
+ sqlite3_result_text(pCtx, Tcl_GetStringResult(interp), -1, SQLITE_TRANSIENT);
+ pVal = sqlite3ValueNew();
+ sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp),
+ SQLITE_UTF8, SQLITE_STATIC);
+ sqlite3_result_text16be(pCtx, sqlite3_value_text16be(pVal),
+ -1, SQLITE_TRANSIENT);
+ sqlite3ValueFree(pVal);
+}
+static void test_function_utf16le(
+ sqlite3_context *pCtx,
+ int nArg,
+ sqlite3_value **argv
+){
+ Tcl_Interp *interp;
+ Tcl_Obj *pX;
+ sqlite3_value *pVal;
+ interp = (Tcl_Interp *)sqlite3_user_data(pCtx);
+ pX = Tcl_NewStringObj("test_function", -1);
+ Tcl_IncrRefCount(pX);
+ Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj("UTF-16LE", -1));
+ Tcl_ListObjAppendElement(interp, pX,
+ Tcl_NewStringObj(sqlite3_value_text(argv[0]), -1));
+ Tcl_EvalObjEx(interp, pX, 0);
+ Tcl_DecrRefCount(pX);
+ pVal = sqlite3ValueNew();
+ sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp),
+ SQLITE_UTF8, SQLITE_STATIC);
+ sqlite3_result_text(pCtx,sqlite3_value_text(pVal),-1,SQLITE_TRANSIENT);
+ sqlite3ValueFree(pVal);
+}
+static void test_function_utf16be(
+ sqlite3_context *pCtx,
+ int nArg,
+ sqlite3_value **argv
+){
+ Tcl_Interp *interp;
+ Tcl_Obj *pX;
+ sqlite3_value *pVal;
+ interp = (Tcl_Interp *)sqlite3_user_data(pCtx);
+ pX = Tcl_NewStringObj("test_function", -1);
+ Tcl_IncrRefCount(pX);
+ Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj("UTF-16BE", -1));
+ Tcl_ListObjAppendElement(interp, pX,
+ Tcl_NewStringObj(sqlite3_value_text(argv[0]), -1));
+ Tcl_EvalObjEx(interp, pX, 0);
+ Tcl_DecrRefCount(pX);
+ pVal = sqlite3ValueNew();
+ sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp),
+ SQLITE_UTF8, SQLITE_STATIC);
+ sqlite3_result_text16le(pCtx, sqlite3_value_text16le(pVal),
+ -1, SQLITE_TRANSIENT);
+ sqlite3ValueFree(pVal);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+static int test_function(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifndef SQLITE_OMIT_UTF16
+ sqlite3 *db;
+ int val;
+
+ if( objc!=5 ) goto bad_args;
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+
+ if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[2], &val) ) return TCL_ERROR;
+ if( val ){
+ sqlite3_create_function(db, "test_function", 1, SQLITE_UTF8,
+ interp, test_function_utf8, 0, 0);
+ }
+ if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[3], &val) ) return TCL_ERROR;
+ if( val ){
+ sqlite3_create_function(db, "test_function", 1, SQLITE_UTF16LE,
+ interp, test_function_utf16le, 0, 0);
+ }
+ if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[4], &val) ) return TCL_ERROR;
+ if( val ){
+ sqlite3_create_function(db, "test_function", 1, SQLITE_UTF16BE,
+ interp, test_function_utf16be, 0, 0);
+ }
+
+ return TCL_OK;
+bad_args:
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " <DB> <utf8> <utf16le> <utf16be>", 0);
+#endif /* SQLITE_OMIT_UTF16 */
+ return TCL_ERROR;
+}
+
+/*
+** Usage: test_errstr <err code>
+**
+** Test that the english language string equivalents for sqlite error codes
+** are sane. The parameter is an integer representing an sqlite error code.
+** The result is a list of two elements, the string representation of the
+** error code and the english language explanation.
+*/
+static int test_errstr(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ char *zCode;
+ int i;
+ if( objc!=1 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "<error code>");
+ }
+
+ zCode = Tcl_GetString(objv[1]);
+ for(i=0; i<200; i++){
+ if( 0==strcmp(errorName(i), zCode) ) break;
+ }
+ Tcl_SetResult(interp, (char *)sqlite3ErrStr(i), 0);
+ return TCL_OK;
+}
+
+static int sqlite3_crashparams(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifdef OS_TEST
+ int delay;
+ if( objc!=3 ) goto bad_args;
+ if( Tcl_GetIntFromObj(interp, objv[1], &delay) ) return TCL_ERROR;
+ sqlite3SetCrashParams(delay, Tcl_GetString(objv[2]));
+#endif
+ return TCL_OK;
+
+#ifdef OS_TEST
+bad_args:
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), "<delay> <filename>", 0);
+ return TCL_ERROR;
+#endif
+}
+
+
+/*
+** Usage: breakpoint
+**
+** This routine exists for one purpose - to provide a place to put a
+** breakpoint with GDB that can be triggered using TCL code. The use
+** for this is when a particular test fails on (say) the 1485th iteration.
+** In the TCL test script, we can add code like this:
+**
+** if {$i==1485} breakpoint
+**
+** Then run testfixture in the debugger and wait for the breakpoint to
+** fire. Then additional breakpoints can be set to trace down the bug.
+*/
+static int test_breakpoint(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ return TCL_OK; /* Do nothing */
+}
+
+/*
+** Usage: sqlite3_bind_int STMT N VALUE
+**
+** Test the sqlite3_bind_int interface. STMT is a prepared statement.
+** N is the index of a wildcard in the prepared statement. This command
+** binds a 32-bit integer VALUE to that wildcard.
+*/
+static int test_bind_int(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int idx;
+ int value;
+ int rc;
+
+ if( objc!=4 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[3], &value) ) return TCL_ERROR;
+
+ rc = sqlite3_bind_int(pStmt, idx, value);
+ if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
+ if( rc!=SQLITE_OK ){
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+
+/*
+** Usage: sqlite3_bind_int64 STMT N VALUE
+**
+** Test the sqlite3_bind_int64 interface. STMT is a prepared statement.
+** N is the index of a wildcard in the prepared statement. This command
+** binds a 64-bit integer VALUE to that wildcard.
+*/
+static int test_bind_int64(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int idx;
+ i64 value;
+ int rc;
+
+ if( objc!=4 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR;
+ if( Tcl_GetWideIntFromObj(interp, objv[3], &value) ) return TCL_ERROR;
+
+ rc = sqlite3_bind_int64(pStmt, idx, value);
+ if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
+ if( rc!=SQLITE_OK ){
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+
+/*
+** Usage: sqlite3_bind_double STMT N VALUE
+**
+** Test the sqlite3_bind_double interface. STMT is a prepared statement.
+** N is the index of a wildcard in the prepared statement. This command
+** binds a 64-bit integer VALUE to that wildcard.
+*/
+static int test_bind_double(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int idx;
+ double value;
+ int rc;
+
+ if( objc!=4 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR;
+ if( Tcl_GetDoubleFromObj(interp, objv[3], &value) ) return TCL_ERROR;
+
+ rc = sqlite3_bind_double(pStmt, idx, value);
+ if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
+ if( rc!=SQLITE_OK ){
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_bind_null STMT N
+**
+** Test the sqlite3_bind_null interface. STMT is a prepared statement.
+** N is the index of a wildcard in the prepared statement. This command
+** binds a NULL to the wildcard.
+*/
+static int test_bind_null(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int idx;
+ int rc;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " STMT N", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR;
+
+ rc = sqlite3_bind_null(pStmt, idx);
+ if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
+ if( rc!=SQLITE_OK ){
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_bind_text STMT N STRING BYTES
+**
+** Test the sqlite3_bind_text interface. STMT is a prepared statement.
+** N is the index of a wildcard in the prepared statement. This command
+** binds a UTF-8 string STRING to the wildcard. The string is BYTES bytes
+** long.
+*/
+static int test_bind_text(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int idx;
+ int bytes;
+ char *value;
+ int rc;
+
+ if( objc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE BYTES", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR;
+ value = Tcl_GetString(objv[3]);
+ if( Tcl_GetIntFromObj(interp, objv[4], &bytes) ) return TCL_ERROR;
+
+ rc = sqlite3_bind_text(pStmt, idx, value, bytes, SQLITE_TRANSIENT);
+ if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, sqlite3TestErrorName(rc), 0);
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_bind_text16 STMT N STRING BYTES
+**
+** Test the sqlite3_bind_text16 interface. STMT is a prepared statement.
+** N is the index of a wildcard in the prepared statement. This command
+** binds a UTF-16 string STRING to the wildcard. The string is BYTES bytes
+** long.
+*/
+static int test_bind_text16(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifndef SQLITE_OMIT_UTF16
+ sqlite3_stmt *pStmt;
+ int idx;
+ int bytes;
+ char *value;
+ int rc;
+
+ if( objc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " STMT N VALUE BYTES", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR;
+ value = Tcl_GetByteArrayFromObj(objv[3], 0);
+ if( Tcl_GetIntFromObj(interp, objv[4], &bytes) ) return TCL_ERROR;
+
+ rc = sqlite3_bind_text16(pStmt, idx, (void *)value, bytes, SQLITE_TRANSIENT);
+ if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
+ if( rc!=SQLITE_OK ){
+ return TCL_ERROR;
+ }
+
+#endif /* SQLITE_OMIT_UTF16 */
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_bind_blob STMT N DATA BYTES
+**
+** Test the sqlite3_bind_blob interface. STMT is a prepared statement.
+** N is the index of a wildcard in the prepared statement. This command
+** binds a BLOB to the wildcard. The BLOB is BYTES bytes in size.
+*/
+static int test_bind_blob(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int idx;
+ int bytes;
+ char *value;
+ int rc;
+
+ if( objc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " STMT N DATA BYTES", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &idx) ) return TCL_ERROR;
+ value = Tcl_GetString(objv[3]);
+ if( Tcl_GetIntFromObj(interp, objv[4], &bytes) ) return TCL_ERROR;
+
+ rc = sqlite3_bind_blob(pStmt, idx, value, bytes, SQLITE_TRANSIENT);
+ if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
+ if( rc!=SQLITE_OK ){
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_bind_parameter_count STMT
+**
+** Return the number of wildcards in the given statement.
+*/
+static int test_bind_parameter_count(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "STMT");
+ return TCL_ERROR;
+ }
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_bind_parameter_count(pStmt)));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_bind_parameter_name STMT N
+**
+** Return the name of the Nth wildcard. The first wildcard is 1.
+** An empty string is returned if N is out of range or if the wildcard
+** is nameless.
+*/
+static int test_bind_parameter_name(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int i;
+
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "STMT N");
+ return TCL_ERROR;
+ }
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &i) ) return TCL_ERROR;
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(sqlite3_bind_parameter_name(pStmt,i),-1)
+ );
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_bind_parameter_index STMT NAME
+**
+** Return the index of the wildcard called NAME. Return 0 if there is
+** no such wildcard.
+*/
+static int test_bind_parameter_index(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "STMT NAME");
+ return TCL_ERROR;
+ }
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(
+ sqlite3_bind_parameter_index(pStmt,Tcl_GetString(objv[2]))
+ )
+ );
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_clear_bindings STMT
+**
+*/
+#if 0
+static int test_clear_bindings(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "STMT");
+ return TCL_ERROR;
+ }
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_clear_bindings(pStmt)));
+ return TCL_OK;
+}
+#endif
+
+/*
+** Usage: sqlite3_errcode DB
+**
+** Return the string representation of the most recent sqlite3_* API
+** error code. e.g. "SQLITE_ERROR".
+*/
+static int test_errcode(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3 *db;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " DB", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+ Tcl_SetResult(interp, (char *)errorName(sqlite3_errcode(db)), 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: test_errmsg DB
+**
+** Returns the UTF-8 representation of the error message string for the
+** most recent sqlite3_* API call.
+*/
+static int test_errmsg(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3 *db;
+ const char *zErr;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " DB", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+
+ zErr = sqlite3_errmsg(db);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(zErr, -1));
+ return TCL_OK;
+}
+
+/*
+** Usage: test_errmsg16 DB
+**
+** Returns the UTF-16 representation of the error message string for the
+** most recent sqlite3_* API call. This is a byte array object at the TCL
+** level, and it includes the 0x00 0x00 terminator bytes at the end of the
+** UTF-16 string.
+*/
+static int test_errmsg16(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifndef SQLITE_OMIT_UTF16
+ sqlite3 *db;
+ const void *zErr;
+ int bytes;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " DB", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+
+ zErr = sqlite3_errmsg16(db);
+ bytes = sqlite3utf16ByteLen(zErr, -1);
+ Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(zErr, bytes));
+#endif /* SQLITE_OMIT_UTF16 */
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_prepare DB sql bytes tailvar
+**
+** Compile up to <bytes> bytes of the supplied SQL string <sql> using
+** database handle <DB>. The parameter <tailval> is the name of a global
+** variable that is set to the unused portion of <sql> (if any). A
+** STMT handle is returned.
+*/
+static int test_prepare(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3 *db;
+ const char *zSql;
+ int bytes;
+ const char *zTail = 0;
+ sqlite3_stmt *pStmt = 0;
+ char zBuf[50];
+ int rc;
+
+ if( objc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+ zSql = Tcl_GetString(objv[2]);
+ if( Tcl_GetIntFromObj(interp, objv[3], &bytes) ) return TCL_ERROR;
+
+ rc = sqlite3_prepare(db, zSql, bytes, &pStmt, &zTail);
+ if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ if( zTail ){
+ if( bytes>=0 ){
+ bytes = bytes - (zTail-zSql);
+ }
+ Tcl_ObjSetVar2(interp, objv[4], 0, Tcl_NewStringObj(zTail, bytes), 0);
+ }
+ if( rc!=SQLITE_OK ){
+ assert( pStmt==0 );
+ sprintf(zBuf, "(%d) ", rc);
+ Tcl_AppendResult(interp, zBuf, sqlite3_errmsg(db), 0);
+ return TCL_ERROR;
+ }
+
+ if( pStmt ){
+ if( makePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR;
+ Tcl_AppendResult(interp, zBuf, 0);
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_prepare DB sql bytes tailvar
+**
+** Compile up to <bytes> bytes of the supplied SQL string <sql> using
+** database handle <DB>. The parameter <tailval> is the name of a global
+** variable that is set to the unused portion of <sql> (if any). A
+** STMT handle is returned.
+*/
+static int test_prepare16(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifndef SQLITE_OMIT_UTF16
+ sqlite3 *db;
+ const void *zSql;
+ const void *zTail = 0;
+ Tcl_Obj *pTail = 0;
+ sqlite3_stmt *pStmt = 0;
+ char zBuf[50];
+ int rc;
+ int bytes; /* The integer specified as arg 3 */
+ int objlen; /* The byte-array length of arg 2 */
+
+ if( objc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+ zSql = Tcl_GetByteArrayFromObj(objv[2], &objlen);
+ if( Tcl_GetIntFromObj(interp, objv[3], &bytes) ) return TCL_ERROR;
+
+ rc = sqlite3_prepare16(db, zSql, bytes, &pStmt, &zTail);
+ if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
+ if( rc ){
+ return TCL_ERROR;
+ }
+
+ if( zTail ){
+ objlen = objlen - ((u8 *)zTail-(u8 *)zSql);
+ }else{
+ objlen = 0;
+ }
+ pTail = Tcl_NewByteArrayObj((u8 *)zTail, objlen);
+ Tcl_IncrRefCount(pTail);
+ Tcl_ObjSetVar2(interp, objv[4], 0, pTail, 0);
+ Tcl_DecrRefCount(pTail);
+
+ if( pStmt ){
+ if( makePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR;
+ }
+ Tcl_AppendResult(interp, zBuf, 0);
+#endif /* SQLITE_OMIT_UTF16 */
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_open filename ?options-list?
+*/
+static int test_open(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ const char *zFilename;
+ sqlite3 *db;
+ int rc;
+ char zBuf[100];
+
+ if( objc!=3 && objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " filename options-list", 0);
+ return TCL_ERROR;
+ }
+
+ zFilename = Tcl_GetString(objv[1]);
+ rc = sqlite3_open(zFilename, &db);
+
+ if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR;
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_open16 filename options
+*/
+static int test_open16(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifndef SQLITE_OMIT_UTF16
+ const void *zFilename;
+ sqlite3 *db;
+ int rc;
+ char zBuf[100];
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " filename options-list", 0);
+ return TCL_ERROR;
+ }
+
+ zFilename = Tcl_GetByteArrayFromObj(objv[1], 0);
+ rc = sqlite3_open16(zFilename, &db);
+
+ if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR;
+ Tcl_AppendResult(interp, zBuf, 0);
+#endif /* SQLITE_OMIT_UTF16 */
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_complete16 <UTF-16 string>
+**
+** Return 1 if the supplied argument is a complete SQL statement, or zero
+** otherwise.
+*/
+static int test_complete16(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#if !defined(SQLITE_OMIT_COMPLETE) && !defined(SQLITE_OMIT_UTF16)
+ char *zBuf;
+
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "<utf-16 sql>");
+ return TCL_ERROR;
+ }
+
+ zBuf = Tcl_GetByteArrayFromObj(objv[1], 0);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_complete16(zBuf)));
+#endif /* SQLITE_OMIT_COMPLETE && SQLITE_OMIT_UTF16 */
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_step STMT
+**
+** Advance the statement to the next row.
+*/
+static int test_step(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int rc;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ rc = sqlite3_step(pStmt);
+
+ /* if( rc!=SQLITE_DONE && rc!=SQLITE_ROW ) return TCL_ERROR; */
+ Tcl_SetResult(interp, (char *)errorName(rc), 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_column_count STMT
+**
+** Return the number of columns returned by the sql statement STMT.
+*/
+static int test_column_count(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT column", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_column_count(pStmt)));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_column_type STMT column
+**
+** Return the type of the data in column 'column' of the current row.
+*/
+static int test_column_type(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int col;
+ int tp;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT column", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR;
+
+ tp = sqlite3_column_type(pStmt, col);
+ switch( tp ){
+ case SQLITE_INTEGER:
+ Tcl_SetResult(interp, "INTEGER", TCL_STATIC);
+ break;
+ case SQLITE_NULL:
+ Tcl_SetResult(interp, "NULL", TCL_STATIC);
+ break;
+ case SQLITE_FLOAT:
+ Tcl_SetResult(interp, "FLOAT", TCL_STATIC);
+ break;
+ case SQLITE_TEXT:
+ Tcl_SetResult(interp, "TEXT", TCL_STATIC);
+ break;
+ case SQLITE_BLOB:
+ Tcl_SetResult(interp, "BLOB", TCL_STATIC);
+ break;
+ default:
+ assert(0);
+ }
+
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_column_int64 STMT column
+**
+** Return the data in column 'column' of the current row cast as an
+** wide (64-bit) integer.
+*/
+static int test_column_int64(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int col;
+ i64 iVal;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT column", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR;
+
+ iVal = sqlite3_column_int64(pStmt, col);
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(iVal));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_column_blob STMT column
+*/
+static int test_column_blob(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int col;
+
+ int len;
+ const void *pBlob;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT column", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR;
+
+ pBlob = sqlite3_column_blob(pStmt, col);
+ len = sqlite3_column_bytes(pStmt, col);
+ Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(pBlob, len));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_column_double STMT column
+**
+** Return the data in column 'column' of the current row cast as a double.
+*/
+static int test_column_double(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int col;
+ double rVal;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT column", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR;
+
+ rVal = sqlite3_column_double(pStmt, col);
+ Tcl_SetObjResult(interp, Tcl_NewDoubleObj(rVal));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_data_count STMT
+**
+** Return the number of columns returned by the sql statement STMT.
+*/
+static int test_data_count(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT column", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_data_count(pStmt)));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_column_text STMT column
+**
+** Usage: sqlite3_column_decltype STMT column
+**
+** Usage: sqlite3_column_name STMT column
+*/
+static int test_stmt_utf8(
+ void * clientData, /* Pointer to SQLite API function to be invoke */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int col;
+ const char *(*xFunc)(sqlite3_stmt*, int) = clientData;
+ const char *zRet;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT column", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR;
+ zRet = xFunc(pStmt, col);
+ if( zRet ){
+ Tcl_SetResult(interp, (char *)zRet, 0);
+ }
+ return TCL_OK;
+}
+
+static int test_global_recover(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifndef SQLITE_OMIT_GLOBALRECOVER
+ int rc;
+ if( objc!=1 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "");
+ return TCL_ERROR;
+ }
+ rc = sqlite3_global_recover();
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+#endif
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_column_text STMT column
+**
+** Usage: sqlite3_column_decltype STMT column
+**
+** Usage: sqlite3_column_name STMT column
+*/
+static int test_stmt_utf16(
+ void * clientData, /* Pointer to SQLite API function to be invoked */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifndef SQLITE_OMIT_UTF16
+ sqlite3_stmt *pStmt;
+ int col;
+ Tcl_Obj *pRet;
+ const void *zName16;
+ const void *(*xFunc)(sqlite3_stmt*, int) = clientData;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT column", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR;
+
+ zName16 = xFunc(pStmt, col);
+ if( zName16 ){
+ pRet = Tcl_NewByteArrayObj(zName16, sqlite3utf16ByteLen(zName16, -1)+2);
+ Tcl_SetObjResult(interp, pRet);
+ }
+#endif /* SQLITE_OMIT_UTF16 */
+
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_column_int STMT column
+**
+** Usage: sqlite3_column_bytes STMT column
+**
+** Usage: sqlite3_column_bytes16 STMT column
+**
+*/
+static int test_stmt_int(
+ void * clientData, /* Pointer to SQLite API function to be invoked */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_stmt *pStmt;
+ int col;
+ int (*xFunc)(sqlite3_stmt*, int) = clientData;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " STMT column", 0);
+ return TCL_ERROR;
+ }
+
+ if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &col) ) return TCL_ERROR;
+
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(xFunc(pStmt, col)));
+ return TCL_OK;
+}
+
+#ifndef SQLITE_OMIT_DISKIO
+/*
+** Usage: sqlite3OsOpenReadWrite <filename>
+*/
+static int test_sqlite3OsOpenReadWrite(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ OsFile * pFile;
+ int rc;
+ int dummy;
+ char zBuf[100];
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " filename", 0);
+ return TCL_ERROR;
+ }
+
+ pFile = sqliteMalloc(sizeof(OsFile));
+ rc = sqlite3OsOpenReadWrite(Tcl_GetString(objv[1]), pFile, &dummy);
+ if( rc!=SQLITE_OK ){
+ sqliteFree(pFile);
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ makePointerStr(interp, zBuf, pFile);
+ Tcl_SetResult(interp, zBuf, 0);
+ return TCL_ERROR;
+}
+
+/*
+** Usage: sqlite3OsClose <file handle>
+*/
+static int test_sqlite3OsClose(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ OsFile * pFile;
+ int rc;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " filehandle", 0);
+ return TCL_ERROR;
+ }
+
+ if( getFilePointer(interp, Tcl_GetString(objv[1]), &pFile) ){
+ return TCL_ERROR;
+ }
+ rc = sqlite3OsClose(pFile);
+ if( rc!=SQLITE_OK ){
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ sqliteFree(pFile);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3OsLock <file handle> <locktype>
+*/
+static int test_sqlite3OsLock(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ OsFile * pFile;
+ int rc;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]),
+ " filehandle (SHARED|RESERVED|PENDING|EXCLUSIVE)", 0);
+ return TCL_ERROR;
+ }
+
+ if( getFilePointer(interp, Tcl_GetString(objv[1]), &pFile) ){
+ return TCL_ERROR;
+ }
+
+ if( 0==strcmp("SHARED", Tcl_GetString(objv[2])) ){
+ rc = sqlite3OsLock(pFile, SHARED_LOCK);
+ }
+ else if( 0==strcmp("RESERVED", Tcl_GetString(objv[2])) ){
+ rc = sqlite3OsLock(pFile, RESERVED_LOCK);
+ }
+ else if( 0==strcmp("PENDING", Tcl_GetString(objv[2])) ){
+ rc = sqlite3OsLock(pFile, PENDING_LOCK);
+ }
+ else if( 0==strcmp("EXCLUSIVE", Tcl_GetString(objv[2])) ){
+ rc = sqlite3OsLock(pFile, EXCLUSIVE_LOCK);
+ }else{
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]),
+ " filehandle (SHARED|RESERVED|PENDING|EXCLUSIVE)", 0);
+ return TCL_ERROR;
+ }
+
+ if( rc!=SQLITE_OK ){
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3OsUnlock <file handle>
+*/
+static int test_sqlite3OsUnlock(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ OsFile * pFile;
+ int rc;
+
+ if( objc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetString(objv[0]), " filehandle", 0);
+ return TCL_ERROR;
+ }
+
+ if( getFilePointer(interp, Tcl_GetString(objv[1]), &pFile) ){
+ return TCL_ERROR;
+ }
+ rc = sqlite3OsUnlock(pFile, NO_LOCK);
+ if( rc!=SQLITE_OK ){
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3OsTempFileName
+*/
+static int test_sqlite3OsTempFileName(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ char zFile[SQLITE_TEMPNAME_SIZE];
+ int rc;
+
+ rc = sqlite3OsTempFileName(zFile);
+ if( rc!=SQLITE_OK ){
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ Tcl_AppendResult(interp, zFile, 0);
+ return TCL_OK;
+}
+#endif
+
+/*
+** Usage: sqlite_set_magic DB MAGIC-NUMBER
+**
+** Set the db->magic value. This is used to test error recovery logic.
+*/
+static int sqlite_set_magic(
+ void * clientData,
+ Tcl_Interp *interp,
+ int argc,
+ char **argv
+){
+ sqlite3 *db;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB MAGIC", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ if( strcmp(argv[2], "SQLITE_MAGIC_OPEN")==0 ){
+ db->magic = SQLITE_MAGIC_OPEN;
+ }else if( strcmp(argv[2], "SQLITE_MAGIC_CLOSED")==0 ){
+ db->magic = SQLITE_MAGIC_CLOSED;
+ }else if( strcmp(argv[2], "SQLITE_MAGIC_BUSY")==0 ){
+ db->magic = SQLITE_MAGIC_BUSY;
+ }else if( strcmp(argv[2], "SQLITE_MAGIC_ERROR")==0 ){
+ db->magic = SQLITE_MAGIC_ERROR;
+ }else if( Tcl_GetInt(interp, argv[2], &db->magic) ){
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_interrupt DB
+**
+** Trigger an interrupt on DB
+*/
+static int test_interrupt(
+ void * clientData,
+ Tcl_Interp *interp,
+ int argc,
+ char **argv
+){
+ sqlite3 *db;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ sqlite3_interrupt(db);
+ return TCL_OK;
+}
+
+static u8 *sqlite3_stack_baseline = 0;
+
+/*
+** Fill the stack with a known bitpattern.
+*/
+static void prepStack(void){
+ int i;
+ u32 bigBuf[65536];
+ for(i=0; i<sizeof(bigBuf); i++) bigBuf[i] = 0xdeadbeef;
+ sqlite3_stack_baseline = (u8*)&bigBuf[65536];
+}
+
+/*
+** Get the current stack depth. Used for debugging only.
+*/
+u64 sqlite3StackDepth(void){
+ u8 x;
+ return (u64)(sqlite3_stack_baseline - &x);
+}
+
+/*
+** Usage: sqlite3_stack_used DB SQL
+**
+** Try to measure the amount of stack space used by a call to sqlite3_exec
+*/
+static int test_stack_used(
+ void * clientData,
+ Tcl_Interp *interp,
+ int argc,
+ char **argv
+){
+ sqlite3 *db;
+ int i;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB SQL", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ prepStack();
+ sqlite3_exec(db, argv[2], 0, 0, 0);
+ for(i=65535; i>=0 && ((u32*)sqlite3_stack_baseline)[-i]==0xdeadbeef; i--){}
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(i*4));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite_delete_function DB function-name
+**
+** Delete the user function 'function-name' from database handle DB. It
+** is assumed that the user function was created as UTF8, any number of
+** arguments (the way the TCL interface does it).
+*/
+static int delete_function(
+ void * clientData,
+ Tcl_Interp *interp,
+ int argc,
+ char **argv
+){
+ int rc;
+ sqlite3 *db;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB function-name", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ rc = sqlite3_create_function(db, argv[2], -1, SQLITE_UTF8, 0, 0, 0, 0);
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite_delete_collation DB collation-name
+**
+** Delete the collation sequence 'collation-name' from database handle
+** DB. It is assumed that the collation sequence was created as UTF8 (the
+** way the TCL interface does it).
+*/
+static int delete_collation(
+ void * clientData,
+ Tcl_Interp *interp,
+ int argc,
+ char **argv
+){
+ int rc;
+ sqlite3 *db;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB function-name", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ rc = sqlite3_create_collation(db, argv[2], SQLITE_UTF8, 0, 0);
+ Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_get_autocommit DB
+**
+** Return true if the database DB is currently in auto-commit mode.
+** Return false if not.
+*/
+static int get_autocommit(
+ void * clientData,
+ Tcl_Interp *interp,
+ int argc,
+ char **argv
+){
+ char zBuf[30];
+ sqlite3 *db;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ sprintf(zBuf, "%d", sqlite3_get_autocommit(db));
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: tcl_variable_type VARIABLENAME
+**
+** Return the name of the internal representation for the
+** value of the given variable.
+*/
+static int tcl_variable_type(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ Tcl_Obj *pVar;
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "VARIABLE");
+ return TCL_ERROR;
+ }
+ pVar = Tcl_GetVar2Ex(interp, Tcl_GetString(objv[1]), 0, TCL_LEAVE_ERR_MSG);
+ if( pVar==0 ) return TCL_ERROR;
+ if( pVar->typePtr ){
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(pVar->typePtr->name, -1));
+ }
+ return TCL_OK;
+}
+
+/*
+** This routine sets entries in the global ::sqlite_options() array variable
+** according to the compile-time configuration of the database. Test
+** procedures use this to determine when tests should be omitted.
+*/
+static void set_options(Tcl_Interp *interp){
+#ifdef SQLITE_32BIT_ROWID
+ Tcl_SetVar2(interp, "sqlite_options", "rowid32", "1", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "rowid32", "0", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_CASE_SENSITIVE_LIKE
+ Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","1",TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_ALTERTABLE
+ Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_ANALYZE
+ Tcl_SetVar2(interp, "sqlite_options", "analyze", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "analyze", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_AUTHORIZATION
+ Tcl_SetVar2(interp, "sqlite_options", "auth", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "auth", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_AUTOINCREMENT
+ Tcl_SetVar2(interp, "sqlite_options", "autoinc", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "autoinc", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "1", TCL_GLOBAL_ONLY);
+#endif /* SQLITE_OMIT_AUTOVACUUM */
+#if !defined(SQLITE_DEFAULT_AUTOVACUUM) || SQLITE_DEFAULT_AUTOVACUUM==0
+ Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","0",TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","1",TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION
+ Tcl_SetVar2(interp, "sqlite_options", "between_opt", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "between_opt", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_BLOB_LITERAL
+ Tcl_SetVar2(interp, "sqlite_options", "bloblit", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "bloblit", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_CAST
+ Tcl_SetVar2(interp, "sqlite_options", "cast", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "cast", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_COMPLETE
+ Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "complete", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_COMPOUND_SELECT
+ Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_CONFLICT_CLAUSE
+ Tcl_SetVar2(interp, "sqlite_options", "conflict", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_DATETIME_FUNCS
+ Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_DISKIO
+ Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "diskio", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_EXPLAIN
+ Tcl_SetVar2(interp, "sqlite_options", "explain", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "explain", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_FLOATING_POINT
+ Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_FOREIGN_KEY
+ Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_GLOBALRECOVER
+ Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_INTEGRITY_CHECK
+ Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "integrityck", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_LIKE_OPTIMIZATION
+ Tcl_SetVar2(interp, "sqlite_options", "like_opt", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "like_opt", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_MEMORYDB
+ Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "memorydb", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_OR_OPTIMIZATION
+ Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "or_opt", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_PAGER_PRAGMAS
+ Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_PARSER
+ Tcl_SetVar2(interp, "sqlite_options", "parser", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "parser", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#if defined(SQLITE_OMIT_PRAGMA) || defined(SQLITE_OMIT_FLAG_PRAGMAS)
+ Tcl_SetVar2(interp, "sqlite_options", "pragma", "0", TCL_GLOBAL_ONLY);
+ Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "pragma", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_PROGRESS_CALLBACK
+ Tcl_SetVar2(interp, "sqlite_options", "progress", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_REINDEX
+ Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "reindex", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_SCHEMA_PRAGMAS
+ Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
+ Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_SUBQUERY
+ Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "subquery", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_TCL_VARIABLE
+ Tcl_SetVar2(interp, "sqlite_options", "tclvar", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "tclvar", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#if defined(THREADSAFE) && THREADSAFE
+ Tcl_SetVar2(interp, "sqlite_options", "threadsafe", "1", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "threadsafe", "0", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_TRACE
+ Tcl_SetVar2(interp, "sqlite_options", "trace", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "trace", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_TRIGGER
+ Tcl_SetVar2(interp, "sqlite_options", "trigger", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "trigger", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_TEMPDB
+ Tcl_SetVar2(interp, "sqlite_options", "tempdb", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "tempdb", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_UTF16
+ Tcl_SetVar2(interp, "sqlite_options", "utf16", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "utf16", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_VACUUM
+ Tcl_SetVar2(interp, "sqlite_options", "vacuum", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "vacuum", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_OMIT_VIEW
+ Tcl_SetVar2(interp, "sqlite_options", "view", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "view", "1", TCL_GLOBAL_ONLY);
+#endif
+}
+
+/*
+** Register commands with the TCL interpreter.
+*/
+int Sqlitetest1_Init(Tcl_Interp *interp){
+ extern int sqlite3_search_count;
+ extern int sqlite3_interrupt_count;
+ extern int sqlite3_open_file_count;
+ extern int sqlite3_sort_count;
+ extern int sqlite3_current_time;
+ static struct {
+ char *zName;
+ Tcl_CmdProc *xProc;
+ } aCmd[] = {
+ { "sqlite3_mprintf_int", (Tcl_CmdProc*)sqlite3_mprintf_int },
+ { "sqlite3_mprintf_int64", (Tcl_CmdProc*)sqlite3_mprintf_int64 },
+ { "sqlite3_mprintf_str", (Tcl_CmdProc*)sqlite3_mprintf_str },
+ { "sqlite3_mprintf_stronly", (Tcl_CmdProc*)sqlite3_mprintf_stronly},
+ { "sqlite3_mprintf_double", (Tcl_CmdProc*)sqlite3_mprintf_double },
+ { "sqlite3_mprintf_scaled", (Tcl_CmdProc*)sqlite3_mprintf_scaled },
+ { "sqlite3_mprintf_hexdouble", (Tcl_CmdProc*)sqlite3_mprintf_hexdouble},
+ { "sqlite3_mprintf_z_test", (Tcl_CmdProc*)test_mprintf_z },
+ { "sqlite3_last_insert_rowid", (Tcl_CmdProc*)test_last_rowid },
+ { "sqlite3_exec_printf", (Tcl_CmdProc*)test_exec_printf },
+ { "sqlite3_get_table_printf", (Tcl_CmdProc*)test_get_table_printf },
+ { "sqlite3_close", (Tcl_CmdProc*)sqlite_test_close },
+ { "sqlite3_create_function", (Tcl_CmdProc*)test_create_function },
+ { "sqlite3_create_aggregate", (Tcl_CmdProc*)test_create_aggregate },
+ { "sqlite_register_test_function", (Tcl_CmdProc*)test_register_func },
+ { "sqlite_abort", (Tcl_CmdProc*)sqlite_abort },
+#ifdef SQLITE_MEMDEBUG
+ { "sqlite_malloc_fail", (Tcl_CmdProc*)sqlite_malloc_fail },
+ { "sqlite_malloc_stat", (Tcl_CmdProc*)sqlite_malloc_stat },
+#endif
+ { "sqlite_bind", (Tcl_CmdProc*)test_bind },
+ { "breakpoint", (Tcl_CmdProc*)test_breakpoint },
+ { "sqlite3_key", (Tcl_CmdProc*)test_key },
+ { "sqlite3_rekey", (Tcl_CmdProc*)test_rekey },
+ { "sqlite_set_magic", (Tcl_CmdProc*)sqlite_set_magic },
+ { "sqlite3_interrupt", (Tcl_CmdProc*)test_interrupt },
+#if 0
+ { "sqlite3_sleep", (Tcl_CmdProc*)test_sleep },
+#endif
+ { "sqlite_delete_function", (Tcl_CmdProc*)delete_function },
+ { "sqlite_delete_collation", (Tcl_CmdProc*)delete_collation },
+ { "sqlite3_get_autocommit", (Tcl_CmdProc*)get_autocommit },
+ { "sqlite3_stack_used", (Tcl_CmdProc*)test_stack_used },
+ };
+ static struct {
+ char *zName;
+ Tcl_ObjCmdProc *xProc;
+ void *clientData;
+ } aObjCmd[] = {
+ { "sqlite3_bind_int", test_bind_int, 0 },
+ { "sqlite3_bind_int64", test_bind_int64, 0 },
+ { "sqlite3_bind_double", test_bind_double, 0 },
+ { "sqlite3_bind_null", test_bind_null ,0 },
+ { "sqlite3_bind_text", test_bind_text ,0 },
+ { "sqlite3_bind_text16", test_bind_text16 ,0 },
+ { "sqlite3_bind_blob", test_bind_blob ,0 },
+ { "sqlite3_bind_parameter_count", test_bind_parameter_count, 0},
+ { "sqlite3_bind_parameter_name", test_bind_parameter_name, 0},
+ { "sqlite3_bind_parameter_index", test_bind_parameter_index, 0},
+#if 0
+ { "sqlite3_clear_bindings", test_clear_bindings, 0},
+#endif
+ { "sqlite3_errcode", test_errcode ,0 },
+ { "sqlite3_errmsg", test_errmsg ,0 },
+ { "sqlite3_errmsg16", test_errmsg16 ,0 },
+ { "sqlite3_open", test_open ,0 },
+ { "sqlite3_open16", test_open16 ,0 },
+ { "sqlite3_complete16", test_complete16 ,0 },
+
+ { "sqlite3_prepare", test_prepare ,0 },
+ { "sqlite3_prepare16", test_prepare16 ,0 },
+ { "sqlite3_finalize", test_finalize ,0 },
+ { "sqlite3_reset", test_reset ,0 },
+ { "sqlite3_expired", test_expired ,0 },
+ { "sqlite3_transfer_bindings", test_transfer_bind ,0 },
+ { "sqlite3_changes", test_changes ,0 },
+ { "sqlite3_step", test_step ,0 },
+
+ /* sqlite3_column_*() API */
+ { "sqlite3_column_count", test_column_count ,0 },
+ { "sqlite3_data_count", test_data_count ,0 },
+ { "sqlite3_column_type", test_column_type ,0 },
+ { "sqlite3_column_blob", test_column_blob ,0 },
+ { "sqlite3_column_double", test_column_double ,0 },
+ { "sqlite3_column_int64", test_column_int64 ,0 },
+ { "sqlite3_column_text", test_stmt_utf8, sqlite3_column_text },
+ { "sqlite3_column_decltype", test_stmt_utf8, sqlite3_column_decltype },
+ { "sqlite3_column_name", test_stmt_utf8, sqlite3_column_name },
+ { "sqlite3_column_int", test_stmt_int, sqlite3_column_int },
+ { "sqlite3_column_bytes", test_stmt_int, sqlite3_column_bytes },
+#ifndef SQLITE_OMIT_UTF16
+ { "sqlite3_column_bytes16", test_stmt_int, sqlite3_column_bytes16 },
+ { "sqlite3_column_text16", test_stmt_utf16, sqlite3_column_text16 },
+ { "sqlite3_column_decltype16", test_stmt_utf16, sqlite3_column_decltype16},
+ { "sqlite3_column_name16", test_stmt_utf16, sqlite3_column_name16 },
+#endif
+ { "sqlite3_global_recover", test_global_recover, 0 },
+
+ /* Functions from os.h */
+#ifndef SQLITE_OMIT_DISKIO
+ { "sqlite3OsOpenReadWrite",test_sqlite3OsOpenReadWrite, 0 },
+ { "sqlite3OsClose", test_sqlite3OsClose, 0 },
+ { "sqlite3OsLock", test_sqlite3OsLock, 0 },
+ { "sqlite3OsTempFileName", test_sqlite3OsTempFileName, 0 },
+
+ /* Custom test interfaces */
+ { "sqlite3OsUnlock", test_sqlite3OsUnlock, 0 },
+#endif
+#ifndef SQLITE_OMIT_UTF16
+ { "add_test_collate", test_collate, 0 },
+ { "add_test_collate_needed", test_collate_needed, 0 },
+ { "add_test_function", test_function, 0 },
+#endif
+ { "sqlite3_crashparams", sqlite3_crashparams, 0 },
+ { "sqlite3_test_errstr", test_errstr, 0 },
+ { "tcl_variable_type", tcl_variable_type, 0 },
+ };
+ static int bitmask_size = sizeof(Bitmask)*8;
+ int i;
+ extern int sqlite3_os_trace;
+ extern int sqlite3_where_trace;
+ extern int sqlite3_sync_count, sqlite3_fullsync_count;
+ extern int sqlite3_opentemp_count;
+ extern int sqlite3_memUsed;
+ extern int sqlite3_memMax;
+ extern int sqlite3_like_count;
+#if OS_WIN
+ extern int sqlite3_os_type;
+#endif
+#ifdef SQLITE_DEBUG
+ extern int sqlite3_vdbe_addop_trace;
+#endif
+#ifdef SQLITE_TEST
+ extern char sqlite3_query_plan[];
+ static char *query_plan = sqlite3_query_plan;
+#endif
+
+ for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
+ Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
+ }
+ for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
+ Tcl_CreateObjCommand(interp, aObjCmd[i].zName,
+ aObjCmd[i].xProc, aObjCmd[i].clientData, 0);
+ }
+ Tcl_LinkVar(interp, "sqlite_search_count",
+ (char*)&sqlite3_search_count, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_sort_count",
+ (char*)&sqlite3_sort_count, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_like_count",
+ (char*)&sqlite3_like_count, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_interrupt_count",
+ (char*)&sqlite3_interrupt_count, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_open_file_count",
+ (char*)&sqlite3_open_file_count, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_current_time",
+ (char*)&sqlite3_current_time, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_os_trace",
+ (char*)&sqlite3_os_trace, TCL_LINK_INT);
+#if OS_WIN
+ Tcl_LinkVar(interp, "sqlite_os_type",
+ (char*)&sqlite3_os_type, TCL_LINK_INT);
+#endif
+#ifdef SQLITE_TEST
+ Tcl_LinkVar(interp, "sqlite_query_plan",
+ (char*)&query_plan, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
+#endif
+#ifdef SQLITE_DEBUG
+ Tcl_LinkVar(interp, "sqlite_addop_trace",
+ (char*)&sqlite3_vdbe_addop_trace, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_where_trace",
+ (char*)&sqlite3_where_trace, TCL_LINK_INT);
+#endif
+#ifdef SQLITE_MEMDEBUG
+ Tcl_LinkVar(interp, "sqlite_memused",
+ (char*)&sqlite3_memUsed, TCL_LINK_INT | TCL_LINK_READ_ONLY);
+ Tcl_LinkVar(interp, "sqlite_memmax",
+ (char*)&sqlite3_memMax, TCL_LINK_INT | TCL_LINK_READ_ONLY);
+#endif
+#ifndef SQLITE_OMIT_DISKIO
+ Tcl_LinkVar(interp, "sqlite_opentemp_count",
+ (char*)&sqlite3_opentemp_count, TCL_LINK_INT);
+#endif
+ Tcl_LinkVar(interp, "sqlite_static_bind_value",
+ (char*)&sqlite_static_bind_value, TCL_LINK_STRING);
+ Tcl_LinkVar(interp, "sqlite_temp_directory",
+ (char*)&sqlite3_temp_directory, TCL_LINK_STRING);
+ Tcl_LinkVar(interp, "bitmask_size",
+ (char*)&bitmask_size, TCL_LINK_INT|TCL_LINK_READ_ONLY);
+#if OS_UNIX
+ Tcl_LinkVar(interp, "sqlite_sync_count",
+ (char*)&sqlite3_sync_count, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_fullsync_count",
+ (char*)&sqlite3_fullsync_count, TCL_LINK_INT);
+#endif /* OS_UNIX */
+ set_options(interp);
+ return TCL_OK;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/test2.c b/ext/pdo_sqlite/sqlite/src/test2.c
new file mode 100644
index 000000000..d4c5544b6
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/test2.c
@@ -0,0 +1,604 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Code for testing the pager.c module in SQLite. This code
+** is not included in the SQLite library. It is used for automated
+** testing of the SQLite library.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#include "pager.h"
+#include "tcl.h"
+#include <stdlib.h>
+#include <string.h>
+
+/*
+** Interpret an SQLite error number
+*/
+static char *errorName(int rc){
+ char *zName;
+ switch( rc ){
+ case SQLITE_OK: zName = "SQLITE_OK"; break;
+ case SQLITE_ERROR: zName = "SQLITE_ERROR"; break;
+ case SQLITE_PERM: zName = "SQLITE_PERM"; break;
+ case SQLITE_ABORT: zName = "SQLITE_ABORT"; break;
+ case SQLITE_BUSY: zName = "SQLITE_BUSY"; break;
+ case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break;
+ case SQLITE_READONLY: zName = "SQLITE_READONLY"; break;
+ case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break;
+ case SQLITE_IOERR: zName = "SQLITE_IOERR"; break;
+ case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break;
+ case SQLITE_FULL: zName = "SQLITE_FULL"; break;
+ case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break;
+ case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break;
+ case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break;
+ case SQLITE_SCHEMA: zName = "SQLITE_SCHEMA"; break;
+ case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break;
+ case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break;
+ case SQLITE_MISUSE: zName = "SQLITE_MISUSE"; break;
+ case SQLITE_NOLFS: zName = "SQLITE_NOLFS"; break;
+ default: zName = "SQLITE_Unknown"; break;
+ }
+ return zName;
+}
+
+/*
+** Page size and reserved size used for testing.
+*/
+static int test_pagesize = 1024;
+
+/*
+** Usage: pager_open FILENAME N-PAGE
+**
+** Open a new pager
+*/
+static int pager_open(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ int nPage;
+ int rc;
+ char zBuf[100];
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FILENAME N-PAGE\"", 0);
+ return TCL_ERROR;
+ }
+ if( Tcl_GetInt(interp, argv[2], &nPage) ) return TCL_ERROR;
+ rc = sqlite3pager_open(&pPager, argv[1], 0, 0);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3pager_set_cachesize(pPager, nPage);
+ sqlite3pager_set_pagesize(pPager, test_pagesize);
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPager);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: pager_close ID
+**
+** Close the given pager.
+*/
+static int pager_close(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3pager_close(pPager);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: pager_rollback ID
+**
+** Rollback changes
+*/
+static int pager_rollback(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3pager_rollback(pPager);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: pager_commit ID
+**
+** Commit all changes
+*/
+static int pager_commit(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3pager_commit(pPager);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: pager_stmt_begin ID
+**
+** Start a new checkpoint.
+*/
+static int pager_stmt_begin(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3pager_stmt_begin(pPager);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: pager_stmt_rollback ID
+**
+** Rollback changes to a checkpoint
+*/
+static int pager_stmt_rollback(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3pager_stmt_rollback(pPager);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: pager_stmt_commit ID
+**
+** Commit changes to a checkpoint
+*/
+static int pager_stmt_commit(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3pager_stmt_commit(pPager);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: pager_stats ID
+**
+** Return pager statistics.
+*/
+static int pager_stats(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ int i, *a;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ a = sqlite3pager_stats(pPager);
+ for(i=0; i<9; i++){
+ static char *zName[] = {
+ "ref", "page", "max", "size", "state", "err",
+ "hit", "miss", "ovfl",
+ };
+ char zBuf[100];
+ Tcl_AppendElement(interp, zName[i]);
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",a[i]);
+ Tcl_AppendElement(interp, zBuf);
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: pager_pagecount ID
+**
+** Return the size of the database file.
+*/
+static int pager_pagecount(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ char zBuf[100];
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",sqlite3pager_pagecount(pPager));
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: page_get ID PGNO
+**
+** Return a pointer to a page from the database.
+*/
+static int page_get(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ char zBuf[100];
+ void *pPage;
+ int pgno;
+ int rc;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID PGNO\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
+ rc = sqlite3pager_get(pPager, pgno, &pPage);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPage);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: page_lookup ID PGNO
+**
+** Return a pointer to a page if the page is already in cache.
+** If not in cache, return an empty string.
+*/
+static int page_lookup(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ char zBuf[100];
+ void *pPage;
+ int pgno;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID PGNO\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
+ pPage = sqlite3pager_lookup(pPager, pgno);
+ if( pPage ){
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPage);
+ Tcl_AppendResult(interp, zBuf, 0);
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: pager_truncate ID PGNO
+*/
+static int pager_truncate(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Pager *pPager;
+ int rc;
+ int pgno;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID PGNO\"", 0);
+ return TCL_ERROR;
+ }
+ pPager = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
+ rc = sqlite3pager_truncate(pPager, pgno);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+
+/*
+** Usage: page_unref PAGE
+**
+** Drop a pointer to a page.
+*/
+static int page_unref(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ void *pPage;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " PAGE\"", 0);
+ return TCL_ERROR;
+ }
+ pPage = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3pager_unref(pPage);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: page_read PAGE
+**
+** Return the content of a page
+*/
+static int page_read(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ char zBuf[100];
+ void *pPage;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " PAGE\"", 0);
+ return TCL_ERROR;
+ }
+ pPage = sqlite3TextToPtr(argv[1]);
+ memcpy(zBuf, pPage, sizeof(zBuf));
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: page_number PAGE
+**
+** Return the page number for a page.
+*/
+static int page_number(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ char zBuf[100];
+ void *pPage;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " PAGE\"", 0);
+ return TCL_ERROR;
+ }
+ pPage = sqlite3TextToPtr(argv[1]);
+ sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", sqlite3pager_pagenumber(pPage));
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: page_write PAGE DATA
+**
+** Write something into a page.
+*/
+static int page_write(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ void *pPage;
+ int rc;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " PAGE DATA\"", 0);
+ return TCL_ERROR;
+ }
+ pPage = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3pager_write(pPage);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ strncpy((char*)pPage, argv[2], test_pagesize-1);
+ ((char*)pPage)[test_pagesize-1] = 0;
+ return TCL_OK;
+}
+
+#ifndef SQLITE_OMIT_DISKIO
+/*
+** Usage: fake_big_file N FILENAME
+**
+** Write a few bytes at the N megabyte point of FILENAME. This will
+** create a large file. If the file was a valid SQLite database, then
+** the next time the database is opened, SQLite will begin allocating
+** new pages after N. If N is 2096 or bigger, this will test the
+** ability of SQLite to write to large files.
+*/
+static int fake_big_file(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int rc;
+ int n;
+ i64 offset;
+ OsFile fd;
+ int readOnly = 0;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " N-MEGABYTES FILE\"", 0);
+ return TCL_ERROR;
+ }
+ if( Tcl_GetInt(interp, argv[1], &n) ) return TCL_ERROR;
+ memset(&fd, 0, sizeof(fd));
+ rc = sqlite3OsOpenReadWrite(argv[2], &fd, &readOnly);
+ if( rc ){
+ Tcl_AppendResult(interp, "open failed: ", errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ offset = n;
+ offset *= 1024*1024;
+ rc = sqlite3OsSeek(&fd, offset);
+ if( rc ){
+ Tcl_AppendResult(interp, "seek failed: ", errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ rc = sqlite3OsWrite(&fd, "Hello, World!", 14);
+ sqlite3OsClose(&fd);
+ if( rc ){
+ Tcl_AppendResult(interp, "write failed: ", errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+#endif
+
+/*
+** Register commands with the TCL interpreter.
+*/
+int Sqlitetest2_Init(Tcl_Interp *interp){
+ extern int sqlite3_io_error_pending;
+ extern int sqlite3_diskfull_pending;
+ extern int sqlite3_diskfull;
+ static struct {
+ char *zName;
+ Tcl_CmdProc *xProc;
+ } aCmd[] = {
+ { "pager_open", (Tcl_CmdProc*)pager_open },
+ { "pager_close", (Tcl_CmdProc*)pager_close },
+ { "pager_commit", (Tcl_CmdProc*)pager_commit },
+ { "pager_rollback", (Tcl_CmdProc*)pager_rollback },
+ { "pager_stmt_begin", (Tcl_CmdProc*)pager_stmt_begin },
+ { "pager_stmt_commit", (Tcl_CmdProc*)pager_stmt_commit },
+ { "pager_stmt_rollback", (Tcl_CmdProc*)pager_stmt_rollback },
+ { "pager_stats", (Tcl_CmdProc*)pager_stats },
+ { "pager_pagecount", (Tcl_CmdProc*)pager_pagecount },
+ { "page_get", (Tcl_CmdProc*)page_get },
+ { "page_lookup", (Tcl_CmdProc*)page_lookup },
+ { "page_unref", (Tcl_CmdProc*)page_unref },
+ { "page_read", (Tcl_CmdProc*)page_read },
+ { "page_write", (Tcl_CmdProc*)page_write },
+ { "page_number", (Tcl_CmdProc*)page_number },
+ { "pager_truncate", (Tcl_CmdProc*)pager_truncate },
+#ifndef SQLITE_OMIT_DISKIO
+ { "fake_big_file", (Tcl_CmdProc*)fake_big_file },
+#endif
+ };
+ int i;
+ for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
+ Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
+ }
+ Tcl_LinkVar(interp, "sqlite_io_error_pending",
+ (char*)&sqlite3_io_error_pending, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_diskfull_pending",
+ (char*)&sqlite3_diskfull_pending, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_diskfull",
+ (char*)&sqlite3_diskfull, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_pending_byte",
+ (char*)&sqlite3_pending_byte, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "pager_pagesize",
+ (char*)&test_pagesize, TCL_LINK_INT);
+ return TCL_OK;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/test3.c b/ext/pdo_sqlite/sqlite/src/test3.c
new file mode 100644
index 000000000..6b973a147
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/test3.c
@@ -0,0 +1,1458 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Code for testing the btree.c module in SQLite. This code
+** is not included in the SQLite library. It is used for automated
+** testing of the SQLite library.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "pager.h"
+#include "btree.h"
+#include "tcl.h"
+#include <stdlib.h>
+#include <string.h>
+
+/*
+** Interpret an SQLite error number
+*/
+static char *errorName(int rc){
+ char *zName;
+ switch( rc ){
+ case SQLITE_OK: zName = "SQLITE_OK"; break;
+ case SQLITE_ERROR: zName = "SQLITE_ERROR"; break;
+ case SQLITE_PERM: zName = "SQLITE_PERM"; break;
+ case SQLITE_ABORT: zName = "SQLITE_ABORT"; break;
+ case SQLITE_BUSY: zName = "SQLITE_BUSY"; break;
+ case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break;
+ case SQLITE_READONLY: zName = "SQLITE_READONLY"; break;
+ case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break;
+ case SQLITE_IOERR: zName = "SQLITE_IOERR"; break;
+ case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break;
+ case SQLITE_FULL: zName = "SQLITE_FULL"; break;
+ case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break;
+ case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break;
+ case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break;
+ case SQLITE_LOCKED: zName = "SQLITE_LOCKED"; break;
+ default: zName = "SQLITE_Unknown"; break;
+ }
+ return zName;
+}
+
+/*
+** Usage: btree_open FILENAME NCACHE FLAGS
+**
+** Open a new database
+*/
+static int btree_open(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc, nCache, flags;
+ char zBuf[100];
+ if( argc!=4 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " FILENAME NCACHE FLAGS\"", 0);
+ return TCL_ERROR;
+ }
+ if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR;
+ if( Tcl_GetInt(interp, argv[3], &flags) ) return TCL_ERROR;
+ rc = sqlite3BtreeOpen(argv[1], &pBt, flags);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3BtreeSetCacheSize(pBt, nCache);
+ sqlite3_snprintf(sizeof(zBuf), zBuf,"%p", pBt);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_close ID
+**
+** Close the given database.
+*/
+static int btree_close(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeClose(pBt);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_begin_transaction ID
+**
+** Start a new transaction
+*/
+static int btree_begin_transaction(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeBeginTrans(pBt, 1);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_rollback ID
+**
+** Rollback changes
+*/
+static int btree_rollback(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeRollback(pBt);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_commit ID
+**
+** Commit all changes
+*/
+static int btree_commit(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeCommit(pBt);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_begin_statement ID
+**
+** Start a new statement transaction
+*/
+static int btree_begin_statement(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeBeginStmt(pBt);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_rollback_statement ID
+**
+** Rollback changes
+*/
+static int btree_rollback_statement(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeRollbackStmt(pBt);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_commit_statement ID
+**
+** Commit all changes
+*/
+static int btree_commit_statement(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeCommitStmt(pBt);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_create_table ID FLAGS
+**
+** Create a new table in the database
+*/
+static int btree_create_table(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc, iTable, flags;
+ char zBuf[30];
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID FLAGS\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &flags) ) return TCL_ERROR;
+ rc = sqlite3BtreeCreateTable(pBt, &iTable, flags);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", iTable);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_drop_table ID TABLENUM
+**
+** Delete an entire table from the database
+*/
+static int btree_drop_table(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int iTable;
+ int rc;
+ int notUsed1;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID TABLENUM\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
+ rc = sqlite3BtreeDropTable(pBt, iTable, &notUsed1);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_clear_table ID TABLENUM
+**
+** Remove all entries from the given table but keep the table around.
+*/
+static int btree_clear_table(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int iTable;
+ int rc;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID TABLENUM\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
+ rc = sqlite3BtreeClearTable(pBt, iTable);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_get_meta ID
+**
+** Return meta data
+*/
+static int btree_get_meta(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc;
+ int i;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ for(i=0; i<SQLITE_N_BTREE_META; i++){
+ char zBuf[30];
+ unsigned int v;
+ rc = sqlite3BtreeGetMeta(pBt, i, &v);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",v);
+ Tcl_AppendElement(interp, zBuf);
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_update_meta ID METADATA...
+**
+** Return meta data
+*/
+static int btree_update_meta(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int rc;
+ int i;
+ int aMeta[SQLITE_N_BTREE_META];
+
+ if( argc!=2+SQLITE_N_BTREE_META ){
+ char zBuf[30];
+ sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",SQLITE_N_BTREE_META);
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID METADATA...\" (METADATA is ", zBuf, " integers)", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ for(i=1; i<SQLITE_N_BTREE_META; i++){
+ if( Tcl_GetInt(interp, argv[i+2], &aMeta[i]) ) return TCL_ERROR;
+ }
+ for(i=1; i<SQLITE_N_BTREE_META; i++){
+ rc = sqlite3BtreeUpdateMeta(pBt, i, aMeta[i]);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_page_dump ID PAGENUM
+**
+** Print a disassembly of a page on standard output
+*/
+static int btree_page_dump(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int iPage;
+ int rc;
+
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &iPage) ) return TCL_ERROR;
+ rc = sqlite3BtreePageDump(pBt, iPage, 0);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_tree_dump ID PAGENUM
+**
+** Print a disassembly of a page and all its child pages on standard output
+*/
+static int btree_tree_dump(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int iPage;
+ int rc;
+
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &iPage) ) return TCL_ERROR;
+ rc = sqlite3BtreePageDump(pBt, iPage, 1);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_pager_stats ID
+**
+** Returns pager statistics
+*/
+static int btree_pager_stats(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int i;
+ int *a;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ a = sqlite3pager_stats(sqlite3BtreePager(pBt));
+ for(i=0; i<11; i++){
+ static char *zName[] = {
+ "ref", "page", "max", "size", "state", "err",
+ "hit", "miss", "ovfl", "read", "write"
+ };
+ char zBuf[100];
+ Tcl_AppendElement(interp, zName[i]);
+ sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",a[i]);
+ Tcl_AppendElement(interp, zBuf);
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_pager_ref_dump ID
+**
+** Print out all outstanding pages.
+*/
+static int btree_pager_ref_dump(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+#ifdef SQLITE_DEBUG
+ sqlite3pager_refdump(sqlite3BtreePager(pBt));
+#endif
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_integrity_check ID ROOT ...
+**
+** Look through every page of the given BTree file to verify correct
+** formatting and linkage. Return a line of text for each problem found.
+** Return an empty string if everything worked.
+*/
+static int btree_integrity_check(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int nRoot;
+ int *aRoot;
+ int i;
+ char *zResult;
+
+ if( argc<3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID ROOT ...\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ nRoot = argc-2;
+ aRoot = malloc( sizeof(int)*(argc-2) );
+ for(i=0; i<argc-2; i++){
+ if( Tcl_GetInt(interp, argv[i+2], &aRoot[i]) ) return TCL_ERROR;
+ }
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
+ zResult = sqlite3BtreeIntegrityCheck(pBt, aRoot, nRoot);
+#else
+ zResult = 0;
+#endif
+ if( zResult ){
+ Tcl_AppendResult(interp, zResult, 0);
+ sqliteFree(zResult);
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_cursor_list ID
+**
+** Print information about all cursors to standard output for debugging.
+*/
+static int btree_cursor_list(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ sqlite3BtreeCursorList(pBt);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_cursor ID TABLENUM WRITEABLE
+**
+** Create a new cursor. Return the ID for the cursor.
+*/
+static int btree_cursor(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ Btree *pBt;
+ int iTable;
+ BtCursor *pCur;
+ int rc;
+ int wrFlag;
+ char zBuf[30];
+
+ if( argc!=4 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID TABLENUM WRITEABLE\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
+ if( Tcl_GetBoolean(interp, argv[3], &wrFlag) ) return TCL_ERROR;
+ rc = sqlite3BtreeCursor(pBt, iTable, wrFlag, 0, 0, &pCur);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3_snprintf(sizeof(zBuf), zBuf,"%p", pCur);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_close_cursor ID
+**
+** Close a cursor opened using btree_cursor.
+*/
+static int btree_close_cursor(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeCloseCursor(pCur);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_move_to ID KEY
+**
+** Move the cursor to the entry with the given key.
+*/
+static int btree_move_to(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+ int res;
+ char zBuf[20];
+
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID KEY\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
+ int iKey;
+ if( Tcl_GetInt(interp, argv[2], &iKey) ) return TCL_ERROR;
+ rc = sqlite3BtreeMoveto(pCur, 0, iKey, &res);
+ }else{
+ rc = sqlite3BtreeMoveto(pCur, argv[2], strlen(argv[2]), &res);
+ }
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ if( res<0 ) res = -1;
+ if( res>0 ) res = 1;
+ sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",res);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_delete ID
+**
+** Delete the entry that the cursor is pointing to
+*/
+static int btree_delete(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeDelete(pCur);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_insert ID KEY DATA
+**
+** Create a new entry with the given key and data. If an entry already
+** exists with the same key the old entry is overwritten.
+*/
+static int btree_insert(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ BtCursor *pCur;
+ int rc;
+
+ if( objc!=4 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "ID KEY DATA");
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(Tcl_GetString(objv[1]));
+ if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
+ i64 iKey;
+ int len;
+ unsigned char *pBuf;
+ if( Tcl_GetWideIntFromObj(interp, objv[2], &iKey) ) return TCL_ERROR;
+ pBuf = Tcl_GetByteArrayFromObj(objv[3], &len);
+ rc = sqlite3BtreeInsert(pCur, 0, iKey, pBuf, len);
+ }else{
+ int keylen;
+ int dlen;
+ unsigned char *pKBuf;
+ unsigned char *pDBuf;
+ pKBuf = Tcl_GetByteArrayFromObj(objv[2], &keylen);
+ pDBuf = Tcl_GetByteArrayFromObj(objv[3], &dlen);
+ rc = sqlite3BtreeInsert(pCur, pKBuf, keylen, pDBuf, dlen);
+ }
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_next ID
+**
+** Move the cursor to the next entry in the table. Return 0 on success
+** or 1 if the cursor was already on the last entry in the table or if
+** the table is empty.
+*/
+static int btree_next(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+ int res = 0;
+ char zBuf[100];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeNext(pCur, &res);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_prev ID
+**
+** Move the cursor to the previous entry in the table. Return 0 on
+** success and 1 if the cursor was already on the first entry in
+** the table or if the table was empty.
+*/
+static int btree_prev(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+ int res = 0;
+ char zBuf[100];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreePrevious(pCur, &res);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_first ID
+**
+** Move the cursor to the first entry in the table. Return 0 if the
+** cursor was left point to something and 1 if the table is empty.
+*/
+static int btree_first(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+ int res = 0;
+ char zBuf[100];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeFirst(pCur, &res);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_last ID
+**
+** Move the cursor to the last entry in the table. Return 0 if the
+** cursor was left point to something and 1 if the table is empty.
+*/
+static int btree_last(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+ int res = 0;
+ char zBuf[100];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ rc = sqlite3BtreeLast(pCur, &res);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_eof ID
+**
+** Return TRUE if the given cursor is not pointing at a valid entry.
+** Return FALSE if the cursor does point to a valid entry.
+*/
+static int btree_eof(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ char zBuf[50];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ sqlite3_snprintf(sizeof(zBuf),zBuf, "%d", sqlite3BtreeEof(pCur));
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_keysize ID
+**
+** Return the number of bytes of key. For an INTKEY table, this
+** returns the key itself.
+*/
+static int btree_keysize(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ u64 n;
+ char zBuf[50];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ sqlite3BtreeKeySize(pCur, &n);
+ sqlite3_snprintf(sizeof(zBuf),zBuf, "%llu", n);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_key ID
+**
+** Return the key for the entry at which the cursor is pointing.
+*/
+static int btree_key(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+ u64 n;
+ char *zBuf;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ sqlite3BtreeKeySize(pCur, &n);
+ if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
+ char zBuf2[60];
+ sqlite3_snprintf(sizeof(zBuf2),zBuf2, "%llu", n);
+ Tcl_AppendResult(interp, zBuf2, 0);
+ }else{
+ zBuf = malloc( n+1 );
+ rc = sqlite3BtreeKey(pCur, 0, n, zBuf);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ zBuf[n] = 0;
+ Tcl_AppendResult(interp, zBuf, 0);
+ free(zBuf);
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_data ID ?N?
+**
+** Return the data for the entry at which the cursor is pointing.
+*/
+static int btree_data(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+ u32 n;
+ char *zBuf;
+
+ if( argc!=2 && argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ if( argc==2 ){
+ sqlite3BtreeDataSize(pCur, &n);
+ }else{
+ n = atoi(argv[2]);
+ }
+ zBuf = malloc( n+1 );
+ rc = sqlite3BtreeData(pCur, 0, n, zBuf);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ zBuf[n] = 0;
+ Tcl_AppendResult(interp, zBuf, 0);
+ free(zBuf);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_fetch_key ID AMT
+**
+** Use the sqlite3BtreeKeyFetch() routine to get AMT bytes of the key.
+** If sqlite3BtreeKeyFetch() fails, return an empty string.
+*/
+static int btree_fetch_key(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int n;
+ int amt;
+ u64 nKey;
+ const char *zBuf;
+ char zStatic[1000];
+
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID AMT\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
+ sqlite3BtreeKeySize(pCur, &nKey);
+ zBuf = sqlite3BtreeKeyFetch(pCur, &amt);
+ if( zBuf && amt>=n ){
+ assert( nKey<sizeof(zStatic) );
+ if( n>0 ) nKey = n;
+ memcpy(zStatic, zBuf, (int)nKey);
+ zStatic[nKey] = 0;
+ Tcl_AppendResult(interp, zStatic, 0);
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_fetch_data ID AMT
+**
+** Use the sqlite3BtreeDataFetch() routine to get AMT bytes of the key.
+** If sqlite3BtreeDataFetch() fails, return an empty string.
+*/
+static int btree_fetch_data(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int n;
+ int amt;
+ u32 nData;
+ const char *zBuf;
+ char zStatic[1000];
+
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID AMT\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
+ sqlite3BtreeDataSize(pCur, &nData);
+ zBuf = sqlite3BtreeDataFetch(pCur, &amt);
+ if( zBuf && amt>=n ){
+ assert( nData<sizeof(zStatic) );
+ if( n>0 ) nData = n;
+ memcpy(zStatic, zBuf, (int)nData);
+ zStatic[nData] = 0;
+ Tcl_AppendResult(interp, zStatic, 0);
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: btree_payload_size ID
+**
+** Return the number of bytes of payload
+*/
+static int btree_payload_size(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int n2;
+ u64 n1;
+ char zBuf[50];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
+ n1 = 0;
+ }else{
+ sqlite3BtreeKeySize(pCur, &n1);
+ }
+ sqlite3BtreeDataSize(pCur, &n2);
+ sqlite3_snprintf(sizeof(zBuf),zBuf, "%d", (int)(n1+n2));
+ Tcl_AppendResult(interp, zBuf, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Usage: btree_cursor_info ID ?UP-CNT?
+**
+** Return integers containing information about the entry the
+** cursor is pointing to:
+**
+** aResult[0] = The page number
+** aResult[1] = The entry number
+** aResult[2] = Total number of entries on this page
+** aResult[3] = Cell size (local payload + header)
+** aResult[4] = Number of free bytes on this page
+** aResult[5] = Number of free blocks on the page
+** aResult[6] = Total payload size (local + overflow)
+** aResult[7] = Header size in bytes
+** aResult[8] = Local payload size
+** aResult[9] = Parent page number
+*/
+static int btree_cursor_info(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ BtCursor *pCur;
+ int rc;
+ int i, j;
+ int up;
+ int aResult[10];
+ char zBuf[400];
+
+ if( argc!=2 && argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID ?UP-CNT?\"", 0);
+ return TCL_ERROR;
+ }
+ pCur = sqlite3TextToPtr(argv[1]);
+ if( argc==3 ){
+ if( Tcl_GetInt(interp, argv[2], &up) ) return TCL_ERROR;
+ }else{
+ up = 0;
+ }
+ rc = sqlite3BtreeCursorInfo(pCur, aResult, up);
+ if( rc ){
+ Tcl_AppendResult(interp, errorName(rc), 0);
+ return TCL_ERROR;
+ }
+ j = 0;
+ for(i=0; i<sizeof(aResult)/sizeof(aResult[0]); i++){
+ sqlite3_snprintf(40,&zBuf[j]," %d", aResult[i]);
+ j += strlen(&zBuf[j]);
+ }
+ Tcl_AppendResult(interp, &zBuf[1], 0);
+ return SQLITE_OK;
+}
+
+/*
+** The command is provided for the purpose of setting breakpoints.
+** in regression test scripts.
+**
+** By setting a GDB breakpoint on this procedure and executing the
+** btree_breakpoint command in a test script, we can stop GDB at
+** the point in the script where the btree_breakpoint command is
+** inserted. This is useful for debugging.
+*/
+static int btree_breakpoint(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ return TCL_OK;
+}
+
+/*
+** usage: varint_test START MULTIPLIER COUNT INCREMENT
+**
+** This command tests the sqlite3PutVarint() and sqlite3GetVarint()
+** routines, both for accuracy and for speed.
+**
+** An integer is written using PutVarint() and read back with
+** GetVarint() and varified to be unchanged. This repeats COUNT
+** times. The first integer is START*MULTIPLIER. Each iteration
+** increases the integer by INCREMENT.
+**
+** This command returns nothing if it works. It returns an error message
+** if something goes wrong.
+*/
+static int btree_varint_test(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ u32 start, mult, count, incr;
+ u64 in, out;
+ int n1, n2, i, j;
+ unsigned char zBuf[100];
+ if( argc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " START MULTIPLIER COUNT INCREMENT\"", 0);
+ return TCL_ERROR;
+ }
+ if( Tcl_GetInt(interp, argv[1], (int*)&start) ) return TCL_ERROR;
+ if( Tcl_GetInt(interp, argv[2], (int*)&mult) ) return TCL_ERROR;
+ if( Tcl_GetInt(interp, argv[3], (int*)&count) ) return TCL_ERROR;
+ if( Tcl_GetInt(interp, argv[4], (int*)&incr) ) return TCL_ERROR;
+ in = start;
+ in *= mult;
+ for(i=0; i<count; i++){
+ char zErr[200];
+ n1 = sqlite3PutVarint(zBuf, in);
+ if( n1>9 || n1<1 ){
+ sprintf(zErr, "PutVarint returned %d - should be between 1 and 9", n1);
+ Tcl_AppendResult(interp, zErr, 0);
+ return TCL_ERROR;
+ }
+ n2 = sqlite3GetVarint(zBuf, &out);
+ if( n1!=n2 ){
+ sprintf(zErr, "PutVarint returned %d and GetVarint returned %d", n1, n2);
+ Tcl_AppendResult(interp, zErr, 0);
+ return TCL_ERROR;
+ }
+ if( in!=out ){
+ sprintf(zErr, "Wrote 0x%016llx and got back 0x%016llx", in, out);
+ Tcl_AppendResult(interp, zErr, 0);
+ return TCL_ERROR;
+ }
+ if( (in & 0xffffffff)==in ){
+ u32 out32;
+ n2 = sqlite3GetVarint32(zBuf, &out32);
+ out = out32;
+ if( n1!=n2 ){
+ sprintf(zErr, "PutVarint returned %d and GetVarint32 returned %d",
+ n1, n2);
+ Tcl_AppendResult(interp, zErr, 0);
+ return TCL_ERROR;
+ }
+ if( in!=out ){
+ sprintf(zErr, "Wrote 0x%016llx and got back 0x%016llx from GetVarint32",
+ in, out);
+ Tcl_AppendResult(interp, zErr, 0);
+ return TCL_ERROR;
+ }
+ }
+
+ /* In order to get realistic timings, run getVarint 19 more times.
+ ** This is because getVarint is called about 20 times more often
+ ** than putVarint.
+ */
+ for(j=0; j<19; j++){
+ sqlite3GetVarint(zBuf, &out);
+ }
+ in += incr;
+ }
+ return TCL_OK;
+}
+
+/*
+** usage: btree_from_db DB-HANDLE
+**
+** This command returns the btree handle for the main database associated
+** with the database-handle passed as the argument. Example usage:
+**
+** sqlite3 db test.db
+** set bt [btree_from_db db]
+*/
+static int btree_from_db(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ char zBuf[100];
+ Tcl_CmdInfo info;
+ sqlite3 *db;
+ Btree *pBt;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB-HANDLE\"", 0);
+ return TCL_ERROR;
+ }
+
+ if( 1!=Tcl_GetCommandInfo(interp, argv[1], &info) ){
+ Tcl_AppendResult(interp, "No such db-handle: \"", argv[1], "\"", 0);
+ return TCL_ERROR;
+ }
+ db = *((sqlite3 **)info.objClientData);
+ assert( db );
+
+ pBt = db->aDb[0].pBt;
+ sqlite3_snprintf(sizeof(zBuf), zBuf, "%p", pBt);
+ Tcl_SetResult(interp, zBuf, TCL_VOLATILE);
+ return TCL_OK;
+}
+
+
+/*
+** usage: btree_set_cache_size ID NCACHE
+**
+** Set the size of the cache used by btree $ID.
+*/
+static int btree_set_cache_size(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int nCache;
+ Btree *pBt;
+
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " BT NCACHE\"", 0);
+ return TCL_ERROR;
+ }
+ pBt = sqlite3TextToPtr(argv[1]);
+ if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR;
+ sqlite3BtreeSetCacheSize(pBt, nCache);
+ return TCL_OK;
+}
+
+
+/*
+** Register commands with the TCL interpreter.
+*/
+int Sqlitetest3_Init(Tcl_Interp *interp){
+ extern int sqlite3_btree_trace;
+ static struct {
+ char *zName;
+ Tcl_CmdProc *xProc;
+ } aCmd[] = {
+ { "btree_open", (Tcl_CmdProc*)btree_open },
+ { "btree_close", (Tcl_CmdProc*)btree_close },
+ { "btree_begin_transaction", (Tcl_CmdProc*)btree_begin_transaction },
+ { "btree_commit", (Tcl_CmdProc*)btree_commit },
+ { "btree_rollback", (Tcl_CmdProc*)btree_rollback },
+ { "btree_create_table", (Tcl_CmdProc*)btree_create_table },
+ { "btree_drop_table", (Tcl_CmdProc*)btree_drop_table },
+ { "btree_clear_table", (Tcl_CmdProc*)btree_clear_table },
+ { "btree_get_meta", (Tcl_CmdProc*)btree_get_meta },
+ { "btree_update_meta", (Tcl_CmdProc*)btree_update_meta },
+ { "btree_page_dump", (Tcl_CmdProc*)btree_page_dump },
+ { "btree_tree_dump", (Tcl_CmdProc*)btree_tree_dump },
+ { "btree_pager_stats", (Tcl_CmdProc*)btree_pager_stats },
+ { "btree_pager_ref_dump", (Tcl_CmdProc*)btree_pager_ref_dump },
+ { "btree_cursor", (Tcl_CmdProc*)btree_cursor },
+ { "btree_close_cursor", (Tcl_CmdProc*)btree_close_cursor },
+ { "btree_move_to", (Tcl_CmdProc*)btree_move_to },
+ { "btree_delete", (Tcl_CmdProc*)btree_delete },
+ { "btree_next", (Tcl_CmdProc*)btree_next },
+ { "btree_prev", (Tcl_CmdProc*)btree_prev },
+ { "btree_eof", (Tcl_CmdProc*)btree_eof },
+ { "btree_keysize", (Tcl_CmdProc*)btree_keysize },
+ { "btree_key", (Tcl_CmdProc*)btree_key },
+ { "btree_data", (Tcl_CmdProc*)btree_data },
+ { "btree_fetch_key", (Tcl_CmdProc*)btree_fetch_key },
+ { "btree_fetch_data", (Tcl_CmdProc*)btree_fetch_data },
+ { "btree_payload_size", (Tcl_CmdProc*)btree_payload_size },
+ { "btree_first", (Tcl_CmdProc*)btree_first },
+ { "btree_last", (Tcl_CmdProc*)btree_last },
+ { "btree_cursor_info", (Tcl_CmdProc*)btree_cursor_info },
+ { "btree_cursor_list", (Tcl_CmdProc*)btree_cursor_list },
+ { "btree_integrity_check", (Tcl_CmdProc*)btree_integrity_check },
+ { "btree_breakpoint", (Tcl_CmdProc*)btree_breakpoint },
+ { "btree_varint_test", (Tcl_CmdProc*)btree_varint_test },
+ { "btree_begin_statement", (Tcl_CmdProc*)btree_begin_statement },
+ { "btree_commit_statement", (Tcl_CmdProc*)btree_commit_statement },
+ { "btree_rollback_statement", (Tcl_CmdProc*)btree_rollback_statement },
+ { "btree_from_db", (Tcl_CmdProc*)btree_from_db },
+ { "btree_set_cache_size", (Tcl_CmdProc*)btree_set_cache_size },
+ };
+ int i;
+
+ for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
+ Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
+ }
+ Tcl_LinkVar(interp, "pager_refinfo_enable", (char*)&pager3_refinfo_enable,
+ TCL_LINK_INT);
+ Tcl_LinkVar(interp, "btree_trace", (char*)&sqlite3_btree_trace,
+ TCL_LINK_INT);
+
+ /* The btree_insert command is implemented using the tcl 'object'
+ ** interface, not the string interface like the other commands in this
+ ** file. This is so binary data can be inserted into btree tables.
+ */
+ Tcl_CreateObjCommand(interp, "btree_insert", btree_insert, 0, 0);
+ return TCL_OK;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/test4.c b/ext/pdo_sqlite/sqlite/src/test4.c
new file mode 100644
index 000000000..45991ba3a
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/test4.c
@@ -0,0 +1,647 @@
+/*
+** 2003 December 18
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Code for testing the the SQLite library in a multithreaded environment.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "tcl.h"
+#include "os.h"
+#if defined(OS_UNIX) && OS_UNIX==1 && defined(THREADSAFE) && THREADSAFE==1
+#include <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <sched.h>
+#include <ctype.h>
+
+/*
+** Each thread is controlled by an instance of the following
+** structure.
+*/
+typedef struct Thread Thread;
+struct Thread {
+ /* The first group of fields are writable by the master and read-only
+ ** to the thread. */
+ char *zFilename; /* Name of database file */
+ void (*xOp)(Thread*); /* next operation to do */
+ char *zArg; /* argument usable by xOp */
+ int opnum; /* Operation number */
+ int busy; /* True if this thread is in use */
+
+ /* The next group of fields are writable by the thread but read-only to the
+ ** master. */
+ int completed; /* Number of operations completed */
+ sqlite3 *db; /* Open database */
+ sqlite3_stmt *pStmt; /* Pending operation */
+ char *zErr; /* operation error */
+ char *zStaticErr; /* Static error message */
+ int rc; /* operation return code */
+ int argc; /* number of columns in result */
+ const char *argv[100]; /* result columns */
+ const char *colv[100]; /* result column names */
+};
+
+/*
+** There can be as many as 26 threads running at once. Each is named
+** by a capital letter: A, B, C, ..., Y, Z.
+*/
+#define N_THREAD 26
+static Thread threadset[N_THREAD];
+
+
+/*
+** The main loop for a thread. Threads use busy waiting.
+*/
+static void *thread_main(void *pArg){
+ Thread *p = (Thread*)pArg;
+ if( p->db ){
+ sqlite3_close(p->db);
+ }
+ sqlite3_open(p->zFilename, &p->db);
+ if( SQLITE_OK!=sqlite3_errcode(p->db) ){
+ p->zErr = strdup(sqlite3_errmsg(p->db));
+ sqlite3_close(p->db);
+ p->db = 0;
+ }
+ p->pStmt = 0;
+ p->completed = 1;
+ while( p->opnum<=p->completed ) sched_yield();
+ while( p->xOp ){
+ if( p->zErr && p->zErr!=p->zStaticErr ){
+ sqlite3_free(p->zErr);
+ p->zErr = 0;
+ }
+ (*p->xOp)(p);
+ p->completed++;
+ while( p->opnum<=p->completed ) sched_yield();
+ }
+ if( p->pStmt ){
+ sqlite3_finalize(p->pStmt);
+ p->pStmt = 0;
+ }
+ if( p->db ){
+ sqlite3_close(p->db);
+ p->db = 0;
+ }
+ if( p->zErr && p->zErr!=p->zStaticErr ){
+ sqlite3_free(p->zErr);
+ p->zErr = 0;
+ }
+ p->completed++;
+ return 0;
+}
+
+/*
+** Get a thread ID which is an upper case letter. Return the index.
+** If the argument is not a valid thread ID put an error message in
+** the interpreter and return -1.
+*/
+static int parse_thread_id(Tcl_Interp *interp, const char *zArg){
+ if( zArg==0 || zArg[0]==0 || zArg[1]!=0 || !isupper((unsigned char)zArg[0]) ){
+ Tcl_AppendResult(interp, "thread ID must be an upper case letter", 0);
+ return -1;
+ }
+ return zArg[0] - 'A';
+}
+
+/*
+** Usage: thread_create NAME FILENAME
+**
+** NAME should be an upper case letter. Start the thread running with
+** an open connection to the given database.
+*/
+static int tcl_thread_create(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+ pthread_t x;
+ int rc;
+
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID FILENAME", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( threadset[i].busy ){
+ Tcl_AppendResult(interp, "thread ", argv[1], " is already running", 0);
+ return TCL_ERROR;
+ }
+ threadset[i].busy = 1;
+ sqliteFree(threadset[i].zFilename);
+ threadset[i].zFilename = sqliteStrDup(argv[2]);
+ threadset[i].opnum = 1;
+ threadset[i].completed = 0;
+ rc = pthread_create(&x, 0, thread_main, &threadset[i]);
+ if( rc ){
+ Tcl_AppendResult(interp, "failed to create the thread", 0);
+ sqliteFree(threadset[i].zFilename);
+ threadset[i].busy = 0;
+ return TCL_ERROR;
+ }
+ pthread_detach(x);
+ return TCL_OK;
+}
+
+/*
+** Wait for a thread to reach its idle state.
+*/
+static void thread_wait(Thread *p){
+ while( p->opnum>p->completed ) sched_yield();
+}
+
+/*
+** Usage: thread_wait ID
+**
+** Wait on thread ID to reach its idle state.
+*/
+static int tcl_thread_wait(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ thread_wait(&threadset[i]);
+ return TCL_OK;
+}
+
+/*
+** Stop a thread.
+*/
+static void stop_thread(Thread *p){
+ thread_wait(p);
+ p->xOp = 0;
+ p->opnum++;
+ thread_wait(p);
+ sqliteFree(p->zArg);
+ p->zArg = 0;
+ sqliteFree(p->zFilename);
+ p->zFilename = 0;
+ p->busy = 0;
+}
+
+/*
+** Usage: thread_halt ID
+**
+** Cause a thread to shut itself down. Wait for the shutdown to be
+** completed. If ID is "*" then stop all threads.
+*/
+static int tcl_thread_halt(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID", 0);
+ return TCL_ERROR;
+ }
+ if( argv[1][0]=='*' && argv[1][1]==0 ){
+ for(i=0; i<N_THREAD; i++){
+ if( threadset[i].busy ) stop_thread(&threadset[i]);
+ }
+ }else{
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ stop_thread(&threadset[i]);
+ }
+ return TCL_OK;
+}
+
+/*
+** Usage: thread_argc ID
+**
+** Wait on the most recent thread_step to complete, then return the
+** number of columns in the result set.
+*/
+static int tcl_thread_argc(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+ char zBuf[100];
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ thread_wait(&threadset[i]);
+ sprintf(zBuf, "%d", threadset[i].argc);
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: thread_argv ID N
+**
+** Wait on the most recent thread_step to complete, then return the
+** value of the N-th columns in the result set.
+*/
+static int tcl_thread_argv(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+ int n;
+
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID N", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
+ thread_wait(&threadset[i]);
+ if( n<0 || n>=threadset[i].argc ){
+ Tcl_AppendResult(interp, "column number out of range", 0);
+ return TCL_ERROR;
+ }
+ Tcl_AppendResult(interp, threadset[i].argv[n], 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: thread_colname ID N
+**
+** Wait on the most recent thread_step to complete, then return the
+** name of the N-th columns in the result set.
+*/
+static int tcl_thread_colname(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+ int n;
+
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID N", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
+ thread_wait(&threadset[i]);
+ if( n<0 || n>=threadset[i].argc ){
+ Tcl_AppendResult(interp, "column number out of range", 0);
+ return TCL_ERROR;
+ }
+ Tcl_AppendResult(interp, threadset[i].colv[n], 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: thread_result ID
+**
+** Wait on the most recent operation to complete, then return the
+** result code from that operation.
+*/
+static int tcl_thread_result(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+ const char *zName;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ thread_wait(&threadset[i]);
+ switch( threadset[i].rc ){
+ case SQLITE_OK: zName = "SQLITE_OK"; break;
+ case SQLITE_ERROR: zName = "SQLITE_ERROR"; break;
+ case SQLITE_PERM: zName = "SQLITE_PERM"; break;
+ case SQLITE_ABORT: zName = "SQLITE_ABORT"; break;
+ case SQLITE_BUSY: zName = "SQLITE_BUSY"; break;
+ case SQLITE_LOCKED: zName = "SQLITE_LOCKED"; break;
+ case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break;
+ case SQLITE_READONLY: zName = "SQLITE_READONLY"; break;
+ case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break;
+ case SQLITE_IOERR: zName = "SQLITE_IOERR"; break;
+ case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break;
+ case SQLITE_FULL: zName = "SQLITE_FULL"; break;
+ case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break;
+ case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break;
+ case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break;
+ case SQLITE_SCHEMA: zName = "SQLITE_SCHEMA"; break;
+ case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break;
+ case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break;
+ case SQLITE_MISUSE: zName = "SQLITE_MISUSE"; break;
+ case SQLITE_NOLFS: zName = "SQLITE_NOLFS"; break;
+ case SQLITE_AUTH: zName = "SQLITE_AUTH"; break;
+ case SQLITE_FORMAT: zName = "SQLITE_FORMAT"; break;
+ case SQLITE_RANGE: zName = "SQLITE_RANGE"; break;
+ case SQLITE_ROW: zName = "SQLITE_ROW"; break;
+ case SQLITE_DONE: zName = "SQLITE_DONE"; break;
+ default: zName = "SQLITE_Unknown"; break;
+ }
+ Tcl_AppendResult(interp, zName, 0);
+ return TCL_OK;
+}
+
+/*
+** Usage: thread_error ID
+**
+** Wait on the most recent operation to complete, then return the
+** error string.
+*/
+static int tcl_thread_error(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ thread_wait(&threadset[i]);
+ Tcl_AppendResult(interp, threadset[i].zErr, 0);
+ return TCL_OK;
+}
+
+/*
+** This procedure runs in the thread to compile an SQL statement.
+*/
+static void do_compile(Thread *p){
+ if( p->db==0 ){
+ p->zErr = p->zStaticErr = "no database is open";
+ p->rc = SQLITE_ERROR;
+ return;
+ }
+ if( p->pStmt ){
+ sqlite3_finalize(p->pStmt);
+ p->pStmt = 0;
+ }
+ p->rc = sqlite3_prepare(p->db, p->zArg, -1, &p->pStmt, 0);
+}
+
+/*
+** Usage: thread_compile ID SQL
+**
+** Compile a new virtual machine.
+*/
+static int tcl_thread_compile(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID SQL", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ thread_wait(&threadset[i]);
+ threadset[i].xOp = do_compile;
+ sqliteFree(threadset[i].zArg);
+ threadset[i].zArg = sqliteStrDup(argv[2]);
+ threadset[i].opnum++;
+ return TCL_OK;
+}
+
+/*
+** This procedure runs in the thread to step the virtual machine.
+*/
+static void do_step(Thread *p){
+ int i;
+ if( p->pStmt==0 ){
+ p->zErr = p->zStaticErr = "no virtual machine available";
+ p->rc = SQLITE_ERROR;
+ return;
+ }
+ p->rc = sqlite3_step(p->pStmt);
+ if( p->rc==SQLITE_ROW ){
+ p->argc = sqlite3_column_count(p->pStmt);
+ for(i=0; i<sqlite3_data_count(p->pStmt); i++){
+ p->argv[i] = sqlite3_column_text(p->pStmt, i);
+ }
+ for(i=0; i<p->argc; i++){
+ p->colv[i] = sqlite3_column_name(p->pStmt, i);
+ }
+ }
+}
+
+/*
+** Usage: thread_step ID
+**
+** Advance the virtual machine by one step
+*/
+static int tcl_thread_step(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " IDL", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ thread_wait(&threadset[i]);
+ threadset[i].xOp = do_step;
+ threadset[i].opnum++;
+ return TCL_OK;
+}
+
+/*
+** This procedure runs in the thread to finalize a virtual machine.
+*/
+static void do_finalize(Thread *p){
+ if( p->pStmt==0 ){
+ p->zErr = p->zStaticErr = "no virtual machine available";
+ p->rc = SQLITE_ERROR;
+ return;
+ }
+ p->rc = sqlite3_finalize(p->pStmt);
+ p->pStmt = 0;
+}
+
+/*
+** Usage: thread_finalize ID
+**
+** Finalize the virtual machine.
+*/
+static int tcl_thread_finalize(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i;
+ if( argc!=2 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " IDL", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ thread_wait(&threadset[i]);
+ threadset[i].xOp = do_finalize;
+ sqliteFree(threadset[i].zArg);
+ threadset[i].zArg = 0;
+ threadset[i].opnum++;
+ return TCL_OK;
+}
+
+/*
+** Usage: thread_swap ID ID
+**
+** Interchange the sqlite* pointer between two threads.
+*/
+static int tcl_thread_swap(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ const char **argv /* Text of each argument */
+){
+ int i, j;
+ sqlite3 *temp;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " ID1 ID2", 0);
+ return TCL_ERROR;
+ }
+ i = parse_thread_id(interp, argv[1]);
+ if( i<0 ) return TCL_ERROR;
+ if( !threadset[i].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ thread_wait(&threadset[i]);
+ j = parse_thread_id(interp, argv[2]);
+ if( j<0 ) return TCL_ERROR;
+ if( !threadset[j].busy ){
+ Tcl_AppendResult(interp, "no such thread", 0);
+ return TCL_ERROR;
+ }
+ thread_wait(&threadset[j]);
+ temp = threadset[i].db;
+ threadset[i].db = threadset[j].db;
+ threadset[j].db = temp;
+ return TCL_OK;
+}
+
+/*
+** Register commands with the TCL interpreter.
+*/
+int Sqlitetest4_Init(Tcl_Interp *interp){
+ static struct {
+ char *zName;
+ Tcl_CmdProc *xProc;
+ } aCmd[] = {
+ { "thread_create", (Tcl_CmdProc*)tcl_thread_create },
+ { "thread_wait", (Tcl_CmdProc*)tcl_thread_wait },
+ { "thread_halt", (Tcl_CmdProc*)tcl_thread_halt },
+ { "thread_argc", (Tcl_CmdProc*)tcl_thread_argc },
+ { "thread_argv", (Tcl_CmdProc*)tcl_thread_argv },
+ { "thread_colname", (Tcl_CmdProc*)tcl_thread_colname },
+ { "thread_result", (Tcl_CmdProc*)tcl_thread_result },
+ { "thread_error", (Tcl_CmdProc*)tcl_thread_error },
+ { "thread_compile", (Tcl_CmdProc*)tcl_thread_compile },
+ { "thread_step", (Tcl_CmdProc*)tcl_thread_step },
+ { "thread_finalize", (Tcl_CmdProc*)tcl_thread_finalize },
+ { "thread_swap", (Tcl_CmdProc*)tcl_thread_swap },
+ };
+ int i;
+
+ for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
+ Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
+ }
+ return TCL_OK;
+}
+#else
+int Sqlitetest4_Init(Tcl_Interp *interp){ return TCL_OK; }
+#endif /* OS_UNIX */
diff --git a/ext/pdo_sqlite/sqlite/src/test5.c b/ext/pdo_sqlite/sqlite/src/test5.c
new file mode 100644
index 000000000..28f546f60
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/test5.c
@@ -0,0 +1,218 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Code for testing the utf.c module in SQLite. This code
+** is not included in the SQLite library. It is used for automated
+** testing of the SQLite library. Specifically, the code in this file
+** is used for testing the SQLite routines for converting between
+** the various supported unicode encodings.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "vdbeInt.h"
+#include "os.h" /* to get SQLITE_BIGENDIAN */
+#include "tcl.h"
+#include <stdlib.h>
+#include <string.h>
+
+/*
+** The first argument is a TCL UTF-8 string. Return the byte array
+** object with the encoded representation of the string, including
+** the NULL terminator.
+*/
+static int binarize(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ int len;
+ char *bytes;
+ Tcl_Obj *pRet;
+ assert(objc==2);
+
+ bytes = Tcl_GetStringFromObj(objv[1], &len);
+ pRet = Tcl_NewByteArrayObj(bytes, len+1);
+ Tcl_SetObjResult(interp, pRet);
+ return TCL_OK;
+}
+
+/*
+** Usage: test_value_overhead <repeat-count> <do-calls>.
+**
+** This routine is used to test the overhead of calls to
+** sqlite3_value_text(), on a value that contains a UTF-8 string. The idea
+** is to figure out whether or not it is a problem to use sqlite3_value
+** structures with collation sequence functions.
+**
+** If <do-calls> is 0, then the calls to sqlite3_value_text() are not
+** actually made.
+*/
+static int test_value_overhead(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ int do_calls;
+ int repeat_count;
+ int i;
+ Mem val;
+ const char *zVal;
+
+ if( objc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0), " <repeat-count> <do-calls>", 0);
+ return TCL_ERROR;
+ }
+
+ if( Tcl_GetIntFromObj(interp, objv[1], &repeat_count) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, objv[2], &do_calls) ) return TCL_ERROR;
+
+ val.flags = MEM_Str|MEM_Term|MEM_Static;
+ val.z = "hello world";
+ val.type = SQLITE_TEXT;
+ val.enc = SQLITE_UTF8;
+
+ for(i=0; i<repeat_count; i++){
+ if( do_calls ){
+ zVal = sqlite3_value_text(&val);
+ }
+ }
+
+ return TCL_OK;
+}
+
+static u8 name_to_enc(Tcl_Interp *interp, Tcl_Obj *pObj){
+ struct EncName {
+ char *zName;
+ u8 enc;
+ } encnames[] = {
+ { "UTF8", SQLITE_UTF8 },
+ { "UTF16LE", SQLITE_UTF16LE },
+ { "UTF16BE", SQLITE_UTF16BE },
+ { "UTF16", SQLITE_UTF16NATIVE },
+ { 0, 0 }
+ };
+ struct EncName *pEnc;
+ char *z = Tcl_GetString(pObj);
+ for(pEnc=&encnames[0]; pEnc->zName; pEnc++){
+ if( 0==sqlite3StrICmp(z, pEnc->zName) ){
+ break;
+ }
+ }
+ if( !pEnc->enc ){
+ Tcl_AppendResult(interp, "No such encoding: ", z, 0);
+ }
+ return pEnc->enc;
+}
+
+/*
+** Usage: test_translate <string/blob> <from enc> <to enc> ?<transient>?
+**
+*/
+static int test_translate(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ u8 enc_from;
+ u8 enc_to;
+ sqlite3_value *pVal;
+
+ char *z;
+ int len;
+ void (*xDel)(void *p) = SQLITE_STATIC;
+
+ if( objc!=4 && objc!=5 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_GetStringFromObj(objv[0], 0),
+ " <string/blob> <from enc> <to enc>", 0
+ );
+ return TCL_ERROR;
+ }
+ if( objc==5 ){
+ xDel = sqlite3FreeX;
+ }
+
+ enc_from = name_to_enc(interp, objv[2]);
+ if( !enc_from ) return TCL_ERROR;
+ enc_to = name_to_enc(interp, objv[3]);
+ if( !enc_to ) return TCL_ERROR;
+
+ pVal = sqlite3ValueNew();
+
+ if( enc_from==SQLITE_UTF8 ){
+ z = Tcl_GetString(objv[1]);
+ if( objc==5 ){
+ z = sqliteStrDup(z);
+ }
+ sqlite3ValueSetStr(pVal, -1, z, enc_from, xDel);
+ }else{
+ z = Tcl_GetByteArrayFromObj(objv[1], &len);
+ if( objc==5 ){
+ char *zTmp = z;
+ z = sqliteMalloc(len);
+ memcpy(z, zTmp, len);
+ }
+ sqlite3ValueSetStr(pVal, -1, z, enc_from, xDel);
+ }
+
+ z = (char *)sqlite3ValueText(pVal, enc_to);
+ len = sqlite3ValueBytes(pVal, enc_to) + (enc_to==SQLITE_UTF8?1:2);
+ Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(z, len));
+
+ sqlite3ValueFree(pVal);
+
+ return TCL_OK;
+}
+
+/*
+** Usage: translate_selftest
+**
+** Call sqlite3utfSelfTest() to run the internal tests for unicode
+** translation. If there is a problem an assert() will fail.
+**/
+void sqlite3utfSelfTest();
+static int test_translate_selftest(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifndef SQLITE_OMIT_UTF16
+ sqlite3utfSelfTest();
+#endif
+ return SQLITE_OK;
+}
+
+
+/*
+** Register commands with the TCL interpreter.
+*/
+int Sqlitetest5_Init(Tcl_Interp *interp){
+ static struct {
+ char *zName;
+ Tcl_ObjCmdProc *xProc;
+ } aCmd[] = {
+ { "binarize", (Tcl_ObjCmdProc*)binarize },
+ { "test_value_overhead", (Tcl_ObjCmdProc*)test_value_overhead },
+ { "test_translate", (Tcl_ObjCmdProc*)test_translate },
+ { "translate_selftest", (Tcl_ObjCmdProc*)test_translate_selftest},
+ };
+ int i;
+ for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
+ Tcl_CreateObjCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
+ }
+ return SQLITE_OK;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/tokenize.c b/ext/pdo_sqlite/sqlite/src/tokenize.c
new file mode 100644
index 000000000..7346f5b54
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/tokenize.c
@@ -0,0 +1,433 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** An tokenizer for SQL
+**
+** This file contains C code that splits an SQL input string up into
+** individual tokens and sends those tokens one-by-one over to the
+** parser for analysis.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#include <ctype.h>
+#include <stdlib.h>
+
+/*
+** The sqlite3KeywordCode function looks up an identifier to determine if
+** it is a keyword. If it is a keyword, the token code of that keyword is
+** returned. If the input is not a keyword, TK_ID is returned.
+**
+** The implementation of this routine was generated by a program,
+** mkkeywordhash.h, located in the tool subdirectory of the distribution.
+** The output of the mkkeywordhash.c program is written into a file
+** named keywordhash.h and then included into this source file by
+** the #include below.
+*/
+#include "keywordhash.h"
+
+
+/*
+** If X is a character that can be used in an identifier and
+** X&0x80==0 then sqlite3IsIdChar[X] will be 1. If X&0x80==0x80 then
+** X is always an identifier character. (Hence all UTF-8
+** characters can be part of an identifier). sqlite3IsIdChar[X] will
+** be 0 for every character in the lower 128 ASCII characters
+** that cannot be used as part of an identifier.
+**
+** In this implementation, an identifier can be a string of
+** alphabetic characters, digits, and "_" plus any character
+** with the high-order bit set. The latter rule means that
+** any sequence of UTF-8 characters or characters taken from
+** an extended ISO8859 character set can form an identifier.
+**
+** Ticket #1066. the SQL standard does not allow '$' in the
+** middle of identfiers. But many SQL implementations do.
+** SQLite will allow '$' in identifiers for compatibility.
+** But the feature is undocumented.
+*/
+const char sqlite3IsIdChar[] = {
+/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */
+};
+
+#define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && sqlite3IsIdChar[c-0x20]))
+
+/*
+** Return the length of the token that begins at z[0].
+** Store the token type in *tokenType before returning.
+*/
+static int getToken(const unsigned char *z, int *tokenType){
+ int i, c;
+ switch( *z ){
+ case ' ': case '\t': case '\n': case '\f': case '\r': {
+ for(i=1; isspace(z[i]); i++){}
+ *tokenType = TK_SPACE;
+ return i;
+ }
+ case '-': {
+ if( z[1]=='-' ){
+ for(i=2; (c=z[i])!=0 && c!='\n'; i++){}
+ *tokenType = TK_COMMENT;
+ return i;
+ }
+ *tokenType = TK_MINUS;
+ return 1;
+ }
+ case '(': {
+ *tokenType = TK_LP;
+ return 1;
+ }
+ case ')': {
+ *tokenType = TK_RP;
+ return 1;
+ }
+ case ';': {
+ *tokenType = TK_SEMI;
+ return 1;
+ }
+ case '+': {
+ *tokenType = TK_PLUS;
+ return 1;
+ }
+ case '*': {
+ *tokenType = TK_STAR;
+ return 1;
+ }
+ case '/': {
+ if( z[1]!='*' || z[2]==0 ){
+ *tokenType = TK_SLASH;
+ return 1;
+ }
+ for(i=3, c=z[2]; (c!='*' || z[i]!='/') && (c=z[i])!=0; i++){}
+ if( c ) i++;
+ *tokenType = TK_COMMENT;
+ return i;
+ }
+ case '%': {
+ *tokenType = TK_REM;
+ return 1;
+ }
+ case '=': {
+ *tokenType = TK_EQ;
+ return 1 + (z[1]=='=');
+ }
+ case '<': {
+ if( (c=z[1])=='=' ){
+ *tokenType = TK_LE;
+ return 2;
+ }else if( c=='>' ){
+ *tokenType = TK_NE;
+ return 2;
+ }else if( c=='<' ){
+ *tokenType = TK_LSHIFT;
+ return 2;
+ }else{
+ *tokenType = TK_LT;
+ return 1;
+ }
+ }
+ case '>': {
+ if( (c=z[1])=='=' ){
+ *tokenType = TK_GE;
+ return 2;
+ }else if( c=='>' ){
+ *tokenType = TK_RSHIFT;
+ return 2;
+ }else{
+ *tokenType = TK_GT;
+ return 1;
+ }
+ }
+ case '!': {
+ if( z[1]!='=' ){
+ *tokenType = TK_ILLEGAL;
+ return 2;
+ }else{
+ *tokenType = TK_NE;
+ return 2;
+ }
+ }
+ case '|': {
+ if( z[1]!='|' ){
+ *tokenType = TK_BITOR;
+ return 1;
+ }else{
+ *tokenType = TK_CONCAT;
+ return 2;
+ }
+ }
+ case ',': {
+ *tokenType = TK_COMMA;
+ return 1;
+ }
+ case '&': {
+ *tokenType = TK_BITAND;
+ return 1;
+ }
+ case '~': {
+ *tokenType = TK_BITNOT;
+ return 1;
+ }
+ case '`':
+ case '\'':
+ case '"': {
+ int delim = z[0];
+ for(i=1; (c=z[i])!=0; i++){
+ if( c==delim ){
+ if( z[i+1]==delim ){
+ i++;
+ }else{
+ break;
+ }
+ }
+ }
+ if( c ) i++;
+ *tokenType = TK_STRING;
+ return i;
+ }
+ case '.': {
+#ifndef SQLITE_OMIT_FLOATING_POINT
+ if( !isdigit(z[1]) )
+#endif
+ {
+ *tokenType = TK_DOT;
+ return 1;
+ }
+ /* If the next character is a digit, this is a floating point
+ ** number that begins with ".". Fall thru into the next case */
+ }
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9': {
+ *tokenType = TK_INTEGER;
+ for(i=0; isdigit(z[i]); i++){}
+#ifndef SQLITE_OMIT_FLOATING_POINT
+ if( z[i]=='.' ){
+ i++;
+ while( isdigit(z[i]) ){ i++; }
+ *tokenType = TK_FLOAT;
+ }
+ if( (z[i]=='e' || z[i]=='E') &&
+ ( isdigit(z[i+1])
+ || ((z[i+1]=='+' || z[i+1]=='-') && isdigit(z[i+2]))
+ )
+ ){
+ i += 2;
+ while( isdigit(z[i]) ){ i++; }
+ *tokenType = TK_FLOAT;
+ }
+#endif
+ return i;
+ }
+ case '[': {
+ for(i=1, c=z[0]; c!=']' && (c=z[i])!=0; i++){}
+ *tokenType = TK_ID;
+ return i;
+ }
+ case '?': {
+ *tokenType = TK_VARIABLE;
+ for(i=1; isdigit(z[i]); i++){}
+ return i;
+ }
+ case '#': {
+ for(i=1; isdigit(z[i]); i++){}
+ if( i>1 ){
+ /* Parameters of the form #NNN (where NNN is a number) are used
+ ** internally by sqlite3NestedParse. */
+ *tokenType = TK_REGISTER;
+ return i;
+ }
+ /* Fall through into the next case if the '#' is not followed by
+ ** a digit. Try to match #AAAA where AAAA is a parameter name. */
+ }
+#ifndef SQLITE_OMIT_TCL_VARIABLE
+ case '$':
+#endif
+ case ':': {
+ int n = 0;
+ *tokenType = TK_VARIABLE;
+ for(i=1; (c=z[i])!=0; i++){
+ if( IdChar(c) ){
+ n++;
+#ifndef SQLITE_OMIT_TCL_VARIABLE
+ }else if( c=='(' && n>0 ){
+ do{
+ i++;
+ }while( (c=z[i])!=0 && !isspace(c) && c!=')' );
+ if( c==')' ){
+ i++;
+ }else{
+ *tokenType = TK_ILLEGAL;
+ }
+ break;
+ }else if( c==':' && z[i+1]==':' ){
+ i++;
+#endif
+ }else{
+ break;
+ }
+ }
+ if( n==0 ) *tokenType = TK_ILLEGAL;
+ return i;
+ }
+#ifndef SQLITE_OMIT_BLOB_LITERAL
+ case 'x': case 'X': {
+ if( (c=z[1])=='\'' || c=='"' ){
+ int delim = c;
+ *tokenType = TK_BLOB;
+ for(i=2; (c=z[i])!=0; i++){
+ if( c==delim ){
+ if( i%2 ) *tokenType = TK_ILLEGAL;
+ break;
+ }
+ if( !isxdigit(c) ){
+ *tokenType = TK_ILLEGAL;
+ return i;
+ }
+ }
+ if( c ) i++;
+ return i;
+ }
+ /* Otherwise fall through to the next case */
+ }
+#endif
+ default: {
+ if( !IdChar(*z) ){
+ break;
+ }
+ for(i=1; IdChar(z[i]); i++){}
+ *tokenType = keywordCode((char*)z, i);
+ return i;
+ }
+ }
+ *tokenType = TK_ILLEGAL;
+ return 1;
+}
+int sqlite3GetToken(const unsigned char *z, int *tokenType){
+ return getToken(z, tokenType);
+}
+
+/*
+** Run the parser on the given SQL string. The parser structure is
+** passed in. An SQLITE_ status code is returned. If an error occurs
+** and pzErrMsg!=NULL then an error message might be written into
+** memory obtained from malloc() and *pzErrMsg made to point to that
+** error message. Or maybe not.
+*/
+int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
+ int nErr = 0;
+ int i;
+ void *pEngine;
+ int tokenType;
+ int lastTokenParsed = -1;
+ sqlite3 *db = pParse->db;
+ extern void *sqlite3ParserAlloc(void*(*)(int));
+ extern void sqlite3ParserFree(void*, void(*)(void*));
+ extern int sqlite3Parser(void*, int, Token, Parse*);
+
+ db->flags &= ~SQLITE_Interrupt;
+ pParse->rc = SQLITE_OK;
+ i = 0;
+ pEngine = sqlite3ParserAlloc((void*(*)(int))sqlite3MallocX);
+ if( pEngine==0 ){
+ sqlite3SetString(pzErrMsg, "out of memory", (char*)0);
+ return SQLITE_NOMEM;
+ }
+ assert( pParse->sLastToken.dyn==0 );
+ assert( pParse->pNewTable==0 );
+ assert( pParse->pNewTrigger==0 );
+ assert( pParse->nVar==0 );
+ assert( pParse->nVarExpr==0 );
+ assert( pParse->nVarExprAlloc==0 );
+ assert( pParse->apVarExpr==0 );
+ pParse->zTail = pParse->zSql = zSql;
+ while( sqlite3_malloc_failed==0 && zSql[i]!=0 ){
+ assert( i>=0 );
+ pParse->sLastToken.z = &zSql[i];
+ assert( pParse->sLastToken.dyn==0 );
+ pParse->sLastToken.n = getToken((unsigned char*)&zSql[i],&tokenType);
+ i += pParse->sLastToken.n;
+ switch( tokenType ){
+ case TK_SPACE:
+ case TK_COMMENT: {
+ if( (db->flags & SQLITE_Interrupt)!=0 ){
+ pParse->rc = SQLITE_INTERRUPT;
+ sqlite3SetString(pzErrMsg, "interrupt", (char*)0);
+ goto abort_parse;
+ }
+ break;
+ }
+ case TK_ILLEGAL: {
+ if( pzErrMsg ){
+ sqliteFree(*pzErrMsg);
+ *pzErrMsg = sqlite3MPrintf("unrecognized token: \"%T\"",
+ &pParse->sLastToken);
+ }
+ nErr++;
+ goto abort_parse;
+ }
+ case TK_SEMI: {
+ pParse->zTail = &zSql[i];
+ /* Fall thru into the default case */
+ }
+ default: {
+ sqlite3Parser(pEngine, tokenType, pParse->sLastToken, pParse);
+ lastTokenParsed = tokenType;
+ if( pParse->rc!=SQLITE_OK ){
+ goto abort_parse;
+ }
+ break;
+ }
+ }
+ }
+abort_parse:
+ if( zSql[i]==0 && nErr==0 && pParse->rc==SQLITE_OK ){
+ if( lastTokenParsed!=TK_SEMI ){
+ sqlite3Parser(pEngine, TK_SEMI, pParse->sLastToken, pParse);
+ pParse->zTail = &zSql[i];
+ }
+ sqlite3Parser(pEngine, 0, pParse->sLastToken, pParse);
+ }
+ sqlite3ParserFree(pEngine, sqlite3FreeX);
+ if( sqlite3_malloc_failed ){
+ pParse->rc = SQLITE_NOMEM;
+ }
+ if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){
+ sqlite3SetString(&pParse->zErrMsg, sqlite3ErrStr(pParse->rc),
+ (char*)0);
+ }
+ if( pParse->zErrMsg ){
+ if( pzErrMsg && *pzErrMsg==0 ){
+ *pzErrMsg = pParse->zErrMsg;
+ }else{
+ sqliteFree(pParse->zErrMsg);
+ }
+ pParse->zErrMsg = 0;
+ if( !nErr ) nErr++;
+ }
+ if( pParse->pVdbe && pParse->nErr>0 && pParse->nested==0 ){
+ sqlite3VdbeDelete(pParse->pVdbe);
+ pParse->pVdbe = 0;
+ }
+ sqlite3DeleteTable(pParse->db, pParse->pNewTable);
+ sqlite3DeleteTrigger(pParse->pNewTrigger);
+ sqliteFree(pParse->apVarExpr);
+ if( nErr>0 && (pParse->rc==SQLITE_OK || pParse->rc==SQLITE_DONE) ){
+ pParse->rc = SQLITE_ERROR;
+ }
+ return nErr;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/trigger.c b/ext/pdo_sqlite/sqlite/src/trigger.c
new file mode 100644
index 000000000..348dfdd57
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/trigger.c
@@ -0,0 +1,803 @@
+/*
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+*
+*/
+#include "sqliteInt.h"
+#include "vdbe.h"
+
+#ifndef SQLITE_OMIT_TRIGGER
+/*
+** Delete a linked list of TriggerStep structures.
+*/
+void sqlite3DeleteTriggerStep(TriggerStep *pTriggerStep){
+ while( pTriggerStep ){
+ TriggerStep * pTmp = pTriggerStep;
+ pTriggerStep = pTriggerStep->pNext;
+
+ if( pTmp->target.dyn ) sqliteFree((char*)pTmp->target.z);
+ sqlite3ExprDelete(pTmp->pWhere);
+ sqlite3ExprListDelete(pTmp->pExprList);
+ sqlite3SelectDelete(pTmp->pSelect);
+ sqlite3IdListDelete(pTmp->pIdList);
+
+ sqliteFree(pTmp);
+ }
+}
+
+/*
+** This is called by the parser when it sees a CREATE TRIGGER statement
+** up to the point of the BEGIN before the trigger actions. A Trigger
+** structure is generated based on the information available and stored
+** in pParse->pNewTrigger. After the trigger actions have been parsed, the
+** sqlite3FinishTrigger() function is called to complete the trigger
+** construction process.
+*/
+void sqlite3BeginTrigger(
+ Parse *pParse, /* The parse context of the CREATE TRIGGER statement */
+ Token *pName1, /* The name of the trigger */
+ Token *pName2, /* The name of the trigger */
+ int tr_tm, /* One of TK_BEFORE, TK_AFTER, TK_INSTEAD */
+ int op, /* One of TK_INSERT, TK_UPDATE, TK_DELETE */
+ IdList *pColumns, /* column list if this is an UPDATE OF trigger */
+ SrcList *pTableName,/* The name of the table/view the trigger applies to */
+ int foreach, /* One of TK_ROW or TK_STATEMENT */
+ Expr *pWhen, /* WHEN clause */
+ int isTemp /* True if the TEMPORARY keyword is present */
+){
+ Trigger *pTrigger = 0;
+ Table *pTab;
+ char *zName = 0; /* Name of the trigger */
+ sqlite3 *db = pParse->db;
+ int iDb; /* The database to store the trigger in */
+ Token *pName; /* The unqualified db name */
+ DbFixer sFix;
+
+ if( isTemp ){
+ /* If TEMP was specified, then the trigger name may not be qualified. */
+ if( pName2 && pName2->n>0 ){
+ sqlite3ErrorMsg(pParse, "temporary trigger may not have qualified name");
+ goto trigger_cleanup;
+ }
+ iDb = 1;
+ pName = pName1;
+ }else{
+ /* Figure out the db that the the trigger will be created in */
+ iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName);
+ if( iDb<0 ){
+ goto trigger_cleanup;
+ }
+ }
+
+ /* If the trigger name was unqualified, and the table is a temp table,
+ ** then set iDb to 1 to create the trigger in the temporary database.
+ ** If sqlite3SrcListLookup() returns 0, indicating the table does not
+ ** exist, the error is caught by the block below.
+ */
+ if( !pTableName || sqlite3_malloc_failed ) goto trigger_cleanup;
+ pTab = sqlite3SrcListLookup(pParse, pTableName);
+ if( pName2->n==0 && pTab && pTab->iDb==1 ){
+ iDb = 1;
+ }
+
+ /* Ensure the table name matches database name and that the table exists */
+ if( sqlite3_malloc_failed ) goto trigger_cleanup;
+ assert( pTableName->nSrc==1 );
+ if( sqlite3FixInit(&sFix, pParse, iDb, "trigger", pName) &&
+ sqlite3FixSrcList(&sFix, pTableName) ){
+ goto trigger_cleanup;
+ }
+ pTab = sqlite3SrcListLookup(pParse, pTableName);
+ if( !pTab ){
+ /* The table does not exist. */
+ goto trigger_cleanup;
+ }
+
+ /* Check that the trigger name is not reserved and that no trigger of the
+ ** specified name exists */
+ zName = sqlite3NameFromToken(pName);
+ if( !zName || SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ goto trigger_cleanup;
+ }
+ if( sqlite3HashFind(&(db->aDb[iDb].trigHash), zName,pName->n+1) ){
+ sqlite3ErrorMsg(pParse, "trigger %T already exists", pName);
+ goto trigger_cleanup;
+ }
+
+ /* Do not create a trigger on a system table */
+ if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){
+ sqlite3ErrorMsg(pParse, "cannot create trigger on system table");
+ pParse->nErr++;
+ goto trigger_cleanup;
+ }
+
+ /* INSTEAD of triggers are only for views and views only support INSTEAD
+ ** of triggers.
+ */
+ if( pTab->pSelect && tr_tm!=TK_INSTEAD ){
+ sqlite3ErrorMsg(pParse, "cannot create %s trigger on view: %S",
+ (tr_tm == TK_BEFORE)?"BEFORE":"AFTER", pTableName, 0);
+ goto trigger_cleanup;
+ }
+ if( !pTab->pSelect && tr_tm==TK_INSTEAD ){
+ sqlite3ErrorMsg(pParse, "cannot create INSTEAD OF"
+ " trigger on table: %S", pTableName, 0);
+ goto trigger_cleanup;
+ }
+
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ {
+ int code = SQLITE_CREATE_TRIGGER;
+ const char *zDb = db->aDb[pTab->iDb].zName;
+ const char *zDbTrig = isTemp ? db->aDb[1].zName : zDb;
+ if( pTab->iDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER;
+ if( sqlite3AuthCheck(pParse, code, zName, pTab->zName, zDbTrig) ){
+ goto trigger_cleanup;
+ }
+ if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(pTab->iDb),0,zDb)){
+ goto trigger_cleanup;
+ }
+ }
+#endif
+
+ /* INSTEAD OF triggers can only appear on views and BEFORE triggers
+ ** cannot appear on views. So we might as well translate every
+ ** INSTEAD OF trigger into a BEFORE trigger. It simplifies code
+ ** elsewhere.
+ */
+ if (tr_tm == TK_INSTEAD){
+ tr_tm = TK_BEFORE;
+ }
+
+ /* Build the Trigger object */
+ pTrigger = (Trigger*)sqliteMalloc(sizeof(Trigger));
+ if( pTrigger==0 ) goto trigger_cleanup;
+ pTrigger->name = zName;
+ zName = 0;
+ pTrigger->table = sqliteStrDup(pTableName->a[0].zName);
+ pTrigger->iDb = iDb;
+ pTrigger->iTabDb = pTab->iDb;
+ pTrigger->op = op;
+ pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER;
+ pTrigger->pWhen = sqlite3ExprDup(pWhen);
+ pTrigger->pColumns = sqlite3IdListDup(pColumns);
+ pTrigger->foreach = foreach;
+ sqlite3TokenCopy(&pTrigger->nameToken,pName);
+ assert( pParse->pNewTrigger==0 );
+ pParse->pNewTrigger = pTrigger;
+
+trigger_cleanup:
+ sqliteFree(zName);
+ sqlite3SrcListDelete(pTableName);
+ sqlite3IdListDelete(pColumns);
+ sqlite3ExprDelete(pWhen);
+ if( !pParse->pNewTrigger ){
+ sqlite3DeleteTrigger(pTrigger);
+ }else{
+ assert( pParse->pNewTrigger==pTrigger );
+ }
+}
+
+/*
+** This routine is called after all of the trigger actions have been parsed
+** in order to complete the process of building the trigger.
+*/
+void sqlite3FinishTrigger(
+ Parse *pParse, /* Parser context */
+ TriggerStep *pStepList, /* The triggered program */
+ Token *pAll /* Token that describes the complete CREATE TRIGGER */
+){
+ Trigger *pTrig = 0; /* The trigger whose construction is finishing up */
+ sqlite3 *db = pParse->db; /* The database */
+ DbFixer sFix;
+
+ pTrig = pParse->pNewTrigger;
+ pParse->pNewTrigger = 0;
+ if( pParse->nErr || pTrig==0 ) goto triggerfinish_cleanup;
+ pTrig->step_list = pStepList;
+ while( pStepList ){
+ pStepList->pTrig = pTrig;
+ pStepList = pStepList->pNext;
+ }
+ if( sqlite3FixInit(&sFix, pParse, pTrig->iDb, "trigger", &pTrig->nameToken)
+ && sqlite3FixTriggerStep(&sFix, pTrig->step_list) ){
+ goto triggerfinish_cleanup;
+ }
+
+ /* if we are not initializing, and this trigger is not on a TEMP table,
+ ** build the sqlite_master entry
+ */
+ if( !db->init.busy ){
+ static const VdbeOpList insertTrig[] = {
+ { OP_NewRowid, 0, 0, 0 },
+ { OP_String8, 0, 0, "trigger" },
+ { OP_String8, 0, 0, 0 }, /* 2: trigger name */
+ { OP_String8, 0, 0, 0 }, /* 3: table name */
+ { OP_Integer, 0, 0, 0 },
+ { OP_String8, 0, 0, "CREATE TRIGGER "},
+ { OP_String8, 0, 0, 0 }, /* 6: SQL */
+ { OP_Concat, 0, 0, 0 },
+ { OP_MakeRecord, 5, 0, "tttit" },
+ { OP_Insert, 0, 0, 0 },
+ };
+ int addr;
+ Vdbe *v;
+
+ /* Make an entry in the sqlite_master table */
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) goto triggerfinish_cleanup;
+ sqlite3BeginWriteOperation(pParse, 0, pTrig->iDb);
+ sqlite3OpenMasterTable(v, pTrig->iDb);
+ addr = sqlite3VdbeAddOpList(v, ArraySize(insertTrig), insertTrig);
+ sqlite3VdbeChangeP3(v, addr+2, pTrig->name, 0);
+ sqlite3VdbeChangeP3(v, addr+3, pTrig->table, 0);
+ sqlite3VdbeChangeP3(v, addr+6, pAll->z, pAll->n);
+ sqlite3ChangeCookie(db, v, pTrig->iDb);
+ sqlite3VdbeAddOp(v, OP_Close, 0, 0);
+ sqlite3VdbeOp3(v, OP_ParseSchema, pTrig->iDb, 0,
+ sqlite3MPrintf("type='trigger' AND name='%q'", pTrig->name), P3_DYNAMIC);
+ }
+
+ if( db->init.busy ){
+ Table *pTab;
+ Trigger *pDel;
+ pDel = sqlite3HashInsert(&db->aDb[pTrig->iDb].trigHash,
+ pTrig->name, strlen(pTrig->name)+1, pTrig);
+ if( pDel ){
+ assert( sqlite3_malloc_failed && pDel==pTrig );
+ goto triggerfinish_cleanup;
+ }
+ pTab = sqlite3LocateTable(pParse,pTrig->table,db->aDb[pTrig->iTabDb].zName);
+ assert( pTab!=0 );
+ pTrig->pNext = pTab->pTrigger;
+ pTab->pTrigger = pTrig;
+ pTrig = 0;
+ }
+
+triggerfinish_cleanup:
+ sqlite3DeleteTrigger(pTrig);
+ assert( !pParse->pNewTrigger );
+ sqlite3DeleteTriggerStep(pStepList);
+}
+
+/*
+** Make a copy of all components of the given trigger step. This has
+** the effect of copying all Expr.token.z values into memory obtained
+** from sqliteMalloc(). As initially created, the Expr.token.z values
+** all point to the input string that was fed to the parser. But that
+** string is ephemeral - it will go away as soon as the sqlite3_exec()
+** call that started the parser exits. This routine makes a persistent
+** copy of all the Expr.token.z strings so that the TriggerStep structure
+** will be valid even after the sqlite3_exec() call returns.
+*/
+static void sqlitePersistTriggerStep(TriggerStep *p){
+ if( p->target.z ){
+ p->target.z = sqliteStrNDup(p->target.z, p->target.n);
+ p->target.dyn = 1;
+ }
+ if( p->pSelect ){
+ Select *pNew = sqlite3SelectDup(p->pSelect);
+ sqlite3SelectDelete(p->pSelect);
+ p->pSelect = pNew;
+ }
+ if( p->pWhere ){
+ Expr *pNew = sqlite3ExprDup(p->pWhere);
+ sqlite3ExprDelete(p->pWhere);
+ p->pWhere = pNew;
+ }
+ if( p->pExprList ){
+ ExprList *pNew = sqlite3ExprListDup(p->pExprList);
+ sqlite3ExprListDelete(p->pExprList);
+ p->pExprList = pNew;
+ }
+ if( p->pIdList ){
+ IdList *pNew = sqlite3IdListDup(p->pIdList);
+ sqlite3IdListDelete(p->pIdList);
+ p->pIdList = pNew;
+ }
+}
+
+/*
+** Turn a SELECT statement (that the pSelect parameter points to) into
+** a trigger step. Return a pointer to a TriggerStep structure.
+**
+** The parser calls this routine when it finds a SELECT statement in
+** body of a TRIGGER.
+*/
+TriggerStep *sqlite3TriggerSelectStep(Select *pSelect){
+ TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));
+ if( pTriggerStep==0 ) return 0;
+
+ pTriggerStep->op = TK_SELECT;
+ pTriggerStep->pSelect = pSelect;
+ pTriggerStep->orconf = OE_Default;
+ sqlitePersistTriggerStep(pTriggerStep);
+
+ return pTriggerStep;
+}
+
+/*
+** Build a trigger step out of an INSERT statement. Return a pointer
+** to the new trigger step.
+**
+** The parser calls this routine when it sees an INSERT inside the
+** body of a trigger.
+*/
+TriggerStep *sqlite3TriggerInsertStep(
+ Token *pTableName, /* Name of the table into which we insert */
+ IdList *pColumn, /* List of columns in pTableName to insert into */
+ ExprList *pEList, /* The VALUE clause: a list of values to be inserted */
+ Select *pSelect, /* A SELECT statement that supplies values */
+ int orconf /* The conflict algorithm (OE_Abort, OE_Replace, etc.) */
+){
+ TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));
+
+ assert(pEList == 0 || pSelect == 0);
+ assert(pEList != 0 || pSelect != 0);
+
+ if( pTriggerStep ){
+ pTriggerStep->op = TK_INSERT;
+ pTriggerStep->pSelect = pSelect;
+ pTriggerStep->target = *pTableName;
+ pTriggerStep->pIdList = pColumn;
+ pTriggerStep->pExprList = pEList;
+ pTriggerStep->orconf = orconf;
+ sqlitePersistTriggerStep(pTriggerStep);
+ }else{
+ sqlite3IdListDelete(pColumn);
+ sqlite3ExprListDelete(pEList);
+ sqlite3SelectDup(pSelect);
+ }
+
+ return pTriggerStep;
+}
+
+/*
+** Construct a trigger step that implements an UPDATE statement and return
+** a pointer to that trigger step. The parser calls this routine when it
+** sees an UPDATE statement inside the body of a CREATE TRIGGER.
+*/
+TriggerStep *sqlite3TriggerUpdateStep(
+ Token *pTableName, /* Name of the table to be updated */
+ ExprList *pEList, /* The SET clause: list of column and new values */
+ Expr *pWhere, /* The WHERE clause */
+ int orconf /* The conflict algorithm. (OE_Abort, OE_Ignore, etc) */
+){
+ TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));
+ if( pTriggerStep==0 ) return 0;
+
+ pTriggerStep->op = TK_UPDATE;
+ pTriggerStep->target = *pTableName;
+ pTriggerStep->pExprList = pEList;
+ pTriggerStep->pWhere = pWhere;
+ pTriggerStep->orconf = orconf;
+ sqlitePersistTriggerStep(pTriggerStep);
+
+ return pTriggerStep;
+}
+
+/*
+** Construct a trigger step that implements a DELETE statement and return
+** a pointer to that trigger step. The parser calls this routine when it
+** sees a DELETE statement inside the body of a CREATE TRIGGER.
+*/
+TriggerStep *sqlite3TriggerDeleteStep(Token *pTableName, Expr *pWhere){
+ TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));
+ if( pTriggerStep==0 ) return 0;
+
+ pTriggerStep->op = TK_DELETE;
+ pTriggerStep->target = *pTableName;
+ pTriggerStep->pWhere = pWhere;
+ pTriggerStep->orconf = OE_Default;
+ sqlitePersistTriggerStep(pTriggerStep);
+
+ return pTriggerStep;
+}
+
+/*
+** Recursively delete a Trigger structure
+*/
+void sqlite3DeleteTrigger(Trigger *pTrigger){
+ if( pTrigger==0 ) return;
+ sqlite3DeleteTriggerStep(pTrigger->step_list);
+ sqliteFree(pTrigger->name);
+ sqliteFree(pTrigger->table);
+ sqlite3ExprDelete(pTrigger->pWhen);
+ sqlite3IdListDelete(pTrigger->pColumns);
+ if( pTrigger->nameToken.dyn ) sqliteFree((char*)pTrigger->nameToken.z);
+ sqliteFree(pTrigger);
+}
+
+/*
+** This function is called to drop a trigger from the database schema.
+**
+** This may be called directly from the parser and therefore identifies
+** the trigger by name. The sqlite3DropTriggerPtr() routine does the
+** same job as this routine except it takes a pointer to the trigger
+** instead of the trigger name.
+**/
+void sqlite3DropTrigger(Parse *pParse, SrcList *pName){
+ Trigger *pTrigger = 0;
+ int i;
+ const char *zDb;
+ const char *zName;
+ int nName;
+ sqlite3 *db = pParse->db;
+
+ if( sqlite3_malloc_failed ) goto drop_trigger_cleanup;
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ goto drop_trigger_cleanup;
+ }
+
+ assert( pName->nSrc==1 );
+ zDb = pName->a[0].zDatabase;
+ zName = pName->a[0].zName;
+ nName = strlen(zName);
+ for(i=OMIT_TEMPDB; i<db->nDb; i++){
+ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
+ if( zDb && sqlite3StrICmp(db->aDb[j].zName, zDb) ) continue;
+ pTrigger = sqlite3HashFind(&(db->aDb[j].trigHash), zName, nName+1);
+ if( pTrigger ) break;
+ }
+ if( !pTrigger ){
+ sqlite3ErrorMsg(pParse, "no such trigger: %S", pName, 0);
+ goto drop_trigger_cleanup;
+ }
+ sqlite3DropTriggerPtr(pParse, pTrigger, 0);
+
+drop_trigger_cleanup:
+ sqlite3SrcListDelete(pName);
+}
+
+/*
+** Return a pointer to the Table structure for the table that a trigger
+** is set on.
+*/
+static Table *tableOfTrigger(sqlite3 *db, Trigger *pTrigger){
+ return sqlite3FindTable(db,pTrigger->table,db->aDb[pTrigger->iTabDb].zName);
+}
+
+
+/*
+** Drop a trigger given a pointer to that trigger. If nested is false,
+** then also generate code to remove the trigger from the SQLITE_MASTER
+** table.
+*/
+void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){
+ Table *pTable;
+ Vdbe *v;
+ sqlite3 *db = pParse->db;
+ int iDb;
+
+ iDb = pTrigger->iDb;
+ assert( iDb>=0 && iDb<db->nDb );
+ pTable = tableOfTrigger(db, pTrigger);
+ assert(pTable);
+ assert( pTable->iDb==iDb || iDb==1 );
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ {
+ int code = SQLITE_DROP_TRIGGER;
+ const char *zDb = db->aDb[iDb].zName;
+ const char *zTab = SCHEMA_TABLE(iDb);
+ if( iDb==1 ) code = SQLITE_DROP_TEMP_TRIGGER;
+ if( sqlite3AuthCheck(pParse, code, pTrigger->name, pTable->zName, zDb) ||
+ sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
+ return;
+ }
+ }
+#endif
+
+ /* Generate code to destroy the database record of the trigger.
+ */
+ if( pTable!=0 && (v = sqlite3GetVdbe(pParse))!=0 ){
+ int base;
+ static const VdbeOpList dropTrigger[] = {
+ { OP_Rewind, 0, ADDR(9), 0},
+ { OP_String8, 0, 0, 0}, /* 1 */
+ { OP_Column, 0, 1, 0},
+ { OP_Ne, 0, ADDR(8), 0},
+ { OP_String8, 0, 0, "trigger"},
+ { OP_Column, 0, 0, 0},
+ { OP_Ne, 0, ADDR(8), 0},
+ { OP_Delete, 0, 0, 0},
+ { OP_Next, 0, ADDR(1), 0}, /* 8 */
+ };
+
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+ sqlite3OpenMasterTable(v, iDb);
+ base = sqlite3VdbeAddOpList(v, ArraySize(dropTrigger), dropTrigger);
+ sqlite3VdbeChangeP3(v, base+1, pTrigger->name, 0);
+ sqlite3ChangeCookie(db, v, iDb);
+ sqlite3VdbeAddOp(v, OP_Close, 0, 0);
+ sqlite3VdbeOp3(v, OP_DropTrigger, iDb, 0, pTrigger->name, 0);
+ }
+}
+
+/*
+** Remove a trigger from the hash tables of the sqlite* pointer.
+*/
+void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){
+ Trigger *pTrigger;
+ int nName = strlen(zName);
+ pTrigger = sqlite3HashInsert(&(db->aDb[iDb].trigHash), zName, nName+1, 0);
+ if( pTrigger ){
+ Table *pTable = tableOfTrigger(db, pTrigger);
+ assert( pTable!=0 );
+ if( pTable->pTrigger == pTrigger ){
+ pTable->pTrigger = pTrigger->pNext;
+ }else{
+ Trigger *cc = pTable->pTrigger;
+ while( cc ){
+ if( cc->pNext == pTrigger ){
+ cc->pNext = cc->pNext->pNext;
+ break;
+ }
+ cc = cc->pNext;
+ }
+ assert(cc);
+ }
+ sqlite3DeleteTrigger(pTrigger);
+ db->flags |= SQLITE_InternChanges;
+ }
+}
+
+/*
+** pEList is the SET clause of an UPDATE statement. Each entry
+** in pEList is of the format <id>=<expr>. If any of the entries
+** in pEList have an <id> which matches an identifier in pIdList,
+** then return TRUE. If pIdList==NULL, then it is considered a
+** wildcard that matches anything. Likewise if pEList==NULL then
+** it matches anything so always return true. Return false only
+** if there is no match.
+*/
+static int checkColumnOverLap(IdList *pIdList, ExprList *pEList){
+ int e;
+ if( !pIdList || !pEList ) return 1;
+ for(e=0; e<pEList->nExpr; e++){
+ if( sqlite3IdListIndex(pIdList, pEList->a[e].zName)>=0 ) return 1;
+ }
+ return 0;
+}
+
+/*
+** Return a bit vector to indicate what kind of triggers exist for operation
+** "op" on table pTab. If pChanges is not NULL then it is a list of columns
+** that are being updated. Triggers only match if the ON clause of the
+** trigger definition overlaps the set of columns being updated.
+**
+** The returned bit vector is some combination of TRIGGER_BEFORE and
+** TRIGGER_AFTER.
+*/
+int sqlite3TriggersExist(
+ Parse *pParse, /* Used to check for recursive triggers */
+ Table *pTab, /* The table the contains the triggers */
+ int op, /* one of TK_DELETE, TK_INSERT, TK_UPDATE */
+ ExprList *pChanges /* Columns that change in an UPDATE statement */
+){
+ Trigger *pTrigger = pTab->pTrigger;
+ int mask = 0;
+
+ while( pTrigger ){
+ if( pTrigger->op==op && checkColumnOverLap(pTrigger->pColumns, pChanges) ){
+ TriggerStack *ss;
+ ss = pParse->trigStack;
+ while( ss && ss->pTrigger!=pTab->pTrigger ){
+ ss = ss->pNext;
+ }
+ if( ss==0 ){
+ mask |= pTrigger->tr_tm;
+ }
+ }
+ pTrigger = pTrigger->pNext;
+ }
+ return mask;
+}
+
+/*
+** Convert the pStep->target token into a SrcList and return a pointer
+** to that SrcList.
+**
+** This routine adds a specific database name, if needed, to the target when
+** forming the SrcList. This prevents a trigger in one database from
+** referring to a target in another database. An exception is when the
+** trigger is in TEMP in which case it can refer to any other database it
+** wants.
+*/
+static SrcList *targetSrcList(
+ Parse *pParse, /* The parsing context */
+ TriggerStep *pStep /* The trigger containing the target token */
+){
+ Token sDb; /* Dummy database name token */
+ int iDb; /* Index of the database to use */
+ SrcList *pSrc; /* SrcList to be returned */
+
+ iDb = pStep->pTrig->iDb;
+ if( iDb==0 || iDb>=2 ){
+ assert( iDb<pParse->db->nDb );
+ sDb.z = pParse->db->aDb[iDb].zName;
+ sDb.n = strlen(sDb.z);
+ pSrc = sqlite3SrcListAppend(0, &sDb, &pStep->target);
+ } else {
+ pSrc = sqlite3SrcListAppend(0, &pStep->target, 0);
+ }
+ return pSrc;
+}
+
+/*
+** Generate VDBE code for zero or more statements inside the body of a
+** trigger.
+*/
+static int codeTriggerProgram(
+ Parse *pParse, /* The parser context */
+ TriggerStep *pStepList, /* List of statements inside the trigger body */
+ int orconfin /* Conflict algorithm. (OE_Abort, etc) */
+){
+ TriggerStep * pTriggerStep = pStepList;
+ int orconf;
+ Vdbe *v = pParse->pVdbe;
+
+ assert( pTriggerStep!=0 );
+ assert( v!=0 );
+ sqlite3VdbeAddOp(v, OP_ContextPush, 0, 0);
+ VdbeComment((v, "# begin trigger %s", pStepList->pTrig->name));
+ while( pTriggerStep ){
+ orconf = (orconfin == OE_Default)?pTriggerStep->orconf:orconfin;
+ pParse->trigStack->orconf = orconf;
+ switch( pTriggerStep->op ){
+ case TK_SELECT: {
+ Select * ss = sqlite3SelectDup(pTriggerStep->pSelect);
+ assert(ss);
+ assert(ss->pSrc);
+ sqlite3SelectResolve(pParse, ss, 0);
+ sqlite3Select(pParse, ss, SRT_Discard, 0, 0, 0, 0, 0);
+ sqlite3SelectDelete(ss);
+ break;
+ }
+ case TK_UPDATE: {
+ SrcList *pSrc;
+ pSrc = targetSrcList(pParse, pTriggerStep);
+ sqlite3VdbeAddOp(v, OP_ResetCount, 0, 0);
+ sqlite3Update(pParse, pSrc,
+ sqlite3ExprListDup(pTriggerStep->pExprList),
+ sqlite3ExprDup(pTriggerStep->pWhere), orconf);
+ sqlite3VdbeAddOp(v, OP_ResetCount, 1, 0);
+ break;
+ }
+ case TK_INSERT: {
+ SrcList *pSrc;
+ pSrc = targetSrcList(pParse, pTriggerStep);
+ sqlite3VdbeAddOp(v, OP_ResetCount, 0, 0);
+ sqlite3Insert(pParse, pSrc,
+ sqlite3ExprListDup(pTriggerStep->pExprList),
+ sqlite3SelectDup(pTriggerStep->pSelect),
+ sqlite3IdListDup(pTriggerStep->pIdList), orconf);
+ sqlite3VdbeAddOp(v, OP_ResetCount, 1, 0);
+ break;
+ }
+ case TK_DELETE: {
+ SrcList *pSrc;
+ sqlite3VdbeAddOp(v, OP_ResetCount, 0, 0);
+ pSrc = targetSrcList(pParse, pTriggerStep);
+ sqlite3DeleteFrom(pParse, pSrc, sqlite3ExprDup(pTriggerStep->pWhere));
+ sqlite3VdbeAddOp(v, OP_ResetCount, 1, 0);
+ break;
+ }
+ default:
+ assert(0);
+ }
+ pTriggerStep = pTriggerStep->pNext;
+ }
+ sqlite3VdbeAddOp(v, OP_ContextPop, 0, 0);
+ VdbeComment((v, "# end trigger %s", pStepList->pTrig->name));
+
+ return 0;
+}
+
+/*
+** This is called to code FOR EACH ROW triggers.
+**
+** When the code that this function generates is executed, the following
+** must be true:
+**
+** 1. No cursors may be open in the main database. (But newIdx and oldIdx
+** can be indices of cursors in temporary tables. See below.)
+**
+** 2. If the triggers being coded are ON INSERT or ON UPDATE triggers, then
+** a temporary vdbe cursor (index newIdx) must be open and pointing at
+** a row containing values to be substituted for new.* expressions in the
+** trigger program(s).
+**
+** 3. If the triggers being coded are ON DELETE or ON UPDATE triggers, then
+** a temporary vdbe cursor (index oldIdx) must be open and pointing at
+** a row containing values to be substituted for old.* expressions in the
+** trigger program(s).
+**
+*/
+int sqlite3CodeRowTrigger(
+ Parse *pParse, /* Parse context */
+ int op, /* One of TK_UPDATE, TK_INSERT, TK_DELETE */
+ ExprList *pChanges, /* Changes list for any UPDATE OF triggers */
+ int tr_tm, /* One of TRIGGER_BEFORE, TRIGGER_AFTER */
+ Table *pTab, /* The table to code triggers from */
+ int newIdx, /* The indice of the "new" row to access */
+ int oldIdx, /* The indice of the "old" row to access */
+ int orconf, /* ON CONFLICT policy */
+ int ignoreJump /* Instruction to jump to for RAISE(IGNORE) */
+){
+ Trigger *pTrigger;
+ TriggerStack *pStack;
+ TriggerStack trigStackEntry;
+
+ assert(op == TK_UPDATE || op == TK_INSERT || op == TK_DELETE);
+ assert(tr_tm == TRIGGER_BEFORE || tr_tm == TRIGGER_AFTER );
+
+ assert(newIdx != -1 || oldIdx != -1);
+
+ pTrigger = pTab->pTrigger;
+ while( pTrigger ){
+ int fire_this = 0;
+
+ /* determine whether we should code this trigger */
+ if( pTrigger->op == op && pTrigger->tr_tm == tr_tm ){
+ fire_this = 1;
+ for(pStack=pParse->trigStack; pStack; pStack=pStack->pNext){
+ if( pStack->pTrigger==pTrigger ){
+ fire_this = 0;
+ }
+ }
+ if( op == TK_UPDATE && pTrigger->pColumns &&
+ !checkColumnOverLap(pTrigger->pColumns, pChanges) ){
+ fire_this = 0;
+ }
+ }
+
+ if( fire_this ){
+ int endTrigger;
+ Expr * whenExpr;
+ AuthContext sContext;
+ NameContext sNC;
+
+ memset(&sNC, 0, sizeof(sNC));
+ sNC.pParse = pParse;
+
+ /* Push an entry on to the trigger stack */
+ trigStackEntry.pTrigger = pTrigger;
+ trigStackEntry.newIdx = newIdx;
+ trigStackEntry.oldIdx = oldIdx;
+ trigStackEntry.pTab = pTab;
+ trigStackEntry.pNext = pParse->trigStack;
+ trigStackEntry.ignoreJump = ignoreJump;
+ pParse->trigStack = &trigStackEntry;
+ sqlite3AuthContextPush(pParse, &sContext, pTrigger->name);
+
+ /* code the WHEN clause */
+ endTrigger = sqlite3VdbeMakeLabel(pParse->pVdbe);
+ whenExpr = sqlite3ExprDup(pTrigger->pWhen);
+ if( sqlite3ExprResolveNames(&sNC, whenExpr) ){
+ pParse->trigStack = trigStackEntry.pNext;
+ sqlite3ExprDelete(whenExpr);
+ return 1;
+ }
+ sqlite3ExprIfFalse(pParse, whenExpr, endTrigger, 1);
+ sqlite3ExprDelete(whenExpr);
+
+ codeTriggerProgram(pParse, pTrigger->step_list, orconf);
+
+ /* Pop the entry off the trigger stack */
+ pParse->trigStack = trigStackEntry.pNext;
+ sqlite3AuthContextPop(&sContext);
+
+ sqlite3VdbeResolveLabel(pParse->pVdbe, endTrigger);
+ }
+ pTrigger = pTrigger->pNext;
+ }
+ return 0;
+}
+#endif /* !defined(SQLITE_OMIT_TRIGGER) */
diff --git a/ext/pdo_sqlite/sqlite/src/update.c b/ext/pdo_sqlite/sqlite/src/update.c
new file mode 100644
index 000000000..b6c6b8b1e
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/update.c
@@ -0,0 +1,506 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains C code routines that are called by the parser
+** to handle UPDATE statements.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+
+/*
+** The most recently coded instruction was an OP_Column to retrieve column
+** 'i' of table pTab. This routine sets the P3 parameter of the
+** OP_Column to the default value, if any.
+**
+** The default value of a column is specified by a DEFAULT clause in the
+** column definition. This was either supplied by the user when the table
+** was created, or added later to the table definition by an ALTER TABLE
+** command. If the latter, then the row-records in the table btree on disk
+** may not contain a value for the column and the default value, taken
+** from the P3 parameter of the OP_Column instruction, is returned instead.
+** If the former, then all row-records are guaranteed to include a value
+** for the column and the P3 value is not required.
+**
+** Column definitions created by an ALTER TABLE command may only have
+** literal default values specified: a number, null or a string. (If a more
+** complicated default expression value was provided, it is evaluated
+** when the ALTER TABLE is executed and one of the literal values written
+** into the sqlite_master table.)
+**
+** Therefore, the P3 parameter is only required if the default value for
+** the column is a literal number, string or null. The sqlite3ValueFromExpr()
+** function is capable of transforming these types of expressions into
+** sqlite3_value objects.
+*/
+void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){
+ if( pTab && !pTab->pSelect ){
+ sqlite3_value *pValue;
+ u8 enc = sqlite3VdbeDb(v)->enc;
+ Column *pCol = &pTab->aCol[i];
+ sqlite3ValueFromExpr(pCol->pDflt, enc, pCol->affinity, &pValue);
+ if( pValue ){
+ sqlite3VdbeChangeP3(v, -1, (const char *)pValue, P3_MEM);
+ }else{
+ VdbeComment((v, "# %s.%s", pTab->zName, pCol->zName));
+ }
+ }
+}
+
+/*
+** Process an UPDATE statement.
+**
+** UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL;
+** \_______/ \________/ \______/ \________________/
+* onError pTabList pChanges pWhere
+*/
+void sqlite3Update(
+ Parse *pParse, /* The parser context */
+ SrcList *pTabList, /* The table in which we should change things */
+ ExprList *pChanges, /* Things to be changed */
+ Expr *pWhere, /* The WHERE clause. May be null */
+ int onError /* How to handle constraint errors */
+){
+ int i, j; /* Loop counters */
+ Table *pTab; /* The table to be updated */
+ int addr = 0; /* VDBE instruction address of the start of the loop */
+ WhereInfo *pWInfo; /* Information about the WHERE clause */
+ Vdbe *v; /* The virtual database engine */
+ Index *pIdx; /* For looping over indices */
+ int nIdx; /* Number of indices that need updating */
+ int nIdxTotal; /* Total number of indices */
+ int iCur; /* VDBE Cursor number of pTab */
+ sqlite3 *db; /* The database structure */
+ Index **apIdx = 0; /* An array of indices that need updating too */
+ char *aIdxUsed = 0; /* aIdxUsed[i]==1 if the i-th index is used */
+ int *aXRef = 0; /* aXRef[i] is the index in pChanges->a[] of the
+ ** an expression for the i-th column of the table.
+ ** aXRef[i]==-1 if the i-th column is not changed. */
+ int chngRowid; /* True if the record number is being changed */
+ Expr *pRowidExpr = 0; /* Expression defining the new record number */
+ int openAll = 0; /* True if all indices need to be opened */
+ AuthContext sContext; /* The authorization context */
+ NameContext sNC; /* The name-context to resolve expressions in */
+
+#ifndef SQLITE_OMIT_TRIGGER
+ int isView; /* Trying to update a view */
+ int triggers_exist = 0; /* True if any row triggers exist */
+#endif
+
+ int newIdx = -1; /* index of trigger "new" temp table */
+ int oldIdx = -1; /* index of trigger "old" temp table */
+
+ sContext.pParse = 0;
+ if( pParse->nErr || sqlite3_malloc_failed ) goto update_cleanup;
+ db = pParse->db;
+ assert( pTabList->nSrc==1 );
+
+ /* Locate the table which we want to update.
+ */
+ pTab = sqlite3SrcListLookup(pParse, pTabList);
+ if( pTab==0 ) goto update_cleanup;
+
+ /* Figure out if we have any triggers and if the table being
+ ** updated is a view
+ */
+#ifndef SQLITE_OMIT_TRIGGER
+ triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges);
+ isView = pTab->pSelect!=0;
+#else
+# define triggers_exist 0
+# define isView 0
+#endif
+#ifdef SQLITE_OMIT_VIEW
+# undef isView
+# define isView 0
+#endif
+
+ if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){
+ goto update_cleanup;
+ }
+ if( isView ){
+ if( sqlite3ViewGetColumnNames(pParse, pTab) ){
+ goto update_cleanup;
+ }
+ }
+ aXRef = sqliteMallocRaw( sizeof(int) * pTab->nCol );
+ if( aXRef==0 ) goto update_cleanup;
+ for(i=0; i<pTab->nCol; i++) aXRef[i] = -1;
+
+ /* If there are FOR EACH ROW triggers, allocate cursors for the
+ ** special OLD and NEW tables
+ */
+ if( triggers_exist ){
+ newIdx = pParse->nTab++;
+ oldIdx = pParse->nTab++;
+ }
+
+ /* Allocate a cursors for the main database table and for all indices.
+ ** The index cursors might not be used, but if they are used they
+ ** need to occur right after the database cursor. So go ahead and
+ ** allocate enough space, just in case.
+ */
+ pTabList->a[0].iCursor = iCur = pParse->nTab++;
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ pParse->nTab++;
+ }
+
+ /* Initialize the name-context */
+ memset(&sNC, 0, sizeof(sNC));
+ sNC.pParse = pParse;
+ sNC.pSrcList = pTabList;
+
+ /* Resolve the column names in all the expressions of the
+ ** of the UPDATE statement. Also find the column index
+ ** for each column to be updated in the pChanges array. For each
+ ** column to be updated, make sure we have authorization to change
+ ** that column.
+ */
+ chngRowid = 0;
+ for(i=0; i<pChanges->nExpr; i++){
+ if( sqlite3ExprResolveNames(&sNC, pChanges->a[i].pExpr) ){
+ goto update_cleanup;
+ }
+ for(j=0; j<pTab->nCol; j++){
+ if( sqlite3StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ){
+ if( j==pTab->iPKey ){
+ chngRowid = 1;
+ pRowidExpr = pChanges->a[i].pExpr;
+ }
+ aXRef[j] = i;
+ break;
+ }
+ }
+ if( j>=pTab->nCol ){
+ if( sqlite3IsRowid(pChanges->a[i].zName) ){
+ chngRowid = 1;
+ pRowidExpr = pChanges->a[i].pExpr;
+ }else{
+ sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName);
+ goto update_cleanup;
+ }
+ }
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ {
+ int rc;
+ rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName,
+ pTab->aCol[j].zName, db->aDb[pTab->iDb].zName);
+ if( rc==SQLITE_DENY ){
+ goto update_cleanup;
+ }else if( rc==SQLITE_IGNORE ){
+ aXRef[j] = -1;
+ }
+ }
+#endif
+ }
+
+ /* Allocate memory for the array apIdx[] and fill it with pointers to every
+ ** index that needs to be updated. Indices only need updating if their
+ ** key includes one of the columns named in pChanges or if the record
+ ** number of the original table entry is changing.
+ */
+ for(nIdx=nIdxTotal=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdxTotal++){
+ if( chngRowid ){
+ i = 0;
+ }else {
+ for(i=0; i<pIdx->nColumn; i++){
+ if( aXRef[pIdx->aiColumn[i]]>=0 ) break;
+ }
+ }
+ if( i<pIdx->nColumn ) nIdx++;
+ }
+ if( nIdxTotal>0 ){
+ apIdx = sqliteMallocRaw( sizeof(Index*) * nIdx + nIdxTotal );
+ if( apIdx==0 ) goto update_cleanup;
+ aIdxUsed = (char*)&apIdx[nIdx];
+ }
+ for(nIdx=j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
+ if( chngRowid ){
+ i = 0;
+ }else{
+ for(i=0; i<pIdx->nColumn; i++){
+ if( aXRef[pIdx->aiColumn[i]]>=0 ) break;
+ }
+ }
+ if( i<pIdx->nColumn ){
+ if( sqlite3CheckIndexCollSeq(pParse, pIdx) ) goto update_cleanup;
+ apIdx[nIdx++] = pIdx;
+ aIdxUsed[j] = 1;
+ }else{
+ aIdxUsed[j] = 0;
+ }
+ }
+
+ /* Resolve the column names in all the expressions in the
+ ** WHERE clause.
+ */
+ if( sqlite3ExprResolveNames(&sNC, pWhere) ){
+ goto update_cleanup;
+ }
+
+ /* Start the view context
+ */
+ if( isView ){
+ sqlite3AuthContextPush(pParse, &sContext, pTab->zName);
+ }
+
+ /* Begin generating code.
+ */
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) goto update_cleanup;
+ if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
+ sqlite3BeginWriteOperation(pParse, 1, pTab->iDb);
+
+ /* If we are trying to update a view, realize that view into
+ ** a ephemeral table.
+ */
+ if( isView ){
+ Select *pView;
+ pView = sqlite3SelectDup(pTab->pSelect);
+ sqlite3Select(pParse, pView, SRT_VirtualTab, iCur, 0, 0, 0, 0);
+ sqlite3SelectDelete(pView);
+ }
+
+ /* Begin the database scan
+ */
+ pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0);
+ if( pWInfo==0 ) goto update_cleanup;
+
+ /* Remember the index of every item to be updated.
+ */
+ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0);
+
+ /* End the database scan loop.
+ */
+ sqlite3WhereEnd(pWInfo);
+
+ /* Initialize the count of updated rows
+ */
+ if( db->flags & SQLITE_CountRows && !pParse->trigStack ){
+ sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
+ }
+
+ if( triggers_exist ){
+ /* Create pseudo-tables for NEW and OLD
+ */
+ sqlite3VdbeAddOp(v, OP_OpenPseudo, oldIdx, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, oldIdx, pTab->nCol);
+ sqlite3VdbeAddOp(v, OP_OpenPseudo, newIdx, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, newIdx, pTab->nCol);
+
+ /* The top of the update loop for when there are triggers.
+ */
+ addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0);
+
+ if( !isView ){
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ /* Open a cursor and make it point to the record that is
+ ** being updated.
+ */
+ sqlite3OpenTableForReading(v, iCur, pTab);
+ }
+ sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0);
+
+ /* Generate the OLD table
+ */
+ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_RowData, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_Insert, oldIdx, 0);
+
+ /* Generate the NEW table
+ */
+ if( chngRowid ){
+ sqlite3ExprCodeAndCache(pParse, pRowidExpr);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ }
+ for(i=0; i<pTab->nCol; i++){
+ if( i==pTab->iPKey ){
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ continue;
+ }
+ j = aXRef[i];
+ if( j<0 ){
+ sqlite3VdbeAddOp(v, OP_Column, iCur, i);
+ sqlite3ColumnDefault(v, pTab, i);
+ }else{
+ sqlite3ExprCodeAndCache(pParse, pChanges->a[j].pExpr);
+ }
+ }
+ sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0);
+ if( !isView ){
+ sqlite3TableAffinityStr(v, pTab);
+ }
+ if( pParse->nErr ) goto update_cleanup;
+ sqlite3VdbeAddOp(v, OP_Insert, newIdx, 0);
+ if( !isView ){
+ sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
+ }
+
+ /* Fire the BEFORE and INSTEAD OF triggers
+ */
+ if( sqlite3CodeRowTrigger(pParse, TK_UPDATE, pChanges, TRIGGER_BEFORE, pTab,
+ newIdx, oldIdx, onError, addr) ){
+ goto update_cleanup;
+ }
+ }
+
+ if( !isView ){
+ /*
+ ** Open every index that needs updating. Note that if any
+ ** index could potentially invoke a REPLACE conflict resolution
+ ** action, then we need to open all indices because we might need
+ ** to be deleting some records.
+ */
+ sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0);
+ sqlite3VdbeAddOp(v, OP_OpenWrite, iCur, pTab->tnum);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iCur, pTab->nCol);
+ if( onError==OE_Replace ){
+ openAll = 1;
+ }else{
+ openAll = 0;
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ if( pIdx->onError==OE_Replace ){
+ openAll = 1;
+ break;
+ }
+ }
+ }
+ for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
+ if( openAll || aIdxUsed[i] ){
+ sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
+ sqlite3VdbeOp3(v, OP_OpenWrite, iCur+i+1, pIdx->tnum,
+ (char*)&pIdx->keyInfo, P3_KEYINFO);
+ assert( pParse->nTab>iCur+i+1 );
+ }
+ }
+
+ /* Loop over every record that needs updating. We have to load
+ ** the old data for each record to be updated because some columns
+ ** might not change and we will need to copy the old value.
+ ** Also, the old data is needed to delete the old index entires.
+ ** So make the cursor point at the old record.
+ */
+ if( !triggers_exist ){
+ addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0);
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ }
+ sqlite3VdbeAddOp(v, OP_NotExists, iCur, addr);
+
+ /* If the record number will change, push the record number as it
+ ** will be after the update. (The old record number is currently
+ ** on top of the stack.)
+ */
+ if( chngRowid ){
+ sqlite3ExprCode(pParse, pRowidExpr);
+ sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0);
+ }
+
+ /* Compute new data for this record.
+ */
+ for(i=0; i<pTab->nCol; i++){
+ if( i==pTab->iPKey ){
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ continue;
+ }
+ j = aXRef[i];
+ if( j<0 ){
+ sqlite3VdbeAddOp(v, OP_Column, iCur, i);
+ sqlite3ColumnDefault(v, pTab, i);
+ }else{
+ sqlite3ExprCode(pParse, pChanges->a[j].pExpr);
+ }
+ }
+
+ /* Do constraint checks
+ */
+ sqlite3GenerateConstraintChecks(pParse, pTab, iCur, aIdxUsed, chngRowid, 1,
+ onError, addr);
+
+ /* Delete the old indices for the current record.
+ */
+ sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, aIdxUsed);
+
+ /* If changing the record number, delete the old record.
+ */
+ if( chngRowid ){
+ sqlite3VdbeAddOp(v, OP_Delete, iCur, 0);
+ }
+
+ /* Create the new index entries and the new record.
+ */
+ sqlite3CompleteInsertion(pParse, pTab, iCur, aIdxUsed, chngRowid, 1, -1);
+ }
+
+ /* Increment the row counter
+ */
+ if( db->flags & SQLITE_CountRows && !pParse->trigStack){
+ sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
+ }
+
+ /* If there are triggers, close all the cursors after each iteration
+ ** through the loop. The fire the after triggers.
+ */
+ if( triggers_exist ){
+ if( !isView ){
+ for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
+ if( openAll || aIdxUsed[i] )
+ sqlite3VdbeAddOp(v, OP_Close, iCur+i+1, 0);
+ }
+ sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
+ }
+ if( sqlite3CodeRowTrigger(pParse, TK_UPDATE, pChanges, TRIGGER_AFTER, pTab,
+ newIdx, oldIdx, onError, addr) ){
+ goto update_cleanup;
+ }
+ }
+
+ /* Repeat the above with the next record to be updated, until
+ ** all record selected by the WHERE clause have been updated.
+ */
+ sqlite3VdbeAddOp(v, OP_Goto, 0, addr);
+ sqlite3VdbeJumpHere(v, addr);
+
+ /* Close all tables if there were no FOR EACH ROW triggers */
+ if( !triggers_exist ){
+ for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
+ if( openAll || aIdxUsed[i] ){
+ sqlite3VdbeAddOp(v, OP_Close, iCur+i+1, 0);
+ }
+ }
+ sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Close, newIdx, 0);
+ sqlite3VdbeAddOp(v, OP_Close, oldIdx, 0);
+ }
+
+ /*
+ ** Return the number of rows that were changed. If this routine is
+ ** generating code because of a call to sqlite3NestedParse(), do not
+ ** invoke the callback function.
+ */
+ if( db->flags & SQLITE_CountRows && !pParse->trigStack && pParse->nested==0 ){
+ sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
+ sqlite3VdbeSetNumCols(v, 1);
+ sqlite3VdbeSetColName(v, 0, "rows updated", P3_STATIC);
+ }
+
+update_cleanup:
+ sqlite3AuthContextPop(&sContext);
+ sqliteFree(apIdx);
+ sqliteFree(aXRef);
+ sqlite3SrcListDelete(pTabList);
+ sqlite3ExprListDelete(pChanges);
+ sqlite3ExprDelete(pWhere);
+ return;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/utf.c b/ext/pdo_sqlite/sqlite/src/utf.c
new file mode 100644
index 000000000..a96b36c6d
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/utf.c
@@ -0,0 +1,570 @@
+/*
+** 2004 April 13
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains routines used to translate between UTF-8,
+** UTF-16, UTF-16BE, and UTF-16LE.
+**
+** $Id$
+**
+** Notes on UTF-8:
+**
+** Byte-0 Byte-1 Byte-2 Byte-3 Value
+** 0xxxxxxx 00000000 00000000 0xxxxxxx
+** 110yyyyy 10xxxxxx 00000000 00000yyy yyxxxxxx
+** 1110zzzz 10yyyyyy 10xxxxxx 00000000 zzzzyyyy yyxxxxxx
+** 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx 000uuuuu zzzzyyyy yyxxxxxx
+**
+**
+** Notes on UTF-16: (with wwww+1==uuuuu)
+**
+** Word-0 Word-1 Value
+** 110110ww wwzzzzyy 110111yy yyxxxxxx 000uuuuu zzzzyyyy yyxxxxxx
+** zzzzyyyy yyxxxxxx 00000000 zzzzyyyy yyxxxxxx
+**
+**
+** BOM or Byte Order Mark:
+** 0xff 0xfe little-endian utf-16 follows
+** 0xfe 0xff big-endian utf-16 follows
+**
+**
+** Handling of malformed strings:
+**
+** SQLite accepts and processes malformed strings without an error wherever
+** possible. However this is not possible when converting between UTF-8 and
+** UTF-16.
+**
+** When converting malformed UTF-8 strings to UTF-16, one instance of the
+** replacement character U+FFFD for each byte that cannot be interpeted as
+** part of a valid unicode character.
+**
+** When converting malformed UTF-16 strings to UTF-8, one instance of the
+** replacement character U+FFFD for each pair of bytes that cannot be
+** interpeted as part of a valid unicode character.
+**
+** This file contains the following public routines:
+**
+** sqlite3VdbeMemTranslate() - Translate the encoding used by a Mem* string.
+** sqlite3VdbeMemHandleBom() - Handle byte-order-marks in UTF16 Mem* strings.
+** sqlite3utf16ByteLen() - Calculate byte-length of a void* UTF16 string.
+** sqlite3utf8CharLen() - Calculate char-length of a char* UTF8 string.
+** sqlite3utf8LikeCompare() - Do a LIKE match given two UTF8 char* strings.
+**
+*/
+#include "sqliteInt.h"
+#include <assert.h>
+#include "vdbeInt.h"
+
+/*
+** This table maps from the first byte of a UTF-8 character to the number
+** of trailing bytes expected. A value '255' indicates that the table key
+** is not a legal first byte for a UTF-8 character.
+*/
+static const u8 xtra_utf8_bytes[256] = {
+/* 0xxxxxxx */
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+/* 10wwwwww */
+255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
+/* 110yyyyy */
+1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+/* 1110zzzz */
+2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+
+/* 11110yyy */
+3, 3, 3, 3, 3, 3, 3, 3, 255, 255, 255, 255, 255, 255, 255, 255,
+};
+
+/*
+** This table maps from the number of trailing bytes in a UTF-8 character
+** to an integer constant that is effectively calculated for each character
+** read by a naive implementation of a UTF-8 character reader. The code
+** in the READ_UTF8 macro explains things best.
+*/
+static const int xtra_utf8_bits[4] = {
+0,
+12416, /* (0xC0 << 6) + (0x80) */
+925824, /* (0xE0 << 12) + (0x80 << 6) + (0x80) */
+63447168 /* (0xF0 << 18) + (0x80 << 12) + (0x80 << 6) + 0x80 */
+};
+
+#define READ_UTF8(zIn, c) { \
+ int xtra; \
+ c = *(zIn)++; \
+ xtra = xtra_utf8_bytes[c]; \
+ switch( xtra ){ \
+ case 255: c = (int)0xFFFD; break; \
+ case 3: c = (c<<6) + *(zIn)++; \
+ case 2: c = (c<<6) + *(zIn)++; \
+ case 1: c = (c<<6) + *(zIn)++; \
+ c -= xtra_utf8_bits[xtra]; \
+ } \
+}
+int sqlite3ReadUtf8(const unsigned char *z){
+ int c;
+ READ_UTF8(z, c);
+ return c;
+}
+
+#define SKIP_UTF8(zIn) { \
+ zIn += (xtra_utf8_bytes[*(u8 *)zIn] + 1); \
+}
+
+#define WRITE_UTF8(zOut, c) { \
+ if( c<0x00080 ){ \
+ *zOut++ = (c&0xFF); \
+ } \
+ else if( c<0x00800 ){ \
+ *zOut++ = 0xC0 + ((c>>6)&0x1F); \
+ *zOut++ = 0x80 + (c & 0x3F); \
+ } \
+ else if( c<0x10000 ){ \
+ *zOut++ = 0xE0 + ((c>>12)&0x0F); \
+ *zOut++ = 0x80 + ((c>>6) & 0x3F); \
+ *zOut++ = 0x80 + (c & 0x3F); \
+ }else{ \
+ *zOut++ = 0xF0 + ((c>>18) & 0x07); \
+ *zOut++ = 0x80 + ((c>>12) & 0x3F); \
+ *zOut++ = 0x80 + ((c>>6) & 0x3F); \
+ *zOut++ = 0x80 + (c & 0x3F); \
+ } \
+}
+
+#define WRITE_UTF16LE(zOut, c) { \
+ if( c<=0xFFFF ){ \
+ *zOut++ = (c&0x00FF); \
+ *zOut++ = ((c>>8)&0x00FF); \
+ }else{ \
+ *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \
+ *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \
+ *zOut++ = (c&0x00FF); \
+ *zOut++ = (0x00DC + ((c>>8)&0x03)); \
+ } \
+}
+
+#define WRITE_UTF16BE(zOut, c) { \
+ if( c<=0xFFFF ){ \
+ *zOut++ = ((c>>8)&0x00FF); \
+ *zOut++ = (c&0x00FF); \
+ }else{ \
+ *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \
+ *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \
+ *zOut++ = (0x00DC + ((c>>8)&0x03)); \
+ *zOut++ = (c&0x00FF); \
+ } \
+}
+
+#define READ_UTF16LE(zIn, c){ \
+ c = (*zIn++); \
+ c += ((*zIn++)<<8); \
+ if( c>=0xD800 && c<=0xE000 ){ \
+ int c2 = (*zIn++); \
+ c2 += ((*zIn++)<<8); \
+ c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
+ } \
+}
+
+#define READ_UTF16BE(zIn, c){ \
+ c = ((*zIn++)<<8); \
+ c += (*zIn++); \
+ if( c>=0xD800 && c<=0xE000 ){ \
+ int c2 = ((*zIn++)<<8); \
+ c2 += (*zIn++); \
+ c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \
+ } \
+}
+
+#define SKIP_UTF16BE(zIn){ \
+ if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn+1)==0x00)) ){ \
+ zIn += 4; \
+ }else{ \
+ zIn += 2; \
+ } \
+}
+#define SKIP_UTF16LE(zIn){ \
+ zIn++; \
+ if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn-1)==0x00)) ){ \
+ zIn += 3; \
+ }else{ \
+ zIn += 1; \
+ } \
+}
+
+#define RSKIP_UTF16LE(zIn){ \
+ if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn-1)==0x00)) ){ \
+ zIn -= 4; \
+ }else{ \
+ zIn -= 2; \
+ } \
+}
+#define RSKIP_UTF16BE(zIn){ \
+ zIn--; \
+ if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn+1)==0x00)) ){ \
+ zIn -= 3; \
+ }else{ \
+ zIn -= 1; \
+ } \
+}
+
+/*
+** If the TRANSLATE_TRACE macro is defined, the value of each Mem is
+** printed on stderr on the way into and out of sqlite3VdbeMemTranslate().
+*/
+/* #define TRANSLATE_TRACE 1 */
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** This routine transforms the internal text encoding used by pMem to
+** desiredEnc. It is an error if the string is already of the desired
+** encoding, or if *pMem does not contain a string value.
+*/
+int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
+ unsigned char zShort[NBFS]; /* Temporary short output buffer */
+ int len; /* Maximum length of output string in bytes */
+ unsigned char *zOut; /* Output buffer */
+ unsigned char *zIn; /* Input iterator */
+ unsigned char *zTerm; /* End of input */
+ unsigned char *z; /* Output iterator */
+ int c;
+
+ assert( pMem->flags&MEM_Str );
+ assert( pMem->enc!=desiredEnc );
+ assert( pMem->enc!=0 );
+ assert( pMem->n>=0 );
+
+#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
+ {
+ char zBuf[100];
+ sqlite3VdbeMemPrettyPrint(pMem, zBuf, 100);
+ fprintf(stderr, "INPUT: %s\n", zBuf);
+ }
+#endif
+
+ /* If the translation is between UTF-16 little and big endian, then
+ ** all that is required is to swap the byte order. This case is handled
+ ** differently from the others.
+ */
+ if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
+ u8 temp;
+ int rc;
+ rc = sqlite3VdbeMemMakeWriteable(pMem);
+ if( rc!=SQLITE_OK ){
+ assert( rc==SQLITE_NOMEM );
+ return SQLITE_NOMEM;
+ }
+ zIn = pMem->z;
+ zTerm = &zIn[pMem->n];
+ while( zIn<zTerm ){
+ temp = *zIn;
+ *zIn = *(zIn+1);
+ zIn++;
+ *zIn++ = temp;
+ }
+ pMem->enc = desiredEnc;
+ goto translate_out;
+ }
+
+ /* Set len to the maximum number of bytes required in the output buffer. */
+ if( desiredEnc==SQLITE_UTF8 ){
+ /* When converting from UTF-16, the maximum growth results from
+ ** translating a 2-byte character to a 3-byte UTF-8 character (i.e.
+ ** code-point 0xFFFC). A single byte is required for the output string
+ ** nul-terminator.
+ */
+ len = (pMem->n/2) * 3 + 1;
+ }else{
+ /* When converting from UTF-8 to UTF-16 the maximum growth is caused
+ ** when a 1-byte UTF-8 character is translated into a 2-byte UTF-16
+ ** character. Two bytes are required in the output buffer for the
+ ** nul-terminator.
+ */
+ len = pMem->n * 2 + 2;
+ }
+
+ /* Set zIn to point at the start of the input buffer and zTerm to point 1
+ ** byte past the end.
+ **
+ ** Variable zOut is set to point at the output buffer. This may be space
+ ** obtained from malloc(), or Mem.zShort, if it large enough and not in
+ ** use, or the zShort array on the stack (see above).
+ */
+ zIn = pMem->z;
+ zTerm = &zIn[pMem->n];
+ if( len>NBFS ){
+ zOut = sqliteMallocRaw(len);
+ if( !zOut ) return SQLITE_NOMEM;
+ }else{
+ zOut = zShort;
+ }
+ z = zOut;
+
+ if( pMem->enc==SQLITE_UTF8 ){
+ if( desiredEnc==SQLITE_UTF16LE ){
+ /* UTF-8 -> UTF-16 Little-endian */
+ while( zIn<zTerm ){
+ READ_UTF8(zIn, c);
+ WRITE_UTF16LE(z, c);
+ }
+ }else{
+ assert( desiredEnc==SQLITE_UTF16BE );
+ /* UTF-8 -> UTF-16 Big-endian */
+ while( zIn<zTerm ){
+ READ_UTF8(zIn, c);
+ WRITE_UTF16BE(z, c);
+ }
+ }
+ pMem->n = z - zOut;
+ *z++ = 0;
+ }else{
+ assert( desiredEnc==SQLITE_UTF8 );
+ if( pMem->enc==SQLITE_UTF16LE ){
+ /* UTF-16 Little-endian -> UTF-8 */
+ while( zIn<zTerm ){
+ READ_UTF16LE(zIn, c);
+ WRITE_UTF8(z, c);
+ }
+ }else{
+ /* UTF-16 Little-endian -> UTF-8 */
+ while( zIn<zTerm ){
+ READ_UTF16BE(zIn, c);
+ WRITE_UTF8(z, c);
+ }
+ }
+ pMem->n = z - zOut;
+ }
+ *z = 0;
+ assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len );
+
+ sqlite3VdbeMemRelease(pMem);
+ pMem->flags &= ~(MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short);
+ pMem->enc = desiredEnc;
+ if( zOut==zShort ){
+ memcpy(pMem->zShort, zOut, len);
+ zOut = pMem->zShort;
+ pMem->flags |= (MEM_Term|MEM_Short);
+ }else{
+ pMem->flags |= (MEM_Term|MEM_Dyn);
+ }
+ pMem->z = zOut;
+
+translate_out:
+#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
+ {
+ char zBuf[100];
+ sqlite3VdbeMemPrettyPrint(pMem, zBuf, 100);
+ fprintf(stderr, "OUTPUT: %s\n", zBuf);
+ }
+#endif
+ return SQLITE_OK;
+}
+
+/*
+** This routine checks for a byte-order mark at the beginning of the
+** UTF-16 string stored in *pMem. If one is present, it is removed and
+** the encoding of the Mem adjusted. This routine does not do any
+** byte-swapping, it just sets Mem.enc appropriately.
+**
+** The allocation (static, dynamic etc.) and encoding of the Mem may be
+** changed by this function.
+*/
+int sqlite3VdbeMemHandleBom(Mem *pMem){
+ int rc = SQLITE_OK;
+ u8 bom = 0;
+
+ if( pMem->n<0 || pMem->n>1 ){
+ u8 b1 = *(u8 *)pMem->z;
+ u8 b2 = *(((u8 *)pMem->z) + 1);
+ if( b1==0xFE && b2==0xFF ){
+ bom = SQLITE_UTF16BE;
+ }
+ if( b1==0xFF && b2==0xFE ){
+ bom = SQLITE_UTF16LE;
+ }
+ }
+
+ if( bom ){
+ /* This function is called as soon as a string is stored in a Mem*,
+ ** from within sqlite3VdbeMemSetStr(). At that point it is not possible
+ ** for the string to be stored in Mem.zShort, or for it to be stored
+ ** in dynamic memory with no destructor.
+ */
+ assert( !(pMem->flags&MEM_Short) );
+ assert( !(pMem->flags&MEM_Dyn) || pMem->xDel );
+ if( pMem->flags & MEM_Dyn ){
+ void (*xDel)(void*) = pMem->xDel;
+ char *z = pMem->z;
+ pMem->z = 0;
+ pMem->xDel = 0;
+ rc = sqlite3VdbeMemSetStr(pMem, &z[2], pMem->n-2, bom, SQLITE_TRANSIENT);
+ xDel(z);
+ }else{
+ rc = sqlite3VdbeMemSetStr(pMem, &pMem->z[2], pMem->n-2, bom,
+ SQLITE_TRANSIENT);
+ }
+ }
+ return rc;
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+/*
+** pZ is a UTF-8 encoded unicode string. If nByte is less than zero,
+** return the number of unicode characters in pZ up to (but not including)
+** the first 0x00 byte. If nByte is not less than zero, return the
+** number of unicode characters in the first nByte of pZ (or up to
+** the first 0x00, whichever comes first).
+*/
+int sqlite3utf8CharLen(const char *z, int nByte){
+ int r = 0;
+ const char *zTerm;
+ if( nByte>=0 ){
+ zTerm = &z[nByte];
+ }else{
+ zTerm = (const char *)(-1);
+ }
+ assert( z<=zTerm );
+ while( *z!=0 && z<zTerm ){
+ SKIP_UTF8(z);
+ r++;
+ }
+ return r;
+}
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** pZ is a UTF-16 encoded unicode string. If nChar is less than zero,
+** return the number of bytes up to (but not including), the first pair
+** of consecutive 0x00 bytes in pZ. If nChar is not less than zero,
+** then return the number of bytes in the first nChar unicode characters
+** in pZ (or up until the first pair of 0x00 bytes, whichever comes first).
+*/
+int sqlite3utf16ByteLen(const void *zIn, int nChar){
+ int c = 1;
+ char const *z = zIn;
+ int n = 0;
+ if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){
+ while( c && ((nChar<0) || n<nChar) ){
+ READ_UTF16BE(z, c);
+ n++;
+ }
+ }else{
+ while( c && ((nChar<0) || n<nChar) ){
+ READ_UTF16LE(z, c);
+ n++;
+ }
+ }
+ return (z-(char const *)zIn)-((c==0)?2:0);
+}
+
+/*
+** UTF-16 implementation of the substr()
+*/
+void sqlite3utf16Substr(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ int y, z;
+ unsigned char const *zStr;
+ unsigned char const *zStrEnd;
+ unsigned char const *zStart;
+ unsigned char const *zEnd;
+ int i;
+
+ zStr = (unsigned char const *)sqlite3_value_text16(argv[0]);
+ zStrEnd = &zStr[sqlite3_value_bytes16(argv[0])];
+ y = sqlite3_value_int(argv[1]);
+ z = sqlite3_value_int(argv[2]);
+
+ if( y>0 ){
+ y = y-1;
+ zStart = zStr;
+ if( SQLITE_UTF16BE==SQLITE_UTF16NATIVE ){
+ for(i=0; i<y && zStart<zStrEnd; i++) SKIP_UTF16BE(zStart);
+ }else{
+ for(i=0; i<y && zStart<zStrEnd; i++) SKIP_UTF16LE(zStart);
+ }
+ }else{
+ zStart = zStrEnd;
+ if( SQLITE_UTF16BE==SQLITE_UTF16NATIVE ){
+ for(i=y; i<0 && zStart>zStr; i++) RSKIP_UTF16BE(zStart);
+ }else{
+ for(i=y; i<0 && zStart>zStr; i++) RSKIP_UTF16LE(zStart);
+ }
+ for(; i<0; i++) z -= 1;
+ }
+
+ zEnd = zStart;
+ if( SQLITE_UTF16BE==SQLITE_UTF16NATIVE ){
+ for(i=0; i<z && zEnd<zStrEnd; i++) SKIP_UTF16BE(zEnd);
+ }else{
+ for(i=0; i<z && zEnd<zStrEnd; i++) SKIP_UTF16LE(zEnd);
+ }
+
+ sqlite3_result_text16(context, zStart, zEnd-zStart, SQLITE_TRANSIENT);
+}
+
+#if defined(SQLITE_TEST)
+/*
+** This routine is called from the TCL test function "translate_selftest".
+** It checks that the primitives for serializing and deserializing
+** characters in each encoding are inverses of each other.
+*/
+void sqlite3utfSelfTest(){
+ int i;
+ unsigned char zBuf[20];
+ unsigned char *z;
+ int n;
+ int c;
+
+ for(i=0; i<0x00110000; i++){
+ z = zBuf;
+ WRITE_UTF8(z, i);
+ n = z-zBuf;
+ z = zBuf;
+ READ_UTF8(z, c);
+ assert( c==i );
+ assert( (z-zBuf)==n );
+ }
+ for(i=0; i<0x00110000; i++){
+ if( i>=0xD800 && i<=0xE000 ) continue;
+ z = zBuf;
+ WRITE_UTF16LE(z, i);
+ n = z-zBuf;
+ z = zBuf;
+ READ_UTF16LE(z, c);
+ assert( c==i );
+ assert( (z-zBuf)==n );
+ }
+ for(i=0; i<0x00110000; i++){
+ if( i>=0xD800 && i<=0xE000 ) continue;
+ z = zBuf;
+ WRITE_UTF16BE(z, i);
+ n = z-zBuf;
+ z = zBuf;
+ READ_UTF16BE(z, c);
+ assert( c==i );
+ assert( (z-zBuf)==n );
+ }
+}
+#endif /* SQLITE_TEST */
+#endif /* SQLITE_OMIT_UTF16 */
diff --git a/ext/pdo_sqlite/sqlite/src/util.c b/ext/pdo_sqlite/sqlite/src/util.c
new file mode 100644
index 000000000..de716d982
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/util.c
@@ -0,0 +1,1005 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Utility functions used throughout sqlite.
+**
+** This file contains functions for allocating memory, comparing
+** strings, and stuff like that.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include <stdarg.h>
+#include <ctype.h>
+
+#if SQLITE_MEMDEBUG>2 && defined(__GLIBC__)
+#include <execinfo.h>
+void print_stack_trace(){
+ void *bt[30];
+ int i;
+ int n = backtrace(bt, 30);
+
+ fprintf(stderr, "STACK: ");
+ for(i=0; i<n;i++){
+ fprintf(stderr, "%p ", bt[i]);
+ }
+ fprintf(stderr, "\n");
+}
+#else
+#define print_stack_trace()
+#endif
+
+/*
+** If malloc() ever fails, this global variable gets set to 1.
+** This causes the library to abort and never again function.
+*/
+int sqlite3_malloc_failed = 0;
+
+/*
+** If SQLITE_MEMDEBUG is defined, then use versions of malloc() and
+** free() that track memory usage and check for buffer overruns.
+*/
+#ifdef SQLITE_MEMDEBUG
+
+/*
+** For keeping track of the number of mallocs and frees. This
+** is used to check for memory leaks. The iMallocFail and iMallocReset
+** values are used to simulate malloc() failures during testing in
+** order to verify that the library correctly handles an out-of-memory
+** condition.
+*/
+int sqlite3_nMalloc; /* Number of sqliteMalloc() calls */
+int sqlite3_nFree; /* Number of sqliteFree() calls */
+int sqlite3_memUsed; /* Total memory obtained from malloc */
+int sqlite3_memMax; /* Mem usage high-water mark */
+int sqlite3_iMallocFail; /* Fail sqliteMalloc() after this many calls */
+int sqlite3_iMallocReset = -1; /* When iMallocFail reaches 0, set to this */
+#if SQLITE_MEMDEBUG>1
+static int memcnt = 0;
+#endif
+
+/*
+** Number of 32-bit guard words. This should probably be a multiple of
+** 2 since on 64-bit machines we want the value returned by sqliteMalloc()
+** to be 8-byte aligned.
+*/
+#define N_GUARD 2
+
+/*
+** Check for a simulated memory allocation failure. Return true if
+** the failure should be simulated. Return false to proceed as normal.
+*/
+static int simulatedMallocFailure(int n, char *zFile, int line){
+ if( sqlite3_iMallocFail>=0 ){
+ sqlite3_iMallocFail--;
+ if( sqlite3_iMallocFail==0 ){
+ sqlite3_malloc_failed++;
+#if SQLITE_MEMDEBUG>1
+ fprintf(stderr,"**** failed to allocate %d bytes at %s:%d\n",
+ n, zFile,line);
+#endif
+ sqlite3_iMallocFail = sqlite3_iMallocReset;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/*
+** Allocate new memory and set it to zero. Return NULL if
+** no memory is available.
+*/
+void *sqlite3Malloc_(int n, int bZero, char *zFile, int line){
+ void *p;
+ int *pi;
+ int i, k;
+ if( n==0 ){
+ return 0;
+ }
+ if( simulatedMallocFailure(n, zFile, line) ){
+ return 0;
+ }
+ sqlite3_memUsed += n;
+ if( sqlite3_memMax<sqlite3_memUsed ) sqlite3_memMax = sqlite3_memUsed;
+ k = (n+sizeof(int)-1)/sizeof(int);
+ pi = malloc( (N_GUARD*2+1+k)*sizeof(int));
+ if( pi==0 ){
+ if( n>0 ) sqlite3_malloc_failed++;
+ return 0;
+ }
+ sqlite3_nMalloc++;
+ for(i=0; i<N_GUARD; i++) pi[i] = 0xdead1122;
+ pi[N_GUARD] = n;
+ for(i=0; i<N_GUARD; i++) pi[k+1+N_GUARD+i] = 0xdead3344;
+ p = &pi[N_GUARD+1];
+ memset(p, bZero==0, n);
+#if SQLITE_MEMDEBUG>1
+ print_stack_trace();
+ fprintf(stderr,"%06d malloc %d bytes at 0x%x from %s:%d\n",
+ ++memcnt, n, (int)p, zFile,line);
+#endif
+ return p;
+}
+
+/*
+** This version of malloc is always a real function, never a macro
+*/
+void *sqlite3MallocX(int n){
+ return sqlite3Malloc_(n, 0, __FILE__, __LINE__);
+}
+
+/*
+** Check to see if the given pointer was obtained from sqliteMalloc()
+** and is able to hold at least N bytes. Raise an exception if this
+** is not the case.
+**
+** This routine is used for testing purposes only.
+*/
+void sqlite3CheckMemory(void *p, int N){
+ int *pi = p;
+ int n, i, k;
+ pi -= N_GUARD+1;
+ for(i=0; i<N_GUARD; i++){
+ assert( pi[i]==0xdead1122 );
+ }
+ n = pi[N_GUARD];
+ assert( N>=0 && N<n );
+ k = (n+sizeof(int)-1)/sizeof(int);
+ for(i=0; i<N_GUARD; i++){
+ assert( pi[k+N_GUARD+1+i]==0xdead3344 );
+ }
+}
+
+/*
+** Free memory previously obtained from sqliteMalloc()
+*/
+void sqlite3Free_(void *p, char *zFile, int line){
+ if( p ){
+ int *pi, i, k, n;
+ pi = p;
+ pi -= N_GUARD+1;
+ sqlite3_nFree++;
+ for(i=0; i<N_GUARD; i++){
+ if( pi[i]!=0xdead1122 ){
+ fprintf(stderr,"Low-end memory corruption at 0x%x\n", (int)p);
+ return;
+ }
+ }
+ n = pi[N_GUARD];
+ sqlite3_memUsed -= n;
+ k = (n+sizeof(int)-1)/sizeof(int);
+ for(i=0; i<N_GUARD; i++){
+ if( pi[k+N_GUARD+1+i]!=0xdead3344 ){
+ fprintf(stderr,"High-end memory corruption at 0x%x\n", (int)p);
+ return;
+ }
+ }
+ memset(pi, 0xff, (k+N_GUARD*2+1)*sizeof(int));
+#if SQLITE_MEMDEBUG>1
+ fprintf(stderr,"%06d free %d bytes at 0x%x from %s:%d\n",
+ ++memcnt, n, (int)p, zFile,line);
+#endif
+ free(pi);
+ }
+}
+
+/*
+** Resize a prior allocation. If p==0, then this routine
+** works just like sqliteMalloc(). If n==0, then this routine
+** works just like sqliteFree().
+*/
+void *sqlite3Realloc_(void *oldP, int n, char *zFile, int line){
+ int *oldPi, *pi, i, k, oldN, oldK;
+ void *p;
+ if( oldP==0 ){
+ return sqlite3Malloc_(n,1,zFile,line);
+ }
+ if( n==0 ){
+ sqlite3Free_(oldP,zFile,line);
+ return 0;
+ }
+ if( simulatedMallocFailure(n, zFile, line) ){
+ return 0;
+ }
+ oldPi = oldP;
+ oldPi -= N_GUARD+1;
+ if( oldPi[0]!=0xdead1122 ){
+ fprintf(stderr,"Low-end memory corruption in realloc at 0x%x\n", (int)oldP);
+ return 0;
+ }
+ oldN = oldPi[N_GUARD];
+ sqlite3_memUsed -= oldN;
+ oldK = (oldN+sizeof(int)-1)/sizeof(int);
+ for(i=0; i<N_GUARD; i++){
+ if( oldPi[oldK+N_GUARD+1+i]!=0xdead3344 ){
+ fprintf(stderr,"High-end memory corruption in realloc at 0x%x\n",
+ (int)oldP);
+ return 0;
+ }
+ }
+ k = (n + sizeof(int) - 1)/sizeof(int);
+ pi = malloc( (k+N_GUARD*2+1)*sizeof(int) );
+ if( pi==0 ){
+ if( n>0 ) sqlite3_malloc_failed++;
+ return 0;
+ }
+ for(i=0; i<N_GUARD; i++) pi[i] = 0xdead1122;
+ pi[N_GUARD] = n;
+ sqlite3_memUsed += n;
+ if( sqlite3_memMax<sqlite3_memUsed ) sqlite3_memMax = sqlite3_memUsed;
+ for(i=0; i<N_GUARD; i++) pi[k+N_GUARD+1+i] = 0xdead3344;
+ p = &pi[N_GUARD+1];
+ memcpy(p, oldP, n>oldN ? oldN : n);
+ if( n>oldN ){
+ memset(&((char*)p)[oldN], 0x55, n-oldN);
+ }
+ memset(oldPi, 0xab, (oldK+N_GUARD+2)*sizeof(int));
+ free(oldPi);
+#if SQLITE_MEMDEBUG>1
+ print_stack_trace();
+ fprintf(stderr,"%06d realloc %d to %d bytes at 0x%x to 0x%x at %s:%d\n",
+ ++memcnt, oldN, n, (int)oldP, (int)p, zFile, line);
+#endif
+ return p;
+}
+
+/*
+** Make a copy of a string in memory obtained from sqliteMalloc()
+*/
+char *sqlite3StrDup_(const char *z, char *zFile, int line){
+ char *zNew;
+ if( z==0 ) return 0;
+ zNew = sqlite3Malloc_(strlen(z)+1, 0, zFile, line);
+ if( zNew ) strcpy(zNew, z);
+ return zNew;
+}
+char *sqlite3StrNDup_(const char *z, int n, char *zFile, int line){
+ char *zNew;
+ if( z==0 ) return 0;
+ zNew = sqlite3Malloc_(n+1, 0, zFile, line);
+ if( zNew ){
+ memcpy(zNew, z, n);
+ zNew[n] = 0;
+ }
+ return zNew;
+}
+
+/*
+** A version of sqliteFree that is always a function, not a macro.
+*/
+void sqlite3FreeX(void *p){
+ sqliteFree(p);
+}
+#endif /* SQLITE_MEMDEBUG */
+
+/*
+** The following versions of malloc() and free() are for use in a
+** normal build.
+*/
+#if !defined(SQLITE_MEMDEBUG)
+
+/*
+** Allocate new memory and set it to zero. Return NULL if
+** no memory is available. See also sqliteMallocRaw().
+*/
+void *sqlite3Malloc(int n){
+ void *p;
+ if( n==0 ) return 0;
+ if( (p = malloc(n))==0 ){
+ if( n>0 ) sqlite3_malloc_failed++;
+ }else{
+ memset(p, 0, n);
+ }
+ return p;
+}
+
+/*
+** Allocate new memory but do not set it to zero. Return NULL if
+** no memory is available. See also sqliteMalloc().
+*/
+void *sqlite3MallocRaw(int n){
+ void *p;
+ if( n==0 ) return 0;
+ if( (p = malloc(n))==0 ){
+ if( n>0 ) sqlite3_malloc_failed++;
+ }
+ return p;
+}
+
+/*
+** Free memory previously obtained from sqliteMalloc()
+*/
+void sqlite3FreeX(void *p){
+ if( p ){
+ free(p);
+ }
+}
+
+/*
+** Resize a prior allocation. If p==0, then this routine
+** works just like sqliteMalloc(). If n==0, then this routine
+** works just like sqliteFree().
+*/
+void *sqlite3Realloc(void *p, int n){
+ void *p2;
+ if( p==0 ){
+ return sqliteMalloc(n);
+ }
+ if( n==0 ){
+ sqliteFree(p);
+ return 0;
+ }
+ p2 = realloc(p, n);
+ if( p2==0 ){
+ if( n>0 ) sqlite3_malloc_failed++;
+ }
+ return p2;
+}
+
+/*
+** Make a copy of a string in memory obtained from sqliteMalloc()
+*/
+char *sqlite3StrDup(const char *z){
+ char *zNew;
+ if( z==0 ) return 0;
+ zNew = sqliteMallocRaw(strlen(z)+1);
+ if( zNew ) strcpy(zNew, z);
+ return zNew;
+}
+char *sqlite3StrNDup(const char *z, int n){
+ char *zNew;
+ if( z==0 ) return 0;
+ zNew = sqliteMallocRaw(n+1);
+ if( zNew ){
+ memcpy(zNew, z, n);
+ zNew[n] = 0;
+ }
+ return zNew;
+}
+#endif /* !defined(SQLITE_MEMDEBUG) */
+
+/*
+** Reallocate a buffer to a different size. This is similar to
+** sqliteRealloc() except that if the allocation fails the buffer
+** is freed.
+*/
+void sqlite3ReallocOrFree(void **ppBuf, int newSize){
+ void *pNew = sqliteRealloc(*ppBuf, newSize);
+ if( pNew==0 ){
+ sqliteFree(*ppBuf);
+ }
+ *ppBuf = pNew;
+}
+
+/*
+** Create a string from the 2nd and subsequent arguments (up to the
+** first NULL argument), store the string in memory obtained from
+** sqliteMalloc() and make the pointer indicated by the 1st argument
+** point to that string. The 1st argument must either be NULL or
+** point to memory obtained from sqliteMalloc().
+*/
+void sqlite3SetString(char **pz, ...){
+ va_list ap;
+ int nByte;
+ const char *z;
+ char *zResult;
+
+ if( pz==0 ) return;
+ nByte = 1;
+ va_start(ap, pz);
+ while( (z = va_arg(ap, const char*))!=0 ){
+ nByte += strlen(z);
+ }
+ va_end(ap);
+ sqliteFree(*pz);
+ *pz = zResult = sqliteMallocRaw( nByte );
+ if( zResult==0 ){
+ return;
+ }
+ *zResult = 0;
+ va_start(ap, pz);
+ while( (z = va_arg(ap, const char*))!=0 ){
+ strcpy(zResult, z);
+ zResult += strlen(zResult);
+ }
+ va_end(ap);
+#ifdef SQLITE_MEMDEBUG
+#if SQLITE_MEMDEBUG>1
+ fprintf(stderr,"string at 0x%x is %s\n", (int)*pz, *pz);
+#endif
+#endif
+}
+
+/*
+** Set the most recent error code and error string for the sqlite
+** handle "db". The error code is set to "err_code".
+**
+** If it is not NULL, string zFormat specifies the format of the
+** error string in the style of the printf functions: The following
+** format characters are allowed:
+**
+** %s Insert a string
+** %z A string that should be freed after use
+** %d Insert an integer
+** %T Insert a token
+** %S Insert the first element of a SrcList
+**
+** zFormat and any string tokens that follow it are assumed to be
+** encoded in UTF-8.
+**
+** To clear the most recent error for sqlite handle "db", sqlite3Error
+** should be called with err_code set to SQLITE_OK and zFormat set
+** to NULL.
+*/
+void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
+ if( db && (db->pErr || (db->pErr = sqlite3ValueNew())) ){
+ db->errCode = err_code;
+ if( zFormat ){
+ char *z;
+ va_list ap;
+ va_start(ap, zFormat);
+ z = sqlite3VMPrintf(zFormat, ap);
+ va_end(ap);
+ sqlite3ValueSetStr(db->pErr, -1, z, SQLITE_UTF8, sqlite3FreeX);
+ }else{
+ sqlite3ValueSetStr(db->pErr, 0, 0, SQLITE_UTF8, SQLITE_STATIC);
+ }
+ }
+}
+
+/*
+** Add an error message to pParse->zErrMsg and increment pParse->nErr.
+** The following formatting characters are allowed:
+**
+** %s Insert a string
+** %z A string that should be freed after use
+** %d Insert an integer
+** %T Insert a token
+** %S Insert the first element of a SrcList
+**
+** This function should be used to report any error that occurs whilst
+** compiling an SQL statement (i.e. within sqlite3_prepare()). The
+** last thing the sqlite3_prepare() function does is copy the error
+** stored by this function into the database handle using sqlite3Error().
+** Function sqlite3Error() should be used during statement execution
+** (sqlite3_step() etc.).
+*/
+void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
+ va_list ap;
+ pParse->nErr++;
+ sqliteFree(pParse->zErrMsg);
+ va_start(ap, zFormat);
+ pParse->zErrMsg = sqlite3VMPrintf(zFormat, ap);
+ va_end(ap);
+}
+
+/*
+** Convert an SQL-style quoted string into a normal string by removing
+** the quote characters. The conversion is done in-place. If the
+** input does not begin with a quote character, then this routine
+** is a no-op.
+**
+** 2002-Feb-14: This routine is extended to remove MS-Access style
+** brackets from around identifers. For example: "[a-b-c]" becomes
+** "a-b-c".
+*/
+void sqlite3Dequote(char *z){
+ int quote;
+ int i, j;
+ if( z==0 ) return;
+ quote = z[0];
+ switch( quote ){
+ case '\'': break;
+ case '"': break;
+ case '`': break; /* For MySQL compatibility */
+ case '[': quote = ']'; break; /* For MS SqlServer compatibility */
+ default: return;
+ }
+ for(i=1, j=0; z[i]; i++){
+ if( z[i]==quote ){
+ if( z[i+1]==quote ){
+ z[j++] = quote;
+ i++;
+ }else{
+ z[j++] = 0;
+ break;
+ }
+ }else{
+ z[j++] = z[i];
+ }
+ }
+}
+
+/* An array to map all upper-case characters into their corresponding
+** lower-case character.
+*/
+const unsigned char sqlite3UpperToLower[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103,
+ 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,
+ 122, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,
+ 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,
+ 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,
+ 162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,
+ 180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,
+ 198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,
+ 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,
+ 234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,
+ 252,253,254,255
+};
+#define UpperToLower sqlite3UpperToLower
+
+/*
+** Some systems have stricmp(). Others have strcasecmp(). Because
+** there is no consistency, we will define our own.
+*/
+int sqlite3StrICmp(const char *zLeft, const char *zRight){
+ register unsigned char *a, *b;
+ a = (unsigned char *)zLeft;
+ b = (unsigned char *)zRight;
+ while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }
+ return UpperToLower[*a] - UpperToLower[*b];
+}
+int sqlite3StrNICmp(const char *zLeft, const char *zRight, int N){
+ register unsigned char *a, *b;
+ a = (unsigned char *)zLeft;
+ b = (unsigned char *)zRight;
+ while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }
+ return N<0 ? 0 : UpperToLower[*a] - UpperToLower[*b];
+}
+
+/*
+** Return TRUE if z is a pure numeric string. Return FALSE if the
+** string contains any character which is not part of a number. If
+** the string is numeric and contains the '.' character, set *realnum
+** to TRUE (otherwise FALSE).
+**
+** An empty string is considered non-numeric.
+*/
+int sqlite3IsNumber(const char *z, int *realnum, u8 enc){
+ int incr = (enc==SQLITE_UTF8?1:2);
+ if( enc==SQLITE_UTF16BE ) z++;
+ if( *z=='-' || *z=='+' ) z += incr;
+ if( !isdigit(*(u8*)z) ){
+ return 0;
+ }
+ z += incr;
+ if( realnum ) *realnum = 0;
+ while( isdigit(*(u8*)z) ){ z += incr; }
+ if( *z=='.' ){
+ z += incr;
+ if( !isdigit(*(u8*)z) ) return 0;
+ while( isdigit(*(u8*)z) ){ z += incr; }
+ if( realnum ) *realnum = 1;
+ }
+ if( *z=='e' || *z=='E' ){
+ z += incr;
+ if( *z=='+' || *z=='-' ) z += incr;
+ if( !isdigit(*(u8*)z) ) return 0;
+ while( isdigit(*(u8*)z) ){ z += incr; }
+ if( realnum ) *realnum = 1;
+ }
+ return *z==0;
+}
+
+/*
+** The string z[] is an ascii representation of a real number.
+** Convert this string to a double.
+**
+** This routine assumes that z[] really is a valid number. If it
+** is not, the result is undefined.
+**
+** This routine is used instead of the library atof() function because
+** the library atof() might want to use "," as the decimal point instead
+** of "." depending on how locale is set. But that would cause problems
+** for SQL. So this routine always uses "." regardless of locale.
+*/
+int sqlite3AtoF(const char *z, double *pResult){
+ int sign = 1;
+ const char *zBegin = z;
+ LONGDOUBLE_TYPE v1 = 0.0;
+ if( *z=='-' ){
+ sign = -1;
+ z++;
+ }else if( *z=='+' ){
+ z++;
+ }
+ while( isdigit(*(u8*)z) ){
+ v1 = v1*10.0 + (*z - '0');
+ z++;
+ }
+ if( *z=='.' ){
+ LONGDOUBLE_TYPE divisor = 1.0;
+ z++;
+ while( isdigit(*(u8*)z) ){
+ v1 = v1*10.0 + (*z - '0');
+ divisor *= 10.0;
+ z++;
+ }
+ v1 /= divisor;
+ }
+ if( *z=='e' || *z=='E' ){
+ int esign = 1;
+ int eval = 0;
+ LONGDOUBLE_TYPE scale = 1.0;
+ z++;
+ if( *z=='-' ){
+ esign = -1;
+ z++;
+ }else if( *z=='+' ){
+ z++;
+ }
+ while( isdigit(*(u8*)z) ){
+ eval = eval*10 + *z - '0';
+ z++;
+ }
+ while( eval>=64 ){ scale *= 1.0e+64; eval -= 64; }
+ while( eval>=16 ){ scale *= 1.0e+16; eval -= 16; }
+ while( eval>=4 ){ scale *= 1.0e+4; eval -= 4; }
+ while( eval>=1 ){ scale *= 1.0e+1; eval -= 1; }
+ if( esign<0 ){
+ v1 /= scale;
+ }else{
+ v1 *= scale;
+ }
+ }
+ *pResult = sign<0 ? -v1 : v1;
+ return z - zBegin;
+}
+
+/*
+** Return TRUE if zNum is a 64-bit signed integer and write
+** the value of the integer into *pNum. If zNum is not an integer
+** or is an integer that is too large to be expressed with 64 bits,
+** then return false. If n>0 and the integer is string is not
+** exactly n bytes long, return false.
+**
+** When this routine was originally written it dealt with only
+** 32-bit numbers. At that time, it was much faster than the
+** atoi() library routine in RedHat 7.2.
+*/
+int sqlite3atoi64(const char *zNum, i64 *pNum){
+ i64 v = 0;
+ int neg;
+ int i, c;
+ if( *zNum=='-' ){
+ neg = 1;
+ zNum++;
+ }else if( *zNum=='+' ){
+ neg = 0;
+ zNum++;
+ }else{
+ neg = 0;
+ }
+ for(i=0; (c=zNum[i])>='0' && c<='9'; i++){
+ v = v*10 + c - '0';
+ }
+ *pNum = neg ? -v : v;
+ return c==0 && i>0 &&
+ (i<19 || (i==19 && memcmp(zNum,"9223372036854775807",19)<=0));
+}
+
+/*
+** The string zNum represents an integer. There might be some other
+** information following the integer too, but that part is ignored.
+** If the integer that the prefix of zNum represents will fit in a
+** 32-bit signed integer, return TRUE. Otherwise return FALSE.
+**
+** This routine returns FALSE for the string -2147483648 even that
+** that number will in fact fit in a 32-bit integer. But positive
+** 2147483648 will not fit in 32 bits. So it seems safer to return
+** false.
+*/
+static int sqlite3FitsIn32Bits(const char *zNum){
+ int i, c;
+ if( *zNum=='-' || *zNum=='+' ) zNum++;
+ for(i=0; (c=zNum[i])>='0' && c<='9'; i++){}
+ return i<10 || (i==10 && memcmp(zNum,"2147483647",10)<=0);
+}
+
+/*
+** If zNum represents an integer that will fit in 32-bits, then set
+** *pValue to that integer and return true. Otherwise return false.
+*/
+int sqlite3GetInt32(const char *zNum, int *pValue){
+ if( sqlite3FitsIn32Bits(zNum) ){
+ *pValue = atoi(zNum);
+ return 1;
+ }
+ return 0;
+}
+
+/*
+** The string zNum represents an integer. There might be some other
+** information following the integer too, but that part is ignored.
+** If the integer that the prefix of zNum represents will fit in a
+** 64-bit signed integer, return TRUE. Otherwise return FALSE.
+**
+** This routine returns FALSE for the string -9223372036854775808 even that
+** that number will, in theory fit in a 64-bit integer. Positive
+** 9223373036854775808 will not fit in 64 bits. So it seems safer to return
+** false.
+*/
+int sqlite3FitsIn64Bits(const char *zNum){
+ int i, c;
+ if( *zNum=='-' || *zNum=='+' ) zNum++;
+ for(i=0; (c=zNum[i])>='0' && c<='9'; i++){}
+ return i<19 || (i==19 && memcmp(zNum,"9223372036854775807",19)<=0);
+}
+
+
+/*
+** Change the sqlite.magic from SQLITE_MAGIC_OPEN to SQLITE_MAGIC_BUSY.
+** Return an error (non-zero) if the magic was not SQLITE_MAGIC_OPEN
+** when this routine is called.
+**
+** This routine is a attempt to detect if two threads use the
+** same sqlite* pointer at the same time. There is a race
+** condition so it is possible that the error is not detected.
+** But usually the problem will be seen. The result will be an
+** error which can be used to debug the application that is
+** using SQLite incorrectly.
+**
+** Ticket #202: If db->magic is not a valid open value, take care not
+** to modify the db structure at all. It could be that db is a stale
+** pointer. In other words, it could be that there has been a prior
+** call to sqlite3_close(db) and db has been deallocated. And we do
+** not want to write into deallocated memory.
+*/
+int sqlite3SafetyOn(sqlite3 *db){
+ if( db->magic==SQLITE_MAGIC_OPEN ){
+ db->magic = SQLITE_MAGIC_BUSY;
+ return 0;
+ }else if( db->magic==SQLITE_MAGIC_BUSY ){
+ db->magic = SQLITE_MAGIC_ERROR;
+ db->flags |= SQLITE_Interrupt;
+ }
+ return 1;
+}
+
+/*
+** Change the magic from SQLITE_MAGIC_BUSY to SQLITE_MAGIC_OPEN.
+** Return an error (non-zero) if the magic was not SQLITE_MAGIC_BUSY
+** when this routine is called.
+*/
+int sqlite3SafetyOff(sqlite3 *db){
+ if( db->magic==SQLITE_MAGIC_BUSY ){
+ db->magic = SQLITE_MAGIC_OPEN;
+ return 0;
+ }else if( db->magic==SQLITE_MAGIC_OPEN ){
+ db->magic = SQLITE_MAGIC_ERROR;
+ db->flags |= SQLITE_Interrupt;
+ }
+ return 1;
+}
+
+/*
+** Check to make sure we have a valid db pointer. This test is not
+** foolproof but it does provide some measure of protection against
+** misuse of the interface such as passing in db pointers that are
+** NULL or which have been previously closed. If this routine returns
+** TRUE it means that the db pointer is invalid and should not be
+** dereferenced for any reason. The calling function should invoke
+** SQLITE_MISUSE immediately.
+*/
+int sqlite3SafetyCheck(sqlite3 *db){
+ int magic;
+ if( db==0 ) return 1;
+ magic = db->magic;
+ if( magic!=SQLITE_MAGIC_CLOSED &&
+ magic!=SQLITE_MAGIC_OPEN &&
+ magic!=SQLITE_MAGIC_BUSY ) return 1;
+ return 0;
+}
+
+/*
+** The variable-length integer encoding is as follows:
+**
+** KEY:
+** A = 0xxxxxxx 7 bits of data and one flag bit
+** B = 1xxxxxxx 7 bits of data and one flag bit
+** C = xxxxxxxx 8 bits of data
+**
+** 7 bits - A
+** 14 bits - BA
+** 21 bits - BBA
+** 28 bits - BBBA
+** 35 bits - BBBBA
+** 42 bits - BBBBBA
+** 49 bits - BBBBBBA
+** 56 bits - BBBBBBBA
+** 64 bits - BBBBBBBBC
+*/
+
+/*
+** Write a 64-bit variable-length integer to memory starting at p[0].
+** The length of data write will be between 1 and 9 bytes. The number
+** of bytes written is returned.
+**
+** A variable-length integer consists of the lower 7 bits of each byte
+** for all bytes that have the 8th bit set and one byte with the 8th
+** bit clear. Except, if we get to the 9th byte, it stores the full
+** 8 bits and is the last byte.
+*/
+int sqlite3PutVarint(unsigned char *p, u64 v){
+ int i, j, n;
+ u8 buf[10];
+ if( v & (((u64)0xff000000)<<32) ){
+ p[8] = v;
+ v >>= 8;
+ for(i=7; i>=0; i--){
+ p[i] = (v & 0x7f) | 0x80;
+ v >>= 7;
+ }
+ return 9;
+ }
+ n = 0;
+ do{
+ buf[n++] = (v & 0x7f) | 0x80;
+ v >>= 7;
+ }while( v!=0 );
+ buf[0] &= 0x7f;
+ assert( n<=9 );
+ for(i=0, j=n-1; j>=0; j--, i++){
+ p[i] = buf[j];
+ }
+ return n;
+}
+
+/*
+** Read a 64-bit variable-length integer from memory starting at p[0].
+** Return the number of bytes read. The value is stored in *v.
+*/
+int sqlite3GetVarint(const unsigned char *p, u64 *v){
+ u32 x;
+ u64 x64;
+ int n;
+ unsigned char c;
+ if( ((c = p[0]) & 0x80)==0 ){
+ *v = c;
+ return 1;
+ }
+ x = c & 0x7f;
+ if( ((c = p[1]) & 0x80)==0 ){
+ *v = (x<<7) | c;
+ return 2;
+ }
+ x = (x<<7) | (c&0x7f);
+ if( ((c = p[2]) & 0x80)==0 ){
+ *v = (x<<7) | c;
+ return 3;
+ }
+ x = (x<<7) | (c&0x7f);
+ if( ((c = p[3]) & 0x80)==0 ){
+ *v = (x<<7) | c;
+ return 4;
+ }
+ x64 = (x<<7) | (c&0x7f);
+ n = 4;
+ do{
+ c = p[n++];
+ if( n==9 ){
+ x64 = (x64<<8) | c;
+ break;
+ }
+ x64 = (x64<<7) | (c&0x7f);
+ }while( (c & 0x80)!=0 );
+ *v = x64;
+ return n;
+}
+
+/*
+** Read a 32-bit variable-length integer from memory starting at p[0].
+** Return the number of bytes read. The value is stored in *v.
+*/
+int sqlite3GetVarint32(const unsigned char *p, u32 *v){
+ u32 x;
+ int n;
+ unsigned char c;
+ if( ((signed char*)p)[0]>=0 ){
+ *v = p[0];
+ return 1;
+ }
+ x = p[0] & 0x7f;
+ if( ((signed char*)p)[1]>=0 ){
+ *v = (x<<7) | p[1];
+ return 2;
+ }
+ x = (x<<7) | (p[1] & 0x7f);
+ n = 2;
+ do{
+ x = (x<<7) | ((c = p[n++])&0x7f);
+ }while( (c & 0x80)!=0 && n<9 );
+ *v = x;
+ return n;
+}
+
+/*
+** Return the number of bytes that will be needed to store the given
+** 64-bit integer.
+*/
+int sqlite3VarintLen(u64 v){
+ int i = 0;
+ do{
+ i++;
+ v >>= 7;
+ }while( v!=0 && i<9 );
+ return i;
+}
+
+#if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) \
+ || defined(SQLITE_TEST)
+/*
+** Translate a single byte of Hex into an integer.
+*/
+static int hexToInt(int h){
+ if( h>='0' && h<='9' ){
+ return h - '0';
+ }else if( h>='a' && h<='f' ){
+ return h - 'a' + 10;
+ }else{
+ assert( h>='A' && h<='F' );
+ return h - 'A' + 10;
+ }
+}
+#endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC || SQLITE_TEST */
+
+#if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC)
+/*
+** Convert a BLOB literal of the form "x'hhhhhh'" into its binary
+** value. Return a pointer to its binary value. Space to hold the
+** binary value has been obtained from malloc and must be freed by
+** the calling routine.
+*/
+void *sqlite3HexToBlob(const char *z){
+ char *zBlob;
+ int i;
+ int n = strlen(z);
+ if( n%2 ) return 0;
+
+ zBlob = (char *)sqliteMalloc(n/2);
+ for(i=0; i<n; i+=2){
+ zBlob[i/2] = (hexToInt(z[i])<<4) | hexToInt(z[i+1]);
+ }
+ return zBlob;
+}
+#endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC */
+
+#if defined(SQLITE_TEST)
+/*
+** Convert text generated by the "%p" conversion format back into
+** a pointer.
+*/
+void *sqlite3TextToPtr(const char *z){
+ void *p;
+ u64 v;
+ u32 v2;
+ if( z[0]=='0' && z[1]=='x' ){
+ z += 2;
+ }
+ v = 0;
+ while( *z ){
+ v = (v<<4) + hexToInt(*z);
+ z++;
+ }
+ if( sizeof(p)==sizeof(v) ){
+ p = *(void**)&v;
+ }else{
+ assert( sizeof(p)==sizeof(v2) );
+ v2 = (u32)v;
+ p = *(void**)&v2;
+ }
+ return p;
+}
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/vacuum.c b/ext/pdo_sqlite/sqlite/src/vacuum.c
new file mode 100644
index 000000000..8254528d9
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/vacuum.c
@@ -0,0 +1,310 @@
+/*
+** 2003 April 6
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains code used to implement the VACUUM command.
+**
+** Most of the code in this file may be omitted by defining the
+** SQLITE_OMIT_VACUUM macro.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "os.h"
+
+#ifndef SQLITE_OMIT_VACUUM
+/*
+** Generate a random name of 20 character in length.
+*/
+static void randomName(unsigned char *zBuf){
+ static const unsigned char zChars[] =
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789";
+ int i;
+ sqlite3Randomness(20, zBuf);
+ for(i=0; i<20; i++){
+ zBuf[i] = zChars[ zBuf[i]%(sizeof(zChars)-1) ];
+ }
+}
+
+/*
+** Execute zSql on database db. Return an error code.
+*/
+static int execSql(sqlite3 *db, const char *zSql){
+ sqlite3_stmt *pStmt;
+ if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){
+ return sqlite3_errcode(db);
+ }
+ while( SQLITE_ROW==sqlite3_step(pStmt) );
+ return sqlite3_finalize(pStmt);
+}
+
+/*
+** Execute zSql on database db. The statement returns exactly
+** one column. Execute this as SQL on the same database.
+*/
+static int execExecSql(sqlite3 *db, const char *zSql){
+ sqlite3_stmt *pStmt;
+ int rc;
+
+ rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0);
+ if( rc!=SQLITE_OK ) return rc;
+
+ while( SQLITE_ROW==sqlite3_step(pStmt) ){
+ rc = execSql(db, sqlite3_column_text(pStmt, 0));
+ if( rc!=SQLITE_OK ){
+ sqlite3_finalize(pStmt);
+ return rc;
+ }
+ }
+
+ return sqlite3_finalize(pStmt);
+}
+
+#endif
+
+/*
+** The non-standard VACUUM command is used to clean up the database,
+** collapse free space, etc. It is modelled after the VACUUM command
+** in PostgreSQL.
+**
+** In version 1.0.x of SQLite, the VACUUM command would call
+** gdbm_reorganize() on all the database tables. But beginning
+** with 2.0.0, SQLite no longer uses GDBM so this command has
+** become a no-op.
+*/
+void sqlite3Vacuum(Parse *pParse, Token *pTableName){
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ if( v ){
+ sqlite3VdbeAddOp(v, OP_Vacuum, 0, 0);
+ }
+ return;
+}
+
+/*
+** This routine implements the OP_Vacuum opcode of the VDBE.
+*/
+int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
+ int rc = SQLITE_OK; /* Return code from service routines */
+#ifndef SQLITE_OMIT_VACUUM
+ const char *zFilename; /* full pathname of the database file */
+ int nFilename; /* number of characters in zFilename[] */
+ char *zTemp = 0; /* a temporary file in same directory as zFilename */
+ Btree *pMain; /* The database being vacuumed */
+ Btree *pTemp;
+ char *zSql = 0;
+ int writeschema_flag; /* Saved value of the write-schema flag */
+
+ /* Save the current value of the write-schema flag before setting it. */
+ writeschema_flag = db->flags&SQLITE_WriteSchema;
+ db->flags |= SQLITE_WriteSchema;
+
+ if( !db->autoCommit ){
+ sqlite3SetString(pzErrMsg, "cannot VACUUM from within a transaction",
+ (char*)0);
+ rc = SQLITE_ERROR;
+ goto end_of_vacuum;
+ }
+
+ /* Get the full pathname of the database file and create a
+ ** temporary filename in the same directory as the original file.
+ */
+ pMain = db->aDb[0].pBt;
+ zFilename = sqlite3BtreeGetFilename(pMain);
+ assert( zFilename );
+ if( zFilename[0]=='\0' ){
+ /* The in-memory database. Do nothing. Return directly to avoid causing
+ ** an error trying to DETACH the vacuum_db (which never got attached)
+ ** in the exit-handler.
+ */
+ return SQLITE_OK;
+ }
+ nFilename = strlen(zFilename);
+ zTemp = sqliteMalloc( nFilename+100 );
+ if( zTemp==0 ){
+ rc = SQLITE_NOMEM;
+ goto end_of_vacuum;
+ }
+ strcpy(zTemp, zFilename);
+
+ /* The randomName() procedure in the following loop uses an excellent
+ ** source of randomness to generate a name from a space of 1.3e+31
+ ** possibilities. So unless the directory already contains on the order
+ ** of 1.3e+31 files, the probability that the following loop will
+ ** run more than once or twice is vanishingly small. We are certain
+ ** enough that this loop will always terminate (and terminate quickly)
+ ** that we don't even bother to set a maximum loop count.
+ */
+ do {
+ zTemp[nFilename] = '-';
+ randomName((unsigned char*)&zTemp[nFilename+1]);
+ } while( sqlite3OsFileExists(zTemp) );
+
+ /* Attach the temporary database as 'vacuum_db'. The synchronous pragma
+ ** can be set to 'off' for this file, as it is not recovered if a crash
+ ** occurs anyway. The integrity of the database is maintained by a
+ ** (possibly synchronous) transaction opened on the main database before
+ ** sqlite3BtreeCopyFile() is called.
+ **
+ ** An optimisation would be to use a non-journaled pager.
+ */
+ zSql = sqlite3MPrintf("ATTACH '%q' AS vacuum_db;", zTemp);
+ if( !zSql ){
+ rc = SQLITE_NOMEM;
+ goto end_of_vacuum;
+ }
+ rc = execSql(db, zSql);
+ sqliteFree(zSql);
+ zSql = 0;
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 );
+ pTemp = db->aDb[db->nDb-1].pBt;
+ sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain),
+ sqlite3BtreeGetReserve(pMain));
+ assert( sqlite3BtreeGetPageSize(pTemp)==sqlite3BtreeGetPageSize(pMain) );
+ execSql(db, "PRAGMA vacuum_db.synchronous=OFF");
+
+#ifndef SQLITE_OMIT_AUTOVACUUM
+ sqlite3BtreeSetAutoVacuum(pTemp, sqlite3BtreeGetAutoVacuum(pMain));
+#endif
+
+ /* Begin a transaction */
+ rc = execSql(db, "BEGIN;");
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+
+ /* Query the schema of the main database. Create a mirror schema
+ ** in the temporary database.
+ */
+ rc = execExecSql(db,
+ "SELECT 'CREATE TABLE vacuum_db.' || substr(sql,14,100000000) "
+ " FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence'");
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ rc = execExecSql(db,
+ "SELECT 'CREATE INDEX vacuum_db.' || substr(sql,14,100000000)"
+ " FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' ");
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ rc = execExecSql(db,
+ "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21,100000000) "
+ " FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'");
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ rc = execExecSql(db,
+ "SELECT 'CREATE VIEW vacuum_db.' || substr(sql,13,100000000) "
+ " FROM sqlite_master WHERE type='view'"
+ );
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+
+ /* Loop through the tables in the main database. For each, do
+ ** an "INSERT INTO vacuum_db.xxx SELECT * FROM xxx;" to copy
+ ** the contents to the temporary database.
+ */
+ rc = execExecSql(db,
+ "SELECT 'INSERT INTO vacuum_db.' || quote(name) "
+ "|| ' SELECT * FROM ' || quote(name) || ';'"
+ "FROM sqlite_master "
+ "WHERE type = 'table' AND name!='sqlite_sequence';"
+ );
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+
+ /* Copy over the sequence table
+ */
+ rc = execExecSql(db,
+ "SELECT 'DELETE FROM vacuum_db.' || quote(name) || ';' "
+ "FROM vacuum_db.sqlite_master WHERE name='sqlite_sequence' "
+ );
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ rc = execExecSql(db,
+ "SELECT 'INSERT INTO vacuum_db.' || quote(name) "
+ "|| ' SELECT * FROM ' || quote(name) || ';' "
+ "FROM vacuum_db.sqlite_master WHERE name=='sqlite_sequence';"
+ );
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+
+
+ /* Copy the triggers from the main database to the temporary database.
+ ** This was deferred before in case the triggers interfered with copying
+ ** the data. It's possible the indices should be deferred until this
+ ** point also.
+ */
+ rc = execExecSql(db,
+ "SELECT 'CREATE TRIGGER vacuum_db.' || substr(sql, 16, 1000000) "
+ "FROM sqlite_master WHERE type='trigger'"
+ );
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+
+
+ /* At this point, unless the main db was completely empty, there is now a
+ ** transaction open on the vacuum database, but not on the main database.
+ ** Open a btree level transaction on the main database. This allows a
+ ** call to sqlite3BtreeCopyFile(). The main database btree level
+ ** transaction is then committed, so the SQL level never knows it was
+ ** opened for writing. This way, the SQL transaction used to create the
+ ** temporary database never needs to be committed.
+ */
+ if( sqlite3BtreeIsInTrans(pTemp) ){
+ u32 meta;
+ int i;
+
+ /* This array determines which meta meta values are preserved in the
+ ** vacuum. Even entries are the meta value number and odd entries
+ ** are an increment to apply to the meta value after the vacuum.
+ ** The increment is used to increase the schema cookie so that other
+ ** connections to the same database will know to reread the schema.
+ */
+ static const unsigned char aCopy[] = {
+ 1, 1, /* Add one to the old schema cookie */
+ 3, 0, /* Preserve the default page cache size */
+ 5, 0, /* Preserve the default text encoding */
+ 6, 0, /* Preserve the user version */
+ };
+
+ assert( 0==sqlite3BtreeIsInTrans(pMain) );
+ rc = sqlite3BtreeBeginTrans(pMain, 1);
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+
+ /* Copy Btree meta values */
+ for(i=0; i<sizeof(aCopy)/sizeof(aCopy[0]); i+=2){
+ rc = sqlite3BtreeGetMeta(pMain, aCopy[i], &meta);
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ rc = sqlite3BtreeUpdateMeta(pTemp, aCopy[i], meta+aCopy[i+1]);
+ }
+
+ rc = sqlite3BtreeCopyFile(pMain, pTemp);
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ rc = sqlite3BtreeCommit(pMain);
+ }
+
+end_of_vacuum:
+ /* Restore the original value of the write-schema flag. */
+ db->flags &= ~SQLITE_WriteSchema;
+ db->flags |= writeschema_flag;
+
+ /* Currently there is an SQL level transaction open on the vacuum
+ ** database. No locks are held on any other files (since the main file
+ ** was committed at the btree level). So it safe to end the transaction
+ ** by manually setting the autoCommit flag to true and detaching the
+ ** vacuum database. The vacuum_db journal file is deleted when the pager
+ ** is closed by the DETACH.
+ */
+ db->autoCommit = 1;
+ if( rc==SQLITE_OK ){
+ rc = execSql(db, "DETACH vacuum_db;");
+ }else{
+ execSql(db, "DETACH vacuum_db;");
+ }
+ if( zTemp ){
+ sqlite3OsDelete(zTemp);
+ sqliteFree(zTemp);
+ }
+ if( zSql ) sqliteFree( zSql );
+ sqlite3ResetInternalSchema(db, 0);
+#endif
+
+ return rc;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/vdbe.c b/ext/pdo_sqlite/sqlite/src/vdbe.c
new file mode 100644
index 000000000..a3c3cd11f
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/vdbe.c
@@ -0,0 +1,4432 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** The code in this file implements execution method of the
+** Virtual Database Engine (VDBE). A separate file ("vdbeaux.c")
+** handles housekeeping details such as creating and deleting
+** VDBE instances. This file is solely interested in executing
+** the VDBE program.
+**
+** In the external interface, an "sqlite3_stmt*" is an opaque pointer
+** to a VDBE.
+**
+** The SQL parser generates a program which is then executed by
+** the VDBE to do the work of the SQL statement. VDBE programs are
+** similar in form to assembly language. The program consists of
+** a linear sequence of operations. Each operation has an opcode
+** and 3 operands. Operands P1 and P2 are integers. Operand P3
+** is a null-terminated string. The P2 operand must be non-negative.
+** Opcodes will typically ignore one or more operands. Many opcodes
+** ignore all three operands.
+**
+** Computation results are stored on a stack. Each entry on the
+** stack is either an integer, a null-terminated string, a floating point
+** number, or the SQL "NULL" value. An inplicit conversion from one
+** type to the other occurs as necessary.
+**
+** Most of the code in this file is taken up by the sqlite3VdbeExec()
+** function which does the work of interpreting a VDBE program.
+** But other routines are also provided to help in building up
+** a program instruction by instruction.
+**
+** Various scripts scan this source file in order to generate HTML
+** documentation, headers files, or other derived files. The formatting
+** of the code in this file is, therefore, important. See other comments
+** in this file for details. If in doubt, do not deviate from existing
+** commenting and indentation practices when changing or adding code.
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#include <ctype.h>
+#include "vdbeInt.h"
+
+/*
+** The following global variable is incremented every time a cursor
+** moves, either by the OP_MoveXX, OP_Next, or OP_Prev opcodes. The test
+** procedures use this information to make sure that indices are
+** working correctly. This variable has no function other than to
+** help verify the correct operation of the library.
+*/
+int sqlite3_search_count = 0;
+
+/*
+** When this global variable is positive, it gets decremented once before
+** each instruction in the VDBE. When reaches zero, the SQLITE_Interrupt
+** of the db.flags field is set in order to simulate and interrupt.
+**
+** This facility is used for testing purposes only. It does not function
+** in an ordinary build.
+*/
+int sqlite3_interrupt_count = 0;
+
+/*
+** The next global variable is incremented each type the OP_Sort opcode
+** is executed. The test procedures use this information to make sure that
+** sorting is occurring or not occuring at appropriate times. This variable
+** has no function other than to help verify the correct operation of the
+** library.
+*/
+int sqlite3_sort_count = 0;
+
+/*
+** Release the memory associated with the given stack level. This
+** leaves the Mem.flags field in an inconsistent state.
+*/
+#define Release(P) if((P)->flags&MEM_Dyn){ sqlite3VdbeMemRelease(P); }
+
+/*
+** Convert the given stack entity into a string if it isn't one
+** already. Return non-zero if a malloc() fails.
+*/
+#define Stringify(P, enc) \
+ if(((P)->flags&(MEM_Str|MEM_Blob))==0 && sqlite3VdbeMemStringify(P,enc)) \
+ { goto no_mem; }
+
+/*
+** Convert the given stack entity into a string that has been obtained
+** from sqliteMalloc(). This is different from Stringify() above in that
+** Stringify() will use the NBFS bytes of static string space if the string
+** will fit but this routine always mallocs for space.
+** Return non-zero if we run out of memory.
+*/
+#define Dynamicify(P,enc) sqlite3VdbeMemDynamicify(P)
+
+
+/*
+** An ephemeral string value (signified by the MEM_Ephem flag) contains
+** a pointer to a dynamically allocated string where some other entity
+** is responsible for deallocating that string. Because the stack entry
+** does not control the string, it might be deleted without the stack
+** entry knowing it.
+**
+** This routine converts an ephemeral string into a dynamically allocated
+** string that the stack entry itself controls. In other words, it
+** converts an MEM_Ephem string into an MEM_Dyn string.
+*/
+#define Deephemeralize(P) \
+ if( ((P)->flags&MEM_Ephem)!=0 \
+ && sqlite3VdbeMemMakeWriteable(P) ){ goto no_mem;}
+
+/*
+** Convert the given stack entity into a integer if it isn't one
+** already.
+**
+** Any prior string or real representation is invalidated.
+** NULLs are converted into 0.
+*/
+#define Integerify(P) sqlite3VdbeMemIntegerify(P)
+
+/*
+** Convert P so that it has type MEM_Real.
+**
+** Any prior string or integer representation is invalidated.
+** NULLs are converted into 0.0.
+*/
+#define Realify(P) sqlite3VdbeMemRealify(P)
+
+/*
+** Argument pMem points at a memory cell that will be passed to a
+** user-defined function or returned to the user as the result of a query.
+** The second argument, 'db_enc' is the text encoding used by the vdbe for
+** stack variables. This routine sets the pMem->enc and pMem->type
+** variables used by the sqlite3_value_*() routines.
+*/
+#define storeTypeInfo(A,B) _storeTypeInfo(A)
+static void _storeTypeInfo(Mem *pMem){
+ int flags = pMem->flags;
+ if( flags & MEM_Null ){
+ pMem->type = SQLITE_NULL;
+ }
+ else if( flags & MEM_Int ){
+ pMem->type = SQLITE_INTEGER;
+ }
+ else if( flags & MEM_Real ){
+ pMem->type = SQLITE_FLOAT;
+ }
+ else if( flags & MEM_Str ){
+ pMem->type = SQLITE_TEXT;
+ }else{
+ pMem->type = SQLITE_BLOB;
+ }
+}
+
+/*
+** Pop the stack N times.
+*/
+static void popStack(Mem **ppTos, int N){
+ Mem *pTos = *ppTos;
+ while( N>0 ){
+ N--;
+ Release(pTos);
+ pTos--;
+ }
+ *ppTos = pTos;
+}
+
+/*
+** Allocate cursor number iCur. Return a pointer to it. Return NULL
+** if we run out of memory.
+*/
+static Cursor *allocateCursor(Vdbe *p, int iCur){
+ Cursor *pCx;
+ assert( iCur<p->nCursor );
+ if( p->apCsr[iCur] ){
+ sqlite3VdbeFreeCursor(p->apCsr[iCur]);
+ }
+ p->apCsr[iCur] = pCx = sqliteMalloc( sizeof(Cursor) );
+ return pCx;
+}
+
+/*
+** Apply any conversion required by the supplied column affinity to
+** memory cell pRec. affinity may be one of:
+**
+** SQLITE_AFF_NUMERIC
+** SQLITE_AFF_TEXT
+** SQLITE_AFF_NONE
+** SQLITE_AFF_INTEGER
+**
+*/
+static void applyAffinity(Mem *pRec, char affinity, u8 enc){
+ if( affinity==SQLITE_AFF_NONE ){
+ /* do nothing */
+ }else if( affinity==SQLITE_AFF_TEXT ){
+ /* Only attempt the conversion to TEXT if there is an integer or real
+ ** representation (blob and NULL do not get converted) but no string
+ ** representation.
+ */
+ if( 0==(pRec->flags&MEM_Str) && (pRec->flags&(MEM_Real|MEM_Int)) ){
+ sqlite3VdbeMemStringify(pRec, enc);
+ }
+ pRec->flags &= ~(MEM_Real|MEM_Int);
+ }else{
+ if( 0==(pRec->flags&(MEM_Real|MEM_Int)) ){
+ /* pRec does not have a valid integer or real representation.
+ ** Attempt a conversion if pRec has a string representation and
+ ** it looks like a number.
+ */
+ int realnum;
+ sqlite3VdbeMemNulTerminate(pRec);
+ if( pRec->flags&MEM_Str && sqlite3IsNumber(pRec->z, &realnum, enc) ){
+ if( realnum ){
+ Realify(pRec);
+ }else{
+ Integerify(pRec);
+ }
+ }
+ }
+
+ if( affinity==SQLITE_AFF_INTEGER ){
+ /* For INTEGER affinity, try to convert a real value to an int */
+ if( (pRec->flags&MEM_Real) && !(pRec->flags&MEM_Int) ){
+ pRec->i = pRec->r;
+ if( ((double)pRec->i)==pRec->r ){
+ pRec->flags |= MEM_Int;
+ }
+ }
+ }
+ }
+}
+
+/*
+** Exported version of applyAffinity(). This one works on sqlite3_value*,
+** not the internal Mem* type.
+*/
+void sqlite3ValueApplyAffinity(sqlite3_value *pVal, u8 affinity, u8 enc){
+ applyAffinity((Mem *)pVal, affinity, enc);
+}
+
+#ifdef SQLITE_DEBUG
+/*
+** Write a nice string representation of the contents of cell pMem
+** into buffer zBuf, length nBuf.
+*/
+void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf){
+ char *zCsr = zBuf;
+ int f = pMem->flags;
+
+ static const char *const encnames[] = {"(X)", "(8)", "(16LE)", "(16BE)"};
+
+ if( f&MEM_Blob ){
+ int i;
+ char c;
+ if( f & MEM_Dyn ){
+ c = 'z';
+ assert( (f & (MEM_Static|MEM_Ephem))==0 );
+ }else if( f & MEM_Static ){
+ c = 't';
+ assert( (f & (MEM_Dyn|MEM_Ephem))==0 );
+ }else if( f & MEM_Ephem ){
+ c = 'e';
+ assert( (f & (MEM_Static|MEM_Dyn))==0 );
+ }else{
+ c = 's';
+ }
+
+ zCsr += sprintf(zCsr, "%c", c);
+ zCsr += sprintf(zCsr, "%d[", pMem->n);
+ for(i=0; i<16 && i<pMem->n; i++){
+ zCsr += sprintf(zCsr, "%02X ", ((int)pMem->z[i] & 0xFF));
+ }
+ for(i=0; i<16 && i<pMem->n; i++){
+ char z = pMem->z[i];
+ if( z<32 || z>126 ) *zCsr++ = '.';
+ else *zCsr++ = z;
+ }
+
+ zCsr += sprintf(zCsr, "]");
+ *zCsr = '\0';
+ }else if( f & MEM_Str ){
+ int j, k;
+ zBuf[0] = ' ';
+ if( f & MEM_Dyn ){
+ zBuf[1] = 'z';
+ assert( (f & (MEM_Static|MEM_Ephem))==0 );
+ }else if( f & MEM_Static ){
+ zBuf[1] = 't';
+ assert( (f & (MEM_Dyn|MEM_Ephem))==0 );
+ }else if( f & MEM_Ephem ){
+ zBuf[1] = 'e';
+ assert( (f & (MEM_Static|MEM_Dyn))==0 );
+ }else{
+ zBuf[1] = 's';
+ }
+ k = 2;
+ k += sprintf(&zBuf[k], "%d", pMem->n);
+ zBuf[k++] = '[';
+ for(j=0; j<15 && j<pMem->n; j++){
+ u8 c = pMem->z[j];
+ if( c>=0x20 && c<0x7f ){
+ zBuf[k++] = c;
+ }else{
+ zBuf[k++] = '.';
+ }
+ }
+ zBuf[k++] = ']';
+ k += sprintf(&zBuf[k], encnames[pMem->enc]);
+ zBuf[k++] = 0;
+ }
+}
+#endif
+
+
+#ifdef VDBE_PROFILE
+/*
+** The following routine only works on pentium-class processors.
+** It uses the RDTSC opcode to read the cycle count value out of the
+** processor and returns that value. This can be used for high-res
+** profiling.
+*/
+__inline__ unsigned long long int hwtime(void){
+ unsigned long long int x;
+ __asm__("rdtsc\n\t"
+ "mov %%edx, %%ecx\n\t"
+ :"=A" (x));
+ return x;
+}
+#endif
+
+/*
+** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
+** sqlite3_interrupt() routine has been called. If it has been, then
+** processing of the VDBE program is interrupted.
+**
+** This macro added to every instruction that does a jump in order to
+** implement a loop. This test used to be on every single instruction,
+** but that meant we more testing that we needed. By only testing the
+** flag on jump instructions, we get a (small) speed improvement.
+*/
+#define CHECK_FOR_INTERRUPT \
+ if( db->flags & SQLITE_Interrupt ) goto abort_due_to_interrupt;
+
+
+/*
+** Execute as much of a VDBE program as we can then return.
+**
+** sqlite3VdbeMakeReady() must be called before this routine in order to
+** close the program with a final OP_Halt and to set up the callbacks
+** and the error message pointer.
+**
+** Whenever a row or result data is available, this routine will either
+** invoke the result callback (if there is one) or return with
+** SQLITE_ROW.
+**
+** If an attempt is made to open a locked database, then this routine
+** will either invoke the busy callback (if there is one) or it will
+** return SQLITE_BUSY.
+**
+** If an error occurs, an error message is written to memory obtained
+** from sqliteMalloc() and p->zErrMsg is made to point to that memory.
+** The error code is stored in p->rc and this routine returns SQLITE_ERROR.
+**
+** If the callback ever returns non-zero, then the program exits
+** immediately. There will be no error message but the p->rc field is
+** set to SQLITE_ABORT and this routine will return SQLITE_ERROR.
+**
+** A memory allocation error causes p->rc to be set to SQLITE_NOMEM and this
+** routine to return SQLITE_ERROR.
+**
+** Other fatal errors return SQLITE_ERROR.
+**
+** After this routine has finished, sqlite3VdbeFinalize() should be
+** used to clean up the mess that was left behind.
+*/
+int sqlite3VdbeExec(
+ Vdbe *p /* The VDBE */
+){
+ int pc; /* The program counter */
+ Op *pOp; /* Current operation */
+ int rc = SQLITE_OK; /* Value to return */
+ sqlite3 *db = p->db; /* The database */
+ Mem *pTos; /* Top entry in the operand stack */
+#ifdef VDBE_PROFILE
+ unsigned long long start; /* CPU clock count at start of opcode */
+ int origPc; /* Program counter at start of opcode */
+#endif
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
+ int nProgressOps = 0; /* Opcodes executed since progress callback. */
+#endif
+#ifndef NDEBUG
+ Mem *pStackLimit;
+#endif
+
+ if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE;
+ assert( db->magic==SQLITE_MAGIC_BUSY );
+ assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY );
+ p->rc = SQLITE_OK;
+ assert( p->explain==0 );
+ pTos = p->pTos;
+ if( sqlite3_malloc_failed ) goto no_mem;
+ if( p->popStack ){
+ popStack(&pTos, p->popStack);
+ p->popStack = 0;
+ }
+ p->resOnStack = 0;
+ db->busyHandler.nBusy = 0;
+ CHECK_FOR_INTERRUPT;
+ for(pc=p->pc; rc==SQLITE_OK; pc++){
+ assert( pc>=0 && pc<p->nOp );
+ assert( pTos<=&p->aStack[pc] );
+ if( sqlite3_malloc_failed ) goto no_mem;
+#ifdef VDBE_PROFILE
+ origPc = pc;
+ start = hwtime();
+#endif
+ pOp = &p->aOp[pc];
+
+ /* Only allow tracing if SQLITE_DEBUG is defined.
+ */
+#ifdef SQLITE_DEBUG
+ if( p->trace ){
+ if( pc==0 ){
+ printf("VDBE Execution Trace:\n");
+ sqlite3VdbePrintSql(p);
+ }
+ sqlite3VdbePrintOp(p->trace, pc, pOp);
+ }
+ if( p->trace==0 && pc==0 && sqlite3OsFileExists("vdbe_sqltrace") ){
+ sqlite3VdbePrintSql(p);
+ }
+#endif
+
+
+ /* Check to see if we need to simulate an interrupt. This only happens
+ ** if we have a special test build.
+ */
+#ifdef SQLITE_TEST
+ if( sqlite3_interrupt_count>0 ){
+ sqlite3_interrupt_count--;
+ if( sqlite3_interrupt_count==0 ){
+ sqlite3_interrupt(db);
+ }
+ }
+#endif
+
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
+ /* Call the progress callback if it is configured and the required number
+ ** of VDBE ops have been executed (either since this invocation of
+ ** sqlite3VdbeExec() or since last time the progress callback was called).
+ ** If the progress callback returns non-zero, exit the virtual machine with
+ ** a return code SQLITE_ABORT.
+ */
+ if( db->xProgress ){
+ if( db->nProgressOps==nProgressOps ){
+ if( db->xProgress(db->pProgressArg)!=0 ){
+ rc = SQLITE_ABORT;
+ continue; /* skip to the next iteration of the for loop */
+ }
+ nProgressOps = 0;
+ }
+ nProgressOps++;
+ }
+#endif
+
+#ifndef NDEBUG
+ /* This is to check that the return value of static function
+ ** opcodeNoPush() (see vdbeaux.c) returns values that match the
+ ** implementation of the virtual machine in this file. If
+ ** opcodeNoPush() returns non-zero, then the stack is guarenteed
+ ** not to grow when the opcode is executed. If it returns zero, then
+ ** the stack may grow by at most 1.
+ **
+ ** The global wrapper function sqlite3VdbeOpcodeUsesStack() is not
+ ** available if NDEBUG is defined at build time.
+ */
+ pStackLimit = pTos;
+ if( !sqlite3VdbeOpcodeNoPush(pOp->opcode) ){
+ pStackLimit++;
+ }
+#endif
+
+ switch( pOp->opcode ){
+
+/*****************************************************************************
+** What follows is a massive switch statement where each case implements a
+** separate instruction in the virtual machine. If we follow the usual
+** indentation conventions, each case should be indented by 6 spaces. But
+** that is a lot of wasted space on the left margin. So the code within
+** the switch statement will break with convention and be flush-left. Another
+** big comment (similar to this one) will mark the point in the code where
+** we transition back to normal indentation.
+**
+** The formatting of each case is important. The makefile for SQLite
+** generates two C files "opcodes.h" and "opcodes.c" by scanning this
+** file looking for lines that begin with "case OP_". The opcodes.h files
+** will be filled with #defines that give unique integer values to each
+** opcode and the opcodes.c file is filled with an array of strings where
+** each string is the symbolic name for the corresponding opcode. If the
+** case statement is followed by a comment of the form "/# same as ... #/"
+** that comment is used to determine the particular value of the opcode.
+**
+** If a comment on the same line as the "case OP_" construction contains
+** the word "no-push", then the opcode is guarenteed not to grow the
+** vdbe stack when it is executed. See function opcode() in
+** vdbeaux.c for details.
+**
+** Documentation about VDBE opcodes is generated by scanning this file
+** for lines of that contain "Opcode:". That line and all subsequent
+** comment lines are used in the generation of the opcode.html documentation
+** file.
+**
+** SUMMARY:
+**
+** Formatting is important to scripts that scan this file.
+** Do not deviate from the formatting style currently in use.
+**
+*****************************************************************************/
+
+/* Opcode: Goto * P2 *
+**
+** An unconditional jump to address P2.
+** The next instruction executed will be
+** the one at index P2 from the beginning of
+** the program.
+*/
+case OP_Goto: { /* no-push */
+ CHECK_FOR_INTERRUPT;
+ pc = pOp->p2 - 1;
+ break;
+}
+
+/* Opcode: Gosub * P2 *
+**
+** Push the current address plus 1 onto the return address stack
+** and then jump to address P2.
+**
+** The return address stack is of limited depth. If too many
+** OP_Gosub operations occur without intervening OP_Returns, then
+** the return address stack will fill up and processing will abort
+** with a fatal error.
+*/
+case OP_Gosub: { /* no-push */
+ assert( p->returnDepth<sizeof(p->returnStack)/sizeof(p->returnStack[0]) );
+ p->returnStack[p->returnDepth++] = pc+1;
+ pc = pOp->p2 - 1;
+ break;
+}
+
+/* Opcode: Return * * *
+**
+** Jump immediately to the next instruction after the last unreturned
+** OP_Gosub. If an OP_Return has occurred for all OP_Gosubs, then
+** processing aborts with a fatal error.
+*/
+case OP_Return: { /* no-push */
+ assert( p->returnDepth>0 );
+ p->returnDepth--;
+ pc = p->returnStack[p->returnDepth] - 1;
+ break;
+}
+
+/* Opcode: Halt P1 P2 P3
+**
+** Exit immediately. All open cursors, Fifos, etc are closed
+** automatically.
+**
+** P1 is the result code returned by sqlite3_exec(), sqlite3_reset(),
+** or sqlite3_finalize(). For a normal halt, this should be SQLITE_OK (0).
+** For errors, it can be some other value. If P1!=0 then P2 will determine
+** whether or not to rollback the current transaction. Do not rollback
+** if P2==OE_Fail. Do the rollback if P2==OE_Rollback. If P2==OE_Abort,
+** then back out all changes that have occurred during this execution of the
+** VDBE, but do not rollback the transaction.
+**
+** If P3 is not null then it is an error message string.
+**
+** There is an implied "Halt 0 0 0" instruction inserted at the very end of
+** every program. So a jump past the last instruction of the program
+** is the same as executing Halt.
+*/
+case OP_Halt: { /* no-push */
+ p->pTos = pTos;
+ p->rc = pOp->p1;
+ p->pc = pc;
+ p->errorAction = pOp->p2;
+ if( pOp->p3 ){
+ sqlite3SetString(&p->zErrMsg, pOp->p3, (char*)0);
+ }
+ rc = sqlite3VdbeHalt(p);
+ assert( rc==SQLITE_BUSY || rc==SQLITE_OK );
+ if( rc==SQLITE_BUSY ){
+ p->rc = SQLITE_BUSY;
+ return SQLITE_BUSY;
+ }
+ return p->rc ? SQLITE_ERROR : SQLITE_DONE;
+}
+
+/* Opcode: Integer P1 * *
+**
+** The 32-bit integer value P1 is pushed onto the stack.
+*/
+case OP_Integer: {
+ pTos++;
+ pTos->flags = MEM_Int;
+ pTos->i = pOp->p1;
+ break;
+}
+
+/* Opcode: Int64 * * P3
+**
+** P3 is a string representation of an integer. Convert that integer
+** to a 64-bit value and push it onto the stack.
+*/
+case OP_Int64: {
+ pTos++;
+ assert( pOp->p3!=0 );
+ pTos->flags = MEM_Str|MEM_Static|MEM_Term;
+ pTos->z = pOp->p3;
+ pTos->n = strlen(pTos->z);
+ pTos->enc = SQLITE_UTF8;
+ pTos->i = sqlite3VdbeIntValue(pTos);
+ pTos->flags |= MEM_Int;
+ break;
+}
+
+/* Opcode: Real * * P3
+**
+** The string value P3 is converted to a real and pushed on to the stack.
+*/
+case OP_Real: { /* same as TK_FLOAT, */
+ pTos++;
+ pTos->flags = MEM_Str|MEM_Static|MEM_Term;
+ pTos->z = pOp->p3;
+ pTos->n = strlen(pTos->z);
+ pTos->enc = SQLITE_UTF8;
+ pTos->r = sqlite3VdbeRealValue(pTos);
+ pTos->flags |= MEM_Real;
+ sqlite3VdbeChangeEncoding(pTos, db->enc);
+ break;
+}
+
+/* Opcode: String8 * * P3
+**
+** P3 points to a nul terminated UTF-8 string. This opcode is transformed
+** into an OP_String before it is executed for the first time.
+*/
+case OP_String8: { /* same as TK_STRING */
+#ifndef SQLITE_OMIT_UTF16
+ pOp->opcode = OP_String;
+
+ assert( pOp->p3!=0 );
+ if( db->enc!=SQLITE_UTF8 ){
+ pTos++;
+ sqlite3VdbeMemSetStr(pTos, pOp->p3, -1, SQLITE_UTF8, SQLITE_STATIC);
+ if( SQLITE_OK!=sqlite3VdbeChangeEncoding(pTos, db->enc) ) goto no_mem;
+ if( SQLITE_OK!=sqlite3VdbeMemDynamicify(pTos) ) goto no_mem;
+ pTos->flags &= ~(MEM_Dyn);
+ pTos->flags |= MEM_Static;
+ if( pOp->p3type==P3_DYNAMIC ){
+ sqliteFree(pOp->p3);
+ }
+ pOp->p3type = P3_DYNAMIC;
+ pOp->p3 = pTos->z;
+ break;
+ }
+#endif
+ /* Otherwise fall through to the next case, OP_String */
+}
+
+/* Opcode: String * * P3
+**
+** The string value P3 is pushed onto the stack. If P3==0 then a
+** NULL is pushed onto the stack. P3 is assumed to be a nul terminated
+** string encoded with the database native encoding.
+*/
+case OP_String: {
+ pTos++;
+ assert( pOp->p3!=0 );
+ pTos->flags = MEM_Str|MEM_Static|MEM_Term;
+ pTos->z = pOp->p3;
+#ifndef SQLITE_OMIT_UTF16
+ if( db->enc==SQLITE_UTF8 ){
+ pTos->n = strlen(pTos->z);
+ }else{
+ pTos->n = sqlite3utf16ByteLen(pTos->z, -1);
+ }
+#else
+ assert( db->enc==SQLITE_UTF8 );
+ pTos->n = strlen(pTos->z);
+#endif
+ pTos->enc = db->enc;
+ break;
+}
+
+/* Opcode: Null * * *
+**
+** Push a NULL onto the stack.
+*/
+case OP_Null: {
+ pTos++;
+ pTos->flags = MEM_Null;
+ pTos->n = 0;
+ break;
+}
+
+
+#ifndef SQLITE_OMIT_BLOB_LITERAL
+/* Opcode: HexBlob * * P3
+**
+** P3 is an UTF-8 SQL hex encoding of a blob. The blob is pushed onto the
+** vdbe stack.
+**
+** The first time this instruction executes, in transforms itself into a
+** 'Blob' opcode with a binary blob as P3.
+*/
+case OP_HexBlob: { /* same as TK_BLOB */
+ pOp->opcode = OP_Blob;
+ pOp->p1 = strlen(pOp->p3)/2;
+ if( pOp->p1 ){
+ char *zBlob = sqlite3HexToBlob(pOp->p3);
+ if( !zBlob ) goto no_mem;
+ if( pOp->p3type==P3_DYNAMIC ){
+ sqliteFree(pOp->p3);
+ }
+ pOp->p3 = zBlob;
+ pOp->p3type = P3_DYNAMIC;
+ }else{
+ if( pOp->p3type==P3_DYNAMIC ){
+ sqliteFree(pOp->p3);
+ }
+ pOp->p3type = P3_STATIC;
+ pOp->p3 = "";
+ }
+
+ /* Fall through to the next case, OP_Blob. */
+}
+
+/* Opcode: Blob P1 * P3
+**
+** P3 points to a blob of data P1 bytes long. Push this
+** value onto the stack. This instruction is not coded directly
+** by the compiler. Instead, the compiler layer specifies
+** an OP_HexBlob opcode, with the hex string representation of
+** the blob as P3. This opcode is transformed to an OP_Blob
+** the first time it is executed.
+*/
+case OP_Blob: {
+ pTos++;
+ sqlite3VdbeMemSetStr(pTos, pOp->p3, pOp->p1, 0, 0);
+ break;
+}
+#endif /* SQLITE_OMIT_BLOB_LITERAL */
+
+/* Opcode: Variable P1 * *
+**
+** Push the value of variable P1 onto the stack. A variable is
+** an unknown in the original SQL string as handed to sqlite3_compile().
+** Any occurance of the '?' character in the original SQL is considered
+** a variable. Variables in the SQL string are number from left to
+** right beginning with 1. The values of variables are set using the
+** sqlite3_bind() API.
+*/
+case OP_Variable: {
+ int j = pOp->p1 - 1;
+ assert( j>=0 && j<p->nVar );
+
+ pTos++;
+ sqlite3VdbeMemShallowCopy(pTos, &p->aVar[j], MEM_Static);
+ break;
+}
+
+/* Opcode: Pop P1 * *
+**
+** P1 elements are popped off of the top of stack and discarded.
+*/
+case OP_Pop: { /* no-push */
+ assert( pOp->p1>=0 );
+ popStack(&pTos, pOp->p1);
+ assert( pTos>=&p->aStack[-1] );
+ break;
+}
+
+/* Opcode: Dup P1 P2 *
+**
+** A copy of the P1-th element of the stack
+** is made and pushed onto the top of the stack.
+** The top of the stack is element 0. So the
+** instruction "Dup 0 0 0" will make a copy of the
+** top of the stack.
+**
+** If the content of the P1-th element is a dynamically
+** allocated string, then a new copy of that string
+** is made if P2==0. If P2!=0, then just a pointer
+** to the string is copied.
+**
+** Also see the Pull instruction.
+*/
+case OP_Dup: {
+ Mem *pFrom = &pTos[-pOp->p1];
+ assert( pFrom<=pTos && pFrom>=p->aStack );
+ pTos++;
+ sqlite3VdbeMemShallowCopy(pTos, pFrom, MEM_Ephem);
+ if( pOp->p2 ){
+ Deephemeralize(pTos);
+ }
+ break;
+}
+
+/* Opcode: Pull P1 * *
+**
+** The P1-th element is removed from its current location on
+** the stack and pushed back on top of the stack. The
+** top of the stack is element 0, so "Pull 0 0 0" is
+** a no-op. "Pull 1 0 0" swaps the top two elements of
+** the stack.
+**
+** See also the Dup instruction.
+*/
+case OP_Pull: { /* no-push */
+ Mem *pFrom = &pTos[-pOp->p1];
+ int i;
+ Mem ts;
+
+ ts = *pFrom;
+ Deephemeralize(pTos);
+ for(i=0; i<pOp->p1; i++, pFrom++){
+ Deephemeralize(&pFrom[1]);
+ assert( (pFrom->flags & MEM_Ephem)==0 );
+ *pFrom = pFrom[1];
+ if( pFrom->flags & MEM_Short ){
+ assert( pFrom->flags & (MEM_Str|MEM_Blob) );
+ assert( pFrom->z==pFrom[1].zShort );
+ pFrom->z = pFrom->zShort;
+ }
+ }
+ *pTos = ts;
+ if( pTos->flags & MEM_Short ){
+ assert( pTos->flags & (MEM_Str|MEM_Blob) );
+ assert( pTos->z==pTos[-pOp->p1].zShort );
+ pTos->z = pTos->zShort;
+ }
+ break;
+}
+
+/* Opcode: Push P1 * *
+**
+** Overwrite the value of the P1-th element down on the
+** stack (P1==0 is the top of the stack) with the value
+** of the top of the stack. Then pop the top of the stack.
+*/
+case OP_Push: { /* no-push */
+ Mem *pTo = &pTos[-pOp->p1];
+
+ assert( pTo>=p->aStack );
+ sqlite3VdbeMemMove(pTo, pTos);
+ pTos--;
+ break;
+}
+
+/* Opcode: Callback P1 * *
+**
+** Pop P1 values off the stack and form them into an array. Then
+** invoke the callback function using the newly formed array as the
+** 3rd parameter.
+*/
+case OP_Callback: { /* no-push */
+ int i;
+ assert( p->nResColumn==pOp->p1 );
+
+ for(i=0; i<pOp->p1; i++){
+ Mem *pVal = &pTos[0-i];
+ sqlite3VdbeMemNulTerminate(pVal);
+ storeTypeInfo(pVal, db->enc);
+ }
+
+ p->resOnStack = 1;
+ p->nCallback++;
+ p->popStack = pOp->p1;
+ p->pc = pc + 1;
+ p->pTos = pTos;
+ return SQLITE_ROW;
+}
+
+/* Opcode: Concat P1 P2 *
+**
+** Look at the first P1+2 elements of the stack. Append them all
+** together with the lowest element first. The original P1+2 elements
+** are popped from the stack if P2==0 and retained if P2==1. If
+** any element of the stack is NULL, then the result is NULL.
+**
+** When P1==1, this routine makes a copy of the top stack element
+** into memory obtained from sqliteMalloc().
+*/
+case OP_Concat: { /* same as TK_CONCAT */
+ char *zNew;
+ int nByte;
+ int nField;
+ int i, j;
+ Mem *pTerm;
+
+ /* Loop through the stack elements to see how long the result will be. */
+ nField = pOp->p1 + 2;
+ pTerm = &pTos[1-nField];
+ nByte = 0;
+ for(i=0; i<nField; i++, pTerm++){
+ assert( pOp->p2==0 || (pTerm->flags&MEM_Str) );
+ if( pTerm->flags&MEM_Null ){
+ nByte = -1;
+ break;
+ }
+ Stringify(pTerm, db->enc);
+ nByte += pTerm->n;
+ }
+
+ if( nByte<0 ){
+ /* If nByte is less than zero, then there is a NULL value on the stack.
+ ** In this case just pop the values off the stack (if required) and
+ ** push on a NULL.
+ */
+ if( pOp->p2==0 ){
+ popStack(&pTos, nField);
+ }
+ pTos++;
+ pTos->flags = MEM_Null;
+ }else{
+ /* Otherwise malloc() space for the result and concatenate all the
+ ** stack values.
+ */
+ zNew = sqliteMallocRaw( nByte+2 );
+ if( zNew==0 ) goto no_mem;
+ j = 0;
+ pTerm = &pTos[1-nField];
+ for(i=j=0; i<nField; i++, pTerm++){
+ int n = pTerm->n;
+ assert( pTerm->flags & (MEM_Str|MEM_Blob) );
+ memcpy(&zNew[j], pTerm->z, n);
+ j += n;
+ }
+ zNew[j] = 0;
+ zNew[j+1] = 0;
+ assert( j==nByte );
+
+ if( pOp->p2==0 ){
+ popStack(&pTos, nField);
+ }
+ pTos++;
+ pTos->n = j;
+ pTos->flags = MEM_Str|MEM_Dyn|MEM_Term;
+ pTos->xDel = 0;
+ pTos->enc = db->enc;
+ pTos->z = zNew;
+ }
+ break;
+}
+
+/* Opcode: Add * * *
+**
+** Pop the top two elements from the stack, add them together,
+** and push the result back onto the stack. If either element
+** is a string then it is converted to a double using the atof()
+** function before the addition.
+** If either operand is NULL, the result is NULL.
+*/
+/* Opcode: Multiply * * *
+**
+** Pop the top two elements from the stack, multiply them together,
+** and push the result back onto the stack. If either element
+** is a string then it is converted to a double using the atof()
+** function before the multiplication.
+** If either operand is NULL, the result is NULL.
+*/
+/* Opcode: Subtract * * *
+**
+** Pop the top two elements from the stack, subtract the
+** first (what was on top of the stack) from the second (the
+** next on stack)
+** and push the result back onto the stack. If either element
+** is a string then it is converted to a double using the atof()
+** function before the subtraction.
+** If either operand is NULL, the result is NULL.
+*/
+/* Opcode: Divide * * *
+**
+** Pop the top two elements from the stack, divide the
+** first (what was on top of the stack) from the second (the
+** next on stack)
+** and push the result back onto the stack. If either element
+** is a string then it is converted to a double using the atof()
+** function before the division. Division by zero returns NULL.
+** If either operand is NULL, the result is NULL.
+*/
+/* Opcode: Remainder * * *
+**
+** Pop the top two elements from the stack, divide the
+** first (what was on top of the stack) from the second (the
+** next on stack)
+** and push the remainder after division onto the stack. If either element
+** is a string then it is converted to a double using the atof()
+** function before the division. Division by zero returns NULL.
+** If either operand is NULL, the result is NULL.
+*/
+case OP_Add: /* same as TK_PLUS, no-push */
+case OP_Subtract: /* same as TK_MINUS, no-push */
+case OP_Multiply: /* same as TK_STAR, no-push */
+case OP_Divide: /* same as TK_SLASH, no-push */
+case OP_Remainder: { /* same as TK_REM, no-push */
+ Mem *pNos = &pTos[-1];
+ assert( pNos>=p->aStack );
+ if( ((pTos->flags | pNos->flags) & MEM_Null)!=0 ){
+ Release(pTos);
+ pTos--;
+ Release(pTos);
+ pTos->flags = MEM_Null;
+ }else if( (pTos->flags & pNos->flags & MEM_Int)==MEM_Int ){
+ i64 a, b;
+ a = pTos->i;
+ b = pNos->i;
+ switch( pOp->opcode ){
+ case OP_Add: b += a; break;
+ case OP_Subtract: b -= a; break;
+ case OP_Multiply: b *= a; break;
+ case OP_Divide: {
+ if( a==0 ) goto divide_by_zero;
+ b /= a;
+ break;
+ }
+ default: {
+ if( a==0 ) goto divide_by_zero;
+ b %= a;
+ break;
+ }
+ }
+ Release(pTos);
+ pTos--;
+ Release(pTos);
+ pTos->i = b;
+ pTos->flags = MEM_Int;
+ }else{
+ double a, b;
+ a = sqlite3VdbeRealValue(pTos);
+ b = sqlite3VdbeRealValue(pNos);
+ switch( pOp->opcode ){
+ case OP_Add: b += a; break;
+ case OP_Subtract: b -= a; break;
+ case OP_Multiply: b *= a; break;
+ case OP_Divide: {
+ if( a==0.0 ) goto divide_by_zero;
+ b /= a;
+ break;
+ }
+ default: {
+ int ia = (int)a;
+ int ib = (int)b;
+ if( ia==0.0 ) goto divide_by_zero;
+ b = ib % ia;
+ break;
+ }
+ }
+ Release(pTos);
+ pTos--;
+ Release(pTos);
+ pTos->r = b;
+ pTos->flags = MEM_Real;
+ }
+ break;
+
+divide_by_zero:
+ Release(pTos);
+ pTos--;
+ Release(pTos);
+ pTos->flags = MEM_Null;
+ break;
+}
+
+/* Opcode: CollSeq * * P3
+**
+** P3 is a pointer to a CollSeq struct. If the next call to a user function
+** or aggregate calls sqlite3GetFuncCollSeq(), this collation sequence will
+** be returned. This is used by the built-in min(), max() and nullif()
+** functions.
+**
+** The interface used by the implementation of the aforementioned functions
+** to retrieve the collation sequence set by this opcode is not available
+** publicly, only to user functions defined in func.c.
+*/
+case OP_CollSeq: { /* no-push */
+ assert( pOp->p3type==P3_COLLSEQ );
+ break;
+}
+
+/* Opcode: Function P1 P2 P3
+**
+** Invoke a user function (P3 is a pointer to a Function structure that
+** defines the function) with P2 arguments taken from the stack. Pop all
+** arguments from the stack and push back the result.
+**
+** P1 is a 32-bit bitmask indicating whether or not each argument to the
+** function was determined to be constant at compile time. If the first
+** argument was constant then bit 0 of P1 is set. This is used to determine
+** whether meta data associated with a user function argument using the
+** sqlite3_set_auxdata() API may be safely retained until the next
+** invocation of this opcode.
+**
+** See also: AggStep and AggFinal
+*/
+case OP_Function: {
+ int i;
+ Mem *pArg;
+ sqlite3_context ctx;
+ sqlite3_value **apVal;
+ int n = pOp->p2;
+
+ apVal = p->apArg;
+ assert( apVal || n==0 );
+
+ pArg = &pTos[1-n];
+ for(i=0; i<n; i++, pArg++){
+ apVal[i] = pArg;
+ storeTypeInfo(pArg, db->enc);
+ }
+
+ assert( pOp->p3type==P3_FUNCDEF || pOp->p3type==P3_VDBEFUNC );
+ if( pOp->p3type==P3_FUNCDEF ){
+ ctx.pFunc = (FuncDef*)pOp->p3;
+ ctx.pVdbeFunc = 0;
+ }else{
+ ctx.pVdbeFunc = (VdbeFunc*)pOp->p3;
+ ctx.pFunc = ctx.pVdbeFunc->pFunc;
+ }
+
+ ctx.s.flags = MEM_Null;
+ ctx.s.z = 0;
+ ctx.s.xDel = 0;
+ ctx.isError = 0;
+ if( ctx.pFunc->needCollSeq ){
+ assert( pOp>p->aOp );
+ assert( pOp[-1].p3type==P3_COLLSEQ );
+ assert( pOp[-1].opcode==OP_CollSeq );
+ ctx.pColl = (CollSeq *)pOp[-1].p3;
+ }
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
+ (*ctx.pFunc->xFunc)(&ctx, n, apVal);
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
+ if( sqlite3_malloc_failed ) goto no_mem;
+ popStack(&pTos, n);
+
+ /* If any auxilary data functions have been called by this user function,
+ ** immediately call the destructor for any non-static values.
+ */
+ if( ctx.pVdbeFunc ){
+ sqlite3VdbeDeleteAuxData(ctx.pVdbeFunc, pOp->p1);
+ pOp->p3 = (char *)ctx.pVdbeFunc;
+ pOp->p3type = P3_VDBEFUNC;
+ }
+
+ /* Copy the result of the function to the top of the stack */
+ sqlite3VdbeChangeEncoding(&ctx.s, db->enc);
+ pTos++;
+ pTos->flags = 0;
+ sqlite3VdbeMemMove(pTos, &ctx.s);
+
+ /* If the function returned an error, throw an exception */
+ if( ctx.isError ){
+ if( !(pTos->flags&MEM_Str) ){
+ sqlite3SetString(&p->zErrMsg, "user function error", (char*)0);
+ }else{
+ sqlite3SetString(&p->zErrMsg, sqlite3_value_text(pTos), (char*)0);
+ sqlite3VdbeChangeEncoding(pTos, db->enc);
+ }
+ rc = SQLITE_ERROR;
+ }
+ break;
+}
+
+/* Opcode: BitAnd * * *
+**
+** Pop the top two elements from the stack. Convert both elements
+** to integers. Push back onto the stack the bit-wise AND of the
+** two elements.
+** If either operand is NULL, the result is NULL.
+*/
+/* Opcode: BitOr * * *
+**
+** Pop the top two elements from the stack. Convert both elements
+** to integers. Push back onto the stack the bit-wise OR of the
+** two elements.
+** If either operand is NULL, the result is NULL.
+*/
+/* Opcode: ShiftLeft * * *
+**
+** Pop the top two elements from the stack. Convert both elements
+** to integers. Push back onto the stack the second element shifted
+** left by N bits where N is the top element on the stack.
+** If either operand is NULL, the result is NULL.
+*/
+/* Opcode: ShiftRight * * *
+**
+** Pop the top two elements from the stack. Convert both elements
+** to integers. Push back onto the stack the second element shifted
+** right by N bits where N is the top element on the stack.
+** If either operand is NULL, the result is NULL.
+*/
+case OP_BitAnd: /* same as TK_BITAND, no-push */
+case OP_BitOr: /* same as TK_BITOR, no-push */
+case OP_ShiftLeft: /* same as TK_LSHIFT, no-push */
+case OP_ShiftRight: { /* same as TK_RSHIFT, no-push */
+ Mem *pNos = &pTos[-1];
+ int a, b;
+
+ assert( pNos>=p->aStack );
+ if( (pTos->flags | pNos->flags) & MEM_Null ){
+ popStack(&pTos, 2);
+ pTos++;
+ pTos->flags = MEM_Null;
+ break;
+ }
+ a = sqlite3VdbeIntValue(pNos);
+ b = sqlite3VdbeIntValue(pTos);
+ switch( pOp->opcode ){
+ case OP_BitAnd: a &= b; break;
+ case OP_BitOr: a |= b; break;
+ case OP_ShiftLeft: a <<= b; break;
+ case OP_ShiftRight: a >>= b; break;
+ default: /* CANT HAPPEN */ break;
+ }
+ Release(pTos);
+ pTos--;
+ Release(pTos);
+ pTos->i = a;
+ pTos->flags = MEM_Int;
+ break;
+}
+
+/* Opcode: AddImm P1 * *
+**
+** Add the value P1 to whatever is on top of the stack. The result
+** is always an integer.
+**
+** To force the top of the stack to be an integer, just add 0.
+*/
+case OP_AddImm: { /* no-push */
+ assert( pTos>=p->aStack );
+ Integerify(pTos);
+ pTos->i += pOp->p1;
+ break;
+}
+
+/* Opcode: ForceInt P1 P2 *
+**
+** Convert the top of the stack into an integer. If the current top of
+** the stack is not numeric (meaning that is is a NULL or a string that
+** does not look like an integer or floating point number) then pop the
+** stack and jump to P2. If the top of the stack is numeric then
+** convert it into the least integer that is greater than or equal to its
+** current value if P1==0, or to the least integer that is strictly
+** greater than its current value if P1==1.
+*/
+case OP_ForceInt: { /* no-push */
+ i64 v;
+ assert( pTos>=p->aStack );
+ applyAffinity(pTos, SQLITE_AFF_INTEGER, db->enc);
+ if( (pTos->flags & (MEM_Int|MEM_Real))==0 ){
+ Release(pTos);
+ pTos--;
+ pc = pOp->p2 - 1;
+ break;
+ }
+ if( pTos->flags & MEM_Int ){
+ v = pTos->i + (pOp->p1!=0);
+ }else{
+ Realify(pTos);
+ v = (int)pTos->r;
+ if( pTos->r>(double)v ) v++;
+ if( pOp->p1 && pTos->r==(double)v ) v++;
+ }
+ Release(pTos);
+ pTos->i = v;
+ pTos->flags = MEM_Int;
+ break;
+}
+
+/* Opcode: MustBeInt P1 P2 *
+**
+** Force the top of the stack to be an integer. If the top of the
+** stack is not an integer and cannot be converted into an integer
+** with out data loss, then jump immediately to P2, or if P2==0
+** raise an SQLITE_MISMATCH exception.
+**
+** If the top of the stack is not an integer and P2 is not zero and
+** P1 is 1, then the stack is popped. In all other cases, the depth
+** of the stack is unchanged.
+*/
+case OP_MustBeInt: { /* no-push */
+ assert( pTos>=p->aStack );
+ applyAffinity(pTos, SQLITE_AFF_INTEGER, db->enc);
+ if( (pTos->flags & MEM_Int)==0 ){
+ if( pOp->p2==0 ){
+ rc = SQLITE_MISMATCH;
+ goto abort_due_to_error;
+ }else{
+ if( pOp->p1 ) popStack(&pTos, 1);
+ pc = pOp->p2 - 1;
+ }
+ }else{
+ Release(pTos);
+ pTos->flags = MEM_Int;
+ }
+ break;
+}
+
+#ifndef SQLITE_OMIT_CAST
+/* Opcode: ToInt * * *
+**
+** Force the value on the top of the stack to be an integer. If
+** The value is currently a real number, drop its fractional part.
+** If the value is text or blob, try to convert it to an integer using the
+** equivalent of atoi() and store 0 if no such conversion is possible.
+**
+** A NULL value is not changed by this routine. It remains NULL.
+*/
+case OP_ToInt: { /* no-push */
+ assert( pTos>=p->aStack );
+ if( pTos->flags & MEM_Null ) break;
+ assert( MEM_Str==(MEM_Blob>>3) );
+ pTos->flags |= (pTos->flags&MEM_Blob)>>3;
+ applyAffinity(pTos, SQLITE_AFF_INTEGER, db->enc);
+ sqlite3VdbeMemIntegerify(pTos);
+ break;
+}
+
+/* Opcode: ToNumeric * * *
+**
+** Force the value on the top of the stack to be numeric (either an
+** integer or a floating-point number.
+** If the value is text or blob, try to convert it to an using the
+** equivalent of atoi() or atof() and store 0 if no such conversion
+** is possible.
+**
+** A NULL value is not changed by this routine. It remains NULL.
+*/
+case OP_ToNumeric: { /* no-push */
+ assert( pTos>=p->aStack );
+ if( pTos->flags & MEM_Null ) break;
+ assert( MEM_Str==(MEM_Blob>>3) );
+ pTos->flags |= (pTos->flags&MEM_Blob)>>3;
+ applyAffinity(pTos, SQLITE_AFF_NUMERIC, db->enc);
+ if( (pTos->flags & (MEM_Int|MEM_Real))==0 ){
+ sqlite3VdbeMemRealify(pTos);
+ }else{
+ sqlite3VdbeMemRelease(pTos);
+ }
+ assert( (pTos->flags & MEM_Dyn)==0 );
+ pTos->flags &= (MEM_Int|MEM_Real);
+ break;
+}
+
+/* Opcode: ToText * * *
+**
+** Force the value on the top of the stack to be text.
+** If the value is numeric, convert it to an using the
+** equivalent of printf(). Blob values are unchanged and
+** are afterwards simply interpreted as text.
+**
+** A NULL value is not changed by this routine. It remains NULL.
+*/
+case OP_ToText: { /* no-push */
+ assert( pTos>=p->aStack );
+ if( pTos->flags & MEM_Null ) break;
+ assert( MEM_Str==(MEM_Blob>>3) );
+ pTos->flags |= (pTos->flags&MEM_Blob)>>3;
+ applyAffinity(pTos, SQLITE_AFF_TEXT, db->enc);
+ assert( pTos->flags & MEM_Str );
+ pTos->flags &= ~(MEM_Int|MEM_Real|MEM_Blob);
+ break;
+}
+
+/* Opcode: ToBlob * * *
+**
+** Force the value on the top of the stack to be a BLOB.
+** If the value is numeric, convert it to a string first.
+** Strings are simply reinterpreted as blobs with no change
+** to the underlying data.
+**
+** A NULL value is not changed by this routine. It remains NULL.
+*/
+case OP_ToBlob: { /* no-push */
+ assert( pTos>=p->aStack );
+ if( pTos->flags & MEM_Null ) break;
+ if( (pTos->flags & MEM_Blob)==0 ){
+ applyAffinity(pTos, SQLITE_AFF_TEXT, db->enc);
+ assert( pTos->flags & MEM_Str );
+ pTos->flags |= MEM_Blob;
+ }
+ pTos->flags &= ~(MEM_Int|MEM_Real|MEM_Str);
+ break;
+}
+#endif /* SQLITE_OMIT_CAST */
+
+/* Opcode: Eq P1 P2 P3
+**
+** Pop the top two elements from the stack. If they are equal, then
+** jump to instruction P2. Otherwise, continue to the next instruction.
+**
+** If the 0x100 bit of P1 is true and either operand is NULL then take the
+** jump. If the 0x100 bit of P1 is clear then fall thru if either operand
+** is NULL.
+**
+** If the 0x200 bit of P1 is set and either operand is NULL then
+** both operands are converted to integers prior to comparison.
+** NULL operands are converted to zero and non-NULL operands are
+** converted to 1. Thus, for example, with 0x200 set, NULL==NULL is true
+** whereas it would normally be NULL. Similarly, NULL==123 is false when
+** 0x200 is set but is NULL when the 0x200 bit of P1 is clear.
+**
+** The least significant byte of P1 (mask 0xff) must be an affinity character -
+** 'n', 't', 'i' or 'o' - or 0x00. An attempt is made to coerce both values
+** according to the affinity before the comparison is made. If the byte is
+** 0x00, then numeric affinity is used.
+**
+** Once any conversions have taken place, and neither value is NULL,
+** the values are compared. If both values are blobs, or both are text,
+** then memcmp() is used to determine the results of the comparison. If
+** both values are numeric, then a numeric comparison is used. If the
+** two values are of different types, then they are inequal.
+**
+** If P2 is zero, do not jump. Instead, push an integer 1 onto the
+** stack if the jump would have been taken, or a 0 if not. Push a
+** NULL if either operand was NULL.
+**
+** If P3 is not NULL it is a pointer to a collating sequence (a CollSeq
+** structure) that defines how to compare text.
+*/
+/* Opcode: Ne P1 P2 P3
+**
+** This works just like the Eq opcode except that the jump is taken if
+** the operands from the stack are not equal. See the Eq opcode for
+** additional information.
+*/
+/* Opcode: Lt P1 P2 P3
+**
+** This works just like the Eq opcode except that the jump is taken if
+** the 2nd element down on the stack is less than the top of the stack.
+** See the Eq opcode for additional information.
+*/
+/* Opcode: Le P1 P2 P3
+**
+** This works just like the Eq opcode except that the jump is taken if
+** the 2nd element down on the stack is less than or equal to the
+** top of the stack. See the Eq opcode for additional information.
+*/
+/* Opcode: Gt P1 P2 P3
+**
+** This works just like the Eq opcode except that the jump is taken if
+** the 2nd element down on the stack is greater than the top of the stack.
+** See the Eq opcode for additional information.
+*/
+/* Opcode: Ge P1 P2 P3
+**
+** This works just like the Eq opcode except that the jump is taken if
+** the 2nd element down on the stack is greater than or equal to the
+** top of the stack. See the Eq opcode for additional information.
+*/
+case OP_Eq: /* same as TK_EQ, no-push */
+case OP_Ne: /* same as TK_NE, no-push */
+case OP_Lt: /* same as TK_LT, no-push */
+case OP_Le: /* same as TK_LE, no-push */
+case OP_Gt: /* same as TK_GT, no-push */
+case OP_Ge: { /* same as TK_GE, no-push */
+ Mem *pNos;
+ int flags;
+ int res;
+ char affinity;
+
+ pNos = &pTos[-1];
+ flags = pTos->flags|pNos->flags;
+
+ /* If either value is a NULL P2 is not zero, take the jump if the least
+ ** significant byte of P1 is true. If P2 is zero, then push a NULL onto
+ ** the stack.
+ */
+ if( flags&MEM_Null ){
+ if( (pOp->p1 & 0x200)!=0 ){
+ /* The 0x200 bit of P1 means, roughly "do not treat NULL as the
+ ** magic SQL value it normally is - treat it as if it were another
+ ** integer".
+ **
+ ** With 0x200 set, if either operand is NULL then both operands
+ ** are converted to integers prior to being passed down into the
+ ** normal comparison logic below. NULL operands are converted to
+ ** zero and non-NULL operands are converted to 1. Thus, for example,
+ ** with 0x200 set, NULL==NULL is true whereas it would normally
+ ** be NULL. Similarly, NULL!=123 is true.
+ */
+ sqlite3VdbeMemSetInt64(pTos, (pTos->flags & MEM_Null)==0);
+ sqlite3VdbeMemSetInt64(pNos, (pNos->flags & MEM_Null)==0);
+ }else{
+ /* If the 0x200 bit of P1 is clear and either operand is NULL then
+ ** the result is always NULL. The jump is taken if the 0x100 bit
+ ** of P1 is set.
+ */
+ popStack(&pTos, 2);
+ if( pOp->p2 ){
+ if( pOp->p1 & 0x100 ){
+ pc = pOp->p2-1;
+ }
+ }else{
+ pTos++;
+ pTos->flags = MEM_Null;
+ }
+ break;
+ }
+ }
+
+ affinity = pOp->p1 & 0xFF;
+ if( affinity ){
+ applyAffinity(pNos, affinity, db->enc);
+ applyAffinity(pTos, affinity, db->enc);
+ }
+
+ assert( pOp->p3type==P3_COLLSEQ || pOp->p3==0 );
+ res = sqlite3MemCompare(pNos, pTos, (CollSeq*)pOp->p3);
+ switch( pOp->opcode ){
+ case OP_Eq: res = res==0; break;
+ case OP_Ne: res = res!=0; break;
+ case OP_Lt: res = res<0; break;
+ case OP_Le: res = res<=0; break;
+ case OP_Gt: res = res>0; break;
+ default: res = res>=0; break;
+ }
+
+ popStack(&pTos, 2);
+ if( pOp->p2 ){
+ if( res ){
+ pc = pOp->p2-1;
+ }
+ }else{
+ pTos++;
+ pTos->flags = MEM_Int;
+ pTos->i = res;
+ }
+ break;
+}
+
+/* Opcode: And * * *
+**
+** Pop two values off the stack. Take the logical AND of the
+** two values and push the resulting boolean value back onto the
+** stack.
+*/
+/* Opcode: Or * * *
+**
+** Pop two values off the stack. Take the logical OR of the
+** two values and push the resulting boolean value back onto the
+** stack.
+*/
+case OP_And: /* same as TK_AND, no-push */
+case OP_Or: { /* same as TK_OR, no-push */
+ Mem *pNos = &pTos[-1];
+ int v1, v2; /* 0==TRUE, 1==FALSE, 2==UNKNOWN or NULL */
+
+ assert( pNos>=p->aStack );
+ if( pTos->flags & MEM_Null ){
+ v1 = 2;
+ }else{
+ Integerify(pTos);
+ v1 = pTos->i==0;
+ }
+ if( pNos->flags & MEM_Null ){
+ v2 = 2;
+ }else{
+ Integerify(pNos);
+ v2 = pNos->i==0;
+ }
+ if( pOp->opcode==OP_And ){
+ static const unsigned char and_logic[] = { 0, 1, 2, 1, 1, 1, 2, 1, 2 };
+ v1 = and_logic[v1*3+v2];
+ }else{
+ static const unsigned char or_logic[] = { 0, 0, 0, 0, 1, 2, 0, 2, 2 };
+ v1 = or_logic[v1*3+v2];
+ }
+ popStack(&pTos, 2);
+ pTos++;
+ if( v1==2 ){
+ pTos->flags = MEM_Null;
+ }else{
+ pTos->i = v1==0;
+ pTos->flags = MEM_Int;
+ }
+ break;
+}
+
+/* Opcode: Negative * * *
+**
+** Treat the top of the stack as a numeric quantity. Replace it
+** with its additive inverse. If the top of the stack is NULL
+** its value is unchanged.
+*/
+/* Opcode: AbsValue * * *
+**
+** Treat the top of the stack as a numeric quantity. Replace it
+** with its absolute value. If the top of the stack is NULL
+** its value is unchanged.
+*/
+case OP_Negative: /* same as TK_UMINUS, no-push */
+case OP_AbsValue: {
+ assert( pTos>=p->aStack );
+ if( pTos->flags & MEM_Real ){
+ Release(pTos);
+ if( pOp->opcode==OP_Negative || pTos->r<0.0 ){
+ pTos->r = -pTos->r;
+ }
+ pTos->flags = MEM_Real;
+ }else if( pTos->flags & MEM_Int ){
+ Release(pTos);
+ if( pOp->opcode==OP_Negative || pTos->i<0 ){
+ pTos->i = -pTos->i;
+ }
+ pTos->flags = MEM_Int;
+ }else if( pTos->flags & MEM_Null ){
+ /* Do nothing */
+ }else{
+ Realify(pTos);
+ if( pOp->opcode==OP_Negative || pTos->r<0.0 ){
+ pTos->r = -pTos->r;
+ }
+ pTos->flags = MEM_Real;
+ }
+ break;
+}
+
+/* Opcode: Not * * *
+**
+** Interpret the top of the stack as a boolean value. Replace it
+** with its complement. If the top of the stack is NULL its value
+** is unchanged.
+*/
+case OP_Not: { /* same as TK_NOT, no-push */
+ assert( pTos>=p->aStack );
+ if( pTos->flags & MEM_Null ) break; /* Do nothing to NULLs */
+ Integerify(pTos);
+ assert( (pTos->flags & MEM_Dyn)==0 );
+ pTos->i = !pTos->i;
+ pTos->flags = MEM_Int;
+ break;
+}
+
+/* Opcode: BitNot * * *
+**
+** Interpret the top of the stack as an value. Replace it
+** with its ones-complement. If the top of the stack is NULL its
+** value is unchanged.
+*/
+case OP_BitNot: { /* same as TK_BITNOT, no-push */
+ assert( pTos>=p->aStack );
+ if( pTos->flags & MEM_Null ) break; /* Do nothing to NULLs */
+ Integerify(pTos);
+ assert( (pTos->flags & MEM_Dyn)==0 );
+ pTos->i = ~pTos->i;
+ pTos->flags = MEM_Int;
+ break;
+}
+
+/* Opcode: Noop * * *
+**
+** Do nothing. This instruction is often useful as a jump
+** destination.
+*/
+/*
+** The magic Explain opcode are only inserted when explain==2 (which
+** is to say when the EXPLAIN QUERY PLAN syntax is used.)
+** This opcode records information from the optimizer. It is the
+** the same as a no-op. This opcodesnever appears in a real VM program.
+*/
+case OP_Explain:
+case OP_Noop: { /* no-push */
+ break;
+}
+
+/* Opcode: If P1 P2 *
+**
+** Pop a single boolean from the stack. If the boolean popped is
+** true, then jump to p2. Otherwise continue to the next instruction.
+** An integer is false if zero and true otherwise. A string is
+** false if it has zero length and true otherwise.
+**
+** If the value popped of the stack is NULL, then take the jump if P1
+** is true and fall through if P1 is false.
+*/
+/* Opcode: IfNot P1 P2 *
+**
+** Pop a single boolean from the stack. If the boolean popped is
+** false, then jump to p2. Otherwise continue to the next instruction.
+** An integer is false if zero and true otherwise. A string is
+** false if it has zero length and true otherwise.
+**
+** If the value popped of the stack is NULL, then take the jump if P1
+** is true and fall through if P1 is false.
+*/
+case OP_If: /* no-push */
+case OP_IfNot: { /* no-push */
+ int c;
+ assert( pTos>=p->aStack );
+ if( pTos->flags & MEM_Null ){
+ c = pOp->p1;
+ }else{
+#ifdef SQLITE_OMIT_FLOATING_POINT
+ c = sqlite3VdbeIntValue(pTos);
+#else
+ c = sqlite3VdbeRealValue(pTos)!=0.0;
+#endif
+ if( pOp->opcode==OP_IfNot ) c = !c;
+ }
+ Release(pTos);
+ pTos--;
+ if( c ) pc = pOp->p2-1;
+ break;
+}
+
+/* Opcode: IsNull P1 P2 *
+**
+** If any of the top abs(P1) values on the stack are NULL, then jump
+** to P2. Pop the stack P1 times if P1>0. If P1<0 leave the stack
+** unchanged.
+*/
+case OP_IsNull: { /* same as TK_ISNULL, no-push */
+ int i, cnt;
+ Mem *pTerm;
+ cnt = pOp->p1;
+ if( cnt<0 ) cnt = -cnt;
+ pTerm = &pTos[1-cnt];
+ assert( pTerm>=p->aStack );
+ for(i=0; i<cnt; i++, pTerm++){
+ if( pTerm->flags & MEM_Null ){
+ pc = pOp->p2-1;
+ break;
+ }
+ }
+ if( pOp->p1>0 ) popStack(&pTos, cnt);
+ break;
+}
+
+/* Opcode: NotNull P1 P2 *
+**
+** Jump to P2 if the top P1 values on the stack are all not NULL. Pop the
+** stack if P1 times if P1 is greater than zero. If P1 is less than
+** zero then leave the stack unchanged.
+*/
+case OP_NotNull: { /* same as TK_NOTNULL, no-push */
+ int i, cnt;
+ cnt = pOp->p1;
+ if( cnt<0 ) cnt = -cnt;
+ assert( &pTos[1-cnt] >= p->aStack );
+ for(i=0; i<cnt && (pTos[1+i-cnt].flags & MEM_Null)==0; i++){}
+ if( i>=cnt ) pc = pOp->p2-1;
+ if( pOp->p1>0 ) popStack(&pTos, cnt);
+ break;
+}
+
+/* Opcode: SetNumColumns P1 P2 *
+**
+** Before the OP_Column opcode can be executed on a cursor, this
+** opcode must be called to set the number of fields in the table.
+**
+** This opcode sets the number of columns for cursor P1 to P2.
+**
+** If OP_KeyAsData is to be applied to cursor P1, it must be executed
+** before this op-code.
+*/
+case OP_SetNumColumns: { /* no-push */
+ Cursor *pC;
+ assert( (pOp->p1)<p->nCursor );
+ assert( p->apCsr[pOp->p1]!=0 );
+ pC = p->apCsr[pOp->p1];
+ pC->nField = pOp->p2;
+ break;
+}
+
+/* Opcode: Column P1 P2 P3
+**
+** Interpret the data that cursor P1 points to as a structure built using
+** the MakeRecord instruction. (See the MakeRecord opcode for additional
+** information about the format of the data.) Push onto the stack the value
+** of the P2-th column contained in the data. If there are less that (P2+1)
+** values in the record, push a NULL onto the stack.
+**
+** If the KeyAsData opcode has previously executed on this cursor, then the
+** field might be extracted from the key rather than the data.
+**
+** If P1 is negative, then the record is stored on the stack rather than in
+** a table. For P1==-1, the top of the stack is used. For P1==-2, the
+** next on the stack is used. And so forth. The value pushed is always
+** just a pointer into the record which is stored further down on the
+** stack. The column value is not copied. The number of columns in the
+** record is stored on the stack just above the record itself.
+**
+** If the column contains fewer than P2 fields, then push a NULL. Or
+** if P3 is of type P3_MEM, then push the P3 value. The P3 value will
+** be default value for a column that has been added using the ALTER TABLE
+** ADD COLUMN command. If P3 is an ordinary string, just push a NULL.
+** When P3 is a string it is really just a comment describing the value
+** to be pushed, not a default value.
+*/
+case OP_Column: {
+ u32 payloadSize; /* Number of bytes in the record */
+ int p1 = pOp->p1; /* P1 value of the opcode */
+ int p2 = pOp->p2; /* column number to retrieve */
+ Cursor *pC = 0; /* The VDBE cursor */
+ char *zRec; /* Pointer to complete record-data */
+ BtCursor *pCrsr; /* The BTree cursor */
+ u32 *aType; /* aType[i] holds the numeric type of the i-th column */
+ u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */
+ u32 nField; /* number of fields in the record */
+ u32 szHdr; /* Number of bytes in the record header */
+ int len; /* The length of the serialized data for the column */
+ int offset = 0; /* Offset into the data */
+ int idx; /* Index into the header */
+ int i; /* Loop counter */
+ char *zData; /* Part of the record being decoded */
+ Mem sMem; /* For storing the record being decoded */
+
+ sMem.flags = 0;
+ assert( p1<p->nCursor );
+ pTos++;
+ pTos->flags = MEM_Null;
+
+ /* This block sets the variable payloadSize to be the total number of
+ ** bytes in the record.
+ **
+ ** zRec is set to be the complete text of the record if it is available.
+ ** The complete record text is always available for pseudo-tables and
+ ** when we are decoded a record from the stack. If the record is stored
+ ** in a cursor, the complete record text might be available in the
+ ** pC->aRow cache. Or it might not be. If the data is unavailable,
+ ** zRec is set to NULL.
+ **
+ ** We also compute the number of columns in the record. For cursors,
+ ** the number of columns is stored in the Cursor.nField element. For
+ ** records on the stack, the next entry down on the stack is an integer
+ ** which is the number of records.
+ */
+ assert( p1<0 || p->apCsr[p1]!=0 );
+ if( p1<0 ){
+ /* Take the record off of the stack */
+ Mem *pRec = &pTos[p1];
+ Mem *pCnt = &pRec[-1];
+ assert( pRec>=p->aStack );
+ assert( pRec->flags & MEM_Blob );
+ payloadSize = pRec->n;
+ zRec = pRec->z;
+ assert( pCnt>=p->aStack );
+ assert( pCnt->flags & MEM_Int );
+ nField = pCnt->i;
+ pCrsr = 0;
+ }else if( (pC = p->apCsr[p1])->pCursor!=0 ){
+ /* The record is stored in a B-Tree */
+ rc = sqlite3VdbeCursorMoveto(pC);
+ if( rc ) goto abort_due_to_error;
+ zRec = 0;
+ pCrsr = pC->pCursor;
+ if( pC->nullRow ){
+ payloadSize = 0;
+ }else if( pC->cacheValid ){
+ payloadSize = pC->payloadSize;
+ zRec = pC->aRow;
+ }else if( pC->isIndex ){
+ i64 payloadSize64;
+ sqlite3BtreeKeySize(pCrsr, &payloadSize64);
+ payloadSize = payloadSize64;
+ }else{
+ sqlite3BtreeDataSize(pCrsr, &payloadSize);
+ }
+ nField = pC->nField;
+#ifndef SQLITE_OMIT_TRIGGER
+ }else if( pC->pseudoTable ){
+ /* The record is the sole entry of a pseudo-table */
+ payloadSize = pC->nData;
+ zRec = pC->pData;
+ pC->cacheValid = 0;
+ assert( payloadSize==0 || zRec!=0 );
+ nField = pC->nField;
+ pCrsr = 0;
+#endif
+ }else{
+ zRec = 0;
+ payloadSize = 0;
+ pCrsr = 0;
+ nField = 0;
+ }
+
+ /* If payloadSize is 0, then just push a NULL onto the stack. */
+ if( payloadSize==0 ){
+ pTos->flags = MEM_Null;
+ break;
+ }
+
+ assert( p2<nField );
+
+ /* Read and parse the table header. Store the results of the parse
+ ** into the record header cache fields of the cursor.
+ */
+ if( pC && pC->cacheValid ){
+ aType = pC->aType;
+ aOffset = pC->aOffset;
+ }else{
+ int avail; /* Number of bytes of available data */
+ if( pC && pC->aType ){
+ aType = pC->aType;
+ }else{
+ aType = sqliteMallocRaw( 2*nField*sizeof(aType) );
+ }
+ aOffset = &aType[nField];
+ if( aType==0 ){
+ goto no_mem;
+ }
+
+ /* Figure out how many bytes are in the header */
+ if( zRec ){
+ zData = zRec;
+ }else{
+ if( pC->isIndex ){
+ zData = (char*)sqlite3BtreeKeyFetch(pCrsr, &avail);
+ }else{
+ zData = (char*)sqlite3BtreeDataFetch(pCrsr, &avail);
+ }
+ /* If KeyFetch()/DataFetch() managed to get the entire payload,
+ ** save the payload in the pC->aRow cache. That will save us from
+ ** having to make additional calls to fetch the content portion of
+ ** the record.
+ */
+ if( avail>=payloadSize ){
+ zRec = pC->aRow = zData;
+ }else{
+ pC->aRow = 0;
+ }
+ }
+ idx = sqlite3GetVarint32(zData, &szHdr);
+
+
+ /* The KeyFetch() or DataFetch() above are fast and will get the entire
+ ** record header in most cases. But they will fail to get the complete
+ ** record header if the record header does not fit on a single page
+ ** in the B-Tree. When that happens, use sqlite3VdbeMemFromBtree() to
+ ** acquire the complete header text.
+ */
+ if( !zRec && avail<szHdr ){
+ rc = sqlite3VdbeMemFromBtree(pCrsr, 0, szHdr, pC->isIndex, &sMem);
+ if( rc!=SQLITE_OK ){
+ goto op_column_out;
+ }
+ zData = sMem.z;
+ }
+
+ /* Scan the header and use it to fill in the aType[] and aOffset[]
+ ** arrays. aType[i] will contain the type integer for the i-th
+ ** column and aOffset[i] will contain the offset from the beginning
+ ** of the record to the start of the data for the i-th column
+ */
+ offset = szHdr;
+ assert( offset>0 );
+ i = 0;
+ while( idx<szHdr && i<nField && offset<=payloadSize ){
+ aOffset[i] = offset;
+ idx += sqlite3GetVarint32(&zData[idx], &aType[i]);
+ offset += sqlite3VdbeSerialTypeLen(aType[i]);
+ i++;
+ }
+ Release(&sMem);
+ sMem.flags = MEM_Null;
+
+ /* If i is less that nField, then there are less fields in this
+ ** record than SetNumColumns indicated there are columns in the
+ ** table. Set the offset for any extra columns not present in
+ ** the record to 0. This tells code below to push a NULL onto the
+ ** stack instead of deserializing a value from the record.
+ */
+ while( i<nField ){
+ aOffset[i++] = 0;
+ }
+
+ /* The header should end at the start of data and the data should
+ ** end at last byte of the record. If this is not the case then
+ ** we are dealing with a malformed record.
+ */
+ if( idx!=szHdr || offset!=payloadSize ){
+ rc = SQLITE_CORRUPT_BKPT;
+ goto op_column_out;
+ }
+
+ /* Remember all aType and aColumn information if we have a cursor
+ ** to remember it in. */
+ if( pC ){
+ pC->payloadSize = payloadSize;
+ pC->aType = aType;
+ pC->aOffset = aOffset;
+ pC->cacheValid = 1;
+ }
+ }
+
+ /* Get the column information. If aOffset[p2] is non-zero, then
+ ** deserialize the value from the record. If aOffset[p2] is zero,
+ ** then there are not enough fields in the record to satisfy the
+ ** request. In this case, set the value NULL or to P3 if P3 is
+ ** a pointer to a Mem object.
+ */
+ if( aOffset[p2] ){
+ assert( rc==SQLITE_OK );
+ if( zRec ){
+ zData = &zRec[aOffset[p2]];
+ }else{
+ len = sqlite3VdbeSerialTypeLen(aType[p2]);
+ rc = sqlite3VdbeMemFromBtree(pCrsr, aOffset[p2], len, pC->isIndex,&sMem);
+ if( rc!=SQLITE_OK ){
+ goto op_column_out;
+ }
+ zData = sMem.z;
+ }
+ sqlite3VdbeSerialGet(zData, aType[p2], pTos);
+ pTos->enc = db->enc;
+ }else{
+ if( pOp->p3type==P3_MEM ){
+ sqlite3VdbeMemShallowCopy(pTos, (Mem *)(pOp->p3), MEM_Static);
+ }else{
+ pTos->flags = MEM_Null;
+ }
+ }
+
+ /* If we dynamically allocated space to hold the data (in the
+ ** sqlite3VdbeMemFromBtree() call above) then transfer control of that
+ ** dynamically allocated space over to the pTos structure rather.
+ ** This prevents a memory copy.
+ */
+ if( (sMem.flags & MEM_Dyn)!=0 ){
+ assert( pTos->flags & MEM_Ephem );
+ assert( pTos->flags & (MEM_Str|MEM_Blob) );
+ assert( pTos->z==sMem.z );
+ assert( sMem.flags & MEM_Term );
+ pTos->flags &= ~MEM_Ephem;
+ pTos->flags |= MEM_Dyn|MEM_Term;
+ }
+
+ /* pTos->z might be pointing to sMem.zShort[]. Fix that so that we
+ ** can abandon sMem */
+ rc = sqlite3VdbeMemMakeWriteable(pTos);
+
+op_column_out:
+ /* Release the aType[] memory if we are not dealing with cursor */
+ if( !pC || !pC->aType ){
+ sqliteFree(aType);
+ }
+ break;
+}
+
+/* Opcode: MakeRecord P1 P2 P3
+**
+** Convert the top abs(P1) entries of the stack into a single entry
+** suitable for use as a data record in a database table or as a key
+** in an index. The details of the format are irrelavant as long as
+** the OP_Column opcode can decode the record later and as long as the
+** sqlite3VdbeRecordCompare function will correctly compare two encoded
+** records. Refer to source code comments for the details of the record
+** format.
+**
+** The original stack entries are popped from the stack if P1>0 but
+** remain on the stack if P1<0.
+**
+** If P2 is not zero and one or more of the entries are NULL, then jump
+** to the address given by P2. This feature can be used to skip a
+** uniqueness test on indices.
+**
+** P3 may be a string that is P1 characters long. The nth character of the
+** string indicates the column affinity that should be used for the nth
+** field of the index key (i.e. the first character of P3 corresponds to the
+** lowest element on the stack).
+**
+** The mapping from character to affinity is as follows:
+** 'n' = NUMERIC.
+** 'i' = INTEGER.
+** 't' = TEXT.
+** 'o' = NONE.
+**
+** If P3 is NULL then all index fields have the affinity NONE.
+**
+** See also OP_MakeIdxRec
+*/
+/* Opcode: MakeRecordI P1 P2 P3
+**
+** This opcode works just OP_MakeRecord except that it reads an extra
+** integer from the stack (thus reading a total of abs(P1+1) entries)
+** and appends that extra integer to the end of the record as a varint.
+** This results in an index key.
+*/
+case OP_MakeIdxRec:
+case OP_MakeRecord: {
+ /* Assuming the record contains N fields, the record format looks
+ ** like this:
+ **
+ ** ------------------------------------------------------------------------
+ ** | hdr-size | type 0 | type 1 | ... | type N-1 | data0 | ... | data N-1 |
+ ** ------------------------------------------------------------------------
+ **
+ ** Data(0) is taken from the lowest element of the stack and data(N-1) is
+ ** the top of the stack.
+ **
+ ** Each type field is a varint representing the serial type of the
+ ** corresponding data element (see sqlite3VdbeSerialType()). The
+ ** hdr-size field is also a varint which is the offset from the beginning
+ ** of the record to data0.
+ */
+ unsigned char *zNewRecord;
+ unsigned char *zCsr;
+ Mem *pRec;
+ Mem *pRowid = 0;
+ int nData = 0; /* Number of bytes of data space */
+ int nHdr = 0; /* Number of bytes of header space */
+ int nByte = 0; /* Space required for this record */
+ int nVarint; /* Number of bytes in a varint */
+ u32 serial_type; /* Type field */
+ int containsNull = 0; /* True if any of the data fields are NULL */
+ char zTemp[NBFS]; /* Space to hold small records */
+ Mem *pData0;
+
+ int leaveOnStack; /* If true, leave the entries on the stack */
+ int nField; /* Number of fields in the record */
+ int jumpIfNull; /* Jump here if non-zero and any entries are NULL. */
+ int addRowid; /* True to append a rowid column at the end */
+ char *zAffinity; /* The affinity string for the record */
+
+ leaveOnStack = ((pOp->p1<0)?1:0);
+ nField = pOp->p1 * (leaveOnStack?-1:1);
+ jumpIfNull = pOp->p2;
+ addRowid = pOp->opcode==OP_MakeIdxRec;
+ zAffinity = pOp->p3;
+
+ pData0 = &pTos[1-nField];
+ assert( pData0>=p->aStack );
+ containsNull = 0;
+
+ /* Loop through the elements that will make up the record to figure
+ ** out how much space is required for the new record.
+ */
+ for(pRec=pData0; pRec<=pTos; pRec++){
+ if( zAffinity ){
+ applyAffinity(pRec, zAffinity[pRec-pData0], db->enc);
+ }
+ if( pRec->flags&MEM_Null ){
+ containsNull = 1;
+ }
+ serial_type = sqlite3VdbeSerialType(pRec);
+ nData += sqlite3VdbeSerialTypeLen(serial_type);
+ nHdr += sqlite3VarintLen(serial_type);
+ }
+
+ /* If we have to append a varint rowid to this record, set 'rowid'
+ ** to the value of the rowid and increase nByte by the amount of space
+ ** required to store it and the 0x00 seperator byte.
+ */
+ if( addRowid ){
+ pRowid = &pTos[0-nField];
+ assert( pRowid>=p->aStack );
+ Integerify(pRowid);
+ serial_type = sqlite3VdbeSerialType(pRowid);
+ nData += sqlite3VdbeSerialTypeLen(serial_type);
+ nHdr += sqlite3VarintLen(serial_type);
+ }
+
+ /* Add the initial header varint and total the size */
+ nHdr += nVarint = sqlite3VarintLen(nHdr);
+ if( nVarint<sqlite3VarintLen(nHdr) ){
+ nHdr++;
+ }
+ nByte = nHdr+nData;
+
+ /* Allocate space for the new record. */
+ if( nByte>sizeof(zTemp) ){
+ zNewRecord = sqliteMallocRaw(nByte);
+ if( !zNewRecord ){
+ goto no_mem;
+ }
+ }else{
+ zNewRecord = zTemp;
+ }
+
+ /* Write the record */
+ zCsr = zNewRecord;
+ zCsr += sqlite3PutVarint(zCsr, nHdr);
+ for(pRec=pData0; pRec<=pTos; pRec++){
+ serial_type = sqlite3VdbeSerialType(pRec);
+ zCsr += sqlite3PutVarint(zCsr, serial_type); /* serial type */
+ }
+ if( addRowid ){
+ zCsr += sqlite3PutVarint(zCsr, sqlite3VdbeSerialType(pRowid));
+ }
+ for(pRec=pData0; pRec<=pTos; pRec++){
+ zCsr += sqlite3VdbeSerialPut(zCsr, pRec); /* serial data */
+ }
+ if( addRowid ){
+ zCsr += sqlite3VdbeSerialPut(zCsr, pRowid);
+ }
+ assert( zCsr==(zNewRecord+nByte) );
+
+ /* Pop entries off the stack if required. Push the new record on. */
+ if( !leaveOnStack ){
+ popStack(&pTos, nField+addRowid);
+ }
+ pTos++;
+ pTos->n = nByte;
+ if( nByte<=sizeof(zTemp) ){
+ assert( zNewRecord==(unsigned char *)zTemp );
+ pTos->z = pTos->zShort;
+ memcpy(pTos->zShort, zTemp, nByte);
+ pTos->flags = MEM_Blob | MEM_Short;
+ }else{
+ assert( zNewRecord!=(unsigned char *)zTemp );
+ pTos->z = zNewRecord;
+ pTos->flags = MEM_Blob | MEM_Dyn;
+ pTos->xDel = 0;
+ }
+ pTos->enc = SQLITE_UTF8; /* In case the blob is ever converted to text */
+
+ /* If a NULL was encountered and jumpIfNull is non-zero, take the jump. */
+ if( jumpIfNull && containsNull ){
+ pc = jumpIfNull - 1;
+ }
+ break;
+}
+
+/* Opcode: Statement P1 * *
+**
+** Begin an individual statement transaction which is part of a larger
+** BEGIN..COMMIT transaction. This is needed so that the statement
+** can be rolled back after an error without having to roll back the
+** entire transaction. The statement transaction will automatically
+** commit when the VDBE halts.
+**
+** The statement is begun on the database file with index P1. The main
+** database file has an index of 0 and the file used for temporary tables
+** has an index of 1.
+*/
+case OP_Statement: { /* no-push */
+ int i = pOp->p1;
+ Btree *pBt;
+ if( i>=0 && i<db->nDb && (pBt = db->aDb[i].pBt) && !(db->autoCommit) ){
+ assert( sqlite3BtreeIsInTrans(pBt) );
+ if( !sqlite3BtreeIsInStmt(pBt) ){
+ rc = sqlite3BtreeBeginStmt(pBt);
+ }
+ }
+ break;
+}
+
+/* Opcode: AutoCommit P1 P2 *
+**
+** Set the database auto-commit flag to P1 (1 or 0). If P2 is true, roll
+** back any currently active btree transactions. If there are any active
+** VMs (apart from this one), then the COMMIT or ROLLBACK statement fails.
+**
+** This instruction causes the VM to halt.
+*/
+case OP_AutoCommit: { /* no-push */
+ u8 i = pOp->p1;
+ u8 rollback = pOp->p2;
+
+ assert( i==1 || i==0 );
+ assert( i==1 || rollback==0 );
+
+ assert( db->activeVdbeCnt>0 ); /* At least this one VM is active */
+
+ if( db->activeVdbeCnt>1 && i && !db->autoCommit ){
+ /* If this instruction implements a COMMIT or ROLLBACK, other VMs are
+ ** still running, and a transaction is active, return an error indicating
+ ** that the other VMs must complete first.
+ */
+ sqlite3SetString(&p->zErrMsg, "cannot ", rollback?"rollback":"commit",
+ " transaction - SQL statements in progress", 0);
+ rc = SQLITE_ERROR;
+ }else if( i!=db->autoCommit ){
+ db->autoCommit = i;
+ if( pOp->p2 ){
+ assert( i==1 );
+ sqlite3RollbackAll(db);
+ }else if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){
+ p->pTos = pTos;
+ p->pc = pc;
+ db->autoCommit = 1-i;
+ p->rc = SQLITE_BUSY;
+ return SQLITE_BUSY;
+ }
+ return SQLITE_DONE;
+ }else{
+ sqlite3SetString(&p->zErrMsg,
+ (!i)?"cannot start a transaction within a transaction":(
+ (rollback)?"cannot rollback - no transaction is active":
+ "cannot commit - no transaction is active"), 0);
+
+ rc = SQLITE_ERROR;
+ }
+ break;
+}
+
+/* Opcode: Transaction P1 P2 *
+**
+** Begin a transaction. The transaction ends when a Commit or Rollback
+** opcode is encountered. Depending on the ON CONFLICT setting, the
+** transaction might also be rolled back if an error is encountered.
+**
+** P1 is the index of the database file on which the transaction is
+** started. Index 0 is the main database file and index 1 is the
+** file used for temporary tables.
+**
+** If P2 is non-zero, then a write-transaction is started. A RESERVED lock is
+** obtained on the database file when a write-transaction is started. No
+** other process can start another write transaction while this transaction is
+** underway. Starting a write transaction also creates a rollback journal. A
+** write transaction must be started before any changes can be made to the
+** database. If P2 is 2 or greater then an EXCLUSIVE lock is also obtained
+** on the file.
+**
+** If P2 is zero, then a read-lock is obtained on the database file.
+*/
+case OP_Transaction: { /* no-push */
+ int i = pOp->p1;
+ Btree *pBt;
+
+ assert( i>=0 && i<db->nDb );
+ pBt = db->aDb[i].pBt;
+
+ if( pBt ){
+ rc = sqlite3BtreeBeginTrans(pBt, pOp->p2);
+ if( rc==SQLITE_BUSY ){
+ p->pc = pc;
+ p->rc = SQLITE_BUSY;
+ p->pTos = pTos;
+ return SQLITE_BUSY;
+ }
+ if( rc!=SQLITE_OK && rc!=SQLITE_READONLY /* && rc!=SQLITE_BUSY */ ){
+ goto abort_due_to_error;
+ }
+ }
+ break;
+}
+
+/* Opcode: ReadCookie P1 P2 *
+**
+** Read cookie number P2 from database P1 and push it onto the stack.
+** P2==0 is the schema version. P2==1 is the database format.
+** P2==2 is the recommended pager cache size, and so forth. P1==0 is
+** the main database file and P1==1 is the database file used to store
+** temporary tables.
+**
+** There must be a read-lock on the database (either a transaction
+** must be started or there must be an open cursor) before
+** executing this instruction.
+*/
+case OP_ReadCookie: {
+ int iMeta;
+ assert( pOp->p2<SQLITE_N_BTREE_META );
+ assert( pOp->p1>=0 && pOp->p1<db->nDb );
+ assert( db->aDb[pOp->p1].pBt!=0 );
+ /* The indexing of meta values at the schema layer is off by one from
+ ** the indexing in the btree layer. The btree considers meta[0] to
+ ** be the number of free pages in the database (a read-only value)
+ ** and meta[1] to be the schema cookie. The schema layer considers
+ ** meta[1] to be the schema cookie. So we have to shift the index
+ ** by one in the following statement.
+ */
+ rc = sqlite3BtreeGetMeta(db->aDb[pOp->p1].pBt, 1 + pOp->p2, (u32 *)&iMeta);
+ pTos++;
+ pTos->i = iMeta;
+ pTos->flags = MEM_Int;
+ break;
+}
+
+/* Opcode: SetCookie P1 P2 *
+**
+** Write the top of the stack into cookie number P2 of database P1.
+** P2==0 is the schema version. P2==1 is the database format.
+** P2==2 is the recommended pager cache size, and so forth. P1==0 is
+** the main database file and P1==1 is the database file used to store
+** temporary tables.
+**
+** A transaction must be started before executing this opcode.
+*/
+case OP_SetCookie: { /* no-push */
+ Db *pDb;
+ assert( pOp->p2<SQLITE_N_BTREE_META );
+ assert( pOp->p1>=0 && pOp->p1<db->nDb );
+ pDb = &db->aDb[pOp->p1];
+ assert( pDb->pBt!=0 );
+ assert( pTos>=p->aStack );
+ Integerify(pTos);
+ /* See note about index shifting on OP_ReadCookie */
+ rc = sqlite3BtreeUpdateMeta(pDb->pBt, 1+pOp->p2, (int)pTos->i);
+ if( pOp->p2==0 ){
+ /* When the schema cookie changes, record the new cookie internally */
+ pDb->schema_cookie = pTos->i;
+ db->flags |= SQLITE_InternChanges;
+ }
+ assert( (pTos->flags & MEM_Dyn)==0 );
+ pTos--;
+ break;
+}
+
+/* Opcode: VerifyCookie P1 P2 *
+**
+** Check the value of global database parameter number 0 (the
+** schema version) and make sure it is equal to P2.
+** P1 is the database number which is 0 for the main database file
+** and 1 for the file holding temporary tables and some higher number
+** for auxiliary databases.
+**
+** The cookie changes its value whenever the database schema changes.
+** This operation is used to detect when that the cookie has changed
+** and that the current process needs to reread the schema.
+**
+** Either a transaction needs to have been started or an OP_Open needs
+** to be executed (to establish a read lock) before this opcode is
+** invoked.
+*/
+case OP_VerifyCookie: { /* no-push */
+ int iMeta;
+ Btree *pBt;
+ assert( pOp->p1>=0 && pOp->p1<db->nDb );
+ pBt = db->aDb[pOp->p1].pBt;
+ if( pBt ){
+ rc = sqlite3BtreeGetMeta(pBt, 1, (u32 *)&iMeta);
+ }else{
+ rc = SQLITE_OK;
+ iMeta = 0;
+ }
+ if( rc==SQLITE_OK && iMeta!=pOp->p2 ){
+ sqlite3SetString(&p->zErrMsg, "database schema has changed", (char*)0);
+ rc = SQLITE_SCHEMA;
+ }
+ break;
+}
+
+/* Opcode: OpenRead P1 P2 P3
+**
+** Open a read-only cursor for the database table whose root page is
+** P2 in a database file. The database file is determined by an
+** integer from the top of the stack. 0 means the main database and
+** 1 means the database used for temporary tables. Give the new
+** cursor an identifier of P1. The P1 values need not be contiguous
+** but all P1 values should be small integers. It is an error for
+** P1 to be negative.
+**
+** If P2==0 then take the root page number from the next of the stack.
+**
+** There will be a read lock on the database whenever there is an
+** open cursor. If the database was unlocked prior to this instruction
+** then a read lock is acquired as part of this instruction. A read
+** lock allows other processes to read the database but prohibits
+** any other process from modifying the database. The read lock is
+** released when all cursors are closed. If this instruction attempts
+** to get a read lock but fails, the script terminates with an
+** SQLITE_BUSY error code.
+**
+** The P3 value is a pointer to a KeyInfo structure that defines the
+** content and collating sequence of indices. P3 is NULL for cursors
+** that are not pointing to indices.
+**
+** See also OpenWrite.
+*/
+/* Opcode: OpenWrite P1 P2 P3
+**
+** Open a read/write cursor named P1 on the table or index whose root
+** page is P2. If P2==0 then take the root page number from the stack.
+**
+** The P3 value is a pointer to a KeyInfo structure that defines the
+** content and collating sequence of indices. P3 is NULL for cursors
+** that are not pointing to indices.
+**
+** This instruction works just like OpenRead except that it opens the cursor
+** in read/write mode. For a given table, there can be one or more read-only
+** cursors or a single read/write cursor but not both.
+**
+** See also OpenRead.
+*/
+case OP_OpenRead: /* no-push */
+case OP_OpenWrite: { /* no-push */
+ int i = pOp->p1;
+ int p2 = pOp->p2;
+ int wrFlag;
+ Btree *pX;
+ int iDb;
+ Cursor *pCur;
+
+ assert( pTos>=p->aStack );
+ Integerify(pTos);
+ iDb = pTos->i;
+ assert( (pTos->flags & MEM_Dyn)==0 );
+ pTos--;
+ assert( iDb>=0 && iDb<db->nDb );
+ pX = db->aDb[iDb].pBt;
+ assert( pX!=0 );
+ wrFlag = pOp->opcode==OP_OpenWrite;
+ if( p2<=0 ){
+ assert( pTos>=p->aStack );
+ Integerify(pTos);
+ p2 = pTos->i;
+ assert( (pTos->flags & MEM_Dyn)==0 );
+ pTos--;
+ assert( p2>=2 );
+ }
+ assert( i>=0 );
+ pCur = allocateCursor(p, i);
+ if( pCur==0 ) goto no_mem;
+ pCur->nullRow = 1;
+ if( pX==0 ) break;
+ /* We always provide a key comparison function. If the table being
+ ** opened is of type INTKEY, the comparision function will be ignored. */
+ rc = sqlite3BtreeCursor(pX, p2, wrFlag,
+ sqlite3VdbeRecordCompare, pOp->p3,
+ &pCur->pCursor);
+ if( pOp->p3type==P3_KEYINFO ){
+ pCur->pKeyInfo = (KeyInfo*)pOp->p3;
+ pCur->pIncrKey = &pCur->pKeyInfo->incrKey;
+ pCur->pKeyInfo->enc = p->db->enc;
+ }else{
+ pCur->pKeyInfo = 0;
+ pCur->pIncrKey = &pCur->bogusIncrKey;
+ }
+ switch( rc ){
+ case SQLITE_BUSY: {
+ p->pc = pc;
+ p->rc = SQLITE_BUSY;
+ p->pTos = &pTos[1 + (pOp->p2<=0)]; /* Operands must remain on stack */
+ return SQLITE_BUSY;
+ }
+ case SQLITE_OK: {
+ int flags = sqlite3BtreeFlags(pCur->pCursor);
+ /* Sanity checking. Only the lower four bits of the flags byte should
+ ** be used. Bit 3 (mask 0x08) is unpreditable. The lower 3 bits
+ ** (mask 0x07) should be either 5 (intkey+leafdata for tables) or
+ ** 2 (zerodata for indices). If these conditions are not met it can
+ ** only mean that we are dealing with a corrupt database file
+ */
+ if( (flags & 0xf0)!=0 || ((flags & 0x07)!=5 && (flags & 0x07)!=2) ){
+ rc = SQLITE_CORRUPT_BKPT;
+ goto abort_due_to_error;
+ }
+ pCur->isTable = (flags & BTREE_INTKEY)!=0;
+ pCur->isIndex = (flags & BTREE_ZERODATA)!=0;
+ /* If P3==0 it means we are expected to open a table. If P3!=0 then
+ ** we expect to be opening an index. If this is not what happened,
+ ** then the database is corrupt
+ */
+ if( (pCur->isTable && pOp->p3type==P3_KEYINFO)
+ || (pCur->isIndex && pOp->p3type!=P3_KEYINFO) ){
+ rc = SQLITE_CORRUPT_BKPT;
+ goto abort_due_to_error;
+ }
+ break;
+ }
+ case SQLITE_EMPTY: {
+ pCur->isTable = pOp->p3type!=P3_KEYINFO;
+ pCur->isIndex = !pCur->isTable;
+ rc = SQLITE_OK;
+ break;
+ }
+ default: {
+ goto abort_due_to_error;
+ }
+ }
+ break;
+}
+
+/* Opcode: OpenVirtual P1 P2 P3
+**
+** Open a new cursor P1 to a transient or virtual table.
+** The cursor is always opened read/write even if
+** the main database is read-only. The transient or virtual
+** table is deleted automatically when the cursor is closed.
+**
+** P2 is the number of columns in the virtual table.
+** The cursor points to a BTree table if P3==0 and to a BTree index
+** if P3 is not 0. If P3 is not NULL, it points to a KeyInfo structure
+** that defines the format of keys in the index.
+*/
+case OP_OpenVirtual: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pCx;
+ assert( i>=0 );
+ pCx = allocateCursor(p, i);
+ if( pCx==0 ) goto no_mem;
+ pCx->nullRow = 1;
+ rc = sqlite3BtreeFactory(db, 0, 1, TEMP_PAGES, &pCx->pBt);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3BtreeBeginTrans(pCx->pBt, 1);
+ }
+ if( rc==SQLITE_OK ){
+ /* If a transient index is required, create it by calling
+ ** sqlite3BtreeCreateTable() with the BTREE_ZERODATA flag before
+ ** opening it. If a transient table is required, just use the
+ ** automatically created table with root-page 1 (an INTKEY table).
+ */
+ if( pOp->p3 ){
+ int pgno;
+ assert( pOp->p3type==P3_KEYINFO );
+ rc = sqlite3BtreeCreateTable(pCx->pBt, &pgno, BTREE_ZERODATA);
+ if( rc==SQLITE_OK ){
+ assert( pgno==MASTER_ROOT+1 );
+ rc = sqlite3BtreeCursor(pCx->pBt, pgno, 1, sqlite3VdbeRecordCompare,
+ pOp->p3, &pCx->pCursor);
+ pCx->pKeyInfo = (KeyInfo*)pOp->p3;
+ pCx->pKeyInfo->enc = p->db->enc;
+ pCx->pIncrKey = &pCx->pKeyInfo->incrKey;
+ }
+ pCx->isTable = 0;
+ }else{
+ rc = sqlite3BtreeCursor(pCx->pBt, MASTER_ROOT, 1, 0, 0, &pCx->pCursor);
+ pCx->isTable = 1;
+ pCx->pIncrKey = &pCx->bogusIncrKey;
+ }
+ }
+ pCx->nField = pOp->p2;
+ pCx->isIndex = !pCx->isTable;
+ break;
+}
+
+#ifndef SQLITE_OMIT_TRIGGER
+/* Opcode: OpenPseudo P1 * *
+**
+** Open a new cursor that points to a fake table that contains a single
+** row of data. Any attempt to write a second row of data causes the
+** first row to be deleted. All data is deleted when the cursor is
+** closed.
+**
+** A pseudo-table created by this opcode is useful for holding the
+** NEW or OLD tables in a trigger.
+*/
+case OP_OpenPseudo: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pCx;
+ assert( i>=0 );
+ pCx = allocateCursor(p, i);
+ if( pCx==0 ) goto no_mem;
+ pCx->nullRow = 1;
+ pCx->pseudoTable = 1;
+ pCx->pIncrKey = &pCx->bogusIncrKey;
+ pCx->isTable = 1;
+ pCx->isIndex = 0;
+ break;
+}
+#endif
+
+/* Opcode: Close P1 * *
+**
+** Close a cursor previously opened as P1. If P1 is not
+** currently open, this instruction is a no-op.
+*/
+case OP_Close: { /* no-push */
+ int i = pOp->p1;
+ if( i>=0 && i<p->nCursor ){
+ sqlite3VdbeFreeCursor(p->apCsr[i]);
+ p->apCsr[i] = 0;
+ }
+ break;
+}
+
+/* Opcode: MoveGe P1 P2 *
+**
+** Pop the top of the stack and use its value as a key. Reposition
+** cursor P1 so that it points to the smallest entry that is greater
+** than or equal to the key that was popped ffrom the stack.
+** If there are no records greater than or equal to the key and P2
+** is not zero, then jump to P2.
+**
+** See also: Found, NotFound, Distinct, MoveLt, MoveGt, MoveLe
+*/
+/* Opcode: MoveGt P1 P2 *
+**
+** Pop the top of the stack and use its value as a key. Reposition
+** cursor P1 so that it points to the smallest entry that is greater
+** than the key from the stack.
+** If there are no records greater than the key and P2 is not zero,
+** then jump to P2.
+**
+** See also: Found, NotFound, Distinct, MoveLt, MoveGe, MoveLe
+*/
+/* Opcode: MoveLt P1 P2 *
+**
+** Pop the top of the stack and use its value as a key. Reposition
+** cursor P1 so that it points to the largest entry that is less
+** than the key from the stack.
+** If there are no records less than the key and P2 is not zero,
+** then jump to P2.
+**
+** See also: Found, NotFound, Distinct, MoveGt, MoveGe, MoveLe
+*/
+/* Opcode: MoveLe P1 P2 *
+**
+** Pop the top of the stack and use its value as a key. Reposition
+** cursor P1 so that it points to the largest entry that is less than
+** or equal to the key that was popped from the stack.
+** If there are no records less than or eqal to the key and P2 is not zero,
+** then jump to P2.
+**
+** See also: Found, NotFound, Distinct, MoveGt, MoveGe, MoveLt
+*/
+case OP_MoveLt: /* no-push */
+case OP_MoveLe: /* no-push */
+case OP_MoveGe: /* no-push */
+case OP_MoveGt: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pC;
+
+ assert( pTos>=p->aStack );
+ assert( i>=0 && i<p->nCursor );
+ pC = p->apCsr[i];
+ assert( pC!=0 );
+ if( pC->pCursor!=0 ){
+ int res, oc;
+ oc = pOp->opcode;
+ pC->nullRow = 0;
+ *pC->pIncrKey = oc==OP_MoveGt || oc==OP_MoveLe;
+ if( pC->isTable ){
+ i64 iKey;
+ Integerify(pTos);
+ iKey = intToKey(pTos->i);
+ if( pOp->p2==0 && pOp->opcode==OP_MoveGe ){
+ pC->movetoTarget = iKey;
+ pC->deferredMoveto = 1;
+ assert( (pTos->flags & MEM_Dyn)==0 );
+ pTos--;
+ break;
+ }
+ rc = sqlite3BtreeMoveto(pC->pCursor, 0, (u64)iKey, &res);
+ if( rc!=SQLITE_OK ){
+ goto abort_due_to_error;
+ }
+ pC->lastRowid = pTos->i;
+ pC->rowidIsValid = res==0;
+ }else{
+ Stringify(pTos, db->enc);
+ rc = sqlite3BtreeMoveto(pC->pCursor, pTos->z, pTos->n, &res);
+ if( rc!=SQLITE_OK ){
+ goto abort_due_to_error;
+ }
+ pC->rowidIsValid = 0;
+ }
+ pC->deferredMoveto = 0;
+ pC->cacheValid = 0;
+ *pC->pIncrKey = 0;
+ sqlite3_search_count++;
+ if( oc==OP_MoveGe || oc==OP_MoveGt ){
+ if( res<0 ){
+ rc = sqlite3BtreeNext(pC->pCursor, &res);
+ if( rc!=SQLITE_OK ) goto abort_due_to_error;
+ pC->rowidIsValid = 0;
+ }else{
+ res = 0;
+ }
+ }else{
+ assert( oc==OP_MoveLt || oc==OP_MoveLe );
+ if( res>=0 ){
+ rc = sqlite3BtreePrevious(pC->pCursor, &res);
+ if( rc!=SQLITE_OK ) goto abort_due_to_error;
+ pC->rowidIsValid = 0;
+ }else{
+ /* res might be negative because the table is empty. Check to
+ ** see if this is the case.
+ */
+ res = sqlite3BtreeEof(pC->pCursor);
+ }
+ }
+ if( res ){
+ if( pOp->p2>0 ){
+ pc = pOp->p2 - 1;
+ }else{
+ pC->nullRow = 1;
+ }
+ }
+ }
+ Release(pTos);
+ pTos--;
+ break;
+}
+
+/* Opcode: Distinct P1 P2 *
+**
+** Use the top of the stack as a record created using MakeRecord. P1 is a
+** cursor on a table that declared as an index. If that table contains an
+** entry that matches the top of the stack fall thru. If the top of the stack
+** matches no entry in P1 then jump to P2.
+**
+** The cursor is left pointing at the matching entry if it exists. The
+** record on the top of the stack is not popped.
+**
+** This instruction is similar to NotFound except that this operation
+** does not pop the key from the stack.
+**
+** The instruction is used to implement the DISTINCT operator on SELECT
+** statements. The P1 table is not a true index but rather a record of
+** all results that have produced so far.
+**
+** See also: Found, NotFound, MoveTo, IsUnique, NotExists
+*/
+/* Opcode: Found P1 P2 *
+**
+** Top of the stack holds a blob constructed by MakeRecord. P1 is an index.
+** If an entry that matches the top of the stack exists in P1 then
+** jump to P2. If the top of the stack does not match any entry in P1
+** then fall thru. The P1 cursor is left pointing at the matching entry
+** if it exists. The blob is popped off the top of the stack.
+**
+** This instruction is used to implement the IN operator where the
+** left-hand side is a SELECT statement. P1 is not a true index but
+** is instead a temporary index that holds the results of the SELECT
+** statement. This instruction just checks to see if the left-hand side
+** of the IN operator (stored on the top of the stack) exists in the
+** result of the SELECT statement.
+**
+** See also: Distinct, NotFound, MoveTo, IsUnique, NotExists
+*/
+/* Opcode: NotFound P1 P2 *
+**
+** The top of the stack holds a blob constructed by MakeRecord. P1 is
+** an index. If no entry exists in P1 that matches the blob then jump
+** to P1. If an entry does existing, fall through. The cursor is left
+** pointing to the entry that matches. The blob is popped from the stack.
+**
+** The difference between this operation and Distinct is that
+** Distinct does not pop the key from the stack.
+**
+** See also: Distinct, Found, MoveTo, NotExists, IsUnique
+*/
+case OP_Distinct: /* no-push */
+case OP_NotFound: /* no-push */
+case OP_Found: { /* no-push */
+ int i = pOp->p1;
+ int alreadyExists = 0;
+ Cursor *pC;
+ assert( pTos>=p->aStack );
+ assert( i>=0 && i<p->nCursor );
+ assert( p->apCsr[i]!=0 );
+ if( (pC = p->apCsr[i])->pCursor!=0 ){
+ int res, rx;
+ assert( pC->isTable==0 );
+ Stringify(pTos, db->enc);
+ rx = sqlite3BtreeMoveto(pC->pCursor, pTos->z, pTos->n, &res);
+ alreadyExists = rx==SQLITE_OK && res==0;
+ pC->deferredMoveto = 0;
+ pC->cacheValid = 0;
+ }
+ if( pOp->opcode==OP_Found ){
+ if( alreadyExists ) pc = pOp->p2 - 1;
+ }else{
+ if( !alreadyExists ) pc = pOp->p2 - 1;
+ }
+ if( pOp->opcode!=OP_Distinct ){
+ Release(pTos);
+ pTos--;
+ }
+ break;
+}
+
+/* Opcode: IsUnique P1 P2 *
+**
+** The top of the stack is an integer record number. Call this
+** record number R. The next on the stack is an index key created
+** using MakeIdxKey. Call it K. This instruction pops R from the
+** stack but it leaves K unchanged.
+**
+** P1 is an index. So it has no data and its key consists of a
+** record generated by OP_MakeRecord where the last field is the
+** rowid of the entry that the index refers to.
+**
+** This instruction asks if there is an entry in P1 where the
+** fields matches K but the rowid is different from R.
+** If there is no such entry, then there is an immediate
+** jump to P2. If any entry does exist where the index string
+** matches K but the record number is not R, then the record
+** number for that entry is pushed onto the stack and control
+** falls through to the next instruction.
+**
+** See also: Distinct, NotFound, NotExists, Found
+*/
+case OP_IsUnique: { /* no-push */
+ int i = pOp->p1;
+ Mem *pNos = &pTos[-1];
+ Cursor *pCx;
+ BtCursor *pCrsr;
+ i64 R;
+
+ /* Pop the value R off the top of the stack
+ */
+ assert( pNos>=p->aStack );
+ Integerify(pTos);
+ R = pTos->i;
+ assert( (pTos->flags & MEM_Dyn)==0 );
+ pTos--;
+ assert( i>=0 && i<=p->nCursor );
+ pCx = p->apCsr[i];
+ assert( pCx!=0 );
+ pCrsr = pCx->pCursor;
+ if( pCrsr!=0 ){
+ int res, rc;
+ i64 v; /* The record number on the P1 entry that matches K */
+ char *zKey; /* The value of K */
+ int nKey; /* Number of bytes in K */
+ int len; /* Number of bytes in K without the rowid at the end */
+ int szRowid; /* Size of the rowid column at the end of zKey */
+
+ /* Make sure K is a string and make zKey point to K
+ */
+ Stringify(pNos, db->enc);
+ zKey = pNos->z;
+ nKey = pNos->n;
+
+ szRowid = sqlite3VdbeIdxRowidLen(nKey, zKey);
+ len = nKey-szRowid;
+
+ /* Search for an entry in P1 where all but the last four bytes match K.
+ ** If there is no such entry, jump immediately to P2.
+ */
+ assert( pCx->deferredMoveto==0 );
+ pCx->cacheValid = 0;
+ rc = sqlite3BtreeMoveto(pCrsr, zKey, len, &res);
+ if( rc!=SQLITE_OK ) goto abort_due_to_error;
+ if( res<0 ){
+ rc = sqlite3BtreeNext(pCrsr, &res);
+ if( res ){
+ pc = pOp->p2 - 1;
+ break;
+ }
+ }
+ rc = sqlite3VdbeIdxKeyCompare(pCx, len, zKey, &res);
+ if( rc!=SQLITE_OK ) goto abort_due_to_error;
+ if( res>0 ){
+ pc = pOp->p2 - 1;
+ break;
+ }
+
+ /* At this point, pCrsr is pointing to an entry in P1 where all but
+ ** the final entry (the rowid) matches K. Check to see if the
+ ** final rowid column is different from R. If it equals R then jump
+ ** immediately to P2.
+ */
+ rc = sqlite3VdbeIdxRowid(pCrsr, &v);
+ if( rc!=SQLITE_OK ){
+ goto abort_due_to_error;
+ }
+ if( v==R ){
+ pc = pOp->p2 - 1;
+ break;
+ }
+
+ /* The final varint of the key is different from R. Push it onto
+ ** the stack. (The record number of an entry that violates a UNIQUE
+ ** constraint.)
+ */
+ pTos++;
+ pTos->i = v;
+ pTos->flags = MEM_Int;
+ }
+ break;
+}
+
+/* Opcode: NotExists P1 P2 *
+**
+** Use the top of the stack as a integer key. If a record with that key
+** does not exist in table of P1, then jump to P2. If the record
+** does exist, then fall thru. The cursor is left pointing to the
+** record if it exists. The integer key is popped from the stack.
+**
+** The difference between this operation and NotFound is that this
+** operation assumes the key is an integer and that P1 is a table whereas
+** NotFound assumes key is a blob constructed from MakeRecord and
+** P1 is an index.
+**
+** See also: Distinct, Found, MoveTo, NotFound, IsUnique
+*/
+case OP_NotExists: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pC;
+ BtCursor *pCrsr;
+ assert( pTos>=p->aStack );
+ assert( i>=0 && i<p->nCursor );
+ assert( p->apCsr[i]!=0 );
+ if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
+ int res;
+ u64 iKey;
+ assert( pTos->flags & MEM_Int );
+ assert( p->apCsr[i]->isTable );
+ iKey = intToKey(pTos->i);
+ rc = sqlite3BtreeMoveto(pCrsr, 0, iKey, &res);
+ pC->lastRowid = pTos->i;
+ pC->rowidIsValid = res==0;
+ pC->nullRow = 0;
+ pC->cacheValid = 0;
+ if( res!=0 ){
+ pc = pOp->p2 - 1;
+ pC->rowidIsValid = 0;
+ }
+ }
+ Release(pTos);
+ pTos--;
+ break;
+}
+
+/* Opcode: Sequence P1 * *
+**
+** Push an integer onto the stack which is the next available
+** sequence number for cursor P1. The sequence number on the
+** cursor is incremented after the push.
+*/
+case OP_Sequence: {
+ int i = pOp->p1;
+ assert( pTos>=p->aStack );
+ assert( i>=0 && i<p->nCursor );
+ assert( p->apCsr[i]!=0 );
+ pTos++;
+ pTos->i = p->apCsr[i]->seqCount++;
+ pTos->flags = MEM_Int;
+ break;
+}
+
+
+/* Opcode: NewRowid P1 P2 *
+**
+** Get a new integer record number (a.k.a "rowid") used as the key to a table.
+** The record number is not previously used as a key in the database
+** table that cursor P1 points to. The new record number is pushed
+** onto the stack.
+**
+** If P2>0 then P2 is a memory cell that holds the largest previously
+** generated record number. No new record numbers are allowed to be less
+** than this value. When this value reaches its maximum, a SQLITE_FULL
+** error is generated. The P2 memory cell is updated with the generated
+** record number. This P2 mechanism is used to help implement the
+** AUTOINCREMENT feature.
+*/
+case OP_NewRowid: {
+ int i = pOp->p1;
+ i64 v = 0;
+ Cursor *pC;
+ assert( i>=0 && i<p->nCursor );
+ assert( p->apCsr[i]!=0 );
+ if( (pC = p->apCsr[i])->pCursor==0 ){
+ /* The zero initialization above is all that is needed */
+ }else{
+ /* The next rowid or record number (different terms for the same
+ ** thing) is obtained in a two-step algorithm.
+ **
+ ** First we attempt to find the largest existing rowid and add one
+ ** to that. But if the largest existing rowid is already the maximum
+ ** positive integer, we have to fall through to the second
+ ** probabilistic algorithm
+ **
+ ** The second algorithm is to select a rowid at random and see if
+ ** it already exists in the table. If it does not exist, we have
+ ** succeeded. If the random rowid does exist, we select a new one
+ ** and try again, up to 1000 times.
+ **
+ ** For a table with less than 2 billion entries, the probability
+ ** of not finding a unused rowid is about 1.0e-300. This is a
+ ** non-zero probability, but it is still vanishingly small and should
+ ** never cause a problem. You are much, much more likely to have a
+ ** hardware failure than for this algorithm to fail.
+ **
+ ** The analysis in the previous paragraph assumes that you have a good
+ ** source of random numbers. Is a library function like lrand48()
+ ** good enough? Maybe. Maybe not. It's hard to know whether there
+ ** might be subtle bugs is some implementations of lrand48() that
+ ** could cause problems. To avoid uncertainty, SQLite uses its own
+ ** random number generator based on the RC4 algorithm.
+ **
+ ** To promote locality of reference for repetitive inserts, the
+ ** first few attempts at chosing a random rowid pick values just a little
+ ** larger than the previous rowid. This has been shown experimentally
+ ** to double the speed of the COPY operation.
+ */
+ int res, rx=SQLITE_OK, cnt;
+ i64 x;
+ cnt = 0;
+ if( (sqlite3BtreeFlags(pC->pCursor)&(BTREE_INTKEY|BTREE_ZERODATA)) !=
+ BTREE_INTKEY ){
+ rc = SQLITE_CORRUPT_BKPT;
+ goto abort_due_to_error;
+ }
+ assert( (sqlite3BtreeFlags(pC->pCursor) & BTREE_INTKEY)!=0 );
+ assert( (sqlite3BtreeFlags(pC->pCursor) & BTREE_ZERODATA)==0 );
+
+#ifdef SQLITE_32BIT_ROWID
+# define MAX_ROWID 0x7fffffff
+#else
+ /* Some compilers complain about constants of the form 0x7fffffffffffffff.
+ ** Others complain about 0x7ffffffffffffffffLL. The following macro seems
+ ** to provide the constant while making all compilers happy.
+ */
+# define MAX_ROWID ( (((u64)0x7fffffff)<<32) | (u64)0xffffffff )
+#endif
+
+ if( !pC->useRandomRowid ){
+ if( pC->nextRowidValid ){
+ v = pC->nextRowid;
+ }else{
+ rx = sqlite3BtreeLast(pC->pCursor, &res);
+ if( res ){
+ v = 1;
+ }else{
+ sqlite3BtreeKeySize(pC->pCursor, &v);
+ v = keyToInt(v);
+ if( v==MAX_ROWID ){
+ pC->useRandomRowid = 1;
+ }else{
+ v++;
+ }
+ }
+ }
+
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+ if( pOp->p2 ){
+ Mem *pMem;
+ assert( pOp->p2>0 && pOp->p2<p->nMem ); /* P2 is a valid memory cell */
+ pMem = &p->aMem[pOp->p2];
+ Integerify(pMem);
+ assert( (pMem->flags & MEM_Int)!=0 ); /* mem(P2) holds an integer */
+ if( pMem->i==MAX_ROWID || pC->useRandomRowid ){
+ rc = SQLITE_FULL;
+ goto abort_due_to_error;
+ }
+ if( v<pMem->i+1 ){
+ v = pMem->i + 1;
+ }
+ pMem->i = v;
+ }
+#endif
+
+ if( v<MAX_ROWID ){
+ pC->nextRowidValid = 1;
+ pC->nextRowid = v+1;
+ }else{
+ pC->nextRowidValid = 0;
+ }
+ }
+ if( pC->useRandomRowid ){
+ assert( pOp->p2==0 ); /* SQLITE_FULL must have occurred prior to this */
+ v = db->priorNewRowid;
+ cnt = 0;
+ do{
+ if( v==0 || cnt>2 ){
+ sqlite3Randomness(sizeof(v), &v);
+ if( cnt<5 ) v &= 0xffffff;
+ }else{
+ unsigned char r;
+ sqlite3Randomness(1, &r);
+ v += r + 1;
+ }
+ if( v==0 ) continue;
+ x = intToKey(v);
+ rx = sqlite3BtreeMoveto(pC->pCursor, 0, (u64)x, &res);
+ cnt++;
+ }while( cnt<1000 && rx==SQLITE_OK && res==0 );
+ db->priorNewRowid = v;
+ if( rx==SQLITE_OK && res==0 ){
+ rc = SQLITE_FULL;
+ goto abort_due_to_error;
+ }
+ }
+ pC->rowidIsValid = 0;
+ pC->deferredMoveto = 0;
+ pC->cacheValid = 0;
+ }
+ pTos++;
+ pTos->i = v;
+ pTos->flags = MEM_Int;
+ break;
+}
+
+/* Opcode: Insert P1 P2 *
+**
+** Write an entry into the table of cursor P1. A new entry is
+** created if it doesn't already exist or the data for an existing
+** entry is overwritten. The data is the value on the top of the
+** stack. The key is the next value down on the stack. The key must
+** be an integer. The stack is popped twice by this instruction.
+**
+** If the OPFLAG_NCHANGE flag of P2 is set, then the row change count is
+** incremented (otherwise not). If the OPFLAG_LASTROWID flag of P2 is set,
+** then rowid is stored for subsequent return by the
+** sqlite3_last_insert_rowid() function (otherwise it's unmodified).
+**
+** This instruction only works on tables. The equivalent instruction
+** for indices is OP_IdxInsert.
+*/
+case OP_Insert: { /* no-push */
+ Mem *pNos = &pTos[-1];
+ int i = pOp->p1;
+ Cursor *pC;
+ assert( pNos>=p->aStack );
+ assert( i>=0 && i<p->nCursor );
+ assert( p->apCsr[i]!=0 );
+ if( ((pC = p->apCsr[i])->pCursor!=0 || pC->pseudoTable) ){
+ i64 iKey; /* The integer ROWID or key for the record to be inserted */
+
+ assert( pNos->flags & MEM_Int );
+ assert( pC->isTable );
+ iKey = intToKey(pNos->i);
+
+ if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++;
+ if( pOp->p2 & OPFLAG_LASTROWID ) db->lastRowid = pNos->i;
+ if( pC->nextRowidValid && pTos->i>=pC->nextRowid ){
+ pC->nextRowidValid = 0;
+ }
+ if( pTos->flags & MEM_Null ){
+ pTos->z = 0;
+ pTos->n = 0;
+ }else{
+ assert( pTos->flags & (MEM_Blob|MEM_Str) );
+ }
+#ifndef SQLITE_OMIT_TRIGGER
+ if( pC->pseudoTable ){
+ sqliteFree(pC->pData);
+ pC->iKey = iKey;
+ pC->nData = pTos->n;
+ if( pTos->flags & MEM_Dyn ){
+ pC->pData = pTos->z;
+ pTos->flags = MEM_Null;
+ }else{
+ pC->pData = sqliteMallocRaw( pC->nData+2 );
+ if( !pC->pData ) goto no_mem;
+ memcpy(pC->pData, pTos->z, pC->nData);
+ pC->pData[pC->nData] = 0;
+ pC->pData[pC->nData+1] = 0;
+ }
+ pC->nullRow = 0;
+ }else{
+#endif
+ rc = sqlite3BtreeInsert(pC->pCursor, 0, iKey, pTos->z, pTos->n);
+#ifndef SQLITE_OMIT_TRIGGER
+ }
+#endif
+
+ pC->rowidIsValid = 0;
+ pC->deferredMoveto = 0;
+ pC->cacheValid = 0;
+ }
+ popStack(&pTos, 2);
+ break;
+}
+
+/* Opcode: Delete P1 P2 *
+**
+** Delete the record at which the P1 cursor is currently pointing.
+**
+** The cursor will be left pointing at either the next or the previous
+** record in the table. If it is left pointing at the next record, then
+** the next Next instruction will be a no-op. Hence it is OK to delete
+** a record from within an Next loop.
+**
+** If the OPFLAG_NCHANGE flag of P2 is set, then the row change count is
+** incremented (otherwise not).
+**
+** If P1 is a pseudo-table, then this instruction is a no-op.
+*/
+case OP_Delete: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pC;
+ assert( i>=0 && i<p->nCursor );
+ pC = p->apCsr[i];
+ assert( pC!=0 );
+ if( pC->pCursor!=0 ){
+ rc = sqlite3VdbeCursorMoveto(pC);
+ if( rc ) goto abort_due_to_error;
+ rc = sqlite3BtreeDelete(pC->pCursor);
+ pC->nextRowidValid = 0;
+ pC->cacheValid = 0;
+ }
+ if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++;
+ break;
+}
+
+/* Opcode: ResetCount P1 * *
+**
+** This opcode resets the VMs internal change counter to 0. If P1 is true,
+** then the value of the change counter is copied to the database handle
+** change counter (returned by subsequent calls to sqlite3_changes())
+** before it is reset. This is used by trigger programs.
+*/
+case OP_ResetCount: { /* no-push */
+ if( pOp->p1 ){
+ sqlite3VdbeSetChanges(db, p->nChange);
+ }
+ p->nChange = 0;
+ break;
+}
+
+/* Opcode: RowData P1 * *
+**
+** Push onto the stack the complete row data for cursor P1.
+** There is no interpretation of the data. It is just copied
+** onto the stack exactly as it is found in the database file.
+**
+** If the cursor is not pointing to a valid row, a NULL is pushed
+** onto the stack.
+*/
+/* Opcode: RowKey P1 * *
+**
+** Push onto the stack the complete row key for cursor P1.
+** There is no interpretation of the key. It is just copied
+** onto the stack exactly as it is found in the database file.
+**
+** If the cursor is not pointing to a valid row, a NULL is pushed
+** onto the stack.
+*/
+case OP_RowKey:
+case OP_RowData: {
+ int i = pOp->p1;
+ Cursor *pC;
+ u32 n;
+
+ /* Note that RowKey and RowData are really exactly the same instruction */
+ pTos++;
+ assert( i>=0 && i<p->nCursor );
+ pC = p->apCsr[i];
+ assert( pC->isTable || pOp->opcode==OP_RowKey );
+ assert( pC->isIndex || pOp->opcode==OP_RowData );
+ assert( pC!=0 );
+ if( pC->nullRow ){
+ pTos->flags = MEM_Null;
+ }else if( pC->pCursor!=0 ){
+ BtCursor *pCrsr = pC->pCursor;
+ rc = sqlite3VdbeCursorMoveto(pC);
+ if( rc ) goto abort_due_to_error;
+ if( pC->nullRow ){
+ pTos->flags = MEM_Null;
+ break;
+ }else if( pC->isIndex ){
+ i64 n64;
+ assert( !pC->isTable );
+ sqlite3BtreeKeySize(pCrsr, &n64);
+ n = n64;
+ }else{
+ sqlite3BtreeDataSize(pCrsr, &n);
+ }
+ pTos->n = n;
+ if( n<=NBFS ){
+ pTos->flags = MEM_Blob | MEM_Short;
+ pTos->z = pTos->zShort;
+ }else{
+ char *z = sqliteMallocRaw( n );
+ if( z==0 ) goto no_mem;
+ pTos->flags = MEM_Blob | MEM_Dyn;
+ pTos->xDel = 0;
+ pTos->z = z;
+ }
+ if( pC->isIndex ){
+ sqlite3BtreeKey(pCrsr, 0, n, pTos->z);
+ }else{
+ sqlite3BtreeData(pCrsr, 0, n, pTos->z);
+ }
+#ifndef SQLITE_OMIT_TRIGGER
+ }else if( pC->pseudoTable ){
+ pTos->n = pC->nData;
+ pTos->z = pC->pData;
+ pTos->flags = MEM_Blob|MEM_Ephem;
+#endif
+ }else{
+ pTos->flags = MEM_Null;
+ }
+ pTos->enc = SQLITE_UTF8; /* In case the blob is ever cast to text */
+ break;
+}
+
+/* Opcode: Rowid P1 * *
+**
+** Push onto the stack an integer which is the key of the table entry that
+** P1 is currently point to.
+*/
+case OP_Rowid: {
+ int i = pOp->p1;
+ Cursor *pC;
+ i64 v;
+
+ assert( i>=0 && i<p->nCursor );
+ pC = p->apCsr[i];
+ assert( pC!=0 );
+ rc = sqlite3VdbeCursorMoveto(pC);
+ if( rc ) goto abort_due_to_error;
+ pTos++;
+ if( pC->rowidIsValid ){
+ v = pC->lastRowid;
+ }else if( pC->pseudoTable ){
+ v = keyToInt(pC->iKey);
+ }else if( pC->nullRow || pC->pCursor==0 ){
+ pTos->flags = MEM_Null;
+ break;
+ }else{
+ assert( pC->pCursor!=0 );
+ sqlite3BtreeKeySize(pC->pCursor, &v);
+ v = keyToInt(v);
+ }
+ pTos->i = v;
+ pTos->flags = MEM_Int;
+ break;
+}
+
+/* Opcode: NullRow P1 * *
+**
+** Move the cursor P1 to a null row. Any OP_Column operations
+** that occur while the cursor is on the null row will always push
+** a NULL onto the stack.
+*/
+case OP_NullRow: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pC;
+
+ assert( i>=0 && i<p->nCursor );
+ pC = p->apCsr[i];
+ assert( pC!=0 );
+ pC->nullRow = 1;
+ pC->rowidIsValid = 0;
+ break;
+}
+
+/* Opcode: Last P1 P2 *
+**
+** The next use of the Rowid or Column or Next instruction for P1
+** will refer to the last entry in the database table or index.
+** If the table or index is empty and P2>0, then jump immediately to P2.
+** If P2 is 0 or if the table or index is not empty, fall through
+** to the following instruction.
+*/
+case OP_Last: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pC;
+ BtCursor *pCrsr;
+
+ assert( i>=0 && i<p->nCursor );
+ pC = p->apCsr[i];
+ assert( pC!=0 );
+ if( (pCrsr = pC->pCursor)!=0 ){
+ int res;
+ rc = sqlite3BtreeLast(pCrsr, &res);
+ pC->nullRow = res;
+ pC->deferredMoveto = 0;
+ pC->cacheValid = 0;
+ if( res && pOp->p2>0 ){
+ pc = pOp->p2 - 1;
+ }
+ }else{
+ pC->nullRow = 0;
+ }
+ break;
+}
+
+
+/* Opcode: Sort P1 P2 *
+**
+** This opcode does exactly the same thing as OP_Rewind except that
+** it increments an undocumented global variable used for testing.
+**
+** Sorting is accomplished by writing records into a sorting index,
+** then rewinding that index and playing it back from beginning to
+** end. We use the OP_Sort opcode instead of OP_Rewind to do the
+** rewinding so that the global variable will be incremented and
+** regression tests can determine whether or not the optimizer is
+** correctly optimizing out sorts.
+*/
+case OP_Sort: { /* no-push */
+ sqlite3_sort_count++;
+ sqlite3_search_count--;
+ /* Fall through into OP_Rewind */
+}
+/* Opcode: Rewind P1 P2 *
+**
+** The next use of the Rowid or Column or Next instruction for P1
+** will refer to the first entry in the database table or index.
+** If the table or index is empty and P2>0, then jump immediately to P2.
+** If P2 is 0 or if the table or index is not empty, fall through
+** to the following instruction.
+*/
+case OP_Rewind: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pC;
+ BtCursor *pCrsr;
+ int res;
+
+ assert( i>=0 && i<p->nCursor );
+ pC = p->apCsr[i];
+ assert( pC!=0 );
+ if( (pCrsr = pC->pCursor)!=0 ){
+ rc = sqlite3BtreeFirst(pCrsr, &res);
+ pC->atFirst = res==0;
+ pC->deferredMoveto = 0;
+ pC->cacheValid = 0;
+ }else{
+ res = 1;
+ }
+ pC->nullRow = res;
+ if( res && pOp->p2>0 ){
+ pc = pOp->p2 - 1;
+ }
+ break;
+}
+
+/* Opcode: Next P1 P2 *
+**
+** Advance cursor P1 so that it points to the next key/data pair in its
+** table or index. If there are no more key/value pairs then fall through
+** to the following instruction. But if the cursor advance was successful,
+** jump immediately to P2.
+**
+** See also: Prev
+*/
+/* Opcode: Prev P1 P2 *
+**
+** Back up cursor P1 so that it points to the previous key/data pair in its
+** table or index. If there is no previous key/value pairs then fall through
+** to the following instruction. But if the cursor backup was successful,
+** jump immediately to P2.
+*/
+case OP_Prev: /* no-push */
+case OP_Next: { /* no-push */
+ Cursor *pC;
+ BtCursor *pCrsr;
+
+ CHECK_FOR_INTERRUPT;
+ assert( pOp->p1>=0 && pOp->p1<p->nCursor );
+ pC = p->apCsr[pOp->p1];
+ assert( pC!=0 );
+ if( (pCrsr = pC->pCursor)!=0 ){
+ int res;
+ if( pC->nullRow ){
+ res = 1;
+ }else{
+ assert( pC->deferredMoveto==0 );
+ rc = pOp->opcode==OP_Next ? sqlite3BtreeNext(pCrsr, &res) :
+ sqlite3BtreePrevious(pCrsr, &res);
+ pC->nullRow = res;
+ pC->cacheValid = 0;
+ }
+ if( res==0 ){
+ pc = pOp->p2 - 1;
+ sqlite3_search_count++;
+ }
+ }else{
+ pC->nullRow = 1;
+ }
+ pC->rowidIsValid = 0;
+ break;
+}
+
+/* Opcode: IdxInsert P1 * *
+**
+** The top of the stack holds a SQL index key made using the
+** MakeIdxKey instruction. This opcode writes that key into the
+** index P1. Data for the entry is nil.
+**
+** This instruction only works for indices. The equivalent instruction
+** for tables is OP_Insert.
+*/
+case OP_IdxInsert: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pC;
+ BtCursor *pCrsr;
+ assert( pTos>=p->aStack );
+ assert( i>=0 && i<p->nCursor );
+ assert( p->apCsr[i]!=0 );
+ assert( pTos->flags & MEM_Blob );
+ assert( pOp->p2==0 );
+ if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
+ int nKey = pTos->n;
+ const char *zKey = pTos->z;
+ assert( pC->isTable==0 );
+ rc = sqlite3BtreeInsert(pCrsr, zKey, nKey, "", 0);
+ assert( pC->deferredMoveto==0 );
+ pC->cacheValid = 0;
+ }
+ Release(pTos);
+ pTos--;
+ break;
+}
+
+/* Opcode: IdxDelete P1 * *
+**
+** The top of the stack is an index key built using the MakeIdxKey opcode.
+** This opcode removes that entry from the index.
+*/
+case OP_IdxDelete: { /* no-push */
+ int i = pOp->p1;
+ Cursor *pC;
+ BtCursor *pCrsr;
+ assert( pTos>=p->aStack );
+ assert( pTos->flags & MEM_Blob );
+ assert( i>=0 && i<p->nCursor );
+ assert( p->apCsr[i]!=0 );
+ if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
+ int rx, res;
+ rx = sqlite3BtreeMoveto(pCrsr, pTos->z, pTos->n, &res);
+ if( rx==SQLITE_OK && res==0 ){
+ rc = sqlite3BtreeDelete(pCrsr);
+ }
+ assert( pC->deferredMoveto==0 );
+ pC->cacheValid = 0;
+ }
+ Release(pTos);
+ pTos--;
+ break;
+}
+
+/* Opcode: IdxRowid P1 * *
+**
+** Push onto the stack an integer which is the last entry in the record at
+** the end of the index key pointed to by cursor P1. This integer should be
+** the rowid of the table entry to which this index entry points.
+**
+** See also: Rowid, MakeIdxKey.
+*/
+case OP_IdxRowid: {
+ int i = pOp->p1;
+ BtCursor *pCrsr;
+ Cursor *pC;
+
+ assert( i>=0 && i<p->nCursor );
+ assert( p->apCsr[i]!=0 );
+ pTos++;
+ pTos->flags = MEM_Null;
+ if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
+ i64 rowid;
+
+ assert( pC->deferredMoveto==0 );
+ assert( pC->isTable==0 );
+ if( pC->nullRow ){
+ pTos->flags = MEM_Null;
+ }else{
+ rc = sqlite3VdbeIdxRowid(pCrsr, &rowid);
+ if( rc!=SQLITE_OK ){
+ goto abort_due_to_error;
+ }
+ pTos->flags = MEM_Int;
+ pTos->i = rowid;
+ }
+ }
+ break;
+}
+
+/* Opcode: IdxGT P1 P2 *
+**
+** The top of the stack is an index entry that omits the ROWID. Compare
+** the top of stack against the index that P1 is currently pointing to.
+** Ignore the ROWID on the P1 index.
+**
+** The top of the stack might have fewer columns that P1.
+**
+** If the P1 index entry is greater than the top of the stack
+** then jump to P2. Otherwise fall through to the next instruction.
+** In either case, the stack is popped once.
+*/
+/* Opcode: IdxGE P1 P2 P3
+**
+** The top of the stack is an index entry that omits the ROWID. Compare
+** the top of stack against the index that P1 is currently pointing to.
+** Ignore the ROWID on the P1 index.
+**
+** If the P1 index entry is greater than or equal to the top of the stack
+** then jump to P2. Otherwise fall through to the next instruction.
+** In either case, the stack is popped once.
+**
+** If P3 is the "+" string (or any other non-NULL string) then the
+** index taken from the top of the stack is temporarily increased by
+** an epsilon prior to the comparison. This make the opcode work
+** like IdxGT except that if the key from the stack is a prefix of
+** the key in the cursor, the result is false whereas it would be
+** true with IdxGT.
+*/
+/* Opcode: IdxLT P1 P2 P3
+**
+** The top of the stack is an index entry that omits the ROWID. Compare
+** the top of stack against the index that P1 is currently pointing to.
+** Ignore the ROWID on the P1 index.
+**
+** If the P1 index entry is less than the top of the stack
+** then jump to P2. Otherwise fall through to the next instruction.
+** In either case, the stack is popped once.
+**
+** If P3 is the "+" string (or any other non-NULL string) then the
+** index taken from the top of the stack is temporarily increased by
+** an epsilon prior to the comparison. This makes the opcode work
+** like IdxLE.
+*/
+case OP_IdxLT: /* no-push */
+case OP_IdxGT: /* no-push */
+case OP_IdxGE: { /* no-push */
+ int i= pOp->p1;
+ Cursor *pC;
+
+ assert( i>=0 && i<p->nCursor );
+ assert( p->apCsr[i]!=0 );
+ assert( pTos>=p->aStack );
+ if( (pC = p->apCsr[i])->pCursor!=0 ){
+ int res, rc;
+
+ assert( pTos->flags & MEM_Blob ); /* Created using OP_Make*Key */
+ Stringify(pTos, db->enc);
+ assert( pC->deferredMoveto==0 );
+ *pC->pIncrKey = pOp->p3!=0;
+ assert( pOp->p3==0 || pOp->opcode!=OP_IdxGT );
+ rc = sqlite3VdbeIdxKeyCompare(pC, pTos->n, pTos->z, &res);
+ *pC->pIncrKey = 0;
+ if( rc!=SQLITE_OK ){
+ break;
+ }
+ if( pOp->opcode==OP_IdxLT ){
+ res = -res;
+ }else if( pOp->opcode==OP_IdxGE ){
+ res++;
+ }
+ if( res>0 ){
+ pc = pOp->p2 - 1 ;
+ }
+ }
+ Release(pTos);
+ pTos--;
+ break;
+}
+
+/* Opcode: IdxIsNull P1 P2 *
+**
+** The top of the stack contains an index entry such as might be generated
+** by the MakeIdxKey opcode. This routine looks at the first P1 fields of
+** that key. If any of the first P1 fields are NULL, then a jump is made
+** to address P2. Otherwise we fall straight through.
+**
+** The index entry is always popped from the stack.
+*/
+case OP_IdxIsNull: { /* no-push */
+ int i = pOp->p1;
+ int k, n;
+ const char *z;
+ u32 serial_type;
+
+ assert( pTos>=p->aStack );
+ assert( pTos->flags & MEM_Blob );
+ z = pTos->z;
+ n = pTos->n;
+ k = sqlite3GetVarint32(z, &serial_type);
+ for(; k<n && i>0; i--){
+ k += sqlite3GetVarint32(&z[k], &serial_type);
+ if( serial_type==0 ){ /* Serial type 0 is a NULL */
+ pc = pOp->p2-1;
+ break;
+ }
+ }
+ Release(pTos);
+ pTos--;
+ break;
+}
+
+/* Opcode: Destroy P1 P2 *
+**
+** Delete an entire database table or index whose root page in the database
+** file is given by P1.
+**
+** The table being destroyed is in the main database file if P2==0. If
+** P2==1 then the table to be clear is in the auxiliary database file
+** that is used to store tables create using CREATE TEMPORARY TABLE.
+**
+** If AUTOVACUUM is enabled then it is possible that another root page
+** might be moved into the newly deleted root page in order to keep all
+** root pages contiguous at the beginning of the database. The former
+** value of the root page that moved - its value before the move occurred -
+** is pushed onto the stack. If no page movement was required (because
+** the table being dropped was already the last one in the database) then
+** a zero is pushed onto the stack. If AUTOVACUUM is disabled
+** then a zero is pushed onto the stack.
+**
+** See also: Clear
+*/
+case OP_Destroy: {
+ int iMoved;
+ if( db->activeVdbeCnt>1 ){
+ rc = SQLITE_LOCKED;
+ }else{
+ assert( db->activeVdbeCnt==1 );
+ rc = sqlite3BtreeDropTable(db->aDb[pOp->p2].pBt, pOp->p1, &iMoved);
+ pTos++;
+ pTos->flags = MEM_Int;
+ pTos->i = iMoved;
+ #ifndef SQLITE_OMIT_AUTOVACUUM
+ if( rc==SQLITE_OK && iMoved!=0 ){
+ sqlite3RootPageMoved(&db->aDb[pOp->p2], iMoved, pOp->p1);
+ }
+ #endif
+ }
+ break;
+}
+
+/* Opcode: Clear P1 P2 *
+**
+** Delete all contents of the database table or index whose root page
+** in the database file is given by P1. But, unlike Destroy, do not
+** remove the table or index from the database file.
+**
+** The table being clear is in the main database file if P2==0. If
+** P2==1 then the table to be clear is in the auxiliary database file
+** that is used to store tables create using CREATE TEMPORARY TABLE.
+**
+** See also: Destroy
+*/
+case OP_Clear: { /* no-push */
+ rc = sqlite3BtreeClearTable(db->aDb[pOp->p2].pBt, pOp->p1);
+ break;
+}
+
+/* Opcode: CreateTable P1 * *
+**
+** Allocate a new table in the main database file if P2==0 or in the
+** auxiliary database file if P2==1. Push the page number
+** for the root page of the new table onto the stack.
+**
+** The difference between a table and an index is this: A table must
+** have a 4-byte integer key and can have arbitrary data. An index
+** has an arbitrary key but no data.
+**
+** See also: CreateIndex
+*/
+/* Opcode: CreateIndex P1 * *
+**
+** Allocate a new index in the main database file if P2==0 or in the
+** auxiliary database file if P2==1. Push the page number of the
+** root page of the new index onto the stack.
+**
+** See documentation on OP_CreateTable for additional information.
+*/
+case OP_CreateIndex:
+case OP_CreateTable: {
+ int pgno;
+ int flags;
+ Db *pDb;
+ assert( pOp->p1>=0 && pOp->p1<db->nDb );
+ pDb = &db->aDb[pOp->p1];
+ assert( pDb->pBt!=0 );
+ if( pOp->opcode==OP_CreateTable ){
+ /* flags = BTREE_INTKEY; */
+ flags = BTREE_LEAFDATA|BTREE_INTKEY;
+ }else{
+ flags = BTREE_ZERODATA;
+ }
+ rc = sqlite3BtreeCreateTable(pDb->pBt, &pgno, flags);
+ pTos++;
+ if( rc==SQLITE_OK ){
+ pTos->i = pgno;
+ pTos->flags = MEM_Int;
+ }else{
+ pTos->flags = MEM_Null;
+ }
+ break;
+}
+
+/* Opcode: ParseSchema P1 * P3
+**
+** Read and parse all entries from the SQLITE_MASTER table of database P1
+** that match the WHERE clause P3.
+**
+** This opcode invokes the parser to create a new virtual machine,
+** then runs the new virtual machine. It is thus a reentrant opcode.
+*/
+case OP_ParseSchema: { /* no-push */
+ char *zSql;
+ int iDb = pOp->p1;
+ const char *zMaster;
+ InitData initData;
+
+ assert( iDb>=0 && iDb<db->nDb );
+ if( !DbHasProperty(db, iDb, DB_SchemaLoaded) ) break;
+ zMaster = SCHEMA_TABLE(iDb);
+ initData.db = db;
+ initData.pzErrMsg = &p->zErrMsg;
+ zSql = sqlite3MPrintf(
+ "SELECT name, rootpage, sql, %d FROM '%q'.%s WHERE %s",
+ pOp->p1, db->aDb[iDb].zName, zMaster, pOp->p3);
+ if( zSql==0 ) goto no_mem;
+ sqlite3SafetyOff(db);
+ assert( db->init.busy==0 );
+ db->init.busy = 1;
+ rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0);
+ db->init.busy = 0;
+ sqlite3SafetyOn(db);
+ sqliteFree(zSql);
+ break;
+}
+
+#ifndef SQLITE_OMIT_ANALYZE
+/* Opcode: LoadAnalysis P1 * *
+**
+** Read the sqlite_stat1 table for database P1 and load the content
+** of that table into the internal index hash table. This will cause
+** the analysis to be used when preparing all subsequent queries.
+*/
+case OP_LoadAnalysis: { /* no-push */
+ int iDb = pOp->p1;
+ assert( iDb>=0 && iDb<db->nDb );
+ sqlite3AnalysisLoad(db, iDb);
+ break;
+}
+#endif /* SQLITE_OMIT_ANALYZE */
+
+/* Opcode: DropTable P1 * P3
+**
+** Remove the internal (in-memory) data structures that describe
+** the table named P3 in database P1. This is called after a table
+** is dropped in order to keep the internal representation of the
+** schema consistent with what is on disk.
+*/
+case OP_DropTable: { /* no-push */
+ sqlite3UnlinkAndDeleteTable(db, pOp->p1, pOp->p3);
+ break;
+}
+
+/* Opcode: DropIndex P1 * P3
+**
+** Remove the internal (in-memory) data structures that describe
+** the index named P3 in database P1. This is called after an index
+** is dropped in order to keep the internal representation of the
+** schema consistent with what is on disk.
+*/
+case OP_DropIndex: { /* no-push */
+ sqlite3UnlinkAndDeleteIndex(db, pOp->p1, pOp->p3);
+ break;
+}
+
+/* Opcode: DropTrigger P1 * P3
+**
+** Remove the internal (in-memory) data structures that describe
+** the trigger named P3 in database P1. This is called after a trigger
+** is dropped in order to keep the internal representation of the
+** schema consistent with what is on disk.
+*/
+case OP_DropTrigger: { /* no-push */
+ sqlite3UnlinkAndDeleteTrigger(db, pOp->p1, pOp->p3);
+ break;
+}
+
+
+#ifndef SQLITE_OMIT_INTEGRITY_CHECK
+/* Opcode: IntegrityCk * P2 *
+**
+** Do an analysis of the currently open database. Push onto the
+** stack the text of an error message describing any problems.
+** If there are no errors, push a "ok" onto the stack.
+**
+** The root page numbers of all tables in the database are integer
+** values on the stack. This opcode pulls as many integers as it
+** can off of the stack and uses those numbers as the root pages.
+**
+** If P2 is not zero, the check is done on the auxiliary database
+** file, not the main database file.
+**
+** This opcode is used for testing purposes only.
+*/
+case OP_IntegrityCk: {
+ int nRoot;
+ int *aRoot;
+ int j;
+ char *z;
+
+ for(nRoot=0; &pTos[-nRoot]>=p->aStack; nRoot++){
+ if( (pTos[-nRoot].flags & MEM_Int)==0 ) break;
+ }
+ assert( nRoot>0 );
+ aRoot = sqliteMallocRaw( sizeof(int*)*(nRoot+1) );
+ if( aRoot==0 ) goto no_mem;
+ for(j=0; j<nRoot; j++){
+ Mem *pMem = &pTos[-j];
+ aRoot[j] = pMem->i;
+ }
+ aRoot[j] = 0;
+ popStack(&pTos, nRoot);
+ pTos++;
+ z = sqlite3BtreeIntegrityCheck(db->aDb[pOp->p2].pBt, aRoot, nRoot);
+ if( z==0 || z[0]==0 ){
+ if( z ) sqliteFree(z);
+ pTos->z = "ok";
+ pTos->n = 2;
+ pTos->flags = MEM_Str | MEM_Static | MEM_Term;
+ }else{
+ pTos->z = z;
+ pTos->n = strlen(z);
+ pTos->flags = MEM_Str | MEM_Dyn | MEM_Term;
+ pTos->xDel = 0;
+ }
+ pTos->enc = SQLITE_UTF8;
+ sqlite3VdbeChangeEncoding(pTos, db->enc);
+ sqliteFree(aRoot);
+ break;
+}
+#endif /* SQLITE_OMIT_INTEGRITY_CHECK */
+
+/* Opcode: FifoWrite * * *
+**
+** Write the integer on the top of the stack
+** into the Fifo.
+*/
+case OP_FifoWrite: { /* no-push */
+ assert( pTos>=p->aStack );
+ Integerify(pTos);
+ sqlite3VdbeFifoPush(&p->sFifo, pTos->i);
+ assert( (pTos->flags & MEM_Dyn)==0 );
+ pTos--;
+ break;
+}
+
+/* Opcode: FifoRead * P2 *
+**
+** Attempt to read a single integer from the Fifo
+** and push it onto the stack. If the Fifo is empty
+** push nothing but instead jump to P2.
+*/
+case OP_FifoRead: {
+ i64 v;
+ CHECK_FOR_INTERRUPT;
+ if( sqlite3VdbeFifoPop(&p->sFifo, &v)==SQLITE_DONE ){
+ pc = pOp->p2 - 1;
+ }else{
+ pTos++;
+ pTos->i = v;
+ pTos->flags = MEM_Int;
+ }
+ break;
+}
+
+#ifndef SQLITE_OMIT_TRIGGER
+/* Opcode: ContextPush * * *
+**
+** Save the current Vdbe context such that it can be restored by a ContextPop
+** opcode. The context stores the last insert row id, the last statement change
+** count, and the current statement change count.
+*/
+case OP_ContextPush: { /* no-push */
+ int i = p->contextStackTop++;
+ Context *pContext;
+
+ assert( i>=0 );
+ /* FIX ME: This should be allocated as part of the vdbe at compile-time */
+ if( i>=p->contextStackDepth ){
+ p->contextStackDepth = i+1;
+ sqlite3ReallocOrFree((void**)&p->contextStack, sizeof(Context)*(i+1));
+ if( p->contextStack==0 ) goto no_mem;
+ }
+ pContext = &p->contextStack[i];
+ pContext->lastRowid = db->lastRowid;
+ pContext->nChange = p->nChange;
+ pContext->sFifo = p->sFifo;
+ sqlite3VdbeFifoInit(&p->sFifo);
+ break;
+}
+
+/* Opcode: ContextPop * * *
+**
+** Restore the Vdbe context to the state it was in when contextPush was last
+** executed. The context stores the last insert row id, the last statement
+** change count, and the current statement change count.
+*/
+case OP_ContextPop: { /* no-push */
+ Context *pContext = &p->contextStack[--p->contextStackTop];
+ assert( p->contextStackTop>=0 );
+ db->lastRowid = pContext->lastRowid;
+ p->nChange = pContext->nChange;
+ sqlite3VdbeFifoClear(&p->sFifo);
+ p->sFifo = pContext->sFifo;
+ break;
+}
+#endif /* #ifndef SQLITE_OMIT_TRIGGER */
+
+/* Opcode: MemStore P1 P2 *
+**
+** Write the top of the stack into memory location P1.
+** P1 should be a small integer since space is allocated
+** for all memory locations between 0 and P1 inclusive.
+**
+** After the data is stored in the memory location, the
+** stack is popped once if P2 is 1. If P2 is zero, then
+** the original data remains on the stack.
+*/
+case OP_MemStore: { /* no-push */
+ assert( pTos>=p->aStack );
+ assert( pOp->p1>=0 && pOp->p1<p->nMem );
+ rc = sqlite3VdbeMemMove(&p->aMem[pOp->p1], pTos);
+ pTos--;
+
+ /* If P2 is 0 then fall thru to the next opcode, OP_MemLoad, that will
+ ** restore the top of the stack to its original value.
+ */
+ if( pOp->p2 ){
+ break;
+ }
+}
+/* Opcode: MemLoad P1 * *
+**
+** Push a copy of the value in memory location P1 onto the stack.
+**
+** If the value is a string, then the value pushed is a pointer to
+** the string that is stored in the memory location. If the memory
+** location is subsequently changed (using OP_MemStore) then the
+** value pushed onto the stack will change too.
+*/
+case OP_MemLoad: {
+ int i = pOp->p1;
+ assert( i>=0 && i<p->nMem );
+ pTos++;
+ sqlite3VdbeMemShallowCopy(pTos, &p->aMem[i], MEM_Ephem);
+ break;
+}
+
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+/* Opcode: MemMax P1 * *
+**
+** Set the value of memory cell P1 to the maximum of its current value
+** and the value on the top of the stack. The stack is unchanged.
+**
+** This instruction throws an error if the memory cell is not initially
+** an integer.
+*/
+case OP_MemMax: { /* no-push */
+ int i = pOp->p1;
+ Mem *pMem;
+ assert( pTos>=p->aStack );
+ assert( i>=0 && i<p->nMem );
+ pMem = &p->aMem[i];
+ Integerify(pMem);
+ Integerify(pTos);
+ if( pMem->i<pTos->i){
+ pMem->i = pTos->i;
+ }
+ break;
+}
+#endif /* SQLITE_OMIT_AUTOINCREMENT */
+
+/* Opcode: MemIncr P1 P2 *
+**
+** Increment the integer valued memory cell P1 by 1. If P2 is not zero
+** and the result after the increment is exactly 1, then jump
+** to P2.
+**
+** This instruction throws an error if the memory cell is not initially
+** an integer.
+*/
+case OP_MemIncr: { /* no-push */
+ int i = pOp->p1;
+ Mem *pMem;
+ assert( i>=0 && i<p->nMem );
+ pMem = &p->aMem[i];
+ assert( pMem->flags==MEM_Int );
+ pMem->i++;
+ if( pOp->p2>0 && pMem->i==1 ){
+ pc = pOp->p2 - 1;
+ }
+ break;
+}
+
+/* Opcode: IfMemPos P1 P2 *
+**
+** If the value of memory cell P1 is 1 or greater, jump to P2. This
+** opcode assumes that memory cell P1 holds an integer value.
+*/
+case OP_IfMemPos: { /* no-push */
+ int i = pOp->p1;
+ Mem *pMem;
+ assert( i>=0 && i<p->nMem );
+ pMem = &p->aMem[i];
+ assert( pMem->flags==MEM_Int );
+ if( pMem->i>0 ){
+ pc = pOp->p2 - 1;
+ }
+ break;
+}
+
+/* Opcode: MemNull P1 * *
+**
+** Store a NULL in memory cell P1
+*/
+case OP_MemNull: {
+ assert( pOp->p1>=0 && pOp->p1<p->nMem );
+ sqlite3VdbeMemSetNull(&p->aMem[pOp->p1]);
+ break;
+}
+
+/* Opcode: MemInt P1 P2 *
+**
+** Store the integer value P1 in memory cell P2.
+*/
+case OP_MemInt: {
+ assert( pOp->p2>=0 && pOp->p2<p->nMem );
+ sqlite3VdbeMemSetInt64(&p->aMem[pOp->p2], pOp->p1);
+ break;
+}
+
+/* Opcode: MemMove P1 P2 *
+**
+** Move the content of memory cell P2 over to memory cell P1.
+** Any prior content of P1 is erased. Memory cell P2 is left
+** containing a NULL.
+*/
+case OP_MemMove: {
+ assert( pOp->p1>=0 && pOp->p1<p->nMem );
+ assert( pOp->p2>=0 && pOp->p2<p->nMem );
+ rc = sqlite3VdbeMemMove(&p->aMem[pOp->p1], &p->aMem[pOp->p2]);
+ break;
+}
+
+/* Opcode: AggStep P1 P2 P3
+**
+** Execute the step function for an aggregate. The
+** function has P2 arguments. P3 is a pointer to the FuncDef
+** structure that specifies the function. Use memory location
+** P1 as the accumulator.
+**
+** The P2 arguments are popped from the stack.
+*/
+case OP_AggStep: { /* no-push */
+ int n = pOp->p2;
+ int i;
+ Mem *pMem, *pRec;
+ sqlite3_context ctx;
+ sqlite3_value **apVal;
+
+ assert( n>=0 );
+ pRec = &pTos[1-n];
+ assert( pRec>=p->aStack );
+ apVal = p->apArg;
+ assert( apVal || n==0 );
+ for(i=0; i<n; i++, pRec++){
+ apVal[i] = pRec;
+ storeTypeInfo(pRec, db->enc);
+ }
+ ctx.pFunc = (FuncDef*)pOp->p3;
+ assert( pOp->p1>=0 && pOp->p1<p->nMem );
+ ctx.pMem = pMem = &p->aMem[pOp->p1];
+ pMem->n++;
+ ctx.isError = 0;
+ ctx.pColl = 0;
+ if( ctx.pFunc->needCollSeq ){
+ assert( pOp>p->aOp );
+ assert( pOp[-1].p3type==P3_COLLSEQ );
+ assert( pOp[-1].opcode==OP_CollSeq );
+ ctx.pColl = (CollSeq *)pOp[-1].p3;
+ }
+ (ctx.pFunc->xStep)(&ctx, n, apVal);
+ popStack(&pTos, n);
+ if( ctx.isError ){
+ rc = SQLITE_ERROR;
+ }
+ break;
+}
+
+/* Opcode: AggFinal P1 P2 P3
+**
+** Execute the finalizer function for an aggregate. P1 is
+** the memory location that is the accumulator for the aggregate.
+**
+** P2 is the number of arguments that the step function takes and
+** P3 is a pointer to the FuncDef for this function. The P2
+** argument is not used by this opcode. It is only there to disambiguate
+** functions that can take varying numbers of arguments. The
+** P3 argument is only needed for the degenerate case where
+** the step function was not previously called.
+*/
+case OP_AggFinal: { /* no-push */
+ Mem *pMem;
+ assert( pOp->p1>=0 && pOp->p1<p->nMem );
+ pMem = &p->aMem[pOp->p1];
+ assert( (pMem->flags & ~(MEM_Null|MEM_Agg))==0 );
+ sqlite3VdbeMemFinalize(pMem, (FuncDef*)pOp->p3);
+ break;
+}
+
+
+/* Opcode: Vacuum * * *
+**
+** Vacuum the entire database. This opcode will cause other virtual
+** machines to be created and run. It may not be called from within
+** a transaction.
+*/
+case OP_Vacuum: { /* no-push */
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
+ rc = sqlite3RunVacuum(&p->zErrMsg, db);
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
+ break;
+}
+
+/* Opcode: Expire P1 * *
+**
+** Cause precompiled statements to become expired. An expired statement
+** fails with an error code of SQLITE_SCHEMA if it is ever executed
+** (via sqlite3_step()).
+**
+** If P1 is 0, then all SQL statements become expired. If P1 is non-zero,
+** then only the currently executing statement is affected.
+*/
+case OP_Expire: { /* no-push */
+ if( !pOp->p1 ){
+ sqlite3ExpirePreparedStatements(db);
+ }else{
+ p->expired = 1;
+ }
+ break;
+}
+
+
+/* An other opcode is illegal...
+*/
+default: {
+ assert( 0 );
+ break;
+}
+
+/*****************************************************************************
+** The cases of the switch statement above this line should all be indented
+** by 6 spaces. But the left-most 6 spaces have been removed to improve the
+** readability. From this point on down, the normal indentation rules are
+** restored.
+*****************************************************************************/
+ }
+
+ /* Make sure the stack limit was not exceeded */
+ assert( pTos<=pStackLimit );
+
+#ifdef VDBE_PROFILE
+ {
+ long long elapse = hwtime() - start;
+ pOp->cycles += elapse;
+ pOp->cnt++;
+#if 0
+ fprintf(stdout, "%10lld ", elapse);
+ sqlite3VdbePrintOp(stdout, origPc, &p->aOp[origPc]);
+#endif
+ }
+#endif
+
+ /* The following code adds nothing to the actual functionality
+ ** of the program. It is only here for testing and debugging.
+ ** On the other hand, it does burn CPU cycles every time through
+ ** the evaluator loop. So we can leave it out when NDEBUG is defined.
+ */
+#ifndef NDEBUG
+ /* Sanity checking on the top element of the stack */
+ if( pTos>=p->aStack ){
+ sqlite3VdbeMemSanity(pTos, db->enc);
+ }
+ assert( pc>=-1 && pc<p->nOp );
+#ifdef SQLITE_DEBUG
+ /* Code for tracing the vdbe stack. */
+ if( p->trace && pTos>=p->aStack ){
+ int i;
+ fprintf(p->trace, "Stack:");
+ for(i=0; i>-5 && &pTos[i]>=p->aStack; i--){
+ if( pTos[i].flags & MEM_Null ){
+ fprintf(p->trace, " NULL");
+ }else if( (pTos[i].flags & (MEM_Int|MEM_Str))==(MEM_Int|MEM_Str) ){
+ fprintf(p->trace, " si:%lld", pTos[i].i);
+ }else if( pTos[i].flags & MEM_Int ){
+ fprintf(p->trace, " i:%lld", pTos[i].i);
+ }else if( pTos[i].flags & MEM_Real ){
+ fprintf(p->trace, " r:%g", pTos[i].r);
+ }else{
+ char zBuf[100];
+ sqlite3VdbeMemPrettyPrint(&pTos[i], zBuf, 100);
+ fprintf(p->trace, " ");
+ fprintf(p->trace, "%s", zBuf);
+ }
+ }
+ if( rc!=0 ) fprintf(p->trace," rc=%d",rc);
+ fprintf(p->trace,"\n");
+ }
+#endif /* SQLITE_DEBUG */
+#endif /* NDEBUG */
+ } /* The end of the for(;;) loop the loops through opcodes */
+
+ /* If we reach this point, it means that execution is finished.
+ */
+vdbe_halt:
+ if( rc ){
+ p->rc = rc;
+ rc = SQLITE_ERROR;
+ }else{
+ rc = SQLITE_DONE;
+ }
+ sqlite3VdbeHalt(p);
+ p->pTos = pTos;
+ return rc;
+
+ /* Jump to here if a malloc() fails. It's hard to get a malloc()
+ ** to fail on a modern VM computer, so this code is untested.
+ */
+no_mem:
+ sqlite3SetString(&p->zErrMsg, "out of memory", (char*)0);
+ rc = SQLITE_NOMEM;
+ goto vdbe_halt;
+
+ /* Jump to here for an SQLITE_MISUSE error.
+ */
+abort_due_to_misuse:
+ rc = SQLITE_MISUSE;
+ /* Fall thru into abort_due_to_error */
+
+ /* Jump to here for any other kind of fatal error. The "rc" variable
+ ** should hold the error number.
+ */
+abort_due_to_error:
+ if( p->zErrMsg==0 ){
+ if( sqlite3_malloc_failed ) rc = SQLITE_NOMEM;
+ sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(rc), (char*)0);
+ }
+ goto vdbe_halt;
+
+ /* Jump to here if the sqlite3_interrupt() API sets the interrupt
+ ** flag.
+ */
+abort_due_to_interrupt:
+ assert( db->flags & SQLITE_Interrupt );
+ db->flags &= ~SQLITE_Interrupt;
+ if( db->magic!=SQLITE_MAGIC_BUSY ){
+ rc = SQLITE_MISUSE;
+ }else{
+ rc = SQLITE_INTERRUPT;
+ }
+ p->rc = rc;
+ sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(rc), (char*)0);
+ goto vdbe_halt;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/vdbe.h b/ext/pdo_sqlite/sqlite/src/vdbe.h
new file mode 100644
index 000000000..06932503f
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/vdbe.h
@@ -0,0 +1,131 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Header file for the Virtual DataBase Engine (VDBE)
+**
+** This header defines the interface to the virtual database engine
+** or VDBE. The VDBE implements an abstract machine that runs a
+** simple program to access and modify the underlying database.
+**
+** $Id$
+*/
+#ifndef _SQLITE_VDBE_H_
+#define _SQLITE_VDBE_H_
+#include <stdio.h>
+
+/*
+** A single VDBE is an opaque structure named "Vdbe". Only routines
+** in the source file sqliteVdbe.c are allowed to see the insides
+** of this structure.
+*/
+typedef struct Vdbe Vdbe;
+
+/*
+** A single instruction of the virtual machine has an opcode
+** and as many as three operands. The instruction is recorded
+** as an instance of the following structure:
+*/
+struct VdbeOp {
+ u8 opcode; /* What operation to perform */
+ int p1; /* First operand */
+ int p2; /* Second parameter (often the jump destination) */
+ char *p3; /* Third parameter */
+ int p3type; /* One of the P3_xxx constants defined below */
+#ifdef VDBE_PROFILE
+ int cnt; /* Number of times this instruction was executed */
+ long long cycles; /* Total time spend executing this instruction */
+#endif
+};
+typedef struct VdbeOp VdbeOp;
+
+/*
+** A smaller version of VdbeOp used for the VdbeAddOpList() function because
+** it takes up less space.
+*/
+struct VdbeOpList {
+ u8 opcode; /* What operation to perform */
+ signed char p1; /* First operand */
+ short int p2; /* Second parameter (often the jump destination) */
+ char *p3; /* Third parameter */
+};
+typedef struct VdbeOpList VdbeOpList;
+
+/*
+** Allowed values of VdbeOp.p3type
+*/
+#define P3_NOTUSED 0 /* The P3 parameter is not used */
+#define P3_DYNAMIC (-1) /* Pointer to a string obtained from sqliteMalloc() */
+#define P3_STATIC (-2) /* Pointer to a static string */
+#define P3_COLLSEQ (-4) /* P3 is a pointer to a CollSeq structure */
+#define P3_FUNCDEF (-5) /* P3 is a pointer to a FuncDef structure */
+#define P3_KEYINFO (-6) /* P3 is a pointer to a KeyInfo structure */
+#define P3_VDBEFUNC (-7) /* P3 is a pointer to a VdbeFunc structure */
+#define P3_MEM (-8) /* P3 is a pointer to a Mem* structure */
+
+/* When adding a P3 argument using P3_KEYINFO, a copy of the KeyInfo structure
+** is made. That copy is freed when the Vdbe is finalized. But if the
+** argument is P3_KEYINFO_HANDOFF, the passed in pointer is used. It still
+** gets freed when the Vdbe is finalized so it still should be obtained
+** from a single sqliteMalloc(). But no copy is made and the calling
+** function should *not* try to free the KeyInfo.
+*/
+#define P3_KEYINFO_HANDOFF (-9)
+
+/*
+** The following macro converts a relative address in the p2 field
+** of a VdbeOp structure into a negative number so that
+** sqlite3VdbeAddOpList() knows that the address is relative. Calling
+** the macro again restores the address.
+*/
+#define ADDR(X) (-1-(X))
+
+/*
+** The makefile scans the vdbe.c source file and creates the "opcodes.h"
+** header file that defines a number for each opcode used by the VDBE.
+*/
+#include "opcodes.h"
+
+/*
+** Prototypes for the VDBE interface. See comments on the implementation
+** for a description of what each of these routines does.
+*/
+Vdbe *sqlite3VdbeCreate(sqlite3*);
+void sqlite3VdbeCreateCallback(Vdbe*, int*);
+int sqlite3VdbeAddOp(Vdbe*,int,int,int);
+int sqlite3VdbeOp3(Vdbe*,int,int,int,const char *zP3,int);
+int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp);
+void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1);
+void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2);
+void sqlite3VdbeJumpHere(Vdbe*, int addr);
+void sqlite3VdbeChangeP3(Vdbe*, int addr, const char *zP1, int N);
+VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
+int sqlite3VdbeMakeLabel(Vdbe*);
+void sqlite3VdbeDelete(Vdbe*);
+void sqlite3VdbeMakeReady(Vdbe*,int,int,int,int);
+int sqlite3VdbeFinalize(Vdbe*);
+void sqlite3VdbeResolveLabel(Vdbe*, int);
+int sqlite3VdbeCurrentAddr(Vdbe*);
+void sqlite3VdbeTrace(Vdbe*,FILE*);
+int sqlite3VdbeReset(Vdbe*);
+int sqliteVdbeSetVariables(Vdbe*,int,const char**);
+void sqlite3VdbeSetNumCols(Vdbe*,int);
+int sqlite3VdbeSetColName(Vdbe*, int, const char *, int);
+void sqlite3VdbeCountChanges(Vdbe*);
+sqlite3 *sqlite3VdbeDb(Vdbe*);
+
+#ifndef NDEBUG
+ void sqlite3VdbeComment(Vdbe*, const char*, ...);
+# define VdbeComment(X) sqlite3VdbeComment X
+#else
+# define VdbeComment(X)
+#endif
+
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/vdbeInt.h b/ext/pdo_sqlite/sqlite/src/vdbeInt.h
new file mode 100644
index 000000000..1746ee561
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/vdbeInt.h
@@ -0,0 +1,377 @@
+/*
+** 2003 September 6
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This is the header file for information that is private to the
+** VDBE. This information used to all be at the top of the single
+** source code file "vdbe.c". When that file became too big (over
+** 6000 lines long) it was split up into several smaller files and
+** this header information was factored out.
+*/
+
+/*
+** intToKey() and keyToInt() used to transform the rowid. But with
+** the latest versions of the design they are no-ops.
+*/
+#define keyToInt(X) (X)
+#define intToKey(X) (X)
+
+/*
+** The makefile scans the vdbe.c source file and creates the following
+** array of string constants which are the names of all VDBE opcodes. This
+** array is defined in a separate source code file named opcode.c which is
+** automatically generated by the makefile.
+*/
+extern char *sqlite3OpcodeNames[];
+
+/*
+** SQL is translated into a sequence of instructions to be
+** executed by a virtual machine. Each instruction is an instance
+** of the following structure.
+*/
+typedef struct VdbeOp Op;
+
+/*
+** Boolean values
+*/
+typedef unsigned char Bool;
+
+/*
+** A cursor is a pointer into a single BTree within a database file.
+** The cursor can seek to a BTree entry with a particular key, or
+** loop over all entries of the Btree. You can also insert new BTree
+** entries or retrieve the key or data from the entry that the cursor
+** is currently pointing to.
+**
+** Every cursor that the virtual machine has open is represented by an
+** instance of the following structure.
+**
+** If the Cursor.isTriggerRow flag is set it means that this cursor is
+** really a single row that represents the NEW or OLD pseudo-table of
+** a row trigger. The data for the row is stored in Cursor.pData and
+** the rowid is in Cursor.iKey.
+*/
+struct Cursor {
+ BtCursor *pCursor; /* The cursor structure of the backend */
+ i64 lastRowid; /* Last rowid from a Next or NextIdx operation */
+ i64 nextRowid; /* Next rowid returned by OP_NewRowid */
+ Bool zeroed; /* True if zeroed out and ready for reuse */
+ Bool rowidIsValid; /* True if lastRowid is valid */
+ Bool atFirst; /* True if pointing to first entry */
+ Bool useRandomRowid; /* Generate new record numbers semi-randomly */
+ Bool nullRow; /* True if pointing to a row with no data */
+ Bool nextRowidValid; /* True if the nextRowid field is valid */
+ Bool pseudoTable; /* This is a NEW or OLD pseudo-tables of a trigger */
+ Bool deferredMoveto; /* A call to sqlite3BtreeMoveto() is needed */
+ Bool isTable; /* True if a table requiring integer keys */
+ Bool isIndex; /* True if an index containing keys only - no data */
+ u8 bogusIncrKey; /* Something for pIncrKey to point to if pKeyInfo==0 */
+ i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */
+ Btree *pBt; /* Separate file holding temporary table */
+ int nData; /* Number of bytes in pData */
+ char *pData; /* Data for a NEW or OLD pseudo-table */
+ i64 iKey; /* Key for the NEW or OLD pseudo-table row */
+ u8 *pIncrKey; /* Pointer to pKeyInfo->incrKey */
+ KeyInfo *pKeyInfo; /* Info about index keys needed by index cursors */
+ int nField; /* Number of fields in the header */
+ i64 seqCount; /* Sequence counter */
+
+ /* Cached information about the header for the data record that the
+ ** cursor is currently pointing to. Only valid if cacheValid is true.
+ ** zRow might point to (ephemeral) data for the current row, or it might
+ ** be NULL. */
+ Bool cacheValid; /* True if the cache is valid */
+ int payloadSize; /* Total number of bytes in the record */
+ u32 *aType; /* Type values for all entries in the record */
+ u32 *aOffset; /* Cached offsets to the start of each columns data */
+ u8 *aRow; /* Data for the current row, if all on one page */
+};
+typedef struct Cursor Cursor;
+
+/*
+** Number of bytes of string storage space available to each stack
+** layer without having to malloc. NBFS is short for Number of Bytes
+** For Strings.
+*/
+#define NBFS 32
+
+/*
+** Internally, the vdbe manipulates nearly all SQL values as Mem
+** structures. Each Mem struct may cache multiple representations (string,
+** integer etc.) of the same value. A value (and therefore Mem structure)
+** has the following properties:
+**
+** Each value has a manifest type. The manifest type of the value stored
+** in a Mem struct is returned by the MemType(Mem*) macro. The type is
+** one of SQLITE_NULL, SQLITE_INTEGER, SQLITE_REAL, SQLITE_TEXT or
+** SQLITE_BLOB.
+*/
+struct Mem {
+ i64 i; /* Integer value. Or FuncDef* when flags==MEM_Agg */
+ double r; /* Real value */
+ char *z; /* String or BLOB value */
+ int n; /* Number of characters in string value, including '\0' */
+ u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
+ u8 type; /* One of MEM_Null, MEM_Str, etc. */
+ u8 enc; /* TEXT_Utf8, TEXT_Utf16le, or TEXT_Utf16be */
+ void (*xDel)(void *); /* If not null, call this function to delete Mem.z */
+ char zShort[NBFS]; /* Space for short strings */
+};
+typedef struct Mem Mem;
+
+/* One or more of the following flags are set to indicate the validOK
+** representations of the value stored in the Mem struct.
+**
+** If the MEM_Null flag is set, then the value is an SQL NULL value.
+** No other flags may be set in this case.
+**
+** If the MEM_Str flag is set then Mem.z points at a string representation.
+** Usually this is encoded in the same unicode encoding as the main
+** database (see below for exceptions). If the MEM_Term flag is also
+** set, then the string is nul terminated. The MEM_Int and MEM_Real
+** flags may coexist with the MEM_Str flag.
+**
+** Multiple of these values can appear in Mem.flags. But only one
+** at a time can appear in Mem.type.
+*/
+#define MEM_Null 0x0001 /* Value is NULL */
+#define MEM_Str 0x0002 /* Value is a string */
+#define MEM_Int 0x0004 /* Value is an integer */
+#define MEM_Real 0x0008 /* Value is a real number */
+#define MEM_Blob 0x0010 /* Value is a BLOB */
+
+/* Whenever Mem contains a valid string or blob representation, one of
+** the following flags must be set to determine the memory management
+** policy for Mem.z. The MEM_Term flag tells us whether or not the
+** string is \000 or \u0000 terminated
+*/
+#define MEM_Term 0x0020 /* String rep is nul terminated */
+#define MEM_Dyn 0x0040 /* Need to call sqliteFree() on Mem.z */
+#define MEM_Static 0x0080 /* Mem.z points to a static string */
+#define MEM_Ephem 0x0100 /* Mem.z points to an ephemeral string */
+#define MEM_Short 0x0200 /* Mem.z points to Mem.zShort */
+#define MEM_Agg 0x0400 /* Mem.z points to an agg function context */
+
+
+/* A VdbeFunc is just a FuncDef (defined in sqliteInt.h) that contains
+** additional information about auxiliary information bound to arguments
+** of the function. This is used to implement the sqlite3_get_auxdata()
+** and sqlite3_set_auxdata() APIs. The "auxdata" is some auxiliary data
+** that can be associated with a constant argument to a function. This
+** allows functions such as "regexp" to compile their constant regular
+** expression argument once and reused the compiled code for multiple
+** invocations.
+*/
+struct VdbeFunc {
+ FuncDef *pFunc; /* The definition of the function */
+ int nAux; /* Number of entries allocated for apAux[] */
+ struct AuxData {
+ void *pAux; /* Aux data for the i-th argument */
+ void (*xDelete)(void *); /* Destructor for the aux data */
+ } apAux[1]; /* One slot for each function argument */
+};
+typedef struct VdbeFunc VdbeFunc;
+
+/*
+** The "context" argument for a installable function. A pointer to an
+** instance of this structure is the first argument to the routines used
+** implement the SQL functions.
+**
+** There is a typedef for this structure in sqlite.h. So all routines,
+** even the public interface to SQLite, can use a pointer to this structure.
+** But this file is the only place where the internal details of this
+** structure are known.
+**
+** This structure is defined inside of vdbeInt.h because it uses substructures
+** (Mem) which are only defined there.
+*/
+struct sqlite3_context {
+ FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */
+ VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */
+ Mem s; /* The return value is stored here */
+ Mem *pMem; /* Memory cell used to store aggregate context */
+ u8 isError; /* Set to true for an error */
+ CollSeq *pColl; /* Collating sequence */
+};
+
+/*
+** A Set structure is used for quick testing to see if a value
+** is part of a small set. Sets are used to implement code like
+** this:
+** x.y IN ('hi','hoo','hum')
+*/
+typedef struct Set Set;
+struct Set {
+ Hash hash; /* A set is just a hash table */
+ HashElem *prev; /* Previously accessed hash elemen */
+};
+
+/*
+** A FifoPage structure holds a single page of valves. Pages are arranged
+** in a list.
+*/
+typedef struct FifoPage FifoPage;
+struct FifoPage {
+ int nSlot; /* Number of entries aSlot[] */
+ int iWrite; /* Push the next value into this entry in aSlot[] */
+ int iRead; /* Read the next value from this entry in aSlot[] */
+ FifoPage *pNext; /* Next page in the fifo */
+ i64 aSlot[1]; /* One or more slots for rowid values */
+};
+
+/*
+** The Fifo structure is typedef-ed in vdbeInt.h. But the implementation
+** of that structure is private to this file.
+**
+** The Fifo structure describes the entire fifo.
+*/
+typedef struct Fifo Fifo;
+struct Fifo {
+ int nEntry; /* Total number of entries */
+ FifoPage *pFirst; /* First page on the list */
+ FifoPage *pLast; /* Last page on the list */
+};
+
+/*
+** A Context stores the last insert rowid, the last statement change count,
+** and the current statement change count (i.e. changes since last statement).
+** The current keylist is also stored in the context.
+** Elements of Context structure type make up the ContextStack, which is
+** updated by the ContextPush and ContextPop opcodes (used by triggers).
+** The context is pushed before executing a trigger a popped when the
+** trigger finishes.
+*/
+typedef struct Context Context;
+struct Context {
+ int lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
+ int nChange; /* Statement changes (Vdbe.nChanges) */
+ Fifo sFifo; /* Records that will participate in a DELETE or UPDATE */
+};
+
+/*
+** An instance of the virtual machine. This structure contains the complete
+** state of the virtual machine.
+**
+** The "sqlite3_stmt" structure pointer that is returned by sqlite3_compile()
+** is really a pointer to an instance of this structure.
+*/
+struct Vdbe {
+ sqlite3 *db; /* The whole database */
+ Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
+ FILE *trace; /* Write an execution trace here, if not NULL */
+ int nOp; /* Number of instructions in the program */
+ int nOpAlloc; /* Number of slots allocated for aOp[] */
+ Op *aOp; /* Space to hold the virtual machine's program */
+ int nLabel; /* Number of labels used */
+ int nLabelAlloc; /* Number of slots allocated in aLabel[] */
+ int *aLabel; /* Space to hold the labels */
+ Mem *aStack; /* The operand stack, except string values */
+ Mem *pTos; /* Top entry in the operand stack */
+ Mem **apArg; /* Arguments to currently executing user function */
+ Mem *aColName; /* Column names to return */
+ int nCursor; /* Number of slots in apCsr[] */
+ Cursor **apCsr; /* One element of this array for each open cursor */
+ int nVar; /* Number of entries in aVar[] */
+ Mem *aVar; /* Values for the OP_Variable opcode. */
+ char **azVar; /* Name of variables */
+ int okVar; /* True if azVar[] has been initialized */
+ int magic; /* Magic number for sanity checking */
+ int nMem; /* Number of memory locations currently allocated */
+ Mem *aMem; /* The memory locations */
+ int nCallback; /* Number of callbacks invoked so far */
+ Fifo sFifo; /* A list of ROWIDs */
+ int contextStackTop; /* Index of top element in the context stack */
+ int contextStackDepth; /* The size of the "context" stack */
+ Context *contextStack; /* Stack used by opcodes ContextPush & ContextPop*/
+ int pc; /* The program counter */
+ int rc; /* Value to return */
+ unsigned uniqueCnt; /* Used by OP_MakeRecord when P2!=0 */
+ int errorAction; /* Recovery action to do in case of an error */
+ int inTempTrans; /* True if temp database is transactioned */
+ int returnStack[100]; /* Return address stack for OP_Gosub & OP_Return */
+ int returnDepth; /* Next unused element in returnStack[] */
+ int nResColumn; /* Number of columns in one row of the result set */
+ char **azResColumn; /* Values for one row of result */
+ int popStack; /* Pop the stack this much on entry to VdbeExec() */
+ char *zErrMsg; /* Error message written here */
+ u8 resOnStack; /* True if there are result values on the stack */
+ u8 explain; /* True if EXPLAIN present on SQL command */
+ u8 changeCntOn; /* True to update the change-counter */
+ u8 aborted; /* True if ROLLBACK in another VM causes an abort */
+ u8 expired; /* True if the VM needs to be recompiled */
+ int nChange; /* Number of db changes made since last reset */
+ i64 startTime; /* Time when query started - used for profiling */
+};
+
+/*
+** The following are allowed values for Vdbe.magic
+*/
+#define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */
+#define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */
+#define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */
+#define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */
+
+/*
+** Function prototypes
+*/
+void sqlite3VdbeFreeCursor(Cursor*);
+void sqliteVdbePopStack(Vdbe*,int);
+int sqlite3VdbeCursorMoveto(Cursor*);
+#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
+void sqlite3VdbePrintOp(FILE*, int, Op*);
+#endif
+#ifdef SQLITE_DEBUG
+void sqlite3VdbePrintSql(Vdbe*);
+#endif
+int sqlite3VdbeSerialTypeLen(u32);
+u32 sqlite3VdbeSerialType(Mem*);
+int sqlite3VdbeSerialPut(unsigned char*, Mem*);
+int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
+void sqlite3VdbeDeleteAuxData(VdbeFunc*, int);
+
+int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
+int sqlite3VdbeIdxKeyCompare(Cursor*, int , const unsigned char*, int*);
+int sqlite3VdbeIdxRowid(BtCursor *, i64 *);
+int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
+int sqlite3VdbeRecordCompare(void*,int,const void*,int, const void*);
+int sqlite3VdbeIdxRowidLen(int,const u8*);
+int sqlite3VdbeExec(Vdbe*);
+int sqlite3VdbeList(Vdbe*);
+int sqlite3VdbeHalt(Vdbe*);
+int sqlite3VdbeChangeEncoding(Mem *, int);
+int sqlite3VdbeMemCopy(Mem*, const Mem*);
+void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int);
+int sqlite3VdbeMemMove(Mem*, Mem*);
+int sqlite3VdbeMemNulTerminate(Mem*);
+int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*));
+void sqlite3VdbeMemSetInt64(Mem*, i64);
+void sqlite3VdbeMemSetDouble(Mem*, double);
+void sqlite3VdbeMemSetNull(Mem*);
+int sqlite3VdbeMemMakeWriteable(Mem*);
+int sqlite3VdbeMemDynamicify(Mem*);
+int sqlite3VdbeMemStringify(Mem*, int);
+i64 sqlite3VdbeIntValue(Mem*);
+int sqlite3VdbeMemIntegerify(Mem*);
+double sqlite3VdbeRealValue(Mem*);
+int sqlite3VdbeMemRealify(Mem*);
+int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*);
+void sqlite3VdbeMemRelease(Mem *p);
+void sqlite3VdbeMemFinalize(Mem*, FuncDef*);
+#ifndef NDEBUG
+void sqlite3VdbeMemSanity(Mem*, u8);
+int sqlite3VdbeOpcodeNoPush(u8);
+#endif
+int sqlite3VdbeMemTranslate(Mem*, u8);
+void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf);
+int sqlite3VdbeMemHandleBom(Mem *pMem);
+void sqlite3VdbeFifoInit(Fifo*);
+int sqlite3VdbeFifoPush(Fifo*, i64);
+int sqlite3VdbeFifoPop(Fifo*, i64*);
+void sqlite3VdbeFifoClear(Fifo*);
diff --git a/ext/pdo_sqlite/sqlite/src/vdbeapi.c b/ext/pdo_sqlite/sqlite/src/vdbeapi.c
new file mode 100644
index 000000000..2fd54f38e
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/vdbeapi.c
@@ -0,0 +1,737 @@
+/*
+** 2004 May 26
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This file contains code use to implement APIs that are part of the
+** VDBE.
+*/
+#include "sqliteInt.h"
+#include "vdbeInt.h"
+#include "os.h"
+
+/*
+** Return TRUE (non-zero) of the statement supplied as an argument needs
+** to be recompiled. A statement needs to be recompiled whenever the
+** execution environment changes in a way that would alter the program
+** that sqlite3_prepare() generates. For example, if new functions or
+** collating sequences are registered or if an authorizer function is
+** added or changed.
+*/
+int sqlite3_expired(sqlite3_stmt *pStmt){
+ Vdbe *p = (Vdbe*)pStmt;
+ return p==0 || p->expired;
+}
+
+/**************************** sqlite3_value_ *******************************
+** The following routines extract information from a Mem or sqlite3_value
+** structure.
+*/
+const void *sqlite3_value_blob(sqlite3_value *pVal){
+ Mem *p = (Mem*)pVal;
+ if( p->flags & (MEM_Blob|MEM_Str) ){
+ return p->z;
+ }else{
+ return sqlite3_value_text(pVal);
+ }
+}
+int sqlite3_value_bytes(sqlite3_value *pVal){
+ return sqlite3ValueBytes(pVal, SQLITE_UTF8);
+}
+int sqlite3_value_bytes16(sqlite3_value *pVal){
+ return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
+}
+double sqlite3_value_double(sqlite3_value *pVal){
+ return sqlite3VdbeRealValue((Mem*)pVal);
+}
+int sqlite3_value_int(sqlite3_value *pVal){
+ return sqlite3VdbeIntValue((Mem*)pVal);
+}
+sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
+ return sqlite3VdbeIntValue((Mem*)pVal);
+}
+const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
+ return (const char *)sqlite3ValueText(pVal, SQLITE_UTF8);
+}
+#ifndef SQLITE_OMIT_UTF16
+const void *sqlite3_value_text16(sqlite3_value* pVal){
+ return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
+}
+const void *sqlite3_value_text16be(sqlite3_value *pVal){
+ return sqlite3ValueText(pVal, SQLITE_UTF16BE);
+}
+const void *sqlite3_value_text16le(sqlite3_value *pVal){
+ return sqlite3ValueText(pVal, SQLITE_UTF16LE);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+int sqlite3_value_type(sqlite3_value* pVal){
+ return pVal->type;
+}
+
+/**************************** sqlite3_result_ *******************************
+** The following routines are used by user-defined functions to specify
+** the function result.
+*/
+void sqlite3_result_blob(
+ sqlite3_context *pCtx,
+ const void *z,
+ int n,
+ void (*xDel)(void *)
+){
+ assert( n>=0 );
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, 0, xDel);
+}
+void sqlite3_result_double(sqlite3_context *pCtx, double rVal){
+ sqlite3VdbeMemSetDouble(&pCtx->s, rVal);
+}
+void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
+ pCtx->isError = 1;
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
+}
+void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
+ pCtx->isError = 1;
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
+}
+void sqlite3_result_int(sqlite3_context *pCtx, int iVal){
+ sqlite3VdbeMemSetInt64(&pCtx->s, (i64)iVal);
+}
+void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
+ sqlite3VdbeMemSetInt64(&pCtx->s, iVal);
+}
+void sqlite3_result_null(sqlite3_context *pCtx){
+ sqlite3VdbeMemSetNull(&pCtx->s);
+}
+void sqlite3_result_text(
+ sqlite3_context *pCtx,
+ const char *z,
+ int n,
+ void (*xDel)(void *)
+){
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, xDel);
+}
+#ifndef SQLITE_OMIT_UTF16
+void sqlite3_result_text16(
+ sqlite3_context *pCtx,
+ const void *z,
+ int n,
+ void (*xDel)(void *)
+){
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, xDel);
+}
+void sqlite3_result_text16be(
+ sqlite3_context *pCtx,
+ const void *z,
+ int n,
+ void (*xDel)(void *)
+){
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16BE, xDel);
+}
+void sqlite3_result_text16le(
+ sqlite3_context *pCtx,
+ const void *z,
+ int n,
+ void (*xDel)(void *)
+){
+ sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16LE, xDel);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
+ sqlite3VdbeMemCopy(&pCtx->s, pValue);
+}
+
+
+/*
+** Execute the statement pStmt, either until a row of data is ready, the
+** statement is completely executed or an error occurs.
+*/
+int sqlite3_step(sqlite3_stmt *pStmt){
+ Vdbe *p = (Vdbe*)pStmt;
+ sqlite3 *db;
+ int rc;
+
+ if( p==0 || p->magic!=VDBE_MAGIC_RUN ){
+ return SQLITE_MISUSE;
+ }
+ if( p->aborted ){
+ return SQLITE_ABORT;
+ }
+ if( p->pc<=0 && p->expired ){
+ if( p->rc==SQLITE_OK ){
+ p->rc = SQLITE_SCHEMA;
+ }
+ return SQLITE_ERROR;
+ }
+ db = p->db;
+ if( sqlite3SafetyOn(db) ){
+ p->rc = SQLITE_MISUSE;
+ return SQLITE_MISUSE;
+ }
+ if( p->pc<0 ){
+#ifndef SQLITE_OMIT_TRACE
+ /* Invoke the trace callback if there is one
+ */
+ if( db->xTrace && !db->init.busy ){
+ assert( p->nOp>0 );
+ assert( p->aOp[p->nOp-1].opcode==OP_Noop );
+ assert( p->aOp[p->nOp-1].p3!=0 );
+ assert( p->aOp[p->nOp-1].p3type==P3_DYNAMIC );
+ sqlite3SafetyOff(db);
+ db->xTrace(db->pTraceArg, p->aOp[p->nOp-1].p3);
+ if( sqlite3SafetyOn(db) ){
+ p->rc = SQLITE_MISUSE;
+ return SQLITE_MISUSE;
+ }
+ }
+ if( db->xProfile && !db->init.busy ){
+ double rNow;
+ sqlite3OsCurrentTime(&rNow);
+ p->startTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0;
+ }
+#endif
+
+ /* Print a copy of SQL as it is executed if the SQL_TRACE pragma is turned
+ ** on in debugging mode.
+ */
+#ifdef SQLITE_DEBUG
+ if( (db->flags & SQLITE_SqlTrace)!=0 ){
+ sqlite3DebugPrintf("SQL-trace: %s\n", p->aOp[p->nOp-1].p3);
+ }
+#endif /* SQLITE_DEBUG */
+
+ db->activeVdbeCnt++;
+ p->pc = 0;
+ }
+#ifndef SQLITE_OMIT_EXPLAIN
+ if( p->explain ){
+ rc = sqlite3VdbeList(p);
+ }else
+#endif /* SQLITE_OMIT_EXPLAIN */
+ {
+ rc = sqlite3VdbeExec(p);
+ }
+
+ if( sqlite3SafetyOff(db) ){
+ rc = SQLITE_MISUSE;
+ }
+
+#ifndef SQLITE_OMIT_TRACE
+ /* Invoke the profile callback if there is one
+ */
+ if( rc!=SQLITE_ROW && db->xProfile && !db->init.busy ){
+ double rNow;
+ u64 elapseTime;
+
+ sqlite3OsCurrentTime(&rNow);
+ elapseTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0 - p->startTime;
+ assert( p->nOp>0 );
+ assert( p->aOp[p->nOp-1].opcode==OP_Noop );
+ assert( p->aOp[p->nOp-1].p3!=0 );
+ assert( p->aOp[p->nOp-1].p3type==P3_DYNAMIC );
+ db->xProfile(db->pProfileArg, p->aOp[p->nOp-1].p3, elapseTime);
+ }
+#endif
+
+ sqlite3Error(p->db, rc, p->zErrMsg ? "%s" : 0, p->zErrMsg);
+ return rc;
+}
+
+/*
+** Extract the user data from a sqlite3_context structure and return a
+** pointer to it.
+*/
+void *sqlite3_user_data(sqlite3_context *p){
+ assert( p && p->pFunc );
+ return p->pFunc->pUserData;
+}
+
+/*
+** Allocate or return the aggregate context for a user function. A new
+** context is allocated on the first call. Subsequent calls return the
+** same context that was returned on prior calls.
+*/
+void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
+ Mem *pMem = p->pMem;
+ assert( p && p->pFunc && p->pFunc->xStep );
+ if( (pMem->flags & MEM_Agg)==0 ){
+ if( nByte==0 ){
+ assert( pMem->flags==MEM_Null );
+ pMem->z = 0;
+ }else{
+ pMem->flags = MEM_Agg;
+ pMem->xDel = sqlite3FreeX;
+ *(FuncDef**)&pMem->i = p->pFunc;
+ if( nByte<=NBFS ){
+ pMem->z = pMem->zShort;
+ memset(pMem->z, 0, nByte);
+ }else{
+ pMem->z = sqliteMalloc( nByte );
+ }
+ }
+ }
+ return (void*)pMem->z;
+}
+
+/*
+** Return the auxilary data pointer, if any, for the iArg'th argument to
+** the user-function defined by pCtx.
+*/
+void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
+ VdbeFunc *pVdbeFunc = pCtx->pVdbeFunc;
+ if( !pVdbeFunc || iArg>=pVdbeFunc->nAux || iArg<0 ){
+ return 0;
+ }
+ return pVdbeFunc->apAux[iArg].pAux;
+}
+
+/*
+** Set the auxilary data pointer and delete function, for the iArg'th
+** argument to the user-function defined by pCtx. Any previous value is
+** deleted by calling the delete function specified when it was set.
+*/
+void sqlite3_set_auxdata(
+ sqlite3_context *pCtx,
+ int iArg,
+ void *pAux,
+ void (*xDelete)(void*)
+){
+ struct AuxData *pAuxData;
+ VdbeFunc *pVdbeFunc;
+ if( iArg<0 ) return;
+
+ pVdbeFunc = pCtx->pVdbeFunc;
+ if( !pVdbeFunc || pVdbeFunc->nAux<=iArg ){
+ int nMalloc = sizeof(VdbeFunc) + sizeof(struct AuxData)*iArg;
+ pVdbeFunc = sqliteRealloc(pVdbeFunc, nMalloc);
+ if( !pVdbeFunc ) return;
+ pCtx->pVdbeFunc = pVdbeFunc;
+ memset(&pVdbeFunc->apAux[pVdbeFunc->nAux], 0,
+ sizeof(struct AuxData)*(iArg+1-pVdbeFunc->nAux));
+ pVdbeFunc->nAux = iArg+1;
+ pVdbeFunc->pFunc = pCtx->pFunc;
+ }
+
+ pAuxData = &pVdbeFunc->apAux[iArg];
+ if( pAuxData->pAux && pAuxData->xDelete ){
+ pAuxData->xDelete(pAuxData->pAux);
+ }
+ pAuxData->pAux = pAux;
+ pAuxData->xDelete = xDelete;
+}
+
+/*
+** Return the number of times the Step function of a aggregate has been
+** called.
+**
+** This routine is defined here in vdbe.c because it depends on knowing
+** the internals of the sqlite3_context structure which is only defined in
+** this source file.
+*/
+int sqlite3_aggregate_count(sqlite3_context *p){
+ assert( p && p->pFunc && p->pFunc->xStep );
+ return p->pMem->n;
+}
+
+/*
+** Return the number of columns in the result set for the statement pStmt.
+*/
+int sqlite3_column_count(sqlite3_stmt *pStmt){
+ Vdbe *pVm = (Vdbe *)pStmt;
+ return pVm ? pVm->nResColumn : 0;
+}
+
+/*
+** Return the number of values available from the current row of the
+** currently executing statement pStmt.
+*/
+int sqlite3_data_count(sqlite3_stmt *pStmt){
+ Vdbe *pVm = (Vdbe *)pStmt;
+ if( pVm==0 || !pVm->resOnStack ) return 0;
+ return pVm->nResColumn;
+}
+
+
+/*
+** Check to see if column iCol of the given statement is valid. If
+** it is, return a pointer to the Mem for the value of that column.
+** If iCol is not valid, return a pointer to a Mem which has a value
+** of NULL.
+*/
+static Mem *columnMem(sqlite3_stmt *pStmt, int i){
+ Vdbe *pVm = (Vdbe *)pStmt;
+ int vals = sqlite3_data_count(pStmt);
+ if( i>=vals || i<0 ){
+ static Mem nullMem;
+ if( nullMem.flags==0 ){ nullMem.flags = MEM_Null; }
+ sqlite3Error(pVm->db, SQLITE_RANGE, 0);
+ return &nullMem;
+ }
+ return &pVm->pTos[(1-vals)+i];
+}
+
+/**************************** sqlite3_column_ *******************************
+** The following routines are used to access elements of the current row
+** in the result set.
+*/
+const void *sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
+ return sqlite3_value_blob( columnMem(pStmt,i) );
+}
+int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
+ return sqlite3_value_bytes( columnMem(pStmt,i) );
+}
+int sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
+ return sqlite3_value_bytes16( columnMem(pStmt,i) );
+}
+double sqlite3_column_double(sqlite3_stmt *pStmt, int i){
+ return sqlite3_value_double( columnMem(pStmt,i) );
+}
+int sqlite3_column_int(sqlite3_stmt *pStmt, int i){
+ return sqlite3_value_int( columnMem(pStmt,i) );
+}
+sqlite_int64 sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
+ return sqlite3_value_int64( columnMem(pStmt,i) );
+}
+const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){
+ return sqlite3_value_text( columnMem(pStmt,i) );
+}
+#if 0
+sqlite3_value *sqlite3_column_value(sqlite3_stmt *pStmt, int i){
+ return columnMem(pStmt, i);
+}
+#endif
+#ifndef SQLITE_OMIT_UTF16
+const void *sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
+ return sqlite3_value_text16( columnMem(pStmt,i) );
+}
+#endif /* SQLITE_OMIT_UTF16 */
+int sqlite3_column_type(sqlite3_stmt *pStmt, int i){
+ return sqlite3_value_type( columnMem(pStmt,i) );
+}
+
+/*
+** Convert the N-th element of pStmt->pColName[] into a string using
+** xFunc() then return that string. If N is out of range, return 0.
+**
+** There are up to 5 names for each column. useType determines which
+** name is returned. Here are the names:
+**
+** 0 The column name as it should be displayed for output
+** 1 The datatype name for the column
+** 2 The name of the database that the column derives from
+** 3 The name of the table that the column derives from
+** 4 The name of the table column that the result column derives from
+**
+** If the result is not a simple column reference (if it is an expression
+** or a constant) then useTypes 2, 3, and 4 return NULL.
+*/
+static const void *columnName(
+ sqlite3_stmt *pStmt,
+ int N,
+ const void *(*xFunc)(Mem*),
+ int useType
+){
+ Vdbe *p = (Vdbe *)pStmt;
+ int n = sqlite3_column_count(pStmt);
+
+ if( p==0 || N>=n || N<0 ){
+ return 0;
+ }
+ N += useType*n;
+ return xFunc(&p->aColName[N]);
+}
+
+
+/*
+** Return the name of the Nth column of the result set returned by SQL
+** statement pStmt.
+*/
+const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 0);
+}
+#ifndef SQLITE_OMIT_UTF16
+const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 0);
+}
+#endif
+
+/*
+** Return the column declaration type (if applicable) of the 'i'th column
+** of the result set of SQL statement pStmt.
+*/
+const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 1);
+}
+#ifndef SQLITE_OMIT_UTF16
+const void *sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 1);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+#if !defined(SQLITE_OMIT_ORIGIN_NAMES) && 0
+/*
+** Return the name of the database from which a result column derives.
+** NULL is returned if the result column is an expression or constant or
+** anything else which is not an unabiguous reference to a database column.
+*/
+const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 2);
+}
+#ifndef SQLITE_OMIT_UTF16
+const void *sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 2);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+/*
+** Return the name of the table from which a result column derives.
+** NULL is returned if the result column is an expression or constant or
+** anything else which is not an unabiguous reference to a database column.
+*/
+const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 3);
+}
+#ifndef SQLITE_OMIT_UTF16
+const void *sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 3);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+/*
+** Return the name of the table column from which a result column derives.
+** NULL is returned if the result column is an expression or constant or
+** anything else which is not an unabiguous reference to a database column.
+*/
+const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, 4);
+}
+#ifndef SQLITE_OMIT_UTF16
+const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){
+ return columnName(pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, 4);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_ORIGIN_NAMES */
+
+
+
+
+/******************************* sqlite3_bind_ ***************************
+**
+** Routines used to attach values to wildcards in a compiled SQL statement.
+*/
+/*
+** Unbind the value bound to variable i in virtual machine p. This is the
+** the same as binding a NULL value to the column. If the "i" parameter is
+** out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK.
+**
+** The error code stored in database p->db is overwritten with the return
+** value in any case.
+*/
+static int vdbeUnbind(Vdbe *p, int i){
+ Mem *pVar;
+ if( p==0 || p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){
+ if( p ) sqlite3Error(p->db, SQLITE_MISUSE, 0);
+ return SQLITE_MISUSE;
+ }
+ if( i<1 || i>p->nVar ){
+ sqlite3Error(p->db, SQLITE_RANGE, 0);
+ return SQLITE_RANGE;
+ }
+ i--;
+ pVar = &p->aVar[i];
+ sqlite3VdbeMemRelease(pVar);
+ pVar->flags = MEM_Null;
+ sqlite3Error(p->db, SQLITE_OK, 0);
+ return SQLITE_OK;
+}
+
+/*
+** Bind a text or BLOB value.
+*/
+static int bindText(
+ sqlite3_stmt *pStmt,
+ int i,
+ const void *zData,
+ int nData,
+ void (*xDel)(void*),
+ int encoding
+){
+ Vdbe *p = (Vdbe *)pStmt;
+ Mem *pVar;
+ int rc;
+
+ rc = vdbeUnbind(p, i);
+ if( rc || zData==0 ){
+ return rc;
+ }
+ pVar = &p->aVar[i-1];
+ rc = sqlite3VdbeMemSetStr(pVar, zData, nData, encoding, xDel);
+ if( rc ){
+ return rc;
+ }
+ if( rc==SQLITE_OK && encoding!=0 ){
+ rc = sqlite3VdbeChangeEncoding(pVar, p->db->enc);
+ }
+ return rc;
+}
+
+
+/*
+** Bind a blob value to an SQL statement variable.
+*/
+int sqlite3_bind_blob(
+ sqlite3_stmt *pStmt,
+ int i,
+ const void *zData,
+ int nData,
+ void (*xDel)(void*)
+){
+ return bindText(pStmt, i, zData, nData, xDel, 0);
+}
+int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
+ int rc;
+ Vdbe *p = (Vdbe *)pStmt;
+ rc = vdbeUnbind(p, i);
+ if( rc==SQLITE_OK ){
+ sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
+ }
+ return rc;
+}
+int sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
+ return sqlite3_bind_int64(p, i, (i64)iValue);
+}
+int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
+ int rc;
+ Vdbe *p = (Vdbe *)pStmt;
+ rc = vdbeUnbind(p, i);
+ if( rc==SQLITE_OK ){
+ sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
+ }
+ return rc;
+}
+int sqlite3_bind_null(sqlite3_stmt* p, int i){
+ return vdbeUnbind((Vdbe *)p, i);
+}
+int sqlite3_bind_text(
+ sqlite3_stmt *pStmt,
+ int i,
+ const char *zData,
+ int nData,
+ void (*xDel)(void*)
+){
+ return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
+}
+#ifndef SQLITE_OMIT_UTF16
+int sqlite3_bind_text16(
+ sqlite3_stmt *pStmt,
+ int i,
+ const void *zData,
+ int nData,
+ void (*xDel)(void*)
+){
+ return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+
+/*
+** Return the number of wildcards that can be potentially bound to.
+** This routine is added to support DBD::SQLite.
+*/
+int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
+ Vdbe *p = (Vdbe*)pStmt;
+ return p ? p->nVar : 0;
+}
+
+/*
+** Create a mapping from variable numbers to variable names
+** in the Vdbe.azVar[] array, if such a mapping does not already
+** exist.
+*/
+static void createVarMap(Vdbe *p){
+ if( !p->okVar ){
+ int j;
+ Op *pOp;
+ for(j=0, pOp=p->aOp; j<p->nOp; j++, pOp++){
+ if( pOp->opcode==OP_Variable ){
+ assert( pOp->p1>0 && pOp->p1<=p->nVar );
+ p->azVar[pOp->p1-1] = pOp->p3;
+ }
+ }
+ p->okVar = 1;
+ }
+}
+
+/*
+** Return the name of a wildcard parameter. Return NULL if the index
+** is out of range or if the wildcard is unnamed.
+**
+** The result is always UTF-8.
+*/
+const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
+ Vdbe *p = (Vdbe*)pStmt;
+ if( p==0 || i<1 || i>p->nVar ){
+ return 0;
+ }
+ createVarMap(p);
+ return p->azVar[i-1];
+}
+
+/*
+** Given a wildcard parameter name, return the index of the variable
+** with that name. If there is no variable with the given name,
+** return 0.
+*/
+int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
+ Vdbe *p = (Vdbe*)pStmt;
+ int i;
+ if( p==0 ){
+ return 0;
+ }
+ createVarMap(p);
+ if( zName ){
+ for(i=0; i<p->nVar; i++){
+ const char *z = p->azVar[i];
+ if( z && strcmp(z,zName)==0 ){
+ return i+1;
+ }
+ }
+ }
+ return 0;
+}
+
+/*
+** Transfer all bindings from the first statement over to the second.
+** If the two statements contain a different number of bindings, then
+** an SQLITE_ERROR is returned.
+*/
+int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
+ Vdbe *pFrom = (Vdbe*)pFromStmt;
+ Vdbe *pTo = (Vdbe*)pToStmt;
+ int i, rc = SQLITE_OK;
+ if( (pFrom->magic!=VDBE_MAGIC_RUN && pFrom->magic!=VDBE_MAGIC_HALT)
+ || (pTo->magic!=VDBE_MAGIC_RUN && pTo->magic!=VDBE_MAGIC_HALT) ){
+ return SQLITE_MISUSE;
+ }
+ if( pFrom->nVar!=pTo->nVar ){
+ return SQLITE_ERROR;
+ }
+ for(i=0; rc==SQLITE_OK && i<pFrom->nVar; i++){
+ rc = sqlite3VdbeMemMove(&pTo->aVar[i], &pFrom->aVar[i]);
+ }
+ return rc;
+}
+
+/*
+** Return the sqlite3* database handle to which the prepared statement given
+** in the argument belongs. This is the same database handle that was
+** the first argument to the sqlite3_prepare() that was used to create
+** the statement in the first place.
+*/
+sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){
+ return pStmt ? ((Vdbe*)pStmt)->db : 0;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/vdbeaux.c b/ext/pdo_sqlite/sqlite/src/vdbeaux.c
new file mode 100644
index 000000000..cba9c096d
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/vdbeaux.c
@@ -0,0 +1,1819 @@
+/*
+** 2003 September 6
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains code used for creating, destroying, and populating
+** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) Prior
+** to version 2.8.7, all this code was combined into the vdbe.c source file.
+** But that file was getting too big so this subroutines were split out.
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#include <ctype.h>
+#include "vdbeInt.h"
+
+
+/*
+** When debugging the code generator in a symbolic debugger, one can
+** set the sqlite3_vdbe_addop_trace to 1 and all opcodes will be printed
+** as they are added to the instruction stream.
+*/
+#ifdef SQLITE_DEBUG
+int sqlite3_vdbe_addop_trace = 0;
+#endif
+
+
+/*
+** Create a new virtual database engine.
+*/
+Vdbe *sqlite3VdbeCreate(sqlite3 *db){
+ Vdbe *p;
+ p = sqliteMalloc( sizeof(Vdbe) );
+ if( p==0 ) return 0;
+ p->db = db;
+ if( db->pVdbe ){
+ db->pVdbe->pPrev = p;
+ }
+ p->pNext = db->pVdbe;
+ p->pPrev = 0;
+ db->pVdbe = p;
+ p->magic = VDBE_MAGIC_INIT;
+ return p;
+}
+
+/*
+** Turn tracing on or off
+*/
+void sqlite3VdbeTrace(Vdbe *p, FILE *trace){
+ p->trace = trace;
+}
+
+/*
+** Resize the Vdbe.aOp array so that it contains at least N
+** elements. If the Vdbe is in VDBE_MAGIC_RUN state, then
+** the Vdbe.aOp array will be sized to contain exactly N
+** elements.
+*/
+static void resizeOpArray(Vdbe *p, int N){
+ int runMode = p->magic==VDBE_MAGIC_RUN;
+ if( runMode || p->nOpAlloc<N ){
+ VdbeOp *pNew;
+ int nNew = N + 100*(!runMode);
+ int oldSize = p->nOpAlloc;
+ pNew = sqliteRealloc(p->aOp, nNew*sizeof(Op));
+ if( pNew ){
+ p->nOpAlloc = nNew;
+ p->aOp = pNew;
+ if( nNew>oldSize ){
+ memset(&p->aOp[oldSize], 0, (nNew-oldSize)*sizeof(Op));
+ }
+ }
+ }
+}
+
+/*
+** Add a new instruction to the list of instructions current in the
+** VDBE. Return the address of the new instruction.
+**
+** Parameters:
+**
+** p Pointer to the VDBE
+**
+** op The opcode for this instruction
+**
+** p1, p2 First two of the three possible operands.
+**
+** Use the sqlite3VdbeResolveLabel() function to fix an address and
+** the sqlite3VdbeChangeP3() function to change the value of the P3
+** operand.
+*/
+int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){
+ int i;
+ VdbeOp *pOp;
+
+ i = p->nOp;
+ p->nOp++;
+ assert( p->magic==VDBE_MAGIC_INIT );
+ resizeOpArray(p, i+1);
+ if( sqlite3_malloc_failed ){
+ return 0;
+ }
+ pOp = &p->aOp[i];
+ pOp->opcode = op;
+ pOp->p1 = p1;
+ pOp->p2 = p2;
+ pOp->p3 = 0;
+ pOp->p3type = P3_NOTUSED;
+ p->expired = 0;
+#ifdef SQLITE_DEBUG
+ if( sqlite3_vdbe_addop_trace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]);
+#endif
+ return i;
+}
+
+/*
+** Add an opcode that includes the p3 value.
+*/
+int sqlite3VdbeOp3(Vdbe *p, int op, int p1, int p2, const char *zP3,int p3type){
+ int addr = sqlite3VdbeAddOp(p, op, p1, p2);
+ sqlite3VdbeChangeP3(p, addr, zP3, p3type);
+ return addr;
+}
+
+/*
+** Create a new symbolic label for an instruction that has yet to be
+** coded. The symbolic label is really just a negative number. The
+** label can be used as the P2 value of an operation. Later, when
+** the label is resolved to a specific address, the VDBE will scan
+** through its operation list and change all values of P2 which match
+** the label into the resolved address.
+**
+** The VDBE knows that a P2 value is a label because labels are
+** always negative and P2 values are suppose to be non-negative.
+** Hence, a negative P2 value is a label that has yet to be resolved.
+**
+** Zero is returned if a malloc() fails.
+*/
+int sqlite3VdbeMakeLabel(Vdbe *p){
+ int i;
+ i = p->nLabel++;
+ assert( p->magic==VDBE_MAGIC_INIT );
+ if( i>=p->nLabelAlloc ){
+ p->nLabelAlloc = p->nLabelAlloc*2 + 10;
+ sqlite3ReallocOrFree((void**)&p->aLabel,
+ p->nLabelAlloc*sizeof(p->aLabel[0]));
+ }
+ if( p->aLabel ){
+ p->aLabel[i] = -1;
+ }
+ return -1-i;
+}
+
+/*
+** Resolve label "x" to be the address of the next instruction to
+** be inserted. The parameter "x" must have been obtained from
+** a prior call to sqlite3VdbeMakeLabel().
+*/
+void sqlite3VdbeResolveLabel(Vdbe *p, int x){
+ int j = -1-x;
+ assert( p->magic==VDBE_MAGIC_INIT );
+ assert( j>=0 && j<p->nLabel );
+ if( p->aLabel ){
+ p->aLabel[j] = p->nOp;
+ }
+}
+
+/*
+** Return non-zero if opcode 'op' is guarenteed not to push more values
+** onto the VDBE stack than it pops off.
+*/
+static int opcodeNoPush(u8 op){
+ /* The 10 NOPUSH_MASK_n constants are defined in the automatically
+ ** generated header file opcodes.h. Each is a 16-bit bitmask, one
+ ** bit corresponding to each opcode implemented by the virtual
+ ** machine in vdbe.c. The bit is true if the word "no-push" appears
+ ** in a comment on the same line as the "case OP_XXX:" in
+ ** sqlite3VdbeExec() in vdbe.c.
+ **
+ ** If the bit is true, then the corresponding opcode is guarenteed not
+ ** to grow the stack when it is executed. Otherwise, it may grow the
+ ** stack by at most one entry.
+ **
+ ** NOPUSH_MASK_0 corresponds to opcodes 0 to 15. NOPUSH_MASK_1 contains
+ ** one bit for opcodes 16 to 31, and so on.
+ **
+ ** 16-bit bitmasks (rather than 32-bit) are specified in opcodes.h
+ ** because the file is generated by an awk program. Awk manipulates
+ ** all numbers as floating-point and we don't want to risk a rounding
+ ** error if someone builds with an awk that uses (for example) 32-bit
+ ** IEEE floats.
+ */
+ static const u32 masks[5] = {
+ NOPUSH_MASK_0 + (NOPUSH_MASK_1<<16),
+ NOPUSH_MASK_2 + (NOPUSH_MASK_3<<16),
+ NOPUSH_MASK_4 + (NOPUSH_MASK_5<<16),
+ NOPUSH_MASK_6 + (NOPUSH_MASK_7<<16),
+ NOPUSH_MASK_8 + (NOPUSH_MASK_9<<16)
+ };
+ return (masks[op>>5] & (1<<(op&0x1F)));
+}
+
+#ifndef NDEBUG
+int sqlite3VdbeOpcodeNoPush(u8 op){
+ return opcodeNoPush(op);
+}
+#endif
+
+/*
+** Loop through the program looking for P2 values that are negative.
+** Each such value is a label. Resolve the label by setting the P2
+** value to its correct non-zero value.
+**
+** This routine is called once after all opcodes have been inserted.
+**
+** Variable *pMaxFuncArgs is set to the maximum value of any P2 argument
+** to an OP_Function or OP_AggStep opcode. This is used by
+** sqlite3VdbeMakeReady() to size the Vdbe.apArg[] array.
+**
+** The integer *pMaxStack is set to the maximum number of vdbe stack
+** entries that static analysis reveals this program might need.
+**
+** This routine also does the following optimization: It scans for
+** Halt instructions where P1==SQLITE_CONSTRAINT or P2==OE_Abort or for
+** IdxInsert instructions where P2!=0. If no such instruction is
+** found, then every Statement instruction is changed to a Noop. In
+** this way, we avoid creating the statement journal file unnecessarily.
+*/
+static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs, int *pMaxStack){
+ int i;
+ int nMaxArgs = 0;
+ int nMaxStack = p->nOp;
+ Op *pOp;
+ int *aLabel = p->aLabel;
+ int doesStatementRollback = 0;
+ int hasStatementBegin = 0;
+ for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
+ u8 opcode = pOp->opcode;
+
+ if( opcode==OP_Function || opcode==OP_AggStep ){
+ if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2;
+ }else if( opcode==OP_Halt ){
+ if( pOp->p1==SQLITE_CONSTRAINT && pOp->p2==OE_Abort ){
+ doesStatementRollback = 1;
+ }
+ }else if( opcode==OP_IdxInsert ){
+ if( pOp->p2 ){
+ doesStatementRollback = 1;
+ }
+ }else if( opcode==OP_Statement ){
+ hasStatementBegin = 1;
+ }
+
+ if( opcodeNoPush(opcode) ){
+ nMaxStack--;
+ }
+
+ if( pOp->p2>=0 ) continue;
+ assert( -1-pOp->p2<p->nLabel );
+ pOp->p2 = aLabel[-1-pOp->p2];
+ }
+ sqliteFree(p->aLabel);
+ p->aLabel = 0;
+
+ *pMaxFuncArgs = nMaxArgs;
+ *pMaxStack = nMaxStack;
+
+ /* If we never rollback a statement transaction, then statement
+ ** transactions are not needed. So change every OP_Statement
+ ** opcode into an OP_Noop. This avoid a call to sqlite3OsOpenExclusive()
+ ** which can be expensive on some platforms.
+ */
+ if( hasStatementBegin && !doesStatementRollback ){
+ for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
+ if( pOp->opcode==OP_Statement ){
+ pOp->opcode = OP_Noop;
+ }
+ }
+ }
+}
+
+/*
+** Return the address of the next instruction to be inserted.
+*/
+int sqlite3VdbeCurrentAddr(Vdbe *p){
+ assert( p->magic==VDBE_MAGIC_INIT );
+ return p->nOp;
+}
+
+/*
+** Add a whole list of operations to the operation stack. Return the
+** address of the first operation added.
+*/
+int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
+ int addr;
+ assert( p->magic==VDBE_MAGIC_INIT );
+ resizeOpArray(p, p->nOp + nOp);
+ if( sqlite3_malloc_failed ){
+ return 0;
+ }
+ addr = p->nOp;
+ if( nOp>0 ){
+ int i;
+ VdbeOpList const *pIn = aOp;
+ for(i=0; i<nOp; i++, pIn++){
+ int p2 = pIn->p2;
+ VdbeOp *pOut = &p->aOp[i+addr];
+ pOut->opcode = pIn->opcode;
+ pOut->p1 = pIn->p1;
+ pOut->p2 = p2<0 ? addr + ADDR(p2) : p2;
+ pOut->p3 = pIn->p3;
+ pOut->p3type = pIn->p3 ? P3_STATIC : P3_NOTUSED;
+#ifdef SQLITE_DEBUG
+ if( sqlite3_vdbe_addop_trace ){
+ sqlite3VdbePrintOp(0, i+addr, &p->aOp[i+addr]);
+ }
+#endif
+ }
+ p->nOp += nOp;
+ }
+ return addr;
+}
+
+/*
+** Change the value of the P1 operand for a specific instruction.
+** This routine is useful when a large program is loaded from a
+** static array using sqlite3VdbeAddOpList but we want to make a
+** few minor changes to the program.
+*/
+void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
+ assert( p->magic==VDBE_MAGIC_INIT );
+ if( p && addr>=0 && p->nOp>addr && p->aOp ){
+ p->aOp[addr].p1 = val;
+ }
+}
+
+/*
+** Change the value of the P2 operand for a specific instruction.
+** This routine is useful for setting a jump destination.
+*/
+void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
+ assert( val>=0 );
+ assert( p->magic==VDBE_MAGIC_INIT );
+ if( p && addr>=0 && p->nOp>addr && p->aOp ){
+ p->aOp[addr].p2 = val;
+ }
+}
+
+/*
+** Change teh P2 operand of instruction addr so that it points to
+** the address of the next instruction to be coded.
+*/
+void sqlite3VdbeJumpHere(Vdbe *p, int addr){
+ sqlite3VdbeChangeP2(p, addr, p->nOp);
+}
+
+/*
+** Delete a P3 value if necessary.
+*/
+static void freeP3(int p3type, void *p3){
+ if( p3 ){
+ switch( p3type ){
+ case P3_DYNAMIC:
+ case P3_KEYINFO:
+ case P3_KEYINFO_HANDOFF: {
+ sqliteFree(p3);
+ break;
+ }
+ case P3_VDBEFUNC: {
+ VdbeFunc *pVdbeFunc = (VdbeFunc *)p3;
+ sqlite3VdbeDeleteAuxData(pVdbeFunc, 0);
+ sqliteFree(pVdbeFunc);
+ break;
+ }
+ case P3_MEM: {
+ sqlite3ValueFree((sqlite3_value*)p3);
+ break;
+ }
+ }
+ }
+}
+
+
+/*
+** Change the value of the P3 operand for a specific instruction.
+** This routine is useful when a large program is loaded from a
+** static array using sqlite3VdbeAddOpList but we want to make a
+** few minor changes to the program.
+**
+** If n>=0 then the P3 operand is dynamic, meaning that a copy of
+** the string is made into memory obtained from sqliteMalloc().
+** A value of n==0 means copy bytes of zP3 up to and including the
+** first null byte. If n>0 then copy n+1 bytes of zP3.
+**
+** If n==P3_KEYINFO it means that zP3 is a pointer to a KeyInfo structure.
+** A copy is made of the KeyInfo structure into memory obtained from
+** sqliteMalloc, to be freed when the Vdbe is finalized.
+** n==P3_KEYINFO_HANDOFF indicates that zP3 points to a KeyInfo structure
+** stored in memory that the caller has obtained from sqliteMalloc. The
+** caller should not free the allocation, it will be freed when the Vdbe is
+** finalized.
+**
+** Other values of n (P3_STATIC, P3_COLLSEQ etc.) indicate that zP3 points
+** to a string or structure that is guaranteed to exist for the lifetime of
+** the Vdbe. In these cases we can just copy the pointer.
+**
+** If addr<0 then change P3 on the most recently inserted instruction.
+*/
+void sqlite3VdbeChangeP3(Vdbe *p, int addr, const char *zP3, int n){
+ Op *pOp;
+ assert( p->magic==VDBE_MAGIC_INIT );
+ if( p==0 || p->aOp==0 ){
+ freeP3(n, (void*)*(char**)&zP3);
+ return;
+ }
+ if( addr<0 || addr>=p->nOp ){
+ addr = p->nOp - 1;
+ if( addr<0 ) return;
+ }
+ pOp = &p->aOp[addr];
+ freeP3(pOp->p3type, pOp->p3);
+ pOp->p3 = 0;
+ if( zP3==0 ){
+ pOp->p3 = 0;
+ pOp->p3type = P3_NOTUSED;
+ }else if( n==P3_KEYINFO ){
+ KeyInfo *pKeyInfo;
+ int nField, nByte;
+
+ /* KeyInfo structures that include an KeyInfo.aSortOrder are always
+ ** sent in using P3_KEYINFO_HANDOFF. The KeyInfo.aSortOrder array
+ ** is not duplicated when P3_KEYINFO is used. */
+ /* assert( pKeyInfo->aSortOrder==0 ); */
+ nField = ((KeyInfo*)zP3)->nField;
+ nByte = sizeof(*pKeyInfo) + (nField-1)*sizeof(pKeyInfo->aColl[0]);
+ pKeyInfo = sqliteMallocRaw( nByte );
+ pOp->p3 = (char*)pKeyInfo;
+ if( pKeyInfo ){
+ memcpy(pKeyInfo, zP3, nByte);
+ pOp->p3type = P3_KEYINFO;
+ }else{
+ pOp->p3type = P3_NOTUSED;
+ }
+ }else if( n==P3_KEYINFO_HANDOFF ){
+ pOp->p3 = (char*)zP3;
+ pOp->p3type = P3_KEYINFO;
+ }else if( n<0 ){
+ pOp->p3 = (char*)zP3;
+ pOp->p3type = n;
+ }else{
+ if( n==0 ) n = strlen(zP3);
+ pOp->p3 = sqliteStrNDup(zP3, n);
+ pOp->p3type = P3_DYNAMIC;
+ }
+}
+
+#ifndef NDEBUG
+/*
+** Replace the P3 field of the most recently coded instruction with
+** comment text.
+*/
+void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){
+ va_list ap;
+ assert( p->nOp>0 );
+ assert( p->aOp==0 || p->aOp[p->nOp-1].p3==0 );
+ va_start(ap, zFormat);
+ sqlite3VdbeChangeP3(p, -1, sqlite3VMPrintf(zFormat, ap), P3_DYNAMIC);
+ va_end(ap);
+}
+#endif
+
+/*
+** Return the opcode for a given address.
+*/
+VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
+ assert( p->magic==VDBE_MAGIC_INIT );
+ assert( addr>=0 && addr<p->nOp );
+ return &p->aOp[addr];
+}
+
+#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) \
+ || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
+/*
+** Compute a string that describes the P3 parameter for an opcode.
+** Use zTemp for any required temporary buffer space.
+*/
+static char *displayP3(Op *pOp, char *zTemp, int nTemp){
+ char *zP3;
+ assert( nTemp>=20 );
+ switch( pOp->p3type ){
+ case P3_KEYINFO: {
+ int i, j;
+ KeyInfo *pKeyInfo = (KeyInfo*)pOp->p3;
+ sprintf(zTemp, "keyinfo(%d", pKeyInfo->nField);
+ i = strlen(zTemp);
+ for(j=0; j<pKeyInfo->nField; j++){
+ CollSeq *pColl = pKeyInfo->aColl[j];
+ if( pColl ){
+ int n = strlen(pColl->zName);
+ if( i+n>nTemp-6 ){
+ strcpy(&zTemp[i],",...");
+ break;
+ }
+ zTemp[i++] = ',';
+ if( pKeyInfo->aSortOrder && pKeyInfo->aSortOrder[j] ){
+ zTemp[i++] = '-';
+ }
+ strcpy(&zTemp[i], pColl->zName);
+ i += n;
+ }else if( i+4<nTemp-6 ){
+ strcpy(&zTemp[i],",nil");
+ i += 4;
+ }
+ }
+ zTemp[i++] = ')';
+ zTemp[i] = 0;
+ assert( i<nTemp );
+ zP3 = zTemp;
+ break;
+ }
+ case P3_COLLSEQ: {
+ CollSeq *pColl = (CollSeq*)pOp->p3;
+ sprintf(zTemp, "collseq(%.20s)", pColl->zName);
+ zP3 = zTemp;
+ break;
+ }
+ case P3_FUNCDEF: {
+ FuncDef *pDef = (FuncDef*)pOp->p3;
+ char zNum[30];
+ sprintf(zTemp, "%.*s", nTemp, pDef->zName);
+ sprintf(zNum,"(%d)", pDef->nArg);
+ if( strlen(zTemp)+strlen(zNum)+1<=nTemp ){
+ strcat(zTemp, zNum);
+ }
+ zP3 = zTemp;
+ break;
+ }
+ default: {
+ zP3 = pOp->p3;
+ if( zP3==0 || pOp->opcode==OP_Noop ){
+ zP3 = "";
+ }
+ }
+ }
+ return zP3;
+}
+#endif
+
+
+#if defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
+/*
+** Print a single opcode. This routine is used for debugging only.
+*/
+void sqlite3VdbePrintOp(FILE *pOut, int pc, Op *pOp){
+ char *zP3;
+ char zPtr[50];
+ static const char *zFormat1 = "%4d %-13s %4d %4d %s\n";
+ if( pOut==0 ) pOut = stdout;
+ zP3 = displayP3(pOp, zPtr, sizeof(zPtr));
+ fprintf(pOut, zFormat1,
+ pc, sqlite3OpcodeNames[pOp->opcode], pOp->p1, pOp->p2, zP3);
+ fflush(pOut);
+}
+#endif
+
+/*
+** Release an array of N Mem elements
+*/
+static void releaseMemArray(Mem *p, int N){
+ if( p ){
+ while( N-->0 ){
+ sqlite3VdbeMemRelease(p++);
+ }
+ }
+}
+
+#ifndef SQLITE_OMIT_EXPLAIN
+/*
+** Give a listing of the program in the virtual machine.
+**
+** The interface is the same as sqlite3VdbeExec(). But instead of
+** running the code, it invokes the callback once for each instruction.
+** This feature is used to implement "EXPLAIN".
+*/
+int sqlite3VdbeList(
+ Vdbe *p /* The VDBE */
+){
+ sqlite3 *db = p->db;
+ int i;
+ int rc = SQLITE_OK;
+
+ assert( p->explain );
+ if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE;
+ assert( db->magic==SQLITE_MAGIC_BUSY );
+ assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY );
+
+ /* Even though this opcode does not put dynamic strings onto the
+ ** the stack, they may become dynamic if the user calls
+ ** sqlite3_column_text16(), causing a translation to UTF-16 encoding.
+ */
+ if( p->pTos==&p->aStack[4] ){
+ releaseMemArray(p->aStack, 5);
+ }
+ p->resOnStack = 0;
+
+ do{
+ i = p->pc++;
+ }while( i<p->nOp && p->explain==2 && p->aOp[i].opcode!=OP_Explain );
+ if( i>=p->nOp ){
+ p->rc = SQLITE_OK;
+ rc = SQLITE_DONE;
+ }else if( db->flags & SQLITE_Interrupt ){
+ db->flags &= ~SQLITE_Interrupt;
+ p->rc = SQLITE_INTERRUPT;
+ rc = SQLITE_ERROR;
+ sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(p->rc), (char*)0);
+ }else{
+ Op *pOp = &p->aOp[i];
+ Mem *pMem = p->aStack;
+ pMem->flags = MEM_Int;
+ pMem->type = SQLITE_INTEGER;
+ pMem->i = i; /* Program counter */
+ pMem++;
+
+ pMem->flags = MEM_Static|MEM_Str|MEM_Term;
+ pMem->z = sqlite3OpcodeNames[pOp->opcode]; /* Opcode */
+ pMem->n = strlen(pMem->z);
+ pMem->type = SQLITE_TEXT;
+ pMem->enc = SQLITE_UTF8;
+ pMem++;
+
+ pMem->flags = MEM_Int;
+ pMem->i = pOp->p1; /* P1 */
+ pMem->type = SQLITE_INTEGER;
+ pMem++;
+
+ pMem->flags = MEM_Int;
+ pMem->i = pOp->p2; /* P2 */
+ pMem->type = SQLITE_INTEGER;
+ pMem++;
+
+ pMem->flags = MEM_Short|MEM_Str|MEM_Term; /* P3 */
+ pMem->z = displayP3(pOp, pMem->zShort, sizeof(pMem->zShort));
+ pMem->type = SQLITE_TEXT;
+ pMem->enc = SQLITE_UTF8;
+
+ p->nResColumn = 5 - 2*(p->explain-1);
+ p->pTos = pMem;
+ p->rc = SQLITE_OK;
+ p->resOnStack = 1;
+ rc = SQLITE_ROW;
+ }
+ return rc;
+}
+#endif /* SQLITE_OMIT_EXPLAIN */
+
+/*
+** Print the SQL that was used to generate a VDBE program.
+*/
+void sqlite3VdbePrintSql(Vdbe *p){
+#ifdef SQLITE_DEBUG
+ int nOp = p->nOp;
+ VdbeOp *pOp;
+ if( nOp<1 ) return;
+ pOp = &p->aOp[nOp-1];
+ if( pOp->opcode==OP_Noop && pOp->p3!=0 ){
+ const char *z = pOp->p3;
+ while( isspace(*(u8*)z) ) z++;
+ printf("SQL: [%s]\n", z);
+ }
+#endif
+}
+
+/*
+** Prepare a virtual machine for execution. This involves things such
+** as allocating stack space and initializing the program counter.
+** After the VDBE has be prepped, it can be executed by one or more
+** calls to sqlite3VdbeExec().
+**
+** This is the only way to move a VDBE from VDBE_MAGIC_INIT to
+** VDBE_MAGIC_RUN.
+*/
+void sqlite3VdbeMakeReady(
+ Vdbe *p, /* The VDBE */
+ int nVar, /* Number of '?' see in the SQL statement */
+ int nMem, /* Number of memory cells to allocate */
+ int nCursor, /* Number of cursors to allocate */
+ int isExplain /* True if the EXPLAIN keywords is present */
+){
+ int n;
+
+ assert( p!=0 );
+ assert( p->magic==VDBE_MAGIC_INIT );
+
+ /* There should be at least one opcode.
+ */
+ assert( p->nOp>0 );
+
+ /* Set the magic to VDBE_MAGIC_RUN sooner rather than later. This
+ * is because the call to resizeOpArray() below may shrink the
+ * p->aOp[] array to save memory if called when in VDBE_MAGIC_RUN
+ * state.
+ */
+ p->magic = VDBE_MAGIC_RUN;
+
+ /* No instruction ever pushes more than a single element onto the
+ ** stack. And the stack never grows on successive executions of the
+ ** same loop. So the total number of instructions is an upper bound
+ ** on the maximum stack depth required. (Added later:) The
+ ** resolveP2Values() call computes a tighter upper bound on the
+ ** stack size.
+ **
+ ** Allocation all the stack space we will ever need.
+ */
+ if( p->aStack==0 ){
+ int nArg; /* Maximum number of args passed to a user function. */
+ int nStack; /* Maximum number of stack entries required */
+ resolveP2Values(p, &nArg, &nStack);
+ resizeOpArray(p, p->nOp);
+ assert( nVar>=0 );
+ assert( nStack<p->nOp );
+ nStack = isExplain ? 10 : nStack;
+ p->aStack = sqliteMalloc(
+ nStack*sizeof(p->aStack[0]) /* aStack */
+ + nArg*sizeof(Mem*) /* apArg */
+ + nVar*sizeof(Mem) /* aVar */
+ + nVar*sizeof(char*) /* azVar */
+ + nMem*sizeof(Mem) /* aMem */
+ + nCursor*sizeof(Cursor*) /* apCsr */
+ );
+ if( !sqlite3_malloc_failed ){
+ p->aMem = &p->aStack[nStack];
+ p->nMem = nMem;
+ p->aVar = &p->aMem[nMem];
+ p->nVar = nVar;
+ p->okVar = 0;
+ p->apArg = (Mem**)&p->aVar[nVar];
+ p->azVar = (char**)&p->apArg[nArg];
+ p->apCsr = (Cursor**)&p->azVar[nVar];
+ p->nCursor = nCursor;
+ for(n=0; n<nVar; n++){
+ p->aVar[n].flags = MEM_Null;
+ }
+ }
+ }
+ for(n=0; n<p->nMem; n++){
+ p->aMem[n].flags = MEM_Null;
+ }
+
+#ifdef SQLITE_DEBUG
+ if( (p->db->flags & SQLITE_VdbeListing)!=0
+ || sqlite3OsFileExists("vdbe_explain")
+ ){
+ int i;
+ printf("VDBE Program Listing:\n");
+ sqlite3VdbePrintSql(p);
+ for(i=0; i<p->nOp; i++){
+ sqlite3VdbePrintOp(stdout, i, &p->aOp[i]);
+ }
+ }
+ if( sqlite3OsFileExists("vdbe_trace") ){
+ p->trace = stdout;
+ }
+#endif
+ p->pTos = &p->aStack[-1];
+ p->pc = -1;
+ p->rc = SQLITE_OK;
+ p->uniqueCnt = 0;
+ p->returnDepth = 0;
+ p->errorAction = OE_Abort;
+ p->popStack = 0;
+ p->explain |= isExplain;
+ p->magic = VDBE_MAGIC_RUN;
+ p->nChange = 0;
+#ifdef VDBE_PROFILE
+ {
+ int i;
+ for(i=0; i<p->nOp; i++){
+ p->aOp[i].cnt = 0;
+ p->aOp[i].cycles = 0;
+ }
+ }
+#endif
+}
+
+/*
+** Close a cursor and release all the resources that cursor happens
+** to hold.
+*/
+void sqlite3VdbeFreeCursor(Cursor *pCx){
+ if( pCx==0 ){
+ return;
+ }
+ if( pCx->pCursor ){
+ sqlite3BtreeCloseCursor(pCx->pCursor);
+ }
+ if( pCx->pBt ){
+ sqlite3BtreeClose(pCx->pBt);
+ }
+ sqliteFree(pCx->pData);
+ sqliteFree(pCx->aType);
+ sqliteFree(pCx);
+}
+
+/*
+** Close all cursors
+*/
+static void closeAllCursors(Vdbe *p){
+ int i;
+ if( p->apCsr==0 ) return;
+ for(i=0; i<p->nCursor; i++){
+ sqlite3VdbeFreeCursor(p->apCsr[i]);
+ p->apCsr[i] = 0;
+ }
+}
+
+/*
+** Clean up the VM after execution.
+**
+** This routine will automatically close any cursors, lists, and/or
+** sorters that were left open. It also deletes the values of
+** variables in the aVar[] array.
+*/
+static void Cleanup(Vdbe *p){
+ int i;
+ if( p->aStack ){
+ releaseMemArray(p->aStack, 1 + (p->pTos - p->aStack));
+ p->pTos = &p->aStack[-1];
+ }
+ closeAllCursors(p);
+ releaseMemArray(p->aMem, p->nMem);
+ sqlite3VdbeFifoClear(&p->sFifo);
+ if( p->contextStack ){
+ for(i=0; i<p->contextStackTop; i++){
+ sqlite3VdbeFifoClear(&p->contextStack[i].sFifo);
+ }
+ sqliteFree(p->contextStack);
+ }
+ p->contextStack = 0;
+ p->contextStackDepth = 0;
+ p->contextStackTop = 0;
+ sqliteFree(p->zErrMsg);
+ p->zErrMsg = 0;
+}
+
+/*
+** Set the number of result columns that will be returned by this SQL
+** statement. This is now set at compile time, rather than during
+** execution of the vdbe program so that sqlite3_column_count() can
+** be called on an SQL statement before sqlite3_step().
+*/
+void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){
+ Mem *pColName;
+ int n;
+ assert( 0==p->nResColumn );
+ p->nResColumn = nResColumn;
+ n = nResColumn*2;
+ p->aColName = pColName = (Mem*)sqliteMalloc( sizeof(Mem)*n );
+ if( p->aColName==0 ) return;
+ while( n-- > 0 ){
+ (pColName++)->flags = MEM_Null;
+ }
+}
+
+/*
+** Set the name of the idx'th column to be returned by the SQL statement.
+** zName must be a pointer to a nul terminated string.
+**
+** This call must be made after a call to sqlite3VdbeSetNumCols().
+**
+** If N==P3_STATIC it means that zName is a pointer to a constant static
+** string and we can just copy the pointer. If it is P3_DYNAMIC, then
+** the string is freed using sqliteFree() when the vdbe is finished with
+** it. Otherwise, N bytes of zName are copied.
+*/
+int sqlite3VdbeSetColName(Vdbe *p, int idx, const char *zName, int N){
+ int rc;
+ Mem *pColName;
+ assert( idx<(2*p->nResColumn) );
+ if( sqlite3_malloc_failed ) return SQLITE_NOMEM;
+ assert( p->aColName!=0 );
+ pColName = &(p->aColName[idx]);
+ if( N==P3_DYNAMIC || N==P3_STATIC ){
+ rc = sqlite3VdbeMemSetStr(pColName, zName, -1, SQLITE_UTF8, SQLITE_STATIC);
+ }else{
+ rc = sqlite3VdbeMemSetStr(pColName, zName, N, SQLITE_UTF8,SQLITE_TRANSIENT);
+ }
+ if( rc==SQLITE_OK && N==P3_DYNAMIC ){
+ pColName->flags = (pColName->flags&(~MEM_Static))|MEM_Dyn;
+ pColName->xDel = 0;
+ }
+ return rc;
+}
+
+/*
+** A read or write transaction may or may not be active on database handle
+** db. If a transaction is active, commit it. If there is a
+** write-transaction spanning more than one database file, this routine
+** takes care of the master journal trickery.
+*/
+static int vdbeCommit(sqlite3 *db){
+ int i;
+ int nTrans = 0; /* Number of databases with an active write-transaction */
+ int rc = SQLITE_OK;
+ int needXcommit = 0;
+
+ for(i=0; i<db->nDb; i++){
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt && sqlite3BtreeIsInTrans(pBt) ){
+ needXcommit = 1;
+ if( i!=1 ) nTrans++;
+ }
+ }
+
+ /* If there are any write-transactions at all, invoke the commit hook */
+ if( needXcommit && db->xCommitCallback ){
+ int rc;
+ sqlite3SafetyOff(db);
+ rc = db->xCommitCallback(db->pCommitArg);
+ sqlite3SafetyOn(db);
+ if( rc ){
+ return SQLITE_CONSTRAINT;
+ }
+ }
+
+ /* The simple case - no more than one database file (not counting the
+ ** TEMP database) has a transaction active. There is no need for the
+ ** master-journal.
+ **
+ ** If the return value of sqlite3BtreeGetFilename() is a zero length
+ ** string, it means the main database is :memory:. In that case we do
+ ** not support atomic multi-file commits, so use the simple case then
+ ** too.
+ */
+ if( 0==strlen(sqlite3BtreeGetFilename(db->aDb[0].pBt)) || nTrans<=1 ){
+ for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt ){
+ rc = sqlite3BtreeSync(pBt, 0);
+ }
+ }
+
+ /* Do the commit only if all databases successfully synced */
+ if( rc==SQLITE_OK ){
+ for(i=0; i<db->nDb; i++){
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt ){
+ sqlite3BtreeCommit(pBt);
+ }
+ }
+ }
+ }
+
+ /* The complex case - There is a multi-file write-transaction active.
+ ** This requires a master journal file to ensure the transaction is
+ ** committed atomicly.
+ */
+#ifndef SQLITE_OMIT_DISKIO
+ else{
+ int needSync = 0;
+ char *zMaster = 0; /* File-name for the master journal */
+ char const *zMainFile = sqlite3BtreeGetFilename(db->aDb[0].pBt);
+ OsFile master;
+
+ /* Select a master journal file name */
+ do {
+ u32 random;
+ sqliteFree(zMaster);
+ sqlite3Randomness(sizeof(random), &random);
+ zMaster = sqlite3MPrintf("%s-mj%08X", zMainFile, random&0x7fffffff);
+ if( !zMaster ){
+ return SQLITE_NOMEM;
+ }
+ }while( sqlite3OsFileExists(zMaster) );
+
+ /* Open the master journal. */
+ memset(&master, 0, sizeof(master));
+ rc = sqlite3OsOpenExclusive(zMaster, &master, 0);
+ if( rc!=SQLITE_OK ){
+ sqliteFree(zMaster);
+ return rc;
+ }
+
+ /* Write the name of each database file in the transaction into the new
+ ** master journal file. If an error occurs at this point close
+ ** and delete the master journal file. All the individual journal files
+ ** still have 'null' as the master journal pointer, so they will roll
+ ** back independently if a failure occurs.
+ */
+ for(i=0; i<db->nDb; i++){
+ Btree *pBt = db->aDb[i].pBt;
+ if( i==1 ) continue; /* Ignore the TEMP database */
+ if( pBt && sqlite3BtreeIsInTrans(pBt) ){
+ char const *zFile = sqlite3BtreeGetJournalname(pBt);
+ if( zFile[0]==0 ) continue; /* Ignore :memory: databases */
+ if( !needSync && !sqlite3BtreeSyncDisabled(pBt) ){
+ needSync = 1;
+ }
+ rc = sqlite3OsWrite(&master, zFile, strlen(zFile)+1);
+ if( rc!=SQLITE_OK ){
+ sqlite3OsClose(&master);
+ sqlite3OsDelete(zMaster);
+ sqliteFree(zMaster);
+ return rc;
+ }
+ }
+ }
+
+
+ /* Sync the master journal file. Before doing this, open the directory
+ ** the master journal file is store in so that it gets synced too.
+ */
+ zMainFile = sqlite3BtreeGetDirname(db->aDb[0].pBt);
+ rc = sqlite3OsOpenDirectory(zMainFile, &master);
+ if( rc!=SQLITE_OK ||
+ (needSync && (rc=sqlite3OsSync(&master,0))!=SQLITE_OK) ){
+ sqlite3OsClose(&master);
+ sqlite3OsDelete(zMaster);
+ sqliteFree(zMaster);
+ return rc;
+ }
+
+ /* Sync all the db files involved in the transaction. The same call
+ ** sets the master journal pointer in each individual journal. If
+ ** an error occurs here, do not delete the master journal file.
+ **
+ ** If the error occurs during the first call to sqlite3BtreeSync(),
+ ** then there is a chance that the master journal file will be
+ ** orphaned. But we cannot delete it, in case the master journal
+ ** file name was written into the journal file before the failure
+ ** occured.
+ */
+ for(i=0; i<db->nDb; i++){
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt && sqlite3BtreeIsInTrans(pBt) ){
+ rc = sqlite3BtreeSync(pBt, zMaster);
+ if( rc!=SQLITE_OK ){
+ sqlite3OsClose(&master);
+ sqliteFree(zMaster);
+ return rc;
+ }
+ }
+ }
+ sqlite3OsClose(&master);
+
+ /* Delete the master journal file. This commits the transaction. After
+ ** doing this the directory is synced again before any individual
+ ** transaction files are deleted.
+ */
+ rc = sqlite3OsDelete(zMaster);
+ assert( rc==SQLITE_OK );
+ sqliteFree(zMaster);
+ zMaster = 0;
+ rc = sqlite3OsSyncDirectory(zMainFile);
+ if( rc!=SQLITE_OK ){
+ /* This is not good. The master journal file has been deleted, but
+ ** the directory sync failed. There is no completely safe course of
+ ** action from here. The individual journals contain the name of the
+ ** master journal file, but there is no way of knowing if that
+ ** master journal exists now or if it will exist after the operating
+ ** system crash that may follow the fsync() failure.
+ */
+ return rc;
+ }
+
+ /* All files and directories have already been synced, so the following
+ ** calls to sqlite3BtreeCommit() are only closing files and deleting
+ ** journals. If something goes wrong while this is happening we don't
+ ** really care. The integrity of the transaction is already guaranteed,
+ ** but some stray 'cold' journals may be lying around. Returning an
+ ** error code won't help matters.
+ */
+ for(i=0; i<db->nDb; i++){
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt ){
+ sqlite3BtreeCommit(pBt);
+ }
+ }
+ }
+#endif
+
+ return rc;
+}
+
+/*
+** Find every active VM other than pVdbe and change its status to
+** aborted. This happens when one VM causes a rollback due to an
+** ON CONFLICT ROLLBACK clause (for example). The other VMs must be
+** aborted so that they do not have data rolled out from underneath
+** them leading to a segfault.
+*/
+static void abortOtherActiveVdbes(Vdbe *pVdbe){
+ Vdbe *pOther;
+ for(pOther=pVdbe->db->pVdbe; pOther; pOther=pOther->pNext){
+ if( pOther==pVdbe ) continue;
+ if( pOther->magic!=VDBE_MAGIC_RUN || pOther->pc<0 ) continue;
+ closeAllCursors(pOther);
+ pOther->aborted = 1;
+ }
+}
+
+/*
+** This routine checks that the sqlite3.activeVdbeCnt count variable
+** matches the number of vdbe's in the list sqlite3.pVdbe that are
+** currently active. An assertion fails if the two counts do not match.
+** This is an internal self-check only - it is not an essential processing
+** step.
+**
+** This is a no-op if NDEBUG is defined.
+*/
+#ifndef NDEBUG
+static void checkActiveVdbeCnt(sqlite3 *db){
+ Vdbe *p;
+ int cnt = 0;
+ p = db->pVdbe;
+ while( p ){
+ if( p->magic==VDBE_MAGIC_RUN && p->pc>=0 ){
+ cnt++;
+ }
+ p = p->pNext;
+ }
+ assert( cnt==db->activeVdbeCnt );
+}
+#else
+#define checkActiveVdbeCnt(x)
+#endif
+
+/*
+** This routine is called the when a VDBE tries to halt. If the VDBE
+** has made changes and is in autocommit mode, then commit those
+** changes. If a rollback is needed, then do the rollback.
+**
+** This routine is the only way to move the state of a VM from
+** SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT.
+**
+** Return an error code. If the commit could not complete because of
+** lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it
+** means the close did not happen and needs to be repeated.
+*/
+int sqlite3VdbeHalt(Vdbe *p){
+ sqlite3 *db = p->db;
+ int i;
+ int (*xFunc)(Btree *pBt) = 0; /* Function to call on each btree backend */
+
+ if( p->magic!=VDBE_MAGIC_RUN ){
+ /* Already halted. Nothing to do. */
+ assert( p->magic==VDBE_MAGIC_HALT );
+ return SQLITE_OK;
+ }
+ closeAllCursors(p);
+ checkActiveVdbeCnt(db);
+ if( p->pc<0 ){
+ /* No commit or rollback needed if the program never started */
+ }else if( db->autoCommit && db->activeVdbeCnt==1 ){
+ if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){
+ /* The auto-commit flag is true, there are no other active queries
+ ** using this handle and the vdbe program was successful or hit an
+ ** 'OR FAIL' constraint. This means a commit is required.
+ */
+ int rc = vdbeCommit(db);
+ if( rc==SQLITE_BUSY ){
+ return SQLITE_BUSY;
+ }else if( rc!=SQLITE_OK ){
+ p->rc = rc;
+ xFunc = sqlite3BtreeRollback;
+ }
+ }else{
+ xFunc = sqlite3BtreeRollback;
+ }
+ }else{
+ if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){
+ xFunc = sqlite3BtreeCommitStmt;
+ }else if( p->errorAction==OE_Abort ){
+ xFunc = sqlite3BtreeRollbackStmt;
+ }else{
+ xFunc = sqlite3BtreeRollback;
+ db->autoCommit = 1;
+ abortOtherActiveVdbes(p);
+ }
+ }
+
+ /* If xFunc is not NULL, then it is one of sqlite3BtreeRollback,
+ ** sqlite3BtreeRollbackStmt or sqlite3BtreeCommitStmt. Call it once on
+ ** each backend. If an error occurs and the return code is still
+ ** SQLITE_OK, set the return code to the new error value.
+ */
+ for(i=0; xFunc && i<db->nDb; i++){
+ int rc;
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt ){
+ rc = xFunc(pBt);
+ if( p->rc==SQLITE_OK ) p->rc = rc;
+ }
+ }
+
+ /* If this was an INSERT, UPDATE or DELETE, set the change counter. */
+ if( p->changeCntOn && p->pc>=0 ){
+ if( !xFunc || xFunc==sqlite3BtreeCommitStmt ){
+ sqlite3VdbeSetChanges(db, p->nChange);
+ }else{
+ sqlite3VdbeSetChanges(db, 0);
+ }
+ p->nChange = 0;
+ }
+
+ /* Rollback or commit any schema changes that occurred. */
+ if( p->rc!=SQLITE_OK ){
+ sqlite3RollbackInternalChanges(db);
+ }else if( db->flags & SQLITE_InternChanges ){
+ sqlite3CommitInternalChanges(db);
+ }
+
+ /* We have successfully halted and closed the VM. Record this fact. */
+ if( p->pc>=0 ){
+ db->activeVdbeCnt--;
+ }
+ p->magic = VDBE_MAGIC_HALT;
+ checkActiveVdbeCnt(db);
+
+ return SQLITE_OK;
+}
+
+/*
+** Clean up a VDBE after execution but do not delete the VDBE just yet.
+** Write any error messages into *pzErrMsg. Return the result code.
+**
+** After this routine is run, the VDBE should be ready to be executed
+** again.
+**
+** To look at it another way, this routine resets the state of the
+** virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to
+** VDBE_MAGIC_INIT.
+*/
+int sqlite3VdbeReset(Vdbe *p){
+ if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
+ sqlite3Error(p->db, SQLITE_MISUSE, 0);
+ return SQLITE_MISUSE;
+ }
+
+ /* If the VM did not run to completion or if it encountered an
+ ** error, then it might not have been halted properly. So halt
+ ** it now.
+ */
+ sqlite3VdbeHalt(p);
+
+ /* If the VDBE has be run even partially, then transfer the error code
+ ** and error message from the VDBE into the main database structure. But
+ ** if the VDBE has just been set to run but has not actually executed any
+ ** instructions yet, leave the main database error information unchanged.
+ */
+ if( p->pc>=0 ){
+ if( p->zErrMsg ){
+ sqlite3Error(p->db, p->rc, "%s", p->zErrMsg);
+ sqliteFree(p->zErrMsg);
+ p->zErrMsg = 0;
+ }else if( p->rc ){
+ sqlite3Error(p->db, p->rc, 0);
+ }else{
+ sqlite3Error(p->db, SQLITE_OK, 0);
+ }
+ }else if( p->rc && p->expired ){
+ /* The expired flag was set on the VDBE before the first call
+ ** to sqlite3_step(). For consistency (since sqlite3_step() was
+ ** called), set the database error in this case as well.
+ */
+ sqlite3Error(p->db, p->rc, 0);
+ }
+
+ /* Reclaim all memory used by the VDBE
+ */
+ Cleanup(p);
+
+ /* Save profiling information from this VDBE run.
+ */
+ assert( p->pTos<&p->aStack[p->pc<0?0:p->pc] || sqlite3_malloc_failed==1 );
+#ifdef VDBE_PROFILE
+ {
+ FILE *out = fopen("vdbe_profile.out", "a");
+ if( out ){
+ int i;
+ fprintf(out, "---- ");
+ for(i=0; i<p->nOp; i++){
+ fprintf(out, "%02x", p->aOp[i].opcode);
+ }
+ fprintf(out, "\n");
+ for(i=0; i<p->nOp; i++){
+ fprintf(out, "%6d %10lld %8lld ",
+ p->aOp[i].cnt,
+ p->aOp[i].cycles,
+ p->aOp[i].cnt>0 ? p->aOp[i].cycles/p->aOp[i].cnt : 0
+ );
+ sqlite3VdbePrintOp(out, i, &p->aOp[i]);
+ }
+ fclose(out);
+ }
+ }
+#endif
+ p->magic = VDBE_MAGIC_INIT;
+ p->aborted = 0;
+ if( p->rc==SQLITE_SCHEMA ){
+ sqlite3ResetInternalSchema(p->db, 0);
+ }
+ return p->rc;
+}
+
+/*
+** Clean up and delete a VDBE after execution. Return an integer which is
+** the result code. Write any error message text into *pzErrMsg.
+*/
+int sqlite3VdbeFinalize(Vdbe *p){
+ int rc = SQLITE_OK;
+
+ if( p->magic==VDBE_MAGIC_RUN || p->magic==VDBE_MAGIC_HALT ){
+ rc = sqlite3VdbeReset(p);
+ }else if( p->magic!=VDBE_MAGIC_INIT ){
+ return SQLITE_MISUSE;
+ }
+ sqlite3VdbeDelete(p);
+ return rc;
+}
+
+/*
+** Call the destructor for each auxdata entry in pVdbeFunc for which
+** the corresponding bit in mask is clear. Auxdata entries beyond 31
+** are always destroyed. To destroy all auxdata entries, call this
+** routine with mask==0.
+*/
+void sqlite3VdbeDeleteAuxData(VdbeFunc *pVdbeFunc, int mask){
+ int i;
+ for(i=0; i<pVdbeFunc->nAux; i++){
+ struct AuxData *pAux = &pVdbeFunc->apAux[i];
+ if( (i>31 || !(mask&(1<<i))) && pAux->pAux ){
+ if( pAux->xDelete ){
+ pAux->xDelete(pAux->pAux);
+ }
+ pAux->pAux = 0;
+ }
+ }
+}
+
+/*
+** Delete an entire VDBE.
+*/
+void sqlite3VdbeDelete(Vdbe *p){
+ int i;
+ if( p==0 ) return;
+ Cleanup(p);
+ if( p->pPrev ){
+ p->pPrev->pNext = p->pNext;
+ }else{
+ assert( p->db->pVdbe==p );
+ p->db->pVdbe = p->pNext;
+ }
+ if( p->pNext ){
+ p->pNext->pPrev = p->pPrev;
+ }
+ if( p->aOp ){
+ for(i=0; i<p->nOp; i++){
+ Op *pOp = &p->aOp[i];
+ freeP3(pOp->p3type, pOp->p3);
+ }
+ sqliteFree(p->aOp);
+ }
+ releaseMemArray(p->aVar, p->nVar);
+ sqliteFree(p->aLabel);
+ sqliteFree(p->aStack);
+ releaseMemArray(p->aColName, p->nResColumn*2);
+ sqliteFree(p->aColName);
+ p->magic = VDBE_MAGIC_DEAD;
+ sqliteFree(p);
+}
+
+/*
+** If a MoveTo operation is pending on the given cursor, then do that
+** MoveTo now. Return an error code. If no MoveTo is pending, this
+** routine does nothing and returns SQLITE_OK.
+*/
+int sqlite3VdbeCursorMoveto(Cursor *p){
+ if( p->deferredMoveto ){
+ int res, rc;
+ extern int sqlite3_search_count;
+ assert( p->isTable );
+ if( p->isTable ){
+ rc = sqlite3BtreeMoveto(p->pCursor, 0, p->movetoTarget, &res);
+ }else{
+ rc = sqlite3BtreeMoveto(p->pCursor,(char*)&p->movetoTarget,
+ sizeof(i64),&res);
+ }
+ if( rc ) return rc;
+ *p->pIncrKey = 0;
+ p->lastRowid = keyToInt(p->movetoTarget);
+ p->rowidIsValid = res==0;
+ if( res<0 ){
+ rc = sqlite3BtreeNext(p->pCursor, &res);
+ if( rc ) return rc;
+ }
+ sqlite3_search_count++;
+ p->deferredMoveto = 0;
+ p->cacheValid = 0;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** The following functions:
+**
+** sqlite3VdbeSerialType()
+** sqlite3VdbeSerialTypeLen()
+** sqlite3VdbeSerialRead()
+** sqlite3VdbeSerialLen()
+** sqlite3VdbeSerialWrite()
+**
+** encapsulate the code that serializes values for storage in SQLite
+** data and index records. Each serialized value consists of a
+** 'serial-type' and a blob of data. The serial type is an 8-byte unsigned
+** integer, stored as a varint.
+**
+** In an SQLite index record, the serial type is stored directly before
+** the blob of data that it corresponds to. In a table record, all serial
+** types are stored at the start of the record, and the blobs of data at
+** the end. Hence these functions allow the caller to handle the
+** serial-type and data blob seperately.
+**
+** The following table describes the various storage classes for data:
+**
+** serial type bytes of data type
+** -------------- --------------- ---------------
+** 0 0 NULL
+** 1 1 signed integer
+** 2 2 signed integer
+** 3 3 signed integer
+** 4 4 signed integer
+** 5 6 signed integer
+** 6 8 signed integer
+** 7 8 IEEE float
+** 8-11 reserved for expansion
+** N>=12 and even (N-12)/2 BLOB
+** N>=13 and odd (N-13)/2 text
+**
+*/
+
+/*
+** Return the serial-type for the value stored in pMem.
+*/
+u32 sqlite3VdbeSerialType(Mem *pMem){
+ int flags = pMem->flags;
+
+ if( flags&MEM_Null ){
+ return 0;
+ }
+ if( flags&MEM_Int ){
+ /* Figure out whether to use 1, 2, 4, 6 or 8 bytes. */
+# define MAX_6BYTE ((((i64)0x00001000)<<32)-1)
+ i64 i = pMem->i;
+ u64 u = i<0 ? -i : i;
+ if( u<=127 ) return 1;
+ if( u<=32767 ) return 2;
+ if( u<=8388607 ) return 3;
+ if( u<=2147483647 ) return 4;
+ if( u<=MAX_6BYTE ) return 5;
+ return 6;
+ }
+ if( flags&MEM_Real ){
+ return 7;
+ }
+ if( flags&MEM_Str ){
+ int n = pMem->n;
+ assert( n>=0 );
+ return ((n*2) + 13);
+ }
+ if( flags&MEM_Blob ){
+ return (pMem->n*2 + 12);
+ }
+ return 0;
+}
+
+/*
+** Return the length of the data corresponding to the supplied serial-type.
+*/
+int sqlite3VdbeSerialTypeLen(u32 serial_type){
+ if( serial_type>=12 ){
+ return (serial_type-12)/2;
+ }else{
+ static const u8 aSize[] = { 0, 1, 2, 3, 4, 6, 8, 8, 0, 0, 0, 0 };
+ return aSize[serial_type];
+ }
+}
+
+/*
+** Write the serialized data blob for the value stored in pMem into
+** buf. It is assumed that the caller has allocated sufficient space.
+** Return the number of bytes written.
+*/
+int sqlite3VdbeSerialPut(unsigned char *buf, Mem *pMem){
+ u32 serial_type = sqlite3VdbeSerialType(pMem);
+ int len;
+
+ /* NULL */
+ if( serial_type==0 ){
+ return 0;
+ }
+
+ /* Integer and Real */
+ if( serial_type<=7 ){
+ u64 v;
+ int i;
+ if( serial_type==7 ){
+ v = *(u64*)&pMem->r;
+ }else{
+ v = *(u64*)&pMem->i;
+ }
+ len = i = sqlite3VdbeSerialTypeLen(serial_type);
+ while( i-- ){
+ buf[i] = (v&0xFF);
+ v >>= 8;
+ }
+ return len;
+ }
+
+ /* String or blob */
+ assert( serial_type>=12 );
+ len = sqlite3VdbeSerialTypeLen(serial_type);
+ memcpy(buf, pMem->z, len);
+ return len;
+}
+
+/*
+** Deserialize the data blob pointed to by buf as serial type serial_type
+** and store the result in pMem. Return the number of bytes read.
+*/
+int sqlite3VdbeSerialGet(
+ const unsigned char *buf, /* Buffer to deserialize from */
+ u32 serial_type, /* Serial type to deserialize */
+ Mem *pMem /* Memory cell to write value into */
+){
+ switch( serial_type ){
+ case 8: /* Reserved for future use */
+ case 9: /* Reserved for future use */
+ case 10: /* Reserved for future use */
+ case 11: /* Reserved for future use */
+ case 0: { /* NULL */
+ pMem->flags = MEM_Null;
+ break;
+ }
+ case 1: { /* 1-byte signed integer */
+ pMem->i = (signed char)buf[0];
+ pMem->flags = MEM_Int;
+ return 1;
+ }
+ case 2: { /* 2-byte signed integer */
+ pMem->i = (((signed char)buf[0])<<8) | buf[1];
+ pMem->flags = MEM_Int;
+ return 2;
+ }
+ case 3: { /* 3-byte signed integer */
+ pMem->i = (((signed char)buf[0])<<16) | (buf[1]<<8) | buf[2];
+ pMem->flags = MEM_Int;
+ return 3;
+ }
+ case 4: { /* 4-byte signed integer */
+ pMem->i = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
+ pMem->flags = MEM_Int;
+ return 4;
+ }
+ case 5: { /* 6-byte signed integer */
+ u64 x = (((signed char)buf[0])<<8) | buf[1];
+ u32 y = (buf[2]<<24) | (buf[3]<<16) | (buf[4]<<8) | buf[5];
+ x = (x<<32) | y;
+ pMem->i = *(i64*)&x;
+ pMem->flags = MEM_Int;
+ return 6;
+ }
+ case 6: /* 8-byte signed integer */
+ case 7: { /* IEEE floating point */
+ u64 x;
+ u32 y;
+#ifndef NDEBUG
+ /* Verify that integers and floating point values use the same
+ ** byte order. The byte order differs on some (broken) architectures.
+ */
+ static const u64 t1 = ((u64)0x3ff00000)<<32;
+ assert( 1.0==*(double*)&t1 );
+#endif
+
+ x = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
+ y = (buf[4]<<24) | (buf[5]<<16) | (buf[6]<<8) | buf[7];
+ x = (x<<32) | y;
+ if( serial_type==6 ){
+ pMem->i = *(i64*)&x;
+ pMem->flags = MEM_Int;
+ }else{
+ pMem->r = *(double*)&x;
+ pMem->flags = MEM_Real;
+ }
+ return 8;
+ }
+ default: {
+ int len = (serial_type-12)/2;
+ pMem->z = (char *)buf;
+ pMem->n = len;
+ pMem->xDel = 0;
+ if( serial_type&0x01 ){
+ pMem->flags = MEM_Str | MEM_Ephem;
+ }else{
+ pMem->flags = MEM_Blob | MEM_Ephem;
+ }
+ return len;
+ }
+ }
+ return 0;
+}
+
+/*
+** This function compares the two table rows or index records specified by
+** {nKey1, pKey1} and {nKey2, pKey2}, returning a negative, zero
+** or positive integer if {nKey1, pKey1} is less than, equal to or
+** greater than {nKey2, pKey2}. Both Key1 and Key2 must be byte strings
+** composed by the OP_MakeRecord opcode of the VDBE.
+*/
+int sqlite3VdbeRecordCompare(
+ void *userData,
+ int nKey1, const void *pKey1,
+ int nKey2, const void *pKey2
+){
+ KeyInfo *pKeyInfo = (KeyInfo*)userData;
+ u32 d1, d2; /* Offset into aKey[] of next data element */
+ u32 idx1, idx2; /* Offset into aKey[] of next header element */
+ u32 szHdr1, szHdr2; /* Number of bytes in header */
+ int i = 0;
+ int nField;
+ int rc = 0;
+ const unsigned char *aKey1 = (const unsigned char *)pKey1;
+ const unsigned char *aKey2 = (const unsigned char *)pKey2;
+
+ Mem mem1;
+ Mem mem2;
+ mem1.enc = pKeyInfo->enc;
+ mem2.enc = pKeyInfo->enc;
+
+ idx1 = sqlite3GetVarint32(pKey1, &szHdr1);
+ d1 = szHdr1;
+ idx2 = sqlite3GetVarint32(pKey2, &szHdr2);
+ d2 = szHdr2;
+ nField = pKeyInfo->nField;
+ while( idx1<szHdr1 && idx2<szHdr2 ){
+ u32 serial_type1;
+ u32 serial_type2;
+
+ /* Read the serial types for the next element in each key. */
+ idx1 += sqlite3GetVarint32(&aKey1[idx1], &serial_type1);
+ if( d1>=nKey1 && sqlite3VdbeSerialTypeLen(serial_type1)>0 ) break;
+ idx2 += sqlite3GetVarint32(&aKey2[idx2], &serial_type2);
+ if( d2>=nKey2 && sqlite3VdbeSerialTypeLen(serial_type2)>0 ) break;
+
+ /* Assert that there is enough space left in each key for the blob of
+ ** data to go with the serial type just read. This assert may fail if
+ ** the file is corrupted. Then read the value from each key into mem1
+ ** and mem2 respectively.
+ */
+ d1 += sqlite3VdbeSerialGet(&aKey1[d1], serial_type1, &mem1);
+ d2 += sqlite3VdbeSerialGet(&aKey2[d2], serial_type2, &mem2);
+
+ rc = sqlite3MemCompare(&mem1, &mem2, i<nField ? pKeyInfo->aColl[i] : 0);
+ if( mem1.flags & MEM_Dyn ) sqlite3VdbeMemRelease(&mem1);
+ if( mem2.flags & MEM_Dyn ) sqlite3VdbeMemRelease(&mem2);
+ if( rc!=0 ){
+ break;
+ }
+ i++;
+ }
+
+ /* One of the keys ran out of fields, but all the fields up to that point
+ ** were equal. If the incrKey flag is true, then the second key is
+ ** treated as larger.
+ */
+ if( rc==0 ){
+ if( pKeyInfo->incrKey ){
+ rc = -1;
+ }else if( d1<nKey1 ){
+ rc = 1;
+ }else if( d2<nKey2 ){
+ rc = -1;
+ }
+ }
+
+ if( pKeyInfo->aSortOrder && i<pKeyInfo->nField && pKeyInfo->aSortOrder[i] ){
+ rc = -rc;
+ }
+
+ return rc;
+}
+
+/*
+** The argument is an index entry composed using the OP_MakeRecord opcode.
+** The last entry in this record should be an integer (specifically
+** an integer rowid). This routine returns the number of bytes in
+** that integer.
+*/
+int sqlite3VdbeIdxRowidLen(int nKey, const u8 *aKey){
+ u32 szHdr; /* Size of the header */
+ u32 typeRowid; /* Serial type of the rowid */
+
+ sqlite3GetVarint32(aKey, &szHdr);
+ sqlite3GetVarint32(&aKey[szHdr-1], &typeRowid);
+ return sqlite3VdbeSerialTypeLen(typeRowid);
+}
+
+
+/*
+** pCur points at an index entry created using the OP_MakeRecord opcode.
+** Read the rowid (the last field in the record) and store it in *rowid.
+** Return SQLITE_OK if everything works, or an error code otherwise.
+*/
+int sqlite3VdbeIdxRowid(BtCursor *pCur, i64 *rowid){
+ i64 nCellKey;
+ int rc;
+ u32 szHdr; /* Size of the header */
+ u32 typeRowid; /* Serial type of the rowid */
+ u32 lenRowid; /* Size of the rowid */
+ Mem m, v;
+
+ sqlite3BtreeKeySize(pCur, &nCellKey);
+ if( nCellKey<=0 ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ rc = sqlite3VdbeMemFromBtree(pCur, 0, nCellKey, 1, &m);
+ if( rc ){
+ return rc;
+ }
+ sqlite3GetVarint32(m.z, &szHdr);
+ sqlite3GetVarint32(&m.z[szHdr-1], &typeRowid);
+ lenRowid = sqlite3VdbeSerialTypeLen(typeRowid);
+ sqlite3VdbeSerialGet(&m.z[m.n-lenRowid], typeRowid, &v);
+ *rowid = v.i;
+ sqlite3VdbeMemRelease(&m);
+ return SQLITE_OK;
+}
+
+/*
+** Compare the key of the index entry that cursor pC is point to against
+** the key string in pKey (of length nKey). Write into *pRes a number
+** that is negative, zero, or positive if pC is less than, equal to,
+** or greater than pKey. Return SQLITE_OK on success.
+**
+** pKey is either created without a rowid or is truncated so that it
+** omits the rowid at the end. The rowid at the end of the index entry
+** is ignored as well.
+*/
+int sqlite3VdbeIdxKeyCompare(
+ Cursor *pC, /* The cursor to compare against */
+ int nKey, const u8 *pKey, /* The key to compare */
+ int *res /* Write the comparison result here */
+){
+ i64 nCellKey;
+ int rc;
+ BtCursor *pCur = pC->pCursor;
+ int lenRowid;
+ Mem m;
+
+ sqlite3BtreeKeySize(pCur, &nCellKey);
+ if( nCellKey<=0 ){
+ *res = 0;
+ return SQLITE_OK;
+ }
+ rc = sqlite3VdbeMemFromBtree(pC->pCursor, 0, nCellKey, 1, &m);
+ if( rc ){
+ return rc;
+ }
+ lenRowid = sqlite3VdbeIdxRowidLen(m.n, m.z);
+ *res = sqlite3VdbeRecordCompare(pC->pKeyInfo, m.n-lenRowid, m.z, nKey, pKey);
+ sqlite3VdbeMemRelease(&m);
+ return SQLITE_OK;
+}
+
+/*
+** This routine sets the value to be returned by subsequent calls to
+** sqlite3_changes() on the database handle 'db'.
+*/
+void sqlite3VdbeSetChanges(sqlite3 *db, int nChange){
+ db->nChange = nChange;
+ db->nTotalChange += nChange;
+}
+
+/*
+** Set a flag in the vdbe to update the change counter when it is finalised
+** or reset.
+*/
+void sqlite3VdbeCountChanges(Vdbe *v){
+ v->changeCntOn = 1;
+}
+
+/*
+** Mark every prepared statement associated with a database connection
+** as expired.
+**
+** An expired statement means that recompilation of the statement is
+** recommend. Statements expire when things happen that make their
+** programs obsolete. Removing user-defined functions or collating
+** sequences, or changing an authorization function are the types of
+** things that make prepared statements obsolete.
+*/
+void sqlite3ExpirePreparedStatements(sqlite3 *db){
+ Vdbe *p;
+ for(p = db->pVdbe; p; p=p->pNext){
+ p->expired = 1;
+ }
+}
+
+/*
+** Return the database associated with the Vdbe.
+*/
+sqlite3 *sqlite3VdbeDb(Vdbe *v){
+ return v->db;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/vdbefifo.c b/ext/pdo_sqlite/sqlite/src/vdbefifo.c
new file mode 100644
index 000000000..7ea6c050f
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/vdbefifo.c
@@ -0,0 +1,114 @@
+/*
+** 2005 June 16
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file implements a FIFO queue of rowids used for processing
+** UPDATE and DELETE statements.
+*/
+#include "sqliteInt.h"
+#include "vdbeInt.h"
+
+/*
+** Allocate a new FifoPage and return a pointer to it. Return NULL if
+** we run out of memory. Leave space on the page for nEntry entries.
+*/
+static FifoPage *allocatePage(int nEntry){
+ FifoPage *pPage;
+ if( nEntry>32767 ){
+ nEntry = 32767;
+ }
+ pPage = sqliteMallocRaw( sizeof(FifoPage) + sizeof(i64)*(nEntry-1) );
+ if( pPage ){
+ pPage->nSlot = nEntry;
+ pPage->iWrite = 0;
+ pPage->iRead = 0;
+ pPage->pNext = 0;
+ }
+ return pPage;
+}
+
+/*
+** Initialize a Fifo structure.
+*/
+void sqlite3VdbeFifoInit(Fifo *pFifo){
+ memset(pFifo, 0, sizeof(*pFifo));
+}
+
+/*
+** Push a single 64-bit integer value into the Fifo. Return SQLITE_OK
+** normally. SQLITE_NOMEM is returned if we are unable to allocate
+** memory.
+*/
+int sqlite3VdbeFifoPush(Fifo *pFifo, i64 val){
+ FifoPage *pPage;
+ pPage = pFifo->pLast;
+ if( pPage==0 ){
+ pPage = pFifo->pLast = pFifo->pFirst = allocatePage(20);
+ if( pPage==0 ){
+ return SQLITE_NOMEM;
+ }
+ }else if( pPage->iWrite>=pPage->nSlot ){
+ pPage->pNext = allocatePage(pFifo->nEntry);
+ if( pPage->pNext==0 ){
+ return SQLITE_NOMEM;
+ }
+ pPage = pFifo->pLast = pPage->pNext;
+ }
+ pPage->aSlot[pPage->iWrite++] = val;
+ pFifo->nEntry++;
+ return SQLITE_OK;
+}
+
+/*
+** Extract a single 64-bit integer value from the Fifo. The integer
+** extracted is the one least recently inserted. If the Fifo is empty
+** return SQLITE_DONE.
+*/
+int sqlite3VdbeFifoPop(Fifo *pFifo, i64 *pVal){
+ FifoPage *pPage;
+ if( pFifo->nEntry==0 ){
+ return SQLITE_DONE;
+ }
+ assert( pFifo->nEntry>0 );
+ pPage = pFifo->pFirst;
+ assert( pPage!=0 );
+ assert( pPage->iWrite>pPage->iRead );
+ assert( pPage->iWrite<=pPage->nSlot );
+ assert( pPage->iRead<pPage->nSlot );
+ assert( pPage->iRead>=0 );
+ *pVal = pPage->aSlot[pPage->iRead++];
+ pFifo->nEntry--;
+ if( pPage->iRead>=pPage->iWrite ){
+ pFifo->pFirst = pPage->pNext;
+ sqliteFree(pPage);
+ if( pFifo->nEntry==0 ){
+ assert( pFifo->pLast==pPage );
+ pFifo->pLast = 0;
+ }else{
+ assert( pFifo->pFirst!=0 );
+ }
+ }else{
+ assert( pFifo->nEntry>0 );
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Delete all information from a Fifo object. Free all memory held
+** by the Fifo.
+*/
+void sqlite3VdbeFifoClear(Fifo *pFifo){
+ FifoPage *pPage, *pNextPage;
+ for(pPage=pFifo->pFirst; pPage; pPage=pNextPage){
+ pNextPage = pPage->pNext;
+ sqliteFree(pPage);
+ }
+ sqlite3VdbeFifoInit(pFifo);
+}
diff --git a/ext/pdo_sqlite/sqlite/src/vdbemem.c b/ext/pdo_sqlite/sqlite/src/vdbemem.c
new file mode 100644
index 000000000..0b7e193be
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/vdbemem.c
@@ -0,0 +1,840 @@
+/*
+** 2004 May 26
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This file contains code use to manipulate "Mem" structure. A "Mem"
+** stores a single value in the VDBE. Mem is an opaque structure visible
+** only within the VDBE. Interface routines refer to a Mem using the
+** name sqlite_value
+*/
+#include "sqliteInt.h"
+#include "os.h"
+#include <ctype.h>
+#include "vdbeInt.h"
+
+/*
+** If pMem is an object with a valid string representation, this routine
+** ensures the internal encoding for the string representation is
+** 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE.
+**
+** If pMem is not a string object, or the encoding of the string
+** representation is already stored using the requested encoding, then this
+** routine is a no-op.
+**
+** SQLITE_OK is returned if the conversion is successful (or not required).
+** SQLITE_NOMEM may be returned if a malloc() fails during conversion
+** between formats.
+*/
+int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
+ int rc;
+ if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
+ return SQLITE_OK;
+ }
+#ifdef SQLITE_OMIT_UTF16
+ return SQLITE_ERROR;
+#else
+ rc = sqlite3VdbeMemTranslate(pMem, desiredEnc);
+ if( rc==SQLITE_NOMEM ){
+ sqlite3VdbeMemRelease(pMem);
+ pMem->flags = MEM_Null;
+ pMem->z = 0;
+ }
+ return rc;
+#endif
+}
+
+/*
+** Make the given Mem object MEM_Dyn.
+**
+** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
+*/
+int sqlite3VdbeMemDynamicify(Mem *pMem){
+ int n = pMem->n;
+ u8 *z;
+ if( (pMem->flags & (MEM_Ephem|MEM_Static|MEM_Short))==0 ){
+ return SQLITE_OK;
+ }
+ assert( (pMem->flags & MEM_Dyn)==0 );
+ assert( pMem->flags & (MEM_Str|MEM_Blob) );
+ z = sqliteMallocRaw( n+2 );
+ if( z==0 ){
+ return SQLITE_NOMEM;
+ }
+ pMem->flags |= MEM_Dyn|MEM_Term;
+ pMem->xDel = 0;
+ memcpy(z, pMem->z, n );
+ z[n] = 0;
+ z[n+1] = 0;
+ pMem->z = z;
+ pMem->flags &= ~(MEM_Ephem|MEM_Static|MEM_Short);
+ return SQLITE_OK;
+}
+
+/*
+** Make the given Mem object either MEM_Short or MEM_Dyn so that bytes
+** of the Mem.z[] array can be modified.
+**
+** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
+*/
+int sqlite3VdbeMemMakeWriteable(Mem *pMem){
+ int n;
+ u8 *z;
+ if( (pMem->flags & (MEM_Ephem|MEM_Static))==0 ){
+ return SQLITE_OK;
+ }
+ assert( (pMem->flags & MEM_Dyn)==0 );
+ assert( pMem->flags & (MEM_Str|MEM_Blob) );
+ if( (n = pMem->n)+2<sizeof(pMem->zShort) ){
+ z = pMem->zShort;
+ pMem->flags |= MEM_Short|MEM_Term;
+ }else{
+ z = sqliteMallocRaw( n+2 );
+ if( z==0 ){
+ return SQLITE_NOMEM;
+ }
+ pMem->flags |= MEM_Dyn|MEM_Term;
+ pMem->xDel = 0;
+ }
+ memcpy(z, pMem->z, n );
+ z[n] = 0;
+ z[n+1] = 0;
+ pMem->z = z;
+ pMem->flags &= ~(MEM_Ephem|MEM_Static);
+ return SQLITE_OK;
+}
+
+/*
+** Make sure the given Mem is \u0000 terminated.
+*/
+int sqlite3VdbeMemNulTerminate(Mem *pMem){
+ /* In SQLite, a string without a nul terminator occurs when a string
+ ** is loaded from disk (in this case the memory management is ephemeral),
+ ** or when it is supplied by the user as a bound variable or function
+ ** return value. Therefore, the memory management of the string must be
+ ** either ephemeral, static or controlled by a user-supplied destructor.
+ */
+ assert(
+ !(pMem->flags&MEM_Str) || /* it's not a string, or */
+ (pMem->flags&MEM_Term) || /* it's nul term. already, or */
+ (pMem->flags&(MEM_Ephem|MEM_Static)) || /* it's static or ephem, or */
+ (pMem->flags&MEM_Dyn && pMem->xDel) /* external management */
+ );
+ if( (pMem->flags & MEM_Term)!=0 || (pMem->flags & MEM_Str)==0 ){
+ return SQLITE_OK; /* Nothing to do */
+ }
+
+ if( pMem->flags & (MEM_Static|MEM_Ephem) ){
+ return sqlite3VdbeMemMakeWriteable(pMem);
+ }else{
+ char *z = sqliteMalloc(pMem->n+2);
+ if( !z ) return SQLITE_NOMEM;
+ memcpy(z, pMem->z, pMem->n);
+ z[pMem->n] = 0;
+ z[pMem->n+1] = 0;
+ pMem->xDel(pMem->z);
+ pMem->xDel = 0;
+ pMem->z = z;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Add MEM_Str to the set of representations for the given Mem. Numbers
+** are converted using sqlite3_snprintf(). Converting a BLOB to a string
+** is a no-op.
+**
+** Existing representations MEM_Int and MEM_Real are *not* invalidated.
+**
+** A MEM_Null value will never be passed to this function. This function is
+** used for converting values to text for returning to the user (i.e. via
+** sqlite3_value_text()), or for ensuring that values to be used as btree
+** keys are strings. In the former case a NULL pointer is returned the
+** user and the later is an internal programming error.
+*/
+int sqlite3VdbeMemStringify(Mem *pMem, int enc){
+ int rc = SQLITE_OK;
+ int fg = pMem->flags;
+ u8 *z = pMem->zShort;
+
+ assert( !(fg&(MEM_Str|MEM_Blob)) );
+ assert( fg&(MEM_Int|MEM_Real) );
+
+ /* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8
+ ** string representation of the value. Then, if the required encoding
+ ** is UTF-16le or UTF-16be do a translation.
+ **
+ ** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16.
+ */
+ if( fg & MEM_Real ){
+ sqlite3_snprintf(NBFS, z, "%!.15g", pMem->r);
+ }else{
+ assert( fg & MEM_Int );
+ sqlite3_snprintf(NBFS, z, "%lld", pMem->i);
+ }
+ pMem->n = strlen(z);
+ pMem->z = z;
+ pMem->enc = SQLITE_UTF8;
+ pMem->flags |= MEM_Str | MEM_Short | MEM_Term;
+ sqlite3VdbeChangeEncoding(pMem, enc);
+ return rc;
+}
+
+/*
+** Memory cell pMem contains the context of an aggregate function.
+** This routine calls the finalize method for that function. The
+** result of the aggregate is stored back into pMem.
+*/
+void sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
+ if( pFunc && pFunc->xFinalize ){
+ sqlite3_context ctx;
+ assert( (pMem->flags & MEM_Null)!=0 || pFunc==*(FuncDef**)&pMem->i );
+ ctx.s.flags = MEM_Null;
+ ctx.s.z = pMem->zShort;
+ ctx.pMem = pMem;
+ ctx.pFunc = pFunc;
+ pFunc->xFinalize(&ctx);
+ if( pMem->z && pMem->z!=pMem->zShort ){
+ sqliteFree( pMem->z );
+ }
+ *pMem = ctx.s;
+ if( pMem->flags & MEM_Short ){
+ pMem->z = pMem->zShort;
+ }
+ }
+}
+
+/*
+** Release any memory held by the Mem. This may leave the Mem in an
+** inconsistent state, for example with (Mem.z==0) and
+** (Mem.type==SQLITE_TEXT).
+*/
+void sqlite3VdbeMemRelease(Mem *p){
+ if( p->flags & (MEM_Dyn|MEM_Agg) ){
+ if( p->xDel ){
+ if( p->flags & MEM_Agg ){
+ sqlite3VdbeMemFinalize(p, *(FuncDef**)&p->i);
+ assert( (p->flags & MEM_Agg)==0 );
+ sqlite3VdbeMemRelease(p);
+ }else{
+ p->xDel((void *)p->z);
+ }
+ }else{
+ sqliteFree(p->z);
+ }
+ p->z = 0;
+ p->xDel = 0;
+ }
+}
+
+/*
+** Return some kind of integer value which is the best we can do
+** at representing the value that *pMem describes as an integer.
+** If pMem is an integer, then the value is exact. If pMem is
+** a floating-point then the value returned is the integer part.
+** If pMem is a string or blob, then we make an attempt to convert
+** it into a integer and return that. If pMem is NULL, return 0.
+**
+** If pMem is a string, its encoding might be changed.
+*/
+i64 sqlite3VdbeIntValue(Mem *pMem){
+ int flags = pMem->flags;
+ if( flags & MEM_Int ){
+ return pMem->i;
+ }else if( flags & MEM_Real ){
+ return (i64)pMem->r;
+ }else if( flags & (MEM_Str|MEM_Blob) ){
+ i64 value;
+ if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)
+ || sqlite3VdbeMemNulTerminate(pMem) ){
+ return SQLITE_NOMEM;
+ }
+ assert( pMem->z );
+ sqlite3atoi64(pMem->z, &value);
+ return value;
+ }else{
+ return 0;
+ }
+}
+
+/*
+** Convert pMem to type integer. Invalidate any prior representations.
+*/
+int sqlite3VdbeMemIntegerify(Mem *pMem){
+ pMem->i = sqlite3VdbeIntValue(pMem);
+ sqlite3VdbeMemRelease(pMem);
+ pMem->flags = MEM_Int;
+ return SQLITE_OK;
+}
+
+/*
+** Return the best representation of pMem that we can get into a
+** double. If pMem is already a double or an integer, return its
+** value. If it is a string or blob, try to convert it to a double.
+** If it is a NULL, return 0.0.
+*/
+double sqlite3VdbeRealValue(Mem *pMem){
+ if( pMem->flags & MEM_Real ){
+ return pMem->r;
+ }else if( pMem->flags & MEM_Int ){
+ return (double)pMem->i;
+ }else if( pMem->flags & (MEM_Str|MEM_Blob) ){
+ double val = 0.0;
+ if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)
+ || sqlite3VdbeMemNulTerminate(pMem) ){
+ return SQLITE_NOMEM;
+ }
+ assert( pMem->z );
+ sqlite3AtoF(pMem->z, &val);
+ return val;
+ }else{
+ return 0.0;
+ }
+}
+
+/*
+** Convert pMem so that it is of type MEM_Real. Invalidate any
+** prior representations.
+*/
+int sqlite3VdbeMemRealify(Mem *pMem){
+ pMem->r = sqlite3VdbeRealValue(pMem);
+ sqlite3VdbeMemRelease(pMem);
+ pMem->flags = MEM_Real;
+ return SQLITE_OK;
+}
+
+/*
+** Delete any previous value and set the value stored in *pMem to NULL.
+*/
+void sqlite3VdbeMemSetNull(Mem *pMem){
+ sqlite3VdbeMemRelease(pMem);
+ pMem->flags = MEM_Null;
+ pMem->type = SQLITE_NULL;
+ pMem->n = 0;
+}
+
+/*
+** Delete any previous value and set the value stored in *pMem to val,
+** manifest type INTEGER.
+*/
+void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
+ sqlite3VdbeMemRelease(pMem);
+ pMem->i = val;
+ pMem->flags = MEM_Int;
+ pMem->type = SQLITE_INTEGER;
+}
+
+/*
+** Delete any previous value and set the value stored in *pMem to val,
+** manifest type REAL.
+*/
+void sqlite3VdbeMemSetDouble(Mem *pMem, double val){
+ sqlite3VdbeMemRelease(pMem);
+ pMem->r = val;
+ pMem->flags = MEM_Real;
+ pMem->type = SQLITE_FLOAT;
+}
+
+/*
+** Make an shallow copy of pFrom into pTo. Prior contents of
+** pTo are overwritten. The pFrom->z field is not duplicated. If
+** pFrom->z is used, then pTo->z points to the same thing as pFrom->z
+** and flags gets srcType (either MEM_Ephem or MEM_Static).
+*/
+void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
+ memcpy(pTo, pFrom, sizeof(*pFrom)-sizeof(pFrom->zShort));
+ pTo->xDel = 0;
+ if( pTo->flags & (MEM_Str|MEM_Blob) ){
+ pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Short|MEM_Ephem);
+ assert( srcType==MEM_Ephem || srcType==MEM_Static );
+ pTo->flags |= srcType;
+ }
+}
+
+/*
+** Make a full copy of pFrom into pTo. Prior contents of pTo are
+** freed before the copy is made.
+*/
+int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
+ int rc;
+ if( pTo->flags & MEM_Dyn ){
+ sqlite3VdbeMemRelease(pTo);
+ }
+ sqlite3VdbeMemShallowCopy(pTo, pFrom, MEM_Ephem);
+ if( pTo->flags & MEM_Ephem ){
+ rc = sqlite3VdbeMemMakeWriteable(pTo);
+ }else{
+ rc = SQLITE_OK;
+ }
+ return rc;
+}
+
+/*
+** Transfer the contents of pFrom to pTo. Any existing value in pTo is
+** freed. If pFrom contains ephemeral data, a copy is made.
+**
+** pFrom contains an SQL NULL when this routine returns. SQLITE_NOMEM
+** might be returned if pFrom held ephemeral data and we were unable
+** to allocate enough space to make a copy.
+*/
+int sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){
+ int rc;
+ if( pTo->flags & MEM_Dyn ){
+ sqlite3VdbeMemRelease(pTo);
+ }
+ memcpy(pTo, pFrom, sizeof(Mem));
+ if( pFrom->flags & MEM_Short ){
+ pTo->z = pTo->zShort;
+ }
+ pFrom->flags = MEM_Null;
+ pFrom->xDel = 0;
+ if( pTo->flags & MEM_Ephem ){
+ rc = sqlite3VdbeMemMakeWriteable(pTo);
+ }else{
+ rc = SQLITE_OK;
+ }
+ return rc;
+}
+
+/*
+** Change the value of a Mem to be a string or a BLOB.
+*/
+int sqlite3VdbeMemSetStr(
+ Mem *pMem, /* Memory cell to set to string value */
+ const char *z, /* String pointer */
+ int n, /* Bytes in string, or negative */
+ u8 enc, /* Encoding of z. 0 for BLOBs */
+ void (*xDel)(void*) /* Destructor function */
+){
+ sqlite3VdbeMemRelease(pMem);
+ if( !z ){
+ pMem->flags = MEM_Null;
+ pMem->type = SQLITE_NULL;
+ return SQLITE_OK;
+ }
+
+ pMem->z = (char *)z;
+ if( xDel==SQLITE_STATIC ){
+ pMem->flags = MEM_Static;
+ }else if( xDel==SQLITE_TRANSIENT ){
+ pMem->flags = MEM_Ephem;
+ }else{
+ pMem->flags = MEM_Dyn;
+ pMem->xDel = xDel;
+ }
+
+ pMem->enc = enc;
+ pMem->type = enc==0 ? SQLITE_BLOB : SQLITE_TEXT;
+ pMem->n = n;
+
+ assert( enc==0 || enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE
+ || enc==SQLITE_UTF16BE );
+ switch( enc ){
+ case 0:
+ pMem->flags |= MEM_Blob;
+ pMem->enc = SQLITE_UTF8;
+ break;
+
+ case SQLITE_UTF8:
+ pMem->flags |= MEM_Str;
+ if( n<0 ){
+ pMem->n = strlen(z);
+ pMem->flags |= MEM_Term;
+ }
+ break;
+
+#ifndef SQLITE_OMIT_UTF16
+ case SQLITE_UTF16LE:
+ case SQLITE_UTF16BE:
+ pMem->flags |= MEM_Str;
+ if( pMem->n<0 ){
+ pMem->n = sqlite3utf16ByteLen(pMem->z,-1);
+ pMem->flags |= MEM_Term;
+ }
+ if( sqlite3VdbeMemHandleBom(pMem) ){
+ return SQLITE_NOMEM;
+ }
+#endif /* SQLITE_OMIT_UTF16 */
+ }
+ if( pMem->flags&MEM_Ephem ){
+ return sqlite3VdbeMemMakeWriteable(pMem);
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Compare the values contained by the two memory cells, returning
+** negative, zero or positive if pMem1 is less than, equal to, or greater
+** than pMem2. Sorting order is NULL's first, followed by numbers (integers
+** and reals) sorted numerically, followed by text ordered by the collating
+** sequence pColl and finally blob's ordered by memcmp().
+**
+** Two NULL values are considered equal by this function.
+*/
+int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){
+ int rc;
+ int f1, f2;
+ int combined_flags;
+
+ /* Interchange pMem1 and pMem2 if the collating sequence specifies
+ ** DESC order.
+ */
+ f1 = pMem1->flags;
+ f2 = pMem2->flags;
+ combined_flags = f1|f2;
+
+ /* If one value is NULL, it is less than the other. If both values
+ ** are NULL, return 0.
+ */
+ if( combined_flags&MEM_Null ){
+ return (f2&MEM_Null) - (f1&MEM_Null);
+ }
+
+ /* If one value is a number and the other is not, the number is less.
+ ** If both are numbers, compare as reals if one is a real, or as integers
+ ** if both values are integers.
+ */
+ if( combined_flags&(MEM_Int|MEM_Real) ){
+ if( !(f1&(MEM_Int|MEM_Real)) ){
+ return 1;
+ }
+ if( !(f2&(MEM_Int|MEM_Real)) ){
+ return -1;
+ }
+ if( (f1 & f2 & MEM_Int)==0 ){
+ double r1, r2;
+ if( (f1&MEM_Real)==0 ){
+ r1 = pMem1->i;
+ }else{
+ r1 = pMem1->r;
+ }
+ if( (f2&MEM_Real)==0 ){
+ r2 = pMem2->i;
+ }else{
+ r2 = pMem2->r;
+ }
+ if( r1<r2 ) return -1;
+ if( r1>r2 ) return 1;
+ return 0;
+ }else{
+ assert( f1&MEM_Int );
+ assert( f2&MEM_Int );
+ if( pMem1->i < pMem2->i ) return -1;
+ if( pMem1->i > pMem2->i ) return 1;
+ return 0;
+ }
+ }
+
+ /* If one value is a string and the other is a blob, the string is less.
+ ** If both are strings, compare using the collating functions.
+ */
+ if( combined_flags&MEM_Str ){
+ if( (f1 & MEM_Str)==0 ){
+ return 1;
+ }
+ if( (f2 & MEM_Str)==0 ){
+ return -1;
+ }
+
+ assert( pMem1->enc==pMem2->enc );
+ assert( pMem1->enc==SQLITE_UTF8 ||
+ pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE );
+
+ /* This assert may fail if the collation sequence is deleted after this
+ ** vdbe program is compiled. The documentation defines this as an
+ ** undefined condition. A crash is usual result.
+ */
+ assert( !pColl || pColl->xCmp );
+
+ if( pColl ){
+ if( pMem1->enc==pColl->enc ){
+ return pColl->xCmp(pColl->pUser,pMem1->n,pMem1->z,pMem2->n,pMem2->z);
+ }else{
+ u8 origEnc = pMem1->enc;
+ rc = pColl->xCmp(
+ pColl->pUser,
+ sqlite3ValueBytes((sqlite3_value*)pMem1, pColl->enc),
+ sqlite3ValueText((sqlite3_value*)pMem1, pColl->enc),
+ sqlite3ValueBytes((sqlite3_value*)pMem2, pColl->enc),
+ sqlite3ValueText((sqlite3_value*)pMem2, pColl->enc)
+ );
+ sqlite3ValueBytes((sqlite3_value*)pMem1, origEnc);
+ sqlite3ValueText((sqlite3_value*)pMem1, origEnc);
+ sqlite3ValueBytes((sqlite3_value*)pMem2, origEnc);
+ sqlite3ValueText((sqlite3_value*)pMem2, origEnc);
+ return rc;
+ }
+ }
+ /* If a NULL pointer was passed as the collate function, fall through
+ ** to the blob case and use memcmp(). */
+ }
+
+ /* Both values must be blobs. Compare using memcmp(). */
+ rc = memcmp(pMem1->z, pMem2->z, (pMem1->n>pMem2->n)?pMem2->n:pMem1->n);
+ if( rc==0 ){
+ rc = pMem1->n - pMem2->n;
+ }
+ return rc;
+}
+
+/*
+** Move data out of a btree key or data field and into a Mem structure.
+** The data or key is taken from the entry that pCur is currently pointing
+** to. offset and amt determine what portion of the data or key to retrieve.
+** key is true to get the key or false to get data. The result is written
+** into the pMem element.
+**
+** The pMem structure is assumed to be uninitialized. Any prior content
+** is overwritten without being freed.
+**
+** If this routine fails for any reason (malloc returns NULL or unable
+** to read from the disk) then the pMem is left in an inconsistent state.
+*/
+int sqlite3VdbeMemFromBtree(
+ BtCursor *pCur, /* Cursor pointing at record to retrieve. */
+ int offset, /* Offset from the start of data to return bytes from. */
+ int amt, /* Number of bytes to return. */
+ int key, /* If true, retrieve from the btree key, not data. */
+ Mem *pMem /* OUT: Return data in this Mem structure. */
+){
+ char *zData; /* Data from the btree layer */
+ int available; /* Number of bytes available on the local btree page */
+
+ if( key ){
+ zData = (char *)sqlite3BtreeKeyFetch(pCur, &available);
+ }else{
+ zData = (char *)sqlite3BtreeDataFetch(pCur, &available);
+ }
+
+ pMem->n = amt;
+ if( offset+amt<=available ){
+ pMem->z = &zData[offset];
+ pMem->flags = MEM_Blob|MEM_Ephem;
+ }else{
+ int rc;
+ if( amt>NBFS-2 ){
+ zData = (char *)sqliteMallocRaw(amt+2);
+ if( !zData ){
+ return SQLITE_NOMEM;
+ }
+ pMem->flags = MEM_Blob|MEM_Dyn|MEM_Term;
+ pMem->xDel = 0;
+ }else{
+ zData = &(pMem->zShort[0]);
+ pMem->flags = MEM_Blob|MEM_Short|MEM_Term;
+ }
+ pMem->z = zData;
+ pMem->enc = 0;
+ pMem->type = SQLITE_BLOB;
+
+ if( key ){
+ rc = sqlite3BtreeKey(pCur, offset, amt, zData);
+ }else{
+ rc = sqlite3BtreeData(pCur, offset, amt, zData);
+ }
+ zData[amt] = 0;
+ zData[amt+1] = 0;
+ if( rc!=SQLITE_OK ){
+ if( amt>NBFS-2 ){
+ assert( zData!=pMem->zShort );
+ assert( pMem->flags & MEM_Dyn );
+ sqliteFree(zData);
+ } else {
+ assert( zData==pMem->zShort );
+ assert( pMem->flags & MEM_Short );
+ }
+ return rc;
+ }
+ }
+
+ return SQLITE_OK;
+}
+
+#ifndef NDEBUG
+/*
+** Perform various checks on the memory cell pMem. An assert() will
+** fail if pMem is internally inconsistent.
+*/
+void sqlite3VdbeMemSanity(Mem *pMem, u8 db_enc){
+ int flags = pMem->flags;
+ assert( flags!=0 ); /* Must define some type */
+ if( pMem->flags & (MEM_Str|MEM_Blob) ){
+ int x = pMem->flags & (MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short);
+ assert( x!=0 ); /* Strings must define a string subtype */
+ assert( (x & (x-1))==0 ); /* Only one string subtype can be defined */
+ assert( pMem->z!=0 ); /* Strings must have a value */
+ /* Mem.z points to Mem.zShort iff the subtype is MEM_Short */
+ assert( (pMem->flags & MEM_Short)==0 || pMem->z==pMem->zShort );
+ assert( (pMem->flags & MEM_Short)!=0 || pMem->z!=pMem->zShort );
+ /* No destructor unless there is MEM_Dyn */
+ assert( pMem->xDel==0 || (pMem->flags & MEM_Dyn)!=0 );
+
+ if( (flags & MEM_Str) ){
+ assert( pMem->enc==SQLITE_UTF8 ||
+ pMem->enc==SQLITE_UTF16BE ||
+ pMem->enc==SQLITE_UTF16LE
+ );
+ /* If the string is UTF-8 encoded and nul terminated, then pMem->n
+ ** must be the length of the string. (Later:) If the database file
+ ** has been corrupted, '\000' characters might have been inserted
+ ** into the middle of the string. In that case, the strlen() might
+ ** be less.
+ */
+ if( pMem->enc==SQLITE_UTF8 && (flags & MEM_Term) ){
+ assert( strlen(pMem->z)<=pMem->n );
+ assert( pMem->z[pMem->n]==0 );
+ }
+ }
+ }else{
+ /* Cannot define a string subtype for non-string objects */
+ assert( (pMem->flags & (MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short))==0 );
+ assert( pMem->xDel==0 );
+ }
+ /* MEM_Null excludes all other types */
+ assert( (pMem->flags&(MEM_Str|MEM_Int|MEM_Real|MEM_Blob))==0
+ || (pMem->flags&MEM_Null)==0 );
+ /* If the MEM is both real and integer, the values are equal */
+ assert( (pMem->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real)
+ || pMem->r==pMem->i );
+}
+#endif
+
+/* This function is only available internally, it is not part of the
+** external API. It works in a similar way to sqlite3_value_text(),
+** except the data returned is in the encoding specified by the second
+** parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or
+** SQLITE_UTF8.
+*/
+const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
+ if( !pVal ) return 0;
+ assert( enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE || enc==SQLITE_UTF8);
+
+ if( pVal->flags&MEM_Null ){
+ return 0;
+ }
+ if( pVal->flags&MEM_Str ){
+ sqlite3VdbeChangeEncoding(pVal, enc);
+ }else if( !(pVal->flags&MEM_Blob) ){
+ sqlite3VdbeMemStringify(pVal, enc);
+ }
+ return (const void *)(pVal->z);
+}
+
+/*
+** Create a new sqlite3_value object.
+*/
+sqlite3_value* sqlite3ValueNew(void){
+ Mem *p = sqliteMalloc(sizeof(*p));
+ if( p ){
+ p->flags = MEM_Null;
+ p->type = SQLITE_NULL;
+ }
+ return p;
+}
+
+/*
+** Create a new sqlite3_value object, containing the value of pExpr.
+**
+** This only works for very simple expressions that consist of one constant
+** token (i.e. "5", "5.1", "NULL", "'a string'"). If the expression can
+** be converted directly into a value, then the value is allocated and
+** a pointer written to *ppVal. The caller is responsible for deallocating
+** the value by passing it to sqlite3ValueFree() later on. If the expression
+** cannot be converted to a value, then *ppVal is set to NULL.
+*/
+int sqlite3ValueFromExpr(
+ Expr *pExpr,
+ u8 enc,
+ u8 affinity,
+ sqlite3_value **ppVal
+){
+ int op;
+ char *zVal = 0;
+ sqlite3_value *pVal = 0;
+
+ if( !pExpr ){
+ *ppVal = 0;
+ return SQLITE_OK;
+ }
+ op = pExpr->op;
+
+ if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){
+ zVal = sqliteStrNDup(pExpr->token.z, pExpr->token.n);
+ pVal = sqlite3ValueNew();
+ if( !zVal || !pVal ) goto no_mem;
+ sqlite3Dequote(zVal);
+ sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, sqlite3FreeX);
+ if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_NONE ){
+ sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, enc);
+ }else{
+ sqlite3ValueApplyAffinity(pVal, affinity, enc);
+ }
+ }else if( op==TK_UMINUS ) {
+ if( SQLITE_OK==sqlite3ValueFromExpr(pExpr->pLeft, enc, affinity, &pVal) ){
+ pVal->i = -1 * pVal->i;
+ pVal->r = -1.0 * pVal->r;
+ }
+ }
+#ifndef SQLITE_OMIT_BLOB_LITERAL
+ else if( op==TK_BLOB ){
+ int nVal;
+ pVal = sqlite3ValueNew();
+ zVal = sqliteStrNDup(pExpr->token.z+1, pExpr->token.n-1);
+ if( !zVal || !pVal ) goto no_mem;
+ sqlite3Dequote(zVal);
+ nVal = strlen(zVal)/2;
+ sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(zVal), nVal, 0, sqlite3FreeX);
+ sqliteFree(zVal);
+ }
+#endif
+
+ *ppVal = pVal;
+ return SQLITE_OK;
+
+no_mem:
+ sqliteFree(zVal);
+ sqlite3ValueFree(pVal);
+ *ppVal = 0;
+ return SQLITE_NOMEM;
+}
+
+/*
+** Change the string value of an sqlite3_value object
+*/
+void sqlite3ValueSetStr(
+ sqlite3_value *v,
+ int n,
+ const void *z,
+ u8 enc,
+ void (*xDel)(void*)
+){
+ if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel);
+}
+
+/*
+** Free an sqlite3_value object
+*/
+void sqlite3ValueFree(sqlite3_value *v){
+ if( !v ) return;
+ sqlite3ValueSetStr(v, 0, 0, SQLITE_UTF8, SQLITE_STATIC);
+ sqliteFree(v);
+}
+
+/*
+** Return the number of bytes in the sqlite3_value object assuming
+** that it uses the encoding "enc"
+*/
+int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
+ Mem *p = (Mem*)pVal;
+ if( (p->flags & MEM_Blob)!=0 || sqlite3ValueText(pVal, enc) ){
+ return p->n;
+ }
+ return 0;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/where.c b/ext/pdo_sqlite/sqlite/src/where.c
new file mode 100644
index 000000000..d057acd0f
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/where.c
@@ -0,0 +1,2052 @@
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This module contains C code that generates VDBE code used to process
+** the WHERE clause of SQL statements. This module is reponsible for
+** generating the code that loops through a table looking for applicable
+** rows. Indices are selected and used to speed the search when doing
+** so is applicable. Because this module is responsible for selecting
+** indices, you might also think of this module as the "query optimizer".
+**
+** $Id$
+*/
+#include "sqliteInt.h"
+
+/*
+** The number of bits in a Bitmask. "BMS" means "BitMask Size".
+*/
+#define BMS (sizeof(Bitmask)*8)
+
+/*
+** Determine the number of elements in an array.
+*/
+#define ARRAYSIZE(X) (sizeof(X)/sizeof(X[0]))
+
+/*
+** Trace output macros
+*/
+#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
+int sqlite3_where_trace = 0;
+# define TRACE(X) if(sqlite3_where_trace) sqlite3DebugPrintf X
+#else
+# define TRACE(X)
+#endif
+
+/* Forward reference
+*/
+typedef struct WhereClause WhereClause;
+
+/*
+** The query generator uses an array of instances of this structure to
+** help it analyze the subexpressions of the WHERE clause. Each WHERE
+** clause subexpression is separated from the others by an AND operator.
+**
+** All WhereTerms are collected into a single WhereClause structure.
+** The following identity holds:
+**
+** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm
+**
+** When a term is of the form:
+**
+** X <op> <expr>
+**
+** where X is a column name and <op> is one of certain operators,
+** then WhereTerm.leftCursor and WhereTerm.leftColumn record the
+** cursor number and column number for X. WhereTerm.operator records
+** the <op> using a bitmask encoding defined by WO_xxx below. The
+** use of a bitmask encoding for the operator allows us to search
+** quickly for terms that match any of several different operators.
+**
+** prereqRight and prereqAll record sets of cursor numbers,
+** but they do so indirectly. A single ExprMaskSet structure translates
+** cursor number into bits and the translated bit is stored in the prereq
+** fields. The translation is used in order to maximize the number of
+** bits that will fit in a Bitmask. The VDBE cursor numbers might be
+** spread out over the non-negative integers. For example, the cursor
+** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The ExprMaskSet
+** translates these sparse cursor numbers into consecutive integers
+** beginning with 0 in order to make the best possible use of the available
+** bits in the Bitmask. So, in the example above, the cursor numbers
+** would be mapped into integers 0 through 7.
+*/
+typedef struct WhereTerm WhereTerm;
+struct WhereTerm {
+ Expr *pExpr; /* Pointer to the subexpression */
+ i16 iParent; /* Disable pWC->a[iParent] when this term disabled */
+ i16 leftCursor; /* Cursor number of X in "X <op> <expr>" */
+ i16 leftColumn; /* Column number of X in "X <op> <expr>" */
+ u16 operator; /* A WO_xx value describing <op> */
+ u8 flags; /* Bit flags. See below */
+ u8 nChild; /* Number of children that must disable us */
+ WhereClause *pWC; /* The clause this term is part of */
+ Bitmask prereqRight; /* Bitmask of tables used by pRight */
+ Bitmask prereqAll; /* Bitmask of tables referenced by p */
+};
+
+/*
+** Allowed values of WhereTerm.flags
+*/
+#define TERM_DYNAMIC 0x01 /* Need to call sqlite3ExprDelete(pExpr) */
+#define TERM_VIRTUAL 0x02 /* Added by the optimizer. Do not code */
+#define TERM_CODED 0x04 /* This term is already coded */
+#define TERM_COPIED 0x08 /* Has a child */
+#define TERM_OR_OK 0x10 /* Used during OR-clause processing */
+
+/*
+** An instance of the following structure holds all information about a
+** WHERE clause. Mostly this is a container for one or more WhereTerms.
+*/
+struct WhereClause {
+ Parse *pParse; /* The parser context */
+ int nTerm; /* Number of terms */
+ int nSlot; /* Number of entries in a[] */
+ WhereTerm *a; /* Each a[] describes a term of the WHERE cluase */
+ WhereTerm aStatic[10]; /* Initial static space for a[] */
+};
+
+/*
+** An instance of the following structure keeps track of a mapping
+** between VDBE cursor numbers and bits of the bitmasks in WhereTerm.
+**
+** The VDBE cursor numbers are small integers contained in
+** SrcList_item.iCursor and Expr.iTable fields. For any given WHERE
+** clause, the cursor numbers might not begin with 0 and they might
+** contain gaps in the numbering sequence. But we want to make maximum
+** use of the bits in our bitmasks. This structure provides a mapping
+** from the sparse cursor numbers into consecutive integers beginning
+** with 0.
+**
+** If ExprMaskSet.ix[A]==B it means that The A-th bit of a Bitmask
+** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<<A.
+**
+** For example, if the WHERE clause expression used these VDBE
+** cursors: 4, 5, 8, 29, 57, 73. Then the ExprMaskSet structure
+** would map those cursor numbers into bits 0 through 5.
+**
+** Note that the mapping is not necessarily ordered. In the example
+** above, the mapping might go like this: 4->3, 5->1, 8->2, 29->0,
+** 57->5, 73->4. Or one of 719 other combinations might be used. It
+** does not really matter. What is important is that sparse cursor
+** numbers all get mapped into bit numbers that begin with 0 and contain
+** no gaps.
+*/
+typedef struct ExprMaskSet ExprMaskSet;
+struct ExprMaskSet {
+ int n; /* Number of assigned cursor values */
+ int ix[sizeof(Bitmask)*8]; /* Cursor assigned to each bit */
+};
+
+
+/*
+** Bitmasks for the operators that indices are able to exploit. An
+** OR-ed combination of these values can be used when searching for
+** terms in the where clause.
+*/
+#define WO_IN 1
+#define WO_EQ 2
+#define WO_LT (WO_EQ<<(TK_LT-TK_EQ))
+#define WO_LE (WO_EQ<<(TK_LE-TK_EQ))
+#define WO_GT (WO_EQ<<(TK_GT-TK_EQ))
+#define WO_GE (WO_EQ<<(TK_GE-TK_EQ))
+
+/*
+** Value for flags returned by bestIndex()
+*/
+#define WHERE_ROWID_EQ 0x0001 /* rowid=EXPR or rowid IN (...) */
+#define WHERE_ROWID_RANGE 0x0002 /* rowid<EXPR and/or rowid>EXPR */
+#define WHERE_COLUMN_EQ 0x0010 /* x=EXPR or x IN (...) */
+#define WHERE_COLUMN_RANGE 0x0020 /* x<EXPR and/or x>EXPR */
+#define WHERE_COLUMN_IN 0x0040 /* x IN (...) */
+#define WHERE_TOP_LIMIT 0x0100 /* x<EXPR or x<=EXPR constraint */
+#define WHERE_BTM_LIMIT 0x0200 /* x>EXPR or x>=EXPR constraint */
+#define WHERE_IDX_ONLY 0x0800 /* Use index only - omit table */
+#define WHERE_ORDERBY 0x1000 /* Output will appear in correct order */
+#define WHERE_REVERSE 0x2000 /* Scan in reverse order */
+#define WHERE_UNIQUE 0x4000 /* Selects no more than one row */
+
+/*
+** Initialize a preallocated WhereClause structure.
+*/
+static void whereClauseInit(WhereClause *pWC, Parse *pParse){
+ pWC->pParse = pParse;
+ pWC->nTerm = 0;
+ pWC->nSlot = ARRAYSIZE(pWC->aStatic);
+ pWC->a = pWC->aStatic;
+}
+
+/*
+** Deallocate a WhereClause structure. The WhereClause structure
+** itself is not freed. This routine is the inverse of whereClauseInit().
+*/
+static void whereClauseClear(WhereClause *pWC){
+ int i;
+ WhereTerm *a;
+ for(i=pWC->nTerm-1, a=pWC->a; i>=0; i--, a++){
+ if( a->flags & TERM_DYNAMIC ){
+ sqlite3ExprDelete(a->pExpr);
+ }
+ }
+ if( pWC->a!=pWC->aStatic ){
+ sqliteFree(pWC->a);
+ }
+}
+
+/*
+** Add a new entries to the WhereClause structure. Increase the allocated
+** space as necessary.
+**
+** WARNING: This routine might reallocate the space used to store
+** WhereTerms. All pointers to WhereTerms should be invalided after
+** calling this routine. Such pointers may be reinitialized by referencing
+** the pWC->a[] array.
+*/
+static int whereClauseInsert(WhereClause *pWC, Expr *p, int flags){
+ WhereTerm *pTerm;
+ int idx;
+ if( pWC->nTerm>=pWC->nSlot ){
+ WhereTerm *pOld = pWC->a;
+ pWC->a = sqliteMalloc( sizeof(pWC->a[0])*pWC->nSlot*2 );
+ if( pWC->a==0 ) return 0;
+ memcpy(pWC->a, pOld, sizeof(pWC->a[0])*pWC->nTerm);
+ if( pOld!=pWC->aStatic ){
+ sqliteFree(pOld);
+ }
+ pWC->nSlot *= 2;
+ }
+ pTerm = &pWC->a[idx = pWC->nTerm];
+ pWC->nTerm++;
+ pTerm->pExpr = p;
+ pTerm->flags = flags;
+ pTerm->pWC = pWC;
+ pTerm->iParent = -1;
+ return idx;
+}
+
+/*
+** This routine identifies subexpressions in the WHERE clause where
+** each subexpression is separated by the AND operator or some other
+** operator specified in the op parameter. The WhereClause structure
+** is filled with pointers to subexpressions. For example:
+**
+** WHERE a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22)
+** \________/ \_______________/ \________________/
+** slot[0] slot[1] slot[2]
+**
+** The original WHERE clause in pExpr is unaltered. All this routine
+** does is make slot[] entries point to substructure within pExpr.
+**
+** In the previous sentence and in the diagram, "slot[]" refers to
+** the WhereClause.a[] array. This array grows as needed to contain
+** all terms of the WHERE clause.
+*/
+static void whereSplit(WhereClause *pWC, Expr *pExpr, int op){
+ if( pExpr==0 ) return;
+ if( pExpr->op!=op ){
+ whereClauseInsert(pWC, pExpr, 0);
+ }else{
+ whereSplit(pWC, pExpr->pLeft, op);
+ whereSplit(pWC, pExpr->pRight, op);
+ }
+}
+
+/*
+** Initialize an expression mask set
+*/
+#define initMaskSet(P) memset(P, 0, sizeof(*P))
+
+/*
+** Return the bitmask for the given cursor number. Return 0 if
+** iCursor is not in the set.
+*/
+static Bitmask getMask(ExprMaskSet *pMaskSet, int iCursor){
+ int i;
+ for(i=0; i<pMaskSet->n; i++){
+ if( pMaskSet->ix[i]==iCursor ){
+ return ((Bitmask)1)<<i;
+ }
+ }
+ return 0;
+}
+
+/*
+** Create a new mask for cursor iCursor.
+**
+** There is one cursor per table in the FROM clause. The number of
+** tables in the FROM clause is limited by a test early in the
+** sqlite3WhereBegin() routine. So we know that the pMaskSet->ix[]
+** array will never overflow.
+*/
+static void createMask(ExprMaskSet *pMaskSet, int iCursor){
+ assert( pMaskSet->n < ARRAYSIZE(pMaskSet->ix) );
+ pMaskSet->ix[pMaskSet->n++] = iCursor;
+}
+
+/*
+** This routine walks (recursively) an expression tree and generates
+** a bitmask indicating which tables are used in that expression
+** tree.
+**
+** In order for this routine to work, the calling function must have
+** previously invoked sqlite3ExprResolveNames() on the expression. See
+** the header comment on that routine for additional information.
+** The sqlite3ExprResolveNames() routines looks for column names and
+** sets their opcodes to TK_COLUMN and their Expr.iTable fields to
+** the VDBE cursor number of the table. This routine just has to
+** translate the cursor numbers into bitmask values and OR all
+** the bitmasks together.
+*/
+static Bitmask exprListTableUsage(ExprMaskSet*, ExprList*);
+static Bitmask exprSelectTableUsage(ExprMaskSet*, Select*);
+static Bitmask exprTableUsage(ExprMaskSet *pMaskSet, Expr *p){
+ Bitmask mask = 0;
+ if( p==0 ) return 0;
+ if( p->op==TK_COLUMN ){
+ mask = getMask(pMaskSet, p->iTable);
+ return mask;
+ }
+ mask = exprTableUsage(pMaskSet, p->pRight);
+ mask |= exprTableUsage(pMaskSet, p->pLeft);
+ mask |= exprListTableUsage(pMaskSet, p->pList);
+ mask |= exprSelectTableUsage(pMaskSet, p->pSelect);
+ return mask;
+}
+static Bitmask exprListTableUsage(ExprMaskSet *pMaskSet, ExprList *pList){
+ int i;
+ Bitmask mask = 0;
+ if( pList ){
+ for(i=0; i<pList->nExpr; i++){
+ mask |= exprTableUsage(pMaskSet, pList->a[i].pExpr);
+ }
+ }
+ return mask;
+}
+static Bitmask exprSelectTableUsage(ExprMaskSet *pMaskSet, Select *pS){
+ Bitmask mask;
+ if( pS==0 ){
+ mask = 0;
+ }else{
+ mask = exprListTableUsage(pMaskSet, pS->pEList);
+ mask |= exprListTableUsage(pMaskSet, pS->pGroupBy);
+ mask |= exprListTableUsage(pMaskSet, pS->pOrderBy);
+ mask |= exprTableUsage(pMaskSet, pS->pWhere);
+ mask |= exprTableUsage(pMaskSet, pS->pHaving);
+ }
+ return mask;
+}
+
+/*
+** Return TRUE if the given operator is one of the operators that is
+** allowed for an indexable WHERE clause term. The allowed operators are
+** "=", "<", ">", "<=", ">=", and "IN".
+*/
+static int allowedOp(int op){
+ assert( TK_GT>TK_EQ && TK_GT<TK_GE );
+ assert( TK_LT>TK_EQ && TK_LT<TK_GE );
+ assert( TK_LE>TK_EQ && TK_LE<TK_GE );
+ assert( TK_GE==TK_EQ+4 );
+ return op==TK_IN || (op>=TK_EQ && op<=TK_GE);
+}
+
+/*
+** Swap two objects of type T.
+*/
+#define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;}
+
+/*
+** Commute a comparision operator. Expressions of the form "X op Y"
+** are converted into "Y op X".
+*/
+static void exprCommute(Expr *pExpr){
+ assert( allowedOp(pExpr->op) && pExpr->op!=TK_IN );
+ SWAP(CollSeq*,pExpr->pRight->pColl,pExpr->pLeft->pColl);
+ SWAP(Expr*,pExpr->pRight,pExpr->pLeft);
+ if( pExpr->op>=TK_GT ){
+ assert( TK_LT==TK_GT+2 );
+ assert( TK_GE==TK_LE+2 );
+ assert( TK_GT>TK_EQ );
+ assert( TK_GT<TK_LE );
+ assert( pExpr->op>=TK_GT && pExpr->op<=TK_GE );
+ pExpr->op = ((pExpr->op-TK_GT)^2)+TK_GT;
+ }
+}
+
+/*
+** Translate from TK_xx operator to WO_xx bitmask.
+*/
+static int operatorMask(int op){
+ int c;
+ assert( allowedOp(op) );
+ if( op==TK_IN ){
+ c = WO_IN;
+ }else{
+ c = WO_EQ<<(op-TK_EQ);
+ }
+ assert( op!=TK_IN || c==WO_IN );
+ assert( op!=TK_EQ || c==WO_EQ );
+ assert( op!=TK_LT || c==WO_LT );
+ assert( op!=TK_LE || c==WO_LE );
+ assert( op!=TK_GT || c==WO_GT );
+ assert( op!=TK_GE || c==WO_GE );
+ return c;
+}
+
+/*
+** Search for a term in the WHERE clause that is of the form "X <op> <expr>"
+** where X is a reference to the iColumn of table iCur and <op> is one of
+** the WO_xx operator codes specified by the op parameter.
+** Return a pointer to the term. Return 0 if not found.
+*/
+static WhereTerm *findTerm(
+ WhereClause *pWC, /* The WHERE clause to be searched */
+ int iCur, /* Cursor number of LHS */
+ int iColumn, /* Column number of LHS */
+ Bitmask notReady, /* RHS must not overlap with this mask */
+ u16 op, /* Mask of WO_xx values describing operator */
+ Index *pIdx /* Must be compatible with this index, if not NULL */
+){
+ WhereTerm *pTerm;
+ int k;
+ for(pTerm=pWC->a, k=pWC->nTerm; k; k--, pTerm++){
+ if( pTerm->leftCursor==iCur
+ && (pTerm->prereqRight & notReady)==0
+ && pTerm->leftColumn==iColumn
+ && (pTerm->operator & op)!=0
+ ){
+ if( iCur>=0 && pIdx ){
+ Expr *pX = pTerm->pExpr;
+ CollSeq *pColl;
+ char idxaff;
+ int k;
+ Parse *pParse = pWC->pParse;
+
+ idxaff = pIdx->pTable->aCol[iColumn].affinity;
+ if( !sqlite3IndexAffinityOk(pX, idxaff) ) continue;
+ pColl = sqlite3ExprCollSeq(pParse, pX->pLeft);
+ if( !pColl ){
+ if( pX->pRight ){
+ pColl = sqlite3ExprCollSeq(pParse, pX->pRight);
+ }
+ if( !pColl ){
+ pColl = pParse->db->pDfltColl;
+ }
+ }
+ for(k=0; k<pIdx->nColumn && pIdx->aiColumn[k]!=iColumn; k++){}
+ assert( k<pIdx->nColumn );
+ if( pColl!=pIdx->keyInfo.aColl[k] ) continue;
+ }
+ return pTerm;
+ }
+ }
+ return 0;
+}
+
+/* Forward reference */
+static void exprAnalyze(SrcList*, ExprMaskSet*, WhereClause*, int);
+
+/*
+** Call exprAnalyze on all terms in a WHERE clause.
+**
+**
+*/
+static void exprAnalyzeAll(
+ SrcList *pTabList, /* the FROM clause */
+ ExprMaskSet *pMaskSet, /* table masks */
+ WhereClause *pWC /* the WHERE clause to be analyzed */
+){
+ int i;
+ for(i=pWC->nTerm-1; i>=0; i--){
+ exprAnalyze(pTabList, pMaskSet, pWC, i);
+ }
+}
+
+#ifndef SQLITE_OMIT_LIKE_OPTIMIZATION
+/*
+** Check to see if the given expression is a LIKE or GLOB operator that
+** can be optimized using inequality constraints. Return TRUE if it is
+** so and false if not.
+**
+** In order for the operator to be optimizible, the RHS must be a string
+** literal that does not begin with a wildcard.
+*/
+static int isLikeOrGlob(
+ sqlite3 *db, /* The database */
+ Expr *pExpr, /* Test this expression */
+ int *pnPattern, /* Number of non-wildcard prefix characters */
+ int *pisComplete /* True if the only wildcard is % in the last character */
+){
+ const char *z;
+ Expr *pRight, *pLeft;
+ ExprList *pList;
+ int c, cnt;
+ int noCase;
+ char wc[3];
+ CollSeq *pColl;
+
+ if( !sqlite3IsLikeFunction(db, pExpr, &noCase, wc) ){
+ return 0;
+ }
+ pList = pExpr->pList;
+ pRight = pList->a[0].pExpr;
+ if( pRight->op!=TK_STRING ){
+ return 0;
+ }
+ pLeft = pList->a[1].pExpr;
+ if( pLeft->op!=TK_COLUMN ){
+ return 0;
+ }
+ pColl = pLeft->pColl;
+ if( pColl==0 ){
+ pColl = db->pDfltColl;
+ }
+ if( (pColl->type!=SQLITE_COLL_BINARY || noCase) &&
+ (pColl->type!=SQLITE_COLL_NOCASE || !noCase) ){
+ return 0;
+ }
+ sqlite3DequoteExpr(pRight);
+ z = pRight->token.z;
+ for(cnt=0; (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2]; cnt++){}
+ if( cnt==0 || 255==(u8)z[cnt] ){
+ return 0;
+ }
+ *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0;
+ *pnPattern = cnt;
+ return 1;
+}
+#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
+
+/*
+** The input to this routine is an WhereTerm structure with only the
+** "pExpr" field filled in. The job of this routine is to analyze the
+** subexpression and populate all the other fields of the WhereTerm
+** structure.
+**
+** If the expression is of the form "<expr> <op> X" it gets commuted
+** to the standard form of "X <op> <expr>". If the expression is of
+** the form "X <op> Y" where both X and Y are columns, then the original
+** expression is unchanged and a new virtual expression of the form
+** "Y <op> X" is added to the WHERE clause and analyzed separately.
+*/
+static void exprAnalyze(
+ SrcList *pSrc, /* the FROM clause */
+ ExprMaskSet *pMaskSet, /* table masks */
+ WhereClause *pWC, /* the WHERE clause */
+ int idxTerm /* Index of the term to be analyzed */
+){
+ WhereTerm *pTerm = &pWC->a[idxTerm];
+ Expr *pExpr = pTerm->pExpr;
+ Bitmask prereqLeft;
+ Bitmask prereqAll;
+ int nPattern;
+ int isComplete;
+
+ if( sqlite3_malloc_failed ) return;
+ prereqLeft = exprTableUsage(pMaskSet, pExpr->pLeft);
+ if( pExpr->op==TK_IN ){
+ assert( pExpr->pRight==0 );
+ pTerm->prereqRight = exprListTableUsage(pMaskSet, pExpr->pList)
+ | exprSelectTableUsage(pMaskSet, pExpr->pSelect);
+ }else{
+ pTerm->prereqRight = exprTableUsage(pMaskSet, pExpr->pRight);
+ }
+ prereqAll = exprTableUsage(pMaskSet, pExpr);
+ if( ExprHasProperty(pExpr, EP_FromJoin) ){
+ prereqAll |= getMask(pMaskSet, pExpr->iRightJoinTable);
+ }
+ pTerm->prereqAll = prereqAll;
+ pTerm->leftCursor = -1;
+ pTerm->iParent = -1;
+ pTerm->operator = 0;
+ if( allowedOp(pExpr->op) && (pTerm->prereqRight & prereqLeft)==0 ){
+ Expr *pLeft = pExpr->pLeft;
+ Expr *pRight = pExpr->pRight;
+ if( pLeft->op==TK_COLUMN ){
+ pTerm->leftCursor = pLeft->iTable;
+ pTerm->leftColumn = pLeft->iColumn;
+ pTerm->operator = operatorMask(pExpr->op);
+ }
+ if( pRight && pRight->op==TK_COLUMN ){
+ WhereTerm *pNew;
+ Expr *pDup;
+ if( pTerm->leftCursor>=0 ){
+ int idxNew;
+ pDup = sqlite3ExprDup(pExpr);
+ idxNew = whereClauseInsert(pWC, pDup, TERM_VIRTUAL|TERM_DYNAMIC);
+ if( idxNew==0 ) return;
+ pNew = &pWC->a[idxNew];
+ pNew->iParent = idxTerm;
+ pTerm = &pWC->a[idxTerm];
+ pTerm->nChild = 1;
+ pTerm->flags |= TERM_COPIED;
+ }else{
+ pDup = pExpr;
+ pNew = pTerm;
+ }
+ exprCommute(pDup);
+ pLeft = pDup->pLeft;
+ pNew->leftCursor = pLeft->iTable;
+ pNew->leftColumn = pLeft->iColumn;
+ pNew->prereqRight = prereqLeft;
+ pNew->prereqAll = prereqAll;
+ pNew->operator = operatorMask(pDup->op);
+ }
+ }
+
+#ifndef SQLITE_OMIT_BETWEEN_OPTIMIZATION
+ /* If a term is the BETWEEN operator, create two new virtual terms
+ ** that define the range that the BETWEEN implements.
+ */
+ else if( pExpr->op==TK_BETWEEN ){
+ ExprList *pList = pExpr->pList;
+ int i;
+ static const u8 ops[] = {TK_GE, TK_LE};
+ assert( pList!=0 );
+ assert( pList->nExpr==2 );
+ for(i=0; i<2; i++){
+ Expr *pNewExpr;
+ int idxNew;
+ pNewExpr = sqlite3Expr(ops[i], sqlite3ExprDup(pExpr->pLeft),
+ sqlite3ExprDup(pList->a[i].pExpr), 0);
+ idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC);
+ exprAnalyze(pSrc, pMaskSet, pWC, idxNew);
+ pTerm = &pWC->a[idxTerm];
+ pWC->a[idxNew].iParent = idxTerm;
+ }
+ pTerm->nChild = 2;
+ }
+#endif /* SQLITE_OMIT_BETWEEN_OPTIMIZATION */
+
+#ifndef SQLITE_OMIT_OR_OPTIMIZATION
+ /* Attempt to convert OR-connected terms into an IN operator so that
+ ** they can make use of indices. Example:
+ **
+ ** x = expr1 OR expr2 = x OR x = expr3
+ **
+ ** is converted into
+ **
+ ** x IN (expr1,expr2,expr3)
+ */
+ else if( pExpr->op==TK_OR ){
+ int ok;
+ int i, j;
+ int iColumn, iCursor;
+ WhereClause sOr;
+ WhereTerm *pOrTerm;
+
+ assert( (pTerm->flags & TERM_DYNAMIC)==0 );
+ whereClauseInit(&sOr, pWC->pParse);
+ whereSplit(&sOr, pExpr, TK_OR);
+ exprAnalyzeAll(pSrc, pMaskSet, &sOr);
+ assert( sOr.nTerm>0 );
+ j = 0;
+ do{
+ iColumn = sOr.a[j].leftColumn;
+ iCursor = sOr.a[j].leftCursor;
+ ok = iCursor>=0;
+ for(i=sOr.nTerm-1, pOrTerm=sOr.a; i>=0 && ok; i--, pOrTerm++){
+ if( pOrTerm->operator!=WO_EQ ){
+ goto or_not_possible;
+ }
+ if( pOrTerm->leftCursor==iCursor && pOrTerm->leftColumn==iColumn ){
+ pOrTerm->flags |= TERM_OR_OK;
+ }else if( (pOrTerm->flags & TERM_COPIED)!=0 ||
+ ((pOrTerm->flags & TERM_VIRTUAL)!=0 &&
+ (sOr.a[pOrTerm->iParent].flags & TERM_OR_OK)!=0) ){
+ pOrTerm->flags &= ~TERM_OR_OK;
+ }else{
+ ok = 0;
+ }
+ }
+ }while( !ok && (sOr.a[j++].flags & TERM_COPIED)!=0 && j<sOr.nTerm );
+ if( ok ){
+ ExprList *pList = 0;
+ Expr *pNew, *pDup;
+ for(i=sOr.nTerm-1, pOrTerm=sOr.a; i>=0 && ok; i--, pOrTerm++){
+ if( (pOrTerm->flags & TERM_OR_OK)==0 ) continue;
+ pDup = sqlite3ExprDup(pOrTerm->pExpr->pRight);
+ pList = sqlite3ExprListAppend(pList, pDup, 0);
+ }
+ pDup = sqlite3Expr(TK_COLUMN, 0, 0, 0);
+ if( pDup ){
+ pDup->iTable = iCursor;
+ pDup->iColumn = iColumn;
+ }
+ pNew = sqlite3Expr(TK_IN, pDup, 0, 0);
+ if( pNew ){
+ pNew->pList = pList;
+ }else{
+ sqlite3ExprListDelete(pList);
+ }
+ pTerm->pExpr = pNew;
+ pTerm->flags |= TERM_DYNAMIC;
+ exprAnalyze(pSrc, pMaskSet, pWC, idxTerm);
+ pTerm = &pWC->a[idxTerm];
+ }
+or_not_possible:
+ whereClauseClear(&sOr);
+ }
+#endif /* SQLITE_OMIT_OR_OPTIMIZATION */
+
+#ifndef SQLITE_OMIT_LIKE_OPTIMIZATION
+ /* Add constraints to reduce the search space on a LIKE or GLOB
+ ** operator.
+ */
+ if( isLikeOrGlob(pWC->pParse->db, pExpr, &nPattern, &isComplete) ){
+ Expr *pLeft, *pRight;
+ Expr *pStr1, *pStr2;
+ Expr *pNewExpr1, *pNewExpr2;
+ int idxNew1, idxNew2;
+
+ pLeft = pExpr->pList->a[1].pExpr;
+ pRight = pExpr->pList->a[0].pExpr;
+ pStr1 = sqlite3Expr(TK_STRING, 0, 0, 0);
+ if( pStr1 ){
+ sqlite3TokenCopy(&pStr1->token, &pRight->token);
+ pStr1->token.n = nPattern;
+ }
+ pStr2 = sqlite3ExprDup(pStr1);
+ if( pStr2 ){
+ assert( pStr2->token.dyn );
+ ++*(u8*)&pStr2->token.z[nPattern-1];
+ }
+ pNewExpr1 = sqlite3Expr(TK_GE, sqlite3ExprDup(pLeft), pStr1, 0);
+ idxNew1 = whereClauseInsert(pWC, pNewExpr1, TERM_VIRTUAL|TERM_DYNAMIC);
+ exprAnalyze(pSrc, pMaskSet, pWC, idxNew1);
+ pNewExpr2 = sqlite3Expr(TK_LT, sqlite3ExprDup(pLeft), pStr2, 0);
+ idxNew2 = whereClauseInsert(pWC, pNewExpr2, TERM_VIRTUAL|TERM_DYNAMIC);
+ exprAnalyze(pSrc, pMaskSet, pWC, idxNew2);
+ pTerm = &pWC->a[idxTerm];
+ if( isComplete ){
+ pWC->a[idxNew1].iParent = idxTerm;
+ pWC->a[idxNew2].iParent = idxTerm;
+ pTerm->nChild = 2;
+ }
+ }
+#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
+}
+
+
+/*
+** This routine decides if pIdx can be used to satisfy the ORDER BY
+** clause. If it can, it returns 1. If pIdx cannot satisfy the
+** ORDER BY clause, this routine returns 0.
+**
+** pOrderBy is an ORDER BY clause from a SELECT statement. pTab is the
+** left-most table in the FROM clause of that same SELECT statement and
+** the table has a cursor number of "base". pIdx is an index on pTab.
+**
+** nEqCol is the number of columns of pIdx that are used as equality
+** constraints. Any of these columns may be missing from the ORDER BY
+** clause and the match can still be a success.
+**
+** All terms of the ORDER BY that match against the index must be either
+** ASC or DESC. (Terms of the ORDER BY clause past the end of a UNIQUE
+** index do not need to satisfy this constraint.) The *pbRev value is
+** set to 1 if the ORDER BY clause is all DESC and it is set to 0 if
+** the ORDER BY clause is all ASC.
+*/
+static int isSortingIndex(
+ Parse *pParse, /* Parsing context */
+ Index *pIdx, /* The index we are testing */
+ Table *pTab, /* The table to be sorted */
+ int base, /* Cursor number for pTab */
+ ExprList *pOrderBy, /* The ORDER BY clause */
+ int nEqCol, /* Number of index columns with == constraints */
+ int *pbRev /* Set to 1 if ORDER BY is DESC */
+){
+ int i, j; /* Loop counters */
+ int sortOrder = SQLITE_SO_ASC; /* Which direction we are sorting */
+ int nTerm; /* Number of ORDER BY terms */
+ struct ExprList_item *pTerm; /* A term of the ORDER BY clause */
+ sqlite3 *db = pParse->db;
+
+ assert( pOrderBy!=0 );
+ nTerm = pOrderBy->nExpr;
+ assert( nTerm>0 );
+
+ /* Match terms of the ORDER BY clause against columns of
+ ** the index.
+ */
+ for(i=j=0, pTerm=pOrderBy->a; j<nTerm && i<pIdx->nColumn; i++){
+ Expr *pExpr; /* The expression of the ORDER BY pTerm */
+ CollSeq *pColl; /* The collating sequence of pExpr */
+
+ pExpr = pTerm->pExpr;
+ if( pExpr->op!=TK_COLUMN || pExpr->iTable!=base ){
+ /* Can not use an index sort on anything that is not a column in the
+ ** left-most table of the FROM clause */
+ return 0;
+ }
+ pColl = sqlite3ExprCollSeq(pParse, pExpr);
+ if( !pColl ) pColl = db->pDfltColl;
+ if( pExpr->iColumn!=pIdx->aiColumn[i] || pColl!=pIdx->keyInfo.aColl[i] ){
+ /* Term j of the ORDER BY clause does not match column i of the index */
+ if( i<nEqCol ){
+ /* If an index column that is constrained by == fails to match an
+ ** ORDER BY term, that is OK. Just ignore that column of the index
+ */
+ continue;
+ }else{
+ /* If an index column fails to match and is not constrained by ==
+ ** then the index cannot satisfy the ORDER BY constraint.
+ */
+ return 0;
+ }
+ }
+ if( i>nEqCol ){
+ if( pTerm->sortOrder!=sortOrder ){
+ /* Indices can only be used if all ORDER BY terms past the
+ ** equality constraints are all either DESC or ASC. */
+ return 0;
+ }
+ }else{
+ sortOrder = pTerm->sortOrder;
+ }
+ j++;
+ pTerm++;
+ }
+
+ /* The index can be used for sorting if all terms of the ORDER BY clause
+ ** are covered.
+ */
+ if( j>=nTerm ){
+ *pbRev = sortOrder==SQLITE_SO_DESC;
+ return 1;
+ }
+ return 0;
+}
+
+/*
+** Check table to see if the ORDER BY clause in pOrderBy can be satisfied
+** by sorting in order of ROWID. Return true if so and set *pbRev to be
+** true for reverse ROWID and false for forward ROWID order.
+*/
+static int sortableByRowid(
+ int base, /* Cursor number for table to be sorted */
+ ExprList *pOrderBy, /* The ORDER BY clause */
+ int *pbRev /* Set to 1 if ORDER BY is DESC */
+){
+ Expr *p;
+
+ assert( pOrderBy!=0 );
+ assert( pOrderBy->nExpr>0 );
+ p = pOrderBy->a[0].pExpr;
+ if( pOrderBy->nExpr==1 && p->op==TK_COLUMN && p->iTable==base
+ && p->iColumn==-1 ){
+ *pbRev = pOrderBy->a[0].sortOrder;
+ return 1;
+ }
+ return 0;
+}
+
+/*
+** Prepare a crude estimate of the logarithm of the input value.
+** The results need not be exact. This is only used for estimating
+** the total cost of performing operatings with O(logN) or O(NlogN)
+** complexity. Because N is just a guess, it is no great tragedy if
+** logN is a little off.
+*/
+static double estLog(double N){
+ double logN = 1.0;
+ double x = 10.0;
+ while( N>x ){
+ logN += 1.0;
+ x *= 10;
+ }
+ return logN;
+}
+
+/*
+** Find the best index for accessing a particular table. Return a pointer
+** to the index, flags that describe how the index should be used, the
+** number of equality constraints, and the "cost" for this index.
+**
+** The lowest cost index wins. The cost is an estimate of the amount of
+** CPU and disk I/O need to process the request using the selected index.
+** Factors that influence cost include:
+**
+** * The estimated number of rows that will be retrieved. (The
+** fewer the better.)
+**
+** * Whether or not sorting must occur.
+**
+** * Whether or not there must be separate lookups in the
+** index and in the main table.
+**
+*/
+static double bestIndex(
+ Parse *pParse, /* The parsing context */
+ WhereClause *pWC, /* The WHERE clause */
+ struct SrcList_item *pSrc, /* The FROM clause term to search */
+ Bitmask notReady, /* Mask of cursors that are not available */
+ ExprList *pOrderBy, /* The order by clause */
+ Index **ppIndex, /* Make *ppIndex point to the best index */
+ int *pFlags, /* Put flags describing this choice in *pFlags */
+ int *pnEq /* Put the number of == or IN constraints here */
+){
+ WhereTerm *pTerm;
+ Index *bestIdx = 0; /* Index that gives the lowest cost */
+ double lowestCost = 1.0e99; /* The cost of using bestIdx */
+ int bestFlags = 0; /* Flags associated with bestIdx */
+ int bestNEq = 0; /* Best value for nEq */
+ int iCur = pSrc->iCursor; /* The cursor of the table to be accessed */
+ Index *pProbe; /* An index we are evaluating */
+ int rev; /* True to scan in reverse order */
+ int flags; /* Flags associated with pProbe */
+ int nEq; /* Number of == or IN constraints */
+ double cost; /* Cost of using pProbe */
+
+ TRACE(("bestIndex: tbl=%s notReady=%x\n", pSrc->pTab->zName, notReady));
+
+ /* Check for a rowid=EXPR or rowid IN (...) constraints
+ */
+ pTerm = findTerm(pWC, iCur, -1, notReady, WO_EQ|WO_IN, 0);
+ if( pTerm ){
+ Expr *pExpr;
+ *ppIndex = 0;
+ bestFlags = WHERE_ROWID_EQ;
+ if( pTerm->operator & WO_EQ ){
+ /* Rowid== is always the best pick. Look no further. Because only
+ ** a single row is generated, output is always in sorted order */
+ *pFlags = WHERE_ROWID_EQ | WHERE_UNIQUE;
+ *pnEq = 1;
+ TRACE(("... best is rowid\n"));
+ return 0.0;
+ }else if( (pExpr = pTerm->pExpr)->pList!=0 ){
+ /* Rowid IN (LIST): cost is NlogN where N is the number of list
+ ** elements. */
+ lowestCost = pExpr->pList->nExpr;
+ lowestCost *= estLog(lowestCost);
+ }else{
+ /* Rowid IN (SELECT): cost is NlogN where N is the number of rows
+ ** in the result of the inner select. We have no way to estimate
+ ** that value so make a wild guess. */
+ lowestCost = 200.0;
+ }
+ TRACE(("... rowid IN cost: %.9g\n", lowestCost));
+ }
+
+ /* Estimate the cost of a table scan. If we do not know how many
+ ** entries are in the table, use 1 million as a guess.
+ */
+ pProbe = pSrc->pTab->pIndex;
+ cost = pProbe ? pProbe->aiRowEst[0] : 1000000.0;
+ TRACE(("... table scan base cost: %.9g\n", cost));
+ flags = WHERE_ROWID_RANGE;
+
+ /* Check for constraints on a range of rowids in a table scan.
+ */
+ pTerm = findTerm(pWC, iCur, -1, notReady, WO_LT|WO_LE|WO_GT|WO_GE, 0);
+ if( pTerm ){
+ if( findTerm(pWC, iCur, -1, notReady, WO_LT|WO_LE, 0) ){
+ flags |= WHERE_TOP_LIMIT;
+ cost *= 0.333; /* Guess that rowid<EXPR eliminates two-thirds or rows */
+ }
+ if( findTerm(pWC, iCur, -1, notReady, WO_GT|WO_GE, 0) ){
+ flags |= WHERE_BTM_LIMIT;
+ cost *= 0.333; /* Guess that rowid>EXPR eliminates two-thirds of rows */
+ }
+ TRACE(("... rowid range reduces cost to %.9g\n", cost));
+ }else{
+ flags = 0;
+ }
+
+ /* If the table scan does not satisfy the ORDER BY clause, increase
+ ** the cost by NlogN to cover the expense of sorting. */
+ if( pOrderBy ){
+ if( sortableByRowid(iCur, pOrderBy, &rev) ){
+ flags |= WHERE_ORDERBY|WHERE_ROWID_RANGE;
+ if( rev ){
+ flags |= WHERE_REVERSE;
+ }
+ }else{
+ cost += cost*estLog(cost);
+ TRACE(("... sorting increases cost to %.9g\n", cost));
+ }
+ }
+ if( cost<lowestCost ){
+ lowestCost = cost;
+ bestFlags = flags;
+ }
+
+ /* Look at each index.
+ */
+ for(; pProbe; pProbe=pProbe->pNext){
+ int i; /* Loop counter */
+ double inMultiplier = 1.0;
+
+ TRACE(("... index %s:\n", pProbe->zName));
+
+ /* Count the number of columns in the index that are satisfied
+ ** by x=EXPR constraints or x IN (...) constraints.
+ */
+ flags = 0;
+ for(i=0; i<pProbe->nColumn; i++){
+ int j = pProbe->aiColumn[i];
+ pTerm = findTerm(pWC, iCur, j, notReady, WO_EQ|WO_IN, pProbe);
+ if( pTerm==0 ) break;
+ flags |= WHERE_COLUMN_EQ;
+ if( pTerm->operator & WO_IN ){
+ Expr *pExpr = pTerm->pExpr;
+ flags |= WHERE_COLUMN_IN;
+ if( pExpr->pSelect!=0 ){
+ inMultiplier *= 100.0;
+ }else if( pExpr->pList!=0 ){
+ inMultiplier *= pExpr->pList->nExpr + 1.0;
+ }
+ }
+ }
+ cost = pProbe->aiRowEst[i] * inMultiplier * estLog(inMultiplier);
+ nEq = i;
+ if( pProbe->onError!=OE_None && (flags & WHERE_COLUMN_IN)==0
+ && nEq==pProbe->nColumn ){
+ flags |= WHERE_UNIQUE;
+ }
+ TRACE(("...... nEq=%d inMult=%.9g cost=%.9g\n", nEq, inMultiplier, cost));
+
+ /* Look for range constraints
+ */
+ if( nEq<pProbe->nColumn ){
+ int j = pProbe->aiColumn[nEq];
+ pTerm = findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE|WO_GT|WO_GE, pProbe);
+ if( pTerm ){
+ flags |= WHERE_COLUMN_RANGE;
+ if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pProbe) ){
+ flags |= WHERE_TOP_LIMIT;
+ cost *= 0.333;
+ }
+ if( findTerm(pWC, iCur, j, notReady, WO_GT|WO_GE, pProbe) ){
+ flags |= WHERE_BTM_LIMIT;
+ cost *= 0.333;
+ }
+ TRACE(("...... range reduces cost to %.9g\n", cost));
+ }
+ }
+
+ /* Add the additional cost of sorting if that is a factor.
+ */
+ if( pOrderBy ){
+ if( (flags & WHERE_COLUMN_IN)==0 &&
+ isSortingIndex(pParse,pProbe,pSrc->pTab,iCur,pOrderBy,nEq,&rev) ){
+ if( flags==0 ){
+ flags = WHERE_COLUMN_RANGE;
+ }
+ flags |= WHERE_ORDERBY;
+ if( rev ){
+ flags |= WHERE_REVERSE;
+ }
+ }else{
+ cost += cost*estLog(cost);
+ TRACE(("...... orderby increases cost to %.9g\n", cost));
+ }
+ }
+
+ /* Check to see if we can get away with using just the index without
+ ** ever reading the table. If that is the case, then halve the
+ ** cost of this index.
+ */
+ if( flags && pSrc->colUsed < (((Bitmask)1)<<(BMS-1)) ){
+ Bitmask m = pSrc->colUsed;
+ int j;
+ for(j=0; j<pProbe->nColumn; j++){
+ int x = pProbe->aiColumn[j];
+ if( x<BMS-1 ){
+ m &= ~(((Bitmask)1)<<x);
+ }
+ }
+ if( m==0 ){
+ flags |= WHERE_IDX_ONLY;
+ cost *= 0.5;
+ TRACE(("...... idx-only reduces cost to %.9g\n", cost));
+ }
+ }
+
+ /* If this index has achieved the lowest cost so far, then use it.
+ */
+ if( cost < lowestCost ){
+ bestIdx = pProbe;
+ lowestCost = cost;
+ assert( flags!=0 );
+ bestFlags = flags;
+ bestNEq = nEq;
+ }
+ }
+
+ /* Report the best result
+ */
+ *ppIndex = bestIdx;
+ TRACE(("best index is %s, cost=%.9g, flags=%x, nEq=%d\n",
+ bestIdx ? bestIdx->zName : "(none)", lowestCost, bestFlags, bestNEq));
+ *pFlags = bestFlags;
+ *pnEq = bestNEq;
+ return lowestCost;
+}
+
+
+/*
+** Disable a term in the WHERE clause. Except, do not disable the term
+** if it controls a LEFT OUTER JOIN and it did not originate in the ON
+** or USING clause of that join.
+**
+** Consider the term t2.z='ok' in the following queries:
+**
+** (1) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok'
+** (2) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok'
+** (3) SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok'
+**
+** The t2.z='ok' is disabled in the in (2) because it originates
+** in the ON clause. The term is disabled in (3) because it is not part
+** of a LEFT OUTER JOIN. In (1), the term is not disabled.
+**
+** Disabling a term causes that term to not be tested in the inner loop
+** of the join. Disabling is an optimization. When terms are satisfied
+** by indices, we disable them to prevent redundant tests in the inner
+** loop. We would get the correct results if nothing were ever disabled,
+** but joins might run a little slower. The trick is to disable as much
+** as we can without disabling too much. If we disabled in (1), we'd get
+** the wrong answer. See ticket #813.
+*/
+static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){
+ if( pTerm
+ && (pTerm->flags & TERM_CODED)==0
+ && (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin))
+ ){
+ pTerm->flags |= TERM_CODED;
+ if( pTerm->iParent>=0 ){
+ WhereTerm *pOther = &pTerm->pWC->a[pTerm->iParent];
+ if( (--pOther->nChild)==0 ){
+ disableTerm(pLevel, pOther);
+ }
+ }
+ }
+}
+
+/*
+** Generate code that builds a probe for an index. Details:
+**
+** * Check the top nColumn entries on the stack. If any
+** of those entries are NULL, jump immediately to brk,
+** which is the loop exit, since no index entry will match
+** if any part of the key is NULL.
+**
+** * Construct a probe entry from the top nColumn entries in
+** the stack with affinities appropriate for index pIdx.
+*/
+static void buildIndexProbe(Vdbe *v, int nColumn, int brk, Index *pIdx){
+ sqlite3VdbeAddOp(v, OP_NotNull, -nColumn, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_Pop, nColumn, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, brk);
+ sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
+ sqlite3IndexAffinityStr(v, pIdx);
+}
+
+
+/*
+** Generate code for a single equality term of the WHERE clause. An equality
+** term can be either X=expr or X IN (...). pTerm is the term to be
+** coded.
+**
+** The current value for the constraint is left on the top of the stack.
+**
+** For a constraint of the form X=expr, the expression is evaluated and its
+** result is left on the stack. For constraints of the form X IN (...)
+** this routine sets up a loop that will iterate over all values of X.
+*/
+static void codeEqualityTerm(
+ Parse *pParse, /* The parsing context */
+ WhereTerm *pTerm, /* The term of the WHERE clause to be coded */
+ int brk, /* Jump here to abandon the loop */
+ WhereLevel *pLevel /* When level of the FROM clause we are working on */
+){
+ Expr *pX = pTerm->pExpr;
+ if( pX->op!=TK_IN ){
+ assert( pX->op==TK_EQ );
+ sqlite3ExprCode(pParse, pX->pRight);
+#ifndef SQLITE_OMIT_SUBQUERY
+ }else{
+ int iTab;
+ int *aIn;
+ Vdbe *v = pParse->pVdbe;
+
+ sqlite3CodeSubselect(pParse, pX);
+ iTab = pX->iTable;
+ sqlite3VdbeAddOp(v, OP_Rewind, iTab, brk);
+ VdbeComment((v, "# %.*s", pX->span.n, pX->span.z));
+ pLevel->nIn++;
+ sqlite3ReallocOrFree((void**)&pLevel->aInLoop,
+ sizeof(pLevel->aInLoop[0])*3*pLevel->nIn);
+ aIn = pLevel->aInLoop;
+ if( aIn ){
+ aIn += pLevel->nIn*3 - 3;
+ aIn[0] = OP_Next;
+ aIn[1] = iTab;
+ aIn[2] = sqlite3VdbeAddOp(v, OP_Column, iTab, 0);
+ }else{
+ pLevel->nIn = 0;
+ }
+#endif
+ }
+ disableTerm(pLevel, pTerm);
+}
+
+/*
+** Generate code that will evaluate all == and IN constraints for an
+** index. The values for all constraints are left on the stack.
+**
+** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c).
+** Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10
+** The index has as many as three equality constraints, but in this
+** example, the third "c" value is an inequality. So only two
+** constraints are coded. This routine will generate code to evaluate
+** a==5 and b IN (1,2,3). The current values for a and b will be left
+** on the stack - a is the deepest and b the shallowest.
+**
+** In the example above nEq==2. But this subroutine works for any value
+** of nEq including 0. If nEq==0, this routine is nearly a no-op.
+** The only thing it does is allocate the pLevel->iMem memory cell.
+**
+** This routine always allocates at least one memory cell and puts
+** the address of that memory cell in pLevel->iMem. The code that
+** calls this routine will use pLevel->iMem to store the termination
+** key value of the loop. If one or more IN operators appear, then
+** this routine allocates an additional nEq memory cells for internal
+** use.
+*/
+static void codeAllEqualityTerms(
+ Parse *pParse, /* Parsing context */
+ WhereLevel *pLevel, /* Which nested loop of the FROM we are coding */
+ WhereClause *pWC, /* The WHERE clause */
+ Bitmask notReady, /* Which parts of FROM have not yet been coded */
+ int brk /* Jump here to end the loop */
+){
+ int nEq = pLevel->nEq; /* The number of == or IN constraints to code */
+ int termsInMem = 0; /* If true, store value in mem[] cells */
+ Vdbe *v = pParse->pVdbe; /* The virtual machine under construction */
+ Index *pIdx = pLevel->pIdx; /* The index being used for this loop */
+ int iCur = pLevel->iTabCur; /* The cursor of the table */
+ WhereTerm *pTerm; /* A single constraint term */
+ int j; /* Loop counter */
+
+ /* Figure out how many memory cells we will need then allocate them.
+ ** We always need at least one used to store the loop terminator
+ ** value. If there are IN operators we'll need one for each == or
+ ** IN constraint.
+ */
+ pLevel->iMem = pParse->nMem++;
+ if( pLevel->flags & WHERE_COLUMN_IN ){
+ pParse->nMem += pLevel->nEq;
+ termsInMem = 1;
+ }
+
+ /* Evaluate the equality constraints
+ */
+ for(j=0; j<pIdx->nColumn; j++){
+ int k = pIdx->aiColumn[j];
+ pTerm = findTerm(pWC, iCur, k, notReady, WO_EQ|WO_IN, pIdx);
+ if( pTerm==0 ) break;
+ assert( (pTerm->flags & TERM_CODED)==0 );
+ codeEqualityTerm(pParse, pTerm, brk, pLevel);
+ if( termsInMem ){
+ sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem+j+1, 1);
+ }
+ }
+ assert( j==nEq );
+
+ /* Make sure all the constraint values are on the top of the stack
+ */
+ if( termsInMem ){
+ for(j=0; j<nEq; j++){
+ sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem+j+1, 0);
+ }
+ }
+}
+
+#if defined(SQLITE_TEST)
+/*
+** The following variable holds a text description of query plan generated
+** by the most recent call to sqlite3WhereBegin(). Each call to WhereBegin
+** overwrites the previous. This information is used for testing and
+** analysis only.
+*/
+char sqlite3_query_plan[BMS*2*40]; /* Text of the join */
+static int nQPlan = 0; /* Next free slow in _query_plan[] */
+
+#endif /* SQLITE_TEST */
+
+
+
+/*
+** Generate the beginning of the loop used for WHERE clause processing.
+** The return value is a pointer to an opaque structure that contains
+** information needed to terminate the loop. Later, the calling routine
+** should invoke sqlite3WhereEnd() with the return value of this function
+** in order to complete the WHERE clause processing.
+**
+** If an error occurs, this routine returns NULL.
+**
+** The basic idea is to do a nested loop, one loop for each table in
+** the FROM clause of a select. (INSERT and UPDATE statements are the
+** same as a SELECT with only a single table in the FROM clause.) For
+** example, if the SQL is this:
+**
+** SELECT * FROM t1, t2, t3 WHERE ...;
+**
+** Then the code generated is conceptually like the following:
+**
+** foreach row1 in t1 do \ Code generated
+** foreach row2 in t2 do |-- by sqlite3WhereBegin()
+** foreach row3 in t3 do /
+** ...
+** end \ Code generated
+** end |-- by sqlite3WhereEnd()
+** end /
+**
+** Note that the loops might not be nested in the order in which they
+** appear in the FROM clause if a different order is better able to make
+** use of indices. Note also that when the IN operator appears in
+** the WHERE clause, it might result in additional nested loops for
+** scanning through all values on the right-hand side of the IN.
+**
+** There are Btree cursors associated with each table. t1 uses cursor
+** number pTabList->a[0].iCursor. t2 uses the cursor pTabList->a[1].iCursor.
+** And so forth. This routine generates code to open those VDBE cursors
+** and sqlite3WhereEnd() generates the code to close them.
+**
+** The code that sqlite3WhereBegin() generates leaves the cursors named
+** in pTabList pointing at their appropriate entries. The [...] code
+** can use OP_Column and OP_Rowid opcodes on these cursors to extract
+** data from the various tables of the loop.
+**
+** If the WHERE clause is empty, the foreach loops must each scan their
+** entire tables. Thus a three-way join is an O(N^3) operation. But if
+** the tables have indices and there are terms in the WHERE clause that
+** refer to those indices, a complete table scan can be avoided and the
+** code will run much faster. Most of the work of this routine is checking
+** to see if there are indices that can be used to speed up the loop.
+**
+** Terms of the WHERE clause are also used to limit which rows actually
+** make it to the "..." in the middle of the loop. After each "foreach",
+** terms of the WHERE clause that use only terms in that loop and outer
+** loops are evaluated and if false a jump is made around all subsequent
+** inner loops (or around the "..." if the test occurs within the inner-
+** most loop)
+**
+** OUTER JOINS
+**
+** An outer join of tables t1 and t2 is conceptally coded as follows:
+**
+** foreach row1 in t1 do
+** flag = 0
+** foreach row2 in t2 do
+** start:
+** ...
+** flag = 1
+** end
+** if flag==0 then
+** move the row2 cursor to a null row
+** goto start
+** fi
+** end
+**
+** ORDER BY CLAUSE PROCESSING
+**
+** *ppOrderBy is a pointer to the ORDER BY clause of a SELECT statement,
+** if there is one. If there is no ORDER BY clause or if this routine
+** is called from an UPDATE or DELETE statement, then ppOrderBy is NULL.
+**
+** If an index can be used so that the natural output order of the table
+** scan is correct for the ORDER BY clause, then that index is used and
+** *ppOrderBy is set to NULL. This is an optimization that prevents an
+** unnecessary sort of the result set if an index appropriate for the
+** ORDER BY clause already exists.
+**
+** If the where clause loops cannot be arranged to provide the correct
+** output order, then the *ppOrderBy is unchanged.
+*/
+WhereInfo *sqlite3WhereBegin(
+ Parse *pParse, /* The parser context */
+ SrcList *pTabList, /* A list of all tables to be scanned */
+ Expr *pWhere, /* The WHERE clause */
+ ExprList **ppOrderBy /* An ORDER BY clause, or NULL */
+){
+ int i; /* Loop counter */
+ WhereInfo *pWInfo; /* Will become the return value of this function */
+ Vdbe *v = pParse->pVdbe; /* The virtual database engine */
+ int brk, cont = 0; /* Addresses used during code generation */
+ Bitmask notReady; /* Cursors that are not yet positioned */
+ WhereTerm *pTerm; /* A single term in the WHERE clause */
+ ExprMaskSet maskSet; /* The expression mask set */
+ WhereClause wc; /* The WHERE clause is divided into these terms */
+ struct SrcList_item *pTabItem; /* A single entry from pTabList */
+ WhereLevel *pLevel; /* A single level in the pWInfo list */
+ int iFrom; /* First unused FROM clause element */
+ int andFlags; /* AND-ed combination of all wc.a[].flags */
+
+ /* The number of tables in the FROM clause is limited by the number of
+ ** bits in a Bitmask
+ */
+ if( pTabList->nSrc>BMS ){
+ sqlite3ErrorMsg(pParse, "at most %d tables in a join", BMS);
+ return 0;
+ }
+
+ /* Split the WHERE clause into separate subexpressions where each
+ ** subexpression is separated by an AND operator.
+ */
+ initMaskSet(&maskSet);
+ whereClauseInit(&wc, pParse);
+ whereSplit(&wc, pWhere, TK_AND);
+
+ /* Allocate and initialize the WhereInfo structure that will become the
+ ** return value.
+ */
+ pWInfo = sqliteMalloc( sizeof(WhereInfo) + pTabList->nSrc*sizeof(WhereLevel));
+ if( sqlite3_malloc_failed ){
+ goto whereBeginNoMem;
+ }
+ pWInfo->pParse = pParse;
+ pWInfo->pTabList = pTabList;
+ pWInfo->iBreak = sqlite3VdbeMakeLabel(v);
+
+ /* Special case: a WHERE clause that is constant. Evaluate the
+ ** expression and either jump over all of the code or fall thru.
+ */
+ if( pWhere && (pTabList->nSrc==0 || sqlite3ExprIsConstant(pWhere)) ){
+ sqlite3ExprIfFalse(pParse, pWhere, pWInfo->iBreak, 1);
+ pWhere = 0;
+ }
+
+ /* Analyze all of the subexpressions. Note that exprAnalyze() might
+ ** add new virtual terms onto the end of the WHERE clause. We do not
+ ** want to analyze these virtual terms, so start analyzing at the end
+ ** and work forward so that the added virtual terms are never processed.
+ */
+ for(i=0; i<pTabList->nSrc; i++){
+ createMask(&maskSet, pTabList->a[i].iCursor);
+ }
+ exprAnalyzeAll(pTabList, &maskSet, &wc);
+ if( sqlite3_malloc_failed ){
+ goto whereBeginNoMem;
+ }
+
+ /* Chose the best index to use for each table in the FROM clause.
+ **
+ ** This loop fills in the following fields:
+ **
+ ** pWInfo->a[].pIdx The index to use for this level of the loop.
+ ** pWInfo->a[].flags WHERE_xxx flags associated with pIdx
+ ** pWInfo->a[].nEq The number of == and IN constraints
+ ** pWInfo->a[].iFrom When term of the FROM clause is being coded
+ ** pWInfo->a[].iTabCur The VDBE cursor for the database table
+ ** pWInfo->a[].iIdxCur The VDBE cursor for the index
+ **
+ ** This loop also figures out the nesting order of tables in the FROM
+ ** clause.
+ */
+ notReady = ~(Bitmask)0;
+ pTabItem = pTabList->a;
+ pLevel = pWInfo->a;
+ andFlags = ~0;
+ TRACE(("*** Optimizer Start ***\n"));
+ for(i=iFrom=0, pLevel=pWInfo->a; i<pTabList->nSrc; i++, pLevel++){
+ Index *pIdx; /* Index for FROM table at pTabItem */
+ int flags; /* Flags asssociated with pIdx */
+ int nEq; /* Number of == or IN constraints */
+ double cost; /* The cost for pIdx */
+ int j; /* For looping over FROM tables */
+ Index *pBest = 0; /* The best index seen so far */
+ int bestFlags = 0; /* Flags associated with pBest */
+ int bestNEq = 0; /* nEq associated with pBest */
+ double lowestCost = 1.0e99; /* Cost of the pBest */
+ int bestJ; /* The value of j */
+ Bitmask m; /* Bitmask value for j or bestJ */
+
+ for(j=iFrom, pTabItem=&pTabList->a[j]; j<pTabList->nSrc; j++, pTabItem++){
+ m = getMask(&maskSet, pTabItem->iCursor);
+ if( (m & notReady)==0 ){
+ if( j==iFrom ) iFrom++;
+ continue;
+ }
+ cost = bestIndex(pParse, &wc, pTabItem, notReady,
+ (i==0 && ppOrderBy) ? *ppOrderBy : 0,
+ &pIdx, &flags, &nEq);
+ if( cost<lowestCost ){
+ lowestCost = cost;
+ pBest = pIdx;
+ bestFlags = flags;
+ bestNEq = nEq;
+ bestJ = j;
+ }
+ if( (pTabItem->jointype & (JT_LEFT|JT_CROSS))!=0
+ || (j>0 && (pTabItem[-1].jointype & (JT_LEFT|JT_CROSS))!=0)
+ ){
+ break;
+ }
+ }
+ TRACE(("*** Optimizer choose table %d for loop %d\n", bestJ,
+ pLevel-pWInfo->a));
+ if( (bestFlags & WHERE_ORDERBY)!=0 ){
+ *ppOrderBy = 0;
+ }
+ andFlags &= bestFlags;
+ pLevel->flags = bestFlags;
+ pLevel->pIdx = pBest;
+ pLevel->nEq = bestNEq;
+ pLevel->aInLoop = 0;
+ pLevel->nIn = 0;
+ if( pBest ){
+ pLevel->iIdxCur = pParse->nTab++;
+ }else{
+ pLevel->iIdxCur = -1;
+ }
+ notReady &= ~getMask(&maskSet, pTabList->a[bestJ].iCursor);
+ pLevel->iFrom = bestJ;
+ }
+ TRACE(("*** Optimizer Finished ***\n"));
+
+ /* If the total query only selects a single row, then the ORDER BY
+ ** clause is irrelevant.
+ */
+ if( (andFlags & WHERE_UNIQUE)!=0 && ppOrderBy ){
+ *ppOrderBy = 0;
+ }
+
+ /* Open all tables in the pTabList and any indices selected for
+ ** searching those tables.
+ */
+ sqlite3CodeVerifySchema(pParse, -1); /* Insert the cookie verifier Goto */
+ pLevel = pWInfo->a;
+ for(i=0, pLevel=pWInfo->a; i<pTabList->nSrc; i++, pLevel++){
+ Table *pTab;
+ Index *pIx;
+ int iIdxCur = pLevel->iIdxCur;
+
+#ifndef SQLITE_OMIT_EXPLAIN
+ if( pParse->explain==2 ){
+ char *zMsg;
+ struct SrcList_item *pItem = &pTabList->a[pLevel->iFrom];
+ zMsg = sqlite3MPrintf("TABLE %s", pItem->zName);
+ if( pItem->zAlias ){
+ zMsg = sqlite3MPrintf("%z AS %s", zMsg, pItem->zAlias);
+ }
+ if( (pIx = pLevel->pIdx)!=0 ){
+ zMsg = sqlite3MPrintf("%z WITH INDEX %s", zMsg, pIx->zName);
+ }
+ sqlite3VdbeOp3(v, OP_Explain, i, pLevel->iFrom, zMsg, P3_DYNAMIC);
+ }
+#endif /* SQLITE_OMIT_EXPLAIN */
+ pTabItem = &pTabList->a[pLevel->iFrom];
+ pTab = pTabItem->pTab;
+ if( pTab->isTransient || pTab->pSelect ) continue;
+ if( (pLevel->flags & WHERE_IDX_ONLY)==0 ){
+ sqlite3OpenTableForReading(v, pTabItem->iCursor, pTab);
+ }
+ pLevel->iTabCur = pTabItem->iCursor;
+ if( (pIx = pLevel->pIdx)!=0 ){
+ sqlite3VdbeAddOp(v, OP_Integer, pIx->iDb, 0);
+ VdbeComment((v, "# %s", pIx->zName));
+ sqlite3VdbeOp3(v, OP_OpenRead, iIdxCur, pIx->tnum,
+ (char*)&pIx->keyInfo, P3_KEYINFO);
+ }
+ if( (pLevel->flags & WHERE_IDX_ONLY)!=0 ){
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, iIdxCur, pIx->nColumn+1);
+ }
+ sqlite3CodeVerifySchema(pParse, pTab->iDb);
+ }
+ pWInfo->iTop = sqlite3VdbeCurrentAddr(v);
+
+ /* Generate the code to do the search. Each iteration of the for
+ ** loop below generates code for a single nested loop of the VM
+ ** program.
+ */
+ notReady = ~(Bitmask)0;
+ for(i=0, pLevel=pWInfo->a; i<pTabList->nSrc; i++, pLevel++){
+ int j;
+ int iCur = pTabItem->iCursor; /* The VDBE cursor for the table */
+ Index *pIdx; /* The index we will be using */
+ int iIdxCur; /* The VDBE cursor for the index */
+ int omitTable; /* True if we use the index only */
+ int bRev; /* True if we need to scan in reverse order */
+
+ pTabItem = &pTabList->a[pLevel->iFrom];
+ iCur = pTabItem->iCursor;
+ pIdx = pLevel->pIdx;
+ iIdxCur = pLevel->iIdxCur;
+ bRev = (pLevel->flags & WHERE_REVERSE)!=0;
+ omitTable = (pLevel->flags & WHERE_IDX_ONLY)!=0;
+
+ /* Create labels for the "break" and "continue" instructions
+ ** for the current loop. Jump to brk to break out of a loop.
+ ** Jump to cont to go immediately to the next iteration of the
+ ** loop.
+ */
+ brk = pLevel->brk = sqlite3VdbeMakeLabel(v);
+ cont = pLevel->cont = sqlite3VdbeMakeLabel(v);
+
+ /* If this is the right table of a LEFT OUTER JOIN, allocate and
+ ** initialize a memory cell that records if this table matches any
+ ** row of the left table of the join.
+ */
+ if( pLevel->iFrom>0 && (pTabItem[-1].jointype & JT_LEFT)!=0 ){
+ if( !pParse->nMem ) pParse->nMem++;
+ pLevel->iLeftJoin = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, pLevel->iLeftJoin);
+ VdbeComment((v, "# init LEFT JOIN no-match flag"));
+ }
+
+ if( pLevel->flags & WHERE_ROWID_EQ ){
+ /* Case 1: We can directly reference a single row using an
+ ** equality comparison against the ROWID field. Or
+ ** we reference multiple rows using a "rowid IN (...)"
+ ** construct.
+ */
+ pTerm = findTerm(&wc, iCur, -1, notReady, WO_EQ|WO_IN, 0);
+ assert( pTerm!=0 );
+ assert( pTerm->pExpr!=0 );
+ assert( pTerm->leftCursor==iCur );
+ assert( omitTable==0 );
+ codeEqualityTerm(pParse, pTerm, brk, pLevel);
+ sqlite3VdbeAddOp(v, OP_MustBeInt, 1, brk);
+ sqlite3VdbeAddOp(v, OP_NotExists, iCur, brk);
+ VdbeComment((v, "pk"));
+ pLevel->op = OP_Noop;
+ }else if( pLevel->flags & WHERE_ROWID_RANGE ){
+ /* Case 2: We have an inequality comparison against the ROWID field.
+ */
+ int testOp = OP_Noop;
+ int start;
+ WhereTerm *pStart, *pEnd;
+
+ assert( omitTable==0 );
+ pStart = findTerm(&wc, iCur, -1, notReady, WO_GT|WO_GE, 0);
+ pEnd = findTerm(&wc, iCur, -1, notReady, WO_LT|WO_LE, 0);
+ if( bRev ){
+ pTerm = pStart;
+ pStart = pEnd;
+ pEnd = pTerm;
+ }
+ if( pStart ){
+ Expr *pX;
+ pX = pStart->pExpr;
+ assert( pX!=0 );
+ assert( pStart->leftCursor==iCur );
+ sqlite3ExprCode(pParse, pX->pRight);
+ sqlite3VdbeAddOp(v, OP_ForceInt, pX->op==TK_LE || pX->op==TK_GT, brk);
+ sqlite3VdbeAddOp(v, bRev ? OP_MoveLt : OP_MoveGe, iCur, brk);
+ VdbeComment((v, "pk"));
+ disableTerm(pLevel, pStart);
+ }else{
+ sqlite3VdbeAddOp(v, bRev ? OP_Last : OP_Rewind, iCur, brk);
+ }
+ if( pEnd ){
+ Expr *pX;
+ pX = pEnd->pExpr;
+ assert( pX!=0 );
+ assert( pEnd->leftCursor==iCur );
+ sqlite3ExprCode(pParse, pX->pRight);
+ pLevel->iMem = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 1);
+ if( pX->op==TK_LT || pX->op==TK_GT ){
+ testOp = bRev ? OP_Le : OP_Ge;
+ }else{
+ testOp = bRev ? OP_Lt : OP_Gt;
+ }
+ disableTerm(pLevel, pEnd);
+ }
+ start = sqlite3VdbeCurrentAddr(v);
+ pLevel->op = bRev ? OP_Prev : OP_Next;
+ pLevel->p1 = iCur;
+ pLevel->p2 = start;
+ if( testOp!=OP_Noop ){
+ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0);
+ sqlite3VdbeAddOp(v, testOp, 'n', brk);
+ }
+ }else if( pLevel->flags & WHERE_COLUMN_RANGE ){
+ /* Case 3: The WHERE clause term that refers to the right-most
+ ** column of the index is an inequality. For example, if
+ ** the index is on (x,y,z) and the WHERE clause is of the
+ ** form "x=5 AND y<10" then this case is used. Only the
+ ** right-most column can be an inequality - the rest must
+ ** use the "==" and "IN" operators.
+ **
+ ** This case is also used when there are no WHERE clause
+ ** constraints but an index is selected anyway, in order
+ ** to force the output order to conform to an ORDER BY.
+ */
+ int start;
+ int nEq = pLevel->nEq;
+ int leFlag=0, geFlag=0;
+ int testOp;
+ int topLimit = (pLevel->flags & WHERE_TOP_LIMIT)!=0;
+ int btmLimit = (pLevel->flags & WHERE_BTM_LIMIT)!=0;
+
+ /* Generate code to evaluate all constraint terms using == or IN
+ ** and level the values of those terms on the stack.
+ */
+ codeAllEqualityTerms(pParse, pLevel, &wc, notReady, brk);
+
+ /* Duplicate the equality term values because they will all be
+ ** used twice: once to make the termination key and once to make the
+ ** start key.
+ */
+ for(j=0; j<nEq; j++){
+ sqlite3VdbeAddOp(v, OP_Dup, nEq-1, 0);
+ }
+
+ /* Generate the termination key. This is the key value that
+ ** will end the search. There is no termination key if there
+ ** are no equality terms and no "X<..." term.
+ **
+ ** 2002-Dec-04: On a reverse-order scan, the so-called "termination"
+ ** key computed here really ends up being the start key.
+ */
+ if( topLimit ){
+ Expr *pX;
+ int k = pIdx->aiColumn[j];
+ pTerm = findTerm(&wc, iCur, k, notReady, WO_LT|WO_LE, pIdx);
+ assert( pTerm!=0 );
+ pX = pTerm->pExpr;
+ assert( (pTerm->flags & TERM_CODED)==0 );
+ sqlite3ExprCode(pParse, pX->pRight);
+ leFlag = pX->op==TK_LE;
+ disableTerm(pLevel, pTerm);
+ testOp = OP_IdxGE;
+ }else{
+ testOp = nEq>0 ? OP_IdxGE : OP_Noop;
+ leFlag = 1;
+ }
+ if( testOp!=OP_Noop ){
+ int nCol = nEq + topLimit;
+ pLevel->iMem = pParse->nMem++;
+ buildIndexProbe(v, nCol, brk, pIdx);
+ if( bRev ){
+ int op = leFlag ? OP_MoveLe : OP_MoveLt;
+ sqlite3VdbeAddOp(v, op, iIdxCur, brk);
+ }else{
+ sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 1);
+ }
+ }else if( bRev ){
+ sqlite3VdbeAddOp(v, OP_Last, iIdxCur, brk);
+ }
+
+ /* Generate the start key. This is the key that defines the lower
+ ** bound on the search. There is no start key if there are no
+ ** equality terms and if there is no "X>..." term. In
+ ** that case, generate a "Rewind" instruction in place of the
+ ** start key search.
+ **
+ ** 2002-Dec-04: In the case of a reverse-order search, the so-called
+ ** "start" key really ends up being used as the termination key.
+ */
+ if( btmLimit ){
+ Expr *pX;
+ int k = pIdx->aiColumn[j];
+ pTerm = findTerm(&wc, iCur, k, notReady, WO_GT|WO_GE, pIdx);
+ assert( pTerm!=0 );
+ pX = pTerm->pExpr;
+ assert( (pTerm->flags & TERM_CODED)==0 );
+ sqlite3ExprCode(pParse, pX->pRight);
+ geFlag = pX->op==TK_GE;
+ disableTerm(pLevel, pTerm);
+ }else{
+ geFlag = 1;
+ }
+ if( nEq>0 || btmLimit ){
+ int nCol = nEq + btmLimit;
+ buildIndexProbe(v, nCol, brk, pIdx);
+ if( bRev ){
+ pLevel->iMem = pParse->nMem++;
+ sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 1);
+ testOp = OP_IdxLT;
+ }else{
+ int op = geFlag ? OP_MoveGe : OP_MoveGt;
+ sqlite3VdbeAddOp(v, op, iIdxCur, brk);
+ }
+ }else if( bRev ){
+ testOp = OP_Noop;
+ }else{
+ sqlite3VdbeAddOp(v, OP_Rewind, iIdxCur, brk);
+ }
+
+ /* Generate the the top of the loop. If there is a termination
+ ** key we have to test for that key and abort at the top of the
+ ** loop.
+ */
+ start = sqlite3VdbeCurrentAddr(v);
+ if( testOp!=OP_Noop ){
+ sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0);
+ sqlite3VdbeAddOp(v, testOp, iIdxCur, brk);
+ if( (leFlag && !bRev) || (!geFlag && bRev) ){
+ sqlite3VdbeChangeP3(v, -1, "+", P3_STATIC);
+ }
+ }
+ sqlite3VdbeAddOp(v, OP_RowKey, iIdxCur, 0);
+ sqlite3VdbeAddOp(v, OP_IdxIsNull, nEq + topLimit, cont);
+ if( !omitTable ){
+ sqlite3VdbeAddOp(v, OP_IdxRowid, iIdxCur, 0);
+ sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0);
+ }
+
+ /* Record the instruction used to terminate the loop.
+ */
+ pLevel->op = bRev ? OP_Prev : OP_Next;
+ pLevel->p1 = iIdxCur;
+ pLevel->p2 = start;
+ }else if( pLevel->flags & WHERE_COLUMN_EQ ){
+ /* Case 4: There is an index and all terms of the WHERE clause that
+ ** refer to the index using the "==" or "IN" operators.
+ */
+ int start;
+ int nEq = pLevel->nEq;
+
+ /* Generate code to evaluate all constraint terms using == or IN
+ ** and leave the values of those terms on the stack.
+ */
+ codeAllEqualityTerms(pParse, pLevel, &wc, notReady, brk);
+
+ /* Generate a single key that will be used to both start and terminate
+ ** the search
+ */
+ buildIndexProbe(v, nEq, brk, pIdx);
+ sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 0);
+
+ /* Generate code (1) to move to the first matching element of the table.
+ ** Then generate code (2) that jumps to "brk" after the cursor is past
+ ** the last matching element of the table. The code (1) is executed
+ ** once to initialize the search, the code (2) is executed before each
+ ** iteration of the scan to see if the scan has finished. */
+ if( bRev ){
+ /* Scan in reverse order */
+ sqlite3VdbeAddOp(v, OP_MoveLe, iIdxCur, brk);
+ start = sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0);
+ sqlite3VdbeAddOp(v, OP_IdxLT, iIdxCur, brk);
+ pLevel->op = OP_Prev;
+ }else{
+ /* Scan in the forward order */
+ sqlite3VdbeAddOp(v, OP_MoveGe, iIdxCur, brk);
+ start = sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0);
+ sqlite3VdbeOp3(v, OP_IdxGE, iIdxCur, brk, "+", P3_STATIC);
+ pLevel->op = OP_Next;
+ }
+ sqlite3VdbeAddOp(v, OP_RowKey, iIdxCur, 0);
+ sqlite3VdbeAddOp(v, OP_IdxIsNull, nEq, cont);
+ if( !omitTable ){
+ sqlite3VdbeAddOp(v, OP_IdxRowid, iIdxCur, 0);
+ sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0);
+ }
+ pLevel->p1 = iIdxCur;
+ pLevel->p2 = start;
+ }else{
+ /* Case 5: There is no usable index. We must do a complete
+ ** scan of the entire table.
+ */
+ assert( omitTable==0 );
+ assert( bRev==0 );
+ pLevel->op = OP_Next;
+ pLevel->p1 = iCur;
+ pLevel->p2 = 1 + sqlite3VdbeAddOp(v, OP_Rewind, iCur, brk);
+ }
+ notReady &= ~getMask(&maskSet, iCur);
+
+ /* Insert code to test every subexpression that can be completely
+ ** computed using the current set of tables.
+ */
+ for(pTerm=wc.a, j=wc.nTerm; j>0; j--, pTerm++){
+ Expr *pE;
+ if( pTerm->flags & (TERM_VIRTUAL|TERM_CODED) ) continue;
+ if( (pTerm->prereqAll & notReady)!=0 ) continue;
+ pE = pTerm->pExpr;
+ assert( pE!=0 );
+ if( pLevel->iLeftJoin && !ExprHasProperty(pE, EP_FromJoin) ){
+ continue;
+ }
+ sqlite3ExprIfFalse(pParse, pE, cont, 1);
+ pTerm->flags |= TERM_CODED;
+ }
+
+ /* For a LEFT OUTER JOIN, generate code that will record the fact that
+ ** at least one row of the right table has matched the left table.
+ */
+ if( pLevel->iLeftJoin ){
+ pLevel->top = sqlite3VdbeCurrentAddr(v);
+ sqlite3VdbeAddOp(v, OP_MemInt, 1, pLevel->iLeftJoin);
+ VdbeComment((v, "# record LEFT JOIN hit"));
+ for(pTerm=wc.a, j=0; j<wc.nTerm; j++, pTerm++){
+ if( pTerm->flags & (TERM_VIRTUAL|TERM_CODED) ) continue;
+ if( (pTerm->prereqAll & notReady)!=0 ) continue;
+ assert( pTerm->pExpr );
+ sqlite3ExprIfFalse(pParse, pTerm->pExpr, cont, 1);
+ pTerm->flags |= TERM_CODED;
+ }
+ }
+ }
+
+#ifdef SQLITE_TEST /* For testing and debugging use only */
+ /* Record in the query plan information about the current table
+ ** and the index used to access it (if any). If the table itself
+ ** is not used, its name is just '{}'. If no index is used
+ ** the index is listed as "{}". If the primary key is used the
+ ** index name is '*'.
+ */
+ for(i=0; i<pTabList->nSrc; i++){
+ char *z;
+ int n;
+ pLevel = &pWInfo->a[i];
+ pTabItem = &pTabList->a[pLevel->iFrom];
+ z = pTabItem->zAlias;
+ if( z==0 ) z = pTabItem->pTab->zName;
+ n = strlen(z);
+ if( n+nQPlan < sizeof(sqlite3_query_plan)-10 ){
+ if( pLevel->flags & WHERE_IDX_ONLY ){
+ strcpy(&sqlite3_query_plan[nQPlan], "{}");
+ nQPlan += 2;
+ }else{
+ strcpy(&sqlite3_query_plan[nQPlan], z);
+ nQPlan += n;
+ }
+ sqlite3_query_plan[nQPlan++] = ' ';
+ }
+ if( pLevel->flags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
+ strcpy(&sqlite3_query_plan[nQPlan], "* ");
+ nQPlan += 2;
+ }else if( pLevel->pIdx==0 ){
+ strcpy(&sqlite3_query_plan[nQPlan], "{} ");
+ nQPlan += 3;
+ }else{
+ n = strlen(pLevel->pIdx->zName);
+ if( n+nQPlan < sizeof(sqlite3_query_plan)-2 ){
+ strcpy(&sqlite3_query_plan[nQPlan], pLevel->pIdx->zName);
+ nQPlan += n;
+ sqlite3_query_plan[nQPlan++] = ' ';
+ }
+ }
+ }
+ while( nQPlan>0 && sqlite3_query_plan[nQPlan-1]==' ' ){
+ sqlite3_query_plan[--nQPlan] = 0;
+ }
+ sqlite3_query_plan[nQPlan] = 0;
+ nQPlan = 0;
+#endif /* SQLITE_TEST // Testing and debugging use only */
+
+ /* Record the continuation address in the WhereInfo structure. Then
+ ** clean up and return.
+ */
+ pWInfo->iContinue = cont;
+ whereClauseClear(&wc);
+ return pWInfo;
+
+ /* Jump here if malloc fails */
+whereBeginNoMem:
+ whereClauseClear(&wc);
+ sqliteFree(pWInfo);
+ return 0;
+}
+
+/*
+** Generate the end of the WHERE loop. See comments on
+** sqlite3WhereBegin() for additional information.
+*/
+void sqlite3WhereEnd(WhereInfo *pWInfo){
+ Vdbe *v = pWInfo->pParse->pVdbe;
+ int i;
+ WhereLevel *pLevel;
+ SrcList *pTabList = pWInfo->pTabList;
+
+ /* Generate loop termination code.
+ */
+ for(i=pTabList->nSrc-1; i>=0; i--){
+ pLevel = &pWInfo->a[i];
+ sqlite3VdbeResolveLabel(v, pLevel->cont);
+ if( pLevel->op!=OP_Noop ){
+ sqlite3VdbeAddOp(v, pLevel->op, pLevel->p1, pLevel->p2);
+ }
+ sqlite3VdbeResolveLabel(v, pLevel->brk);
+ if( pLevel->nIn ){
+ int *a;
+ int j;
+ for(j=pLevel->nIn, a=&pLevel->aInLoop[j*3-3]; j>0; j--, a-=3){
+ sqlite3VdbeAddOp(v, a[0], a[1], a[2]);
+ }
+ sqliteFree(pLevel->aInLoop);
+ }
+ if( pLevel->iLeftJoin ){
+ int addr;
+ addr = sqlite3VdbeAddOp(v, OP_IfMemPos, pLevel->iLeftJoin, 0);
+ sqlite3VdbeAddOp(v, OP_NullRow, pTabList->a[i].iCursor, 0);
+ if( pLevel->iIdxCur>=0 ){
+ sqlite3VdbeAddOp(v, OP_NullRow, pLevel->iIdxCur, 0);
+ }
+ sqlite3VdbeAddOp(v, OP_Goto, 0, pLevel->top);
+ sqlite3VdbeJumpHere(v, addr);
+ }
+ }
+
+ /* The "break" point is here, just past the end of the outer loop.
+ ** Set it.
+ */
+ sqlite3VdbeResolveLabel(v, pWInfo->iBreak);
+
+ /* Close all of the cursors that were opened by sqlite3WhereBegin.
+ */
+ for(i=0, pLevel=pWInfo->a; i<pTabList->nSrc; i++, pLevel++){
+ struct SrcList_item *pTabItem = &pTabList->a[pLevel->iFrom];
+ Table *pTab = pTabItem->pTab;
+ assert( pTab!=0 );
+ if( pTab->isTransient || pTab->pSelect ) continue;
+ if( (pLevel->flags & WHERE_IDX_ONLY)==0 ){
+ sqlite3VdbeAddOp(v, OP_Close, pTabItem->iCursor, 0);
+ }
+ if( pLevel->pIdx!=0 ){
+ sqlite3VdbeAddOp(v, OP_Close, pLevel->iIdxCur, 0);
+ }
+
+ /* Make cursor substitutions for cases where we want to use
+ ** just the index and never reference the table.
+ **
+ ** Calls to the code generator in between sqlite3WhereBegin and
+ ** sqlite3WhereEnd will have created code that references the table
+ ** directly. This loop scans all that code looking for opcodes
+ ** that reference the table and converts them into opcodes that
+ ** reference the index.
+ */
+ if( pLevel->flags & WHERE_IDX_ONLY ){
+ int i, j, last;
+ VdbeOp *pOp;
+ Index *pIdx = pLevel->pIdx;
+
+ assert( pIdx!=0 );
+ pOp = sqlite3VdbeGetOp(v, pWInfo->iTop);
+ last = sqlite3VdbeCurrentAddr(v);
+ for(i=pWInfo->iTop; i<last; i++, pOp++){
+ if( pOp->p1!=pLevel->iTabCur ) continue;
+ if( pOp->opcode==OP_Column ){
+ pOp->p1 = pLevel->iIdxCur;
+ for(j=0; j<pIdx->nColumn; j++){
+ if( pOp->p2==pIdx->aiColumn[j] ){
+ pOp->p2 = j;
+ break;
+ }
+ }
+ }else if( pOp->opcode==OP_Rowid ){
+ pOp->p1 = pLevel->iIdxCur;
+ pOp->opcode = OP_IdxRowid;
+ }else if( pOp->opcode==OP_NullRow ){
+ pOp->opcode = OP_Noop;
+ }
+ }
+ }
+ }
+
+ /* Final cleanup
+ */
+ sqliteFree(pWInfo);
+ return;
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/diffdb.c b/ext/pdo_sqlite/sqlite/tool/diffdb.c
new file mode 100644
index 000000000..0537d3872
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/diffdb.c
@@ -0,0 +1,44 @@
+/*
+** A utility for printing the differences between two SQLite database files.
+*/
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+
+#define PAGESIZE 1024
+static int db1 = -1;
+static int db2 = -1;
+
+int main(int argc, char **argv){
+ int iPg;
+ unsigned char a1[PAGESIZE], a2[PAGESIZE];
+ if( argc!=3 ){
+ fprintf(stderr,"Usage: %s FILENAME FILENAME\n", argv[0]);
+ exit(1);
+ }
+ db1 = open(argv[1], O_RDONLY);
+ if( db1<0 ){
+ fprintf(stderr,"%s: can't open %s\n", argv[0], argv[1]);
+ exit(1);
+ }
+ db2 = open(argv[2], O_RDONLY);
+ if( db2<0 ){
+ fprintf(stderr,"%s: can't open %s\n", argv[0], argv[2]);
+ exit(1);
+ }
+ iPg = 1;
+ while( read(db1, a1, PAGESIZE)==PAGESIZE && read(db2,a2,PAGESIZE)==PAGESIZE ){
+ if( memcmp(a1,a2,PAGESIZE) ){
+ printf("Page %d\n", iPg);
+ }
+ iPg++;
+ }
+ printf("%d pages checked\n", iPg-1);
+ close(db1);
+ close(db2);
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/lemon.c b/ext/pdo_sqlite/sqlite/tool/lemon.c
new file mode 100644
index 000000000..8f6e87330
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/lemon.c
@@ -0,0 +1,4587 @@
+/*
+** This file contains all sources (including headers) to the LEMON
+** LALR(1) parser generator. The sources have been combined into a
+** single file to make it easy to include LEMON in the source tree
+** and Makefile of another program.
+**
+** The author of this program disclaims copyright.
+*/
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+#ifndef __WIN32__
+# if defined(_WIN32) || defined(WIN32)
+# define __WIN32__
+# endif
+#endif
+
+/* #define PRIVATE static */
+#define PRIVATE
+
+#ifdef TEST
+#define MAXRHS 5 /* Set low to exercise exception code */
+#else
+#define MAXRHS 1000
+#endif
+
+char *msort();
+extern void *malloc();
+
+/******** From the file "action.h" *************************************/
+struct action *Action_new();
+struct action *Action_sort();
+
+/********* From the file "assert.h" ************************************/
+void myassert();
+#ifndef NDEBUG
+# define assert(X) if(!(X))myassert(__FILE__,__LINE__)
+#else
+# define assert(X)
+#endif
+
+/********** From the file "build.h" ************************************/
+void FindRulePrecedences();
+void FindFirstSets();
+void FindStates();
+void FindLinks();
+void FindFollowSets();
+void FindActions();
+
+/********* From the file "configlist.h" *********************************/
+void Configlist_init(/* void */);
+struct config *Configlist_add(/* struct rule *, int */);
+struct config *Configlist_addbasis(/* struct rule *, int */);
+void Configlist_closure(/* void */);
+void Configlist_sort(/* void */);
+void Configlist_sortbasis(/* void */);
+struct config *Configlist_return(/* void */);
+struct config *Configlist_basis(/* void */);
+void Configlist_eat(/* struct config * */);
+void Configlist_reset(/* void */);
+
+/********* From the file "error.h" ***************************************/
+void ErrorMsg(const char *, int,const char *, ...);
+
+/****** From the file "option.h" ******************************************/
+struct s_options {
+ enum { OPT_FLAG=1, OPT_INT, OPT_DBL, OPT_STR,
+ OPT_FFLAG, OPT_FINT, OPT_FDBL, OPT_FSTR} type;
+ char *label;
+ char *arg;
+ char *message;
+};
+int OptInit(/* char**,struct s_options*,FILE* */);
+int OptNArgs(/* void */);
+char *OptArg(/* int */);
+void OptErr(/* int */);
+void OptPrint(/* void */);
+
+/******** From the file "parse.h" *****************************************/
+void Parse(/* struct lemon *lemp */);
+
+/********* From the file "plink.h" ***************************************/
+struct plink *Plink_new(/* void */);
+void Plink_add(/* struct plink **, struct config * */);
+void Plink_copy(/* struct plink **, struct plink * */);
+void Plink_delete(/* struct plink * */);
+
+/********** From the file "report.h" *************************************/
+void Reprint(/* struct lemon * */);
+void ReportOutput(/* struct lemon * */);
+void ReportTable(/* struct lemon * */);
+void ReportHeader(/* struct lemon * */);
+void CompressTables(/* struct lemon * */);
+
+/********** From the file "set.h" ****************************************/
+void SetSize(/* int N */); /* All sets will be of size N */
+char *SetNew(/* void */); /* A new set for element 0..N */
+void SetFree(/* char* */); /* Deallocate a set */
+
+int SetAdd(/* char*,int */); /* Add element to a set */
+int SetUnion(/* char *A,char *B */); /* A <- A U B, thru element N */
+
+#define SetFind(X,Y) (X[Y]) /* True if Y is in set X */
+
+/********** From the file "struct.h" *************************************/
+/*
+** Principal data structures for the LEMON parser generator.
+*/
+
+typedef enum {B_FALSE=0, B_TRUE} Boolean;
+
+/* Symbols (terminals and nonterminals) of the grammar are stored
+** in the following: */
+struct symbol {
+ char *name; /* Name of the symbol */
+ int index; /* Index number for this symbol */
+ enum {
+ TERMINAL,
+ NONTERMINAL
+ } type; /* Symbols are all either TERMINALS or NTs */
+ struct rule *rule; /* Linked list of rules of this (if an NT) */
+ struct symbol *fallback; /* fallback token in case this token doesn't parse */
+ int prec; /* Precedence if defined (-1 otherwise) */
+ enum e_assoc {
+ LEFT,
+ RIGHT,
+ NONE,
+ UNK
+ } assoc; /* Associativity if predecence is defined */
+ char *firstset; /* First-set for all rules of this symbol */
+ Boolean lambda; /* True if NT and can generate an empty string */
+ char *destructor; /* Code which executes whenever this symbol is
+ ** popped from the stack during error processing */
+ int destructorln; /* Line number of destructor code */
+ char *datatype; /* The data type of information held by this
+ ** object. Only used if type==NONTERMINAL */
+ int dtnum; /* The data type number. In the parser, the value
+ ** stack is a union. The .yy%d element of this
+ ** union is the correct data type for this object */
+};
+
+/* Each production rule in the grammar is stored in the following
+** structure. */
+struct rule {
+ struct symbol *lhs; /* Left-hand side of the rule */
+ char *lhsalias; /* Alias for the LHS (NULL if none) */
+ int ruleline; /* Line number for the rule */
+ int nrhs; /* Number of RHS symbols */
+ struct symbol **rhs; /* The RHS symbols */
+ char **rhsalias; /* An alias for each RHS symbol (NULL if none) */
+ int line; /* Line number at which code begins */
+ char *code; /* The code executed when this rule is reduced */
+ struct symbol *precsym; /* Precedence symbol for this rule */
+ int index; /* An index number for this rule */
+ Boolean canReduce; /* True if this rule is ever reduced */
+ struct rule *nextlhs; /* Next rule with the same LHS */
+ struct rule *next; /* Next rule in the global list */
+};
+
+/* A configuration is a production rule of the grammar together with
+** a mark (dot) showing how much of that rule has been processed so far.
+** Configurations also contain a follow-set which is a list of terminal
+** symbols which are allowed to immediately follow the end of the rule.
+** Every configuration is recorded as an instance of the following: */
+struct config {
+ struct rule *rp; /* The rule upon which the configuration is based */
+ int dot; /* The parse point */
+ char *fws; /* Follow-set for this configuration only */
+ struct plink *fplp; /* Follow-set forward propagation links */
+ struct plink *bplp; /* Follow-set backwards propagation links */
+ struct state *stp; /* Pointer to state which contains this */
+ enum {
+ COMPLETE, /* The status is used during followset and */
+ INCOMPLETE /* shift computations */
+ } status;
+ struct config *next; /* Next configuration in the state */
+ struct config *bp; /* The next basis configuration */
+};
+
+/* Every shift or reduce operation is stored as one of the following */
+struct action {
+ struct symbol *sp; /* The look-ahead symbol */
+ enum e_action {
+ SHIFT,
+ ACCEPT,
+ REDUCE,
+ ERROR,
+ CONFLICT, /* Was a reduce, but part of a conflict */
+ SH_RESOLVED, /* Was a shift. Precedence resolved conflict */
+ RD_RESOLVED, /* Was reduce. Precedence resolved conflict */
+ NOT_USED /* Deleted by compression */
+ } type;
+ union {
+ struct state *stp; /* The new state, if a shift */
+ struct rule *rp; /* The rule, if a reduce */
+ } x;
+ struct action *next; /* Next action for this state */
+ struct action *collide; /* Next action with the same hash */
+};
+
+/* Each state of the generated parser's finite state machine
+** is encoded as an instance of the following structure. */
+struct state {
+ struct config *bp; /* The basis configurations for this state */
+ struct config *cfp; /* All configurations in this set */
+ int index; /* Sequencial number for this state */
+ struct action *ap; /* Array of actions for this state */
+ int nTknAct, nNtAct; /* Number of actions on terminals and nonterminals */
+ int iTknOfst, iNtOfst; /* yy_action[] offset for terminals and nonterms */
+ int iDflt; /* Default action */
+};
+#define NO_OFFSET (-2147483647)
+
+/* A followset propagation link indicates that the contents of one
+** configuration followset should be propagated to another whenever
+** the first changes. */
+struct plink {
+ struct config *cfp; /* The configuration to which linked */
+ struct plink *next; /* The next propagate link */
+};
+
+/* The state vector for the entire parser generator is recorded as
+** follows. (LEMON uses no global variables and makes little use of
+** static variables. Fields in the following structure can be thought
+** of as begin global variables in the program.) */
+struct lemon {
+ struct state **sorted; /* Table of states sorted by state number */
+ struct rule *rule; /* List of all rules */
+ int nstate; /* Number of states */
+ int nrule; /* Number of rules */
+ int nsymbol; /* Number of terminal and nonterminal symbols */
+ int nterminal; /* Number of terminal symbols */
+ struct symbol **symbols; /* Sorted array of pointers to symbols */
+ int errorcnt; /* Number of errors */
+ struct symbol *errsym; /* The error symbol */
+ char *name; /* Name of the generated parser */
+ char *arg; /* Declaration of the 3th argument to parser */
+ char *tokentype; /* Type of terminal symbols in the parser stack */
+ char *vartype; /* The default type of non-terminal symbols */
+ char *start; /* Name of the start symbol for the grammar */
+ char *stacksize; /* Size of the parser stack */
+ char *include; /* Code to put at the start of the C file */
+ int includeln; /* Line number for start of include code */
+ char *error; /* Code to execute when an error is seen */
+ int errorln; /* Line number for start of error code */
+ char *overflow; /* Code to execute on a stack overflow */
+ int overflowln; /* Line number for start of overflow code */
+ char *failure; /* Code to execute on parser failure */
+ int failureln; /* Line number for start of failure code */
+ char *accept; /* Code to execute when the parser excepts */
+ int acceptln; /* Line number for the start of accept code */
+ char *extracode; /* Code appended to the generated file */
+ int extracodeln; /* Line number for the start of the extra code */
+ char *tokendest; /* Code to execute to destroy token data */
+ int tokendestln; /* Line number for token destroyer code */
+ char *vardest; /* Code for the default non-terminal destructor */
+ int vardestln; /* Line number for default non-term destructor code*/
+ char *filename; /* Name of the input file */
+ char *outname; /* Name of the current output file */
+ char *tokenprefix; /* A prefix added to token names in the .h file */
+ int nconflict; /* Number of parsing conflicts */
+ int tablesize; /* Size of the parse tables */
+ int basisflag; /* Print only basis configurations */
+ int has_fallback; /* True if any %fallback is seen in the grammer */
+ char *argv0; /* Name of the program */
+};
+
+#define MemoryCheck(X) if((X)==0){ \
+ extern void memory_error(); \
+ memory_error(); \
+}
+
+/**************** From the file "table.h" *********************************/
+/*
+** All code in this file has been automatically generated
+** from a specification in the file
+** "table.q"
+** by the associative array code building program "aagen".
+** Do not edit this file! Instead, edit the specification
+** file, then rerun aagen.
+*/
+/*
+** Code for processing tables in the LEMON parser generator.
+*/
+
+/* Routines for handling a strings */
+
+char *Strsafe();
+
+void Strsafe_init(/* void */);
+int Strsafe_insert(/* char * */);
+char *Strsafe_find(/* char * */);
+
+/* Routines for handling symbols of the grammar */
+
+struct symbol *Symbol_new();
+int Symbolcmpp(/* struct symbol **, struct symbol ** */);
+void Symbol_init(/* void */);
+int Symbol_insert(/* struct symbol *, char * */);
+struct symbol *Symbol_find(/* char * */);
+struct symbol *Symbol_Nth(/* int */);
+int Symbol_count(/* */);
+struct symbol **Symbol_arrayof(/* */);
+
+/* Routines to manage the state table */
+
+int Configcmp(/* struct config *, struct config * */);
+struct state *State_new();
+void State_init(/* void */);
+int State_insert(/* struct state *, struct config * */);
+struct state *State_find(/* struct config * */);
+struct state **State_arrayof(/* */);
+
+/* Routines used for efficiency in Configlist_add */
+
+void Configtable_init(/* void */);
+int Configtable_insert(/* struct config * */);
+struct config *Configtable_find(/* struct config * */);
+void Configtable_clear(/* int(*)(struct config *) */);
+/****************** From the file "action.c" *******************************/
+/*
+** Routines processing parser actions in the LEMON parser generator.
+*/
+
+/* Allocate a new parser action */
+struct action *Action_new(){
+ static struct action *freelist = 0;
+ struct action *new;
+
+ if( freelist==0 ){
+ int i;
+ int amt = 100;
+ freelist = (struct action *)malloc( sizeof(struct action)*amt );
+ if( freelist==0 ){
+ fprintf(stderr,"Unable to allocate memory for a new parser action.");
+ exit(1);
+ }
+ for(i=0; i<amt-1; i++) freelist[i].next = &freelist[i+1];
+ freelist[amt-1].next = 0;
+ }
+ new = freelist;
+ freelist = freelist->next;
+ return new;
+}
+
+/* Compare two actions */
+static int actioncmp(ap1,ap2)
+struct action *ap1;
+struct action *ap2;
+{
+ int rc;
+ rc = ap1->sp->index - ap2->sp->index;
+ if( rc==0 ) rc = (int)ap1->type - (int)ap2->type;
+ if( rc==0 ){
+ assert( ap1->type==REDUCE || ap1->type==RD_RESOLVED || ap1->type==CONFLICT);
+ assert( ap2->type==REDUCE || ap2->type==RD_RESOLVED || ap2->type==CONFLICT);
+ rc = ap1->x.rp->index - ap2->x.rp->index;
+ }
+ return rc;
+}
+
+/* Sort parser actions */
+struct action *Action_sort(ap)
+struct action *ap;
+{
+ ap = (struct action *)msort((char *)ap,(char **)&ap->next,actioncmp);
+ return ap;
+}
+
+void Action_add(app,type,sp,arg)
+struct action **app;
+enum e_action type;
+struct symbol *sp;
+char *arg;
+{
+ struct action *new;
+ new = Action_new();
+ new->next = *app;
+ *app = new;
+ new->type = type;
+ new->sp = sp;
+ if( type==SHIFT ){
+ new->x.stp = (struct state *)arg;
+ }else{
+ new->x.rp = (struct rule *)arg;
+ }
+}
+/********************** New code to implement the "acttab" module ***********/
+/*
+** This module implements routines use to construct the yy_action[] table.
+*/
+
+/*
+** The state of the yy_action table under construction is an instance of
+** the following structure
+*/
+typedef struct acttab acttab;
+struct acttab {
+ int nAction; /* Number of used slots in aAction[] */
+ int nActionAlloc; /* Slots allocated for aAction[] */
+ struct {
+ int lookahead; /* Value of the lookahead token */
+ int action; /* Action to take on the given lookahead */
+ } *aAction, /* The yy_action[] table under construction */
+ *aLookahead; /* A single new transaction set */
+ int mnLookahead; /* Minimum aLookahead[].lookahead */
+ int mnAction; /* Action associated with mnLookahead */
+ int mxLookahead; /* Maximum aLookahead[].lookahead */
+ int nLookahead; /* Used slots in aLookahead[] */
+ int nLookaheadAlloc; /* Slots allocated in aLookahead[] */
+};
+
+/* Return the number of entries in the yy_action table */
+#define acttab_size(X) ((X)->nAction)
+
+/* The value for the N-th entry in yy_action */
+#define acttab_yyaction(X,N) ((X)->aAction[N].action)
+
+/* The value for the N-th entry in yy_lookahead */
+#define acttab_yylookahead(X,N) ((X)->aAction[N].lookahead)
+
+/* Free all memory associated with the given acttab */
+void acttab_free(acttab *p){
+ free( p->aAction );
+ free( p->aLookahead );
+ free( p );
+}
+
+/* Allocate a new acttab structure */
+acttab *acttab_alloc(void){
+ acttab *p = malloc( sizeof(*p) );
+ if( p==0 ){
+ fprintf(stderr,"Unable to allocate memory for a new acttab.");
+ exit(1);
+ }
+ memset(p, 0, sizeof(*p));
+ return p;
+}
+
+/* Add a new action to the current transaction set
+*/
+void acttab_action(acttab *p, int lookahead, int action){
+ if( p->nLookahead>=p->nLookaheadAlloc ){
+ p->nLookaheadAlloc += 25;
+ p->aLookahead = realloc( p->aLookahead,
+ sizeof(p->aLookahead[0])*p->nLookaheadAlloc );
+ if( p->aLookahead==0 ){
+ fprintf(stderr,"malloc failed\n");
+ exit(1);
+ }
+ }
+ if( p->nLookahead==0 ){
+ p->mxLookahead = lookahead;
+ p->mnLookahead = lookahead;
+ p->mnAction = action;
+ }else{
+ if( p->mxLookahead<lookahead ) p->mxLookahead = lookahead;
+ if( p->mnLookahead>lookahead ){
+ p->mnLookahead = lookahead;
+ p->mnAction = action;
+ }
+ }
+ p->aLookahead[p->nLookahead].lookahead = lookahead;
+ p->aLookahead[p->nLookahead].action = action;
+ p->nLookahead++;
+}
+
+/*
+** Add the transaction set built up with prior calls to acttab_action()
+** into the current action table. Then reset the transaction set back
+** to an empty set in preparation for a new round of acttab_action() calls.
+**
+** Return the offset into the action table of the new transaction.
+*/
+int acttab_insert(acttab *p){
+ int i, j, k, n;
+ assert( p->nLookahead>0 );
+
+ /* Make sure we have enough space to hold the expanded action table
+ ** in the worst case. The worst case occurs if the transaction set
+ ** must be appended to the current action table
+ */
+ n = p->mxLookahead + 1;
+ if( p->nAction + n >= p->nActionAlloc ){
+ int oldAlloc = p->nActionAlloc;
+ p->nActionAlloc = p->nAction + n + p->nActionAlloc + 20;
+ p->aAction = realloc( p->aAction,
+ sizeof(p->aAction[0])*p->nActionAlloc);
+ if( p->aAction==0 ){
+ fprintf(stderr,"malloc failed\n");
+ exit(1);
+ }
+ for(i=oldAlloc; i<p->nActionAlloc; i++){
+ p->aAction[i].lookahead = -1;
+ p->aAction[i].action = -1;
+ }
+ }
+
+ /* Scan the existing action table looking for an offset where we can
+ ** insert the current transaction set. Fall out of the loop when that
+ ** offset is found. In the worst case, we fall out of the loop when
+ ** i reaches p->nAction, which means we append the new transaction set.
+ **
+ ** i is the index in p->aAction[] where p->mnLookahead is inserted.
+ */
+ for(i=0; i<p->nAction+p->mnLookahead; i++){
+ if( p->aAction[i].lookahead<0 ){
+ for(j=0; j<p->nLookahead; j++){
+ k = p->aLookahead[j].lookahead - p->mnLookahead + i;
+ if( k<0 ) break;
+ if( p->aAction[k].lookahead>=0 ) break;
+ }
+ if( j<p->nLookahead ) continue;
+ for(j=0; j<p->nAction; j++){
+ if( p->aAction[j].lookahead==j+p->mnLookahead-i ) break;
+ }
+ if( j==p->nAction ){
+ break; /* Fits in empty slots */
+ }
+ }else if( p->aAction[i].lookahead==p->mnLookahead ){
+ if( p->aAction[i].action!=p->mnAction ) continue;
+ for(j=0; j<p->nLookahead; j++){
+ k = p->aLookahead[j].lookahead - p->mnLookahead + i;
+ if( k<0 || k>=p->nAction ) break;
+ if( p->aLookahead[j].lookahead!=p->aAction[k].lookahead ) break;
+ if( p->aLookahead[j].action!=p->aAction[k].action ) break;
+ }
+ if( j<p->nLookahead ) continue;
+ n = 0;
+ for(j=0; j<p->nAction; j++){
+ if( p->aAction[j].lookahead<0 ) continue;
+ if( p->aAction[j].lookahead==j+p->mnLookahead-i ) n++;
+ }
+ if( n==p->nLookahead ){
+ break; /* Same as a prior transaction set */
+ }
+ }
+ }
+ /* Insert transaction set at index i. */
+ for(j=0; j<p->nLookahead; j++){
+ k = p->aLookahead[j].lookahead - p->mnLookahead + i;
+ p->aAction[k] = p->aLookahead[j];
+ if( k>=p->nAction ) p->nAction = k+1;
+ }
+ p->nLookahead = 0;
+
+ /* Return the offset that is added to the lookahead in order to get the
+ ** index into yy_action of the action */
+ return i - p->mnLookahead;
+}
+
+/********************** From the file "assert.c" ****************************/
+/*
+** A more efficient way of handling assertions.
+*/
+void myassert(file,line)
+char *file;
+int line;
+{
+ fprintf(stderr,"Assertion failed on line %d of file \"%s\"\n",line,file);
+ exit(1);
+}
+/********************** From the file "build.c" *****************************/
+/*
+** Routines to construction the finite state machine for the LEMON
+** parser generator.
+*/
+
+/* Find a precedence symbol of every rule in the grammar.
+**
+** Those rules which have a precedence symbol coded in the input
+** grammar using the "[symbol]" construct will already have the
+** rp->precsym field filled. Other rules take as their precedence
+** symbol the first RHS symbol with a defined precedence. If there
+** are not RHS symbols with a defined precedence, the precedence
+** symbol field is left blank.
+*/
+void FindRulePrecedences(xp)
+struct lemon *xp;
+{
+ struct rule *rp;
+ for(rp=xp->rule; rp; rp=rp->next){
+ if( rp->precsym==0 ){
+ int i;
+ for(i=0; i<rp->nrhs; i++){
+ if( rp->rhs[i]->prec>=0 ){
+ rp->precsym = rp->rhs[i];
+ break;
+ }
+ }
+ }
+ }
+ return;
+}
+
+/* Find all nonterminals which will generate the empty string.
+** Then go back and compute the first sets of every nonterminal.
+** The first set is the set of all terminal symbols which can begin
+** a string generated by that nonterminal.
+*/
+void FindFirstSets(lemp)
+struct lemon *lemp;
+{
+ int i;
+ struct rule *rp;
+ int progress;
+
+ for(i=0; i<lemp->nsymbol; i++){
+ lemp->symbols[i]->lambda = B_FALSE;
+ }
+ for(i=lemp->nterminal; i<lemp->nsymbol; i++){
+ lemp->symbols[i]->firstset = SetNew();
+ }
+
+ /* First compute all lambdas */
+ do{
+ progress = 0;
+ for(rp=lemp->rule; rp; rp=rp->next){
+ if( rp->lhs->lambda ) continue;
+ for(i=0; i<rp->nrhs; i++){
+ if( rp->rhs[i]->lambda==B_FALSE ) break;
+ }
+ if( i==rp->nrhs ){
+ rp->lhs->lambda = B_TRUE;
+ progress = 1;
+ }
+ }
+ }while( progress );
+
+ /* Now compute all first sets */
+ do{
+ struct symbol *s1, *s2;
+ progress = 0;
+ for(rp=lemp->rule; rp; rp=rp->next){
+ s1 = rp->lhs;
+ for(i=0; i<rp->nrhs; i++){
+ s2 = rp->rhs[i];
+ if( s2->type==TERMINAL ){
+ progress += SetAdd(s1->firstset,s2->index);
+ break;
+ }else if( s1==s2 ){
+ if( s1->lambda==B_FALSE ) break;
+ }else{
+ progress += SetUnion(s1->firstset,s2->firstset);
+ if( s2->lambda==B_FALSE ) break;
+ }
+ }
+ }
+ }while( progress );
+ return;
+}
+
+/* Compute all LR(0) states for the grammar. Links
+** are added to between some states so that the LR(1) follow sets
+** can be computed later.
+*/
+PRIVATE struct state *getstate(/* struct lemon * */); /* forward reference */
+void FindStates(lemp)
+struct lemon *lemp;
+{
+ struct symbol *sp;
+ struct rule *rp;
+
+ Configlist_init();
+
+ /* Find the start symbol */
+ if( lemp->start ){
+ sp = Symbol_find(lemp->start);
+ if( sp==0 ){
+ ErrorMsg(lemp->filename,0,
+"The specified start symbol \"%s\" is not \
+in a nonterminal of the grammar. \"%s\" will be used as the start \
+symbol instead.",lemp->start,lemp->rule->lhs->name);
+ lemp->errorcnt++;
+ sp = lemp->rule->lhs;
+ }
+ }else{
+ sp = lemp->rule->lhs;
+ }
+
+ /* Make sure the start symbol doesn't occur on the right-hand side of
+ ** any rule. Report an error if it does. (YACC would generate a new
+ ** start symbol in this case.) */
+ for(rp=lemp->rule; rp; rp=rp->next){
+ int i;
+ for(i=0; i<rp->nrhs; i++){
+ if( rp->rhs[i]==sp ){
+ ErrorMsg(lemp->filename,0,
+"The start symbol \"%s\" occurs on the \
+right-hand side of a rule. This will result in a parser which \
+does not work properly.",sp->name);
+ lemp->errorcnt++;
+ }
+ }
+ }
+
+ /* The basis configuration set for the first state
+ ** is all rules which have the start symbol as their
+ ** left-hand side */
+ for(rp=sp->rule; rp; rp=rp->nextlhs){
+ struct config *newcfp;
+ newcfp = Configlist_addbasis(rp,0);
+ SetAdd(newcfp->fws,0);
+ }
+
+ /* Compute the first state. All other states will be
+ ** computed automatically during the computation of the first one.
+ ** The returned pointer to the first state is not used. */
+ (void)getstate(lemp);
+ return;
+}
+
+/* Return a pointer to a state which is described by the configuration
+** list which has been built from calls to Configlist_add.
+*/
+PRIVATE void buildshifts(/* struct lemon *, struct state * */); /* Forwd ref */
+PRIVATE struct state *getstate(lemp)
+struct lemon *lemp;
+{
+ struct config *cfp, *bp;
+ struct state *stp;
+
+ /* Extract the sorted basis of the new state. The basis was constructed
+ ** by prior calls to "Configlist_addbasis()". */
+ Configlist_sortbasis();
+ bp = Configlist_basis();
+
+ /* Get a state with the same basis */
+ stp = State_find(bp);
+ if( stp ){
+ /* A state with the same basis already exists! Copy all the follow-set
+ ** propagation links from the state under construction into the
+ ** preexisting state, then return a pointer to the preexisting state */
+ struct config *x, *y;
+ for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){
+ Plink_copy(&y->bplp,x->bplp);
+ Plink_delete(x->fplp);
+ x->fplp = x->bplp = 0;
+ }
+ cfp = Configlist_return();
+ Configlist_eat(cfp);
+ }else{
+ /* This really is a new state. Construct all the details */
+ Configlist_closure(lemp); /* Compute the configuration closure */
+ Configlist_sort(); /* Sort the configuration closure */
+ cfp = Configlist_return(); /* Get a pointer to the config list */
+ stp = State_new(); /* A new state structure */
+ MemoryCheck(stp);
+ stp->bp = bp; /* Remember the configuration basis */
+ stp->cfp = cfp; /* Remember the configuration closure */
+ stp->index = lemp->nstate++; /* Every state gets a sequence number */
+ stp->ap = 0; /* No actions, yet. */
+ State_insert(stp,stp->bp); /* Add to the state table */
+ buildshifts(lemp,stp); /* Recursively compute successor states */
+ }
+ return stp;
+}
+
+/* Construct all successor states to the given state. A "successor"
+** state is any state which can be reached by a shift action.
+*/
+PRIVATE void buildshifts(lemp,stp)
+struct lemon *lemp;
+struct state *stp; /* The state from which successors are computed */
+{
+ struct config *cfp; /* For looping thru the config closure of "stp" */
+ struct config *bcfp; /* For the inner loop on config closure of "stp" */
+ struct config *new; /* */
+ struct symbol *sp; /* Symbol following the dot in configuration "cfp" */
+ struct symbol *bsp; /* Symbol following the dot in configuration "bcfp" */
+ struct state *newstp; /* A pointer to a successor state */
+
+ /* Each configuration becomes complete after it contibutes to a successor
+ ** state. Initially, all configurations are incomplete */
+ for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE;
+
+ /* Loop through all configurations of the state "stp" */
+ for(cfp=stp->cfp; cfp; cfp=cfp->next){
+ if( cfp->status==COMPLETE ) continue; /* Already used by inner loop */
+ if( cfp->dot>=cfp->rp->nrhs ) continue; /* Can't shift this config */
+ Configlist_reset(); /* Reset the new config set */
+ sp = cfp->rp->rhs[cfp->dot]; /* Symbol after the dot */
+
+ /* For every configuration in the state "stp" which has the symbol "sp"
+ ** following its dot, add the same configuration to the basis set under
+ ** construction but with the dot shifted one symbol to the right. */
+ for(bcfp=cfp; bcfp; bcfp=bcfp->next){
+ if( bcfp->status==COMPLETE ) continue; /* Already used */
+ if( bcfp->dot>=bcfp->rp->nrhs ) continue; /* Can't shift this one */
+ bsp = bcfp->rp->rhs[bcfp->dot]; /* Get symbol after dot */
+ if( bsp!=sp ) continue; /* Must be same as for "cfp" */
+ bcfp->status = COMPLETE; /* Mark this config as used */
+ new = Configlist_addbasis(bcfp->rp,bcfp->dot+1);
+ Plink_add(&new->bplp,bcfp);
+ }
+
+ /* Get a pointer to the state described by the basis configuration set
+ ** constructed in the preceding loop */
+ newstp = getstate(lemp);
+
+ /* The state "newstp" is reached from the state "stp" by a shift action
+ ** on the symbol "sp" */
+ Action_add(&stp->ap,SHIFT,sp,(char *)newstp);
+ }
+}
+
+/*
+** Construct the propagation links
+*/
+void FindLinks(lemp)
+struct lemon *lemp;
+{
+ int i;
+ struct config *cfp, *other;
+ struct state *stp;
+ struct plink *plp;
+
+ /* Housekeeping detail:
+ ** Add to every propagate link a pointer back to the state to
+ ** which the link is attached. */
+ for(i=0; i<lemp->nstate; i++){
+ stp = lemp->sorted[i];
+ for(cfp=stp->cfp; cfp; cfp=cfp->next){
+ cfp->stp = stp;
+ }
+ }
+
+ /* Convert all backlinks into forward links. Only the forward
+ ** links are used in the follow-set computation. */
+ for(i=0; i<lemp->nstate; i++){
+ stp = lemp->sorted[i];
+ for(cfp=stp->cfp; cfp; cfp=cfp->next){
+ for(plp=cfp->bplp; plp; plp=plp->next){
+ other = plp->cfp;
+ Plink_add(&other->fplp,cfp);
+ }
+ }
+ }
+}
+
+/* Compute all followsets.
+**
+** A followset is the set of all symbols which can come immediately
+** after a configuration.
+*/
+void FindFollowSets(lemp)
+struct lemon *lemp;
+{
+ int i;
+ struct config *cfp;
+ struct plink *plp;
+ int progress;
+ int change;
+
+ for(i=0; i<lemp->nstate; i++){
+ for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){
+ cfp->status = INCOMPLETE;
+ }
+ }
+
+ do{
+ progress = 0;
+ for(i=0; i<lemp->nstate; i++){
+ for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){
+ if( cfp->status==COMPLETE ) continue;
+ for(plp=cfp->fplp; plp; plp=plp->next){
+ change = SetUnion(plp->cfp->fws,cfp->fws);
+ if( change ){
+ plp->cfp->status = INCOMPLETE;
+ progress = 1;
+ }
+ }
+ cfp->status = COMPLETE;
+ }
+ }
+ }while( progress );
+}
+
+static int resolve_conflict();
+
+/* Compute the reduce actions, and resolve conflicts.
+*/
+void FindActions(lemp)
+struct lemon *lemp;
+{
+ int i,j;
+ struct config *cfp;
+ struct state *stp;
+ struct symbol *sp;
+ struct rule *rp;
+
+ /* Add all of the reduce actions
+ ** A reduce action is added for each element of the followset of
+ ** a configuration which has its dot at the extreme right.
+ */
+ for(i=0; i<lemp->nstate; i++){ /* Loop over all states */
+ stp = lemp->sorted[i];
+ for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */
+ if( cfp->rp->nrhs==cfp->dot ){ /* Is dot at extreme right? */
+ for(j=0; j<lemp->nterminal; j++){
+ if( SetFind(cfp->fws,j) ){
+ /* Add a reduce action to the state "stp" which will reduce by the
+ ** rule "cfp->rp" if the lookahead symbol is "lemp->symbols[j]" */
+ Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp);
+ }
+ }
+ }
+ }
+ }
+
+ /* Add the accepting token */
+ if( lemp->start ){
+ sp = Symbol_find(lemp->start);
+ if( sp==0 ) sp = lemp->rule->lhs;
+ }else{
+ sp = lemp->rule->lhs;
+ }
+ /* Add to the first state (which is always the starting state of the
+ ** finite state machine) an action to ACCEPT if the lookahead is the
+ ** start nonterminal. */
+ Action_add(&lemp->sorted[0]->ap,ACCEPT,sp,0);
+
+ /* Resolve conflicts */
+ for(i=0; i<lemp->nstate; i++){
+ struct action *ap, *nap;
+ struct state *stp;
+ stp = lemp->sorted[i];
+ assert( stp->ap );
+ stp->ap = Action_sort(stp->ap);
+ for(ap=stp->ap; ap && ap->next; ap=ap->next){
+ for(nap=ap->next; nap && nap->sp==ap->sp; nap=nap->next){
+ /* The two actions "ap" and "nap" have the same lookahead.
+ ** Figure out which one should be used */
+ lemp->nconflict += resolve_conflict(ap,nap,lemp->errsym);
+ }
+ }
+ }
+
+ /* Report an error for each rule that can never be reduced. */
+ for(rp=lemp->rule; rp; rp=rp->next) rp->canReduce = B_FALSE;
+ for(i=0; i<lemp->nstate; i++){
+ struct action *ap;
+ for(ap=lemp->sorted[i]->ap; ap; ap=ap->next){
+ if( ap->type==REDUCE ) ap->x.rp->canReduce = B_TRUE;
+ }
+ }
+ for(rp=lemp->rule; rp; rp=rp->next){
+ if( rp->canReduce ) continue;
+ ErrorMsg(lemp->filename,rp->ruleline,"This rule can not be reduced.\n");
+ lemp->errorcnt++;
+ }
+}
+
+/* Resolve a conflict between the two given actions. If the
+** conflict can't be resolve, return non-zero.
+**
+** NO LONGER TRUE:
+** To resolve a conflict, first look to see if either action
+** is on an error rule. In that case, take the action which
+** is not associated with the error rule. If neither or both
+** actions are associated with an error rule, then try to
+** use precedence to resolve the conflict.
+**
+** If either action is a SHIFT, then it must be apx. This
+** function won't work if apx->type==REDUCE and apy->type==SHIFT.
+*/
+static int resolve_conflict(apx,apy,errsym)
+struct action *apx;
+struct action *apy;
+struct symbol *errsym; /* The error symbol (if defined. NULL otherwise) */
+{
+ struct symbol *spx, *spy;
+ int errcnt = 0;
+ assert( apx->sp==apy->sp ); /* Otherwise there would be no conflict */
+ if( apx->type==SHIFT && apy->type==REDUCE ){
+ spx = apx->sp;
+ spy = apy->x.rp->precsym;
+ if( spy==0 || spx->prec<0 || spy->prec<0 ){
+ /* Not enough precedence information. */
+ apy->type = CONFLICT;
+ errcnt++;
+ }else if( spx->prec>spy->prec ){ /* Lower precedence wins */
+ apy->type = RD_RESOLVED;
+ }else if( spx->prec<spy->prec ){
+ apx->type = SH_RESOLVED;
+ }else if( spx->prec==spy->prec && spx->assoc==RIGHT ){ /* Use operator */
+ apy->type = RD_RESOLVED; /* associativity */
+ }else if( spx->prec==spy->prec && spx->assoc==LEFT ){ /* to break tie */
+ apx->type = SH_RESOLVED;
+ }else{
+ assert( spx->prec==spy->prec && spx->assoc==NONE );
+ apy->type = CONFLICT;
+ errcnt++;
+ }
+ }else if( apx->type==REDUCE && apy->type==REDUCE ){
+ spx = apx->x.rp->precsym;
+ spy = apy->x.rp->precsym;
+ if( spx==0 || spy==0 || spx->prec<0 ||
+ spy->prec<0 || spx->prec==spy->prec ){
+ apy->type = CONFLICT;
+ errcnt++;
+ }else if( spx->prec>spy->prec ){
+ apy->type = RD_RESOLVED;
+ }else if( spx->prec<spy->prec ){
+ apx->type = RD_RESOLVED;
+ }
+ }else{
+ assert(
+ apx->type==SH_RESOLVED ||
+ apx->type==RD_RESOLVED ||
+ apx->type==CONFLICT ||
+ apy->type==SH_RESOLVED ||
+ apy->type==RD_RESOLVED ||
+ apy->type==CONFLICT
+ );
+ /* The REDUCE/SHIFT case cannot happen because SHIFTs come before
+ ** REDUCEs on the list. If we reach this point it must be because
+ ** the parser conflict had already been resolved. */
+ }
+ return errcnt;
+}
+/********************* From the file "configlist.c" *************************/
+/*
+** Routines to processing a configuration list and building a state
+** in the LEMON parser generator.
+*/
+
+static struct config *freelist = 0; /* List of free configurations */
+static struct config *current = 0; /* Top of list of configurations */
+static struct config **currentend = 0; /* Last on list of configs */
+static struct config *basis = 0; /* Top of list of basis configs */
+static struct config **basisend = 0; /* End of list of basis configs */
+
+/* Return a pointer to a new configuration */
+PRIVATE struct config *newconfig(){
+ struct config *new;
+ if( freelist==0 ){
+ int i;
+ int amt = 3;
+ freelist = (struct config *)malloc( sizeof(struct config)*amt );
+ if( freelist==0 ){
+ fprintf(stderr,"Unable to allocate memory for a new configuration.");
+ exit(1);
+ }
+ for(i=0; i<amt-1; i++) freelist[i].next = &freelist[i+1];
+ freelist[amt-1].next = 0;
+ }
+ new = freelist;
+ freelist = freelist->next;
+ return new;
+}
+
+/* The configuration "old" is no longer used */
+PRIVATE void deleteconfig(old)
+struct config *old;
+{
+ old->next = freelist;
+ freelist = old;
+}
+
+/* Initialized the configuration list builder */
+void Configlist_init(){
+ current = 0;
+ currentend = &current;
+ basis = 0;
+ basisend = &basis;
+ Configtable_init();
+ return;
+}
+
+/* Initialized the configuration list builder */
+void Configlist_reset(){
+ current = 0;
+ currentend = &current;
+ basis = 0;
+ basisend = &basis;
+ Configtable_clear(0);
+ return;
+}
+
+/* Add another configuration to the configuration list */
+struct config *Configlist_add(rp,dot)
+struct rule *rp; /* The rule */
+int dot; /* Index into the RHS of the rule where the dot goes */
+{
+ struct config *cfp, model;
+
+ assert( currentend!=0 );
+ model.rp = rp;
+ model.dot = dot;
+ cfp = Configtable_find(&model);
+ if( cfp==0 ){
+ cfp = newconfig();
+ cfp->rp = rp;
+ cfp->dot = dot;
+ cfp->fws = SetNew();
+ cfp->stp = 0;
+ cfp->fplp = cfp->bplp = 0;
+ cfp->next = 0;
+ cfp->bp = 0;
+ *currentend = cfp;
+ currentend = &cfp->next;
+ Configtable_insert(cfp);
+ }
+ return cfp;
+}
+
+/* Add a basis configuration to the configuration list */
+struct config *Configlist_addbasis(rp,dot)
+struct rule *rp;
+int dot;
+{
+ struct config *cfp, model;
+
+ assert( basisend!=0 );
+ assert( currentend!=0 );
+ model.rp = rp;
+ model.dot = dot;
+ cfp = Configtable_find(&model);
+ if( cfp==0 ){
+ cfp = newconfig();
+ cfp->rp = rp;
+ cfp->dot = dot;
+ cfp->fws = SetNew();
+ cfp->stp = 0;
+ cfp->fplp = cfp->bplp = 0;
+ cfp->next = 0;
+ cfp->bp = 0;
+ *currentend = cfp;
+ currentend = &cfp->next;
+ *basisend = cfp;
+ basisend = &cfp->bp;
+ Configtable_insert(cfp);
+ }
+ return cfp;
+}
+
+/* Compute the closure of the configuration list */
+void Configlist_closure(lemp)
+struct lemon *lemp;
+{
+ struct config *cfp, *newcfp;
+ struct rule *rp, *newrp;
+ struct symbol *sp, *xsp;
+ int i, dot;
+
+ assert( currentend!=0 );
+ for(cfp=current; cfp; cfp=cfp->next){
+ rp = cfp->rp;
+ dot = cfp->dot;
+ if( dot>=rp->nrhs ) continue;
+ sp = rp->rhs[dot];
+ if( sp->type==NONTERMINAL ){
+ if( sp->rule==0 && sp!=lemp->errsym ){
+ ErrorMsg(lemp->filename,rp->line,"Nonterminal \"%s\" has no rules.",
+ sp->name);
+ lemp->errorcnt++;
+ }
+ for(newrp=sp->rule; newrp; newrp=newrp->nextlhs){
+ newcfp = Configlist_add(newrp,0);
+ for(i=dot+1; i<rp->nrhs; i++){
+ xsp = rp->rhs[i];
+ if( xsp->type==TERMINAL ){
+ SetAdd(newcfp->fws,xsp->index);
+ break;
+ }else{
+ SetUnion(newcfp->fws,xsp->firstset);
+ if( xsp->lambda==B_FALSE ) break;
+ }
+ }
+ if( i==rp->nrhs ) Plink_add(&cfp->fplp,newcfp);
+ }
+ }
+ }
+ return;
+}
+
+/* Sort the configuration list */
+void Configlist_sort(){
+ current = (struct config *)msort((char *)current,(char **)&(current->next),Configcmp);
+ currentend = 0;
+ return;
+}
+
+/* Sort the basis configuration list */
+void Configlist_sortbasis(){
+ basis = (struct config *)msort((char *)current,(char **)&(current->bp),Configcmp);
+ basisend = 0;
+ return;
+}
+
+/* Return a pointer to the head of the configuration list and
+** reset the list */
+struct config *Configlist_return(){
+ struct config *old;
+ old = current;
+ current = 0;
+ currentend = 0;
+ return old;
+}
+
+/* Return a pointer to the head of the configuration list and
+** reset the list */
+struct config *Configlist_basis(){
+ struct config *old;
+ old = basis;
+ basis = 0;
+ basisend = 0;
+ return old;
+}
+
+/* Free all elements of the given configuration list */
+void Configlist_eat(cfp)
+struct config *cfp;
+{
+ struct config *nextcfp;
+ for(; cfp; cfp=nextcfp){
+ nextcfp = cfp->next;
+ assert( cfp->fplp==0 );
+ assert( cfp->bplp==0 );
+ if( cfp->fws ) SetFree(cfp->fws);
+ deleteconfig(cfp);
+ }
+ return;
+}
+/***************** From the file "error.c" *********************************/
+/*
+** Code for printing error message.
+*/
+
+/* Find a good place to break "msg" so that its length is at least "min"
+** but no more than "max". Make the point as close to max as possible.
+*/
+static int findbreak(msg,min,max)
+char *msg;
+int min;
+int max;
+{
+ int i,spot;
+ char c;
+ for(i=spot=min; i<=max; i++){
+ c = msg[i];
+ if( c=='\t' ) msg[i] = ' ';
+ if( c=='\n' ){ msg[i] = ' '; spot = i; break; }
+ if( c==0 ){ spot = i; break; }
+ if( c=='-' && i<max-1 ) spot = i+1;
+ if( c==' ' ) spot = i;
+ }
+ return spot;
+}
+
+/*
+** The error message is split across multiple lines if necessary. The
+** splits occur at a space, if there is a space available near the end
+** of the line.
+*/
+#define ERRMSGSIZE 10000 /* Hope this is big enough. No way to error check */
+#define LINEWIDTH 79 /* Max width of any output line */
+#define PREFIXLIMIT 30 /* Max width of the prefix on each line */
+void ErrorMsg(const char *filename, int lineno, const char *format, ...){
+ char errmsg[ERRMSGSIZE];
+ char prefix[PREFIXLIMIT+10];
+ int errmsgsize;
+ int prefixsize;
+ int availablewidth;
+ va_list ap;
+ int end, restart, base;
+
+ va_start(ap, format);
+ /* Prepare a prefix to be prepended to every output line */
+ if( lineno>0 ){
+ sprintf(prefix,"%.*s:%d: ",PREFIXLIMIT-10,filename,lineno);
+ }else{
+ sprintf(prefix,"%.*s: ",PREFIXLIMIT-10,filename);
+ }
+ prefixsize = strlen(prefix);
+ availablewidth = LINEWIDTH - prefixsize;
+
+ /* Generate the error message */
+ vsprintf(errmsg,format,ap);
+ va_end(ap);
+ errmsgsize = strlen(errmsg);
+ /* Remove trailing '\n's from the error message. */
+ while( errmsgsize>0 && errmsg[errmsgsize-1]=='\n' ){
+ errmsg[--errmsgsize] = 0;
+ }
+
+ /* Print the error message */
+ base = 0;
+ while( errmsg[base]!=0 ){
+ end = restart = findbreak(&errmsg[base],0,availablewidth);
+ restart += base;
+ while( errmsg[restart]==' ' ) restart++;
+ fprintf(stdout,"%s%.*s\n",prefix,end,&errmsg[base]);
+ base = restart;
+ }
+}
+/**************** From the file "main.c" ************************************/
+/*
+** Main program file for the LEMON parser generator.
+*/
+
+/* Report an out-of-memory condition and abort. This function
+** is used mostly by the "MemoryCheck" macro in struct.h
+*/
+void memory_error(){
+ fprintf(stderr,"Out of memory. Aborting...\n");
+ exit(1);
+}
+
+static int nDefine = 0; /* Number of -D options on the command line */
+static char **azDefine = 0; /* Name of the -D macros */
+
+/* This routine is called with the argument to each -D command-line option.
+** Add the macro defined to the azDefine array.
+*/
+static void handle_D_option(char *z){
+ char **paz;
+ nDefine++;
+ azDefine = realloc(azDefine, sizeof(azDefine[0])*nDefine);
+ if( azDefine==0 ){
+ fprintf(stderr,"out of memory\n");
+ exit(1);
+ }
+ paz = &azDefine[nDefine-1];
+ *paz = malloc( strlen(z)+1 );
+ if( *paz==0 ){
+ fprintf(stderr,"out of memory\n");
+ exit(1);
+ }
+ strcpy(*paz, z);
+ for(z=*paz; *z && *z!='='; z++){}
+ *z = 0;
+}
+
+
+/* The main program. Parse the command line and do it... */
+int main(argc,argv)
+int argc;
+char **argv;
+{
+ static int version = 0;
+ static int rpflag = 0;
+ static int basisflag = 0;
+ static int compress = 0;
+ static int quiet = 0;
+ static int statistics = 0;
+ static int mhflag = 0;
+ static struct s_options options[] = {
+ {OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."},
+ {OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."},
+ {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."},
+ {OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."},
+ {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file"},
+ {OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."},
+ {OPT_FLAG, "s", (char*)&statistics,
+ "Print parser stats to standard output."},
+ {OPT_FLAG, "x", (char*)&version, "Print the version number."},
+ {OPT_FLAG,0,0,0}
+ };
+ int i;
+ struct lemon lem;
+
+ OptInit(argv,options,stderr);
+ if( version ){
+ printf("Lemon version 1.0\n");
+ exit(0);
+ }
+ if( OptNArgs()!=1 ){
+ fprintf(stderr,"Exactly one filename argument is required.\n");
+ exit(1);
+ }
+ lem.errorcnt = 0;
+
+ /* Initialize the machine */
+ Strsafe_init();
+ Symbol_init();
+ State_init();
+ lem.argv0 = argv[0];
+ lem.filename = OptArg(0);
+ lem.basisflag = basisflag;
+ lem.has_fallback = 0;
+ lem.nconflict = 0;
+ lem.name = lem.include = lem.arg = lem.tokentype = lem.start = 0;
+ lem.vartype = 0;
+ lem.stacksize = 0;
+ lem.error = lem.overflow = lem.failure = lem.accept = lem.tokendest =
+ lem.tokenprefix = lem.outname = lem.extracode = 0;
+ lem.vardest = 0;
+ lem.tablesize = 0;
+ Symbol_new("$");
+ lem.errsym = Symbol_new("error");
+
+ /* Parse the input file */
+ Parse(&lem);
+ if( lem.errorcnt ) exit(lem.errorcnt);
+ if( lem.rule==0 ){
+ fprintf(stderr,"Empty grammar.\n");
+ exit(1);
+ }
+
+ /* Count and index the symbols of the grammar */
+ lem.nsymbol = Symbol_count();
+ Symbol_new("{default}");
+ lem.symbols = Symbol_arrayof();
+ for(i=0; i<=lem.nsymbol; i++) lem.symbols[i]->index = i;
+ qsort(lem.symbols,lem.nsymbol+1,sizeof(struct symbol*),
+ (int(*)())Symbolcmpp);
+ for(i=0; i<=lem.nsymbol; i++) lem.symbols[i]->index = i;
+ for(i=1; isupper(lem.symbols[i]->name[0]); i++);
+ lem.nterminal = i;
+
+ /* Generate a reprint of the grammar, if requested on the command line */
+ if( rpflag ){
+ Reprint(&lem);
+ }else{
+ /* Initialize the size for all follow and first sets */
+ SetSize(lem.nterminal);
+
+ /* Find the precedence for every production rule (that has one) */
+ FindRulePrecedences(&lem);
+
+ /* Compute the lambda-nonterminals and the first-sets for every
+ ** nonterminal */
+ FindFirstSets(&lem);
+
+ /* Compute all LR(0) states. Also record follow-set propagation
+ ** links so that the follow-set can be computed later */
+ lem.nstate = 0;
+ FindStates(&lem);
+ lem.sorted = State_arrayof();
+
+ /* Tie up loose ends on the propagation links */
+ FindLinks(&lem);
+
+ /* Compute the follow set of every reducible configuration */
+ FindFollowSets(&lem);
+
+ /* Compute the action tables */
+ FindActions(&lem);
+
+ /* Compress the action tables */
+ if( compress==0 ) CompressTables(&lem);
+
+ /* Generate a report of the parser generated. (the "y.output" file) */
+ if( !quiet ) ReportOutput(&lem);
+
+ /* Generate the source code for the parser */
+ ReportTable(&lem, mhflag);
+
+ /* Produce a header file for use by the scanner. (This step is
+ ** omitted if the "-m" option is used because makeheaders will
+ ** generate the file for us.) */
+ if( !mhflag ) ReportHeader(&lem);
+ }
+ if( statistics ){
+ printf("Parser statistics: %d terminals, %d nonterminals, %d rules\n",
+ lem.nterminal, lem.nsymbol - lem.nterminal, lem.nrule);
+ printf(" %d states, %d parser table entries, %d conflicts\n",
+ lem.nstate, lem.tablesize, lem.nconflict);
+ }
+ if( lem.nconflict ){
+ fprintf(stderr,"%d parsing conflicts.\n",lem.nconflict);
+ }
+ exit(lem.errorcnt + lem.nconflict);
+ return (lem.errorcnt + lem.nconflict);
+}
+/******************** From the file "msort.c" *******************************/
+/*
+** A generic merge-sort program.
+**
+** USAGE:
+** Let "ptr" be a pointer to some structure which is at the head of
+** a null-terminated list. Then to sort the list call:
+**
+** ptr = msort(ptr,&(ptr->next),cmpfnc);
+**
+** In the above, "cmpfnc" is a pointer to a function which compares
+** two instances of the structure and returns an integer, as in
+** strcmp. The second argument is a pointer to the pointer to the
+** second element of the linked list. This address is used to compute
+** the offset to the "next" field within the structure. The offset to
+** the "next" field must be constant for all structures in the list.
+**
+** The function returns a new pointer which is the head of the list
+** after sorting.
+**
+** ALGORITHM:
+** Merge-sort.
+*/
+
+/*
+** Return a pointer to the next structure in the linked list.
+*/
+#define NEXT(A) (*(char**)(((unsigned long)A)+offset))
+
+/*
+** Inputs:
+** a: A sorted, null-terminated linked list. (May be null).
+** b: A sorted, null-terminated linked list. (May be null).
+** cmp: A pointer to the comparison function.
+** offset: Offset in the structure to the "next" field.
+**
+** Return Value:
+** A pointer to the head of a sorted list containing the elements
+** of both a and b.
+**
+** Side effects:
+** The "next" pointers for elements in the lists a and b are
+** changed.
+*/
+static char *merge(a,b,cmp,offset)
+char *a;
+char *b;
+int (*cmp)();
+int offset;
+{
+ char *ptr, *head;
+
+ if( a==0 ){
+ head = b;
+ }else if( b==0 ){
+ head = a;
+ }else{
+ if( (*cmp)(a,b)<0 ){
+ ptr = a;
+ a = NEXT(a);
+ }else{
+ ptr = b;
+ b = NEXT(b);
+ }
+ head = ptr;
+ while( a && b ){
+ if( (*cmp)(a,b)<0 ){
+ NEXT(ptr) = a;
+ ptr = a;
+ a = NEXT(a);
+ }else{
+ NEXT(ptr) = b;
+ ptr = b;
+ b = NEXT(b);
+ }
+ }
+ if( a ) NEXT(ptr) = a;
+ else NEXT(ptr) = b;
+ }
+ return head;
+}
+
+/*
+** Inputs:
+** list: Pointer to a singly-linked list of structures.
+** next: Pointer to pointer to the second element of the list.
+** cmp: A comparison function.
+**
+** Return Value:
+** A pointer to the head of a sorted list containing the elements
+** orginally in list.
+**
+** Side effects:
+** The "next" pointers for elements in list are changed.
+*/
+#define LISTSIZE 30
+char *msort(list,next,cmp)
+char *list;
+char **next;
+int (*cmp)();
+{
+ unsigned long offset;
+ char *ep;
+ char *set[LISTSIZE];
+ int i;
+ offset = (unsigned long)next - (unsigned long)list;
+ for(i=0; i<LISTSIZE; i++) set[i] = 0;
+ while( list ){
+ ep = list;
+ list = NEXT(list);
+ NEXT(ep) = 0;
+ for(i=0; i<LISTSIZE-1 && set[i]!=0; i++){
+ ep = merge(ep,set[i],cmp,offset);
+ set[i] = 0;
+ }
+ set[i] = ep;
+ }
+ ep = 0;
+ for(i=0; i<LISTSIZE; i++) if( set[i] ) ep = merge(ep,set[i],cmp,offset);
+ return ep;
+}
+/************************ From the file "option.c" **************************/
+static char **argv;
+static struct s_options *op;
+static FILE *errstream;
+
+#define ISOPT(X) ((X)[0]=='-'||(X)[0]=='+'||strchr((X),'=')!=0)
+
+/*
+** Print the command line with a carrot pointing to the k-th character
+** of the n-th field.
+*/
+static void errline(n,k,err)
+int n;
+int k;
+FILE *err;
+{
+ int spcnt, i;
+ if( argv[0] ) fprintf(err,"%s",argv[0]);
+ spcnt = strlen(argv[0]) + 1;
+ for(i=1; i<n && argv[i]; i++){
+ fprintf(err," %s",argv[i]);
+ spcnt += strlen(argv[i])+1;
+ }
+ spcnt += k;
+ for(; argv[i]; i++) fprintf(err," %s",argv[i]);
+ if( spcnt<20 ){
+ fprintf(err,"\n%*s^-- here\n",spcnt,"");
+ }else{
+ fprintf(err,"\n%*shere --^\n",spcnt-7,"");
+ }
+}
+
+/*
+** Return the index of the N-th non-switch argument. Return -1
+** if N is out of range.
+*/
+static int argindex(n)
+int n;
+{
+ int i;
+ int dashdash = 0;
+ if( argv!=0 && *argv!=0 ){
+ for(i=1; argv[i]; i++){
+ if( dashdash || !ISOPT(argv[i]) ){
+ if( n==0 ) return i;
+ n--;
+ }
+ if( strcmp(argv[i],"--")==0 ) dashdash = 1;
+ }
+ }
+ return -1;
+}
+
+static char emsg[] = "Command line syntax error: ";
+
+/*
+** Process a flag command line argument.
+*/
+static int handleflags(i,err)
+int i;
+FILE *err;
+{
+ int v;
+ int errcnt = 0;
+ int j;
+ for(j=0; op[j].label; j++){
+ if( strncmp(&argv[i][1],op[j].label,strlen(op[j].label))==0 ) break;
+ }
+ v = argv[i][0]=='-' ? 1 : 0;
+ if( op[j].label==0 ){
+ if( err ){
+ fprintf(err,"%sundefined option.\n",emsg);
+ errline(i,1,err);
+ }
+ errcnt++;
+ }else if( op[j].type==OPT_FLAG ){
+ *((int*)op[j].arg) = v;
+ }else if( op[j].type==OPT_FFLAG ){
+ (*(void(*)())(op[j].arg))(v);
+ }else if( op[j].type==OPT_FSTR ){
+ (*(void(*)())(op[j].arg))(&argv[i][2]);
+ }else{
+ if( err ){
+ fprintf(err,"%smissing argument on switch.\n",emsg);
+ errline(i,1,err);
+ }
+ errcnt++;
+ }
+ return errcnt;
+}
+
+/*
+** Process a command line switch which has an argument.
+*/
+static int handleswitch(i,err)
+int i;
+FILE *err;
+{
+ int lv = 0;
+ double dv = 0.0;
+ char *sv = 0, *end;
+ char *cp;
+ int j;
+ int errcnt = 0;
+ cp = strchr(argv[i],'=');
+ *cp = 0;
+ for(j=0; op[j].label; j++){
+ if( strcmp(argv[i],op[j].label)==0 ) break;
+ }
+ *cp = '=';
+ if( op[j].label==0 ){
+ if( err ){
+ fprintf(err,"%sundefined option.\n",emsg);
+ errline(i,0,err);
+ }
+ errcnt++;
+ }else{
+ cp++;
+ switch( op[j].type ){
+ case OPT_FLAG:
+ case OPT_FFLAG:
+ if( err ){
+ fprintf(err,"%soption requires an argument.\n",emsg);
+ errline(i,0,err);
+ }
+ errcnt++;
+ break;
+ case OPT_DBL:
+ case OPT_FDBL:
+ dv = strtod(cp,&end);
+ if( *end ){
+ if( err ){
+ fprintf(err,"%sillegal character in floating-point argument.\n",emsg);
+ errline(i,((unsigned long)end)-(unsigned long)argv[i],err);
+ }
+ errcnt++;
+ }
+ break;
+ case OPT_INT:
+ case OPT_FINT:
+ lv = strtol(cp,&end,0);
+ if( *end ){
+ if( err ){
+ fprintf(err,"%sillegal character in integer argument.\n",emsg);
+ errline(i,((unsigned long)end)-(unsigned long)argv[i],err);
+ }
+ errcnt++;
+ }
+ break;
+ case OPT_STR:
+ case OPT_FSTR:
+ sv = cp;
+ break;
+ }
+ switch( op[j].type ){
+ case OPT_FLAG:
+ case OPT_FFLAG:
+ break;
+ case OPT_DBL:
+ *(double*)(op[j].arg) = dv;
+ break;
+ case OPT_FDBL:
+ (*(void(*)())(op[j].arg))(dv);
+ break;
+ case OPT_INT:
+ *(int*)(op[j].arg) = lv;
+ break;
+ case OPT_FINT:
+ (*(void(*)())(op[j].arg))((int)lv);
+ break;
+ case OPT_STR:
+ *(char**)(op[j].arg) = sv;
+ break;
+ case OPT_FSTR:
+ (*(void(*)())(op[j].arg))(sv);
+ break;
+ }
+ }
+ return errcnt;
+}
+
+int OptInit(a,o,err)
+char **a;
+struct s_options *o;
+FILE *err;
+{
+ int errcnt = 0;
+ argv = a;
+ op = o;
+ errstream = err;
+ if( argv && *argv && op ){
+ int i;
+ for(i=1; argv[i]; i++){
+ if( argv[i][0]=='+' || argv[i][0]=='-' ){
+ errcnt += handleflags(i,err);
+ }else if( strchr(argv[i],'=') ){
+ errcnt += handleswitch(i,err);
+ }
+ }
+ }
+ if( errcnt>0 ){
+ fprintf(err,"Valid command line options for \"%s\" are:\n",*a);
+ OptPrint();
+ exit(1);
+ }
+ return 0;
+}
+
+int OptNArgs(){
+ int cnt = 0;
+ int dashdash = 0;
+ int i;
+ if( argv!=0 && argv[0]!=0 ){
+ for(i=1; argv[i]; i++){
+ if( dashdash || !ISOPT(argv[i]) ) cnt++;
+ if( strcmp(argv[i],"--")==0 ) dashdash = 1;
+ }
+ }
+ return cnt;
+}
+
+char *OptArg(n)
+int n;
+{
+ int i;
+ i = argindex(n);
+ return i>=0 ? argv[i] : 0;
+}
+
+void OptErr(n)
+int n;
+{
+ int i;
+ i = argindex(n);
+ if( i>=0 ) errline(i,0,errstream);
+}
+
+void OptPrint(){
+ int i;
+ int max, len;
+ max = 0;
+ for(i=0; op[i].label; i++){
+ len = strlen(op[i].label) + 1;
+ switch( op[i].type ){
+ case OPT_FLAG:
+ case OPT_FFLAG:
+ break;
+ case OPT_INT:
+ case OPT_FINT:
+ len += 9; /* length of "<integer>" */
+ break;
+ case OPT_DBL:
+ case OPT_FDBL:
+ len += 6; /* length of "<real>" */
+ break;
+ case OPT_STR:
+ case OPT_FSTR:
+ len += 8; /* length of "<string>" */
+ break;
+ }
+ if( len>max ) max = len;
+ }
+ for(i=0; op[i].label; i++){
+ switch( op[i].type ){
+ case OPT_FLAG:
+ case OPT_FFLAG:
+ fprintf(errstream," -%-*s %s\n",max,op[i].label,op[i].message);
+ break;
+ case OPT_INT:
+ case OPT_FINT:
+ fprintf(errstream," %s=<integer>%*s %s\n",op[i].label,
+ (int)(max-strlen(op[i].label)-9),"",op[i].message);
+ break;
+ case OPT_DBL:
+ case OPT_FDBL:
+ fprintf(errstream," %s=<real>%*s %s\n",op[i].label,
+ (int)(max-strlen(op[i].label)-6),"",op[i].message);
+ break;
+ case OPT_STR:
+ case OPT_FSTR:
+ fprintf(errstream," %s=<string>%*s %s\n",op[i].label,
+ (int)(max-strlen(op[i].label)-8),"",op[i].message);
+ break;
+ }
+ }
+}
+/*********************** From the file "parse.c" ****************************/
+/*
+** Input file parser for the LEMON parser generator.
+*/
+
+/* The state of the parser */
+struct pstate {
+ char *filename; /* Name of the input file */
+ int tokenlineno; /* Linenumber at which current token starts */
+ int errorcnt; /* Number of errors so far */
+ char *tokenstart; /* Text of current token */
+ struct lemon *gp; /* Global state vector */
+ enum e_state {
+ INITIALIZE,
+ WAITING_FOR_DECL_OR_RULE,
+ WAITING_FOR_DECL_KEYWORD,
+ WAITING_FOR_DECL_ARG,
+ WAITING_FOR_PRECEDENCE_SYMBOL,
+ WAITING_FOR_ARROW,
+ IN_RHS,
+ LHS_ALIAS_1,
+ LHS_ALIAS_2,
+ LHS_ALIAS_3,
+ RHS_ALIAS_1,
+ RHS_ALIAS_2,
+ PRECEDENCE_MARK_1,
+ PRECEDENCE_MARK_2,
+ RESYNC_AFTER_RULE_ERROR,
+ RESYNC_AFTER_DECL_ERROR,
+ WAITING_FOR_DESTRUCTOR_SYMBOL,
+ WAITING_FOR_DATATYPE_SYMBOL,
+ WAITING_FOR_FALLBACK_ID
+ } state; /* The state of the parser */
+ struct symbol *fallback; /* The fallback token */
+ struct symbol *lhs; /* Left-hand side of current rule */
+ char *lhsalias; /* Alias for the LHS */
+ int nrhs; /* Number of right-hand side symbols seen */
+ struct symbol *rhs[MAXRHS]; /* RHS symbols */
+ char *alias[MAXRHS]; /* Aliases for each RHS symbol (or NULL) */
+ struct rule *prevrule; /* Previous rule parsed */
+ char *declkeyword; /* Keyword of a declaration */
+ char **declargslot; /* Where the declaration argument should be put */
+ int *decllnslot; /* Where the declaration linenumber is put */
+ enum e_assoc declassoc; /* Assign this association to decl arguments */
+ int preccounter; /* Assign this precedence to decl arguments */
+ struct rule *firstrule; /* Pointer to first rule in the grammar */
+ struct rule *lastrule; /* Pointer to the most recently parsed rule */
+};
+
+/* Parse a single token */
+static void parseonetoken(psp)
+struct pstate *psp;
+{
+ char *x;
+ x = Strsafe(psp->tokenstart); /* Save the token permanently */
+#if 0
+ printf("%s:%d: Token=[%s] state=%d\n",psp->filename,psp->tokenlineno,
+ x,psp->state);
+#endif
+ switch( psp->state ){
+ case INITIALIZE:
+ psp->prevrule = 0;
+ psp->preccounter = 0;
+ psp->firstrule = psp->lastrule = 0;
+ psp->gp->nrule = 0;
+ /* Fall thru to next case */
+ case WAITING_FOR_DECL_OR_RULE:
+ if( x[0]=='%' ){
+ psp->state = WAITING_FOR_DECL_KEYWORD;
+ }else if( islower(x[0]) ){
+ psp->lhs = Symbol_new(x);
+ psp->nrhs = 0;
+ psp->lhsalias = 0;
+ psp->state = WAITING_FOR_ARROW;
+ }else if( x[0]=='{' ){
+ if( psp->prevrule==0 ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+"There is not prior rule opon which to attach the code \
+fragment which begins on this line.");
+ psp->errorcnt++;
+ }else if( psp->prevrule->code!=0 ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+"Code fragment beginning on this line is not the first \
+to follow the previous rule.");
+ psp->errorcnt++;
+ }else{
+ psp->prevrule->line = psp->tokenlineno;
+ psp->prevrule->code = &x[1];
+ }
+ }else if( x[0]=='[' ){
+ psp->state = PRECEDENCE_MARK_1;
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Token \"%s\" should be either \"%%\" or a nonterminal name.",
+ x);
+ psp->errorcnt++;
+ }
+ break;
+ case PRECEDENCE_MARK_1:
+ if( !isupper(x[0]) ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "The precedence symbol must be a terminal.");
+ psp->errorcnt++;
+ }else if( psp->prevrule==0 ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "There is no prior rule to assign precedence \"[%s]\".",x);
+ psp->errorcnt++;
+ }else if( psp->prevrule->precsym!=0 ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+"Precedence mark on this line is not the first \
+to follow the previous rule.");
+ psp->errorcnt++;
+ }else{
+ psp->prevrule->precsym = Symbol_new(x);
+ }
+ psp->state = PRECEDENCE_MARK_2;
+ break;
+ case PRECEDENCE_MARK_2:
+ if( x[0]!=']' ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Missing \"]\" on precedence mark.");
+ psp->errorcnt++;
+ }
+ psp->state = WAITING_FOR_DECL_OR_RULE;
+ break;
+ case WAITING_FOR_ARROW:
+ if( x[0]==':' && x[1]==':' && x[2]=='=' ){
+ psp->state = IN_RHS;
+ }else if( x[0]=='(' ){
+ psp->state = LHS_ALIAS_1;
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Expected to see a \":\" following the LHS symbol \"%s\".",
+ psp->lhs->name);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_RULE_ERROR;
+ }
+ break;
+ case LHS_ALIAS_1:
+ if( isalpha(x[0]) ){
+ psp->lhsalias = x;
+ psp->state = LHS_ALIAS_2;
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "\"%s\" is not a valid alias for the LHS \"%s\"\n",
+ x,psp->lhs->name);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_RULE_ERROR;
+ }
+ break;
+ case LHS_ALIAS_2:
+ if( x[0]==')' ){
+ psp->state = LHS_ALIAS_3;
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Missing \")\" following LHS alias name \"%s\".",psp->lhsalias);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_RULE_ERROR;
+ }
+ break;
+ case LHS_ALIAS_3:
+ if( x[0]==':' && x[1]==':' && x[2]=='=' ){
+ psp->state = IN_RHS;
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Missing \"->\" following: \"%s(%s)\".",
+ psp->lhs->name,psp->lhsalias);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_RULE_ERROR;
+ }
+ break;
+ case IN_RHS:
+ if( x[0]=='.' ){
+ struct rule *rp;
+ rp = (struct rule *)malloc( sizeof(struct rule) +
+ sizeof(struct symbol*)*psp->nrhs + sizeof(char*)*psp->nrhs );
+ if( rp==0 ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Can't allocate enough memory for this rule.");
+ psp->errorcnt++;
+ psp->prevrule = 0;
+ }else{
+ int i;
+ rp->ruleline = psp->tokenlineno;
+ rp->rhs = (struct symbol**)&rp[1];
+ rp->rhsalias = (char**)&(rp->rhs[psp->nrhs]);
+ for(i=0; i<psp->nrhs; i++){
+ rp->rhs[i] = psp->rhs[i];
+ rp->rhsalias[i] = psp->alias[i];
+ }
+ rp->lhs = psp->lhs;
+ rp->lhsalias = psp->lhsalias;
+ rp->nrhs = psp->nrhs;
+ rp->code = 0;
+ rp->precsym = 0;
+ rp->index = psp->gp->nrule++;
+ rp->nextlhs = rp->lhs->rule;
+ rp->lhs->rule = rp;
+ rp->next = 0;
+ if( psp->firstrule==0 ){
+ psp->firstrule = psp->lastrule = rp;
+ }else{
+ psp->lastrule->next = rp;
+ psp->lastrule = rp;
+ }
+ psp->prevrule = rp;
+ }
+ psp->state = WAITING_FOR_DECL_OR_RULE;
+ }else if( isalpha(x[0]) ){
+ if( psp->nrhs>=MAXRHS ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Too many symbol on RHS or rule beginning at \"%s\".",
+ x);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_RULE_ERROR;
+ }else{
+ psp->rhs[psp->nrhs] = Symbol_new(x);
+ psp->alias[psp->nrhs] = 0;
+ psp->nrhs++;
+ }
+ }else if( x[0]=='(' && psp->nrhs>0 ){
+ psp->state = RHS_ALIAS_1;
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Illegal character on RHS of rule: \"%s\".",x);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_RULE_ERROR;
+ }
+ break;
+ case RHS_ALIAS_1:
+ if( isalpha(x[0]) ){
+ psp->alias[psp->nrhs-1] = x;
+ psp->state = RHS_ALIAS_2;
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "\"%s\" is not a valid alias for the RHS symbol \"%s\"\n",
+ x,psp->rhs[psp->nrhs-1]->name);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_RULE_ERROR;
+ }
+ break;
+ case RHS_ALIAS_2:
+ if( x[0]==')' ){
+ psp->state = IN_RHS;
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Missing \")\" following LHS alias name \"%s\".",psp->lhsalias);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_RULE_ERROR;
+ }
+ break;
+ case WAITING_FOR_DECL_KEYWORD:
+ if( isalpha(x[0]) ){
+ psp->declkeyword = x;
+ psp->declargslot = 0;
+ psp->decllnslot = 0;
+ psp->state = WAITING_FOR_DECL_ARG;
+ if( strcmp(x,"name")==0 ){
+ psp->declargslot = &(psp->gp->name);
+ }else if( strcmp(x,"include")==0 ){
+ psp->declargslot = &(psp->gp->include);
+ psp->decllnslot = &psp->gp->includeln;
+ }else if( strcmp(x,"code")==0 ){
+ psp->declargslot = &(psp->gp->extracode);
+ psp->decllnslot = &psp->gp->extracodeln;
+ }else if( strcmp(x,"token_destructor")==0 ){
+ psp->declargslot = &psp->gp->tokendest;
+ psp->decllnslot = &psp->gp->tokendestln;
+ }else if( strcmp(x,"default_destructor")==0 ){
+ psp->declargslot = &psp->gp->vardest;
+ psp->decllnslot = &psp->gp->vardestln;
+ }else if( strcmp(x,"token_prefix")==0 ){
+ psp->declargslot = &psp->gp->tokenprefix;
+ }else if( strcmp(x,"syntax_error")==0 ){
+ psp->declargslot = &(psp->gp->error);
+ psp->decllnslot = &psp->gp->errorln;
+ }else if( strcmp(x,"parse_accept")==0 ){
+ psp->declargslot = &(psp->gp->accept);
+ psp->decllnslot = &psp->gp->acceptln;
+ }else if( strcmp(x,"parse_failure")==0 ){
+ psp->declargslot = &(psp->gp->failure);
+ psp->decllnslot = &psp->gp->failureln;
+ }else if( strcmp(x,"stack_overflow")==0 ){
+ psp->declargslot = &(psp->gp->overflow);
+ psp->decllnslot = &psp->gp->overflowln;
+ }else if( strcmp(x,"extra_argument")==0 ){
+ psp->declargslot = &(psp->gp->arg);
+ }else if( strcmp(x,"token_type")==0 ){
+ psp->declargslot = &(psp->gp->tokentype);
+ }else if( strcmp(x,"default_type")==0 ){
+ psp->declargslot = &(psp->gp->vartype);
+ }else if( strcmp(x,"stack_size")==0 ){
+ psp->declargslot = &(psp->gp->stacksize);
+ }else if( strcmp(x,"start_symbol")==0 ){
+ psp->declargslot = &(psp->gp->start);
+ }else if( strcmp(x,"left")==0 ){
+ psp->preccounter++;
+ psp->declassoc = LEFT;
+ psp->state = WAITING_FOR_PRECEDENCE_SYMBOL;
+ }else if( strcmp(x,"right")==0 ){
+ psp->preccounter++;
+ psp->declassoc = RIGHT;
+ psp->state = WAITING_FOR_PRECEDENCE_SYMBOL;
+ }else if( strcmp(x,"nonassoc")==0 ){
+ psp->preccounter++;
+ psp->declassoc = NONE;
+ psp->state = WAITING_FOR_PRECEDENCE_SYMBOL;
+ }else if( strcmp(x,"destructor")==0 ){
+ psp->state = WAITING_FOR_DESTRUCTOR_SYMBOL;
+ }else if( strcmp(x,"type")==0 ){
+ psp->state = WAITING_FOR_DATATYPE_SYMBOL;
+ }else if( strcmp(x,"fallback")==0 ){
+ psp->fallback = 0;
+ psp->state = WAITING_FOR_FALLBACK_ID;
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Unknown declaration keyword: \"%%%s\".",x);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_DECL_ERROR;
+ }
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Illegal declaration keyword: \"%s\".",x);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_DECL_ERROR;
+ }
+ break;
+ case WAITING_FOR_DESTRUCTOR_SYMBOL:
+ if( !isalpha(x[0]) ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Symbol name missing after %destructor keyword");
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_DECL_ERROR;
+ }else{
+ struct symbol *sp = Symbol_new(x);
+ psp->declargslot = &sp->destructor;
+ psp->decllnslot = &sp->destructorln;
+ psp->state = WAITING_FOR_DECL_ARG;
+ }
+ break;
+ case WAITING_FOR_DATATYPE_SYMBOL:
+ if( !isalpha(x[0]) ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Symbol name missing after %destructor keyword");
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_DECL_ERROR;
+ }else{
+ struct symbol *sp = Symbol_new(x);
+ psp->declargslot = &sp->datatype;
+ psp->decllnslot = 0;
+ psp->state = WAITING_FOR_DECL_ARG;
+ }
+ break;
+ case WAITING_FOR_PRECEDENCE_SYMBOL:
+ if( x[0]=='.' ){
+ psp->state = WAITING_FOR_DECL_OR_RULE;
+ }else if( isupper(x[0]) ){
+ struct symbol *sp;
+ sp = Symbol_new(x);
+ if( sp->prec>=0 ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Symbol \"%s\" has already be given a precedence.",x);
+ psp->errorcnt++;
+ }else{
+ sp->prec = psp->preccounter;
+ sp->assoc = psp->declassoc;
+ }
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Can't assign a precedence to \"%s\".",x);
+ psp->errorcnt++;
+ }
+ break;
+ case WAITING_FOR_DECL_ARG:
+ if( (x[0]=='{' || x[0]=='\"' || isalnum(x[0])) ){
+ if( *(psp->declargslot)!=0 ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "The argument \"%s\" to declaration \"%%%s\" is not the first.",
+ x[0]=='\"' ? &x[1] : x,psp->declkeyword);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_DECL_ERROR;
+ }else{
+ *(psp->declargslot) = (x[0]=='\"' || x[0]=='{') ? &x[1] : x;
+ if( psp->decllnslot ) *psp->decllnslot = psp->tokenlineno;
+ psp->state = WAITING_FOR_DECL_OR_RULE;
+ }
+ }else{
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Illegal argument to %%%s: %s",psp->declkeyword,x);
+ psp->errorcnt++;
+ psp->state = RESYNC_AFTER_DECL_ERROR;
+ }
+ break;
+ case WAITING_FOR_FALLBACK_ID:
+ if( x[0]=='.' ){
+ psp->state = WAITING_FOR_DECL_OR_RULE;
+ }else if( !isupper(x[0]) ){
+ ErrorMsg(psp->filename, psp->tokenlineno,
+ "%%fallback argument \"%s\" should be a token", x);
+ psp->errorcnt++;
+ }else{
+ struct symbol *sp = Symbol_new(x);
+ if( psp->fallback==0 ){
+ psp->fallback = sp;
+ }else if( sp->fallback ){
+ ErrorMsg(psp->filename, psp->tokenlineno,
+ "More than one fallback assigned to token %s", x);
+ psp->errorcnt++;
+ }else{
+ sp->fallback = psp->fallback;
+ psp->gp->has_fallback = 1;
+ }
+ }
+ break;
+ case RESYNC_AFTER_RULE_ERROR:
+/* if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE;
+** break; */
+ case RESYNC_AFTER_DECL_ERROR:
+ if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE;
+ if( x[0]=='%' ) psp->state = WAITING_FOR_DECL_KEYWORD;
+ break;
+ }
+}
+
+/* Run the proprocessor over the input file text. The global variables
+** azDefine[0] through azDefine[nDefine-1] contains the names of all defined
+** macros. This routine looks for "%ifdef" and "%ifndef" and "%endif" and
+** comments them out. Text in between is also commented out as appropriate.
+*/
+static void preprocess_input(char *z){
+ int i, j, k, n;
+ int exclude = 0;
+ int start;
+ int lineno = 1;
+ int start_lineno;
+ for(i=0; z[i]; i++){
+ if( z[i]=='\n' ) lineno++;
+ if( z[i]!='%' || (i>0 && z[i-1]!='\n') ) continue;
+ if( strncmp(&z[i],"%endif",6)==0 && isspace(z[i+6]) ){
+ if( exclude ){
+ exclude--;
+ if( exclude==0 ){
+ for(j=start; j<i; j++) if( z[j]!='\n' ) z[j] = ' ';
+ }
+ }
+ for(j=i; z[j] && z[j]!='\n'; j++) z[j] = ' ';
+ }else if( (strncmp(&z[i],"%ifdef",6)==0 && isspace(z[i+6]))
+ || (strncmp(&z[i],"%ifndef",7)==0 && isspace(z[i+7])) ){
+ if( exclude ){
+ exclude++;
+ }else{
+ for(j=i+7; isspace(z[j]); j++){}
+ for(n=0; z[j+n] && !isspace(z[j+n]); n++){}
+ exclude = 1;
+ for(k=0; k<nDefine; k++){
+ if( strncmp(azDefine[k],&z[j],n)==0 && strlen(azDefine[k])==n ){
+ exclude = 0;
+ break;
+ }
+ }
+ if( z[i+3]=='n' ) exclude = !exclude;
+ if( exclude ){
+ start = i;
+ start_lineno = lineno;
+ }
+ }
+ for(j=i; z[j] && z[j]!='\n'; j++) z[j] = ' ';
+ }
+ }
+ if( exclude ){
+ fprintf(stderr,"unterminated %%ifdef starting on line %d\n", start_lineno);
+ exit(1);
+ }
+}
+
+/* In spite of its name, this function is really a scanner. It read
+** in the entire input file (all at once) then tokenizes it. Each
+** token is passed to the function "parseonetoken" which builds all
+** the appropriate data structures in the global state vector "gp".
+*/
+void Parse(gp)
+struct lemon *gp;
+{
+ struct pstate ps;
+ FILE *fp;
+ char *filebuf;
+ int filesize;
+ int lineno;
+ int c;
+ char *cp, *nextcp;
+ int startline = 0;
+
+ ps.gp = gp;
+ ps.filename = gp->filename;
+ ps.errorcnt = 0;
+ ps.state = INITIALIZE;
+
+ /* Begin by reading the input file */
+ fp = fopen(ps.filename,"rb");
+ if( fp==0 ){
+ ErrorMsg(ps.filename,0,"Can't open this file for reading.");
+ gp->errorcnt++;
+ return;
+ }
+ fseek(fp,0,2);
+ filesize = ftell(fp);
+ rewind(fp);
+ filebuf = (char *)malloc( filesize+1 );
+ if( filebuf==0 ){
+ ErrorMsg(ps.filename,0,"Can't allocate %d of memory to hold this file.",
+ filesize+1);
+ gp->errorcnt++;
+ return;
+ }
+ if( fread(filebuf,1,filesize,fp)!=filesize ){
+ ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.",
+ filesize);
+ free(filebuf);
+ gp->errorcnt++;
+ return;
+ }
+ fclose(fp);
+ filebuf[filesize] = 0;
+
+ /* Make an initial pass through the file to handle %ifdef and %ifndef */
+ preprocess_input(filebuf);
+
+ /* Now scan the text of the input file */
+ lineno = 1;
+ for(cp=filebuf; (c= *cp)!=0; ){
+ if( c=='\n' ) lineno++; /* Keep track of the line number */
+ if( isspace(c) ){ cp++; continue; } /* Skip all white space */
+ if( c=='/' && cp[1]=='/' ){ /* Skip C++ style comments */
+ cp+=2;
+ while( (c= *cp)!=0 && c!='\n' ) cp++;
+ continue;
+ }
+ if( c=='/' && cp[1]=='*' ){ /* Skip C style comments */
+ cp+=2;
+ while( (c= *cp)!=0 && (c!='/' || cp[-1]!='*') ){
+ if( c=='\n' ) lineno++;
+ cp++;
+ }
+ if( c ) cp++;
+ continue;
+ }
+ ps.tokenstart = cp; /* Mark the beginning of the token */
+ ps.tokenlineno = lineno; /* Linenumber on which token begins */
+ if( c=='\"' ){ /* String literals */
+ cp++;
+ while( (c= *cp)!=0 && c!='\"' ){
+ if( c=='\n' ) lineno++;
+ cp++;
+ }
+ if( c==0 ){
+ ErrorMsg(ps.filename,startline,
+"String starting on this line is not terminated before the end of the file.");
+ ps.errorcnt++;
+ nextcp = cp;
+ }else{
+ nextcp = cp+1;
+ }
+ }else if( c=='{' ){ /* A block of C code */
+ int level;
+ cp++;
+ for(level=1; (c= *cp)!=0 && (level>1 || c!='}'); cp++){
+ if( c=='\n' ) lineno++;
+ else if( c=='{' ) level++;
+ else if( c=='}' ) level--;
+ else if( c=='/' && cp[1]=='*' ){ /* Skip comments */
+ int prevc;
+ cp = &cp[2];
+ prevc = 0;
+ while( (c= *cp)!=0 && (c!='/' || prevc!='*') ){
+ if( c=='\n' ) lineno++;
+ prevc = c;
+ cp++;
+ }
+ }else if( c=='/' && cp[1]=='/' ){ /* Skip C++ style comments too */
+ cp = &cp[2];
+ while( (c= *cp)!=0 && c!='\n' ) cp++;
+ if( c ) lineno++;
+ }else if( c=='\'' || c=='\"' ){ /* String a character literals */
+ int startchar, prevc;
+ startchar = c;
+ prevc = 0;
+ for(cp++; (c= *cp)!=0 && (c!=startchar || prevc=='\\'); cp++){
+ if( c=='\n' ) lineno++;
+ if( prevc=='\\' ) prevc = 0;
+ else prevc = c;
+ }
+ }
+ }
+ if( c==0 ){
+ ErrorMsg(ps.filename,ps.tokenlineno,
+"C code starting on this line is not terminated before the end of the file.");
+ ps.errorcnt++;
+ nextcp = cp;
+ }else{
+ nextcp = cp+1;
+ }
+ }else if( isalnum(c) ){ /* Identifiers */
+ while( (c= *cp)!=0 && (isalnum(c) || c=='_') ) cp++;
+ nextcp = cp;
+ }else if( c==':' && cp[1]==':' && cp[2]=='=' ){ /* The operator "::=" */
+ cp += 3;
+ nextcp = cp;
+ }else{ /* All other (one character) operators */
+ cp++;
+ nextcp = cp;
+ }
+ c = *cp;
+ *cp = 0; /* Null terminate the token */
+ parseonetoken(&ps); /* Parse the token */
+ *cp = c; /* Restore the buffer */
+ cp = nextcp;
+ }
+ free(filebuf); /* Release the buffer after parsing */
+ gp->rule = ps.firstrule;
+ gp->errorcnt = ps.errorcnt;
+}
+/*************************** From the file "plink.c" *********************/
+/*
+** Routines processing configuration follow-set propagation links
+** in the LEMON parser generator.
+*/
+static struct plink *plink_freelist = 0;
+
+/* Allocate a new plink */
+struct plink *Plink_new(){
+ struct plink *new;
+
+ if( plink_freelist==0 ){
+ int i;
+ int amt = 100;
+ plink_freelist = (struct plink *)malloc( sizeof(struct plink)*amt );
+ if( plink_freelist==0 ){
+ fprintf(stderr,
+ "Unable to allocate memory for a new follow-set propagation link.\n");
+ exit(1);
+ }
+ for(i=0; i<amt-1; i++) plink_freelist[i].next = &plink_freelist[i+1];
+ plink_freelist[amt-1].next = 0;
+ }
+ new = plink_freelist;
+ plink_freelist = plink_freelist->next;
+ return new;
+}
+
+/* Add a plink to a plink list */
+void Plink_add(plpp,cfp)
+struct plink **plpp;
+struct config *cfp;
+{
+ struct plink *new;
+ new = Plink_new();
+ new->next = *plpp;
+ *plpp = new;
+ new->cfp = cfp;
+}
+
+/* Transfer every plink on the list "from" to the list "to" */
+void Plink_copy(to,from)
+struct plink **to;
+struct plink *from;
+{
+ struct plink *nextpl;
+ while( from ){
+ nextpl = from->next;
+ from->next = *to;
+ *to = from;
+ from = nextpl;
+ }
+}
+
+/* Delete every plink on the list */
+void Plink_delete(plp)
+struct plink *plp;
+{
+ struct plink *nextpl;
+
+ while( plp ){
+ nextpl = plp->next;
+ plp->next = plink_freelist;
+ plink_freelist = plp;
+ plp = nextpl;
+ }
+}
+/*********************** From the file "report.c" **************************/
+/*
+** Procedures for generating reports and tables in the LEMON parser generator.
+*/
+
+/* Generate a filename with the given suffix. Space to hold the
+** name comes from malloc() and must be freed by the calling
+** function.
+*/
+PRIVATE char *file_makename(lemp,suffix)
+struct lemon *lemp;
+char *suffix;
+{
+ char *name;
+ char *cp;
+
+ name = malloc( strlen(lemp->filename) + strlen(suffix) + 5 );
+ if( name==0 ){
+ fprintf(stderr,"Can't allocate space for a filename.\n");
+ exit(1);
+ }
+ strcpy(name,lemp->filename);
+ cp = strrchr(name,'.');
+ if( cp ) *cp = 0;
+ strcat(name,suffix);
+ return name;
+}
+
+/* Open a file with a name based on the name of the input file,
+** but with a different (specified) suffix, and return a pointer
+** to the stream */
+PRIVATE FILE *file_open(lemp,suffix,mode)
+struct lemon *lemp;
+char *suffix;
+char *mode;
+{
+ FILE *fp;
+
+ if( lemp->outname ) free(lemp->outname);
+ lemp->outname = file_makename(lemp, suffix);
+ fp = fopen(lemp->outname,mode);
+ if( fp==0 && *mode=='w' ){
+ fprintf(stderr,"Can't open file \"%s\".\n",lemp->outname);
+ lemp->errorcnt++;
+ return 0;
+ }
+ return fp;
+}
+
+/* Duplicate the input file without comments and without actions
+** on rules */
+void Reprint(lemp)
+struct lemon *lemp;
+{
+ struct rule *rp;
+ struct symbol *sp;
+ int i, j, maxlen, len, ncolumns, skip;
+ printf("// Reprint of input file \"%s\".\n// Symbols:\n",lemp->filename);
+ maxlen = 10;
+ for(i=0; i<lemp->nsymbol; i++){
+ sp = lemp->symbols[i];
+ len = strlen(sp->name);
+ if( len>maxlen ) maxlen = len;
+ }
+ ncolumns = 76/(maxlen+5);
+ if( ncolumns<1 ) ncolumns = 1;
+ skip = (lemp->nsymbol + ncolumns - 1)/ncolumns;
+ for(i=0; i<skip; i++){
+ printf("//");
+ for(j=i; j<lemp->nsymbol; j+=skip){
+ sp = lemp->symbols[j];
+ assert( sp->index==j );
+ printf(" %3d %-*.*s",j,maxlen,maxlen,sp->name);
+ }
+ printf("\n");
+ }
+ for(rp=lemp->rule; rp; rp=rp->next){
+ printf("%s",rp->lhs->name);
+/* if( rp->lhsalias ) printf("(%s)",rp->lhsalias); */
+ printf(" ::=");
+ for(i=0; i<rp->nrhs; i++){
+ printf(" %s",rp->rhs[i]->name);
+/* if( rp->rhsalias[i] ) printf("(%s)",rp->rhsalias[i]); */
+ }
+ printf(".");
+ if( rp->precsym ) printf(" [%s]",rp->precsym->name);
+/* if( rp->code ) printf("\n %s",rp->code); */
+ printf("\n");
+ }
+}
+
+void ConfigPrint(fp,cfp)
+FILE *fp;
+struct config *cfp;
+{
+ struct rule *rp;
+ int i;
+ rp = cfp->rp;
+ fprintf(fp,"%s ::=",rp->lhs->name);
+ for(i=0; i<=rp->nrhs; i++){
+ if( i==cfp->dot ) fprintf(fp," *");
+ if( i==rp->nrhs ) break;
+ fprintf(fp," %s",rp->rhs[i]->name);
+ }
+}
+
+/* #define TEST */
+#ifdef TEST
+/* Print a set */
+PRIVATE void SetPrint(out,set,lemp)
+FILE *out;
+char *set;
+struct lemon *lemp;
+{
+ int i;
+ char *spacer;
+ spacer = "";
+ fprintf(out,"%12s[","");
+ for(i=0; i<lemp->nterminal; i++){
+ if( SetFind(set,i) ){
+ fprintf(out,"%s%s",spacer,lemp->symbols[i]->name);
+ spacer = " ";
+ }
+ }
+ fprintf(out,"]\n");
+}
+
+/* Print a plink chain */
+PRIVATE void PlinkPrint(out,plp,tag)
+FILE *out;
+struct plink *plp;
+char *tag;
+{
+ while( plp ){
+ fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->index);
+ ConfigPrint(out,plp->cfp);
+ fprintf(out,"\n");
+ plp = plp->next;
+ }
+}
+#endif
+
+/* Print an action to the given file descriptor. Return FALSE if
+** nothing was actually printed.
+*/
+int PrintAction(struct action *ap, FILE *fp, int indent){
+ int result = 1;
+ switch( ap->type ){
+ case SHIFT:
+ fprintf(fp,"%*s shift %d",indent,ap->sp->name,ap->x.stp->index);
+ break;
+ case REDUCE:
+ fprintf(fp,"%*s reduce %d",indent,ap->sp->name,ap->x.rp->index);
+ break;
+ case ACCEPT:
+ fprintf(fp,"%*s accept",indent,ap->sp->name);
+ break;
+ case ERROR:
+ fprintf(fp,"%*s error",indent,ap->sp->name);
+ break;
+ case CONFLICT:
+ fprintf(fp,"%*s reduce %-3d ** Parsing conflict **",
+ indent,ap->sp->name,ap->x.rp->index);
+ break;
+ case SH_RESOLVED:
+ case RD_RESOLVED:
+ case NOT_USED:
+ result = 0;
+ break;
+ }
+ return result;
+}
+
+/* Generate the "y.output" log file */
+void ReportOutput(lemp)
+struct lemon *lemp;
+{
+ int i;
+ struct state *stp;
+ struct config *cfp;
+ struct action *ap;
+ FILE *fp;
+
+ fp = file_open(lemp,".out","wb");
+ if( fp==0 ) return;
+ fprintf(fp," \b");
+ for(i=0; i<lemp->nstate; i++){
+ stp = lemp->sorted[i];
+ fprintf(fp,"State %d:\n",stp->index);
+ if( lemp->basisflag ) cfp=stp->bp;
+ else cfp=stp->cfp;
+ while( cfp ){
+ char buf[20];
+ if( cfp->dot==cfp->rp->nrhs ){
+ sprintf(buf,"(%d)",cfp->rp->index);
+ fprintf(fp," %5s ",buf);
+ }else{
+ fprintf(fp," ");
+ }
+ ConfigPrint(fp,cfp);
+ fprintf(fp,"\n");
+#ifdef TEST
+ SetPrint(fp,cfp->fws,lemp);
+ PlinkPrint(fp,cfp->fplp,"To ");
+ PlinkPrint(fp,cfp->bplp,"From");
+#endif
+ if( lemp->basisflag ) cfp=cfp->bp;
+ else cfp=cfp->next;
+ }
+ fprintf(fp,"\n");
+ for(ap=stp->ap; ap; ap=ap->next){
+ if( PrintAction(ap,fp,30) ) fprintf(fp,"\n");
+ }
+ fprintf(fp,"\n");
+ }
+ fclose(fp);
+ return;
+}
+
+/* Search for the file "name" which is in the same directory as
+** the exacutable */
+PRIVATE char *pathsearch(argv0,name,modemask)
+char *argv0;
+char *name;
+int modemask;
+{
+ char *pathlist;
+ char *path,*cp;
+ char c;
+ extern int access();
+
+#ifdef __WIN32__
+ cp = strrchr(argv0,'\\');
+#else
+ cp = strrchr(argv0,'/');
+#endif
+ if( cp ){
+ c = *cp;
+ *cp = 0;
+ path = (char *)malloc( strlen(argv0) + strlen(name) + 2 );
+ if( path ) sprintf(path,"%s/%s",argv0,name);
+ *cp = c;
+ }else{
+ extern char *getenv();
+ pathlist = getenv("PATH");
+ if( pathlist==0 ) pathlist = ".:/bin:/usr/bin";
+ path = (char *)malloc( strlen(pathlist)+strlen(name)+2 );
+ if( path!=0 ){
+ while( *pathlist ){
+ cp = strchr(pathlist,':');
+ if( cp==0 ) cp = &pathlist[strlen(pathlist)];
+ c = *cp;
+ *cp = 0;
+ sprintf(path,"%s/%s",pathlist,name);
+ *cp = c;
+ if( c==0 ) pathlist = "";
+ else pathlist = &cp[1];
+ if( access(path,modemask)==0 ) break;
+ }
+ }
+ }
+ return path;
+}
+
+/* Given an action, compute the integer value for that action
+** which is to be put in the action table of the generated machine.
+** Return negative if no action should be generated.
+*/
+PRIVATE int compute_action(lemp,ap)
+struct lemon *lemp;
+struct action *ap;
+{
+ int act;
+ switch( ap->type ){
+ case SHIFT: act = ap->x.stp->index; break;
+ case REDUCE: act = ap->x.rp->index + lemp->nstate; break;
+ case ERROR: act = lemp->nstate + lemp->nrule; break;
+ case ACCEPT: act = lemp->nstate + lemp->nrule + 1; break;
+ default: act = -1; break;
+ }
+ return act;
+}
+
+#define LINESIZE 1000
+/* The next cluster of routines are for reading the template file
+** and writing the results to the generated parser */
+/* The first function transfers data from "in" to "out" until
+** a line is seen which begins with "%%". The line number is
+** tracked.
+**
+** if name!=0, then any word that begin with "Parse" is changed to
+** begin with *name instead.
+*/
+PRIVATE void tplt_xfer(name,in,out,lineno)
+char *name;
+FILE *in;
+FILE *out;
+int *lineno;
+{
+ int i, iStart;
+ char line[LINESIZE];
+ while( fgets(line,LINESIZE,in) && (line[0]!='%' || line[1]!='%') ){
+ (*lineno)++;
+ iStart = 0;
+ if( name ){
+ for(i=0; line[i]; i++){
+ if( line[i]=='P' && strncmp(&line[i],"Parse",5)==0
+ && (i==0 || !isalpha(line[i-1]))
+ ){
+ if( i>iStart ) fprintf(out,"%.*s",i-iStart,&line[iStart]);
+ fprintf(out,"%s",name);
+ i += 4;
+ iStart = i+1;
+ }
+ }
+ }
+ fprintf(out,"%s",&line[iStart]);
+ }
+}
+
+/* The next function finds the template file and opens it, returning
+** a pointer to the opened file. */
+PRIVATE FILE *tplt_open(lemp)
+struct lemon *lemp;
+{
+ static char templatename[] = "lempar.c";
+ char buf[1000];
+ FILE *in;
+ char *tpltname;
+ char *cp;
+
+ cp = strrchr(lemp->filename,'.');
+ if( cp ){
+ sprintf(buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename);
+ }else{
+ sprintf(buf,"%s.lt",lemp->filename);
+ }
+ if( access(buf,004)==0 ){
+ tpltname = buf;
+ }else if( access(templatename,004)==0 ){
+ tpltname = templatename;
+ }else{
+ tpltname = pathsearch(lemp->argv0,templatename,0);
+ }
+ if( tpltname==0 ){
+ fprintf(stderr,"Can't find the parser driver template file \"%s\".\n",
+ templatename);
+ lemp->errorcnt++;
+ return 0;
+ }
+ in = fopen(tpltname,"rb");
+ if( in==0 ){
+ fprintf(stderr,"Can't open the template file \"%s\".\n",templatename);
+ lemp->errorcnt++;
+ return 0;
+ }
+ return in;
+}
+
+/* Print a #line directive line to the output file. */
+PRIVATE void tplt_linedir(out,lineno,filename)
+FILE *out;
+int lineno;
+char *filename;
+{
+ fprintf(out,"#line %d \"",lineno);
+ while( *filename ){
+ if( *filename == '\\' ) putc('\\',out);
+ putc(*filename,out);
+ filename++;
+ }
+ fprintf(out,"\"\n");
+}
+
+/* Print a string to the file and keep the linenumber up to date */
+PRIVATE void tplt_print(out,lemp,str,strln,lineno)
+FILE *out;
+struct lemon *lemp;
+char *str;
+int strln;
+int *lineno;
+{
+ if( str==0 ) return;
+ tplt_linedir(out,strln,lemp->filename);
+ (*lineno)++;
+ while( *str ){
+ if( *str=='\n' ) (*lineno)++;
+ putc(*str,out);
+ str++;
+ }
+ if( str[-1]!='\n' ){
+ putc('\n',out);
+ (*lineno)++;
+ }
+ tplt_linedir(out,*lineno+2,lemp->outname);
+ (*lineno)+=2;
+ return;
+}
+
+/*
+** The following routine emits code for the destructor for the
+** symbol sp
+*/
+void emit_destructor_code(out,sp,lemp,lineno)
+FILE *out;
+struct symbol *sp;
+struct lemon *lemp;
+int *lineno;
+{
+ char *cp = 0;
+
+ int linecnt = 0;
+ if( sp->type==TERMINAL ){
+ cp = lemp->tokendest;
+ if( cp==0 ) return;
+ tplt_linedir(out,lemp->tokendestln,lemp->filename);
+ fprintf(out,"{");
+ }else if( sp->destructor ){
+ cp = sp->destructor;
+ tplt_linedir(out,sp->destructorln,lemp->filename);
+ fprintf(out,"{");
+ }else if( lemp->vardest ){
+ cp = lemp->vardest;
+ if( cp==0 ) return;
+ tplt_linedir(out,lemp->vardestln,lemp->filename);
+ fprintf(out,"{");
+ }else{
+ assert( 0 ); /* Cannot happen */
+ }
+ for(; *cp; cp++){
+ if( *cp=='$' && cp[1]=='$' ){
+ fprintf(out,"(yypminor->yy%d)",sp->dtnum);
+ cp++;
+ continue;
+ }
+ if( *cp=='\n' ) linecnt++;
+ fputc(*cp,out);
+ }
+ (*lineno) += 3 + linecnt;
+ fprintf(out,"}\n");
+ tplt_linedir(out,*lineno,lemp->outname);
+ return;
+}
+
+/*
+** Return TRUE (non-zero) if the given symbol has a destructor.
+*/
+int has_destructor(sp, lemp)
+struct symbol *sp;
+struct lemon *lemp;
+{
+ int ret;
+ if( sp->type==TERMINAL ){
+ ret = lemp->tokendest!=0;
+ }else{
+ ret = lemp->vardest!=0 || sp->destructor!=0;
+ }
+ return ret;
+}
+
+/*
+** Append text to a dynamically allocated string. If zText is 0 then
+** reset the string to be empty again. Always return the complete text
+** of the string (which is overwritten with each call).
+**
+** n bytes of zText are stored. If n==0 then all of zText up to the first
+** \000 terminator is stored. zText can contain up to two instances of
+** %d. The values of p1 and p2 are written into the first and second
+** %d.
+**
+** If n==-1, then the previous character is overwritten.
+*/
+PRIVATE char *append_str(char *zText, int n, int p1, int p2){
+ static char *z = 0;
+ static int alloced = 0;
+ static int used = 0;
+ int c;
+ char zInt[40];
+
+ if( zText==0 ){
+ used = 0;
+ return z;
+ }
+ if( n<=0 ){
+ if( n<0 ){
+ used += n;
+ assert( used>=0 );
+ }
+ n = strlen(zText);
+ }
+ if( n+sizeof(zInt)*2+used >= alloced ){
+ alloced = n + sizeof(zInt)*2 + used + 200;
+ z = realloc(z, alloced);
+ }
+ if( z==0 ) return "";
+ while( n-- > 0 ){
+ c = *(zText++);
+ if( c=='%' && zText[0]=='d' ){
+ sprintf(zInt, "%d", p1);
+ p1 = p2;
+ strcpy(&z[used], zInt);
+ used += strlen(&z[used]);
+ zText++;
+ n--;
+ }else{
+ z[used++] = c;
+ }
+ }
+ z[used] = 0;
+ return z;
+}
+
+/*
+** zCode is a string that is the action associated with a rule. Expand
+** the symbols in this string so that the refer to elements of the parser
+** stack.
+*/
+PRIVATE void translate_code(struct lemon *lemp, struct rule *rp){
+ char *cp, *xp;
+ int i;
+ char lhsused = 0; /* True if the LHS element has been used */
+ char used[MAXRHS]; /* True for each RHS element which is used */
+
+ for(i=0; i<rp->nrhs; i++) used[i] = 0;
+ lhsused = 0;
+
+ append_str(0,0,0,0);
+ for(cp=rp->code; *cp; cp++){
+ if( isalpha(*cp) && (cp==rp->code || (!isalnum(cp[-1]) && cp[-1]!='_')) ){
+ char saved;
+ for(xp= &cp[1]; isalnum(*xp) || *xp=='_'; xp++);
+ saved = *xp;
+ *xp = 0;
+ if( rp->lhsalias && strcmp(cp,rp->lhsalias)==0 ){
+ append_str("yygotominor.yy%d",0,rp->lhs->dtnum,0);
+ cp = xp;
+ lhsused = 1;
+ }else{
+ for(i=0; i<rp->nrhs; i++){
+ if( rp->rhsalias[i] && strcmp(cp,rp->rhsalias[i])==0 ){
+ if( cp!=rp->code && cp[-1]=='@' ){
+ /* If the argument is of the form @X then substituted
+ ** the token number of X, not the value of X */
+ append_str("yymsp[%d].major",-1,i-rp->nrhs+1,0);
+ }else{
+ append_str("yymsp[%d].minor.yy%d",0,
+ i-rp->nrhs+1,rp->rhs[i]->dtnum);
+ }
+ cp = xp;
+ used[i] = 1;
+ break;
+ }
+ }
+ }
+ *xp = saved;
+ }
+ append_str(cp, 1, 0, 0);
+ } /* End loop */
+
+ /* Check to make sure the LHS has been used */
+ if( rp->lhsalias && !lhsused ){
+ ErrorMsg(lemp->filename,rp->ruleline,
+ "Label \"%s\" for \"%s(%s)\" is never used.",
+ rp->lhsalias,rp->lhs->name,rp->lhsalias);
+ lemp->errorcnt++;
+ }
+
+ /* Generate destructor code for RHS symbols which are not used in the
+ ** reduce code */
+ for(i=0; i<rp->nrhs; i++){
+ if( rp->rhsalias[i] && !used[i] ){
+ ErrorMsg(lemp->filename,rp->ruleline,
+ "Label %s for \"%s(%s)\" is never used.",
+ rp->rhsalias[i],rp->rhs[i]->name,rp->rhsalias[i]);
+ lemp->errorcnt++;
+ }else if( rp->rhsalias[i]==0 ){
+ if( has_destructor(rp->rhs[i],lemp) ){
+ append_str(" yy_destructor(%d,&yymsp[%d].minor);\n", 0,
+ rp->rhs[i]->index,i-rp->nrhs+1);
+ }else{
+ /* No destructor defined for this term */
+ }
+ }
+ }
+ cp = append_str(0,0,0,0);
+ rp->code = Strsafe(cp);
+}
+
+/*
+** Generate code which executes when the rule "rp" is reduced. Write
+** the code to "out". Make sure lineno stays up-to-date.
+*/
+PRIVATE void emit_code(out,rp,lemp,lineno)
+FILE *out;
+struct rule *rp;
+struct lemon *lemp;
+int *lineno;
+{
+ char *cp;
+ int linecnt = 0;
+
+ /* Generate code to do the reduce action */
+ if( rp->code ){
+ tplt_linedir(out,rp->line,lemp->filename);
+ fprintf(out,"{%s",rp->code);
+ for(cp=rp->code; *cp; cp++){
+ if( *cp=='\n' ) linecnt++;
+ } /* End loop */
+ (*lineno) += 3 + linecnt;
+ fprintf(out,"}\n");
+ tplt_linedir(out,*lineno,lemp->outname);
+ } /* End if( rp->code ) */
+
+ return;
+}
+
+/*
+** Print the definition of the union used for the parser's data stack.
+** This union contains fields for every possible data type for tokens
+** and nonterminals. In the process of computing and printing this
+** union, also set the ".dtnum" field of every terminal and nonterminal
+** symbol.
+*/
+void print_stack_union(out,lemp,plineno,mhflag)
+FILE *out; /* The output stream */
+struct lemon *lemp; /* The main info structure for this parser */
+int *plineno; /* Pointer to the line number */
+int mhflag; /* True if generating makeheaders output */
+{
+ int lineno = *plineno; /* The line number of the output */
+ char **types; /* A hash table of datatypes */
+ int arraysize; /* Size of the "types" array */
+ int maxdtlength; /* Maximum length of any ".datatype" field. */
+ char *stddt; /* Standardized name for a datatype */
+ int i,j; /* Loop counters */
+ int hash; /* For hashing the name of a type */
+ char *name; /* Name of the parser */
+
+ /* Allocate and initialize types[] and allocate stddt[] */
+ arraysize = lemp->nsymbol * 2;
+ types = (char**)malloc( arraysize * sizeof(char*) );
+ for(i=0; i<arraysize; i++) types[i] = 0;
+ maxdtlength = 0;
+ if( lemp->vartype ){
+ maxdtlength = strlen(lemp->vartype);
+ }
+ for(i=0; i<lemp->nsymbol; i++){
+ int len;
+ struct symbol *sp = lemp->symbols[i];
+ if( sp->datatype==0 ) continue;
+ len = strlen(sp->datatype);
+ if( len>maxdtlength ) maxdtlength = len;
+ }
+ stddt = (char*)malloc( maxdtlength*2 + 1 );
+ if( types==0 || stddt==0 ){
+ fprintf(stderr,"Out of memory.\n");
+ exit(1);
+ }
+
+ /* Build a hash table of datatypes. The ".dtnum" field of each symbol
+ ** is filled in with the hash index plus 1. A ".dtnum" value of 0 is
+ ** used for terminal symbols. If there is no %default_type defined then
+ ** 0 is also used as the .dtnum value for nonterminals which do not specify
+ ** a datatype using the %type directive.
+ */
+ for(i=0; i<lemp->nsymbol; i++){
+ struct symbol *sp = lemp->symbols[i];
+ char *cp;
+ if( sp==lemp->errsym ){
+ sp->dtnum = arraysize+1;
+ continue;
+ }
+ if( sp->type!=NONTERMINAL || (sp->datatype==0 && lemp->vartype==0) ){
+ sp->dtnum = 0;
+ continue;
+ }
+ cp = sp->datatype;
+ if( cp==0 ) cp = lemp->vartype;
+ j = 0;
+ while( isspace(*cp) ) cp++;
+ while( *cp ) stddt[j++] = *cp++;
+ while( j>0 && isspace(stddt[j-1]) ) j--;
+ stddt[j] = 0;
+ hash = 0;
+ for(j=0; stddt[j]; j++){
+ hash = hash*53 + stddt[j];
+ }
+ hash = (hash & 0x7fffffff)%arraysize;
+ while( types[hash] ){
+ if( strcmp(types[hash],stddt)==0 ){
+ sp->dtnum = hash + 1;
+ break;
+ }
+ hash++;
+ if( hash>=arraysize ) hash = 0;
+ }
+ if( types[hash]==0 ){
+ sp->dtnum = hash + 1;
+ types[hash] = (char*)malloc( strlen(stddt)+1 );
+ if( types[hash]==0 ){
+ fprintf(stderr,"Out of memory.\n");
+ exit(1);
+ }
+ strcpy(types[hash],stddt);
+ }
+ }
+
+ /* Print out the definition of YYTOKENTYPE and YYMINORTYPE */
+ name = lemp->name ? lemp->name : "Parse";
+ lineno = *plineno;
+ if( mhflag ){ fprintf(out,"#if INTERFACE\n"); lineno++; }
+ fprintf(out,"#define %sTOKENTYPE %s\n",name,
+ lemp->tokentype?lemp->tokentype:"void*"); lineno++;
+ if( mhflag ){ fprintf(out,"#endif\n"); lineno++; }
+ fprintf(out,"typedef union {\n"); lineno++;
+ fprintf(out," %sTOKENTYPE yy0;\n",name); lineno++;
+ for(i=0; i<arraysize; i++){
+ if( types[i]==0 ) continue;
+ fprintf(out," %s yy%d;\n",types[i],i+1); lineno++;
+ free(types[i]);
+ }
+ fprintf(out," int yy%d;\n",lemp->errsym->dtnum); lineno++;
+ free(stddt);
+ free(types);
+ fprintf(out,"} YYMINORTYPE;\n"); lineno++;
+ *plineno = lineno;
+}
+
+/*
+** Return the name of a C datatype able to represent values between
+** lwr and upr, inclusive.
+*/
+static const char *minimum_size_type(int lwr, int upr){
+ if( lwr>=0 ){
+ if( upr<=255 ){
+ return "unsigned char";
+ }else if( upr<65535 ){
+ return "unsigned short int";
+ }else{
+ return "unsigned int";
+ }
+ }else if( lwr>=-127 && upr<=127 ){
+ return "signed char";
+ }else if( lwr>=-32767 && upr<32767 ){
+ return "short";
+ }else{
+ return "int";
+ }
+}
+
+/*
+** Each state contains a set of token transaction and a set of
+** nonterminal transactions. Each of these sets makes an instance
+** of the following structure. An array of these structures is used
+** to order the creation of entries in the yy_action[] table.
+*/
+struct axset {
+ struct state *stp; /* A pointer to a state */
+ int isTkn; /* True to use tokens. False for non-terminals */
+ int nAction; /* Number of actions */
+};
+
+/*
+** Compare to axset structures for sorting purposes
+*/
+static int axset_compare(const void *a, const void *b){
+ struct axset *p1 = (struct axset*)a;
+ struct axset *p2 = (struct axset*)b;
+ return p2->nAction - p1->nAction;
+}
+
+/* Generate C source code for the parser */
+void ReportTable(lemp, mhflag)
+struct lemon *lemp;
+int mhflag; /* Output in makeheaders format if true */
+{
+ FILE *out, *in;
+ char line[LINESIZE];
+ int lineno;
+ struct state *stp;
+ struct action *ap;
+ struct rule *rp;
+ struct acttab *pActtab;
+ int i, j, n;
+ char *name;
+ int mnTknOfst, mxTknOfst;
+ int mnNtOfst, mxNtOfst;
+ struct axset *ax;
+
+ in = tplt_open(lemp);
+ if( in==0 ) return;
+ out = file_open(lemp,".c","wb");
+ if( out==0 ){
+ fclose(in);
+ return;
+ }
+ lineno = 1;
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate the include code, if any */
+ tplt_print(out,lemp,lemp->include,lemp->includeln,&lineno);
+ if( mhflag ){
+ char *name = file_makename(lemp, ".h");
+ fprintf(out,"#include \"%s\"\n", name); lineno++;
+ free(name);
+ }
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate #defines for all tokens */
+ if( mhflag ){
+ char *prefix;
+ fprintf(out,"#if INTERFACE\n"); lineno++;
+ if( lemp->tokenprefix ) prefix = lemp->tokenprefix;
+ else prefix = "";
+ for(i=1; i<lemp->nterminal; i++){
+ fprintf(out,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i);
+ lineno++;
+ }
+ fprintf(out,"#endif\n"); lineno++;
+ }
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate the defines */
+ fprintf(out,"#define YYCODETYPE %s\n",
+ minimum_size_type(0, lemp->nsymbol+5)); lineno++;
+ fprintf(out,"#define YYNOCODE %d\n",lemp->nsymbol+1); lineno++;
+ fprintf(out,"#define YYACTIONTYPE %s\n",
+ minimum_size_type(0, lemp->nstate+lemp->nrule+5)); lineno++;
+ print_stack_union(out,lemp,&lineno,mhflag);
+ if( lemp->stacksize ){
+ if( atoi(lemp->stacksize)<=0 ){
+ ErrorMsg(lemp->filename,0,
+"Illegal stack size: [%s]. The stack size should be an integer constant.",
+ lemp->stacksize);
+ lemp->errorcnt++;
+ lemp->stacksize = "100";
+ }
+ fprintf(out,"#define YYSTACKDEPTH %s\n",lemp->stacksize); lineno++;
+ }else{
+ fprintf(out,"#define YYSTACKDEPTH 100\n"); lineno++;
+ }
+ if( mhflag ){
+ fprintf(out,"#if INTERFACE\n"); lineno++;
+ }
+ name = lemp->name ? lemp->name : "Parse";
+ if( lemp->arg && lemp->arg[0] ){
+ int i;
+ i = strlen(lemp->arg);
+ while( i>=1 && isspace(lemp->arg[i-1]) ) i--;
+ while( i>=1 && (isalnum(lemp->arg[i-1]) || lemp->arg[i-1]=='_') ) i--;
+ fprintf(out,"#define %sARG_SDECL %s;\n",name,lemp->arg); lineno++;
+ fprintf(out,"#define %sARG_PDECL ,%s\n",name,lemp->arg); lineno++;
+ fprintf(out,"#define %sARG_FETCH %s = yypParser->%s\n",
+ name,lemp->arg,&lemp->arg[i]); lineno++;
+ fprintf(out,"#define %sARG_STORE yypParser->%s = %s\n",
+ name,&lemp->arg[i],&lemp->arg[i]); lineno++;
+ }else{
+ fprintf(out,"#define %sARG_SDECL\n",name); lineno++;
+ fprintf(out,"#define %sARG_PDECL\n",name); lineno++;
+ fprintf(out,"#define %sARG_FETCH\n",name); lineno++;
+ fprintf(out,"#define %sARG_STORE\n",name); lineno++;
+ }
+ if( mhflag ){
+ fprintf(out,"#endif\n"); lineno++;
+ }
+ fprintf(out,"#define YYNSTATE %d\n",lemp->nstate); lineno++;
+ fprintf(out,"#define YYNRULE %d\n",lemp->nrule); lineno++;
+ fprintf(out,"#define YYERRORSYMBOL %d\n",lemp->errsym->index); lineno++;
+ fprintf(out,"#define YYERRSYMDT yy%d\n",lemp->errsym->dtnum); lineno++;
+ if( lemp->has_fallback ){
+ fprintf(out,"#define YYFALLBACK 1\n"); lineno++;
+ }
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate the action table and its associates:
+ **
+ ** yy_action[] A single table containing all actions.
+ ** yy_lookahead[] A table containing the lookahead for each entry in
+ ** yy_action. Used to detect hash collisions.
+ ** yy_shift_ofst[] For each state, the offset into yy_action for
+ ** shifting terminals.
+ ** yy_reduce_ofst[] For each state, the offset into yy_action for
+ ** shifting non-terminals after a reduce.
+ ** yy_default[] Default action for each state.
+ */
+
+ /* Compute the actions on all states and count them up */
+ ax = malloc( sizeof(ax[0])*lemp->nstate*2 );
+ if( ax==0 ){
+ fprintf(stderr,"malloc failed\n");
+ exit(1);
+ }
+ for(i=0; i<lemp->nstate; i++){
+ stp = lemp->sorted[i];
+ stp->nTknAct = stp->nNtAct = 0;
+ stp->iDflt = lemp->nstate + lemp->nrule;
+ stp->iTknOfst = NO_OFFSET;
+ stp->iNtOfst = NO_OFFSET;
+ for(ap=stp->ap; ap; ap=ap->next){
+ if( compute_action(lemp,ap)>=0 ){
+ if( ap->sp->index<lemp->nterminal ){
+ stp->nTknAct++;
+ }else if( ap->sp->index<lemp->nsymbol ){
+ stp->nNtAct++;
+ }else{
+ stp->iDflt = compute_action(lemp, ap);
+ }
+ }
+ }
+ ax[i*2].stp = stp;
+ ax[i*2].isTkn = 1;
+ ax[i*2].nAction = stp->nTknAct;
+ ax[i*2+1].stp = stp;
+ ax[i*2+1].isTkn = 0;
+ ax[i*2+1].nAction = stp->nNtAct;
+ }
+ mxTknOfst = mnTknOfst = 0;
+ mxNtOfst = mnNtOfst = 0;
+
+ /* Compute the action table. In order to try to keep the size of the
+ ** action table to a minimum, the heuristic of placing the largest action
+ ** sets first is used.
+ */
+ qsort(ax, lemp->nstate*2, sizeof(ax[0]), axset_compare);
+ pActtab = acttab_alloc();
+ for(i=0; i<lemp->nstate*2 && ax[i].nAction>0; i++){
+ stp = ax[i].stp;
+ if( ax[i].isTkn ){
+ for(ap=stp->ap; ap; ap=ap->next){
+ int action;
+ if( ap->sp->index>=lemp->nterminal ) continue;
+ action = compute_action(lemp, ap);
+ if( action<0 ) continue;
+ acttab_action(pActtab, ap->sp->index, action);
+ }
+ stp->iTknOfst = acttab_insert(pActtab);
+ if( stp->iTknOfst<mnTknOfst ) mnTknOfst = stp->iTknOfst;
+ if( stp->iTknOfst>mxTknOfst ) mxTknOfst = stp->iTknOfst;
+ }else{
+ for(ap=stp->ap; ap; ap=ap->next){
+ int action;
+ if( ap->sp->index<lemp->nterminal ) continue;
+ if( ap->sp->index==lemp->nsymbol ) continue;
+ action = compute_action(lemp, ap);
+ if( action<0 ) continue;
+ acttab_action(pActtab, ap->sp->index, action);
+ }
+ stp->iNtOfst = acttab_insert(pActtab);
+ if( stp->iNtOfst<mnNtOfst ) mnNtOfst = stp->iNtOfst;
+ if( stp->iNtOfst>mxNtOfst ) mxNtOfst = stp->iNtOfst;
+ }
+ }
+ free(ax);
+
+ /* Output the yy_action table */
+ fprintf(out,"static const YYACTIONTYPE yy_action[] = {\n"); lineno++;
+ n = acttab_size(pActtab);
+ for(i=j=0; i<n; i++){
+ int action = acttab_yyaction(pActtab, i);
+ if( action<0 ) action = lemp->nsymbol + lemp->nrule + 2;
+ if( j==0 ) fprintf(out," /* %5d */ ", i);
+ fprintf(out, " %4d,", action);
+ if( j==9 || i==n-1 ){
+ fprintf(out, "\n"); lineno++;
+ j = 0;
+ }else{
+ j++;
+ }
+ }
+ fprintf(out, "};\n"); lineno++;
+
+ /* Output the yy_lookahead table */
+ fprintf(out,"static const YYCODETYPE yy_lookahead[] = {\n"); lineno++;
+ for(i=j=0; i<n; i++){
+ int la = acttab_yylookahead(pActtab, i);
+ if( la<0 ) la = lemp->nsymbol;
+ if( j==0 ) fprintf(out," /* %5d */ ", i);
+ fprintf(out, " %4d,", la);
+ if( j==9 || i==n-1 ){
+ fprintf(out, "\n"); lineno++;
+ j = 0;
+ }else{
+ j++;
+ }
+ }
+ fprintf(out, "};\n"); lineno++;
+
+ /* Output the yy_shift_ofst[] table */
+ fprintf(out, "#define YY_SHIFT_USE_DFLT (%d)\n", mnTknOfst-1); lineno++;
+ fprintf(out, "static const %s yy_shift_ofst[] = {\n",
+ minimum_size_type(mnTknOfst-1, mxTknOfst)); lineno++;
+ n = lemp->nstate;
+ for(i=j=0; i<n; i++){
+ int ofst;
+ stp = lemp->sorted[i];
+ ofst = stp->iTknOfst;
+ if( ofst==NO_OFFSET ) ofst = mnTknOfst - 1;
+ if( j==0 ) fprintf(out," /* %5d */ ", i);
+ fprintf(out, " %4d,", ofst);
+ if( j==9 || i==n-1 ){
+ fprintf(out, "\n"); lineno++;
+ j = 0;
+ }else{
+ j++;
+ }
+ }
+ fprintf(out, "};\n"); lineno++;
+
+ /* Output the yy_reduce_ofst[] table */
+ fprintf(out, "#define YY_REDUCE_USE_DFLT (%d)\n", mnNtOfst-1); lineno++;
+ fprintf(out, "static const %s yy_reduce_ofst[] = {\n",
+ minimum_size_type(mnNtOfst-1, mxNtOfst)); lineno++;
+ n = lemp->nstate;
+ for(i=j=0; i<n; i++){
+ int ofst;
+ stp = lemp->sorted[i];
+ ofst = stp->iNtOfst;
+ if( ofst==NO_OFFSET ) ofst = mnNtOfst - 1;
+ if( j==0 ) fprintf(out," /* %5d */ ", i);
+ fprintf(out, " %4d,", ofst);
+ if( j==9 || i==n-1 ){
+ fprintf(out, "\n"); lineno++;
+ j = 0;
+ }else{
+ j++;
+ }
+ }
+ fprintf(out, "};\n"); lineno++;
+
+ /* Output the default action table */
+ fprintf(out, "static const YYACTIONTYPE yy_default[] = {\n"); lineno++;
+ n = lemp->nstate;
+ for(i=j=0; i<n; i++){
+ stp = lemp->sorted[i];
+ if( j==0 ) fprintf(out," /* %5d */ ", i);
+ fprintf(out, " %4d,", stp->iDflt);
+ if( j==9 || i==n-1 ){
+ fprintf(out, "\n"); lineno++;
+ j = 0;
+ }else{
+ j++;
+ }
+ }
+ fprintf(out, "};\n"); lineno++;
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate the table of fallback tokens.
+ */
+ if( lemp->has_fallback ){
+ for(i=0; i<lemp->nterminal; i++){
+ struct symbol *p = lemp->symbols[i];
+ if( p->fallback==0 ){
+ fprintf(out, " 0, /* %10s => nothing */\n", p->name);
+ }else{
+ fprintf(out, " %3d, /* %10s => %s */\n", p->fallback->index,
+ p->name, p->fallback->name);
+ }
+ lineno++;
+ }
+ }
+ tplt_xfer(lemp->name, in, out, &lineno);
+
+ /* Generate a table containing the symbolic name of every symbol
+ */
+ for(i=0; i<lemp->nsymbol; i++){
+ sprintf(line,"\"%s\",",lemp->symbols[i]->name);
+ fprintf(out," %-15s",line);
+ if( (i&3)==3 ){ fprintf(out,"\n"); lineno++; }
+ }
+ if( (i&3)!=0 ){ fprintf(out,"\n"); lineno++; }
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate a table containing a text string that describes every
+ ** rule in the rule set of the grammer. This information is used
+ ** when tracing REDUCE actions.
+ */
+ for(i=0, rp=lemp->rule; rp; rp=rp->next, i++){
+ assert( rp->index==i );
+ fprintf(out," /* %3d */ \"%s ::=", i, rp->lhs->name);
+ for(j=0; j<rp->nrhs; j++) fprintf(out," %s",rp->rhs[j]->name);
+ fprintf(out,"\",\n"); lineno++;
+ }
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate code which executes every time a symbol is popped from
+ ** the stack while processing errors or while destroying the parser.
+ ** (In other words, generate the %destructor actions)
+ */
+ if( lemp->tokendest ){
+ for(i=0; i<lemp->nsymbol; i++){
+ struct symbol *sp = lemp->symbols[i];
+ if( sp==0 || sp->type!=TERMINAL ) continue;
+ fprintf(out," case %d:\n",sp->index); lineno++;
+ }
+ for(i=0; i<lemp->nsymbol && lemp->symbols[i]->type!=TERMINAL; i++);
+ if( i<lemp->nsymbol ){
+ emit_destructor_code(out,lemp->symbols[i],lemp,&lineno);
+ fprintf(out," break;\n"); lineno++;
+ }
+ }
+ if( lemp->vardest ){
+ struct symbol *dflt_sp = 0;
+ for(i=0; i<lemp->nsymbol; i++){
+ struct symbol *sp = lemp->symbols[i];
+ if( sp==0 || sp->type==TERMINAL ||
+ sp->index<=0 || sp->destructor!=0 ) continue;
+ fprintf(out," case %d:\n",sp->index); lineno++;
+ dflt_sp = sp;
+ }
+ if( dflt_sp!=0 ){
+ emit_destructor_code(out,dflt_sp,lemp,&lineno);
+ fprintf(out," break;\n"); lineno++;
+ }
+ }
+ for(i=0; i<lemp->nsymbol; i++){
+ struct symbol *sp = lemp->symbols[i];
+ if( sp==0 || sp->type==TERMINAL || sp->destructor==0 ) continue;
+ fprintf(out," case %d:\n",sp->index); lineno++;
+
+ /* Combine duplicate destructors into a single case */
+ for(j=i+1; j<lemp->nsymbol; j++){
+ struct symbol *sp2 = lemp->symbols[j];
+ if( sp2 && sp2->type!=TERMINAL && sp2->destructor
+ && sp2->dtnum==sp->dtnum
+ && strcmp(sp->destructor,sp2->destructor)==0 ){
+ fprintf(out," case %d:\n",sp2->index); lineno++;
+ sp2->destructor = 0;
+ }
+ }
+
+ emit_destructor_code(out,lemp->symbols[i],lemp,&lineno);
+ fprintf(out," break;\n"); lineno++;
+ }
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate code which executes whenever the parser stack overflows */
+ tplt_print(out,lemp,lemp->overflow,lemp->overflowln,&lineno);
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate the table of rule information
+ **
+ ** Note: This code depends on the fact that rules are number
+ ** sequentually beginning with 0.
+ */
+ for(rp=lemp->rule; rp; rp=rp->next){
+ fprintf(out," { %d, %d },\n",rp->lhs->index,rp->nrhs); lineno++;
+ }
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate code which execution during each REDUCE action */
+ for(rp=lemp->rule; rp; rp=rp->next){
+ if( rp->code ) translate_code(lemp, rp);
+ }
+ for(rp=lemp->rule; rp; rp=rp->next){
+ struct rule *rp2;
+ if( rp->code==0 ) continue;
+ fprintf(out," case %d:\n",rp->index); lineno++;
+ for(rp2=rp->next; rp2; rp2=rp2->next){
+ if( rp2->code==rp->code ){
+ fprintf(out," case %d:\n",rp2->index); lineno++;
+ rp2->code = 0;
+ }
+ }
+ emit_code(out,rp,lemp,&lineno);
+ fprintf(out," break;\n"); lineno++;
+ }
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate code which executes if a parse fails */
+ tplt_print(out,lemp,lemp->failure,lemp->failureln,&lineno);
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate code which executes when a syntax error occurs */
+ tplt_print(out,lemp,lemp->error,lemp->errorln,&lineno);
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Generate code which executes when the parser accepts its input */
+ tplt_print(out,lemp,lemp->accept,lemp->acceptln,&lineno);
+ tplt_xfer(lemp->name,in,out,&lineno);
+
+ /* Append any addition code the user desires */
+ tplt_print(out,lemp,lemp->extracode,lemp->extracodeln,&lineno);
+
+ fclose(in);
+ fclose(out);
+ return;
+}
+
+/* Generate a header file for the parser */
+void ReportHeader(lemp)
+struct lemon *lemp;
+{
+ FILE *out, *in;
+ char *prefix;
+ char line[LINESIZE];
+ char pattern[LINESIZE];
+ int i;
+
+ if( lemp->tokenprefix ) prefix = lemp->tokenprefix;
+ else prefix = "";
+ in = file_open(lemp,".h","rb");
+ if( in ){
+ for(i=1; i<lemp->nterminal && fgets(line,LINESIZE,in); i++){
+ sprintf(pattern,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i);
+ if( strcmp(line,pattern) ) break;
+ }
+ fclose(in);
+ if( i==lemp->nterminal ){
+ /* No change in the file. Don't rewrite it. */
+ return;
+ }
+ }
+ out = file_open(lemp,".h","wb");
+ if( out ){
+ for(i=1; i<lemp->nterminal; i++){
+ fprintf(out,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i);
+ }
+ fclose(out);
+ }
+ return;
+}
+
+/* Reduce the size of the action tables, if possible, by making use
+** of defaults.
+**
+** In this version, we take the most frequent REDUCE action and make
+** it the default. Only default a reduce if there are more than one.
+*/
+void CompressTables(lemp)
+struct lemon *lemp;
+{
+ struct state *stp;
+ struct action *ap, *ap2;
+ struct rule *rp, *rp2, *rbest;
+ int nbest, n;
+ int i;
+
+ for(i=0; i<lemp->nstate; i++){
+ stp = lemp->sorted[i];
+ nbest = 0;
+ rbest = 0;
+
+ for(ap=stp->ap; ap; ap=ap->next){
+ if( ap->type!=REDUCE ) continue;
+ rp = ap->x.rp;
+ if( rp==rbest ) continue;
+ n = 1;
+ for(ap2=ap->next; ap2; ap2=ap2->next){
+ if( ap2->type!=REDUCE ) continue;
+ rp2 = ap2->x.rp;
+ if( rp2==rbest ) continue;
+ if( rp2==rp ) n++;
+ }
+ if( n>nbest ){
+ nbest = n;
+ rbest = rp;
+ }
+ }
+
+ /* Do not make a default if the number of rules to default
+ ** is not at least 2 */
+ if( nbest<2 ) continue;
+
+
+ /* Combine matching REDUCE actions into a single default */
+ for(ap=stp->ap; ap; ap=ap->next){
+ if( ap->type==REDUCE && ap->x.rp==rbest ) break;
+ }
+ assert( ap );
+ ap->sp = Symbol_new("{default}");
+ for(ap=ap->next; ap; ap=ap->next){
+ if( ap->type==REDUCE && ap->x.rp==rbest ) ap->type = NOT_USED;
+ }
+ stp->ap = Action_sort(stp->ap);
+ }
+}
+
+/***************** From the file "set.c" ************************************/
+/*
+** Set manipulation routines for the LEMON parser generator.
+*/
+
+static int size = 0;
+
+/* Set the set size */
+void SetSize(n)
+int n;
+{
+ size = n+1;
+}
+
+/* Allocate a new set */
+char *SetNew(){
+ char *s;
+ int i;
+ s = (char*)malloc( size );
+ if( s==0 ){
+ extern void memory_error();
+ memory_error();
+ }
+ for(i=0; i<size; i++) s[i] = 0;
+ return s;
+}
+
+/* Deallocate a set */
+void SetFree(s)
+char *s;
+{
+ free(s);
+}
+
+/* Add a new element to the set. Return TRUE if the element was added
+** and FALSE if it was already there. */
+int SetAdd(s,e)
+char *s;
+int e;
+{
+ int rv;
+ rv = s[e];
+ s[e] = 1;
+ return !rv;
+}
+
+/* Add every element of s2 to s1. Return TRUE if s1 changes. */
+int SetUnion(s1,s2)
+char *s1;
+char *s2;
+{
+ int i, progress;
+ progress = 0;
+ for(i=0; i<size; i++){
+ if( s2[i]==0 ) continue;
+ if( s1[i]==0 ){
+ progress = 1;
+ s1[i] = 1;
+ }
+ }
+ return progress;
+}
+/********************** From the file "table.c" ****************************/
+/*
+** All code in this file has been automatically generated
+** from a specification in the file
+** "table.q"
+** by the associative array code building program "aagen".
+** Do not edit this file! Instead, edit the specification
+** file, then rerun aagen.
+*/
+/*
+** Code for processing tables in the LEMON parser generator.
+*/
+
+PRIVATE int strhash(x)
+char *x;
+{
+ int h = 0;
+ while( *x) h = h*13 + *(x++);
+ return h;
+}
+
+/* Works like strdup, sort of. Save a string in malloced memory, but
+** keep strings in a table so that the same string is not in more
+** than one place.
+*/
+char *Strsafe(y)
+char *y;
+{
+ char *z;
+
+ z = Strsafe_find(y);
+ if( z==0 && (z=malloc( strlen(y)+1 ))!=0 ){
+ strcpy(z,y);
+ Strsafe_insert(z);
+ }
+ MemoryCheck(z);
+ return z;
+}
+
+/* There is one instance of the following structure for each
+** associative array of type "x1".
+*/
+struct s_x1 {
+ int size; /* The number of available slots. */
+ /* Must be a power of 2 greater than or */
+ /* equal to 1 */
+ int count; /* Number of currently slots filled */
+ struct s_x1node *tbl; /* The data stored here */
+ struct s_x1node **ht; /* Hash table for lookups */
+};
+
+/* There is one instance of this structure for every data element
+** in an associative array of type "x1".
+*/
+typedef struct s_x1node {
+ char *data; /* The data */
+ struct s_x1node *next; /* Next entry with the same hash */
+ struct s_x1node **from; /* Previous link */
+} x1node;
+
+/* There is only one instance of the array, which is the following */
+static struct s_x1 *x1a;
+
+/* Allocate a new associative array */
+void Strsafe_init(){
+ if( x1a ) return;
+ x1a = (struct s_x1*)malloc( sizeof(struct s_x1) );
+ if( x1a ){
+ x1a->size = 1024;
+ x1a->count = 0;
+ x1a->tbl = (x1node*)malloc(
+ (sizeof(x1node) + sizeof(x1node*))*1024 );
+ if( x1a->tbl==0 ){
+ free(x1a);
+ x1a = 0;
+ }else{
+ int i;
+ x1a->ht = (x1node**)&(x1a->tbl[1024]);
+ for(i=0; i<1024; i++) x1a->ht[i] = 0;
+ }
+ }
+}
+/* Insert a new record into the array. Return TRUE if successful.
+** Prior data with the same key is NOT overwritten */
+int Strsafe_insert(data)
+char *data;
+{
+ x1node *np;
+ int h;
+ int ph;
+
+ if( x1a==0 ) return 0;
+ ph = strhash(data);
+ h = ph & (x1a->size-1);
+ np = x1a->ht[h];
+ while( np ){
+ if( strcmp(np->data,data)==0 ){
+ /* An existing entry with the same key is found. */
+ /* Fail because overwrite is not allows. */
+ return 0;
+ }
+ np = np->next;
+ }
+ if( x1a->count>=x1a->size ){
+ /* Need to make the hash table bigger */
+ int i,size;
+ struct s_x1 array;
+ array.size = size = x1a->size*2;
+ array.count = x1a->count;
+ array.tbl = (x1node*)malloc(
+ (sizeof(x1node) + sizeof(x1node*))*size );
+ if( array.tbl==0 ) return 0; /* Fail due to malloc failure */
+ array.ht = (x1node**)&(array.tbl[size]);
+ for(i=0; i<size; i++) array.ht[i] = 0;
+ for(i=0; i<x1a->count; i++){
+ x1node *oldnp, *newnp;
+ oldnp = &(x1a->tbl[i]);
+ h = strhash(oldnp->data) & (size-1);
+ newnp = &(array.tbl[i]);
+ if( array.ht[h] ) array.ht[h]->from = &(newnp->next);
+ newnp->next = array.ht[h];
+ newnp->data = oldnp->data;
+ newnp->from = &(array.ht[h]);
+ array.ht[h] = newnp;
+ }
+ free(x1a->tbl);
+ *x1a = array;
+ }
+ /* Insert the new data */
+ h = ph & (x1a->size-1);
+ np = &(x1a->tbl[x1a->count++]);
+ np->data = data;
+ if( x1a->ht[h] ) x1a->ht[h]->from = &(np->next);
+ np->next = x1a->ht[h];
+ x1a->ht[h] = np;
+ np->from = &(x1a->ht[h]);
+ return 1;
+}
+
+/* Return a pointer to data assigned to the given key. Return NULL
+** if no such key. */
+char *Strsafe_find(key)
+char *key;
+{
+ int h;
+ x1node *np;
+
+ if( x1a==0 ) return 0;
+ h = strhash(key) & (x1a->size-1);
+ np = x1a->ht[h];
+ while( np ){
+ if( strcmp(np->data,key)==0 ) break;
+ np = np->next;
+ }
+ return np ? np->data : 0;
+}
+
+/* Return a pointer to the (terminal or nonterminal) symbol "x".
+** Create a new symbol if this is the first time "x" has been seen.
+*/
+struct symbol *Symbol_new(x)
+char *x;
+{
+ struct symbol *sp;
+
+ sp = Symbol_find(x);
+ if( sp==0 ){
+ sp = (struct symbol *)malloc( sizeof(struct symbol) );
+ MemoryCheck(sp);
+ sp->name = Strsafe(x);
+ sp->type = isupper(*x) ? TERMINAL : NONTERMINAL;
+ sp->rule = 0;
+ sp->fallback = 0;
+ sp->prec = -1;
+ sp->assoc = UNK;
+ sp->firstset = 0;
+ sp->lambda = B_FALSE;
+ sp->destructor = 0;
+ sp->datatype = 0;
+ Symbol_insert(sp,sp->name);
+ }
+ return sp;
+}
+
+/* Compare two symbols for working purposes
+**
+** Symbols that begin with upper case letters (terminals or tokens)
+** must sort before symbols that begin with lower case letters
+** (non-terminals). Other than that, the order does not matter.
+**
+** We find experimentally that leaving the symbols in their original
+** order (the order they appeared in the grammar file) gives the
+** smallest parser tables in SQLite.
+*/
+int Symbolcmpp(struct symbol **a, struct symbol **b){
+ int i1 = (**a).index + 10000000*((**a).name[0]>'Z');
+ int i2 = (**b).index + 10000000*((**b).name[0]>'Z');
+ return i1-i2;
+}
+
+/* There is one instance of the following structure for each
+** associative array of type "x2".
+*/
+struct s_x2 {
+ int size; /* The number of available slots. */
+ /* Must be a power of 2 greater than or */
+ /* equal to 1 */
+ int count; /* Number of currently slots filled */
+ struct s_x2node *tbl; /* The data stored here */
+ struct s_x2node **ht; /* Hash table for lookups */
+};
+
+/* There is one instance of this structure for every data element
+** in an associative array of type "x2".
+*/
+typedef struct s_x2node {
+ struct symbol *data; /* The data */
+ char *key; /* The key */
+ struct s_x2node *next; /* Next entry with the same hash */
+ struct s_x2node **from; /* Previous link */
+} x2node;
+
+/* There is only one instance of the array, which is the following */
+static struct s_x2 *x2a;
+
+/* Allocate a new associative array */
+void Symbol_init(){
+ if( x2a ) return;
+ x2a = (struct s_x2*)malloc( sizeof(struct s_x2) );
+ if( x2a ){
+ x2a->size = 128;
+ x2a->count = 0;
+ x2a->tbl = (x2node*)malloc(
+ (sizeof(x2node) + sizeof(x2node*))*128 );
+ if( x2a->tbl==0 ){
+ free(x2a);
+ x2a = 0;
+ }else{
+ int i;
+ x2a->ht = (x2node**)&(x2a->tbl[128]);
+ for(i=0; i<128; i++) x2a->ht[i] = 0;
+ }
+ }
+}
+/* Insert a new record into the array. Return TRUE if successful.
+** Prior data with the same key is NOT overwritten */
+int Symbol_insert(data,key)
+struct symbol *data;
+char *key;
+{
+ x2node *np;
+ int h;
+ int ph;
+
+ if( x2a==0 ) return 0;
+ ph = strhash(key);
+ h = ph & (x2a->size-1);
+ np = x2a->ht[h];
+ while( np ){
+ if( strcmp(np->key,key)==0 ){
+ /* An existing entry with the same key is found. */
+ /* Fail because overwrite is not allows. */
+ return 0;
+ }
+ np = np->next;
+ }
+ if( x2a->count>=x2a->size ){
+ /* Need to make the hash table bigger */
+ int i,size;
+ struct s_x2 array;
+ array.size = size = x2a->size*2;
+ array.count = x2a->count;
+ array.tbl = (x2node*)malloc(
+ (sizeof(x2node) + sizeof(x2node*))*size );
+ if( array.tbl==0 ) return 0; /* Fail due to malloc failure */
+ array.ht = (x2node**)&(array.tbl[size]);
+ for(i=0; i<size; i++) array.ht[i] = 0;
+ for(i=0; i<x2a->count; i++){
+ x2node *oldnp, *newnp;
+ oldnp = &(x2a->tbl[i]);
+ h = strhash(oldnp->key) & (size-1);
+ newnp = &(array.tbl[i]);
+ if( array.ht[h] ) array.ht[h]->from = &(newnp->next);
+ newnp->next = array.ht[h];
+ newnp->key = oldnp->key;
+ newnp->data = oldnp->data;
+ newnp->from = &(array.ht[h]);
+ array.ht[h] = newnp;
+ }
+ free(x2a->tbl);
+ *x2a = array;
+ }
+ /* Insert the new data */
+ h = ph & (x2a->size-1);
+ np = &(x2a->tbl[x2a->count++]);
+ np->key = key;
+ np->data = data;
+ if( x2a->ht[h] ) x2a->ht[h]->from = &(np->next);
+ np->next = x2a->ht[h];
+ x2a->ht[h] = np;
+ np->from = &(x2a->ht[h]);
+ return 1;
+}
+
+/* Return a pointer to data assigned to the given key. Return NULL
+** if no such key. */
+struct symbol *Symbol_find(key)
+char *key;
+{
+ int h;
+ x2node *np;
+
+ if( x2a==0 ) return 0;
+ h = strhash(key) & (x2a->size-1);
+ np = x2a->ht[h];
+ while( np ){
+ if( strcmp(np->key,key)==0 ) break;
+ np = np->next;
+ }
+ return np ? np->data : 0;
+}
+
+/* Return the n-th data. Return NULL if n is out of range. */
+struct symbol *Symbol_Nth(n)
+int n;
+{
+ struct symbol *data;
+ if( x2a && n>0 && n<=x2a->count ){
+ data = x2a->tbl[n-1].data;
+ }else{
+ data = 0;
+ }
+ return data;
+}
+
+/* Return the size of the array */
+int Symbol_count()
+{
+ return x2a ? x2a->count : 0;
+}
+
+/* Return an array of pointers to all data in the table.
+** The array is obtained from malloc. Return NULL if memory allocation
+** problems, or if the array is empty. */
+struct symbol **Symbol_arrayof()
+{
+ struct symbol **array;
+ int i,size;
+ if( x2a==0 ) return 0;
+ size = x2a->count;
+ array = (struct symbol **)malloc( sizeof(struct symbol *)*size );
+ if( array ){
+ for(i=0; i<size; i++) array[i] = x2a->tbl[i].data;
+ }
+ return array;
+}
+
+/* Compare two configurations */
+int Configcmp(a,b)
+struct config *a;
+struct config *b;
+{
+ int x;
+ x = a->rp->index - b->rp->index;
+ if( x==0 ) x = a->dot - b->dot;
+ return x;
+}
+
+/* Compare two states */
+PRIVATE int statecmp(a,b)
+struct config *a;
+struct config *b;
+{
+ int rc;
+ for(rc=0; rc==0 && a && b; a=a->bp, b=b->bp){
+ rc = a->rp->index - b->rp->index;
+ if( rc==0 ) rc = a->dot - b->dot;
+ }
+ if( rc==0 ){
+ if( a ) rc = 1;
+ if( b ) rc = -1;
+ }
+ return rc;
+}
+
+/* Hash a state */
+PRIVATE int statehash(a)
+struct config *a;
+{
+ int h=0;
+ while( a ){
+ h = h*571 + a->rp->index*37 + a->dot;
+ a = a->bp;
+ }
+ return h;
+}
+
+/* Allocate a new state structure */
+struct state *State_new()
+{
+ struct state *new;
+ new = (struct state *)malloc( sizeof(struct state) );
+ MemoryCheck(new);
+ return new;
+}
+
+/* There is one instance of the following structure for each
+** associative array of type "x3".
+*/
+struct s_x3 {
+ int size; /* The number of available slots. */
+ /* Must be a power of 2 greater than or */
+ /* equal to 1 */
+ int count; /* Number of currently slots filled */
+ struct s_x3node *tbl; /* The data stored here */
+ struct s_x3node **ht; /* Hash table for lookups */
+};
+
+/* There is one instance of this structure for every data element
+** in an associative array of type "x3".
+*/
+typedef struct s_x3node {
+ struct state *data; /* The data */
+ struct config *key; /* The key */
+ struct s_x3node *next; /* Next entry with the same hash */
+ struct s_x3node **from; /* Previous link */
+} x3node;
+
+/* There is only one instance of the array, which is the following */
+static struct s_x3 *x3a;
+
+/* Allocate a new associative array */
+void State_init(){
+ if( x3a ) return;
+ x3a = (struct s_x3*)malloc( sizeof(struct s_x3) );
+ if( x3a ){
+ x3a->size = 128;
+ x3a->count = 0;
+ x3a->tbl = (x3node*)malloc(
+ (sizeof(x3node) + sizeof(x3node*))*128 );
+ if( x3a->tbl==0 ){
+ free(x3a);
+ x3a = 0;
+ }else{
+ int i;
+ x3a->ht = (x3node**)&(x3a->tbl[128]);
+ for(i=0; i<128; i++) x3a->ht[i] = 0;
+ }
+ }
+}
+/* Insert a new record into the array. Return TRUE if successful.
+** Prior data with the same key is NOT overwritten */
+int State_insert(data,key)
+struct state *data;
+struct config *key;
+{
+ x3node *np;
+ int h;
+ int ph;
+
+ if( x3a==0 ) return 0;
+ ph = statehash(key);
+ h = ph & (x3a->size-1);
+ np = x3a->ht[h];
+ while( np ){
+ if( statecmp(np->key,key)==0 ){
+ /* An existing entry with the same key is found. */
+ /* Fail because overwrite is not allows. */
+ return 0;
+ }
+ np = np->next;
+ }
+ if( x3a->count>=x3a->size ){
+ /* Need to make the hash table bigger */
+ int i,size;
+ struct s_x3 array;
+ array.size = size = x3a->size*2;
+ array.count = x3a->count;
+ array.tbl = (x3node*)malloc(
+ (sizeof(x3node) + sizeof(x3node*))*size );
+ if( array.tbl==0 ) return 0; /* Fail due to malloc failure */
+ array.ht = (x3node**)&(array.tbl[size]);
+ for(i=0; i<size; i++) array.ht[i] = 0;
+ for(i=0; i<x3a->count; i++){
+ x3node *oldnp, *newnp;
+ oldnp = &(x3a->tbl[i]);
+ h = statehash(oldnp->key) & (size-1);
+ newnp = &(array.tbl[i]);
+ if( array.ht[h] ) array.ht[h]->from = &(newnp->next);
+ newnp->next = array.ht[h];
+ newnp->key = oldnp->key;
+ newnp->data = oldnp->data;
+ newnp->from = &(array.ht[h]);
+ array.ht[h] = newnp;
+ }
+ free(x3a->tbl);
+ *x3a = array;
+ }
+ /* Insert the new data */
+ h = ph & (x3a->size-1);
+ np = &(x3a->tbl[x3a->count++]);
+ np->key = key;
+ np->data = data;
+ if( x3a->ht[h] ) x3a->ht[h]->from = &(np->next);
+ np->next = x3a->ht[h];
+ x3a->ht[h] = np;
+ np->from = &(x3a->ht[h]);
+ return 1;
+}
+
+/* Return a pointer to data assigned to the given key. Return NULL
+** if no such key. */
+struct state *State_find(key)
+struct config *key;
+{
+ int h;
+ x3node *np;
+
+ if( x3a==0 ) return 0;
+ h = statehash(key) & (x3a->size-1);
+ np = x3a->ht[h];
+ while( np ){
+ if( statecmp(np->key,key)==0 ) break;
+ np = np->next;
+ }
+ return np ? np->data : 0;
+}
+
+/* Return an array of pointers to all data in the table.
+** The array is obtained from malloc. Return NULL if memory allocation
+** problems, or if the array is empty. */
+struct state **State_arrayof()
+{
+ struct state **array;
+ int i,size;
+ if( x3a==0 ) return 0;
+ size = x3a->count;
+ array = (struct state **)malloc( sizeof(struct state *)*size );
+ if( array ){
+ for(i=0; i<size; i++) array[i] = x3a->tbl[i].data;
+ }
+ return array;
+}
+
+/* Hash a configuration */
+PRIVATE int confighash(a)
+struct config *a;
+{
+ int h=0;
+ h = h*571 + a->rp->index*37 + a->dot;
+ return h;
+}
+
+/* There is one instance of the following structure for each
+** associative array of type "x4".
+*/
+struct s_x4 {
+ int size; /* The number of available slots. */
+ /* Must be a power of 2 greater than or */
+ /* equal to 1 */
+ int count; /* Number of currently slots filled */
+ struct s_x4node *tbl; /* The data stored here */
+ struct s_x4node **ht; /* Hash table for lookups */
+};
+
+/* There is one instance of this structure for every data element
+** in an associative array of type "x4".
+*/
+typedef struct s_x4node {
+ struct config *data; /* The data */
+ struct s_x4node *next; /* Next entry with the same hash */
+ struct s_x4node **from; /* Previous link */
+} x4node;
+
+/* There is only one instance of the array, which is the following */
+static struct s_x4 *x4a;
+
+/* Allocate a new associative array */
+void Configtable_init(){
+ if( x4a ) return;
+ x4a = (struct s_x4*)malloc( sizeof(struct s_x4) );
+ if( x4a ){
+ x4a->size = 64;
+ x4a->count = 0;
+ x4a->tbl = (x4node*)malloc(
+ (sizeof(x4node) + sizeof(x4node*))*64 );
+ if( x4a->tbl==0 ){
+ free(x4a);
+ x4a = 0;
+ }else{
+ int i;
+ x4a->ht = (x4node**)&(x4a->tbl[64]);
+ for(i=0; i<64; i++) x4a->ht[i] = 0;
+ }
+ }
+}
+/* Insert a new record into the array. Return TRUE if successful.
+** Prior data with the same key is NOT overwritten */
+int Configtable_insert(data)
+struct config *data;
+{
+ x4node *np;
+ int h;
+ int ph;
+
+ if( x4a==0 ) return 0;
+ ph = confighash(data);
+ h = ph & (x4a->size-1);
+ np = x4a->ht[h];
+ while( np ){
+ if( Configcmp(np->data,data)==0 ){
+ /* An existing entry with the same key is found. */
+ /* Fail because overwrite is not allows. */
+ return 0;
+ }
+ np = np->next;
+ }
+ if( x4a->count>=x4a->size ){
+ /* Need to make the hash table bigger */
+ int i,size;
+ struct s_x4 array;
+ array.size = size = x4a->size*2;
+ array.count = x4a->count;
+ array.tbl = (x4node*)malloc(
+ (sizeof(x4node) + sizeof(x4node*))*size );
+ if( array.tbl==0 ) return 0; /* Fail due to malloc failure */
+ array.ht = (x4node**)&(array.tbl[size]);
+ for(i=0; i<size; i++) array.ht[i] = 0;
+ for(i=0; i<x4a->count; i++){
+ x4node *oldnp, *newnp;
+ oldnp = &(x4a->tbl[i]);
+ h = confighash(oldnp->data) & (size-1);
+ newnp = &(array.tbl[i]);
+ if( array.ht[h] ) array.ht[h]->from = &(newnp->next);
+ newnp->next = array.ht[h];
+ newnp->data = oldnp->data;
+ newnp->from = &(array.ht[h]);
+ array.ht[h] = newnp;
+ }
+ free(x4a->tbl);
+ *x4a = array;
+ }
+ /* Insert the new data */
+ h = ph & (x4a->size-1);
+ np = &(x4a->tbl[x4a->count++]);
+ np->data = data;
+ if( x4a->ht[h] ) x4a->ht[h]->from = &(np->next);
+ np->next = x4a->ht[h];
+ x4a->ht[h] = np;
+ np->from = &(x4a->ht[h]);
+ return 1;
+}
+
+/* Return a pointer to data assigned to the given key. Return NULL
+** if no such key. */
+struct config *Configtable_find(key)
+struct config *key;
+{
+ int h;
+ x4node *np;
+
+ if( x4a==0 ) return 0;
+ h = confighash(key) & (x4a->size-1);
+ np = x4a->ht[h];
+ while( np ){
+ if( Configcmp(np->data,key)==0 ) break;
+ np = np->next;
+ }
+ return np ? np->data : 0;
+}
+
+/* Remove all data from the table. Pass each data to the function "f"
+** as it is removed. ("f" may be null to avoid this step.) */
+void Configtable_clear(f)
+int(*f)(/* struct config * */);
+{
+ int i;
+ if( x4a==0 || x4a->count==0 ) return;
+ if( f ) for(i=0; i<x4a->count; i++) (*f)(x4a->tbl[i].data);
+ for(i=0; i<x4a->size; i++) x4a->ht[i] = 0;
+ x4a->count = 0;
+ return;
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/lempar.c b/ext/pdo_sqlite/sqlite/tool/lempar.c
new file mode 100644
index 000000000..57ec97f6a
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/lempar.c
@@ -0,0 +1,714 @@
+/* Driver template for the LEMON parser generator.
+** The author disclaims copyright to this source code.
+*/
+/* First off, code is include which follows the "include" declaration
+** in the input file. */
+#include <stdio.h>
+%%
+/* Next is all token values, in a form suitable for use by makeheaders.
+** This section will be null unless lemon is run with the -m switch.
+*/
+/*
+** These constants (all generated automatically by the parser generator)
+** specify the various kinds of tokens (terminals) that the parser
+** understands.
+**
+** Each symbol here is a terminal symbol in the grammar.
+*/
+%%
+/* Make sure the INTERFACE macro is defined.
+*/
+#ifndef INTERFACE
+# define INTERFACE 1
+#endif
+/* The next thing included is series of defines which control
+** various aspects of the generated parser.
+** YYCODETYPE is the data type used for storing terminal
+** and nonterminal numbers. "unsigned char" is
+** used if there are fewer than 250 terminals
+** and nonterminals. "int" is used otherwise.
+** YYNOCODE is a number of type YYCODETYPE which corresponds
+** to no legal terminal or nonterminal number. This
+** number is used to fill in empty slots of the hash
+** table.
+** YYFALLBACK If defined, this indicates that one or more tokens
+** have fall-back values which should be used if the
+** original value of the token will not parse.
+** YYACTIONTYPE is the data type used for storing terminal
+** and nonterminal numbers. "unsigned char" is
+** used if there are fewer than 250 rules and
+** states combined. "int" is used otherwise.
+** ParseTOKENTYPE is the data type used for minor tokens given
+** directly to the parser from the tokenizer.
+** YYMINORTYPE is the data type used for all minor tokens.
+** This is typically a union of many types, one of
+** which is ParseTOKENTYPE. The entry in the union
+** for base tokens is called "yy0".
+** YYSTACKDEPTH is the maximum depth of the parser's stack.
+** ParseARG_SDECL A static variable declaration for the %extra_argument
+** ParseARG_PDECL A parameter declaration for the %extra_argument
+** ParseARG_STORE Code to store %extra_argument into yypParser
+** ParseARG_FETCH Code to extract %extra_argument from yypParser
+** YYNSTATE the combined number of states.
+** YYNRULE the number of rules in the grammar
+** YYERRORSYMBOL is the code number of the error symbol. If not
+** defined, then do no error processing.
+*/
+%%
+#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
+#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
+#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
+
+/* Next are that tables used to determine what action to take based on the
+** current state and lookahead token. These tables are used to implement
+** functions that take a state number and lookahead value and return an
+** action integer.
+**
+** Suppose the action integer is N. Then the action is determined as
+** follows
+**
+** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
+** token onto the stack and goto state N.
+**
+** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
+**
+** N == YYNSTATE+YYNRULE A syntax error has occurred.
+**
+** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
+**
+** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
+** slots in the yy_action[] table.
+**
+** The action table is constructed as a single large table named yy_action[].
+** Given state S and lookahead X, the action is computed as
+**
+** yy_action[ yy_shift_ofst[S] + X ]
+**
+** If the index value yy_shift_ofst[S]+X is out of range or if the value
+** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
+** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
+** and that yy_default[S] should be used instead.
+**
+** The formula above is for computing the action when the lookahead is
+** a terminal symbol. If the lookahead is a non-terminal (as occurs after
+** a reduce action) then the yy_reduce_ofst[] array is used in place of
+** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
+** YY_SHIFT_USE_DFLT.
+**
+** The following are the tables generated in this section:
+**
+** yy_action[] A single table containing all actions.
+** yy_lookahead[] A table containing the lookahead for each entry in
+** yy_action. Used to detect hash collisions.
+** yy_shift_ofst[] For each state, the offset into yy_action for
+** shifting terminals.
+** yy_reduce_ofst[] For each state, the offset into yy_action for
+** shifting non-terminals after a reduce.
+** yy_default[] Default action for each state.
+*/
+%%
+#define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0]))
+
+/* The next table maps tokens into fallback tokens. If a construct
+** like the following:
+**
+** %fallback ID X Y Z.
+**
+** appears in the grammer, then ID becomes a fallback token for X, Y,
+** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
+** but it does not parse, the type of the token is changed to ID and
+** the parse is retried before an error is thrown.
+*/
+#ifdef YYFALLBACK
+static const YYCODETYPE yyFallback[] = {
+%%
+};
+#endif /* YYFALLBACK */
+
+/* The following structure represents a single element of the
+** parser's stack. Information stored includes:
+**
+** + The state number for the parser at this level of the stack.
+**
+** + The value of the token stored at this level of the stack.
+** (In other words, the "major" token.)
+**
+** + The semantic value stored at this level of the stack. This is
+** the information used by the action routines in the grammar.
+** It is sometimes called the "minor" token.
+*/
+struct yyStackEntry {
+ int stateno; /* The state-number */
+ int major; /* The major token value. This is the code
+ ** number for the token at this stack level */
+ YYMINORTYPE minor; /* The user-supplied minor token value. This
+ ** is the value of the token */
+};
+typedef struct yyStackEntry yyStackEntry;
+
+/* The state of the parser is completely contained in an instance of
+** the following structure */
+struct yyParser {
+ int yyidx; /* Index of top element in stack */
+ int yyerrcnt; /* Shifts left before out of the error */
+ ParseARG_SDECL /* A place to hold %extra_argument */
+ yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
+};
+typedef struct yyParser yyParser;
+
+#ifndef NDEBUG
+#include <stdio.h>
+static FILE *yyTraceFILE = 0;
+static char *yyTracePrompt = 0;
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/*
+** Turn parser tracing on by giving a stream to which to write the trace
+** and a prompt to preface each trace message. Tracing is turned off
+** by making either argument NULL
+**
+** Inputs:
+** <ul>
+** <li> A FILE* to which trace output should be written.
+** If NULL, then tracing is turned off.
+** <li> A prefix string written at the beginning of every
+** line of trace output. If NULL, then tracing is
+** turned off.
+** </ul>
+**
+** Outputs:
+** None.
+*/
+void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
+ yyTraceFILE = TraceFILE;
+ yyTracePrompt = zTracePrompt;
+ if( yyTraceFILE==0 ) yyTracePrompt = 0;
+ else if( yyTracePrompt==0 ) yyTraceFILE = 0;
+}
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/* For tracing shifts, the names of all terminals and nonterminals
+** are required. The following table supplies these names */
+static const char *const yyTokenName[] = {
+%%
+};
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/* For tracing reduce actions, the names of all rules are required.
+*/
+static const char *const yyRuleName[] = {
+%%
+};
+#endif /* NDEBUG */
+
+/*
+** This function returns the symbolic name associated with a token
+** value.
+*/
+const char *ParseTokenName(int tokenType){
+#ifndef NDEBUG
+ if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
+ return yyTokenName[tokenType];
+ }else{
+ return "Unknown";
+ }
+#else
+ return "";
+#endif
+}
+
+/*
+** This function allocates a new parser.
+** The only argument is a pointer to a function which works like
+** malloc.
+**
+** Inputs:
+** A pointer to the function used to allocate memory.
+**
+** Outputs:
+** A pointer to a parser. This pointer is used in subsequent calls
+** to Parse and ParseFree.
+*/
+void *ParseAlloc(void *(*mallocProc)(size_t)){
+ yyParser *pParser;
+ pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
+ if( pParser ){
+ pParser->yyidx = -1;
+ }
+ return pParser;
+}
+
+/* The following function deletes the value associated with a
+** symbol. The symbol can be either a terminal or nonterminal.
+** "yymajor" is the symbol code, and "yypminor" is a pointer to
+** the value.
+*/
+static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
+ switch( yymajor ){
+ /* Here is inserted the actions which take place when a
+ ** terminal or non-terminal is destroyed. This can happen
+ ** when the symbol is popped from the stack during a
+ ** reduce or during error processing or when a parser is
+ ** being destroyed before it is finished parsing.
+ **
+ ** Note: during a reduce, the only symbols destroyed are those
+ ** which appear on the RHS of the rule, but which are not used
+ ** inside the C code.
+ */
+%%
+ default: break; /* If no destructor action specified: do nothing */
+ }
+}
+
+/*
+** Pop the parser's stack once.
+**
+** If there is a destructor routine associated with the token which
+** is popped from the stack, then call it.
+**
+** Return the major token number for the symbol popped.
+*/
+static int yy_pop_parser_stack(yyParser *pParser){
+ YYCODETYPE yymajor;
+ yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
+
+ if( pParser->yyidx<0 ) return 0;
+#ifndef NDEBUG
+ if( yyTraceFILE && pParser->yyidx>=0 ){
+ fprintf(yyTraceFILE,"%sPopping %s\n",
+ yyTracePrompt,
+ yyTokenName[yytos->major]);
+ }
+#endif
+ yymajor = yytos->major;
+ yy_destructor( yymajor, &yytos->minor);
+ pParser->yyidx--;
+ return yymajor;
+}
+
+/*
+** Deallocate and destroy a parser. Destructors are all called for
+** all stack elements before shutting the parser down.
+**
+** Inputs:
+** <ul>
+** <li> A pointer to the parser. This should be a pointer
+** obtained from ParseAlloc.
+** <li> A pointer to a function used to reclaim memory obtained
+** from malloc.
+** </ul>
+*/
+void ParseFree(
+ void *p, /* The parser to be deleted */
+ void (*freeProc)(void*) /* Function used to reclaim memory */
+){
+ yyParser *pParser = (yyParser*)p;
+ if( pParser==0 ) return;
+ while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
+ (*freeProc)((void*)pParser);
+}
+
+/*
+** Find the appropriate action for a parser given the terminal
+** look-ahead token iLookAhead.
+**
+** If the look-ahead token is YYNOCODE, then check to see if the action is
+** independent of the look-ahead. If it is, return the action, otherwise
+** return YY_NO_ACTION.
+*/
+static int yy_find_shift_action(
+ yyParser *pParser, /* The parser */
+ int iLookAhead /* The look-ahead token */
+){
+ int i;
+ int stateno = pParser->yystack[pParser->yyidx].stateno;
+
+ /* if( pParser->yyidx<0 ) return YY_NO_ACTION; */
+ i = yy_shift_ofst[stateno];
+ if( i==YY_SHIFT_USE_DFLT ){
+ return yy_default[stateno];
+ }
+ if( iLookAhead==YYNOCODE ){
+ return YY_NO_ACTION;
+ }
+ i += iLookAhead;
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+#ifdef YYFALLBACK
+ int iFallback; /* Fallback token */
+ if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
+ && (iFallback = yyFallback[iLookAhead])!=0 ){
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
+ yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
+ }
+#endif
+ return yy_find_shift_action(pParser, iFallback);
+ }
+#endif
+ return yy_default[stateno];
+ }else{
+ return yy_action[i];
+ }
+}
+
+/*
+** Find the appropriate action for a parser given the non-terminal
+** look-ahead token iLookAhead.
+**
+** If the look-ahead token is YYNOCODE, then check to see if the action is
+** independent of the look-ahead. If it is, return the action, otherwise
+** return YY_NO_ACTION.
+*/
+static int yy_find_reduce_action(
+ int stateno, /* Current state number */
+ int iLookAhead /* The look-ahead token */
+){
+ int i;
+ /* int stateno = pParser->yystack[pParser->yyidx].stateno; */
+
+ i = yy_reduce_ofst[stateno];
+ if( i==YY_REDUCE_USE_DFLT ){
+ return yy_default[stateno];
+ }
+ if( iLookAhead==YYNOCODE ){
+ return YY_NO_ACTION;
+ }
+ i += iLookAhead;
+ if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ return yy_default[stateno];
+ }else{
+ return yy_action[i];
+ }
+}
+
+/*
+** Perform a shift action.
+*/
+static void yy_shift(
+ yyParser *yypParser, /* The parser to be shifted */
+ int yyNewState, /* The new state to shift in */
+ int yyMajor, /* The major token to shift in */
+ YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */
+){
+ yyStackEntry *yytos;
+ yypParser->yyidx++;
+ if( yypParser->yyidx>=YYSTACKDEPTH ){
+ ParseARG_FETCH;
+ yypParser->yyidx--;
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
+ }
+#endif
+ while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
+ /* Here code is inserted which will execute if the parser
+ ** stack every overflows */
+%%
+ ParseARG_STORE; /* Suppress warning about unused %extra_argument var */
+ return;
+ }
+ yytos = &yypParser->yystack[yypParser->yyidx];
+ yytos->stateno = yyNewState;
+ yytos->major = yyMajor;
+ yytos->minor = *yypMinor;
+#ifndef NDEBUG
+ if( yyTraceFILE && yypParser->yyidx>0 ){
+ int i;
+ fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
+ fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
+ for(i=1; i<=yypParser->yyidx; i++)
+ fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
+ fprintf(yyTraceFILE,"\n");
+ }
+#endif
+}
+
+/* The following table contains information about every rule that
+** is used during the reduce.
+*/
+static const struct {
+ YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
+ unsigned char nrhs; /* Number of right-hand side symbols in the rule */
+} yyRuleInfo[] = {
+%%
+};
+
+static void yy_accept(yyParser*); /* Forward Declaration */
+
+/*
+** Perform a reduce action and the shift that must immediately
+** follow the reduce.
+*/
+static void yy_reduce(
+ yyParser *yypParser, /* The parser */
+ int yyruleno /* Number of the rule by which to reduce */
+){
+ int yygoto; /* The next state */
+ int yyact; /* The next action */
+ YYMINORTYPE yygotominor; /* The LHS of the rule reduced */
+ yyStackEntry *yymsp; /* The top of the parser's stack */
+ int yysize; /* Amount to pop the stack */
+ ParseARG_FETCH;
+ yymsp = &yypParser->yystack[yypParser->yyidx];
+#ifndef NDEBUG
+ if( yyTraceFILE && yyruleno>=0
+ && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
+ fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
+ yyRuleName[yyruleno]);
+ }
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+ /* Silence complaints from purify about yygotominor being uninitialized
+ ** in some cases when it is copied into the stack after the following
+ ** switch. yygotominor is uninitialized when a rule reduces that does
+ ** not set the value of its left-hand side nonterminal. Leaving the
+ ** value of the nonterminal uninitialized is utterly harmless as long
+ ** as the value is never used. So really the only thing this code
+ ** accomplishes is to quieten purify.
+ */
+ memset(&yygotominor, 0, sizeof(yygotominor));
+#endif
+
+ switch( yyruleno ){
+ /* Beginning here are the reduction cases. A typical example
+ ** follows:
+ ** case 0:
+ ** #line <lineno> <grammarfile>
+ ** { ... } // User supplied code
+ ** #line <lineno> <thisfile>
+ ** break;
+ */
+%%
+ };
+ yygoto = yyRuleInfo[yyruleno].lhs;
+ yysize = yyRuleInfo[yyruleno].nrhs;
+ yypParser->yyidx -= yysize;
+ yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto);
+ if( yyact < YYNSTATE ){
+#ifdef NDEBUG
+ /* If we are not debugging and the reduce action popped at least
+ ** one element off the stack, then we can push the new element back
+ ** onto the stack here, and skip the stack overflow test in yy_shift().
+ ** That gives a significant speed improvement. */
+ if( yysize ){
+ yypParser->yyidx++;
+ yymsp -= yysize-1;
+ yymsp->stateno = yyact;
+ yymsp->major = yygoto;
+ yymsp->minor = yygotominor;
+ }else
+#endif
+ {
+ yy_shift(yypParser,yyact,yygoto,&yygotominor);
+ }
+ }else if( yyact == YYNSTATE + YYNRULE + 1 ){
+ yy_accept(yypParser);
+ }
+}
+
+/*
+** The following code executes when the parse fails
+*/
+static void yy_parse_failed(
+ yyParser *yypParser /* The parser */
+){
+ ParseARG_FETCH;
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
+ }
+#endif
+ while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
+ /* Here code is inserted which will be executed whenever the
+ ** parser fails */
+%%
+ ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
+}
+
+/*
+** The following code executes when a syntax error first occurs.
+*/
+static void yy_syntax_error(
+ yyParser *yypParser, /* The parser */
+ int yymajor, /* The major type of the error token */
+ YYMINORTYPE yyminor /* The minor type of the error token */
+){
+ ParseARG_FETCH;
+#define TOKEN (yyminor.yy0)
+%%
+ ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
+}
+
+/*
+** The following is executed when the parser accepts
+*/
+static void yy_accept(
+ yyParser *yypParser /* The parser */
+){
+ ParseARG_FETCH;
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
+ }
+#endif
+ while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
+ /* Here code is inserted which will be executed whenever the
+ ** parser accepts */
+%%
+ ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
+}
+
+/* The main parser program.
+** The first argument is a pointer to a structure obtained from
+** "ParseAlloc" which describes the current state of the parser.
+** The second argument is the major token number. The third is
+** the minor token. The fourth optional argument is whatever the
+** user wants (and specified in the grammar) and is available for
+** use by the action routines.
+**
+** Inputs:
+** <ul>
+** <li> A pointer to the parser (an opaque structure.)
+** <li> The major token number.
+** <li> The minor token number.
+** <li> An option argument of a grammar-specified type.
+** </ul>
+**
+** Outputs:
+** None.
+*/
+void Parse(
+ void *yyp, /* The parser */
+ int yymajor, /* The major token code number */
+ ParseTOKENTYPE yyminor /* The value for the token */
+ ParseARG_PDECL /* Optional %extra_argument parameter */
+){
+ YYMINORTYPE yyminorunion;
+ int yyact; /* The parser action. */
+ int yyendofinput; /* True if we are at the end of input */
+ int yyerrorhit = 0; /* True if yymajor has invoked an error */
+ yyParser *yypParser; /* The parser */
+
+ /* (re)initialize the parser, if necessary */
+ yypParser = (yyParser*)yyp;
+ if( yypParser->yyidx<0 ){
+ /* if( yymajor==0 ) return; // not sure why this was here... */
+ yypParser->yyidx = 0;
+ yypParser->yyerrcnt = -1;
+ yypParser->yystack[0].stateno = 0;
+ yypParser->yystack[0].major = 0;
+ }
+ yyminorunion.yy0 = yyminor;
+ yyendofinput = (yymajor==0);
+ ParseARG_STORE;
+
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
+ }
+#endif
+
+ do{
+ yyact = yy_find_shift_action(yypParser,yymajor);
+ if( yyact<YYNSTATE ){
+ yy_shift(yypParser,yyact,yymajor,&yyminorunion);
+ yypParser->yyerrcnt--;
+ if( yyendofinput && yypParser->yyidx>=0 ){
+ yymajor = 0;
+ }else{
+ yymajor = YYNOCODE;
+ }
+ }else if( yyact < YYNSTATE + YYNRULE ){
+ yy_reduce(yypParser,yyact-YYNSTATE);
+ }else if( yyact == YY_ERROR_ACTION ){
+ int yymx;
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
+ }
+#endif
+#ifdef YYERRORSYMBOL
+ /* A syntax error has occurred.
+ ** The response to an error depends upon whether or not the
+ ** grammar defines an error token "ERROR".
+ **
+ ** This is what we do if the grammar does define ERROR:
+ **
+ ** * Call the %syntax_error function.
+ **
+ ** * Begin popping the stack until we enter a state where
+ ** it is legal to shift the error symbol, then shift
+ ** the error symbol.
+ **
+ ** * Set the error count to three.
+ **
+ ** * Begin accepting and shifting new tokens. No new error
+ ** processing will occur until three tokens have been
+ ** shifted successfully.
+ **
+ */
+ if( yypParser->yyerrcnt<0 ){
+ yy_syntax_error(yypParser,yymajor,yyminorunion);
+ }
+ yymx = yypParser->yystack[yypParser->yyidx].major;
+ if( yymx==YYERRORSYMBOL || yyerrorhit ){
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE,"%sDiscard input token %s\n",
+ yyTracePrompt,yyTokenName[yymajor]);
+ }
+#endif
+ yy_destructor(yymajor,&yyminorunion);
+ yymajor = YYNOCODE;
+ }else{
+ while(
+ yypParser->yyidx >= 0 &&
+ yymx != YYERRORSYMBOL &&
+ (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE
+ ){
+ yy_pop_parser_stack(yypParser);
+ }
+ if( yypParser->yyidx < 0 || yymajor==0 ){
+ yy_destructor(yymajor,&yyminorunion);
+ yy_parse_failed(yypParser);
+ yymajor = YYNOCODE;
+ }else if( yymx!=YYERRORSYMBOL ){
+ YYMINORTYPE u2;
+ u2.YYERRSYMDT = 0;
+ yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
+ }
+ }
+ yypParser->yyerrcnt = 3;
+ yyerrorhit = 1;
+#else /* YYERRORSYMBOL is not defined */
+ /* This is what we do if the grammar does not define ERROR:
+ **
+ ** * Report an error message, and throw away the input token.
+ **
+ ** * If the input token is $, then fail the parse.
+ **
+ ** As before, subsequent error messages are suppressed until
+ ** three input tokens have been successfully shifted.
+ */
+ if( yypParser->yyerrcnt<=0 ){
+ yy_syntax_error(yypParser,yymajor,yyminorunion);
+ }
+ yypParser->yyerrcnt = 3;
+ yy_destructor(yymajor,&yyminorunion);
+ if( yyendofinput ){
+ yy_parse_failed(yypParser);
+ }
+ yymajor = YYNOCODE;
+#endif
+ }else{
+ yy_accept(yypParser);
+ yymajor = YYNOCODE;
+ }
+ }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
+ return;
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/memleak.awk b/ext/pdo_sqlite/sqlite/tool/memleak.awk
new file mode 100644
index 000000000..928d3b69d
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/memleak.awk
@@ -0,0 +1,29 @@
+#
+# This script looks for memory leaks by analyzing the output of "sqlite"
+# when compiled with the SQLITE_DEBUG=2 option.
+#
+/[0-9]+ malloc / {
+ mem[$6] = $0
+}
+/[0-9]+ realloc / {
+ mem[$8] = "";
+ mem[$10] = $0
+}
+/[0-9]+ free / {
+ if (mem[$6]=="") {
+ print "*** free without a malloc at",$6
+ }
+ mem[$6] = "";
+ str[$6] = ""
+}
+/^string at / {
+ addr = $4
+ sub("string at " addr " is ","")
+ str[addr] = $0
+}
+END {
+ for(addr in mem){
+ if( mem[addr]=="" ) continue
+ print mem[addr], str[addr]
+ }
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/memleak2.awk b/ext/pdo_sqlite/sqlite/tool/memleak2.awk
new file mode 100644
index 000000000..5d81b70d8
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/memleak2.awk
@@ -0,0 +1,29 @@
+# This AWK script reads the output of testfixture when compiled for memory
+# debugging. It generates SQL commands that can be fed into an sqlite
+# instance to determine what memory is never freed. A typical usage would
+# be as follows:
+#
+# make -f memleak.mk fulltest 2>mem.out
+# awk -f ../sqlite/tool/memleak2.awk mem.out | ./sqlite :memory:
+#
+# The job performed by this script is the same as that done by memleak.awk.
+# The difference is that this script uses much less memory when the size
+# of the mem.out file is huge.
+#
+BEGIN {
+ print "CREATE TABLE mem(loc INTEGER PRIMARY KEY, src);"
+}
+/[0-9]+ malloc / {
+ print "INSERT INTO mem VALUES(" strtonum($6) ",'" $0 "');"
+}
+/[0-9]+ realloc / {
+ print "INSERT INTO mem VALUES(" strtonum($10) \
+ ",(SELECT src FROM mem WHERE loc=" strtonum($8) "));"
+ print "DELETE FROM mem WHERE loc=" strtonum($8) ";"
+}
+/[0-9]+ free / {
+ print "DELETE FROM mem WHERE loc=" strtonum($6) ";"
+}
+END {
+ print "SELECT src FROM mem;"
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/memleak3.tcl b/ext/pdo_sqlite/sqlite/tool/memleak3.tcl
new file mode 100644
index 000000000..2e3f43bc1
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/memleak3.tcl
@@ -0,0 +1,232 @@
+#/bin/sh
+# \
+exec `which tclsh` $0 "$@"
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+######################################################################
+
+set doco "
+This script is a tool to help track down memory leaks in the sqlite
+library. The library must be compiled with the preprocessor symbol
+SQLITE_MEMDEBUG set to at least 2. It must be set to 3 to enable stack
+traces.
+
+To use, run the leaky application and save the standard error output.
+Then, execute this program with the first argument the name of the
+application binary (or interpreter) and the second argument the name of the
+text file that contains the collected stderr output.
+
+If all goes well a summary of unfreed allocations is printed out. If the
+GNU C library is in use and SQLITE_DEBUG is 3 or greater a stack trace is
+printed out for each unmatched allocation.
+
+If the \"-r <n>\" option is passed, then the program stops and prints out
+the state of the heap immediately after the <n>th call to malloc() or
+realloc().
+
+Example:
+
+$ ./testfixture ../sqlite/test/select1.test 2> memtrace.out
+$ tclsh $argv0 ?-r <malloc-number>? ./testfixture memtrace.out
+"
+
+
+proc usage {} {
+ set prg [file tail $::argv0]
+ puts "Usage: $prg ?-r <malloc-number>? <binary file> <mem trace file>"
+ puts ""
+ puts [string trim $::doco]
+ exit -1
+}
+
+proc shift {listvar} {
+ upvar $listvar l
+ set ret [lindex $l 0]
+ set l [lrange $l 1 end]
+ return $ret
+}
+
+# Argument handling. The following vars are set:
+#
+# $exe - the name of the executable (i.e. "testfixture" or "./sqlite3")
+# $memfile - the name of the file containing the trace output.
+# $report_at - The malloc number to stop and report at. Or -1 to read
+# all of $memfile.
+#
+set report_at -1
+while {[llength $argv]>2} {
+ set arg [shift argv]
+ switch -- $arg {
+ "-r" {
+ set report_at [shift argv]
+ }
+ default {
+ usage
+ }
+ }
+}
+if {[llength $argv]!=2} usage
+set exe [lindex $argv 0]
+set memfile [lindex $argv 1]
+
+# If stack traces are enabled, the 'addr2line' program is called to
+# translate a binary stack address into a human-readable form.
+set addr2line addr2line
+
+# When the SQLITE_MEMDEBUG is set as described above, SQLite prints
+# out a line for each malloc(), realloc() or free() call that the
+# library makes. If SQLITE_MEMDEBUG is 3, then a stack trace is printed
+# out before each malloc() and realloc() line.
+#
+# This program parses each line the SQLite library outputs and updates
+# the following global Tcl variables to reflect the "current" state of
+# the heap used by SQLite.
+#
+set nBytes 0 ;# Total number of bytes currently allocated.
+set nMalloc 0 ;# Total number of malloc()/realloc() calls.
+set nPeak 0 ;# Peak of nBytes.
+set iPeak 0 ;# nMalloc when nPeak was set.
+#
+# More detailed state information is stored in the $memmap array.
+# Each key in the memmap array is the address of a chunk of memory
+# currently allocated from the heap. The value is a list of the
+# following form
+#
+# {<number-of-bytes> <malloc id> <stack trace>}
+#
+array unset memmap
+
+proc process_input {input_file array_name} {
+ upvar $array_name mem
+ set input [open $input_file]
+
+ set MALLOC {([[:digit:]]+) malloc ([[:digit:]]+) bytes at 0x([[:xdigit:]]+)}
+ # set STACK {^[[:digit:]]+: STACK: (.*)$}
+ set STACK {^STACK: (.*)$}
+ set FREE {[[:digit:]]+ free ([[:digit:]]+) bytes at 0x([[:xdigit:]]+)}
+ set REALLOC {([[:digit:]]+) realloc ([[:digit:]]+) to ([[:digit:]]+)}
+ append REALLOC { bytes at 0x([[:xdigit:]]+) to 0x([[:xdigit:]]+)}
+
+ set stack ""
+ while { ![eof $input] } {
+ set line [gets $input]
+ if {[regexp $STACK $line dummy stack]} {
+ # Do nothing. The variable $stack now stores the hexadecimal stack dump
+ # for the next malloc() or realloc().
+
+ } elseif { [regexp $MALLOC $line dummy mallocid bytes addr] } {
+ # If this is a 'malloc' line, set an entry in the mem array. Each entry
+ # is a list of length three, the number of bytes allocated , the malloc
+ # number and the stack dump when it was allocated.
+ set mem($addr) [list $bytes "malloc $mallocid" $stack]
+ set stack ""
+
+ # Increase the current heap usage
+ incr ::nBytes $bytes
+
+ # Increase the number of malloc() calls
+ incr ::nMalloc
+
+ if {$::nBytes > $::nPeak} {
+ set ::nPeak $::nBytes
+ set ::iPeak $::nMalloc
+ }
+
+ } elseif { [regexp $FREE $line dummy bytes addr] } {
+ # If this is a 'free' line, remove the entry from the mem array. If the
+ # entry does not exist, or is the wrong number of bytes, announce a
+ # problem. This is more likely a bug in the regular expressions for
+ # this script than an SQLite defect.
+ if { [lindex $mem($addr) 0] != $bytes } {
+ error "byte count mismatch"
+ }
+ unset mem($addr)
+
+ # Decrease the current heap usage
+ incr ::nBytes [expr -1 * $bytes]
+
+ } elseif { [regexp $REALLOC $line dummy mallocid ob b oa a] } {
+ # "free" the old allocation in the internal model:
+ incr ::nBytes [expr -1 * $ob]
+ unset mem($oa);
+
+ # "malloc" the new allocation
+ set mem($a) [list $b "realloc $mallocid" $stack]
+ incr ::nBytes $b
+ set stack ""
+
+ # Increase the number of malloc() calls
+ incr ::nMalloc
+
+ if {$::nBytes > $::nPeak} {
+ set ::nPeak $::nBytes
+ set ::iPeak $::nMalloc
+ }
+
+ } else {
+ # puts "REJECT: $line"
+ }
+
+ if {$::nMalloc==$::report_at} report
+ }
+
+ close $input
+}
+
+proc printstack {stack} {
+ set fcount 10
+ if {[llength $stack]<10} {
+ set fcount [llength $stack]
+ }
+ foreach frame [lrange $stack 1 $fcount] {
+ foreach {f l} [split [exec $::addr2line -f --exe=$::exe $frame] \n] {}
+ puts [format "%-30s %s" $f $l]
+ }
+ if {[llength $stack]>0 } {puts ""}
+}
+
+proc report {} {
+
+ foreach key [array names ::memmap] {
+ set stack [lindex $::memmap($key) 2]
+ set bytes [lindex $::memmap($key) 0]
+ lappend summarymap($stack) $bytes
+ }
+
+ foreach stack [array names summarymap] {
+ set allocs $summarymap($stack)
+ set sum 0
+ foreach a $allocs {
+ incr sum $a
+ }
+ lappend sorted [list $sum $stack]
+ }
+
+ set sorted [lsort -integer -index 0 $sorted]
+ foreach s $sorted {
+ set sum [lindex $s 0]
+ set stack [lindex $s 1]
+ set allocs $summarymap($stack)
+ puts "$sum bytes in [llength $allocs] chunks ($allocs)"
+ printstack $stack
+ }
+
+ # Print out summary statistics
+ puts "Total allocations : $::nMalloc"
+ puts "Total outstanding allocations: [array size ::memmap]"
+ puts "Current heap usage : $::nBytes bytes"
+ puts "Peak heap usage : $::nPeak bytes (malloc #$::iPeak)"
+
+ exit
+}
+
+process_input $memfile memmap
+report
+
+
+
diff --git a/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c b/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c
new file mode 100644
index 000000000..58d4b9cb7
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c
@@ -0,0 +1,501 @@
+/*
+** Compile and run this standalone program in order to generate code that
+** implements a function that will translate alphabetic identifiers into
+** parser token codes.
+*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+/*
+** All the keywords of the SQL language are stored as in a hash
+** table composed of instances of the following structure.
+*/
+typedef struct Keyword Keyword;
+struct Keyword {
+ char *zName; /* The keyword name */
+ char *zTokenType; /* Token value for this keyword */
+ int mask; /* Code this keyword if non-zero */
+ int id; /* Unique ID for this record */
+ int hash; /* Hash on the keyword */
+ int offset; /* Offset to start of name string */
+ int len; /* Length of this keyword, not counting final \000 */
+ int prefix; /* Number of characters in prefix */
+ int iNext; /* Index in aKeywordTable[] of next with same hash */
+ int substrId; /* Id to another keyword this keyword is embedded in */
+ int substrOffset; /* Offset into substrId for start of this keyword */
+};
+
+/*
+** Define masks used to determine which keywords are allowed
+*/
+#ifdef SQLITE_OMIT_ALTERTABLE
+# define ALTER 0
+#else
+# define ALTER 0x00000001
+#endif
+#define ALWAYS 0x00000002
+#ifdef SQLITE_OMIT_ANALYZE
+# define ANALYZE 0
+#else
+# define ANALYZE 0x00000004
+#endif
+#ifdef SQLITE_OMIT_ATTACH
+# define ATTACH 0
+#else
+# define ATTACH 0x00000008
+#endif
+#ifdef SQLITE_OMIT_AUTOINCREMENT
+# define AUTOINCR 0
+#else
+# define AUTOINCR 0x00000010
+#endif
+#ifdef SQLITE_OMIT_CAST
+# define CAST 0
+#else
+# define CAST 0x00000020
+#endif
+#ifdef SQLITE_OMIT_COMPOUND_SELECT
+# define COMPOUND 0
+#else
+# define COMPOUND 0x00000040
+#endif
+#ifdef SQLITE_OMIT_CONFLICT_CLAUSE
+# define CONFLICT 0
+#else
+# define CONFLICT 0x00000080
+#endif
+#ifdef SQLITE_OMIT_EXPLAIN
+# define EXPLAIN 0
+#else
+# define EXPLAIN 0x00000100
+#endif
+#ifdef SQLITE_OMIT_FOREIGN_KEY
+# define FKEY 0
+#else
+# define FKEY 0x00000200
+#endif
+#ifdef SQLITE_OMIT_PRAGMA
+# define PRAGMA 0
+#else
+# define PRAGMA 0x00000400
+#endif
+#ifdef SQLITE_OMIT_REINDEX
+# define REINDEX 0
+#else
+# define REINDEX 0x00000800
+#endif
+#ifdef SQLITE_OMIT_SUBQUERY
+# define SUBQUERY 0
+#else
+# define SUBQUERY 0x00001000
+#endif
+#ifdef SQLITE_OMIT_TRIGGER
+# define TRIGGER 0
+#else
+# define TRIGGER 0x00002000
+#endif
+#ifdef SQLITE_OMIT_VACUUM
+# define VACUUM 0
+#else
+# define VACUUM 0x00004000
+#endif
+#ifdef SQLITE_OMIT_VIEW
+# define VIEW 0
+#else
+# define VIEW 0x00008000
+#endif
+
+
+/*
+** These are the keywords
+*/
+static Keyword aKeywordTable[] = {
+ { "ABORT", "TK_ABORT", CONFLICT|TRIGGER },
+ { "ADD", "TK_ADD", ALTER },
+ { "AFTER", "TK_AFTER", TRIGGER },
+ { "ALL", "TK_ALL", ALWAYS },
+ { "ALTER", "TK_ALTER", ALTER },
+ { "ANALYZE", "TK_ANALYZE", ANALYZE },
+ { "AND", "TK_AND", ALWAYS },
+ { "AS", "TK_AS", ALWAYS },
+ { "ASC", "TK_ASC", ALWAYS },
+ { "ATTACH", "TK_ATTACH", ATTACH },
+ { "AUTOINCREMENT", "TK_AUTOINCR", AUTOINCR },
+ { "BEFORE", "TK_BEFORE", TRIGGER },
+ { "BEGIN", "TK_BEGIN", ALWAYS },
+ { "BETWEEN", "TK_BETWEEN", ALWAYS },
+ { "BY", "TK_BY", ALWAYS },
+ { "CASCADE", "TK_CASCADE", FKEY },
+ { "CASE", "TK_CASE", ALWAYS },
+ { "CAST", "TK_CAST", CAST },
+ { "CHECK", "TK_CHECK", ALWAYS },
+ { "COLLATE", "TK_COLLATE", ALWAYS },
+ { "COLUMN", "TK_COLUMNKW", ALTER },
+ { "COMMIT", "TK_COMMIT", ALWAYS },
+ { "CONFLICT", "TK_CONFLICT", CONFLICT },
+ { "CONSTRAINT", "TK_CONSTRAINT", ALWAYS },
+ { "CREATE", "TK_CREATE", ALWAYS },
+ { "CROSS", "TK_JOIN_KW", ALWAYS },
+ { "CURRENT_DATE", "TK_CTIME_KW", ALWAYS },
+ { "CURRENT_TIME", "TK_CTIME_KW", ALWAYS },
+ { "CURRENT_TIMESTAMP","TK_CTIME_KW", ALWAYS },
+ { "DATABASE", "TK_DATABASE", ATTACH },
+ { "DEFAULT", "TK_DEFAULT", ALWAYS },
+ { "DEFERRED", "TK_DEFERRED", ALWAYS },
+ { "DEFERRABLE", "TK_DEFERRABLE", FKEY },
+ { "DELETE", "TK_DELETE", ALWAYS },
+ { "DESC", "TK_DESC", ALWAYS },
+ { "DETACH", "TK_DETACH", ATTACH },
+ { "DISTINCT", "TK_DISTINCT", ALWAYS },
+ { "DROP", "TK_DROP", ALWAYS },
+ { "END", "TK_END", ALWAYS },
+ { "EACH", "TK_EACH", TRIGGER },
+ { "ELSE", "TK_ELSE", ALWAYS },
+ { "ESCAPE", "TK_ESCAPE", ALWAYS },
+ { "EXCEPT", "TK_EXCEPT", COMPOUND },
+ { "EXCLUSIVE", "TK_EXCLUSIVE", ALWAYS },
+ { "EXISTS", "TK_EXISTS", SUBQUERY },
+ { "EXPLAIN", "TK_EXPLAIN", EXPLAIN },
+ { "FAIL", "TK_FAIL", CONFLICT|TRIGGER },
+ { "FOR", "TK_FOR", TRIGGER },
+ { "FOREIGN", "TK_FOREIGN", FKEY },
+ { "FROM", "TK_FROM", ALWAYS },
+ { "FULL", "TK_JOIN_KW", ALWAYS },
+ { "GLOB", "TK_LIKE_KW", ALWAYS },
+ { "GROUP", "TK_GROUP", ALWAYS },
+ { "HAVING", "TK_HAVING", ALWAYS },
+ { "IGNORE", "TK_IGNORE", CONFLICT|TRIGGER },
+ { "IMMEDIATE", "TK_IMMEDIATE", ALWAYS },
+ { "IN", "TK_IN", ALWAYS },
+ { "INDEX", "TK_INDEX", ALWAYS },
+ { "INITIALLY", "TK_INITIALLY", FKEY },
+ { "INNER", "TK_JOIN_KW", ALWAYS },
+ { "INSERT", "TK_INSERT", ALWAYS },
+ { "INSTEAD", "TK_INSTEAD", TRIGGER },
+ { "INTERSECT", "TK_INTERSECT", COMPOUND },
+ { "INTO", "TK_INTO", ALWAYS },
+ { "IS", "TK_IS", ALWAYS },
+ { "ISNULL", "TK_ISNULL", ALWAYS },
+ { "JOIN", "TK_JOIN", ALWAYS },
+ { "KEY", "TK_KEY", ALWAYS },
+ { "LEFT", "TK_JOIN_KW", ALWAYS },
+ { "LIKE", "TK_LIKE_KW", ALWAYS },
+ { "LIMIT", "TK_LIMIT", ALWAYS },
+ { "MATCH", "TK_MATCH", ALWAYS },
+ { "NATURAL", "TK_JOIN_KW", ALWAYS },
+ { "NOT", "TK_NOT", ALWAYS },
+ { "NOTNULL", "TK_NOTNULL", ALWAYS },
+ { "NULL", "TK_NULL", ALWAYS },
+ { "OF", "TK_OF", ALWAYS },
+ { "OFFSET", "TK_OFFSET", ALWAYS },
+ { "ON", "TK_ON", ALWAYS },
+ { "OR", "TK_OR", ALWAYS },
+ { "ORDER", "TK_ORDER", ALWAYS },
+ { "OUTER", "TK_JOIN_KW", ALWAYS },
+ { "PRAGMA", "TK_PRAGMA", PRAGMA },
+ { "PRIMARY", "TK_PRIMARY", ALWAYS },
+ { "RAISE", "TK_RAISE", TRIGGER },
+ { "REFERENCES", "TK_REFERENCES", FKEY },
+ { "REGEXP", "TK_LIKE_KW", ALWAYS },
+ { "REINDEX", "TK_REINDEX", REINDEX },
+ { "RENAME", "TK_RENAME", ALTER },
+ { "REPLACE", "TK_REPLACE", CONFLICT },
+ { "RESTRICT", "TK_RESTRICT", FKEY },
+ { "RIGHT", "TK_JOIN_KW", ALWAYS },
+ { "ROLLBACK", "TK_ROLLBACK", ALWAYS },
+ { "ROW", "TK_ROW", TRIGGER },
+ { "SELECT", "TK_SELECT", ALWAYS },
+ { "SET", "TK_SET", ALWAYS },
+ { "STATEMENT", "TK_STATEMENT", TRIGGER },
+ { "TABLE", "TK_TABLE", ALWAYS },
+ { "TEMP", "TK_TEMP", ALWAYS },
+ { "TEMPORARY", "TK_TEMP", ALWAYS },
+ { "THEN", "TK_THEN", ALWAYS },
+ { "TO", "TK_TO", ALTER },
+ { "TRANSACTION", "TK_TRANSACTION", ALWAYS },
+ { "TRIGGER", "TK_TRIGGER", TRIGGER },
+ { "UNION", "TK_UNION", COMPOUND },
+ { "UNIQUE", "TK_UNIQUE", ALWAYS },
+ { "UPDATE", "TK_UPDATE", ALWAYS },
+ { "USING", "TK_USING", ALWAYS },
+ { "VACUUM", "TK_VACUUM", VACUUM },
+ { "VALUES", "TK_VALUES", ALWAYS },
+ { "VIEW", "TK_VIEW", VIEW },
+ { "WHEN", "TK_WHEN", ALWAYS },
+ { "WHERE", "TK_WHERE", ALWAYS },
+};
+
+/* Number of keywords */
+static int NKEYWORD = (sizeof(aKeywordTable)/sizeof(aKeywordTable[0]));
+
+/* An array to map all upper-case characters into their corresponding
+** lower-case character.
+*/
+const unsigned char sqlite3UpperToLower[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103,
+ 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,
+ 122, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,
+ 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,
+ 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,
+ 162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,
+ 180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,
+ 198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,
+ 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,
+ 234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,
+ 252,253,254,255
+};
+#define UpperToLower sqlite3UpperToLower
+
+/*
+** Comparision function for two Keyword records
+*/
+static int keywordCompare1(const void *a, const void *b){
+ const Keyword *pA = (Keyword*)a;
+ const Keyword *pB = (Keyword*)b;
+ int n = pA->len - pB->len;
+ if( n==0 ){
+ n = strcmp(pA->zName, pB->zName);
+ }
+ return n;
+}
+static int keywordCompare2(const void *a, const void *b){
+ const Keyword *pA = (Keyword*)a;
+ const Keyword *pB = (Keyword*)b;
+ int n = strcmp(pA->zName, pB->zName);
+ return n;
+}
+static int keywordCompare3(const void *a, const void *b){
+ const Keyword *pA = (Keyword*)a;
+ const Keyword *pB = (Keyword*)b;
+ int n = pA->offset - pB->offset;
+ return n;
+}
+
+/*
+** Return a KeywordTable entry with the given id
+*/
+static Keyword *findById(int id){
+ int i;
+ for(i=0; i<NKEYWORD; i++){
+ if( aKeywordTable[i].id==id ) break;
+ }
+ return &aKeywordTable[i];
+}
+
+/*
+** This routine does the work. The generated code is printed on standard
+** output.
+*/
+int main(int argc, char **argv){
+ int i, j, k, h;
+ int bestSize, bestCount;
+ int count;
+ int nChar;
+ int aHash[1000]; /* 1000 is much bigger than NKEYWORD */
+
+ /* Remove entries from the list of keywords that have mask==0 */
+ for(i=j=0; i<NKEYWORD; i++){
+ if( aKeywordTable[i].mask==0 ) continue;
+ if( j<i ){
+ aKeywordTable[j] = aKeywordTable[i];
+ }
+ j++;
+ }
+ NKEYWORD = j;
+
+ /* Fill in the lengths of strings and hashes for all entries. */
+ for(i=0; i<NKEYWORD; i++){
+ Keyword *p = &aKeywordTable[i];
+ p->len = strlen(p->zName);
+ p->hash = (UpperToLower[p->zName[0]]*4) ^
+ (UpperToLower[p->zName[p->len-1]]*3) ^ p->len;
+ p->id = i+1;
+ }
+
+ /* Sort the table from shortest to longest keyword */
+ qsort(aKeywordTable, NKEYWORD, sizeof(aKeywordTable[0]), keywordCompare1);
+
+ /* Look for short keywords embedded in longer keywords */
+ for(i=NKEYWORD-2; i>=0; i--){
+ Keyword *p = &aKeywordTable[i];
+ for(j=NKEYWORD-1; j>i && p->substrId==0; j--){
+ Keyword *pOther = &aKeywordTable[j];
+ if( pOther->substrId ) continue;
+ if( pOther->len<=p->len ) continue;
+ for(k=0; k<=pOther->len-p->len; k++){
+ if( memcmp(p->zName, &pOther->zName[k], p->len)==0 ){
+ p->substrId = pOther->id;
+ p->substrOffset = k;
+ break;
+ }
+ }
+ }
+ }
+
+ /* Sort the table into alphabetical order */
+ qsort(aKeywordTable, NKEYWORD, sizeof(aKeywordTable[0]), keywordCompare2);
+
+ /* Fill in the offset for all entries */
+ nChar = 0;
+ for(i=0; i<NKEYWORD; i++){
+ Keyword *p = &aKeywordTable[i];
+ if( p->offset>0 || p->substrId ) continue;
+ p->offset = nChar;
+ nChar += p->len;
+ for(k=p->len-1; k>=1; k--){
+ for(j=i+1; j<NKEYWORD; j++){
+ Keyword *pOther = &aKeywordTable[j];
+ if( pOther->offset>0 || pOther->substrId ) continue;
+ if( pOther->len<=k ) continue;
+ if( memcmp(&p->zName[p->len-k], pOther->zName, k)==0 ){
+ p = pOther;
+ p->offset = nChar - k;
+ nChar = p->offset + p->len;
+ p->zName += k;
+ p->len -= k;
+ p->prefix = k;
+ j = i;
+ k = p->len;
+ }
+ }
+ }
+ }
+ for(i=0; i<NKEYWORD; i++){
+ Keyword *p = &aKeywordTable[i];
+ if( p->substrId ){
+ p->offset = findById(p->substrId)->offset + p->substrOffset;
+ }
+ }
+
+ /* Sort the table by offset */
+ qsort(aKeywordTable, NKEYWORD, sizeof(aKeywordTable[0]), keywordCompare3);
+
+ /* Figure out how big to make the hash table in order to minimize the
+ ** number of collisions */
+ bestSize = NKEYWORD;
+ bestCount = NKEYWORD*NKEYWORD;
+ for(i=NKEYWORD/2; i<=2*NKEYWORD; i++){
+ for(j=0; j<i; j++) aHash[j] = 0;
+ for(j=0; j<NKEYWORD; j++){
+ h = aKeywordTable[j].hash % i;
+ aHash[h] *= 2;
+ aHash[h]++;
+ }
+ for(j=count=0; j<i; j++) count += aHash[j];
+ if( count<bestCount ){
+ bestCount = count;
+ bestSize = i;
+ }
+ }
+
+ /* Compute the hash */
+ for(i=0; i<bestSize; i++) aHash[i] = 0;
+ for(i=0; i<NKEYWORD; i++){
+ h = aKeywordTable[i].hash % bestSize;
+ aKeywordTable[i].iNext = aHash[h];
+ aHash[h] = i+1;
+ }
+
+ /* Begin generating code */
+ printf("/* Hash score: %d */\n", bestCount);
+ printf("static int keywordCode(const char *z, int n){\n");
+
+ printf(" static const char zText[%d] =\n", nChar+1);
+ for(i=j=0; i<NKEYWORD; i++){
+ Keyword *p = &aKeywordTable[i];
+ if( p->substrId ) continue;
+ if( j==0 ) printf(" \"");
+ printf("%s", p->zName);
+ j += p->len;
+ if( j>60 ){
+ printf("\"\n");
+ j = 0;
+ }
+ }
+ printf("%s;\n", j>0 ? "\"" : " ");
+
+ printf(" static const unsigned char aHash[%d] = {\n", bestSize);
+ for(i=j=0; i<bestSize; i++){
+ if( j==0 ) printf(" ");
+ printf(" %3d,", aHash[i]);
+ j++;
+ if( j>12 ){
+ printf("\n");
+ j = 0;
+ }
+ }
+ printf("%s };\n", j==0 ? "" : "\n");
+
+ printf(" static const unsigned char aNext[%d] = {\n", NKEYWORD);
+ for(i=j=0; i<NKEYWORD; i++){
+ if( j==0 ) printf(" ");
+ printf(" %3d,", aKeywordTable[i].iNext);
+ j++;
+ if( j>12 ){
+ printf("\n");
+ j = 0;
+ }
+ }
+ printf("%s };\n", j==0 ? "" : "\n");
+
+ printf(" static const unsigned char aLen[%d] = {\n", NKEYWORD);
+ for(i=j=0; i<NKEYWORD; i++){
+ if( j==0 ) printf(" ");
+ printf(" %3d,", aKeywordTable[i].len+aKeywordTable[i].prefix);
+ j++;
+ if( j>12 ){
+ printf("\n");
+ j = 0;
+ }
+ }
+ printf("%s };\n", j==0 ? "" : "\n");
+
+ printf(" static const unsigned short int aOffset[%d] = {\n", NKEYWORD);
+ for(i=j=0; i<NKEYWORD; i++){
+ if( j==0 ) printf(" ");
+ printf(" %3d,", aKeywordTable[i].offset);
+ j++;
+ if( j>12 ){
+ printf("\n");
+ j = 0;
+ }
+ }
+ printf("%s };\n", j==0 ? "" : "\n");
+
+ printf(" static const unsigned char aCode[%d] = {\n", NKEYWORD);
+ for(i=j=0; i<NKEYWORD; i++){
+ char *zToken = aKeywordTable[i].zTokenType;
+ if( j==0 ) printf(" ");
+ printf("%s,%*s", zToken, (int)(14-strlen(zToken)), "");
+ j++;
+ if( j>=5 ){
+ printf("\n");
+ j = 0;
+ }
+ }
+ printf("%s };\n", j==0 ? "" : "\n");
+
+ printf(" int h, i;\n");
+ printf(" if( n<2 ) return TK_ID;\n");
+ printf(" h = ((sqlite3UpperToLower[((unsigned char*)z)[0]]*4) ^\n"
+ " (sqlite3UpperToLower[((unsigned char*)z)[n-1]]*3) ^\n"
+ " n) %% %d;\n", bestSize);
+ printf(" for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){\n");
+ printf(" if( aLen[i]==n &&"
+ " sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){\n");
+ printf(" return aCode[i];\n");
+ printf(" }\n");
+ printf(" }\n");
+ printf(" return TK_ID;\n");
+ printf("}\n");
+ printf("int sqlite3KeywordCode(const char *z, int n){\n");
+ printf(" return keywordCode(z, n);\n");
+ printf("}\n");
+
+ return 0;
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/mkopts.tcl b/ext/pdo_sqlite/sqlite/tool/mkopts.tcl
new file mode 100755
index 000000000..e3ddcb9ee
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/mkopts.tcl
@@ -0,0 +1,51 @@
+#!/usr/bin/tclsh
+#
+# This script is used to generate the array of strings and the enum
+# that appear at the beginning of the C code implementation of a
+# a TCL command and that define the available subcommands for that
+# TCL command.
+
+set prefix {}
+while {![eof stdin]} {
+ set line [gets stdin]
+ if {$line==""} continue
+ regsub -all "\[ \t\n,\]+" [string trim $line] { } line
+ foreach token [split $line { }] {
+ if {![regexp {(([a-zA-Z]+)_)?([_a-zA-Z]+)} $token all px p2 name]} continue
+ lappend namelist [string tolower $name]
+ if {$px!=""} {set prefix $p2}
+ }
+}
+
+puts " static const char *${prefix}_strs\[\] = \173"
+set col 0
+proc put_item x {
+ global col
+ if {$col==0} {puts -nonewline " "}
+ if {$col<2} {
+ puts -nonewline [format " %-21s" $x]
+ incr col
+ } else {
+ puts $x
+ set col 0
+ }
+}
+proc finalize {} {
+ global col
+ if {$col>0} {puts {}}
+ set col 0
+}
+
+foreach name [lsort $namelist] {
+ put_item \"$name\",
+}
+put_item 0
+finalize
+puts " \175;"
+puts " enum ${prefix}_enum \173"
+foreach name [lsort $namelist] {
+ regsub -all {@} $name {} name
+ put_item ${prefix}_[string toupper $name],
+}
+finalize
+puts " \175;"
diff --git a/ext/pdo_sqlite/sqlite/tool/opcodeDoc.awk b/ext/pdo_sqlite/sqlite/tool/opcodeDoc.awk
new file mode 100644
index 000000000..492010624
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/opcodeDoc.awk
@@ -0,0 +1,23 @@
+#
+# Extract opcode documentation for sqliteVdbe.c and generate HTML
+#
+BEGIN {
+ print "<html><body bgcolor=white>"
+ print "<h1>SQLite Virtual Database Engine Opcodes</h1>"
+ print "<table>"
+}
+/ Opcode: /,/\*\// {
+ if( $2=="Opcode:" ){
+ printf "<tr><td>%s&nbsp;%s&nbsp;%s&nbsp;%s</td>\n<td>\n", $3, $4, $5, $6
+ }else if( $1=="*/" ){
+ printf "</td></tr>\n"
+ }else if( NF>1 ){
+ sub(/^ *\*\* /,"")
+ gsub(/</,"&lt;")
+ gsub(/&/,"&amp;")
+ print
+ }
+}
+END {
+ print "</table></body></html>"
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/report1.txt b/ext/pdo_sqlite/sqlite/tool/report1.txt
new file mode 100644
index 000000000..7820b8ccf
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/report1.txt
@@ -0,0 +1,66 @@
+The SQL database used for ACD contains 113 tables and indices implemented
+in GDBM. The following are statistics on the sizes of keys and data
+within these tables and indices.
+
+Entries: 962080
+Size: 45573853
+Avg Size: 48
+Key Size: 11045299
+Avg Key Size: 12
+Max Key Size: 99
+
+
+ Size of key Cummulative
+ and data Instances Percentage
+------------ ---------- -----------
+ 0..8 266 0%
+ 9..12 5485 0%
+ 13..16 73633 8%
+ 17..24 180918 27%
+ 25..32 209823 48%
+ 33..40 148995 64%
+ 41..48 76304 72%
+ 49..56 14346 73%
+ 57..64 15725 75%
+ 65..80 44916 80%
+ 81..96 127815 93%
+ 97..112 34769 96%
+ 113..128 13314 98%
+ 129..144 8098 99%
+ 145..160 3355 99%
+ 161..176 1159 99%
+ 177..192 629 99%
+ 193..208 221 99%
+ 209..224 210 99%
+ 225..240 129 99%
+ 241..256 57 99%
+ 257..288 496 99%
+ 289..320 60 99%
+ 321..352 37 99%
+ 353..384 46 99%
+ 385..416 22 99%
+ 417..448 24 99%
+ 449..480 26 99%
+ 481..512 27 99%
+ 513..1024 471 99%
+ 1025..2048 389 99%
+ 2049..4096 182 99%
+ 4097..8192 74 99%
+ 8193..16384 34 99%
+16385..32768 17 99%
+32769..65536 5 99%
+65537..131073 3 100%
+
+
+This information is gathered to help design the new built-in
+backend for sqlite 2.0. Note in particular that 99% of all
+database entries have a combined key and data size of less than
+144 bytes. So if a leaf node in the new database is able to
+store 144 bytes of combined key and data, only 1% of the leaves
+will require overflow pages. Furthermore, note that no key
+is larger than 99 bytes, so if the key will never be on an
+overflow page.
+
+The average combined size of key+data is 48. Add in 16 bytes of
+overhead for a total of 64. That means that a 1K page will
+store (on average) about 16 entries.
diff --git a/ext/pdo_sqlite/sqlite/tool/showdb.c b/ext/pdo_sqlite/sqlite/tool/showdb.c
new file mode 100644
index 000000000..fe105c7bb
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/showdb.c
@@ -0,0 +1,85 @@
+/*
+** A utility for printing all or part of an SQLite database file.
+*/
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+
+static int pagesize = 1024;
+static int db = -1;
+static int mxPage = 0;
+
+static void out_of_memory(void){
+ fprintf(stderr,"Out of memory...\n");
+ exit(1);
+}
+
+static print_page(int iPg){
+ unsigned char *aData;
+ int i, j;
+ aData = malloc(pagesize);
+ if( aData==0 ) out_of_memory();
+ lseek(db, (iPg-1)*pagesize, SEEK_SET);
+ read(db, aData, pagesize);
+ fprintf(stdout, "Page %d:\n", iPg);
+ for(i=0; i<pagesize; i += 16){
+ fprintf(stdout, " %03x: ",i);
+ for(j=0; j<16; j++){
+ fprintf(stdout,"%02x ", aData[i+j]);
+ }
+ for(j=0; j<16; j++){
+ fprintf(stdout,"%c", isprint(aData[i+j]) ? aData[i+j] : '.');
+ }
+ fprintf(stdout,"\n");
+ }
+ free(aData);
+}
+
+int main(int argc, char **argv){
+ struct stat sbuf;
+ if( argc<2 ){
+ fprintf(stderr,"Usage: %s FILENAME ?PAGE? ...\n", argv[0]);
+ exit(1);
+ }
+ db = open(argv[1], O_RDONLY);
+ if( db<0 ){
+ fprintf(stderr,"%s: can't open %s\n", argv[0], argv[1]);
+ exit(1);
+ }
+ fstat(db, &sbuf);
+ mxPage = sbuf.st_size/pagesize + 1;
+ if( argc==2 ){
+ int i;
+ for(i=1; i<=mxPage; i++) print_page(i);
+ }else{
+ int i;
+ for(i=2; i<argc; i++){
+ int iStart, iEnd;
+ char *zLeft;
+ iStart = strtol(argv[i], &zLeft, 0);
+ if( zLeft && strcmp(zLeft,"..end")==0 ){
+ iEnd = mxPage;
+ }else if( zLeft && zLeft[0]=='.' && zLeft[1]=='.' ){
+ iEnd = strtol(&zLeft[2], 0, 0);
+ }else{
+ iEnd = iStart;
+ }
+ if( iStart<1 || iEnd<iStart || iEnd>mxPage ){
+ fprintf(stderr,
+ "Page argument should be LOWER?..UPPER?. Range 1 to %d\n",
+ mxPage);
+ exit(1);
+ }
+ while( iStart<=iEnd ){
+ print_page(iStart);
+ iStart++;
+ }
+ }
+ }
+ close(db);
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/showjournal.c b/ext/pdo_sqlite/sqlite/tool/showjournal.c
new file mode 100644
index 000000000..ec93c9190
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/showjournal.c
@@ -0,0 +1,76 @@
+/*
+** A utility for printing an SQLite database journal.
+*/
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+
+static int pagesize = 1024;
+static int db = -1;
+static int mxPage = 0;
+
+static void out_of_memory(void){
+ fprintf(stderr,"Out of memory...\n");
+ exit(1);
+}
+
+static print_page(int iPg){
+ unsigned char *aData;
+ int i, j;
+ aData = malloc(pagesize);
+ if( aData==0 ) out_of_memory();
+ read(db, aData, pagesize);
+ fprintf(stdout, "Page %d:\n", iPg);
+ for(i=0; i<pagesize; i += 16){
+ fprintf(stdout, " %03x: ",i);
+ for(j=0; j<16; j++){
+ fprintf(stdout,"%02x ", aData[i+j]);
+ }
+ for(j=0; j<16; j++){
+ fprintf(stdout,"%c", isprint(aData[i+j]) ? aData[i+j] : '.');
+ }
+ fprintf(stdout,"\n");
+ }
+ free(aData);
+}
+
+int main(int argc, char **argv){
+ struct stat sbuf;
+ unsigned int u;
+ int rc;
+ unsigned char zBuf[10];
+ unsigned char zBuf2[sizeof(u)];
+ if( argc!=2 ){
+ fprintf(stderr,"Usage: %s FILENAME\n", argv[0]);
+ exit(1);
+ }
+ db = open(argv[1], O_RDONLY);
+ if( db<0 ){
+ fprintf(stderr,"%s: can't open %s\n", argv[0], argv[1]);
+ exit(1);
+ }
+ read(db, zBuf, 8);
+ if( zBuf[7]==0xd6 ){
+ read(db, &u, sizeof(u));
+ printf("Records in Journal: %u\n", u);
+ read(db, &u, sizeof(u));
+ printf("Magic Number: 0x%08x\n", u);
+ }
+ read(db, zBuf2, sizeof(zBuf2));
+ u = zBuf2[0]<<24 | zBuf2[1]<<16 | zBuf2[2]<<8 | zBuf2[3];
+ printf("Database Size: %u\n", u);
+ while( read(db, zBuf2, sizeof(zBuf2))==sizeof(zBuf2) ){
+ u = zBuf2[0]<<24 | zBuf2[1]<<16 | zBuf2[2]<<8 | zBuf2[3];
+ print_page(u);
+ if( zBuf[7]==0xd6 ){
+ read(db, &u, sizeof(u));
+ printf("Checksum: 0x%08x\n", u);
+ }
+ }
+ close(db);
+}
diff --git a/ext/pdo_sqlite/sqlite/tool/space_used.tcl b/ext/pdo_sqlite/sqlite/tool/space_used.tcl
new file mode 100644
index 000000000..2044aa38c
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/space_used.tcl
@@ -0,0 +1,111 @@
+# Run this TCL script using "testfixture" in order get a report that shows
+# how much disk space is used by a particular data to actually store data
+# versus how much space is unused.
+#
+
+# Get the name of the database to analyze
+#
+if {[llength $argv]!=1} {
+ puts stderr "Usage: $argv0 database-name"
+ exit 1
+}
+set file_to_analyze [lindex $argv 0]
+
+# Open the database
+#
+sqlite db [lindex $argv 0]
+set DB [btree_open [lindex $argv 0]]
+
+# Output the schema for the generated report
+#
+puts \
+{BEGIN;
+CREATE TABLE space_used(
+ name clob, -- Name of a table or index in the database file
+ is_index boolean, -- TRUE if it is an index, false for a table
+ payload int, -- Total amount of data stored in this table or index
+ pri_pages int, -- Number of primary pages used
+ ovfl_pages int, -- Number of overflow pages used
+ pri_unused int, -- Number of unused bytes on primary pages
+ ovfl_unused int -- Number of unused bytes on overflow pages
+);}
+
+# This query will be used to find the root page number for every index and
+# table in the database.
+#
+set sql {
+ SELECT name, type, rootpage FROM sqlite_master
+ UNION ALL
+ SELECT 'sqlite_master', 'table', 2
+ ORDER BY 1
+}
+
+# Initialize variables used for summary statistics.
+#
+set total_size 0
+set total_primary 0
+set total_overflow 0
+set total_unused_primary 0
+set total_unused_ovfl 0
+
+# Analyze every table in the database, one at a time.
+#
+foreach {name type rootpage} [db eval $sql] {
+ set cursor [btree_cursor $DB $rootpage 0]
+ set go [btree_first $cursor]
+ set size 0
+ catch {unset pg_used}
+ set unused_ovfl 0
+ set n_overflow 0
+ while {$go==0} {
+ set payload [btree_payload_size $cursor]
+ incr size $payload
+ set stat [btree_cursor_dump $cursor]
+ set pgno [lindex $stat 0]
+ set freebytes [lindex $stat 4]
+ set pg_used($pgno) $freebytes
+ if {$payload>238} {
+ set n [expr {($payload-238+1019)/1020}]
+ incr n_overflow $n
+ incr unused_ovfl [expr {$n*1020+238-$payload}]
+ }
+ set go [btree_next $cursor]
+ }
+ btree_close_cursor $cursor
+ set n_primary [llength [array names pg_used]]
+ set unused_primary 0
+ foreach x [array names pg_used] {incr unused_primary $pg_used($x)}
+ regsub -all ' $name '' name
+ puts -nonewline "INSERT INTO space_used VALUES('$name'"
+ puts -nonewline ",[expr {$type=="index"}]"
+ puts ",$size,$n_primary,$n_overflow,$unused_primary,$unused_ovfl);"
+ incr total_size $size
+ incr total_primary $n_primary
+ incr total_overflow $n_overflow
+ incr total_unused_primary $unused_primary
+ incr total_unused_ovfl $unused_ovfl
+}
+
+# Output summary statistics:
+#
+puts "-- Total payload size: $total_size"
+puts "-- Total pages used: $total_primary primary and $total_overflow overflow"
+set file_pgcnt [expr {[file size [lindex $argv 0]]/1024}]
+puts -nonewline "-- Total unused bytes on primary pages: $total_unused_primary"
+if {$total_primary>0} {
+ set upp [expr {$total_unused_primary/$total_primary}]
+ puts " (avg $upp bytes/page)"
+} else {
+ puts ""
+}
+puts -nonewline "-- Total unused bytes on overflow pages: $total_unused_ovfl"
+if {$total_overflow>0} {
+ set upp [expr {$total_unused_ovfl/$total_overflow}]
+ puts " (avg $upp bytes/page)"
+} else {
+ puts ""
+}
+set n_free [expr {$file_pgcnt-$total_primary-$total_overflow}]
+if {$n_free>0} {incr n_free -1}
+puts "-- Total pages on freelist: $n_free"
+puts "COMMIT;"
diff --git a/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl b/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl
new file mode 100644
index 000000000..c9b8f92e2
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl
@@ -0,0 +1,801 @@
+# Run this TCL script using "testfixture" in order get a report that shows
+# how much disk space is used by a particular data to actually store data
+# versus how much space is unused.
+#
+
+# Get the name of the database to analyze
+#
+#set argv $argv0
+if {[llength $argv]!=1} {
+ puts stderr "Usage: $argv0 database-name"
+ exit 1
+}
+set file_to_analyze [lindex $argv 0]
+if {![file exists $file_to_analyze]} {
+ puts stderr "No such file: $file_to_analyze"
+ exit 1
+}
+if {![file readable $file_to_analyze]} {
+ puts stderr "File is not readable: $file_to_analyze"
+ exit 1
+}
+if {[file size $file_to_analyze]<512} {
+ puts stderr "Empty or malformed database: $file_to_analyze"
+ exit 1
+}
+
+# Open the database
+#
+sqlite3 db [lindex $argv 0]
+set DB [btree_open [lindex $argv 0] 1000 0]
+
+# In-memory database for collecting statistics. This script loops through
+# the tables and indices in the database being analyzed, adding a row for each
+# to an in-memory database (for which the schema is shown below). It then
+# queries the in-memory db to produce the space-analysis report.
+#
+sqlite3 mem :memory:
+set tabledef\
+{CREATE TABLE space_used(
+ name clob, -- Name of a table or index in the database file
+ tblname clob, -- Name of associated table
+ is_index boolean, -- TRUE if it is an index, false for a table
+ nentry int, -- Number of entries in the BTree
+ leaf_entries int, -- Number of leaf entries
+ payload int, -- Total amount of data stored in this table or index
+ ovfl_payload int, -- Total amount of data stored on overflow pages
+ ovfl_cnt int, -- Number of entries that use overflow
+ mx_payload int, -- Maximum payload size
+ int_pages int, -- Number of interior pages used
+ leaf_pages int, -- Number of leaf pages used
+ ovfl_pages int, -- Number of overflow pages used
+ int_unused int, -- Number of unused bytes on interior pages
+ leaf_unused int, -- Number of unused bytes on primary pages
+ ovfl_unused int -- Number of unused bytes on overflow pages
+);}
+mem eval $tabledef
+
+proc integerify {real} {
+ return [expr int($real)]
+}
+mem function int integerify
+
+# Quote a string for use in an SQL query. Examples:
+#
+# [quote {hello world}] == {'hello world'}
+# [quote {hello world's}] == {'hello world''s'}
+#
+proc quote {txt} {
+ regsub -all ' $txt '' q
+ return '$q'
+}
+
+# This proc is a wrapper around the btree_cursor_info command. The
+# second argument is an open btree cursor returned by [btree_cursor].
+# The first argument is the name of an array variable that exists in
+# the scope of the caller. If the third argument is non-zero, then
+# info is returned for the page that lies $up entries upwards in the
+# tree-structure. (i.e. $up==1 returns the parent page, $up==2 the
+# grandparent etc.)
+#
+# The following entries in that array are filled in with information retrieved
+# using [btree_cursor_info]:
+#
+# $arrayvar(page_no) = The page number
+# $arrayvar(entry_no) = The entry number
+# $arrayvar(page_entries) = Total number of entries on this page
+# $arrayvar(cell_size) = Cell size (local payload + header)
+# $arrayvar(page_freebytes) = Number of free bytes on this page
+# $arrayvar(page_freeblocks) = Number of free blocks on the page
+# $arrayvar(payload_bytes) = Total payload size (local + overflow)
+# $arrayvar(header_bytes) = Header size in bytes
+# $arrayvar(local_payload_bytes) = Local payload size
+# $arrayvar(parent) = Parent page number
+#
+proc cursor_info {arrayvar csr {up 0}} {
+ upvar $arrayvar a
+ foreach [list a(page_no) \
+ a(entry_no) \
+ a(page_entries) \
+ a(cell_size) \
+ a(page_freebytes) \
+ a(page_freeblocks) \
+ a(payload_bytes) \
+ a(header_bytes) \
+ a(local_payload_bytes) \
+ a(parent) ] [btree_cursor_info $csr $up] {}
+}
+
+# Determine the page-size of the database. This global variable is used
+# throughout the script.
+#
+set pageSize [db eval {PRAGMA page_size}]
+
+# Analyze every table in the database, one at a time.
+#
+# The following query returns the name and root-page of each table in the
+# database, including the sqlite_master table.
+#
+set sql {
+ SELECT name, rootpage FROM sqlite_master WHERE type='table'
+ UNION ALL
+ SELECT 'sqlite_master', 1
+ ORDER BY 1
+}
+foreach {name rootpage} [db eval $sql] {
+ puts stderr "Analyzing table $name..."
+
+ # Code below traverses the table being analyzed (table name $name), using the
+ # btree cursor $cursor. Statistics related to table $name are accumulated in
+ # the following variables:
+ #
+ set total_payload 0 ;# Payload space used by all entries
+ set total_ovfl 0 ;# Payload space on overflow pages
+ set unused_int 0 ;# Unused space on interior nodes
+ set unused_leaf 0 ;# Unused space on leaf nodes
+ set unused_ovfl 0 ;# Unused space on overflow pages
+ set cnt_ovfl 0 ;# Number of entries that use overflows
+ set cnt_leaf_entry 0 ;# Number of leaf entries
+ set cnt_int_entry 0 ;# Number of interor entries
+ set mx_payload 0 ;# Maximum payload size
+ set ovfl_pages 0 ;# Number of overflow pages used
+ set leaf_pages 0 ;# Number of leaf pages
+ set int_pages 0 ;# Number of interior pages
+
+ # As the btree is traversed, the array variable $seen($pgno) is set to 1
+ # the first time page $pgno is encountered.
+ #
+ catch {unset seen}
+
+ # The following loop runs once for each entry in table $name. The table
+ # is traversed using the btree cursor stored in variable $csr
+ #
+ set csr [btree_cursor $DB $rootpage 0]
+ for {btree_first $csr} {![btree_eof $csr]} {btree_next $csr} {
+ incr cnt_leaf_entry
+
+ # Retrieve information about the entry the btree-cursor points to into
+ # the array variable $ci (cursor info).
+ #
+ cursor_info ci $csr
+
+ # Check if the payload of this entry is greater than the current
+ # $mx_payload statistic for the table. Also increase the $total_payload
+ # statistic.
+ #
+ if {$ci(payload_bytes)>$mx_payload} {set mx_payload $ci(payload_bytes)}
+ incr total_payload $ci(payload_bytes)
+
+ # If this entry uses overflow pages, then update the $cnt_ovfl,
+ # $total_ovfl, $ovfl_pages and $unused_ovfl statistics.
+ #
+ set ovfl [expr {$ci(payload_bytes)-$ci(local_payload_bytes)}]
+ if {$ovfl} {
+ incr cnt_ovfl
+ incr total_ovfl $ovfl
+ set n [expr {int(ceil($ovfl/($pageSize-4.0)))}]
+ incr ovfl_pages $n
+ incr unused_ovfl [expr {$n*($pageSize-4) - $ovfl}]
+ }
+
+ # If this is the first table entry analyzed for the page, then update
+ # the page-related statistics $leaf_pages and $unused_leaf. Also, if
+ # this page has a parent page that has not been analyzed, retrieve
+ # info for the parent and update statistics for it too.
+ #
+ if {![info exists seen($ci(page_no))]} {
+ set seen($ci(page_no)) 1
+ incr leaf_pages
+ incr unused_leaf $ci(page_freebytes)
+
+ # Now check if the page has a parent that has not been analyzed. If
+ # so, update the $int_pages, $cnt_int_entry and $unused_int statistics
+ # accordingly. Then check if the parent page has a parent that has
+ # not yet been analyzed etc.
+ #
+ # set parent $ci(parent_page_no)
+ for {set up 1} \
+ {$ci(parent)!=0 && ![info exists seen($ci(parent))]} {incr up} \
+ {
+ # Mark the parent as seen.
+ #
+ set seen($ci(parent)) 1
+
+ # Retrieve info for the parent and update statistics.
+ cursor_info ci $csr $up
+ incr int_pages
+ incr cnt_int_entry $ci(page_entries)
+ incr unused_int $ci(page_freebytes)
+ }
+ }
+ }
+ btree_close_cursor $csr
+
+ # Handle the special case where a table contains no data. In this case
+ # all statistics are zero, except for the number of leaf pages (1) and
+ # the unused bytes on leaf pages ($pageSize - 8).
+ #
+ # An exception to the above is the sqlite_master table. If it is empty
+ # then all statistics are zero except for the number of leaf pages (1),
+ # and the number of unused bytes on leaf pages ($pageSize - 112).
+ #
+ if {[llength [array names seen]]==0} {
+ set leaf_pages 1
+ if {$rootpage==1} {
+ set unused_leaf [expr {$pageSize-112}]
+ } else {
+ set unused_leaf [expr {$pageSize-8}]
+ }
+ }
+
+ # Insert the statistics for the table analyzed into the in-memory database.
+ #
+ set sql "INSERT INTO space_used VALUES("
+ append sql [quote $name]
+ append sql ",[quote $name]"
+ append sql ",0"
+ append sql ",[expr {$cnt_leaf_entry+$cnt_int_entry}]"
+ append sql ",$cnt_leaf_entry"
+ append sql ",$total_payload"
+ append sql ",$total_ovfl"
+ append sql ",$cnt_ovfl"
+ append sql ",$mx_payload"
+ append sql ",$int_pages"
+ append sql ",$leaf_pages"
+ append sql ",$ovfl_pages"
+ append sql ",$unused_int"
+ append sql ",$unused_leaf"
+ append sql ",$unused_ovfl"
+ append sql );
+ mem eval $sql
+}
+
+# Analyze every index in the database, one at a time.
+#
+# The query below returns the name, associated table and root-page number
+# for every index in the database.
+#
+set sql {
+ SELECT name, tbl_name, rootpage FROM sqlite_master WHERE type='index'
+ ORDER BY 2, 1
+}
+foreach {name tbl_name rootpage} [db eval $sql] {
+ puts stderr "Analyzing index $name of table $tbl_name..."
+
+ # Code below traverses the index being analyzed (index name $name), using the
+ # btree cursor $cursor. Statistics related to index $name are accumulated in
+ # the following variables:
+ #
+ set total_payload 0 ;# Payload space used by all entries
+ set total_ovfl 0 ;# Payload space on overflow pages
+ set unused_leaf 0 ;# Unused space on leaf nodes
+ set unused_ovfl 0 ;# Unused space on overflow pages
+ set cnt_ovfl 0 ;# Number of entries that use overflows
+ set cnt_leaf_entry 0 ;# Number of leaf entries
+ set mx_payload 0 ;# Maximum payload size
+ set ovfl_pages 0 ;# Number of overflow pages used
+ set leaf_pages 0 ;# Number of leaf pages
+
+ # As the btree is traversed, the array variable $seen($pgno) is set to 1
+ # the first time page $pgno is encountered.
+ #
+ catch {unset seen}
+
+ # The following loop runs once for each entry in index $name. The index
+ # is traversed using the btree cursor stored in variable $csr
+ #
+ set csr [btree_cursor $DB $rootpage 0]
+ for {btree_first $csr} {![btree_eof $csr]} {btree_next $csr} {
+ incr cnt_leaf_entry
+
+ # Retrieve information about the entry the btree-cursor points to into
+ # the array variable $ci (cursor info).
+ #
+ cursor_info ci $csr
+
+ # Check if the payload of this entry is greater than the current
+ # $mx_payload statistic for the table. Also increase the $total_payload
+ # statistic.
+ #
+ set payload [btree_keysize $csr]
+ if {$payload>$mx_payload} {set mx_payload $payload}
+ incr total_payload $payload
+
+ # If this entry uses overflow pages, then update the $cnt_ovfl,
+ # $total_ovfl, $ovfl_pages and $unused_ovfl statistics.
+ #
+ set ovfl [expr {$payload-$ci(local_payload_bytes)}]
+ if {$ovfl} {
+ incr cnt_ovfl
+ incr total_ovfl $ovfl
+ set n [expr {int(ceil($ovfl/($pageSize-4.0)))}]
+ incr ovfl_pages $n
+ incr unused_ovfl [expr {$n*($pageSize-4) - $ovfl}]
+ }
+
+ # If this is the first table entry analyzed for the page, then update
+ # the page-related statistics $leaf_pages and $unused_leaf.
+ #
+ if {![info exists seen($ci(page_no))]} {
+ set seen($ci(page_no)) 1
+ incr leaf_pages
+ incr unused_leaf $ci(page_freebytes)
+ }
+ }
+ btree_close_cursor $csr
+
+ # Handle the special case where a index contains no data. In this case
+ # all statistics are zero, except for the number of leaf pages (1) and
+ # the unused bytes on leaf pages ($pageSize - 8).
+ #
+ if {[llength [array names seen]]==0} {
+ set leaf_pages 1
+ set unused_leaf [expr {$pageSize-8}]
+ }
+
+ # Insert the statistics for the index analyzed into the in-memory database.
+ #
+ set sql "INSERT INTO space_used VALUES("
+ append sql [quote $name]
+ append sql ",[quote $tbl_name]"
+ append sql ",1"
+ append sql ",$cnt_leaf_entry"
+ append sql ",$cnt_leaf_entry"
+ append sql ",$total_payload"
+ append sql ",$total_ovfl"
+ append sql ",$cnt_ovfl"
+ append sql ",$mx_payload"
+ append sql ",0"
+ append sql ",$leaf_pages"
+ append sql ",$ovfl_pages"
+ append sql ",0"
+ append sql ",$unused_leaf"
+ append sql ",$unused_ovfl"
+ append sql );
+ mem eval $sql
+}
+
+# Generate a single line of output in the statistics section of the
+# report.
+#
+proc statline {title value {extra {}}} {
+ set len [string length $title]
+ set dots [string range {......................................} $len end]
+ set len [string length $value]
+ set sp2 [string range { } $len end]
+ if {$extra ne ""} {
+ set extra " $extra"
+ }
+ puts "$title$dots $value$sp2$extra"
+}
+
+# Generate a formatted percentage value for $num/$denom
+#
+proc percent {num denom {of {}}} {
+ if {$denom==0.0} {return ""}
+ set v [expr {$num*100.0/$denom}]
+ set of {}
+ if {$v==100.0 || $v<0.001 || ($v>1.0 && $v<99.0)} {
+ return [format {%5.1f%% %s} $v $of]
+ } elseif {$v<0.1 || $v>99.9} {
+ return [format {%7.3f%% %s} $v $of]
+ } else {
+ return [format {%6.2f%% %s} $v $of]
+ }
+}
+
+proc divide {num denom} {
+ if {$denom==0} {return 0.0}
+ return [format %.2f [expr double($num)/double($denom)]]
+}
+
+# Generate a subreport that covers some subset of the database.
+# the $where clause determines which subset to analyze.
+#
+proc subreport {title where} {
+ global pageSize file_pgcnt
+
+ # Query the in-memory database for the sum of various statistics
+ # for the subset of tables/indices identified by the WHERE clause in
+ # $where. Note that even if the WHERE clause matches no rows, the
+ # following query returns exactly one row (because it is an aggregate).
+ #
+ # The results of the query are stored directly by SQLite into local
+ # variables (i.e. $nentry, $nleaf etc.).
+ #
+ mem eval "
+ SELECT
+ int(sum(nentry)) AS nentry,
+ int(sum(leaf_entries)) AS nleaf,
+ int(sum(payload)) AS payload,
+ int(sum(ovfl_payload)) AS ovfl_payload,
+ max(mx_payload) AS mx_payload,
+ int(sum(ovfl_cnt)) as ovfl_cnt,
+ int(sum(leaf_pages)) AS leaf_pages,
+ int(sum(int_pages)) AS int_pages,
+ int(sum(ovfl_pages)) AS ovfl_pages,
+ int(sum(leaf_unused)) AS leaf_unused,
+ int(sum(int_unused)) AS int_unused,
+ int(sum(ovfl_unused)) AS ovfl_unused
+ FROM space_used WHERE $where" {} {}
+
+ # Output the sub-report title, nicely decorated with * characters.
+ #
+ puts ""
+ set len [string length $title]
+ set stars [string repeat * [expr 65-$len]]
+ puts "*** $title $stars"
+ puts ""
+
+ # Calculate statistics and store the results in TCL variables, as follows:
+ #
+ # total_pages: Database pages consumed.
+ # total_pages_percent: Pages consumed as a percentage of the file.
+ # storage: Bytes consumed.
+ # payload_percent: Payload bytes used as a percentage of $storage.
+ # total_unused: Unused bytes on pages.
+ # avg_payload: Average payload per btree entry.
+ # avg_fanout: Average fanout for internal pages.
+ # avg_unused: Average unused bytes per btree entry.
+ # ovfl_cnt_percent: Percentage of btree entries that use overflow pages.
+ #
+ set total_pages [expr {$leaf_pages+$int_pages+$ovfl_pages}]
+ set total_pages_percent [percent $total_pages $file_pgcnt]
+ set storage [expr {$total_pages*$pageSize}]
+ set payload_percent [percent $payload $storage {of storage consumed}]
+ set total_unused [expr {$ovfl_unused+$int_unused+$leaf_unused}]
+ set avg_payload [divide $payload $nleaf]
+ set avg_unused [divide $total_unused $nleaf]
+ if {$int_pages>0} {
+ # TODO: Is this formula correct?
+ set nTab [mem eval "
+ SELECT count(*) FROM (
+ SELECT DISTINCT tblname FROM space_used WHERE $where AND is_index=0
+ )
+ "]
+ set avg_fanout [mem eval "
+ SELECT (sum(leaf_pages+int_pages)-$nTab)/sum(int_pages) FROM space_used
+ WHERE $where AND is_index = 0
+ "]
+ set avg_fanout [format %.2f $avg_fanout]
+ }
+ set ovfl_cnt_percent [percent $ovfl_cnt $nleaf {of all entries}]
+
+ # Print out the sub-report statistics.
+ #
+ statline {Percentage of total database} $total_pages_percent
+ statline {Number of entries} $nleaf
+ statline {Bytes of storage consumed} $storage
+ statline {Bytes of payload} $payload $payload_percent
+ statline {Average payload per entry} $avg_payload
+ statline {Average unused bytes per entry} $avg_unused
+ if {[info exists avg_fanout]} {
+ statline {Average fanout} $avg_fanout
+ }
+ statline {Maximum payload per entry} $mx_payload
+ statline {Entries that use overflow} $ovfl_cnt $ovfl_cnt_percent
+ if {$int_pages>0} {
+ statline {Index pages used} $int_pages
+ }
+ statline {Primary pages used} $leaf_pages
+ statline {Overflow pages used} $ovfl_pages
+ statline {Total pages used} $total_pages
+ if {$int_unused>0} {
+ set int_unused_percent \
+ [percent $int_unused [expr {$int_pages*$pageSize}] {of index space}]
+ statline "Unused bytes on index pages" $int_unused $int_unused_percent
+ }
+ statline "Unused bytes on primary pages" $leaf_unused \
+ [percent $leaf_unused [expr {$leaf_pages*$pageSize}] {of primary space}]
+ statline "Unused bytes on overflow pages" $ovfl_unused \
+ [percent $ovfl_unused [expr {$ovfl_pages*$pageSize}] {of overflow space}]
+ statline "Unused bytes on all pages" $total_unused \
+ [percent $total_unused $storage {of all space}]
+ return 1
+}
+
+# Calculate the overhead in pages caused by auto-vacuum.
+#
+# This procedure calculates and returns the number of pages used by the
+# auto-vacuum 'pointer-map'. If the database does not support auto-vacuum,
+# then 0 is returned. The two arguments are the size of the database file in
+# pages and the page size used by the database (in bytes).
+proc autovacuum_overhead {filePages pageSize} {
+
+ # Read the value of meta 4. If non-zero, then the database supports
+ # auto-vacuum. It would be possible to use "PRAGMA auto_vacuum" instead,
+ # but that would not work if the SQLITE_OMIT_PRAGMA macro was defined
+ # when the library was built.
+ set meta4 [lindex [btree_get_meta $::DB] 4]
+
+ # If the database is not an auto-vacuum database or the file consists
+ # of one page only then there is no overhead for auto-vacuum. Return zero.
+ if {0==$meta4 || $filePages==1} {
+ return 0
+ }
+
+ # The number of entries on each pointer map page. The layout of the
+ # database file is one pointer-map page, followed by $ptrsPerPage other
+ # pages, followed by a pointer-map page etc. The first pointer-map page
+ # is the second page of the file overall.
+ set ptrsPerPage [expr double($pageSize/5)]
+
+ # Return the number of pointer map pages in the database.
+ return [expr int(ceil( ($filePages-1.0)/($ptrsPerPage+1.0) ))]
+}
+
+
+# Calculate the summary statistics for the database and store the results
+# in TCL variables. They are output below. Variables are as follows:
+#
+# pageSize: Size of each page in bytes.
+# file_bytes: File size in bytes.
+# file_pgcnt: Number of pages in the file.
+# file_pgcnt2: Number of pages in the file (calculated).
+# av_pgcnt: Pages consumed by the auto-vacuum pointer-map.
+# av_percent: Percentage of the file consumed by auto-vacuum pointer-map.
+# inuse_pgcnt: Data pages in the file.
+# inuse_percent: Percentage of pages used to store data.
+# free_pgcnt: Free pages calculated as (<total pages> - <in-use pages>)
+# free_pgcnt2: Free pages in the file according to the file header.
+# free_percent: Percentage of file consumed by free pages (calculated).
+# free_percent2: Percentage of file consumed by free pages (header).
+# ntable: Number of tables in the db.
+# nindex: Number of indices in the db.
+# nautoindex: Number of indices created automatically.
+# nmanindex: Number of indices created manually.
+# user_payload: Number of bytes of payload in table btrees
+# (not including sqlite_master)
+# user_percent: $user_payload as a percentage of total file size.
+
+set file_bytes [file size $file_to_analyze]
+set file_pgcnt [expr {$file_bytes/$pageSize}]
+
+set av_pgcnt [autovacuum_overhead $file_pgcnt $pageSize]
+set av_percent [percent $av_pgcnt $file_pgcnt]
+
+set sql {SELECT sum(leaf_pages+int_pages+ovfl_pages) FROM space_used}
+set inuse_pgcnt [expr int([mem eval $sql])]
+set inuse_percent [percent $inuse_pgcnt $file_pgcnt]
+
+set free_pgcnt [expr $file_pgcnt-$inuse_pgcnt-$av_pgcnt]
+set free_percent [percent $free_pgcnt $file_pgcnt]
+set free_pgcnt2 [lindex [btree_get_meta $DB] 0]
+set free_percent2 [percent $free_pgcnt2 $file_pgcnt]
+
+set file_pgcnt2 [expr {$inuse_pgcnt+$free_pgcnt2+$av_pgcnt}]
+
+set ntable [db eval {SELECT count(*)+1 FROM sqlite_master WHERE type='table'}]
+set nindex [db eval {SELECT count(*) FROM sqlite_master WHERE type='index'}]
+set sql {SELECT count(*) FROM sqlite_master WHERE name LIKE 'sqlite_autoindex%'}
+set nautoindex [db eval $sql]
+set nmanindex [expr {$nindex-$nautoindex}]
+
+# set total_payload [mem eval "SELECT sum(payload) FROM space_used"]
+set user_payload [mem one {SELECT int(sum(payload)) FROM space_used
+ WHERE NOT is_index AND name NOT LIKE 'sqlite_master'}]
+set user_percent [percent $user_payload $file_bytes]
+
+# Output the summary statistics calculated above.
+#
+puts "/** Disk-Space Utilization Report For $file_to_analyze"
+puts "*** As of [clock format [clock seconds] -format {%Y-%b-%d %H:%M:%S}]"
+puts ""
+statline {Page size in bytes} $pageSize
+statline {Pages in the whole file (measured)} $file_pgcnt
+statline {Pages in the whole file (calculated)} $file_pgcnt2
+statline {Pages that store data} $inuse_pgcnt $inuse_percent
+statline {Pages on the freelist (per header)} $free_pgcnt2 $free_percent2
+statline {Pages on the freelist (calculated)} $free_pgcnt $free_percent
+statline {Pages of auto-vacuum overhead} $av_pgcnt $av_percent
+statline {Number of tables in the database} $ntable
+statline {Number of indices} $nindex
+statline {Number of named indices} $nmanindex
+statline {Automatically generated indices} $nautoindex
+statline {Size of the file in bytes} $file_bytes
+statline {Bytes of user payload stored} $user_payload $user_percent
+
+# Output table rankings
+#
+puts ""
+puts "*** Page counts for all tables with their indices ********************"
+puts ""
+mem eval {SELECT tblname, count(*) AS cnt,
+ int(sum(int_pages+leaf_pages+ovfl_pages)) AS size
+ FROM space_used GROUP BY tblname ORDER BY size+0 DESC, tblname} {} {
+ statline [string toupper $tblname] $size [percent $size $file_pgcnt]
+}
+
+# Output subreports
+#
+if {$nindex>0} {
+ subreport {All tables and indices} 1
+}
+subreport {All tables} {NOT is_index}
+if {$nindex>0} {
+ subreport {All indices} {is_index}
+}
+foreach tbl [mem eval {SELECT name FROM space_used WHERE NOT is_index
+ ORDER BY name}] {
+ regsub ' $tbl '' qn
+ set name [string toupper $tbl]
+ set n [mem eval "SELECT count(*) FROM space_used WHERE tblname='$qn'"]
+ if {$n>1} {
+ subreport "Table $name and all its indices" "tblname='$qn'"
+ subreport "Table $name w/o any indices" "name='$qn'"
+ subreport "Indices of table $name" "tblname='$qn' AND is_index"
+ } else {
+ subreport "Table $name" "name='$qn'"
+ }
+}
+
+# Output instructions on what the numbers above mean.
+#
+puts {
+*** Definitions ******************************************************
+
+Page size in bytes
+
+ The number of bytes in a single page of the database file.
+ Usually 1024.
+
+Number of pages in the whole file
+}
+puts \
+" The number of $pageSize-byte pages that go into forming the complete
+ database"
+puts \
+{
+Pages that store data
+
+ The number of pages that store data, either as primary B*Tree pages or
+ as overflow pages. The number at the right is the data pages divided by
+ the total number of pages in the file.
+
+Pages on the freelist
+
+ The number of pages that are not currently in use but are reserved for
+ future use. The percentage at the right is the number of freelist pages
+ divided by the total number of pages in the file.
+
+Pages of auto-vacuum overhead
+
+ The number of pages that store data used by the database to facilitate
+ auto-vacuum. This is zero for databases that do not support auto-vacuum.
+
+Number of tables in the database
+
+ The number of tables in the database, including the SQLITE_MASTER table
+ used to store schema information.
+
+Number of indices
+
+ The total number of indices in the database.
+
+Number of named indices
+
+ The number of indices created using an explicit CREATE INDEX statement.
+
+Automatically generated indices
+
+ The number of indices used to implement PRIMARY KEY or UNIQUE constraints
+ on tables.
+
+Size of the file in bytes
+
+ The total amount of disk space used by the entire database files.
+
+Bytes of user payload stored
+
+ The total number of bytes of user payload stored in the database. The
+ schema information in the SQLITE_MASTER table is not counted when
+ computing this number. The percentage at the right shows the payload
+ divided by the total file size.
+
+Percentage of total database
+
+ The amount of the complete database file that is devoted to storing
+ information described by this category.
+
+Number of entries
+
+ The total number of B-Tree key/value pairs stored under this category.
+
+Bytes of storage consumed
+
+ The total amount of disk space required to store all B-Tree entries
+ under this category. The is the total number of pages used times
+ the pages size.
+
+Bytes of payload
+
+ The amount of payload stored under this category. Payload is the data
+ part of table entries and the key part of index entries. The percentage
+ at the right is the bytes of payload divided by the bytes of storage
+ consumed.
+
+Average payload per entry
+
+ The average amount of payload on each entry. This is just the bytes of
+ payload divided by the number of entries.
+
+Average unused bytes per entry
+
+ The average amount of free space remaining on all pages under this
+ category on a per-entry basis. This is the number of unused bytes on
+ all pages divided by the number of entries.
+
+Maximum payload per entry
+
+ The largest payload size of any entry.
+
+Entries that use overflow
+
+ The number of entries that user one or more overflow pages.
+
+Total pages used
+
+ This is the number of pages used to hold all information in the current
+ category. This is the sum of index, primary, and overflow pages.
+
+Index pages used
+
+ This is the number of pages in a table B-tree that hold only key (rowid)
+ information and no data.
+
+Primary pages used
+
+ This is the number of B-tree pages that hold both key and data.
+
+Overflow pages used
+
+ The total number of overflow pages used for this category.
+
+Unused bytes on index pages
+
+ The total number of bytes of unused space on all index pages. The
+ percentage at the right is the number of unused bytes divided by the
+ total number of bytes on index pages.
+
+Unused bytes on primary pages
+
+ The total number of bytes of unused space on all primary pages. The
+ percentage at the right is the number of unused bytes divided by the
+ total number of bytes on primary pages.
+
+Unused bytes on overflow pages
+
+ The total number of bytes of unused space on all overflow pages. The
+ percentage at the right is the number of unused bytes divided by the
+ total number of bytes on overflow pages.
+
+Unused bytes on all pages
+
+ The total number of bytes of unused space on all primary and overflow
+ pages. The percentage at the right is the number of unused bytes
+ divided by the total number of bytes.
+}
+
+# Output a dump of the in-memory database. This can be used for more
+# complex offline analysis.
+#
+puts "**********************************************************************"
+puts "The entire text of this report can be sourced into any SQL database"
+puts "engine for further analysis. All of the text above is an SQL comment."
+puts "The data used to generate this report follows:"
+puts "*/"
+puts "BEGIN;"
+puts $tabledef
+unset -nocomplain x
+mem eval {SELECT * FROM space_used} x {
+ puts -nonewline "INSERT INTO space_used VALUES"
+ set sep (
+ foreach col $x(*) {
+ set v $x($col)
+ if {$v=="" || ![string is double $v]} {set v [quote $v]}
+ puts -nonewline $sep$v
+ set sep ,
+ }
+ puts ");"
+}
+puts "COMMIT;"
diff --git a/ext/pdo_sqlite/sqlite/tool/speedtest.tcl b/ext/pdo_sqlite/sqlite/tool/speedtest.tcl
new file mode 100644
index 000000000..ef39dc546
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/speedtest.tcl
@@ -0,0 +1,275 @@
+#!/usr/bin/tclsh
+#
+# Run this script using TCLSH to do a speed comparison between
+# various versions of SQLite and PostgreSQL and MySQL
+#
+
+# Run a test
+#
+set cnt 1
+proc runtest {title} {
+ global cnt
+ set sqlfile test$cnt.sql
+ puts "<h2>Test $cnt: $title</h2>"
+ incr cnt
+ set fd [open $sqlfile r]
+ set sql [string trim [read $fd [file size $sqlfile]]]
+ close $fd
+ set sx [split $sql \n]
+ set n [llength $sx]
+ if {$n>8} {
+ set sql {}
+ for {set i 0} {$i<3} {incr i} {append sql [lindex $sx $i]<br>\n}
+ append sql "<i>... [expr {$n-6}] lines omitted</i><br>\n"
+ for {set i [expr {$n-3}]} {$i<$n} {incr i} {
+ append sql [lindex $sx $i]<br>\n
+ }
+ } else {
+ regsub -all \n [string trim $sql] <br> sql
+ }
+ puts "<blockquote>"
+ puts "$sql"
+ puts "</blockquote><table border=0 cellpadding=0 cellspacing=0>"
+ set format {<tr><td>%s</td><td align="right">&nbsp;&nbsp;&nbsp;%.3f</td></tr>}
+ set delay 1000
+# exec sync; after $delay;
+# set t [time "exec psql drh <$sqlfile" 1]
+# set t [expr {[lindex $t 0]/1000000.0}]
+# puts [format $format PostgreSQL: $t]
+ exec sync; after $delay;
+ set t [time "exec mysql -f drh <$sqlfile" 1]
+ set t [expr {[lindex $t 0]/1000000.0}]
+ puts [format $format MySQL: $t]
+# set t [time "exec ./sqlite232 s232.db <$sqlfile" 1]
+# set t [expr {[lindex $t 0]/1000000.0}]
+# puts [format $format {SQLite 2.3.2:} $t]
+# set t [time "exec ./sqlite-100 s100.db <$sqlfile" 1]
+# set t [expr {[lindex $t 0]/1000000.0}]
+# puts [format $format {SQLite 2.4 (cache=100):} $t]
+ exec sync; after $delay;
+ set t [time "exec ./sqlite248 s2k.db <$sqlfile" 1]
+ set t [expr {[lindex $t 0]/1000000.0}]
+ puts [format $format {SQLite 2.4.8:} $t]
+ exec sync; after $delay;
+ set t [time "exec ./sqlite248 sns.db <$sqlfile" 1]
+ set t [expr {[lindex $t 0]/1000000.0}]
+ puts [format $format {SQLite 2.4.8 (nosync):} $t]
+ exec sync; after $delay;
+ set t [time "exec ./sqlite2412 s2kb.db <$sqlfile" 1]
+ set t [expr {[lindex $t 0]/1000000.0}]
+ puts [format $format {SQLite 2.4.12:} $t]
+ exec sync; after $delay;
+ set t [time "exec ./sqlite2412 snsb.db <$sqlfile" 1]
+ set t [expr {[lindex $t 0]/1000000.0}]
+ puts [format $format {SQLite 2.4.12 (nosync):} $t]
+# set t [time "exec ./sqlite-t1 st1.db <$sqlfile" 1]
+# set t [expr {[lindex $t 0]/1000000.0}]
+# puts [format $format {SQLite 2.4 (test):} $t]
+ puts "</table>"
+}
+
+# Initialize the environment
+#
+expr srand(1)
+catch {exec /bin/sh -c {rm -f s*.db}}
+set fd [open clear.sql w]
+puts $fd {
+ drop table t1;
+ drop table t2;
+}
+close $fd
+catch {exec psql drh <clear.sql}
+catch {exec mysql drh <clear.sql}
+set fd [open 2kinit.sql w]
+puts $fd {
+ PRAGMA default_cache_size=2000;
+ PRAGMA default_synchronous=on;
+}
+close $fd
+exec ./sqlite248 s2k.db <2kinit.sql
+exec ./sqlite2412 s2kb.db <2kinit.sql
+set fd [open nosync-init.sql w]
+puts $fd {
+ PRAGMA default_cache_size=2000;
+ PRAGMA default_synchronous=off;
+}
+close $fd
+exec ./sqlite248 sns.db <nosync-init.sql
+exec ./sqlite2412 snsb.db <nosync-init.sql
+set ones {zero one two three four five six seven eight nine
+ ten eleven twelve thirteen fourteen fifteen sixteen seventeen
+ eighteen nineteen}
+set tens {{} ten twenty thirty forty fifty sixty seventy eighty ninety}
+proc number_name {n} {
+ if {$n>=1000} {
+ set txt "[number_name [expr {$n/1000}]] thousand"
+ set n [expr {$n%1000}]
+ } else {
+ set txt {}
+ }
+ if {$n>=100} {
+ append txt " [lindex $::ones [expr {$n/100}]] hundred"
+ set n [expr {$n%100}]
+ }
+ if {$n>=20} {
+ append txt " [lindex $::tens [expr {$n/10}]]"
+ set n [expr {$n%10}]
+ }
+ if {$n>0} {
+ append txt " [lindex $::ones $n]"
+ }
+ set txt [string trim $txt]
+ if {$txt==""} {set txt zero}
+ return $txt
+}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd "CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100));"
+for {set i 1} {$i<=1000} {incr i} {
+ set r [expr {int(rand()*100000)}]
+ puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');"
+}
+close $fd
+runtest {1000 INSERTs}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+puts $fd "CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100));"
+for {set i 1} {$i<=25000} {incr i} {
+ set r [expr {int(rand()*500000)}]
+ puts $fd "INSERT INTO t2 VALUES($i,$r,'[number_name $r]');"
+}
+puts $fd "COMMIT;"
+close $fd
+runtest {25000 INSERTs in a transaction}
+
+
+
+set fd [open test$cnt.sql w]
+for {set i 0} {$i<100} {incr i} {
+ set lwr [expr {$i*100}]
+ set upr [expr {($i+10)*100}]
+ puts $fd "SELECT count(*), avg(b) FROM t2 WHERE b>=$lwr AND b<$upr;"
+}
+close $fd
+runtest {100 SELECTs without an index}
+
+
+
+set fd [open test$cnt.sql w]
+for {set i 1} {$i<=100} {incr i} {
+ puts $fd "SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%[number_name $i]%';"
+}
+close $fd
+runtest {100 SELECTs on a string comparison}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd {CREATE INDEX i2a ON t2(a);}
+puts $fd {CREATE INDEX i2b ON t2(b);}
+close $fd
+runtest {Creating an index}
+
+
+
+set fd [open test$cnt.sql w]
+for {set i 0} {$i<5000} {incr i} {
+ set lwr [expr {$i*100}]
+ set upr [expr {($i+1)*100}]
+ puts $fd "SELECT count(*), avg(b) FROM t2 WHERE b>=$lwr AND b<$upr;"
+}
+close $fd
+runtest {5000 SELECTs with an index}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+for {set i 0} {$i<1000} {incr i} {
+ set lwr [expr {$i*10}]
+ set upr [expr {($i+1)*10}]
+ puts $fd "UPDATE t1 SET b=b*2 WHERE a>=$lwr AND a<$upr;"
+}
+puts $fd "COMMIT;"
+close $fd
+runtest {1000 UPDATEs without an index}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+for {set i 1} {$i<=25000} {incr i} {
+ set r [expr {int(rand()*500000)}]
+ puts $fd "UPDATE t2 SET b=$r WHERE a=$i;"
+}
+puts $fd "COMMIT;"
+close $fd
+runtest {25000 UPDATEs with an index}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+for {set i 1} {$i<=25000} {incr i} {
+ set r [expr {int(rand()*500000)}]
+ puts $fd "UPDATE t2 SET c='[number_name $r]' WHERE a=$i;"
+}
+puts $fd "COMMIT;"
+close $fd
+runtest {25000 text UPDATEs with an index}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+puts $fd "INSERT INTO t1 SELECT * FROM t2;"
+puts $fd "INSERT INTO t2 SELECT * FROM t1;"
+puts $fd "COMMIT;"
+close $fd
+runtest {INSERTs from a SELECT}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd {DELETE FROM t2 WHERE c LIKE '%fifty%';}
+close $fd
+runtest {DELETE without an index}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd {DELETE FROM t2 WHERE a>10 AND a<20000;}
+close $fd
+runtest {DELETE with an index}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd {INSERT INTO t2 SELECT * FROM t1;}
+close $fd
+runtest {A big INSERT after a big DELETE}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd {BEGIN;}
+puts $fd {DELETE FROM t1;}
+for {set i 1} {$i<=3000} {incr i} {
+ set r [expr {int(rand()*100000)}]
+ puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');"
+}
+puts $fd {COMMIT;}
+close $fd
+runtest {A big DELETE followed by many small INSERTs}
+
+
+
+set fd [open test$cnt.sql w]
+puts $fd {DROP TABLE t1;}
+puts $fd {DROP TABLE t2;}
+close $fd
+runtest {DROP TABLE}
diff --git a/ext/pdo_sqlite/sqlite/tool/speedtest2.tcl b/ext/pdo_sqlite/sqlite/tool/speedtest2.tcl
new file mode 100644
index 000000000..4fd632d4c
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/tool/speedtest2.tcl
@@ -0,0 +1,207 @@
+#!/usr/bin/tclsh
+#
+# Run this script using TCLSH to do a speed comparison between
+# various versions of SQLite and PostgreSQL and MySQL
+#
+
+# Run a test
+#
+set cnt 1
+proc runtest {title} {
+ global cnt
+ set sqlfile test$cnt.sql
+ puts "<h2>Test $cnt: $title</h2>"
+ incr cnt
+ set fd [open $sqlfile r]
+ set sql [string trim [read $fd [file size $sqlfile]]]
+ close $fd
+ set sx [split $sql \n]
+ set n [llength $sx]
+ if {$n>8} {
+ set sql {}
+ for {set i 0} {$i<3} {incr i} {append sql [lindex $sx $i]<br>\n}
+ append sql "<i>... [expr {$n-6}] lines omitted</i><br>\n"
+ for {set i [expr {$n-3}]} {$i<$n} {incr i} {
+ append sql [lindex $sx $i]<br>\n
+ }
+ } else {
+ regsub -all \n [string trim $sql] <br> sql
+ }
+ puts "<blockquote>"
+ puts "$sql"
+ puts "</blockquote><table border=0 cellpadding=0 cellspacing=0>"
+ set format {<tr><td>%s</td><td align="right">&nbsp;&nbsp;&nbsp;%.3f</td></tr>}
+ set delay 1000
+ exec sync; after $delay;
+ set t [time "exec psql drh <$sqlfile" 1]
+ set t [expr {[lindex $t 0]/1000000.0}]
+ puts [format $format PostgreSQL: $t]
+ exec sync; after $delay;
+ set t [time "exec mysql -f drh <$sqlfile" 1]
+ set t [expr {[lindex $t 0]/1000000.0}]
+ puts [format $format MySQL: $t]
+# set t [time "exec ./sqlite232 s232.db <$sqlfile" 1]
+# set t [expr {[lindex $t 0]/1000000.0}]
+# puts [format $format {SQLite 2.3.2:} $t]
+# set t [time "exec ./sqlite-100 s100.db <$sqlfile" 1]
+# set t [expr {[lindex $t 0]/1000000.0}]
+# puts [format $format {SQLite 2.4 (cache=100):} $t]
+ exec sync; after $delay;
+ set t [time "exec ./sqlite240 s2k.db <$sqlfile" 1]
+ set t [expr {[lindex $t 0]/1000000.0}]
+ puts [format $format {SQLite 2.4:} $t]
+ exec sync; after $delay;
+ set t [time "exec ./sqlite240 sns.db <$sqlfile" 1]
+ set t [expr {[lindex $t 0]/1000000.0}]
+ puts [format $format {SQLite 2.4 (nosync):} $t]
+# set t [time "exec ./sqlite-t1 st1.db <$sqlfile" 1]
+# set t [expr {[lindex $t 0]/1000000.0}]
+# puts [format $format {SQLite 2.4 (test):} $t]
+ puts "</table>"
+}
+
+# Initialize the environment
+#
+expr srand(1)
+catch {exec /bin/sh -c {rm -f s*.db}}
+set fd [open clear.sql w]
+puts $fd {
+ drop table t1;
+ drop table t2;
+}
+close $fd
+catch {exec psql drh <clear.sql}
+catch {exec mysql drh <clear.sql}
+set fd [open 2kinit.sql w]
+puts $fd {
+ PRAGMA default_cache_size=2000;
+ PRAGMA default_synchronous=on;
+}
+close $fd
+exec ./sqlite240 s2k.db <2kinit.sql
+exec ./sqlite-t1 st1.db <2kinit.sql
+set fd [open nosync-init.sql w]
+puts $fd {
+ PRAGMA default_cache_size=2000;
+ PRAGMA default_synchronous=off;
+}
+close $fd
+exec ./sqlite240 sns.db <nosync-init.sql
+set ones {zero one two three four five six seven eight nine
+ ten eleven twelve thirteen fourteen fifteen sixteen seventeen
+ eighteen nineteen}
+set tens {{} ten twenty thirty forty fifty sixty seventy eighty ninety}
+proc number_name {n} {
+ if {$n>=1000} {
+ set txt "[number_name [expr {$n/1000}]] thousand"
+ set n [expr {$n%1000}]
+ } else {
+ set txt {}
+ }
+ if {$n>=100} {
+ append txt " [lindex $::ones [expr {$n/100}]] hundred"
+ set n [expr {$n%100}]
+ }
+ if {$n>=20} {
+ append txt " [lindex $::tens [expr {$n/10}]]"
+ set n [expr {$n%10}]
+ }
+ if {$n>0} {
+ append txt " [lindex $::ones $n]"
+ }
+ set txt [string trim $txt]
+ if {$txt==""} {set txt zero}
+ return $txt
+}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+puts $fd "CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100));"
+for {set i 1} {$i<=25000} {incr i} {
+ set r [expr {int(rand()*500000)}]
+ puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');"
+}
+puts $fd "COMMIT;"
+close $fd
+runtest {25000 INSERTs in a transaction}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "DELETE FROM t1;"
+close $fd
+runtest {DELETE everything}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+for {set i 1} {$i<=25000} {incr i} {
+ set r [expr {int(rand()*500000)}]
+ puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');"
+}
+puts $fd "COMMIT;"
+close $fd
+runtest {25000 INSERTs in a transaction}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "DELETE FROM t1;"
+close $fd
+runtest {DELETE everything}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+for {set i 1} {$i<=25000} {incr i} {
+ set r [expr {int(rand()*500000)}]
+ puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');"
+}
+puts $fd "COMMIT;"
+close $fd
+runtest {25000 INSERTs in a transaction}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "DELETE FROM t1;"
+close $fd
+runtest {DELETE everything}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+for {set i 1} {$i<=25000} {incr i} {
+ set r [expr {int(rand()*500000)}]
+ puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');"
+}
+puts $fd "COMMIT;"
+close $fd
+runtest {25000 INSERTs in a transaction}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "DELETE FROM t1;"
+close $fd
+runtest {DELETE everything}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "BEGIN;"
+for {set i 1} {$i<=25000} {incr i} {
+ set r [expr {int(rand()*500000)}]
+ puts $fd "INSERT INTO t1 VALUES($i,$r,'[number_name $r]');"
+}
+puts $fd "COMMIT;"
+close $fd
+runtest {25000 INSERTs in a transaction}
+
+
+set fd [open test$cnt.sql w]
+puts $fd "DELETE FROM t1;"
+close $fd
+runtest {DELETE everything}
+
+
+set fd [open test$cnt.sql w]
+puts $fd {DROP TABLE t1;}
+close $fd
+runtest {DROP TABLE}
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
new file mode 100644
index 000000000..763018aca
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -0,0 +1,744 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: sqlite_driver.c,v 1.20.2.1 2005/09/20 19:52:24 iliaa Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_sqlite.h"
+#include "php_pdo_sqlite_int.h"
+#include "zend_exceptions.h"
+
+int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC) /* {{{ */
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+ pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code;
+ pdo_sqlite_error_info *einfo = &H->einfo;
+
+ einfo->errcode = sqlite3_errcode(H->db);
+ einfo->file = file;
+ einfo->line = line;
+
+ if (einfo->errcode != SQLITE_OK) {
+ einfo->errmsg = (char*)sqlite3_errmsg(H->db);
+ } else { /* no error */
+ strcpy(*pdo_err, PDO_ERR_NONE);
+ return 0;
+ }
+ switch (einfo->errcode) {
+ case SQLITE_NOTFOUND:
+ strcpy(*pdo_err, "42S02");
+ break;
+
+ case SQLITE_INTERRUPT:
+ strcpy(*pdo_err, "01002");
+ break;
+
+ case SQLITE_NOLFS:
+ strcpy(*pdo_err, "HYC00");
+ break;
+
+ case SQLITE_TOOBIG:
+ strcpy(*pdo_err, "22001");
+ break;
+
+ case SQLITE_CONSTRAINT:
+ strcpy(*pdo_err, "23000");
+ break;
+
+ case SQLITE_ERROR:
+ default:
+ strcpy(*pdo_err, "HY000");
+ break;
+ }
+
+ if (!dbh->methods) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ *pdo_err, einfo->errcode, einfo->errmsg);
+ }
+
+ return einfo->errcode;
+}
+/* }}} */
+
+static int pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+ pdo_sqlite_error_info *einfo = &H->einfo;
+
+ if (einfo->errcode) {
+ add_next_index_long(info, einfo->errcode);
+ add_next_index_string(info, einfo->errmsg, 1);
+ }
+
+ return 1;
+}
+
+static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H TSRMLS_DC)
+{
+ struct pdo_sqlite_func *func;
+
+ while (H->funcs) {
+ func = H->funcs;
+ H->funcs = func->next;
+
+ if (H->db) {
+ /* delete the function from the handle */
+ sqlite3_create_function(H->db,
+ func->funcname,
+ func->argc,
+ SQLITE_UTF8,
+ func,
+ NULL, NULL, NULL);
+ }
+
+ efree((char*)func->funcname);
+ if (func->func) {
+ zval_ptr_dtor(&func->func);
+ }
+ if (func->step) {
+ zval_ptr_dtor(&func->step);
+ }
+ if (func->fini) {
+ zval_ptr_dtor(&func->fini);
+ }
+ efree(func);
+ }
+}
+
+static int sqlite_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+
+ if (H) {
+ pdo_sqlite_cleanup_callbacks(H TSRMLS_CC);
+ if (H->db) {
+ sqlite3_close(H->db);
+ H->db = NULL;
+ }
+ pefree(H, dbh->is_persistent);
+ dbh->driver_data = NULL;
+ }
+ return 0;
+}
+/* }}} */
+
+static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+ pdo_sqlite_stmt *S = ecalloc(1, sizeof(pdo_sqlite_stmt));
+ int i;
+ const char *tail;
+
+ S->H = H;
+ stmt->driver_data = S;
+ stmt->methods = &sqlite_stmt_methods;
+ stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL|PDO_PLACEHOLDER_NAMED;
+
+ if (PDO_CURSOR_FWDONLY != pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC)) {
+ H->einfo.errcode = SQLITE_ERROR;
+ pdo_sqlite_error(dbh);
+ return 0;
+ }
+
+ i = sqlite3_prepare(H->db, sql, sql_len, &S->stmt, &tail);
+ if (i == SQLITE_OK) {
+ return 1;
+ }
+
+ pdo_sqlite_error(dbh);
+
+ return 0;
+}
+
+static long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC)
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+ char *errmsg = NULL;
+
+ if (sqlite3_exec(H->db, sql, NULL, NULL, &errmsg) != SQLITE_OK) {
+ pdo_sqlite_error(dbh);
+ if (errmsg)
+ sqlite3_free(errmsg);
+
+ return -1;
+ } else {
+ return sqlite3_changes(H->db);
+ }
+}
+
+static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+ char *id;
+
+ id = php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db) TSRMLS_CC);
+ *len = strlen(id);
+ return id;
+}
+
+/* NB: doesn't handle binary strings... use prepared stmts for that */
+static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+{
+ *quoted = safe_emalloc(2, unquotedlen, 3);
+ sqlite3_snprintf(2*unquotedlen + 3, *quoted, "'%q'", unquoted);
+ *quotedlen = strlen(*quoted);
+ return 1;
+}
+
+static int sqlite_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+ char *errmsg = NULL;
+
+ if (sqlite3_exec(H->db, "BEGIN", NULL, NULL, &errmsg) != SQLITE_OK) {
+ pdo_sqlite_error(dbh);
+ if (errmsg)
+ sqlite3_free(errmsg);
+ return 0;
+ }
+ return 1;
+}
+
+static int sqlite_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+ char *errmsg = NULL;
+
+ if (sqlite3_exec(H->db, "COMMIT", NULL, NULL, &errmsg) != SQLITE_OK) {
+ pdo_sqlite_error(dbh);
+ if (errmsg)
+ sqlite3_free(errmsg);
+ return 0;
+ }
+ return 1;
+}
+
+static int sqlite_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+ char *errmsg = NULL;
+
+ if (sqlite3_exec(H->db, "ROLLBACK", NULL, NULL, &errmsg) != SQLITE_OK) {
+ pdo_sqlite_error(dbh);
+ if (errmsg)
+ sqlite3_free(errmsg);
+ return 0;
+ }
+ return 1;
+}
+
+static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC)
+{
+ switch (attr) {
+ case PDO_ATTR_CLIENT_VERSION:
+ case PDO_ATTR_SERVER_VERSION:
+ ZVAL_STRING(return_value, (char *)sqlite3_libversion(), 1);
+ break;
+
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
+static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+
+ switch (attr) {
+ case PDO_ATTR_TIMEOUT:
+ convert_to_long(val);
+ sqlite3_busy_timeout(H->db, Z_LVAL_P(val) * 1000);
+ return 1;
+ }
+ return 0;
+}
+
+static int do_callback(struct pdo_sqlite_fci *fc, zval *cb,
+ int argc, sqlite3_value **argv, sqlite3_context *context,
+ int is_agg TSRMLS_DC)
+{
+ zval ***zargs = NULL;
+ zval *retval = NULL;
+ int i;
+ int ret;
+ int fake_argc;
+ zval **agg_context = NULL;
+
+ if (is_agg) {
+ is_agg = 2;
+ }
+
+ fake_argc = argc + is_agg;
+
+ fc->fci.size = sizeof(fc->fci);
+ fc->fci.function_table = EG(function_table);
+ fc->fci.function_name = cb;
+ fc->fci.symbol_table = NULL;
+ fc->fci.object_pp = NULL;
+ fc->fci.retval_ptr_ptr = &retval;
+ fc->fci.param_count = fake_argc;
+
+ /* build up the params */
+
+ if (fake_argc) {
+ zargs = (zval ***)safe_emalloc(fake_argc, sizeof(zval **), 0);
+ }
+
+ if (is_agg) {
+ /* summon the aggregation context */
+ agg_context = (zval**)sqlite3_aggregate_context(context, sizeof(zval*));
+ if (!*agg_context) {
+ MAKE_STD_ZVAL(*agg_context);
+ ZVAL_NULL(*agg_context);
+ }
+ zargs[0] = agg_context;
+
+ zargs[1] = emalloc(sizeof(zval*));
+ MAKE_STD_ZVAL(*zargs[1]);
+ ZVAL_LONG(*zargs[1], sqlite3_aggregate_count(context));
+ }
+
+ for (i = 0; i < argc; i++) {
+ zargs[i + is_agg] = emalloc(sizeof(zval *));
+ MAKE_STD_ZVAL(*zargs[i + is_agg]);
+
+ /* get the value */
+ switch (sqlite3_value_type(argv[i])) {
+ case SQLITE_INTEGER:
+ ZVAL_LONG(*zargs[i + is_agg], sqlite3_value_int(argv[i]));
+ break;
+
+ case SQLITE_FLOAT:
+ ZVAL_DOUBLE(*zargs[i + is_agg], sqlite3_value_double(argv[i]));
+ break;
+
+ case SQLITE_NULL:
+ ZVAL_NULL(*zargs[i + is_agg]);
+ break;
+
+ case SQLITE_BLOB:
+ case SQLITE3_TEXT:
+ default:
+ ZVAL_STRINGL(*zargs[i + is_agg], (char*)sqlite3_value_text(argv[i]),
+ sqlite3_value_bytes(argv[i]), 1);
+ break;
+ }
+ }
+
+
+ fc->fci.params = zargs;
+
+
+ if ((ret = zend_call_function(&fc->fci, &fc->fcc TSRMLS_CC)) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback");
+ }
+
+ /* clean up the params */
+ if (argc) {
+ for (i = is_agg; i < argc; i++) {
+ zval_ptr_dtor(zargs[i]);
+ efree(zargs[i]);
+ }
+ if (is_agg) {
+ zval_ptr_dtor(zargs[1]);
+ efree(zargs[1]);
+ }
+ efree(zargs);
+ }
+
+ if (!is_agg || !argv) {
+ /* only set the sqlite return value if we are a scalar function,
+ * or if we are finalizing an aggregate */
+ if (retval) {
+ switch (Z_TYPE_P(retval)) {
+ case IS_LONG:
+ sqlite3_result_int(context, Z_LVAL_P(retval));
+ break;
+
+ case IS_NULL:
+ sqlite3_result_null(context);
+ break;
+
+ case IS_DOUBLE:
+ sqlite3_result_double(context, Z_DVAL_P(retval));
+ break;
+
+ default:
+ convert_to_string_ex(&retval);
+ sqlite3_result_text(context, Z_STRVAL_P(retval),
+ Z_STRLEN_P(retval), SQLITE_TRANSIENT);
+ break;
+ }
+ } else {
+ sqlite3_result_error(context, "failed to invoke callback", 0);
+ }
+
+ if (agg_context) {
+ zval_ptr_dtor(agg_context);
+ }
+ } else {
+ /* we're stepping in an aggregate; the return value goes into
+ * the context */
+ if (agg_context) {
+ zval_ptr_dtor(agg_context);
+ }
+ if (retval) {
+ *agg_context = retval;
+ retval = NULL;
+ } else {
+ *agg_context = NULL;
+ }
+ }
+
+ if (retval) {
+ zval_ptr_dtor(&retval);
+ }
+
+ return ret;
+}
+
+static void php_sqlite3_func_callback(sqlite3_context *context, int argc,
+ sqlite3_value **argv)
+{
+ struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
+ TSRMLS_FETCH();
+
+ do_callback(&func->afunc, func->func, argc, argv, context, 0 TSRMLS_CC);
+}
+
+static void php_sqlite3_func_step_callback(sqlite3_context *context, int argc,
+ sqlite3_value **argv)
+{
+ struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
+ TSRMLS_FETCH();
+
+ do_callback(&func->astep, func->step, argc, argv, context, 1 TSRMLS_CC);
+}
+
+static void php_sqlite3_func_final_callback(sqlite3_context *context)
+{
+ struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
+ TSRMLS_FETCH();
+
+ do_callback(&func->afini, func->fini, 0, NULL, context, 1 TSRMLS_CC);
+}
+
+/* {{{ bool SQLite::sqliteCreateFunction(string name, mixed callback [, int argcount])
+ Registers a UDF with the sqlite db handle */
+static PHP_METHOD(SQLite, sqliteCreateFunction)
+{
+ struct pdo_sqlite_func *func;
+ zval *callback;
+ char *func_name;
+ int func_name_len;
+ long argc = -1;
+ char *cbname = NULL;
+ pdo_dbh_t *dbh;
+ pdo_sqlite_db_handle *H;
+ int ret;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l",
+ &func_name, &func_name_len, &callback, &argc)) {
+ RETURN_FALSE;
+ }
+
+ dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+ PDO_CONSTRUCT_CHECK;
+
+ if (!zend_is_callable(callback, 0, &cbname)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname);
+ efree(cbname);
+ RETURN_FALSE;
+ }
+ efree(cbname);
+
+ H = (pdo_sqlite_db_handle *)dbh->driver_data;
+
+ func = (struct pdo_sqlite_func*)ecalloc(1, sizeof(*func));
+
+ ret = sqlite3_create_function(H->db, func_name, argc, SQLITE_UTF8,
+ func, php_sqlite3_func_callback, NULL, NULL);
+ if (ret == SQLITE_OK) {
+ func->funcname = estrdup(func_name);
+
+ MAKE_STD_ZVAL(func->func);
+ *(func->func) = *callback;
+ zval_copy_ctor(func->func);
+
+ func->argc = argc;
+
+ func->next = H->funcs;
+ H->funcs = func;
+
+ RETURN_TRUE;
+ }
+
+ efree(func);
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ bool SQLite::sqliteCreateAggregate(string name, mixed step, mixed fini [, int argcount])
+ Registers a UDF with the sqlite db handle */
+
+/* The step function should have the prototype:
+ mixed step(mixed $context, int $rownumber, $value [, $value2 [, ...]])
+
+ $context will be null for the first row; on subsequent rows it will have
+ the value that was previously returned from the step function; you should
+ use this to maintain state for the aggregate.
+
+ The fini function should have the prototype:
+ mixed fini(mixed $context, int $rownumber)
+
+ $context will hold the return value from the very last call to the step function.
+ rownumber will hold the number of rows over which the aggregate was performed.
+ The return value of this function will be used as the return value for this
+ aggregate UDF.
+*/
+
+static PHP_METHOD(SQLite, sqliteCreateAggregate)
+{
+ struct pdo_sqlite_func *func;
+ zval *step_callback, *fini_callback;
+ char *func_name;
+ int func_name_len;
+ long argc = -1;
+ char *cbname = NULL;
+ pdo_dbh_t *dbh;
+ pdo_sqlite_db_handle *H;
+ int ret;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l",
+ &func_name, &func_name_len, &step_callback, &fini_callback, &argc)) {
+ RETURN_FALSE;
+ }
+
+ dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
+ PDO_CONSTRUCT_CHECK;
+
+ if (!zend_is_callable(step_callback, 0, &cbname)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname);
+ efree(cbname);
+ RETURN_FALSE;
+ }
+ efree(cbname);
+ if (!zend_is_callable(fini_callback, 0, &cbname)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname);
+ efree(cbname);
+ RETURN_FALSE;
+ }
+ efree(cbname);
+
+ H = (pdo_sqlite_db_handle *)dbh->driver_data;
+
+ func = (struct pdo_sqlite_func*)ecalloc(1, sizeof(*func));
+
+ ret = sqlite3_create_function(H->db, func_name, argc, SQLITE_UTF8,
+ func, NULL, php_sqlite3_func_step_callback, php_sqlite3_func_final_callback);
+ if (ret == SQLITE_OK) {
+ func->funcname = estrdup(func_name);
+
+ MAKE_STD_ZVAL(func->step);
+ *(func->step) = *step_callback;
+ zval_copy_ctor(func->step);
+
+ MAKE_STD_ZVAL(func->fini);
+ *(func->fini) = *fini_callback;
+ zval_copy_ctor(func->fini);
+
+ func->argc = argc;
+
+ func->next = H->funcs;
+ H->funcs = func;
+
+ RETURN_TRUE;
+ }
+
+ efree(func);
+ RETURN_FALSE;
+}
+/* }}} */
+static function_entry dbh_methods[] = {
+ PHP_ME(SQLite, sqliteCreateFunction, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(SQLite, sqliteCreateAggregate, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+static function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC)
+{
+ switch (kind) {
+ case PDO_DBH_DRIVER_METHOD_KIND_DBH:
+ return dbh_methods;
+
+ default:
+ return NULL;
+ }
+}
+
+static void pdo_sqlite_request_shutdown(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
+ /* unregister functions, so that they don't linger for the next
+ * request */
+ if (H) {
+ pdo_sqlite_cleanup_callbacks(H TSRMLS_CC);
+ }
+}
+
+static struct pdo_dbh_methods sqlite_methods = {
+ sqlite_handle_closer,
+ sqlite_handle_preparer,
+ sqlite_handle_doer,
+ sqlite_handle_quoter,
+ sqlite_handle_begin,
+ sqlite_handle_commit,
+ sqlite_handle_rollback,
+ pdo_sqlite_set_attr,
+ pdo_sqlite_last_insert_id,
+ pdo_sqlite_fetch_error_func,
+ pdo_sqlite_get_attribute,
+ NULL, /* check_liveness: not needed */
+ get_driver_methods,
+ pdo_sqlite_request_shutdown
+};
+
+static char *make_filename_safe(const char *filename TSRMLS_DC)
+{
+ if (strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
+ char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
+
+ if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ efree(fullpath);
+ return NULL;
+ }
+
+ if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ efree(fullpath);
+ return NULL;
+ }
+ return fullpath;
+ }
+ return estrdup(filename);
+}
+
+static int authorizer(void *autharg, int access_type, const char *arg3, const char *arg4,
+ const char *arg5, const char *arg6)
+{
+ char *filename;
+ switch (access_type) {
+ case SQLITE_COPY: {
+ TSRMLS_FETCH();
+ filename = make_filename_safe(arg4 TSRMLS_CC);
+ if (!filename) {
+ return SQLITE_DENY;
+ }
+ efree(filename);
+ return SQLITE_OK;
+ }
+
+ case SQLITE_ATTACH: {
+ TSRMLS_FETCH();
+ filename = make_filename_safe(arg3 TSRMLS_CC);
+ if (!filename) {
+ return SQLITE_DENY;
+ }
+ efree(filename);
+ return SQLITE_OK;
+ }
+
+ default:
+ /* access allowed */
+ return SQLITE_OK;
+ }
+}
+
+static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+{
+ pdo_sqlite_db_handle *H;
+ int i, ret = 0;
+ long timeout = 60;
+ char *filename;
+
+ H = pecalloc(1, sizeof(pdo_sqlite_db_handle), dbh->is_persistent);
+
+ H->einfo.errcode = 0;
+ H->einfo.errmsg = NULL;
+ dbh->driver_data = H;
+
+ filename = make_filename_safe(dbh->data_source TSRMLS_CC);
+
+ if (!filename) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC,
+ "safe_mode/open_basedir prohibits opening %s",
+ dbh->data_source);
+ goto cleanup;
+ }
+
+ i = sqlite3_open(filename, &H->db);
+ efree(filename);
+
+ if (i != SQLITE_OK) {
+ pdo_sqlite_error(dbh);
+ goto cleanup;
+ }
+
+ if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
+ sqlite3_set_authorizer(H->db, authorizer, NULL);
+ }
+
+ if (driver_options) {
+ timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, timeout TSRMLS_CC);
+ }
+ sqlite3_busy_timeout(H->db, timeout * 1000);
+
+ dbh->alloc_own_columns = 1;
+ dbh->max_escaped_char_length = 2;
+
+ ret = 1;
+
+cleanup:
+ dbh->methods = &sqlite_methods;
+
+ return ret;
+}
+/* }}} */
+
+pdo_driver_t pdo_sqlite_driver = {
+ PDO_DRIVER_HEADER(sqlite),
+ pdo_sqlite_handle_factory
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c
new file mode 100644
index 000000000..c0e759e8b
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite_statement.c
@@ -0,0 +1,325 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: sqlite_statement.c,v 1.18.2.3 2005/09/29 19:57:13 helly Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_sqlite.h"
+#include "php_pdo_sqlite_int.h"
+
+
+static int pdo_sqlite_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
+
+ if (S->stmt) {
+ sqlite3_finalize(S->stmt);
+ S->stmt = NULL;
+ }
+ efree(S);
+ return 1;
+}
+
+static int pdo_sqlite_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
+
+ if (stmt->executed && !S->done) {
+ sqlite3_reset(S->stmt);
+ }
+
+ S->done = 0;
+ switch (sqlite3_step(S->stmt)) {
+ case SQLITE_ROW:
+ S->pre_fetched = 1;
+ stmt->column_count = sqlite3_data_count(S->stmt);
+ return 1;
+
+ case SQLITE_DONE:
+ stmt->column_count = sqlite3_column_count(S->stmt);
+ stmt->row_count = sqlite3_changes(S->H->db);
+ sqlite3_reset(S->stmt);
+ S->done = 1;
+ return 1;
+
+ case SQLITE_ERROR:
+ case SQLITE_MISUSE:
+ case SQLITE_BUSY:
+ default:
+ pdo_sqlite_error_stmt(stmt);
+ return 0;
+ }
+}
+
+static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
+ enum pdo_param_event event_type TSRMLS_DC)
+{
+ pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
+
+ switch (event_type) {
+ case PDO_PARAM_EVT_EXEC_PRE:
+ if (stmt->executed && !S->done) {
+ sqlite3_reset(S->stmt);
+ S->done = 1;
+ }
+
+ if (param->is_param) {
+
+ if (param->paramno == -1) {
+ param->paramno = sqlite3_bind_parameter_index(S->stmt, param->name) - 1;
+ }
+
+ switch (PDO_PARAM_TYPE(param->param_type)) {
+ case PDO_PARAM_STMT:
+ return 0;
+
+ case PDO_PARAM_NULL:
+ if (sqlite3_bind_null(S->stmt, param->paramno + 1) == SQLITE_OK) {
+ return 1;
+ }
+ pdo_sqlite_error_stmt(stmt);
+ return 0;
+
+ case PDO_PARAM_LOB:
+ if (Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ php_stream *stm;
+ php_stream_from_zval_no_verify(stm, &param->parameter);
+ if (stm) {
+ SEPARATE_ZVAL_IF_NOT_REF(&param->parameter);
+ Z_TYPE_P(param->parameter) = IS_STRING;
+ Z_STRLEN_P(param->parameter) = php_stream_copy_to_mem(stm,
+ &Z_STRVAL_P(param->parameter), PHP_STREAM_COPY_ALL, 0);
+ } else {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ return 0;
+ }
+ }
+ /* fall through */
+
+ case PDO_PARAM_STR:
+ default:
+ if (Z_TYPE_P(param->parameter) == IS_NULL) {
+ if (sqlite3_bind_null(S->stmt, param->paramno + 1) == SQLITE_OK) {
+ return 1;
+ }
+ } else {
+ convert_to_string(param->parameter);
+ if(SQLITE_OK == sqlite3_bind_text(S->stmt, param->paramno + 1,
+ Z_STRVAL_P(param->parameter),
+ Z_STRLEN_P(param->parameter),
+ SQLITE_STATIC)) {
+ return 1;
+ }
+ }
+ pdo_sqlite_error_stmt(stmt);
+ return 0;
+ }
+ }
+ break;
+
+ default:
+ ;
+ }
+ return 1;
+}
+
+static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt,
+ enum pdo_fetch_orientation ori, long offset TSRMLS_DC)
+{
+ pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
+ int i;
+ if (!S->stmt) {
+ return 0;
+ }
+ if (S->pre_fetched) {
+ S->pre_fetched = 0;
+ return 1;
+ }
+ if (S->done) {
+ return 0;
+ }
+ i = sqlite3_step(S->stmt);
+ switch (i) {
+ case SQLITE_ROW:
+ return 1;
+
+ case SQLITE_DONE:
+ S->done = 1;
+ sqlite3_reset(S->stmt);
+ return 0;
+
+ default:
+ pdo_sqlite_error_stmt(stmt);
+ return 0;
+ }
+}
+
+static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+{
+ pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
+
+ if(colno >= sqlite3_column_count(S->stmt)) {
+ /* error invalid column */
+ pdo_sqlite_error_stmt(stmt);
+ return 0;
+ }
+
+ stmt->columns[colno].name = estrdup(sqlite3_column_name(S->stmt, colno));
+ stmt->columns[colno].namelen = strlen(stmt->columns[colno].name);
+ stmt->columns[colno].maxlen = 0xffffffff;
+ stmt->columns[colno].precision = 0;
+
+ switch (sqlite3_column_type(S->stmt, colno)) {
+ case SQLITE_INTEGER:
+ case SQLITE_FLOAT:
+ case SQLITE3_TEXT:
+ case SQLITE_BLOB:
+ case SQLITE_NULL:
+ default:
+ stmt->columns[colno].param_type = PDO_PARAM_STR;
+ break;
+ }
+
+ return 1;
+}
+
+static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC)
+{
+ pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
+ if (!S->stmt) {
+ return 0;
+ }
+ if(colno >= sqlite3_data_count(S->stmt)) {
+ /* error invalid column */
+ pdo_sqlite_error_stmt(stmt);
+ return 0;
+ }
+ switch (sqlite3_column_type(S->stmt, colno)) {
+ case SQLITE_NULL:
+ *ptr = NULL;
+ *len = 0;
+ return 1;
+
+ case SQLITE_BLOB:
+ *ptr = (char*)sqlite3_column_blob(S->stmt, colno);
+ *len = sqlite3_column_bytes(S->stmt, colno);
+ return 1;
+
+ case SQLITE3_TEXT:
+ *ptr = (char*)sqlite3_column_text(S->stmt, colno);
+ *len = sqlite3_column_bytes(S->stmt, colno);
+ if (*len) {
+ /* sqlite3.h says "the NUL terminator is included in the byte count
+ * for TEXT values" */
+ *len--;
+ }
+ return 1;
+
+ default:
+ *ptr = (char*)sqlite3_column_text(S->stmt, colno);
+ *len = sqlite3_column_bytes(S->stmt, colno);
+ return 1;
+ }
+}
+
+static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC)
+{
+ pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
+ char *str;
+ zval *flags;
+
+ if (!S->stmt) {
+ return FAILURE;
+ }
+ if(colno >= sqlite3_data_count(S->stmt)) {
+ /* error invalid column */
+ pdo_sqlite_error_stmt(stmt);
+ return FAILURE;
+ }
+
+ array_init(return_value);
+ MAKE_STD_ZVAL(flags);
+ array_init(flags);
+
+ switch (sqlite3_column_type(S->stmt, colno)) {
+ case SQLITE_NULL:
+ add_assoc_string(return_value, "native_type", "null", 1);
+ break;
+
+ case SQLITE_FLOAT:
+ add_assoc_string(return_value, "native_type", "double", 1);
+ break;
+
+ case SQLITE_BLOB:
+ add_next_index_string(flags, "blob", 1);
+ case SQLITE_TEXT:
+ add_assoc_string(return_value, "native_type", "string", 1);
+ break;
+
+ case SQLITE_INTEGER:
+ add_assoc_string(return_value, "native_type", "integer", 1);
+ break;
+ }
+
+ str = (char*)sqlite3_column_decltype(S->stmt, colno);
+ if (str) {
+ add_assoc_string(return_value, "sqlite:decl_type", str, 1);
+ }
+
+ add_assoc_zval(return_value, "flags", flags);
+
+ return SUCCESS;
+}
+
+static int pdo_sqlite_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
+ sqlite3_reset(S->stmt);
+ return 1;
+}
+
+struct pdo_stmt_methods sqlite_stmt_methods = {
+ pdo_sqlite_stmt_dtor,
+ pdo_sqlite_stmt_execute,
+ pdo_sqlite_stmt_fetch,
+ pdo_sqlite_stmt_describe,
+ pdo_sqlite_stmt_get_col,
+ pdo_sqlite_stmt_param_hook,
+ NULL, /* set_attr */
+ NULL, /* get_attr */
+ pdo_sqlite_stmt_col_meta,
+ NULL, /* next_rowset */
+ pdo_sqlite_stmt_cursor_closer
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/pdo_sqlite/tests/bug33841.phpt b/ext/pdo_sqlite/tests/bug33841.phpt
new file mode 100644
index 000000000..d472af770
--- /dev/null
+++ b/ext/pdo_sqlite/tests/bug33841.phpt
@@ -0,0 +1,28 @@
+--TEST--
+PDO SQLite Bug #33841 (rowCount() does not work on prepared statements)
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+$db->exec('CREATE TABLE test (text)');
+
+$stmt = $db->prepare("INSERT INTO test VALUES ( :text )");
+$stmt->bindParam(':text', $name);
+$name = 'test1';
+var_dump($stmt->execute(), $stmt->rowCount());
+
+$stmt = $db->prepare("UPDATE test SET text = :text ");
+$stmt->bindParam(':text', $name);
+$name = 'test2';
+var_dump($stmt->execute(), $stmt->rowCount());
+
+--EXPECT--
+bool(true)
+int(1)
+bool(true)
+int(1)
diff --git a/ext/pdo_sqlite/tests/bug35336.phpt b/ext/pdo_sqlite/tests/bug35336.phpt
new file mode 100644
index 000000000..9fe77e19b
--- /dev/null
+++ b/ext/pdo_sqlite/tests/bug35336.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #35336 (crash on PDO::FETCH_CLASS + __set())
+--FILE--
+<?php
+class EEE {
+ function __set ($field, $value) {
+ echo "hello world\n";
+ }
+}
+
+$a = new PDO("sqlite::memory:");// pool ("sqlite::memory:");
+$a->query ("CREATE TABLE test (a integer primary key, b text)");
+$b = $a->prepare("insert into test (b) values (?)");
+$b->execute(array (5));
+$rez = $a->query ("SELECT * FROM test")->fetchAll(PDO::FETCH_CLASS, 'EEE');
+
+echo "Done\n";
+?>
+--EXPECTF--
+hello world
+hello world
+Done
diff --git a/ext/pdo_sqlite/tests/common.phpt b/ext/pdo_sqlite/tests/common.phpt
new file mode 100644
index 000000000..65ea0c96f
--- /dev/null
+++ b/ext/pdo_sqlite/tests/common.phpt
@@ -0,0 +1,12 @@
+--TEST--
+SQLite
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_sqlite')) print 'skip'; ?>
+--REDIRECTTEST--
+return array(
+ 'ENV' => array(
+ 'PDOTEST_DSN' => 'sqlite::memory:'
+ ),
+ 'TESTS' => 'ext/pdo/tests'
+ );
diff --git a/ext/pfpro/CREDITS b/ext/pfpro/CREDITS
deleted file mode 100644
index 1b57a7f25..000000000
--- a/ext/pfpro/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-Verisign Payflow Pro
-John Donagher, David Croft
diff --git a/ext/pfpro/TODO b/ext/pfpro/TODO
deleted file mode 100644
index a10a191e8..000000000
--- a/ext/pfpro/TODO
+++ /dev/null
@@ -1,12 +0,0 @@
-John Donagher <jdonagher@php.net> - 20010501
-############################################
-- XMLPay support??
-- Add test cases
-
-pfpro_process[_raw]:
-- Expose API-level context control optionally to user
-- Figure out what Verisign's pfproCompleteTransaction() purpose is and why it
- corrupts the response data
-
-pfpro_process:
-- Fix response parsing to ignore delimiters [&=] in response data values
diff --git a/ext/pfpro/config.m4 b/ext/pfpro/config.m4
deleted file mode 100644
index 3359c662b..000000000
--- a/ext/pfpro/config.m4
+++ /dev/null
@@ -1,70 +0,0 @@
-dnl
-dnl $Id: config.m4,v 1.11 2003/10/01 02:53:12 sniper Exp $
-dnl
-
-PHP_ARG_WITH(pfpro, for Verisign Payflow Pro support,
-[ --with-pfpro[=DIR] Include Verisign Payflow Pro support.])
-
-if test "$PHP_PFPRO" != "no"; then
- PFPRO_LIB=libpfpro.so
- PFPRO_HDR=pfpro.h
-
- for i in $PHP_PFPRO /usr/local /usr; do
- if test -r $i/$PFPRO_HDR; then
- PFPRO_INC_DIR=$i
- elif test -r $i/include/$PFPRO_HDR; then
- PFPRO_INC_DIR=$i/include
- elif test -r $i/lib/$PFPRO_HDR; then
- PFPRO_INC_DIR=$i/lib
- elif test -r $i/bin/$PFPRO_HDR; then
- PFPRO_INC_DIR=$i/bin
- fi
-
- if test -r $i/$PFPRO_LIB; then
- PFPRO_LIB_DIR=$i
- elif test -r $i/lib/$PFPRO_LIB; then
- PFPRO_LIB_DIR=$i/lib
- fi
-
- test -n "$PFPRO_INC_DIR" && test -n "$PFPRO_LIB_DIR" && break
- done
-
- if test -z "$PFPRO_INC_DIR"; then
- AC_MSG_ERROR([Could not find pfpro.h. Please make sure you have the
- Verisign Payflow Pro SDK installed. Use
- ./configure --with-pfpro=<pfpro-dir> if necessary])
- fi
-
- if test -z "$PFPRO_LIB_DIR"; then
- AC_MSG_ERROR([Could not find libpfpro.so. Please make sure you have the
- Verisign Payflow Pro SDK installed. Use
- ./configure --with-pfpro=<pfpro-dir> if necessary])
- fi
-
- dnl
- dnl Check version of SDK
- dnl
- PHP_CHECK_LIBRARY(pfpro, pfproInit,
- [
- PFPRO_VERSION=3
- ], [
- PHP_CHECK_LIBRARY(pfpro, PNInit,
- [
- PFPRO_VERSION=2
- ], [
- AC_MSG_ERROR([The pfpro extension requires version 2 or 3 of the SDK])
- ], [
- -L$PFPRO_LIB_DIR
- ])
- ], [
- -L$PFPRO_LIB_DIR
- ])
-
- AC_DEFINE_UNQUOTED(PFPRO_VERSION, $PFPRO_VERSION, [Version of SDK])
- PHP_ADD_INCLUDE($PFPRO_INC_DIR)
- PHP_ADD_LIBRARY_WITH_PATH(pfpro, $PFPRO_LIB_DIR, PFPRO_SHARED_LIBADD)
-
- PHP_NEW_EXTENSION(pfpro, pfpro.c, $ext_shared)
- PHP_SUBST(PFPRO_SHARED_LIBADD)
- AC_DEFINE(HAVE_PFPRO, 1, [ ])
-fi
diff --git a/ext/pfpro/pfpro.c b/ext/pfpro/pfpro.c
deleted file mode 100644
index 2e2860eb4..000000000
--- a/ext/pfpro/pfpro.c
+++ /dev/null
@@ -1,549 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: David Croft <david@infotrek.co.uk>, |
- | John Donagher <john@webmeta.com> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: pfpro.c,v 1.33 2004/05/20 00:11:11 iliaa Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_pfpro.h"
-
-#if HAVE_PFPRO
-
-/* {{{ includes */
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "ext/standard/php_string.h"
-#include <pfpro.h>
-/* }}} */
-
-/* {{{ zts */
-ZEND_DECLARE_MODULE_GLOBALS(pfpro)
-/* }}} */
-
-/* {{{ Function table */
-function_entry pfpro_functions[] = {
- PHP_FE(pfpro_version, NULL)
- PHP_FE(pfpro_init, NULL)
- PHP_FE(pfpro_cleanup, NULL)
- PHP_FE(pfpro_process_raw, NULL)
- PHP_FE(pfpro_process, NULL)
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-/* {{{ Zend module entry */
-zend_module_entry pfpro_module_entry = {
- STANDARD_MODULE_HEADER,
- "pfpro",
- pfpro_functions,
- PHP_MINIT(pfpro),
- PHP_MSHUTDOWN(pfpro),
- PHP_RINIT(pfpro), /* request start */
- PHP_RSHUTDOWN(pfpro), /* request end */
- PHP_MINFO(pfpro),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-/* {{{ dl() stuff */
-#ifdef COMPILE_DL_PFPRO
-ZEND_GET_MODULE(pfpro)
-#endif
-/* }}} */
-
-/* {{{ initialization defaults */
-PHP_INI_BEGIN()
- STD_PHP_INI_ENTRY("pfpro.defaulthost", "test-payflow.verisign.com", PHP_INI_ALL, OnUpdateString, defaulthost, zend_pfpro_globals, pfpro_globals)
- STD_PHP_INI_ENTRY("pfpro.defaultport", "443", PHP_INI_ALL, OnUpdateLong, defaultport, zend_pfpro_globals, pfpro_globals)
- STD_PHP_INI_ENTRY("pfpro.defaulttimeout", "30", PHP_INI_ALL, OnUpdateLong, defaulttimeout, zend_pfpro_globals, pfpro_globals)
- STD_PHP_INI_ENTRY("pfpro.proxyaddress", "", PHP_INI_ALL, OnUpdateString, proxyaddress, zend_pfpro_globals, pfpro_globals)
- STD_PHP_INI_ENTRY("pfpro.proxyport", "", PHP_INI_ALL, OnUpdateLong, proxyport, zend_pfpro_globals, pfpro_globals)
- STD_PHP_INI_ENTRY("pfpro.proxylogon", "", PHP_INI_ALL, OnUpdateString, proxylogon, zend_pfpro_globals, pfpro_globals)
- STD_PHP_INI_ENTRY("pfpro.proxypassword", "", PHP_INI_ALL, OnUpdateString, proxypassword, zend_pfpro_globals, pfpro_globals)
-PHP_INI_END()
-
-/* {{{ php_extname_init_globals
- */
-static void php_pfpro_init_globals(zend_pfpro_globals *pfpro_globals)
-{
- pfpro_globals->initialized = 0;
- pfpro_globals->defaulthost = NULL;
- pfpro_globals->defaultport = 0;
- pfpro_globals->defaulttimeout = 0;
- pfpro_globals->proxyaddress = NULL;
- pfpro_globals->proxyport = 0;
- pfpro_globals->proxylogon = NULL;
- pfpro_globals->proxypassword = NULL;
-}
-/* }}} */
-
-PHP_MINIT_FUNCTION(pfpro)
-{
- ZEND_INIT_MODULE_GLOBALS(pfpro, php_pfpro_init_globals, NULL);
- REGISTER_INI_ENTRIES();
- return SUCCESS;
-}
-
-PHP_MSHUTDOWN_FUNCTION(pfpro)
-{
- UNREGISTER_INI_ENTRIES();
- return SUCCESS;
-}
-
-PHP_RINIT_FUNCTION(pfpro)
-{
- PFPROG(initialized) = 0;
-
- return SUCCESS;
-}
-
-PHP_RSHUTDOWN_FUNCTION(pfpro)
-{
- if (PFPROG(initialized) == 1) {
- pfproCleanup();
- }
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ minfo registration */
-PHP_MINFO_FUNCTION(pfpro)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "Verisign Payflow Pro support", "enabled");
- php_info_print_table_row(2, "libpfpro version", pfproVersion());
- php_info_print_table_end();
-
- DISPLAY_INI_ENTRIES();
-}
-/* }}} */
-
-/* {{{ proto string pfpro_version()
- Returns the version of the Payflow Pro library */
-PHP_FUNCTION(pfpro_version)
-{
- if (ZEND_NUM_ARGS() != 0) {
- WRONG_PARAM_COUNT;
- }
-
- RETURN_STRING((char *)pfproVersion(), 1);
-}
-/* }}} */
-
-/* {{{ proto bool pfpro_init()
- Initializes the Payflow Pro library */
-PHP_FUNCTION(pfpro_init)
-{
- if (ZEND_NUM_ARGS() != 0) {
- WRONG_PARAM_COUNT;
- }
-
- pfproInit();
-
- PFPROG(initialized) = 1;
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool pfpro_cleanup()
- Shuts down the Payflow Pro library */
-PHP_FUNCTION(pfpro_cleanup)
-{
- if (ZEND_NUM_ARGS() != 0) {
- WRONG_PARAM_COUNT;
- }
-
- pfproCleanup();
-
- PFPROG(initialized) = 0;
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto string pfpro_process_raw(string parmlist [, string hostaddress [, int port, [, int timeout [, string proxyAddress [, int proxyPort [, string proxyLogon [, string proxyPassword]]]]]]])
- Raw Payflow Pro transaction processing */
-PHP_FUNCTION(pfpro_process_raw)
-{
- zval ***args;
- char *parmlist = NULL;
- char *address = NULL;
- int port = PFPROG(defaultport);
- int timeout = PFPROG(defaulttimeout);
- char *proxyAddress = PFPROG(proxyaddress);
- int proxyPort = PFPROG(proxyport);
- char *proxyLogon = PFPROG(proxylogon);
- char *proxyPassword = PFPROG(proxypassword);
- int freeaddress = 0;
-#if PFPRO_VERSION < 3
- char response[512] = "";
-#else
- int context;
- char *response;
-#endif
-
- if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 8) {
- WRONG_PARAM_COUNT;
- }
-
- args = (zval ***) safe_emalloc(sizeof(zval **), ZEND_NUM_ARGS(), 0);
-
- if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to read parameters in pfpro_process_raw()");
- efree(args);
- RETURN_FALSE;
- }
-
- switch (ZEND_NUM_ARGS()) {
- case 8:
- convert_to_string_ex(args[7]);
- proxyPassword = Z_STRVAL_PP(args[7]);
- /* fall through */
-
- case 7:
- convert_to_string_ex(args[6]);
- proxyLogon = Z_STRVAL_PP(args[6]);
- /* fall through */
-
- case 6:
- convert_to_long_ex(args[5]);
- proxyPort = Z_LVAL_PP(args[5]);
- /* fall through */
-
- case 5:
- convert_to_string_ex(args[4]);
- proxyAddress = Z_STRVAL_PP(args[4]);
- /* fall through */
-
- case 4:
- convert_to_long_ex(args[3]);
- timeout = Z_LVAL_PP(args[3]);
- /* fall through */
-
- case 3:
- convert_to_long_ex(args[2]);
- port = Z_LVAL_PP(args[2]);
- /* fall through */
-
- case 2:
- convert_to_string_ex(args[1]);
- address = Z_STRVAL_PP(args[1]);
- }
-
- convert_to_string_ex(args[0]);
- parmlist = Z_STRVAL_PP(args[0]);
-
- efree(args);
-
- if (address == NULL) {
- address = estrdup(PFPROG(defaulthost));
- freeaddress = 1;
- }
-
-#if PFPRO_VERSION < 3
- /* Blank the response buffer */
- memset(response, 0, sizeof(response));
-#endif
-
- /* Initialize the library if needed */
-
- if (PFPROG(initialized) == 0) {
- pfproInit();
- PFPROG(initialized) = 1;
- }
-
- /* Perform the transaction */
-
-#if PFPRO_VERSION < 3
- ProcessPNTransaction(address, port, proxyAddress, proxyPort, proxyLogon, proxyPassword, parmlist, strlen(parmlist), timeout, response);
-#else
- pfproCreateContext(&context, address, port, timeout, proxyAddress, proxyPort, proxyLogon, proxyPassword);
- pfproSubmitTransaction(context, parmlist, strlen(parmlist), &response);
- pfproDestroyContext(context);
-#endif
-
- if (freeaddress) {
- efree(address);
- }
-
- RETURN_STRING(response, 1);
-}
-/* }}} */
-
-/* {{{ proto array pfpro_process(array parmlist [, string hostaddress [, int port, [, int timeout [, string proxyAddress [, int proxyPort [, string proxyLogon [, string proxyPassword]]]]]]])
- Payflow Pro transaction processing using arrays */
-PHP_FUNCTION(pfpro_process)
-{
- zval ***args;
- HashTable *target_hash;
- ulong num_key;
- char *string_key;
- zval **entry;
- int pass;
- char *parmlist = NULL;
- char *address = NULL;
- int port = PFPROG(defaultport);
- int timeout = PFPROG(defaulttimeout);
- char *proxyAddress = PFPROG(proxyaddress);
- int proxyPort = PFPROG(proxyport);
- char *proxyLogon = PFPROG(proxylogon);
- char *proxyPassword = PFPROG(proxypassword);
- int parmlength = 0;
- int freeaddress = 0;
-#if PFPRO_VERSION < 3
- char response[512] = "";
-#else
- int context;
- char *response;
-#endif
- char tmpbuf[128];
- char *var,*val,*strtok_buf=NULL; /* Pointers for string manipulation */
-
- if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 8) {
- WRONG_PARAM_COUNT;
- }
-
- args = (zval ***) safe_emalloc(sizeof(zval **), ZEND_NUM_ARGS(), 0);
-
- if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
- efree(args);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to read parameters in pfpro_process()");
- RETURN_FALSE;
- }
-
- if (Z_TYPE_PP(args[0]) != IS_ARRAY) {
- efree(args);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "First parameter to pfpro_process() must be an array");
- RETURN_FALSE;
- }
-
- switch (ZEND_NUM_ARGS()) {
- case 8:
- convert_to_string_ex(args[7]);
- proxyPassword = Z_STRVAL_PP(args[7]);
- /* fall through */
-
- case 7:
- convert_to_string_ex(args[6]);
- proxyLogon = Z_STRVAL_PP(args[6]);
- /* fall through */
-
- case 6:
- convert_to_long_ex(args[5]);
- proxyPort = Z_LVAL_PP(args[5]);
- /* fall through */
-
- case 5:
- convert_to_string_ex(args[4]);
- proxyAddress = Z_STRVAL_PP(args[4]);
- /* fall through */
-
- case 4:
- convert_to_long_ex(args[3]);
- timeout = Z_LVAL_PP(args[3]);
- /* fall through */
-
- case 3:
- convert_to_long_ex(args[2]);
- port = Z_LVAL_PP(args[2]);
- /* fall through */
-
- case 2:
- convert_to_string_ex(args[1]);
- address = Z_STRVAL_PP(args[1]);
- }
-
- /* Concatenate the passed array as specified by Verisign.
- Basically it's all key=value&key=value, the only exception
- being if the value contains = or &, in which case we also
- encode the length, e.g. key[5]=bl&ah */
-
- target_hash = HASH_OF(*args[0]);
-
- for (pass = 0; pass <= 1; pass ++) {
-
- parmlength = 0;
- /* we go around the array twice. the first time to calculate
- the string length, the second time to actually store it */
-
- zend_hash_internal_pointer_reset(target_hash);
-
- while (zend_hash_get_current_data(target_hash, (void **)&entry) == SUCCESS) {
-
- if (parmlength > 0) {
- if (pass == 1)
- strcpy(parmlist + parmlength, "&");
- parmlength += 1;
- }
-
- switch (zend_hash_get_current_key(target_hash, &string_key, &num_key, 0)) {
-
- case HASH_KEY_IS_STRING:
-
- if (pass == 1)
- strcpy(parmlist + parmlength, string_key);
- parmlength += strlen(string_key);
-
- break;
-
- case HASH_KEY_IS_LONG:
-
- sprintf(tmpbuf, "%ld", num_key);
- if (pass == 1)
- strcpy(parmlist + parmlength, tmpbuf);
- parmlength += strlen(tmpbuf);
-
- break;
-
- default:
- if (parmlist) {
- efree(parmlist);
- }
- efree(args);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "pfpro_process() array keys must be strings or integers");
- RETURN_FALSE;
- }
-
-
- switch (Z_TYPE_PP(entry)) {
- case IS_STRING:
- if (strchr(Z_STRVAL_PP(entry), '&')
- || strchr(Z_STRVAL_PP(entry), '=')) {
- sprintf(tmpbuf, "[%d]=", Z_STRLEN_PP(entry));
- if (pass == 1)
- strcpy(parmlist + parmlength, tmpbuf);
- parmlength += strlen(tmpbuf);
- } else {
- if (pass == 1)
- strcpy(parmlist + parmlength, "=");
- parmlength += 1;
- }
-
- if (pass == 1)
- strcpy(parmlist + parmlength, Z_STRVAL_PP(entry));
- parmlength += Z_STRLEN_PP(entry);
-
- break;
-
- case IS_LONG:
- sprintf(tmpbuf, "=%ld", Z_LVAL_PP(entry));
- if (pass == 1)
- strcpy(parmlist + parmlength, tmpbuf);
- parmlength += strlen(tmpbuf);
-
- break;
-
- case IS_DOUBLE:
- sprintf(tmpbuf, "=%.2f", Z_DVAL_PP(entry));
- if (pass == 1)
- strcpy(parmlist + parmlength, tmpbuf);
- parmlength += strlen(tmpbuf);
-
- break;
-
- default:
- if (parmlist) {
- efree(parmlist);
- }
- efree(args);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "pfpro_process() array values must be strings, ints or floats");
- RETURN_FALSE;
- }
- zend_hash_move_forward(target_hash);
- }
-
- if (pass == 0) {
- parmlist = emalloc(parmlength + 1);
- }
- }
-
- efree(args);
-
- if (address == NULL) {
- address = estrdup(PFPROG(defaulthost));
- freeaddress = 1;
- }
-
- /* Allocate the array for the response now - so we catch any errors
- from this BEFORE we knock it off to the bank */
-
- array_init(return_value);
-
-#if PFPRO_VERSION < 3
- /* Blank the response buffer */
- memset(response, 0, sizeof(response));
-#endif
-
- /* Initialize the library if needed */
-
- if (PFPROG(initialized) == 0) {
- pfproInit();
- PFPROG(initialized) = 1;
- }
-
- /* Perform the transaction */
-
-#if PFPRO_VERSION < 3
- ProcessPNTransaction(address, port, proxyAddress, proxyPort, proxyLogon, proxyPassword, parmlist, strlen(parmlist), timeout, response);
-#else
- pfproCreateContext(&context, address, port, timeout, proxyAddress, proxyPort, proxyLogon, proxyPassword);
- pfproSubmitTransaction(context, parmlist, strlen(parmlist), &response);
- pfproDestroyContext(context);
-#endif
-
- if (freeaddress) {
- efree(address);
- }
-
- if (parmlist) {
- efree(parmlist);
- }
-
- /* This final chunk of code is to walk the returned string
- * and build the return array to the user.
- */
- var = php_strtok_r(response, "&", &strtok_buf);
-
- while (var) {
- val = strchr(var, '=');
- if (val) { /* have a value */
- *val++ = '\0';
- add_assoc_string(return_value, var, val, 1);
- }
- var = php_strtok_r(NULL, "&", &strtok_buf);
- }
-}
-/* }}} */
-
-#endif /* HAVE_PFPRO */
-
-/*
- * 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/pfpro/php_pfpro.h b/ext/pfpro/php_pfpro.h
deleted file mode 100644
index 3a0d75ae3..000000000
--- a/ext/pfpro/php_pfpro.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: David Croft <david@infotrek.co.uk> |
- | John Donagher <john@webmeta.com> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: php_pfpro.h,v 1.16 2004/01/08 17:32:40 sniper Exp $ */
-
-#ifndef PHP_PFPRO_H
-#define PHP_PFPRO_H
-
-#if HAVE_PFPRO
-
-extern zend_module_entry pfpro_module_entry;
-#define phpext_pfpro_ptr &pfpro_module_entry
-
-#ifdef PHP_WIN32
-#define PHP_PFPRO_API __declspec(dllexport)
-#else
-#define PHP_PFPRO_API
-#endif
-
-#if PFPRO_VERSION < 3
-#define pfproVersion() PNVersion()
-#define pfproInit() PNInit()
-#define pfproCleanup() PNCleanup()
-#endif
-
-PHP_MINIT_FUNCTION(pfpro);
-PHP_MSHUTDOWN_FUNCTION(pfpro);
-PHP_RINIT_FUNCTION(pfpro);
-PHP_RSHUTDOWN_FUNCTION(pfpro);
-PHP_MINFO_FUNCTION(pfpro);
-
-PHP_FUNCTION(pfpro_version); /* Return library version */
-PHP_FUNCTION(pfpro_init); /* Initialise pfpro gateway */
-PHP_FUNCTION(pfpro_cleanup); /* Shut down cleanly */
-PHP_FUNCTION(pfpro_process_raw); /* Raw transaction processing */
-PHP_FUNCTION(pfpro_process); /* Transaction processing */
-
-ZEND_BEGIN_MODULE_GLOBALS(pfpro)
- int initialized;
- char *defaulthost;
- long defaultport;
- long defaulttimeout;
- char *proxyaddress;
- long proxyport;
- char *proxylogon;
- char *proxypassword;
-ZEND_END_MODULE_GLOBALS(pfpro)
-
-#ifdef ZTS
-#define PFPROG(v) TSRMG(pfpro_globals_id, zend_pfpro_globals *, v)
-#else
-#define PFPROG(v) (pfpro_globals.v)
-#endif
-
-#else
-
-#define phpext_pfpro_ptr NULL
-
-#endif
-
-#endif /* PHP_PFPRO_H */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/pgsql/CREDITS b/ext/pgsql/CREDITS
index 846d37c2f..7930bc8b1 100644
--- a/ext/pgsql/CREDITS
+++ b/ext/pgsql/CREDITS
@@ -1,2 +1,2 @@
PostgreSQL
-Jouni Ahto, Zeev Suraski, Yasuo Ohgaki
+Jouni Ahto, Zeev Suraski, Yasuo Ohgaki, Chris Kings-Lynne
diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4
index ce0a8bd3d..d2bfe8829 100644
--- a/ext/pgsql/config.m4
+++ b/ext/pgsql/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.37.2.2 2005/04/03 13:06:33 tony2001 Exp $
+dnl $Id: config.m4,v 1.46 2005/07/22 22:00:55 sniper Exp $
dnl
AC_DEFUN([PHP_PGSQL_CHECK_FUNCTIONS],[
@@ -7,7 +7,7 @@ AC_DEFUN([PHP_PGSQL_CHECK_FUNCTIONS],[
PHP_ARG_WITH(pgsql,for PostgreSQL support,
[ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL
- base install directory or the path to pg_config.])
+ base install directory or the path to pg_config])
if test "$PHP_PGSQL" != "no"; then
PHP_EXPAND_PATH($PGSQL_INCLUDE, PGSQL_INCLUDE)
@@ -44,7 +44,7 @@ if test "$PHP_PGSQL" != "no"; then
fi
done
- for j in lib lib/pgsql lib/postgres lib/postgresql ""; do
+ for j in lib $PHP_LIBDIR/pgsql $PHP_LIBDIR/postgres $PHP_LIBDIR/postgresql ""; do
if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then
PGSQL_LIBDIR=$i/$j
fi
@@ -69,6 +69,7 @@ if test "$PHP_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, PQunescapeBytea,AC_DEFINE(HAVE_PQUNESCAPEBYTEA,1,[PostgreSQL 7.3.0 or later]))
AC_CHECK_LIB(pq, PQsetnonblocking,AC_DEFINE(HAVE_PQSETNONBLOCKING,1,[PostgreSQL 7.0.x or later]))
AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[Broken libpq under windows]))
AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[Older PostgreSQL]))
@@ -76,6 +77,17 @@ if test "$PHP_PGSQL" != "no"; then
AC_CHECK_LIB(pq, PQparameterStatus,AC_DEFINE(HAVE_PQPARAMETERSTATUS,1,[PostgreSQL 7.4 or later]))
AC_CHECK_LIB(pq, PQprotocolVersion,AC_DEFINE(HAVE_PQPROTOCOLVERSION,1,[PostgreSQL 7.4 or later]))
AC_CHECK_LIB(pq, PQtransactionStatus,AC_DEFINE(HAVE_PGTRANSACTIONSTATUS,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQexecParams,AC_DEFINE(HAVE_PQEXECPARAMS,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQprepare,AC_DEFINE(HAVE_PQPREPARE,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQexecPrepared,AC_DEFINE(HAVE_PQEXECPREPARED,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQresultErrorField,AC_DEFINE(HAVE_PQRESULTERRORFIELD,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQsendQueryParams,AC_DEFINE(HAVE_PQSENDQUERYPARAMS,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQsendPrepare,AC_DEFINE(HAVE_PQSENDPREPARE,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQsendQueryPrepared,AC_DEFINE(HAVE_PQSENDQUERYPREPARED,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQputCopyData,AC_DEFINE(HAVE_PQPUTCOPYDATA,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQputCopyEnd,AC_DEFINE(HAVE_PQPUTCOPYEND,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQgetCopyData,AC_DEFINE(HAVE_PQGETCOPYDATA,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQsetErrorVerbosity,AC_DEFINE(HAVE_PQSETERRORVERBOSITY,1,[PostgreSQL 7.4 or later]))
AC_CHECK_LIB(pq, pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether libpq is compiled with --enable-multibyte]))
LIBS=$old_LIBS
LDFLAGS=$old_LDFLAGS
diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32
index 7be475b29..4ac49276f 100644
--- a/ext/pgsql/config.w32
+++ b/ext/pgsql/config.w32
@@ -1,14 +1,14 @@
-// $Id: config.w32,v 1.2.2.1 2005/02/14 23:41:04 edink Exp $
+// $Id: config.w32,v 1.7 2005/06/05 19:25:01 wez Exp $
// vim:ft=javascript
ARG_WITH("pgsql", "PostgreSQL support", "no");
if (PHP_PGSQL != "no") {
if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) &&
- CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PGSQL)) {
+ CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PGSQL)) {
EXTENSION("pgsql", "pgsql.c");
AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library');
- ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS");
+ ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS /D HAVE_PQEXECPARAMS /D HAVE_PQPREPARE /D HAVE_PQEXECPREPARED /D HAVE_PQRESULTERRORFIELD /D HAVE_PQSENDQUERYPARAMS /D HAVE_PQSENDPREPARE /D HAVE_PQSENDQUERYPREPARED /D HAVE_PQPUTCOPYDATA /D HAVE_PQPUTCOPYEND /D HAVE_PQGETCOPYDATA /D HAVE_PQSETERRORVERBOSITY /D HAVE_PQUNESCAPEBYTEA");
} else {
WARNING("pgsql not enabled; libraries and headers not found");
}
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index bf19dbd3a..d1e3d6d43 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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,10 +16,11 @@
| Jouni Ahto <jouni.ahto@exdec.fi> |
| Yasuo Ohgaki <yohgaki@php.net> |
| Youichi Iwakiri <yiwakiri@st.rim.or.jp> (pg_copy_*) |
+ | Chris Kings-Lynne <chriskl@php.net> (v3 protocol) |
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.311.2.5 2005/07/05 12:47:06 derick Exp $ */
+/* $Id: pgsql.c,v 1.331.2.4 2005/11/07 12:57:49 helly Exp $ */
#include <stdlib.h>
@@ -94,9 +95,30 @@ function_entry pgsql_functions[] = {
#if HAVE_PQPARAMETERSTATUS
PHP_FE(pg_parameter_status, NULL)
#endif
+#if HAVE_PGTRANSACTIONSTATUS
+ PHP_FE(pg_transaction_status, NULL)
+#endif
/* query functions */
PHP_FE(pg_query, NULL)
+#if HAVE_PQEXECPARAMS
+ PHP_FE(pg_query_params, NULL)
+#endif
+#if HAVE_PQPREPARE
+ PHP_FE(pg_prepare, NULL)
+#endif
+#if HAVE_PQEXECPREPARED
+ PHP_FE(pg_execute, NULL)
+#endif
PHP_FE(pg_send_query, NULL)
+#if HAVE_PQSENDQUERYPARAMS
+ PHP_FE(pg_send_query_params, NULL)
+#endif
+#if HAVE_PQSENDPREPARE
+ PHP_FE(pg_send_prepare, NULL)
+#endif
+#if HAVE_PQSENDQUERYPREPARED
+ PHP_FE(pg_send_execute, NULL)
+#endif
PHP_FE(pg_cancel_query, NULL)
/* result functions */
PHP_FE(pg_fetch_result, NULL)
@@ -105,6 +127,7 @@ function_entry pgsql_functions[] = {
PHP_FE(pg_fetch_array, NULL)
PHP_FE(pg_fetch_object, NULL)
PHP_FE(pg_fetch_all, NULL)
+ PHP_FE(pg_fetch_all_columns, NULL)
#if HAVE_PQCMDTUPLES
PHP_FE(pg_affected_rows,NULL)
#endif
@@ -119,6 +142,7 @@ function_entry pgsql_functions[] = {
PHP_FE(pg_field_num, NULL)
PHP_FE(pg_field_size, NULL)
PHP_FE(pg_field_type, NULL)
+ PHP_FE(pg_field_type_oid, NULL)
PHP_FE(pg_field_prtlen, NULL)
PHP_FE(pg_field_is_null,NULL)
/* async message function */
@@ -126,6 +150,9 @@ function_entry pgsql_functions[] = {
PHP_FE(pg_get_pid, NULL)
/* error message functions */
PHP_FE(pg_result_error, NULL)
+#if HAVE_PQRESULTERRORFIELD
+ PHP_FE(pg_result_error_field, NULL)
+#endif
PHP_FE(pg_last_error, NULL)
PHP_FE(pg_last_notice, NULL)
/* copy functions */
@@ -154,6 +181,9 @@ function_entry pgsql_functions[] = {
PHP_FE(pg_escape_bytea, NULL)
PHP_FE(pg_unescape_bytea, NULL)
#endif
+#if HAVE_PQSETERRORVERBOSITY
+ PHP_FE(pg_set_error_verbosity, NULL)
+#endif
#if HAVE_PQCLIENTENCODING
PHP_FE(pg_client_encoding, NULL)
PHP_FE(pg_set_client_encoding, NULL)
@@ -315,7 +345,7 @@ static void _php_pgsql_notice_handler(void *resource_id, const char *message)
if (PGG(log_notices)) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message);
}
- zend_hash_index_update(&PGG(notices), *(int *)resource_id, (void **)&notice, sizeof(php_pgsql_notice *), NULL);
+ zend_hash_index_update(&PGG(notices), (int)resource_id, (void **)&notice, sizeof(php_pgsql_notice *), NULL);
}
}
/* }}} */
@@ -327,8 +357,11 @@ static void _php_pgsql_notice_handler(void *resource_id, const char *message)
static void _php_pgsql_notice_ptr_dtor(void **ptr)
{
php_pgsql_notice *notice = (php_pgsql_notice *)*ptr;
- efree(notice->message);
- efree(notice);
+ if (notice) {
+ efree(notice->message);
+ efree(notice);
+ notice = NULL;
+ }
}
/* }}} */
@@ -438,6 +471,20 @@ PHP_MINIT_FUNCTION(pgsql)
/* For pg_connection_status() */
REGISTER_LONG_CONSTANT("PGSQL_CONNECTION_BAD", CONNECTION_BAD, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PGSQL_CONNECTION_OK", CONNECTION_OK, CONST_CS | CONST_PERSISTENT);
+#if HAVE_PGTRANSACTIONSTATUS
+ /* For pg_transaction_status() */
+ REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_IDLE", PQTRANS_IDLE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_ACTIVE", PQTRANS_ACTIVE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_INTRANS", PQTRANS_INTRANS, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_INERROR", PQTRANS_INERROR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_TRANSACTION_UNKNOWN", PQTRANS_UNKNOWN, CONST_CS | CONST_PERSISTENT);
+#endif
+#if HAVE_PQSETERRORVERBOSITY
+ /* For pg_set_error_verbosity() */
+ REGISTER_LONG_CONSTANT("PGSQL_ERRORS_TERSE", PQERRORS_TERSE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_ERRORS_DEFAULT", PQERRORS_DEFAULT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_ERRORS_VERBOSE", PQERRORS_VERBOSE, CONST_CS | CONST_PERSISTENT);
+#endif
/* For lo_seek() */
REGISTER_LONG_CONSTANT("PGSQL_SEEK_SET", SEEK_SET, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PGSQL_SEEK_CUR", SEEK_CUR, CONST_CS | CONST_PERSISTENT);
@@ -454,6 +501,25 @@ PHP_MINIT_FUNCTION(pgsql)
REGISTER_LONG_CONSTANT("PGSQL_BAD_RESPONSE", PGRES_BAD_RESPONSE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PGSQL_NONFATAL_ERROR", PGRES_NONFATAL_ERROR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PGSQL_FATAL_ERROR", PGRES_FATAL_ERROR, CONST_CS | CONST_PERSISTENT);
+#if HAVE_PQRESULTERRORFIELD
+ /* For pg_result_error_field() field codes */
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_SEVERITY", PG_DIAG_SEVERITY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_SQLSTATE", PG_DIAG_SQLSTATE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_MESSAGE_PRIMARY", PG_DIAG_MESSAGE_PRIMARY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_MESSAGE_DETAIL", PG_DIAG_MESSAGE_DETAIL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_MESSAGE_HINT", PG_DIAG_MESSAGE_HINT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_STATEMENT_POSITION", PG_DIAG_STATEMENT_POSITION, CONST_CS | CONST_PERSISTENT);
+#ifdef PG_DIAG_INTERNAL_POSITION
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_INTERNAL_POSITION", PG_DIAG_INTERNAL_POSITION, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef PG_DIAG_INTERNAL_QUERY
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_INTERNAL_QUERY", PG_DIAG_INTERNAL_QUERY, CONST_CS | CONST_PERSISTENT);
+#endif
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_CONTEXT", PG_DIAG_CONTEXT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_SOURCE_FILE", PG_DIAG_SOURCE_FILE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_SOURCE_LINE", PG_DIAG_SOURCE_LINE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_SOURCE_FUNCTION", PG_DIAG_SOURCE_FUNCTION, CONST_CS | CONST_PERSISTENT);
+#endif
/* pg_convert options */
REGISTER_LONG_CONSTANT("PGSQL_CONV_IGNORE_DEFAULT", PGSQL_CONV_IGNORE_DEFAULT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PGSQL_CONV_FORCE_NULL", PGSQL_CONV_FORCE_NULL, CONST_CS | CONST_PERSISTENT);
@@ -717,7 +783,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
/* set notice processer */
if (! PGG(ignore_notices) && Z_TYPE_P(return_value) == IS_RESOURCE) {
- PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, (void *)&Z_RESVAL_P(return_value));
+ PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, (void*)Z_RESVAL_P(return_value));
}
php_pgsql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC);
@@ -1102,6 +1168,374 @@ PHP_FUNCTION(pg_query)
}
/* }}} */
+#if HAVE_PQEXECPARAMS || HAVE_PQEXECPREPARED || HAVE_PQSENDQUERYPARAMS || HAVE_PQSENDQUERYPREPARED
+/* {{{ _php_pgsql_free_params */
+static void _php_pgsql_free_params(char **params, int num_params)
+{
+ if (num_params > 0) {
+ efree(params);
+ }
+}
+/* }}} */
+#endif
+
+#if HAVE_PQEXECPARAMS
+/* {{{ proto resource pg_query_params([resource connection,] string query, array params)
+ Execute a query */
+PHP_FUNCTION(pg_query_params)
+{
+ zval **query, **pgsql_link = NULL;
+ zval **pv_param_arr, **tmp;
+ int id = -1;
+ int leftover = 0;
+ int num_params = 0;
+ char **params = NULL;
+ unsigned char otype;
+ PGconn *pgsql;
+ PGresult *pgsql_result;
+ ExecStatusType status;
+ pgsql_result_handle *pg_result;
+
+ switch(ZEND_NUM_ARGS()) {
+ case 2:
+ if (zend_get_parameters_ex(2, &query, &pv_param_arr)==FAILURE) {
+ RETURN_FALSE;
+ }
+ id = PGG(default_link);
+ CHECK_DEFAULT_LINK(id);
+ break;
+ case 3:
+ if (zend_get_parameters_ex(3, &pgsql_link, &query, &pv_param_arr)==FAILURE) {
+ RETURN_FALSE;
+ }
+ break;
+ default:
+ WRONG_PARAM_COUNT;
+ break;
+ }
+ if (pgsql_link == NULL && id == -1) {
+ RETURN_FALSE;
+ }
+
+ if (Z_TYPE_PP(pv_param_arr) != IS_ARRAY) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No array passed");
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+
+ convert_to_string_ex(query);
+ if (PQ_SETNONBLOCKING(pgsql, 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ RETURN_FALSE;
+ }
+ while ((pgsql_result = PQgetResult(pgsql))) {
+ PQclear(pgsql_result);
+ leftover = 1;
+ }
+ if (leftover) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ }
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr));
+ num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr));
+ if (num_params > 0) {
+ int i = 0;
+ params = (char **)safe_emalloc(sizeof(char *), num_params, 0);
+
+ for(i = 0; i < num_params; i++) {
+ if (zend_hash_get_current_data(Z_ARRVAL_PP(pv_param_arr), (void **) &tmp) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter");
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+
+ otype = (*tmp)->type;
+ convert_to_string(*tmp);
+ if (Z_TYPE_PP(tmp) != IS_STRING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+
+ if (otype == IS_NULL) {
+ params[i] = NULL;
+ }
+ else {
+ params[i] = Z_STRVAL_PP(tmp);
+ }
+
+ zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr));
+ }
+ }
+
+ pgsql_result = PQexecParams(pgsql, Z_STRVAL_PP(query), num_params,
+ NULL, (const char * const *)params, NULL, NULL, 0);
+ if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
+ PQclear(pgsql_result);
+ PQreset(pgsql);
+ pgsql_result = PQexecParams(pgsql, Z_STRVAL_PP(query), num_params,
+ NULL, (const char * const *)params, NULL, NULL, 0);
+ }
+
+ if (pgsql_result) {
+ status = PQresultStatus(pgsql_result);
+ } else {
+ status = (ExecStatusType) PQstatus(pgsql);
+ }
+
+ _php_pgsql_free_params(params, num_params);
+
+ switch (status) {
+ case PGRES_EMPTY_QUERY:
+ case PGRES_BAD_RESPONSE:
+ case PGRES_NONFATAL_ERROR:
+ case PGRES_FATAL_ERROR:
+ PHP_PQ_ERROR("Query failed: %s", pgsql);
+ PQclear(pgsql_result);
+ RETURN_FALSE;
+ break;
+ case PGRES_COMMAND_OK: /* successful command that did not return rows */
+ default:
+ if (pgsql_result) {
+ pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle));
+ pg_result->conn = pgsql;
+ pg_result->result = pgsql_result;
+ pg_result->row = 0;
+ ZEND_REGISTER_RESOURCE(return_value, pg_result, le_result);
+ } else {
+ PQclear(pgsql_result);
+ RETURN_FALSE;
+ }
+ break;
+ }
+}
+/* }}} */
+#endif
+
+#if HAVE_PQPREPARE
+/* {{{ proto resource pg_prepare([resource connection,] string stmtname, string query)
+ Prepare a query for future execution */
+PHP_FUNCTION(pg_prepare)
+{
+ zval **query, **stmtname, **pgsql_link = NULL;
+ int id = -1;
+ int leftover = 0;
+ PGconn *pgsql;
+ PGresult *pgsql_result;
+ ExecStatusType status;
+ pgsql_result_handle *pg_result;
+
+ switch(ZEND_NUM_ARGS()) {
+ case 2:
+ if (zend_get_parameters_ex(2, &stmtname, &query)==FAILURE) {
+ RETURN_FALSE;
+ }
+ id = PGG(default_link);
+ CHECK_DEFAULT_LINK(id);
+ break;
+ case 3:
+ if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &query)==FAILURE) {
+ RETURN_FALSE;
+ }
+ break;
+ default:
+ WRONG_PARAM_COUNT;
+ break;
+ }
+ if (pgsql_link == NULL && id == -1) {
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+
+ convert_to_string_ex(stmtname);
+ convert_to_string_ex(query);
+ if (PQ_SETNONBLOCKING(pgsql, 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ RETURN_FALSE;
+ }
+ while ((pgsql_result = PQgetResult(pgsql))) {
+ PQclear(pgsql_result);
+ leftover = 1;
+ }
+ if (leftover) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ }
+ pgsql_result = PQprepare(pgsql, Z_STRVAL_PP(stmtname), Z_STRVAL_PP(query), 0, NULL);
+ if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
+ PQclear(pgsql_result);
+ PQreset(pgsql);
+ pgsql_result = PQprepare(pgsql, Z_STRVAL_PP(stmtname), Z_STRVAL_PP(query), 0, NULL);
+ }
+
+ if (pgsql_result) {
+ status = PQresultStatus(pgsql_result);
+ } else {
+ status = (ExecStatusType) PQstatus(pgsql);
+ }
+
+ switch (status) {
+ case PGRES_EMPTY_QUERY:
+ case PGRES_BAD_RESPONSE:
+ case PGRES_NONFATAL_ERROR:
+ case PGRES_FATAL_ERROR:
+ PHP_PQ_ERROR("Query failed: %s", pgsql);
+ PQclear(pgsql_result);
+ RETURN_FALSE;
+ break;
+ case PGRES_COMMAND_OK: /* successful command that did not return rows */
+ default:
+ if (pgsql_result) {
+ pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle));
+ pg_result->conn = pgsql;
+ pg_result->result = pgsql_result;
+ pg_result->row = 0;
+ ZEND_REGISTER_RESOURCE(return_value, pg_result, le_result);
+ } else {
+ PQclear(pgsql_result);
+ RETURN_FALSE;
+ }
+ break;
+ }
+}
+/* }}} */
+#endif
+
+#if HAVE_PQEXECPREPARED
+/* {{{ proto resource pg_execute([resource connection,] string stmtname, array params)
+ Execute a prepared query */
+PHP_FUNCTION(pg_execute)
+{
+ zval **stmtname, **pgsql_link = NULL;
+ zval **pv_param_arr, **tmp;
+ int id = -1;
+ int leftover = 0;
+ int num_params = 0;
+ char **params = NULL;
+ unsigned char otype;
+ PGconn *pgsql;
+ PGresult *pgsql_result;
+ ExecStatusType status;
+ pgsql_result_handle *pg_result;
+
+ switch(ZEND_NUM_ARGS()) {
+ case 2:
+ if (zend_get_parameters_ex(2, &stmtname, &pv_param_arr)==FAILURE) {
+ RETURN_FALSE;
+ }
+ id = PGG(default_link);
+ CHECK_DEFAULT_LINK(id);
+ break;
+ case 3:
+ if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &pv_param_arr)==FAILURE) {
+ RETURN_FALSE;
+ }
+ break;
+ default:
+ WRONG_PARAM_COUNT;
+ break;
+ }
+ if (pgsql_link == NULL && id == -1) {
+ RETURN_FALSE;
+ }
+
+ if (Z_TYPE_PP(pv_param_arr) != IS_ARRAY) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No array passed");
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+
+ convert_to_string_ex(stmtname);
+ if (PQ_SETNONBLOCKING(pgsql, 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ RETURN_FALSE;
+ }
+ while ((pgsql_result = PQgetResult(pgsql))) {
+ PQclear(pgsql_result);
+ leftover = 1;
+ }
+ if (leftover) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ }
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr));
+ num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr));
+ if (num_params > 0) {
+ int i = 0;
+ params = (char **)safe_emalloc(sizeof(char *), num_params, 0);
+
+ for(i = 0; i < num_params; i++) {
+ if (zend_hash_get_current_data(Z_ARRVAL_PP(pv_param_arr), (void **) &tmp) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter");
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+
+ otype = (*tmp)->type;
+ convert_to_string(*tmp);
+ if (Z_TYPE_PP(tmp) != IS_STRING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+
+ if (otype == IS_NULL) {
+ params[i] = NULL;
+ }
+ else {
+ params[i] = Z_STRVAL_PP(tmp);
+ }
+
+ zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr));
+ }
+ }
+
+ pgsql_result = PQexecPrepared(pgsql, Z_STRVAL_PP(stmtname), num_params,
+ (const char * const *)params, NULL, NULL, 0);
+ if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
+ PQclear(pgsql_result);
+ PQreset(pgsql);
+ pgsql_result = PQexecPrepared(pgsql, Z_STRVAL_PP(stmtname), num_params,
+ (const char * const *)params, NULL, NULL, 0);
+ }
+
+ if (pgsql_result) {
+ status = PQresultStatus(pgsql_result);
+ } else {
+ status = (ExecStatusType) PQstatus(pgsql);
+ }
+
+ _php_pgsql_free_params(params, num_params);
+
+ switch (status) {
+ case PGRES_EMPTY_QUERY:
+ case PGRES_BAD_RESPONSE:
+ case PGRES_NONFATAL_ERROR:
+ case PGRES_FATAL_ERROR:
+ PHP_PQ_ERROR("Query failed: %s", pgsql);
+ PQclear(pgsql_result);
+ RETURN_FALSE;
+ break;
+ case PGRES_COMMAND_OK: /* successful command that did not return rows */
+ default:
+ if (pgsql_result) {
+ pg_result = (pgsql_result_handle *) emalloc(sizeof(pgsql_result_handle));
+ pg_result->conn = pgsql;
+ pg_result->result = pgsql_result;
+ pg_result->row = 0;
+ ZEND_REGISTER_RESOURCE(return_value, pg_result, le_result);
+ } else {
+ PQclear(pgsql_result);
+ RETURN_FALSE;
+ }
+ break;
+ }
+}
+/* }}} */
+#endif
+
#define PHP_PG_NUM_ROWS 1
#define PHP_PG_NUM_FIELDS 2
#define PHP_PG_CMD_TUPLES 3
@@ -1220,7 +1654,7 @@ static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC)
PQclear(result);
}
smart_str_free(&str);
- return empty_string;
+ return STR_EMPTY_ALLOC();
}
num_rows = PQntuples(result);
oid_offset = PQfnumber(result,"oid");
@@ -1257,6 +1691,7 @@ static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC)
#define PHP_PG_FIELD_NAME 1
#define PHP_PG_FIELD_SIZE 2
#define PHP_PG_FIELD_TYPE 3
+#define PHP_PG_FIELD_TYPE_OID 4
/* {{{ php_pgsql_get_field_info
*/
@@ -1265,6 +1700,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
zval **result, **field;
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
+ Oid oid;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &result, &field)==FAILURE) {
WRONG_PARAM_COUNT;
@@ -1296,6 +1732,24 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
break;
+ case PHP_PG_FIELD_TYPE_OID:
+
+ oid = PQftype(pgsql_result, Z_LVAL_PP(field));
+
+ if (oid > LONG_MAX) {
+ smart_str s = {0};
+ smart_str_append_unsigned(&s, oid);
+ smart_str_0(&s);
+ Z_STRVAL_P(return_value) = s.c;
+ Z_STRLEN_P(return_value) = s.len;
+ Z_TYPE_P(return_value) = IS_STRING;
+ }
+ else
+ {
+ Z_LVAL_P(return_value) = (long)oid;
+ Z_TYPE_P(return_value) = IS_LONG;
+ }
+ break;
default:
RETURN_FALSE;
}
@@ -1326,6 +1780,15 @@ PHP_FUNCTION(pg_field_type)
}
/* }}} */
+
+/* {{{ proto string pg_field_type_oid(resource result, int field_number)
+ Returns the type oid for the given field */
+PHP_FUNCTION(pg_field_type_oid)
+{
+ php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_FIELD_TYPE_OID);
+}
+/* }}} */
+
/* {{{ proto int pg_field_num(resource result, string field_name)
Returns the field number of the named field */
PHP_FUNCTION(pg_field_num)
@@ -1409,11 +1872,11 @@ PHP_FUNCTION(pg_fetch_result)
/* {{{ void php_pgsql_fetch_hash */
static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, int into_object)
{
- zval *result, *zrow;
+ zval *result, *zrow = NULL;
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
int i, num_fields, pgsql_row, use_row;
- long row;
+ long row = -1;
char *element, *field_name;
uint element_len;
zval *ctor_params = NULL;
@@ -1423,9 +1886,9 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,
char *class_name;
int class_name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|zsz", &result, &zrow, &class_name, &class_name_len, &ctor_params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!sz", &result, &zrow, &class_name, &class_name_len, &ctor_params) == FAILURE) {
return;
- }
+ }
if (ZEND_NUM_ARGS() < 3) {
ce = zend_standard_class_def;
} else {
@@ -1437,15 +1900,17 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,
}
result_type = PGSQL_ASSOC;
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|zl", &result, &zrow, &result_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!l", &result, &zrow, &result_type) == FAILURE) {
return;
}
}
- use_row = ZEND_NUM_ARGS() > 1 && Z_TYPE_P(zrow) != IS_NULL;
- if (use_row) {
- convert_to_long_ex(&zrow);
+ if (zrow == NULL) {
+ row = -1;
+ } else {
+ convert_to_long(zrow);
row = Z_LVAL_P(zrow);
}
+ use_row = ZEND_NUM_ARGS() > 1 && row != -1;
if (!(result_type & PGSQL_BOTH)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type");
@@ -1639,6 +2104,47 @@ PHP_FUNCTION(pg_fetch_all)
}
/* }}} */
+/* {{{ proto array pg_fetch_all_columns(resource result [, int column_number])
+ Fetch all rows into array */
+PHP_FUNCTION(pg_fetch_all_columns)
+{
+ zval *result;
+ PGresult *pgsql_result;
+ pgsql_result_handle *pg_result;
+ long colno=0;
+ int pg_numrows, pg_row;
+ size_t num_fields;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result, &colno) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result);
+
+ pgsql_result = pg_result->result;
+
+ num_fields = PQnfields(pgsql_result);
+ if (colno >= num_fields || colno < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column number '%ld'", colno);
+ RETURN_FALSE;
+ }
+
+ array_init(return_value);
+
+ if ((pg_numrows = PQntuples(pgsql_result)) <= 0) {
+ return;
+ }
+
+ for (pg_row = 0; pg_row < pg_numrows; pg_row++) {
+ if (PQgetisnull(pgsql_result, pg_row, colno)) {
+ add_next_index_null(return_value);
+ } else {
+ add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, colno), 1);
+ }
+ }
+}
+/* }}} */
+
/* {{{ proto bool pg_result_seek(resource result, int offset)
Set internal row offset */
PHP_FUNCTION(pg_result_seek)
@@ -1792,7 +2298,7 @@ PHP_FUNCTION(pg_last_oid)
if (Z_STRVAL_P(return_value)) {
RETURN_STRING(Z_STRVAL_P(return_value), 1);
}
- RETURN_STRING(empty_string, 0);
+ RETURN_STRING("", 1);
#endif
}
/* }}} */
@@ -2462,6 +2968,51 @@ PHP_FUNCTION(pg_lo_tell)
}
/* }}} */
+#if HAVE_PQSETERRORVERBOSITY
+/* {{{ proto int pg_set_error_verbosity([resource connection,] int verbosity)
+ Set error verbosity */
+PHP_FUNCTION(pg_set_error_verbosity)
+{
+ zval **verbosity, **pgsql_link = NULL;
+ long val;
+ int id = -1;
+ PGconn *pgsql;
+
+ switch(ZEND_NUM_ARGS()) {
+ case 1:
+ if (zend_get_parameters_ex(1, &verbosity)==FAILURE) {
+ RETURN_FALSE;
+ }
+ id = PGG(default_link);
+ CHECK_DEFAULT_LINK(id);
+ break;
+ case 2:
+ if (zend_get_parameters_ex(2, &pgsql_link, &verbosity)==FAILURE) {
+ RETURN_FALSE;
+ }
+ break;
+ default:
+ WRONG_PARAM_COUNT;
+ break;
+ }
+ if (pgsql_link == NULL && id == -1) {
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+
+ convert_to_long_ex(verbosity);
+ val = Z_LVAL_PP(verbosity);
+ if (val & (PQERRORS_TERSE|PQERRORS_DEFAULT|PQERRORS_VERBOSE)) {
+ Z_LVAL_P(return_value) = PQsetErrorVerbosity(pgsql, val);
+ Z_TYPE_P(return_value) = IS_LONG;
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+#endif
+
#ifdef HAVE_PQCLIENTENCODING
/* {{{ proto int pg_set_client_encoding([resource connection,] string encoding)
Set client encoding */
@@ -2544,8 +3095,9 @@ PHP_FUNCTION(pg_client_encoding)
/* }}} */
#endif
-
+#if !HAVE_PQGETCOPYDATA
#define COPYBUFSIZ 8192
+#endif
/* {{{ proto bool pg_end_copy([resource connection])
Sync with backend. Completes the Copy command */
@@ -2621,7 +3173,6 @@ PHP_FUNCTION(pg_put_line)
convert_to_string_ex(query);
result = PQputline(pgsql, Z_STRVAL_PP(query));
-
if (result==EOF) {
PHP_PQ_ERROR("Query failed: %s", pgsql);
RETURN_FALSE;
@@ -2644,7 +3195,9 @@ PHP_FUNCTION(pg_copy_to)
PGresult *pgsql_result;
ExecStatusType status;
int copydone = 0;
+#if !HAVE_PQGETCOPYDATA
char copybuf[COPYBUFSIZ];
+#endif
char *csv = (char *)NULL;
int ret;
int argc = ZEND_NUM_ARGS();
@@ -2685,6 +3238,26 @@ PHP_FUNCTION(pg_copy_to)
if (pgsql_result) {
PQclear(pgsql_result);
array_init(return_value);
+#if HAVE_PQGETCOPYDATA
+ while (!copydone)
+ {
+ ret = PQgetCopyData(pgsql, &csv, 0);
+ switch (ret) {
+ case -1:
+ copydone = 1;
+ break;
+ case 0:
+ case -2:
+ PHP_PQ_ERROR("getline failed: %s", pgsql);
+ RETURN_FALSE;
+ break;
+ default:
+ add_next_index_string(return_value, csv, 1);
+ free(csv);
+ break;
+ }
+ }
+#else
while (!copydone)
{
if ((ret = PQgetline(pgsql, copybuf, COPYBUFSIZ))) {
@@ -2725,6 +3298,7 @@ PHP_FUNCTION(pg_copy_to)
PHP_PQ_ERROR("endcopy failed: %s", pgsql);
RETURN_FALSE;
}
+#endif
while ((pgsql_result = PQgetResult(pgsql))) {
PQclear(pgsql_result);
}
@@ -2797,15 +3371,36 @@ PHP_FUNCTION(pg_copy_from)
switch (status) {
case PGRES_COPY_IN:
if (pgsql_result) {
+ int command_failed = 0;
PQclear(pgsql_result);
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(pg_rows), &pos);
+#if HAVE_PQPUTCOPYDATA
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(pg_rows), (void **) &tmp, &pos) == SUCCESS) {
convert_to_string_ex(tmp);
query = (char *)emalloc(Z_STRLEN_PP(tmp) +2);
strcpy(query, Z_STRVAL_PP(tmp));
if(*(query+Z_STRLEN_PP(tmp)-1) != '\n')
strcat(query, "\n");
- if (PQputline(pgsql, query)) {
+ if (PQputCopyData(pgsql, query, strlen(query)) != 1) {
+ efree(query);
+ PHP_PQ_ERROR("copy failed: %s", pgsql);
+ RETURN_FALSE;
+ }
+ efree(query);
+ zend_hash_move_forward_ex(Z_ARRVAL_P(pg_rows), &pos);
+ }
+ if (PQputCopyEnd(pgsql, NULL) != 1) {
+ PHP_PQ_ERROR("putcopyend failed: %s", pgsql);
+ RETURN_FALSE;
+ }
+#else
+ while (zend_hash_get_current_data_ex(Z_ARRVAL_P(pg_rows), (void **) &tmp, &pos) == SUCCESS) {
+ convert_to_string_ex(tmp);
+ query = (char *)emalloc(Z_STRLEN_PP(tmp) +2);
+ strcpy(query, Z_STRVAL_PP(tmp));
+ if(*(query+Z_STRLEN_PP(tmp)-1) != '\n')
+ strcat(query, "\n");
+ if (PQputline(pgsql, query)==EOF) {
efree(query);
PHP_PQ_ERROR("copy failed: %s", pgsql);
RETURN_FALSE;
@@ -2821,9 +3416,17 @@ PHP_FUNCTION(pg_copy_from)
PHP_PQ_ERROR("endcopy failed: %s", pgsql);
RETURN_FALSE;
}
+#endif
while ((pgsql_result = PQgetResult(pgsql))) {
+ if (PGRES_COMMAND_OK != PQresultStatus(pgsql_result)) {
+ PHP_PQ_ERROR("Copy command failed: %s", pgsql);
+ command_failed = 1;
+ }
PQclear(pgsql_result);
}
+ if (command_failed) {
+ RETURN_FALSE;
+ }
} else {
PQclear(pgsql_result);
RETURN_FALSE;
@@ -2876,6 +3479,7 @@ PHP_FUNCTION(pg_escape_bytea)
}
/* }}} */
+#if !HAVE_PQUNESCAPEBYTEA
/* PQunescapeBytea() from PostgreSQL 7.3 to provide bytea unescape feature to 7.2 users.
Renamed to php_pgsql_unescape_bytea() */
/*
@@ -2979,12 +3583,13 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t *
*retbuflen = buflen;
return buffer;
}
+#endif
/* {{{ proto string pg_unescape_bytea(string data)
Unescape binary for bytea type */
PHP_FUNCTION(pg_unescape_bytea)
{
- char *from = NULL, *to = NULL;
+ char *from = NULL, *to = NULL, *tmp = NULL;
size_t to_len;
int from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
@@ -2992,7 +3597,13 @@ PHP_FUNCTION(pg_unescape_bytea)
return;
}
+#if HAVE_PQUNESCAPEBYTEA
+ tmp = (char *)PQunescapeBytea((unsigned char*)from, &to_len);
+ to = estrndup(tmp, to_len);
+ free(tmp);
+#else
to = (char *)php_pgsql_unescape_bytea((unsigned char*)from, &to_len);
+#endif
if (!to) {
RETURN_FALSE;
}
@@ -3026,6 +3637,51 @@ PHP_FUNCTION(pg_result_error)
}
/* }}} */
+#if HAVE_PQRESULTERRORFIELD
+/* {{{ proto string pg_result_error_field(resource result, int fieldcode)
+ Get error message field associated with result */
+PHP_FUNCTION(pg_result_error_field)
+{
+ zval *result;
+ long fieldcode;
+ PGresult *pgsql_result;
+ pgsql_result_handle *pg_result;
+ char *field = NULL;
+
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rl",
+ &result, &fieldcode) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result);
+
+ pgsql_result = pg_result->result;
+ if (!pgsql_result) {
+ RETURN_FALSE;
+ }
+ if (fieldcode & (PG_DIAG_SEVERITY|PG_DIAG_SQLSTATE|PG_DIAG_MESSAGE_PRIMARY|PG_DIAG_MESSAGE_DETAIL
+ |PG_DIAG_MESSAGE_HINT|PG_DIAG_STATEMENT_POSITION
+#if PG_DIAG_INTERNAL_POSITION
+ |PG_DIAG_INTERNAL_POSITION
+#endif
+#if PG_DIAG_INTERNAL_QUERY
+ |PG_DIAG_INTERNAL_QUERY
+#endif
+ |PG_DIAG_CONTEXT|PG_DIAG_SOURCE_FILE|PG_DIAG_SOURCE_LINE
+ |PG_DIAG_SOURCE_FUNCTION)) {
+ field = (char *)PQresultErrorField(pgsql_result, fieldcode);
+ if (field == NULL) {
+ RETURN_NULL();
+ } else {
+ RETURN_STRING(field, 1);
+ }
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+#endif
+
/* {{{ proto int pg_connection_status(resource connnection)
Get connection status */
PHP_FUNCTION(pg_connection_status)
@@ -3046,6 +3702,28 @@ PHP_FUNCTION(pg_connection_status)
/* }}} */
+#if HAVE_PGTRANSACTIONSTATUS
+/* {{{ proto int pg_transaction_status(resource connnection)
+ Get transaction status */
+PHP_FUNCTION(pg_transaction_status)
+{
+ zval *pgsql_link = NULL;
+ int id = -1;
+ PGconn *pgsql;
+
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ &pgsql_link) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+
+ RETURN_LONG(PQtransactionStatus(pgsql));
+}
+#endif
+
+/* }}} */
+
/* {{{ proto bool pg_connection_reset(resource connection)
Reset connection (reconnect) */
PHP_FUNCTION(pg_connection_reset)
@@ -3153,7 +3831,7 @@ PHP_FUNCTION(pg_connection_busy)
}
/* }}} */
-/* {{{ proto bool pg_send_query(resource connection, string qeury)
+/* {{{ proto bool pg_send_query(resource connection, string query)
Send asynchronous query */
PHP_FUNCTION(pg_send_query)
{
@@ -3198,6 +3876,242 @@ PHP_FUNCTION(pg_send_query)
}
/* }}} */
+#if HAVE_PQSENDQUERYPARAMS
+/* {{{ proto bool pg_send_query_params(resource connection, string query)
+ Send asynchronous parameterized query */
+PHP_FUNCTION(pg_send_query_params)
+{
+ zval **pgsql_link;
+ zval **pv_param_arr, **tmp;
+ int num_params = 0;
+ char **params = NULL;
+ unsigned char otype;
+ zval **query;
+ int id = -1;
+ PGconn *pgsql;
+ PGresult *res;
+ int leftover = 0;
+
+ if (zend_get_parameters_ex(3, &pgsql_link, &query, &pv_param_arr) == FAILURE) {
+ return;
+ }
+
+ if (pgsql_link == NULL && id == -1) {
+ RETURN_FALSE;
+ }
+
+ if (Z_TYPE_PP(pv_param_arr) != IS_ARRAY) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No array passed");
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+
+ convert_to_string_ex(query);
+ if (PQ_SETNONBLOCKING(pgsql, 1)) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ RETURN_FALSE;
+ }
+ while ((res = PQgetResult(pgsql))) {
+ PQclear(res);
+ leftover = 1;
+ }
+ if (leftover) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There are results on this connection. Call pg_get_result() until it returns FALSE");
+ }
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr));
+ num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr));
+ if (num_params > 0) {
+ int i = 0;
+ params = (char **)safe_emalloc(sizeof(char *), num_params, 0);
+
+ for(i = 0; i < num_params; i++) {
+ if (zend_hash_get_current_data(Z_ARRVAL_PP(pv_param_arr), (void **) &tmp) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter");
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+
+ otype = (*tmp)->type;
+ convert_to_string(*tmp);
+ if (Z_TYPE_PP(tmp) != IS_STRING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+
+ if (otype == IS_NULL) {
+ params[i] = NULL;
+ }
+ else {
+ params[i] = Z_STRVAL_PP(tmp);
+ }
+
+ zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr));
+ }
+ }
+
+ if (!PQsendQueryParams(pgsql, Z_STRVAL_PP(query), num_params, NULL, (const char * const *)params, NULL, NULL, 0)) {
+ if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
+ PQreset(pgsql);
+ }
+ if (!PQsendQueryParams(pgsql, Z_STRVAL_PP(query), num_params, NULL, (const char * const *)params, NULL, NULL, 0)) {
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+ }
+ _php_pgsql_free_params(params, num_params);
+ if (PQ_SETNONBLOCKING(pgsql, 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ }
+ RETURN_TRUE;
+}
+/* }}} */
+#endif
+
+#if HAVE_PQSENDPREPARE
+/* {{{ proto bool pg_send_prepare(resource connection, string stmtname, string query)
+ Asynchronously prepare a query for future execution */
+PHP_FUNCTION(pg_send_prepare)
+{
+ zval **pgsql_link;
+ zval **query, **stmtname;
+ int id = -1;
+ PGconn *pgsql;
+ PGresult *res;
+ int leftover = 0;
+
+ if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &query) == FAILURE) {
+ return;
+ }
+ if (pgsql_link == NULL && id == -1) {
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+
+ convert_to_string_ex(stmtname);
+ convert_to_string_ex(query);
+ if (PQ_SETNONBLOCKING(pgsql, 1)) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ RETURN_FALSE;
+ }
+ while ((res = PQgetResult(pgsql))) {
+ PQclear(res);
+ leftover = 1;
+ }
+ if (leftover) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There are results on this connection. Call pg_get_result() until it returns FALSE");
+ }
+ if (!PQsendPrepare(pgsql, Z_STRVAL_PP(stmtname), Z_STRVAL_PP(query), 0, NULL)) {
+ if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
+ PQreset(pgsql);
+ }
+ if (!PQsendPrepare(pgsql, Z_STRVAL_PP(stmtname), Z_STRVAL_PP(query), 0, NULL)) {
+ RETURN_FALSE;
+ }
+ }
+ if (PQ_SETNONBLOCKING(pgsql, 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ }
+ RETURN_TRUE;
+}
+/* }}} */
+#endif
+
+#if HAVE_PQSENDQUERYPREPARED
+/* {{{ proto bool pg_send_execute(resource connection, string stmtname, array params)
+ Executes prevriously prepared stmtname asynchronously */
+PHP_FUNCTION(pg_send_execute)
+{
+ zval **pgsql_link;
+ zval **pv_param_arr, **tmp;
+ int num_params = 0;
+ char **params = NULL;
+ unsigned char otype;
+ zval **stmtname;
+ int id = -1;
+ PGconn *pgsql;
+ PGresult *res;
+ int leftover = 0;
+
+ if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &pv_param_arr)==FAILURE) {
+ return;
+ }
+ if (pgsql_link == NULL && id == -1) {
+ RETURN_FALSE;
+ }
+
+ if (Z_TYPE_PP(pv_param_arr) != IS_ARRAY) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No array passed");
+ RETURN_FALSE;
+ }
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+
+ convert_to_string_ex(stmtname);
+ if (PQ_SETNONBLOCKING(pgsql, 1)) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ RETURN_FALSE;
+ }
+ while ((res = PQgetResult(pgsql))) {
+ PQclear(res);
+ leftover = 1;
+ }
+ if (leftover) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There are results on this connection. Call pg_get_result() until it returns FALSE");
+ }
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr));
+ num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr));
+ if (num_params > 0) {
+ int i = 0;
+ params = (char **)safe_emalloc(sizeof(char *), num_params, 0);
+
+ for(i = 0; i < num_params; i++) {
+ if (zend_hash_get_current_data(Z_ARRVAL_PP(pv_param_arr), (void **) &tmp) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter");
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+
+ otype = (*tmp)->type;
+ convert_to_string(*tmp);
+ if (Z_TYPE_PP(tmp) != IS_STRING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+
+ if (otype == IS_NULL) {
+ params[i] = NULL;
+ }
+ else {
+ params[i] = Z_STRVAL_PP(tmp);
+ }
+
+ zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr));
+ }
+ }
+
+ if (!PQsendQueryPrepared(pgsql, Z_STRVAL_PP(stmtname), num_params, (const char * const *)params, NULL, NULL, 0)) {
+ if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
+ PQreset(pgsql);
+ }
+ if (!PQsendQueryPrepared(pgsql, Z_STRVAL_PP(stmtname), num_params, (const char * const *)params, NULL, NULL, 0)) {
+ _php_pgsql_free_params(params, num_params);
+ RETURN_FALSE;
+ }
+ }
+ _php_pgsql_free_params(params, num_params);
+ if (PQ_SETNONBLOCKING(pgsql, 0)) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ }
+ RETURN_TRUE;
+}
+/* }}} */
+#endif
/* {{{ proto resource pg_get_result(resource connection)
Get asynchronous query result */
@@ -3278,7 +4192,7 @@ PHP_FUNCTION(pg_get_notify)
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
-
+
if (!(result_type & PGSQL_BOTH)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type");
RETURN_FALSE;
@@ -4328,7 +5242,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var
smart_str_append_long(&querystr, Z_LVAL_PP(val));
break;
case IS_DOUBLE:
- smart_str_appendl(&querystr, buf, sprintf(buf, "%f", Z_DVAL_PP(val)));
+ smart_str_appendl(&querystr, buf, snprintf(buf, sizeof(buf), "%f", Z_DVAL_PP(val)));
break;
default:
/* should not happen */
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index 1b56208d9..e7ca2219c 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pgsql.h,v 1.67.2.1 2005/04/13 21:46:32 derick Exp $ */
+/* $Id: php_pgsql.h,v 1.73 2005/08/03 14:07:41 sniper Exp $ */
#ifndef PHP_PGSQL_H
#define PHP_PGSQL_H
@@ -75,9 +75,30 @@ PHP_FUNCTION(pg_ping);
#if HAVE_PQPARAMETERSTATUS
PHP_FUNCTION(pg_parameter_status);
#endif
+#if HAVE_PGTRANSACTIONSTATUS
+PHP_FUNCTION(pg_transaction_status);
+#endif
/* query functions */
PHP_FUNCTION(pg_query);
+#if HAVE_PQEXECPARAMS
+PHP_FUNCTION(pg_query_params);
+#endif
+#if HAVE_PQPREPARE
+PHP_FUNCTION(pg_prepare);
+#endif
+#if HAVE_PQEXECPREPARED
+PHP_FUNCTION(pg_execute);
+#endif
PHP_FUNCTION(pg_send_query);
+#if HAVE_PQSENDQUERYPARAMS
+PHP_FUNCTION(pg_send_query_params);
+#endif
+#if HAVE_PQSENDPREPARE
+PHP_FUNCTION(pg_send_prepare);
+#endif
+#if HAVE_PQSENDQUERYPREPARED
+PHP_FUNCTION(pg_send_execute);
+#endif
PHP_FUNCTION(pg_cancel_query);
/* result functions */
PHP_FUNCTION(pg_fetch_assoc);
@@ -86,6 +107,7 @@ PHP_FUNCTION(pg_fetch_object);
PHP_FUNCTION(pg_fetch_result);
PHP_FUNCTION(pg_fetch_row);
PHP_FUNCTION(pg_fetch_all);
+PHP_FUNCTION(pg_fetch_all_columns);
#if HAVE_PQCMDTUPLES
PHP_FUNCTION(pg_affected_rows);
#endif
@@ -100,6 +122,7 @@ PHP_FUNCTION(pg_field_name);
PHP_FUNCTION(pg_field_num);
PHP_FUNCTION(pg_field_size);
PHP_FUNCTION(pg_field_type);
+PHP_FUNCTION(pg_field_type_oid);
PHP_FUNCTION(pg_field_prtlen);
PHP_FUNCTION(pg_field_is_null);
/* async message functions */
@@ -107,6 +130,9 @@ PHP_FUNCTION(pg_get_notify);
PHP_FUNCTION(pg_get_pid);
/* error message functions */
PHP_FUNCTION(pg_result_error);
+#if HAVE_PQRESULTERRORFIELD
+PHP_FUNCTION(pg_result_error_field);
+#endif
PHP_FUNCTION(pg_last_error);
PHP_FUNCTION(pg_last_notice);
/* copy functions */
@@ -134,6 +160,9 @@ PHP_FUNCTION(pg_untrace);
/* utility functions */
PHP_FUNCTION(pg_client_encoding);
PHP_FUNCTION(pg_set_client_encoding);
+#if HAVE_PQSETERRORVERBOSITY
+PHP_FUNCTION(pg_set_error_verbosity);
+#endif
#if HAVE_PQESCAPE
PHP_FUNCTION(pg_escape_string);
PHP_FUNCTION(pg_escape_bytea);
diff --git a/ext/pgsql/tests/02connection.phpt b/ext/pgsql/tests/02connection.phpt
index 4f21fcdf9..6288d0e17 100644
--- a/ext/pgsql/tests/02connection.phpt
+++ b/ext/pgsql/tests/02connection.phpt
@@ -23,6 +23,12 @@ if (pg_connection_busy($db))
{
echo "pg_connection_busy() error\n";
}
+if (function_exists('pg_transaction_status')) {
+ if (pg_transaction_status($db) != PGSQL_TRANSACTION_IDLE)
+ {
+ echo "pg_transaction_status() error\n";
+ }
+}
if (!pg_host($db))
{
echo "pg_host() error\n";
diff --git a/ext/pgsql/tests/03sync_query.phpt b/ext/pgsql/tests/03sync_query.phpt
index 96827fe5a..afb6bb447 100644
--- a/ext/pgsql/tests/03sync_query.phpt
+++ b/ext/pgsql/tests/03sync_query.phpt
@@ -32,6 +32,26 @@ for ($i=0; $i < $rows; $i++)
}
pg_result_error($result);
+if (function_exists('pg_result_error_field')) {
+ pg_result_error_field($result, PGSQL_DIAG_SEVERITY);
+ pg_result_error_field($result, PGSQL_DIAG_SQLSTATE);
+ pg_result_error_field($result, PGSQL_DIAG_MESSAGE_PRIMARY);
+ pg_result_error_field($result, PGSQL_DIAG_MESSAGE_DETAIL);
+ pg_result_error_field($result, PGSQL_DIAG_MESSAGE_HINT);
+ pg_result_error_field($result, PGSQL_DIAG_STATEMENT_POSITION);
+ if (defined('PGSQL_DIAG_INTERNAL_POSITION'))
+ {
+ pg_result_error_field($result, PGSQL_DIAG_INTERNAL_POSITION);
+ }
+ if (defined('PGSQL_DIAG_INTERNAL_QUERY'))
+ {
+ pg_result_error_field($result, PGSQL_DIAG_INTERNAL_QUERY);
+ }
+ pg_result_error_field($result, PGSQL_DIAG_CONTEXT);
+ pg_result_error_field($result, PGSQL_DIAG_SOURCE_FILE);
+ pg_result_error_field($result, PGSQL_DIAG_SOURCE_LINE);
+ pg_result_error_field($result, PGSQL_DIAG_SOURCE_FUNCTION);
+}
pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";"));
pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";"));
pg_field_name($result, 0);
diff --git a/ext/pgsql/tests/06copy.phpt b/ext/pgsql/tests/06copy.phpt
index e5823c43a..bed783a6f 100644
--- a/ext/pgsql/tests/06copy.phpt
+++ b/ext/pgsql/tests/06copy.phpt
@@ -7,6 +7,13 @@ PostgreSQL copy functions
include('config.inc');
+$db = pg_connect($conn_str);
+
+$rows = pg_copy_to($db, $table_name);
+
+pg_query($db, "DELETE FROM $table_name");
+
+pg_copy_from($db, $table_name, $rows);
echo "OK";
diff --git a/ext/pgsql/tests/07optional.phpt b/ext/pgsql/tests/07optional.phpt
index e73a9cffe..9fa6f1633 100644
--- a/ext/pgsql/tests/07optional.phpt
+++ b/ext/pgsql/tests/07optional.phpt
@@ -13,6 +13,11 @@ $enc = pg_client_encoding($db);
pg_set_client_encoding($db, $enc);
+if (function_exists('pg_set_error_verbosity')) {
+ pg_set_error_verbosity(PGSQL_ERRORS_TERSE);
+ pg_set_error_verbosity(PGSQL_ERRORS_DEFAULT);
+ pg_set_error_verbosity(PGSQL_ERRORS_VERBOSE);
+}
echo "OK";
?>
--EXPECT--
diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt
index c5a3877e3..cf23b50e3 100644
--- a/ext/pgsql/tests/08escape.phpt
+++ b/ext/pgsql/tests/08escape.phpt
@@ -51,14 +51,12 @@ $sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = -9999";
$result = pg_query($db, $sql);
$row = pg_fetch_array($result, 0, PGSQL_ASSOC);
-// Compare
-// Need to wait PostgreSQL 7.3.x for PQunescapeBytea()
-// if ($data === pg_unescape_bytea($row['bin'])) {
-// echo "pg_escape_bytea() actually works with databse\n";
-// }
-// else {
-// echo "pg_escape_bytea() is broken\n";
-// }
+if ($data === pg_unescape_bytea($row['bin'])) {
+ echo "pg_escape_bytea() actually works with database\n";
+}
+else {
+ echo "pg_escape_bytea() is broken\n";
+}
?>
--EXPECT--
@@ -67,3 +65,4 @@ string(9) "ABC\ABC\'"
string(12) "ABC\\ABC\\''"
string(10) "ABC\\ABC\'"
pg_escape_bytea() is Ok
+pg_escape_bytea() actually works with database
diff --git a/ext/pgsql/tests/23sync_query_params.phpt b/ext/pgsql/tests/23sync_query_params.phpt
new file mode 100644
index 000000000..6959cd75a
--- /dev/null
+++ b/ext/pgsql/tests/23sync_query_params.phpt
@@ -0,0 +1,59 @@
+--TEST--
+PostgreSQL sync query params
+--SKIPIF--
+<?php
+include("skipif.inc");
+if (!function_exists('pg_query_params')) die('skip function pg_query_params() does not exist');
+?>
+--FILE--
+<?php
+
+include('config.inc');
+
+$db = pg_connect($conn_str);
+
+$version = pg_version($db);
+if ($version['protocol'] >= 3) {
+ $result = pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100));
+ if (!($rows = pg_num_rows($result)))
+ {
+ echo "pg_num_row() error\n";
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_array($result, $i, PGSQL_NUM);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_object($result);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_row($result, $i);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_result($result, $i, 0);
+ }
+
+ pg_result_error($result);
+ pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
+ pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
+ pg_field_name($result, 0);
+ pg_field_num($result, $field_name);
+ pg_field_size($result, 0);
+ pg_field_type($result, 0);
+ pg_field_prtlen($result, 0);
+ pg_field_is_null($result, 0);
+
+ $result = pg_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC"));
+ pg_last_oid($result);
+
+ pg_free_result($result);
+}
+pg_close($db);
+
+echo "OK";
+?>
+--EXPECT--
+OK
diff --git a/ext/pgsql/tests/24sync_query_prepared.phpt b/ext/pgsql/tests/24sync_query_prepared.phpt
new file mode 100644
index 000000000..ea8f14661
--- /dev/null
+++ b/ext/pgsql/tests/24sync_query_prepared.phpt
@@ -0,0 +1,65 @@
+--TEST--
+PostgreSQL sync prepared queries
+--SKIPIF--
+<?php
+include("skipif.inc");
+if (!function_exists('pg_prepare')) die('skip function pg_prepare() does not exist');
+?>
+--FILE--
+<?php
+
+include('config.inc');
+
+$db = pg_connect($conn_str);
+
+$version = pg_version($db);
+if ($version['protocol'] >= 3) {
+ $result = pg_prepare($db, "php_test", "SELECT * FROM ".$table_name." WHERE num > \$1;");
+ pg_result_error($result);
+ pg_free_result($result);
+ $result = pg_execute($db, "php_test", array(100));
+ if (!($rows = pg_num_rows($result)))
+ {
+ echo "pg_num_row() error\n";
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_array($result, $i, PGSQL_NUM);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_object($result);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_row($result, $i);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_result($result, $i, 0);
+ }
+
+ pg_result_error($result);
+ pg_num_rows(pg_execute($db, "php_test", array(100)));
+ pg_num_fields(pg_execute($db, "php_test", array(100)));
+ pg_field_name($result, 0);
+ pg_field_num($result, $field_name);
+ pg_field_size($result, 0);
+ pg_field_type($result, 0);
+ pg_field_prtlen($result, 0);
+ pg_field_is_null($result, 0);
+
+ $result = pg_prepare($db, "php_test2", "INSERT INTO ".$table_name." VALUES (\$1, \$2);");
+ pg_result_error($result);
+ pg_free_result($result);
+ $result = pg_execute($db, "php_test2", array(9999, "A'BC"));
+ pg_last_oid($result);
+
+ pg_free_result($result);
+}
+pg_close($db);
+
+echo "OK";
+?>
+--EXPECT--
+OK
diff --git a/ext/pgsql/tests/25async_query_params.phpt b/ext/pgsql/tests/25async_query_params.phpt
new file mode 100644
index 000000000..6e7dafe34
--- /dev/null
+++ b/ext/pgsql/tests/25async_query_params.phpt
@@ -0,0 +1,70 @@
+--TEST--
+PostgreSQL async query params
+--SKIPIF--
+<?php
+include("skipif.inc");
+if (!function_exists('pg_send_query_params')) die('skip function pg_send_query_params() does not exist');
+?>
+--FILE--
+<?php
+
+include('config.inc');
+
+$db = pg_connect($conn_str);
+
+$version = pg_version($db);
+if ($version['protocol'] >= 3) {
+ if (!pg_send_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))) {
+ echo "pg_send_query_params() error\n";
+ }
+ while(pg_connection_busy($db)); // busy wait: intended
+ if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
+ echo "pg_connection_status() error\n";
+ }
+ if (!($result = pg_get_result($db)))
+ {
+ echo "pg_get_result() error\n";
+ }
+ if (!($rows = pg_num_rows($result))) {
+ echo "pg_num_rows() error\n";
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_array($result, $i, PGSQL_NUM);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_object($result);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_row($result, $i);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_result($result, $i, 0);
+ }
+
+ pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
+ pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
+ pg_field_name($result, 0);
+ pg_field_num($result, $field_name);
+ pg_field_size($result, 0);
+ pg_field_type($result, 0);
+ pg_field_prtlen($result, 0);
+ pg_field_is_null($result, 0);
+
+ if (!pg_send_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC")))
+ {
+ echo "pg_send_query_params() error\n";
+ }
+
+ pg_last_oid($result);
+ pg_free_result($result);
+}
+pg_close($db);
+
+echo "OK";
+?>
+--EXPECT--
+OK
diff --git a/ext/pgsql/tests/26async_query_prepared.phpt b/ext/pgsql/tests/26async_query_prepared.phpt
new file mode 100644
index 000000000..bda363b75
--- /dev/null
+++ b/ext/pgsql/tests/26async_query_prepared.phpt
@@ -0,0 +1,106 @@
+--TEST--
+PostgreSQL async prepared queries
+--SKIPIF--
+<?php
+include("skipif.inc");
+if (!function_exists('pg_send_prepare')) die('skip function pg_send_prepare() does not exist');
+?>
+--FILE--
+<?php
+
+include('config.inc');
+
+$db = pg_connect($conn_str);
+
+$version = pg_version($db);
+if ($version['protocol'] >= 3) {
+ if (!pg_send_prepare($db, 'php_test', "SELECT * FROM ".$table_name." WHERE num > \$1;")) {
+ echo "pg_send_prepare() error\n";
+ }
+ while(pg_connection_busy($db)); // busy wait: intended
+ if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
+ echo "pg_connection_status() error\n";
+ }
+ if (!($result = pg_get_result($db)))
+ {
+ echo "pg_get_result() error\n";
+ }
+ pg_free_result($result);
+
+ if (!pg_send_execute($db, 'php_test', array(100))) {
+ echo "pg_send_execute() error\n";
+ }
+ while(pg_connection_busy($db)); // busy wait: intended
+ if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
+ echo "pg_connection_status() error\n";
+ }
+ if (!($result = pg_get_result($db)))
+ {
+ echo "pg_get_result() error\n";
+ }
+
+ if (!($rows = pg_num_rows($result))) {
+ echo "pg_num_rows() error\n";
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_array($result, $i, PGSQL_NUM);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_object($result);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_row($result, $i);
+ }
+ for ($i=0; $i < $rows; $i++)
+ {
+ pg_fetch_result($result, $i, 0);
+ }
+
+ pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
+ pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
+ pg_field_name($result, 0);
+ pg_field_num($result, $field_name);
+ pg_field_size($result, 0);
+ pg_field_type($result, 0);
+ pg_field_prtlen($result, 0);
+ pg_field_is_null($result, 0);
+
+ if (!pg_send_prepare($db, "php_test2", "INSERT INTO ".$table_name." VALUES (\$1, \$2);"))
+ {
+ echo "pg_send_prepare() error\n";
+ }
+ while(pg_connection_busy($db)); // busy wait: intended
+ if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
+ echo "pg_connection_status() error\n";
+ }
+ if (!($result = pg_get_result($db)))
+ {
+ echo "pg_get_result() error\n";
+ }
+ pg_free_result($result);
+
+ if (!pg_send_execute($db, "php_test2", array(9999, "A'BC")))
+ {
+ echo "pg_send_execute() error\n";
+ }
+ while(pg_connection_busy($db)); // busy wait: intended
+ if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
+ echo "pg_connection_status() error\n";
+ }
+ if (!($result = pg_get_result($db)))
+ {
+ echo "pg_get_result() error\n";
+ }
+
+ pg_last_oid($result);
+ pg_free_result($result);
+}
+pg_close($db);
+
+echo "OK";
+?>
+--EXPECT--
+OK
diff --git a/ext/pgsql/tests/80_bug32223.phpt b/ext/pgsql/tests/80_bug32223.phpt
new file mode 100755
index 000000000..a605fcc20
--- /dev/null
+++ b/ext/pgsql/tests/80_bug32223.phpt
@@ -0,0 +1,54 @@
+--TEST--
+Bug #32223 (weird behaviour of pg_last_notice)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+
+@pg_query($conn, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'");
+$res = @pg_query($conn, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
+begin
+ RAISE NOTICE ''11111'';
+ return ''f'';
+end;
+' LANGUAGE plpgsql;");
+if (!$res) die('skip PLPGSQL not available');
+?>
+--FILE--
+<?php
+
+require_once('config.inc');
+
+$dbh = @pg_connect($conn_str);
+if (!$dbh) {
+ die ("Could not connect to the server");
+}
+
+//@pg_query($dbh, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'");
+$res = pg_query($dbh, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
+begin
+ RAISE NOTICE ''11111'';
+ return ''f'';
+end;
+' LANGUAGE plpgsql;");
+
+
+$res = pg_query($dbh, 'SELECT test_notice()');
+$row = pg_fetch_row($res, 0);
+var_dump($row);
+pg_free_result($res);
+if ($row[0] == 'f')
+{
+ var_dump(pg_last_notice($dbh));
+}
+
+pg_close($dbh);
+
+?>
+===DONE===
+--EXPECTF--
+array(1) {
+ [0]=>
+ string(1) "f"
+}
+string(14) "NOTICE: 11111"
+===DONE===
diff --git a/ext/pgsql/tests/80_bug32223b.phpt b/ext/pgsql/tests/80_bug32223b.phpt
new file mode 100755
index 000000000..010915e82
--- /dev/null
+++ b/ext/pgsql/tests/80_bug32223b.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Bug #32223 (weird behaviour of pg_last_notice using notice)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+
+@pg_query($conn, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'");
+$res = @pg_query($conn, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
+begin
+ RAISE NOTICE ''11111'';
+ return ''f'';
+end;
+' LANGUAGE plpgsql;");
+if (!$res) die('skip PLPGSQL not available');
+?>
+--FILE--
+<?php
+
+require('config.inc');
+
+define ('dbh', pg_connect($conn_str));
+//$dbh = @pg_connect($conn_str);
+if (!dbh) {
+ die ("Could not connect to the server");
+}
+
+//@pg_query(dbh, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'");
+$res = pg_query(dbh, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
+begin
+ RAISE NOTICE ''11111'';
+ return ''f'';
+end;
+' LANGUAGE plpgsql;");
+
+function tester() {
+ $res = pg_query(dbh, 'SELECT test_notice()');
+ $row = pg_fetch_row($res, 0);
+ var_dump($row);
+ pg_free_result($res);
+ if ($row[0] == 'f')
+ {
+ var_dump(pg_last_notice(dbh));
+ }
+}
+tester();
+
+pg_close(dbh);
+
+?>
+===DONE===
+--EXPECTF--
+array(1) {
+ [0]=>
+ string(1) "f"
+}
+string(14) "NOTICE: 11111"
+===DONE===
diff --git a/ext/posix/config.m4 b/ext/posix/config.m4
index 0a7536ab3..fbd2afed6 100644
--- a/ext/posix/config.m4
+++ b/ext/posix/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.7.14.2 2005/06/06 22:06:00 wez Exp $
+dnl $Id: config.m4,v 1.12 2005/06/30 13:39:42 sniper 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)
+ AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev)
fi
diff --git a/ext/posix/php_posix.h b/ext/posix/php_posix.h
index cfb69a0cf..fd920651b 100644
--- a/ext/posix/php_posix.h
+++ b/ext/posix/php_posix.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
*/
-/* $Id: php_posix.h,v 1.14.2.1 2005/05/09 12:16:11 sniper Exp $ */
+/* $Id: php_posix.h,v 1.18 2005/08/03 14:07:42 sniper Exp $ */
#ifndef PHP_POSIX_H
#define PHP_POSIX_H
@@ -93,6 +93,12 @@ PHP_FUNCTION(posix_getcwd);
#ifdef HAVE_MKFIFO
PHP_FUNCTION(posix_mkfifo);
#endif
+#ifdef HAVE_MKNOD
+PHP_FUNCTION(posix_mknod);
+#endif
+
+/* POSIX.1, 5.6 */
+PHP_FUNCTION(posix_access);
/* POSIX.1, 9.2 */
PHP_FUNCTION(posix_getgrnam);
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 1e5b4aa86..f43b18b00 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: posix.c,v 1.60.2.4 2005/06/06 22:06:00 wez Exp $ */
+/* $Id: posix.c,v 1.70.2.1 2005/11/02 15:53:49 derick Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -114,7 +114,12 @@ function_entry posix_functions[] = {
#ifdef HAVE_MKFIFO
PHP_FE(posix_mkfifo, NULL)
#endif
+#ifdef HAVE_MKNOD
+ PHP_FE(posix_mknod, NULL)
+#endif
+ /* POSIX.1, 5.6 */
+ PHP_FE(posix_access, NULL)
/* POSIX.1, 9.2 */
PHP_FE(posix_getgrnam, NULL)
PHP_FE(posix_getgrgid, NULL)
@@ -138,7 +143,7 @@ function_entry posix_functions[] = {
static PHP_MINFO_FUNCTION(posix)
{
php_info_print_table_start();
- php_info_print_table_row(2, "Revision", "$Revision: 1.60.2.4 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.70.2.1 $");
php_info_print_table_end();
}
/* }}} */
@@ -153,6 +158,26 @@ 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);
+ REGISTER_LONG_CONSTANT("POSIX_R_OK", R_OK, CONST_CS | CONST_PERSISTENT);
+#ifdef S_IFREG
+ REGISTER_LONG_CONSTANT("POSIX_S_IFREG", S_IFREG, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef S_IFCHR
+ REGISTER_LONG_CONSTANT("POSIX_S_IFCHR", S_IFCHR, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef S_IFBLK
+ REGISTER_LONG_CONSTANT("POSIX_S_IFBLK", S_IFBLK, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef S_IFIFO
+ REGISTER_LONG_CONSTANT("POSIX_S_IFIFO", S_IFIFO, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef S_IFSOCK
+ REGISTER_LONG_CONSTANT("POSIX_S_IFSOCK", S_IFSOCK, CONST_CS | CONST_PERSISTENT);
+#endif
+
return SUCCESS;
}
/* }}} */
@@ -204,7 +229,7 @@ PHP_FUNCTION(posix_kill)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &sig) == FAILURE) {
RETURN_FALSE;
}
-
+
if (kill(pid, sig) < 0) {
POSIX_G(last_error) = errno;
RETURN_FALSE;
@@ -560,7 +585,7 @@ PHP_FUNCTION(posix_isatty)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
RETURN_FALSE;
}
-
+
switch (Z_TYPE_P(z_fd)) {
case IS_RESOURCE:
if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
@@ -643,6 +668,59 @@ PHP_FUNCTION(posix_mkfifo)
#endif
/* }}} */
+/* {{{ proto bool posix_mknod(string pathname, int mode [, int major [, int minor]])
+ Make a special or ordinary file (POSIX.1) */
+#ifdef HAVE_MKNOD
+PHP_FUNCTION(posix_mknod)
+{
+ char *path;
+ int path_len;
+ long mode;
+ long major = 0, minor = 0;
+ int result;
+ dev_t php_dev;
+
+ php_dev = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ll", &path, &path_len,
+ &mode, &major, &minor) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) ||
+ (PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR)))) {
+ RETURN_FALSE;
+ }
+
+ if ((mode & S_IFCHR) || (mode & S_IFBLK)) {
+ if (ZEND_NUM_ARGS() == 2) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "For S_IFCHR and S_IFBLK you need to pass a major device kernel identifier");
+ RETURN_FALSE;
+ }
+ if (major == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "Expects argument 3 to be non-zero for POSIX_S_IFCHR and POSIX_S_IFBLK");
+ RETURN_FALSE;
+ } else {
+#if defined(HAVE_MAKEDEV) || defined(makedev)
+ php_dev = makedev(major, minor);
+#else
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not create a block or character device, creating a normal file instead");
+#endif
+ }
+ }
+
+ result = mknod(path, mode, php_dev);
+ if (result < 0) {
+ POSIX_G(last_error) = errno;
+ RETURN_FALSE;
+ }
+
+ RETURN_TRUE;
+}
+#endif
+/* }}} */
+
/* Takes a pointer to posix group and a pointer to an already initialized ZVAL
* array container and fills the array with the posix group member data. */
int php_posix_group_to_array(struct group *g, zval *array_group) {
@@ -672,15 +750,48 @@ int php_posix_group_to_array(struct group *g, zval *array_group) {
POSIX.1, 5.5.1 unlink()
POSIX.1, 5.5.2 rmdir()
POSIX.1, 5.5.3 rename()
- POSIX.1, 5.6.x stat(), access(), chmod(), utime()
- already supported by PHP (access() not supported, because it is
- braindead and dangerous and gives outdated results).
+ POSIX.1, 5.6.x stat(), chmod(), utime() already supported by PHP.
+*/
+
+/* {{{ proto bool posix_access(string file [, int mode])
+ Determine accessibility of a file (POSIX.1 5.6.3) */
+PHP_FUNCTION(posix_access)
+{
+ long mode = 0;
+ int filename_len, ret;
+ char *filename, *path;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &mode) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ path = expand_filepath(filename, NULL TSRMLS_CC);
+
+ if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) ||
+ (PG(safe_mode) && (!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, CHECKUID_NO_ERRORS)))) {
+ efree(path);
+ POSIX_G(last_error) = EPERM;
+ RETURN_FALSE;
+ }
+
+ ret = access(path, mode);
+ efree(path);
+
+ if (ret) {
+ POSIX_G(last_error) = errno;
+ RETURN_FALSE;
+ }
+ RETURN_TRUE;
+}
+/* }}} */
+
+/*
POSIX.1, 6.x most I/O functions already supported by PHP.
POSIX.1, 7.x tty functions, TODO
POSIX.1, 8.x interactions with other C language functions
- POSIX.1, 9.x system database access
- */
+ POSIX.1, 9.x system database access
+*/
/* {{{ proto array posix_getgrnam(string groupname)
Group database access (POSIX.1, 9.2.1) */
@@ -760,6 +871,7 @@ PHP_FUNCTION(posix_getpwnam)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
RETURN_FALSE;
}
+
if (NULL == (pw = getpwnam(name))) {
POSIX_G(last_error) = errno;
RETURN_FALSE;
diff --git a/ext/pspell/README b/ext/pspell/README
index 4969a81bb..2e68a2cb9 100644
--- a/ext/pspell/README
+++ b/ext/pspell/README
@@ -3,7 +3,7 @@ README file for pspell (spellchecker) module for PHP
The latest release of pspell is always available from
- http://pspell.sourceforge.net/
+ http://aspell.net/
This module was developed and tested with aspell-.31.1 and pspell-.11.0.2,
although slightly earlier (and hopefully later) versions of those libraries
diff --git a/ext/pspell/config.m4 b/ext/pspell/config.m4
index e4c16c737..85d0d3b0d 100644
--- a/ext/pspell/config.m4
+++ b/ext/pspell/config.m4
@@ -1,10 +1,10 @@
dnl
-dnl $Id: config.m4,v 1.9.2.1 2005/02/17 03:51:35 sniper Exp $
+dnl $Id: config.m4,v 1.12 2005/05/29 23:16:43 sniper Exp $
dnl
PHP_ARG_WITH(pspell,for PSPELL support,
[ --with-pspell[=DIR] Include PSPELL support.
- GNU Aspell version 0.50.0 or higher required.])
+ GNU Aspell version 0.50.0 or higher required])
if test "$PHP_PSPELL" != "no"; then
PHP_NEW_EXTENSION(pspell, pspell.c, $ext_shared)
@@ -27,7 +27,7 @@ if test "$PHP_PSPELL" != "no"; then
AC_MSG_ERROR(Cannot find pspell)
fi
- PSPELL_LIBDIR=$PSPELL_DIR/lib
+ PSPELL_LIBDIR=$PSPELL_DIR/$PHP_LIBDIR
PHP_ADD_LIBRARY_WITH_PATH(pspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD)
diff --git a/ext/pspell/php_pspell.h b/ext/pspell/php_pspell.h
index e2b3d24b3..47ed21591 100644
--- a/ext/pspell/php_pspell.h
+++ b/ext/pspell/php_pspell.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_pspell.h,v 1.14 2004/02/11 18:50:16 bfrance Exp $ */
+/* $Id: php_pspell.h,v 1.15 2005/08/03 14:07:42 sniper Exp $ */
#ifndef _PSPELL_H
#define _PSPELL_H
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c
index 7c8d26cb5..de7532958 100644
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: pspell.c,v 1.44 2004/05/18 12:32:05 edink Exp $ */
+/* $Id: pspell.c,v 1.45.2.2 2005/10/17 15:31:10 iliaa Exp $ */
#define IS_EXT_MODULE
@@ -101,6 +101,22 @@ static void php_pspell_close_config(zend_rsrc_list_entry *rsrc TSRMLS_DC)
delete_pspell_config(config);
}
+#define PSPELL_FETCH_CONFIG \
+ convert_to_long_ex(conf); \
+ config = (PspellConfig *) zend_list_find(Z_LVAL_PP(conf), &type); \
+ if (config == NULL || type != le_pspell_config) { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", Z_LVAL_PP(conf)); \
+ RETURN_FALSE; \
+ } \
+
+#define PSPELL_FETCH_MANAGER \
+ convert_to_long_ex(scin); \
+ manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type); \
+ if (!manager || type != le_pspell) { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", Z_LVAL_PP(scin)); \
+ RETURN_FALSE; \
+ } \
+
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(pspell)
@@ -352,13 +368,7 @@ PHP_FUNCTION(pspell_new_config)
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(conf);
- config = (PspellConfig *) zend_list_find(Z_LVAL_PP(conf), &type);
-
- if (config == NULL || type != le_pspell_config) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", Z_LVAL_PP(conf));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_CONFIG;
ret = new_pspell_manager(config);
@@ -387,13 +397,9 @@ PHP_FUNCTION(pspell_check)
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(scin);
convert_to_string_ex(word);
- manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
- if(!manager){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", Z_LVAL_PP(scin));
- RETURN_FALSE;
- }
+
+ PSPELL_FETCH_MANAGER;
if(pspell_manager_check(manager, Z_STRVAL_PP(word))){
RETURN_TRUE;
@@ -419,13 +425,8 @@ PHP_FUNCTION(pspell_suggest)
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(scin);
convert_to_string_ex(word);
- manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
- if(!manager){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", Z_LVAL_PP(scin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_MANAGER;
array_init(return_value);
@@ -457,14 +458,9 @@ PHP_FUNCTION(pspell_store_replacement)
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(scin);
convert_to_string_ex(miss);
convert_to_string_ex(corr);
- manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
- if(!manager){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", Z_LVAL_PP(scin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_MANAGER;
pspell_manager_store_replacement(manager, Z_STRVAL_PP(miss), Z_STRVAL_PP(corr));
if(pspell_manager_error_number(manager) == 0){
@@ -490,13 +486,8 @@ PHP_FUNCTION(pspell_add_to_personal)
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(scin);
convert_to_string_ex(word);
- manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
- if(!manager){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", Z_LVAL_PP(scin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_MANAGER;
/*If the word is empty, we have to return; otherwise we'll segfault! ouch!*/
if(Z_STRLEN_PP(word) == 0){
@@ -527,13 +518,8 @@ PHP_FUNCTION(pspell_add_to_session)
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(scin);
convert_to_string_ex(word);
- manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
- if(!manager){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", Z_LVAL_PP(scin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_MANAGER;
/*If the word is empty, we have to return; otherwise we'll segfault! ouch!*/
if(Z_STRLEN_PP(word) == 0){
@@ -564,12 +550,7 @@ PHP_FUNCTION(pspell_clear_session)
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(scin);
- manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
- if(!manager){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", Z_LVAL_PP(scin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_MANAGER;
pspell_manager_clear_session(manager);
if(pspell_manager_error_number(manager) == 0){
@@ -595,12 +576,7 @@ PHP_FUNCTION(pspell_save_wordlist)
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(scin);
- manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
- if(!manager){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", Z_LVAL_PP(scin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_MANAGER;
pspell_manager_save_all_word_lists(manager);
@@ -694,22 +670,17 @@ PHP_FUNCTION(pspell_config_create)
PHP_FUNCTION(pspell_config_runtogether)
{
int type;
- zval **sccin, **runtogether;
+ zval **conf, **runtogether;
int argc;
PspellConfig *config;
argc = ZEND_NUM_ARGS();
- if (argc != 2 || zend_get_parameters_ex(argc,&sccin,&runtogether) == FAILURE) {
+ if (argc != 2 || zend_get_parameters_ex(argc,&conf,&runtogether) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
- if(!config){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", Z_LVAL_PP(sccin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_CONFIG;
convert_to_boolean_ex(runtogether);
pspell_config_replace(config, "run-together", Z_LVAL_PP(runtogether) ? "true" : "false");
@@ -723,22 +694,17 @@ PHP_FUNCTION(pspell_config_runtogether)
PHP_FUNCTION(pspell_config_mode)
{
int type;
- zval **sccin, **mode;
+ zval **conf, **mode;
int argc;
PspellConfig *config;
argc = ZEND_NUM_ARGS();
- if (argc != 2 || zend_get_parameters_ex(argc,&sccin,&mode) == FAILURE) {
+ if (argc != 2 || zend_get_parameters_ex(argc,&conf,&mode) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
- if(!config){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", Z_LVAL_PP(sccin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_CONFIG;
convert_to_long_ex(mode);
@@ -760,7 +726,7 @@ PHP_FUNCTION(pspell_config_mode)
PHP_FUNCTION(pspell_config_ignore)
{
int type;
- zval **sccin, **pignore;
+ zval **conf, **pignore;
int argc;
int loc = PSPELL_LARGEST_WORD;
@@ -770,16 +736,11 @@ PHP_FUNCTION(pspell_config_ignore)
PspellConfig *config;
argc = ZEND_NUM_ARGS();
- if (argc != 2 || zend_get_parameters_ex(argc,&sccin,&pignore) == FAILURE) {
+ if (argc != 2 || zend_get_parameters_ex(argc,&conf,&pignore) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
- if(!config){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", Z_LVAL_PP(sccin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_CONFIG;
convert_to_long_ex(pignore);
ignore = Z_LVAL_PP(pignore);
@@ -808,21 +769,16 @@ PHP_FUNCTION(pspell_config_ignore)
static void pspell_config_path(INTERNAL_FUNCTION_PARAMETERS, char *option)
{
int type;
- zval **sccin, **value;
+ zval **conf, **value;
int argc;
PspellConfig *config;
argc = ZEND_NUM_ARGS();
- if (argc != 2 || zend_get_parameters_ex(argc, &sccin, &value) == FAILURE) {
+ if (argc != 2 || zend_get_parameters_ex(argc, &conf, &value) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
- if (!config) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", Z_LVAL_PP(sccin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_CONFIG;
convert_to_string_ex(value);
@@ -868,22 +824,17 @@ PHP_FUNCTION(pspell_config_data_dir)
PHP_FUNCTION(pspell_config_repl)
{
int type;
- zval **sccin, **repl;
+ zval **conf, **repl;
int argc;
PspellConfig *config;
argc = ZEND_NUM_ARGS();
- if (argc != 2 || zend_get_parameters_ex(argc,&sccin,&repl) == FAILURE) {
+ if (argc != 2 || zend_get_parameters_ex(argc,&conf,&repl) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
- if(!config){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", Z_LVAL_PP(sccin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_CONFIG;
pspell_config_replace(config, "save-repl", "true");
@@ -908,22 +859,17 @@ PHP_FUNCTION(pspell_config_repl)
PHP_FUNCTION(pspell_config_save_repl)
{
int type;
- zval **sccin, **save;
+ zval **conf, **save;
int argc;
PspellConfig *config;
argc = ZEND_NUM_ARGS();
- if (argc != 2 || zend_get_parameters_ex(argc,&sccin,&save) == FAILURE) {
+ if (argc != 2 || zend_get_parameters_ex(argc,&conf,&save) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
- if(!config){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", Z_LVAL_PP(sccin));
- RETURN_FALSE;
- }
+ PSPELL_FETCH_CONFIG;
convert_to_boolean_ex(save);
pspell_config_replace(config, "save-repl", Z_LVAL_PP(save) ? "true" : "false");
diff --git a/ext/pspell/tests/01pspell_basic.phpt b/ext/pspell/tests/01pspell_basic.phpt
index 2316708ce..1c996a6da 100644
--- a/ext/pspell/tests/01pspell_basic.phpt
+++ b/ext/pspell/tests/01pspell_basic.phpt
@@ -8,7 +8,7 @@ pspell basic tests (warning: may fail with pspell/aspell < GNU Aspell 0.50.3)
}
?>
--FILE--
-<?php // $Id: 01pspell_basic.phpt,v 1.5.2.1 2004/12/16 12:35:42 sniper Exp $
+<?php // $Id: 01pspell_basic.phpt,v 1.7 2005/07/25 18:27:41 helly Exp $
error_reporting(E_ALL);
$string = "";
@@ -29,17 +29,13 @@ for($i=0,$u=count($array);$i<$u;++$i) {
echo $array[$i].' : ';
if (!pspell_check($pspell, $array[$i])) {
echo "..false\n";
- $suggestions = pspell_suggest ($pspell, $array[$i]);
-
- foreach ($suggestions as $suggestion) {
- echo "Possible spelling: $suggestion\n";
- }
+ echo "Possible spellings: " . join(',',pspell_suggest ($pspell, $array[$i])) . "\n";
} else {
echo "true\n";
}
}
?>
---EXPECT--
+--EXPECTF--
I : true
will : true
not : true
@@ -90,23 +86,7 @@ a : true
pack : true
Ya : true
Seegarets : ..false
-Possible spelling: Secrets
-Possible spelling: Regrets
-Possible spelling: Secretes
-Possible spelling: Egrets
-Possible spelling: Segre's
-Possible spelling: Seagate's
-Possible spelling: Regreets
-Possible spelling: Segregates
-Possible spelling: Sergeants
-Possible spelling: Sugariest
-Possible spelling: Garrets
-Possible spelling: Socrates
-Possible spelling: Egret's
-Possible spelling: Separates
-Possible spelling: Cigarettes
-Possible spelling: Sugared
-Possible spelling: Scarlets
+Possible spellings:%s,Regrets,%s,Cigarettes,%s
Ya : true
Uh : true
My : true
@@ -132,9 +112,5 @@ strike : true
a : true
match : true
Ahh : ..false
-Possible spelling: Shh
-Possible spelling: Ah
-Possible spelling: Aha
-Possible spelling: Ash
-Possible spelling: Ha
+Possible spellings:%sAh,Aha,%s
matches : true
diff --git a/ext/readline/config.m4 b/ext/readline/config.m4
index 9822f9bad..6f6151df3 100644
--- a/ext/readline/config.m4
+++ b/ext/readline/config.m4
@@ -1,12 +1,14 @@
dnl
-dnl $Id: config.m4,v 1.20 2003/10/01 02:53:13 sniper Exp $
+dnl $Id: config.m4,v 1.25.2.1 2005/11/18 15:07:39 sniper Exp $
dnl
PHP_ARG_WITH(libedit,for libedit readline replacement,
-[ --with-libedit[=DIR] Include libedit readline replacement (CLI/CGI only).])
+[ --with-libedit[=DIR] Include libedit readline replacement (CLI/CGI only)])
-PHP_ARG_WITH(readline,for readline support,
-[ --with-readline[=DIR] Include readline support (CLI/CGI only).])
+if test "$PHP_LIBEDIT" = "no"; then
+ PHP_ARG_WITH(readline,for readline support,
+ [ --with-readline[=DIR] Include readline support (CLI/CGI only)])
+fi
if test "$PHP_READLINE" != "no"; then
for i in $PHP_READLINE /usr/local /usr; do
@@ -19,32 +21,42 @@ if test "$PHP_READLINE" != "no"; then
PHP_ADD_INCLUDE($READLINE_DIR/include)
+ PHP_READLINE_LIBS=""
AC_CHECK_LIB(ncurses, tgetent,
[
PHP_ADD_LIBRARY(ncurses,,READLINE_SHARED_LIBADD)
+ PHP_READLINE_LIBS="$PHP_READLINE_LIBS -lncurses"
],[
AC_CHECK_LIB(termcap, tgetent,
[
PHP_ADD_LIBRARY(termcap,,READLINE_SHARED_LIBADD)
+ PHP_READLINE_LIBS="$PHP_READLINE_LIBS -ltermcap"
])
])
PHP_CHECK_LIBRARY(readline, readline,
[
- PHP_ADD_LIBRARY_WITH_PATH(readline, $READLINE_DIR/lib, READLINE_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(readline, $READLINE_DIR/$PHP_LIBDIR, READLINE_SHARED_LIBADD)
], [
AC_MSG_ERROR(readline library not found)
], [
- -L$READLINE_DIR/lib
+ -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
+ ])
+
+ PHP_CHECK_LIBRARY(readline, rl_callback_read_char,
+ [
+ AC_DEFINE(HAVE_RL_CALLBACK_READ_CHAR, 1, [ ])
+ ],[],[
+ -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
])
PHP_CHECK_LIBRARY(history, add_history,
[
- PHP_ADD_LIBRARY_WITH_PATH(history, $READLINE_DIR/lib, READLINE_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(history, $READLINE_DIR/$PHP_LIBDIR, READLINE_SHARED_LIBADD)
], [
AC_MSG_ERROR(history library required by readline not found)
], [
- -L$READLINE_DIR/lib
+ -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
])
PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)
@@ -75,11 +87,11 @@ elif test "$PHP_LIBEDIT" != "no"; then
PHP_CHECK_LIBRARY(edit, readline,
[
- PHP_ADD_LIBRARY_WITH_PATH(edit, $LIBEDIT_DIR/lib, READLINE_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(edit, $LIBEDIT_DIR/$PHP_LIBDIR, READLINE_SHARED_LIBADD)
], [
AC_MSG_ERROR(edit library required by readline not found)
], [
- -L$READLINE_DIR/lib
+ -L$READLINE_DIR/$PHP_LIBDIR
])
PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)
diff --git a/ext/readline/php_readline.h b/ext/readline/php_readline.h
index e24a5eaf7..4c8da11ed 100644
--- a/ext/readline/php_readline.h
+++ b/ext/readline/php_readline.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_readline.h,v 1.16 2004/01/08 17:32:42 sniper Exp $ */
+/* $Id: php_readline.h,v 1.17 2005/08/03 14:07:42 sniper Exp $ */
#ifndef PHP_READLINE_H
#define PHP_READLINE_H
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 0ecc91311..cfe382c31 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: readline.c,v 1.35.2.3 2005/04/12 16:42:20 iliaa Exp $ */
+/* $Id: readline.c,v 1.42 2005/08/03 14:07:42 sniper Exp $ */
/* {{{ includes & prototypes */
@@ -45,7 +45,18 @@ PHP_FUNCTION(readline_read_history);
PHP_FUNCTION(readline_write_history);
PHP_FUNCTION(readline_completion_function);
-static char *_readline_completion = NULL;
+#if HAVE_RL_CALLBACK_READ_CHAR
+PHP_FUNCTION(readline_callback_handler_install);
+PHP_FUNCTION(readline_callback_read_char);
+PHP_FUNCTION(readline_callback_handler_remove);
+PHP_FUNCTION(readline_redisplay);
+PHP_FUNCTION(readline_on_new_line);
+
+static zval *_prepped_callback = NULL;
+
+#endif
+
+static zval *_readline_completion = NULL;
static zval _readline_array;
PHP_MINIT_FUNCTION(readline);
@@ -65,6 +76,13 @@ static zend_function_entry php_readline_functions[] = {
PHP_FE(readline_read_history, NULL)
PHP_FE(readline_write_history, NULL)
PHP_FE(readline_completion_function,NULL)
+#if HAVE_RL_CALLBACK_READ_CHAR
+ PHP_FE(readline_callback_handler_install, NULL)
+ PHP_FE(readline_callback_read_char, NULL)
+ PHP_FE(readline_callback_handler_remove, NULL)
+ PHP_FE(readline_redisplay, NULL)
+ PHP_FE(readline_on_new_line, NULL)
+#endif
{NULL, NULL, NULL}
};
@@ -94,29 +112,33 @@ PHP_MINIT_FUNCTION(readline)
PHP_RSHUTDOWN_FUNCTION(readline)
{
if (_readline_completion)
- efree(_readline_completion);
+ FREE_ZVAL(_readline_completion);
+#if HAVE_RL_CALLBACK_READ_CHAR
+ if (_prepped_callback) {
+ rl_callback_handler_remove();
+ FREE_ZVAL(_prepped_callback);
+ _prepped_callback = 0;
+ }
+#endif
return SUCCESS;
}
/* }}} */
+
/* {{{ proto string readline([string prompt])
Reads a line */
PHP_FUNCTION(readline)
{
+ char *prompt = NULL;
+ int prompt_len;
char *result;
- pval **arg;
- int ac = ZEND_NUM_ARGS();
- if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- if (ac == 1) {
- convert_to_string_ex(arg);
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &prompt, &prompt_len)) {
+ RETURN_FALSE;
}
- result = readline(ac?Z_STRVAL_PP(arg):NULL);
+ result = readline(prompt);
if (! result) {
RETURN_FALSE;
@@ -127,10 +149,11 @@ PHP_FUNCTION(readline)
}
/* }}} */
+
/* {{{ proto mixed readline_info([string varname] [, string newvalue])
Gets/sets various internal readline variables. */
-#define SAFE_STRING(s) ((s)?(s):"")
+#define SAFE_STRING(s) ((s)?(char*)(s):"")
PHP_FUNCTION(readline_info)
{
@@ -210,7 +233,7 @@ PHP_FUNCTION(readline_info)
} else if (! strcasecmp(Z_STRVAL_PP(what),"library_version")) {
RETVAL_STRING((char *)SAFE_STRING(rl_library_version),1);
} else if (! strcasecmp(Z_STRVAL_PP(what),"readline_name")) {
- oldstr = (char *)rl_readline_name;
+ oldstr = (char*)rl_readline_name;
if (ac == 2) {
/* XXX if (rl_readline_name) free(rl_readline_name); */
convert_to_string_ex(value);
@@ -360,12 +383,17 @@ static char *_readline_command_generator(char *text,int state)
static zval *_readline_string_zval(const char *str)
{
zval *ret;
- int len = strlen(str);
+ int len;
+
MAKE_STD_ZVAL(ret);
+
+ if (str) {
+ len = strlen(str);
+ ZVAL_STRINGL(ret, (char*)str, len, 1);
+ } else {
+ ZVAL_NULL(ret);
+ }
- Z_TYPE_P(ret) = IS_STRING;
- Z_STRLEN_P(ret) = len;
- Z_STRVAL_P(ret) = estrndup(str, len);
return ret;
}
@@ -379,19 +407,18 @@ static zval *_readline_long_zval(long l)
return ret;
}
-static char **_readline_completion_cb(char *text, int start, int end)
+static char **_readline_completion_cb(const char *text, int start, int end)
{
- zval *params[4];
+ zval *params[3];
int i;
char **matches = NULL;
TSRMLS_FETCH();
- params[0]=_readline_string_zval(_readline_completion);
- params[1]=_readline_string_zval(text);
- params[2]=_readline_long_zval(start);
- params[3]=_readline_long_zval(end);
+ params[0]=_readline_string_zval(text);
+ params[1]=_readline_long_zval(start);
+ params[2]=_readline_long_zval(end);
- if (call_user_function(CG(function_table), NULL, params[0], &_readline_array, 3, params+1 TSRMLS_CC) == SUCCESS) {
+ if (call_user_function(CG(function_table), NULL, _readline_completion, &_readline_array, 3, params TSRMLS_CC) == SUCCESS) {
if (Z_TYPE(_readline_array) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL(_readline_array))) {
matches = completion_matches(text,_readline_command_generator);
@@ -403,7 +430,7 @@ static char **_readline_completion_cb(char *text, int start, int end)
}
}
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 3; i++) {
zval_ptr_dtor(&params[i]);
}
zval_dtor(&_readline_array);
@@ -413,28 +440,126 @@ static char **_readline_completion_cb(char *text, int start, int end)
PHP_FUNCTION(readline_completion_function)
{
- pval **arg;
- int ac = ZEND_NUM_ARGS();
+ zval *arg = NULL;
+ char *name = NULL;
- if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg)) {
+ RETURN_FALSE;
}
- if (ac == 1) {
- convert_to_string_ex(arg);
+ if (!zend_is_callable(arg, 0, &name)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not callable", name);
+ RETURN_FALSE;
+ }
+
+ if (_readline_completion)
+ FREE_ZVAL(_readline_completion);
+
+ MAKE_STD_ZVAL(_readline_completion);
+ *_readline_completion = *arg;
+ zval_copy_ctor(_readline_completion);
+
+ rl_attempted_completion_function = _readline_completion_cb;
+
+ RETURN_TRUE;
+}
+
+/* }}} */
- if (_readline_completion)
- efree(_readline_completion);
+#if HAVE_RL_CALLBACK_READ_CHAR
- _readline_completion = estrdup(Z_STRVAL_PP(arg));
- rl_attempted_completion_function = _readline_completion_cb;
+static void php_rl_callback_handler(char *the_line)
+{
+ zval *params[1];
+ zval dummy;
+ TSRMLS_FETCH();
+
+ ZVAL_NULL(&dummy);
+
+ params[0] = _readline_string_zval(the_line);
+
+ call_user_function(CG(function_table), NULL, _prepped_callback, &dummy, 1, params TSRMLS_CC);
+
+ zval_ptr_dtor(&params[0]);
+ zval_dtor(&dummy);
+}
+
+/* {{{ proto void readline_callback_handler_install(string prompt, mixed callback)
+ Initializes the readline callback interface and terminal, prints the prompt and returns immediately */
+PHP_FUNCTION(readline_callback_handler_install)
+{
+ zval *callback;
+ char *name = NULL;
+ char *prompt;
+ int prompt_len;
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &prompt, &prompt_len, &callback)) {
+ return;
}
+ if (!zend_is_callable(callback, 0, &name)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not callable", name);
+ RETURN_FALSE;
+ }
+
+ if (_prepped_callback) {
+ rl_callback_handler_remove();
+ FREE_ZVAL(_prepped_callback);
+ }
+
+ MAKE_STD_ZVAL(_prepped_callback);
+ *_prepped_callback = *callback;
+ zval_copy_ctor(_prepped_callback);
+
+ rl_callback_handler_install(prompt, php_rl_callback_handler);
+
RETURN_TRUE;
}
+/* }}} */
+
+/* {{{ proto void readline_callback_read_char()
+ Informs the readline callback interface that a character is ready for input */
+PHP_FUNCTION(readline_callback_read_char)
+{
+ if (_prepped_callback) {
+ rl_callback_read_char();
+ }
+}
+/* }}} */
+/* {{{ proto bool readline_callback_handler_remove()
+ Removes a previously installed callback handler and restores terminal settings */
+PHP_FUNCTION(readline_callback_handler_remove)
+{
+ if (_prepped_callback) {
+ rl_callback_handler_remove();
+ FREE_ZVAL(_prepped_callback);
+ _prepped_callback = 0;
+ RETURN_TRUE;
+ }
+ RETURN_FALSE;
+}
/* }}} */
+/* {{{ proto void readline_redisplay(void)
+ Ask readline to redraw the display */
+PHP_FUNCTION(readline_redisplay)
+{
+ rl_redisplay();
+}
+/* }}} */
+
+/* {{{ proto void readline_on_new_line(void)
+ Inform readline that the cursor has moved to a new line */
+PHP_FUNCTION(readline_on_new_line)
+{
+ rl_on_new_line();
+}
+/* }}} */
+
+#endif
+
+
#endif /* HAVE_LIBREADLINE */
/*
diff --git a/ext/recode/config.m4 b/ext/recode/config.m4
index 476bd7d3f..f4ef31513 100644
--- a/ext/recode/config.m4
+++ b/ext/recode/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.11 2003/10/01 02:53:14 sniper Exp $
+dnl $Id: config.m4,v 1.13 2005/05/29 23:16:44 sniper Exp $
dnl
PHP_ARG_WITH(recode,for recode support,
-[ --with-recode[=DIR] Include recode support.])
+[ --with-recode[=DIR] Include recode support])
if test "$PHP_RECODE" != "no"; then
RECODE_LIST="$PHP_RECODE /usr/local /usr /opt"
@@ -12,17 +12,17 @@ if test "$PHP_RECODE" != "no"; then
if test -f $i/include/recode.h; then
RECODE_DIR=$i
RECODE_INC=include
- RECODE_LIB=lib
+ RECODE_LIB=$PHP_LIBDIR
fi
if test -f $i/include/recode/recode.h; then
RECODE_DIR=$i
RECODE_INC=include/recode
- RECODE_LIB=lib/recode
+ RECODE_LIB=$PHP_LIBDIR/recode
fi
if test -f $i/recode/include/recode.h; then
RECODE_DIR=$i/recode
RECODE_INC=include
- RECODE_LIB=lib
+ RECODE_LIB=$PHP_LIBDIR
fi
test -n "$RECODE_DIR" && break
done
diff --git a/ext/recode/config9.m4 b/ext/recode/config9.m4
index b7bb5e266..1595f4fb6 100644
--- a/ext/recode/config9.m4
+++ b/ext/recode/config9.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config9.m4,v 1.1.2.1 2004/12/21 02:53:34 sniper Exp $
+dnl $Id: config9.m4,v 1.2 2004/11/09 16:11:13 jorton Exp $
dnl
dnl Check for extensions with which Recode can not work
diff --git a/ext/recode/php_recode.h b/ext/recode/php_recode.h
index 1302e8d7a..37bcedef1 100644
--- a/ext/recode/php_recode.h
+++ b/ext/recode/php_recode.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_recode.h,v 1.16 2004/01/08 17:32:43 sniper Exp $ */
+/* $Id: php_recode.h,v 1.17 2005/08/03 14:07:43 sniper Exp $ */
#ifndef PHP_RECODE_H
#define PHP_RECODE_H
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index e790768d7..bbdb8e9f2 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: recode.c,v 1.35 2004/01/08 08:17:22 andi Exp $ */
+/* $Id: recode.c,v 1.37 2005/08/03 14:07:43 sniper Exp $ */
/* {{{ includes & prototypes */
@@ -119,7 +119,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.35 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.37 $");
php_info_print_table_end();
}
@@ -129,7 +129,6 @@ PHP_FUNCTION(recode_string)
{
RECODE_REQUEST request = NULL;
char *r = NULL;
- bool success;
int r_len = 0, r_alen = 0;
int req_len, str_len;
char *req, *str;
@@ -144,9 +143,8 @@ PHP_FUNCTION(recode_string)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure");
RETURN_FALSE;
}
-
- success = recode_scan_request(request, req);
- if (!success) {
+
+ if (!recode_scan_request(request, req)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", req);
goto error_exit;
}
@@ -154,19 +152,14 @@ PHP_FUNCTION(recode_string)
recode_buffer_to_buffer(request, str, str_len, &r, &r_len, &r_alen);
if (!r) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed.");
- goto error_exit;
- }
-
- RETVAL_STRINGL(r, r_len, 1);
- free(r);
- /* FALLTHROUGH */
-
error_exit:
- if (request)
- recode_delete_request(request);
+ RETVAL_FALSE;
+ } else {
+ RETVAL_STRINGL(r, r_len, 1);
+ free(r);
+ }
- if (!r)
- RETURN_FALSE;
+ recode_delete_request(request);
return;
}
@@ -177,7 +170,6 @@ error_exit:
PHP_FUNCTION(recode_file)
{
RECODE_REQUEST request = NULL;
- int success;
zval **req;
zval **input, **output;
php_stream *instream, *outstream;
@@ -206,26 +198,21 @@ PHP_FUNCTION(recode_file)
RETURN_FALSE;
}
- success = recode_scan_request(request, Z_STRVAL_PP(req));
- if (!success) {
+ if (!recode_scan_request(request, Z_STRVAL_PP(req))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", Z_STRVAL_PP(req));
goto error_exit;
}
- success = recode_file_to_file(request, in_fp, out_fp);
- if (!success) {
+ if (!recode_file_to_file(request, in_fp, out_fp)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed.");
goto error_exit;
}
- if (request)
- recode_delete_request(request);
+ recode_delete_request(request);
RETURN_TRUE;
error_exit:
- if (request)
- recode_delete_request(request);
-
+ recode_delete_request(request);
RETURN_FALSE;
}
/* }}} */
diff --git a/ext/session/config.m4 b/ext/session/config.m4
index 9de551404..7286a6b77 100644
--- a/ext/session/config.m4
+++ b/ext/session/config.m4
@@ -1,18 +1,19 @@
dnl
-dnl $Id: config.m4,v 1.25 2003/10/01 02:53:15 sniper Exp $
+dnl $Id: config.m4,v 1.28 2005/05/29 23:16:44 sniper Exp $
dnl
PHP_ARG_ENABLE(session, whether to enable PHP sessions,
[ --disable-session Disable session support], yes)
PHP_ARG_WITH(mm,for mm support,
-[ --with-mm[=DIR] Include mm support for session storage], no, no)
+[ --with-mm[=DIR] SESSION: Include mm support for session storage], no, no)
if test "$PHP_SESSION" != "no"; then
PHP_PWRITE_TEST
PHP_PREAD_TEST
PHP_NEW_EXTENSION(session, session.c mod_files.c mod_mm.c mod_user.c, $ext_shared)
PHP_SUBST(SESSION_SHARED_LIBADD)
+ PHP_INSTALL_HEADERS(ext/session, [php_session.h mod_files.h mod_user.h])
AC_DEFINE(HAVE_PHP_SESSION,1,[ ])
fi
@@ -25,7 +26,8 @@ if test "$PHP_MM" != "no"; then
AC_MSG_ERROR(cannot find mm library)
fi
- PHP_ADD_LIBRARY_WITH_PATH(mm, $MM_DIR/lib, SESSION_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(mm, $MM_DIR/$PHP_LIBDIR, SESSION_SHARED_LIBADD)
PHP_ADD_INCLUDE($MM_DIR/include)
+ PHP_INSTALL_HEADERS([ext/session/mod_mm.h])
AC_DEFINE(HAVE_LIBMM, 1, [Whether you have libmm])
fi
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index d33e53a12..3131a7219 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: mod_files.c,v 1.95.2.4 2005/03/10 11:41:00 hyanantha Exp $ */
+/* $Id: mod_files.c,v 1.100.2.1 2005/08/18 13:34:40 sniper Exp $ */
#include "php.h"
@@ -193,7 +193,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
dir = opendir(dirname);
if (!dir) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)\n", dirname, strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, strerror(errno), errno);
return (0);
}
@@ -327,6 +327,12 @@ PS_READ_FUNC(files)
return FAILURE;
data->st_size = *vallen = sbuf.st_size;
+
+ if (sbuf.st_size == 0) {
+ *val = STR_EMPTY_ALLOC();
+ return SUCCESS;
+ }
+
*val = emalloc(sbuf.st_size);
#if defined(HAVE_PREAD)
diff --git a/ext/session/mod_files.h b/ext/session/mod_files.h
index 2c49321b5..27aadb498 100644
--- a/ext/session/mod_files.h
+++ b/ext/session/mod_files.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: mod_files.h,v 1.9.2.1 2005/02/13 17:54:31 sniper Exp $ */
+/* $Id: mod_files.h,v 1.11 2005/08/03 14:07:43 sniper Exp $ */
#ifndef MOD_FILES_H
#define MOD_FILES_H
diff --git a/ext/session/mod_files.sh b/ext/session/mod_files.sh
index 4d6a681d9..6d9d5d949 100644
--- a/ext/session/mod_files.sh
+++ b/ext/session/mod_files.sh
@@ -9,8 +9,16 @@ if test "$2" = "0"; then
exit 0
fi
-for i in a b c d e f 0 1 2 3 4 5 6 7 8 9; do
+hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f"
+if test "$3" -a "$3" -ge "5"; then
+ hash_chars="$hash_chars g h i j k l m n o p q r s t u v"
+ if test "$3" -eq "6"; then
+ hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ,"
+ fi
+fi
+
+for i in $hash_chars; do
newpath="$1/$i"
mkdir $newpath || exit 1
- sh $0 $newpath `expr $2 - 1`
+ sh $0 $newpath `expr $2 - 1 $3`
done
diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c
index 996e57d91..9bdebf60d 100644
--- a/ext/session/mod_mm.c
+++ b/ext/session/mod_mm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: mod_mm.c,v 1.45 2004/06/30 01:12:06 iliaa Exp $ */
+/* $Id: mod_mm.c,v 1.46 2005/08/03 14:07:43 sniper Exp $ */
#include "php.h"
diff --git a/ext/session/mod_mm.h b/ext/session/mod_mm.h
index 5a21f0f11..7c4755a48 100644
--- a/ext/session/mod_mm.h
+++ b/ext/session/mod_mm.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: mod_mm.h,v 1.10.2.1 2005/02/13 17:54:31 sniper Exp $ */
+/* $Id: mod_mm.h,v 1.12 2005/08/03 14:07:43 sniper Exp $ */
#ifndef MOD_MM_H
#define MOD_MM_H
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index b428e7431..243f6c963 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: mod_user.c,v 1.28 2004/01/08 08:17:23 andi Exp $ */
+/* $Id: mod_user.c,v 1.29 2005/08/03 14:07:43 sniper Exp $ */
#include "php.h"
#include "php_session.h"
diff --git a/ext/session/mod_user.h b/ext/session/mod_user.h
index 8711da16f..87eb8b7bb 100644
--- a/ext/session/mod_user.h
+++ b/ext/session/mod_user.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: mod_user.h,v 1.12.2.1 2005/02/13 17:54:31 sniper Exp $ */
+/* $Id: mod_user.h,v 1.14 2005/08/03 14:07:44 sniper Exp $ */
#ifndef MOD_USER_H
#define MOD_USER_H
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 50c73f237..2f48d2a75 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_session.h,v 1.98.2.1 2005/02/13 17:54:31 sniper Exp $ */
+/* $Id: php_session.h,v 1.101 2005/08/03 14:07:44 sniper Exp $ */
#ifndef PHP_SESSION_H
#define PHP_SESSION_H
@@ -216,8 +216,7 @@ PHPAPI void php_session_start(TSRMLS_D);
ulong num_key; \
zval **struc;
-#define PS_ENCODE_LOOP(code) \
- { \
+#define PS_ENCODE_LOOP(code) do { \
HashTable *_ht = Z_ARRVAL_P(PS(http_session_vars)); \
\
for (zend_hash_internal_pointer_reset(_ht); \
@@ -228,7 +227,7 @@ PHPAPI void php_session_start(TSRMLS_D);
code; \
} \
} \
- }
+ } while(0)
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(ps)
diff --git a/ext/session/session.c b/ext/session/session.c
index 37e56fd36..1a695298c 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session.c,v 1.391.2.14 2005/05/22 12:57:45 tony2001 Exp $ */
+/* $Id: session.c,v 1.417.2.3 2005/09/23 08:14:13 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -131,9 +131,10 @@ static PHP_INI_MH(OnUpdateSerializer)
return SUCCESS;
}
-static PHP_INI_MH(OnUpdateSaveDir) {
+static PHP_INI_MH(OnUpdateSaveDir)
+{
/* Only do the safemode/open_basedir check at runtime */
- if(stage == PHP_INI_STAGE_RUNTIME) {
+ if (stage == PHP_INI_STAGE_RUNTIME) {
if (PG(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_ALLOW_ONLY_DIR))) {
return FAILURE;
}
@@ -440,7 +441,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, endptr, &var_hash TSRMLS_CC)) {
php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC);
}
zval_ptr_dtor(&current);
@@ -520,7 +521,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, endptr, &var_hash TSRMLS_CC)) {
php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC);
}
zval_ptr_dtor(&current);
@@ -542,14 +543,13 @@ static void php_session_track_init(TSRMLS_D)
zval *session_vars = NULL;
/* Unconditionally destroy existing arrays -- possible dirty data */
- zend_hash_del(&EG(symbol_table), "HTTP_SESSION_VARS",
- sizeof("HTTP_SESSION_VARS"));
- zend_hash_del(&EG(symbol_table), "_SESSION", sizeof("_SESSION"));
+ zend_delete_global_variable("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS")-1 TSRMLS_CC);
+ zend_delete_global_variable("_SESSION", sizeof("_SESSION")-1 TSRMLS_CC);
MAKE_STD_ZVAL(session_vars);
array_init(session_vars);
PS(http_session_vars) = session_vars;
-
+
if (PG(register_long_arrays)) {
ZEND_SET_GLOBAL_VAR_WITH_LENGTH("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), PS(http_session_vars), 2, 1);
ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 2, 1);
@@ -1098,7 +1098,7 @@ static void php_session_reset_id(TSRMLS_D)
smart_str_0(&var);
REGISTER_STRINGL_CONSTANT("SID", var.c, var.len, 0);
} else {
- REGISTER_STRINGL_CONSTANT("SID", empty_string, 0, 0);
+ REGISTER_STRINGL_CONSTANT("SID", STR_EMPTY_ALLOC(), 0, 0);
}
if (PS(apply_trans_sid)) {
@@ -1120,13 +1120,13 @@ PHPAPI void php_session_start(TSRMLS_D)
PS(define_sid) = 1;
PS(send_cookie) = 1;
if (PS(session_status) != php_session_none) {
-
+
if (PS(session_status) == php_session_disabled) {
char *value;
value = zend_ini_string("session.save_handler", sizeof("session.save_handler"), 0);
-
- if (value) {
+
+ if (value) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find save handler %s", value);
}
else {
@@ -1134,7 +1134,7 @@ PHPAPI void php_session_start(TSRMLS_D)
}
return;
}
-
+
php_error(E_NOTICE, "A session had already been started - ignoring session_start()");
return;
}
@@ -1342,9 +1342,17 @@ PHP_FUNCTION(session_module_name)
zval **p_name;
int ac = ZEND_NUM_ARGS();
- if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
+ if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) {
WRONG_PARAM_COUNT;
+ }
+ /* Set return_value to current module name */
+ if (PS(mod) && PS(mod)->s_name) {
+ RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0);
+ } else {
+ RETVAL_EMPTY_STRING();
+ }
+
if (ac == 1) {
convert_to_string_ex(p_name);
if (!_php_find_ps_module(Z_STRVAL_PP(p_name) TSRMLS_CC)) {
@@ -1357,19 +1365,7 @@ PHP_FUNCTION(session_module_name)
}
PS(mod_data) = NULL;
- if (PS(mod) && PS(mod)->s_name) {
- RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0);
- } else {
- RETVAL_EMPTY_STRING();
- }
-
zend_alter_ini_entry("session.save_handler", sizeof("session.save_handler"), Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
- } else {
- if (PS(mod) && PS(mod)->s_name) {
- RETURN_STRING(safe_estrdup(PS(mod)->s_name), 0);
- } else {
- RETURN_EMPTY_STRING();
- }
}
}
/* }}} */
@@ -1388,7 +1384,7 @@ PHP_FUNCTION(session_set_save_handler)
if (PS(session_status) != php_session_none)
RETURN_FALSE;
-
+
for (i = 0; i < 6; i++) {
if (!zend_is_callable(*args[i], 0, &name)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument %d is not a valid callback", i+1);
@@ -1441,13 +1437,16 @@ PHP_FUNCTION(session_id)
{
zval **p_name;
int ac = ZEND_NUM_ARGS();
- char *old = empty_string;
+ char *old;
if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
WRONG_PARAM_COUNT;
- if (PS(id))
+ if (PS(id)) {
old = estrdup(PS(id));
+ } else {
+ old = STR_EMPTY_ALLOC();
+ }
if (ac == 1) {
convert_to_string_ex(p_name);
@@ -1459,12 +1458,24 @@ PHP_FUNCTION(session_id)
}
/* }}} */
-/* {{{ proto bool session_regenerate_id()
- Update the current session id with a newly generated one. */
+/* {{{ proto bool session_regenerate_id([bool delete_old_session])
+ Update the current session id with a newly generated one. If delete_old_session is set to true, remove the old session. */
PHP_FUNCTION(session_regenerate_id)
{
+ zend_bool del_ses = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &del_ses) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
if (PS(session_status) == php_session_active) {
- if (PS(id)) efree(PS(id));
+ if (PS(id)) {
+ if (del_ses && PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed");
+ RETURN_FALSE;
+ }
+ efree(PS(id));
+ }
PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
@@ -1564,12 +1575,12 @@ PHP_FUNCTION(session_register)
if (PS(session_status) == php_session_none || PS(session_status) == php_session_disabled) {
php_session_start(TSRMLS_C);
}
-
+
if (PS(session_status) == php_session_disabled) {
efree(args);
RETURN_FALSE;
}
-
+
for (i = 0; i < argc; i++) {
if (Z_TYPE_PP(args[i]) == IS_ARRAY)
SEPARATE_ZVAL(args[i]);
@@ -1716,7 +1727,7 @@ PHP_FUNCTION(session_unset)
while (zend_hash_get_current_key_ex(ht, &str, &str_len, &num_key,
0, &pos) == HASH_KEY_IS_STRING) {
- zend_hash_del(&EG(symbol_table), str, str_len);
+ zend_delete_global_variable(str, str_len-1 TSRMLS_CC);
zend_hash_move_forward_ex(ht, &pos);
}
}
@@ -1745,7 +1756,9 @@ static void php_rinit_session_globals(TSRMLS_D)
static void php_rshutdown_session_globals(TSRMLS_D)
{
if (PS(mod_data)) {
- PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ zend_try {
+ PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ } zend_end_try();
}
if (PS(id)) {
efree(PS(id));
@@ -1781,9 +1794,11 @@ PHP_RINIT_FUNCTION(session)
static void php_session_flush(TSRMLS_D)
{
- if(PS(session_status)==php_session_active) {
- php_session_save_current_state(TSRMLS_C);
- PS(session_status)=php_session_none;
+ if (PS(session_status) == php_session_active) {
+ PS(session_status) = php_session_none;
+ zend_try {
+ php_session_save_current_state(TSRMLS_C);
+ } zend_end_try();
}
}
@@ -1798,6 +1813,7 @@ PHP_RSHUTDOWN_FUNCTION(session)
{
php_session_flush(TSRMLS_C);
php_rshutdown_session_globals(TSRMLS_C);
+
return SUCCESS;
}
/* }}} */
@@ -1846,7 +1862,7 @@ PHP_MSHUTDOWN_FUNCTION(session)
#endif
ps_serializers[PREDEFINED_SERIALIZERS].name = NULL;
- ps_modules[PREDEFINED_MODULES] = NULL;
+ memset(&ps_modules[PREDEFINED_MODULES], 0, (MAX_MODULES-PREDEFINED_MODULES)*sizeof(ps_module *));
return SUCCESS;
}
diff --git a/ext/session/tests/001.phpt b/ext/session/tests/001.phpt
index 75d5df163..934987f1c 100644
--- a/ext/session/tests/001.phpt
+++ b/ext/session/tests/001.phpt
@@ -7,6 +7,7 @@ session.use_cookies=0
session.cache_limiter=
register_globals=1
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/003.phpt b/ext/session/tests/003.phpt
index fed90902c..9972358e1 100644
--- a/ext/session/tests/003.phpt
+++ b/ext/session/tests/003.phpt
@@ -7,6 +7,7 @@ session.use_cookies=0
session.cache_limiter=
register_globals=1
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt
index fb355976f..40385bbe1 100644
--- a/ext/session/tests/006.phpt
+++ b/ext/session/tests/006.phpt
@@ -7,6 +7,7 @@ session.use_cookies=0
session.cache_limiter=
register_globals=1
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
@@ -67,4 +68,4 @@ object(b)#%d (1) {
["test"]=>
string(5) "hallo"
}
-} \ No newline at end of file
+}
diff --git a/ext/session/tests/007.phpt b/ext/session/tests/007.phpt
index a37b1db8f..7ed74ea47 100644
--- a/ext/session/tests/007.phpt
+++ b/ext/session/tests/007.phpt
@@ -3,12 +3,13 @@ bug compatibility: unset($c) with enabled register_globals
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
+register_long_arrays=1
session.use_cookies=0
session.cache_limiter=
register_globals=1
session.bug_compat_42=1
session.serialize_handler=php
-register_long_arrays=1
+session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/008-php4.2.3.phpt b/ext/session/tests/008-php4.2.3.phpt
index c1cc0c4c2..0057f2be4 100644
--- a/ext/session/tests/008-php4.2.3.phpt
+++ b/ext/session/tests/008-php4.2.3.phpt
@@ -5,6 +5,7 @@ bug compatibility: global is used albeit register_globals=0
if (version_compare(PHP_VERSION,"4.2.3-dev", "<")) die("skip this is for PHP >= 4.2.3");
?>
--INI--
+register_long_arrays=1
session.use_cookies=0
session.cache_limiter=
register_globals=0
@@ -16,7 +17,7 @@ html_errors=0
display_errors=1
error_reporting=2039;
session.serialize_handler=php
-register_long_arrays=1
+session.save_handler=files
--FILE--
<?php
session_id("abtest");
diff --git a/ext/session/tests/009.phpt b/ext/session/tests/009.phpt
index aa9e46eb5..903b8be3a 100644
--- a/ext/session/tests/009.phpt
+++ b/ext/session/tests/009.phpt
@@ -3,13 +3,14 @@ unset($_SESSION["name"]); should work with register_globals=off
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
+register_long_arrays=1
session.use_cookies=0
session.cache_limiter=
register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
-register_long_arrays=1
+session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/012.phpt b/ext/session/tests/012.phpt
index 2bfee9b3d..a3d33d360 100644
--- a/ext/session/tests/012.phpt
+++ b/ext/session/tests/012.phpt
@@ -9,6 +9,7 @@ register_globals=1
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/013.phpt b/ext/session/tests/013.phpt
index 77c135305..54ccaeddb 100644
--- a/ext/session/tests/013.phpt
+++ b/ext/session/tests/013.phpt
@@ -9,6 +9,7 @@ register_globals=1
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt
index 3f2218683..4c5b14c69 100644
--- a/ext/session/tests/014.phpt
+++ b/ext/session/tests/014.phpt
@@ -11,6 +11,7 @@ session.bug_compat_42=1
session.bug_compat_warn=0
session.name=PHPSESSID
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/015.phpt b/ext/session/tests/015.phpt
index 53929b167..e747e08fb 100644
--- a/ext/session/tests/015.phpt
+++ b/ext/session/tests/015.phpt
@@ -9,6 +9,7 @@ session.cache_limiter=
arg_separator.output=&
session.name=PHPSESSID
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/017.phpt b/ext/session/tests/017.phpt
index 2a11fed85..dbe53f569 100644
--- a/ext/session/tests/017.phpt
+++ b/ext/session/tests/017.phpt
@@ -6,6 +6,7 @@ setting $_SESSION before session_start() should not cause segfault
session.use_cookies=0
session.cache_limiter=
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
diff --git a/ext/session/tests/018.phpt b/ext/session/tests/018.phpt
index 0b84978ed..3450d1e3f 100644
--- a/ext/session/tests/018.phpt
+++ b/ext/session/tests/018.phpt
@@ -8,6 +8,7 @@ session.cache_limiter=
session.use_trans_sid=1
session.name=PHPSESSID
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
diff --git a/ext/session/tests/019.phpt b/ext/session/tests/019.phpt
index e9f869944..2d819c676 100644
--- a/ext/session/tests/019.phpt
+++ b/ext/session/tests/019.phpt
@@ -7,6 +7,7 @@ session.use_cookies=0
session.cache_limiter=
register_globals=1
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
diff --git a/ext/session/tests/020.phpt b/ext/session/tests/020.phpt
index c9571ef20..455c7f720 100644
--- a/ext/session/tests/020.phpt
+++ b/ext/session/tests/020.phpt
@@ -9,6 +9,7 @@ session.use_trans_sid=1
arg_separator.output=&amp;
session.name=PHPSESSID
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
diff --git a/ext/session/tests/021.phpt b/ext/session/tests/021.phpt
index b45406438..9d95b86d0 100644
--- a/ext/session/tests/021.phpt
+++ b/ext/session/tests/021.phpt
@@ -9,6 +9,7 @@ session.use_trans_sid=1
url_rewriter.tags="a=href,area=href,frame=src,input=src,form=,fieldset="
session.name=PHPSESSID
session.serialize_handler=php
+session.save_handler=files
--FILE--
<?php
diff --git a/ext/session/tests/bug24592.phpt b/ext/session/tests/bug24592.phpt
index e13c89a5f..2c749386e 100644
--- a/ext/session/tests/bug24592.phpt
+++ b/ext/session/tests/bug24592.phpt
@@ -5,6 +5,7 @@ Bug #24592 (crash when multiple NULL values are being stored)
--INI--
register_globals=0
html_errors=0
+session.save_handler=files
--FILE--
<?php
@session_start();
diff --git a/ext/session/tests/bug26862.phpt b/ext/session/tests/bug26862.phpt
index 01533929e..44e7418cd 100644
--- a/ext/session/tests/bug26862.phpt
+++ b/ext/session/tests/bug26862.phpt
@@ -6,6 +6,7 @@ Bug #26862 (ob_flush() before output_reset_rewrite_vars() results in data loss)
register_globals=0
html_errors=0
session.use_trans_sid=0
+session.save_handler=files
--FILE--
<?php
session_start();
diff --git a/ext/shmop/php_shmop.h b/ext/shmop/php_shmop.h
index 485826d0c..30db3196f 100644
--- a/ext/shmop/php_shmop.h
+++ b/ext/shmop/php_shmop.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -31,9 +31,6 @@ extern zend_module_entry shmop_module_entry;
#endif
PHP_MINIT_FUNCTION(shmop);
-PHP_MSHUTDOWN_FUNCTION(shmop);
-PHP_RINIT_FUNCTION(shmop);
-PHP_RSHUTDOWN_FUNCTION(shmop);
PHP_MINFO_FUNCTION(shmop);
PHP_FUNCTION(shmop_open);
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c
index af3e62d59..d210411e4 100644
--- a/ext/shmop/shmop.c
+++ b/ext/shmop/shmop.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP version 4 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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 @@
| Ilia Alshanetsky <ilia@prohost.org> |
+----------------------------------------------------------------------+
*/
-/* $Id: shmop.c,v 1.27.2.1 2004/11/27 18:18:09 iliaa Exp $ */
+/* $Id: shmop.c,v 1.31 2005/08/03 14:07:45 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -65,7 +65,7 @@ zend_module_entry shmop_module_entry = {
"shmop",
shmop_functions,
PHP_MINIT(shmop),
- PHP_MSHUTDOWN(shmop),
+ NULL,
NULL,
NULL,
PHP_MINFO(shmop),
@@ -99,14 +99,6 @@ PHP_MINIT_FUNCTION(shmop)
}
/* }}} */
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(shmop)
-{
- return SUCCESS;
-}
-/* }}} */
-
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(shmop)
@@ -164,34 +156,33 @@ PHP_FUNCTION(shmop_open)
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid access mode");
- efree(shmop);
- RETURN_FALSE;
+ goto err;
}
shmop->shmid = shmget(shmop->key, shmop->size, shmop->shmflg);
if (shmop->shmid == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to attach or create shared memory segment");
- efree(shmop);
- RETURN_FALSE;
+ goto err;
}
if (shmctl(shmop->shmid, IPC_STAT, &shm)) {
- efree(shmop);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to get shared memory segment information");
- RETURN_FALSE;
+ goto err;
}
shmop->addr = shmat(shmop->shmid, 0, shmop->shmatflg);
if (shmop->addr == (char*) -1) {
- efree(shmop);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to attach to shared memory segment");
- RETURN_FALSE;
+ goto err;
}
shmop->size = shm.shm_segsz;
rsid = zend_list_insert(shmop, shm_type);
RETURN_LONG(rsid);
+err:
+ efree(shmop);
+ RETURN_FALSE;
}
/* }}} */
@@ -222,12 +213,7 @@ PHP_FUNCTION(shmop_read)
RETURN_FALSE;
}
- if (start + count > shmop->size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "count is out of range");
- RETURN_FALSE;
- }
-
- if (count < 0 ){
+ if (start + count > shmop->size || count < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "count is out of range");
RETURN_FALSE;
}
diff --git a/ext/simplexml/config.m4 b/ext/simplexml/config.m4
index a07ba9a56..a8f35b9b2 100644
--- a/ext/simplexml/config.m4
+++ b/ext/simplexml/config.m4
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.7.2.1 2005/04/27 13:13:38 sniper Exp $
+dnl $Id: config.m4,v 1.9.2.1 2005/10/01 15:41:37 helly Exp $
dnl config.m4 for extension simplexml
PHP_ARG_ENABLE(simplexml, whether to enable SimpleXML support,
@@ -22,4 +22,6 @@ if test "$PHP_SIMPLEXML" != "no"; then
], [
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
])
+ PHP_ADD_EXTENSION_DEP(simplexml, libxml)
+ PHP_ADD_EXTENSION_DEP(simplexml, spl, true)
fi
diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h
index ad2e003ff..663eb0794 100644
--- a/ext/simplexml/php_simplexml.h
+++ b/ext/simplexml/php_simplexml.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_simplexml.h,v 1.18 2004/02/13 00:02:19 fmk Exp $ */
+/* $Id: php_simplexml.h,v 1.20 2005/08/03 14:07:45 sniper Exp $ */
#ifndef PHP_SIMPLEXML_H
#define PHP_SIMPLEXML_H
@@ -48,7 +48,7 @@ extern zend_module_entry simplexml_module_entry;
PHP_MINIT_FUNCTION(simplexml);
PHP_MSHUTDOWN_FUNCTION(simplexml);
-#if HAVE_SPL && !defined(COMPILE_DL_SPL)
+#ifdef HAVE_SPL
PHP_RINIT_FUNCTION(simplexml);
#endif
PHP_MINFO_FUNCTION(simplexml);
diff --git a/ext/simplexml/php_simplexml_exports.h b/ext/simplexml/php_simplexml_exports.h
index 2ec9a385a..51e1999fb 100755
--- a/ext/simplexml/php_simplexml_exports.h
+++ b/ext/simplexml/php_simplexml_exports.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_simplexml_exports.h,v 1.1.2.1 2004/08/05 23:57:53 iliaa Exp $ */
+/* $Id: php_simplexml_exports.h,v 1.3.2.2 2005/10/31 21:20:44 helly Exp $ */
#ifndef PHP_SIMPLEXML_EXPORTS_H
#define PHP_SIMPLEXML_EXPORTS_H
@@ -49,8 +49,10 @@ php_sxe_fetch_object(zval *object TSRMLS_DC)
}
/* }}} */
-ZEND_API void php_sxe_reset_iterator(php_sxe_object *sxe TSRMLS_DC);
-ZEND_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC);
+typedef struct {
+ zend_object_iterator intern;
+ php_sxe_object *sxe;
+} php_sxe_iterator;
#endif /* PHP_SIMPLEXML_EXPORTS_H */
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index a6fa86b3c..720673ae8 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: simplexml.c,v 1.139.2.4 2004/08/30 17:29:58 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.7 2005/11/20 13:05:13 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -34,7 +34,7 @@
#include "php_simplexml_exports.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
-#if HAVE_SPL && !defined(COMPILE_DL_SPL)
+#ifdef HAVE_SPL
#include "ext/spl/spl_sxe.h"
#endif
@@ -51,6 +51,8 @@ ZEND_API zend_class_entry *sxe_get_element_class_entry()
static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC);
static zend_object_value php_sxe_register_object(php_sxe_object * TSRMLS_DC);
+static void php_sxe_reset_iterator(php_sxe_object *sxe TSRMLS_DC);
+static void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC);
/* {{{ _node_as_zval()
*/
@@ -271,8 +273,7 @@ static zval * sxe_dimension_read(zval *object, zval *offset, int type TSRMLS_DC)
/* {{{ change_node_zval()
*/
-static void
-change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
+static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
{
zval value_copy;
@@ -420,7 +421,7 @@ next_iter:
}
change_node_zval(newnode, value TSRMLS_CC);
} else if (counter > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot assign to an array of nodes (duplicate subnodes or attr detected)\n");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot assign to an array of nodes (duplicate subnodes or attr detected)");
} else {
if (attribs) {
switch (Z_TYPE_P(value)) {
@@ -634,7 +635,7 @@ static void sxe_dimension_delete(zval *object, zval *offset TSRMLS_DC)
/* {{{ _get_base_node_value()
*/
static void
-_get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval **value TSRMLS_DC)
+_get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval **value, char *prefix TSRMLS_DC)
{
php_sxe_object *subnode;
xmlChar *contents;
@@ -651,8 +652,10 @@ _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval **value TSRM
subnode = php_sxe_object_new(sxe_ref->zo.ce TSRMLS_CC);
subnode->document = sxe_ref->document;
subnode->document->refcount++;
+ if (prefix) {
+ subnode->iter.nsprefix = xmlStrdup(prefix);
+ }
php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC);
-
(*value)->type = IS_OBJECT;
(*value)->value.obj = php_sxe_register_object(subnode TSRMLS_CC);
/*zval_add_ref(value);*/
@@ -688,10 +691,15 @@ sxe_properties_get(zval *object TSRMLS_DC)
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
-
- if (node) {
- node = node->children;
-
+ if (node && sxe->iter.type != SXE_ITER_ATTRLIST) {
+ if (node->type == XML_ATTRIBUTE_NODE) {
+ MAKE_STD_ZVAL(value);
+ ZVAL_STRING(value, xmlNodeListGetString(node->doc, node->children, 1), 1);
+ zend_hash_next_index_insert(rv, &value, sizeof(zval *), NULL);
+ node = NULL;
+ } else {
+ node = node->children;
+ }
while (node) {
if (node->children != NULL || node->prev != NULL || node->next != NULL) {
SKIP_TEXT(node);
@@ -704,6 +712,10 @@ sxe_properties_get(zval *object TSRMLS_DC)
}
}
+ if (node->type == XML_ELEMENT_NODE && (! match_ns(sxe, node, sxe->iter.nsprefix))) {
+ goto next_iter;
+ }
+
name = (char *) node->name;
if (!name) {
goto next_iter;
@@ -711,7 +723,7 @@ sxe_properties_get(zval *object TSRMLS_DC)
namelen = xmlStrlen(node->name) + 1;
}
- _get_base_node_value(sxe, node, &value TSRMLS_CC);
+ _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix TSRMLS_CC);
h = zend_hash_func(name, namelen);
if (zend_hash_quick_find(rv, name, namelen, h, (void **) &data_ptr) == SUCCESS) {
@@ -843,6 +855,28 @@ SXE_METHOD(xpath)
xmlXPathFreeObject(retval);
}
+
+SXE_METHOD(registerXPathNamespace)
+{
+ php_sxe_object *sxe;
+ int prefix_len, ns_uri_len;
+ char *prefix, *ns_uri;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ return;
+ }
+
+ sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
+ if (!sxe->xpath) {
+ sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr);
+ }
+
+ if (xmlXPathRegisterNs(sxe->xpath, prefix, ns_uri) != 0) {
+ RETURN_FALSE
+ }
+ RETURN_TRUE;
+}
+
/* }}} */
/* {{{ proto string SimpleXMLElement::asXML([string filename])
@@ -1162,6 +1196,7 @@ static void sxe_object_dtor(void *object, zend_object_handle handle TSRMLS_DC)
sxe->iter.nsprefix = NULL;
}
}
+/* }}} */
/* {{{ sxe_object_free_storage()
*/
@@ -1220,7 +1255,7 @@ php_sxe_register_object(php_sxe_object *intern TSRMLS_DC)
if (EG(ze1_compatibility_mode)) {
rv.handlers = (zend_object_handlers *) &sxe_ze1_object_handlers;
} else {
- rv.handlers = (zend_object_handlers *) &sxe_object_handlers;
+ rv.handlers = (zend_object_handlers *) &sxe_object_handlers;
}
return rv;
@@ -1239,7 +1274,7 @@ sxe_object_new(zend_class_entry *ce TSRMLS_DC)
}
/* }}} */
-/* {{{ proto simplemxml_element simplexml_load_file(string filename [, string class_name])
+/* {{{ proto simplemxml_element simplexml_load_file(string filename [, string class_name [, int options]])
Load a filename and return a simplexml_element object to allow for processing */
PHP_FUNCTION(simplexml_load_file)
{
@@ -1249,13 +1284,19 @@ PHP_FUNCTION(simplexml_load_file)
xmlDocPtr docp;
char *classname = "";
int classname_len = 0;
+ long options = 0;
zend_class_entry *ce= sxe_class_entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &filename, &filename_len, &classname, &classname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &filename, &filename_len, &classname, &classname_len, &options) == FAILURE) {
return;
}
+#if LIBXML_VERSION >= 20600
+ docp = xmlReadFile(filename, NULL, options);
+#else
docp = xmlParseFile(filename);
+#endif
+
if (! docp) {
RETURN_FALSE;
}
@@ -1277,7 +1318,7 @@ PHP_FUNCTION(simplexml_load_file)
}
/* }}} */
-/* {{{ proto simplemxml_element simplexml_load_string(string data [, string class_name])
+/* {{{ proto simplemxml_element simplexml_load_string(string data [, string class_name [, int options]])
Load a string and return a simplexml_element object to allow for processing */
PHP_FUNCTION(simplexml_load_string)
{
@@ -1287,13 +1328,19 @@ PHP_FUNCTION(simplexml_load_string)
xmlDocPtr docp;
char *classname = "";
int classname_len = 0;
+ long options = 0;
zend_class_entry *ce= sxe_class_entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &data, &data_len, &classname, &classname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &data, &data_len, &classname, &classname_len, &options) == FAILURE) {
return;
}
+#if LIBXML_VERSION >= 20600
+ docp = xmlReadMemory(data, data_len, NULL, NULL, options);
+#else
docp = xmlParseMemory(data, data_len);
+#endif
+
if (! docp) {
RETURN_FALSE;
}
@@ -1316,7 +1363,7 @@ PHP_FUNCTION(simplexml_load_string)
/* }}} */
-/* {{{ proto SimpleXMLElement::__construct()
+/* {{{ proto SimpleXMLElement::__construct(string data)
SimpleXMLElement constructor */
SXE_METHOD(__construct)
{
@@ -1345,11 +1392,6 @@ SXE_METHOD(__construct)
/* }}} */
-typedef struct {
- zend_object_iterator intern;
- php_sxe_object *sxe;
-} php_sxe_iterator;
-
static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC);
static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC);
@@ -1366,7 +1408,7 @@ zend_object_iterator_funcs php_sxe_iterator_funcs = {
php_sxe_iterator_rewind,
};
-ZEND_API void php_sxe_reset_iterator(php_sxe_object *sxe TSRMLS_DC)
+static void php_sxe_reset_iterator(php_sxe_object *sxe TSRMLS_DC)
{
xmlNodePtr node;
char *prefix;
@@ -1481,7 +1523,7 @@ static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_k
}
-ZEND_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC)
+static void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC)
{
xmlNodePtr node = NULL;
php_sxe_object *intern;
@@ -1557,7 +1599,6 @@ void *simplexml_export_node(zval *object TSRMLS_DC)
return php_sxe_get_first_node(sxe, node TSRMLS_CC);
}
-#ifdef HAVE_DOM
/* {{{ proto simplemxml_element simplexml_import_dom(domNode node [, string class_name])
Get a simplexml_element object from dom to allow for processing */
PHP_FUNCTION(simplexml_import_dom)
@@ -1610,19 +1651,22 @@ PHP_FUNCTION(simplexml_import_dom)
}
}
/* }}} */
-#endif
function_entry simplexml_functions[] = {
PHP_FE(simplexml_load_file, NULL)
PHP_FE(simplexml_load_string, NULL)
-#ifdef HAVE_DOM
PHP_FE(simplexml_import_dom, NULL)
-#endif
+ {NULL, NULL, NULL}
+};
+
+static zend_module_dep simplexml_deps[] = {
+ ZEND_MOD_REQUIRED("libxml")
{NULL, NULL, NULL}
};
zend_module_entry simplexml_module_entry = {
- STANDARD_MODULE_HEADER,
+ STANDARD_MODULE_HEADER_EX, NULL,
+ simplexml_deps,
"SimpleXML",
simplexml_functions,
PHP_MINIT(simplexml),
@@ -1644,6 +1688,7 @@ static zend_function_entry sxe_functions[] = {
SXE_ME(__construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) /* must be called */
SXE_ME(asXML, NULL, ZEND_ACC_PUBLIC)
SXE_ME(xpath, NULL, ZEND_ACC_PUBLIC)
+ SXE_ME(registerXPathNamespace, NULL, ZEND_ACC_PUBLIC)
SXE_ME(attributes, NULL, ZEND_ACC_PUBLIC)
SXE_ME(children, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
@@ -1659,6 +1704,7 @@ PHP_MINIT_FUNCTION(simplexml)
sxe.create_object = sxe_object_new;
sxe_class_entry = zend_register_internal_class(&sxe TSRMLS_CC);
sxe_class_entry->get_iterator = php_sxe_get_iterator;
+ sxe_class_entry->iterator_funcs.funcs = &php_sxe_iterator_funcs;
zend_class_implements(sxe_class_entry TSRMLS_CC, 1, zend_ce_traversable);
sxe_object_handlers.get_method = zend_get_std_object_handlers()->get_method;
sxe_object_handlers.get_constructor = zend_get_std_object_handlers()->get_constructor;
@@ -1671,7 +1717,7 @@ PHP_MINIT_FUNCTION(simplexml)
sxe_ze1_object_handlers.get_class_name = zend_get_std_object_handlers()->get_class_name;
sxe_ze1_object_handlers.clone_obj = sxe_object_ze1_clone;
-#if HAVE_SPL && !defined(COMPILE_DL_SPL)
+#ifdef HAVE_SPL
if (zend_get_module_started("spl") == SUCCESS) {
PHP_MINIT(spl_sxe)(INIT_FUNC_ARGS_PASSTHRU);
}
@@ -1697,7 +1743,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.139.2.4 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.7 $");
php_info_print_table_row(2, "Schema support",
#ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
diff --git a/ext/simplexml/tests/016a.phpt b/ext/simplexml/tests/016a.phpt
new file mode 100755
index 000000000..9797e2930
--- /dev/null
+++ b/ext/simplexml/tests/016a.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SimpleXML: concatenating attributes
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+$xml =<<<EOF
+<people>
+ <person name="Foo"></person>
+</people>
+EOF;
+
+$people = simplexml_load_string($xml);
+var_dump($people->person['name']);
+$people->person['name'] .= 'Bar';
+var_dump($people->person['name']);
+
+?>
+===DONE===
+--EXPECTF--
+object(SimpleXMLElement)#%d (1) {
+ [0]=>
+ string(3) "Foo"
+}
+object(SimpleXMLElement)#%d (1) {
+ [0]=>
+ string(6) "FooBar"
+}
+===DONE===
diff --git a/ext/simplexml/tests/022.phpt b/ext/simplexml/tests/022.phpt
new file mode 100755
index 000000000..08cb908c9
--- /dev/null
+++ b/ext/simplexml/tests/022.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SimpleXML and attributes inside foreach
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+
+$xml =<<<EOF
+<?xml version='1.0'?>
+<pres><content><file glob="slide_*.xml"/></content></pres>
+EOF;
+
+$sxe = simplexml_load_string($xml);
+
+foreach($sxe->content->file as $file)
+{
+ var_dump($file);
+ var_dump($file['glob']);
+}
+
+?>
+===DONE===
+--EXPECTF--
+object(SimpleXMLElement)#%d (0) {
+}
+object(SimpleXMLElement)#%d (1) {
+ [0]=>
+ string(11) "slide_*.xml"
+}
+===DONE===
diff --git a/ext/simplexml/tests/023.phpt b/ext/simplexml/tests/023.phpt
new file mode 100755
index 000000000..dd6dde59d
--- /dev/null
+++ b/ext/simplexml/tests/023.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SimpleXML: Attributes with entities
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+
+$xml =<<<EOF
+<?xml version='1.0'?>
+<!DOCTYPE talks SYSTEM "nbsp.dtd" [
+<!ELEMENT root EMPTY>
+<!ATTLIST root attr1 CDATA #IMPLIED>
+<!ENTITY nbsp "&#38;#x00A0;">
+]>
+<root attr='foo&nbsp;bar&nbsp;baz'></root>
+EOF;
+
+$sxe = simplexml_load_string($xml);
+
+var_dump($sxe);
+var_dump($sxe['attr']);
+?>
+===DONE===
+--EXPECTF--
+object(SimpleXMLElement)#%d (0) {
+}
+object(SimpleXMLElement)#%d (1) {
+ [0]=>
+ string(%d) "foo%sbar%sbaz"
+}
+===DONE===
diff --git a/ext/simplexml/tests/sxe.dtd b/ext/simplexml/tests/sxe.dtd
index 8a8dde430..b75a7922b 100755
--- a/ext/simplexml/tests/sxe.dtd
+++ b/ext/simplexml/tests/sxe.dtd
@@ -1,21 +1,34 @@
<?xml encoding='US-ASCII'?>
-<!ELEMENT sxe elem1, elem 11>
+<!ELEMENT sxe (elem1+, elem11, elem22*)>
<!ATTLIST sxe id CDATA #implied>
-<!ELEMENT elem1 elem2>
+<!ELEMENT elem1 elem2*>
<!ATTLIST elem1 attr1 CDATA #required
attr2 CDATA "default>
-<!ELEMENT elem2 elem3>
-<!ATTLIST elem2>
+<!ELEMENT elem2 elem3*>
+<!ATTLIST elem2 att25 CDATA #implied
+ att42 CDATA #implied>
-<!ELEMENT elem3 elem4>
+<!ELEMENT elem3 elem4*>
<!ATTLIST elem3>
<!ELEMENT elem4 EMPTY>
<!ATTLIST elem4>
-<!ELEMENT elem11 EMPTY>
+<!ELEMENT elem11 elem111*>
<!ATTLIST elem11>
+<!ELEMNET elem111 elem1111*>
+<!ATTLIST elem111>
+
+<!ELEMENT elem1111 EMPTY>
+<!ATTLIST elem1111>
+
+<!ELEMENT elem22 elem222*>
+<!ATTLIST elem22 attr22 CDATA #implied>
+
+<!ELEMENT elem222 EMPTY>
+<!ATTLIST elem222>
+
diff --git a/ext/skeleton/skeleton.php b/ext/skeleton/skeleton.php
index 12e1e64bb..91db9d540 100644
--- a/ext/skeleton/skeleton.php
+++ b/ext/skeleton/skeleton.php
@@ -1,14 +1,16 @@
-<?
+<?php
+$br = (php_sapi_name() == "cli")? "":"<br>";
+
if(!extension_loaded('extname')) {
dl('extname.' . PHP_SHLIB_SUFFIX);
}
$module = 'extname';
$functions = get_extension_funcs($module);
-echo "Functions available in the test extension:<br>\n";
+echo "Functions available in the test extension:$br\n";
foreach($functions as $func) {
- echo $func."<br>\n";
+ echo $func."$br\n";
}
-echo "<br>\n";
+echo "$br\n";
$function = 'confirm_' . $module . '_compiled';
if (extension_loaded($module)) {
$str = $function($module);
diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4
index 326d20983..511246b48 100644
--- a/ext/snmp/config.m4
+++ b/ext/snmp/config.m4
@@ -1,12 +1,12 @@
dnl
-dnl $Id: config.m4,v 1.31 2003/09/23 08:15:49 sniper Exp $
+dnl $Id: config.m4,v 1.32 2005/05/29 23:16:44 sniper Exp $
dnl
PHP_ARG_WITH(snmp,for SNMP support,
-[ --with-snmp[=DIR] Include SNMP support.])
+[ --with-snmp[=DIR] Include SNMP support])
PHP_ARG_WITH(openssl-dir,OpenSSL dir for SNMP,
-[ --with-openssl-dir[=DIR] SNMP: openssl install prefix.], no, no)
+[ --with-openssl-dir[=DIR] SNMP: openssl install prefix], no, no)
if test "$PHP_SNMP" != "no"; then
@@ -123,10 +123,9 @@ if test "$PHP_SNMP" != "no"; then
PHP_SUBST(SNMP_SHARED_LIBADD)
fi
-
AC_MSG_CHECKING(whether to enable UCD SNMP hack)
AC_ARG_ENABLE(ucd-snmp-hack,
-[ --enable-ucd-snmp-hack Enable UCD SNMP hack],[
+[ --enable-ucd-snmp-hack SNMP: Enable UCD SNMP hack],[
if test "$enableval" = "yes" ; then
AC_DEFINE(UCD_SNMP_HACK, 1, [ ])
AC_MSG_RESULT(yes)
diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h
index 867f345d5..0013fa91a 100644
--- a/ext/snmp/php_snmp.h
+++ b/ext/snmp/php_snmp.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_snmp.h,v 1.22.2.2 2005/03/17 19:47:48 harrie Exp $ */
+/* $Id: php_snmp.h,v 1.25 2005/08/03 14:07:46 sniper Exp $ */
#ifndef PHP_SNMP_H
#define PHP_SNMP_H
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 141c30dda..a732c1773 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: snmp.c,v 1.92.2.11 2005/06/28 13:43:29 hyanantha Exp $ */
+/* $Id: snmp.c,v 1.106 2005/08/03 14:07:46 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -146,6 +146,12 @@ function_entry snmp_functions[] = {
};
/* }}} */
+#define SNMP_CMD_GET 1
+#define SNMP_CMD_GETNEXT 2
+#define SNMP_CMD_WALK 3
+#define SNMP_CMD_REALWALK 4
+#define SNMP_CMD_SET 11
+
/* {{{ snmp_module_entry
*/
zend_module_entry snmp_module_entry = {
@@ -331,14 +337,13 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
*
* Generic SNMP object fetcher (for all SNMP versions)
*
-* st=1 snmpget() - query an agent and return a single value.
-* st=2 snmpget() - query an agent and return the next single value.
-* st=3 snmpwalk() - walk the mib and return a single dimensional array
-* containing the values.
-* st=4 snmprealwalk() and snmpwalkoid() - walk the mib and return an
-* array of oid,value pairs.
-* st=5-8 ** Reserved **
-* st=11 snmpset() - query an agent and set a single value
+* st=SNMP_CMD_GET get - query an agent with SNMP-GET.
+* st=SNMP_CMD_GETNEXT getnext - query an agent with SNMP-GETNEXT.
+* st=SNMP_CMD_WALK walk - walk the mib and return a single dimensional array
+* containing the values.
+* st=SNMP_CMD_REALWALK realwalk() and walkoid() - walk the mib and return an
+* array of oid,value pairs.
+* st=SNMP_CMD_SET set() - query an agent and set a single value
*
*/
static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
@@ -362,7 +367,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
char *err;
zval *snmpval = NULL;
- if (st >= 3) { /* walk */
+ if (st >= SNMP_CMD_WALK) { /* walk */
rootlen = MAX_NAME_LEN;
if (strlen(objid)) { /* on a walk, an empty string means top of tree - no error */
if (snmp_parse_oid(objid, root, &rootlen)) {
@@ -386,12 +391,12 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
RETURN_FALSE;
}
- if (st >= 3) {
+ if (st >= SNMP_CMD_WALK) {
memmove((char *)name, (char *)root, rootlen * sizeof(oid));
name_length = rootlen;
switch(st) {
- case 3:
- case 4:
+ case SNMP_CMD_WALK:
+ case SNMP_CMD_REALWALK:
array_init(return_value);
break;
default:
@@ -402,8 +407,8 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
while (keepwalking) {
keepwalking = 0;
- if ((st == 1) || (st == 2)) {
- pdu = snmp_pdu_create((st == 1) ? SNMP_MSG_GET : SNMP_MSG_GETNEXT);
+ if ((st == SNMP_CMD_GET) || (st == SNMP_CMD_GETNEXT)) {
+ pdu = snmp_pdu_create((st == SNMP_CMD_GET) ? SNMP_MSG_GET : SNMP_MSG_GETNEXT);
name_length = MAX_OID_LEN;
if (!snmp_parse_oid(objid, name, &name_length)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid object identifier: %s", objid);
@@ -411,7 +416,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
RETURN_FALSE;
}
snmp_add_null_var(pdu, name, name_length);
- } else if (st == 11) {
+ } else if (st == SNMP_CMD_SET) {
pdu = snmp_pdu_create(SNMP_MSG_SET);
if (snmp_add_var(pdu, name, name_length, type, value)) {
#ifdef HAVE_NET_SNMP
@@ -423,8 +428,14 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
snmp_close(ss);
RETURN_FALSE;
}
- } else if (st >= 3) {
- pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ } else if (st >= SNMP_CMD_WALK) {
+ if (session->version == SNMP_VERSION_1) {
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ } else {
+ pdu = snmp_pdu_create(SNMP_MSG_GETBULK);
+ pdu->non_repeaters = 0;
+ pdu->max_repetitions = 20;
+ }
snmp_add_null_var(pdu, name, name_length);
}
@@ -433,30 +444,30 @@ retry:
if (status == STAT_SUCCESS) {
if (response->errstat == SNMP_ERR_NOERROR) {
for (vars = response->variables; vars; vars = vars->next_variable) {
- if (st >= 3 && st != 11 &&
+ if (st >= SNMP_CMD_WALK && st != SNMP_CMD_SET &&
(vars->name_length < rootlen || memcmp(root, vars->name, rootlen * sizeof(oid)))) {
continue; /* not part of this subtree */
}
- if (st != 11) {
+ if (st != SNMP_CMD_SET) {
MAKE_STD_ZVAL(snmpval);
php_snmp_getvalue(vars, snmpval TSRMLS_CC);
}
- if (st == 1) {
+ if (st == SNMP_CMD_GET) {
*return_value = *snmpval;
zval_copy_ctor(return_value);
zval_ptr_dtor(&snmpval);
snmp_close(ss);
return;
- } else if (st == 2) {
+ } else if (st == SNMP_CMD_GETNEXT) {
*return_value = *snmpval;
zval_copy_ctor(return_value);
snmp_close(ss);
return;
- } else if (st == 3) {
+ } else if (st == SNMP_CMD_WALK) {
add_next_index_zval(return_value,snmpval); /* Add to returned array */
- } else if (st == 4) {
+ } else if (st == SNMP_CMD_REALWALK) {
#ifdef HAVE_NET_SNMP
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
#else
@@ -464,7 +475,7 @@ retry:
#endif
add_assoc_zval(return_value,buf2,snmpval);
}
- if (st >= 3 && st != 11) {
+ if (st >= SNMP_CMD_WALK && st != SNMP_CMD_SET) {
if (vars->type != SNMP_ENDOFMIBVIEW &&
vars->type != SNMP_NOSUCHOBJECT && vars->type != SNMP_NOSUCHINSTANCE) {
memmove((char *)name, (char *)vars->name,vars->name_length * sizeof(oid));
@@ -474,7 +485,7 @@ retry:
}
}
} else {
- if (st != 3 || response->errstat != SNMP_ERR_NOSUCHNAME) {
+ if (st != SNMP_CMD_WALK || response->errstat != SNMP_ERR_NOSUCHNAME) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in packet: %s", snmp_errstring(response->errstat));
if (response->errstat == SNMP_ERR_NOSUCHNAME) {
for (count=1, vars = response->variables; vars && count != response->errindex;
@@ -488,18 +499,24 @@ retry:
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, "This name does not exist: %s",buf);
}
- if (st == 1) {
+ if (st == SNMP_CMD_GET) {
if ((pdu = snmp_fix_pdu(response, SNMP_MSG_GET)) != NULL) {
goto retry;
}
- } else if (st == 11) {
+ } else if (st == SNMP_CMD_SET) {
if ((pdu = snmp_fix_pdu(response, SNMP_MSG_SET)) != NULL) {
goto retry;
}
- } else if (st >= 2) { /* Here we do both getnext and walks. */
+ } else if (st == SNMP_CMD_GETNEXT) {
if ((pdu = snmp_fix_pdu(response, SNMP_MSG_GETNEXT)) != NULL) {
goto retry;
}
+ } else if (st >= SNMP_CMD_WALK) { /* Here we do walks. */
+ if ((pdu = snmp_fix_pdu(response, ((session->version == SNMP_VERSION_1)
+ ? SNMP_MSG_GETNEXT
+ : SNMP_MSG_GETBULK))) != NULL) {
+ goto retry;
+ }
}
snmp_close(ss);
RETURN_FALSE;
@@ -507,14 +524,14 @@ retry:
}
} else if (status == STAT_TIMEOUT) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No response from %s", session->peername);
- if (st == 3 || st == 4) {
+ if (st == SNMP_CMD_WALK || st == SNMP_CMD_REALWALK) {
zval_dtor(return_value);
}
snmp_close(ss);
RETURN_FALSE;
} else { /* status == STAT_ERROR */
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred, quitting");
- if (st == 3 || st == 4) {
+ if (st == SNMP_CMD_WALK || st == SNMP_CMD_REALWALK) {
zval_dtor(return_value);
}
snmp_close(ss);
@@ -534,14 +551,14 @@ retry:
* This function makes use of the internal SNMP object fetcher.
* The object fetcher is shared with SNMPv3.
*
-* st=1 snmpget() - query an agent and return a single value.
-* st=2 snmpgetnext() - query an agent and return the next single value.
-* st=3 snmpwalk() - walk the mib and return a single dimensional array
+* st=SNMP_CMD_GET get - query an agent with SNMP-GET.
+* st=SNMP_CMD_GETNEXT getnext - query an agent with SNMP-GETNEXT.
+* st=SNMP_CMD_WALK walk - walk the mib and return a single dimensional array
* containing the values.
-* st=4 snmprealwalk() and snmpwalkoid() - walk the mib and return an
+* st=SNMP_CMD_REALWALK realwalk() and walkoid() - walk the mib and return an
* array of oid,value pairs.
* st=5-8 ** Reserved **
-* st=11 snmpset() - query an agent and set a single value
+* st=SNMP_CMD_SET set() - query an agent and set a single value
*
*/
static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
@@ -566,7 +583,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
convert_to_string_ex(a2);
convert_to_string_ex(a3);
- if (st == 11) {
+ if (st == SNMP_CMD_SET) {
if (myargc < 5) {
WRONG_PARAM_COUNT;
}
@@ -632,7 +649,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
Fetch a SNMP object */
PHP_FUNCTION(snmpget)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,1, SNMP_VERSION_1);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_GET, SNMP_VERSION_1);
}
/* }}} */
@@ -640,7 +657,7 @@ PHP_FUNCTION(snmpget)
Fetch a SNMP object */
PHP_FUNCTION(snmpgetnext)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,2, SNMP_VERSION_1);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_GETNEXT, SNMP_VERSION_1);
}
/* }}} */
@@ -648,7 +665,7 @@ PHP_FUNCTION(snmpgetnext)
Return all objects under the specified object id */
PHP_FUNCTION(snmpwalk)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,3, SNMP_VERSION_1);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_WALK, SNMP_VERSION_1);
}
/* }}} */
@@ -656,7 +673,7 @@ PHP_FUNCTION(snmpwalk)
Return all objects including their respective object id withing the specified one */
PHP_FUNCTION(snmprealwalk)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,4, SNMP_VERSION_1);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_REALWALK, SNMP_VERSION_1);
}
/* }}} */
@@ -734,7 +751,7 @@ PHP_FUNCTION(snmp_set_oid_numeric_print)
Set the value of a SNMP object */
PHP_FUNCTION(snmpset)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,11, SNMP_VERSION_1);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_SET, SNMP_VERSION_1);
}
/* }}} */
@@ -907,7 +924,7 @@ static int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass TSRM
Fetch a SNMP object */
PHP_FUNCTION(snmp2_get)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,1, SNMP_VERSION_2c);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_GET, SNMP_VERSION_2c);
}
/* }}} */
@@ -915,7 +932,7 @@ PHP_FUNCTION(snmp2_get)
Fetch a SNMP object */
PHP_FUNCTION(snmp2_getnext)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,2, SNMP_VERSION_2c);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_GETNEXT, SNMP_VERSION_2c);
}
/* }}} */
@@ -923,7 +940,7 @@ PHP_FUNCTION(snmp2_getnext)
Return all objects under the specified object id */
PHP_FUNCTION(snmp2_walk)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,3, SNMP_VERSION_2c);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_WALK, SNMP_VERSION_2c);
}
/* }}} */
@@ -931,7 +948,7 @@ PHP_FUNCTION(snmp2_walk)
Return all objects including their respective object id withing the specified one */
PHP_FUNCTION(snmp2_real_walk)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,4, SNMP_VERSION_2c);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_REALWALK, SNMP_VERSION_2c);
}
/* }}} */
@@ -939,7 +956,7 @@ PHP_FUNCTION(snmp2_real_walk)
Set the value of a SNMP object */
PHP_FUNCTION(snmp2_set)
{
- php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,11, SNMP_VERSION_2c);
+ php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,SNMP_CMD_SET, SNMP_VERSION_2c);
}
/* }}} */
@@ -948,13 +965,13 @@ PHP_FUNCTION(snmp2_set)
* Generic SNMPv3 object fetcher
* From here is passed on the the common internal object fetcher.
*
-* st=1 snmp3_get() - query an agent and return a single value.
-* st=2 snmp3_getnext() - query an agent and return the next single value.
-* st=3 snmp3_walk() - walk the mib and return a single dimensional array
+* st=SNMP_CMD_GET snmp3_get() - query an agent and return a single value.
+* st=SNMP_CMD_GETNEXT snmp3_getnext() - query an agent and return the next single value.
+* st=SNMP_CMD_WALK snmp3_walk() - walk the mib and return a single dimensional array
* containing the values.
-* st=4 snmp3_real_walk() - walk the mib and return an
+* st=SNMP_CMD_REALWALK snmp3_real_walk() - walk the mib and return an
* array of oid,value pairs.
-* st=11 snmp3_set() - query an agent and set a single value
+* st=SNMP_CMD_SET snmp3_set() - query an agent and set a single value
*
*/
static void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st)
@@ -1032,7 +1049,7 @@ static void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st)
RETURN_FALSE;
}
- if (st == 11) {
+ if (st == SNMP_CMD_SET) {
if (myargc < 10) {
WRONG_PARAM_COUNT;
}
@@ -1070,7 +1087,7 @@ static void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st)
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_get)
{
- php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+ php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET);
}
/* }}} */
@@ -1078,7 +1095,7 @@ PHP_FUNCTION(snmp3_get)
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_getnext)
{
- php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2);
+ php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT);
}
/* }}} */
@@ -1086,7 +1103,7 @@ PHP_FUNCTION(snmp3_getnext)
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_walk)
{
- php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3);
+ php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK);
}
/* }}} */
@@ -1094,7 +1111,7 @@ PHP_FUNCTION(snmp3_walk)
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_real_walk)
{
- php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, 4);
+ php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_REALWALK);
}
/* }}} */
@@ -1102,7 +1119,7 @@ PHP_FUNCTION(snmp3_real_walk)
Fetch the value of a SNMP object */
PHP_FUNCTION(snmp3_set)
{
- php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, 11);
+ php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_SET);
}
/* }}} */
diff --git a/ext/snmp/winsnmp.c b/ext/snmp/winsnmp.c
index 188d526ff..f4332300a 100644
--- a/ext/snmp/winsnmp.c
+++ b/ext/snmp/winsnmp.c
@@ -100,7 +100,7 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
for the session are also required.
*/
if ((session = SnmpMgrOpen(agent, community, timeout, retries)) == NULL){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrOpen %d\n", GetLastError());
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrOpen %d", GetLastError());
}
/* Determine and perform the requested operation.*/
@@ -119,12 +119,12 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
if (!SnmpMgrRequest(session, requestType, &variableBindings,
&errorStatus, &errorIndex)){
/* The API is indicating an error. */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrRequest %d\n", GetLastError());
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrRequest %d", GetLastError());
} else {
/* The API succeeded, errors may be indicated from the remote
agent. */
if (errorStatus > 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error: errorStatus=%d, errorIndex=%d\n",
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error: errorStatus=%d, errorIndex=%d",
errorStatus, errorIndex);
} else {
/* Display the resulting variable bindings.*/
@@ -165,7 +165,7 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
if (!SnmpMgrRequest(session, requestType, &variableBindings,
&errorStatus, &errorIndex)){
/* The API is indicating an error.*/
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrRequest %d\n", GetLastError());
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrRequest %d", GetLastError());
break;
}
else
@@ -183,7 +183,7 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
/* Test for general error conditions or sucesss. */
if (errorStatus > 0){
- php_error_docref(NULL TSRMLS_CC, E_ERROR,"Error: errorStatus=%d, errorIndex=%d \n", errorStatus, errorIndex);
+ php_error_docref(NULL TSRMLS_CC, E_ERROR,"Error: errorStatus=%d, errorIndex=%d", errorStatus, errorIndex);
break;
}
else
@@ -218,7 +218,7 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
/* Close SNMP session with the remote agent.*/
if (!SnmpMgrClose(session)){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrClose %d\n", GetLastError());
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrClose %d", GetLastError());
}
}
/* }}} */
diff --git a/ext/soap/TODO b/ext/soap/TODO
index 2bb875bff..800176cf0 100644
--- a/ext/soap/TODO
+++ b/ext/soap/TODO
@@ -34,8 +34,6 @@ Encoding
? gMonthDay,
? gDay,
? gMonth)
-? proper encoding of standard hexBinary type
-? proper encoding of standard base64Binary type
? full support for arrays
- SOAP 1.1 encoding of arrays with holes (partially transmitted and sparse arrays)
SOAP 1.2 doesn't support partially transmitted and sparse arrays
diff --git a/ext/soap/config.m4 b/ext/soap/config.m4
index 9efb0d796..7a1b4a680 100644
--- a/ext/soap/config.m4
+++ b/ext/soap/config.m4
@@ -1,8 +1,8 @@
-dnl $Id: config.m4,v 1.8.2.1 2005/04/27 13:13:38 sniper Exp $
+dnl $Id: config.m4,v 1.10 2005/05/29 23:16:44 sniper Exp $
dnl config.m4 for extension soap
PHP_ARG_ENABLE(soap, whether to enable SOAP support,
-[ --enable-soap Include SOAP support.])
+[ --enable-soap Enable SOAP support])
if test -z "$PHP_LIBXML_DIR"; then
PHP_ARG_WITH(libxml-dir, libxml2 install dir,
diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php
index d6b4b17ac..ee785f67c 100644
--- a/ext/soap/interop/client_round2_interop.php
+++ b/ext/soap/interop/client_round2_interop.php
@@ -16,7 +16,7 @@
// | Authors: Shane Caraveo <Shane@Caraveo.com> |
// +----------------------------------------------------------------------+
//
-// $Id: client_round2_interop.php,v 1.15.2.2 2004/09/13 11:54:06 dmitry Exp $
+// $Id: client_round2_interop.php,v 1.17 2004/09/13 11:55:24 dmitry Exp $
//
require_once 'DB.php'; // PEAR/DB
require_once 'client_round2_params.php';
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index b211df9d9..fb544dcd4 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,12 +17,13 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.c,v 1.71.2.25 2005/08/24 11:45:57 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.103.2.11 2005/11/08 08:30:16 dmitry Exp $ */
#include <time.h>
#include "php_soap.h"
#include "ext/libxml/php_libxml.h"
+#include "ext/standard/base64.h"
#include <libxml/parserInternals.h>
#include "zend_strtod.h"
@@ -33,9 +34,10 @@ static zval *to_zval_bool(encodeTypePtr type, xmlNodePtr data);
static zval *to_zval_string(encodeTypePtr type, xmlNodePtr data);
static zval *to_zval_stringr(encodeTypePtr type, xmlNodePtr data);
static zval *to_zval_stringc(encodeTypePtr type, xmlNodePtr data);
-static zval *to_zval_stringb(encodeTypePtr type, xmlNodePtr data);
static zval *to_zval_map(encodeTypePtr type, xmlNodePtr data);
static zval *to_zval_null(encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_base64(encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_hexbin(encodeTypePtr type, xmlNodePtr data);
static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
@@ -43,7 +45,8 @@ static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNode
/* String encode */
static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
-static xmlNodePtr to_xml_stringl(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
/* Null encode */
static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
@@ -110,7 +113,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", "1"); \
+ xmlSetProp(xml, "xsi:nil", "true"); \
} \
return xml; \
} \
@@ -148,8 +151,8 @@ encode defaultEncoding[] = {
{{XSD_GMONTH, XSD_GMONTH_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gmonth},
{{XSD_DURATION, XSD_DURATION_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_duration},
- {{XSD_HEXBINARY, XSD_HEXBINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringb, to_xml_stringl},
- {{XSD_BASE64BINARY, XSD_BASE64BINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringb, to_xml_stringl},
+ {{XSD_HEXBINARY, XSD_HEXBINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_hexbin, to_xml_hexbin},
+ {{XSD_BASE64BINARY, XSD_BASE64BINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_base64, to_xml_base64},
{{XSD_LONG, XSD_LONG_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
{{XSD_INT, XSD_INT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
@@ -599,17 +602,22 @@ static zval *to_zval_stringc(encodeTypePtr type, xmlNodePtr data)
return ret;
}
-static zval *to_zval_stringb(encodeTypePtr type, xmlNodePtr data)
+static zval *to_zval_base64(encodeTypePtr type, xmlNodePtr data)
{
zval *ret;
+ char *str;
+ int str_len;
+
MAKE_STD_ZVAL(ret);
FIND_XML_NULL(data, ret);
if (data && data->children) {
if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
- whiteSpace_collapse(data->children->content);
- ZVAL_STRING(ret, data->children->content, 1);
+ whiteSpace_collapse((char*)data->children->content);
+ str = (char*)php_base64_decode(data->children->content, strlen((char*)data->children->content), &str_len);
+ ZVAL_STRINGL(ret, str, str_len, 0);
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
- ZVAL_STRING(ret, data->children->content, 1);
+ str = (char*)php_base64_decode(data->children->content, strlen((char*)data->children->content), &str_len);
+ ZVAL_STRINGL(ret, str, str_len, 0);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
@@ -619,6 +627,50 @@ static zval *to_zval_stringb(encodeTypePtr type, xmlNodePtr data)
return ret;
}
+static zval *to_zval_hexbin(encodeTypePtr type, xmlNodePtr data)
+{
+ zval *ret;
+ unsigned char *str;
+ int str_len, i, j;
+ unsigned char c;
+
+ MAKE_STD_ZVAL(ret);
+ FIND_XML_NULL(data, ret);
+ if (data && data->children) {
+ if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
+ whiteSpace_collapse((char*)data->children->content);
+ } else if (data->children->type != XML_CDATA_SECTION_NODE || data->children->next != NULL) {
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
+ return ret;
+ }
+ str_len = strlen((char*)data->children->content) / 2;
+ str = emalloc(str_len+1);
+ for (i = j = 0; i < str_len; i++) {
+ c = data->children->content[j++];
+ if (c >= '0' && c <= '9') {
+ str[i] = (c - '0') << 4;
+ } else if (c >= 'a' && c <= 'f') {
+ str[i] = (c - 'a' + 10) << 4;
+ } else if (c >= 'A' && c <= 'F') {
+ str[i] = (c - 'A' + 10) << 4;
+ }
+ c = data->children->content[j++];
+ if (c >= '0' && c <= '9') {
+ str[i] |= c - '0';
+ } else if (c >= 'a' && c <= 'f') {
+ str[i] |= c - 'a' + 10;
+ } else if (c >= 'A' && c <= 'F') {
+ str[i] |= c - 'A' + 10;
+ }
+ }
+ str[str_len] = '\0';
+ ZVAL_STRINGL(ret, (char*)str, str_len, 0);
+ } else {
+ ZVAL_EMPTY_STRING(ret);
+ }
+ return ret;
+}
+
static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
@@ -637,7 +689,7 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo
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 = php_escape_html_entities(Z_STRVAL(tmp), Z_STRLEN(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
zval_dtor(&tmp);
}
@@ -668,22 +720,66 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo
return ret;
}
-static xmlNodePtr to_xml_stringl(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
+static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
+ unsigned char *str;
+ int str_len;
ret = xmlNewNode(NULL,"BOGUS");
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
- if (Z_TYPE_P(data) == IS_STRING) {
- xmlNodeSetContentLen(ret, Z_STRVAL_P(data), Z_STRLEN_P(data));
+ if (Z_TYPE_P(data) == IS_STRING) {
+ str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRLEN_P(data), &str_len);
+ xmlNodeSetContentLen(ret, str, str_len);
+ efree(str);
} else {
zval tmp = *data;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
- xmlNodeSetContentLen(ret, Z_STRVAL(tmp), Z_STRLEN(tmp));
+ str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRLEN(tmp), &str_len);
+ xmlNodeSetContentLen(ret, str, str_len);
+ efree(str);
+ zval_dtor(&tmp);
+ }
+
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, type);
+ }
+ return ret;
+}
+
+static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
+{
+ static char hexconvtab[] = "0123456789ABCDEF";
+ xmlNodePtr ret;
+ unsigned char *str;
+ zval tmp;
+ int i, j;
+
+ ret = xmlNewNode(NULL,"BOGUS");
+ xmlAddChild(parent, ret);
+ FIND_ZVAL_NULL(data, ret, style);
+
+ if (Z_TYPE_P(data) != IS_STRING) {
+ tmp = *data;
+ zval_copy_ctor(&tmp);
+ convert_to_string(&tmp);
+ data = &tmp;
+ }
+ str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data) * 2, sizeof(char), 1);
+
+ for (i = j = 0; i < Z_STRLEN_P(data); i++) {
+ str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) >> 4];
+ str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) & 15];
+ }
+ str[j] = '\0';
+
+ xmlNodeSetContentLen(ret, str, Z_STRLEN_P(data) * 2 * sizeof(char));
+ efree(str);
+ if (data == &tmp) {
zval_dtor(&tmp);
}
@@ -866,7 +962,7 @@ static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNode
ret = xmlNewNode(NULL,"BOGUS");
xmlAddChild(parent, ret);
if (style == SOAP_ENCODED) {
- xmlSetProp(ret, "xsi:nil", "1");
+ xmlSetProp(ret, "xsi:nil", "true");
}
return ret;
}
@@ -895,10 +991,18 @@ static zval* get_zval_property(zval* object, char* name TSRMLS_DC)
old_scope = EG(scope);
EG(scope) = Z_OBJCE_P(object);
data = Z_OBJ_HT_P(object)->read_property(object, &member, BP_VAR_IS TSRMLS_CC);
- EG(scope) = old_scope;
if (data == EG(uninitialized_zval_ptr)) {
+ /* Hack for bug #32455 */
+ zend_property_info *property_info;
+
+ property_info = zend_get_property_info(Z_OBJCE_P(object), &member, 1 TSRMLS_CC);
+ EG(scope) = old_scope;
+ if (property_info && zend_hash_quick_exists(Z_OBJPROP_P(object), property_info->name, property_info->name_length+1, property_info->h)) {
+ return data;
+ }
return NULL;
}
+ EG(scope) = old_scope;
return data;
} else if (Z_TYPE_P(object) == IS_ARRAY) {
zval **data_ptr;
@@ -1119,6 +1223,10 @@ static zval *to_zval_object(encodeTypePtr type, xmlNodePtr data)
unset_zval_property(ret, "any" TSRMLS_CC);
redo_any = 1;
}
+ if (Z_TYPE_P(ret) == IS_OBJECT && ce != ZEND_STANDARD_CLASS_DEF_PTR) {
+ zend_object *zobj = zend_objects_get_address(ret TSRMLS_CC);
+ zobj->ce = ce;
+ }
} else {
zval *base;
@@ -1225,7 +1333,9 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
data = get_zval_property(object, model->u.element->name TSRMLS_CC);
if (data) {
enc = model->u.element->encode;
- if ((model->max_occurs == -1 || model->max_occurs > 1) && Z_TYPE_P(data) == IS_ARRAY) {
+ if ((model->max_occurs == -1 || model->max_occurs > 1) &&
+ Z_TYPE_P(data) == IS_ARRAY &&
+ !is_map(data)) {
HashTable *ht = Z_ARRVAL_P(data);
zval **val;
@@ -1235,10 +1345,10 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
property = xmlNewNode(NULL,"BOGUS");
xmlAddChild(node, property);
if (style == SOAP_ENCODED) {
- xmlSetProp(property, "xsi:nil", "1");
+ xmlSetProp(property, "xsi:nil", "true");
} else {
xmlNsPtr xsi = encode_add_ns(property,XSI_NAMESPACE);
- xmlSetNsProp(property, xsi, "nil", "1");
+ xmlSetNsProp(property, xsi, "nil", "true");
}
} else {
property = master_to_xml(enc, *val, style, node);
@@ -1248,7 +1358,9 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
}
}
xmlNodeSetName(property, model->u.element->name);
- if (style == SOAP_LITERAL && model->u.element->namens) {
+ if (style == SOAP_LITERAL &&
+ model->u.element->namens &&
+ model->u.element->form == XSD_FORM_QUALIFIED) {
xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens);
xmlSetNs(property, nsp);
}
@@ -1259,10 +1371,10 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
property = xmlNewNode(NULL,"BOGUS");
xmlAddChild(node, property);
if (style == SOAP_ENCODED) {
- xmlSetProp(property, "xsi:nil", "1");
+ xmlSetProp(property, "xsi:nil", "true");
} else {
xmlNsPtr xsi = encode_add_ns(property,XSI_NAMESPACE);
- xmlSetNsProp(property, xsi, "nil", "1");
+ xmlSetNsProp(property, xsi, "nil", "true");
}
} else {
property = master_to_xml(enc, data, style, node);
@@ -1280,14 +1392,20 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
}
}
return 1;
- } else if (strict && model->u.element->nillable) {
+ } else if (strict && model->u.element->nillable && model->min_occurs > 0) {
property = xmlNewNode(NULL,model->u.element->name);
xmlAddChild(node, property);
if (style == SOAP_ENCODED) {
- xmlSetProp(property, "xsi:nil", "1");
+ xmlSetProp(property, "xsi:nil", "true");
} else {
xmlNsPtr xsi = encode_add_ns(property,XSI_NAMESPACE);
- xmlSetNsProp(property, xsi, "nil", "1");
+ xmlSetNsProp(property, xsi, "nil", "true");
+ }
+ if (style == SOAP_LITERAL &&
+ model->u.element->namens &&
+ model->u.element->form == XSD_FORM_QUALIFIED) {
+ xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens);
+ xmlSetNs(property, nsp);
}
return 1;
} else if (model->min_occurs == 0) {
@@ -1308,7 +1426,9 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
data = get_zval_property(object, "any" TSRMLS_CC);
if (data) {
enc = get_conversion(XSD_ANYXML);
- if ((model->max_occurs == -1 || model->max_occurs > 1) && Z_TYPE_P(data) == IS_ARRAY) {
+ if ((model->max_occurs == -1 || model->max_occurs > 1) &&
+ Z_TYPE_P(data) == IS_ARRAY &&
+ !is_map(data)) {
HashTable *ht = Z_ARRVAL_P(data);
zval **val;
@@ -1415,7 +1535,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
xmlParam = xmlNewNode(NULL,"BOGUS");
xmlAddChild(parent, xmlParam);
if (style == SOAP_ENCODED) {
- xmlSetProp(xmlParam, "xsi:nil", "1");
+ xmlSetProp(xmlParam, "xsi:nil", "true");
}
return xmlParam;
}
@@ -1494,16 +1614,18 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
property = xmlNewNode(NULL,"BOGUS");
xmlAddChild(xmlParam, property);
if (style == SOAP_ENCODED) {
- xmlSetProp(property, "xsi:nil", "1");
+ xmlSetProp(property, "xsi:nil", "true");
} else {
xmlNsPtr xsi = encode_add_ns(property,XSI_NAMESPACE);
- xmlSetNsProp(property, xsi, "nil", "1");
+ xmlSetNsProp(property, xsi, "nil", "true");
}
} else {
property = master_to_xml(array_el->encode, *val, style, xmlParam);
}
xmlNodeSetName(property, array_el->name);
- if (style == SOAP_LITERAL && array_el->namens) {
+ if (style == SOAP_LITERAL &&
+ array_el->namens &&
+ array_el->form == XSD_FORM_QUALIFIED) {
xmlNsPtr nsp = encode_add_ns(property, array_el->namens);
xmlSetNs(property, nsp);
}
@@ -1573,9 +1695,9 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
zval **zprop;
char *str_key;
ulong index;
- int key_type;
+ int key_type, str_key_len;
- key_type = zend_hash_get_current_key(prop, &str_key, &index, FALSE);
+ 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);
property = master_to_xml(get_conversion((*zprop)->type), (*zprop), style, xmlParam);
@@ -1586,7 +1708,7 @@ 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(str_key, &class_name, &prop_name);
+ zend_unmangle_property_name_ex(str_key, str_key_len, &class_name, &prop_name);
} else {
prop_name = str_key;
}
@@ -2642,15 +2764,16 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP
if (Z_TYPE_P(data) == IS_STRING) {
ret = xmlNewTextLen(Z_STRVAL_P(data), Z_STRLEN_P(data));
+ ret->name = xmlStringTextNoenc;
} else {
zval tmp = *data;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
- ret = xmlNewTextLen(Z_STRVAL_P(data), Z_STRLEN_P(data));
+ ret = xmlNewTextLen(Z_STRVAL(tmp), Z_STRLEN(tmp));
zval_dtor(&tmp);
+ ret->name = xmlStringTextNoenc;
}
- ret->name = xmlStringTextNoenc;
xmlAddChild(parent, ret);
return ret;
diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h
index 3625124eb..3a7d05ba2 100644
--- a/ext/soap/php_encoding.h
+++ b/ext/soap/php_encoding.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.h,v 1.35.2.3 2005/04/15 06:53:04 gschlossnagle Exp $ */
+/* $Id: php_encoding.h,v 1.38 2005/08/03 14:07:47 sniper Exp $ */
#ifndef PHP_ENCODING_H
#define PHP_ENCODING_H
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index e31abd622..cf16a0615 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_http.c,v 1.55.2.19 2005/07/08 09:36:42 dmitry Exp $ */
+/* $Id: php_http.c,v 1.77.2.3 2005/10/12 14:04:02 tony2001 Exp $ */
#include "php_soap.h"
#include "ext/standard/base64.h"
@@ -110,11 +110,9 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, in
php_stream *stream;
zval **proxy_host, **proxy_port, **tmp;
char *host;
-#ifdef ZEND_ENGINE_2
php_stream_context *context = NULL;
char *name;
long namelen;
-#endif
int port;
int old_error_reporting;
struct timeval tv;
@@ -141,21 +139,13 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, in
old_error_reporting = EG(error_reporting);
EG(error_reporting) &= ~(E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
-#ifdef ZEND_ENGINE_2
- namelen = spprintf(&name, 0, "%s://%s:%d", (use_ssl && !*use_proxy)? "ssl" : "tcp", host, port);
- if (use_ssl) {
- zval **tmp;
-
- if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_local_cert", sizeof("_local_cert"), (void **) &tmp) == SUCCESS &&
- Z_TYPE_PP(tmp) == IS_STRING) {
- context = php_stream_context_alloc();
- php_stream_context_set_option(context, "ssl", "local_cert", *tmp);
- if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_passphrase", sizeof("_passphrase"), (void **) &tmp) == SUCCESS &&
- Z_TYPE_PP(tmp) == IS_STRING) {
- php_stream_context_set_option(context, "ssl", "passphrase", *tmp);
- }
- }
+ if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr),
+ "_stream_context", sizeof("_stream_context"), (void**)&tmp)) {
+ context = php_stream_context_from_zval(*tmp, 0);
}
+
+ namelen = spprintf(&name, 0, "%s://%s:%d", (use_ssl && !*use_proxy)? "ssl" : "tcp", host, port);
+
stream = php_stream_xport_create(name, namelen,
ENFORCE_SAFE_MODE | REPORT_ERRORS,
STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT,
@@ -164,9 +154,6 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, in
context,
NULL, NULL);
efree(name);
-#else
- stream = php_stream_sock_open_host(host, port, SOCK_STREAM, timeout, NULL);
-#endif
/* SSL & proxy */
if (stream && *use_proxy && use_ssl) {
@@ -194,7 +181,6 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, in
}
efree(http_headers);
}
-#ifdef ZEND_ENGINE_2
/* enable SSL transport layer */
if (stream) {
if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
@@ -203,18 +189,8 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, in
stream = NULL;
}
}
-#endif
}
-#if !defined(ZEND_ENGINE_2) && defined(HAVE_OPENSSL_EXT)
- if (stream && use_ssl) {
- /* enable SSL transport layer */
- if (FAILURE == php_stream_sock_ssl_activate(stream, 1)) {
- php_stream_close(stream);
- stream = NULL;
- }
- }
-#endif
EG(error_reporting) = old_error_reporting;
return stream;
}
@@ -258,6 +234,7 @@ int make_http_soap_request(zval *this_ptr,
int http_status;
int content_type_xml = 0;
char *content_encoding;
+ zend_bool old_allow_url_fopen;
if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
return FALSE;
@@ -339,23 +316,16 @@ try_again:
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL TSRMLS_CC);
return FALSE;
}
-#ifdef ZEND_ENGINE_2
+
+ old_allow_url_fopen = PG(allow_url_fopen);
+ PG(allow_url_fopen) = 1;
if (use_ssl && php_stream_locate_url_wrapper("https://", NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) == NULL) {
php_url_free(phpurl);
if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "SSL support not available in this build", NULL, NULL TSRMLS_CC);
- return FALSE;
- }
-#else
-#ifndef HAVE_OPENSSL_EXT
- if (use_ssl) {
- php_url_free(phpurl);
- if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "SSL support not available in this build", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL TSRMLS_CC);
+ PG(allow_url_fopen) = old_allow_url_fopen;
return FALSE;
}
-#endif
-#endif
if (phpurl->port == 0) {
phpurl->port = use_ssl ? 443 : 80;
@@ -402,9 +372,11 @@ try_again:
php_url_free(phpurl);
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL TSRMLS_CC);
+ PG(allow_url_fopen) = old_allow_url_fopen;
return FALSE;
}
}
+ PG(allow_url_fopen) = old_allow_url_fopen;
if (stream) {
zval **cookies, **login, **password;
@@ -428,6 +400,10 @@ try_again:
smart_str_appendc(&soap_headers, '?');
smart_str_appends(&soap_headers, phpurl->query);
}
+ if (phpurl->fragment) {
+ smart_str_appendc(&soap_headers, '#');
+ smart_str_appends(&soap_headers, phpurl->fragment);
+ }
smart_str_append_const(&soap_headers, " HTTP/1.1\r\n"
"Host: ");
smart_str_appends(&soap_headers, phpurl->host);
@@ -584,6 +560,10 @@ try_again:
smart_str_appendc(&soap_headers, '?');
smart_str_appends(&soap_headers, phpurl->query);
}
+ if (phpurl->fragment) {
+ smart_str_appendc(&soap_headers, '#');
+ smart_str_appends(&soap_headers, phpurl->fragment);
+ }
if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
/* TODO: Support for qop="auth-int" */
@@ -687,6 +667,9 @@ try_again:
}
smart_str_free(&soap_headers);
+ } else {
+ add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL TSRMLS_CC);
+ return FALSE;
}
do {
@@ -853,6 +836,7 @@ try_again:
php_stream_close(stream);
zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"));
+ stream = NULL;
}
/* Process HTTP status codes */
@@ -861,17 +845,8 @@ try_again:
if ((loc = get_http_header_value(http_headers,"Location: ")) != NULL) {
php_url *new_url = php_url_parse(loc);
- char *body;
- int body_size;
if (new_url != NULL) {
- if (get_http_body(stream, !http_1_1, http_headers, &body, &body_size TSRMLS_CC)) {
- efree(body);
- } else {
- php_stream_close(stream);
- zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
- stream = NULL;
- }
efree(http_headers);
efree(http_body);
efree(loc);
@@ -951,9 +926,7 @@ try_again:
if (digest != NULL) {
php_url *new_url = emalloc(sizeof(php_url));
-#ifdef ZEND_ENGINE_2
digest->refcount--;
-#endif
add_property_zval_ex(this_ptr, "_digest", sizeof("_digest"), digest TSRMLS_CC);
*new_url = *phpurl;
diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h
index c45ea7a65..773f64de0 100644
--- a/ext/soap/php_http.h
+++ b/ext/soap/php_http.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_http.h,v 1.14.2.1 2005/07/08 09:36:42 dmitry Exp $ */
+/* $Id: php_http.h,v 1.16 2005/08/03 14:07:47 sniper Exp $ */
#ifndef PHP_HTTP_H
#define PHP_HTTP_H
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index 3c4ba0cbc..af48a6527 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_packet_soap.c,v 1.36.2.5 2005/04/20 10:58:37 dmitry Exp $ */
+/* $Id: php_packet_soap.c,v 1.42 2005/08/03 14:07:47 sniper Exp $ */
#include "php_soap.h"
diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h
index 584e19bf7..b32736df7 100644
--- a/ext/soap/php_packet_soap.h
+++ b/ext/soap/php_packet_soap.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_packet_soap.h,v 1.9 2004/02/03 16:44:56 dmitry Exp $ */
+/* $Id: php_packet_soap.h,v 1.10 2005/08/03 14:07:47 sniper Exp $ */
#ifndef PHP_PACKET_SOAP_H
#define PHP_PACKET_SOAP_H
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c
index 1621a5713..fe58a28bb 100644
--- a/ext/soap/php_schema.c
+++ b/ext/soap/php_schema.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_schema.c,v 1.49.2.6 2005/06/01 14:42:50 dmitry Exp $ */
+/* $Id: php_schema.c,v 1.58.2.2 2005/11/08 08:30:17 dmitry Exp $ */
#include "php_soap.h"
#include "libxml/uri.h"
@@ -95,14 +95,14 @@ static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char
return enc;
}
-static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import) {
+static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import TSRMLS_DC) {
if (location != NULL &&
!zend_hash_exists(&ctx->docs, location, strlen(location)+1)) {
xmlDocPtr doc;
xmlNodePtr schema;
xmlAttrPtr new_tns;
- doc = soap_xmlParseFile(location);
+ doc = soap_xmlParseFile(location TSRMLS_CC);
if (doc == NULL) {
soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location);
}
@@ -133,7 +133,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA
}
}
zend_hash_add(&ctx->docs, location, strlen(location)+1, (void**)&doc, sizeof(xmlDocPtr), NULL);
- load_schema(ctx, schema);
+ load_schema(ctx, schema TSRMLS_CC);
}
}
@@ -157,7 +157,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA
Content: ((include | import | redefine | annotation)*, (((simpleType | complexType | group | attributeGroup) | element | attribute | notation), annotation*)*)
</schema>
*/
-int load_schema(sdlCtx *ctx,xmlNodePtr schema)
+int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
{
xmlNodePtr trav;
xmlAttrPtr tns;
@@ -199,7 +199,7 @@ int load_schema(sdlCtx *ctx,xmlNodePtr schema)
uri = xmlBuildURI(location->children->content, base);
xmlFree(base);
}
- schema_load_file(ctx,NULL,uri,tns,0);
+ schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC);
xmlFree(uri);
}
@@ -219,7 +219,7 @@ int load_schema(sdlCtx *ctx,xmlNodePtr schema)
uri = xmlBuildURI(location->children->content, base);
xmlFree(base);
}
- schema_load_file(ctx,NULL,uri,tns,0);
+ schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC);
xmlFree(uri);
/* TODO: <redefine> support */
}
@@ -244,7 +244,7 @@ int load_schema(sdlCtx *ctx,xmlNodePtr schema)
xmlFree(base);
}
}
- schema_load_file(ctx,ns,uri,tns,1);
+ schema_load_file(ctx, ns, uri, tns, 1 TSRMLS_CC);
if (uri != NULL) {xmlFree(uri);}
} else if (node_is_equal(trav,"annotation")) {
/* TODO: <annotation> support */
@@ -534,10 +534,6 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp
if (node_is_equal(trav,"simpleType")) {
sdlTypePtr newType, *tmp;
- if (memberTypes != NULL) {
- soap_error0(E_ERROR, "Parsing Schema: union has both 'memberTypes' attribute and subtypes");
- }
-
newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
@@ -2196,9 +2192,25 @@ static void schema_content_model_fixup(sdlCtx *ctx, sdlContentModelPtr model)
}
break;
}
- case XSD_CONTENT_SEQUENCE:
- case XSD_CONTENT_ALL:
case XSD_CONTENT_CHOICE: {
+ if (model->max_occurs != 1) {
+ HashPosition pos;
+ sdlContentModelPtr *tmp;
+
+ zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
+ while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) {
+ (*tmp)->min_occurs = 0;
+ (*tmp)->max_occurs = model->max_occurs;
+ zend_hash_move_forward_ex(model->u.content, &pos);
+ }
+
+ model->kind = XSD_CONTENT_ALL;
+ model->min_occurs = 1;
+ model->max_occurs = 1;
+ }
+ }
+ case XSD_CONTENT_SEQUENCE:
+ case XSD_CONTENT_ALL: {
sdlContentModelPtr *tmp;
zend_hash_internal_pointer_reset(model->u.content);
diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h
index 97bf71a2f..9707cf9a0 100644
--- a/ext/soap/php_schema.h
+++ b/ext/soap/php_schema.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,12 +17,12 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_schema.h,v 1.11 2004/02/10 13:41:21 dmitry Exp $ */
+/* $Id: php_schema.h,v 1.13 2005/08/03 14:07:48 sniper Exp $ */
#ifndef PHP_SCHEMA_H
#define PHP_SCHEMA_H
-int load_schema(sdlCtx *ctx, xmlNodePtr schema);
+int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC);
void schema_pass2(sdlCtx *ctx);
void delete_model(void *handle);
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index b4beca04b..cfa1a6df3 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_sdl.c,v 1.70.2.12 2005/07/08 09:36:42 dmitry Exp $ */
+/* $Id: php_sdl.c,v 1.88.2.2 2005/11/18 11:00:15 dmitry Exp $ */
#include "php_soap.h"
#include "ext/libxml/php_libxml.h"
@@ -117,24 +117,40 @@ encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type)
nscat[len] = '\0';
enc = get_encoder_ex(sdl, nscat, len);
- efree(nscat);
if (enc == NULL &&
((ns_len == sizeof(SOAP_1_1_ENC_NAMESPACE)-1 &&
memcmp(ns, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)-1) == 0) ||
(ns_len == sizeof(SOAP_1_2_ENC_NAMESPACE)-1 &&
memcmp(ns, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)-1) == 0))) {
- ns_len = sizeof(XSD_NAMESPACE)-1;
- len = ns_len + type_len + 1;
- nscat = emalloc(len + 1);
- memcpy(nscat, XSD_NAMESPACE, sizeof(XSD_NAMESPACE)-1);
- nscat[ns_len] = ':';
- memcpy(nscat+ns_len+1, type, type_len);
- nscat[len] = '\0';
-
- enc = get_encoder_ex(sdl, nscat, len);
- efree(nscat);
+ char *enc_nscat;
+ int enc_ns_len;
+ int enc_len;
+
+ enc_ns_len = sizeof(XSD_NAMESPACE)-1;
+ enc_len = enc_ns_len + type_len + 1;
+ enc_nscat = emalloc(enc_len + 1);
+ memcpy(enc_nscat, XSD_NAMESPACE, sizeof(XSD_NAMESPACE)-1);
+ enc_nscat[enc_ns_len] = ':';
+ memcpy(enc_nscat+enc_ns_len+1, type, type_len);
+ enc_nscat[enc_len] = '\0';
+
+ enc = get_encoder_ex(NULL, enc_nscat, enc_len);
+ efree(enc_nscat);
+ if (enc && sdl) {
+ encodePtr new_enc = emalloc(sizeof(encode));
+ memcpy(new_enc, enc, sizeof(encode));
+ new_enc->details.ns = estrndup(ns, ns_len);
+ new_enc->details.type_str = estrdup(new_enc->details.type_str);
+ if (sdl->encoders == NULL) {
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
+ }
+ zend_hash_update(sdl->encoders, nscat, len + 1, &new_enc, sizeof(encodePtr), NULL);
+ enc = new_enc;
+ }
}
+ efree(nscat);
return enc;
}
@@ -211,7 +227,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
return;
}
- wsdl = soap_xmlParseFile(struri);
+ wsdl = soap_xmlParseFile(struri TSRMLS_CC);
if (!wsdl) {
soap_error1(E_ERROR, "Parsing WSDL: Couldn't load from '%s'", struri);
@@ -225,7 +241,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
if (include) {
xmlNodePtr schema = get_node_ex(root, "schema", XSD_NAMESPACE);
if (schema) {
- load_schema(ctx, schema);
+ load_schema(ctx, schema TSRMLS_CC);
return;
}
}
@@ -251,7 +267,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
while (trav2 != NULL) {
if (node_is_equal_ex(trav2, "schema", XSD_NAMESPACE)) {
- load_schema(ctx, trav2);
+ load_schema(ctx, trav2 TSRMLS_CC);
} else if (is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) {
soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name);
}
@@ -2214,9 +2230,14 @@ sdlPtr get_sdl(zval *this_ptr, char *uri TSRMLS_DC)
char* old_error_code = SOAP_GLOBAL(error_code);
int uri_len;
php_stream_context *context=NULL;
- zval **proxy_host, **proxy_port, *orig_context, *new_context;
+ zval **tmp, **proxy_host, **proxy_port, *orig_context, *new_context;
smart_str headers = {0};
+ if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr),
+ "_stream_context", sizeof("_stream_context"), (void**)&tmp)) {
+ context = php_stream_context_from_zval(*tmp, 0);
+ }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
Z_TYPE_PP(proxy_host) == IS_STRING &&
zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", sizeof("_proxy_port"), (void **) &proxy_port) == SUCCESS &&
@@ -2230,15 +2251,23 @@ sdlPtr get_sdl(zval *this_ptr, char *uri TSRMLS_DC)
smart_str_appends(&proxy,Z_STRVAL_PP(proxy_host));
smart_str_appends(&proxy,":");
smart_str_appends(&proxy,Z_STRVAL(str_port));
+ smart_str_0(&proxy);
zval_dtor(&str_port);
MAKE_STD_ZVAL(str_proxy);
ZVAL_STRING(str_proxy, proxy.c, 1);
smart_str_free(&proxy);
- context = php_stream_context_alloc();
+ if (!context) {
+ context = php_stream_context_alloc();
+ }
php_stream_context_set_option(context, "http", "proxy", str_proxy);
zval_ptr_dtor(&str_proxy);
+ MAKE_STD_ZVAL(str_proxy);
+ ZVAL_BOOL(str_proxy, 1);
+ php_stream_context_set_option(context, "http", "request_fulluri", str_proxy);
+ zval_ptr_dtor(&str_proxy);
+
proxy_authentication(this_ptr, &headers TSRMLS_CC);
}
diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h
index 9bd8e3a37..7fbce10a9 100644
--- a/ext/soap/php_sdl.h
+++ b/ext/soap/php_sdl.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_sdl.h,v 1.31.2.5 2005/04/20 08:31:10 dmitry Exp $ */
+/* $Id: php_sdl.h,v 1.37 2005/08/03 14:07:48 sniper Exp $ */
#ifndef PHP_SDL_H
#define PHP_SDL_H
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index d03e77a14..5a09ce39c 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_soap.h,v 1.33.2.3 2005/02/02 10:34:21 dmitry Exp $ */
+/* $Id: php_soap.h,v 1.38 2005/08/03 14:07:48 sniper Exp $ */
#ifndef PHP_SOAP_H
#define PHP_SOAP_H
@@ -26,7 +26,9 @@
#include "php_globals.h"
#include "ext/standard/info.h"
#include "ext/standard/php_standard.h"
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
#include "ext/session/php_session.h"
+#endif
#include "ext/standard/php_smart_str.h"
#include "php_ini.h"
#include "SAPI.h"
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
index 35dc825cb..944610fbe 100644
--- a/ext/soap/php_xml.c
+++ b/ext/soap/php_xml.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_xml.c,v 1.22 2004/02/13 15:19:09 dmitry Exp $ */
+/* $Id: php_xml.c,v 1.25 2005/08/03 14:07:48 sniper Exp $ */
#include "php_soap.h"
#include "libxml/parser.h"
@@ -76,15 +76,20 @@ static void soap_Comment(void *ctx, const xmlChar *value)
{
}
-xmlDocPtr soap_xmlParseFile(const char *filename)
+xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
{
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
+ zend_bool old_allow_url_fopen;
/*
xmlInitParser();
*/
+
+ old_allow_url_fopen = PG(allow_url_fopen);
+ PG(allow_url_fopen) = 1;
ctxt = xmlCreateFileParserCtxt(filename);
+ PG(allow_url_fopen) = old_allow_url_fopen;
if (ctxt) {
ctxt->keepBlanks = 0;
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;
diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h
index e7ca12066..8e234fdc3 100644
--- a/ext/soap/php_xml.h
+++ b/ext/soap/php_xml.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_xml.h,v 1.15 2004/02/06 08:01:35 dmitry Exp $ */
+/* $Id: php_xml.h,v 1.17 2005/08/03 14:07:48 sniper Exp $ */
#ifndef PHP_SOAP_XML_H
#define PHP_SOAP_XML_H
@@ -30,7 +30,7 @@
#define node_is_equal(node, name) node_is_equal_ex(node, name, NULL)
#define attr_is_equal(node, name) attr_is_equal_ex(node, name, NULL)
-xmlDocPtr soap_xmlParseFile(const char *filename);
+xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC);
xmlDocPtr soap_xmlParseMemory(const void *buf, size_t size);
xmlNsPtr attr_find_ns(xmlAttrPtr node);
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 403bebce8..75061d7f5 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: soap.c,v 1.110.2.42 2005/08/17 17:04:37 sniper Exp $ */
+/* $Id: soap.c,v 1.156.2.8 2005/11/07 10:05:35 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -110,7 +110,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
EG(current_execute_data) = _old_current_execute_data; \
if (EG(exception) == NULL || \
Z_TYPE_P(EG(exception)) != IS_OBJECT || \
- Z_OBJCE_P(EG(exception)) != soap_fault_class_entry) {\
+ !instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {\
_bailout = 1;\
}\
} zend_end_try();\
@@ -403,14 +403,16 @@ STD_PHP_INI_ENTRY("soap.wsdl_cache_ttl", "86400", PHP_INI_ALL, OnUpdateI
#endif
PHP_INI_END()
-static void php_soap_init_globals(zend_soap_globals *soap_globals)
+static HashTable defEnc, defEncIndex, defEncNs;
+
+static void php_soap_prepare_globals()
{
int i;
encodePtr enc;
- zend_hash_init(&soap_globals->defEnc, 0, NULL, NULL, 1);
- zend_hash_init(&soap_globals->defEncIndex, 0, NULL, NULL, 1);
- zend_hash_init(&soap_globals->defEncNs, 0, NULL, NULL, 1);
+ zend_hash_init(&defEnc, 0, NULL, NULL, 1);
+ zend_hash_init(&defEncIndex, 0, NULL, NULL, 1);
+ zend_hash_init(&defEncNs, 0, NULL, NULL, 1);
i = 0;
do {
@@ -422,27 +424,33 @@ static void php_soap_init_globals(zend_soap_globals *soap_globals)
char *ns_type;
ns_type = emalloc(strlen(defaultEncoding[i].details.ns) + strlen(defaultEncoding[i].details.type_str) + 2);
sprintf(ns_type, "%s:%s", defaultEncoding[i].details.ns, defaultEncoding[i].details.type_str);
- zend_hash_add(&soap_globals->defEnc, ns_type, strlen(ns_type) + 1, &enc, sizeof(encodePtr), NULL);
+ zend_hash_add(&defEnc, ns_type, strlen(ns_type) + 1, &enc, sizeof(encodePtr), NULL);
efree(ns_type);
} else {
- zend_hash_add(&soap_globals->defEnc, defaultEncoding[i].details.type_str, strlen(defaultEncoding[i].details.type_str) + 1, &enc, sizeof(encodePtr), NULL);
+ zend_hash_add(&defEnc, defaultEncoding[i].details.type_str, strlen(defaultEncoding[i].details.type_str) + 1, &enc, sizeof(encodePtr), NULL);
}
}
/* Index everything by number */
- if (!zend_hash_index_exists(&soap_globals->defEncIndex, defaultEncoding[i].details.type)) {
- zend_hash_index_update(&soap_globals->defEncIndex, defaultEncoding[i].details.type, &enc, sizeof(encodePtr), NULL);
+ if (!zend_hash_index_exists(&defEncIndex, defaultEncoding[i].details.type)) {
+ zend_hash_index_update(&defEncIndex, defaultEncoding[i].details.type, &enc, sizeof(encodePtr), NULL);
}
i++;
} while (defaultEncoding[i].details.type != END_KNOWN_TYPES);
/* hash by namespace */
- zend_hash_add(&soap_globals->defEncNs, XSD_1999_NAMESPACE, sizeof(XSD_1999_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
- zend_hash_add(&soap_globals->defEncNs, XSD_NAMESPACE, sizeof(XSD_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
- zend_hash_add(&soap_globals->defEncNs, XSI_NAMESPACE, sizeof(XSI_NAMESPACE), XSI_NS_PREFIX, sizeof(XSI_NS_PREFIX), NULL);
- zend_hash_add(&soap_globals->defEncNs, XML_NAMESPACE, sizeof(XML_NAMESPACE), XML_NS_PREFIX, sizeof(XML_NS_PREFIX), NULL);
- zend_hash_add(&soap_globals->defEncNs, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE), SOAP_1_1_ENC_NS_PREFIX, sizeof(SOAP_1_1_ENC_NS_PREFIX), NULL);
- zend_hash_add(&soap_globals->defEncNs, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE), SOAP_1_2_ENC_NS_PREFIX, sizeof(SOAP_1_2_ENC_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, XSD_1999_NAMESPACE, sizeof(XSD_1999_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, XSD_NAMESPACE, sizeof(XSD_NAMESPACE), XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, XSI_NAMESPACE, sizeof(XSI_NAMESPACE), XSI_NS_PREFIX, sizeof(XSI_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, XML_NAMESPACE, sizeof(XML_NAMESPACE), XML_NS_PREFIX, sizeof(XML_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE), SOAP_1_1_ENC_NS_PREFIX, sizeof(SOAP_1_1_ENC_NS_PREFIX), NULL);
+ zend_hash_add(&defEncNs, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE), SOAP_1_2_ENC_NS_PREFIX, sizeof(SOAP_1_2_ENC_NS_PREFIX), NULL);
+}
+static void php_soap_init_globals(zend_soap_globals *soap_globals TSRMLS_DC)
+{
+ soap_globals->defEnc = defEnc;
+ soap_globals->defEncIndex = defEncIndex;
+ soap_globals->defEncNs = defEncNs;
soap_globals->overrides = NULL;
soap_globals->use_soap_error_handler = 0;
soap_globals->error_code = NULL;
@@ -479,6 +487,7 @@ PHP_MINIT_FUNCTION(soap)
zend_class_entry ce;
/* TODO: add ini entry for always use soap errors */
+ php_soap_prepare_globals();
ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL);
REGISTER_INI_ENTRIES();
@@ -614,6 +623,7 @@ PHP_MINIT_FUNCTION(soap)
REGISTER_LONG_CONSTANT("XSD_POSITIVEINTEGER", XSD_POSITIVEINTEGER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("XSD_NMTOKENS", XSD_NMTOKENS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("XSD_ANYTYPE", XSD_ANYTYPE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XSD_ANYXML", XSD_ANYXML, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SOAP_ENC_OBJECT", SOAP_ENC_OBJECT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SOAP_ENC_ARRAY", SOAP_ENC_ARRAY, CONST_CS | CONST_PERSISTENT);
@@ -971,7 +981,6 @@ PHP_METHOD(SoapServer, SoapServer)
ret = zend_list_insert(service, le_service);
add_property_resource(this_ptr, "service", ret);
- zend_list_addref(ret);
SOAP_SERVER_END_CODE();
}
@@ -1539,7 +1548,7 @@ PHP_METHOD(SoapServer, handle)
}
if (EG(exception)) {
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
- Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) {
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
} else {
zval_dtor(&constructor);
@@ -1572,7 +1581,7 @@ PHP_METHOD(SoapServer, handle)
#ifdef ZEND_ENGINE_2
if (EG(exception)) {
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
- Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) {
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
} else {
zval_dtor(&constructor);
@@ -1642,7 +1651,7 @@ PHP_METHOD(SoapServer, handle)
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Function '%s' call failed", Z_STRVAL(h->function_name));
}
if (Z_TYPE(h->retval) == IS_OBJECT &&
- Z_OBJCE(h->retval) == soap_fault_class_entry) {
+ instanceof_function(Z_OBJCE(h->retval), soap_fault_class_entry TSRMLS_CC)) {
zval *headerfault = NULL, **tmp;
if (zend_hash_find(Z_OBJPROP(h->retval), "headerfault", sizeof("headerfault"), (void**)&tmp) == SUCCESS &&
@@ -1653,7 +1662,7 @@ PHP_METHOD(SoapServer, handle)
#ifdef ZEND_ENGINE_2
} else if (EG(exception)) {
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
- Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) {
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
zval *headerfault = NULL, **tmp;
if (zend_hash_find(Z_OBJPROP_P(EG(exception)), "headerfault", sizeof("headerfault"), (void**)&tmp) == SUCCESS &&
@@ -1700,7 +1709,7 @@ PHP_METHOD(SoapServer, handle)
#ifdef ZEND_ENGINE_2
if (EG(exception)) {
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
- Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) {
+ instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
} else {
if (soap_obj) {zval_ptr_dtor(&soap_obj);}
@@ -1713,7 +1722,7 @@ PHP_METHOD(SoapServer, handle)
char *response_name;
if (Z_TYPE(retval) == IS_OBJECT &&
- Z_OBJCE(retval) == soap_fault_class_entry) {
+ instanceof_function(Z_OBJCE(retval), soap_fault_class_entry TSRMLS_CC)) {
soap_server_fault_ex(function, &retval, NULL TSRMLS_CC);
}
@@ -2016,7 +2025,7 @@ PHP_FUNCTION(is_soap_fault)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &fault) == SUCCESS &&
Z_TYPE_P(fault) == IS_OBJECT &&
- Z_OBJCE_P(fault) == soap_fault_class_entry) {
+ instanceof_function(Z_OBJCE_P(fault), soap_fault_class_entry TSRMLS_CC)) {
RETURN_TRUE;
}
RETURN_FALSE
@@ -2032,6 +2041,7 @@ PHP_METHOD(SoapClient, SoapClient)
zval *wsdl;
zval *options = NULL;
int soap_version = SOAP_1_1;
+ php_stream_context *context = NULL;
SOAP_CLIENT_BEGIN_CODE();
@@ -2074,6 +2084,11 @@ PHP_METHOD(SoapClient, SoapClient)
}
}
+ if (zend_hash_find(ht, "stream_context", sizeof("stream_context"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_RESOURCE) {
+ context = php_stream_context_from_zval(*tmp, 1);
+ }
+
if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
add_property_stringl(this_ptr, "location", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
@@ -2119,10 +2134,13 @@ PHP_METHOD(SoapClient, SoapClient)
}
if (zend_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
- add_property_stringl(this_ptr, "_local_cert", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ if (!context) {
+ context = php_stream_context_alloc();
+ }
+ php_stream_context_set_option(context, "ssl", "local_cert", *tmp);
if (zend_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
- add_property_stringl(this_ptr, "_passphrase", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
+ php_stream_context_set_option(context, "ssl", "passphrase", *tmp);
}
}
if (zend_hash_find(ht, "trace", sizeof("trace"), (void**)&tmp) == SUCCESS &&
@@ -2175,6 +2193,11 @@ PHP_METHOD(SoapClient, SoapClient)
Z_TYPE_PP(tmp) == IS_LONG && Z_LVAL_PP(tmp) > 0) {
add_property_long(this_ptr, "_connection_timeout", Z_LVAL_PP(tmp));
}
+
+ if (context) {
+ add_property_resource(this_ptr, "_stream_context", context->rsrc_id);
+ }
+
} else if (wsdl == NULL) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' and 'uri' options are requred in nonWSDL mode");
return;
@@ -2193,7 +2216,6 @@ PHP_METHOD(SoapClient, SoapClient)
ret = zend_list_insert(sdl, le_sdl);
add_property_resource(this_ptr, "sdl", ret);
- zend_list_addref(ret);
SOAP_GLOBAL(soap_version) = old_soap_version;
}
@@ -2424,7 +2446,7 @@ static void do_soap_call(zval* this_ptr,
}
#ifdef ZEND_ENGINE_2
if (Z_TYPE_P(return_value) == IS_OBJECT &&
- Z_OBJCE_P(return_value) == soap_fault_class_entry &&
+ instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry TSRMLS_CC) &&
(zend_hash_find(Z_OBJPROP_P(this_ptr), "_exceptions", sizeof("_exceptions"), (void **) &tmp) != SUCCESS ||
Z_TYPE_PP(tmp) != IS_BOOL || Z_LVAL_PP(tmp) != 0)) {
zval *exception;
@@ -3421,7 +3443,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
xmlDocSetRootElement(doc, envelope);
if (Z_TYPE_P(ret) == IS_OBJECT &&
- Z_OBJCE_P(ret) == soap_fault_class_entry) {
+ instanceof_function(Z_OBJCE_P(ret), soap_fault_class_entry TSRMLS_CC)) {
char *detail_name;
HashTable* prop;
zval **tmp;
@@ -4003,9 +4025,21 @@ static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName,
{
xmlNodePtr xmlParam;
encodePtr enc;
+ zval defval;
if (param != NULL) {
enc = param->encode;
+ if (val == NULL) {
+ if (param->element) {
+ if (param->element->fixed) {
+ ZVAL_STRING(&defval, param->element->fixed, 0);
+ val = &defval;
+ } else if (param->element->def && !param->element->nillable) {
+ ZVAL_STRING(&defval, param->element->def, 0);
+ val = &defval;
+ }
+ }
+ }
} else {
enc = NULL;
}
diff --git a/ext/soap/tests/any.phpt b/ext/soap/tests/any.phpt
new file mode 100755
index 000000000..054319fe3
--- /dev/null
+++ b/ext/soap/tests/any.phpt
@@ -0,0 +1,83 @@
+--TEST--
+SOAP handling of <any>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+
+function echoAnyElement($x) {
+ global $g;
+
+ $g = $x;
+ $struct = $x->inputAny->any;
+ if ($struct instanceof SOAPComplexType) {
+ return array("return" => array("any" => new SoapVar($struct, SOAP_ENC_OBJECT, "SOAPComplexType", "http://soapinterop.org/xsd", "SOAPComplexType", "http://soapinterop.org/")));
+ } else {
+ return "?";
+ }
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('echoAnyElement');
+ }
+
+ 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__)."/interop/Round4/GroupI/round4_groupI_xsd.wsdl",
+ array("trace"=>1,"exceptions"=>0,
+ 'classmap' => array('SOAPComplexType'=>'SOAPComplexType')));
+$ret = $client->echoAnyElement(
+ array(
+ "inputAny"=>array(
+ "any"=>new SoapVar($struct, SOAP_ENC_OBJECT, "SOAPComplexType", "http://soapinterop.org/xsd", "SOAPComplexType", "http://soapinterop.org/")
+ )));
+var_dump($g);
+var_dump($ret);
+?>
+--EXPECT--
+object(stdClass)#5 (1) {
+ ["inputAny"]=>
+ object(stdClass)#6 (1) {
+ ["any"]=>
+ object(SOAPComplexType)#7 (3) {
+ ["varInt"]=>
+ int(34)
+ ["varString"]=>
+ string(3) "arg"
+ ["varFloat"]=>
+ float(325.325)
+ }
+ }
+}
+object(stdClass)#8 (1) {
+ ["return"]=>
+ object(stdClass)#9 (1) {
+ ["any"]=>
+ object(SOAPComplexType)#10 (3) {
+ ["varInt"]=>
+ int(34)
+ ["varString"]=>
+ string(3) "arg"
+ ["varFloat"]=>
+ float(325.325)
+ }
+ }
+}
diff --git a/ext/soap/tests/bugs/bug34449.phpt b/ext/soap/tests/bugs/bug34449.phpt
new file mode 100755
index 000000000..b753efccf
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34449.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #34449 (ext/soap: XSD_ANYXML functionality not exposed)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version) {
+ echo "$request\n";
+ exit;
+ }
+}
+
+$my_xml = "<array><item/><item/><item/></array>";
+$client = new TestSoapClient(null, array('location' => 'test://', 'uri' => 'test://'));
+$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>
diff --git a/ext/soap/tests/bugs/bug34453.phpt b/ext/soap/tests/bugs/bug34453.phpt
new file mode 100755
index 000000000..60277ca72
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34453.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Bug #29839 incorrect convert (xml:lang to lang)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+function EchoString($s) {
+ return $s;
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('EchoString');
+ }
+
+ function __doRequest($request, $location, $action, $version) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$client = new LocalSoapClient(dirname(__FILE__)."/bug34453.wsdl", array("trace"=>1));
+$client->EchoString(array("value"=>"hello","lang"=>"en"));
+echo $client->__getLastRequest();
+echo $client->__getLastResponse();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri"><SOAP-ENV:Body><string xml:lang="en"><ns1:value>hello</ns1:value></string></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://test-uri"><SOAP-ENV:Body><string xml:lang="en"><ns1:value>hello</ns1:value></string></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug34453.wsdl b/ext/soap/tests/bugs/bug34453.wsdl
new file mode 100755
index 000000000..205e1c95b
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34453.wsdl
@@ -0,0 +1,42 @@
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://test-uri" targetNamespace="http://test-uri">
+ <types>
+ <xs:schema targetNamespace="http://test-uri" elementFormDefault="qualified">
+ <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml2.xsd" />
+ <complexType name="LocalizedString">
+ <sequence>
+ <element name="value" type="xsd:string"/>
+ </sequence>
+ <attribute ref="xml:lang" use="required"/>
+ </complexType>
+ </xs:schema>
+ </types>
+ <message name="EchoStringRequest">
+ <part name="string" type="tns:LocalizedString"/>
+ </message>
+ <message name="EchoStringResponse">
+ <part name="string" type="tns:LocalizedString"/>
+ </message>
+ <portType name="AWSProductDataPortType">
+ <operation name="EchoString">
+ <input message="tns:EchoStringRequest"/>
+ <output message="tns:EchoStringResponse"/>
+ </operation>
+ </portType>
+ <binding name="AWSProductDataBinding" type="tns:AWSProductDataPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="EchoString">
+ <soap:operation soapAction="http://test-uri"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="AWSProductData">
+ <port name="AWSProductDataPort" binding="tns:AWSProductDataBinding">
+ <soap:address location="http://aws-beta.amazon.com/onca/soap?Service=AWSProductData"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug34643.phpt b/ext/soap/tests/bugs/bug34643.phpt
new file mode 100755
index 000000000..e1e97a99a
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34643.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Bug #34643 (wsdl default value)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled", 0);
+
+class fp {
+ public function get_it($opt="zzz") {
+ return $opt;
+ }
+}
+
+class LocalSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->setClass('fp');
+ }
+
+ function __doRequest($request, $location, $action, $version) {
+ ob_start();
+ $this->server->handle($request);
+ $response = ob_get_contents();
+ ob_end_clean();
+ return $response;
+ }
+
+}
+
+$cl = new LocalSoapClient(dirname(__FILE__).'/bug34643.wsdl', array("trace"=>1));
+print_r($cl->__getFunctions());
+echo $cl->get_it("aaa")."\n";
+echo $cl->get_it()."\n";
+var_dump($cl->get_it(null));
+?>
+--EXPECT--
+Array
+(
+ [0] => string get_it(string $opt)
+)
+aaa
+zzz
+NULL
diff --git a/ext/soap/tests/bugs/bug34643.wsdl b/ext/soap/tests/bugs/bug34643.wsdl
new file mode 100755
index 000000000..24c3a5082
--- /dev/null
+++ b/ext/soap/tests/bugs/bug34643.wsdl
@@ -0,0 +1,42 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<definitions name="wsdl" targetNamespace="urn:wsdl"
+xmlns:typens="urn:wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:wsdl">
+ <xsd:element name="opt" type="xsd:string" default="zzz" />
+ </xsd:schema>
+ </types>
+ <message name="get_it">
+ <part name="opt" element="typens:opt"/>
+ </message>
+ <message name="get_itResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+ <portType name="fpPortType">
+ <operation name="get_it">
+ <input message="typens:get_it"/>
+ <output message="typens:get_itResponse"/>
+ </operation>
+ </portType>
+ <binding name="fpBinding" type="typens:fpPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="get_it">
+ <soap:operation soapAction="urn:fpAction"/>
+ <input>
+ <soap:body namespace="urn:wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body namespace="urn:wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="wsdlService">
+ <port name="fpPort" binding="typens:fpBinding">
+ <soap:address location="**********"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug35142.phpt b/ext/soap/tests/bugs/bug35142.phpt
new file mode 100755
index 000000000..f787c5964
--- /dev/null
+++ b/ext/soap/tests/bugs/bug35142.phpt
@@ -0,0 +1,135 @@
+--TEST--
+Bug #35142 SOAP Client/Server Complex Object Support
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled",0);
+$timestamp = "2005-11-08T11:22:07+03:00";
+$wsdl = dirname(__FILE__)."/bug35142.wsdl";
+
+function PostEvents($x) {
+ var_dump($x);
+ exit();
+ return $x;
+}
+
+class TestSoapClient extends SoapClient {
+
+ function __construct($wsdl, $options) {
+ parent::__construct($wsdl, $options);
+ $this->server = new SoapServer($wsdl, $options);
+ $this->server->addFunction('PostEvents');
+ }
+
+ function __doRequest($request, $location, $action, $version) {
+ echo "$request\n";
+ $this->server->handle($request);
+ return $response;
+ }
+
+}
+
+$soapClient = new TestSoapClient($wsdl,
+ array('trace' => 1, 'exceptions' => 0,
+ 'classmap' => array('logOnEvent' => 'LogOnEvent',
+ 'logOffEvent' => 'LogOffEvent',
+ 'events' => 'IVREvents')));
+
+$logOnEvent = new LogOnEvent(34567, $timestamp);
+$logOffEvents[] = new LogOffEvent(34567, $timestamp, "Smoked");
+$logOffEvents[] = new LogOffEvent(34568, $timestamp, "SmokeFree");
+$ivrEvents = new IVREvents("1.0", 101, 12345, 'IVR', $logOnEvent, $logOffEvents);
+
+$result = $soapClient->PostEvents($ivrEvents);
+
+class LogOffEvent {
+ public $audienceMemberId;
+ public $timestamp;
+ public $smokeStatus;
+ public $callInititator;
+
+ function __construct($audienceMemberId, $timestamp, $smokeStatus) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ $this->smokeStatus = $smokeStatus;
+ $this->callInitiator = "IVR";
+ }
+}
+
+class LogOnEvent {
+ public $audienceMemberId;
+ public $timestamp;
+
+ function __construct($audienceMemberId, $timestamp) {
+ $this->audienceMemberId = $audienceMemberId;
+ $this->timestamp = $timestamp;
+ }
+}
+
+class IVREvents {
+ public $version;
+ public $activityId;
+ public $messageId;
+ public $source;
+ public $logOnEvent;
+ public $logOffEvent;
+
+ function __construct($version, $activityId, $messageId, $source, $logOnEvent=NULL, $logOffEvent=NULL) {
+ $this->version = $version;
+ $this->activityId = $activityId;
+ $this->messageId = $messageId;
+ $this->source = $source;
+ $this->logOnEvent = $logOnEvent;
+ $this->logOffEvent = $logOffEvent;
+ }
+}
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testurl/Message"><SOAP-ENV:Body><ns1:ivrEvents version="1.0" activityId="101" messageId="12345" source="IVR"><ns1:logOffEvent audienceMemberId="34567" timestamp="2005-11-08T11:22:07+03:00" smokeStatus="Smoked" callInitiator="IVR"/><ns1:logOffEvent audienceMemberId="34568" timestamp="2005-11-08T11:22:07+03:00" smokeStatus="SmokeFree" callInitiator="IVR"/><ns1:logOnEvent audienceMemberId="34567" timestamp="2005-11-08T11:22:07+03:00"/></ns1:ivrEvents></SOAP-ENV:Body></SOAP-ENV:Envelope>
+
+object(IVREvents)#%d (6) {
+ ["version"]=>
+ string(3) "1.0"
+ ["activityId"]=>
+ int(101)
+ ["messageId"]=>
+ int(12345)
+ ["logOffEvent"]=>
+ array(2) {
+ [0]=>
+ object(LogOffEvent)#%d (4) {
+ ["audienceMemberId"]=>
+ int(34567)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ ["smokeStatus"]=>
+ string(6) "Smoked"
+ ["callInitiator"]=>
+ string(3) "IVR"
+ }
+ [1]=>
+ object(LogOffEvent)#%d (4) {
+ ["audienceMemberId"]=>
+ int(34568)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ ["smokeStatus"]=>
+ string(9) "SmokeFree"
+ ["callInitiator"]=>
+ string(3) "IVR"
+ }
+ }
+ ["logOnEvent"]=>
+ object(LogOnEvent)#%d (2) {
+ ["audienceMemberId"]=>
+ int(34567)
+ ["timestamp"]=>
+ string(25) "2005-11-08T11:22:07+03:00"
+ }
+ ["source"]=>
+ string(3) "IVR"
+}
diff --git a/ext/soap/tests/bugs/bug35142.wsdl b/ext/soap/tests/bugs/bug35142.wsdl
new file mode 100755
index 000000000..2c712ec10
--- /dev/null
+++ b/ext/soap/tests/bugs/bug35142.wsdl
@@ -0,0 +1,543 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:s1="http://testurl/Events" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://testurl/Message" xmlns:s3="http://testurl/Smoker" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s4="http://testurl/AudienceMember" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://testurl/Actions" xmlns:tns="http://testurl/Service" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://testurl/Service" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Message">
+ <s:import namespace="http://testurl/Events" />
+ <s:import namespace="http://testurl/Actions" />
+ <s:element name="ivrActions" type="s0:actions" />
+ <s:complexType name="actions">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="pauseSmokerAction" type="s2:pauseSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateSmokerAction" type="s2:terminateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="activateSmokerAction" type="s2:activateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="addSmokerAction" type="s2:addSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="updateSmokerAction" type="s2:updateSmokerAction" />
+ <s:element minOccurs="0" maxOccurs="1" name="deleteSmokerAction" type="s2:deleteSmokerAction" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="Client" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractMessage" abstract="true">
+ <s:attribute default="1.0" name="version" type="s:string" />
+ <s:attribute name="activityId" type="s:unsignedLong" use="required" />
+ <s:attribute name="messageId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="events">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="authFailureEvent" type="s1:authFailureEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="logOffEvent" type="s1:logOffEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="cravingLineEvent" type="s1:cravingLineEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateEvent" type="s1:terminateEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="relapseWakeSmsReplaceEvent" type="s1:relapseWakeSmsReplaceEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="confessionLineEvent" type="s1:confessionLineEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="rfqRecordedEvent" type="s1:rfqRecordedEvent" />
+ <s:element minOccurs="0" maxOccurs="1" name="logOnEvent" type="s1:logOnEvent" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="ivrMessageSource">
+ <s:restriction base="s:string">
+ <s:enumeration value="IVR" />
+ <s:enumeration value="Client" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="actionResults">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:choice minOccurs="0" maxOccurs="unbounded">
+ <s:element minOccurs="0" maxOccurs="1" name="updateSmokerActionResult" type="s2:updateSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="activateSmokerActionResult" type="s2:activateSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="deleteSmokerActionResult" type="s2:deleteSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="addSmokerActionResult" type="s2:addSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="pauseSmokerActionResult" type="s2:pauseSmokerActionResult" />
+ <s:element minOccurs="0" maxOccurs="1" name="terminateSmokerActionResult" type="s2:terminateSmokerActionResult" />
+ </s:choice>
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="eventResults">
+ <s:complexContent mixed="false">
+ <s:extension base="s0:abstractMessage">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="eventResult" type="s1:eventResult" />
+ </s:sequence>
+ <s:attribute default="IVR" name="source" type="s0:ivrMessageSource" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:element name="ivrActionResults" type="s0:actionResults" />
+ <s:element name="ivrEvents" type="s0:events" />
+ <s:element name="ivrEventResults" type="s0:eventResults" />
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Events">
+ <s:complexType name="authFailureEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="mobileNumber" type="s:string" />
+ <s:attribute name="line" type="s1:line" use="required" />
+ <s:attribute name="reason" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractEvent" abstract="true">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" />
+ <s:attribute name="timestamp" type="s:dateTime" use="required" />
+ </s:complexType>
+ <s:complexType name="logOnEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="cravingLineEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="selection" type="s1:cravingLineEventSelection" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="cravingLineEventSelection">
+ <s:attribute name="type" type="s1:cravingLineMessageType" use="required" />
+ <s:attribute name="msgNumber" type="s:positiveInteger" />
+ </s:complexType>
+ <s:simpleType name="cravingLineMessageType">
+ <s:restriction base="s:string">
+ <s:enumeration value="Motivational" />
+ <s:enumeration value="StressReval" />
+ <s:enumeration value="EffectReg" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="confessionLineEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="smokeStatus" type="s1:smokeStatus" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="smokeStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Smoked" />
+ <s:enumeration value="SmokeFree" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="rfqRecordedEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent" />
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="logOffEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="smokeStatus" type="s1:smokeStatus" use="required" />
+ <s:attribute name="callInitiator" type="s1:callInitiator" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="callInitiator">
+ <s:restriction base="s:string">
+ <s:enumeration value="AudienceMember" />
+ <s:enumeration value="IVR" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="relapseWakeSmsReplaceEvent">
+ <s:complexContent mixed="false">
+ <s:extension base="s1:abstractEvent">
+ <s:attribute name="relapseCount" type="s:positiveInteger" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="line">
+ <s:restriction base="s:string">
+ <s:enumeration value="LogOnOffLine" />
+ <s:enumeration value="CravingLine" />
+ <s:enumeration value="ConfessionLine" />
+ <s:enumeration value="ReasonsForQuittingLine" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="eventResult">
+ <s:attribute name="success" type="s:boolean" use="required" />
+ </s:complexType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Actions">
+ <s:import namespace="http://testurl/Smoker" />
+ <s:complexType name="updateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:updateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractActionResult">
+ <s:attribute name="resultId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="pauseSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:pauseSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="pauseSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:pauseSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:pauseSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="pauseSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Paused" />
+ <s:enumeration value="NotPaused" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="pauseSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="addSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:addSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="addSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:addSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:addSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="addSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Added" />
+ <s:enumeration value="NotAdded" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="addSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="DuplicateID" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="deleteSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:deleteSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="deleteSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:deleteSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:deleteSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="deleteSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Deleted" />
+ <s:enumeration value="NotDeleted" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="deleteSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="activateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:activateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="activateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:activateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:activateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="activateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Activated" />
+ <s:enumeration value="NotActivated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="activateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="terminateSmokerActionResult">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractActionResult">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s2:terminateSmokerActionResultSmoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:terminateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:terminateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="terminateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Terminated" />
+ <s:enumeration value="NotTerminated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="terminateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="updateSmokerActionResultSmoker">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ <s:attribute name="status" type="s2:updateSmokerActionResultSmokerStatus" use="required" />
+ <s:attribute name="exception" type="s2:updateSmokerActionResultSmokerException" />
+ </s:complexType>
+ <s:simpleType name="updateSmokerActionResultSmokerStatus">
+ <s:restriction base="s:string">
+ <s:enumeration value="Updated" />
+ <s:enumeration value="NotUpdated" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="updateSmokerActionResultSmokerException">
+ <s:restriction base="s:string">
+ <s:enumeration value="UnspecifiedError" />
+ <s:enumeration value="IDNotFound" />
+ </s:restriction>
+ </s:simpleType>
+ <s:complexType name="pauseSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="audienceMemberID" type="s:unsignedLong" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="abstractAction" abstract="true">
+ <s:attribute name="requestId" type="s:unsignedLong" use="required" />
+ </s:complexType>
+ <s:complexType name="addSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s3:smoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="updateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="smoker" type="s3:smoker" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="terminateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="deleteSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="audienceMemberID" type="s:unsignedLong" />
+ </s:sequence>
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:complexType name="activateSmokerAction">
+ <s:complexContent mixed="false">
+ <s:extension base="s2:abstractAction">
+ <s:attribute name="audienceMemberId" type="s:unsignedLong" use="required" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/Smoker">
+ <s:import namespace="http://testurl/AudienceMember" />
+ <s:complexType name="smoker">
+ <s:complexContent mixed="false">
+ <s:extension base="s4:ivrAudienceMember">
+ <s:attribute name="startDate" type="s:date" use="required" />
+ <s:attribute name="phase" type="s3:phase" use="required" />
+ <s:attribute name="day" type="s:positiveInteger" />
+ <s:attribute name="track" type="s3:track" use="required" />
+ <s:attribute name="status" type="s3:status" use="required" />
+ <s:attribute name="baseTime" type="s:string" />
+ <s:attribute name="sunWakeOffset" type="s:string" />
+ <s:attribute name="monWakeOffset" type="s:string" />
+ <s:attribute name="tueWakeOffset" type="s:string" />
+ <s:attribute name="wedWakeOffset" type="s:string" />
+ <s:attribute name="thuWakeOffset" type="s:string" />
+ <s:attribute name="friWakeOffset" type="s:string" />
+ <s:attribute name="satWakeOffset" type="s:string" />
+ <s:attribute name="sunSleepOffset" type="s:string" />
+ <s:attribute name="monSleepOffset" type="s:string" />
+ <s:attribute name="tueSleepOffset" type="s:string" />
+ <s:attribute name="wedSleepOffset" type="s:string" />
+ <s:attribute name="thuSleepOffset" type="s:string" />
+ <s:attribute name="friSleepOffset" type="s:string" />
+ <s:attribute name="satSleepOffset" type="s:string" />
+ <s:attribute name="sunLogOnWindowOffset" type="s:string" />
+ <s:attribute name="monLogOnWindowOffset" type="s:string" />
+ <s:attribute name="tueLogOnWindowOffset" type="s:string" />
+ <s:attribute name="wedLogOnWindowOffset" type="s:string" />
+ <s:attribute name="thuLogOnWindowOffset" type="s:string" />
+ <s:attribute name="friLogOnWindowOffset" type="s:string" />
+ <s:attribute name="satLogOnWindowOffset" type="s:string" />
+ <s:attribute name="sunLogOffWindowOffset" type="s:string" />
+ <s:attribute name="monLogOffWindowOffset" type="s:string" />
+ <s:attribute name="tueLogOffWindowOffset" type="s:string" />
+ <s:attribute name="wedLogOffWindowOffset" type="s:string" />
+ <s:attribute name="thuLogOffWindowOffset" type="s:string" />
+ <s:attribute name="friLogOffWindowOffset" type="s:string" />
+ <s:attribute name="satLogOffWindowOffset" type="s:string" />
+ </s:extension>
+ </s:complexContent>
+ </s:complexType>
+ <s:simpleType name="phase">
+ <s:restriction base="s:string">
+ <s:enumeration value="Prep" />
+ <s:enumeration value="Quit" />
+ <s:enumeration value="Followup" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="track">
+ <s:restriction base="s:string">
+ <s:enumeration value="NRT" />
+ <s:enumeration value="NonNRT" />
+ </s:restriction>
+ </s:simpleType>
+ <s:simpleType name="status">
+ <s:restriction base="s:string">
+ <s:enumeration value="Pre-Start" />
+ <s:enumeration value="Completed" />
+ <s:enumeration value="Terminated" />
+ <s:enumeration value="Paused" />
+ <s:enumeration value="Active" />
+ </s:restriction>
+ </s:simpleType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://testurl/AudienceMember">
+ <s:import namespace="http://testurl/Smoker" />
+ <s:complexType name="ivrAudienceMember">
+ <s:attribute name="id" type="s:unsignedLong" use="required" />
+ <s:attribute name="mobileNumber" type="s:string" />
+ <s:attribute name="firstName" type="s:string" />
+ <s:attribute name="lastName" type="s:string" />
+ </s:complexType>
+ </s:schema>
+ </types>
+ <message name="PostActionsSoapIn">
+ <part name="ivrActions" element="s0:ivrActions" />
+ </message>
+ <message name="PostActionsSoapOut">
+ <part name="PostActionsResult" element="s0:ivrActionResults" />
+ </message>
+ <message name="PostEventsSoapIn">
+ <part name="ivrEvents" element="s0:ivrEvents" />
+ </message>
+ <message name="PostEventsSoapOut">
+ <part name="PostEventsResult" element="s0:ivrEventResults" />
+ </message>
+ <portType name="IVRServicePortSoap">
+ <operation name="PostActions">
+ <input message="tns:PostActionsSoapIn" />
+ <output message="tns:PostActionsSoapOut" />
+ </operation>
+ <operation name="PostEvents">
+ <input message="tns:PostEventsSoapIn" />
+ <output message="tns:PostEventsSoapOut" />
+ </operation>
+ </portType>
+ <binding name="IVRServicePortSoap" type="tns:IVRServicePortSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="PostActions">
+ <soap:operation soapAction="http://testurl/Service:postActionsIn" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="PostEvents">
+ <soap:operation soapAction="http://testurl/Service:postEventsIn" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="IVRServicePortSoap12" type="tns:IVRServicePortSoap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="PostActions">
+ <soap12:operation soapAction="http://testurl/Service:postActionsIn" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="PostEvents">
+ <soap12:operation soapAction="http://testurl/Service:postEventsIn" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="IVRServicePort">
+ <port name="IVRServicePortSoap" binding="tns:IVRServicePortSoap">
+ <soap:address location="test://" />
+ </port>
+ <port name="IVRServicePortSoap12" binding="tns:IVRServicePortSoap12">
+ <soap12:address location="test://" />
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug35273.phpt b/ext/soap/tests/bugs/bug35273.phpt
new file mode 100755
index 000000000..12a555c5c
--- /dev/null
+++ b/ext/soap/tests/bugs/bug35273.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #35273 Error in mapping soap - java types
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient {
+ function __doRequest($request, $location, $action, $version) {
+ echo $request;
+ exit;
+ }
+}
+
+ini_set("soap.wsdl_cache_enabled", 0);
+$client = new TestSoapClient(dirname(__FILE__).'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0));
+$ahoj = $client->echoPerson(array("name"=>"Name","surname"=>"Surname"));
+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>
diff --git a/ext/soap/tests/bugs/xml2.xsd b/ext/soap/tests/bugs/xml2.xsd
new file mode 100755
index 000000000..a8e2185f1
--- /dev/null
+++ b/ext/soap/tests/bugs/xml2.xsd
@@ -0,0 +1,146 @@
+<?xml version='1.0'?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+
+ <xs:annotation>
+ <xs:documentation>
+ See http://www.w3.org/XML/1998/namespace.html and
+ http://www.w3.org/TR/REC-xml for information about this namespace.
+
+ This schema document describes the XML namespace, in a form
+ suitable for import by other schema documents.
+
+ Note that local names in this namespace are intended to be defined
+ only by the World Wide Web Consortium or its subgroups. The
+ following names are currently defined in this namespace and should
+ not be used with conflicting semantics by any Working Group,
+ specification, or document instance:
+
+ base (as an attribute name): denotes an attribute whose value
+ provides a URI to be used as the base for interpreting any
+ relative URIs in the scope of the element on which it
+ appears; its value is inherited. This name is reserved
+ by virtue of its definition in the XML Base specification.
+
+ id (as an attribute name): denotes an attribute whose value
+ should be interpreted as if declared to be of type ID.
+ The xml:id specification is not yet a W3C Recommendation,
+ but this attribute is included here to facilitate experimentation
+ with the mechanisms it proposes. Note that it is _not_ included
+ in the specialAttrs attribute group.
+
+ lang (as an attribute name): denotes an attribute whose value
+ is a language code for the natural language of the content of
+ any element; its value is inherited. This name is reserved
+ by virtue of its definition in the XML specification.
+
+ space (as an attribute name): denotes an attribute whose
+ value is a keyword indicating what whitespace processing
+ discipline is intended for the content of the element; its
+ value is inherited. This name is reserved by virtue of its
+ definition in the XML specification.
+
+ Father (in any context at all): denotes Jon Bosak, the chair of
+ the original XML Working Group. This name is reserved by
+ the following decision of the W3C XML Plenary and
+ XML Coordination groups:
+
+ In appreciation for his vision, leadership and dedication
+ the W3C XML Plenary on this 10th day of February, 2000
+ reserves for Jon Bosak in perpetuity the XML name
+ xml:Father
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>This schema defines attributes and an attribute group
+ suitable for use by
+ schemas wishing to allow xml:base, xml:lang or xml:space attributes
+ on elements they define.
+
+ To enable this, such a schema must import this schema
+ for the XML namespace, e.g. as follows:
+ &lt;schema . . .>
+ . . .
+ &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
+
+ Subsequently, qualified reference to any of the attributes
+ or the group defined below will have the desired effect, e.g.
+
+ &lt;type . . .>
+ . . .
+ &lt;attributeGroup ref="xml:specialAttrs"/>
+
+ will define a type which will schema-validate an instance
+ element with any of those attributes</xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>In keeping with the XML Schema WG's standard versioning
+ policy, this schema document will persist at
+ http://www.w3.org/2005/08/xml.xsd.
+ At the date of issue it can also be found at
+ http://www.w3.org/2001/xml.xsd.
+ The schema document at that URI may however change in the future,
+ in order to remain compatible with the latest version of XML Schema
+ itself, or with the XML namespace itself. In other words, if the XML
+ Schema or XML namespaces change, the version of this document at
+ http://www.w3.org/2001/xml.xsd will change
+ accordingly; the version at
+ http://www.w3.org/2005/08/xml.xsd will not change.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+ <xs:annotation>
+ <xs:documentation>Attempting to install the relevant ISO 2- and 3-letter
+ codes as the enumerated possible values is probably never
+ going to be a realistic possibility. See
+ RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry
+ at http://www.iana.org/assignments/lang-tag-apps.htm for
+ further information.
+
+ The union allows for the 'un-declaration' of xml:lang with
+ the empty string.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:union memberTypes="xs:language">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value=""/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+ <xs:simpleType>
+ <xs:restriction base="xs:NCName">
+ <xs:enumeration value="default"/>
+ <xs:enumeration value="preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="base" type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>See http://www.w3.org/TR/xmlbase/ for
+ information about this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="id" type="xs:ID">
+ <xs:annotation>
+ <xs:documentation>See http://www.w3.org/TR/xml-id/ for
+ information about this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+ <xs:attribute ref="xml:base"/>
+ <xs:attribute ref="xml:lang"/>
+ <xs:attribute ref="xml:space"/>
+ </xs:attributeGroup>
+
+</xs:schema>
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt
new file mode 100644
index 000000000..0fdfd2c0c
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_001p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 001 (php/direct): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array("Hello World!"), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:type="xsd:string">Hello World!</param0></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:type="xsd:string">Hello World!</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt
new file mode 100644
index 000000000..4bdfce41a
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_001s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 001 (soap/direct): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar("Hello World!",XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:type="xsd:string">Hello World!</inputString></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:type="xsd:string">Hello World!</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt
new file mode 100644
index 000000000..49bcc131e
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World!");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:type="xsd:string">Hello World!</inputString></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:type="xsd:string">Hello World!</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt
new file mode 100644
index 000000000..8905ee536
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_002p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 002 (php/direct): echoString(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(""), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:type="xsd:string"></param0></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:type="xsd:string"></outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt
new file mode 100644
index 000000000..b21af9380
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_002s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 002 (soap/direct): echoString(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar("",XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:type="xsd:string"></inputString></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:type="xsd:string"></outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt
new file mode 100644
index 000000000..4741ab758
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_002w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 002 (php/wsdl): echoString(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:type="xsd:string"></inputString></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:type="xsd:string"></outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt
new file mode 100644
index 000000000..1ee25584b
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 003 (php/direct): echoString(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(NULL), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..2fd1dd0be
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 003 (soap/direct): echoString(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar(NULL,XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..0104ffc08
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 003 (php/wsdl): echoString(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(NULL);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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>
+<?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>
+ok \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt
new file mode 100644
index 000000000..c9a2d20b3
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_004p.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 004 (php/direct): echoString(entities)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(">,<,&,\",',\\,\n"), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</param0></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:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt
new file mode 100644
index 000000000..b75d9842a
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_004s.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 004 (soap/direct): echoString(entities)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar(">,<,&,\",',\\,\n",XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</inputString></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:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt
new file mode 100644
index 000000000..c1410058c
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_004w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 004 (php/wsdl): echoString(entities)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(">,<,&,\",',\\,\n");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</inputString></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:type="xsd:string">&gt;,&lt;,&amp;,",',\,
+</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt
new file mode 100644
index 000000000..0db9eceed
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_005p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 005 (php/direct): echoString(utf-8)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(utf8_encode('ỗÈéóÒ₧⅜ỗỸ')), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</param0></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:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt
new file mode 100644
index 000000000..342e7f59b
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_005s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 005 (soap/direct): echoString(utf-8)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString", array(new SoapParam(new SoapVar(utf8_encode('ỗÈéóÒ₧⅜ỗỸ'),XSD_STRING),"inputString")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</inputString></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:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt
new file mode 100644
index 000000000..7dd127cfb
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_005w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 005 (php/wsdl): echoString(utf-8)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(utf8_encode('ỗÈéóÒ₧⅜ỗỸ'));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</inputString></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:type="xsd:string">ỗÈéóÒ₧⅜ỗỸ</outputString></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt
new file mode 100644
index 000000000..58c4e5fc6
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 006 (php/direct): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array(array('good','bad')), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+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
new file mode 100644
index 000000000..9238f943c
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round2 base 006 (soap/direct): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar('good', XSD_STRING),
+ new SoapVar('bad', XSD_STRING)
+ ), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd"), "inputStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..b5ff5a63d
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 006 (php/wsdl): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array('good','bad'));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..9daeca1bb
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 007 (php/direct): echoStringArray(one)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array(array('good')), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+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
new file mode 100644
index 000000000..fe91d5a1c
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 base 007 (soap/direct): echoStringArray(one)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar('good', XSD_STRING)
+ ), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd"), "inputStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..ae9c9b5dd
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 007 (php/wsdl): echoStringArray(one)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array('good'));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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>
+<?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>
+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
new file mode 100644
index 000000000..377d0b049
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 008 (php/direct): echoStringArray(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array(array()), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..6ab530146
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round2 base 008 (soap/direct): echoStringArray(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ ), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd"), "inputStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..b4d4e0414
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 008 (php/wsdl): echoStringArray(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array());
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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>
+<?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>
+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
new file mode 100644
index 000000000..8fe6cee94
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 009 (php/direct): echoStringArray(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array(NULL), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..b29f52f7d
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round2 base 009 (soap/direct): echoStringArray(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(NULL, SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd"), "inputStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..0f779a032
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 009 (php/wsdl): echoStringArray(NULL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(NULL);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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>
+<?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>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt
new file mode 100644
index 000000000..a9f3ba5e6
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_010p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 010 (php/direct): echoInteger
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoInteger", array(34345), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoInteger><param0 xsi:type="xsd:int">34345</param0></ns1:echoInteger></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:echoIntegerResponse><outputInteger xsi:type="xsd:int">34345</outputInteger></ns1:echoIntegerResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt
new file mode 100644
index 000000000..673f8e6ea
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_010s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 010 (soap/direct): echoInteger
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoInteger", array(new SoapParam(new soapVar(34345, XSD_INT), "inputInteger")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoInteger><inputInteger xsi:type="xsd:int">34345</inputInteger></ns1:echoInteger></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:echoIntegerResponse><outputInteger xsi:type="xsd:int">34345</outputInteger></ns1:echoIntegerResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt
new file mode 100644
index 000000000..045a4db43
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_010w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 010 (php/wsdl): echoInteger
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoInteger(34345);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:echoInteger><inputInteger xsi:type="xsd:int">34345</inputInteger></ns1:echoInteger></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:echoIntegerResponse><outputInteger xsi:type="xsd:int">34345</outputInteger></ns1:echoIntegerResponse></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
new file mode 100644
index 000000000..5c1cbcb85
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 011 (php/direct): echoIntegerArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoIntegerArray", array(array(1,234324324,2)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+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
new file mode 100644
index 000000000..8c6808409
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round2 base 011 (soap/direct): echoIntegerArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar(1,XSD_INT),
+ new SoapVar(234324324,XSD_INT),
+ new SoapVar(2,XSD_INT)
+ ), SOAP_ENC_ARRAY, "ArrayOfint","http://soapinterop.org/xsd"), "inputIntegerArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoIntegerArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..e0c18bd1d
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 011 (php/wsdl): echoIntegerArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoIntegerArray(array(1,234324324,2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt
new file mode 100644
index 000000000..b30abdc2d
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_012p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 012 (php/direct): echoFloat
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoFloat", array(342.23), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoFloat><param0 xsi:type="xsd:float">342.23</param0></ns1:echoFloat></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:echoFloatResponse><outputFloat xsi:type="xsd:float">342.23</outputFloat></ns1:echoFloatResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt
new file mode 100644
index 000000000..107814bc8
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_012s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 012 (soap/direct): echoFloat
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoFloat", array(new SoapParam(new SoapVar(342.23,XSD_FLOAT),"inputFloat")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoFloat><inputFloat xsi:type="xsd:float">342.23</inputFloat></ns1:echoFloat></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:echoFloatResponse><outputFloat xsi:type="xsd:float">342.23</outputFloat></ns1:echoFloatResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt
new file mode 100644
index 000000000..aae41109c
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_012w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 012 (php/wsdl): echoFloat
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoFloat(342.23);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:echoFloat><inputFloat xsi:type="xsd:float">342.23</inputFloat></ns1:echoFloat></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:echoFloatResponse><outputFloat xsi:type="xsd:float">342.23</outputFloat></ns1:echoFloatResponse></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
new file mode 100644
index 000000000..db8e432cd
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 013 (php/direct): echoFloatArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoFloatArray", array(array(1.3223,34.2,325.325)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+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
new file mode 100644
index 000000000..fcdf47630
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round2 base 013 (soap/direct): echoFloatArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar(1.3223, XSD_FLOAT),
+ new SoapVar(34.2, XSD_FLOAT),
+ new SoapVar(325.325, XSD_FLOAT)
+ ), SOAP_ENC_ARRAY, "ArrayOffloat","http://soapinterop.org/xsd"), "inputFloatArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoFloatArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..9af95192a
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 013 (php/wsdl): echoFloatArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoFloatArray(array(1.3223,34.2,325.325));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..5995225da
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round2 base 014 (php/direct): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStruct", array(new SOAPStruct('arg',34,325.325)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..8ef6882d5
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round2 base 014 (soap/direct): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar('arg', XSD_STRING, null, null, 'varString'),
+ new SoapVar('34', XSD_INT, null, null, 'varInt'),
+ new SoapVar('325.325', XSD_FLOAT, null, null, 'varFloat')
+ ),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"), "inputStruct");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStruct", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..a08550ebe
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round2 base 014 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct(new SOAPStruct('arg',34,325.325));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..6c9ac42eb
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP Interop Round2 base 015 (php/direct): echoStructArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStructArray", array(array($struct,$struct)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+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
new file mode 100644
index 000000000..c97ca7bb1
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SOAP Interop Round2 base 015 (soap/direct): echoStructArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$struct = new SoapVar(array(
+ new SoapVar('arg', XSD_STRING, null, null, 'varString'),
+ new SoapVar('34', XSD_INT, null, null, 'varInt'),
+ new SoapVar('325.325', XSD_FLOAT, null, null, 'varFloat')
+ ),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
+
+$param = new SoapParam(new SoapVar(array(
+ $struct,
+ $struct
+ ),SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd"), "inputStructArray");
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStructArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..028bb6ced
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP Interop Round2 base 015 (php/wsdl): echoStructArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStructArray(array($struct,$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..4f791aa5f
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 016 (php/direct): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoid", array(), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..4a4751669
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 016 (soap/direct): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoid", array(), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..0642b3cf3
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 016 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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>
+<?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>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt
new file mode 100644
index 000000000..b769fc09f
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_017p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 017 (php/direct): echoBase64
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBase64", array('Nebraska'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBase64><param0 xsi:type="xsd:string">Nebraska</param0></ns1:echoBase64></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:echoBase64Response><outputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</outputBase64></ns1:echoBase64Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt
new file mode 100644
index 000000000..0e467a9df
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_017s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 017 (soap/direct): echoBase64
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBase64", array(new SoapParam(new SoapVar('Nebraska',XSD_BASE64BINARY),"inputBase64")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBase64><inputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</inputBase64></ns1:echoBase64></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:echoBase64Response><outputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</outputBase64></ns1:echoBase64Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt
new file mode 100644
index 000000000..c2e836d74
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_017w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 017 (php/wsdl): echoBase64
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBase64('Nebraska');
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:echoBase64><inputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</inputBase64></ns1:echoBase64></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:echoBase64Response><outputBase64 xsi:type="xsd:base64Binary">TmVicmFza2E=</outputBase64></ns1:echoBase64Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt
new file mode 100644
index 000000000..899db7ba0
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_018p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 018 (php/direct): echoHexBinary
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoHexBinary", array('soapx4'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoHexBinary><param0 xsi:type="xsd:string">soapx4</param0></ns1:echoHexBinary></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:echoHexBinaryResponse><outputHexBinary xsi:type="xsd:hexBinary">736F61707834</outputHexBinary></ns1:echoHexBinaryResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt
new file mode 100644
index 000000000..1e7825507
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_018s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 018 (soap/direct): echoHexBinary
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoHexBinary", array(new SoapParam(new SoapVar('soapx4',XSD_HEXBINARY),"inputHexBinary")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoHexBinary><inputHexBinary xsi:type="xsd:hexBinary">736F61707834</inputHexBinary></ns1:echoHexBinary></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:echoHexBinaryResponse><outputHexBinary xsi:type="xsd:hexBinary">736F61707834</outputHexBinary></ns1:echoHexBinaryResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt
new file mode 100644
index 000000000..e7dce5430
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_018w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 018 (php/wsdl): echoHexBinary
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoHexBinary('soapx4');
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:echoHexBinary><inputHexBinary xsi:type="xsd:hexBinary">736F61707834</inputHexBinary></ns1:echoHexBinary></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:echoHexBinaryResponse><outputHexBinary xsi:type="xsd:hexBinary">736F61707834</outputHexBinary></ns1:echoHexBinaryResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt
new file mode 100644
index 000000000..0ce289400
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_019p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 019 (php/direct): echoDecimal
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoDecimal", array('12345.67890'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoDecimal><param0 xsi:type="xsd:string">12345.67890</param0></ns1:echoDecimal></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:echoDecimalResponse><outputDecimal xsi:type="xsd:decimal">12345.67890</outputDecimal></ns1:echoDecimalResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt
new file mode 100644
index 000000000..d653b8370
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_019s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 019 (soap/direct): echoDecimal
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoDecimal", array(new SoapParam(new SoapVar('12345.67890',XSD_DECIMAL), "inputDecimal")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoDecimal><inputDecimal xsi:type="xsd:decimal">12345.67890</inputDecimal></ns1:echoDecimal></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:echoDecimalResponse><outputDecimal xsi:type="xsd:decimal">12345.67890</outputDecimal></ns1:echoDecimalResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt
new file mode 100644
index 000000000..5cc7c47ee
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_019w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 019 (php/wsdl): echoDecimal
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDecimal('12345.67890');
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:echoDecimal><inputDecimal xsi:type="xsd:decimal">12345.67890</inputDecimal></ns1:echoDecimal></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:echoDecimalResponse><outputDecimal xsi:type="xsd:decimal">12345.67890</outputDecimal></ns1:echoDecimalResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt
new file mode 100644
index 000000000..1e8807355
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_020p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 020 (php/direct): echoDate
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoDate", array('2001-05-24T17:31:41Z'), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoDate><param0 xsi:type="xsd:string">2001-05-24T17:31:41Z</param0></ns1:echoDate></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:echoDateResponse><outputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</outputDate></ns1:echoDateResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt
new file mode 100644
index 000000000..0b04b0331
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_020s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 020 (soap/direct): echoDate
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoDate", array(new SoapParam(new SoapVar('2001-05-24T17:31:41Z', XSD_DATETIME), "inputDate")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoDate><inputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</inputDate></ns1:echoDate></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:echoDateResponse><outputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</outputDate></ns1:echoDateResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt
new file mode 100644
index 000000000..ac8222157
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_020w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 020 (php/wsdl): echoDate
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDate('2001-05-24T17:31:41Z');
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoDate><inputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</inputDate></ns1:echoDate></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:echoDateResponse><outputDate xsi:type="xsd:dateTime">2001-05-24T17:31:41Z</outputDate></ns1:echoDateResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt
new file mode 100644
index 000000000..c25eac495
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_021p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 021 (php/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(true), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBoolean><param0 xsi:type="xsd:boolean">true</param0></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt
new file mode 100644
index 000000000..829ee3c87
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_021s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 021 (soap/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(true, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBoolean><inputBoolean xsi:type="xsd:boolean">true</inputBoolean></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt
new file mode 100644
index 000000000..03f8ad5e8
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_021w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 021 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(true);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:echoBoolean><inputBoolean xsi:type="xsd:boolean">true</inputBoolean></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt
new file mode 100644
index 000000000..d01623edb
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_022p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 022 (php/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(false), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBoolean><param0 xsi:type="xsd:boolean">false</param0></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt
new file mode 100644
index 000000000..039fd23d4
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_022s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 022 (soap/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(false, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBoolean><inputBoolean xsi:type="xsd:boolean">false</inputBoolean></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt
new file mode 100644
index 000000000..a516b9dcc
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_022w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 022 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(false);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:echoBoolean><inputBoolean xsi:type="xsd:boolean">false</inputBoolean></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt
new file mode 100644
index 000000000..f21ccc140
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_023p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 023 (php/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(1), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBoolean><param0 xsi:type="xsd:int">1</param0></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt
new file mode 100644
index 000000000..296e4b1e8
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_023s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 023 (soap/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(1, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBoolean><inputBoolean xsi:type="xsd:boolean">true</inputBoolean></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt
new file mode 100644
index 000000000..90d831cb1
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_023w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 023 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(1);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:echoBoolean><inputBoolean xsi:type="xsd:boolean">true</inputBoolean></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">true</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt
new file mode 100644
index 000000000..1deee18ba
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_024p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 024 (php/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(0), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBoolean><param0 xsi:type="xsd:int">0</param0></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt
new file mode 100644
index 000000000..c3166c167
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_024s.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 024 (soap/direct): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoBoolean", array(new SoapParam(new SoapVar(0, XSD_BOOLEAN), "inputBoolean")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoBoolean><inputBoolean xsi:type="xsd:boolean">false</inputBoolean></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt
new file mode 100644
index 000000000..99dab0b4f
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_024w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 base 024 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_base.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(0);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_base.inc");
+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:echoBoolean><inputBoolean xsi:type="xsd:boolean">false</inputBoolean></ns1:echoBoolean></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:echoBooleanResponse><outputBoolean xsi:type="xsd:boolean">false</outputBoolean></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round2/Base/round2_base.inc b/ext/soap/tests/interop/Round2/Base/round2_base.inc
new file mode 100644
index 000000000..b197f5bdd
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/round2_base.inc
@@ -0,0 +1,80 @@
+<?php
+class SOAP_Interop_Base {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+ function echoStringArray($inputStringArray)
+ {
+ return $inputStringArray;
+ }
+
+
+ function echoInteger($inputInteger)
+ {
+ return $inputInteger;
+ }
+
+ function echoIntegerArray($inputIntegerArray)
+ {
+ return $inputIntegerArray;
+ }
+
+ function echoFloat($inputFloat)
+ {
+ return $inputFloat;
+ }
+
+ function echoFloatArray($inputFloatArray)
+ {
+ return $inputFloatArray;
+ }
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+ function echoStructArray($inputStructArray)
+ {
+ return $inputStructArray;
+ }
+
+ function echoVoid()
+ {
+ return NULL;
+ }
+
+ function echoBase64($b_encoded)
+ {
+ return $b_encoded;
+ }
+
+ function echoDate($timeInstant)
+ {
+ return $timeInstant;
+ }
+
+ function echoHexBinary($hb)
+ {
+ return $hb;
+ }
+
+ function echoDecimal($dec)
+ {
+ return $dec;
+ }
+
+ function echoBoolean($boolean)
+ {
+ return $boolean;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round2_base.wsdl");
+$server->setClass("SOAP_Interop_Base");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round2/Base/round2_base.wsdl b/ext/soap/tests/interop/Round2/Base/round2_base.wsdl
new file mode 100644
index 000000000..c7c70319d
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/round2_base.wsdl
@@ -0,0 +1,332 @@
+<?xml version="1.0"?>
+<definitions name="InteropTest"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:s="http://soapinterop.org/xsd"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://soapinterop.org/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
+ <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+ <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
+ <xsd:complexType name="ArrayOfstring">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="ArrayOfint">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="ArrayOffloat">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="SOAPStruct">
+ <xsd:all>
+ <xsd:element name="varString" type="string"/>
+ <xsd:element name="varInt" type="int"/>
+ <xsd:element name="varFloat" type="float"/>
+ </xsd:all>
+ </xsd:complexType>
+ <xsd:complexType name="ArrayOfSOAPStruct">
+ <xsd:complexContent>
+ <xsd:restriction base="SOAP-ENC:Array">
+ <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </schema>
+ </types>
+
+ <message name="echoStringRequest">
+ <part name="inputString" type="xsd:string" />
+ </message>
+ <message name="echoStringResponse">
+ <part name="outputString" type="xsd:string" />
+ </message>
+ <message name="echoStringArrayRequest">
+ <part name="inputStringArray" type="s:ArrayOfstring" />
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="outputStringArray" type="s:ArrayOfstring" />
+ </message>
+ <message name="echoIntegerRequest">
+ <part name="inputInteger" type="xsd:int" />
+ </message>
+ <message name="echoIntegerResponse">
+ <part name="outputInteger" type="xsd:int" />
+ </message>
+ <message name="echoIntegerArrayRequest">
+ <part name="inputIntegerArray" type="s:ArrayOfint" />
+ </message>
+ <message name="echoIntegerArrayResponse">
+ <part name="outputIntegerArray" type="s:ArrayOfint" />
+ </message>
+ <message name="echoFloatRequest">
+ <part name="inputFloat" type="xsd:float" />
+ </message>
+ <message name="echoFloatResponse">
+ <part name="outputFloat" type="xsd:float" />
+ </message>
+ <message name="echoFloatArrayRequest">
+ <part name="inputFloatArray" type="s:ArrayOffloat" />
+ </message>
+ <message name="echoFloatArrayResponse">
+ <part name="outputFloatArray" type="s:ArrayOffloat" />
+ </message>
+ <message name="echoStructRequest">
+ <part name="inputStruct" type="s:SOAPStruct" />
+ </message>
+ <message name="echoStructResponse">
+ <part name="outputStruct" type="s:SOAPStruct" />
+ </message>
+ <message name="echoStructArrayRequest">
+ <part name="inputStructArray" type="s:ArrayOfSOAPStruct" />
+ </message>
+ <message name="echoStructArrayResponse">
+ <part name="outputStructArray" type="s:ArrayOfSOAPStruct" />
+ </message>
+ <message name="echoVoidRequest">
+ </message>
+ <message name="echoVoidResponse">
+ </message>
+ <message name="echoBase64Request">
+ <part name="inputBase64" type="xsd:base64Binary" />
+ </message>
+ <message name="echoBase64Response">
+ <part name="outputBase64" type="xsd:base64Binary" />
+ </message>
+ <message name="echoDateRequest">
+ <part name="inputDate" type="xsd:dateTime" />
+ </message>
+ <message name="echoDateResponse">
+ <part name="outputDate" type="xsd:dateTime" />
+ </message>
+ <message name="echoHexBinaryRequest">
+ <part name="inputHexBinary" type="xsd:hexBinary" />
+ </message>
+ <message name="echoHexBinaryResponse">
+ <part name="outputHexBinary" type="xsd:hexBinary" />
+ </message>
+ <message name="echoDecimalRequest">
+ <part name="inputDecimal" type="xsd:decimal" />
+ </message>
+ <message name="echoDecimalResponse">
+ <part name="outputDecimal" type="xsd:decimal" />
+ </message>
+ <message name="echoBooleanRequest">
+ <part name="inputBoolean" type="xsd:boolean" />
+ </message>
+ <message name="echoBooleanResponse">
+ <part name="outputBoolean" type="xsd:boolean" />
+ </message>
+
+ <portType name="InteropTestPortType">
+ <operation name="echoString">
+ <input message="tns:echoStringRequest"/>
+ <output message="tns:echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray">
+ <input message="tns:echoStringArrayRequest"/>
+ <output message="tns:echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoInteger">
+ <input message="tns:echoIntegerRequest"/>
+ <output message="tns:echoIntegerResponse"/>
+ </operation>
+ <operation name="echoIntegerArray">
+ <input message="tns:echoIntegerArrayRequest"/>
+ <output message="tns:echoIntegerArrayResponse"/>
+ </operation>
+ <operation name="echoFloat">
+ <input message="tns:echoFloatRequest"/>
+ <output message="tns:echoFloatResponse"/>
+ </operation>
+ <operation name="echoFloatArray">
+ <input message="tns:echoFloatArrayRequest"/>
+ <output message="tns:echoFloatArrayResponse"/>
+ </operation>
+ <operation name="echoStruct">
+ <input message="tns:echoStructRequest"/>
+ <output message="tns:echoStructResponse"/>
+ </operation>
+ <operation name="echoStructArray">
+ <input message="tns:echoStructArrayRequest"/>
+ <output message="tns:echoStructArrayResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoidRequest"/>
+ <output message="tns:echoVoidResponse"/>
+ </operation>
+ <operation name="echoBase64">
+ <input message="tns:echoBase64Request"/>
+ <output message="tns:echoBase64Response"/>
+ </operation>
+ <operation name="echoDate">
+ <input message="tns:echoDateRequest"/>
+ <output message="tns:echoDateResponse"/>
+ </operation>
+ <operation name="echoHexBinary">
+ <input message="tns:echoHexBinaryRequest"/>
+ <output message="tns:echoHexBinaryResponse"/>
+ </operation>
+ <operation name="echoDecimal">
+ <input message="tns:echoDecimalRequest"/>
+ <output message="tns:echoDecimalResponse"/>
+ </operation>
+ <operation name="echoBoolean">
+ <input message="tns:echoBooleanRequest"/>
+ <output message="tns:echoBooleanResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="InteropTestBinding" type="tns:InteropTestPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoInteger">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoIntegerArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoFloat">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoFloatArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStructArray">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoBase64">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoDate">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoHexBinary">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoDecimal">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoBoolean">
+ <soap:operation soapAction="http://" style="rpc"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="InteropTest">
+ <port name="InteropTestPort" binding="tns:InteropTestBinding">
+ <soap:address location="round2_base.inc"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/interop/Round2/Base/skipif.inc b/ext/soap/tests/interop/Round2/Base/skipif.inc
new file mode 100644
index 000000000..fa8574e6a
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/Base/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt
new file mode 100644
index 000000000..d15b16907
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 groupB 001 (php/direct): echoStructAsSimpleTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStructAsSimpleTypes", array((object)array('varString'=>"arg",'varInt'=>34,'varFloat'=>34.345)), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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
new file mode 100644
index 000000000..431ab88b4
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round2 groupB 001 (soap/direct): echoStructAsSimpleTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar("arg", XSD_STRING, null, null, "varString"),
+ new SoapVar(34, XSD_INT, null, null, "varInt"),
+ new SoapVar(34.345, XSD_FLOAT, null, null, "varFloat")
+ ), SOAP_ENC_OBJECT, "SOAPStruct", "http://soapinterop.org/xsd"), "inputStruct");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoStructAsSimpleTypes", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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
new file mode 100644
index 000000000..ae589b6fa
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 groupB 001 (php/wsdl): echoStructAsSimpleTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStructAsSimpleTypes((object)array('varString'=>"arg",'varInt'=>34,'varFloat'=>34.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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
new file mode 100644
index 000000000..9feba58f1
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 groupB 002 (php/direct): echoSimpleTypesAsStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoSimpleTypesAsStruct", array("arg",34,34.345), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+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
new file mode 100644
index 000000000..cf1caa4b6
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 groupB 002 (soap/direct): echoSimpleTypesAsStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoSimpleTypesAsStruct", array(
+ new SoapParam(new SoapVar("arg",XSD_STRING), "inputString"),
+ new SoapParam(new SoapVar(34,XSD_INT), "inputInteger"),
+ new SoapParam(new SoapVar(34.345,XSD_FLOAT), "inputFloat")), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+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
new file mode 100644
index 000000000..08369f8ed
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round2 groupB 002 (php/wsdl): echoSimpleTypesAsStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSimpleTypesAsStruct("arg",34,34.345);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+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
new file mode 100644
index 000000000..6a5c1f04e
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 groupB 003 (php/direct): echo2DStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = array(
+ array('row0col0', 'row0col1', 'row0col2'),
+ array('row1col0', 'row1col1', 'row1col2'));
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echo2DStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+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
new file mode 100644
index 000000000..cfcb8bb2f
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt
@@ -0,0 +1,31 @@
+--TEST--
+SOAP Interop Round2 groupB 003 (soap/direct): echo2DStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar(array(
+ new SoapVar('row0col0', XSD_STRING),
+ new SoapVar('row0col1', XSD_STRING),
+ new SoapVar('row0col2', XSD_STRING)
+ ), SOAP_ENC_ARRAY),
+ new SoapVar(array(
+ new SoapVar('row1col0', XSD_STRING),
+ new SoapVar('row1col1', XSD_STRING),
+ new SoapVar('row1col2', XSD_STRING)
+ ), SOAP_ENC_ARRAY)
+ ), SOAP_ENC_ARRAY, "ArrayOfString2D", "http://soapinterop.org/xsd"),"input2DStringArray");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echo2DStringArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..685458691
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SOAP Interop Round2 groupB 003 (php/wsdl): echo2DStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = array(
+ array('row0col0', 'row0col1', 'row0col2'),
+ array('row1col0', 'row1col1', 'row1col2'));
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echo2DStringArray($param);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+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>
+<?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>
+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
new file mode 100644
index 000000000..32fff9896
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP Interop Round2 groupB 004 (php/direct): echoNestedStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = (object)array(
+ 'varString' => "arg",
+ 'varInt' => 34,
+ 'varFloat' => 123.45,
+ 'varStruct' => (object)array(
+ 'varString' => "arg2",
+ 'varInt' => 342,
+ 'varFloat' => 123.452,
+ ));
+
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoNestedStruct", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..cf1c950ae
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP Interop Round2 groupB 004 (soap/direct): echoNestedStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar("arg", XSD_STRING, null, null, "varString"),
+ new SoapVar(34, XSD_INT, null, null, "varInt"),
+ new SoapVar(123.45, XSD_FLOAT, null, null, "varFloat"),
+ new SoapVar(array(
+ new SoapVar("arg2", XSD_STRING, null, null, "varString"),
+ new SoapVar(342, XSD_INT, null, null, "varInt"),
+ new SoapVar(123.452, XSD_FLOAT, null, null, "varFloat")
+ ), SOAP_ENC_OBJECT, "SOAPStruct", "http://soapinterop.org/xsd", 'varStruct')
+ ), SOAP_ENC_OBJECT, "SOAPStructStruct", "http://soapinterop.org/xsd"), "inputStruct");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoNestedStruct", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..33112492a
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP Interop Round2 groupB 004 (php/wsdl): echoNestedStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = (object)array(
+ 'varString' => "arg",
+ 'varInt' => 34,
+ 'varFloat' => 123.45,
+ 'varStruct' => (object)array(
+ 'varString' => "arg2",
+ 'varInt' => 342,
+ 'varFloat' => 123.452,
+ ));
+
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedStruct($param);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..1b5c7bd81
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round2 groupB 005 (php/direct): echoNestedArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325,
+ 'varArray' => array('red','blue','green'));
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoNestedArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..ec03a8550
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP Interop Round2 groupB 005 (soap/direct): echoNestedArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = new SoapParam(new SoapVar(array(
+ new SoapVar("arg", XSD_STRING, null, null, "varString"),
+ new SoapVar(34, XSD_INT, null, null, "varInt"),
+ new SoapVar(325.325, XSD_FLOAT, null, null, "varFloat"),
+ new SoapVar(array(
+ new SoapVar("red", XSD_STRING),
+ new SoapVar("blue", XSD_STRING),
+ new SoapVar("green", XSD_STRING),
+ ), SOAP_ENC_ARRAY, "ArrayOfString", "http://soapinterop.org/xsd", 'varArray')
+ ), SOAP_ENC_OBJECT, "SOAPArrayStruct", "http://soapinterop.org/xsd"), "inputStruct");
+$client = new SoapClient(NULL,array("location"=>"test://","uri"=>"http://soapinterop.org/","trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoNestedArray", array($param), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..305ca4a4b
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SOAP Interop Round2 groupB 005 (php/wsdl): echoNestedArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$param = (object)array(
+ 'varString'=>'arg',
+ 'varInt'=>34,
+ 'varFloat'=>325.325,
+ 'varArray' => array('red','blue','green'));
+$client = new SoapClient(dirname(__FILE__)."/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedArray($param);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round2_groupB.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc
new file mode 100644
index 000000000..ef00e3bfd
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.inc
@@ -0,0 +1,37 @@
+<?php
+class SOAP_Interop_GroupB {
+
+ function echoStructAsSimpleTypes ($struct)
+ {
+ return array('outputString' => $struct->varString,
+ 'outputInteger' => $struct->varInt,
+ 'outputFloat' => $struct->varFloat);
+ }
+
+ function echoSimpleTypesAsStruct($string, $int, $float)
+ {
+ return (object)array("varString" => $string,
+ "varInt" => $int,
+ "varFloat" => $float);
+ }
+
+ function echoNestedStruct($struct)
+ {
+ return $struct;
+ }
+
+ function echo2DStringArray($ary)
+ {
+ return $ary;
+ }
+
+ function echoNestedArray($ary)
+ {
+ return $ary;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round2_groupB.wsdl");
+$server->setClass("SOAP_Interop_GroupB");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl
new file mode 100644
index 000000000..8fc2a1b11
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/round2_groupB.wsdl
@@ -0,0 +1,192 @@
+<?xml version="1.0"?>
+<definitions name="InteropTest"
+ targetNamespace="http://soapinterop.org/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:s="http://soapinterop.org/xsd"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://soapinterop.org/xsd">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
+
+ <complexType name="ArrayOfstring">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOfint">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOffloat">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOfSOAPStruct">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ </all>
+ </complexType>
+ <complexType name="SOAPStructStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ <element name="varStruct" type="s:SOAPStruct"/>
+ </all>
+ </complexType>
+ <complexType name="SOAPArrayStruct">
+ <all>
+ <element name="varString" type="string" nillable="true"/>
+ <element name="varInt" type="int" nillable="true"/>
+ <element name="varFloat" type="float" nillable="true"/>
+ <element name="varArray" type="s:ArrayOfstring"/>
+ </all>
+ </complexType>
+ <complexType name="ArrayOfString2D">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[,]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="echoStructAsSimpleTypesRequest">
+ <part name="inputStruct" type="s:SOAPStruct"/>
+ </message>
+ <message name="echoStructAsSimpleTypesResponse">
+ <part name="outputString" type="xsd:string"/>
+ <part name="outputInteger" type="xsd:int"/>
+ <part name="outputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoSimpleTypesAsStructRequest">
+ <part name="inputString" type="xsd:string"/>
+ <part name="inputInteger" type="xsd:int"/>
+ <part name="inputFloat" type="xsd:float"/>
+ </message>
+ <message name="echoSimpleTypesAsStructResponse">
+ <part name="return" type="s:SOAPStruct"/>
+ </message>
+ <message name="echo2DStringArrayRequest">
+ <part name="input2DStringArray" type="s:ArrayOfString2D"/>
+ </message>
+ <message name="echo2DStringArrayResponse">
+ <part name="return" type="s:ArrayOfString2D"/>
+ </message>
+ <message name="echoNestedStructRequest">
+ <part name="inputStruct" type="s:SOAPStructStruct"/>
+ </message>
+ <message name="echoNestedStructResponse">
+ <part name="return" type="s:SOAPStructStruct"/>
+ </message>
+ <message name="echoNestedArrayRequest">
+ <part name="inputStruct" type="s:SOAPArrayStruct"/>
+ </message>
+ <message name="echoNestedArrayResponse">
+ <part name="return" type="s:SOAPArrayStruct"/>
+ </message>
+
+ <portType name="InteropTestPortTypeB">
+ <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat">
+ <input message="tns:echoStructAsSimpleTypesRequest" name="echoStructAsSimpleTypes"/>
+ <output message="tns:echoStructAsSimpleTypesResponse" name="echoStructAsSimpleTypesResponse"/>
+ </operation>
+ <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat">
+ <input message="tns:echoSimpleTypesAsStructRequest" name="echoSimpleTypesAsStruct"/>
+ <output message="tns:echoSimpleTypesAsStructResponse" name="echoSimpleTypesAsStructResponse"/>
+ </operation>
+ <operation name="echo2DStringArray" parameterOrder="input2DStringArray">
+ <input message="tns:echo2DStringArrayRequest" name="echo2DStringArray"/>
+ <output message="tns:echo2DStringArrayResponse" name="echo2DStringArrayResponse"/>
+ </operation>
+ <operation name="echoNestedStruct" parameterOrder="inputStruct">
+ <input message="tns:echoNestedStructRequest" name="echoNestedStruct"/>
+ <output message="tns:echoNestedStructResponse" name="echoNestedStructResponse"/>
+ </operation>
+ <operation name="echoNestedArray" parameterOrder="inputStruct">
+ <input message="tns:echoNestedArrayRequest" name="echoNestedArray"/>
+ <output message="tns:echoNestedArrayResponse" name="echoNestedArrayResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="InteropTestSoapBindingB" type="tns:InteropTestPortTypeB">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoStructAsSimpleTypes">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoSimpleTypesAsStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echo2DStringArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoNestedStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoNestedArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="interopLabB">
+ <port name="interopTestPortB" binding="tns:InteropTestSoapBindingB">
+ <soap:address location="round2_groupB.inc"/>
+ </port>
+ </service>
+
+</definitions>
diff --git a/ext/soap/tests/interop/Round2/GroupB/skipif.inc b/ext/soap/tests/interop/Round2/GroupB/skipif.inc
new file mode 100644
index 000000000..fa8574e6a
--- /dev/null
+++ b/ext/soap/tests/interop/Round2/GroupB/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl b/ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl
new file mode 100644
index 000000000..26ab6dbdd
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/imported/import1B.wsdl
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/definitions/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types/>
+ <message name="echoStringRequest">
+ <part name="x" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="Result" type="xsd:string"/>
+ </message>
+ <portType name="SoapInteropImport1PortType">
+ <operation name="echoString" parameterOrder="x">
+ <input message="wsdlns:echoStringRequest"/>
+ <output message="wsdlns:echoStringResponse"/>
+ </operation>
+ </portType>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl
new file mode 100644
index 000000000..8a397bc0b
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.wsdl
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/definitions/"
+ xmlns:typens="http://soapinterop.org/xsd"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <import location="import2B.xsd" namespace="http://soapinterop.org/xsd" />
+ <message name='Server.echoStruct'>
+ <part name='inputStruct' type='typens:SOAPStruct'/>
+ </message>
+ <message name='Server.echoStructResponse'>
+ <part name='Result' type='typens:SOAPStruct'/>
+ </message>
+
+ <portType name="SoapInteropImport2PortType">
+ <operation name='echoStruct' parameterOrder='inputStruct'>
+ <input message='wsdlns:Server.echoStruct' />
+ <output message='wsdlns:Server.echoStructResponse' />
+ </operation>
+ </portType>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd
new file mode 100644
index 000000000..b35eded4f
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/imported/import2B.xsd
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<schema targetNamespace='http://soapinterop.org/xsd'
+ xmlns='http://www.w3.org/2001/XMLSchema'
+ elementFormDefault='unqualified'>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varString" type="string" />
+ <element name="varInt" type="int" />
+ <element name="varFloat" type="float" />
+ </all>
+ </complexType>
+</schema> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt
new file mode 100644
index 000000000..8718693cb
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP Interop Round3 GroupD Compound1 001 (php/wsdl): echoPerson
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Person {
+ function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) {
+ $this->Age = $a;
+ $this->ID = $i;
+ $this->Name = $n;
+ $this->Male = $m;
+ }
+}
+$person = new Person(32,12345,'Shane',TRUE);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound1.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoPerson($person);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_compound1.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:x_Person Name="Shane" Male="true"><ns1:Age>32</ns1:Age><ns1:ID>12345</ns1:ID></ns1:x_Person></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/xsd"><SOAP-ENV:Body><ns1:result_Person Name="Shane" Male="true"><ns1:Age>32</ns1:Age><ns1:ID>12345</ns1:ID></ns1:result_Person></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt
new file mode 100644
index 000000000..a2b08d801
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_002w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD Compound1 002 (php/wsdl): echoDocument
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound1.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDocument("Test Document Here");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_compound1.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:x_Document>Test Document Here</ns1:x_Document></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/xsd"><SOAP-ENV:Body><ns1:result_Document>Test Document Here</ns1:result_Document></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt
new file mode 100644
index 000000000..a961d118e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_003w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD Compound1 003 (php/wsdl): echoDocument
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound1.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDocument((object)array("_"=>"Test Document Here","ID"=>1));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_compound1.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:x_Document ID="1">Test Document Here</ns1:x_Document></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/xsd"><SOAP-ENV:Body><ns1:result_Document ID="1">Test Document Here</ns1:result_Document></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt
new file mode 100644
index 000000000..79830f410
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Interop Round3 GroupD Compound2 001 (php/wsdl): echoEmployee
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Person {
+ function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) {
+ $this->Age = $a;
+ $this->ID = $i;
+ $this->Name = $n;
+ $this->Male = $m;
+ }
+}
+class Employee {
+ function Employee($person=NULL,$id=NULL,$salary=NULL) {
+ $this->person = $person;
+ $this->ID = $id;
+ $this->salary = $salary;
+ }
+}
+$person = new Person(32,12345,'Shane',TRUE);
+$employee = new Employee($person,12345,1000000.00);
+
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_compound2.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoEmployee($employee);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_compound2.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/person" xmlns:ns2="http://soapinterop.org/employee"><SOAP-ENV:Body><ns2:x_Employee><ns2:person><ns1:Name>Shane</ns1:Name><ns1:Male>true</ns1:Male></ns2:person><ns2:salary>1000000</ns2:salary><ns2:ID>12345</ns2:ID></ns2:x_Employee></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/person" xmlns:ns2="http://soapinterop.org/employee"><SOAP-ENV:Body><ns2:result_Employee><ns2:person><ns1:Name>Shane</ns1:Name><ns1:Male>true</ns1:Male></ns2:person><ns2:salary>1000000</ns2:salary><ns2:ID>12345</ns2:ID></ns2:result_Employee></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt
new file mode 100644
index 000000000..bacad8691
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></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/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt
new file mode 100644
index 000000000..17301bf7b
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_002w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit 002 (php/wsdl): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringArrayParam><ns1:string>one</ns1:string><ns1:string>two</ns1:string><ns1:string>three</ns1:string></ns1:echoStringArrayParam></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/xsd"><SOAP-ENV:Body><ns1:echoStringArrayReturn><ns1:string>one</ns1:string><ns1:string>two</ns1:string><ns1:string>three</ns1:string></ns1:echoStringArrayReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt
new file mode 100644
index 000000000..c9c217292
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit 003 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStructParam><ns1:varFloat>325.325</ns1:varFloat><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString></ns1:echoStructParam></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/xsd"><SOAP-ENV:Body><ns1:echoStructReturn><ns1:varFloat>325.325</ns1:varFloat><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString></ns1:echoStructReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt
new file mode 100644
index 000000000..7193bf85a
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_004w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit 004 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclit.inc");
+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: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:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt
new file mode 100644
index 000000000..3b1f17633
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit Parameters 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(array("param0"=>"Hello World"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclitparams.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoString><ns1:param0>Hello World</ns1:param0></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/xsd"><SOAP-ENV:Body><ns1:echoStringResponse><ns1:return>Hello World</ns1:return></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt
new file mode 100644
index 000000000..d44409bf6
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_002w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit Parameters 002 (php/wsdl): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array("param0"=>array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclitparams.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringArray><ns1:param0><ns1:string>one</ns1:string><ns1:string>two</ns1:string><ns1:string>three</ns1:string></ns1: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/xsd"><SOAP-ENV:Body><ns1:echoStringArrayResponse><ns1:return><ns1:string>one</ns1:string><ns1:string>two</ns1:string><ns1:string>three</ns1:string></ns1:return></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt
new file mode 100644
index 000000000..0c3aa1cdd
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit Parameters 003 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct(array("param0"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclitparams.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStruct><ns1:param0><ns1:varFloat>325.325</ns1:varFloat><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString></ns1: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/xsd"><SOAP-ENV:Body><ns1:echoStructResponse><ns1:return><ns1:varFloat>325.325</ns1:varFloat><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString></ns1:return></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt
new file mode 100644
index 000000000..7ee4aa29a
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_004w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD Doc Lit Parameters 004 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_doclitparams.inc");
+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/xsd"><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/xsd"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt
new file mode 100644
index 000000000..9c2e756fb
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_emptysa_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD EmptySA 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_emptysa.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_emptysa.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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: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><a xsi:type="xsd:string">Hello World</a></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/" 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><Result xsi:type="xsd:string">Hello World</Result></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt
new file mode 100644
index 000000000..181fc8ad7
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import1_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD Import1 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import1.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_import1.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/echoString/" 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><x xsi:type="xsd:string">Hello World</x></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/echoStringResponse/" 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><Result xsi:type="xsd:string">Hello World</Result></ns1:echoStringResponse></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
new file mode 100644
index 000000000..bed81e9e2
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round3 GroupD Import2 001 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import2.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_import2.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..b9e483bf2
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round3 GroupD Import3 001 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import3.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_import3.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..230ac1881
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round3 GroupD Import3 002 (php/wsdl): echoStructArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_import3.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStructArray(array($struct,$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_import3.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt
new file mode 100644
index 000000000..26612d0c5
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD RPC Encoded 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:echoString><param0 xsi:type="xsd:string">Hello World</param0></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/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:echoStringResponse><return xsi:type="xsd:string">Hello World</return></ns1:echoStringResponse></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
new file mode 100644
index 000000000..e9bb31952
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD RPC Encoded 002 (php/wsdl): echoStringArray
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringArray(array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..820b1d25e
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round3 GroupD RPC Encoded 003 (php/wsdl): echoStruct
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStruct($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+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
new file mode 100644
index 000000000..fc6bb07ab
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupD RPC Encoded 004 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupD_rpcenc.inc");
+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>
+<?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>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc
new file mode 100644
index 000000000..0525b0b51
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.inc
@@ -0,0 +1,17 @@
+<?php
+class SOAP_Interop_GroupD {
+ function echoPerson($person)
+ {
+ return $person;
+ }
+
+ function echoDocument($doc)
+ {
+ return $doc;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_compound1.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl
new file mode 100644
index 000000000..6a8f85182
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound1.wsdl
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInteropCompound"
+ targetNamespace="http://soapinterop.org/"
+ xmlns:wsdlns="http://soapinterop.org/"
+ xmlns:typens="http://soapinterop.org/xsd"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ >
+ <complexType name="Person">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" name="Age" type="double"/>
+ <element minOccurs="1" maxOccurs="1" name="ID" type="xsd:float"/>
+ </sequence>
+ <attribute name="Name" type="string"/>
+ <attribute name="Male" type="boolean"/>
+ </complexType>
+ <element name="x_Person" type="typens:Person"/>
+ <element name="result_Person" type="typens:Person"/>
+
+ <complexType name="Document">
+ <simpleContent>
+ <extension base="string">
+ <xsd:attribute name ="ID" type="string"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <element name="x_Document" type="typens:Document"/>
+ <element name="result_Document" type="typens:Document"/>
+ </schema>
+ </types>
+ <message name="echoPerson">
+ <part name="x" element="typens:x_Person"/>
+ </message>
+ <message name="echoPersonResponse">
+ <part name="Result" element="typens:result_Person"/>
+ </message>
+ <message name="echoDocument">
+ <part name="x" element="typens:x_Document"/>
+ </message>
+ <message name="echoDocumentResponse">
+ <part name="Result" element="typens:result_Document"/>
+ </message>
+ <portType name="SoapInteropCompound1PortType">
+ <operation name="echoPerson" parameterOrder="x">
+ <input message="wsdlns:echoPerson"/>
+ <output message="wsdlns:echoPersonResponse"/>
+ </operation>
+ <operation name="echoDocument" parameterOrder="x">
+ <input message="wsdlns:echoDocument"/>
+ <output message="wsdlns:echoDocumentResponse"/>
+ </operation>
+ </portType>
+ <binding name="SoapInteropCompound1Binding" type="wsdlns:SoapInteropCompound1PortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoPerson">
+ <soap:operation soapAction="http://soapinterop/echoPerson"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoDocument">
+ <soap:operation soapAction="http://soapinterop/echoDocument"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+
+ </binding>
+ <service name="Compound1">
+ <port name="SoapInteropCompound1Port" binding="wsdlns:SoapInteropCompound1Binding">
+ <soap:address location="round3_groupD_compound1.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc
new file mode 100644
index 000000000..81b96cdbf
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.inc
@@ -0,0 +1,12 @@
+<?php
+class SOAP_Interop_GroupD {
+ function echoEmployee($employee)
+ {
+ return $employee;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_compound2.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl
new file mode 100644
index 000000000..e8b63e015
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_compound2.wsdl
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInteropCompound" targetNamespace="http://soapinterop.org/"
+ xmlns:wsdlns="http://soapinterop.org/"
+ xmlns:emp="http://soapinterop.org/employee"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/person"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <complexType name="Person">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" name="Name" type="string"/>
+ <element minOccurs="1" maxOccurs="1" name="Male" type="boolean"/>
+ </sequence>
+ </complexType>
+ </schema>
+ <schema targetNamespace = "http://soapinterop.org/employee"
+ xmlns:prs = "http://soapinterop.org/person"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+ <import namespace="http://soapinterop.org/person" />
+ <complexType name="Employee">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" name="person" type="prs:Person"/>
+ <element minOccurs="1" maxOccurs="1" name="salary" type="double"/>
+ <element minOccurs="1" maxOccurs="1" name="ID" type="int"/>
+ </sequence>
+ </complexType>
+ <element name="x_Employee" type="emp:Employee"/>
+ <element name="result_Employee" type="emp:Employee"/>
+ </schema>
+ </types>
+ <message name="echoEmployee">
+ <part name="x" element="emp:x_Employee"/>
+ </message>
+ <message name="echoEmployeeResponse">
+ <part name="result" element="emp:result_Employee"/>
+ </message>
+ <portType name="SoapInteropCompound2PortType">
+ <operation name="echoEmployee" parameterOrder="x">
+ <input message="wsdlns:echoEmployee"/>
+ <output message="wsdlns:echoEmployeeResponse"/>
+ </operation>
+ </portType>
+ <binding name="SoapInteropCompound2Binding" type="wsdlns:SoapInteropCompound2PortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoEmployee">
+ <soap:operation soapAction="#echoEmployee"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Compound2">
+ <port name="SoapInteropCompound2Port" binding="wsdlns:SoapInteropCompound2Binding">
+ <soap:address location="round3_groupD_compound2.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc
new file mode 100644
index 000000000..8ca0338f5
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.inc
@@ -0,0 +1,28 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+ function echoStringArray($inputStringArray)
+ {
+ return $inputStringArray;
+ }
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+ function echoVoid()
+ {
+ return NULL;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_doclit.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl
new file mode 100644
index 000000000..4febca899
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclit.wsdl
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestDocLitService"
+ targetNamespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/WSDLInteropTestDocLit"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ elementFormDefault="qualified">
+ <complexType name="ArrayOfstring_literal">
+ <sequence>
+ <element maxOccurs="unbounded" minOccurs="1" name="string" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varString" type="xsd:string"/>
+ </all>
+ </complexType>
+
+ <element name="echoStringParam" type="xsd:string"/>
+
+ <element name="echoStringReturn" type="xsd:string"/>
+ <element name="echoStringArrayParam" type="xsd1:ArrayOfstring_literal"/>
+
+ <element name="echoStringArrayReturn" type="xsd1:ArrayOfstring_literal"/>
+
+ <element name="echoStructParam" type="xsd1:SOAPStruct"/>
+
+ <element name="echoStructReturn" type="xsd1:SOAPStruct"/>
+ </schema>
+ </types>
+ <message name="echoString">
+ <part element="xsd1:echoStringParam" name="a"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="xsd1:echoStringReturn" name="result"/>
+ </message>
+ <message name="echoStringArray">
+ <part element="xsd1:echoStringArrayParam" name="a"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part element="xsd1:echoStringArrayReturn" name="result"/>
+ </message>
+ <message name="echoStruct">
+ <part element="xsd1:echoStructParam" name="a"/>
+ </message>
+ <message name="echoStructResponse">
+ <part element="xsd1:echoStructReturn" name="result"/>
+ </message>
+ <message name="echoVoid"/>
+ <message name="echoVoidResponse"/>
+
+ <portType name="WSDLInteropTestDocLitPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray">
+ <input message="tns:echoStringArray" name="echoStringArray"/>
+ <output message="tns:echoStringArrayResponse" name="echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoStruct">
+ <input message="tns:echoStruct" name="echoStruct"/>
+ <output message="tns:echoStructResponse" name="echoStructResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoid" name="echoVoid"/>
+ <output message="tns:echoVoidResponse" name="echoVoidResponse"/>
+ </operation>
+ </portType>
+ <binding name="WSDLInteropTestDocLitPortBinding"
+ type="tns:WSDLInteropTestDocLitPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoString">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoStringArray">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringArrayResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoStruct">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStructResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoVoid">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoVoidResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="WSDLInteropTestDocLitService">
+ <port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort">
+ <soap:address
+ location="round3_groupD_doclit.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc
new file mode 100644
index 000000000..2042cfc17
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.inc
@@ -0,0 +1,29 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return array("return"=>$inputString->param0);
+ }
+
+ function echoStringArray($inputStringArray)
+ {
+ return array("return"=>$inputStringArray->param0);
+ }
+
+ function echoStruct($inputStruct)
+ {
+ return array("return"=>$inputStruct->param0);
+ }
+
+ function echoVoid()
+ {
+ return NULL;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_doclitparams.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl
new file mode 100644
index 000000000..9ecf1e170
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_doclitparams.wsdl
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestDocLitService"
+ targetNamespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/WSDLInteropTestDocLit"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified">
+ <complexType name="ArrayOfstring_literal">
+ <sequence>
+ <element maxOccurs="unbounded" minOccurs="1" name="string" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varString" type="xsd:string"/>
+ </all>
+ </complexType>
+
+ <element name="echoString">
+ <complexType>
+ <sequence>
+ <element name="param0" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStringResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStringArray">
+ <complexType>
+ <sequence>
+ <element name="param0" type="xsd1:ArrayOfstring_literal"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStringArrayResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="xsd1:ArrayOfstring_literal"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStruct">
+ <complexType>
+ <sequence>
+ <element name="param0" type="xsd1:SOAPStruct"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoStructResponse">
+ <complexType>
+ <sequence>
+ <element name="return" type="xsd1:SOAPStruct"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoVoid">
+ <complexType/>
+ </element>
+ <element name="echoVoidResponse">
+ <complexType/>
+ </element>
+ </schema>
+ </types>
+ <message name="echoString">
+ <part element="xsd1:echoString" name="parameters"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="xsd1:echoStringResponse" name="parameters"/>
+ </message>
+ <message name="echoStringArray">
+ <part element="xsd1:echoStringArray" name="parameters"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part element="xsd1:echoStringArrayResponse" name="parameters"/>
+ </message>
+ <message name="echoStruct">
+ <part element="xsd1:echoStruct" name="parameters"/>
+ </message>
+ <message name="echoStructResponse">
+ <part element="xsd1:echoStructResponse" name="parameters"/>
+ </message>
+ <message name="echoVoid">
+ <part element="xsd1:echoVoid" name="parameters"/>
+ </message>
+ <message name="echoVoidResponse">
+ <part element="xsd1:echoVoidResponse" name="parameters"/>
+ </message>
+ <portType name="WSDLInteropTestDocLitPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray">
+ <input message="tns:echoStringArray" name="echoStringArray"/>
+ <output message="tns:echoStringArrayResponse" name="echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoStruct">
+ <input message="tns:echoStruct" name="echoStruct"/>
+ <output message="tns:echoStructResponse" name="echoStructResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoid" name="echoVoid"/>
+ <output message="tns:echoVoidResponse" name="echoVoidResponse"/>
+ </operation>
+ </portType>
+ <binding name="WSDLInteropTestDocLitPortBinding"
+ type="tns:WSDLInteropTestDocLitPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoString">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoStringArray">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringArrayResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoStruct">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStructResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoVoid">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoVoidResponse">
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="WSDLInteropTestDocLitService">
+ <port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort">
+ <soap:address
+ location="round3_groupD_doclitparams.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc
new file mode 100644
index 000000000..b239c4543
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.inc
@@ -0,0 +1,14 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_emptysa.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl
new file mode 100644
index 000000000..09a09a4cd
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_emptysa.wsdl
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop/"
+ xmlns:wsdlns="http://soapinterop/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types/>
+ <message name="echoStringRequest">
+ <part name="a" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="Result" type="xsd:string"/>
+ </message>
+ <portType name="SoapInteropEmptySAPortType">
+ <operation name="echoString" parameterOrder="a">
+ <input message="wsdlns:echoStringRequest"/>
+ <output message="wsdlns:echoStringResponse"/>
+ </operation>
+ </portType>
+ <binding name="SoapInteropEmptySABinding" type="wsdlns:SoapInteropEmptySAPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="EmptySA">
+ <port name="SoapInteropEmptySAPort" binding="wsdlns:SoapInteropEmptySABinding">
+ <soap:address location="round3_groupD_emptysa.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc
new file mode 100644
index 000000000..2e56d1897
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.inc
@@ -0,0 +1,14 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_import1.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl
new file mode 100644
index 000000000..d92883000
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import1.wsdl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/"
+ xmlns:wsdlns1="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <import location="imported/import1B.wsdl" namespace="http://soapinterop.org/definitions/" />
+
+ <binding name="SoapInteropImport1Binding" type="wsdlns1:SoapInteropImport1PortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/echoString/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/echoStringResponse/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Import1">
+ <port name="SoapInteropImport1Port" binding="wsdlns:SoapInteropImport1Binding">
+ <soap:address location="round3_groupD_import1.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc
new file mode 100644
index 000000000..a0893c6b7
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.inc
@@ -0,0 +1,14 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_import2.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl
new file mode 100644
index 000000000..fc0f8ae7f
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2.wsdl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/main/"
+ xmlns:wsdlns1="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/main/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <import location="imported/import2B.wsdl" namespace="http://soapinterop.org/definitions/" />
+
+ <binding name="SoapInteropImport2Binding" type="wsdlns1:SoapInteropImport2PortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Import2">
+ <port name="SoapInteropImport2Port" binding="wsdlns:SoapInteropImport2Binding">
+ <soap:address location="round3_groupD_import2.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl
new file mode 100644
index 000000000..fc0f8ae7f
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/main/"
+ xmlns:wsdlns1="http://soapinterop.org/definitions/"
+ xmlns:wsdlns="http://soapinterop.org/main/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <import location="imported/import2B.wsdl" namespace="http://soapinterop.org/definitions/" />
+
+ <binding name="SoapInteropImport2Binding" type="wsdlns1:SoapInteropImport2PortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Import2">
+ <port name="SoapInteropImport2Port" binding="wsdlns:SoapInteropImport2Binding">
+ <soap:address location="round3_groupD_import2.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc
new file mode 100644
index 000000000..398f97ecf
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.inc
@@ -0,0 +1,19 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+ function echoStructArray($inputStructArray)
+ {
+ return $inputStructArray;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_import3.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl
new file mode 100644
index 000000000..3dd264208
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_import3.wsdl
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="SoapInterop" targetNamespace="http://soapinterop.org/main2/"
+ xmlns:wsdlns="http://soapinterop.org/main2/"
+ xmlns:impns="http://soapinterop.org/definitions/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:typens2="http://soapinterop.org/xsd2"
+ xmlns:typens="http://soapinterop.org/xsd"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <import namespace = "http://soapinterop.org/xsd" location = "round3_groupD_import2.wsdl"/>
+ <import namespace = "http://soapinterop.org/definitions/" location = "round3_groupD_import2.wsdl"/>
+
+ <types>
+ <schema targetNamespace='http://soapinterop.org/xsd2'
+ xmlns='http://www.w3.org/2001/XMLSchema'
+ xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
+ xmlns:wsdl = "http://schemas.xmlsoap.org/wsdl/"
+ elementFormDefault='unqualified'>
+ <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
+ <import namespace = "http://soapinterop.org/xsd"/>
+ <complexType name ='ArrayOfSOAPStruct'>
+ <complexContent>
+ <restriction base='SOAP-ENC:Array'>
+ <attribute ref='SOAP-ENC:arrayType' wsdl:arrayType='typens:SOAPStruct[]'/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name='Server.echoStructArray'>
+ <part name='inputArray' type='typens2:ArrayOfSOAPStruct'/>
+ </message>
+ <message name='Server.echoStructArrayResponse'>
+ <part name='Result' type='typens2:ArrayOfSOAPStruct'/>
+ </message>
+
+ <portType name="SoapInteropImport3PortType">
+ <operation name='echoStruct' parameterOrder='inputStruct'>
+ <input message='impns:Server.echoStruct' />
+ <output message='impns:Server.echoStructResponse' />
+ </operation>
+ <operation name='echoStructArray' parameterOrder='inputArray'>
+ <input message='wsdlns:Server.echoStructArray' />
+ <output message='wsdlns:Server.echoStructArrayResponse' />
+ </operation>
+ </portType>
+
+ <binding name="SoapInteropImport3Binding" type="wsdlns:SoapInteropImport3PortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoStruct">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="echoStructArray">
+ <soap:operation soapAction="http://soapinterop.org/"/>
+ <input>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Import3">
+ <port name="SoapInteropImport3Port" binding="wsdlns:SoapInteropImport3Binding">
+ <soap:address location="round3_groupD_import3.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc
new file mode 100644
index 000000000..645ab3a61
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.inc
@@ -0,0 +1,28 @@
+<?php
+class SOAP_Interop_GroupD {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+ function echoStringArray($inputStringArray)
+ {
+ return $inputStringArray;
+ }
+
+ function echoStruct($inputStruct)
+ {
+ return $inputStruct;
+ }
+
+ function echoVoid()
+ {
+ return NULL;
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupD_rpcenc.wsdl");
+$server->setClass("SOAP_Interop_GroupD");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl
new file mode 100644
index 000000000..5e24411a3
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/round3_groupD_rpcenc.wsdl
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestRpcEncService"
+ targetNamespace="http://soapinterop.org/WSDLInteropTestRpcEnc"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/WSDLInteropTestRpcEnc"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified">
+ <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="ArrayOfstring">
+ <complexContent>
+ <restriction base="SOAP-ENC:Array">
+ <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="SOAPStruct">
+ <all>
+ <element name="varFloat" type="xsd:float"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varString" type="xsd:string"/>
+ </all>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="echoString">
+ <part name="param0" type="xsd:string"/>
+ </message>
+ <message name="echoStringResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+ <message name="echoStringArray">
+ <part name="param0" type="xsd1:ArrayOfstring"/>
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="return" type="xsd1:ArrayOfstring"/>
+ </message>
+ <message name="echoStruct">
+ <part name="param0" type="xsd1:SOAPStruct"/>
+ </message>
+ <message name="echoStructResponse">
+ <part name="return" type="xsd1:SOAPStruct"/>
+ </message>
+ <message name="echoVoid"/>
+ <message name="echoVoidResponse"/>
+ <portType name="WSDLInteropTestRpcEncPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ <operation name="echoStringArray">
+ <input message="tns:echoStringArray" name="echoStringArray"/>
+ <output message="tns:echoStringArrayResponse" name="echoStringArrayResponse"/>
+ </operation>
+ <operation name="echoStruct">
+ <input message="tns:echoStruct" name="echoStruct"/>
+ <output message="tns:echoStructResponse" name="echoStructResponse"/>
+ </operation>
+ <operation name="echoVoid">
+ <input message="tns:echoVoid" name="echoVoid"/>
+ <output message="tns:echoVoidResponse" name="echoVoidResponse"/>
+ </operation>
+ </portType>
+ <binding name="WSDLInteropTestRpcEncPortBinding"
+ type="tns:WSDLInteropTestRpcEncPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="echoString">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output name="echoStringResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="echoStringArray">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output name="echoStringArrayResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+ <operation name="echoStruct">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="echoStruct">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output name="echoStructResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+ <operation name="echoVoid">
+ <soap:operation soapAction="" style="rpc"/>
+ <input name="echoVoid">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output name="echoVoidResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="WSDLInteropTestRpcEncService">
+ <port binding="tns:WSDLInteropTestRpcEncPortBinding"
+ name="WSDLInteropTestRpcEncPort">
+ <soap:address
+ location="round3_groupD_rpcenc.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupD/skipif.inc b/ext/soap/tests/interop/Round3/GroupD/skipif.inc
new file mode 100644
index 000000000..fa8574e6a
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupD/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
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
new file mode 100644
index 000000000..2fdf58070
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SOAP Interop Round3 GroupE List 001 (php/wsdl): echoLinkedList
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1,NULL);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+object(stdClass)#5 (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ NULL
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt
new file mode 100644
index 000000000..f8f73212c
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt
@@ -0,0 +1,42 @@
+--TEST--
+SOAP Interop Round3 GroupE List 002 (php/wsdl): echoLinkedList
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1, new SOAPList('arg2',2,NULL));
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+object(stdClass)#6 (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ object(stdClass)#7 (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ NULL
+ }
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt
new file mode 100644
index 000000000..857f7930f
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt
@@ -0,0 +1,49 @@
+--TEST--
+SOAP Interop Round3 GroupE List 003 (php/wsdl): echoLinkedList
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1,new SOAPList('arg2',2,new SOAPList('arg3',3,NULL)));
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+object(stdClass)#7 (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ object(stdClass)#8 (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ object(stdClass)#9 (3) {
+ ["varInt"]=>
+ int(3)
+ ["varString"]=>
+ string(4) "arg3"
+ ["child"]=>
+ NULL
+ }
+ }
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt
new file mode 100644
index 000000000..3c34ef1dd
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP Interop Round3 GroupE List 004 (php/wsdl): echoLinkedList
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = NULL;
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+NULL
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt
new file mode 100644
index 000000000..224f44dc2
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt
@@ -0,0 +1,50 @@
+--TEST--
+SOAP Interop Round3 GroupE List 005 (php/wsdl): echoLinkedList (cyclic)
+--SKIPIF--
+<?php require_once('skipif.inc'); die('skip cyclic stuctures are not supported yet'); ?>
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1,new SOAPList('arg2',2,new SOAPList('arg3',3,NULL)));
+$struct->child->child->child = $struct;
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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="1" 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="1" xsi:type="ns2:List"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#7 (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ object(stdClass)#8 (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ object(stdClass)#9 (3) {
+ ["varInt"]=>
+ int(3)
+ ["varString"]=>
+ string(4) "arg3"
+ ["child"]=>
+ NULL
+ }
+ }
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt
new file mode 100644
index 000000000..a786492df
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt
@@ -0,0 +1,50 @@
+--TEST--
+SOAP Interop Round3 GroupE List 006 (php/wsdl): echoLinkedList (cyclic)
+--SKIPIF--
+<?php require_once('skipif.inc'); die("skip cyclic stuctures are not supported yet"); ?>
+--FILE--
+<?php
+class SOAPList {
+ function SOAPList($s, $i, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->child = $c;
+ }
+}
+$struct = new SOAPList('arg1',1,new SOAPList('arg2',2,new SOAPList('arg3',3,NULL)));
+$struct->child->child->child = $struct->child;
+$client = new SoapClient(dirname(__FILE__)."/round3_groupE_list.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoLinkedList($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupE_list.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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="1" 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="1" xsi:type="ns2:List"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+object(stdClass)#7 (3) {
+ ["varInt"]=>
+ int(1)
+ ["varString"]=>
+ string(4) "arg1"
+ ["child"]=>
+ object(stdClass)#8 (3) {
+ ["varInt"]=>
+ int(2)
+ ["varString"]=>
+ string(4) "arg2"
+ ["child"]=>
+ object(stdClass)#9 (3) {
+ ["varInt"]=>
+ int(3)
+ ["varString"]=>
+ string(4) "arg3"
+ ["child"]=>
+ NULL
+ }
+ }
+}
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc
new file mode 100644
index 000000000..83454c077
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.inc
@@ -0,0 +1,17 @@
+<?php
+class SOAP_Interop_GroupE {
+
+ function echoLinkedList($inputList)
+ {
+ global $d;
+ $d = $inputList;
+ return $inputList;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupE_list.wsdl");
+$server->setClass("SOAP_Interop_GroupE");
+$server->handle();
+var_dump($d);
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl
new file mode 100644
index 000000000..49e6a8c4c
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/round3_groupE_list.wsdl
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestList"
+ targetNamespace="http://soapinterop.org/WSDLInteropTestList"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/WSDLInteropTestList"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <types>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <complexType name="List">
+ <all>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varString" type="xsd:string"/>
+ <element name="child" type = "xsd1:List"/>
+ </all>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="echoLinkedList">
+ <part name="param0" type="xsd1:List"/>
+ </message>
+ <message name="echoLinkedListResponse">
+ <part name="return" type="xsd1:List"/>
+ </message>
+ <portType name="WSDLInteropTestListPortType">
+ <operation name="echoLinkedList">
+ <input message="tns:echoLinkedList"/>
+ <output message="tns:echoLinkedListResponse"/>
+ </operation>
+ </portType>
+ <binding name="WSDLInteropTestListBinding"
+ type="tns:WSDLInteropTestListPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoLinkedList">
+ <soap:operation soapAction="" style="rpc"/>
+ <input>
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </input>
+ <output>
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://soapinterop.org/WSDLInteropTestRpcEnc" use="encoded"/>
+ </output>
+ </operation>
+
+ </binding>
+ <service name="WSDLInteropTestListService">
+ <port binding="tns:WSDLInteropTestListBinding"
+ name="WSDLInteropTestListPort">
+ <soap:address
+ location="round3_groupE_list.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupE/skipif.inc b/ext/soap/tests/interop/Round3/GroupE/skipif.inc
new file mode 100644
index 000000000..fa8574e6a
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupE/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt
new file mode 100644
index 000000000..e9c52e2a7
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_ext_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupF Extensibility 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_ext.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_ext.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></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/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt
new file mode 100644
index 000000000..ed6f860f4
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt
@@ -0,0 +1,15 @@
+--TEST--
+SOAP Interop Round3 GroupF Extensibility Required 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_extreq.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+//$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+//include("round3_groupF_extreq.inc");
+echo "ok\n";
+?>
+--EXPECTF--
+Fatal error: SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://soapinterop.org/ext' in %sr3_groupF_extreq_001w.php on line %d
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt
new file mode 100644
index 000000000..cd54939c2
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round3 GroupF Headers 001 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_headers.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></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/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt
new file mode 100644
index 000000000..5edc550fe
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_002w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round3 GroupF Headers 002 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/xsd","Header1", array("int"=>34,"string"=>"arg"));
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString",array("Hello World"),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_headers.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Header><ns1:Header1><ns1:string>arg</ns1:string><ns1:int>34</ns1:int></ns1:Header1></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></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/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt
new file mode 100644
index 000000000..ef7002c63
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_003w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round3 GroupF Headers 003 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/xsd","Header2", array("int"=>34,"string"=>"arg"));
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString",array("Hello World"),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_headers.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Header><ns1:Header2><ns1:int>34</ns1:int><ns1:string>arg</ns1:string></ns1:Header2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></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/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt
new file mode 100644
index 000000000..60b027ff1
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_headers_004w.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SOAP Interop Round3 GroupF Headers 004 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = array(
+ new SoapHeader("http://soapinterop.org/xsd","Header1", array("int"=>34,"string"=>"arg1")),
+ new SoapHeader("http://soapinterop.org/xsd","Header2", array("int"=>43,"string"=>"arg2"))
+);
+$client = new SoapClient(dirname(__FILE__)."/round3_groupF_headers.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoString",array("Hello World"),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round3_groupF_headers.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd"><SOAP-ENV:Header><ns1:Header1><ns1:string>arg1</ns1:string><ns1:int>34</ns1:int></ns1:Header1><ns1:Header2><ns1:int>43</ns1:int><ns1:string>arg2</ns1:string></ns1:Header2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoStringParam>Hello World</ns1:echoStringParam></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/xsd"><SOAP-ENV:Body><ns1:echoStringReturn>Hello World</ns1:echoStringReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc
new file mode 100644
index 000000000..44bc83bdc
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.inc
@@ -0,0 +1,14 @@
+<?php
+class SOAP_Interop_GroupF {
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupF_ext.wsdl");
+$server->setClass("SOAP_Interop_GroupF");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl
new file mode 100644
index 000000000..74ec01805
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_ext.wsdl
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestDocLitService"
+ targetNamespace="http://soapinterop.org/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ext="http://soapinterop.org/ext">
+ <ext:types/>
+
+ <types>
+ <ext:schema targetNamespace="http://soapinterop.org/xsd"/>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <element name="echoStringParam" type="xsd:string"/>
+
+ <element name="echoStringReturn" type="xsd:string"/>
+ </schema>
+ </types>
+ <ext:message name="echoString"/>
+ <message name="echoString">
+ <part element="xsd1:echoStringParam" name="a"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="xsd1:echoStringReturn" name="result"/>
+ </message>
+
+ <ext:portType name="WSDLInteropTestDocLitPortType"/>
+
+ <portType name="WSDLInteropTestDocLitPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ </portType>
+ <ext:binding name="WSDLInteropTestDocLitPortBinding"/>
+ <binding name="WSDLInteropTestDocLitPortBinding"
+ type="tns:WSDLInteropTestDocLitPortType">
+ <ext:binding style ="chunked"/>
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <ext:operation style ="chunked"/>
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoString">
+ <ext:body use ="direct"/>
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringResponse">
+ <ext:body use ="direct"/>
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <ext:service name="WSDLInteropTestDocLitService"/>
+ <service name="WSDLInteropTestDocLitService">
+ <ext:port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort"/>
+ <port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort">
+ <ext:address location=""/>
+ <soap:address
+ location="round3_groupF_ext.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl
new file mode 100644
index 000000000..8dfd65ec9
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_extreq.wsdl
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="WSDLInteropTestDocLitService"
+ targetNamespace="http://soapinterop.org/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://soapinterop.org/xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ext="http://soapinterop.org/ext">
+ <ext:types/>
+
+ <types>
+ <ext:schema targetNamespace="http://soapinterop.org/xsd"/>
+ <schema targetNamespace="http://soapinterop.org/xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <element name="echoStringParam" type="xsd:string"/>
+
+ <element name="echoStringReturn" type="xsd:string"/>
+ </schema>
+ </types>
+ <ext:message name="echoString"/>
+ <message name="echoString">
+ <part element="xsd1:echoStringParam" name="a"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="xsd1:echoStringReturn" name="result"/>
+ </message>
+
+ <ext:portType name="WSDLInteropTestDocLitPortType"/>
+
+ <portType name="WSDLInteropTestDocLitPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" name="echoString"/>
+ <output message="tns:echoStringResponse" name="echoStringResponse"/>
+ </operation>
+ </portType>
+ <ext:binding name="WSDLInteropTestDocLitPortBinding"/>
+ <binding name="WSDLInteropTestDocLitPortBinding"
+ type="tns:WSDLInteropTestDocLitPortType">
+ <ext:binding style ="chunked" wsdl:required="true"/>
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <ext:operation style ="chunked"/>
+ <soap:operation soapAction="http://soapinterop.org/" style="document"/>
+ <input name="echoString">
+ <ext:body use ="direct"/>
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </input>
+ <output name="echoStringResponse">
+ <ext:body use ="direct"/>
+ <soap:body namespace="http://soapinterop.org/WSDLInteropTestDocLit"
+ use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <ext:service name="WSDLInteropTestDocLitService"/>
+ <service name="WSDLInteropTestDocLitService">
+ <ext:port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort"/>
+ <port binding="tns:WSDLInteropTestDocLitPortBinding"
+ name="WSDLInteropTestDocLitPort">
+ <ext:address location=""/>
+ <soap:address
+ location="round3_groupF_extreq.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc
new file mode 100644
index 000000000..ee6581119
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.inc
@@ -0,0 +1,22 @@
+<?php
+class SOAP_Interop_GroupF {
+
+ function Header1($input)
+ {
+ }
+
+ function Header2($input)
+ {
+ }
+
+ function echoString($inputString)
+ {
+ return $inputString;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round3_groupF_ext.wsdl");
+$server->setClass("SOAP_Interop_GroupF");
+$server->handle();
+?> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl
new file mode 100644
index 000000000..d03fc32e3
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/round3_groupF_headers.wsdl
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/"
+ xmlns:types="http://soapinterop.org/xsd"
+ targetNamespace="http://soapinterop.org/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd">
+ <s:element name="echoStringParam" type="s:string"/>
+
+ <s:element name="echoStringReturn" type="s:string"/>
+
+ <s:element name="Header1" type="types:Header1" />
+ <s:complexType name="Header1">
+ <s:sequence>
+ <s:element name="string" type="s:string" />
+ <s:element name="int" type="s:int" />
+ </s:sequence>
+ <s:anyAttribute />
+ </s:complexType>
+ <s:element name="Header2" type="types:Header2" />
+ <s:complexType name="Header2">
+ <s:sequence>
+ <s:element name="int" type="s:int" />
+ <s:element name="string" type="s:string" />
+ </s:sequence>
+ <s:anyAttribute />
+ </s:complexType>
+ </s:schema>
+ </types>
+ <message name="echoString">
+ <part element="types:echoStringParam" name="a"/>
+ </message>
+ <message name="echoStringResponse">
+ <part element="types:echoStringReturn" name="result"/>
+ </message>
+ <message name="Header1">
+ <part name="Header1" element="types:Header1" />
+ </message>
+ <message name="Header2">
+ <part name="Header2" element="types:Header2" />
+ </message>
+ <portType name="RetHeaderPortType">
+ <operation name="echoString">
+ <input message="tns:echoString" />
+ <output message="tns:echoStringResponse" />
+ </operation>
+ </portType>
+ <binding name = "RetHeaderBinding" type="tns:RetHeaderPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/" style="document" />
+ <input>
+ <soap:body use="literal" />
+ <soap:header message="tns:Header1" part="Header1" use="literal"/>
+ <soap:header message="tns:Header2" part="Header2" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="RetHeaderService">
+ <port name="RetHeaderPort" binding="tns:RetHeaderBinding">
+ <soap:address location="round3_groupF_headers.inc"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round3/GroupF/skipif.inc b/ext/soap/tests/interop/Round3/GroupF/skipif.inc
new file mode 100644
index 000000000..fa8574e6a
--- /dev/null
+++ b/ext/soap/tests/interop/Round3/GroupF/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc
new file mode 100644
index 000000000..c2a27186d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.inc
@@ -0,0 +1,33 @@
+<?php
+class SOAP_Interop_GroupG {
+
+ function EchoBase64AsAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsBase64($in) {
+ return $in;
+ }
+
+ function EchoAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachments($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsString($in) {
+ return $in;
+ }
+
+ function EchoUnrefAttachments($in) {
+ return $in;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupG_dimedoc.wsdl");
+$server->setClass("SOAP_Interop_GroupG");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl
new file mode 100644
index 000000000..f82216e6f
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimedoc.wsdl
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="SOAPBuilders" xmlns="http://soapinterop.org/attachments/wsdl" xmlns:types="http://soapinterop.org/attachments/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:dime="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/" xmlns:content="http://schemas.xmlsoap.org/ws/2002/04/content-type/" xmlns:ref="http://schemas.xmlsoap.org/ws/2002/04/reference/" targetNamespace="http://soapinterop.org/attachments/wsdl">
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/attachments/xsd" elementFormDefault="qualified" attributeFormDefault="qualified">
+ <import namespace="http://schemas.xmlsoap.org/ws/2002/04/reference/"/>
+ <import namespace="http://schemas.xmlsoap.org/ws/2002/04/content-type/"/>
+ <complexType name="ReferencedBinary">
+ <simpleContent>
+ <restriction base="xsd:base64Binary">
+ <annotation>
+ <appinfo>
+ <content:mediaType value="application/octetstream"/>
+ </appinfo>
+ </annotation>
+ <attribute ref="ref:location" use="optional"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <complexType name="ReferencedText">
+ <simpleContent>
+ <restriction base="xsd:base64Binary">
+ <annotation>
+ <appinfo>
+ <content:mediaType value="text/plain"/>
+ </appinfo>
+ </annotation>
+ <attribute ref="ref:location" use="optional"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <element name="EchoAttachment" type="types:EchoAttachment"/>
+ <element name="EchoAttachmentResponse" type="types:EchoAttachmentResponse"/>
+ <complexType name="EchoAttachment">
+ <sequence>
+ <element name="In" type="types:ReferencedBinary"/>
+ </sequence>
+ </complexType>
+ <complexType name="EchoAttachmentResponse">
+ <sequence>
+ <element name="Out" type="types:ReferencedBinary"/>
+ </sequence>
+ </complexType>
+ <element name="EchoAttachments" type="types:Attachments"/>
+ <element name="EchoAttachmentsResponse" type="types:Attachments"/>
+ <complexType name="Attachments">
+ <sequence>
+ <element name="Item" minOccurs="0" maxOccurs="unbounded" type="types:ReferencedBinary"/>
+ </sequence>
+ </complexType>
+ <element name="EchoAttachmentAsBase64" type="types:EchoAttachment"/>
+ <element name="EchoAttachmentAsBase64Response" type="types:base64Out"/>
+ <element name="EchoBase64AsAttachment" type="types:base64In"/>
+ <element name="EchoBase64AsAttachmentResponse" type="types:EchoAttachmentResponse"/>
+ <complexType name="base64In">
+ <sequence>
+ <element name="In" type="xsd:base64Binary"/>
+ </sequence>
+ </complexType>
+ <complexType name="base64Out">
+ <sequence>
+ <element name="Out" type="xsd:base64Binary"/>
+ </sequence>
+ </complexType>
+ <element name="EchoUnrefAttachments" type="types:emptyType"/>
+ <element name="EchoUnrefAttachmentsResponse" type="types:emptyType"/>
+ <complexType name="emptyType">
+ <sequence/>
+ </complexType>
+ <element name="EchoAttachmentAsString" type="types:EchoAttachmentAsString"/>
+ <element name="EchoAttachmentAsStringResponse" type="types:EchoAttachmentAsStringResponse"/>
+ <complexType name="EchoAttachmentAsString">
+ <sequence>
+ <element name="In" type="types:ReferencedText"/>
+ </sequence>
+ </complexType>
+ <complexType name="EchoAttachmentAsStringResponse">
+ <sequence>
+ <element name="Out" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="EchoAttachmentIn">
+ <wsdl:part name="In" element="types:EchoAttachment"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsIn">
+ <wsdl:part name="In" element="types:EchoAttachments"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentsResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64In">
+ <wsdl:part name="In" element="types:EchoAttachmentAsBase64"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64Out">
+ <wsdl:part name="Out" element="types:EchoAttachmentAsBase64Response"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentIn">
+ <wsdl:part name="In" element="types:EchoBase64AsAttachment"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentOut">
+ <wsdl:part name="Out" element="types:EchoBase64AsAttachmentResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoUnrefAttachmentsIn">
+ <wsdl:part name="In" element="types:EchoUnrefAttachments"/>
+ </wsdl:message>
+ <wsdl:message name="EchoUnrefAttachmentsOut">
+ <wsdl:part name="Out" element="types:EchoUnrefAttachmentsResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsStringIn">
+ <wsdl:part name="In" element="types:EchoAttachmentAsString"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsStringOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentAsStringResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="AttachmentsPortType">
+ <wsdl:operation name="EchoAttachment">
+ <wsdl:input name="EchoAttachmentInput" message="EchoAttachmentIn"/>
+ <wsdl:output name="EchoAttachmentOutput" message="EchoAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <wsdl:input name="EchoAttachmentsInput" message="EchoAttachmentsIn"/>
+ <wsdl:output name="EchoAttachmentsOutput" message="EchoAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <wsdl:input name="EchoAttachmentAsBase64Input" message="EchoAttachmentAsBase64In"/>
+ <wsdl:output name="EchoAttachmentAsBase64Output" message="EchoAttachmentAsBase64Out"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <wsdl:input name="EchoBase64AsAttachmentInput" message="EchoBase64AsAttachmentIn"/>
+ <wsdl:output name="EchoBase64AsAttachmentOutput" message="EchoBase64AsAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoUnrefAttachments">
+ <wsdl:input name="EchoUnrefAttachmentsInput" message="EchoUnrefAttachmentsIn"/>
+ <wsdl:output name="EchoUnrefAttachmentsOutput" message="EchoUnrefAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsString">
+ <wsdl:input name="EchoAttachmentAsStringInput" message="EchoAttachmentAsStringIn"/>
+ <wsdl:output name="EchoAttachmentAsStringOutput" message="EchoAttachmentAsStringOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AttachmentsBinding" type="AttachmentsPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="EchoAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentsInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentsOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsBase64Input">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsBase64Output">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoBase64AsAttachmentInput">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoBase64AsAttachmentOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoUnrefAttachments">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoUnrefAttachmentsInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoUnrefAttachmentsOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsString">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsStringInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsStringOutput">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Round4DIMEDOC">
+ <wsdl:port name="Round4DIMEDOCTestSoap" binding="AttachmentsBinding">
+ <soap:address location="test://" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc
new file mode 100644
index 000000000..2f3c00aa1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.inc
@@ -0,0 +1,33 @@
+<?php
+class SOAP_Interop_GroupG {
+
+ function EchoBase64AsAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsBase64($in) {
+ return $in;
+ }
+
+ function EchoAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachments($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsString($in) {
+ return $in;
+ }
+
+ function EchoUnrefAttachments($in) {
+ return $in;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupG_dimerpc.wsdl");
+$server->setClass("SOAP_Interop_GroupG");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl
new file mode 100644
index 000000000..d837da0c6
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_dimerpc.wsdl
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="SOAPBuilders" xmlns="http://soapinterop.org/attachments/wsdl" xmlns:types="http://soapinterop.org/attachments/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:dime="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/" xmlns:content="http://schemas.xmlsoap.org/ws/2002/04/content-type/" targetNamespace="http://soapinterop.org/attachments/wsdl">
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/attachments/xsd">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" location="http://schemas.xmlsoap.org/soap/encoding/" />
+ <import namespace="http://schemas.xmlsoap.org/ws/2002/04/content-type/"/>
+ <import namespace="http://schemas.xmlsoap.org/ws/2002/04/reference/"/>
+ <complexType name="ReferencedBinary">
+ <simpleContent>
+ <restriction base="soap-enc:base64Binary">
+ <annotation>
+ <appinfo>
+ <content:mediaType value="application/octetstream"/>
+ </appinfo>
+ </annotation>
+ <attributeGroup ref="soap-enc:commonAttributes"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ <complexType name="ArrayOfBinary">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="types:ReferencedBinary[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ReferencedText">
+ <simpleContent>
+ <restriction base="soap-enc:base64Binary">
+ <annotation>
+ <appinfo>
+ <content:mediaType value="text/plain"/>
+ </appinfo>
+ </annotation>
+ <attributeGroup ref="soap-enc:commonAttributes"/>
+ </restriction>
+ </simpleContent>
+ </complexType>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="EchoAttachmentIn">
+ <wsdl:part name="In" type="types:ReferencedBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentOut">
+ <wsdl:part name="Out" type="types:ReferencedBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsIn">
+ <wsdl:part name="In" type="types:ArrayOfBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsOut">
+ <wsdl:part name="Out" type="types:ArrayOfBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64In">
+ <wsdl:part name="In" type="types:ReferencedBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64Out">
+ <wsdl:part name="Out" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentIn">
+ <wsdl:part name="In" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentOut">
+ <wsdl:part name="Out" type="types:ReferencedBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoUnrefAttachmentsIn" />
+ <wsdl:message name="EchoUnrefAttachmentsOut" />
+ <wsdl:message name="EchoAttachmentAsStringIn">
+ <wsdl:part name="In" type="types:ReferencedText"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsStringOut">
+ <wsdl:part name="Out" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="AttachmentsPortType">
+ <wsdl:operation name="EchoAttachment">
+ <wsdl:input name="EchoAttachmentInput" message="EchoAttachmentIn"/>
+ <wsdl:output name="EchoAttachmentOutput" message="EchoAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <wsdl:input name="EchoAttachmentsInput" message="EchoAttachmentsIn"/>
+ <wsdl:output name="EchoAttachmentsOutput" message="EchoAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <wsdl:input name="EchoAttachmentAsBase64Input" message="EchoAttachmentAsBase64In"/>
+ <wsdl:output name="EchoAttachmentAsBase64Output" message="EchoAttachmentAsBase64Out"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <wsdl:input name="EchoBase64AsAttachmentInput" message="EchoBase64AsAttachmentIn"/>
+ <wsdl:output name="EchoBase64AsAttachmentOutput" message="EchoBase64AsAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoUnrefAttachments">
+ <wsdl:input name="EchoUnrefAttachmentsInput" message="EchoUnrefAttachmentsIn"/>
+ <wsdl:output name="EchoUnrefAttachmentsOutput" message="EchoUnrefAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsString">
+ <wsdl:input name="EchoAttachmentAsStringInput" message="EchoAttachmentAsStringIn"/>
+ <wsdl:output name="EchoAttachmentAsStringOutput" message="EchoAttachmentAsStringOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AttachmentsBinding" type="AttachmentsPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="EchoAttachment">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentsInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentsOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsBase64Input">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsBase64Output">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoBase64AsAttachmentInput">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoBase64AsAttachmentOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoUnrefAttachments">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoUnrefAttachmentsInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoUnrefAttachmentsOutput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsString">
+ <soap:operation style="rpc" soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsStringInput">
+ <dime:message layout="http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout" wsdl:required="true"/>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsStringOutput">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Round4DIMERPC">
+ <wsdl:port name="Round4DIMERPCTestSoap" binding="AttachmentsBinding">
+ <soap:address location="test://" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc
new file mode 100644
index 000000000..8ed272ed1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.inc
@@ -0,0 +1,25 @@
+<?php
+class SOAP_Interop_GroupG {
+
+ function EchoBase64AsAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsBase64($in) {
+ return $in;
+ }
+
+ function EchoAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachments($in) {
+ return $in;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupG_dimedoc.wsdl");
+$server->setClass("SOAP_Interop_GroupG");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl
new file mode 100644
index 000000000..c67172e8c
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="SOAPBuilders"
+ xmlns="http://soapinterop.org/attachments/wsdl"
+ xmlns:types="http://soapinterop.org/attachments/xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
+ targetNamespace="http://soapinterop.org/attachments/wsdl">
+ <wsdl:types>
+ <schema
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://soapinterop.org/attachments/xsd"
+ elementFormDefault="qualified"
+ attributeFormDefault="qualified">
+
+ <complexType name="binary">
+ <simpleContent>
+ <extension base="xsd:base64Binary">
+ <attribute name="href" type="xsd:anyURI"/>
+ </extension>
+ </simpleContent>
+ </complexType >
+
+ <element name="EchoAttachment" type="types:EchoAttachment"/>
+ <element name="EchoAttachmentResponse" type="types:EchoAttachmentResponse"/>
+ <complexType name="EchoAttachment">
+ <sequence>
+ <element name="In" type="types:binary"/>
+ </sequence>
+ </complexType>
+ <complexType name="EchoAttachmentResponse">
+ <sequence>
+ <element name="Out" type="types:binary"/>
+ </sequence>
+ </complexType>
+
+ <element name="EchoAttachments" type="types:Attachments"/>
+ <element name="EchoAttachmentsResponse" type="types:Attachments"/>
+ <complexType name="Attachments">
+ <sequence>
+ <element name="Item" minOccurs="0" maxOccurs="unbounded" type="types:binary">
+ </element>
+ </sequence>
+ </complexType>
+
+ <element name="EchoAttachmentAsBase64" type="types:EchoAttachment"/>
+ <element name="EchoAttachmentAsBase64Response" type="types:EchoAttachmentResponse"/>
+
+ <element name="EchoBase64AsAttachment" type="types:EchoAttachment"/>
+ <element name="EchoBase64AsAttachmentResponse" type="types:EchoAttachmentResponse"/>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="EchoAttachmentIn">
+ <wsdl:part name="In" element="types:EchoAttachment"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsIn">
+ <wsdl:part name="In" element="types:EchoAttachments"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsOut">
+ <wsdl:part name="Out" element="types:EchoAttachmentsResponse"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64In">
+ <wsdl:part name="In" element="types:EchoAttachmentAsBase64"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64Out">
+ <wsdl:part name="Out" element="types:EchoAttachmentAsBase64Response"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentIn">
+ <wsdl:part name="In" element="types:EchoBase64AsAttachment"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentOut">
+ <wsdl:part name="Out" element="types:EchoBase64AsAttachmentResponse"/>
+ </wsdl:message>
+
+ <wsdl:portType name="AttachmentsPortType">
+ <wsdl:operation name="EchoAttachment">
+ <wsdl:input name="EchoAttachmentInput" message="EchoAttachmentIn"/>
+ <wsdl:output name="EchoAttachmentOutput" message="EchoAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <wsdl:input name="EchoAttachmentsInput" message="EchoAttachmentsIn"/>
+ <wsdl:output name="EchoAttachmentsOutput" message="EchoAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <wsdl:input name="EchoAttachmentAsBase64Input" message="EchoAttachmentAsBase64In"/>
+ <wsdl:output name="EchoAttachmentAsBase64Output" message="EchoAttachmentAsBase64Out"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <wsdl:input name="EchoBase64AsAttachmentInput" message="EchoBase64AsAttachmentIn"/>
+ <wsdl:output name="EchoBase64AsAttachmentOutput" message="EchoBase64AsAttachmentOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AttachmentsBinding" type="AttachmentsPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="EchoAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentInput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal" />
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentsInput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentsOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsBase64Input">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsBase64Output">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoBase64AsAttachmentInput">
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="EchoBase64AsAttachmentOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="literal"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Round4MIMEDOC">
+ <wsdl:port name="Round4MIMEDOCTestSoap" binding="AttachmentsBinding">
+ <soap:address location="test://" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc
new file mode 100644
index 000000000..8ed272ed1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.inc
@@ -0,0 +1,25 @@
+<?php
+class SOAP_Interop_GroupG {
+
+ function EchoBase64AsAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachmentAsBase64($in) {
+ return $in;
+ }
+
+ function EchoAttachment($in) {
+ return $in;
+ }
+
+ function EchoAttachments($in) {
+ return $in;
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupG_dimedoc.wsdl");
+$server->setClass("SOAP_Interop_GroupG");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl
new file mode 100644
index 000000000..30a56d12f
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="SOAPBuilders"
+ xmlns="http://soapinterop.org/attachments/wsdl"
+ xmlns:types="http://soapinterop.org/attachments/xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
+ targetNamespace="http://soapinterop.org/attachments/wsdl">
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/attachments/xsd">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="ArrayOfBinary">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="soap-enc:base64Binary[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="EchoAttachmentIn">
+ <wsdl:part name="In" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentOut">
+ <wsdl:part name="Out" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsIn">
+ <wsdl:part name="In" type="types:ArrayOfBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentsOut">
+ <wsdl:part name="Out" type="types:ArrayOfBinary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64In">
+ <wsdl:part name="In" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoAttachmentAsBase64Out">
+ <wsdl:part name="Out" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentIn">
+ <wsdl:part name="In" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:message name="EchoBase64AsAttachmentOut">
+ <wsdl:part name="Out" type="xsd:base64Binary"/>
+ </wsdl:message>
+ <wsdl:portType name="AttachmentsPortType">
+ <wsdl:operation name="EchoAttachment">
+ <wsdl:input name="EchoAttachmentInput" message="EchoAttachmentIn"/>
+ <wsdl:output name="EchoAttachmentOutput" message="EchoAttachmentOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <wsdl:input name="EchoAttachmentsInput" message="EchoAttachmentsIn"/>
+ <wsdl:output name="EchoAttachmentsOutput" message="EchoAttachmentsOut"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <wsdl:input name="EchoAttachmentAsBase64Input" message="EchoAttachmentAsBase64In"/>
+ <wsdl:output name="EchoAttachmentAsBase64Output" message="EchoAttachmentAsBase64Out"/>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <wsdl:input name="EchoBase64AsAttachmentInput" message="EchoBase64AsAttachmentIn"/>
+ <wsdl:output name="EchoBase64AsAttachmentOutput" message="EchoBase64AsAttachmentOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AttachmentsBinding" type="AttachmentsPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="EchoAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentInput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachments">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentsInput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentsOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoAttachmentAsBase64">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoAttachmentAsBase64Input">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="In" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:input>
+ <wsdl:output name="EchoAttachmentAsBase64Output">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="EchoBase64AsAttachment">
+ <soap:operation soapAction="http://soapinterop.org/attachments/"/>
+ <wsdl:input name="EchoBase64AsAttachmentInput">
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </wsdl:input>
+ <wsdl:output name="EchoBase64AsAttachmentOutput">
+ <mime:multipartRelated>
+ <mime:part>
+ <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </mime:part>
+ <mime:part>
+ <mime:content part="Out" type="application/octetstream"/>
+ </mime:part>
+ </mime:multipartRelated>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Round4MIMERPC">
+ <wsdl:port name="Round4MIMERPCTestSoap" binding="AttachmentsBinding">
+ <soap:address location="test://" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/ext/soap/tests/interop/Round4/GroupG/skipif.inc b/ext/soap/tests/interop/Round4/GroupG/skipif.inc
new file mode 100644
index 000000000..fa8574e6a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupG/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt
new file mode 100644
index 000000000..15a6c0983
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 001 (php/wsdl): echoSOAPStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSOAPStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/types/requestresponse"><SOAP-ENV:Body><ns2:echoSOAPStructFaultRequest><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns2:echoSOAPStructFaultRequest></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoSOAPStructFault'.</faultstring><detail><ns2:SOAPStructFaultPart><ns1:soapStruct><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns1:soapStruct></ns2:SOAPStructFaultPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt
new file mode 100644
index 000000000..1778d38ba
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 002 (php/wsdl): echoBaseStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$struct = new BaseStruct(new SOAPStruct("a1",11,12.345),11);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBaseStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/types/requestresponse"><SOAP-ENV:Body><ns2:echoBaseStructFaultRequest><ns1:structMessage><ns1:varString>a1</ns1:varString><ns1:varInt>11</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns1:structMessage><ns1:shortMessage>11</ns1:shortMessage></ns2:echoBaseStructFaultRequest></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoBaseStructFault'.</faultstring><detail><ns2:BaseStructPart><ns1:structMessage><ns1:varString>a1</ns1:varString><ns1:varInt>11</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns1:structMessage><ns1:shortMessage>11</ns1:shortMessage></ns2:BaseStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt
new file mode 100644
index 000000000..cd7cc499d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt
@@ -0,0 +1,40 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 003 (php/wsdl): echoExtendedStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+$struct = new ExtendedStruct(new SOAPStruct("a1",11,12.345),12,"arg",-3,5);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoExtendedStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/types/requestresponse"><SOAP-ENV:Body><ns2:echoExtendedStructFaultRequest><ns1:structMessage><ns1:varString>a1</ns1:varString><ns1:varInt>11</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns1:structMessage><ns1:shortMessage>12</ns1:shortMessage><ns1:stringMessage>arg</ns1:stringMessage><ns1:intMessage>-3</ns1:intMessage><ns1:anotherIntMessage>5</ns1:anotherIntMessage></ns2:echoExtendedStructFaultRequest></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoExtendedStructFault'.</faultstring><detail><ns2:ExtendedStructPart><ns1:structMessage><ns1:varString>a1</ns1:varString><ns1:varInt>11</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns1:structMessage><ns1:shortMessage>12</ns1:shortMessage><ns1:stringMessage>arg</ns1:stringMessage><ns1:intMessage>-3</ns1:intMessage><ns1:anotherIntMessage>5</ns1:anotherIntMessage></ns2:ExtendedStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt
new file mode 100644
index 000000000..421878bb8
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 004 (php/wsdl): echoMultipleFaults1(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg1',34,325.325);
+$s2 = new BaseStruct(new SOAPStruct('arg2',34,325.325),12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 1,
+ "param1" => $s1,
+ "param2" => $s2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>1</ns1:whichFault><ns1:param1><ns2:varString>arg1</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>arg2</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns2:structMessage><ns2:shortMessage>12</ns2:shortMessage></ns1:param2></ns1:echoMultipleFaults1Request></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:SOAPStructFaultPart><ns1:soapStruct><ns1:varString>arg1</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns1:soapStruct></ns2:SOAPStructFaultPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt
new file mode 100644
index 000000000..9b3b0be5e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 005 (php/wsdl): echoMultipleFaults1(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg1',34,325.325);
+$s2 = new BaseStruct(new SOAPStruct('arg2',34,325.325),12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 2,
+ "param1" => $s1,
+ "param2" => $s2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>2</ns1:whichFault><ns1:param1><ns2:varString>arg1</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>arg2</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns2:structMessage><ns2:shortMessage>12</ns2:shortMessage></ns1:param2></ns1:echoMultipleFaults1Request></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:BaseStructPart><ns1:structMessage><ns1:varString>arg2</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns1:structMessage><ns1:shortMessage>12</ns1:shortMessage></ns2:BaseStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt
new file mode 100644
index 000000000..e6566888f
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 006 (php/wsdl): echoMultipleFaults1(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg1',34,325.325);
+$s2 = new BaseStruct(new SOAPStruct('arg2',34,325.325),12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 3,
+ "param1" => $s1,
+ "param2" => $s2));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>3</ns1:whichFault><ns1:param1><ns2:varString>arg1</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>arg2</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>325.325</ns2:varFloat></ns2:structMessage><ns2:shortMessage>12</ns2:shortMessage></ns1:param2></ns1:echoMultipleFaults1Request></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:SOAPStructFaultPart><ns1:soapStruct><ns1:varString>arg1</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns1:soapStruct></ns2:SOAPStructFaultPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt
new file mode 100644
index 000000000..54db2ebe4
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt
@@ -0,0 +1,51 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 007 (php/wsdl): echoMultipleFaults2(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1);
+$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 1,
+ "param1" => $s1,
+ "param2" => $s2,
+ "param3" => $s3));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>1</ns1:whichFault><ns1:param1><ns2:structMessage><ns2:varString>s1</ns2:varString><ns2:varInt>1</ns2:varInt><ns2:varFloat>1.1</ns2:varFloat></ns2:structMessage><ns2:shortMessage>1</ns2:shortMessage></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>s2</ns2:varString><ns2:varInt>2</ns2:varInt><ns2:varFloat>2.2</ns2:varFloat></ns2:structMessage><ns2:shortMessage>2</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage></ns1:param2><ns1:param3><ns2:structMessage><ns2:varString>s3</ns2:varString><ns2:varInt>3</ns2:varInt><ns2:varFloat>3.3</ns2:varFloat></ns2:structMessage><ns2:shortMessage>3</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage><ns2:booleanMessage>true</ns2:booleanMessage></ns1:param3></ns1:echoMultipleFaults2Request></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:BaseStructPart><ns1:structMessage><ns1:varString>s1</ns1:varString><ns1:varInt>1</ns1:varInt><ns1:varFloat>1.1</ns1:varFloat></ns1:structMessage><ns1:shortMessage>1</ns1:shortMessage></ns2:BaseStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt
new file mode 100644
index 000000000..bbb39de71
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt
@@ -0,0 +1,51 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 008 (php/wsdl): echoMultipleFaults2(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1);
+$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 2,
+ "param1" => $s1,
+ "param2" => $s2,
+ "param3" => $s3));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>2</ns1:whichFault><ns1:param1><ns2:structMessage><ns2:varString>s1</ns2:varString><ns2:varInt>1</ns2:varInt><ns2:varFloat>1.1</ns2:varFloat></ns2:structMessage><ns2:shortMessage>1</ns2:shortMessage></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>s2</ns2:varString><ns2:varInt>2</ns2:varInt><ns2:varFloat>2.2</ns2:varFloat></ns2:structMessage><ns2:shortMessage>2</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage></ns1:param2><ns1:param3><ns2:structMessage><ns2:varString>s3</ns2:varString><ns2:varInt>3</ns2:varInt><ns2:varFloat>3.3</ns2:varFloat></ns2:structMessage><ns2:shortMessage>3</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage><ns2:booleanMessage>true</ns2:booleanMessage></ns1:param3></ns1:echoMultipleFaults2Request></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:ExtendedStructPart><ns1:structMessage><ns1:varString>s2</ns1:varString><ns1:varInt>2</ns1:varInt><ns1:varFloat>2.2</ns1:varFloat></ns1:structMessage><ns1:shortMessage>2</ns1:shortMessage><ns1:stringMessage>arg</ns1:stringMessage><ns1:intMessage>-3</ns1:intMessage><ns1:anotherIntMessage>5</ns1:anotherIntMessage></ns2:ExtendedStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt
new file mode 100644
index 000000000..28e9208c0
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt
@@ -0,0 +1,51 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 009 (php/wsdl): echoMultipleFaults2(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1);
+$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 3,
+ "param1" => $s1,
+ "param2" => $s2,
+ "param3" => $s3));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>3</ns1:whichFault><ns1:param1><ns2:structMessage><ns2:varString>s1</ns2:varString><ns2:varInt>1</ns2:varInt><ns2:varFloat>1.1</ns2:varFloat></ns2:structMessage><ns2:shortMessage>1</ns2:shortMessage></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>s2</ns2:varString><ns2:varInt>2</ns2:varInt><ns2:varFloat>2.2</ns2:varFloat></ns2:structMessage><ns2:shortMessage>2</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage></ns1:param2><ns1:param3><ns2:structMessage><ns2:varString>s3</ns2:varString><ns2:varInt>3</ns2:varInt><ns2:varFloat>3.3</ns2:varFloat></ns2:structMessage><ns2:shortMessage>3</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage><ns2:booleanMessage>true</ns2:booleanMessage></ns1:param3></ns1:echoMultipleFaults2Request></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:MoreExtendedStructPart><ns1:structMessage><ns1:varString>s3</ns1:varString><ns1:varInt>3</ns1:varInt><ns1:varFloat>3.3</ns1:varFloat></ns1:structMessage><ns1:shortMessage>3</ns1:shortMessage><ns1:stringMessage>arg</ns1:stringMessage><ns1:intMessage>-3</ns1:intMessage><ns1:anotherIntMessage>5</ns1:anotherIntMessage><ns1:booleanMessage>true</ns1:booleanMessage></ns2:MoreExtendedStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt
new file mode 100644
index 000000000..7c047e885
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt
@@ -0,0 +1,51 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex Doc Lit 010 (php/wsdl): echoMultipleFaults2(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->structMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(new SOAPStruct("s1",1,1.1),1);
+$s2 = new ExtendedStruct(new SOAPStruct("s2",2,2.2),2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(new SOAPStruct("s3",3,3.3),3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 4,
+ "param1" => $s1,
+ "param2" => $s2,
+ "param3" => $s3));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>4</ns1:whichFault><ns1:param1><ns2:structMessage><ns2:varString>s1</ns2:varString><ns2:varInt>1</ns2:varInt><ns2:varFloat>1.1</ns2:varFloat></ns2:structMessage><ns2:shortMessage>1</ns2:shortMessage></ns1:param1><ns1:param2><ns2:structMessage><ns2:varString>s2</ns2:varString><ns2:varInt>2</ns2:varInt><ns2:varFloat>2.2</ns2:varFloat></ns2:structMessage><ns2:shortMessage>2</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage></ns1:param2><ns1:param3><ns2:structMessage><ns2:varString>s3</ns2:varString><ns2:varInt>3</ns2:varInt><ns2:varFloat>3.3</ns2:varFloat></ns2:structMessage><ns2:shortMessage>3</ns2:shortMessage><ns2:stringMessage>arg</ns2:stringMessage><ns2:intMessage>-3</ns2:intMessage><ns2:anotherIntMessage>5</ns2:anotherIntMessage><ns2:booleanMessage>true</ns2:booleanMessage></ns1:param3></ns1:echoMultipleFaults2Request></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:BaseStructPart><ns1:structMessage><ns1:varString>s1</ns1:varString><ns1:varInt>1</ns1:varInt><ns1:varFloat>1.1</ns1:varFloat></ns1:structMessage><ns1:shortMessage>1</ns1:shortMessage></ns2:BaseStructPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
new file mode 100644
index 000000000..3c77e08f0
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 001 (php/wsdl): echoSOAPStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPStruct('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSOAPStructFault(array("soapStruct"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..9b1a2b2bf
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt
@@ -0,0 +1,25 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 002 (php/wsdl): echoBaseStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$struct = new BaseStruct(12.345,12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBaseStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..db2890c8e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt
@@ -0,0 +1,33 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 003 (php/wsdl): echoExtendedStructFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+$struct = new ExtendedStruct(12.345,12,"arg",-3,5);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoExtendedStructFault($struct);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..0846a04ba
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt
@@ -0,0 +1,33 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 004 (php/wsdl): echoMultipleFaults1(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg',34,325.325);
+$s2 = new BaseStruct(12.345,12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(1,$s1,$s2);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..03db1a245
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt
@@ -0,0 +1,33 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 005 (php/wsdl): echoMultipleFaults1(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg',34,325.325);
+$s2 = new BaseStruct(12.345,12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(2,$s1,$s2);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..e5fa8540a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt
@@ -0,0 +1,33 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 006 (php/wsdl): echoMultipleFaults1(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPStruct {
+ function SOAPStruct($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+$s1 = new SOAPStruct('arg',34,325.325);
+$s2 = new BaseStruct(12.345,12);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(3,$s1,$s2);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..8df5e9a94
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt
@@ -0,0 +1,41 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 007 (php/wsdl): echoMultipleFaults2(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(12.345,1);
+$s2 = new ExtendedStruct(12.345,2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(1,$s1,$s2,$s3);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..ed1a38cb1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt
@@ -0,0 +1,41 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 008 (php/wsdl): echoMultipleFaults2(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(12.345,1);
+$s2 = new ExtendedStruct(12.345,2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(2,$s1,$s2,$s3);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..1c206ff81
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt
@@ -0,0 +1,41 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 009 (php/wsdl): echoMultipleFaults2(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(12.345,1);
+$s2 = new ExtendedStruct(12.345,2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(3,$s1,$s2,$s3);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..8d7597655
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt
@@ -0,0 +1,41 @@
+--TEST--
+SOAP Interop Round4 GroupH Complex RPC Enc 010 (php/wsdl): echoMultipleFaults2(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class BaseStruct {
+ function BaseStruct($f, $s) {
+ $this->floatMessage = $f;
+ $this->shortMessage = $s;
+ }
+}
+class ExtendedStruct extends BaseStruct {
+ function ExtendedStruct($f, $s, $x1, $x2, $x3) {
+ $this->BaseStruct($f,$s);
+ $this->stringMessage = $x1;
+ $this->intMessage = $x2;
+ $this->anotherIntMessage = $x3;
+ }
+}
+class MoreExtendedStruct extends ExtendedStruct {
+ function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) {
+ $this->ExtendedStruct($f, $s, $x1, $x2, $x3);
+ $this->booleanMessage = $b;
+ }
+}
+$s1 = new BaseStruct(12.345,1);
+$s2 = new ExtendedStruct(12.345,2,"arg",-3,5);
+$s3 = new MoreExtendedStruct(12.345,3,"arg",-3,5,true);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(4,$s1,$s2,$s3);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_complex_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt
new file mode 100644
index 000000000..576b664db
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_001w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 001 (php/wsdl): echoEmptyFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoEmptyFault();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+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/types/requestresponse"><SOAP-ENV:Body><ns1:echoEmptyFaultRequest/></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoEmptyFault'.</faultstring><detail><ns1:EmptyPart/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt
new file mode 100644
index 000000000..5484df49c
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_002w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 002 (php/wsdl): echoStringFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringFault("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse"><SOAP-ENV:Body><ns1:echoStringFaultRequest>Hello World</ns1:echoStringFaultRequest></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoStringFault'.</faultstring><detail><ns1:StringPart>Hello World</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt
new file mode 100644
index 000000000..c6f519d13
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_003w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 003 (php/wsdl): echoIntArrayFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoIntArrayFault(array(34,12.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/types/requestresponse"><SOAP-ENV:Body><ns2:echoIntArrayFaultRequest><ns1:value>34</ns1:value><ns1:value>12</ns1:value></ns2:echoIntArrayFaultRequest></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoIntArrayFault'.</faultstring><detail><ns2:ArrayOfIntPart><ns1:value>34</ns1:value><ns1:value>12</ns1:value></ns2:ArrayOfIntPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt
new file mode 100644
index 000000000..61c1e59be
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_004w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 004 (php/wsdl): echoMultipleFaults1(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 1,
+ "param1" => "Hello world",
+ "param2" => array(12.345,45,678)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>1</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2><ns2:value>12.345</ns2:value><ns2:value>45</ns2:value><ns2:value>678</ns2:value></ns1:param2></ns1:echoMultipleFaults1Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns1:EmptyPart/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt
new file mode 100644
index 000000000..dd65751c4
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_005w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 005 (php/wsdl): echoMultipleFaults1(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 2,
+ "param1" => "Hello world",
+ "param2" => array(12.345,45,678)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>2</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2><ns2:value>12.345</ns2:value><ns2:value>45</ns2:value><ns2:value>678</ns2:value></ns1:param2></ns1:echoMultipleFaults1Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns1:StringPart>Hello world</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt
new file mode 100644
index 000000000..a8ba99206
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_006w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 006 (php/wsdl): echoMultipleFaults1(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 3,
+ "param1" => "Hello world",
+ "param2" => array(12.345,45,678)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>3</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2><ns2:value>12.345</ns2:value><ns2:value>45</ns2:value><ns2:value>678</ns2:value></ns1:param2></ns1:echoMultipleFaults1Request></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:ArrayOfFloatPart><ns1:value>12.345</ns1:value><ns1:value>45</ns1:value><ns1:value>678</ns1:value></ns2:ArrayOfFloatPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt
new file mode 100644
index 000000000..5cc2c2062
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_007w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 007 (php/wsdl): echoMultipleFaults1(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(array("whichFault" => 4,
+ "param1" => "Hello world",
+ "param2" => array(12.345,45,678)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults1Request><ns1:whichFault>4</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2><ns2:value>12.345</ns2:value><ns2:value>45</ns2:value><ns2:value>678</ns2:value></ns1:param2></ns1:echoMultipleFaults1Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns1:EmptyPart/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt
new file mode 100644
index 000000000..3125a4c0c
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_008w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 008 (php/wsdl): echoMultipleFaults2(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 1,
+ "param1" => "Hello world",
+ "param2" => 12.345,
+ "param3" => array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>1</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2>12.345</ns1:param2><ns1:param3><ns2:value>one</ns2:value><ns2:value>two</ns2:value><ns2:value>three</ns2:value></ns1:param3></ns1:echoMultipleFaults2Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:FloatPart>12.345</ns1:FloatPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt
new file mode 100644
index 000000000..460af7915
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_009w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 009 (php/wsdl): echoMultipleFaults2(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 2,
+ "param1" => "Hello world",
+ "param2" => 12.345,
+ "param3" => array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>2</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2>12.345</ns1:param2><ns1:param3><ns2:value>one</ns2:value><ns2:value>two</ns2:value><ns2:value>three</ns2:value></ns1:param3></ns1:echoMultipleFaults2Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:StringPart>Hello world</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt
new file mode 100644
index 000000000..c5c7ba738
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_010w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 010 (php/wsdl): echoMultipleFaults2(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 3,
+ "param1" => "Hello world",
+ "param2" => 12.345,
+ "param3" => array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>3</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2>12.345</ns1:param2><ns1:param3><ns2:value>one</ns2:value><ns2:value>two</ns2:value><ns2:value>three</ns2:value></ns1:param3></ns1:echoMultipleFaults2Request></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/types/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:ArrayOfStringPart><ns1:value>one</ns1:value><ns1:value>two</ns1:value><ns1:value>three</ns1:value></ns2:ArrayOfStringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt
new file mode 100644
index 000000000..9753e9854
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_011w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 011 (php/wsdl): echoMultipleFaults2(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(array("whichFault" => 4,
+ "param1" => "Hello world",
+ "param2" => 12.345,
+ "param3" => array("one","two","three")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse" xmlns:ns2="http://soapinterop.org/types"><SOAP-ENV:Body><ns1:echoMultipleFaults2Request><ns1:whichFault>4</ns1:whichFault><ns1:param1>Hello world</ns1:param1><ns1:param2>12.345</ns1:param2><ns1:param3><ns2:value>one</ns2:value><ns2:value>two</ns2:value><ns2:value>three</ns2:value></ns1:param3></ns1:echoMultipleFaults2Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:FloatPart>12.345</ns1:FloatPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt
new file mode 100644
index 000000000..7bf2ae3a7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_012w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 012 (php/wsdl): echoMultipleFaults3(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(array("whichFault" => 1,
+ "param1" => "arg1",
+ "param2" => "arg2"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults3Request><ns1:whichFault>1</ns1:whichFault><ns1:param1>arg1</ns1:param1><ns1:param2>arg2</ns1:param2></ns1:echoMultipleFaults3Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:StringPart>arg1</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt
new file mode 100644
index 000000000..058e16eb2
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_013w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 013 (php/wsdl): echoMultipleFaults3(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(array("whichFault" => 2,
+ "param1" => "arg1",
+ "param2" => "arg2"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults3Request><ns1:whichFault>2</ns1:whichFault><ns1:param1>arg1</ns1:param1><ns1:param2>arg2</ns1:param2></ns1:echoMultipleFaults3Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:String2Part>arg2</ns1:String2Part></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt
new file mode 100644
index 000000000..ab1028bbe
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_014w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 014 (php/wsdl): echoMultipleFaults3(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(array("whichFault" => 3,
+ "param1" => "arg1",
+ "param2" => "arg2"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults3Request><ns1:whichFault>3</ns1:whichFault><ns1:param1>arg1</ns1:param1><ns1:param2>arg2</ns1:param2></ns1:echoMultipleFaults3Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:StringPart>arg1</ns1:StringPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt
new file mode 100644
index 000000000..d3949c91a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_015w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 015 (php/wsdl): echoMultipleFaults4(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(array("whichFault" => 1,
+ "param1" => 162,
+ "param2" => 1));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults4Request><ns1:whichFault>1</ns1:whichFault><ns1:param1>162</ns1:param1><ns1:param2>1</ns1:param2></ns1:echoMultipleFaults4Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:IntPart>162</ns1:IntPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt
new file mode 100644
index 000000000..b16cc2375
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_016w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 016 (php/wsdl): echoMultipleFaults4(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(array("whichFault" => 2,
+ "param1" => 162,
+ "param2" => 1));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults4Request><ns1:whichFault>2</ns1:whichFault><ns1:param1>162</ns1:param1><ns1:param2>1</ns1:param2></ns1:echoMultipleFaults4Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:EnumPart>1</ns1:EnumPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt
new file mode 100644
index 000000000..442f45261
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_doclit_017w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple Doc Lit 017 (php/wsdl): echoMultipleFaults4(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(array("whichFault" => 3,
+ "param1" => 162,
+ "param2" => 1));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_doclit.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/requestresponse"><SOAP-ENV:Body><ns1:echoMultipleFaults4Request><ns1:whichFault>3</ns1:whichFault><ns1:param1>162</ns1:param1><ns1:param2>1</ns1:param2></ns1:echoMultipleFaults4Request></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/part"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:IntPart>162</ns1:IntPart></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
new file mode 100644
index 000000000..8582257d2
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 001 (php/wsdl): echoEmptyFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoEmptyFault();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+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>
+<?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>
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
new file mode 100644
index 000000000..f86355121
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 002 (php/wsdl): echoStringFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringFault("Hello World");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
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
new file mode 100644
index 000000000..0cddcdc94
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 003 (php/wsdl): echoIntArrayFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoIntArrayFault(array(34,12.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..dbf1d63f1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 004 (php/wsdl): echoMultipleFaults1(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(1,"Hello world",array(12.345,45,678));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..25b4d0145
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 005 (php/wsdl): echoMultipleFaults1(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(2,"Hello world",array(12.345,45,678));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..b25d7c0e0
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 006 (php/wsdl): echoMultipleFaults1(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(3,"Hello world",array(12.345,45,678));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..f4484b690
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 007 (php/wsdl): echoMultipleFaults1(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults1(4,"Hello world",array(12.345,45,678));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..c7cbd26b9
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 008 (php/wsdl): echoMultipleFaults2(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(1, "Hello World", 12.345, array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..28d4819b8
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 009 (php/wsdl): echoMultipleFaults2(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(2, "Hello World", 12.345, array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..0030daebb
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 010 (php/wsdl): echoMultipleFaults2(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(3, "Hello World", 12.345, array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..bccad3665
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 011 (php/wsdl): echoMultipleFaults2(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults2(4, "Hello World", 12.345, array("one","two","three"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..2dccfc397
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 012 (php/wsdl): echoMultipleFaults3(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(1,"arg1","arg2");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
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
new file mode 100644
index 000000000..0a557cc72
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 013 (php/wsdl): echoMultipleFaults3(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(2,"arg1","arg2");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
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
new file mode 100644
index 000000000..d082e5c8d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 014 (php/wsdl): echoMultipleFaults3(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults3(3,"arg1","arg2");
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
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
new file mode 100644
index 000000000..d3139de6f
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 015 (php/wsdl): echoMultipleFaults4(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(1, 162, 1);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..43f71b2cc
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 016 (php/wsdl): echoMultipleFaults4(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(2, 162, 1);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..e0e31d90b
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SOAP Interop Round4 GroupH Simple RPC Enc 017 (php/wsdl): echoMultipleFaults4(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoMultipleFaults4(3, 162, 1);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_simple_rpcenc.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
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
new file mode 100644
index 000000000..44e79cc0b
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupH SoapFault 001 (php/wsdl): echoVersionMismatchFault(SOAP 1.1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_soapfault.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVersionMismatchFault();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_soapfault.inc");
+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>
+<?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>
+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
new file mode 100644
index 000000000..3ef248962
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupH SoapFault 002 (php/wsdl): echoVersionMismatchFault(SOAP 1.2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_soapfault.wsdl",array("trace"=>1,"exceptions"=>0,"soap_version"=>SOAP_1_2));
+$client->echoVersionMismatchFault();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_soapfault.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt
new file mode 100644
index 000000000..586cc69e2
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_003w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupH SoapFault 003 (php/wsdl): echoVersionMismatchFault(unknown version)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://unknown.org/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>
+EOF;
+echo $HTTP_RAW_POST_DATA."\n";
+include("round4_groupH_soapfault.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://unknown.org/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>
+<?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:VersionMismatch</faultcode><faultstring>Wrong Version</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
new file mode 100644
index 000000000..8e6b91136
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupH SoapFault 004 (php/wsdl): echoMustUnderstandFault
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/wsdl", "UnknownHeaderRequest", "Hello World", 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupH_soapfault.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVersionMismatchFault",array(), null, $hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupH_soapfault.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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>
+<?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/interop/Round4/GroupH/round4_groupH_complex_doclit.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc
new file mode 100644
index 000000000..1c31aa3da
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.inc
@@ -0,0 +1,38 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoSOAPStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoSOAPStructFault'.", null, array("soapStruct"=>$input), "ComplexFault");
+ }
+
+ function echoBaseStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoBaseStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoExtendedStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoExtendedStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoMultipleFaults1($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $input->param2, "ComplexFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, array("soapStruct"=>$input->param1), "ComplexFault1");
+ }
+ }
+
+ function echoMultipleFaults2($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param2, "ComplexFault2");
+ } else if ($input->whichFault == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param3, "ComplexFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param1, "ComplexFault1");
+ }
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_complex_doclit.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl
new file mode 100644
index 000000000..f1c383dc1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_doclit.wsdl
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ xmlns:ns3="http://soapinterop.org/types/part"
+ xmlns:ns4="http://soapinterop.org/types/requestresponse"
+ targetNamespace="http://soapinterop.org/wsdl">
+
+ <types>
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/types">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+
+ <complexType name="SOAPStruct">
+ <sequence>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SOAPStructFault">
+ <sequence>
+ <element name="soapStruct" type="tns:SOAPStruct"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="BaseStruct">
+ <sequence>
+ <element name="structMessage" type="tns:SOAPStruct"/>
+ <element name="shortMessage" type="xsd:short"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ExtendedStruct">
+ <complexContent>
+ <extension base="tns:BaseStruct">
+ <sequence>
+ <element name="stringMessage" type="xsd:string"/>
+ <element name="intMessage" type="xsd:int"/>
+ <element name="anotherIntMessage" type="xsd:int"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="MoreExtendedStruct">
+ <complexContent>
+ <extension base="tns:ExtendedStruct">
+ <sequence>
+ <element name="booleanMessage" type="xsd:boolean"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ </schema>
+
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types/part"
+ targetNamespace="http://soapinterop.org/types/part">
+
+ <element name="SOAPStructFaultPart" type="ns2:SOAPStructFault"/>
+ <element name="BaseStructPart" type="ns2:BaseStruct"/>
+ <element name="ExtendedStructPart" type="ns2:ExtendedStruct"/>
+ <element name="MoreExtendedStructPart" type="ns2:MoreExtendedStruct"/>
+
+ </schema>
+
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types/requestresponse"
+ targetNamespace="http://soapinterop.org/types/requestresponse">
+
+ <element name="echoSOAPStructFaultRequest" type="ns2:SOAPStruct"/>
+ <element name="echoSOAPStructFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoBaseStructFaultRequest" type="ns2:BaseStruct"/>
+ <element name="echoBaseStructFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoExtendedStructFaultRequest" type="ns2:ExtendedStruct"/>
+ <element name="echoExtendedStructFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults1Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="ns2:SOAPStruct"/>
+ <element name="param2" type="ns2:BaseStruct"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults1Response">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults2Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="ns2:BaseStruct"/>
+ <element name="param2" type="ns2:ExtendedStruct"/>
+ <element name="param3" type="ns2:MoreExtendedStruct"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults2Response">
+ <complexType/>
+ </element>
+
+ </schema>
+ </types>
+
+ <message name="echoSOAPStructFaultRequest">
+ <part name="param" element="ns4:echoSOAPStructFaultRequest"/>
+ </message>
+ <message name="echoSOAPStructFaultResponse">
+ <part name="param" element="ns4:echoSOAPStructFaultResponse"/>
+ </message>
+
+ <message name="echoBaseStructFaultRequest">
+ <part name="param" element="ns4:echoBaseStructFaultRequest"/>
+ </message>
+ <message name="echoBaseStructFaultResponse">
+ <part name="param" element="ns4:echoBaseStructFaultResponse"/>
+ </message>
+
+ <message name="echoExtendedStructFaultRequest">
+ <part name="param" element="ns4:echoExtendedStructFaultRequest"/>
+ </message>
+ <message name="echoExtendedStructFaultResponse">
+ <part name="param" element="ns4:echoExtendedStructFaultResponse"/>
+ </message>
+
+ <message name="echoMultipleFaults1Request">
+ <part name="param" element="ns4:echoMultipleFaults1Request"/>
+ </message>
+ <message name="echoMultipleFaults1Response">
+ <part name="param" element="ns4:echoMultipleFaults1Response"/>
+ </message>
+
+ <message name="echoMultipleFaults2Request">
+ <part name="param" element="ns4:echoMultipleFaults2Request"/>
+ </message>
+ <message name="echoMultipleFaults2Response">
+ <part name="param" element="ns4:echoMultipleFaults2Response"/>
+ </message>
+
+ <!-- Fault messages -->
+ <message name="SOAPStructFault">
+ <part name="part3" element="ns3:SOAPStructFaultPart"/>
+ </message>
+ <message name="BaseStructFault">
+ <part name="part1" element="ns3:BaseStructPart"/>
+ </message>
+ <message name="ExtendedStructFault">
+ <part name="part2" element="ns3:ExtendedStructPart"/>
+ </message>
+ <message name="MoreExtendedStructFault">
+ <part name="part5" element="ns3:MoreExtendedStructPart"/>
+ </message>
+
+ <portType name="ComplexDocLitPortType">
+ <!--
+ Throws a fault with an embedded SOAPStruct
+ -->
+ <operation name="echoSOAPStructFault" parameterOrder="">
+ <input message="tns:echoSOAPStructFaultRequest"/>
+ <output message="tns:echoSOAPStructFaultResponse"/>
+ <fault name="ComplexFault" message="tns:SOAPStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with a base complex struct
+ -->
+ <operation name="echoBaseStructFault" parameterOrder="">
+ <input message="tns:echoBaseStructFaultRequest"/>
+ <output message="tns:echoBaseStructFaultResponse"/>
+ <fault name="ComplexFault" message="tns:BaseStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with an en extended complex type
+ -->
+ <operation name="echoExtendedStructFault" parameterOrder="">
+ <input message="tns:echoExtendedStructFaultRequest"/>
+ <output message="tns:echoExtendedStructFaultResponse"/>
+ <fault name="ComplexFault" message="tns:ExtendedStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with embedded complex type, fault with an
+ extended complex type and fault with an array of a base
+ complex type
+ -->
+ <operation name="echoMultipleFaults1" parameterOrder="param">
+ <input message="tns:echoMultipleFaults1Request"/>
+ <output message="tns:echoMultipleFaults1Response"/>
+ <fault name="ComplexFault1" message="tns:SOAPStructFault"/>
+ <fault name="ComplexFault2" message="tns:BaseStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with an array of base complex type and
+ a fault with doubly extended complex type
+ -->
+ <operation name="echoMultipleFaults2" parameterOrder="param">
+ <input message="tns:echoMultipleFaults2Request"/>
+ <output message="tns:echoMultipleFaults2Response"/>
+ <fault name="ComplexFault1" message="tns:BaseStructFault"/>
+ <fault name="ComplexFault2" message="tns:ExtendedStructFault"/>
+ <fault name="ComplexFault3" message="tns:MoreExtendedStructFault"/>
+ </operation>
+ </portType>
+
+ <binding name="ComplexDocLitBinding" type="tns:ComplexDocLitPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="echoSOAPStructFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoBaseStructFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoExtendedStructFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults1">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault1">
+ <soap:fault
+ name="ComplexFault1"
+ use="literal"/>
+ </fault>
+ <fault name="ComplexFault2">
+ <soap:fault
+ name="ComplexFault2"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults2">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ComplexFault1">
+ <soap:fault
+ name="ComplexFault1"
+ use="literal"/>
+ </fault>
+ <fault name="ComplexFault2">
+ <soap:fault
+ name="ComplexFault2"
+ use="literal"/>
+ </fault>
+ <fault name="ComplexFault3">
+ <soap:fault
+ name="ComplexFault3"
+ use="literal"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+ </binding>
+
+ <service name="ComplexDocLitService">
+ <port name="ComplexDocLitPort" binding="tns:ComplexDocLitBinding">
+ <soap:address
+ location="test://"/>
+ </port>
+ </service>
+</definitions>
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc
new file mode 100644
index 000000000..6dec18647
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.inc
@@ -0,0 +1,38 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoSOAPStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoSOAPStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoBaseStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoBaseStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoExtendedStructFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoExtendedStructFault'.", null, $input, "ComplexFault");
+ }
+
+ function echoMultipleFaults1($which, $s1, $s2) {
+ if ($which == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $s2, "ComplexFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, array("soapStruct"=>$s1), "ComplexFault1");
+ }
+ }
+
+ function echoMultipleFaults2($which, $s1, $s2, $s3) {
+ if ($which == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $s2, "ComplexFault2");
+ } else if ($which == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $s3, "ComplexFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $s1, "ComplexFault1");
+ }
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_complex_rpcenc.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl
new file mode 100644
index 000000000..e78ca38ea
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_complex_rpcenc.wsdl
@@ -0,0 +1,301 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/wsdl">
+
+ <types>
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://soapinterop.org/types">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+
+ <complexType name="SOAPStruct">
+ <sequence>
+ <element name="varString" type="xsd:string"/>
+ <element name="varInt" type="xsd:int"/>
+ <element name="varFloat" type="xsd:float"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SOAPStructFault">
+ <sequence>
+ <element name="soapStruct" type="tns:SOAPStruct"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="BaseStruct">
+ <sequence>
+ <element name="floatMessage" type="xsd:float"/>
+ <element name="shortMessage" type="xsd:short"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ExtendedStruct">
+ <complexContent>
+ <extension base="tns:BaseStruct">
+ <sequence>
+ <element name="stringMessage" type="xsd:string"/>
+ <element name="intMessage" type="xsd:int"/>
+ <element name="anotherIntMessage" type="xsd:int"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="MoreExtendedStruct">
+ <complexContent>
+ <extension base="tns:ExtendedStruct">
+ <sequence>
+ <element name="booleanMessage" type="xsd:boolean"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ </schema>
+ </types>
+
+ <message name="echoFaultResponse"/>
+ <message name="echoSOAPStructFaultRequest">
+ <part name="param" type="ns2:SOAPStructFault"/>
+ </message>
+ <message name="echoBaseStructFaultRequest">
+ <part name="param" type="ns2:BaseStruct"/>
+ </message>
+ <message name="echoExtendedStructFaultRequest">
+ <part name="param" type="ns2:ExtendedStruct"/>
+ </message>
+ <message name="echoMultipleFaults1Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="ns2:SOAPStruct"/>
+ <part name="param2" type="ns2:BaseStruct"/>
+ </message>
+ <message name="echoMultipleFaults2Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="ns2:BaseStruct"/>
+ <part name="param2" type="ns2:ExtendedStruct"/>
+ <part name="param3" type="ns2:MoreExtendedStruct"/>
+ </message>
+
+ <!-- Fault messages -->
+ <message name="SOAPStructFault">
+ <part name="part1" type="ns2:SOAPStructFault"/>
+ </message>
+ <message name="BaseStructFault">
+ <part name="part2" type="ns2:BaseStruct"/>
+ </message>
+ <message name="ExtendedStructFault">
+ <part name="part3" type="ns2:ExtendedStruct"/>
+ </message>
+ <message name="MoreExtendedStructFault">
+ <part name="part4" type="ns2:MoreExtendedStruct"/>
+ </message>
+
+ <portType name="ComplexRpcEncPortType">
+ <!--
+ Throws a fault with an embedded SOAPStruct
+ -->
+ <operation name="echoSOAPStructFault" parameterOrder="param">
+ <input message="tns:echoSOAPStructFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault" message="tns:SOAPStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with a base complex struct
+ -->
+ <operation name="echoBaseStructFault" parameterOrder="param">
+ <input message="tns:echoBaseStructFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault" message="tns:BaseStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with an en extended complex type
+ -->
+ <operation name="echoExtendedStructFault" parameterOrder="param">
+ <input message="tns:echoExtendedStructFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault" message="tns:ExtendedStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with embedded complex type and fault with
+ another complex type
+ -->
+ <operation name="echoMultipleFaults1" parameterOrder="whichFault param1 param2">
+ <input message="tns:echoMultipleFaults1Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault1" message="tns:SOAPStructFault"/>
+ <fault name="ComplexFault2" message="tns:BaseStructFault"/>
+ </operation>
+
+ <!--
+ Throws a fault with base complex type, fault with an extended
+ complex type and a fault with doubly extended complex type
+ -->
+ <operation name="echoMultipleFaults2" parameterOrder="whichFault param1 param2 param3">
+ <input message="tns:echoMultipleFaults2Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="ComplexFault1" message="tns:BaseStructFault"/>
+ <fault name="ComplexFault2" message="tns:ExtendedStructFault"/>
+ <fault name="ComplexFault3" message="tns:MoreExtendedStructFault"/>
+ </operation>
+ </portType>
+
+ <binding name="ComplexRpcEncBinding" type="tns:ComplexRpcEncPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <operation name="echoSOAPStructFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoBaseStructFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoExtendedStructFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault">
+ <soap:fault
+ name="ComplexFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults1">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault1">
+ <soap:fault
+ name="ComplexFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="ComplexFault2">
+ <soap:fault
+ name="ComplexFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults2">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="ComplexFault1">
+ <soap:fault
+ name="ComplexFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="ComplexFault2">
+ <soap:fault
+ name="ComplexFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="ComplexFault3">
+ <soap:fault
+ name="ComplexFault3"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+ </binding>
+
+ <service name="ComplexRpcEncService">
+ <port name="ComplexRpcEncPort" binding="tns:ComplexRpcEncBinding">
+ <soap:address
+ location="test://"/>
+ </port>
+ </service>
+</definitions>
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc
new file mode 100644
index 000000000..6a04cfd2d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.inc
@@ -0,0 +1,56 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoEmptyFault() {
+ return new SoapFault("Server", "Fault in response to 'echoEmptyFault'.", null, null, "SimpleFault");
+ }
+
+ function echoStringFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoStringFault'.", null, $input, "SimpleFault");
+ }
+
+ function echoIntArrayFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoIntArrayFault'.", null, $input, "SimpleFault");
+ }
+
+ function echoMultipleFaults1($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $input->param1, "SimpleFault2");
+ } else if ($input->whichFault == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $input->param2, "SimpleFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, null, "SimpleFault1");
+ }
+ }
+
+ function echoMultipleFaults2($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param1, "SimpleFault1");
+ } else if ($input->whichFault == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param3, "SimpleFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $input->param2, "SimpleFault2");
+ }
+ }
+
+ function echoMultipleFaults3($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $input->param2, "SimpleFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $input->param1, "SimpleFault1");
+ }
+ }
+
+ function echoMultipleFaults4($input) {
+ if ($input->whichFault == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $input->param2, "SimpleFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $input->param1, "SimpleFault1");
+ }
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_simple_doclit.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl
new file mode 100644
index 000000000..8f0d32217
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_doclit.wsdl
@@ -0,0 +1,418 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ xmlns:ns3="http://soapinterop.org/types/part"
+ xmlns:ns4="http://soapinterop.org/types/requestresponse"
+ targetNamespace="http://soapinterop.org/wsdl">
+ <types>
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/types">
+
+ <complexType name="ArrayOfString">
+ <sequence>
+ <element name="value" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ArrayOfInt">
+ <sequence>
+ <element name="value" minOccurs="0" maxOccurs="unbounded" type="xsd:int"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ArrayOfFloat">
+ <sequence>
+ <element name="value" minOccurs="0" maxOccurs="unbounded" type="xsd:float"/>
+ </sequence>
+ </complexType>
+
+ <simpleType name="Enum">
+ <restriction base="xsd:int">
+ <enumeration value="1"/>
+ <enumeration value="2"/>
+ </restriction>
+ </simpleType>
+
+ </schema>
+
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types/part"
+ targetNamespace="http://soapinterop.org/types/part">
+
+ <element name="EmptyPart">
+ <complexType/>
+ </element>
+
+ <element name="StringPart" type="xsd:string"/>
+ <element name="IntPart" type="xsd:int"/>
+ <element name="FloatPart" type="xsd:float"/>
+ <element name="ArrayOfStringPart" type="ns2:ArrayOfString"/>
+ <element name="ArrayOfIntPart" type="ns2:ArrayOfInt"/>
+ <element name="ArrayOfFloatPart" type="ns2:ArrayOfFloat"/>
+ <element name="String2Part" type="xsd:string"/>
+ <element name="EnumPart" type="ns2:Enum"/>
+
+ </schema>
+
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types/requestresponse"
+ targetNamespace="http://soapinterop.org/types/requestresponse">
+
+ <element name="echoEmptyFaultRequest">
+ <complexType/>
+ </element>
+ <element name="echoEmptyFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoStringFaultRequest" type="xsd:string"/>
+ <element name="echoStringFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoIntArrayFaultRequest" type="ns2:ArrayOfInt"/>
+ <element name="echoIntArrayFaultResponse">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults1Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="xsd:string"/>
+ <element name="param2" type="ns2:ArrayOfFloat"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults1Response">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults2Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="xsd:string"/>
+ <element name="param2" type="xsd:float"/>
+ <element name="param3" type="ns2:ArrayOfString"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults2Response">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults3Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="xsd:string"/>
+ <element name="param2" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults3Response">
+ <complexType/>
+ </element>
+
+ <element name="echoMultipleFaults4Request">
+ <complexType>
+ <sequence>
+ <element name="whichFault" type="xsd:int"/>
+ <element name="param1" type="xsd:int"/>
+ <element name="param2" type="ns2:Enum"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoMultipleFaults4Response">
+ <complexType/>
+ </element>
+
+ </schema>
+ </types>
+
+ <message name="echoEmptyFaultRequest">
+ <part name="param" element="ns4:echoEmptyFaultRequest"/>
+ </message>
+ <message name="echoEmptyFaultResponse">
+ <part name="param" element="ns4:echoEmptyFaultResponse"/>
+ </message>
+
+ <message name="echoStringFaultRequest">
+ <part name="param" element="ns4:echoStringFaultRequest"/>
+ </message>
+ <message name="echoStringFaultResponse">
+ <part name="param" element="ns4:echoStringFaultResponse"/>
+ </message>
+
+ <message name="echoIntArrayFaultRequest">
+ <part name="param" element="ns4:echoIntArrayFaultRequest"/>
+ </message>
+ <message name="echoIntArrayFaultResponse">
+ <part name="param" element="ns4:echoIntArrayFaultResponse"/>
+ </message>
+
+ <message name="echoMultipleFaults1Request">
+ <part name="param" element="ns4:echoMultipleFaults1Request"/>
+ </message>
+ <message name="echoMultipleFaults1Response">
+ <part name="param" element="ns4:echoMultipleFaults1Response"/>
+ </message>
+
+ <message name="echoMultipleFaults2Request">
+ <part name="param" element="ns4:echoMultipleFaults2Request"/>
+ </message>
+ <message name="echoMultipleFaults2Response">
+ <part name="param" element="ns4:echoMultipleFaults2Response"/>
+ </message>
+
+ <message name="echoMultipleFaults3Request">
+ <part name="param" element="ns4:echoMultipleFaults3Request"/>
+ </message>
+ <message name="echoMultipleFaults3Response">
+ <part name="param" element="ns4:echoMultipleFaults3Response"/>
+ </message>
+
+ <message name="echoMultipleFaults4Request">
+ <part name="param" element="ns4:echoMultipleFaults4Request"/>
+ </message>
+ <message name="echoMultipleFaults4Response">
+ <part name="param" element="ns4:echoMultipleFaults4Response"/>
+ </message>
+
+ <!-- Fault messages -->
+ <message name="EmptyFault">
+ <part name="part1" element="ns3:EmptyPart"/>
+ </message>
+ <message name="StringFault">
+ <part name="part2" element="ns3:StringPart"/>
+ </message>
+ <message name="IntFault">
+ <part name="part3" element="ns3:IntPart"/>
+ </message>
+ <message name="FloatFault">
+ <part name="part4" element="ns3:FloatPart"/>
+ </message>
+ <message name="StringArrayFault">
+ <part name="part5" element="ns3:ArrayOfStringPart"/>
+ </message>
+ <message name="IntArrayFault">
+ <part name="part6" element="ns3:ArrayOfIntPart"/>
+ </message>
+ <message name="FloatArrayFault">
+ <part name="part7" element="ns3:ArrayOfFloatPart"/>
+ </message>
+ <!--
+ Part name same as in Fault2 message
+ -->
+ <message name="String2Fault">
+ <part name="part2" element="ns3:String2Part"/>
+ </message>
+ <message name="EnumFault">
+ <part name="part9" element="ns3:EnumPart"/>
+ </message>
+
+ <portType name="SimpleDocLitPortType">
+ <!--
+ Throws an empty fault
+ -->
+ <operation name="echoEmptyFault" parameterOrder="">
+ <input message="tns:echoEmptyFaultRequest"/>
+ <output message="tns:echoEmptyFaultResponse"/>
+ <fault name="SimpleFault" message="tns:EmptyFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:string parameter
+ -->
+ <operation name="echoStringFault" parameterOrder="param">
+ <input message="tns:echoStringFaultRequest"/>
+ <output message="tns:echoStringFaultResponse"/>
+ <fault name="SimpleFault" message="tns:StringFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:int[] parameter
+ -->
+ <operation name="echoIntArrayFault" parameterOrder="param">
+ <input message="tns:echoIntArrayFaultRequest"/>
+ <output message="tns:echoIntArrayFaultResponse"/>
+ <fault name="SimpleFault" message="tns:IntArrayFault"/>
+ </operation>
+
+ <!--
+ Throws empty fault, fault with a xsd:string
+ parameter and fault with xsd:float[] parameter
+ -->
+ <operation name="echoMultipleFaults1" parameterOrder="param">
+ <input message="tns:echoMultipleFaults1Request"/>
+ <output message="tns:echoMultipleFaults1Response"/>
+ <fault name="SimpleFault1" message="tns:EmptyFault"/>
+ <fault name="SimpleFault2" message="tns:StringFault"/>
+ <fault name="SimpleFault3" message="tns:FloatArrayFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:string parameter, fault with
+ xsd:float parameter and fault with xsd:string[]
+ parameters
+ -->
+ <operation name="echoMultipleFaults2" parameterOrder="param">
+ <input message="tns:echoMultipleFaults2Request"/>
+ <output message="tns:echoMultipleFaults2Response"/>
+ <fault name="SimpleFault1" message="tns:StringFault"/>
+ <fault name="SimpleFault2" message="tns:FloatFault"/>
+ <fault name="SimpleFault3" message="tns:StringArrayFault"/>
+ </operation>
+
+ <!--
+ Throws two faults, each with xsd:string parameters
+ and same part names
+ -->
+ <operation name="echoMultipleFaults3" parameterOrder="param">
+ <input message="tns:echoMultipleFaults3Request"/>
+ <output message="tns:echoMultipleFaults3Response"/>
+ <fault name="SimpleFault1" message="tns:StringFault"/>
+ <fault name="SimpleFault2" message="tns:String2Fault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:int parameter and fault with an
+ int enumeration parameter
+ -->
+ <operation name="echoMultipleFaults4" parameterOrder="param">
+ <input message="tns:echoMultipleFaults4Request"/>
+ <output message="tns:echoMultipleFaults4Response"/>
+ <fault name="SimpleFault1" message="tns:IntFault"/>
+ <fault name="SimpleFault2" message="tns:EnumFault"/>
+ </operation>
+ </portType>
+
+ <binding name="SimpleDocLitBinding" type="tns:SimpleDocLitPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+
+ <operation name="echoEmptyFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <soap:fault use="literal"/>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoStringFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoIntArrayFault">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoMultipleFaults1">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault3">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoMultipleFaults2">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault3">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoMultipleFaults3">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ <operation name="echoMultipleFaults4">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault use="literal"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault use="literal"/>
+ </fault>
+ <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
+ </operation>
+
+ </binding>
+
+ <service name="SimpleDocLitService">
+ <port name="SimpleDocLitPort" binding="tns:SimpleDocLitBinding">
+ <soap:address
+ location="http://"/>
+ </port>
+ </service>
+</definitions>
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc
new file mode 100644
index 000000000..0b85a34f9
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.inc
@@ -0,0 +1,56 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoEmptyFault() {
+ return new SoapFault("Server", "Fault in response to 'echoEmptyFault'.", null, null, "SimpleFault");
+ }
+
+ function echoStringFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoStringFault'.", null, $input, "SimpleFault");
+ }
+
+ function echoIntArrayFault($input) {
+ return new SoapFault("Server", "Fault in response to 'echoIntArrayFault'.", null, $input, "SimpleFault");
+ }
+
+ function echoMultipleFaults1($param, $string, $floats) {
+ if ($param == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $string, "SimpleFault2");
+ } else if ($param == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, $floats, "SimpleFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults1'.", null, null, "SimpleFault1");
+ }
+ }
+
+ function echoMultipleFaults2($param, $string, $float, $strings) {
+ if ($param == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $string, "SimpleFault1");
+ } else if ($param == 3) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $strings, "SimpleFault3");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults2'.", null, $float, "SimpleFault2");
+ }
+ }
+
+ function echoMultipleFaults3($param, $param1, $param2) {
+ if ($param == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $param2, "SimpleFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults3'.", null, $param1, "SimpleFault1");
+ }
+ }
+
+ function echoMultipleFaults4($param, $int, $enum) {
+ if ($param == 2) {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $enum, "SimpleFault2");
+ } else {
+ return new SoapFault("Server", "Fault in response to 'echoMultipleFaults4'.", null, $int, "SimpleFault1");
+ }
+ }
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_simple_rpcenc.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl
new file mode 100644
index 000000000..24f73fcb0
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_simple_rpcenc.wsdl
@@ -0,0 +1,408 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/wsdl">
+ <types>
+ <schema elementFormDefault="qualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://soapinterop.org/types"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://soapinterop.org/types">
+
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+
+ <complexType name="EmptyFault"/>
+
+ <complexType name="ArrayOfString">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ArrayOfInt">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ArrayOfFloat">
+ <complexContent>
+ <restriction base="soap-enc:Array">
+ <attribute ref="soap-enc:arrayType" wsdl:arrayType="float[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <simpleType name="Enum">
+ <restriction base="int">
+ <enumeration value="1"/>
+ <enumeration value="2"/>
+ </restriction>
+ </simpleType>
+ </schema>
+ </types>
+
+ <message name="echoFaultRequest"/>
+ <message name="echoFaultResponse"/>
+ <message name="echoStringFaultRequest">
+ <part name="param" type="xsd:string"/>
+ </message>
+ <message name="echoIntArrayFaultRequest">
+ <part name="param" type="ns2:ArrayOfInt"/>
+ </message>
+ <message name="echoMultipleFaults1Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="xsd:string"/>
+ <part name="param2" type="ns2:ArrayOfFloat"/>
+ </message>
+ <message name="echoMultipleFaults2Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="xsd:string"/>
+ <part name="param2" type="xsd:float"/>
+ <part name="param3" type="ns2:ArrayOfString"/>
+ </message>
+ <message name="echoMultipleFaults3Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="xsd:string"/>
+ <part name="param2" type="xsd:string"/>
+ </message>
+ <message name="echoMultipleFaults4Request">
+ <part name="whichFault" type="xsd:int"/>
+ <part name="param1" type="xsd:int"/>
+ <part name="param2" type="ns2:Enum"/>
+ </message>
+
+ <!-- Fault messages -->
+ <message name="EmptyFault">
+ <part name="part1" type="ns2:EmptyFault"/>
+ </message>
+ <message name="StringFault">
+ <part name="part2" type="xsd:string"/>
+ </message>
+ <message name="IntFault">
+ <part name="part3" type="xsd:int"/>
+ </message>
+ <message name="FloatFault">
+ <part name="part4" type="xsd:float"/>
+ </message>
+ <message name="IntArrayFault">
+ <part name="part5" type="ns2:ArrayOfInt"/>
+ </message>
+ <message name="StringArrayFault">
+ <part name="part6" type="ns2:ArrayOfString"/>
+ </message>
+ <message name="FloatArrayFault">
+ <part name="part7" type="ns2:ArrayOfFloat"/>
+ </message>
+ <!--
+ Part name same as in StringFault message
+ -->
+ <message name="String2Fault">
+ <part name="part2" type="xsd:string"/>
+ </message>
+ <message name="EnumFault">
+ <part name="part9" type="ns2:Enum"/>
+ </message>
+
+ <portType name="SimpleRpcEncPortType">
+ <!--
+ Throws an empty fault
+ -->
+ <operation name="echoEmptyFault" parameterOrder="">
+ <input message="tns:echoFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault" message="tns:EmptyFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:string parameter
+ -->
+ <operation name="echoStringFault" parameterOrder="param">
+ <input message="tns:echoStringFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault" message="tns:StringFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:int[] parameter
+ -->
+ <operation name="echoIntArrayFault" parameterOrder="param">
+ <input message="tns:echoIntArrayFaultRequest"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault" message="tns:IntArrayFault"/>
+ </operation>
+
+ <!--
+ Throws empty fault, fault with a xsd:string
+ parameter and fault with xsd:float[] parameter
+ -->
+ <operation name="echoMultipleFaults1" parameterOrder="whichFault param1 param2">
+ <input message="tns:echoMultipleFaults1Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault1" message="tns:EmptyFault"/>
+ <fault name="SimpleFault2" message="tns:StringFault"/>
+ <fault name="SimpleFault3" message="tns:FloatArrayFault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:string parameter, fault with
+ xsd:float parameter and fault with xsd:string[]
+ parameters
+ -->
+ <operation name="echoMultipleFaults2" parameterOrder="whichFault param1 param2 param3">
+ <input message="tns:echoMultipleFaults2Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault1" message="tns:StringFault"/>
+ <fault name="SimpleFault2" message="tns:FloatFault"/>
+ <fault name="SimpleFault3" message="tns:StringArrayFault"/>
+ </operation>
+
+ <!--
+ Throws two faults, each with xsd:string parameters
+ and same part names. Each part name is bound to a different
+ namespace.
+ -->
+ <operation name="echoMultipleFaults3" parameterOrder="whichFault param1 param2">
+ <input message="tns:echoMultipleFaults3Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault1" message="tns:StringFault"/>
+ <fault name="SimpleFault2" message="tns:String2Fault"/>
+ </operation>
+
+ <!--
+ Throws fault with xsd:int parameter and fault with an
+ int enumeration parameter
+ -->
+ <operation name="echoMultipleFaults4" parameterOrder="whichFault param1 param2">
+ <input message="tns:echoMultipleFaults4Request"/>
+ <output message="tns:echoFaultResponse"/>
+ <fault name="SimpleFault1" message="tns:IntFault"/>
+ <fault name="SimpleFault2" message="tns:EnumFault"/>
+ </operation>
+ </portType>
+
+ <binding name="SimpleRpcEncBinding" type="tns:SimpleRpcEncPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+
+ <operation name="echoEmptyFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault
+ name="SimpleFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoStringFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault
+ name="SimpleFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoIntArrayFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault">
+ <soap:fault
+ name="SimpleFault"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults1">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault
+ name="SimpleFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault
+ name="SimpleFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault3">
+ <soap:fault
+ name="SimpleFault3"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults2">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault
+ name="SimpleFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault
+ name="SimpleFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault3">
+ <soap:fault
+ name="SimpleFault3"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults3">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault
+ name="SimpleFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl/fault1"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault
+ name="SimpleFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl/fault2"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMultipleFaults4">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <fault name="SimpleFault1">
+ <soap:fault
+ name="SimpleFault1"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <fault name="SimpleFault2">
+ <soap:fault
+ name="SimpleFault2"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </fault>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ </binding>
+
+ <service name="SimpleRpcEncService">
+ <port name="SimpleRpcEncPort" binding="tns:SimpleRpcEncBinding">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc
new file mode 100644
index 000000000..cf6c3741c
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.inc
@@ -0,0 +1,22 @@
+<?php
+class SOAP_Interop_GroupH {
+
+ function echoVersionMismatchFault()
+ {
+ }
+
+ function echoMustUnderstandFault()
+ {
+ }
+
+ function HeaderRequest($string)
+ {
+ }
+
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupH_soapfault.wsdl");
+$server->setClass("SOAP_Interop_GroupH");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl
new file mode 100644
index 000000000..4f49b8f1b
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/round4_groupH_soapfault.wsdl
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://soapinterop.org/wsdl"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns2="http://soapinterop.org/types"
+ targetNamespace="http://soapinterop.org/wsdl">
+
+ <message name="echoVoidRequest"/>
+ <message name="echoVoidResponse"/>
+ <message name="HeaderRequest">
+ <part name="param" type="xsd:string"/>
+ </message>
+
+ <portType name="SOAPFaultPortType">
+ <operation name="echoVersionMismatchFault" parameterOrder="">
+ <input message="tns:echoVoidRequest"/>
+ <output message="tns:echoVoidResponse"/>
+ </operation>
+
+ <operation name="echoMustUnderstandFault" parameterOrder="">
+ <input message="tns:echoVoidRequest"/>
+ <output message="tns:echoVoidResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="SOAPFaultBinding" type="tns:SOAPFaultPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <!--
+ If the server receives an envelope with an incorrect
+ namespace, then a fault with VersionMismatch fault code
+ is populated in the SOAP response
+ -->
+ <operation name="echoVersionMismatchFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ <operation name="echoMustUnderstandFault">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ <soap:header
+ message="tns:HeaderRequest"
+ part="param"
+ use="encoded"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded"
+ namespace="http://soapinterop.org/wsdl"/>
+ </output>
+ <soap:operation soapAction=""/>
+ </operation>
+
+ </binding>
+
+ <service name="SOAPFaultService">
+ <port name="SOAPFaultPort" binding="tns:SOAPFaultBinding">
+ <soap:address location="test://"/>
+ </port>
+ </service>
+</definitions>
+
+
diff --git a/ext/soap/tests/interop/Round4/GroupH/skipif.inc b/ext/soap/tests/interop/Round4/GroupH/skipif.inc
new file mode 100644
index 000000000..fa8574e6a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupH/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt
new file mode 100644
index 000000000..a6ede9bbb
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_001w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 001 (php/wsdl): echoVoid
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoVoid();
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+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/"><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/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt
new file mode 100644
index 000000000..d72497175
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_002w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 002 (php/wsdl): echoInteger
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoInteger(array("inputInteger"=>22));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoInteger><ns1:inputInteger>22</ns1:inputInteger></ns1:echoInteger></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/"><SOAP-ENV:Body><ns1:echoIntegerResponse><ns1:return>22</ns1:return></ns1:echoIntegerResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt
new file mode 100644
index 000000000..705e2a976
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_003w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 003 (php/wsdl): echoFloat
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoFloat(array("inputFloat"=>12.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoFloat><ns1:inputFloat>12.345</ns1:inputFloat></ns1:echoFloat></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/"><SOAP-ENV:Body><ns1:echoFloatResponse><ns1:return>12.345</ns1:return></ns1:echoFloatResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt
new file mode 100644
index 000000000..db71f87e1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_004w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 004 (php/wsdl): echoString
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(array("inputString"=>"Hello World"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoString><ns1:inputString>Hello World</ns1:inputString></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/"><SOAP-ENV:Body><ns1:echoStringResponse><ns1:return>Hello World</ns1:return></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt
new file mode 100644
index 000000000..e741e000a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_005w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 005 (php/wsdl): echoString(empty)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoString(array());
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+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/"><SOAP-ENV:Body><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/"><SOAP-ENV:Body><ns1:echoStringResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phpt
new file mode 100644
index 000000000..32308ba2b
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_006w.phpt
Binary files differ
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt
new file mode 100644
index 000000000..917419eea
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_007w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 007 (php/wsdl): echoDate
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDate(array("inputDate"=>"2002-12-22T21:41:17Z"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoDate><ns1:inputDate>2002-12-22T21:41:17Z</ns1:inputDate></ns1:echoDate></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/"><SOAP-ENV:Body><ns1:echoDateResponse><ns1:return>2002-12-22T21:41:17Z</ns1:return></ns1:echoDateResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt
new file mode 100644
index 000000000..4f7c0f9d7
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 008 (php/wsdl): echoComplexType
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexType(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexType><ns2:inputComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:inputComplexType></ns2:echoComplexType></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt
new file mode 100644
index 000000000..25fa95287
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 009 (php/wsdl): echoComplexType(minOccur=0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+unset($struct->varString);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexType(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexType><ns2:inputComplexType><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns2:inputComplexType></ns2:echoComplexType></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt
new file mode 100644
index 000000000..9a8ea0365
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_010w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 010 (php/wsdl): echoIntegerMultiOccurs
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoIntegerMultiOccurs(array("inputIntegerMultiOccurs"=>array(22,29,36)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoIntegerMultiOccurs><ns1:inputIntegerMultiOccurs><ns1:int>22</ns1:int><ns1:int>29</ns1:int><ns1:int>36</ns1:int></ns1:inputIntegerMultiOccurs></ns1:echoIntegerMultiOccurs></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/"><SOAP-ENV:Body><ns1:echoIntegerMultiOccursResponse><ns1:return>22</ns1:return><ns1:return>29</ns1:return><ns1:return>36</ns1:return></ns1:echoIntegerMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt
new file mode 100644
index 000000000..1362a310e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_011w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 011 (php/wsdl): echoFloatMultiOccurs
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoFloatMultiOccurs(array("inputFloatMultiOccurs"=>array(22.5,12.345)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoFloatMultiOccurs><ns1:inputFloatMultiOccurs><ns1:float>22.5</ns1:float><ns1:float>12.345</ns1:float></ns1:inputFloatMultiOccurs></ns1:echoFloatMultiOccurs></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/"><SOAP-ENV:Body><ns1:echoFloatMultiOccursResponse><ns1:return>22.5</ns1:return><ns1:return>12.345</ns1:return></ns1:echoFloatMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt
new file mode 100644
index 000000000..231583dd2
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_012w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 012 (php/wsdl): echoStringMultiOccurs
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringMultiOccurs(array("inputStringMultiOccurs"=>array("arg1","arg2","arg3")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoStringMultiOccurs><ns1:inputStringMultiOccurs><ns1:string>arg1</ns1:string><ns1:string>arg2</ns1:string><ns1:string>arg3</ns1:string></ns1:inputStringMultiOccurs></ns1:echoStringMultiOccurs></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/"><SOAP-ENV:Body><ns1:echoStringMultiOccursResponse><ns1:return>arg1</ns1:return><ns1:return>arg2</ns1:return><ns1:return>arg3</ns1:return></ns1:echoStringMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt
new file mode 100644
index 000000000..199f91f4f
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_013w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 013 (php/wsdl): echoStringMultiOccurs(nil)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoStringMultiOccurs(array("inputStringMultiOccurs"=>array("arg1",NULL,"arg3")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:echoStringMultiOccurs><ns1:inputStringMultiOccurs><ns1:string>arg1</ns1:string><ns1:string xsi:nil="true"/><ns1:string>arg3</ns1:string></ns1:inputStringMultiOccurs></ns1:echoStringMultiOccurs></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/"><SOAP-ENV:Body><ns1:echoStringMultiOccursResponse><ns1:return>arg1</ns1:return><ns1:return/><ns1:return>arg3</ns1:return></ns1:echoStringMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt
new file mode 100644
index 000000000..eb6dd7af1
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 014 (php/wsdl): echoComplexTypeMultiOccurs(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct,$struct,$struct)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeMultiOccurs><ns2:inputComplexTypeMultiOccurs><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType></ns2:inputComplexTypeMultiOccurs></ns2:echoComplexTypeMultiOccurs></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeMultiOccursResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoComplexTypeMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt
new file mode 100644
index 000000000..e0c705238
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 015 (php/wsdl): echoComplexTypeMultiOccurs(nil)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexTypeMultiOccurs(array("inputComplexTypeMultiOccurs"=>array($struct,null,$struct)));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns2:echoComplexTypeMultiOccurs><ns2:inputComplexTypeMultiOccurs><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType><ns2:SOAPComplexType xsi:nil="true"/><ns2:SOAPComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:SOAPComplexType></ns2:inputComplexTypeMultiOccurs></ns2:echoComplexTypeMultiOccurs></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeMultiOccursResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return><ns2:return/><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoComplexTypeMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt
new file mode 100644
index 000000000..5cffa8c08
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_016w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 016 (php/wsdl): echoDecimal
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoDecimal(array("inputDecimal"=>"123456789.123456789"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoDecimal><ns1:inputDecimal>123456789.123456789</ns1:inputDecimal></ns1:echoDecimal></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/"><SOAP-ENV:Body><ns1:echoDecimalResponse><ns1:return>123456789.123456789</ns1:return></ns1:echoDecimalResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt
new file mode 100644
index 000000000..843f73dad
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_017w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 017 (php/wsdl): echoBoolean
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoBoolean(array("inputBoolean"=>true));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoBoolean><ns1:inputBoolean>true</ns1:inputBoolean></ns1:echoBoolean></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/"><SOAP-ENV:Body><ns1:echoBooleanResponse><ns1:return>true</ns1:return></ns1:echoBooleanResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt
new file mode 100644
index 000000000..6a02c0483
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_018w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 018 (php/wsdl): echoHexBinary
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoHexBinary(array("inputHexBinary"=>"\x80\xFF\x00\x01\x7F"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoHexBinary><ns1:inputHexBinary>80FF00017F</ns1:inputHexBinary></ns1:echoHexBinary></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/"><SOAP-ENV:Body><ns1:echoHexBinaryResponse><ns1:return>80FF00017F</ns1:return></ns1:echoHexBinaryResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt
new file mode 100644
index 000000000..3673be2a6
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 019 (php/wsdl): echoComplexTypeAsSimpleTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexTypeAsSimpleTypes(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeAsSimpleTypes><ns2:inputComplexType><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:inputComplexType></ns2:echoComplexTypeAsSimpleTypes></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/"><SOAP-ENV:Body><ns1:echoComplexTypeAsSimpleTypesResponse><ns1:outputString>arg</ns1:outputString><ns1:outputInteger>34</ns1:outputInteger><ns1:outputFloat>325.325</ns1:outputFloat></ns1:echoComplexTypeAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt
new file mode 100644
index 000000000..4ba0fda7d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 020 (php/wsdl): echoComplexTypeAsSimpleTypes(minOccurs=0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+unset($struct->varString);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoComplexTypeAsSimpleTypes(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoComplexTypeAsSimpleTypes><ns2:inputComplexType><ns1:varInt>34</ns1:varInt><ns1:varFloat>325.325</ns1:varFloat></ns2:inputComplexType></ns2:echoComplexTypeAsSimpleTypes></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/"><SOAP-ENV:Body><ns1:echoComplexTypeAsSimpleTypesResponse><ns1:outputInteger>34</ns1:outputInteger><ns1:outputFloat>325.325</ns1:outputFloat></ns1:echoComplexTypeAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt
new file mode 100644
index 000000000..23c9598eb
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_021w.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 021 (php/wsdl): echoSimpleTypesAsComplexType
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSimpleTypesAsComplexType(array("inputInteger"=>34,
+ "inputFloat"=>12.345,
+ "inputString"=>"arg"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsComplexType><ns1:inputString>arg</ns1:inputString><ns1:inputInteger>34</ns1:inputInteger><ns1:inputFloat>12.345</ns1:inputFloat></ns1:echoSimpleTypesAsComplexType></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoSimpleTypesAsComplexTypeResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>12.345</ns1:varFloat></ns2:return></ns2:echoSimpleTypesAsComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt
new file mode 100644
index 000000000..bbe48d21c
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_022w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 022 (php/wsdl): echoSimpleTypesAsComplexType(minOccurs=0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoSimpleTypesAsComplexType(array("inputInteger"=>34,
+ "inputFloat"=>12.345));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsComplexType><ns1:inputInteger>34</ns1:inputInteger><ns1:inputFloat>12.345</ns1:inputFloat></ns1:echoSimpleTypesAsComplexType></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoSimpleTypesAsComplexTypeResponse><ns2:return><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:return></ns2:echoSimpleTypesAsComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt
new file mode 100644
index 000000000..97fcb02b3
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 023 (php/wsdl): echoNestedComplexType
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+class SOAPComplexTypeComplexType {
+ function SOAPComplexTypeComplexType($s, $i, $f, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ $this->varComplexType = $c;
+ }
+}
+$struct = new SOAPComplexTypeComplexType("arg",34,12.345,new SOAPComplexType("arg",43,54.321));
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedComplexType(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedComplexType><ns2:inputComplexType><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat><ns1:varComplexType><ns1:varInt>43</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>54.321</ns1:varFloat></ns1:varComplexType></ns2:inputComplexType></ns2:echoNestedComplexType></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedComplexTypeResponse><ns2:return><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat><ns1:varComplexType><ns1:varInt>43</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>54.321</ns1:varFloat></ns1:varComplexType></ns2:return></ns2:echoNestedComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt
new file mode 100644
index 000000000..94f178724
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 024 (php/wsdl): echoNestedComplexType(minOccurs=0)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexTypeComplexType {
+ function SOAPComplexTypeComplexType($s, $i, $f, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ $this->varComplexType = $c;
+ }
+}
+$struct = new SOAPComplexTypeComplexType("arg",34,12.345,NULL);
+unset($struct->varComplexType);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedComplexType(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedComplexType><ns2:inputComplexType><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:inputComplexType></ns2:echoNestedComplexType></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedComplexTypeResponse><ns2:return><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:return></ns2:echoNestedComplexTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt
new file mode 100644
index 000000000..37c67014d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 025 (php/wsdl): echoNestedMultiOccurs
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPMultiOccursComplexType {
+ function SOAPMultiOccursComplexType($s, $i, $f, $c) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ $this->varMultiOccurs = $c;
+ }
+}
+$struct = new SOAPMultiOccursComplexType("arg",34,12.345,array("red","green","blue"));
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoNestedMultiOccurs(array("inputComplexType"=>$struct));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedMultiOccurs><ns2:inputComplexType><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat><ns1:varMultiOccurs><ns1:string>red</ns1:string><ns1:string>green</ns1:string><ns1:string>blue</ns1:string></ns1:varMultiOccurs></ns2:inputComplexType></ns2:echoNestedMultiOccurs></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoNestedMultiOccursResponse><ns2:return><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat><ns1:varMultiOccurs><ns1:string>red</ns1:string><ns1:string>green</ns1:string><ns1:string>blue</ns1:string></ns1:varMultiOccurs></ns2:return></ns2:echoNestedMultiOccursResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt
new file mode 100644
index 000000000..6d1c06238
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_026w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 026 (php/wsdl): echoChoice
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoChoice(array("inputChoice"=>(object)array("name1"=>"Hello World")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoChoice><ns2:inputChoice><ns1:name1>Hello World</ns1:name1></ns2:inputChoice></ns2:echoChoice></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/xsd" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoChoiceResponse><ns2:return><ns1:name1>Hello World</ns1:name1></ns2:return></ns2:echoChoiceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt
new file mode 100644
index 000000000..575e7bed3
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_027w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 027 (php/wsdl): echoEnum
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoEnum(array("inputEnum"=>"bitTwo"));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/"><SOAP-ENV:Body><ns1:echoEnum><ns1:inputEnum>bitTwo</ns1:inputEnum></ns1:echoEnum></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/"><SOAP-ENV:Body><ns1:echoEnumResponse><ns1:return>bitTwo</ns1:return></ns1:echoEnumResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt
new file mode 100644
index 000000000..22366b437
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt
@@ -0,0 +1,27 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 028 (php/wsdl): echoAnyType
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class SOAPComplexType {
+ function SOAPComplexType($s, $i, $f) {
+ $this->varString = $s;
+ $this->varInt = $i;
+ $this->varFloat = $f;
+ }
+}
+$struct = new SOAPComplexType('arg',34,325.325);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoAnyType(array('inputAnyType'=>new SoapVar($struct,SOAP_ENC_OBJECT,"SOAPComplexType","http://soapinterop.org/xsd")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoAnyType><ns2:inputAnyType xsi:type="ns1:SOAPComplexType"><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:inputAnyType></ns2:echoAnyType></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/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Body><ns2:echoAnyTypeResponse><ns2:return xsi:type="ns1:SOAPComplexType"><ns1:varInt>34</ns1:varInt><ns1:varString>arg</ns1:varString><ns1:varFloat>325.325</ns1:varFloat></ns2:return></ns2:echoAnyTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt
new file mode 100644
index 000000000..926edd16f
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_029w.phpt
@@ -0,0 +1,19 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 029 (php/wsdl): echoAnyElement
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->echoAnyElement(array("inputAny"=>array("any"=>"<bold>Hello World</bold>")));
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+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/"><SOAP-ENV:Body><ns1:echoAnyElement><ns1:inputAny><bold>Hello World</bold></ns1:inputAny></ns1:echoAnyElement></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/"><SOAP-ENV:Body><ns1:echoAnyElementResponse><ns1:return><bold>Hello World</bold></ns1:return></ns1:echoAnyElementResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt
new file mode 100644
index 000000000..5081cddbb
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_030w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 030 (php/wsdl): echoVoidSoapHeader(1)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeStringRequest", array("varString"=>"Hello World"), 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeStringRequest SOAP-ENV:mustUnderstand="1"><ns2:varString>Hello World</ns2:varString></ns3:echoMeStringRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></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/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeStringResponse><ns1:varString>Hello World</ns1:varString></ns2:echoMeStringResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt
new file mode 100644
index 000000000..c09f2b28b
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_031w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 031 (php/wsdl): echoVoidSoapHeader(2)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeStringRequest", array(), 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/"><SOAP-ENV:Header><ns2:echoMeStringRequest SOAP-ENV:mustUnderstand="1"/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></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/"><SOAP-ENV:Header><ns1:echoMeStringResponse/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt
new file mode 100644
index 000000000..2a366fdaa
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_032w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 032 (php/wsdl): echoVoidSoapHeader(3)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeComplexTypeRequest", array("varInt"=>34,"varString"=>"arg","varFloat"=>12.345), 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeComplexTypeRequest SOAP-ENV:mustUnderstand="1"><ns2:varString>arg</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>12.345</ns2:varFloat></ns3:echoMeComplexTypeRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></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/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeComplexTypeResponse><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:echoMeComplexTypeResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt
new file mode 100644
index 000000000..846d2a0e2
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_033w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 033 (php/wsdl): echoVoidSoapHeader(4)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeComplexTypeRequest", array("varInt"=>34,"varFloat"=>12.345), 1);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeComplexTypeRequest SOAP-ENV:mustUnderstand="1"><ns2:varInt>34</ns2:varInt><ns2:varFloat>12.345</ns2:varFloat></ns3:echoMeComplexTypeRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></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/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeComplexTypeResponse><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:echoMeComplexTypeResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt
new file mode 100644
index 000000000..e90fe5c9d
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_034w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 034 (php/wsdl): echoVoidSoapHeader(5)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeStringRequest", array("varString"=>"Hello World"), 1, SOAP_ACTOR_NEXT);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeStringRequest SOAP-ENV:mustUnderstand="1" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next"><ns2:varString>Hello World</ns2:varString></ns3:echoMeStringRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></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/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeStringResponse><ns1:varString>Hello World</ns1:varString></ns2:echoMeStringResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt
new file mode 100644
index 000000000..183783d01
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_035w.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SOAP Interop Round4 GroupI XSD 035 (php/wsdl): echoVoidSoapHeader(6)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$hdr = new SoapHeader("http://soapinterop.org/","echoMeComplexTypeRequest", array("varInt"=>34,"varString"=>"arg","varFloat"=>12.345), 1, SOAP_ACTOR_NEXT);
+$client = new SoapClient(dirname(__FILE__)."/round4_groupI_xsd.wsdl",array("trace"=>1,"exceptions"=>0));
+$client->__soapCall("echoVoidSoapHeader",array(),null,$hdr);
+echo $client->__getlastrequest();
+$HTTP_RAW_POST_DATA = $client->__getlastrequest();
+include("round4_groupI_xsd.inc");
+echo "ok\n";
+?>
+--EXPECT--
+<?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/echoheader/" xmlns:ns3="http://soapinterop.org/"><SOAP-ENV:Header><ns3:echoMeComplexTypeRequest SOAP-ENV:mustUnderstand="1" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next"><ns2:varString>arg</ns2:varString><ns2:varInt>34</ns2:varInt><ns2:varFloat>12.345</ns2:varFloat></ns3:echoMeComplexTypeRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVoidSoapHeader/></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/echoheader/" xmlns:ns2="http://soapinterop.org/"><SOAP-ENV:Header><ns2:echoMeComplexTypeResponse><ns1:varString>arg</ns1:varString><ns1:varInt>34</ns1:varInt><ns1:varFloat>12.345</ns1:varFloat></ns2:echoMeComplexTypeResponse></SOAP-ENV:Header><SOAP-ENV:Body><ns2:echoVoidSoapHeaderResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc
new file mode 100644
index 000000000..0c50f199e
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.inc
@@ -0,0 +1,198 @@
+<?php
+class SOAP_Interop_GroupI {
+
+ function echoString($inputString)
+ {
+ if (isset($inputString->inputString)) {
+ return array("return"=>$inputString->inputString);
+ } else {
+ return $inputString;
+ }
+ }
+
+ function echoInteger($inputInteger)
+ {
+ return array("return"=>$inputInteger->inputInteger);
+ }
+
+ function echoFloat($inputFloat)
+ {
+ return array("return"=>$inputFloat->inputFloat);
+ }
+
+ function echoVoid()
+ {
+ }
+
+ function echoBase64($inputBase64)
+ {
+ if (isset($inputBase64->inputBase64)) {
+ return array("return"=>$inputBase64->inputBase64);
+ } else {
+ return $inputBase64;
+ }
+ }
+
+ function echoDate($timeInstant)
+ {
+ return array("return"=>$timeInstant->inputDate);
+ }
+
+ function echoComplexType($inputComplexType)
+ {
+ if (isset($inputComplexType->inputComplexType)) {
+ return array("return"=>$inputComplexType->inputComplexType);
+ } else {
+ return $inputComplexType;
+ }
+ }
+
+ function echoIntegerMultiOccurs($input)
+ {
+ if (isset($input->inputIntegerMultiOccurs->int)) {
+ return array("return"=>$input->inputIntegerMultiOccurs->int);
+ } else {
+ return array();
+ }
+ }
+
+ function echoFloatMultiOccurs($input)
+ {
+ if (isset($input->inputFloatMultiOccurs->float)) {
+ return array("return"=>$input->inputFloatMultiOccurs->float);
+ } else {
+ return array();
+ }
+ }
+
+ function echoStringMultiOccurs($input)
+ {
+ if (isset($input->inputStringMultiOccurs->string)) {
+ return array("return"=>$input->inputStringMultiOccurs->string);
+ } else {
+ return array();
+ }
+ }
+
+ function echoComplexTypeMultiOccurs($input)
+ {
+ if (isset($input->inputComplexTypeMultiOccurs->SOAPComplexType)) {
+ return array("return"=>$input->inputComplexTypeMultiOccurs->SOAPComplexType);
+ } else {
+ return array();
+ }
+ }
+
+ function echoHexBinary($hb)
+ {
+ if (isset($hb->inputHexBinary)) {
+ return array("return"=>$hb->inputHexBinary);
+ } else {
+ return $hb;
+ }
+ }
+
+ function echoDecimal($dec)
+ {
+ return array("return"=>$dec->inputDecimal);
+ }
+
+ function echoBoolean($boolean)
+ {
+ return array("return"=>$boolean->inputBoolean);
+ }
+
+ function echoComplexTypeAsSimpleTypes($input)
+ {
+ if (isset($input->inputComplexType)) {
+ $ret = array("outputInteger" => $input->inputComplexType->varInt,
+ "outputFloat" => $input->inputComplexType->varFloat);
+ if (isset($input->inputComplexType->varString)) {
+ $ret["outputString"] = $input->inputComplexType->varString;
+ }
+ return $ret;
+ } else {
+ return array();
+ }
+ }
+
+ function echoSimpleTypesAsComplexType($input)
+ {
+ $ret = array("varInt" => $input->inputInteger,
+ "varFloat" => $input->inputFloat);
+ if (isset($input->inputString)) {
+ $ret["varString"] = $input->inputString;
+ }
+ return array("return"=>$ret);
+ }
+
+ function echoNestedComplexType($inputComplexType)
+ {
+ if (isset($inputComplexType->inputComplexType)) {
+ return array("return"=>$inputComplexType->inputComplexType);
+ } else {
+ return $inputComplexType;
+ }
+ }
+
+ function echoNestedMultiOccurs($inputComplexType)
+ {
+ if (isset($inputComplexType->inputComplexType)) {
+ return array("return"=>$inputComplexType->inputComplexType);
+ } else {
+ return $inputComplexType;
+ }
+ }
+
+ function echoChoice($input)
+ {
+ if (isset($input->inputChoice)) {
+ return array("return"=>$input->inputChoice);
+ } else {
+ return $input;
+ }
+ }
+
+ function echoEnum($input)
+ {
+ return array("return"=>$input->inputEnum);
+ }
+
+ function echoAnyType($input)
+ {
+ if (isset($input->inputAnyType)) {
+ return array("return"=>$input->inputAnyType);
+ } else {
+ return $input;
+ }
+ }
+
+ function echoAnyElement($input)
+ {
+ if (isset($input->inputAny)) {
+ return array("return"=>$input->inputAny);
+ } else {
+ return $input;
+ }
+ }
+
+ function echoVoidSoapHeader()
+ {
+ }
+
+ function echoMeStringRequest($input)
+ {
+ return new SoapHeader("http://soapinterop.org/","echoMeStringResponse",$input);
+ }
+
+ function echoMeComplexTypeRequest($input)
+ {
+ return new SoapHeader("http://soapinterop.org/","echoMeComplexTypeResponse",$input);
+ }
+
+}
+
+$server = new SoapServer(dirname(__FILE__)."/round4_groupI_xsd.wsdl");
+$server->setClass("SOAP_Interop_GroupI");
+$server->handle();
+?>
diff --git a/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl
new file mode 100644
index 000000000..b62084669
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/round4_groupI_xsd.wsdl
@@ -0,0 +1,1113 @@
+<?xml version="1.0" encoding="utf-8"?>
+<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/">
+ <s:import namespace="http://soapinterop.org/xsd" />
+ <s:import namespace="http://soapinterop.org/echoheader/" />
+ <s:element name="echoVoid">
+ <s:complexType />
+ </s:element>
+ <s:element name="echoVoidResponse">
+ <s:complexType />
+ </s:element>
+ <s:element name="echoInteger">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputInteger" type="s:int" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoIntegerResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:int" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoFloat">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoFloatResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoString">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputString" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoStringResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoBase64">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputBase64" type="s:base64Binary" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoBase64Response">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s:base64Binary" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoDate">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputDate" type="s:dateTime" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoDateResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:dateTime" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexType">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexType" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexTypeResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoIntegerMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputIntegerMultiOccurs" type="s0:ArrayOfInt" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfInt">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="int" type="s:int" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="echoIntegerMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="return" type="s:int" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoFloatMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputFloatMultiOccurs" type="s0:ArrayOfFloat" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfFloat">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="float" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="echoFloatMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="return" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoStringMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputStringMultiOccurs" type="s0:ArrayOfString" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:complexType name="ArrayOfString">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:element name="echoStringMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="return" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexTypeMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexTypeMultiOccurs" type="s1:ArrayOfSOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="SOAPComplexType" nillable="true" type="s1:SOAPComplexType" />
+ <s:element name="echoComplexTypeMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="return" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoDecimal">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputDecimal" type="s:decimal" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoDecimalResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:decimal" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoBoolean">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputBoolean" type="s:boolean" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoBooleanResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s:boolean" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoHexBinary">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputHexBinary" type="s:hexBinary" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoHexBinaryResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s:hexBinary" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexTypeAsSimpleTypes">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexType" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoComplexTypeAsSimpleTypesResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="outputString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="outputInteger" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="outputFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoSimpleTypesAsComplexType">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="inputInteger" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="inputFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoSimpleTypesAsComplexTypeResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoNestedComplexType">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexType" type="s1:SOAPComplexTypeComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoNestedComplexTypeResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:SOAPComplexTypeComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoNestedMultiOccurs">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputComplexType" type="s1:SOAPMultiOccursComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoNestedMultiOccursResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:SOAPMultiOccursComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoChoice">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputChoice" type="s1:ChoiceComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoChoiceResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:ChoiceComplexType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoEnum">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="inputEnum" type="s1:Enum" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoEnumResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="return" type="s1:Enum" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoAnyType">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputAnyType" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoAnyTypeResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoAnyElement">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="inputAny">
+ <s:complexType>
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoAnyElementResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="return">
+ <s:complexType>
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="echoVoidSoapHeaderResponse">
+ <s:complexType />
+ </s:element>
+ <s:element name="echoMeComplexTypeRequest" type="s3:echoMeComplexTypeRequest" />
+ <s:element name="echoMeStringRequest" type="s3:echoMeStringRequest" />
+ <s:element name="echoMeComplexTypeResponse" type="s3:echoMeComplexTypeResponse" />
+ <s:element name="echoMeStringResponse" type="s3:echoMeStringResponse" />
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd">
+ <s:import namespace="http://soapinterop.org/" />
+ <s:complexType name="SOAPComplexType">
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ArrayOfSOAPComplexType">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" ref="s0:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="SOAPComplexTypeComplexType">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ <s:element minOccurs="0" maxOccurs="1" name="varComplexType" type="s1:SOAPComplexType" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="SOAPMultiOccursComplexType">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ <s:element minOccurs="0" maxOccurs="1" name="varMultiOccurs" type="s1:ArrayOfString" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ArrayOfString">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="ChoiceComplexType">
+ <s:sequence>
+ <s:choice minOccurs="1" maxOccurs="1">
+ <s:element minOccurs="0" maxOccurs="1" name="name0" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="name1" type="s:string" />
+ </s:choice>
+ </s:sequence>
+ </s:complexType>
+ <s:simpleType name="Enum">
+ <s:restriction base="s:string">
+ <s:enumeration value="BitOne" />
+ <s:enumeration value="BitTwo" />
+ <s:enumeration value="BitThree" />
+ <s:enumeration value="BitFour" />
+ <s:enumeration value="BitFive" />
+ </s:restriction>
+ </s:simpleType>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org">
+ <s:element name="echoVoidSoapHeader">
+ <s:complexType />
+ </s:element>
+ </s:schema>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/echoheader/">
+ <s:complexType name="echoMeComplexTypeRequest">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="echoMeStringRequest">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="echoMeComplexTypeResponse">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ <s:element minOccurs="1" maxOccurs="1" name="varInt" type="s:int" />
+ <s:element minOccurs="1" maxOccurs="1" name="varFloat" type="s:float" />
+ </s:sequence>
+ </s:complexType>
+ <s:complexType name="echoMeStringResponse">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="varString" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:schema>
+ </types>
+ <message name="echoVoidSoapIn">
+ <part name="parameters" element="s0:echoVoid" />
+ </message>
+ <message name="echoVoidSoapOut">
+ <part name="parameters" element="s0:echoVoidResponse" />
+ </message>
+ <message name="echoIntegerSoapIn">
+ <part name="parameters" element="s0:echoInteger" />
+ </message>
+ <message name="echoIntegerSoapOut">
+ <part name="parameters" element="s0:echoIntegerResponse" />
+ </message>
+ <message name="echoFloatSoapIn">
+ <part name="parameters" element="s0:echoFloat" />
+ </message>
+ <message name="echoFloatSoapOut">
+ <part name="parameters" element="s0:echoFloatResponse" />
+ </message>
+ <message name="echoStringSoapIn">
+ <part name="parameters" element="s0:echoString" />
+ </message>
+ <message name="echoStringSoapOut">
+ <part name="parameters" element="s0:echoStringResponse" />
+ </message>
+ <message name="echoBase64SoapIn">
+ <part name="parameters" element="s0:echoBase64" />
+ </message>
+ <message name="echoBase64SoapOut">
+ <part name="parameters" element="s0:echoBase64Response" />
+ </message>
+ <message name="echoDateSoapIn">
+ <part name="parameters" element="s0:echoDate" />
+ </message>
+ <message name="echoDateSoapOut">
+ <part name="parameters" element="s0:echoDateResponse" />
+ </message>
+ <message name="echoComplexTypeSoapIn">
+ <part name="parameters" element="s0:echoComplexType" />
+ </message>
+ <message name="echoComplexTypeSoapOut">
+ <part name="parameters" element="s0:echoComplexTypeResponse" />
+ </message>
+ <message name="echoIntegerMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoIntegerMultiOccurs" />
+ </message>
+ <message name="echoIntegerMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoIntegerMultiOccursResponse" />
+ </message>
+ <message name="echoFloatMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoFloatMultiOccurs" />
+ </message>
+ <message name="echoFloatMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoFloatMultiOccursResponse" />
+ </message>
+ <message name="echoStringMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoStringMultiOccurs" />
+ </message>
+ <message name="echoStringMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoStringMultiOccursResponse" />
+ </message>
+ <message name="echoComplexTypeMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoComplexTypeMultiOccurs" />
+ </message>
+ <message name="echoComplexTypeMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoComplexTypeMultiOccursResponse" />
+ </message>
+ <message name="echoDecimalSoapIn">
+ <part name="parameters" element="s0:echoDecimal" />
+ </message>
+ <message name="echoDecimalSoapOut">
+ <part name="parameters" element="s0:echoDecimalResponse" />
+ </message>
+ <message name="echoBooleanSoapIn">
+ <part name="parameters" element="s0:echoBoolean" />
+ </message>
+ <message name="echoBooleanSoapOut">
+ <part name="parameters" element="s0:echoBooleanResponse" />
+ </message>
+ <message name="echoHexBinarySoapIn">
+ <part name="parameters" element="s0:echoHexBinary" />
+ </message>
+ <message name="echoHexBinarySoapOut">
+ <part name="parameters" element="s0:echoHexBinaryResponse" />
+ </message>
+ <message name="echoComplexTypeAsSimpleTypesSoapIn">
+ <part name="parameters" element="s0:echoComplexTypeAsSimpleTypes" />
+ </message>
+ <message name="echoComplexTypeAsSimpleTypesSoapOut">
+ <part name="parameters" element="s0:echoComplexTypeAsSimpleTypesResponse" />
+ </message>
+ <message name="echoSimpleTypesAsComplexTypeSoapIn">
+ <part name="parameters" element="s0:echoSimpleTypesAsComplexType" />
+ </message>
+ <message name="echoSimpleTypesAsComplexTypeSoapOut">
+ <part name="parameters" element="s0:echoSimpleTypesAsComplexTypeResponse" />
+ </message>
+ <message name="echoNestedComplexTypeSoapIn">
+ <part name="parameters" element="s0:echoNestedComplexType" />
+ </message>
+ <message name="echoNestedComplexTypeSoapOut">
+ <part name="parameters" element="s0:echoNestedComplexTypeResponse" />
+ </message>
+ <message name="echoNestedMultiOccursSoapIn">
+ <part name="parameters" element="s0:echoNestedMultiOccurs" />
+ </message>
+ <message name="echoNestedMultiOccursSoapOut">
+ <part name="parameters" element="s0:echoNestedMultiOccursResponse" />
+ </message>
+ <message name="echoChoiceSoapIn">
+ <part name="parameters" element="s0:echoChoice" />
+ </message>
+ <message name="echoChoiceSoapOut">
+ <part name="parameters" element="s0:echoChoiceResponse" />
+ </message>
+ <message name="echoEnumSoapIn">
+ <part name="parameters" element="s0:echoEnum" />
+ </message>
+ <message name="echoEnumSoapOut">
+ <part name="parameters" element="s0:echoEnumResponse" />
+ </message>
+ <message name="echoAnyTypeSoapIn">
+ <part name="parameters" element="s0:echoAnyType" />
+ </message>
+ <message name="echoAnyTypeSoapOut">
+ <part name="parameters" element="s0:echoAnyTypeResponse" />
+ </message>
+ <message name="echoAnyElementSoapIn">
+ <part name="parameters" element="s0:echoAnyElement" />
+ </message>
+ <message name="echoAnyElementSoapOut">
+ <part name="parameters" element="s0:echoAnyElementResponse" />
+ </message>
+ <message name="echoVoidSoapHeaderSoapIn">
+ <part name="parameters" element="s2:echoVoidSoapHeader" />
+ </message>
+ <message name="echoVoidSoapHeaderSoapOut">
+ <part name="parameters" element="s0:echoVoidSoapHeaderResponse" />
+ </message>
+ <message name="echoVoidSoapHeaderechoMeComplexTypeRequest">
+ <part name="echoMeComplexTypeRequest" element="s0:echoMeComplexTypeRequest" />
+ </message>
+ <message name="echoVoidSoapHeaderechoMeComplexTypeResponse">
+ <part name="echoMeComplexTypeResponse" element="s0:echoMeComplexTypeResponse" />
+ </message>
+ <message name="echoVoidSoapHeaderechoMeStringRequest">
+ <part name="echoMeStringRequest" element="s0:echoMeStringRequest" />
+ </message>
+ <message name="echoVoidSoapHeaderechoMeStringResponse">
+ <part name="echoMeStringResponse" element="s0:echoMeStringResponse" />
+ </message>
+ <portType name="Round4XSDTestSoap">
+ <operation name="echoVoid">
+ <input message="s0:echoVoidSoapIn" />
+ <output message="s0:echoVoidSoapOut" />
+ </operation>
+ <operation name="echoInteger">
+ <input message="s0:echoIntegerSoapIn" />
+ <output message="s0:echoIntegerSoapOut" />
+ </operation>
+ <operation name="echoFloat">
+ <input message="s0:echoFloatSoapIn" />
+ <output message="s0:echoFloatSoapOut" />
+ </operation>
+ <operation name="echoString">
+ <input message="s0:echoStringSoapIn" />
+ <output message="s0:echoStringSoapOut" />
+ </operation>
+ <operation name="echoBase64">
+ <input message="s0:echoBase64SoapIn" />
+ <output message="s0:echoBase64SoapOut" />
+ </operation>
+ <operation name="echoDate">
+ <input message="s0:echoDateSoapIn" />
+ <output message="s0:echoDateSoapOut" />
+ </operation>
+ <operation name="echoComplexType">
+ <input message="s0:echoComplexTypeSoapIn" />
+ <output message="s0:echoComplexTypeSoapOut" />
+ </operation>
+ <operation name="echoIntegerMultiOccurs">
+ <input message="s0:echoIntegerMultiOccursSoapIn" />
+ <output message="s0:echoIntegerMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoFloatMultiOccurs">
+ <input message="s0:echoFloatMultiOccursSoapIn" />
+ <output message="s0:echoFloatMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoStringMultiOccurs">
+ <input message="s0:echoStringMultiOccursSoapIn" />
+ <output message="s0:echoStringMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoComplexTypeMultiOccurs">
+ <input message="s0:echoComplexTypeMultiOccursSoapIn" />
+ <output message="s0:echoComplexTypeMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoDecimal">
+ <input message="s0:echoDecimalSoapIn" />
+ <output message="s0:echoDecimalSoapOut" />
+ </operation>
+ <operation name="echoBoolean">
+ <input message="s0:echoBooleanSoapIn" />
+ <output message="s0:echoBooleanSoapOut" />
+ </operation>
+ <operation name="echoHexBinary">
+ <input message="s0:echoHexBinarySoapIn" />
+ <output message="s0:echoHexBinarySoapOut" />
+ </operation>
+ <operation name="echoComplexTypeAsSimpleTypes">
+ <input message="s0:echoComplexTypeAsSimpleTypesSoapIn" />
+ <output message="s0:echoComplexTypeAsSimpleTypesSoapOut" />
+ </operation>
+ <operation name="echoSimpleTypesAsComplexType">
+ <input message="s0:echoSimpleTypesAsComplexTypeSoapIn" />
+ <output message="s0:echoSimpleTypesAsComplexTypeSoapOut" />
+ </operation>
+ <operation name="echoNestedComplexType">
+ <input message="s0:echoNestedComplexTypeSoapIn" />
+ <output message="s0:echoNestedComplexTypeSoapOut" />
+ </operation>
+ <operation name="echoNestedMultiOccurs">
+ <input message="s0:echoNestedMultiOccursSoapIn" />
+ <output message="s0:echoNestedMultiOccursSoapOut" />
+ </operation>
+ <operation name="echoChoice">
+ <input message="s0:echoChoiceSoapIn" />
+ <output message="s0:echoChoiceSoapOut" />
+ </operation>
+ <operation name="echoEnum">
+ <input message="s0:echoEnumSoapIn" />
+ <output message="s0:echoEnumSoapOut" />
+ </operation>
+ <operation name="echoAnyType">
+ <input message="s0:echoAnyTypeSoapIn" />
+ <output message="s0:echoAnyTypeSoapOut" />
+ </operation>
+ <operation name="echoAnyElement">
+ <input message="s0:echoAnyElementSoapIn" />
+ <output message="s0:echoAnyElementSoapOut" />
+ </operation>
+ <operation name="echoVoidSoapHeader">
+ <input message="s0:echoVoidSoapHeaderSoapIn" />
+ <output message="s0:echoVoidSoapHeaderSoapOut" />
+ </operation>
+ </portType>
+ <binding name="Round4XSDTestSoap" type="s0:Round4XSDTestSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="echoVoid">
+ <soap:operation soapAction="http://soapinterop.org/echoVoid" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoInteger">
+ <soap:operation soapAction="http://soapinterop.org/echoInteger" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoFloat">
+ <soap:operation soapAction="http://soapinterop.org/echoFloat" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoString">
+ <soap:operation soapAction="http://soapinterop.org/echoString" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoBase64">
+ <soap:operation soapAction="http://soapinterop.org/echoBase64" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoDate">
+ <soap:operation soapAction="http://soapinterop.org/echoDate" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexType">
+ <soap:operation soapAction="http://soapinterop.org/echoComplexType" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoIntegerMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoIntegerMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoFloatMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoFloatMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoStringMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoStringMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexTypeMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoComplexTypeMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoDecimal">
+ <soap:operation soapAction="http://soapinterop.org/echoDecimal" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoBoolean">
+ <soap:operation soapAction="http://soapinterop.org/echoBoolean" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoHexBinary">
+ <soap:operation soapAction="http://soapinterop.org/echoHexBinary" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexTypeAsSimpleTypes">
+ <soap:operation soapAction="http://soapinterop.org/echoComplexTypeAsSimpleTypes" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoSimpleTypesAsComplexType">
+ <soap:operation soapAction="http://soapinterop.org/echoSimpleTypesAsComplexType" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoNestedComplexType">
+ <soap:operation soapAction="http://soapinterop.org/echoNestedComplexType" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoNestedMultiOccurs">
+ <soap:operation soapAction="http://soapinterop.org/echoNestedMultiOccurs" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoChoice">
+ <soap:operation soapAction="http://soapinterop.org/echoChoice" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoEnum">
+ <soap:operation soapAction="http://soapinterop.org/echoEnum" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoAnyType">
+ <soap:operation soapAction="http://soapinterop.org/echoAnyType" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoAnyElement">
+ <soap:operation soapAction="http://soapinterop.org/echoAnyElement" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoVoidSoapHeader">
+ <soap:operation soapAction="http://soapinterop.org" style="document" />
+ <input>
+ <soap:body use="literal" />
+ <soap:header message="s0:echoVoidSoapHeaderechoMeComplexTypeRequest" part="echoMeComplexTypeRequest" use="literal" />
+ <soap:header message="s0:echoVoidSoapHeaderechoMeStringRequest" part="echoMeStringRequest" use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ <soap:header message="s0:echoVoidSoapHeaderechoMeComplexTypeResponse" part="echoMeComplexTypeResponse" use="literal" />
+ <soap:header message="s0:echoVoidSoapHeaderechoMeStringResponse" part="echoMeStringResponse" use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <binding name="Round4XSDTestSoap12" type="s0:Round4XSDTestSoap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <operation name="echoVoid">
+ <soap12:operation soapAction="http://soapinterop.org/echoVoid" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoInteger">
+ <soap12:operation soapAction="http://soapinterop.org/echoInteger" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoFloat">
+ <soap12:operation soapAction="http://soapinterop.org/echoFloat" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoString">
+ <soap12:operation soapAction="http://soapinterop.org/echoString" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoBase64">
+ <soap12:operation soapAction="http://soapinterop.org/echoBase64" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoDate">
+ <soap12:operation soapAction="http://soapinterop.org/echoDate" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexType">
+ <soap12:operation soapAction="http://soapinterop.org/echoComplexType" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoIntegerMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoIntegerMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoFloatMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoFloatMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoStringMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoStringMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexTypeMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoComplexTypeMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoDecimal">
+ <soap12:operation soapAction="http://soapinterop.org/echoDecimal" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoBoolean">
+ <soap12:operation soapAction="http://soapinterop.org/echoBoolean" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoHexBinary">
+ <soap12:operation soapAction="http://soapinterop.org/echoHexBinary" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoComplexTypeAsSimpleTypes">
+ <soap12:operation soapAction="http://soapinterop.org/echoComplexTypeAsSimpleTypes" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoSimpleTypesAsComplexType">
+ <soap12:operation soapAction="http://soapinterop.org/echoSimpleTypesAsComplexType" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoNestedComplexType">
+ <soap12:operation soapAction="http://soapinterop.org/echoNestedComplexType" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoNestedMultiOccurs">
+ <soap12:operation soapAction="http://soapinterop.org/echoNestedMultiOccurs" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoChoice">
+ <soap12:operation soapAction="http://soapinterop.org/echoChoice" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoEnum">
+ <soap12:operation soapAction="http://soapinterop.org/echoEnum" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoAnyType">
+ <soap12:operation soapAction="http://soapinterop.org/echoAnyType" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoAnyElement">
+ <soap12:operation soapAction="http://soapinterop.org/echoAnyElement" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ <operation name="echoVoidSoapHeader">
+ <soap12:operation soapAction="http://soapinterop.org" style="document" />
+ <input>
+ <soap12:body use="literal" />
+ <soap12:header message="s0:echoVoidSoapHeaderechoMeComplexTypeRequest" part="echoMeComplexTypeRequest" use="literal" />
+ <soap12:header message="s0:echoVoidSoapHeaderechoMeStringRequest" part="echoMeStringRequest" use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ <soap12:header message="s0:echoVoidSoapHeaderechoMeComplexTypeResponse" part="echoMeComplexTypeResponse" use="literal" />
+ <soap12:header message="s0:echoVoidSoapHeaderechoMeStringResponse" part="echoMeStringResponse" use="literal" />
+ </output>
+ </operation>
+ </binding>
+ <service name="Round4XSDTest">
+ <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation>
+ <port name="Round4XSDTestSoap" binding="s0:Round4XSDTestSoap">
+ <soap:address location="test://" />
+ </port>
+ <port name="Round4XSDTestSoap12" binding="s0:Round4XSDTestSoap12">
+ <soap12:address location="http://mssoapinterop.org/asmx/xsd/round4xsd.asmx" />
+ </port>
+ </service>
+</definitions> \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round4/GroupI/skipif.inc b/ext/soap/tests/interop/Round4/GroupI/skipif.inc
new file mode 100644
index 000000000..fa8574e6a
--- /dev/null
+++ b/ext/soap/tests/interop/Round4/GroupI/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('soap')) die('skip soap extension not available');
+?>
diff --git a/ext/soap/tests/schema/schema049.phpt b/ext/soap/tests/schema/schema049.phpt
index 78dc5681e..7268a4b67 100644
--- a/ext/soap/tests/schema/schema049.phpt
+++ b/ext/soap/tests/schema/schema049.phpt
@@ -9,6 +9,7 @@ $schema = <<<EOF
<complexType name="testType2">
<sequence>
<element name="int" type="int"/>
+ <element name="int2" type="int"/>
</sequence>
</complexType>
<complexType name="testType">
diff --git a/ext/soap/tests/schema/schema062.phpt b/ext/soap/tests/schema/schema062.phpt
index d4efc9a59..1dc51ef76 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="1" 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: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>
object(stdClass)#%d (2) {
["_"]=>
NULL
diff --git a/ext/soap/tests/server022.phpt b/ext/soap/tests/server022.phpt
new file mode 100755
index 000000000..7b74d8923
--- /dev/null
+++ b/ext/soap/tests/server022.phpt
@@ -0,0 +1,40 @@
+--TEST--
+SOAP Server 22: user fault (through throw of subclass)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class MyFault extends SoapFault {
+ function __construct() {
+ parent::__construct("MyFault","My fault string");
+ }
+}
+
+
+function test() {
+ throw new MyFault;
+}
+
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("test");
+
+$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/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>MyFault</faultcode><faultstring>My fault string</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4
index 3fdca9f0f..a0a5be72a 100644
--- a/ext/sockets/config.m4
+++ b/ext/sockets/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.15 2003/07/08 03:38:00 pollita Exp $
+dnl $Id: config.m4,v 1.15.4.1 2005/09/23 09:54:31 hyanantha Exp $
dnl
PHP_ARG_ENABLE(sockets, whether to enable sockets support,
@@ -31,5 +31,6 @@ if test "$PHP_SOCKETS" != "no"; then
PHP_NEW_EXTENSION([sockets], [sockets.c], [$ext_shared])
fi
+PHP_CHECK_FUNC(socketpair)
PHP_CHECK_FUNC(gethostbyname2)
diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h
index 136ec0ff9..056bc69a7 100644
--- a/ext/sockets/php_sockets.h
+++ b/ext/sockets/php_sockets.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -22,7 +22,7 @@
#ifndef PHP_SOCKETS_H
#define PHP_SOCKETS_H
-/* $Id: php_sockets.h,v 1.34.2.1 2005/02/14 08:25:30 sniper Exp $ */
+/* $Id: php_sockets.h,v 1.36 2005/08/03 14:07:51 sniper Exp $ */
#if HAVE_SOCKETS
diff --git a/ext/sockets/php_sockets_win.c b/ext/sockets/php_sockets_win.c
index 46e221953..6366437d9 100644
--- a/ext/sockets/php_sockets_win.c
+++ b/ext/sockets/php_sockets_win.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_sockets_win.c,v 1.11 2004/01/08 08:17:27 andi Exp $ */
+/* $Id: php_sockets_win.c,v 1.12 2005/08/03 14:07:51 sniper Exp $ */
#ifdef PHP_WIN32
diff --git a/ext/sockets/php_sockets_win.h b/ext/sockets/php_sockets_win.h
index 54d5f81db..6c0e3c192 100644
--- a/ext/sockets/php_sockets_win.h
+++ b/ext/sockets/php_sockets_win.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_sockets_win.h,v 1.10.2.1 2005/02/12 18:15:03 sniper Exp $ */
+/* $Id: php_sockets_win.h,v 1.12 2005/08/03 14:07:52 sniper Exp $ */
#ifdef PHP_WIN32
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index aeed91b02..fa8a12d48 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sockets.c,v 1.165.2.4 2005/05/12 16:27:05 tony2001 Exp $ */
+/* $Id: sockets.c,v 1.171.2.2 2005/11/03 15:00:51 mike Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -116,7 +116,9 @@ function_entry sockets_functions[] = {
PHP_FE(socket_select, first_through_third_args_force_ref)
PHP_FE(socket_create, NULL)
PHP_FE(socket_create_listen, NULL)
+#ifdef HAVE_SOCKETPAIR
PHP_FE(socket_create_pair, fourth_arg_force_ref)
+#endif
PHP_FE(socket_accept, NULL)
PHP_FE(socket_set_nonblock, NULL)
PHP_FE(socket_set_block, NULL)
@@ -339,7 +341,7 @@ static char *php_strerror(int error TSRMLS_DC)
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &tmp, 0, NULL)) {
-
+
if (SOCKETS_G(strerror_buf)) {
efree(SOCKETS_G(strerror_buf));
}
@@ -696,7 +698,7 @@ PHP_FUNCTION(socket_accept)
}
new_sock->error = 0;
-
+
ZEND_REGISTER_RESOURCE(return_value, new_sock, le_socket);
}
/* }}} */
@@ -1504,6 +1506,7 @@ PHP_FUNCTION(socket_get_option)
zval *arg1;
struct linger linger_val;
struct timeval tv;
+ int timeout = 0;
socklen_t optlen;
php_socket *php_sock;
int other_val;
@@ -1531,12 +1534,24 @@ PHP_FUNCTION(socket_get_option)
break;
case SO_RCVTIMEO:
case SO_SNDTIMEO:
+#ifndef PHP_WIN32
optlen = sizeof(tv);
if (getsockopt(php_sock->bsd_socket, level, optname, (char*)&tv, &optlen) != 0) {
PHP_SOCKET_ERROR(php_sock, "unable to retrieve socket option", errno);
RETURN_FALSE;
}
+#else
+ optlen = sizeof(int);
+
+ if (getsockopt(php_sock->bsd_socket, level, optname, (char*)&timeout, &optlen) != 0) {
+ PHP_SOCKET_ERROR(php_sock, "unable to retrieve socket option", errno);
+ RETURN_FALSE;
+ }
+
+ tv.tv_sec = timeout ? timeout / 1000 : 0;
+ tv.tv_usec = timeout ? (timeout * 1000) % 1000000 : 0;
+#endif
array_init(return_value);
@@ -1566,7 +1581,7 @@ PHP_FUNCTION(socket_set_option)
struct linger lv;
struct timeval tv;
php_socket *php_sock;
- int ov, optlen, retval;
+ int ov, optlen, retval, timeout;
long level, optname;
void *opt_ptr;
@@ -1626,11 +1641,16 @@ PHP_FUNCTION(socket_set_option)
convert_to_long_ex(sec);
convert_to_long_ex(usec);
+#ifndef PHP_WIN32
tv.tv_sec = Z_LVAL_PP(sec);
tv.tv_usec = Z_LVAL_PP(usec);
-
optlen = sizeof(tv);
opt_ptr = &tv;
+#else
+ timeout = Z_LVAL_PP(sec) * 1000 + Z_LVAL_PP(usec) / 1000;
+ optlen = sizeof(int);
+ opt_ptr = &timeout;
+#endif
break;
default:
convert_to_long_ex(&arg4);
@@ -1652,6 +1672,7 @@ PHP_FUNCTION(socket_set_option)
}
/* }}} */
+#ifdef HAVE_SOCKETPAIR
/* {{{ proto bool socket_create_pair(int domain, int type, int protocol, array &fd)
Creates a pair of indistinguishable sockets and stores them in fds. */
PHP_FUNCTION(socket_create_pair)
@@ -1711,6 +1732,7 @@ PHP_FUNCTION(socket_create_pair)
RETURN_TRUE;
}
/* }}} */
+#endif
/* {{{ proto bool socket_shutdown(resource socket[, int how])
Shuts down a socket for receiving, sending, or both. */
diff --git a/ext/sockets/unix_socket_constants.h b/ext/sockets/unix_socket_constants.h
index 2aab61143..ffb13e6af 100644
--- a/ext/sockets/unix_socket_constants.h
+++ b/ext/sockets/unix_socket_constants.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: unix_socket_constants.h,v 1.4 2004/01/08 17:32:48 sniper Exp $ */
+/* $Id: unix_socket_constants.h,v 1.5 2005/08/03 14:07:52 sniper Exp $ */
/* This file is to be included by sockets.c */
diff --git a/ext/sockets/win32_socket_constants.h b/ext/sockets/win32_socket_constants.h
index 14542304d..533ac292a 100644
--- a/ext/sockets/win32_socket_constants.h
+++ b/ext/sockets/win32_socket_constants.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: win32_socket_constants.h,v 1.4 2004/01/08 17:32:48 sniper Exp $ */
+/* $Id: win32_socket_constants.h,v 1.5 2005/08/03 14:07:52 sniper Exp $ */
/* This file is to be included by sockets.c */
diff --git a/ext/spl/README b/ext/spl/README
index 7806b0f56..b2aeb596d 100755
--- a/ext/spl/README
+++ b/ext/spl/README
@@ -4,47 +4,4 @@ code in the file spl.php or in the corresponding .inc file in the examples
subdirectory. Based on the internal implementations or the files in the
examples subdirectory there are also some .php files to experiment with.
-The .inc files are not included automatically because they are sooner or
-later integrated into the extension. That means that you either need to
-put the code of examples/autoload into your autoprepend file or that you
-have to point your ini setting auto_prepend_file to this file.
-
-Below is a list of interfaces/classes already availabel natively through
-the SPL extension grouped by category. For more information refer to the
-docuement spl.php.
-
-1) Iterators
-
-SPL offers some advanced iterator algorithms:
-
-interface RecursiveIterator implements Iterator
-class RecursiveIteratorIterator implements Iterator
-abstract class FilterIterator implements Iterator
-class ParentIterator extends FilterIterator implements RecursiveIterator
-interface SeekableIterator implements Iterator
-class LimitIterator implements Iterator
-class CachingIterator implements Iterator
-class CachingRecursiveIterator extends CachingIterator implements RecursiveIterator
-
-2) Directories
-
-SPL offers two advanced directory classes:
-
-class DirectoryIterator implements Iterator
-class RecursiveDirectoryIterator extends DirectoryIterator implements RecursiveIterator
-
-3) XML
-
-SPL offers an advanced XML handling class:
-
-class SimpleXMLIterator extends simplexml_element extends recursiveiterator
-
-4) Array Overloading
-
-SPL offers advanced Array overloading:
-
-class ArrayObject implements IteratorAggregate
-class ArrayIterator implements Iterator
-
-As the above suggest an ArrayObject creates an ArrayIterator when it comes to
-iteration (e.g. ArrayObject instance used inside foreach).
+For more information look at: http://php.net/~helly/php/ext/spl
diff --git a/ext/spl/config.m4 b/ext/spl/config.m4
index 0e6f19fbc..318ff1694 100755
--- a/ext/spl/config.m4
+++ b/ext/spl/config.m4
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.10 2004/02/09 18:18:00 sniper Exp $
+dnl $Id: config.m4,v 1.13.2.1 2005/10/01 15:46:31 helly Exp $
dnl config.m4 for extension SPL
PHP_ARG_ENABLE(spl, enable SPL suppport,
@@ -9,5 +9,5 @@ if test "$PHP_SPL" != "no"; then
AC_MSG_ERROR(Cannot build SPL as a shared module)
fi
AC_DEFINE(HAVE_SPL, 1, [Whether you want SPL (Standard PHP Library) support])
- PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_sxe.c, $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, $ext_shared)
fi
diff --git a/ext/spl/config.w32 b/ext/spl/config.w32
index 7ba8812aa..357bcb36f 100644
--- a/ext/spl/config.w32
+++ b/ext/spl/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.5 2004/01/20 19:49:21 helly Exp $
+// $Id: config.w32,v 1.7 2005/02/08 20:42:47 helly Exp $
// vim:ft=javascript
ARG_ENABLE("spl", "SPL (Standard PHP Library) support", "yes");
@@ -7,6 +7,6 @@ if (PHP_SPL != "no") {
if (PHP_SPL_SHARED) {
ERROR("SPL cannot be compiled as a shared ext");
}
- EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_sxe.c");
+ EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_sxe.c spl_exceptions.c spl_observer.c");
AC_DEFINE('HAVE_SPL', 1);
}
diff --git a/ext/spl/doxygen.cfg b/ext/spl/doxygen.cfg
index 227e9788b..1d79e4046 100755
--- a/ext/spl/doxygen.cfg
+++ b/ext/spl/doxygen.cfg
@@ -1,209 +1,217 @@
-# Doxyfile 1.3.6
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = SPL - Standard PHP Library
-PROJECT_NUMBER =
-OUTPUT_DIRECTORY =
-OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = YES
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ABBREVIATE_BRIEF =
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-SHORT_NAMES = NO
-JAVADOC_AUTOBRIEF = YES
-MULTILINE_CPP_IS_BRIEF = YES
-DETAILS_AT_TOP = NO
-INHERIT_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-ALIASES =
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-SUBGROUPING = YES
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL = YES
-EXTRACT_PRIVATE = YES
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = YES
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-INTERNAL_DOCS = YES
-CASE_SENSE_NAMES = YES
-HIDE_SCOPE_NAMES = NO
-SHOW_INCLUDE_FILES = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-SORT_BRIEF_DOCS = YES
-SORT_BY_SCOPE_NAME = NO
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-SHOW_USED_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = spl.php examples
-FILE_PATTERNS = *.inc *.php
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = YES
-CHM_FILE = ../spl.chm
-HHC_LOCATION = hhc.exe
-GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT = latex
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT = rtf
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT = man
-MAN_EXTENSION = .3
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = YES
-XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
-XML_PROGRAMLISTING = YES
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-UML_LOOK = NO
-TEMPLATE_RELATIONS = NO
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DOT_IMAGE_FORMAT = png
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-MAX_DOT_GRAPH_DEPTH = 0
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
+# Doxyfile 1.3.9.1
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = SPL-StandardPHPLibrary
+PROJECT_NUMBER =
+OUTPUT_DIRECTORY =
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = YES
+BRIEF_MEMBER_DESC = NO
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = YES
+INLINE_INHERITED_MEMB = YES
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = YES
+MULTILINE_CPP_IS_BRIEF = YES
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+DISTRIBUTE_GROUP_DOC = YES
+TAB_SIZE = 4
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+SUBGROUPING = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = YES
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = YES
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = YES
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = spl.php \
+ examples \
+ internal
+FILE_PATTERNS = *.inc \
+ *.php
+RECURSIVE = NO
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = YES
+COLS_IN_ALPHA_INDEX = 4
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = YES
+CHM_FILE = ../spl.chm
+HHC_LOCATION = hhc.exe
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 1
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = YES
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = NO
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = YES
+GRAPHICAL_HIERARCHY = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1200
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 0
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
diff --git a/ext/spl/examples/autoload.inc b/ext/spl/examples/autoload.inc
index 6dda2c581..acb2e11e0 100755
--- a/ext/spl/examples/autoload.inc
+++ b/ext/spl/examples/autoload.inc
@@ -4,7 +4,7 @@
* @ingroup Examples
* @brief function __autoload
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
diff --git a/ext/spl/examples/cachingrecursiveiterator.inc b/ext/spl/examples/cachingrecursiveiterator.inc
new file mode 100644
index 000000000..352e42120
--- /dev/null
+++ b/ext/spl/examples/cachingrecursiveiterator.inc
@@ -0,0 +1,28 @@
+<?php
+
+/** @file cachingrecursiveiterator.inc
+ * @ingroup Examples
+ * @brief class CachingRecursiveIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup Examples
+ * @brief Compatibility to PHP 5.0
+ * @author Marcus Boerger
+ * @version 1.2
+ * @deprecated
+ *
+ * Class RecursiveCachingIterator was named CachingRecursiveIterator until
+ * PHP 5.0.6.
+ *
+ * @see RecursiveCachingIterator
+ */
+
+class CachingRecursiveIterator extends RecursiveCachingIterator
+{
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/examples/class_tree.php b/ext/spl/examples/class_tree.php
new file mode 100755
index 000000000..325b5b4ab
--- /dev/null
+++ b/ext/spl/examples/class_tree.php
@@ -0,0 +1,87 @@
+<?php
+
+/** @file class_tree.php
+ * @brief Class Tree example
+ * @ingroup Examples
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ * @version 1.0
+ *
+ * Usage: php class_tree.php \<class\>
+ *
+ * Simply specify the root class or interface to tree with parameter \<class\>.
+ */
+
+if ($argc < 2) {
+ echo <<<EOF
+Usage: php ${_SERVER['PHP_SELF']} <class>
+
+Displays a graphical tree for the given <class>.
+
+<class> The class or interface for which to generate the tree graph.
+
+
+EOF;
+ exit(1);
+}
+
+if (!class_exists("RecursiveTreeIterator", false)) require_once("recursivetreeiterator.inc");
+
+/** \brief Collects sub classes for given class or interface
+ */
+class SubClasses extends RecursiveArrayIterator
+{
+ /** @param base base class to collect sub classes for
+ * @param check_interfaces whether we deal with interfaces
+ */
+ function __construct($base, $check_interfaces = false)
+ {
+ foreach(get_declared_classes() as $cname)
+ {
+ if (strcasecmp(get_parent_class($cname), $base) == 0)
+ {
+ $this->offsetSet($cname, new SubClasses($cname));
+ }
+ if ($check_interfaces)
+ {
+ foreach(class_implements($cname) as $iname)
+ {
+ if (strcasecmp($iname, $base) == 0)
+ {
+ $this->offsetSet($cname, new SubClasses($cname));
+ }
+ }
+ }
+ }
+ if ($check_interfaces)
+ {
+ foreach(get_declared_interfaces() as $cname)
+ {
+ foreach(class_implements($cname) as $iname)
+ {
+ if (strcasecmp($iname, $base) == 0)
+ {
+ $this->offsetSet($cname, new SubClasses($cname, true));
+ }
+ }
+ }
+ }
+ }
+
+ /** @return key() since that is the name we need
+ */
+ function current()
+ {
+ return parent::key();
+ }
+}
+
+$it = new RecursiveTreeIterator(new SubClasses($argv[1], true));
+
+echo $argv[1]."\n";
+foreach($it as $c=>$v)
+{
+ echo "$v\n";
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/examples/dba_array.php b/ext/spl/examples/dba_array.php
index b2ce604e4..3375bd44f 100755
--- a/ext/spl/examples/dba_array.php
+++ b/ext/spl/examples/dba_array.php
@@ -4,7 +4,7 @@
* @brief Program DBA array utility
* @ingroup Examples
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* Usage php dba_array.php \<file\> \<handler\> \<key\> [\<value\>]
*
diff --git a/ext/spl/examples/dba_dump.php b/ext/spl/examples/dba_dump.php
index 4a5a4c7e0..33720932d 100755
--- a/ext/spl/examples/dba_dump.php
+++ b/ext/spl/examples/dba_dump.php
@@ -4,7 +4,7 @@
* @brief Program DBA dump utility
* @ingroup Examples
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* Usage: php dba_dump.php \<file\> \<handler\> [\<regex\>]
*
@@ -26,8 +26,8 @@ EOF;
exit(1);
}
-if (!class_exists("DbaReader")) require_once("dbareader.inc");
-if (!class_exists("KeyFilter")) require_once("keyfilter.inc");
+if (!class_exists("DbaReader", false)) require_once("dbareader.inc");
+if (!class_exists("KeyFilter", false)) require_once("keyfilter.inc");
$db = new DbaReader($argv[1], $argv[2]);
diff --git a/ext/spl/examples/dbaarray.inc b/ext/spl/examples/dbaarray.inc
index c423b98c1..01d2d38cd 100755
--- a/ext/spl/examples/dbaarray.inc
+++ b/ext/spl/examples/dbaarray.inc
@@ -4,12 +4,12 @@
* @ingroup Examples
* @brief class DbaArray
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
-if (!class_exists("DbaReader")) require_once("dbareader.inc");
+if (!class_exists("DbaReader", false)) require_once("dbareader.inc");
/** @ingroup Examples
* @brief This implements a DBA Array
diff --git a/ext/spl/examples/dbareader.inc b/ext/spl/examples/dbareader.inc
index d0e859710..858000cca 100755
--- a/ext/spl/examples/dbareader.inc
+++ b/ext/spl/examples/dbareader.inc
@@ -4,7 +4,7 @@
* @ingroup Examples
* @brief class DbaReader
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
diff --git a/ext/spl/examples/directoryfilterdots.inc b/ext/spl/examples/directoryfilterdots.inc
index bfc709d02..740c2303c 100755
--- a/ext/spl/examples/directoryfilterdots.inc
+++ b/ext/spl/examples/directoryfilterdots.inc
@@ -4,7 +4,7 @@
* @ingroup Examples
* @brief class DirectoryFilterDots
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
@@ -12,12 +12,12 @@
/** @ingroup Examples
* @brief A filtered DirectoryIterator
* @author Marcus Boerger
- * @version 1.0
+ * @version 1.1
*
* This Iteraotr takes a pathname from which it creates a DirectoryIterator
* and makes it recursive. Further more it filters the entries '.' and '..'.
*/
-class DirectoryFilterDots extends FilterIterator implements RecursiveIterator
+class DirectoryFilterDots extends RecursiveFilterIterator
{
/** Construct from a path.
* @param $path directory to iterate
@@ -31,28 +31,14 @@ class DirectoryFilterDots extends FilterIterator implements RecursiveIterator
*/
function accept()
{
- return !$this->it->isDot();
- }
-
- /** @return whether the current entry is a directory
- */
- function hasChildren()
- {
- return $this->it->hasChildren();
+ return !$this->getInnerIterator()->isDot();
}
- /** @return the current subdirectory as a new DirectoryFilterDots instance.
- */
- function getChildren()
- {
- return new DirectoryFilterDots($this->it->getPathname());
- }
-
/** @return the current entries path name
*/
function key()
{
- return $this->it->getPathname();
+ return $this->getInnerIterator()->getPathname();
}
}
diff --git a/ext/spl/examples/directorygraphiterator.inc b/ext/spl/examples/directorygraphiterator.inc
new file mode 100644
index 000000000..a875352f4
--- /dev/null
+++ b/ext/spl/examples/directorygraphiterator.inc
@@ -0,0 +1,25 @@
+<?php
+
+/** @file directorygraphiterator.inc
+ * @ingroup Examples
+ * @brief class DirectoryGraphIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup Examples
+ * @brief A tree iterator that only shows directories.
+ * @author Marcus Boerger
+ * @version 1.0
+ */
+class DirectoryGraphIterator extends DirectoryTreeIterator
+{
+ function __construct($path)
+ {
+ RecursiveIteratorIterator::__construct(new RecursiveCachingIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), CachingIterator::CALL_TOSTRING|CachingIterator::CATCH_GET_CHILD), 1);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/examples/directorytree.inc b/ext/spl/examples/directorytree.inc
index c35411472..4c999eb94 100755
--- a/ext/spl/examples/directorytree.inc
+++ b/ext/spl/examples/directorytree.inc
@@ -4,7 +4,7 @@
* @ingroup Examples
* @brief class DirectoryTree
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
diff --git a/ext/spl/examples/directorytree.php b/ext/spl/examples/directorytree.php
index d0ecbebbe..687f8437b 100755
--- a/ext/spl/examples/directorytree.php
+++ b/ext/spl/examples/directorytree.php
@@ -4,7 +4,7 @@
* @brief Program Directory tree example
* @ingroup Examples
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* Usage: php directorytree.php \<path\> [\<start\> [\<count\>]]
*
@@ -24,7 +24,7 @@ EOF;
exit(1);
}
-if (!class_exists("DirectoryTreeIterator")) require_once("directorytreeiterator.inc");
+if (!class_exists("DirectoryTreeIterator", false)) require_once("directorytreeiterator.inc");
$length = $argc > 3 ? $argv[3] : -1;
diff --git a/ext/spl/examples/directorytreeiterator.inc b/ext/spl/examples/directorytreeiterator.inc
index dea564eda..654be428f 100644
--- a/ext/spl/examples/directorytreeiterator.inc
+++ b/ext/spl/examples/directorytreeiterator.inc
@@ -4,7 +4,7 @@
* @ingroup Examples
* @brief class DirectoryTreeIterator
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
@@ -21,7 +21,7 @@ class DirectoryTreeIterator extends RecursiveIteratorIterator
*/
function __construct($path)
{
- parent::__construct(new CachingRecursiveIterator(new RecursiveDirectoryIterator($path), CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD), 1);
+ parent::__construct(new RecursiveCachingIterator(new RecursiveDirectoryIterator($path), CachingIterator::CALL_TOSTRING|CachingIterator::CATCH_GET_CHILD), 1);
}
/** @return the current element prefixed with ASCII graphics
diff --git a/ext/spl/examples/findfile.inc b/ext/spl/examples/findfile.inc
index 56dba97b9..05d525a3f 100755
--- a/ext/spl/examples/findfile.inc
+++ b/ext/spl/examples/findfile.inc
@@ -4,13 +4,13 @@
* @ingroup Examples
* @brief class FindFile
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
-if (!class_exists("FindFile")) require_once("findfile.inc");
-if (!class_exists("AppendIterator")) require_once("appenditerator.inc");
+if (!class_exists("FindFile", false)) require_once("findfile.inc");
+if (!class_exists("AppendIterator", false)) require_once("appenditerator.inc");
/** @ingroup Examples
* @brief Base class to find files
diff --git a/ext/spl/examples/findfile.php b/ext/spl/examples/findfile.php
index 03c06eaa4..60146cbff 100755
--- a/ext/spl/examples/findfile.php
+++ b/ext/spl/examples/findfile.php
@@ -4,7 +4,7 @@
* @brief Program Find a specific file by name.
* @ingroup Examples
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* Usage: php findfile.php \<path\> \<name\>
*
@@ -27,7 +27,7 @@ EOF;
exit(1);
}
-if (!class_exists("FindFile")) require_once("findfile.inc");
+if (!class_exists("FindFile", false)) require_once("findfile.inc");
foreach(new FindFile($argv[1], $argv[2]) as $file) echo $file->getPathname()."\n";
?> \ No newline at end of file
diff --git a/ext/spl/examples/findregex.php b/ext/spl/examples/findregex.php
index 8a7dd8158..b43ee0cbb 100755
--- a/ext/spl/examples/findregex.php
+++ b/ext/spl/examples/findregex.php
@@ -26,7 +26,7 @@ EOF;
exit(1);
}
-if (!class_exists("RegexFindFile")) require_once("regexfindfile.inc");
+if (!class_exists("RegexFindFile", false)) require_once("regexfindfile.inc");
foreach(new RegexFindFile($argv[1], $argv[2]) as $file)
{
diff --git a/ext/spl/examples/infiniteiterator.inc b/ext/spl/examples/infiniteiterator.inc
deleted file mode 100755
index 96eeb7558..000000000
--- a/ext/spl/examples/infiniteiterator.inc
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-
-/** @file infiniteiterator.inc
- * @ingroup Examples
- * @brief class InfiniteIterator
- * @author Marcus Boerger
- * @date 2003 - 2004
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief An infinite Iterator
- * @author Marcus Boerger
- * @version 1.0
- *
- * This Iterator takes another Iterator and infinitvely iterates it by
- * rewinding it when its end is reached.
- *
- * \note Even an InfiniteIterator stops if its inner Iterator is empty.
- *
- \verbatim
- $it = new ArrayIterator(array(1,2,3));
- $infinite = new InfiniteIterator($it);
- $limit = new LimitIterator($infinite, 0, 5);
- foreach($limit as $val=>$key)
- {
- echo "$val=>$key\n";
- }
- \endverbatim
- */
-class InfiniteIterator implements Iterator
-{
- /** @internal
- * The inner Iterator. */
- private $it;
-
- /** Construct from another Iterator.
- * @param $it the inner Iterator.
- */
- function __construct(Iterator $it)
- {
- $this->it = $it;
- }
-
- /** @return the inner iterator
- */
- function getInnerIterator()
- {
- return $this->it;
- }
-
- /** Rewind the inner iterator.
- * @return void
- */
- function rewind()
- {
- $this->it->rewind();
- }
-
- /** @return whether the current element is valid
- */
- function valid()
- {
- return $this->it->valid();
- }
-
- /** @return the current value
- */
- function current()
- {
- return $this->it->current();
- }
-
- /** @return the current key
- */
- function key()
- {
- return $this->it->key();
- }
-
- /** Move the inner Iterator forward to its next element or rewind it.
- * @return void
- */
- function next()
- {
- $this->it->next();
- if (!$this->it->valid())
- {
- $this->it->rewind();
- }
- }
-
- /** Aggregates the inner iterator
- */
- function __call($func, $params)
- {
- return call_user_func_array(array($this->it, $func), $params);
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/ini_groups.php b/ext/spl/examples/ini_groups.php
index ed7cdc001..91ddb49f2 100755
--- a/ext/spl/examples/ini_groups.php
+++ b/ext/spl/examples/ini_groups.php
@@ -4,7 +4,7 @@
* @brief Program List groups within an ini file
* @ingroup Examples
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* Usage: php dba_dump.php \<file\> [\<regex\>]
*
@@ -26,8 +26,8 @@ EOF;
exit(1);
}
-if (!class_exists("KeyFilter")) require_once("keyfilter.inc");
-if (!class_exists("IniGroups")) require_once("inigroups.inc");
+if (!class_exists("KeyFilter", false)) require_once("keyfilter.inc");
+if (!class_exists("IniGroups", false)) require_once("inigroups.inc");
$it = new IniGroups($argv[1]);
if ($argc>2) {
diff --git a/ext/spl/examples/inigroups.inc b/ext/spl/examples/inigroups.inc
index 519c31631..62cfa3e02 100755
--- a/ext/spl/examples/inigroups.inc
+++ b/ext/spl/examples/inigroups.inc
@@ -4,13 +4,13 @@
* @ingroup Examples
* @brief class IniGroups
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
-if (!class_exists("KeyFilter")) require_once("keyfilter.inc");
-if (!class_exists("DbaReader")) require_once("dbareader.inc");
+if (!class_exists("KeyFilter", false)) require_once("keyfilter.inc");
+if (!class_exists("DbaReader", false)) require_once("dbareader.inc");
/** @ingroup Examples
* @brief Class to iterate all groups within an ini file.
diff --git a/ext/spl/examples/keyfilter.inc b/ext/spl/examples/keyfilter.inc
index c6130bc2e..a309f098e 100755
--- a/ext/spl/examples/keyfilter.inc
+++ b/ext/spl/examples/keyfilter.inc
@@ -4,7 +4,7 @@
* @ingroup Examples
* @brief class KeyFilter
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
diff --git a/ext/spl/examples/nocvsdir.php b/ext/spl/examples/nocvsdir.php
new file mode 100755
index 000000000..121731416
--- /dev/null
+++ b/ext/spl/examples/nocvsdir.php
@@ -0,0 +1,54 @@
+<?php
+
+/** @file nocvsdir.php
+ * @brief Program Dir without CVS subdirs
+ * @ingroup Examples
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * Usage: php nocvsdir.php \<path\>
+ *
+ * Simply specify the path to tree with parameter \<path\>.
+ */
+
+if ($argc < 2) {
+ echo <<<EOF
+Usage: php ${_SERVER['PHP_SELF']} <path>
+
+Show the directory and all it's contents without any CVS directory in <path>.
+
+<path> The directory for which to generate the directory.
+
+
+EOF;
+ exit(1);
+}
+
+if (!class_exists("RecursiveFilterIterator")) require_once("recursivefilteriterator.inc");
+
+class NoCvsDirectory extends RecursiveFilterIterator
+{
+ function __construct($path)
+ {
+ parent::__construct(new RecursiveDirectoryIterator($path));
+ }
+
+ function accept()
+ {
+ return $this->getInnerIterator()->getFilename() != 'CVS';
+ }
+
+ function getChildren()
+ {
+ return new NoCvsDirectory($this->current()->getPathName());
+ }
+}
+
+$it = new RecursiveIteratorIterator(new NoCvsDirectory($argv[1]));
+
+foreach($it as $pathname => $file)
+{
+ echo $pathname."\n";
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/examples/norewinditerator.inc b/ext/spl/examples/norewinditerator.inc
deleted file mode 100755
index 984c4f686..000000000
--- a/ext/spl/examples/norewinditerator.inc
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-/** @file norewinditerator.inc
- * @ingroup Examples
- * @brief class NoRewindIterator
- * @author Marcus Boerger
- * @date 2003 - 2004
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief An Iterator that doesn't call rewind
- * @author Marcus Boerger
- * @version 1.0
- *
- */
-class NoRewindIterator implements Iterator
-{
- protected $it;
-
- function __construct(Iterator $it)
- {
- $this->it = $it;
- }
-
- function rewind()
- {
- // nothing to do
- }
-
- function valid()
- {
- return $this->it->valid();
- }
-
- function current()
- {
- return $this->it->current();
- }
-
- function key()
- {
- return $this->it->key();
- }
-
- function next()
- {
- $this->it->next();
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/recursivetreeiterator.inc b/ext/spl/examples/recursivetreeiterator.inc
new file mode 100755
index 000000000..42d217fa7
--- /dev/null
+++ b/ext/spl/examples/recursivetreeiterator.inc
@@ -0,0 +1,113 @@
+<?php
+
+/** @file recursivetreeiterator.inc
+ * @ingroup Examples
+ * @brief class RecursiveTreeIterator
+ * @author Marcus Boerger, Johannes Schlueter
+ * @date 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+
+/** @ingroup Examples
+ * @brief RecursiveIteratorIterator to generate ASCII graphic trees for the
+ * entries in a RecursiveIterator
+ * @author Marcus Boerger, Johannes Schlueter
+ * @version 1.0
+ */
+class RecursiveTreeIterator extends RecursiveIteratorIterator
+{
+ const BYPASS_CURRENT = 0x00000004;
+ const BYPASS_KEY = 0x00000008;
+
+ private $rit_flags;
+
+ /**
+ * @param it iterator to use as inner iterator
+ * @param rit_flags flags passed to RecursiveIteratoIterator (parent)
+ * @param cit_flags flags passed to RecursiveCachingIterator (for hasNext)
+ * @param mode mode passed to RecursiveIteratoIterator (parent)
+ */
+ function __construct(RecursiveIterator $it, $rit_flags = self::BYPASS_KEY, $cit_flags = CachingIterator::CATCH_GET_CHILD, $mode = self::SELF_FIRST)
+ {
+ parent::__construct(new RecursiveCachingIterator($it, $cit_flags), $mode, $rit_flags);
+ $this->rit_flags = $rit_flags;
+ }
+
+ /** Prefix strings used in getPrefix()
+ *
+ * 0: prefix used to start elements
+ * 1: prefix used if $level < depth and hasNext($level) == true
+ * 2: prefix used if $level < depth and hasNext($level) == false
+ * 3: prefix used if $level == depth and hasNext($level) == true
+ * 4: prefix used if $level == depth and hasNext($level) == false
+ * 5: prefix used right in front of the current element
+ */
+ public $prefix = array(0=>'', 1=>'| ', 2=>' ', 3=>'|-', 4=>'\-', 5=>'');
+
+ /** @return string to place in front of current element
+ */
+ function getPrefix()
+ {
+ $tree = '';
+ for ($level = 0; $level < $this->getDepth(); $level++)
+ {
+ $tree .= $this->getSubIterator($level)->hasNext() ? $this->prefix[1] : $this->prefix[2];
+ }
+ $tree .= $this->getSubIterator($level)->hasNext() ? $this->prefix[3] : $this->prefix[4];
+
+ return $this->prefix[0] . $tree . $this->prefix[5];
+ }
+
+ /** @return string presentation build for current element
+ */
+ function getEntry()
+ {
+ return @(string)parent::current();
+ }
+
+ /** @return string to place after the current element
+ */
+ function getPostfix()
+ {
+ return '';
+ }
+
+ /** @return the current element prefixed and postfixed
+ */
+ function current()
+ {
+ if ($this->rit_flags & self::BYPASS_CURRENT)
+ {
+ return parent::current();
+ }
+ else
+ {
+ return $this->getPrefix() . $this->getEntry() . $this->getPostfix();
+ }
+ }
+
+ /** @return the current key prefixed and postfixed
+ */
+ function key()
+ {
+ if ($this->rit_flags & self::BYPASS_KEY)
+ {
+ return parent::key();
+ }
+ else
+ {
+ return $this->getPrefix() . parent::key() . $this->getPostfix();
+ }
+ }
+
+ /** Aggregates the inner iterator
+ */
+ function __call($func, $params)
+ {
+ return call_user_func_array(array($this->getSubIterator(), $func), $params);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/examples/regexfindfile.inc b/ext/spl/examples/regexfindfile.inc
index af3b293a1..d5dd72253 100755
--- a/ext/spl/examples/regexfindfile.inc
+++ b/ext/spl/examples/regexfindfile.inc
@@ -4,7 +4,7 @@
* @ingroup Examples
* @brief class RegexFindFile
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
diff --git a/ext/spl/examples/searchiterator.inc b/ext/spl/examples/searchiterator.inc
index 2e9befedf..0e6a7bcc4 100755
--- a/ext/spl/examples/searchiterator.inc
+++ b/ext/spl/examples/searchiterator.inc
@@ -4,7 +4,7 @@
* @ingroup Examples
* @brief abstract class SearchIterator
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
diff --git a/ext/spl/examples/tests/examples.inc b/ext/spl/examples/tests/examples.inc
index 74b652adb..feeba7db2 100755
--- a/ext/spl/examples/tests/examples.inc
+++ b/ext/spl/examples/tests/examples.inc
@@ -13,10 +13,6 @@ class IncludeFiles extends ArrayIterator
}
$classes = array(
- 'EmptyIterator',
- 'InfiniteIterator',
- 'AppendIterator',
- 'NoRewindIterator',
);
foreach (new IncludeFiles(dirname(__FILE__). '/..', $classes) as $file)
diff --git a/ext/spl/examples/tree.php b/ext/spl/examples/tree.php
index 5bffaf9cd..6005263cc 100755
--- a/ext/spl/examples/tree.php
+++ b/ext/spl/examples/tree.php
@@ -4,7 +4,7 @@
* @brief Program Tree view example
* @ingroup Examples
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* Usage: php tree.php \<path\>
*
@@ -28,10 +28,11 @@ EOF;
exit(1);
}
-if (!class_exists("DirectoryTreeIterator")) require_once("directorytreeiterator.inc");
+if (!class_exists("DirectoryTreeIterator", false)) require_once("directorytreeiterator.inc");
+if (!class_exists("DirectoryGraphIterator", false)) require_once("directorygraphiterator.inc");
echo $argv[1]."\n";
-foreach(new DirectoryTreeIterator($argv[1]) as $file)
+foreach(new DirectoryGraphIterator($argv[1]) as $file)
{
echo $file . "\n";
}
diff --git a/ext/spl/examples/appenditerator.inc b/ext/spl/internal/appenditerator.inc
index d2d5c8dd0..74f254d11 100755
--- a/ext/spl/examples/appenditerator.inc
+++ b/ext/spl/internal/appenditerator.inc
@@ -1,20 +1,21 @@
<?php
/** @file appenditerator.inc
- * @ingroup Examples
+ * @ingroup SPL
* @brief class AppendIterator
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
-/** @ingroup Examples
+/** @ingroup SPL
* @brief Iterator that iterates over several iterators one after the other
* @author Marcus Boerger
* @version 1.0
+ * @since PHP 5.1
*/
-class AppendIterator implements Iterator
+class AppendIterator implements OuterIterator
{
/** @internal array of inner iterators */
private $iterators;
@@ -28,6 +29,11 @@ class AppendIterator implements Iterator
/** Append an Iterator
* @param $it Iterator to append
+ *
+ * If the current state is invalid but the appended iterator is valid
+ * the the AppendIterator itself becomes valid. However there will be no
+ * call to $it->rewind(). Also if the current state is invalid the inner
+ * ArrayIterator will be rewound und forwarded to the appended element.
*/
function append(Iterator $it)
{
diff --git a/ext/spl/internal/cachingiterator.inc b/ext/spl/internal/cachingiterator.inc
index 48b732104..6714821f6 100755
--- a/ext/spl/internal/cachingiterator.inc
+++ b/ext/spl/internal/cachingiterator.inc
@@ -1,35 +1,77 @@
<?php
-define('CIT_CALL_TOSTRING', 1);
-define('CIT_CATCH_GET_CHILD', 2);
+/** @file cachingiterator.inc
+ * @ingroup SPL
+ * @brief class CachingIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
-class CachingIterator
+/**
+ * @brief Cached iteration over another Iterator
+ * @author Marcus Boerger
+ * @version 1.2
+ * @since PHP 5.0
+ *
+ * This iterator wrapper does a one ahead iteration. This way it knows whether
+ * the inner iterator has one more element.
+ *
+ * @note If you want to convert the elements into strings and the inner
+ * Iterator is an internal Iterator then you need to provide the
+ * flag CALL_TOSTRING to do the conversion when the actual element
+ * is being fetched. Otherwise the conversion would happen with the
+ * already changed iterator. If you do not need this then it you should
+ * omit this flag because it costs unneccessary work and time.
+ */
+class CachingIterator implements OuterIterator
{
- protected $it;
- protected $current;
- protected $key;
- protected $valid;
- protected $strValue;
+ const CALL_TOSTRING = 0x00000001;
+ const CATCH_GET_CHILD = 0x00000002;
+ const TOSTRING_USE_KEY = 0x00000010;
+ const TOSTRING_USE_CURRENT = 0x00000020;
- function __construct(Iterator $it, $flags = CIT_CALL_TOSTRING)
+ private $it;
+ private $current;
+ private $key;
+ private $valid;
+ private $strValue;
+
+ /** Construct from another iterator
+ *
+ * @param it Iterator to cache
+ * @param flags Bitmask:
+ * - CALL_TOSTRING (whether to call __toString() for every element)
+ */
+ function __construct(Iterator $it, $flags = self::CALL_TOSTRING)
{
+ if ((($flags & self::CALL_TOSTRING) && ($flags & (self::TOSTRING_USE_KEY|self::TOSTRING_USE_CURRENT)))
+ || ((flags & (self::CIT_TOSTRING_USE_KEY|self::CIT_TOSTRING_USE_CURRENT)) == (self::CIT_TOSTRING_USE_KEY|self::CIT_TOSTRING_USE_CURRENT)))
+ {
+ throw new InvalidArgumentException('Flags must contain only one of CIT_CALL_TOSTRING, CIT_TOSTRING_USE_KEY, CIT_TOSTRING_USE_CURRENT');
+ }
$this->it = $it;
- $this->flags = $flags & (CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD);
+ $this->flags = $flags & (0x0000FFFF);
$this->next();
}
+ /** Rewind the Iterator
+ */
function rewind()
{
$this->it->rewind();
$this->next();
}
+ /** Forward to the next element
+ */
function next()
{
if ($this->valid = $this->it->valid()) {
$this->current = $this->it->current();
$this->key = $this->it->key();
- if ($this->flags & CIT_CALL_TOSTRING) {
+ if ($this->flags & self::CALL_TOSTRING) {
if (is_object($this->current)) {
$this->strValue = $this->current->__toString();
} else {
@@ -44,38 +86,72 @@ class CachingIterator
$this->it->next();
}
+ /** @return whether teh iterator is valid
+ */
function valid()
{
return $this->valid;
}
+ /** @return whether there is one more element
+ */
function hasNext()
{
return $this->it->valid();
}
+ /** @return the current element
+ */
function current()
{
return $this->current;
}
+ /** @return the current key
+ */
function key()
{
return $this->key;
}
+ /** Aggregate the inner iterator
+ *
+ * @param func Name of method to invoke
+ * @param params Array of parameters to pass to method
+ */
function __call($func, $params)
{
return call_user_func_array(array($this->it, $func), $params);
}
+ /** @return the string represenatation that was generated for the current
+ * element
+ * @throw exception when CALL_TOSTRING was not specified in constructor
+ */
function __toString()
{
- if (!$this->flags & CIT_CALL_TOSTRING) {
+ if ($this->flags & self::TOSTRING_USE_KEY)
+ {
+ return $this->key;
+ }
+ else if ($this->flags & self::TOSTRING_USE_CURRENT)
+ {
+ return $this->current;
+ }
+ if (!$this->flags & self::CALL_TOSTRING)
+ {
throw new exception('CachingIterator does not fetch string value (see CachingIterator::__construct)');
}
return $this->strValue;
}
+
+ /**
+ * @return The inner iterator
+ */
+ function getInnerIterator()
+ {
+ return $this->it;
+ }
}
?> \ No newline at end of file
diff --git a/ext/spl/internal/cachingrecursiveiterator.inc b/ext/spl/internal/cachingrecursiveiterator.inc
deleted file mode 100755
index c706e195d..000000000
--- a/ext/spl/internal/cachingrecursiveiterator.inc
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-class CachingRecursiveIterator extends CachingIterator implements RecursiveIterator
-{
- protected $hasChildren;
- protected $getChildren;
-
- function __construct(RecursiveIterator $it, $flags = CIT_CALL_TOSTRING)
- {
- parent::__construct($it, $flags);
- }
-
- function rewind();
- {
- $this->hasChildren = false;
- $this->getChildren = NULL;
- parent::rewind();
- }
-
- function next()
- {
- if ($this->hasChildren = $this->it->hasChildren()) {
- try {
- //$this->getChildren = new CachingRecursiveIterator($this->it->getChildren(), $this->flags);
- // workaround memleaks...
- $child = $this->it->getChildren();
- $this->getChildren = new CachingRecursiveIterator($child, $this->flags);
- }
- catch(Exception $e) {
- if (!$this->flags & CIT_CATCH_GET_CHILD) {
- throw $e;
- }
- $this->hasChildren = false;
- $this->getChildren = NULL;
- }
- } else {
- $this->getChildren = NULL;
- }
- parent::next();
- }
-
- function hasChildren()
- {
- return $this->hasChildren;
- }
-
- function getChildren()
- {
- return $this->getChildren;
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/emptyiterator.inc b/ext/spl/internal/emptyiterator.inc
index a3896ccf5..a72a8b1a4 100755
--- a/ext/spl/examples/emptyiterator.inc
+++ b/ext/spl/internal/emptyiterator.inc
@@ -1,19 +1,19 @@
<?php
/** @file emptyiterator.inc
- * @ingroup Examples
+ * @ingroup SPL
* @brief class EmptyIterator
* @author Marcus Boerger
- * @date 2003 - 2004
+ * @date 2003 - 2005
*
* SPL - Standard PHP Library
*/
-/** @ingroup Examples
+/** @ingroup SPL
* @brief An empty Iterator
* @author Marcus Boerger
* @version 1.0
- *
+ * @since PHP 5.1
*/
class EmptyIterator implements Iterator
{
diff --git a/ext/spl/internal/filteriterator.inc b/ext/spl/internal/filteriterator.inc
index 051c99e75..ddf161355 100755
--- a/ext/spl/internal/filteriterator.inc
+++ b/ext/spl/internal/filteriterator.inc
@@ -1,17 +1,31 @@
<?php
+/** @file filteriterator.inc
+ * @ingroup SPL
+ * @brief class FilterIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
/**
* @brief Regular expression filter for string iterators
* @author Marcus Boerger
- * @version 1.0
+ * @version 1.1
+ * @since PHP 5.0
*
* Instances of this class act as a filter around iterators. In other words
* you can put an iterator into the constructor and the instance will only
* return selected (accepted) elements.
+ *
+ * The only thing that needs to be done to make this work is implementing
+ * method accept(). Typically this invloves reading the current element or
+ * key of the inner Iterator and checking whether it is acceptable.
*/
-abstract class FilterIterator implements Iterator
+abstract class FilterIterator implements OuterIterator
{
- protected $it;
+ private $it;
/**
* Constructs a filter around an iterator whose elemnts are strings.
@@ -92,6 +106,24 @@ abstract class FilterIterator implements Iterator
protected function __clone() {
// disallow clone
}
+
+ /**
+ * @return The inner iterator
+ */
+ function getInnerIterator()
+ {
+ return $this->it;
+ }
+
+ /** Aggregate the inner iterator
+ *
+ * @param func Name of method to invoke
+ * @param params Array of parameters to pass to method
+ */
+ function __call($func, $params)
+ {
+ return call_user_func_array(array($this->it, $func), $params);
+ }
}
?> \ No newline at end of file
diff --git a/ext/spl/internal/infiniteiterator.inc b/ext/spl/internal/infiniteiterator.inc
new file mode 100755
index 000000000..2dbe8d865
--- /dev/null
+++ b/ext/spl/internal/infiniteiterator.inc
@@ -0,0 +1,48 @@
+<?php
+
+/** @file infiniteiterator.inc
+ * @ingroup SPL
+ * @brief class InfiniteIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup SPL
+ * @brief An infinite Iterator
+ * @author Marcus Boerger
+ * @version 1.1
+ * @since PHP 5.1
+ *
+ * This Iterator takes another Iterator and infinitvely iterates it by
+ * rewinding it when its end is reached.
+ *
+ * \note Even an InfiniteIterator stops if its inner Iterator is empty.
+ *
+ \verbatim
+ $it = new ArrayIterator(array(1,2,3));
+ $infinite = new InfiniteIterator($it);
+ $limit = new LimitIterator($infinite, 0, 5);
+ foreach($limit as $val=>$key)
+ {
+ echo "$val=>$key\n";
+ }
+ \endverbatim
+ */
+class InfiniteIterator extends IteratorIterator
+{
+ /** Move the inner Iterator forward to its next element or rewind it.
+ * @return void
+ */
+ function next()
+ {
+ $this->getInnerIterator()->next();
+ if (!$this->getInnerIterator()->valid())
+ {
+ $this->getInnerIterator()->rewind();
+ }
+ }
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/internal/iteratoriterator.inc b/ext/spl/internal/iteratoriterator.inc
new file mode 100755
index 000000000..c76412ed0
--- /dev/null
+++ b/ext/spl/internal/iteratoriterator.inc
@@ -0,0 +1,121 @@
+<?php
+
+/** @file iteratoriterator.inc
+ * @ingroup SPL
+ * @brief class IteratorIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup SPL
+ * @brief Basic Iterator wrapper
+ * @since PHP 5.1
+ *
+ * This iterator wrapper allows to convert anything that is traversable into
+ * an Iterator. It is very important to understand that most classes that do
+ * not implement Iterator have their reasone to. Most likely they do not allow
+ * the full Iterator feature set. If so you need to provide techniques to
+ * prevent missuse. If you do not you must expect exceptions or fatal erros.
+ *
+ * It is also possible to derive the class and implement IteratorAggregate by
+ * downcasting the instances returned in getIterator. See the following
+ * example (assuming BaseClass implements Traversable):
+ \code
+ class SomeClass extends BaseClass implements IteratorAggregate
+ {
+ function getIterator()
+ {
+ return new IteratorIterator($this, 'BaseClass');
+ }
+ }
+ \endcode
+ *
+ * As you can see in the example this approach requires that the class to
+ * downcast to is actually a base class of the specified iterator to wrap.
+ * Omitting the downcast in the above example would result in an endless loop
+ * since IteratorIterator::__construct() would call SomeClass::getIterator().
+ */
+class IteratorIterator implements OuterIterator
+{
+ /** Construct an IteratorIterator from an Iterator or an IteratorAggregate.
+ *
+ * @param iterator inner iterator
+ * @param classname optional class the iterator has to be downcasted to
+ */
+ function __construct(Traversable $iterator, $classname = null)
+ {
+ if ($iterator instanceof IteratorAggregate)
+ {
+ $iterator = $iterator->getIterator();
+ }
+ if ($iterator instanceof Iterator)
+ {
+ $this->iterator = $iterator;
+ }
+ else
+ {
+ throw new Exception("Classes that only implement Traversable can be wrapped only after converting class IteratorItaerator into c code");
+ }
+ }
+
+ /** \return the inner iterator as passed to the constructor
+ */
+ function getInnerIterator()
+ {
+ return $this->iterator;
+ }
+
+ /** \return whether the iterator is valid
+ */
+ function valid()
+ {
+ return $this->iterator->valid();
+ }
+
+ /** \return current key
+ */
+ function key()
+ {
+ return $this->iterator->key();
+ }
+
+ /** \return current value
+ */
+ function current()
+ {
+ return $this->iterator->current();
+ }
+
+ /** forward to next element
+ */
+ function next()
+ {
+ return $this->iterator->next();
+ }
+
+ /** rewind to the first element
+ */
+ function rewind()
+ {
+ return $this->iterator->rewind();
+ }
+
+ /** Aggregate the inner iterator
+ *
+ * @param func Name of method to invoke
+ * @param params Array of parameters to pass to method
+ */
+ function __call($func, $params)
+ {
+ return call_user_func_array(array($this->it, $func), $params);
+ }
+
+ /** The inner iterator must be private because when this class will be
+ * converted to c code it won't no longer be available.
+ */
+ private $iterator;
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/internal/limititerator.inc b/ext/spl/internal/limititerator.inc
index 3283f39db..b87f3c586 100755
--- a/ext/spl/internal/limititerator.inc
+++ b/ext/spl/internal/limititerator.inc
@@ -1,13 +1,39 @@
<?php
-class LimitIterator implements Iterator
+/** @file limititerator.inc
+ * @ingroup SPL
+ * @brief class LimitIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/**
+ * @brief Limited Iteration over another Iterator
+ * @author Marcus Boerger
+ * @version 1.1
+ * @since PHP 5.0
+ *
+ * A class that starts iteration at a certain offset and only iterates over
+ * a specified amount of elements.
+ *
+ * This class uses SeekableIterator::seek() if available and rewind() plus
+ * a skip loop otehrwise.
+ */
+class LimitIterator implements OuterIterator
{
- protected $it;
- protected $offset;
- protected $count;
+ private $it;
+ private $offset;
+ private $count;
private $pos;
- // count === NULL means all
+ /** Construct
+ *
+ * @param it Iterator to limit
+ * @param offset Offset to first element
+ * @param count Maximum number of elements to show or NULL for all
+ */
function __construct(Iterator $it, $offset = 0, $count = -1)
{
if ($offset < 0) {
@@ -22,6 +48,11 @@ class LimitIterator implements Iterator
$this->pos = 0;
}
+ /** Seek to specified position
+ * @param position offset to seek to (relative to beginning not offset
+ * specified in constructor).
+ * @throw exception when position is invalid
+ */
function seek($position) {
if ($position < $this->offset) {
throw new exception('Cannot seek to '.$position.' which is below offset '.$this->offset);
@@ -39,6 +70,8 @@ class LimitIterator implements Iterator
}
}
+ /** Rewind to offset specified in constructor
+ */
function rewind()
{
$this->it->rewind();
@@ -46,27 +79,56 @@ class LimitIterator implements Iterator
$this->seek($this->offset);
}
+ /** @return whether iterator is valid
+ */
function valid() {
return ($this->count == -1 || $this->pos < $this->offset + $this->count)
&& $this->it->valid();
}
+ /** @return current key
+ */
function key() {
return $this->it->key();
}
+ /** @return current element
+ */
function current() {
return $this->it->current();
}
+ /** Forward to nect element
+ */
function next() {
$this->it->next();
$this->pos++;
}
+ /** @return current position relative to zero (not to offset specified in
+ * constructor).
+ */
function getPosition() {
return $this->pos;
}
+
+ /**
+ * @return The inner iterator
+ */
+ function getInnerIterator()
+ {
+ return $this->it;
+ }
+
+ /** Aggregate the inner iterator
+ *
+ * @param func Name of method to invoke
+ * @param params Array of parameters to pass to method
+ */
+ function __call($func, $params)
+ {
+ return call_user_func_array(array($this->it, $func), $params);
+ }
}
?> \ No newline at end of file
diff --git a/ext/spl/internal/norewinditerator.inc b/ext/spl/internal/norewinditerator.inc
new file mode 100755
index 000000000..296fe2b92
--- /dev/null
+++ b/ext/spl/internal/norewinditerator.inc
@@ -0,0 +1,28 @@
+<?php
+
+/** @file norewinditerator.inc
+ * @ingroup SPL
+ * @brief class NoRewindIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup SPL
+ * @brief An Iterator wrapper that doesn't call rewind
+ * @author Marcus Boerger
+ * @version 1.1
+ * @since PHP 5.1
+ */
+class NoRewindIterator extends IteratorIterator
+{
+ /** Simply prevent execution of inner iterators rewind().
+ */
+ function rewind()
+ {
+ // nothing to do
+ }
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/internal/outeriterator.inc b/ext/spl/internal/outeriterator.inc
new file mode 100755
index 000000000..d3068f029
--- /dev/null
+++ b/ext/spl/internal/outeriterator.inc
@@ -0,0 +1,25 @@
+<?php
+
+/** @file outeriterator.inc
+ * @ingroup SPL
+ * @brief class OuterIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/**
+ * @brief Interface to access the current inner iteraor of iterator wrappers
+ * @author Marcus Boerger
+ * @version 1.0
+ * @since PHP 5.1
+ */
+interface OuterIterator extends Iterator
+{
+ /** @return inner iterator
+ */
+ function getInnerIterator();
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/internal/parentiterator.inc b/ext/spl/internal/parentiterator.inc
index 782d10343..9e0ebfa25 100755
--- a/ext/spl/internal/parentiterator.inc
+++ b/ext/spl/internal/parentiterator.inc
@@ -1,21 +1,42 @@
<?php
-class ParentIterator extends FilterIterator implements RecursiveIterator
+/** @file parentiterator.inc
+ * @ingroup SPL
+ * @brief class FilterIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/**
+ * @brief Iterator to filter parents
+ * @author Marcus Boerger
+ * @version 1.2
+ * @since PHP 5.1
+ *
+ * This extended FilterIterator allows a recursive iteration using
+ * RecursiveIteratorIterator that only shows those elements which have
+ * children.
+ */
+class ParentIterator extends RecursiveFilterIterator
{
+ /** @param $it the RecursiveIterator to filter
+ */
function __construct(RecursiveIterator $it)
{
parent::__construct($it);
}
+
+ /** @return whetehr the current element has children
+ */
function accept()
{
return $this->it->hasChildren();
}
- function hasChildren()
- {
- return $this->it->hasChildren();
- }
-
+ /** @return the ParentIterator for the current elements children
+ */
function getChildren()
{
return new ParentIterator($this->it->getChildren());
diff --git a/ext/spl/internal/recursivearrayiterator.inc b/ext/spl/internal/recursivearrayiterator.inc
new file mode 100755
index 000000000..833a65686
--- /dev/null
+++ b/ext/spl/internal/recursivearrayiterator.inc
@@ -0,0 +1,59 @@
+<?php
+
+/** @file recursivearrayiterator.inc
+ * @ingroup Examples
+ * @brief class RecursiveArrayIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup SPL
+ * @brief A recursive array iterator
+ * @author Marcus Boerger
+ * @version 1.0
+ * @since PHP 5.1
+ *
+ * Passes the RecursiveIterator interface to the inner Iterator and provides
+ * the same functionality as FilterIterator. This allows you to skip parents
+ * and all their childs before loading them all. You need to care about
+ * function getChildren() because it may not always suit your needs. The
+ * builtin behavior uses reflection to return a new instance of the exact same
+ * class it is called from. That is you extend RecursiveFilterIterator and
+ * getChildren() will create instance of that class. The problem is that doing
+ * this does not transport any state or control information of your accept()
+ * implementation to the new instance. To overcome this problem you might
+ * need to overwrite getChildren(), call this implementation and pass the
+ * control vaules manually.
+ */
+class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator
+{
+ /** @return whether the current element has children
+ */
+ function hasChildren()
+ {
+ return is_array($this->current());
+ }
+
+ /** @return an iterator for the current elements children
+ *
+ * @note the returned iterator will be of the same class as $this
+ */
+ function getChildren()
+ {
+ if ($this->current() instanceof self)
+ {
+ return $this->current();
+ }
+ if (empty($this->ref))
+ {
+ $this->ref = new ReflectionClass($this);
+ }
+ return $this->ref->newInstance($this->current());
+ }
+
+ private $ref;
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/internal/recursivecachingiterator.inc b/ext/spl/internal/recursivecachingiterator.inc
new file mode 100755
index 000000000..327514687
--- /dev/null
+++ b/ext/spl/internal/recursivecachingiterator.inc
@@ -0,0 +1,99 @@
+<?php
+
+/** @file recursivecachingiterator.inc
+ * @ingroup SPL
+ * @brief class RecursiveCachingIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/**
+ * @brief Cached recursive iteration over another Iterator
+ * @author Marcus Boerger
+ * @version 1.2
+ * @since PHP 5.1
+ *
+ * @see CachingIterator
+ */
+class RecursiveCachingIterator extends CachingIterator implements RecursiveIterator
+{
+ private $hasChildren;
+ private $getChildren;
+
+ /** Construct from another iterator
+ *
+ * @param it Iterator to cache
+ * @param flags Bitmask:
+ * - CALL_TOSTRING (whether to call __toString() for every element)
+ * - CATCH_GET_CHILD (whether to catch exceptions when trying to get childs)
+ */
+ function __construct(RecursiveIterator $it, $flags = self::CALL_TOSTRING)
+ {
+ parent::__construct($it, $flags);
+ }
+
+ /** Rewind Iterator
+ */
+ function rewind();
+ {
+ $this->hasChildren = false;
+ $this->getChildren = NULL;
+ parent::rewind();
+ }
+
+ /** Forward to next element if necessary then an Iterator for the Children
+ * will be created.
+ */
+ function next()
+ {
+ if ($this->hasChildren = $this->it->hasChildren())
+ {
+ try
+ {
+ $child = $this->it->getChildren();
+ if (!$this->ref)
+ {
+ $this->ref = new ReflectionClass($this);
+ }
+ $this->getChildren = $ref->newInstance($child, $this->flags);
+ }
+ catch(Exception $e)
+ {
+ if (!$this->flags & self::CATCH_GET_CHILD)
+ {
+ throw $e;
+ }
+ $this->hasChildren = false;
+ $this->getChildren = NULL;
+ }
+ } else
+ {
+ $this->getChildren = NULL;
+ }
+ parent::next();
+ }
+
+ private $ref;
+
+ /** @return whether the current element has children
+ * @note The check whether the Iterator for the children can be created was
+ * already executed. Hence when flag CATCH_GET_CHILD was given in
+ * constructor this fucntion returns false so that getChildren does
+ * not try to access those children.
+ */
+ function hasChildren()
+ {
+ return $this->hasChildren;
+ }
+
+ /** @return An Iterator for the children
+ */
+ function getChildren()
+ {
+ return $this->getChildren;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/internal/recursivefilteriterator.inc b/ext/spl/internal/recursivefilteriterator.inc
new file mode 100755
index 000000000..0e17845e1
--- /dev/null
+++ b/ext/spl/internal/recursivefilteriterator.inc
@@ -0,0 +1,62 @@
+<?php
+
+/** @file recursivefilteriterator.inc
+ * @ingroup SPL
+ * @brief class RecursiveFilterIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup SPL
+ * @brief Iterator to filter recursive iterators
+ * @author Marcus Boerger
+ * @version 1.0
+ * @since PHP 5.1
+ *
+ * Passes the RecursiveIterator interface to the inner Iterator and provides
+ * the same functionality as FilterIterator. This allows you to skip parents
+ * and all their childs before loading them all. You need to care about
+ * function getChildren() because it may not always suit your needs. The
+ * builtin behavior uses reflection to return a new instance of the exact same
+ * class it is called from. That is you extend RecursiveFilterIterator and
+ * getChildren() will create instance of that class. The problem is that doing
+ * this does not transport any state or control information of your accept()
+ * implementation to the new instance. To overcome this problem you might
+ * need to overwrite getChildren(), call this implementation and pass the
+ * control vaules manually.
+ */
+abstract class RecursiveFilterIterator extends FilterIterator implements RecursiveIterator
+{
+ /** @param $it the RecursiveIterator to filter
+ */
+ function __construct(RecursiveIterator $it)
+ {
+ parent::__construct($it);
+ }
+
+ /** @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/recursiveiterator.inc b/ext/spl/internal/recursiveiterator.inc
index 715f6b06a..063fc905c 100755
--- a/ext/spl/internal/recursiveiterator.inc
+++ b/ext/spl/internal/recursiveiterator.inc
@@ -1,8 +1,29 @@
<?php
+/** @file recursiveiterator.inc
+ * @ingroup SPL
+ * @brief class RecursiveIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/**
+ * @brief Interface for recursive iteration with RecursiveIteratorIterator
+ * @author Marcus Boerger
+ * @version 1.0
+ * @since PHP 5.0
+ */
interface RecursiveIterator implements Iterator
{
+ /** @return whether the current element has children
+ */
function hasChildren();
+
+ /** @return the sub iterator for the current element
+ * @note The returned object must implement RecursiveIterator.
+ */
function getChildren();
}
diff --git a/ext/spl/internal/recursiveiteratoriterator.inc b/ext/spl/internal/recursiveiteratoriterator.inc
index ad1ba7a29..ba32e4ee9 100755
--- a/ext/spl/internal/recursiveiteratoriterator.inc
+++ b/ext/spl/internal/recursiveiteratoriterator.inc
@@ -1,31 +1,77 @@
<?php
+/** @file recursiveiteratoriterator.inc
+ * @ingroup SPL
+ * @brief class RecursiveIteratorIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
/**
* @brief Iterates through recursive iterators
* @author Marcus Boerger
- * @version 1.0
+ * @version 1.2
+ * @since PHP 5.0
*
+ * The objects of this class are created by instances of RecursiveIterator.
+ * Elements of those iterators may be traversable themselves. If so these
+ * sub elements are recursed into.
*/
-class RecursiveIteratorIterator implements Iterator
+class RecursiveIteratorIterator implements OuterIterator
{
- protected $ait = array();
- protected $count = 0;
+ /** Mode: Only show leaves */
+ const LEAVES_ONLY = 0;
+ /** Mode: Show parents prior to their children */
+ const SELF_FIRST = 1;
+ /** Mode: Show all children prior to their parent */
+ const CHILD_FIRST = 2;
+
+ /** Flag: Catches exceptions during getChildren() calls and simply jumps
+ * to the next element. */
+ const CATCH_GET_CHILD = 0x00000002;
- function __construct(RecursiveIterator $it)
+ private $ait = array();
+ private $count = 0;
+ private $mode = self::LEAVES_ONLY;
+ private $flags = 0;
+
+ /** Construct from RecursiveIterator
+ *
+ * @param it RecursiveIterator to iterate
+ * @param mode Operation mode (one of):
+ * - LEAVES_ONLY only show leaves
+ * - SELF_FIRST show parents prior to their childs
+ * - CHILD_FIRST show all children prior to their parent
+ * @param flags Control flags, zero or any combination of the following
+ * (since PHP 5.1).
+ * - CATCH_GET_CHILD which catches exceptions during
+ * getChildren() calls and simply jumps to the next
+ * element.
+ */
+ function __construct(RecursiveIterator $it, $mode = self::LEAVES_ONLY, $flags = 0)
{
$this->ait[0] = $it;
+ $this->mode = $mode;
+ $this->flags = $flags;
}
-
+ /** Rewind to top iterator as set in constructor
+ */
function rewind()
{
while ($this->count) {
unset($this->ait[$this->count--]);
+ $this->endChildren();
}
$this->ait[0]->rewind();
$this->ait[0]->recursed = false;
+ callNextElement(true);
}
+ /** @return whether iterator is valid
+ */
function valid()
{
$count = $this->count;
@@ -35,37 +81,57 @@ class RecursiveIteratorIterator implements Iterator
return true;
}
$count--;
+ $this->endChildren();
}
return false;
}
+ /** @return current key
+ */
function key()
{
$it = $this->ait[$this->count];
return $it->key();
}
+ /** @return current element
+ */
function current()
{
$it = $this->ait[$this->count];
return $it->current();
}
+ /** Forward to next element
+ */
function next()
{
while ($this->count) {
$it = $this->ait[$this->count];
if ($it->valid()) {
- if (!$it->recursed && $it->hasChildren()) {
+ if (!$it->recursed && callHasChildren()) {
$it->recursed = true;
- $sub = $it->getChildren();
+ try
+ {
+ $sub = callGetChildren();
+ }
+ catch (Exception $e)
+ {
+ if (!($this->flags & self::CATCH_GET_CHILD))
+ {
+ throw $e;
+ }
+ $it->next();
+ continue;
+ }
$sub->recursed = false;
$sub->rewind();
if ($sub->valid()) {
$this->ait[++$this->count] = $sub;
if (!$sub instanceof RecursiveIterator) {
throw new Exception(get_class($sub).'::getChildren() must return an object that implements RecursiveIterator');
- }
+ }
+ $this->beginChildren();
return;
}
unset($sub);
@@ -80,10 +146,16 @@ class RecursiveIteratorIterator implements Iterator
if ($this->count) {
unset($this->ait[$this->count--]);
$it = $this->ait[$this->count];
+ $this->endChildren();
+ callNextElement(false);
}
}
+ callNextElement(true);
}
-
+
+ /** @return Sub Iterator at given level or if unspecified the current sub
+ * Iterator
+ */
function getSubIterator($level = NULL)
{
if (is_null($level)) {
@@ -92,10 +164,72 @@ class RecursiveIteratorIterator implements Iterator
return @$this->ait[$level];
}
+ /**
+ * @return The inner iterator
+ */
+ function getInnerIterator()
+ {
+ return $this->it;
+ }
+
+ /** @return Current Depth (Number of parents)
+ */
function getDepth()
{
return $this->level;
}
+
+ /** @return whether current sub iterators current element has children
+ * @since PHP 5.1
+ */
+ function callHasChildren()
+ {
+ return $this->ait[$this->count]->hasChildren();
+ }
+
+ /** @return current sub iterators current children
+ * @since PHP 5.1
+ */
+ function callGetChildren()
+ {
+ return $this->ait[$this->count]->getChildren();
+ }
+
+ /** Called right after calling getChildren() and its rewind().
+ * @since PHP 5.1
+ */
+ function beginChildren()
+ {
+ }
+
+ /** Called after current child iterator is invalid and right before it
+ * gets destructed.
+ * @since PHP 5.1
+ */
+ function endChildren()
+ {
+ }
+
+ private function callNextElement($after_move)
+ {
+ if ($this->valid())
+ {
+ if ($after_move)
+ {
+ if (($this->mode == self::SELF_FIRST && $this->callHasChildren())
+ $this->mode == self::LEAVES_ONLY)
+ $this->nextElement();
+ }
+ else
+ {
+ $this->nextElement();
+ }
+ }
+ }
+
+ /** Called when the next element is available
+ */
+ function nextElement();
}
?> \ No newline at end of file
diff --git a/ext/spl/internal/seekableiterator.inc b/ext/spl/internal/seekableiterator.inc
index 5f6b36c28..af66c60c3 100755
--- a/ext/spl/internal/seekableiterator.inc
+++ b/ext/spl/internal/seekableiterator.inc
@@ -1,6 +1,18 @@
<?php
-/** \brief seekable iterator
+/** @file seekableiterator.inc
+ * @ingroup SPL
+ * @brief class SeekableIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @brief seekable iterator
+ * @author Marcus Boerger
+ * @version 1.0
+ * @since PHP 5.0
*
* Turns a normal iterator ino a seekable iterator. When there is a way
* to seek on an iterator LimitIterator can use this to efficiently rewind
@@ -13,17 +25,24 @@ interface SeekableIterator implements Iterator
* \param $index position to seek to
* \return void
*
- * \note The method should throw an exception if it is not possible to
- * seek to the given position.
- */
+ * The method should throw an exception if it is not possible to seek to
+ * the given position. Typically this exception should be of type
+ * OutOfBoundsException.
+ \code
function seek($index);
-/* $this->rewind();
+ $this->rewind();
$position = 0;
while($position < $index && $this->valid()) {
$this->next();
$position++;
}
- }*/
+ if (!$this->valid()) {
+ throw new OutOfBoundsException('Invalid seek position');
+ }
+ }
+ \endcode
+ */
+ function seek($index);
}
?> \ No newline at end of file
diff --git a/ext/spl/internal/splfileobject.inc b/ext/spl/internal/splfileobject.inc
new file mode 100755
index 000000000..bb1a23929
--- /dev/null
+++ b/ext/spl/internal/splfileobject.inc
@@ -0,0 +1,353 @@
+<?php
+
+/** @file splfileobject.inc
+ * @ingroup SPL
+ * @brief class FileObject
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup SPL
+ * @brief Object representation for any stream
+ * @author Marcus Boerger
+ * @version 1.0
+ * @since PHP 5.1
+ */
+class SplFileObject implements RecursiveIterator, SeekableIterator
+{
+ /** Flag: wheter to suppress new lines */
+ const DROP_NEW_LINE = 0x00000001;
+
+ private $fp;
+ private $fname;
+ private $line = NULL;
+ private $lnum = 0;
+ private $max_len = 0;
+ private $flags = 0;
+
+ /**
+ * Constructs a new file object
+ *
+ * @param $file_name The name of the stream to open
+ * @param $open_mode The file open mode
+ * @param $use_include_path Whether to search in include paths
+ * @param $context A stream context
+ * @throw RuntimeException If file cannot be opened (e.g. insufficient
+ * access rights).
+ */
+ function __construct($file_name, $open_mode = 'r', $use_include_path = false, $context = NULL)
+ {
+ $this->fp = fopen($file_name, $open_mode, $use_include_path, $context);
+ if (!$this->fp)
+ {
+ throw new RuntimeException("Cannot open file $file_name");
+ }
+ $this->fname = $file_name;
+ }
+
+ /**
+ * @return the filename as specified in the constructor
+ */
+ function getFilename()
+ {
+ return $this->fname;
+ }
+
+ /**
+ * @return whether the end of the stream is reached
+ */
+ function eof()
+ {
+ return eof($this->fp);
+ }
+
+ /** increase current line number
+ * @return next line from stream
+ */
+ function fgets()
+ {
+ $this->freeLine();
+ $this->lnum++;
+ $buf = fgets($this->fp, $this->max_len);
+
+ return $buf;
+ }
+
+ /**
+ * @param delimiter character used as field separator
+ * @param enclosure end of
+ * @return array containing read data
+ */
+ function fgetcsv($delimiter = ';', $enclosure = '')
+ {
+ $this->freeLine();
+ $this->lnum++;
+ return fgetcsv($this->fp, $this->max_len, $delimiter, $enclosure);
+ }
+
+ /**
+ * @param operation lock operation (LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB)
+ * @retval $wouldblock whether the operation would block
+ */
+ function flock($operation, &$wouldblock)
+ {
+ return flock($this->fp, $operation, $wouldblock);
+ }
+
+ /**
+ * Flush current data
+ * @return success or failure
+ */
+ function fflush()
+ {
+ return fflush($this->fp);
+ }
+
+ /**
+ * @return current file position
+ */
+ function ftell()
+ {
+ return ftell($this->fp);
+ }
+
+ /**
+ * @param pos new file position
+ * @param whence seek method (SEEK_SET, SEEK_CUR, SEEK_END)
+ * @return Upon success, returns 0; otherwise, returns -1. Note that
+ * seeking past EOF is not considered an error.
+ */
+ function fseek($pos, $whence = SEEK_SET)
+ {
+ return fseek($this->fp, $pos, $whence);
+ }
+
+ /**
+ * @return next char from file
+ * @note a new line character does not increase $this->lnum
+ */
+ function fgetc()
+ {
+ $this->freeLine();
+ $c = fgetc($this->fp);
+ if ($c == '\n') {
+ $this->lnum++;
+ }
+ }
+
+ /** Read and return remaining part of stream
+ * @return size of remaining part passed through
+ */
+ function fpassthru()
+ {
+ return fpassthru($this->fp);
+ }
+
+ /** Get a line from the file and strip HTML tags
+ * @param $allowable_tags tags to keep in the string
+ */
+ function fgetss($allowable_tags = NULL)
+ {
+ return fgetss($this->fp, $allowable_tags);
+ }
+
+ /** Scan the next line
+ * @param $format string specifying format to parse
+ */
+ function fscanf($format /* , ... */)
+ {
+ $this->freeLine();
+ $this->lnum++;
+ return fscanf($this->fp, $format /* , ... */);
+ }
+
+ /**
+ * @param $str to write
+ * @param $length maximum line length to write
+ */
+ function fwrite($str, $length = NULL)
+ {
+ return fwrite($this->fp, $length);
+ }
+
+ /**
+ * @return array of file stat information
+ */
+ function fstat()
+ {
+ return fstat($this->fp);
+ }
+
+ /**
+ * @param $size new size to truncate file to
+ */
+ function ftruncate($size)
+ {
+ return ftruncate($this->fp, $size);
+ }
+
+ /**
+ * @param $flags new flag set
+ */
+ function setFlags($flags)
+ {
+ $this->flags = $flags;
+ }
+
+ /**
+ * @return current set of flags
+ */
+ function getFlags()
+ {
+ return $this->flags;
+ }
+
+ /**
+ * @param $max_len set the maximum line length read
+ */
+ function setMaxLineLen($max_len)
+ {
+ $this->max_len = $max_len;
+ }
+
+ /**
+ * @return current setting for max line
+ */
+ function getMaxLineLen()
+ {
+ return $this->max_len;
+ }
+
+ /**
+ * @return false
+ */
+ function hasChildren()
+ {
+ return false;
+ }
+
+ /**
+ * @return false
+ */
+ function getChildren()
+ {
+ return NULL;
+ }
+
+ /**
+ * Invalidate current line buffer and set line number to 0.
+ */
+ function rewind()
+ {
+ $this->freeLine();
+ $this->lnum = 0;
+ }
+
+ /**
+ * @return whether more data can be read
+ */
+ function valid()
+ {
+ return !$this->eof();
+ }
+
+ /**
+ * @note Fill current line buffer if not done yet.
+ * @return line buffer
+ */
+ function current()
+ {
+ if (is_null($this->line))
+ {
+ $this->line = getCurrentLine();
+ }
+ return $this->line;
+ }
+
+ /**
+ * @return line number
+ * @note fgetc() will increase the line number when reaing a new line char.
+ * This has the effect key() called on a read a new line will already
+ * return the increased line number.
+ * @note Line counting works as long as you only read the file and do not
+ * use fseek().
+ */
+ function key()
+ {
+ return $this->lnum;
+ }
+
+ /** Invalidate current line buffer.
+ */
+ function next()
+ {
+ $this->freeLine();
+ }
+
+ /**
+ * @return next line read from file and increase the line counter
+ */
+ private function readLine()
+ {
+ if ($this->eof())
+ {
+ $this->freeLine();
+ throw new RuntimeException("Cannot read from file " . $this->fname);
+ }
+ if ($this->line) {
+ $this->lnum++;
+ }
+ $this->freeLine();
+ $this->line = fgets($this->fp, $this->max_len);
+ return $this->line;
+ }
+
+ /**
+ * Free the current line buffer and increment the line counter
+ */
+ private function freeLine()
+ {
+ if ($this->line) {
+ $this->line = NULL;
+ }
+ }
+
+ /*
+ * @note If you DO overload this function key() and current() will increment
+ * $this->lnum automatically. If not then function reaLine() will do
+ * that for you.
+ */
+ function getCurrentLine()
+ {
+ $this->freeLine();
+ if ($this->eof())
+ {
+ throw new RuntimeException("Cannot read from file " . $this->fname);
+ }
+ $this->readLine();
+ }
+
+ /**
+ * @return current line
+ */
+ function __toString()
+ {
+ return current();
+ }
+
+ /**
+ * @param $line_pos Seek to this line
+ */
+ function seek($line_pos)
+ {
+ $this->rewind();
+ while($this->lnum < $line_pos && !$this->eof())
+ {
+ $this->getCurrentLine();
+ }
+ }
+}
+
+?>
diff --git a/ext/spl/internal/splobjectstorage.inc b/ext/spl/internal/splobjectstorage.inc
new file mode 100755
index 000000000..b01a85096
--- /dev/null
+++ b/ext/spl/internal/splobjectstorage.inc
@@ -0,0 +1,118 @@
+<?php
+
+/** @file splobjectstorage.inc
+ * @ingroup SPL
+ * @brief class SplObjectStorage
+ * @author Marcus Boerger
+ * @date 2003 - 2005
+ *
+ * SPL - Standard PHP Library
+ */
+
+/**
+ * @brief Object storage
+ * @author Marcus Boerger
+ * @version 1.0
+ * @since PHP 6.0
+ *
+ * This container allows to store objects uniquly without the need to compare
+ * them one by one. This is only possible internally. The code represenation
+ * here therefore has a complexity of O(n) while the actual implementation has
+ * complexity O(1).
+ */
+class SplObjectStorage implements Iterator, Countable
+{
+ private $storage = array();
+ private $index = 0;
+
+ /** Rewind to top iterator as set in constructor
+ */
+ function rewind()
+ {
+ rewind($this->storage);
+ }
+
+ /** @return whether iterator is valid
+ */
+ function valid()
+ {
+ return key($this->storage) !== false;
+ }
+
+ /** @return current key
+ */
+ function key()
+ {
+ return $this->index;
+ }
+
+ /** @return current object
+ */
+ function current()
+ {
+ return current($this->storage);
+ }
+
+ /** Forward to next element
+ */
+ function next()
+ {
+ next($this->storage);
+ $this->index++;
+ }
+
+ /** @return number of objects in storage
+ */
+ function count()
+ {
+ return count($this->storage);
+ }
+
+ /** @param obj object to look for
+ * @return whether $obj is contained in storage
+ */
+ function contains($obj)
+ {
+ if (is_object($obj))
+ {
+ foreach($this->storage as $object)
+ {
+ if ($object === $obj)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /** @param $obj new object to attach to storage if not yet contained
+ */
+ function attach($obj)
+ {
+ if (is_object($obj) && !$this->contains($obj))
+ {
+ $this->storage[] = $obj;
+ }
+ }
+
+ /** @param $obj object to remove from storage
+ */
+ function detach($obj)
+ {
+ if (is_object($obj))
+ {
+ foreach($this->storage as $idx => $object)
+ {
+ if ($object === $obj)
+ {
+ unset($this->storage[$idx]);
+ $this->rewind();
+ return;
+ }
+ }
+ }
+ }
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 92262241a..0c6fe462e 100755
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_spl.c,v 1.28.2.1 2005/08/24 10:18:15 johannes Exp $ */
+/* $Id: php_spl.c,v 1.52.2.15 2005/11/07 13:08:24 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -32,6 +32,10 @@
#include "spl_directory.h"
#include "spl_iterators.h"
#include "spl_sxe.h"
+#include "spl_exceptions.h"
+#include "spl_observer.h"
+#include "zend_exceptions.h"
+#include "zend_interfaces.h"
#ifdef COMPILE_DL_SPL
ZEND_GET_MODULE(spl)
@@ -39,32 +43,6 @@ ZEND_GET_MODULE(spl)
ZEND_DECLARE_MODULE_GLOBALS(spl)
-/* {{{ spl_functions
- */
-function_entry spl_functions[] = {
- PHP_FE(spl_classes, NULL)
- PHP_FE(class_parents, NULL)
- PHP_FE(class_implements, NULL)
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-/* {{{ spl_module_entry
- */
-zend_module_entry spl_module_entry = {
- STANDARD_MODULE_HEADER,
- "SPL",
- spl_functions,
- PHP_MINIT(spl),
- PHP_MSHUTDOWN(spl),
- PHP_RINIT(spl),
- PHP_RSHUTDOWN(spl),
- PHP_MINFO(spl),
- "0.2",
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
/* {{{ spl_functions_none
*/
function_entry spl_functions_none[] = {
@@ -76,62 +54,62 @@ function_entry spl_functions_none[] = {
*/
static void spl_init_globals(zend_spl_globals *spl_globals)
{
+ spl_globals->autoload_extensions = NULL;
+ spl_globals->autoload_functions = NULL;
}
/* }}} */
-/* {{{ PHP_MINIT_FUNCTION(spl)
- */
-PHP_MINIT_FUNCTION(spl)
+static zend_class_entry * spl_find_ce_by_name(char *name, int len, zend_bool autoload TSRMLS_DC)
{
- ZEND_INIT_MODULE_GLOBALS(spl, spl_init_globals, NULL);
+ zend_class_entry **ce;
+ int found;
- PHP_MINIT(spl_iterators)(INIT_FUNC_ARGS_PASSTHRU);
- PHP_MINIT(spl_array)(INIT_FUNC_ARGS_PASSTHRU);
- PHP_MINIT(spl_directory)(INIT_FUNC_ARGS_PASSTHRU);
- PHP_MINIT(spl_sxe)(INIT_FUNC_ARGS_PASSTHRU);
+ if (!autoload) {
+ char *lc_name;
- return SUCCESS;
-}
-/* }}} */
+ lc_name = do_alloca(len + 1);
+ zend_str_tolower_copy(lc_name, name, len);
-/* {{{ PHP_RINIT_FUNCTION(spl)
- */
-PHP_RINIT_FUNCTION(spl)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RSHUTDOWN_FUNCTION(spl)
- */
-PHP_RSHUTDOWN_FUNCTION(spl)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION(spl)
- */
-PHP_MSHUTDOWN_FUNCTION(spl)
-{
- SPL_DEBUG(fprintf(stderr, "%s\n", "Shutting down SPL");)
-
- return SUCCESS;
+ found = zend_hash_find(EG(class_table), lc_name, len +1, (void **) &ce);
+ free_alloca(lc_name);
+ } else {
+ found = zend_lookup_class(name, len, &ce TSRMLS_CC);
+ }
+ if (found != SUCCESS) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class %s does not exist%s", name, autoload ? " and could not be loaded" : "");
+ return NULL;
+ }
+
+ return *ce;
}
-/* }}} */
-/* {{{ class_parents
- */
+/* {{{ array class_parents(object instance)
+ Return an array containing the names of all parent classes */
PHP_FUNCTION(class_parents)
{
zval *obj;
- zend_class_entry *parent_class;
+ zend_class_entry *parent_class, *ce;
+ zend_bool autoload = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected");
RETURN_FALSE;
}
+
+ if (Z_TYPE_P(obj) == IS_STRING) {
+ if (NULL == (ce = spl_find_ce_by_name(Z_STRVAL_P(obj), Z_STRLEN_P(obj), autoload TSRMLS_CC))) {
+ RETURN_FALSE;
+ }
+ } else {
+ ce = Z_OBJCE_P(obj);
+ }
+
array_init(return_value);
- parent_class = Z_OBJCE_P(obj)->parent;
+ parent_class = ce->parent;
while (parent_class) {
spl_add_class_name(return_value, parent_class, 0, 0 TSRMLS_CC);
parent_class = parent_class->parent;
@@ -139,17 +117,32 @@ PHP_FUNCTION(class_parents)
}
/* }}} */
-/* {{{ class_implements
- */
+/* {{{ proto array class_implements(mixed what [, bool autoload ])
+ Return all classes and interfaces implemented by SPL */
PHP_FUNCTION(class_implements)
{
zval *obj;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ zend_bool autoload = 1;
+ zend_class_entry *ce;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) {
RETURN_FALSE;
}
+ if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected");
+ RETURN_FALSE;
+ }
+
+ if (Z_TYPE_P(obj) == IS_STRING) {
+ if (NULL == (ce = spl_find_ce_by_name(Z_STRVAL_P(obj), Z_STRLEN_P(obj), autoload TSRMLS_CC))) {
+ RETURN_FALSE;
+ }
+ } else {
+ ce = Z_OBJCE_P(obj);
+ }
+
array_init(return_value);
- spl_add_interfaces(return_value, Z_OBJCE_P(obj), 1, ZEND_ACC_INTERFACE TSRMLS_CC);
+ spl_add_interfaces(return_value, ce, 1, ZEND_ACC_INTERFACE TSRMLS_CC);
}
/* }}} */
@@ -157,21 +150,48 @@ PHP_FUNCTION(class_implements)
spl_add_classes(&spl_ce_ ## class_name, z_list, sub, allow, ce_flags TSRMLS_CC)
#define SPL_LIST_CLASSES(z_list, sub, allow, ce_flags) \
+ SPL_ADD_CLASS(AppendIterator, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(ArrayIterator, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(ArrayObject, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(BadFunctionCallException, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(BadMethodCallException, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(CachingIterator, z_list, sub, allow, ce_flags); \
- SPL_ADD_CLASS(CachingRecursiveIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(Countable, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(DirectoryIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(DomainException, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(EmptyIterator, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(FilterIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(InfiniteIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(InvalidArgumentException, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(IteratorIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(LengthException, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(LimitIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(LogicException, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(NoRewindIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(OuterIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(OutOfBoundsException, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(OutOfRangeException, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(OverflowException, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(ParentIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(RangeException, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(RecursiveArrayIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(RecursiveCachingIterator, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(RecursiveDirectoryIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(RecursiveFilterIterator, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(RecursiveIterator, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(RecursiveIteratorIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(RuntimeException, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(SeekableIterator, z_list, sub, allow, ce_flags); \
SPL_ADD_CLASS(SimpleXMLIterator, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(SplFileObject, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(SplObjectStorage, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(SplObserver, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(SplSubject, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(UnderflowException, z_list, sub, allow, ce_flags); \
+ SPL_ADD_CLASS(UnexpectedValueException, z_list, sub, allow, ce_flags); \
-/* {{{ spl_classes */
+/* {{{ proto array spl_classes()
+ Return an array containing the names of all clsses and interfaces defined in SPL */
PHP_FUNCTION(spl_classes)
{
array_init(return_value);
@@ -180,7 +200,361 @@ PHP_FUNCTION(spl_classes)
}
/* }}} */
-int spl_build_class_list_string(zval **entry, char **list TSRMLS_DC)
+int spl_autoload(const char *class_name, const char * lc_name, int class_name_len, const char * file_extension TSRMLS_DC) /* {{{ */
+{
+ char *class_file;
+ int class_file_len;
+ int dummy = 1;
+ zend_file_handle file_handle;
+ zend_op_array *new_op_array;
+ zval *result = NULL;
+
+ class_file_len = spprintf(&class_file, 0, "%s%s", lc_name, file_extension);
+
+ if (zend_stream_open(class_file, &file_handle TSRMLS_CC) == SUCCESS) {
+ if (!file_handle.opened_path) {
+ file_handle.opened_path = estrndup(class_file, class_file_len);
+ }
+ if (zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ } else {
+ new_op_array = NULL;
+ zend_file_handle_dtor(&file_handle);
+ }
+ if (new_op_array) {
+ EG(return_value_ptr_ptr) = &result;
+ EG(active_op_array) = new_op_array;
+
+ zend_execute(new_op_array TSRMLS_CC);
+
+ destroy_op_array(new_op_array TSRMLS_CC);
+ efree(new_op_array);
+ if (!EG(exception)) {
+ if (EG(return_value_ptr_ptr)) {
+ zval_ptr_dtor(EG(return_value_ptr_ptr));
+ }
+ }
+
+ efree(class_file);
+ return zend_hash_exists(EG(class_table), (char*)lc_name, class_name_len+1);
+ }
+ }
+ efree(class_file);
+ return 0;
+} /* }}} */
+
+/* {{{ void spl_autoload(string class_name [, string file_extensions])
+ Default implementation for __autoload() */
+PHP_FUNCTION(spl_autoload)
+{
+ char *class_name, *lc_name, *file_exts;
+ int class_name_len, file_exts_len, found = 0;
+ char *copy, *pos1, *pos2;
+ zval **original_return_value = EG(return_value_ptr_ptr);
+ zend_op **original_opline_ptr = EG(opline_ptr);
+ zend_op_array *original_active_op_array = EG(active_op_array);
+ zend_function_state *original_function_state_ptr = EG(function_state_ptr);
+ zval err_mode;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &class_name, &class_name_len, &file_exts, &file_exts_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ ZVAL_LONG(&err_mode, EG(error_reporting));
+ php_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+
+ copy = pos1 = estrdup(ZEND_NUM_ARGS() > 1 ? file_exts : SPL_G(autoload_extensions));
+ lc_name = zend_str_tolower_dup(class_name, class_name_len);
+ while(pos1 && *pos1 && !EG(exception)) {
+ EG(return_value_ptr_ptr) = original_return_value;
+ EG(opline_ptr) = original_opline_ptr;
+ EG(active_op_array) = original_active_op_array;
+ EG(function_state_ptr) = original_function_state_ptr;
+ pos2 = strchr(pos1, ',');
+ if (pos2) *pos2 = '\0';
+ if (spl_autoload(class_name, lc_name, class_name_len, pos1 TSRMLS_CC)) {
+ found = 1;
+ break; /* loaded */
+ }
+ pos1 = pos2 ? pos2 + 1 : NULL;
+ }
+ efree(lc_name);
+ if (copy) {
+ efree(copy);
+ }
+
+ if (!EG(error_reporting) && Z_LVAL(err_mode) != EG(error_reporting)) {
+ convert_to_string(&err_mode);
+ zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(err_mode), Z_STRLEN(err_mode), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+ zendi_zval_dtor(err_mode);
+ }
+
+ EG(return_value_ptr_ptr) = original_return_value;
+ EG(opline_ptr) = original_opline_ptr;
+ EG(active_op_array) = original_active_op_array;
+ EG(function_state_ptr) = original_function_state_ptr;
+
+ if (!found) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Class %s could not be loaded", class_name);
+ }
+} /* }}} */
+
+/* {{{ void string spl_autoload_extensions([string file_extensions])
+ Register and return default file extensions for spl_autoload */
+PHP_FUNCTION(spl_autoload_extensions)
+{
+ char *file_exts;
+ int file_exts_len;
+
+ if (ZEND_NUM_ARGS() > 0) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file_exts, &file_exts_len) == FAILURE) {
+ return;
+ }
+
+ if (SPL_G(autoload_extensions)) {
+ efree(SPL_G(autoload_extensions));
+ }
+ SPL_G(autoload_extensions) = estrdup(file_exts);
+ }
+
+ RETURN_STRING(SPL_G(autoload_extensions), 1);
+} /* }}} */
+
+typedef struct {
+ zend_function *func_ptr;
+ zval *obj;
+ zend_class_entry *ce;
+} autoload_func_info;
+
+static void autoload_func_info_dtor(autoload_func_info *alfi)
+{
+ if (alfi->obj) {
+ zval_ptr_dtor(&alfi->obj);
+ }
+}
+
+/* {{{ void spl_autoload_call(string class_name)
+ Try all registerd autoload function to load the requested class */
+PHP_FUNCTION(spl_autoload_call)
+{
+ zval **class_name, *retval = NULL;
+ char *func_name, *lc_name;
+ uint func_name_len;
+ ulong dummy;
+ HashPosition function_pos;
+ autoload_func_info *alfi;
+
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name) == FAILURE || Z_TYPE_PP(class_name) != IS_STRING) {
+ return;
+ }
+
+ if (SPL_G(autoload_functions)) {
+ lc_name = zend_str_tolower_dup(Z_STRVAL_PP(class_name), Z_STRLEN_PP(class_name));
+ zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos);
+ while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), &function_pos) == SUCCESS && !EG(exception)) {
+ zend_hash_get_current_key_ex(SPL_G(autoload_functions), &func_name, &func_name_len, &dummy, 0, &function_pos);
+ zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) &alfi, &function_pos);
+ zend_call_method(alfi->obj ? &alfi->obj : NULL, alfi->ce, &alfi->func_ptr, func_name, func_name_len, &retval, 1, *class_name, NULL TSRMLS_CC);
+ if (retval) {
+ zval_ptr_dtor(&retval);
+ }
+ if (zend_hash_exists(EG(class_table), lc_name, Z_STRLEN_PP(class_name)+1)) {
+ break;
+ }
+ zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos);
+ }
+ efree(lc_name);
+ } else {
+ /* do not use or overwrite &EG(autoload_func) here */
+ zend_call_method_with_1_params(NULL, NULL, NULL, "spl_autoload", NULL, *class_name);
+ }
+} /* }}} */
+
+/* {{{ void spl_autoload_register([string autoload_function = "spl_autoload" [, throw = true]])
+ Register given function as __autoload() implementation */
+PHP_FUNCTION(spl_autoload_register)
+{
+ char *func_name;
+ int func_name_len;
+ char *lc_name = NULL;
+ zval *zcallable = NULL;
+ zend_bool do_throw = 1;
+ zend_function *spl_func_ptr;
+ autoload_func_info alfi;
+ zval **obj_ptr;
+
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|zb", &zcallable, &do_throw) == FAILURE) {
+ return;
+ }
+
+ if (ZEND_NUM_ARGS()) {
+ if (Z_TYPE_P(zcallable) == IS_STRING) {
+ if (Z_STRLEN_P(zcallable) == sizeof("spl_autoload_call") - 1) {
+ char tmp_name[sizeof("spl_autoload_call")];
+ zend_str_tolower_copy(tmp_name, Z_STRVAL_P(zcallable), Z_STRLEN_P(zcallable));
+ if (!strcmp(tmp_name, "spl_autoload_call")) {
+ if (do_throw) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function spl_autoload_call() cannot be registered");
+ }
+ return;
+ }
+ }
+ }
+
+ if (!zend_is_callable_ex(zcallable, IS_CALLABLE_CHECK_IS_STATIC, &func_name, &func_name_len, &alfi.ce, &alfi.func_ptr, &obj_ptr TSRMLS_CC)) {
+ if (Z_TYPE_P(zcallable) == IS_ARRAY) {
+ if (!obj_ptr && alfi.func_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (do_throw) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array specifies a non static method but no object");
+ }
+ efree(func_name);
+ return;
+ }
+ else if (do_throw) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array does not specify a callable %smethod", !obj_ptr ? "static " : "");
+ }
+ efree(func_name);
+ return;
+ } else if (Z_TYPE_P(zcallable) == IS_STRING) {
+ if (do_throw) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function '%s' not found", func_name);
+ }
+ efree(func_name);
+ return;
+ } else {
+ if (do_throw) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Illegal value passed", func_name);
+ }
+ efree(func_name);
+ return;
+ }
+ }
+
+ lc_name = do_alloca(func_name_len + 1);
+ zend_str_tolower_copy(lc_name, func_name, func_name_len);
+ efree(func_name);
+ if (obj_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) {
+ alfi.obj = *obj_ptr;
+ alfi.obj->refcount++;
+ } else {
+ alfi.obj = NULL;
+ }
+
+ if (!SPL_G(autoload_functions)) {
+ ALLOC_HASHTABLE(SPL_G(autoload_functions));
+ zend_hash_init(SPL_G(autoload_functions), 1, NULL, (dtor_func_t) autoload_func_info_dtor, 0);
+ }
+
+ zend_hash_find(EG(function_table), "spl_autoload", sizeof("spl_autoload"), (void **) &spl_func_ptr);
+
+ if (EG(autoload_func) == spl_func_ptr) { /* registered already, so we insert that first */
+ autoload_func_info spl_alfi;
+
+ spl_alfi.func_ptr = spl_func_ptr;
+ spl_alfi.obj = NULL;
+ spl_alfi.ce = NULL;
+ zend_hash_add(SPL_G(autoload_functions), "spl_autoload", sizeof("spl_autoload"), &spl_alfi, sizeof(autoload_func_info), NULL);
+ }
+
+ zend_hash_add(SPL_G(autoload_functions), lc_name, func_name_len+1, &alfi.func_ptr, sizeof(autoload_func_info), NULL);
+
+ free_alloca(lc_name);
+ }
+
+ if (SPL_G(autoload_functions)) {
+ zend_hash_find(EG(function_table), "spl_autoload_call", sizeof("spl_autoload_call"), (void **) &EG(autoload_func));
+ } else {
+ zend_hash_find(EG(function_table), "spl_autoload", sizeof("spl_autoload"), (void **) &EG(autoload_func));
+ }
+} /* }}} */
+
+/* {{{ bool spl_autoload_unregister(string autoload_function)
+ Unregister given function as __autoload() implementation */
+PHP_FUNCTION(spl_autoload_unregister)
+{
+ char *func_name, *lc_name;
+ int func_name_len, success = FAILURE;
+ zend_function *spl_func_ptr;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &func_name, &func_name_len) == FAILURE) {
+ return;
+ }
+
+ lc_name = do_alloca(func_name_len + 1);
+ zend_str_tolower_copy(lc_name, func_name, func_name_len);
+
+ if (SPL_G(autoload_functions)) {
+ if (func_name_len == sizeof("spl_autoload_call")-1 && !strcmp(lc_name, "spl_autoload_call")) {
+ /* remove all */
+ zend_hash_destroy(SPL_G(autoload_functions));
+ FREE_HASHTABLE(SPL_G(autoload_functions));
+ SPL_G(autoload_functions) = NULL;
+ EG(autoload_func) = NULL;
+ success = SUCCESS;
+ } else {
+ /* remove specific */
+ success = zend_hash_del(SPL_G(autoload_functions), lc_name, func_name_len+1);
+ }
+ } else if (func_name_len == sizeof("spl_autoload")-1 && !strcmp(lc_name, "spl_autoload")) {
+ /* register single spl_autoload() */
+ zend_hash_find(EG(function_table), "spl_autoload", sizeof("spl_autoload"), (void **) &spl_func_ptr);
+
+ if (EG(autoload_func) == spl_func_ptr) {
+ success = SUCCESS;
+ EG(autoload_func) = NULL;
+ }
+ }
+
+ free_alloca(lc_name);
+
+ RETURN_BOOL(success == SUCCESS);
+} /* }}} */
+
+/* {{{ false|array spl_autoload_functions()
+ Return all registered __autoload() functionns */
+PHP_FUNCTION(spl_autoload_functions)
+{
+ zend_function *fptr, **func_ptr_ptr;
+ HashPosition function_pos;
+
+ if (!EG(autoload_func)) {
+ if (zend_hash_find(EG(function_table), ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME), (void **) &fptr) == SUCCESS) {
+ array_init(return_value);
+ add_next_index_stringl(return_value, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)-1, 1);
+ return;
+ }
+ RETURN_FALSE;
+ }
+
+ zend_hash_find(EG(function_table), "spl_autoload_call", sizeof("spl_autoload_call"), (void **) &fptr);
+
+ if (EG(autoload_func) == fptr) {
+ array_init(return_value);
+ zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos);
+ while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), &function_pos) == SUCCESS) {
+ zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) &func_ptr_ptr, &function_pos);
+ if ((*func_ptr_ptr)->common.scope) {
+ zval *tmp;
+ MAKE_STD_ZVAL(tmp);
+ array_init(tmp);
+
+ add_next_index_string(tmp, (*func_ptr_ptr)->common.scope->name, 1);
+ add_next_index_string(tmp, (*func_ptr_ptr)->common.function_name, 1);
+ add_next_index_zval(return_value, tmp);
+ } else
+ add_next_index_string(return_value, (*func_ptr_ptr)->common.function_name, 1);
+
+ zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos);
+ }
+ return;
+ }
+
+ array_init(return_value);
+ add_next_index_string(return_value, EG(autoload_func)->common.function_name, 1);
+} /* }}} */
+
+int spl_build_class_list_string(zval **entry, char **list TSRMLS_DC) /* {{{ */
{
char *res;
@@ -188,7 +562,7 @@ int spl_build_class_list_string(zval **entry, char **list TSRMLS_DC)
efree(*list);
*list = res;
return ZEND_HASH_APPLY_KEEP;
-}
+} /* }}} */
/* {{{ PHP_MINFO(spl)
*/
@@ -222,6 +596,93 @@ PHP_MINFO_FUNCTION(spl)
}
/* }}} */
+/* {{{ spl_functions
+ */
+function_entry spl_functions[] = {
+ PHP_FE(spl_classes, NULL)
+ PHP_FE(spl_autoload, NULL)
+ PHP_FE(spl_autoload_extensions, NULL)
+ PHP_FE(spl_autoload_register, NULL)
+ PHP_FE(spl_autoload_unregister, NULL)
+ PHP_FE(spl_autoload_functions, NULL)
+ PHP_FE(spl_autoload_call, NULL)
+ PHP_FE(class_parents, NULL)
+ PHP_FE(class_implements, NULL)
+#ifdef SPL_ITERATORS_H
+ PHP_FE(iterator_to_array, NULL)
+ PHP_FE(iterator_count, NULL)
+#endif /* SPL_ITERATORS_H */
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ PHP_MINIT_FUNCTION(spl)
+ */
+PHP_MINIT_FUNCTION(spl)
+{
+ ZEND_INIT_MODULE_GLOBALS(spl, spl_init_globals, NULL);
+
+ PHP_MINIT(spl_iterators)(INIT_FUNC_ARGS_PASSTHRU);
+ PHP_MINIT(spl_array)(INIT_FUNC_ARGS_PASSTHRU);
+ PHP_MINIT(spl_directory)(INIT_FUNC_ARGS_PASSTHRU);
+ PHP_MINIT(spl_sxe)(INIT_FUNC_ARGS_PASSTHRU);
+ PHP_MINIT(spl_exceptions)(INIT_FUNC_ARGS_PASSTHRU);
+ PHP_MINIT(spl_observer)(INIT_FUNC_ARGS_PASSTHRU);
+
+ return SUCCESS;
+}
+/* }}} */
+
+PHP_RINIT_FUNCTION(spl) /* {{{ */
+{
+ SPL_G(autoload_extensions) = estrndup(".inc,.php", sizeof(".inc,.php")-1);
+ SPL_G(autoload_functions) = NULL;
+ return SUCCESS;
+} /* }}} */
+
+PHP_RSHUTDOWN_FUNCTION(spl) /* {{{ */
+{
+ if (SPL_G(autoload_extensions)) {
+ efree(SPL_G(autoload_extensions));
+ SPL_G(autoload_extensions) = NULL;
+ }
+ if (SPL_G(autoload_functions)) {
+ zend_hash_destroy(SPL_G(autoload_functions));
+ FREE_HASHTABLE(SPL_G(autoload_functions));
+ SPL_G(autoload_functions) = NULL;
+ }
+ return SUCCESS;
+} /* }}} */
+
+#ifdef HAVE_SIMPLEXML
+static zend_module_dep spl_deps[] = {
+ ZEND_MOD_REQUIRED("libxml")
+ ZEND_MOD_REQUIRED("simplexml")
+ {NULL, NULL, NULL}
+};
+#endif
+
+/* {{{ spl_module_entry
+ */
+zend_module_entry spl_module_entry = {
+#ifdef HAVE_SIMPLEXML
+ STANDARD_MODULE_HEADER_EX, NULL,
+ spl_deps,
+#else
+ STANDARD_MODULE_HEADER,
+#endif
+ "SPL",
+ spl_functions,
+ PHP_MINIT(spl),
+ NULL,
+ PHP_RINIT(spl),
+ PHP_RSHUTDOWN(spl),
+ PHP_MINFO(spl),
+ "0.2",
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
/*
* Local variables:
* tab-width: 4
diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h
index 2e6bd2b62..e70931e47 100755
--- a/ext/spl/php_spl.h
+++ b/ext/spl/php_spl.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -56,7 +56,8 @@ PHP_MINFO_FUNCTION(spl);
ZEND_BEGIN_MODULE_GLOBALS(spl)
- int dummy;
+ char * autoload_extensions;
+ HashTable * autoload_functions;
ZEND_END_MODULE_GLOBALS(spl)
#ifdef ZTS
diff --git a/ext/spl/spl.php b/ext/spl/spl.php
index 1f4e8ec7e..a3a867761 100755
--- a/ext/spl/spl.php
+++ b/ext/spl/spl.php
@@ -1,73 +1,494 @@
<?php
-/** \file spl.php
- * \ingroup SPL
- * \brief Documentation of internal classes and interfaces
+/** @file spl.php
+ * @ingroup SPL
+ * @brief Documentation of internal classes and interfaces
*
* SPL - Standard PHP Library
*
- * (c) Marcus Boerger, 2003 - 2004
+ * (c) Marcus Boerger, 2003 - 2005
*/
-/** \mainpage SPL - Standard PHP Library
+/** @mainpage SPL - Standard PHP Library
*
* SPL - Standard PHP Library
*
+ * SPL is a collection of interfaces and classes that are meant to solve
+ * standard problems and implements some efficient data access interfaces
+ * and classes. You'll find the classes documented using php code in the
+ * file spl.php or in corresponding .inc files in subdirectories examples
+ * and internal. Based on the internal implementations or the files in the
+ * examples subdirectory there are also some .php files to experiment with.
+ *
+ * The .inc files are not included automatically because they are sooner or
+ * later integrated into the extension. That means that you either need to
+ * put the code of examples/autoload.inc into your autoprepend file or that
+ * you have to point your ini setting auto_prepend_file to that file.
+ *
+ * Below is a list of interfaces/classes already availabel natively through
+ * the SPL extension grouped by category.
+ *
+ * 1) Iterators
+ *
+ * SPL offers some advanced iterator algorithms:
+ *
+ * - interface RecursiveIterator implements Iterator
+ * - interface OuterIterator extends Iterator
+ * - class RecursiveIteratorIterator implements OuterIterator
+ * - abstract class FilterIterator implements OuterIterator
+ * - class ParentIterator extends FilterIterator implements RecursiveIterator
+ * - interface SeekableIterator implements Iterator
+ * - class LimitIterator implements OuterIterator
+ * - class CachingIterator implements OuterIterator
+ * - class RecursiveCachingIterator extends CachingIterator implements RecursiveIterator
+ * - class IteratorIterator implements OuterIterator
+ * - class NoRewindIterator implements OuterIterator
+ * - class EmptyIterator implements Iterator
+ * - class InfiniteIterator extends IteratorIterator
+ * - class AppendIterator implements OuterIterator
+ *
+ * 2) Directories and Files
+ *
+ * SPL offers two advanced directory and file handling classes:
+ *
+ * - class DirectoryIterator implements Iterator
+ * - class RecursiveDirectoryIterator extends DirectoryIterator implements RecursiveIterator
+ * - class SplFileObject implements RecursiveIterator, SeekableIterator
+ *
+ * 3) XML
+ *
+ * SPL offers an advanced XML handling class:
+ *
+ * - class SimpleXMLIterator extends simplexml_element implements RecursiveIterator
+ *
+ * 4) Array Overloading
+ *
+ * SPL offers advanced Array overloading:
+ *
+ * - class ArrayObject implements IteratorAggregate
+ * - class ArrayIterator implements Iterator
+ * - class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator
+ *
+ * As the above suggest an ArrayObject creates an ArrayIterator when it comes to
+ * iteration (e.g. ArrayObject instance used inside foreach).
+ *
+ * 5) Counting
+ *
+ * - interface Countable allows to hook into the standard array function count().
+ *
+ * 6) Exception%s
+ *
+ * SPL provides a set of standard Exception classes each meant to indicate a
+ * certain problem type.
+ *
+ * - class LogicException extends Exception
+ * - class BadFunctionCallException extends LogicException
+ * - class BadMethodCallException extends BadFunctionCallException
+ * - class DomainException extends LogicException
+ * - class InvalidArgumentException extends LogicException
+ * - class LengthException extends LogicException
+ * - class OutOfRangeException extends LogicException
+ * - class RuntimeException extends Exception
+ * - class OutOfBoundsException extends RuntimeException
+ * - class OverflowException extends RuntimeException
+ * - class RangeException extends RuntimeException
+ * - class UnderflowException extends RuntimeException
+ *
+ * 7) Observer
+ *
+ * SPL suggests a standard way of implementing the observer pattern.
+ *
+ * - interface SplObserver
+ * - interface SplSubject
+ * - class SplObjectStorage
+ *
+ * Some articles about SPL:
+ * - <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>
+ * - <a href="http://www.devshed.com/c/a/PHP/The-Standard-PHP-Library-Part-1/">The Standard PHP Library, Part 1</a>
+ * - <a href="http://www.devshed.com/c/a/PHP/The-Standard-PHP-Library-Part-2/">The Standard PHP Library, Part 2</a>
+ * - <a href="http://www.wiki.cc/php/SPL">SPL on PHP Wiki</a>
+ * - <a href="http://www.professionelle-softwareentwicklung-mit-php5.de/erste_auflage/oop.iterators.spl.html">Die Standard PHP Library (SPL) [german]</a>
+ *
+ * Talks on SPL:
+ * - SPL for the masses <a href="http://somabo.de/talks/200504_php_quebec_spl_for_the_masses.pps">[pps]</a>, <a href="http://somabo.de/talks/200504_php_quebec_spl_for_the_masses.pdf">[pdf]</a>
+ * - From engine overloading to SPL <a href="http://somabo.de/talks/200505_cancun_from_engine_overloading_to_spl.pps">[pps]</a>, <a href="http://somabo.de/talks/200505_cancun_from_engine_overloading_to_spl.pdf">[pdf]</a>
+ * - Happy SPLing <a href="http://somabo.de/talks/200509_toronto_happy_spling.pps">[pps]</a>, <a href="http://somabo.de/talks/200509_toronto_happy_spling.pdf">[pdf]</a>
+ * - Debug session 1 <a href="http://somabo.de/talks/200509_toronto_iterator_debug_session_1.pps">[pps]</a>, <a href="http://somabo.de/talks/200509_toronto_iterator_debug_session_1.pdf">[pdf]</a>
+ * - Debug session 2 <a href="http://somabo.de/talks/200509_toronto_iterator_debug_session_2.pps">[pps]</a>, <a href="http://somabo.de/talks/200509_toronto_iterator_debug_session_2.pdf">[pdf]</a>
+ *
* 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 - 2004
+ * (c) Marcus Boerger, 2003 - 2005
+ */
+
+/** @defgroup ZendEngine Zend engine classes
+ *
+ * The classes and interfaces in this group are contained in the c-code of
+ * PHP's Zend engine.
*/
-/** \defgroup SPL Internal classes
+/** @defgroup SPL Internal classes
*
* The classes and interfaces in this group are contained in the c-code of
* ext/SPL.
*/
-/** \defgroup Examples Example classes
+/** @defgroup Examples Example classes
*
* The classes and interfaces in this group are contained as PHP code in the
* examples subdirectory of ext/SPL. Sooner or later they will be moved to
* c-code.
*/
-/** \ingroup SPL
- * \brief Interface to override array access of objects.
+/** @ingroup SPL
+ * @brief Default implementation for __autoload()
+ * @since PHP 5.1
+ *
+ * @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);
+
+/** @ingroup SPL
+ * @brief Manual invocation of all registerd autoload functions
+ * @since PHP 5.1
+ *
+ * @param class_name name of class to load
+ */
+function spl_autoload_call(string $class_name);
+
+/** @ingroup SPL
+ * @brief Register and return default file extensions for spl_autoload
+ * @since PHP 5.1
+ *
+ * @param file_extensions optional comma separated list of extensions to use in
+ * default autoload function. If not given just return the current list.
+ * @return comma separated list of file extensions to use in default autoload
+ * function.
+ */
+function spl_autoload_extensions($file_extensions);
+
+/** @ingroup SPL
+ * @brief Return all registered autoload functionns
+ * @since PHP 5.1
+ *
+ * @return array of all registered autoload functions or false
+ */
+function spl_autoload_functions();
+
+/** @ingroup SPL
+ * @brief Register given function as autoload implementation
+ * @since PHP 5.1
+ *
+ * @param autoload_function name of function or array of object/class and
+ * 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);
+
+/** @ingroup SPL
+ * @brief Unregister given function as autoload implementation
+ * @since PHP 5.1
+ *
+ * @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");
+
+/** @ingroup SPL
+ * @brief Return an array of classes and interfaces in SPL
+ *
+ * @return array containing the names of all clsses and interfaces defined in
+ * extension SPL
+ */
+function spl_classes();
+
+/** @ingroup SPL
+ * @brief Count the elements in an iterator
+ * @since PHP 5.1
+ *
+ * @return number of elements in an iterator
+ */
+function iterator_count(Traversable $it);
+
+/** @ingroup SPL
+ * @brief Copy iterator elements into an array
+ * @since PHP 5.1
+ *
+ * @param it iterator to copy
+ * @return array with elements copied from the iterator
+ */
+function iterator_to_array(Traversable $it);
+
+/** @ingroup ZendEngine
+ * @brief Basic Exception class.
+ * @since PHP 5.0
+ */
+class Exception
+{
+ /** The exception message */
+ protected $message;
+
+ /** The string represenations as generated during construction */
+ private $string;
+
+ /** The code passed to the constructor */
+ protected $code;
+
+ /** The file name where the exception was instantiated */
+ protected $file;
+
+ /** The line number where the exception was instantiated */
+ protected $line;
+
+ /** The stack trace */
+ private $trace;
+
+ /** Prevent clone
+ */
+ final private function __clone() {}
+
+ /** Construct an exception
+ *
+ * @param $message Some text describing the exception
+ * @param $code Some code describing the exception
+ */
+ function __construct($message = NULL, $code = 0) {
+ if (func_num_args()) {
+ $this->message = $message;
+ }
+ $this->code = $code;
+ $this->file = __FILE__; // of throw clause
+ $this->line = __LINE__; // of throw clause
+ $this->trace = debug_backtrace();
+ $this->string = StringFormat($this);
+ }
+
+ /** @return the message passed to the constructor
+ */
+ final public function getMessage()
+ {
+ return $this->message;
+ }
+
+ /** @return the code passed to the constructor
+ */
+ final public function getCode()
+ {
+ return $this->code;
+ }
+
+ /** @return the name of the file where the exception was thrown
+ */
+ final public function getFile()
+ {
+ return $this->file;
+ }
+
+ /** @return the line number where the exception was thrown
+ */
+ final public function getLine()
+ {
+ return $this->line;
+ }
+
+ /** @return the stack trace as array
+ */
+ final public function getTrace()
+ {
+ return $this->trace;
+ }
+
+ /** @return the stack trace as string
+ */
+ final public function getTraceAsString()
+ {
+ }
+
+ /** @return string represenation of exception
+ */
+ public function __toString()
+ {
+ return $this->string;
+ }
+}
+
+/** @ingroup SPL
+ * @brief Exception that represents error in the program logic.
+ * @since PHP 5.1
+ *
+ * This kind of exceptions should directly leed to a fix in your code.
+ */
+class LogicException extends Exception
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown when a function call was illegal.
+ * @since PHP 5.1
+ */
+class BadFunctionCallException extends LogicException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown when a method call was illegal.
+ * @since PHP 5.1
+ */
+class BadMethodCallException extends BadFunctionCallException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception that denotes a value not in the valid domain was used.
+ * @since PHP 5.1
+ *
+ * This kind of exception should be used to inform about domain erors in
+ * mathematical sense.
+ *
+ * @see RangeException
+ */
+class DomainException extends LogicException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception that denotes invalid arguments were passed.
+ * @since PHP 5.1
+ *
+ * @see UnexpectedValueException
+ */
+class InvalidArgumentException extends LogicException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown when a parameter exceeds the allowed length.
+ * @since PHP 5.1
+ *
+ * This can be used for strings length, array size, file size, number of
+ * elements read from an Iterator and so on.
+ */
+class LengthException extends LogicException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown when an illegal index was requested.
+ * @since PHP 5.1
+ *
+ * This represents errors that should be detected at compile time.
+ *
+ * @see OutOfBoundsException
+ */
+class OutOfRangeException extends LogicException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown for errors that are only detectable at runtime.
+ * @since PHP 5.1
+ */
+class RuntimeException extends Exception
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown when an illegal index was requested.
+ * @since PHP 5.1
+ *
+ * This represents errors that cannot be detected at compile time.
+ *
+ * @see OutOfRangeException
+ */
+class OutOfBoundsException extends RuntimeException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown to indicate arithmetic/buffer overflow.
+ * @since PHP 5.1
+ */
+class OverflowException extends RuntimeException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown to indicate range errors during program execution.
+ * @since PHP 5.1
+ *
+ * Normally this means there was an arithmetic error other than under/overflow.
+ * This is the runtime version of DomainException.
+ *
+ * @see DomainException
+ */
+class RangeException extends RuntimeException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown to indicate arithmetic/buffer underflow.
+ * @since PHP 5.1
+ */
+class UnderflowException extends RuntimeException
+{
+}
+
+/** @ingroup SPL
+ * @brief Exception thrown to indicate an unexpected value.
+ * @since PHP 5.1
+ *
+ * Typically this happens when a function calls another function and espects
+ * the return value to be of a certain type or value not including arithmetic
+ * or buffer related errors.
+ *
+ * @see InvalidArgumentException
+ */
+class UnexpectedValueException extends RuntimeException
+{
+}
+
+/** @ingroup ZendEngine
+ * @brief Interface to override array access of objects.
+ * @since PHP 5.0
*/
interface ArrayAccess
{
- /** \param $offset to modify
- * \param $value new value
+ /** @param $offset to modify
+ * @param $value new value
*/
function offsetSet($offset, $value);
- /** \param $offset to retrieve
- * \return value at given offset
+ /** @param $offset to retrieve
+ * @return value at given offset
*/
function offsetGet($offset);
- /** \param $offset to delete
+ /** @param $offset to delete
*/
function offsetUnset($offset);
- /** \param $offset to check
- *\return whether the offset exists.
+ /** @param $offset to check
+ * @return whether the offset exists.
*/
function offsetExists($offset);
}
-/** \ingroup SPL
- * \brief Interface to detect a class is traversable using foreach.
+/** @ingroup ZendEngine
+ * @brief Interface to detect a class is traversable using foreach.
+ * @since PHP 5.0
*
* Abstract base interface that cannot be implemented alone. Instead it
* must be implemented by either IteratorAggregate or Iterator.
*
- * \note Internal classes that implement this interface can be used in a
+ * @note Internal classes that implement this interface can be used in a
* foreach construct and do not need to implement IteratorAggregate or
* Iterator.
*
- * \note This is an engine internal interface which cannot be implemented
+ * @note This is an engine internal interface which cannot be implemented
* in PHP scripts. Either IteratorAggregate or Iterator must be used
* instead.
*/
@@ -75,25 +496,27 @@ interface Traversable
{
}
-/** \ingroup SPL
- * \brief Interface to create an external Iterator.
+/** @ingroup ZendEngine
+ * @brief Interface to create an external Iterator.
+ * @since PHP 5.0
*
- * \note This is an engine internal interface.
+ * @note This is an engine internal interface.
*/
interface IteratorAggregate extends Traversable
{
- /** \return an Iterator for the implementing object.
+ /** @return an Iterator for the implementing object.
*/
function getIterator();
}
-/** \ingroup SPL
- * \brief Basic iterator
+/** @ingroup ZendEngine
+ * @brief Basic iterator
+ * @since PHP 5.0
*
* Interface for external iterators or objects that can be iterated
* themselves internally.
*
- * \note This is an engine internal interface.
+ * @note This is an engine internal interface.
*/
interface Iterator extends Traversable
{
@@ -118,118 +541,144 @@ interface Iterator extends Traversable
function valid();
}
-/** \ingroup SPL
- * \brief Recursive iterator
- *
- * Interface for recursive traversal to be used with
- * RecursiveIteratorIterator.
+/** @ingroup SPL
+ * @brief This Interface allows to hook into the global count() function.
+ * @since PHP 5.1
*/
-interface RecursiveIterator extends Iterator
+interface Countable
{
- /** \return whether current element can be iterated itself.
- */
- function hasChildren();
-
- /** \return an object that recursively iterates the current element.
- * This object must implement RecursiveIterator.
+ /** @return the number the global function count() should show
*/
- function getChildren();
+ function count();
}
-/** \ingroup SPL
- * \brief Class for recursive traversal.
- *
- * The objects of this class are created by instances of RecursiveIterator.
- * Elements of those iterators may be traversable themselves. If so these
- * sub elements are recursed into.
+/** @ingroup ZendEngine
+ * @brief Interface for customized serializing
+ * @since 5.1
+ *
+ * Classes that implement this interface no longer support __sleep() and
+ * __wakeup(). The method serialized is called whenever an instance needs to
+ * be serialized. This does not invoke __destruct() or has any other side
+ * effect unless programmed inside the method. When the data is unserialized
+ * the class is known and the appropriate unserialize() method is called as a
+ * constructor instead of calling __construct(). If you need to execute the
+ * standard constructor you may do so in the method.
*/
-class RecursiveIteratorIterator implements Iterator
+interface Serializable
{
- /** Construct an instance form a RecursiveIterator.
- *
- * \param $iterator inner root iterator
- * \param $mode one of
- * - RIT_LEAVES_ONLY do not return elements that can be recursed.
- * - RIT_SELF_FIRST show elements before their sub elements.
- * - RIT_CHILD_FIRST show elements after their sub elements.
- *
- * \note If you want to see only those elements which have sub elements then
- * use a ParentIterator.
+ /**
+ * @return string representation of the instance
*/
- function __construct(RecursiveIterator $iterator, $mode);
-
- /** \return the level of recursion (>=0).
- */
- function getDepth();
-
- /** \param $level the level of the sub iterator to return.
- * \return the current inner sub iterator or the iterator at the
- * specified $level.
+ function serialize();
+
+ /**
+ * @note This is a constructor
+ *
+ * @param $serialized data read from stream to construct the instance
*/
- function getSubIterator([$level]);
+ function unserialize($serialized);
}
-/** \ingroup SPL
- * \brief An Array wrapper
+/** @ingroup SPL
+ * @brief An Array wrapper
+ * @since PHP 5.0
+ * @version 1.1
*
* This array wrapper allows to recursively iterate over Arrays and public
* Object properties.
*
- * \see ArrayIterator
+ * @see ArrayIterator
*/
-class ArrayObject implements IteratorAggregate, ArrayAccess
+class ArrayObject implements IteratorAggregate, ArrayAccess, Countable
{
+ /** Properties of the object have their normal functionality
+ * when accessed as list (var_dump, foreach, etc.) */
+ const STD_PROP_LIST = 0x00000001;
+ /** Array indices can be accessed as properties in read/write */
+ const ARRAY_AS_PROPS = 0x00000002;
+
/** Construct a new array iterator from anything that has a hash table.
* That is any Array or Object.
*
- * \param $array the array to use.
+ * @param $array the array to use.
+ * @param $flags see setFlags().
+ * @param $iterator_class class used in getIterator()
+ */
+ function __construct($array, $flags = 0, $iterator_class = "ArrayIterator");
+
+ /** Set behavior flags.
+ *
+ * @param $flags bitmask as follows:
+ * 0 set: properties of the object have their normal functionality
+ * when accessed as list (var_dump, foreach, etc.)
+ * 1 set: array indices can be accessed as properties in read/write
*/
- function __construct($array);
+ function setFlags($flags);
+
+ /**
+ * @ return current flags
+ */
+ function getFlags();
+
+ /**
+ * @param $array new array or object
+ */
+ function exchangeArray($array);
- /** \return the iterator which is an ArrayIterator object connected to
+ /** @return the iterator which is an ArrayIterator object connected to
* this object.
*/
function getIterator();
- /** \param $index offset to inspect
- * \return whetehr offset $index esists
+ /** @param $index offset to inspect
+ * @return whetehr offset $index esists
*/
function offsetExists($index);
- /** \param $index offset to return value for
- * \return value at offset $index
+ /** @param $index offset to return value for
+ * @return value at offset $index
*/
function offsetGet($index);
- /** \param $index index to set
- * \param $newval new value to store at offset $index
+ /** @param $index index to set
+ * @param $newval new value to store at offset $index
*/
function offsetSet($index, $newval);
- /** \param $index offset to unset
+ /** @param $index offset to unset
*/
function offsetUnset($index);
- /** \param $value is appended as last element
- * \warning this method cannot be called when the ArrayObject refers to
+ /** @param $value is appended as last element
+ * @warning this method cannot be called when the ArrayObject refers to
* an object.
*/
function append($value);
- /** \return a \b copy of the array
- * \note when the ArrayObject refers to an object then this method
+ /** @return a \b copy of the array
+ * @note when the ArrayObject refers to an object then this method
* returns an array of the public properties.
*/
function getArrayCopy();
- /** \return the number of elements in the array or the number of public
+ /** @return the number of elements in the array or the number of public
* properties in the object.
*/
function count();
+
+ /* @param $iterator_class new class used in getIterator()
+ */
+ function setIteratorClass($itertor_class);
+
+ /* @return class used in getIterator()
+ */
+ function getIteratorClass();
}
-/** \ingroup SPL
- * \brief An Array iterator
+/** @ingroup SPL
+ * @brief An Array iterator
+ * @since PHP 5.0
+ * @version 1.1
*
* This iterator allows to unset and modify values and keys while iterating
* over Arrays and Objects.
@@ -239,311 +688,203 @@ class ArrayObject implements IteratorAggregate, ArrayAccess
* refer to it either by using foreach or by calling its getIterator()
* method manually.
*/
-class ArrayIterator implements Iterator, SeekableIterator, ArrayAccess
+class ArrayIterator implements SeekableIterator, ArrayAccess, Countable
{
+ /** Properties of the object have their normal functionality
+ * when accessed as list (var_dump, foreach, etc.) */
+ const STD_PROP_LIST = 0x00000001;
+ /** Array indices can be accessed as properties in read/write */
+ const ARRAY_AS_PROPS = 0x00000002;
+
/** Construct a new array iterator from anything that has a hash table.
* That is any Array or Object.
*
- * \param $array the array to use.
+ * @param $array the array to use.
+ * @param $flags see setFlags().
*/
- public function __construct($array);
+ function __construct($array, $flags = 0);
- /** \param $index offset to inspect
- * \return whetehr offset $index esists
+ /** Set behavior flags.
+ *
+ * @param $flags bitmask as follows:
+ * 0 set: properties of the object have their normal functionality
+ * when accessed as list (var_dump, foreach, etc.)
+ * 1 set: array indices can be accessed as properties in read/write
+ */
+ function setFlags($flags);
+
+ /**
+ * @ return current flags
+ */
+ function getFlags();
+
+ /** @param $index offset to inspect
+ * @return whetehr offset $index esists
*/
function offsetExists($index);
- /** \param $index offset to return value for
- * \return value at offset $index
+ /** @param $index offset to return value for
+ * @return value at offset $index
*/
function offsetGet($index);
- /** \param $index index to set
- * \param $newval new value to store at offset $index
+ /** @param $index index to set
+ * @param $newval new value to store at offset $index
*/
function offsetSet($index, $newval);
- /** \param $index offset to unset
+ /** @param $index offset to unset
*/
function offsetUnset($index);
- /** \param $value is appended as last element
- * \warning this method cannot be called when the ArrayIterator refers to
+ /** @param $value is appended as last element
+ * @warning this method cannot be called when the ArrayIterator refers to
* an object.
*/
function append($value);
- /** \return a \b copy of the array
- * \note when the ArrayIterator refers to an object then this method
+ /** @return a \b copy of the array
+ * @note when the ArrayIterator refers to an object then this method
* returns an array of the public properties.
*/
function getArrayCopy();
- /** \param $position offset to seek to
+ /** @param $position offset to seek to
+ * @throw OutOfBoundsException if $position is invalid
*/
function seek($position);
- /** \return the number of elements in the array or the number of public
+ /** @return the number of elements in the array or the number of public
* properties in the object.
*/
function count();
}
-/** \ingroup SPL
- * \brief An iterator that filters other iterators
- *
- * Iterator that wrapps around another iterator and only returns selected
- * elements of the inner iterator. The only thing that needs to be done to
- * make this work is implementing method accept(). Typically this invloves
- * reading the current element or key of the inner Iterator and checking
- * whether it is acceptable.
- */
-abstract class FilterIterator implements Iterator
-{
- /** Construct an instance form a Iterator.
- *
- * \param $iterator inner iterator
- */
- function __construct(Iterator $iterator);
-
- /** \return whether the current element of the inner iterator should be
- * used as a current element of this iterator or if it should be skipped.
- */
- abstract function accept();
-
- /** \return the inner Iterator
- */
- function getInnerIterator();
-}
-
-/** \ingroup SPL
- * \brief Seekable iterator
- *
- * This interface is used to optimize LimitIterator functionality. but it
- * may also be used for other situations where seeking a specific offset is
- * required and easily possible.
- */
-interface SeekableIterator extends Iterator
-{
- /** Seek to a specific position if available or throw an exception.
- * \param $position offset to seek to.
- */
- function seek($position);
-}
-
-/** \ingroup SPL
- * \brief Limiting iterator
- *
- * A class that starts iteration at a certain offset and only iterates over
- * a specified amount of elements.
- *
- * This class uses SeekableIterator::seek() if available and rewind() plus
- * a skip loop otehrwise.
- */
-class LimitIterator implements Iterator
-{
- /** Construct an instance form a Iterator.
- *
- * \param $iterator inner iterator
- * \param $offset starting position (zero based)
- * \param $count amount of elements returned, if available)
- */
- function __construct(Iterator $iterator, $offset = 0, $count = -1);
-
- /** \return whether the current element of the inner iterator should be
- * used as a current element of this iterator or if it should be skipped.
- */
- abstract function accept();
-
- /** \return the inner Iterator
- */
- function getInnerIterator();
-
- /** Seek to a specific position if available or throw an exception.
- * If the inner iterator is an instance of SeekableIterator its seek()
- * method will be used. Otherwise the iterator will be rewound if
- * necessary and then manually advanced element by element.
- *
- * \param $position index to seek to.
- */
- function seek($position);
-
- /** return the current position (zero based)
- */
- function getPosition();
-}
-
-/** \ingroup SPL
- * \brief Iterator that shows only parents
- *
- * A recursive iterator that only returns elements that themselves can be
- * trversed.
- */
-class ParentIterator extends FilterIterator implements RecursiveIterator
-{
- /** Construct an instance form a RecursiveIterator.
- *
- * \param $iterator inner iterator
- */
- function __construct(RecursiveIterator $iterator);
-}
-
-/** \ingroup SPL
- * \brief Caching iterator
- *
- * This Iterator allways reads one ahead. That allows it to know whether
- * more elements are available.
- */
-class CachingIterator implements Iterator
-{
- /** Construct an instance form a RecursiveIterator.
- *
- * \param $iterator inner iterator
- * \param $getStrVal whether to fetch the value returned by __toString()
- * or the (string) conversion. This is optional since
- * it is not always used nad takes an additional fcall.
- */
- function __construct(Iterator $iterator, $getStrVal = false);
-
- /** \return whether the inner iterator is valid. That is this iterator
- * is valid and has one more element.
- */
- function valid();
-
- /** \return The last value from the inner iterators __toString() or
- * (string) conversion. The value is only fetched when the __constructor
- * was called with $getStrVal = true.
- */
- function __tostring();
-
- /** \return the inner Iterator
- */
- function getInnerIterator();
-}
-
-/** \ingroup SPL
- * \brief The recursive version of the CachingIterator.
- */
-class CachingRecursiveIterator extends CachingIterator implements RecursiveIterator
-{
- /** Construct an instance form a RecursiveIterator.
- *
- * \param $iterator inner iterator
- * \param $getStrVal whether to fetch the value returned by __toString()
- * or the (string) conversion. This is optional since
- * it is not always used nad takes an additional fcall.
- */
- function __construct(RecursiveIterator $iterator, $getStrVal);
-}
-
-/** \ingroup SPL
- * \brief Directory iterator
+/** @ingroup SPL
+ * @brief Directory iterator
+ * @since PHP 5.0
*/
class DirectoryIterator implements Iterator
{
/** Construct a directory iterator from a path-string.
*
- * \param $path directory to iterate.
+ * @param $path directory to iterate.
*/
function __construct($path);
- /** \return The opened path.
+ /** @return The opened path.
*/
function getPath();
- /** \return The current file name.
+ /** @return The current file name.
*/
function getFilename();
- /** \return The current entries path and file name.
+ /** @return The current entries path and file name.
*/
function getPathname();
- /** \return The current entry's permissions.
+ /** @return The current entry's permissions.
*/
function getPerms();
- /** \return The current entry's inode.
+ /** @return The current entry's inode.
*/
function getInode();
- /** \return The current entry's size in bytes .
+ /** @return The current entry's size in bytes .
*/
function getSize();
- /** \return The current entry's owner name.
+ /** @return The current entry's owner name.
*/
function getOwner();
- /** \return The current entry's group name.
+ /** @return The current entry's group name.
*/
function getGroup();
- /** \return The current entry's last access time.
+ /** @return The current entry's last access time.
*/
function getATime();
- /** \return The current entry's last modification time.
+ /** @return The current entry's last modification time.
*/
function getMTime();
- /** \return The current entry's last change time.
+ /** @return The current entry's last change time.
*/
function getCTime();
- /** \return The current entry's size in bytes .
+ /** @return The current entry's size in bytes .
*/
function getType();
- /** \return Whether the current entry is writeable.
+ /** @return Whether the current entry is writeable.
*/
function isWritable();
- /** \return Whether the current entry is readable.
+ /** @return Whether the current entry is readable.
*/
function isReadable();
- /** \return Whether the current entry is executable.
+ /** @return Whether the current entry is executable.
*/
function isExecutable();
- /** \return Whether the current entry is .
+ /** @return Whether the current entry is .
*/
function isFile();
- /** \return Whether the current entry is a directory.
+ /** @return Whether the current entry is a directory.
*/
function isDir();
- /** \return Whether the current entry is either '.' or '..'.
+ /** @return Whether the current entry is either '.' or '..'.
*/
function isDot();
- /** \return whether the current entry is a link.
+ /** @return whether the current entry is a link.
*/
function isLink();
- /** \return getFilename()
+ /** @return getFilename()
*/
function __toString();
+
+ /** Open the current file as a SplFileObject instance
+ *
+ * @param mode open mode
+ * @param use_include_path whether to search include paths (don't use)
+ * @param context resource context to pased to open function
+ * @throw RuntimeException if file cannot be opened (e.g. insufficient
+ * access rights).
+ * @return The opened file as a SplFileObject instance
+ *
+ * @see SplFileObject
+ * @see file()
+ */
+ function DirectoryIterator::openFile($mode = 'r', $use_include_path = false, $context = NULL);
}
-/** \ingroup SPL
- * \brief recursive directory iterator
+/** @ingroup SPL
+ * @brief recursive directory iterator
+ * @since PHP 5.0
*/
class RecursiveDirectoryIterator extends DirectoryIterator implements RecursiveIterator
{
- /** \return whether the current is a directory (not '.' or '..').
+ /** @return whether the current is a directory (not '.' or '..').
*/
function hasChildren();
- /** \return a RecursiveDirectoryIterator for the current entry.
+ /** @return a RecursiveDirectoryIterator for the current entry.
*/
function getChildren();
}
-/** \ingroup SPL
- * \brief recursive SimpleXML_Element iterator
+/** @ingroup SPL
+ * @brief recursive SimpleXML_Element iterator
+ * @since PHP 5.0
*
* The SimpleXMLIterator implements the RecursiveIterator interface. This
* allows iteration over all elements using foreach or an appropriate while
@@ -554,13 +895,52 @@ class RecursiveDirectoryIterator extends DirectoryIterator implements RecursiveI
*/
class SimpleXMLIterator extends SimpleXMLElement implements RecursiveIterator
{
- /** \return whether the current node has sub nodes.
+ /** @return whether the current node has sub nodes.
*/
function hasChildren();
- /** \return a SimpleXMLIterator for the current node.
+ /** @return a SimpleXMLIterator for the current node.
*/
function getChildren();
}
+/** @ingroup SPL
+ * @brief Observer of the observer pattern
+ * @since PHP 5.1
+ *
+ * For a detailed explanation see Observer pattern in
+ * <em>
+ * Gamma, Helm, Johnson, Vlissides<br />
+ * Design Patterns
+ * </em>
+ */
+interface SplObserver
+{
+ /** Called from the subject (i.e. when it's value has changed).
+ * @param $subject the callee
+ */
+ function update(SplSubject $subject);
+}
+
+/** @ingroup SPL
+ * @brief Subject to the observer pattern
+ * @since PHP 5.1
+ * @see Observer
+ */
+interface SplSubject
+{
+ /** @param $observer new observer to attach
+ */
+ function attach(SplObserver $observer);
+
+ /** @param $observer existing observer to detach
+ * @note a non attached observer shouldn't result in a warning or similar
+ */
+ function detach(SplObserver $observer);
+
+ /** Notify all observers
+ */
+ function notify();
+}
+
?>
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 189677b2e..7ef1fd1a9 100755
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_array.c,v 1.49.2.7 2005/03/21 20:13:54 helly Exp $ */
+/* $Id: spl_array.c,v 1.71.2.6 2005/11/14 22:03:01 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -33,103 +33,53 @@
#include "spl_engine.h"
#include "spl_iterators.h"
#include "spl_array.h"
-
-SPL_METHOD(Array, __construct);
-SPL_METHOD(Array, getIterator);
-SPL_METHOD(Array, rewind);
-SPL_METHOD(Array, current);
-SPL_METHOD(Array, key);
-SPL_METHOD(Array, next);
-SPL_METHOD(Array, valid);
-SPL_METHOD(Array, offsetExists);
-SPL_METHOD(Array, offsetGet);
-SPL_METHOD(Array, offsetSet);
-SPL_METHOD(Array, offsetUnset);
-SPL_METHOD(Array, append);
-SPL_METHOD(Array, getArrayCopy);
-SPL_METHOD(Array, seek);
-SPL_METHOD(Array, count);
-
-static
-ZEND_BEGIN_ARG_INFO(arginfo_array___construct, 0)
- ZEND_ARG_INFO(0, array)
-ZEND_END_ARG_INFO();
-
-static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_array_offsetGet, 0, 0, 1)
- ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO();
-
-static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_array_offsetSet, 0, 0, 2)
- ZEND_ARG_INFO(0, index)
- ZEND_ARG_INFO(0, newval)
-ZEND_END_ARG_INFO();
-
-static
-ZEND_BEGIN_ARG_INFO(arginfo_array_append, 0)
- ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO();
-
-static
-ZEND_BEGIN_ARG_INFO(arginfo_array_seek, 0)
- ZEND_ARG_INFO(0, position)
-ZEND_END_ARG_INFO();
-
-static zend_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)
- /* ArrayObject specific */
- SPL_ME(Array, getIterator, NULL, ZEND_ACC_PUBLIC)
- {NULL, NULL, NULL}
-};
-
-static zend_function_entry spl_funcs_ArrayIterator[] = {
- SPL_ME(Array, __construct, arginfo_array___construct, ZEND_ACC_PUBLIC)
- SPL_ME(Array, offsetExists, arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
- SPL_ME(Array, offsetGet, arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
- SPL_ME(Array, offsetSet, arginfo_array_offsetSet, ZEND_ACC_PUBLIC)
- SPL_ME(Array, offsetUnset, arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
- SPL_ME(Array, append, arginfo_array_append, ZEND_ACC_PUBLIC)
- SPL_ME(Array, getArrayCopy, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(Array, count, NULL, ZEND_ACC_PUBLIC)
- /* ArrayIterator specific */
- SPL_ME(Array, rewind, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(Array, current, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(Array, key, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(Array, next, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(Array, valid, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(Array, seek, arginfo_array_seek, ZEND_ACC_PUBLIC)
- {NULL, NULL, NULL}
-};
-
+#include "spl_exceptions.h"
zend_object_handlers spl_handler_ArrayObject;
PHPAPI zend_class_entry *spl_ce_ArrayObject;
zend_object_handlers spl_handler_ArrayIterator;
-PHPAPI zend_class_entry *spl_ce_ArrayIterator;
+PHPAPI zend_class_entry *spl_ce_ArrayIterator;
+PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator;
+
+PHPAPI zend_class_entry *spl_ce_Countable;
+
+#define SPL_ARRAY_STD_PROP_LIST 0x00000001
+#define SPL_ARRAY_ARRAY_AS_PROPS 0x00000002
+#define SPL_ARRAY_IS_REF 0x01000000
+#define SPL_ARRAY_IS_SELF 0x02000000
+#define SPL_ARRAY_USE_OTHER 0x04000000
+#define SPL_ARRAY_INT_MASK 0xFF000000
+#define SPL_ARRAY_CLONE_MASK 0x03000007
typedef struct _spl_array_object {
zend_object std;
zval *array;
+ zval *retval;
HashPosition pos;
- int is_ref;
+ int ar_flags;
+ int is_self;
zend_function * fptr_offset_get;
zend_function * fptr_offset_set;
zend_function * fptr_offset_has;
zend_function * fptr_offset_del;
+ zend_class_entry* ce_get_iterator;
} spl_array_object;
+static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int check_std_props TSRMLS_DC) {
+ if ((intern->ar_flags & SPL_ARRAY_USE_OTHER) && (check_std_props == 0 || (intern->ar_flags & SPL_ARRAY_STD_PROP_LIST) == 0)) {
+ spl_array_object *other = (spl_array_object*)zend_object_store_get_object(intern->array TSRMLS_CC);
+ return spl_array_get_hash_table(other, check_std_props TSRMLS_CC);
+ } else if ((intern->ar_flags & ((check_std_props ? SPL_ARRAY_STD_PROP_LIST : 0) | SPL_ARRAY_IS_SELF)) != 0) {
+ return intern->std.properties;
+ } else {
+ return HASH_OF(intern->array);
+ }
+}
+
SPL_API int spl_hash_verify_pos(spl_array_object * intern TSRMLS_DC) /* {{{ */
{
- HashTable *ht = HASH_OF(intern->array);
+ HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
Bucket *p;
/* IS_CONSISTENT(ht);*/
@@ -143,7 +93,7 @@ SPL_API int spl_hash_verify_pos(spl_array_object * intern TSRMLS_DC) /* {{{ */
p = p->pListNext;
}
/* HASH_UNPROTECT_RECURSION(ht); */
- zend_hash_internal_pointer_reset_ex(HASH_OF(intern->array), &intern->pos);
+ zend_hash_internal_pointer_reset_ex(spl_array_get_hash_table(intern, 0 TSRMLS_CC), &intern->pos);
return FAILURE;
}
/* }}} */
@@ -157,13 +107,14 @@ static void spl_array_object_free_storage(void *object TSRMLS_DC)
FREE_HASHTABLE(intern->std.properties);
zval_ptr_dtor(&intern->array);
+ zval_ptr_dtor(&intern->retval);
efree(object);
}
/* }}} */
/* {{{ spl_array_object_new */
-static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, spl_array_object **obj, spl_array_object *orig TSRMLS_DC)
+static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, spl_array_object **obj, zval *orig TSRMLS_DC)
{
zend_object_value retval;
spl_array_object *intern;
@@ -175,23 +126,27 @@ static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, s
memset(intern, 0, sizeof(spl_array_object));
intern->std.ce = class_type;
*obj = intern;
+ ALLOC_INIT_ZVAL(intern->retval);
ALLOC_HASHTABLE(intern->std.properties);
zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+ intern->ar_flags = 0;
if (orig) {
- intern->array = orig->array;
+ spl_array_object *other = (spl_array_object*)zend_object_store_get_object(orig TSRMLS_CC);
+
+ intern->array = orig;
ZVAL_ADDREF(intern->array);
- intern->is_ref = 1;
+ intern->ar_flags &= ~ SPL_ARRAY_CLONE_MASK;
+ intern->ar_flags |= (other->ar_flags & SPL_ARRAY_CLONE_MASK) | SPL_ARRAY_IS_REF | SPL_ARRAY_USE_OTHER;
} else {
MAKE_STD_ZVAL(intern->array);
array_init(intern->array);
- intern->is_ref = 0;
+ intern->ar_flags &= ~SPL_ARRAY_IS_REF;
}
- zend_hash_internal_pointer_reset_ex(HASH_OF(intern->array), &intern->pos);
- retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_array_object_free_storage, NULL TSRMLS_CC);
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) spl_array_object_free_storage, NULL TSRMLS_CC);
while (parent) {
if (parent == spl_ce_ArrayIterator) {
retval.handlers = &spl_handler_ArrayIterator;
@@ -224,6 +179,8 @@ 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;
+ zend_hash_internal_pointer_reset_ex(spl_array_get_hash_table(intern, 0 TSRMLS_CC), &intern->pos);
return retval;
}
/* }}} */
@@ -246,7 +203,7 @@ static zend_object_value spl_array_object_clone(zval *zobject TSRMLS_DC)
spl_array_object *intern;
old_object = zend_objects_get_address(zobject TSRMLS_CC);
- new_obj_val = spl_array_object_new_ex(old_object->ce, &intern, (spl_array_object*)old_object TSRMLS_CC);
+ new_obj_val = spl_array_object_new_ex(old_object->ce, &intern, zobject TSRMLS_CC);
new_object = &intern->std;
zend_objects_clone_members(new_object, new_obj_val, old_object, handle TSRMLS_CC);
@@ -255,23 +212,24 @@ static zend_object_value spl_array_object_clone(zval *zobject TSRMLS_DC)
}
/* }}} */
-static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
+static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
- zval **retval, *rv;
+ zval **retval;
long index;
+/* We cannot get the pointer pointer so we don't allow it here for now
if (check_inherited && intern->fptr_offset_get) {
- return zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", &rv, offset);
- }
+ return zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", NULL, offset);
+ }*/
switch(Z_TYPE_P(offset)) {
case IS_STRING:
- if (zend_symtable_find(HASH_OF(intern->array), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) == FAILURE) {
+ if (zend_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) == FAILURE) {
zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset));
- return EG(uninitialized_zval_ptr);
+ return &EG(uninitialized_zval_ptr);
} else {
- return *retval;
+ return retval;
}
case IS_DOUBLE:
case IS_RESOURCE:
@@ -282,17 +240,33 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval
} else {
index = Z_LVAL_P(offset);
}
- if (zend_hash_index_find(HASH_OF(intern->array), index, (void **) &retval) == FAILURE) {
+ if (zend_hash_index_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), index, (void **) &retval) == FAILURE) {
zend_error(E_NOTICE, "Undefined offset: %ld", Z_LVAL_P(offset));
- return EG(uninitialized_zval_ptr);
+ return &EG(uninitialized_zval_ptr);
} else {
- return *retval;
+ return retval;
}
break;
default:
zend_error(E_WARNING, "Illegal offset type");
- return EG(uninitialized_zval_ptr);
+ return &EG(uninitialized_zval_ptr);
+ }
+} /* }}} */
+
+static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
+{
+ if (check_inherited) {
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+ if (intern->fptr_offset_get) {
+ zval *rv;
+ zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", &rv, offset);
+ zval_ptr_dtor(&intern->retval);
+ MAKE_STD_ZVAL(intern->retval);
+ ZVAL_ZVAL(intern->retval, rv, 1, 1);
+ return intern->retval;
+ }
}
+ return *spl_array_get_dimension_ptr_ptr(check_inherited, object, offset, type TSRMLS_CC);
} /* }}} */
static zval *spl_array_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
@@ -304,22 +278,35 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
long index;
- zval *rv;
+ int free_offset;
if (check_inherited && intern->fptr_offset_set) {
- zend_call_method_with_2_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_set, "offsetSet", &rv, offset, value);
+ if (!offset) {
+ ALLOC_INIT_ZVAL(offset);
+ free_offset = 1;
+ } else {
+ free_offset = 0;
+ }
+ zend_call_method_with_2_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_set, "offsetSet", NULL, offset, value);
+ if (free_offset) {
+ zval_ptr_dtor(&offset);
+ }
return;
}
-
+
if (!offset) {
value->refcount++;
- zend_hash_next_index_insert(HASH_OF(intern->array), (void**)&value, sizeof(void*), NULL);
+ zend_hash_next_index_insert(spl_array_get_hash_table(intern, 0 TSRMLS_CC), (void**)&value, sizeof(void*), NULL);
return;
}
switch(Z_TYPE_P(offset)) {
case IS_STRING:
+ if (*Z_STRVAL_P(offset) == '\0') {
+ zend_throw_exception(spl_ce_InvalidArgumentException, "An offset must not begin with \\0 or be empty", 0 TSRMLS_CC);
+ return;
+ }
value->refcount++;
- zend_symtable_update(HASH_OF(intern->array), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL);
+ zend_symtable_update(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL);
return;
case IS_DOUBLE:
case IS_RESOURCE:
@@ -331,7 +318,11 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
index = Z_LVAL_P(offset);
}
value->refcount++;
- zend_hash_index_update(HASH_OF(intern->array), index, (void**)&value, sizeof(void*), NULL);
+ zend_hash_index_update(spl_array_get_hash_table(intern, 0 TSRMLS_CC), index, (void**)&value, sizeof(void*), NULL);
+ return;
+ case IS_NULL:
+ value->refcount++;
+ zend_hash_next_index_insert(spl_array_get_hash_table(intern, 0 TSRMLS_CC), (void**)&value, sizeof(void*), NULL);
return;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -348,22 +339,22 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
long index;
- zval *rv;
if (check_inherited && intern->fptr_offset_del) {
- zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_del, "offsetUnset", &rv, offset);
+ zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_del, "offsetUnset", NULL, offset);
return;
}
switch(Z_TYPE_P(offset)) {
case IS_STRING:
-
-
-
-
-
- if (zend_symtable_del(HASH_OF(intern->array), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1) == FAILURE) {
- zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ if (spl_array_get_hash_table(intern, 0 TSRMLS_CC) == &EG(symbol_table)) {
+ if (zend_delete_global_variable(Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC)) {
+ zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ }
+ } else {
+ if (zend_symtable_del(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1) == FAILURE) {
+ zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ }
}
break;
case IS_DOUBLE:
@@ -375,7 +366,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
} else {
index = Z_LVAL_P(offset);
}
- if (zend_hash_index_del(HASH_OF(intern->array), index) == FAILURE) {
+ if (zend_hash_index_del(spl_array_get_hash_table(intern, 0 TSRMLS_CC), index) == FAILURE) {
zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset));
}
break;
@@ -406,10 +397,10 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
zval_ptr_dtor(&rv);
return 0;
}
-
+
switch(Z_TYPE_P(offset)) {
case IS_STRING:
- return zend_symtable_exists(HASH_OF(intern->array), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
+ return zend_symtable_exists(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
case IS_DOUBLE:
case IS_RESOURCE:
case IS_BOOL:
@@ -419,7 +410,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
} else {
index = Z_LVAL_P(offset);
}
- return zend_hash_index_exists(HASH_OF(intern->array), index);
+ return zend_hash_index_exists(spl_array_get_hash_table(intern, 0 TSRMLS_CC), index);
default:
zend_error(E_WARNING, "Illegal offset type");
}
@@ -461,7 +452,7 @@ SPL_METHOD(Array, offsetGet)
Sets the value at the specified $index to $newval. */
SPL_METHOD(Array, offsetSet)
{
- zval *index, *value = NULL;
+ zval *index, *value;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &index, &value) == FAILURE) {
return;
}
@@ -472,7 +463,7 @@ SPL_METHOD(Array, offsetSet)
void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (!aht) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
@@ -523,24 +514,84 @@ SPL_METHOD(Array, getArrayCopy)
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
array_init(return_value);
- zend_hash_copy(HASH_OF(return_value), HASH_OF(intern->array), (copy_ctor_func_t) zval_add_ref, &tmp, sizeof(zval*));
+ zend_hash_copy(HASH_OF(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC), (copy_ctor_func_t) zval_add_ref, &tmp, sizeof(zval*));
} /* }}} */
-/* {{{ spl_array_get_properties */
-static HashTable *spl_array_get_properties(zval *object TSRMLS_DC)
+static HashTable *spl_array_get_properties(zval *object TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
- return HASH_OF(intern->array);
-}
-/* }}} */
+ return spl_array_get_hash_table(intern, 1 TSRMLS_CC);
+} /* }}} */
+
+static zval *spl_array_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */
+{
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
+ && !std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) {
+ return spl_array_read_dimension(object, member, type TSRMLS_CC);
+ }
+ return std_object_handlers.read_property(object, member, type TSRMLS_CC);
+} /* }}} */
+
+static void spl_array_write_property(zval *object, zval *member, zval *value TSRMLS_DC) /* {{{ */
+{
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
+ && !std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) {
+ spl_array_write_dimension(object, member, value TSRMLS_CC);
+ return;
+ }
+ std_object_handlers.write_property(object, member, value TSRMLS_CC);
+} /* }}} */
+
+static zval **spl_array_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) /* {{{ */
+{
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
+ && !std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) {
+ return spl_array_get_dimension_ptr_ptr(1, object, member, 0 TSRMLS_CC);
+ }
+ return std_object_handlers.get_property_ptr_ptr(object, member TSRMLS_CC);
+} /* }}} */
+
+static int spl_array_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) /* {{{ */
+{
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0) {
+ if (!std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) {
+ return spl_array_has_dimension(object, member, has_set_exists TSRMLS_CC);
+ }
+ return 0; /* if prop doesn't exist at all mode 0/1 cannot return 1 */
+ }
+ return std_object_handlers.has_property(object, member, has_set_exists TSRMLS_CC);
+} /* }}} */
+
+static void spl_array_rewind(spl_array_object *intern TSRMLS_DC);
+
+static void spl_array_unset_property(zval *object, zval *member TSRMLS_DC) /* {{{ */
+{
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
+ && !std_object_handlers.has_property(object, member, 2 TSRMLS_CC)) {
+ spl_array_unset_dimension(object, member TSRMLS_CC);
+ spl_array_rewind(intern TSRMLS_CC); /* because deletion might invalidate position */
+ return;
+ }
+ std_object_handlers.unset_property(object, member TSRMLS_CC);
+} /* }}} */
static int spl_array_skip_protected(spl_array_object *intern TSRMLS_DC) /* {{{ */
{
char *string_key;
uint string_length;
ulong num_key;
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (Z_TYPE_P(intern->array) == IS_OBJECT) {
do {
@@ -563,9 +614,9 @@ static int spl_array_skip_protected(spl_array_object *intern TSRMLS_DC) /* {{{ *
static int spl_array_next(spl_array_object *intern TSRMLS_DC) /* {{{ */
{
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
- if (intern->is_ref && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
+ if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
return FAILURE;
} else {
@@ -598,14 +649,14 @@ static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
{
spl_array_it *iterator = (spl_array_it *)iter;
spl_array_object *object = iterator->object;
- HashTable *aht = HASH_OF(object->array);
+ 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->is_ref && spl_hash_verify_pos(object TSRMLS_CC) == 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 {
@@ -618,7 +669,7 @@ 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 = HASH_OF(object->array);
+ 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;
@@ -630,14 +681,14 @@ static int spl_array_it_get_current_key(zend_object_iterator *iter, char **str_k
{
spl_array_it *iterator = (spl_array_it *)iter;
spl_array_object *object = iterator->object;
- HashTable *aht = HASH_OF(object->array);
+ 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->is_ref && spl_hash_verify_pos(object TSRMLS_CC) == FAILURE) {
+ 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;
}
@@ -651,14 +702,14 @@ static void spl_array_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {
spl_array_it *iterator = (spl_array_it *)iter;
spl_array_object *object = iterator->object;
- HashTable *aht = HASH_OF(object->array);
+ 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->is_ref && spl_hash_verify_pos(object TSRMLS_CC) == FAILURE) {
+ 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);
@@ -668,7 +719,7 @@ static void spl_array_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {
static void spl_array_rewind(spl_array_object *intern TSRMLS_DC) /* {{{ */
{
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (!aht) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::rewind(): Array was modified outside object and is no longer an array");
@@ -713,45 +764,183 @@ zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object
}
/* }}} */
-/* {{{ proto void ArrayObject::__construct(array|object ar = array())
- proto void ArrayIterator::__construct(array|object ar = array())
+/* {{{ proto void ArrayObject::__construct(array|object ar = array() [, int flags = 0 [, string iterator_class = "ArrayIterator"]])
+ proto void ArrayIterator::__construct(array|object ar = array() [, int flags = 0])
Cronstructs a new array iterator from a path. */
SPL_METHOD(Array, __construct)
{
zval *object = getThis();
spl_array_object *intern;
- zval **array;
+ zval *array;
+ long ar_flags = 0;
+ char *class_name;
+ int class_name_len;
+ zend_class_entry ** pce_get_iterator;
if (ZEND_NUM_ARGS() == 0) {
return; /* nothing to do */
}
- php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);
+ php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC);
intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ls", &array, &ar_flags, &class_name, &class_name_len) == FAILURE) {
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return;
+ }
+
+ if (ZEND_NUM_ARGS() > 2) {
+ if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) {
+ zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC);
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return;
+ }
+ intern->ce_get_iterator = *pce_get_iterator;
+ }
+
+ ar_flags &= ~SPL_ARRAY_INT_MASK;
+
+ if (Z_TYPE_P(array) == IS_OBJECT && (Z_OBJ_HT_P(array) == &spl_handler_ArrayObject || Z_OBJ_HT_P(array) == &spl_handler_ArrayIterator)) {
+ zval_ptr_dtor(&intern->array);
+ if (ZEND_NUM_ARGS() == 1)
+ {
+ spl_array_object *other = (spl_array_object*)zend_object_store_get_object(array TSRMLS_CC);
+ ar_flags = other->ar_flags & ~SPL_ARRAY_INT_MASK;
+ }
+ ar_flags |= SPL_ARRAY_USE_OTHER;
+ intern->array = array;
+ } else {
+ if (Z_TYPE_P(array) != IS_OBJECT && Z_TYPE_P(array) != IS_ARRAY) {
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC);
+ return;
+ }
+ zval_ptr_dtor(&intern->array);
+ intern->array = array;
+ }
+ if (object == array) {
+ intern->ar_flags |= SPL_ARRAY_IS_SELF;
+ } else {
+ intern->ar_flags &= ~SPL_ARRAY_IS_SELF;
+ }
+ intern->ar_flags |= ar_flags;
+ ZVAL_ADDREF(intern->array);
+ if (Z_TYPE_P(array) == IS_OBJECT) {
+ zend_object_get_properties_t handler = Z_OBJ_HANDLER_P(array, get_properties);
+ if ((handler != std_object_handlers.get_properties && handler != spl_array_get_properties)
+ || !spl_array_get_hash_table(intern, 0 TSRMLS_CC)) {
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name);
+ return;
+ }
+ }
+
+ spl_array_rewind(intern TSRMLS_CC);
+
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto void ArrayObject::setIteratorClass(string iterator_class)
+ Set the class used in getIterator. */
+SPL_METHOD(Array, setIteratorClass)
+{
+ zval *object = getThis();
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+ char *class_name;
+ int class_name_len;
+ zend_class_entry ** pce_get_iterator;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &class_name, &class_name_len) == FAILURE) {
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return;
+ }
+
+ if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) {
+ zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC);
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return;
+ }
+ intern->ce_get_iterator = *pce_get_iterator;
+}
+/* }}} */
+
+/* {{{ proto string ArrayObject::getIteratorClass()
+ Get the class used in getIterator. */
+SPL_METHOD(Array, getIteratorClass)
+{
+ zval *object = getThis();
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ RETURN_STRING(intern->ce_get_iterator->name, 1);
+}
+/* }}} */
+
+/* {{{ proto int ArrayObject::getFlags()
+ Get flags */
+SPL_METHOD(Array, getFlags)
+{
+ zval *object = getThis();
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ RETURN_LONG(intern->ar_flags & ~SPL_ARRAY_INT_MASK);
+}
+/* }}} */
+
+/* {{{ proto void ArrayObject::setFlags(int flags)
+ Set flags */
+SPL_METHOD(Array, setFlags)
+{
+ zval *object = getThis();
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+ long ar_flags = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ar_flags) == FAILURE) {
+ return;
+ }
+
+ intern->ar_flags = (intern->ar_flags & SPL_ARRAY_INT_MASK) | (ar_flags & ~SPL_ARRAY_INT_MASK);
+}
+/* }}} */
+
+/* {{{ proto Array|Object ArrayObject::exchangeArray(Array|Object ar = array())
+ Replace the referenced array or object with a new one and return the old one (right now copy - to be changed) */
+SPL_METHOD(Array, exchangeArray)
+{
+ zval *object = getThis(), *tmp, **array;
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ array_init(return_value);
+ zend_hash_copy(HASH_OF(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC), (copy_ctor_func_t) zval_add_ref, &tmp, sizeof(zval*));
+
if (ZEND_NUM_ARGS() > 1 || zend_get_parameters_ex(1, &array) == FAILURE) {
WRONG_PARAM_COUNT;
}
- if (Z_TYPE_PP(array) == IS_OBJECT && (Z_OBJ_HT_PP(array) == &spl_handler_ArrayObject || Z_OBJ_HT_PP(array) == &spl_handler_ArrayIterator)) {
+ if (Z_TYPE_PP(array) == IS_OBJECT && intern == (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC))
+ {
+ zval_ptr_dtor(&intern->array);
+ array = &object;
+ intern->array = object;
+ } else if (Z_TYPE_PP(array) == IS_OBJECT && (Z_OBJ_HT_PP(array) == &spl_handler_ArrayObject || Z_OBJ_HT_PP(array) == &spl_handler_ArrayIterator)) {
spl_array_object *other = (spl_array_object*)zend_object_store_get_object(*array TSRMLS_CC);
- zval_dtor(intern->array);
- FREE_ZVAL(intern->array);
- intern->array = other->array;
+ zval_ptr_dtor(&intern->array);
+ intern->array = other->array;
} else {
- if (!HASH_OF(*array)) {
- php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
- zend_throw_exception(zend_exception_get_default(), "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC);
+ if (Z_TYPE_PP(array) != IS_OBJECT && !HASH_OF(*array)) {
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC);
return;
}
- zval_dtor(intern->array);
- FREE_ZVAL(intern->array);
+ zval_ptr_dtor(&intern->array);
intern->array = *array;
}
+ if (object == *array) {
+ intern->ar_flags |= SPL_ARRAY_IS_SELF;
+ } else {
+ intern->ar_flags &= ~SPL_ARRAY_IS_SELF;
+ }
ZVAL_ADDREF(intern->array);
- zend_hash_internal_pointer_reset_ex(HASH_OF(intern->array), &intern->pos);
-
- php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ spl_array_rewind(intern TSRMLS_CC);
}
/* }}} */
@@ -762,7 +951,7 @@ SPL_METHOD(Array, getIterator)
zval *object = getThis();
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
spl_array_object *iterator;
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (!aht) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
@@ -770,7 +959,7 @@ SPL_METHOD(Array, getIterator)
}
return_value->type = IS_OBJECT;
- return_value->value.obj = spl_array_object_new_ex(spl_ce_ArrayIterator, &iterator, intern TSRMLS_CC);
+ return_value->value.obj = spl_array_object_new_ex(intern->ce_get_iterator, &iterator, object TSRMLS_CC);
return_value->refcount = 1;
return_value->is_ref = 1;
}
@@ -794,7 +983,7 @@ SPL_METHOD(Array, seek)
long opos, position;
zval *object = getThis();
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
int result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) {
@@ -813,7 +1002,7 @@ SPL_METHOD(Array, seek)
while (position-- > 0 && (result = spl_array_next(intern TSRMLS_CC)) == SUCCESS);
- if (intern->pos && intern->is_ref && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
+ if (intern->pos && (intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
/* fail */
} else {
if (zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS) {
@@ -821,13 +1010,13 @@ SPL_METHOD(Array, seek)
}
}
}
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Seek position %ld is out of range", opos);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Seek position %ld is out of range", opos);
} /* }}} */
int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
HashPosition pos;
if (!aht) {
@@ -871,14 +1060,14 @@ SPL_METHOD(Array, current)
zval *object = getThis();
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
zval **entry;
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (!aht) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
- if (intern->is_ref && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
+ if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
return;
}
@@ -899,14 +1088,14 @@ SPL_METHOD(Array, key)
char *string_key;
uint string_length;
ulong num_key;
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (!aht) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
- if (intern->is_ref && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
+ if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
return;
}
@@ -930,7 +1119,7 @@ SPL_METHOD(Array, next)
{
zval *object = getThis();
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (!aht) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
@@ -947,14 +1136,14 @@ SPL_METHOD(Array, valid)
{
zval *object = getThis();
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
- HashTable *aht = HASH_OF(intern->array);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (!aht) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
- if (intern->pos && intern->is_ref && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
+ if (intern->pos && (intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
RETURN_FALSE;
} else {
@@ -963,28 +1152,195 @@ SPL_METHOD(Array, valid)
}
/* }}} */
+/* {{{ proto bool RecursiveArrayIterator::hasChildren()
+ Check whether current element has children (e.g. is an array) */
+SPL_METHOD(Array, hasChildren)
+{
+ zval *object = getThis(), **entry;
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+
+ if (!aht) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ RETURN_FALSE;
+ }
+
+ if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
+ RETURN_FALSE;
+ }
+
+ if (zend_hash_get_current_data_ex(aht, (void **) &entry, &intern->pos) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ RETURN_BOOL(Z_TYPE_PP(entry) == IS_ARRAY || Z_TYPE_PP(entry) == IS_OBJECT);
+}
+/* }}} */
+
+/* {{{ proto object RecursiveArrayIterator::getChildren()
+ Create a sub iterator for the current element (same class as $this) */
+SPL_METHOD(Array, getChildren)
+{
+ zval *object = getThis(), **entry;
+ spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+
+ if (!aht) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ return;
+ }
+
+ if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
+ return;
+ }
+
+ if (zend_hash_get_current_data_ex(aht, (void **) &entry, &intern->pos) == FAILURE) {
+ return;
+ }
+
+ if (Z_TYPE_PP(entry) == IS_OBJECT && instanceof_function(Z_OBJCE_PP(entry), Z_OBJCE_P(getThis()) TSRMLS_CC)) {
+ RETURN_ZVAL(*entry, 0, 0);
+ }
+
+ spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), &return_value, 0, *entry TSRMLS_CC);
+}
+/* }}} */
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array___construct, 0)
+ ZEND_ARG_INFO(0, array)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_offsetGet, 0, 0, 1)
+ ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_offsetSet, 0, 0, 2)
+ ZEND_ARG_INFO(0, index)
+ ZEND_ARG_INFO(0, newval)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_append, 0)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_seek, 0)
+ ZEND_ARG_INFO(0, position)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_exchangeArray, 0)
+ ZEND_ARG_INFO(0, array)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_setFlags, 0)
+ ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_setIteratorClass, 0)
+ ZEND_ARG_INFO(0, iteratorClass)
+ZEND_END_ARG_INFO();
+
+static zend_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)
+ /* ArrayObject specific */
+ SPL_ME(Array, getIterator, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, exchangeArray, arginfo_array_exchangeArray, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, setIteratorClass, arginfo_array_setIteratorClass, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, getIteratorClass, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+static zend_function_entry spl_funcs_ArrayIterator[] = {
+ SPL_ME(Array, __construct, arginfo_array___construct, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, offsetExists, arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, offsetGet, arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, offsetSet, arginfo_array_offsetSet, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, offsetUnset, arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, append, arginfo_array_append, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, getArrayCopy, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, count, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, getFlags, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, setFlags, arginfo_array_setFlags, ZEND_ACC_PUBLIC)
+ /* ArrayIterator specific */
+ SPL_ME(Array, rewind, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, current, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, key, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, next, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, valid, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, seek, arginfo_array_seek, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+static zend_function_entry spl_funcs_RecursiveArrayIterator[] = {
+ SPL_ME(Array, hasChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(Array, getChildren, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+static zend_function_entry spl_funcs_Countable[] = {
+ SPL_ABSTRACT_ME(Countable, count, NULL)
+ {NULL, NULL, NULL}
+};
+
/* {{{ PHP_MINIT_FUNCTION(spl_array) */
PHP_MINIT_FUNCTION(spl_array)
{
REGISTER_SPL_STD_CLASS_EX(ArrayObject, spl_array_object_new, spl_funcs_ArrayObject);
- zend_class_implements(spl_ce_ArrayObject TSRMLS_CC, 1, zend_ce_aggregate);
- zend_class_implements(spl_ce_ArrayObject TSRMLS_CC, 1, zend_ce_arrayaccess);
+ REGISTER_SPL_IMPLEMENTS(ArrayObject, Aggregate);
+ REGISTER_SPL_IMPLEMENTS(ArrayObject, ArrayAccess);
memcpy(&spl_handler_ArrayObject, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
spl_handler_ArrayObject.clone_obj = spl_array_object_clone;
spl_handler_ArrayObject.read_dimension = spl_array_read_dimension;
spl_handler_ArrayObject.write_dimension = spl_array_write_dimension;
spl_handler_ArrayObject.unset_dimension = spl_array_unset_dimension;
spl_handler_ArrayObject.has_dimension = spl_array_has_dimension;
- spl_handler_ArrayObject.get_properties = spl_array_get_properties;
spl_handler_ArrayObject.count_elements = spl_array_object_count_elements;
+ spl_handler_ArrayObject.get_properties = spl_array_get_properties;
+ spl_handler_ArrayObject.read_property = spl_array_read_property;
+ spl_handler_ArrayObject.write_property = spl_array_write_property;
+ spl_handler_ArrayObject.get_property_ptr_ptr = spl_array_get_property_ptr_ptr;
+ spl_handler_ArrayObject.has_property = spl_array_has_property;
+ spl_handler_ArrayObject.unset_property = spl_array_unset_property;
+
REGISTER_SPL_STD_CLASS_EX(ArrayIterator, spl_array_object_new, spl_funcs_ArrayIterator);
- zend_class_implements(spl_ce_ArrayIterator TSRMLS_CC, 1, zend_ce_iterator);
- zend_class_implements(spl_ce_ArrayIterator TSRMLS_CC, 1, zend_ce_arrayaccess);
+ REGISTER_SPL_IMPLEMENTS(ArrayIterator, Iterator);
+ REGISTER_SPL_IMPLEMENTS(ArrayIterator, ArrayAccess);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, SeekableIterator);
memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers));
spl_ce_ArrayIterator->get_iterator = spl_array_get_iterator;
+
+ REGISTER_SPL_SUB_CLASS_EX(RecursiveArrayIterator, ArrayIterator, spl_array_object_new, spl_funcs_RecursiveArrayIterator);
+ REGISTER_SPL_IMPLEMENTS(RecursiveArrayIterator, RecursiveIterator);
+
+ REGISTER_SPL_INTERFACE(Countable);
+
+ REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable);
+ REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable);
+
+ REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST);
+ REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS);
+ REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST);
+ REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS);
return SUCCESS;
}
/* }}} */
diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h
index 89f3fd7b4..f9a8a53b8 100755
--- a/ext/spl/spl_array.h
+++ b/ext/spl/spl_array.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_array.h,v 1.9.2.1 2005/03/03 10:45:42 helly Exp $ */
+/* $Id: spl_array.h,v 1.13.2.1 2005/09/18 17:15:04 helly Exp $ */
#ifndef SPL_ARRAY_H
#define SPL_ARRAY_H
@@ -26,9 +26,13 @@
extern PHPAPI zend_class_entry *spl_ce_ArrayObject;
extern PHPAPI zend_class_entry *spl_ce_ArrayIterator;
+extern PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator;
+extern PHPAPI zend_class_entry *spl_ce_Countable;
PHP_MINIT_FUNCTION(spl_array);
+extern void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC);
+
#endif /* SPL_ARRAY_H */
/*
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 4b25838ec..8cef99f10 100755
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_directory.c,v 1.26.2.2 2004/10/30 14:35:01 helly Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.3 2005/11/27 12:16:14 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -25,6 +25,8 @@
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
+#include "ext/standard/file.h"
+#include "ext/standard/php_string.h"
#include "zend_compile.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
@@ -34,6 +36,7 @@
#include "spl_engine.h"
#include "spl_iterators.h"
#include "spl_directory.h"
+#include "spl_exceptions.h"
#include "php.h"
#include "fopen_wrappers.h"
@@ -44,11 +47,13 @@
/* declare the class handlers */
static zend_object_handlers spl_ce_dir_handlers;
-
/* decalre the class entry */
-zend_class_entry *spl_ce_DirectoryIterator;
-zend_class_entry *spl_ce_RecursiveDirectoryIterator;
+PHPAPI zend_class_entry *spl_ce_DirectoryIterator;
+PHPAPI zend_class_entry *spl_ce_RecursiveDirectoryIterator;
+PHPAPI zend_class_entry *spl_ce_SplFileObject;
+static zend_object_value spl_file_object_new_ex(zend_class_entry *class_type, spl_file_object **obj TSRMLS_DC);
+static int spl_file_object_open(spl_file_object *intern, int use_include_path, int silent TSRMLS_DC);
/* {{{ spl_ce_dir_object_free_storage */
/* close all resources and the memory allocated for the object */
@@ -68,6 +73,9 @@ static void spl_ce_dir_object_free_storage(void *object TSRMLS_DC)
if (intern->path_name) {
efree(intern->path_name);
}
+ if (intern->sub_path) {
+ efree(intern->sub_path);
+ }
efree(object);
}
/* }}} */
@@ -93,13 +101,13 @@ static zend_object_value spl_ce_dir_object_new_ex(zend_class_entry *class_type,
intern = emalloc(sizeof(spl_ce_dir_object));
memset(intern, 0, sizeof(spl_ce_dir_object));
intern->std.ce = class_type;
- *obj = intern;
+ if (obj) *obj = intern;
ALLOC_HASHTABLE(intern->std.properties);
zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
- retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_ce_dir_object_free_storage, NULL TSRMLS_CC);
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) spl_ce_dir_object_free_storage, NULL TSRMLS_CC);
retval.handlers = &spl_ce_dir_handlers;
return retval;
}
@@ -110,12 +118,10 @@ static zend_object_value spl_ce_dir_object_new_ex(zend_class_entry *class_type,
/* See spl_ce_dir_object_new_ex */
static zend_object_value spl_ce_dir_object_new(zend_class_entry *class_type TSRMLS_DC)
{
- spl_ce_dir_object *tmp;
- return spl_ce_dir_object_new_ex(class_type, &tmp TSRMLS_CC);
+ return spl_ce_dir_object_new_ex(class_type, NULL TSRMLS_CC);
}
/* }}} */
-
/* {{{ spl_ce_dir_open */
/* open a directory resource */
static void spl_ce_dir_open(spl_ce_dir_object* intern, char *path TSRMLS_DC)
@@ -185,7 +191,7 @@ SPL_METHOD(DirectoryIterator, __construct)
char *path;
int len;
- php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);
+ php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len) == FAILURE) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -336,8 +342,8 @@ SPL_METHOD(DirectoryIterator, isDot)
}
/* }}} */
-/* {{{ FileFunction */
-#define FileFunction(func_name, func_num) \
+/* {{{ DirectoryFunction */
+#define DirectoryFunction(func_name, func_num) \
SPL_METHOD(DirectoryIterator, func_name) \
{ \
spl_ce_dir_object *intern = (spl_ce_dir_object*)zend_object_store_get_object(getThis() TSRMLS_CC); \
@@ -349,79 +355,123 @@ SPL_METHOD(DirectoryIterator, func_name) \
/* {{{ proto int DirectoryIterator::getPerms()
Get file permissions */
-FileFunction(getPerms, FS_PERMS)
+DirectoryFunction(getPerms, FS_PERMS)
/* }}} */
/* {{{ proto int DirectoryIterator::getInode()
Get file inode */
-FileFunction(getInode, FS_INODE)
+DirectoryFunction(getInode, FS_INODE)
/* }}} */
/* {{{ proto int DirectoryIterator::getSize()
Get file size */
-FileFunction(getSize, FS_SIZE)
+DirectoryFunction(getSize, FS_SIZE)
/* }}} */
/* {{{ proto int DirectoryIterator::getOwner()
Get file owner */
-FileFunction(getOwner, FS_OWNER)
+DirectoryFunction(getOwner, FS_OWNER)
/* }}} */
/* {{{ proto int DirectoryIterator::getGroup()
Get file group */
-FileFunction(getGroup, FS_GROUP)
+DirectoryFunction(getGroup, FS_GROUP)
/* }}} */
/* {{{ proto int DirectoryIterator::getATime()
Get last access time of file */
-FileFunction(getATime, FS_ATIME)
+DirectoryFunction(getATime, FS_ATIME)
/* }}} */
/* {{{ proto int DirectoryIterator::getMTime()
Get last modification time of file */
-FileFunction(getMTime, FS_MTIME)
+DirectoryFunction(getMTime, FS_MTIME)
/* }}} */
/* {{{ proto int DirectoryIterator::getCTime()
Get inode modification time of file */
-FileFunction(getCTime, FS_CTIME)
+DirectoryFunction(getCTime, FS_CTIME)
/* }}} */
/* {{{ proto string DirectoryIterator::getType()
Get file type */
-FileFunction(getType, FS_TYPE)
+DirectoryFunction(getType, FS_TYPE)
/* }}} */
/* {{{ proto bool DirectoryIterator::isWritable()
Returns true if file can be written */
-FileFunction(isWritable, FS_IS_W)
+DirectoryFunction(isWritable, FS_IS_W)
/* }}} */
/* {{{ proto bool DirectoryIterator::isReadable()
Returns true if file can be read */
-FileFunction(isReadable, FS_IS_R)
+DirectoryFunction(isReadable, FS_IS_R)
/* }}} */
/* {{{ proto bool DirectoryIterator::isExecutable()
Returns true if file is executable */
-FileFunction(isExecutable, FS_IS_X)
+DirectoryFunction(isExecutable, FS_IS_X)
/* }}} */
/* {{{ proto bool DirectoryIterator::isFile()
Returns true if file is a regular file */
-FileFunction(isFile, FS_IS_FILE)
+DirectoryFunction(isFile, FS_IS_FILE)
/* }}} */
/* {{{ proto bool DirectoryIterator::isDir()
Returns true if file is directory */
-FileFunction(isDir, FS_IS_DIR)
+DirectoryFunction(isDir, FS_IS_DIR)
/* }}} */
/* {{{ proto bool DirectoryIterator::isLink()
Returns true if file is symbolic link */
-FileFunction(isLink, FS_IS_LINK)
+DirectoryFunction(isLink, FS_IS_LINK)
/* }}} */
+/* {{{ proto SplFileObject DirectoryIterator::openFile([string mode = 'r' [, bool use_include_path [, resource context]]])
+ Open the current file */
+SPL_METHOD(DirectoryIterator, openFile)
+{
+ zval *object = getThis();
+ spl_ce_dir_object *dir_obj = (spl_ce_dir_object*)zend_object_store_get_object(object TSRMLS_CC);
+ spl_file_object *intern;
+ zend_bool use_include_path = 0;
+
+ php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
+
+ if (!dir_obj->entry.d_name[0]) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Could not open file");
+ zval_dtor(return_value);
+ return;
+ }
+
+ return_value->value.obj = spl_file_object_new_ex(spl_ce_SplFileObject, &intern TSRMLS_CC);
+
+ spl_dir_get_path_name(dir_obj);
+ intern->file_name = dir_obj->path_name;
+ intern->file_name_len = dir_obj->path_name_len;
+
+ intern->open_mode = "r";
+ intern->open_mode_len = 1;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sbr",
+ &intern->open_mode, &intern->open_mode_len,
+ &use_include_path, &intern->zcontext) == FAILURE) {
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ zval_dtor(return_value);
+ return;
+ }
+
+ if (spl_file_object_open(intern, use_include_path, 0 TSRMLS_CC) == SUCCESS) {
+ Z_TYPE_P(return_value) = IS_OBJECT;
+ } else {
+ zval_dtor(return_value);
+ return;
+ }
+
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+} /* }}} */
+
/* {{{ proto void RecursiveDirectoryIterator::rewind()
Rewind dir back to the start */
SPL_METHOD(RecursiveDirectoryIterator, rewind)
@@ -488,11 +538,12 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren)
/* }}} */
/* {{{ proto RecursiveDirectoryIterator DirectoryIterator::getChildren()
- Returns an iterator fo rthe current entry if it is a directory */
+ Returns an iterator for the current entry if it is a directory */
SPL_METHOD(RecursiveDirectoryIterator, getChildren)
{
zval *object = getThis(), zpath;
spl_ce_dir_object *intern = (spl_ce_dir_object*)zend_object_store_get_object(object TSRMLS_CC);
+ spl_ce_dir_object *subdir;
spl_dir_get_path_name(intern);
@@ -500,6 +551,49 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren)
ZVAL_STRINGL(&zpath, intern->path_name, intern->path_name_len, 0);
spl_instantiate_arg_ex1(spl_ce_RecursiveDirectoryIterator, &return_value, 0, &zpath TSRMLS_CC);
+
+ subdir = (spl_ce_dir_object*)zend_object_store_get_object(return_value TSRMLS_CC);
+ if (subdir) {
+ if (intern->sub_path && intern->sub_path[0]) {
+ subdir->sub_path_len = spprintf(&subdir->sub_path, 0, "%s/%s", intern->sub_path, intern->entry.d_name);
+ } else {
+ subdir->sub_path_len = strlen(intern->entry.d_name);
+ subdir->sub_path = estrndup(intern->entry.d_name, subdir->sub_path_len);
+ }
+ }
+}
+/* }}} */
+
+/* {{{ proto void RecursiveDirectoryIterator::getSubPath()
+ Get sub path */
+SPL_METHOD(RecursiveDirectoryIterator, getSubPath)
+{
+ zval *object = getThis();
+ spl_ce_dir_object *intern = (spl_ce_dir_object*)zend_object_store_get_object(object TSRMLS_CC);
+
+ if (intern->sub_path) {
+ RETURN_STRINGL(intern->sub_path, intern->sub_path_len, 1);
+ } else {
+ RETURN_STRINGL("", 0, 1);
+ }
+}
+/* }}} */
+
+/* {{{ proto void RecursiveDirectoryIterator::getSubPathname()
+ Get sub path and file name */
+SPL_METHOD(RecursiveDirectoryIterator, getSubPathname)
+{
+ zval *object = getThis();
+ spl_ce_dir_object *intern = (spl_ce_dir_object*)zend_object_store_get_object(object TSRMLS_CC);
+ char *sub_name;
+ int len;
+
+ if (intern->sub_path) {
+ len = spprintf(&sub_name, 0, "%s/%s", intern->sub_path, intern->entry.d_name);
+ RETURN_STRINGL(sub_name, len, 0);
+ } else {
+ RETURN_STRING(intern->entry.d_name, 1);
+ }
}
/* }}} */
@@ -507,7 +601,7 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren)
typedef struct {
zend_object_iterator intern;
zval *current;
- spl_ce_dir_object *object;
+ spl_ce_dir_object *object;
} spl_ce_dir_it;
/* forward declarations to the iterator handlers */
@@ -518,7 +612,6 @@ static int spl_ce_dir_it_current_key(zend_object_iterator *iter, char **str_key,
static void spl_ce_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC);
static void spl_ce_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC);
-
/* iterator handler table */
zend_object_iterator_funcs spl_ce_dir_it_funcs = {
spl_ce_dir_it_dtor,
@@ -529,7 +622,6 @@ zend_object_iterator_funcs spl_ce_dir_it_funcs = {
spl_ce_dir_it_rewind
};
-
/* {{{ spl_ce_dir_get_iterator */
zend_object_iterator *spl_ce_dir_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
{
@@ -547,7 +639,6 @@ zend_object_iterator *spl_ce_dir_get_iterator(zend_class_entry *ce, zval *object
}
/* }}} */
-
/* {{{ spl_ce_dir_it_dtor */
static void spl_ce_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC)
{
@@ -560,7 +651,6 @@ static void spl_ce_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC)
}
/* }}} */
-
/* {{{ spl_ce_dir_it_valid */
static int spl_ce_dir_it_valid(zend_object_iterator *iter TSRMLS_DC)
{
@@ -581,7 +671,6 @@ static void spl_ce_dir_it_current_data(zend_object_iterator *iter, zval ***data
}
/* }}} */
-
/* {{{ spl_ce_dir_it_current_key */
static int spl_ce_dir_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
{
@@ -593,7 +682,6 @@ static int spl_ce_dir_it_current_key(zend_object_iterator *iter, char **str_key,
}
/* }}} */
-
/* {{{ spl_ce_dir_it_move_forward */
static void spl_ce_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
{
@@ -611,7 +699,6 @@ static void spl_ce_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
}
/* }}} */
-
/* {{{ spl_ce_dir_it_rewind */
static void spl_ce_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC)
{
@@ -628,7 +715,6 @@ static void spl_ce_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC)
}
/* }}} */
-
/* {{{ spl_ce_dir_tree_it_current_key */
static int spl_ce_dir_tree_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
{
@@ -642,7 +728,6 @@ static int spl_ce_dir_tree_it_current_key(zend_object_iterator *iter, char **str
}
/* }}} */
-
/* {{{ spl_ce_dir_tree_it_move_forward */
static void spl_ce_dir_tree_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
{
@@ -734,6 +819,12 @@ ZEND_BEGIN_ARG_INFO(arginfo_dir___construct, 0)
ZEND_ARG_INFO(0, path) /* parameter name */
ZEND_END_ARG_INFO();
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dir_openFile, 0, 0, 0)
+ ZEND_ARG_INFO(0, open_mode)
+ ZEND_ARG_INFO(0, use_include_path)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO();
/* the method table */
/* each method can have its own parameters and visibility */
@@ -763,6 +854,7 @@ static zend_function_entry spl_ce_dir_class_functions[] = {
SPL_ME(DirectoryIterator, isDir, NULL, ZEND_ACC_PUBLIC)
SPL_ME(DirectoryIterator, isLink, NULL, ZEND_ACC_PUBLIC)
SPL_ME(DirectoryIterator, isDot, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(DirectoryIterator, openFile, arginfo_dir_openFile, ZEND_ACC_PUBLIC)
SPL_MA(DirectoryIterator, __toString, DirectoryIterator, getFilename, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
@@ -773,9 +865,724 @@ static zend_function_entry spl_ce_dir_tree_class_functions[] = {
SPL_ME(RecursiveDirectoryIterator, key, NULL, ZEND_ACC_PUBLIC)
SPL_ME(RecursiveDirectoryIterator, hasChildren, NULL, ZEND_ACC_PUBLIC)
SPL_ME(RecursiveDirectoryIterator, getChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveDirectoryIterator, getSubPath, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveDirectoryIterator, getSubPathname,NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
+static void spl_file_object_free_line(spl_file_object *intern TSRMLS_DC) /* {{{ */
+{
+ if (intern->current_line) {
+ efree(intern->current_line);
+ intern->current_line = NULL;
+ }
+ if (intern->current_zval) {
+ zval_ptr_dtor(&intern->current_zval);
+ intern->current_zval = NULL;
+ }
+} /* }}} */
+
+static void spl_file_object_free_storage(void *object TSRMLS_DC) /* {{{ */
+{
+ spl_file_object *intern = (spl_file_object*)object;
+
+ zend_hash_destroy(intern->std.properties);
+ FREE_HASHTABLE(intern->std.properties);
+
+ if (intern->stream) {
+ if (intern->zcontext) {
+/* zend_list_delref(Z_RESVAL_P(intern->zcontext));*/
+ }
+ if (!intern->stream->is_persistent) {
+ php_stream_free(intern->stream, PHP_STREAM_FREE_CLOSE);
+ } else {
+ php_stream_free(intern->stream, PHP_STREAM_FREE_CLOSE_PERSISTENT);
+ }
+ if (intern->file_name) {
+ efree(intern->file_name);
+ }
+ if (intern->open_mode) {
+ efree(intern->open_mode);
+ }
+ }
+ spl_file_object_free_line(intern TSRMLS_CC);
+ efree(object);
+} /* }}} */
+
+static zend_object_value spl_file_object_new_ex(zend_class_entry *class_type, spl_file_object **obj TSRMLS_DC) /* {{{ */
+{
+ zend_object_value retval;
+ spl_file_object *intern;
+ zval *tmp;
+
+ intern = emalloc(sizeof(spl_ce_dir_object));
+ memset(intern, 0, sizeof(spl_ce_dir_object));
+ intern->std.ce = class_type;
+ if (obj) *obj = intern;
+
+ ALLOC_HASHTABLE(intern->std.properties);
+ zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) spl_file_object_free_storage, NULL TSRMLS_CC);
+ retval.handlers = &spl_ce_dir_handlers;
+ return retval;
+} /* }}} */
+
+static zend_object_value spl_file_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+{
+ return spl_file_object_new_ex(class_type, NULL TSRMLS_CC);
+} /* }}} */
+
+static int spl_file_object_read(spl_file_object *intern, int silent TSRMLS_DC) /* {{{ */
+{
+ char *buf;
+ size_t line_len;
+ int len;
+ long line_add = (intern->current_line || intern->current_zval) ? 1 : 0;
+
+ spl_file_object_free_line(intern TSRMLS_CC);
+
+ if (php_stream_eof(intern->stream)) {
+ if (!silent) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name);
+ }
+ return FAILURE;
+ }
+
+ buf = php_stream_get_line(intern->stream, NULL, intern->max_line_len, &line_len);
+
+ if (!buf) {
+ intern->current_line = estrdup("");
+ intern->current_line_len = 0;
+ } else {
+ if (intern->flags & SPL_FILE_OBJECT_DROP_NEW_LINE) {
+ line_len = strcspn(buf, "\r\n");
+ buf[line_len] = '\0';
+ }
+
+ if (PG(magic_quotes_runtime)) {
+ buf = php_addslashes(buf, line_len, &len, 1 TSRMLS_CC);
+ line_len = len;
+ }
+
+ intern->current_line = buf;
+ intern->current_line_len = line_len;
+ }
+ intern->current_line_num += line_add;
+
+ return SUCCESS;
+} /* }}} */
+
+static int spl_file_object_read_line(zval * this_ptr, spl_file_object *intern, int silent TSRMLS_DC) /* {{{ */
+{
+ zval *retval;
+
+ /* if overloaded call the function, otherwise do it directly */
+ if (intern->func_getCurr->common.scope != spl_ce_SplFileObject) {
+ if (php_stream_eof(intern->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->func_getCurr, "getCurrentLine", &retval);
+ if (retval) {
+ if (intern->current_line || intern->current_zval) {
+ intern->current_line_num++;
+ }
+ spl_file_object_free_line(intern TSRMLS_CC);
+ if (Z_TYPE_P(retval) == IS_STRING) {
+ intern->current_line = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ intern->current_line_len = Z_STRLEN_P(retval);
+ } else {
+ MAKE_STD_ZVAL(intern->current_zval);
+ ZVAL_ZVAL(intern->current_zval, retval, 1, 0);
+ }
+ zval_ptr_dtor(&retval);
+ return SUCCESS;
+ } else {
+ return FAILURE;
+ }
+ } else {
+ return spl_file_object_read(intern, silent TSRMLS_CC);
+ }
+} /* }}} */
+
+static void spl_file_object_rewind(spl_file_object *intern TSRMLS_DC) /* {{{ */
+{
+ if (-1 == php_stream_rewind(intern->stream)) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot rewind file %s", intern->file_name);
+ } else {
+ spl_file_object_free_line(intern TSRMLS_CC);
+ intern->current_line_num = 0;
+ }
+} /* }}} */
+
+static int spl_file_object_open(spl_file_object *intern, int use_include_path, int silent TSRMLS_DC) /* {{{ */
+{
+ intern->context = php_stream_context_from_zval(intern->zcontext, 0);
+ intern->stream = php_stream_open_wrapper_ex(intern->file_name, intern->open_mode, (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, intern->context);
+
+ if (intern->stream == NULL) {
+ if (!EG(exception)) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot open file %s", intern->file_name);
+ }
+ return FAILURE;
+ }
+
+ if (intern->zcontext) {
+ zend_list_addref(Z_RESVAL_P(intern->zcontext));
+ }
+
+ intern->file_name = estrndup(intern->file_name, intern->file_name_len);
+ intern->open_mode = estrndup(intern->open_mode, intern->open_mode_len);
+
+ /* avoid reference counting in debug mode, thus do it manually */
+ ZVAL_RESOURCE(&intern->zresource, php_stream_get_resource_id(intern->stream));
+ intern->zresource.refcount = 1;
+
+ zend_hash_find(&intern->std.ce->function_table, "getcurrentline", sizeof("getcurrentline"), (void **) &intern->func_getCurr);
+
+ return SUCCESS;
+} /* }}} */
+
+/* {{{ proto void SplFileObject::__construct(string filename [, string mode = 'r' [, bool use_include_path [, resource context]]]])
+ Construct a new file reader */
+SPL_METHOD(SplFileObject, __construct)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ zend_bool use_include_path = 0;
+
+ php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
+
+ intern->open_mode = "r";
+ intern->open_mode_len = 1;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sbr",
+ &intern->file_name, &intern->file_name_len,
+ &intern->open_mode, &intern->open_mode_len,
+ &use_include_path, &intern->zcontext) == FAILURE) {
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return;
+ }
+
+ spl_file_object_open(intern, use_include_path, 0 TSRMLS_CC);
+
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto void SplFileObject::rewind()
+ Rewind the file and read the first line */
+SPL_METHOD(SplFileObject, rewind)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ spl_file_object_rewind(intern TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto string SplFileObject::getFilename()
+ Return the filename */
+SPL_METHOD(SplFileObject, getFilename)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_STRINGL(intern->file_name, intern->file_name_len, 1);
+} /* }}} */
+
+/* {{{ proto void SplFileObject::eof()
+ Return whether end of file is reached */
+SPL_METHOD(SplFileObject, eof)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_BOOL(php_stream_eof(intern->stream));
+} /* }}} */
+
+/* {{{ proto void SplFileObject::valid()
+ Return !eof() */
+SPL_METHOD(SplFileObject, valid)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETVAL_BOOL(!php_stream_eof(intern->stream));
+} /* }}} */
+
+/* {{{ proto string SplFileObject::fgets()
+ Rturn next line from file */
+SPL_METHOD(SplFileObject, fgets)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (spl_file_object_read(intern, 0 TSRMLS_CC) == FAILURE) {
+ RETURN_FALSE;
+ }
+ RETURN_STRINGL(intern->current_line, intern->current_line_len, 1);
+} /* }}} */
+
+/* {{{ proto string SplFileObject::current()
+ Return current line from file */
+SPL_METHOD(SplFileObject, current)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (!intern->current_line) {
+ spl_file_object_read_line(getThis(), intern, 1 TSRMLS_CC);
+ }
+ if (intern->current_line) {
+ RETURN_STRINGL(intern->current_line, intern->current_line_len, 1);
+ } else if (intern->current_zval) {
+ RETURN_ZVAL(intern->current_zval, 1, 0);
+ }
+ RETURN_FALSE;
+} /* }}} */
+
+/* {{{ proto int SplFileObject::key()
+ Return line number */
+SPL_METHOD(SplFileObject, key)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+/* Do not read the next line to support correct counting with fgetc()
+ if (!intern->current_line) {
+ spl_file_object_read_line(getThis(), intern, 1 TSRMLS_CC);
+ } */
+ RETURN_LONG(intern->current_line_num);
+} /* }}} */
+
+/* {{{ proto void SplFileObject::next()
+ Read next line */
+SPL_METHOD(SplFileObject, next)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ spl_file_object_free_line(intern TSRMLS_CC);
+ intern->current_line_num++;
+} /* }}} */
+
+/* {{{ proto void SplFileObject::setFlags(int flags)
+ Set file handling flags */
+SPL_METHOD(SplFileObject, setFlags)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags);
+} /* }}} */
+
+/* {{{ proto int SplFileObject::getFlags()
+ Get file handling flags */
+SPL_METHOD(SplFileObject, getFlags)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_LONG(intern->flags);
+} /* }}} */
+
+/* {{{ proto void SplFileObject::setMaxLineLen(int max_len)
+ Set maximum line length */
+SPL_METHOD(SplFileObject, setMaxLineLen)
+{
+ long max_len;
+
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &max_len) == FAILURE) {
+ return;
+ }
+
+ if (max_len < 0) {
+ zend_throw_exception_ex(spl_ce_DomainException, 0 TSRMLS_CC, "Maximum line length must be greater than or equal zero");
+ return;
+ }
+
+ intern->max_line_len = max_len;
+} /* }}} */
+
+/* {{{ proto int SplFileObject::getMaxLineLen()
+ Get maximum line length */
+SPL_METHOD(SplFileObject, getMaxLineLen)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_LONG((long)intern->max_line_len);
+} /* }}} */
+
+/* {{{ proto bool hasChildren()
+ Rturn false */
+SPL_METHOD(SplFileObject, hasChildren)
+{
+ RETURN_FALSE;
+} /* }}} */
+
+/* {{{ proto bool SplFileObject::getChildren()
+ Read NULL */
+SPL_METHOD(SplFileObject, getChildren)
+{
+ /* return NULL */
+} /* }}} */
+
+static int spl_file_object_call(INTERNAL_FUNCTION_PARAMETERS, spl_file_object *intern, zend_function *func_ptr, zval *arg2) /* {{{ */
+{
+ zend_fcall_info fci;
+ zend_fcall_info_cache fcic;
+ zval z_fname;
+ zval * zresource_ptr = &intern->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_file_object_call(INTERNAL_FUNCTION_PARAM_PASSTHRU, intern, func_ptr, arg2); \
+}
+
+/* {{{ FileFunction */
+#define FileFunction(func_name) \
+SPL_METHOD(SplFileObject, func_name) \
+{ \
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC); \
+ FileFunctionCall(func_name, NULL); \
+}
+/* }}} */
+
+/* {{{ proto array SplFileObject::fgetcsv([string delimiter [, string enclosure]])
+ Return current line as csv */
+SPL_METHOD(SplFileObject, fgetcsv)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ zval *arg2 = NULL;
+ MAKE_STD_ZVAL(arg2);
+ ZVAL_LONG(arg2, intern->max_line_len);
+
+ spl_file_object_free_line(intern TSRMLS_CC);
+ intern->current_line_num++;
+
+ FileFunctionCall(fgetcsv, arg2);
+
+ zval_ptr_dtor(&arg2);
+}
+/* }}} */
+
+/* {{{ proto bool SplFileObject::flock(int operation [, int &wouldblock])
+ Portable file locking */
+FileFunction(flock)
+/* }}} */
+
+/* {{{ proto bool SplFileObject::fflush()
+ Flush the file */
+SPL_METHOD(SplFileObject, fflush)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_BOOL(!php_stream_flush(intern->stream));
+} /* }}} */
+
+
+/* {{{ proto int SplFileObject::ftell()
+ Return current file position */
+SPL_METHOD(SplFileObject, ftell)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ long ret = php_stream_tell(intern->stream);
+
+ if (ret == -1) {
+ RETURN_FALSE;
+ } else {
+ RETURN_LONG(ret);
+ }
+} /* }}} */
+
+/* {{{ proto int SplFileObject::fseek(int pos [, int whence = SEEK_SET])
+ Return current file position */
+SPL_METHOD(SplFileObject, fseek)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ long pos, whence = SEEK_SET;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &pos, &whence) == FAILURE) {
+ return;
+ }
+
+ spl_file_object_free_line(intern TSRMLS_CC);
+ RETURN_LONG(php_stream_seek(intern->stream, pos, whence));
+} /* }}} */
+
+/* {{{ proto int SplFileObject::fgetc()
+ Get a character form the file */
+SPL_METHOD(SplFileObject, fgetc)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ char buf[2];
+ int result;
+
+ spl_file_object_free_line(intern TSRMLS_CC);
+
+ result = php_stream_getc(intern->stream);
+
+ if (result == EOF) {
+ RETVAL_FALSE;
+ } else {
+ if (result == '\n') {
+ intern->current_line_num++;
+ }
+ buf[0] = result;
+ buf[1] = '\0';
+
+ RETURN_STRINGL(buf, 1, 1);
+ }
+} /* }}} */
+
+/* {{{ proto string SplFileObject::fgetss([string allowable_tags])
+ Get a line from file pointer and strip HTML tags */
+SPL_METHOD(SplFileObject, fgetss)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ zval *arg2 = NULL;
+ MAKE_STD_ZVAL(arg2);
+ ZVAL_LONG(arg2, intern->max_line_len);
+
+ spl_file_object_free_line(intern TSRMLS_CC);
+ intern->current_line_num++;
+
+ FileFunctionCall(fgetss, arg2);
+
+ zval_ptr_dtor(&arg2);
+} /* }}} */
+
+/* {{{ proto int SplFileObject::fpassthru()
+ Output all remaining data from a file pointer */
+SPL_METHOD(SplFileObject, fpassthru)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_LONG(php_stream_passthru(intern->stream));
+} /* }}} */
+
+/* {{{ proto bool SplFileObject::fscanf(string format [, string ...])
+ Implements a mostly ANSI compatible fscanf() */
+SPL_METHOD(SplFileObject, fscanf)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ spl_file_object_free_line(intern TSRMLS_CC);
+ intern->current_line_num++;
+
+ FileFunctionCall(fscanf, NULL);
+}
+/* }}} */
+
+/* {{{ proto mixed SplFileObject::fwrite(string str [, int length])
+ Binary-safe file write */
+SPL_METHOD(SplFileObject, fwrite)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ char *str;
+ int str_len;
+ int ret;
+ long length;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &length) == FAILURE) {
+ return;
+ }
+
+ if (ZEND_NUM_ARGS() < 2) {
+ str_len = MAX(0, MIN(length, str_len));
+ }
+ if (!str_len) {
+ RETURN_LONG(0);
+ }
+
+ if (PG(magic_quotes_runtime)) {
+ str = estrndup(str, str_len);
+ php_stripslashes(str, &str_len TSRMLS_CC);
+ ret = php_stream_write(intern->stream, str, str_len);
+ efree(str);
+ RETURN_LONG(ret);
+ }
+
+ RETURN_LONG(php_stream_write(intern->stream, str, str_len));
+} /* }}} */
+
+/* {{{ proto bool SplFileObject::fstat()
+ Stat() on a filehandle */
+FileFunction(fstat)
+/* }}} */
+
+/* {{{ proto bool SplFileObject::ftruncate(int size)
+ Truncate file to 'size' length */
+SPL_METHOD(SplFileObject, ftruncate)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ long size;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size) == FAILURE) {
+ return;
+ }
+
+ if (!php_stream_truncate_supported(intern->stream)) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't truncate file %s", intern->file_name);
+ RETURN_FALSE;
+ }
+
+ RETURN_BOOL(0 == php_stream_truncate_set_size(intern->stream, size));
+} /* }}} */
+
+/* {{{ proto void SplFileObject::seek(int line_pos)
+ Seek to specified line */
+SPL_METHOD(SplFileObject, seek)
+{
+ spl_file_object *intern = (spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ long line_pos;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &line_pos) == FAILURE) {
+ return;
+ }
+ if (line_pos < 0) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't seek file %s to negative line %ld", intern->file_name, line_pos);
+ RETURN_FALSE;
+ }
+
+ spl_file_object_rewind(intern TSRMLS_CC);
+
+ while(intern->current_line_num < line_pos) {
+ spl_file_object_read_line(getThis(), intern, 1 TSRMLS_CC);
+ }
+}
+/* }}} */
+
+/* {{{ Function/Class/Method definitions */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object___construct, 0, 0, 1)
+ ZEND_ARG_INFO(0, file_name)
+ ZEND_ARG_INFO(0, open_mode)
+ ZEND_ARG_INFO(0, use_include_path)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_file_object_setFlags, 0)
+ ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_file_object_setMaxLineLen, 0)
+ ZEND_ARG_INFO(0, max_len)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fgetcsv, 0, 0, 0)
+ ZEND_ARG_INFO(0, delimiter)
+ ZEND_ARG_INFO(0, enclosure)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_flock, 0, 0, 1)
+ ZEND_ARG_INFO(0, operation)
+ ZEND_ARG_INFO(1, wouldblock])
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fseek, 0, 0, 1)
+ ZEND_ARG_INFO(0, pos)
+ ZEND_ARG_INFO(0, whence)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fgetss, 0, 0, 0)
+ ZEND_ARG_INFO(0, allowable_tags)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 0, 0, 1)
+ ZEND_ARG_INFO(0, format)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fwrite, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_ftruncate, 0, 0, 1)
+ ZEND_ARG_INFO(0, size)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_seek, 0, 0, 1)
+ ZEND_ARG_INFO(0, line_pos)
+ZEND_END_ARG_INFO();
+
+static zend_function_entry spl_file_object_class_functions[] = {
+ SPL_ME(SplFileObject, __construct, arginfo_file_object___construct, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, getFilename, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, rewind, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, eof, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, valid, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fgets, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fgetcsv, arginfo_file_object_fgetcsv, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, flock, arginfo_file_object_flock, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fflush, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, ftell, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fseek, arginfo_file_object_fseek, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fgetc, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fpassthru, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fgetss, arginfo_file_object_fgetss, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fscanf, arginfo_file_object_fscanf, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fwrite, arginfo_file_object_fwrite, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, fstat, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, ftruncate, arginfo_file_object_ftruncate, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, current, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, key, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, next, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, setFlags, arginfo_file_object_setFlags, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, getFlags, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, setMaxLineLen, arginfo_file_object_setMaxLineLen, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, getMaxLineLen, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, hasChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, getChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, seek, arginfo_file_object_seek, ZEND_ACC_PUBLIC)
+ // mappings
+ SPL_MA(SplFileObject, getCurrentLine, SplFileObject, fgets, NULL, ZEND_ACC_PUBLIC)
+ SPL_MA(SplFileObject, __toString, SplFileObject, current, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+/* }}} */
/* {{{ PHP_MINIT_FUNCTION(spl_directory)
*/
@@ -794,6 +1601,12 @@ PHP_MINIT_FUNCTION(spl_directory)
spl_ce_RecursiveDirectoryIterator->get_iterator = spl_ce_dir_tree_get_iterator;
+ REGISTER_SPL_STD_CLASS_EX(SplFileObject, spl_file_object_new, spl_file_object_class_functions);
+ REGISTER_SPL_IMPLEMENTS(SplFileObject, RecursiveIterator);
+ REGISTER_SPL_IMPLEMENTS(SplFileObject, SeekableIterator);
+
+ REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "DROP_NEW_LINE", SPL_FILE_OBJECT_DROP_NEW_LINE);
+
return SUCCESS;
}
/* }}} */
diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h
index 755b661ab..397a78f23 100755
--- a/ext/spl/spl_directory.h
+++ b/ext/spl/spl_directory.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_directory.h,v 1.6 2004/01/20 20:59:45 helly Exp $ */
+/* $Id: spl_directory.h,v 1.12.2.1 2005/09/15 14:08:14 helly Exp $ */
#ifndef SPL_DIRECTORY_H
#define SPL_DIRECTORY_H
@@ -24,8 +24,9 @@
#include "php.h"
#include "php_spl.h"
-extern zend_class_entry *spl_ce_DirectoryIterator;
-extern zend_class_entry *spl_ce_RecursiveDirectoryIterator;
+extern PHPAPI zend_class_entry *spl_ce_DirectoryIterator;
+extern PHPAPI zend_class_entry *spl_ce_RecursiveDirectoryIterator;
+extern PHPAPI zend_class_entry *spl_ce_SplFileObject;
PHP_MINIT_FUNCTION(spl_directory);
@@ -36,9 +37,32 @@ typedef struct _spl_ce_dir_object {
char *path;
char *path_name;
int path_name_len;
+ char *sub_path;
+ int sub_path_len;
int index;
} spl_ce_dir_object;
+typedef struct _spl_file_object {
+ zend_object std;
+ php_stream *stream;
+ php_stream_context *context;
+ zval *zcontext;
+ char *file_name;
+ int file_name_len;
+ char *open_mode;
+ int open_mode_len;
+ zval *current_zval;
+ char *current_line;
+ size_t current_line_len;
+ size_t max_line_len;
+ long current_line_num;
+ long flags;
+ zval zresource;
+ zend_function *func_getCurr;
+} spl_file_object;
+
+#define SPL_FILE_OBJECT_DROP_NEW_LINE 0x00000001 /* drop new lines */
+
#endif /* SPL_DIRECTORY_H */
/*
diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c
index 7ba631b4a..43d39d17e 100755
--- a/ext/spl/spl_engine.c
+++ b/ext/spl/spl_engine.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h
index 5dd75e9c1..3828adbe6 100755
--- a/ext/spl/spl_engine.h
+++ b/ext/spl/spl_engine.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_engine.h,v 1.18 2004/01/20 20:59:45 helly Exp $ */
+/* $Id: spl_engine.h,v 1.19 2005/08/03 14:07:53 sniper Exp $ */
#ifndef SPL_ENGINE_H
#define SPL_ENGINE_H
diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c
new file mode 100755
index 000000000..f3dfc91d6
--- /dev/null
+++ b/ext/spl/spl_exceptions.c
@@ -0,0 +1,81 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Marcus Boerger <helly@php.net> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: spl_exceptions.c,v 1.6 2005/08/03 14:07:53 sniper Exp $ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "zend_interfaces.h"
+#include "zend_exceptions.h"
+
+#include "php_spl.h"
+#include "spl_functions.h"
+#include "spl_engine.h"
+#include "spl_exceptions.h"
+
+PHPAPI zend_class_entry *spl_ce_LogicException;
+PHPAPI zend_class_entry *spl_ce_BadFunctionCallException;
+PHPAPI zend_class_entry *spl_ce_BadMethodCallException;
+PHPAPI zend_class_entry *spl_ce_DomainException;
+PHPAPI zend_class_entry *spl_ce_InvalidArgumentException;
+PHPAPI zend_class_entry *spl_ce_LengthException;
+PHPAPI zend_class_entry *spl_ce_OutOfRangeException;
+PHPAPI zend_class_entry *spl_ce_RuntimeException;
+PHPAPI zend_class_entry *spl_ce_OutOfBoundsException;
+PHPAPI zend_class_entry *spl_ce_OverflowException;
+PHPAPI zend_class_entry *spl_ce_RangeException;
+PHPAPI zend_class_entry *spl_ce_UnderflowException;
+PHPAPI zend_class_entry *spl_ce_UnexpectedValueException;
+
+#define spl_ce_Exception zend_exception_get_default()
+
+/* {{{ PHP_MINIT_FUNCTION(spl_exceptions) */
+PHP_MINIT_FUNCTION(spl_exceptions)
+{
+ REGISTER_SPL_SUB_CLASS_EX(LogicException, Exception, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(BadFunctionCallException, LogicException, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(BadMethodCallException, BadFunctionCallException, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(DomainException, LogicException, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(InvalidArgumentException, LogicException, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(LengthException, LogicException, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(OutOfRangeException, LogicException, NULL, NULL);
+
+ REGISTER_SPL_SUB_CLASS_EX(RuntimeException, Exception, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(OutOfBoundsException, RuntimeException, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(OverflowException, RuntimeException, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(RangeException, RuntimeException, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(UnderflowException, RuntimeException, NULL, NULL);
+ REGISTER_SPL_SUB_CLASS_EX(UnexpectedValueException, RuntimeException, NULL, NULL);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: fdm=marker
+ * vim: noet sw=4 ts=4
+ */
diff --git a/ext/spl/spl_exceptions.h b/ext/spl/spl_exceptions.h
new file mode 100755
index 000000000..5ab54e745
--- /dev/null
+++ b/ext/spl/spl_exceptions.h
@@ -0,0 +1,53 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Marcus Boerger <helly@php.net> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: spl_exceptions.h,v 1.5 2005/08/03 14:07:53 sniper Exp $ */
+
+#ifndef SPL_EXCEPTIONS_H
+#define SPL_EXCEPTIONS_H
+
+#include "php.h"
+#include "php_spl.h"
+
+extern PHPAPI zend_class_entry *spl_ce_LogicException;
+extern PHPAPI zend_class_entry *spl_ce_BadFunctionCallException;
+extern PHPAPI zend_class_entry *spl_ce_BadMethodCallException;
+extern PHPAPI zend_class_entry *spl_ce_DomainException;
+extern PHPAPI zend_class_entry *spl_ce_InvalidArgumentException;
+extern PHPAPI zend_class_entry *spl_ce_LengthException;
+extern PHPAPI zend_class_entry *spl_ce_OutOfRangeException;
+
+extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
+extern PHPAPI zend_class_entry *spl_ce_OutOfBoundsException;
+extern PHPAPI zend_class_entry *spl_ce_OverflowException;
+extern PHPAPI zend_class_entry *spl_ce_RangeException;
+extern PHPAPI zend_class_entry *spl_ce_UnderflowException;
+extern PHPAPI zend_class_entry *spl_ce_UnexpectedValueException;
+
+PHP_MINIT_FUNCTION(spl_exceptions);
+
+#endif /* SPL_EXCEPTIONS_H */
+
+/*
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ * vim600: fdm=marker
+ * vim: noet sw=4 ts=4
+ */
diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c
index 0ca472f52..efa152527 100755
--- a/ext/spl/spl_functions.c
+++ b/ext/spl/spl_functions.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_functions.c,v 1.25 2004/03/09 16:38:37 helly Exp $ */
+/* $Id: spl_functions.c,v 1.28 2005/08/03 14:07:53 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -59,7 +59,9 @@ void spl_register_std_class(zend_class_entry ** ppce, char * class_name, void *
*ppce = zend_register_internal_class(&ce TSRMLS_CC);
/* entries changed by initialize */
- (*ppce)->create_object = obj_ctor;
+ if (obj_ctor) {
+ (*ppce)->create_object = obj_ctor;
+ }
}
/* }}} */
@@ -73,7 +75,11 @@ void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_
*ppce = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC);
/* entries changed by initialize */
- (*ppce)->create_object = obj_ctor;
+ if (obj_ctor) {
+ (*ppce)->create_object = obj_ctor;
+ } else {
+ (*ppce)->create_object = parent_ce->create_object;
+ }
}
/* }}} */
diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h
index 971e23f5b..6f2f9a0eb 100755
--- a/ext/spl/spl_functions.h
+++ b/ext/spl/spl_functions.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_functions.h,v 1.17 2004/04/12 13:02:54 helly Exp $ */
+/* $Id: spl_functions.h,v 1.19.2.1 2005/09/15 03:33:04 helly Exp $ */
#ifndef PHP_FUNCTIONS_H
#define PHP_FUNCTIONS_H
@@ -52,6 +52,9 @@ typedef zend_object_value (*create_object_func_t)(zend_class_entry *class_type T
#define REGISTER_SPL_PROPERTY(class_name, prop_name) \
spl_register_property(spl_ce_ ## class_name, prop_name, prop_val, prop_flags TSRMLS_CC);
+#define REGISTER_SPL_CLASS_CONST_LONG(class_name, const_name, value) \
+ zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
+
void spl_destroy_class(zend_class_entry ** ppce);
void spl_register_std_class(zend_class_entry ** ppce, char * class_name, create_object_func_t ctor, function_entry * function_list TSRMLS_DC);
@@ -82,7 +85,7 @@ int spl_add_classes(zend_class_entry ** ppce, zval *list, int sub, int allow, in
PHP_METHOD(spl_ ## class_name, function_name)
#define SPL_MA(class_name, function_name, alias_class, alias_function, arg_info, flags) \
- ZEND_MALIAS(spl_ ## alias_class, function_name, alias_function, arg_info, flags)
+ PHP_MALIAS(spl_ ## alias_class, function_name, alias_function, arg_info, flags)
#endif /* PHP_FUNCTIONS_H */
/*
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 4162d6400..c711bb65f 100755
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_iterators.c,v 1.38.2.10 2005/03/12 23:12:36 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.73.2.6 2005/11/14 22:03:01 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -33,17 +33,26 @@
#include "spl_engine.h"
#include "spl_iterators.h"
#include "spl_directory.h"
+#include "spl_array.h"
+#include "spl_exceptions.h"
#define INLINE inline
-zend_class_entry *spl_ce_RecursiveIterator;
-zend_class_entry *spl_ce_RecursiveIteratorIterator;
-zend_class_entry *spl_ce_FilterIterator;
-zend_class_entry *spl_ce_ParentIterator;
-zend_class_entry *spl_ce_SeekableIterator;
-zend_class_entry *spl_ce_LimitIterator;
-zend_class_entry *spl_ce_CachingIterator;
-zend_class_entry *spl_ce_CachingRecursiveIterator;
+PHPAPI zend_class_entry *spl_ce_RecursiveIterator;
+PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator;
+PHPAPI zend_class_entry *spl_ce_FilterIterator;
+PHPAPI zend_class_entry *spl_ce_RecursiveFilterIterator;
+PHPAPI zend_class_entry *spl_ce_ParentIterator;
+PHPAPI zend_class_entry *spl_ce_SeekableIterator;
+PHPAPI zend_class_entry *spl_ce_LimitIterator;
+PHPAPI zend_class_entry *spl_ce_CachingIterator;
+PHPAPI zend_class_entry *spl_ce_RecursiveCachingIterator;
+PHPAPI zend_class_entry *spl_ce_OuterIterator;
+PHPAPI zend_class_entry *spl_ce_IteratorIterator;
+PHPAPI zend_class_entry *spl_ce_NoRewindIterator;
+PHPAPI zend_class_entry *spl_ce_InfiniteIterator;
+PHPAPI zend_class_entry *spl_ce_EmptyIterator;
+PHPAPI zend_class_entry *spl_ce_AppendIterator;
function_entry spl_funcs_RecursiveIterator[] = {
SPL_ABSTRACT_ME(RecursiveIterator, hasChildren, NULL)
@@ -51,44 +60,14 @@ function_entry spl_funcs_RecursiveIterator[] = {
{NULL, NULL, NULL}
};
-SPL_METHOD(RecursiveIteratorIterator, __construct);
-SPL_METHOD(RecursiveIteratorIterator, rewind);
-SPL_METHOD(RecursiveIteratorIterator, valid);
-SPL_METHOD(RecursiveIteratorIterator, key);
-SPL_METHOD(RecursiveIteratorIterator, current);
-SPL_METHOD(RecursiveIteratorIterator, next);
-SPL_METHOD(RecursiveIteratorIterator, getDepth);
-SPL_METHOD(RecursiveIteratorIterator, getSubIterator);
-
-static
-ZEND_BEGIN_ARG_INFO(arginfo_recursive_it___construct, 0)
- ZEND_ARG_OBJ_INFO(0, iterator, RecursiveIterator, 0)
- ZEND_ARG_INFO(0, mode)
-ZEND_END_ARG_INFO();
-
-static
-ZEND_BEGIN_ARG_INFO(arginfo_recursive_it_getSubIterator, 0)
- ZEND_ARG_INFO(0, level)
-ZEND_END_ARG_INFO();
-
-static zend_function_entry spl_funcs_RecursiveIteratorIterator[] = {
- SPL_ME(RecursiveIteratorIterator, __construct, arginfo_recursive_it___construct, ZEND_ACC_PUBLIC)
- SPL_ME(RecursiveIteratorIterator, rewind, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(RecursiveIteratorIterator, valid, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(RecursiveIteratorIterator, key, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(RecursiveIteratorIterator, current, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(RecursiveIteratorIterator, next, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(RecursiveIteratorIterator, getDepth, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(RecursiveIteratorIterator, getSubIterator,arginfo_recursive_it_getSubIterator, ZEND_ACC_PUBLIC)
- {NULL, NULL, NULL}
-};
-
typedef enum {
RIT_LEAVES_ONLY = 0,
RIT_SELF_FIRST = 1,
RIT_CHILD_FIRST = 2
} RecursiveIteratorMode;
+#define RIT_CATCH_GET_CHILD CIT_CATCH_GET_CHILD
+
typedef enum {
RS_NEXT = 0,
RS_TEST = 1,
@@ -109,6 +88,17 @@ typedef struct _spl_recursive_it_object {
spl_sub_iterator *iterators;
int level;
RecursiveIteratorMode mode;
+ int flags;
+ int max_depth;
+ zend_bool in_iteration;
+ zend_function *beginIteration;
+ zend_function *endIteration;
+ zend_function *callHasChildren;
+ zend_function *callGetChildren;
+ zend_function *beginChildren;
+ zend_function *endChildren;
+ zend_function *nextElement;
+ zend_class_entry *ce;
} spl_recursive_it_object;
typedef struct _spl_recursive_it_iterator {
@@ -130,14 +120,14 @@ static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
sub_iter->funcs->dtor(sub_iter TSRMLS_CC);
zval_ptr_dtor(&object->iterators[object->level--].zobject);
}
- erealloc(object->iterators, sizeof(spl_sub_iterator));
+ object->iterators = erealloc(object->iterators, sizeof(spl_sub_iterator));
object->level = 0;
zval_ptr_dtor(&iter->zobject);
efree(iter);
}
-static int spl_recursive_it_valid_ex(spl_recursive_it_object *object TSRMLS_DC)
+static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC)
{
zend_object_iterator *sub_iter;
int level = object->level;
@@ -149,6 +139,10 @@ static int spl_recursive_it_valid_ex(spl_recursive_it_object *object TSRMLS_DC)
}
level--;
}
+ if (object->endIteration && object->in_iteration) {
+ zend_call_method_with_0_params(&zthis, object->ce, &object->endIteration, "endIteration", NULL);
+ }
+ object->in_iteration = 0;
return FAILURE;
}
@@ -156,7 +150,7 @@ static int spl_recursive_it_valid(zend_object_iterator *iter TSRMLS_DC)
{
spl_recursive_it_object *object = (spl_recursive_it_object*)iter->data;
- return spl_recursive_it_valid_ex(object TSRMLS_CC);
+ return spl_recursive_it_valid_ex(object, ((spl_recursive_it_iterator*)iter)->zobject TSRMLS_CC);
}
static void spl_recursive_it_get_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC)
@@ -180,7 +174,7 @@ static int spl_recursive_it_get_current_key(zend_object_iterator *iter, char **s
}
}
-static void spl_recursive_it_move_forward_ex(spl_recursive_it_object *object TSRMLS_DC)
+static void spl_recursive_it_move_forward_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC)
{
zend_object_iterator *iterator;
zval *zobject;
@@ -204,25 +198,44 @@ next_step:
case RS_TEST:
ce = object->iterators[object->level].ce;
zobject = object->iterators[object->level].zobject;
- zend_call_method_with_0_params(&zobject, ce, NULL, "haschildren", &retval);
+ if (object->callHasChildren) {
+ zend_call_method_with_0_params(&zthis, object->ce, &object->callHasChildren, "callHasChildren", &retval);
+ } else {
+ zend_call_method_with_0_params(&zobject, ce, NULL, "haschildren", &retval);
+ }
if (retval) {
has_children = zend_is_true(retval);
zval_ptr_dtor(&retval);
if (has_children) {
+ if (object->max_depth == -1 || object->max_depth > object->level) {
switch (object->mode) {
- case RIT_LEAVES_ONLY:
- case RIT_CHILD_FIRST:
- object->iterators[object->level].state = RS_CHILD;
- goto next_step;
- case RIT_SELF_FIRST:
- object->iterators[object->level].state = RS_SELF;
+ case RIT_LEAVES_ONLY:
+ case RIT_CHILD_FIRST:
+ object->iterators[object->level].state = RS_CHILD;
+ goto next_step;
+ case RIT_SELF_FIRST:
+ object->iterators[object->level].state = RS_SELF;
+ goto next_step;
+ }
+ } else {
+ /* do not recurse into */
+ if (object->mode == RIT_LEAVES_ONLY) {
+ /* this is not a leave, so skip it */
+ object->iterators[object->level].state = RS_NEXT;
goto next_step;
+ }
}
}
}
+ if (object->nextElement) {
+ zend_call_method_with_0_params(&zthis, object->ce, &object->nextElement, "nextelement", NULL);
+ }
object->iterators[object->level].state = RS_NEXT;
return /* self */;
case RS_SELF:
+ if (object->nextElement && (object->mode == RIT_SELF_FIRST || object->mode == RIT_CHILD_FIRST)) {
+ zend_call_method_with_0_params(&zthis, object->ce, &object->nextElement, "nextelement", NULL);
+ }
if (object->mode == RIT_SELF_FIRST) {
object->iterators[object->level].state = RS_CHILD;
} else {
@@ -232,13 +245,31 @@ next_step:
case RS_CHILD:
ce = object->iterators[object->level].ce;
zobject = object->iterators[object->level].zobject;
- zend_call_method_with_0_params(&zobject, ce, NULL, "getchildren", &child);
+ if (object->callGetChildren) {
+ zend_call_method_with_0_params(&zthis, object->ce, &object->callGetChildren, "callGetChildren", &child);
+ } else {
+ zend_call_method_with_0_params(&zobject, ce, NULL, "getchildren", &child);
+ }
+
+ if (EG(exception)) {
+ if (!(object->flags & RIT_CATCH_GET_CHILD)) {
+ return;
+ } else {
+ zend_clear_exception(TSRMLS_C);
+ if (child) {
+ zval_ptr_dtor(&child);
+ }
+ object->iterators[object->level].state = RS_NEXT;
+ goto next_step;
+ }
+ }
+
ce = child && Z_TYPE_P(child) == IS_OBJECT ? Z_OBJCE_P(child) : NULL;
if (!ce || !instanceof_function(ce, spl_ce_RecursiveIterator TSRMLS_CC)) {
if (child) {
zval_ptr_dtor(&child);
}
- zend_throw_exception(zend_exception_get_default(), "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_UnexpectedValueException, "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0 TSRMLS_CC);
return;
}
if (object->mode == RIT_CHILD_FIRST) {
@@ -255,10 +286,16 @@ next_step:
if (sub_iter->funcs->rewind) {
sub_iter->funcs->rewind(sub_iter TSRMLS_CC);
}
+ if (object->beginChildren) {
+ zend_call_method_with_0_params(&zthis, object->ce, &object->beginChildren, "beginchildren", NULL);
+ }
goto next_step;
}
/* no more elements */
if (object->level > 0) {
+ if (object->endChildren) {
+ zend_call_method_with_0_params(&zthis, object->ce, &object->endChildren, "endchildren", NULL);
+ }
iterator->funcs->dtor(iterator TSRMLS_CC);
zval_ptr_dtor(&object->iterators[object->level].zobject);
object->level--;
@@ -268,7 +305,7 @@ next_step:
}
}
-static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object TSRMLS_DC)
+static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC)
{
zend_object_iterator *sub_iter;
@@ -276,6 +313,9 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object TSRMLS_DC
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) {
+ zend_call_method_with_0_params(&zthis, object->ce, &object->endChildren, "endchildren", NULL);
+ }
}
erealloc(object->iterators, sizeof(spl_sub_iterator));
object->iterators[0].state = RS_START;
@@ -283,17 +323,21 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object TSRMLS_DC
if (sub_iter->funcs->rewind) {
sub_iter->funcs->rewind(sub_iter TSRMLS_CC);
}
- spl_recursive_it_move_forward_ex(object TSRMLS_CC);
+ if (object->beginIteration && !object->in_iteration) {
+ zend_call_method_with_0_params(&zthis, object->ce, &object->beginIteration, "beginIteration", NULL);
+ }
+ object->in_iteration = 1;
+ spl_recursive_it_move_forward_ex(object, zthis TSRMLS_CC);
}
static void spl_recursive_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
{
- spl_recursive_it_move_forward_ex((spl_recursive_it_object*)iter->data TSRMLS_CC);
+ spl_recursive_it_move_forward_ex((spl_recursive_it_object*)iter->data, ((spl_recursive_it_iterator*)iter)->zobject TSRMLS_CC);
}
static void spl_recursive_it_rewind(zend_object_iterator *iter TSRMLS_DC)
{
- spl_recursive_it_rewind_ex((spl_recursive_it_object*)iter->data TSRMLS_CC);
+ 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)
@@ -317,7 +361,7 @@ zend_object_iterator_funcs spl_recursive_it_iterator_funcs = {
spl_recursive_it_rewind
};
-/* {{{ proto RecursiveIteratorIterator::__construct(RecursiveIterator it [, int flags = RIT_LEAVES_ONLY])
+/* {{{ proto RecursiveIteratorIterator::__construct(RecursiveIterator|IteratorAggregate it [, int mode = RIT_LEAVES_ONLY [, int flags = 0]]) throws InvalidArgumentException
Creates a RecursiveIteratorIterator from a RecursiveIterator. */
SPL_METHOD(RecursiveIteratorIterator, __construct)
{
@@ -325,12 +369,21 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
spl_recursive_it_object *intern;
zval *iterator;
zend_class_entry *ce_iterator;
- long mode = RIT_LEAVES_ONLY;
+ long mode = RIT_LEAVES_ONLY, flags = 0;
- php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);
+ php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &iterator, spl_ce_RecursiveIterator, &mode) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|ll", &iterator, &mode, &flags) == SUCCESS) {
+ if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) {
+ zval *aggregate = iterator;
+ zend_call_method_with_0_params(&aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", &iterator);
+ }
+ } else {
+ iterator = NULL;
+ }
+ if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), spl_ce_RecursiveIterator TSRMLS_CC)) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC);
return;
}
@@ -338,6 +391,39 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
intern->iterators = emalloc(sizeof(spl_sub_iterator));
intern->level = 0;
intern->mode = mode;
+ intern->flags = flags;
+ intern->max_depth = -1;
+ intern->in_iteration = 0;
+ intern->ce = Z_OBJCE_P(object);
+
+ zend_hash_find(&intern->ce->function_table, "beginiteration", sizeof("beginiteration"), (void **) &intern->beginIteration);
+ if (intern->beginIteration->common.scope == spl_ce_RecursiveIteratorIterator) {
+ intern->beginIteration = NULL;
+ }
+ zend_hash_find(&intern->ce->function_table, "enditeration", sizeof("enditeration"), (void **) &intern->endIteration);
+ if (intern->endIteration->common.scope == spl_ce_RecursiveIteratorIterator) {
+ intern->endIteration = NULL;
+ }
+ zend_hash_find(&intern->ce->function_table, "callhaschildren", sizeof("callHasChildren"), (void **) &intern->callHasChildren);
+ if (intern->callHasChildren->common.scope == spl_ce_RecursiveIteratorIterator) {
+ intern->callHasChildren = NULL;
+ }
+ zend_hash_find(&intern->ce->function_table, "callgetchildren", sizeof("callGetChildren"), (void **) &intern->callGetChildren);
+ if (intern->callGetChildren->common.scope == spl_ce_RecursiveIteratorIterator) {
+ intern->callGetChildren = NULL;
+ }
+ zend_hash_find(&intern->ce->function_table, "beginchildren", sizeof("beginchildren"), (void **) &intern->beginChildren);
+ if (intern->beginChildren->common.scope == spl_ce_RecursiveIteratorIterator) {
+ intern->beginChildren = NULL;
+ }
+ zend_hash_find(&intern->ce->function_table, "endchildren", sizeof("endchildren"), (void **) &intern->endChildren);
+ if (intern->endChildren->common.scope == spl_ce_RecursiveIteratorIterator) {
+ intern->endChildren = NULL;
+ }
+ zend_hash_find(&intern->ce->function_table, "nextelement", sizeof("nextElement"), (void **) &intern->nextElement);
+ if (intern->nextElement->common.scope == spl_ce_RecursiveIteratorIterator) {
+ intern->nextElement = NULL;
+ }
ce_iterator = Z_OBJCE_P(iterator); /* respect inheritance, don't use spl_ce_RecursiveIterator */
intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, iterator TSRMLS_CC);
iterator->refcount++;
@@ -354,7 +440,7 @@ SPL_METHOD(RecursiveIteratorIterator, rewind)
{
spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
- spl_recursive_it_rewind_ex(object TSRMLS_CC);
+ spl_recursive_it_rewind_ex(object, getThis() TSRMLS_CC);
} /* }}} */
/* {{{ proto bolean RecursiveIteratorIterator::valid()
@@ -363,7 +449,7 @@ SPL_METHOD(RecursiveIteratorIterator, valid)
{
spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
- RETURN_BOOL(spl_recursive_it_valid_ex(object TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(spl_recursive_it_valid_ex(object, getThis() TSRMLS_CC) == SUCCESS);
} /* }}} */
/* {{{ proto mixed RecursiveIteratorIterator::key()
@@ -405,7 +491,7 @@ SPL_METHOD(RecursiveIteratorIterator, next)
{
spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
- spl_recursive_it_move_forward_ex(object TSRMLS_CC);
+ spl_recursive_it_move_forward_ex(object, getThis() TSRMLS_CC);
} /* }}} */
/* {{{ proto int RecursiveIteratorIterator::getDepth()
@@ -433,6 +519,136 @@ SPL_METHOD(RecursiveIteratorIterator, getSubIterator)
RETURN_ZVAL(object->iterators[level].zobject, 1, 0);
} /* }}} */
+/* {{{ proto RecursiveIterator RecursiveIteratorIterator::getInnerIterator()
+ The current active sub iterator */
+SPL_METHOD(RecursiveIteratorIterator, getInnerIterator)
+{
+ spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ long level = object->level;
+
+ RETURN_ZVAL(object->iterators[level].zobject, 1, 0);
+} /* }}} */
+
+/* {{{ proto RecursiveIterator RecursiveIteratorIterator::beginIteration()
+ Called when iteration begins (after first rewind() call) */
+SPL_METHOD(RecursiveIteratorIterator, beginIteration)
+{
+ /* nothing to do */
+} /* }}} */
+
+/* {{{ proto RecursiveIterator RecursiveIteratorIterator::endIteration()
+ Called when iteration ends (when valid() first returns false */
+SPL_METHOD(RecursiveIteratorIterator, endIteration)
+{
+ /* nothing to do */
+} /* }}} */
+
+/* {{{ proto bool RecursiveIteratorIterator::callHasChildren()
+ Called for each element to test whether it has children */
+SPL_METHOD(RecursiveIteratorIterator, callHasChildren)
+{
+ spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ zend_class_entry *ce = object->iterators[object->level].ce;
+ zval *retval, *zobject;
+
+ zobject = object->iterators[object->level].zobject;
+ if (!zobject) {
+ RETURN_FALSE;
+ } else {
+ zend_call_method_with_0_params(&zobject, ce, NULL, "haschildren", &retval);
+ RETURN_ZVAL(retval, 0, 1);
+ }
+} /* }}} */
+
+/* {{{ proto RecursiveIterator RecursiveIteratorIterator::callGetChildren()
+ Return children of current element */
+SPL_METHOD(RecursiveIteratorIterator, callGetChildren)
+{
+ spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ zend_class_entry *ce = object->iterators[object->level].ce;
+ zval *retval, *zobject;
+
+ zobject = object->iterators[object->level].zobject;
+ if (!zobject) {
+ return;
+ } else {
+ zend_call_method_with_0_params(&zobject, ce, NULL, "getchildren", &retval);
+ if (retval) {
+ RETURN_ZVAL(retval, 0, 1);
+ }
+ }
+} /* }}} */
+
+/* {{{ proto RecursiveIterator RecursiveIteratorIterator::beginChildren()
+ Called when recursing one level down */
+SPL_METHOD(RecursiveIteratorIterator, beginChildren)
+{
+ /* nothing to do */
+} /* }}} */
+
+/* {{{ proto RecursiveIterator RecursiveIteratorIterator::endChildren()
+ Called when end recursing one level */
+SPL_METHOD(RecursiveIteratorIterator, endChildren)
+{
+ /* nothing to do */
+} /* }}} */
+
+/* {{{ proto RecursiveIterator RecursiveIteratorIterator::nextElement()
+ Called when the next element is available */
+SPL_METHOD(RecursiveIteratorIterator, nextElement)
+{
+ /* nothing to do */
+} /* }}} */
+
+/* {{{ proto RecursiveIterator RecursiveIteratorIterator::setMaxDepth([$max_depth = -1])
+ Set the maximum allowed depth (or any depth if pmax_depth = -1] */
+SPL_METHOD(RecursiveIteratorIterator, setMaxDepth)
+{
+ spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ long max_depth = -1;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_depth) == FAILURE) {
+ return;
+ }
+ if (max_depth < -1) {
+ zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0 TSRMLS_CC);
+ return;
+ }
+ object->max_depth = max_depth;
+} /* }}} */
+
+/* {{{ proto RecursiveIterator RecursiveIteratorIterator::getMaxDepth()
+ Return the maximum accepted depth or false if any depth is allowed */
+SPL_METHOD(RecursiveIteratorIterator, getMaxDepth)
+{
+ spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (object->max_depth == -1) {
+ RETURN_FALSE;
+ } else {
+ RETURN_LONG(object->max_depth);
+ }
+} /* }}} */
+
+static union _zend_function *spl_recursive_it_get_method(zval **object_ptr, char *method, int method_len TSRMLS_DC)
+{
+ union _zend_function *function_handler;
+ spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(*object_ptr TSRMLS_CC);
+ long level = object->level;
+ zval *zobj = object->iterators[level].zobject;
+
+ function_handler = std_object_handlers.get_method(object_ptr, method, method_len TSRMLS_CC);
+ if (!function_handler) {
+ if (zend_hash_find(&Z_OBJCE_P(zobj)->function_table, method, method_len+1, (void **) &function_handler) == FAILURE) {
+ if (Z_OBJ_HT_P(zobj)->get_method) {
+ *object_ptr = zobj;
+ function_handler = Z_OBJ_HT_P(*object_ptr)->get_method(object_ptr, method, method_len TSRMLS_CC);
+ }
+ }
+ }
+ return function_handler;
+}
+
/* {{{ spl_RecursiveIteratorIterator_dtor */
static void spl_RecursiveIteratorIterator_free_storage(void *_object TSRMLS_DC)
{
@@ -446,6 +662,7 @@ static void spl_RecursiveIteratorIterator_free_storage(void *_object TSRMLS_DC)
zval_ptr_dtor(&object->iterators[object->level--].zobject);
}
efree(object->iterators);
+ object->iterators = NULL;
}
zend_hash_destroy(object->std.properties);
@@ -470,12 +687,50 @@ static zend_object_value spl_RecursiveIteratorIterator_new(zend_class_entry *cla
zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
- retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_RecursiveIteratorIterator_free_storage, NULL TSRMLS_CC);
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) spl_RecursiveIteratorIterator_free_storage, NULL TSRMLS_CC);
retval.handlers = &spl_handlers_rec_it_it;
return retval;
}
/* }}} */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_recursive_it___construct, 0)
+ ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_recursive_it_getSubIterator, 0)
+ ZEND_ARG_INFO(0, level)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_recursive_it_setMaxDepth, 0)
+ ZEND_ARG_INFO(0, max_depth)
+ZEND_END_ARG_INFO();
+
+static zend_function_entry spl_funcs_RecursiveIteratorIterator[] = {
+ SPL_ME(RecursiveIteratorIterator, __construct, arginfo_recursive_it___construct, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, rewind, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, valid, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, key, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, current, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, next, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, getDepth, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, getSubIterator, arginfo_recursive_it_getSubIterator, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, getInnerIterator, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, beginIteration, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, endIteration, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, callHasChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, callGetChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, beginChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, endChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, nextElement, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, setMaxDepth, arginfo_recursive_it_setMaxDepth, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveIteratorIterator, getMaxDepth, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
#if MBO_0
static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
{
@@ -492,19 +747,19 @@ static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_
}
#endif
-static union _zend_function *spl_dual_it_get_method(zval *object_ptr, char *method, int method_len TSRMLS_DC)
+static union _zend_function *spl_dual_it_get_method(zval **object_ptr, char *method, int method_len TSRMLS_DC)
{
union _zend_function *function_handler;
spl_dual_it_object *intern;
- intern = (spl_dual_it_object*)zend_object_store_get_object(object_ptr TSRMLS_CC);
+ intern = (spl_dual_it_object*)zend_object_store_get_object(*object_ptr TSRMLS_CC);
function_handler = std_object_handlers.get_method(object_ptr, method, method_len TSRMLS_CC);
if (!function_handler) {
if (zend_hash_find(&intern->inner.ce->function_table, method, method_len+1, (void **) &function_handler) == FAILURE) {
if (Z_OBJ_HT_P(intern->inner.zobject)->get_method) {
- object_ptr = intern->inner.zobject;
- function_handler = Z_OBJ_HT_P(object_ptr)->get_method(object_ptr, method, method_len TSRMLS_CC);
+ *object_ptr = intern->inner.zobject;
+ function_handler = Z_OBJ_HT_P(*object_ptr)->get_method(object_ptr, method, method_len TSRMLS_CC);
}
}
}
@@ -555,12 +810,15 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
}
#endif
+static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC);
+
static INLINE spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, dual_it_type dit_type)
{
zval *zobject;
spl_dual_it_object *intern;
+ zend_class_entry *ce;
- php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);
+ php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC);
intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
@@ -575,26 +833,68 @@ static INLINE spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAME
}
if (intern->u.limit.offset < 0) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
- zend_throw_exception(zend_exception_get_default(), "Parameter offset must be > 0", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be > 0", 0 TSRMLS_CC);
return NULL;
}
if (intern->u.limit.count < 0 && intern->u.limit.count != -1) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
- zend_throw_exception(zend_exception_get_default(), "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC);
return NULL;
}
break;
}
case DIT_CachingIterator:
- case DIT_CachingRecursiveIterator: {
+ case DIT_RecursiveCachingIterator: {
long flags = CIT_CALL_TOSTRING;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &zobject, ce_inner, &flags) == FAILURE) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
return NULL;
}
+ if (((flags & CIT_CALL_TOSTRING) && (flags & (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT)))
+ || ((flags & (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT)) == (CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT))) {
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CIT_CALL_TOSTRING, CIT_TOSTRING_USE_KEY, CIT_TOSTRING_USE_CURRENT", 0 TSRMLS_CC);
+ return NULL;
+ }
intern->u.caching.flags |= flags & CIT_PUBLIC;
break;
}
+ case DIT_IteratorIterator: {
+ zend_class_entry **pce_cast;
+ char * class_name;
+ int class_name_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|s", &zobject, ce_inner, &class_name, &class_name_len) == FAILURE) {
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return NULL;
+ }
+ ce = Z_OBJCE_P(zobject);
+ if (!instanceof_function(ce, zend_ce_iterator TSRMLS_CC)) {
+ if (ZEND_NUM_ARGS() > 1) {
+ if (zend_lookup_class(class_name, class_name_len, &pce_cast TSRMLS_CC) == FAILURE
+ || !instanceof_function(ce, *pce_cast TSRMLS_CC)
+ || !(*pce_cast)->get_iterator
+ ) {
+ zend_throw_exception(spl_ce_LogicException, "Class to downcast to not found or not base class or does not implement Traversable", 0 TSRMLS_CC);
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return NULL;
+ }
+ ce = *pce_cast;
+ }
+ if (instanceof_function(ce, zend_ce_aggregate TSRMLS_CC)) {
+ zval *retval;
+ zobject = zend_call_method_with_0_params(&zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval);
+ ce = Z_OBJCE_P(zobject);
+ }
+ }
+ break;
+ }
+ case DIT_AppendIterator:
+ spl_instantiate(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);
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return intern;
default:
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zobject, ce_inner) == FAILURE) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -603,9 +903,11 @@ static INLINE spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAME
break;
}
+ php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);
+
zobject->refcount++;
intern->inner.zobject = zobject;
- intern->inner.ce = Z_OBJCE_P(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);
@@ -647,7 +949,6 @@ static INLINE void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
{
- spl_dual_it_require(intern TSRMLS_CC);
if (intern->inner.iterator && intern->inner.iterator->funcs->invalidate_current) {
intern->inner.iterator->funcs->invalidate_current(intern->inner.iterator TSRMLS_CC);
}
@@ -659,7 +960,7 @@ static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
efree(intern->current.str_key);
intern->current.str_key = NULL;
}
- if (intern->dit_type == DIT_CachingIterator || intern->dit_type == DIT_CachingRecursiveIterator) {
+ if (intern->dit_type == DIT_CachingIterator || intern->dit_type == DIT_RecursiveCachingIterator) {
if (intern->u.caching.zstr) {
zval_ptr_dtor(&intern->u.caching.zstr);
intern->u.caching.zstr = NULL;
@@ -718,6 +1019,7 @@ static INLINE void spl_dual_it_next(spl_dual_it_object *intern, int do_free TSRM
}
/* {{{ proto void ParentIterator::rewind()
+ proto void IteratorIterator::rewind()
Rewind the iterator
*/
SPL_METHOD(dual_it, rewind)
@@ -731,6 +1033,8 @@ SPL_METHOD(dual_it, rewind)
/* {{{ proto boolean FilterIterator::valid()
proto boolean ParentIterator::valid()
+ proto boolean IteratorIterator::valid()
+ proto boolean NoRewindIterator::valid()
Check whether the current element is valid */
SPL_METHOD(dual_it, valid)
{
@@ -745,6 +1049,9 @@ SPL_METHOD(dual_it, valid)
proto mixed CachingIterator::key()
proto mixed LimitIterator::key()
proto mixed ParentIterator::key()
+ proto mixed IteratorIterator::key()
+ proto mixed NoRewindIterator::key()
+ proto mixed AppendIterator::key()
Get the current key */
SPL_METHOD(dual_it, key)
{
@@ -766,6 +1073,9 @@ SPL_METHOD(dual_it, key)
proto mixed CachingIterator::current()
proto mixed LimitIterator::current()
proto mixed ParentIterator::current()
+ proto mixed IteratorIterator::current()
+ proto mixed NoRewindIterator::current()
+ proto mixed AppendIterator::current()
Get the current element value */
SPL_METHOD(dual_it, current)
{
@@ -781,6 +1091,8 @@ SPL_METHOD(dual_it, current)
} /* }}} */
/* {{{ proto void ParentIterator::next()
+ proto void IteratorIterator::next()
+ proto void NoRewindIterator::next()
Move the iterator forward */
SPL_METHOD(dual_it, next)
{
@@ -843,6 +1155,40 @@ SPL_METHOD(FilterIterator, next)
spl_filter_it_next(getThis(), intern TSRMLS_CC);
} /* }}} */
+/* {{{ proto RecursiveFilterIterator::__construct(RecursiveIterator it)
+ Create a RecursiveFilterIterator from a RecursiveIterator */
+SPL_METHOD(RecursiveFilterIterator, __construct)
+{
+ spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveIterator, DIT_Default);
+} /* }}} */
+
+/* {{{ proto boolean RecursiveFilterIterator::hasChildren()
+ Check whether the inner iterator's current element has children */
+SPL_METHOD(RecursiveFilterIterator, hasChildren)
+{
+ spl_dual_it_object *intern;
+ zval *retval;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "haschildren", &retval);
+ RETURN_ZVAL(retval, 0, 1);
+} /* }}} */
+
+/* {{{ proto RecursiveFilterIterator RecursiveFilterIterator::getChildren()
+ Return the inner iterator's children contained in a RecursiveFilterIterator */
+SPL_METHOD(RecursiveFilterIterator, getChildren)
+{
+ spl_dual_it_object *intern;
+ zval *retval;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
+ spl_instantiate_arg_ex1(spl_ce_RecursiveFilterIterator, &return_value, 0, retval TSRMLS_CC);
+ zval_ptr_dtor(&retval);
+} /* }}} */
+
/* {{{ proto ParentIterator::__construct(RecursiveIterator it)
Create a ParentIterator from a RecursiveIterator */
SPL_METHOD(ParentIterator, __construct)
@@ -891,6 +1237,11 @@ static INLINE void spl_dual_it_free_storage(void *_object TSRMLS_DC)
if (object->inner.zobject) {
zval_ptr_dtor(&object->inner.zobject);
}
+
+ if (object->dit_type == DIT_AppendIterator) {
+ object->u.append.iterator->funcs->dtor(object->u.append.iterator TSRMLS_CC);
+ zval_ptr_dtor(&object->u.append.zarrayit);
+ }
zend_hash_destroy(object->std.properties);
FREE_HASHTABLE(object->std.properties);
@@ -914,7 +1265,7 @@ static zend_object_value spl_dual_it_new(zend_class_entry *class_type TSRMLS_DC)
zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
- retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_dual_it_free_storage, NULL TSRMLS_CC);
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) spl_dual_it_free_storage, NULL TSRMLS_CC);
retval.handlers = &spl_handlers_dual_it;
return retval;
}
@@ -939,9 +1290,17 @@ static zend_function_entry spl_funcs_FilterIterator[] = {
static
ZEND_BEGIN_ARG_INFO(arginfo_parent_it___construct, 0)
- ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0)
+ ZEND_ARG_OBJ_INFO(0, iterator, RecursiveIterator, 0)
ZEND_END_ARG_INFO();
+static zend_function_entry spl_funcs_RecursiveFilterIterator[] = {
+ SPL_ME(RecursiveFilterIterator, __construct, arginfo_parent_it___construct, ZEND_ACC_PUBLIC)
+ SPL_MA(ParentIterator, accept, RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveFilterIterator, getChildren, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
static zend_function_entry spl_funcs_ParentIterator[] = {
SPL_ME(ParentIterator, __construct, arginfo_parent_it___construct, ZEND_ACC_PUBLIC)
SPL_MA(ParentIterator, accept, ParentIterator, hasChildren, NULL, ZEND_ACC_PUBLIC)
@@ -967,11 +1326,11 @@ static INLINE void spl_limit_it_seek(spl_dual_it_object *intern, long pos TSRMLS
spl_dual_it_free(intern TSRMLS_CC);
if (pos < intern->u.limit.offset) {
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Cannot seek to %ld which is below the offset %ld", pos, intern->u.limit.offset);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %ld which is below the offset %ld", pos, intern->u.limit.offset);
return;
}
if (pos > intern->u.limit.offset + intern->u.limit.count && intern->u.limit.count != -1) {
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Cannot seek to %ld which is behind offest %ld plus count %ld", pos, intern->u.limit.offset, intern->u.limit.count);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %ld which is behind offest %ld plus count %ld", pos, intern->u.limit.offset, intern->u.limit.count);
return;
}
if (instanceof_function(intern->inner.ce, spl_ce_SeekableIterator TSRMLS_CC)) {
@@ -1117,21 +1476,20 @@ 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;
- if (intern->dit_type == DIT_CachingRecursiveIterator) {
+ 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) {
- zval_ptr_dtor(&EG(exception));
- EG(exception) = NULL;
+ zend_clear_exception(TSRMLS_C);
if (zchildren) {
zval_ptr_dtor(&zchildren);
}
} else {
INIT_PZVAL(&zflags);
ZVAL_LONG(&zflags, intern->u.caching.flags & CIT_PUBLIC);
- spl_instantiate_arg_ex2(spl_ce_CachingRecursiveIterator, &intern->u.caching.zchildren, 1, zchildren, &zflags TSRMLS_CC);
+ spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &intern->u.caching.zchildren, 1, zchildren, &zflags TSRMLS_CC);
zval_ptr_dtor(&zchildren);
}
}
@@ -1251,8 +1609,21 @@ 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)) {
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "%s does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+ if (!(intern->u.caching.flags & (CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT))) {
+ 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) {
+ if (intern->current.key_type == HASH_KEY_IS_STRING) {
+ RETURN_STRINGL(intern->current.str_key, intern->current.str_key_len, 1);
+ } else {
+ RETVAL_LONG(intern->current.int_key);
+ convert_to_string(return_value);
+ return;
+ }
+ } else if (intern->u.caching.flags & CIT_TOSTRING_USE_CURRENT) {
+ RETVAL_ZVAL(intern->current.data, 1, 0);
+
+ return;
}
if (intern->u.caching.zstr) {
RETURN_STRINGL(Z_STRVAL_P(intern->u.caching.zstr), Z_STRLEN_P(intern->u.caching.zstr), 1);
@@ -1280,16 +1651,16 @@ static zend_function_entry spl_funcs_CachingIterator[] = {
{NULL, NULL, NULL}
};
-/* {{{ proto CachingRecursiveIterator::__construct(RecursiveIterator it [, flags = CIT_CALL_TOSTRING])
+/* {{{ proto RecursiveCachingIterator::__construct(RecursiveIterator it [, flags = CIT_CALL_TOSTRING])
Create an iterator from a RecursiveIterator */
-SPL_METHOD(CachingRecursiveIterator, __construct)
+SPL_METHOD(RecursiveCachingIterator, __construct)
{
- spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveIterator, DIT_CachingRecursiveIterator);
+ spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveIterator, DIT_RecursiveCachingIterator);
} /* }}} */
-/* {{{ proto bolean CachingRecursiveIterator::hasChildren()
+/* {{{ proto bolean RecursiveCachingIterator::hasChildren()
Check whether the current element of the inner iterator has children */
-SPL_METHOD(CachingRecursiveIterator, hasChildren)
+SPL_METHOD(RecursiveCachingIterator, hasChildren)
{
spl_dual_it_object *intern;
@@ -1298,9 +1669,9 @@ SPL_METHOD(CachingRecursiveIterator, hasChildren)
RETURN_BOOL(intern->u.caching.zchildren);
} /* }}} */
-/* {{{ proto CachingRecursiveIterator CachingRecursiveIterator::getChildren()
- Return the inner iterator's children as a CachingRecursiveIterator */
-SPL_METHOD(CachingRecursiveIterator, getChildren)
+/* {{{ proto RecursiveCachingIterator RecursiveCachingIterator::getChildren()
+ Return the inner iterator's children as a RecursiveCachingIterator */
+SPL_METHOD(RecursiveCachingIterator, getChildren)
{
spl_dual_it_object *intern;
@@ -1314,15 +1685,396 @@ SPL_METHOD(CachingRecursiveIterator, getChildren)
} /* }}} */
static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_caching_rec_it___construct, 0, ZEND_RETURN_REFERENCE_AGNOSTIC, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_caching_rec_it___construct, 0, ZEND_RETURN_VALUE, 2)
ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0)
ZEND_ARG_INFO(0, flags)
ZEND_END_ARG_INFO();
-static zend_function_entry spl_funcs_CachingRecursiveIterator[] = {
- SPL_ME(CachingRecursiveIterator, __construct, arginfo_caching_rec_it___construct, ZEND_ACC_PUBLIC)
- SPL_ME(CachingRecursiveIterator, hasChildren, NULL, ZEND_ACC_PUBLIC)
- SPL_ME(CachingRecursiveIterator, getChildren, NULL, ZEND_ACC_PUBLIC)
+static zend_function_entry spl_funcs_RecursiveCachingIterator[] = {
+ SPL_ME(RecursiveCachingIterator, __construct, arginfo_caching_rec_it___construct, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveCachingIterator, hasChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveCachingIterator, getChildren, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+/* {{{ proto IteratorIterator::__construct(Traversable it)
+ Create an iterator from anything that is traversable */
+SPL_METHOD(IteratorIterator, __construct)
+{
+ spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_traversable, DIT_IteratorIterator);
+} /* }}} */
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_iterator_it___construct, 0)
+ ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0)
+ZEND_END_ARG_INFO();
+
+static zend_function_entry spl_funcs_IteratorIterator[] = {
+ SPL_ME(IteratorIterator, __construct, arginfo_iterator_it___construct, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, rewind, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, valid, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, key, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, current, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, next, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+/* {{{ proto NoRewindIterator::__construct(Iterator it)
+ Create an iterator from another iterator */
+SPL_METHOD(NoRewindIterator, __construct)
+{
+ spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_NoRewindIterator);
+} /* }}} */
+
+/* {{{ proto void NoRewindIterator::rewind()
+ Prevent a call to inner iterators rewind() */
+SPL_METHOD(NoRewindIterator, rewind)
+{
+ /* nothing to do */
+} /* }}} */
+
+/* {{{ proto void NoRewindIterator::valid()
+ Return inner iterators valid() */
+SPL_METHOD(NoRewindIterator, valid)
+{
+ spl_dual_it_object *intern;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ RETURN_BOOL(intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC) == SUCCESS);
+} /* }}} */
+
+/* {{{ proto mixed NoRewindIterator::key()
+ Return inner iterators key() */
+SPL_METHOD(NoRewindIterator, key)
+{
+ spl_dual_it_object *intern;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (intern->inner.iterator->funcs->get_current_key) {
+ char *str_key;
+ uint str_key_len;
+ ulong int_key;
+ if (intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &str_key, &str_key_len, &int_key TSRMLS_CC) == HASH_KEY_IS_LONG) {
+ RETURN_LONG(int_key);
+ } else {
+ RETURN_STRINGL(str_key, str_key_len-1, 0);
+ }
+ } else {
+ RETURN_NULL();
+ }
+} /* }}} */
+
+/* {{{ proto mixed NoRewindIterator::current()
+ Return inner iterators current() */
+SPL_METHOD(NoRewindIterator, current)
+{
+ spl_dual_it_object *intern;
+ zval **data;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ intern->inner.iterator->funcs->get_current_data(intern->inner.iterator, &data TSRMLS_CC);
+ RETURN_ZVAL(*data, 1, 0);
+} /* }}} */
+
+/* {{{ proto void NoRewindIterator::next()
+ Return inner iterators next() */
+SPL_METHOD(NoRewindIterator, next)
+{
+ spl_dual_it_object *intern;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC);
+} /* }}} */
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_norewind_it___construct, 0)
+ ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0)
+ZEND_END_ARG_INFO();
+
+static zend_function_entry spl_funcs_NoRewindIterator[] = {
+ SPL_ME(NoRewindIterator, __construct, arginfo_norewind_it___construct, ZEND_ACC_PUBLIC)
+ SPL_ME(NoRewindIterator, rewind, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(NoRewindIterator, valid, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(NoRewindIterator, key, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(NoRewindIterator, current, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(NoRewindIterator, next, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+/* {{{ proto InfiniteIterator::__construct(Iterator it)
+ Create an iterator from another iterator */
+SPL_METHOD(InfiniteIterator, __construct)
+{
+ spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_InfiniteIterator);
+} /* }}} */
+
+/* {{{ proto InfiniteIterator::next()
+ Prevent a call to inner iterators rewind() (internally the current data will be fetched if valid()) */
+SPL_METHOD(InfiniteIterator, next)
+{
+ spl_dual_it_object *intern;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ spl_dual_it_next(intern, 1 TSRMLS_CC);
+ if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
+ spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ } else {
+ spl_dual_it_rewind(intern TSRMLS_CC);
+ if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
+ spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ }
+ }
+} /* }}} */
+
+static zend_function_entry spl_funcs_InfiniteIterator[] = {
+ SPL_ME(InfiniteIterator, __construct, arginfo_norewind_it___construct, ZEND_ACC_PUBLIC)
+ SPL_ME(InfiniteIterator, next, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+/* {{{ proto EmptyIterator::rewind()
+ Does nothing */
+SPL_METHOD(EmptyIterator, rewind)
+{
+} /* }}} */
+
+/* {{{ proto EmptyIterator::valid()
+ Return false */
+SPL_METHOD(EmptyIterator, valid)
+{
+ RETURN_FALSE;
+} /* }}} */
+
+/* {{{ proto EmptyIterator::key()
+ Throws exception */
+SPL_METHOD(EmptyIterator, key)
+{
+ zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the key of an EmptyIterator", 0 TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto EmptyIterator::current()
+ Throws exception */
+SPL_METHOD(EmptyIterator, current)
+{
+ zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the value of an EmptyIterator", 0 TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto EmptyIterator::next()
+ Does nothing */
+SPL_METHOD(EmptyIterator, next)
+{
+} /* }}} */
+
+static zend_function_entry spl_funcs_EmptyIterator[] = {
+ SPL_ME(EmptyIterator, rewind, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(EmptyIterator, valid, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(EmptyIterator, key, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(EmptyIterator, current, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(EmptyIterator, next, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+int spl_append_it_next_iterator(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/
+{
+ spl_dual_it_free(intern TSRMLS_CC);
+
+ if (intern->inner.zobject) {
+ zval_ptr_dtor(&intern->inner.zobject);
+ intern->inner.zobject = NULL;
+ intern->inner.ce = NULL;
+ intern->inner.object = NULL;
+ intern->inner.iterator = NULL;
+ }
+ if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) == SUCCESS) {
+ zval **it;
+
+ intern->u.append.iterator->funcs->get_current_data(intern->u.append.iterator, &it TSRMLS_CC);
+ (*it)->refcount++;
+ intern->inner.zobject = *it;
+ intern->inner.ce = Z_OBJCE_PP(it);
+ intern->inner.object = zend_object_store_get_object(*it TSRMLS_CC);
+ intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, *it TSRMLS_CC);
+ spl_dual_it_rewind(intern TSRMLS_CC);
+ intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator TSRMLS_CC);
+ return SUCCESS;
+ } else {
+ return FAILURE;
+ }
+} /* }}} */
+
+void spl_append_it_fetch(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/
+{
+ while (spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) {
+ if (spl_append_it_next_iterator(intern TSRMLS_CC) != SUCCESS) {
+ return;
+ }
+ }
+ spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+} /* }}} */
+
+void spl_append_it_next(spl_dual_it_object *intern TSRMLS_DC) /* {{{ */
+{
+ if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
+ spl_dual_it_next(intern, 1 TSRMLS_CC);
+ }
+ spl_append_it_fetch(intern TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto AppendIterator::__construct()
+ Create an AppendIterator */
+SPL_METHOD(AppendIterator, __construct)
+{
+ spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, zend_ce_iterator, DIT_AppendIterator);
+} /* }}} */
+
+/* {{{ proto void AppendIterator::append(Iterator it)
+ Append an iterator */
+SPL_METHOD(AppendIterator, append)
+{
+ spl_dual_it_object *intern;
+ zval *it;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &it, zend_ce_iterator) == FAILURE) {
+ return;
+ }
+ spl_array_iterator_append(intern->u.append.zarrayit, it TSRMLS_CC);
+
+ if (!intern->inner.iterator || spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) {
+ if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) != SUCCESS) {
+ intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC);
+ }
+ do {
+ spl_append_it_next_iterator(intern TSRMLS_CC);
+ } while (intern->inner.zobject != it);
+ spl_append_it_fetch(intern TSRMLS_CC);
+ }
+} /* }}} */
+
+/* {{{ proto void AppendIterator::rewind()
+ Rewind to the first iterator and rewind the first iterator, too */
+SPL_METHOD(AppendIterator, rewind)
+{
+ spl_dual_it_object *intern;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC);
+ if (spl_append_it_next_iterator(intern TSRMLS_CC) == SUCCESS) {
+ spl_append_it_fetch(intern TSRMLS_CC);
+ }
+} /* }}} */
+
+/* {{{ proto boolean AppendIterator::valid()
+ Check if the current state is valid */
+SPL_METHOD(AppendIterator, valid)
+{
+ spl_dual_it_object *intern;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_BOOL(intern->current.data);
+} /* }}} */
+
+/* {{{ proto AppendIterator::next()
+ Forward to next element */
+SPL_METHOD(AppendIterator, next)
+{
+ spl_dual_it_object *intern;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ spl_append_it_next(intern TSRMLS_CC);
+} /* }}} */
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_append_it_append, 0)
+ ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0)
+ZEND_END_ARG_INFO();
+
+static zend_function_entry spl_funcs_AppendIterator[] = {
+ SPL_ME(AppendIterator, __construct, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(AppendIterator, append, arginfo_append_it_append, ZEND_ACC_PUBLIC)
+ SPL_ME(AppendIterator, rewind, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(AppendIterator, valid, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, key, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, current, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(AppendIterator, next, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+/* {{{ array iterator_to_array(Traversable it)
+ Copy the iterator into an array */
+PHP_FUNCTION(iterator_to_array)
+{
+ zval *obj, **data;
+ zend_object_iterator *iter;
+ char *str_key;
+ uint str_key_len;
+ ulong int_key;
+ int key_type;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ array_init(return_value);
+
+ iter = Z_OBJCE_P(obj)->get_iterator(Z_OBJCE_P(obj), obj TSRMLS_CC);
+
+ iter->funcs->rewind(iter TSRMLS_CC);
+ while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
+ key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
+ iter->funcs->get_current_data(iter, &data TSRMLS_CC);
+ (*data)->refcount++;
+ switch(key_type) {
+ case HASH_KEY_IS_STRING:
+ add_assoc_zval_ex(return_value, str_key, str_key_len, *data);
+ efree(str_key);
+ break;
+ case HASH_KEY_IS_LONG:
+ add_index_zval(return_value, int_key, *data);
+ break;
+ }
+ iter->funcs->move_forward(iter TSRMLS_CC);
+ }
+ iter->funcs->dtor(iter TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ int iterator_count(Travesable it)
+ Count the elements in an iterator */
+PHP_FUNCTION(iterator_count)
+{
+ zval *obj;
+ zend_object_iterator *iter;
+ long count = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ iter = Z_OBJCE_P(obj)->get_iterator(Z_OBJCE_P(obj), obj TSRMLS_CC);
+
+ iter->funcs->rewind(iter TSRMLS_CC);
+ while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
+ count++;
+ iter->funcs->move_forward(iter TSRMLS_CC);
+ }
+ iter->funcs->dtor(iter TSRMLS_CC);
+
+ RETURN_LONG(count);
+}
+/* }}} */
+
+static zend_function_entry spl_funcs_OuterIterator[] = {
+ SPL_ABSTRACT_ME(OuterIterator, getInnerIterator, NULL)
{NULL, NULL, NULL}
};
@@ -1337,6 +2089,7 @@ PHP_MINIT_FUNCTION(spl_iterators)
REGISTER_SPL_ITERATOR(RecursiveIteratorIterator);
memcpy(&spl_handlers_rec_it_it, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ spl_handlers_rec_it_it.get_method = spl_recursive_it_get_method;
spl_handlers_rec_it_it.clone_obj = NULL;
memcpy(&spl_handlers_dual_it, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
@@ -1347,16 +2100,19 @@ PHP_MINIT_FUNCTION(spl_iterators)
spl_ce_RecursiveIteratorIterator->get_iterator = spl_recursive_it_get_iterator;
spl_ce_RecursiveIteratorIterator->iterator_funcs.funcs = &spl_recursive_it_iterator_funcs;
- REGISTER_LONG_CONSTANT("RIT_LEAVES_ONLY", (long)RIT_LEAVES_ONLY, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("RIT_SELF_FIRST", (long)RIT_SELF_FIRST, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("RIT_CHILD_FIRST", (long)RIT_CHILD_FIRST, CONST_CS | CONST_PERSISTENT);
+ REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "LEAVES_ONLY", RIT_LEAVES_ONLY);
+ REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "SELF_FIRST", RIT_SELF_FIRST);
+ REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "CHILD_FIRST", RIT_CHILD_FIRST);
+ REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "CATCH_GET_CHILD", RIT_CATCH_GET_CHILD);
REGISTER_SPL_STD_CLASS_EX(FilterIterator, spl_dual_it_new, spl_funcs_FilterIterator);
REGISTER_SPL_ITERATOR(FilterIterator);
spl_ce_FilterIterator->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
- REGISTER_SPL_SUB_CLASS_EX(ParentIterator, FilterIterator, spl_dual_it_new, spl_funcs_ParentIterator);
- REGISTER_SPL_IMPLEMENTS(ParentIterator, RecursiveIterator);
+ REGISTER_SPL_SUB_CLASS_EX(RecursiveFilterIterator, FilterIterator, spl_dual_it_new, spl_funcs_RecursiveFilterIterator);
+ REGISTER_SPL_IMPLEMENTS(RecursiveFilterIterator, RecursiveIterator);
+
+ REGISTER_SPL_SUB_CLASS_EX(ParentIterator, RecursiveFilterIterator, spl_dual_it_new, spl_funcs_ParentIterator);
REGISTER_SPL_INTERFACE(SeekableIterator);
REGISTER_SPL_ITERATOR(SeekableIterator);
@@ -1367,12 +2123,38 @@ PHP_MINIT_FUNCTION(spl_iterators)
REGISTER_SPL_STD_CLASS_EX(CachingIterator, spl_dual_it_new, spl_funcs_CachingIterator);
REGISTER_SPL_ITERATOR(CachingIterator);
- REGISTER_LONG_CONSTANT("CIT_CALL_TOSTRING", (long)CIT_CALL_TOSTRING, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("CIT_CATCH_GET_CHILD", (long)CIT_CATCH_GET_CHILD, CONST_CS | CONST_PERSISTENT);
+ 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_SUB_CLASS_EX(RecursiveCachingIterator, CachingIterator, spl_dual_it_new, spl_funcs_RecursiveCachingIterator);
+ REGISTER_SPL_IMPLEMENTS(RecursiveCachingIterator, RecursiveIterator);
+
+ REGISTER_SPL_STD_CLASS_EX(IteratorIterator, spl_dual_it_new, spl_funcs_IteratorIterator);
+ REGISTER_SPL_ITERATOR(IteratorIterator);
+
+ REGISTER_SPL_STD_CLASS_EX(NoRewindIterator, spl_dual_it_new, spl_funcs_NoRewindIterator);
+ REGISTER_SPL_ITERATOR(NoRewindIterator);
+
+ REGISTER_SPL_INTERFACE(OuterIterator);
+ REGISTER_SPL_ITERATOR(OuterIterator);
+
+ REGISTER_SPL_STD_CLASS_EX(AppendIterator, spl_dual_it_new, spl_funcs_AppendIterator);
+
+ REGISTER_SPL_IMPLEMENTS(RecursiveIteratorIterator, OuterIterator);
+ REGISTER_SPL_IMPLEMENTS(CachingIterator, OuterIterator);
+ REGISTER_SPL_IMPLEMENTS(FilterIterator, OuterIterator);
+ REGISTER_SPL_IMPLEMENTS(LimitIterator, OuterIterator);
+ REGISTER_SPL_IMPLEMENTS(IteratorIterator, OuterIterator);
+ REGISTER_SPL_IMPLEMENTS(NoRewindIterator, OuterIterator);
+ REGISTER_SPL_IMPLEMENTS(AppendIterator, OuterIterator);
+
+ REGISTER_SPL_SUB_CLASS_EX(InfiniteIterator, IteratorIterator, spl_dual_it_new, spl_funcs_InfiniteIterator);
+
+ REGISTER_SPL_STD_CLASS_EX(EmptyIterator, NULL, spl_funcs_EmptyIterator);
+ REGISTER_SPL_ITERATOR(EmptyIterator);
- REGISTER_SPL_SUB_CLASS_EX(CachingRecursiveIterator, CachingIterator, spl_dual_it_new, spl_funcs_CachingRecursiveIterator);
- REGISTER_SPL_IMPLEMENTS(CachingRecursiveIterator, RecursiveIterator);
-
return SUCCESS;
}
/* }}} */
diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h
index 9177b269c..7c951791c 100755
--- a/ext/spl/spl_iterators.h
+++ b/ext/spl/spl_iterators.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_iterators.h,v 1.9 2004/03/08 18:05:41 helly Exp $ */
+/* $Id: spl_iterators.h,v 1.18.2.5 2005/10/08 19:09:58 helly Exp $ */
#ifndef SPL_ITERATORS_H
#define SPL_ITERATORS_H
@@ -24,32 +24,54 @@
#include "php.h"
#include "php_spl.h"
-extern zend_class_entry *spl_ce_RecursiveIterator;
-extern zend_class_entry *spl_ce_RecursiveIteratorIterator;
-extern zend_class_entry *spl_ce_FilterIterator;
-extern zend_class_entry *spl_ce_ParentIterator;
-extern zend_class_entry *spl_ce_SeekableIterator;
-extern zend_class_entry *spl_ce_LimitIterator;
-extern zend_class_entry *spl_ce_CachingIterator;
-extern zend_class_entry *spl_ce_CachingRecursiveIterator;
+#define spl_ce_Traversable zend_ce_traversable
+#define spl_ce_Iterator zend_ce_iterator
+#define spl_ce_Aggregate zend_ce_aggregate
+#define spl_ce_ArrayAccess zend_ce_arrayaccess
+#define spl_ce_Serializable zend_ce_serializable
+
+extern PHPAPI zend_class_entry *spl_ce_RecursiveIterator;
+extern PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator;
+extern PHPAPI zend_class_entry *spl_ce_FilterIterator;
+extern PHPAPI zend_class_entry *spl_ce_RecursiveFilterIterator;
+extern PHPAPI zend_class_entry *spl_ce_ParentIterator;
+extern PHPAPI zend_class_entry *spl_ce_SeekableIterator;
+extern PHPAPI zend_class_entry *spl_ce_LimitIterator;
+extern PHPAPI zend_class_entry *spl_ce_CachingIterator;
+extern PHPAPI zend_class_entry *spl_ce_RecursiveCachingIterator;
+extern PHPAPI zend_class_entry *spl_ce_OuterIterator;
+extern PHPAPI zend_class_entry *spl_ce_IteratorIterator;
+extern PHPAPI zend_class_entry *spl_ce_NoRewindIterator;
+extern PHPAPI zend_class_entry *spl_ce_InfiniteIterator;
+extern PHPAPI zend_class_entry *spl_ce_EmptyIterator;
+extern PHPAPI zend_class_entry *spl_ce_AppendIterator;
PHP_MINIT_FUNCTION(spl_iterators);
+PHP_FUNCTION(iterator_to_array);
+PHP_FUNCTION(iterator_count);
+
typedef enum {
DIT_Default = 0,
DIT_LimitIterator,
DIT_CachingIterator,
- DIT_CachingRecursiveIterator
+ DIT_RecursiveCachingIterator,
+ DIT_IteratorIterator,
+ DIT_NoRewindIterator,
+ DIT_InfiniteIterator,
+ DIT_AppendIterator,
} dual_it_type;
enum {
/* public */
- CIT_CALL_TOSTRING = 1,
- CIT_CATCH_GET_CHILD = 2,
- CIT_PUBLIC = CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD,
+ CIT_CALL_TOSTRING = 0x00000001,
+ CIT_CATCH_GET_CHILD = 0x00000002,
+ CIT_TOSTRING_USE_KEY = 0x00000010,
+ CIT_TOSTRING_USE_CURRENT = 0x00000020,
+ CIT_PUBLIC = 0x0000FFFF,
/* private */
- CIT_VALID = 4,
- CIT_HAS_CHILDREN = 8
+ CIT_VALID = 0x00010000,
+ CIT_HAS_CHILDREN = 0x00020000
};
typedef struct _spl_dual_it_object {
@@ -75,10 +97,14 @@ typedef struct _spl_dual_it_object {
long count;
} limit;
struct {
- int flags; /* CIT_VALID, CIT_CALL_TOSTRING, CIT_CATCH_GET_CHILD */
+ int flags; /* CIT_* */
zval *zstr;
zval *zchildren;
} caching;
+ struct {
+ zval *zarrayit;
+ zend_object_iterator *iterator;
+ } append;
} u;
} spl_dual_it_object;
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
new file mode 100755
index 000000000..fae0d58ab
--- /dev/null
+++ b/ext/spl/spl_observer.c
@@ -0,0 +1,273 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is SplSubject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Marcus Boerger <helly@php.net> |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: spl_observer.c,v 1.2.2.2 2005/11/14 22:03:02 tony2001 Exp $ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "zend_interfaces.h"
+#include "zend_exceptions.h"
+
+#include "php_spl.h"
+#include "spl_functions.h"
+#include "spl_engine.h"
+#include "spl_observer.h"
+#include "spl_iterators.h"
+#include "spl_array.h"
+
+SPL_METHOD(SplObserver, update);
+SPL_METHOD(SplSubject, attach);
+SPL_METHOD(SplSubject, detach);
+SPL_METHOD(SplSubject, notify);
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_SplObserver_update, 0)
+ ZEND_ARG_OBJ_INFO(0, SplSubject, SplSubject, 0)
+ZEND_END_ARG_INFO();
+
+static zend_function_entry spl_funcs_SplObserver[] = {
+ SPL_ABSTRACT_ME(SplObserver, update, arginfo_SplObserver_update)
+ {NULL, NULL, NULL}
+};
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_SplSubject_attach, 0)
+ ZEND_ARG_OBJ_INFO(0, SplObserver, SplObserver, 0)
+ZEND_END_ARG_INFO();
+
+/*static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_SplSubject_notify, 0, 0, 1)
+ ZEND_ARG_OBJ_INFO(0, ignore, SplObserver, 1)
+ZEND_END_ARG_INFO();*/
+
+static zend_function_entry spl_funcs_SplSubject[] = {
+ SPL_ABSTRACT_ME(SplSubject, attach, arginfo_SplSubject_attach)
+ SPL_ABSTRACT_ME(SplSubject, detach, arginfo_SplSubject_attach)
+ SPL_ABSTRACT_ME(SplSubject, notify, NULL)
+ {NULL, NULL, NULL}
+};
+
+PHPAPI zend_class_entry *spl_ce_SplObserver;
+PHPAPI zend_class_entry *spl_ce_SplSubject;
+PHPAPI zend_class_entry *spl_ce_SplObjectStorage;
+PHPAPI zend_object_handlers spl_handler_SplObjectStorage;
+
+typedef struct _spl_SplObjectStorage {
+ zend_object std;
+ HashTable storage;
+ long index;
+ HashPosition pos;
+} spl_SplObjectStorage;
+
+/* storage is an assoc aray of [zend_object_value]=>[zval*] */
+
+void spl_SplOjectStorage_free_storage(void *object TSRMLS_DC) /* {{{ */
+{
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage *)object;
+
+ zend_hash_destroy(intern->std.properties);
+ FREE_HASHTABLE(intern->std.properties);
+
+ zend_hash_destroy(&intern->storage);
+
+ efree(object);
+} /* }}} */
+
+static zend_object_value spl_object_storage_new_ex(zend_class_entry *class_type, spl_SplObjectStorage **obj, zval *orig TSRMLS_DC) /* {{{ */
+{
+ zend_object_value retval;
+ spl_SplObjectStorage *intern;
+ zval *tmp;
+
+ intern = emalloc(sizeof(spl_SplObjectStorage));
+ memset(intern, 0, sizeof(spl_SplObjectStorage));
+ intern->std.ce = class_type;
+ *obj = intern;
+
+ ALLOC_HASHTABLE(intern->std.properties);
+ zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+
+ zend_hash_init(&intern->storage, 0, NULL, ZVAL_PTR_DTOR, 0);
+
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) spl_SplOjectStorage_free_storage, NULL TSRMLS_CC);
+ retval.handlers = &spl_handler_SplObjectStorage;
+ return retval;
+}
+/* }}} */
+
+/* {{{ spl_array_object_new */
+static zend_object_value spl_SplObjectStorage_new(zend_class_entry *class_type TSRMLS_DC)
+{
+ spl_SplObjectStorage *tmp;
+ return spl_object_storage_new_ex(class_type, &tmp, NULL TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto void SplObjectStorage::attach($obj)
+ Attaches an object to the storage if not yet contained */
+SPL_METHOD(SplObjectStorage, attach)
+{
+ zval *obj;
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ return;
+ }
+
+ zend_hash_update(&intern->storage, (char*)&obj->value.obj, sizeof(obj->value.obj), &obj, sizeof(zval**), NULL);
+ obj->refcount++;
+} /* }}} */
+
+/* {{{ proto void SplObjectStorage::detach($obj)
+ Detaches an object from the storage */
+SPL_METHOD(SplObjectStorage, detach)
+{
+ zval *obj;
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ return;
+ }
+
+ zend_hash_del(&intern->storage, (char*)&obj->value.obj, sizeof(obj->value.obj));
+ zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
+ intern->index = 0;
+} /* }}} */
+
+/* {{{ proto bool SplObjectStorage::contains($obj)
+ Determine whethe an object is contained in the storage */
+SPL_METHOD(SplObjectStorage, contains)
+{
+ zval *obj;
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ return;
+ }
+
+ RETURN_BOOL(zend_hash_exists(&intern->storage, (char*)&obj->value.obj, sizeof(obj->value.obj)));
+} /* }}} */
+
+/* {{{ proto int SplObjectStorage::count()
+ Determine number of objects in storage */
+SPL_METHOD(SplObjectStorage, count)
+{
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_LONG(zend_hash_num_elements(&intern->storage));
+} /* }}} */
+
+/* {{{ proto void SplObjectStorage::rewind()
+ */
+SPL_METHOD(SplObjectStorage, rewind)
+{
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
+ intern->index = 0;
+} /* }}} */
+
+/* {{{ proto bool SplObjectStorage::valid()
+ */
+SPL_METHOD(SplObjectStorage, valid)
+{
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_BOOL(zend_hash_has_more_elements_ex(&intern->storage, &intern->pos) == SUCCESS);
+} /* }}} */
+
+/* {{{ proto mixed SplObjectStorage::key()
+ */
+SPL_METHOD(SplObjectStorage, key)
+{
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_LONG(intern->index);
+} /* }}} */
+
+/* {{{ proto mixed SplObjectStorage::current()
+ */
+SPL_METHOD(SplObjectStorage, current)
+{
+ zval **entry;
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (zend_hash_get_current_data_ex(&intern->storage, (void**)&entry, &intern->pos) == FAILURE) {
+ return;
+ }
+ RETVAL_ZVAL(*entry, 1, 0);
+} /* }}} */
+
+/* {{{ proto void SplObjectStorage::next()
+ */
+SPL_METHOD(SplObjectStorage, next)
+{
+ spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ zend_hash_move_forward_ex(&intern->storage, &intern->pos);
+ intern->index++;
+} /* }}} */
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_Object, 0)
+ ZEND_ARG_INFO(0, object 0)
+ZEND_END_ARG_INFO();
+
+static zend_function_entry spl_funcs_SplObjectStorage[] = {
+ SPL_ME(SplObjectStorage, attach, arginfo_Object, 0)
+ SPL_ME(SplObjectStorage, detach, arginfo_Object, 0)
+ SPL_ME(SplObjectStorage, contains, arginfo_Object, 0)
+ SPL_ME(SplObjectStorage, count, NULL, 0)
+ SPL_ME(SplObjectStorage, rewind, NULL, 0)
+ SPL_ME(SplObjectStorage, valid, NULL, 0)
+ SPL_ME(SplObjectStorage, key, NULL, 0)
+ SPL_ME(SplObjectStorage, current, NULL, 0)
+ SPL_ME(SplObjectStorage, next, NULL, 0)
+ {NULL, NULL, NULL}
+};
+
+/* {{{ PHP_MINIT_FUNCTION(spl_observer) */
+PHP_MINIT_FUNCTION(spl_observer)
+{
+ REGISTER_SPL_INTERFACE(SplObserver);
+ REGISTER_SPL_INTERFACE(SplSubject);
+
+ REGISTER_SPL_STD_CLASS_EX(SplObjectStorage, spl_SplObjectStorage_new, spl_funcs_SplObjectStorage);
+ memcpy(&spl_handler_SplObjectStorage, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+
+ REGISTER_SPL_IMPLEMENTS(SplObjectStorage, Countable);
+ REGISTER_SPL_IMPLEMENTS(SplObjectStorage, Iterator);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: fdm=marker
+ * vim: noet sw=4 ts=4
+ */
diff --git a/ext/ircg/ircg_thttpd.c b/ext/spl/spl_observer.h
index 283189a39..c0dc17d0f 100644..100755
--- a/ext/ircg/ircg_thttpd.c
+++ b/ext/spl/spl_observer.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,20 +12,31 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Author: Sascha Schumann <sascha@schumann.cx> |
+ | Authors: Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
-*/
+ */
-/* $Id: ircg_thttpd.c,v 1.5 2004/01/08 08:15:53 andi Exp $ */
+/* $Id: spl_observer.h,v 1.2.2.1 2005/09/15 03:33:04 helly Exp $ */
-int php_ircg_register_closed_connection(void (*http_closed_connection)(int))
-{
- thttpd_register_on_close(http_closed_connection);
- thttpd_set_dont_close();
- return 0;
-}
+#ifndef SPL_OBSERVER_H
+#define SPL_OBSERVER_H
-int php_ircg_register_with_sapi(int *fd TSRMLS_DC)
-{
- return sapi_get_fd(fd TSRMLS_CC);
-}
+#include "php.h"
+#include "php_spl.h"
+
+extern PHPAPI zend_class_entry *spl_ce_SplObserver;
+extern PHPAPI zend_class_entry *spl_ce_SplSubject;
+extern PHPAPI zend_class_entry *spl_ce_SplObjectStorage;
+
+PHP_MINIT_FUNCTION(spl_observer);
+
+#endif /* SPL_OBSERVER_H */
+
+/*
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ * vim600: fdm=marker
+ * vim: noet sw=4 ts=4
+ */
diff --git a/ext/spl/spl_sxe.c b/ext/spl/spl_sxe.c
index 27c61b852..ab554a694 100755
--- a/ext/spl/spl_sxe.c
+++ b/ext/spl/spl_sxe.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2003 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_sxe.c,v 1.7 2004/03/08 17:33:29 helly Exp $ */
+/* $Id: spl_sxe.c,v 1.8.2.2 2005/10/03 16:05:08 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -34,6 +34,7 @@
#include "spl_sxe.h"
zend_class_entry *spl_ce_SimpleXMLIterator = NULL;
+zend_class_entry *spl_ce_SimpleXMLElement;
#if HAVE_LIBXML && HAVE_SIMPLEXML
@@ -41,9 +42,10 @@ zend_class_entry *spl_ce_SimpleXMLIterator = NULL;
SPL_METHOD(SimpleXMLIterator, rewind) /* {{{ */
{
- php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
+ php_sxe_iterator iter;
- php_sxe_reset_iterator(sxe TSRMLS_CC);
+ iter.sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
+ spl_ce_SimpleXMLElement->iterator_funcs.funcs->rewind((zend_object_iterator*)&iter TSRMLS_CC);
}
/* }}} */
@@ -89,9 +91,10 @@ SPL_METHOD(SimpleXMLIterator, key) /* {{{ */
SPL_METHOD(SimpleXMLIterator, next) /* {{{ */
{
- php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
+ php_sxe_iterator iter;
- php_sxe_move_forward_iterator(sxe TSRMLS_CC);
+ iter.sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
+ spl_ce_SimpleXMLElement->iterator_funcs.funcs->move_forward((zend_object_iterator*)&iter TSRMLS_CC);
}
/* }}} */
@@ -146,13 +149,17 @@ static zend_function_entry spl_funcs_SimpleXMLIterator[] = {
SPL_API PHP_MINIT_FUNCTION(spl_sxe) /* {{{ */
{
- zend_class_entry *spl_ce_SimpleXML_Element = sxe_get_element_class_entry();
-
- if (!spl_ce_SimpleXML_Element) {
+ zend_class_entry **pce;
+
+ if (zend_hash_find(CG(class_table), "simplexmlelement", sizeof("SimpleXMLElement"), (void **) &pce) == FAILURE) {
+ spl_ce_SimpleXMLElement = NULL;
+ spl_ce_SimpleXMLIterator = NULL;
return SUCCESS; /* SimpleXML must be initialized before */
}
+
+ spl_ce_SimpleXMLElement = *pce;
- REGISTER_SPL_SUB_CLASS_EX(SimpleXMLIterator, SimpleXML_Element, sxe_object_new, spl_funcs_SimpleXMLIterator);
+ REGISTER_SPL_SUB_CLASS_EX(SimpleXMLIterator, SimpleXMLElement, spl_ce_SimpleXMLElement->create_object, spl_funcs_SimpleXMLIterator);
REGISTER_SPL_IMPLEMENTS(SimpleXMLIterator, RecursiveIterator);
return SUCCESS;
diff --git a/ext/spl/spl_sxe.h b/ext/spl/spl_sxe.h
index 61ced6046..f034d20e0 100755
--- a/ext/spl/spl_sxe.h
+++ b/ext/spl/spl_sxe.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2003 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: spl_sxe.h,v 1.3 2004/01/20 20:59:45 helly Exp $ */
+/* $Id: spl_sxe.h,v 1.4 2005/08/03 14:07:53 sniper Exp $ */
#ifndef SPL_SXE_H
#define SPL_SXE_H
diff --git a/ext/spl/tests/array_009.phpt b/ext/spl/tests/array_009.phpt
index 5499caad6..0431cca77 100755
--- a/ext/spl/tests/array_009.phpt
+++ b/ext/spl/tests/array_009.phpt
@@ -5,22 +5,9 @@ SPL: ArrayIterator implementing RecursiveIterator
--FILE--
<?php
-class RecursiceArrayIterator extends ArrayIterator implements RecursiveIterator
-{
- function hasChildren()
- {
- return is_array($this->current());
- }
-
- function getChildren()
- {
- return new RecursiceArrayIterator($this->current());
- }
-}
-
$array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3);
-$dir = new RecursiveIteratorIterator(new RecursiceArrayIterator($array), RIT_LEAVES_ONLY);
+$dir = new RecursiveIteratorIterator(new RecursiveArrayIterator($array), RecursiveIteratorIterator::LEAVES_ONLY);
foreach ($dir as $file) {
print "$file\n";
diff --git a/ext/spl/tests/array_009a.phpt b/ext/spl/tests/array_009a.phpt
new file mode 100755
index 000000000..aebac08ba
--- /dev/null
+++ b/ext/spl/tests/array_009a.phpt
@@ -0,0 +1,39 @@
+--TEST--
+SPL: ArrayIterator implementing RecursiveIterator
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRecursiveArrayIterator extends ArrayIterator implements RecursiveIterator
+{
+ function hasChildren()
+ {
+ return is_array($this->current());
+ }
+
+ function getChildren()
+ {
+ return new MyRecursiveArrayIterator($this->current());
+ }
+}
+
+$array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3);
+
+$dir = new RecursiveIteratorIterator(new MyRecursiveArrayIterator($array), RecursiveIteratorIterator::LEAVES_ONLY);
+
+foreach ($dir as $file) {
+ print "$file\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+1
+21
+221
+222
+231
+3
+===DONE===
diff --git a/ext/spl/tests/array_016.phpt b/ext/spl/tests/array_016.phpt
new file mode 100755
index 000000000..d4ea0ab39
--- /dev/null
+++ b/ext/spl/tests/array_016.phpt
@@ -0,0 +1,34 @@
+--TEST--
+SPL: ArrayItaerator/Object and IteratorIterator
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+$it = new ArrayIterator(range(0,3));
+
+foreach(new IteratorIterator($it) as $v)
+{
+ var_dump($v);
+}
+
+$it = new ArrayObject(range(0,3));
+
+foreach(new IteratorIterator($it) as $v)
+{
+ var_dump($v);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+int(0)
+int(1)
+int(2)
+int(3)
+int(0)
+int(1)
+int(2)
+int(3)
+===DONE===
diff --git a/ext/spl/tests/array_017.phpt b/ext/spl/tests/array_017.phpt
new file mode 100755
index 000000000..f028a1203
--- /dev/null
+++ b/ext/spl/tests/array_017.phpt
@@ -0,0 +1,649 @@
+--TEST--
+SPL: ArrayObject::exchangeArray($this)
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class ArrayIteratorEx extends ArrayIterator
+{
+ public $pub2 = 1;
+ protected $pro2 = 2;
+ private $pri2 = 3;
+
+ function __construct($ar, $flags = 0)
+ {
+ echo __METHOD__ . "()\n";
+ parent::__construct($ar, $flags);
+ $this->imp2 = 4;
+ }
+
+ function dump()
+ {
+ echo __METHOD__ . "()\n";
+ var_dump(array('Flags'=>$this->getFlags()
+ ,'OVars'=>get_object_vars($this)
+ ,'$this'=>$this));
+ }
+
+ function setFlags($flags)
+ {
+ echo __METHOD__ . "($flags)\n";
+ ArrayObject::setFlags($flags);
+ }
+}
+
+class ArrayObjectEx extends ArrayObject
+{
+ public $pub1 = 1;
+ protected $pro1 = 2;
+ private $pri1 = 3;
+
+ function __construct($ar = array(), $flags = 0)
+ {
+ echo __METHOD__ . "()\n";
+ parent::__construct($ar, $flags);
+ $this->imp1 = 4;
+ }
+
+ function exchange()
+ {
+ echo __METHOD__ . "()\n";
+ $this->exchangeArray($this);
+ }
+
+ function dump()
+ {
+ echo __METHOD__ . "()\n";
+ var_dump(array('Flags'=>$this->getFlags()
+ ,'OVars'=>get_object_vars($this)
+ ,'$this'=>$this));
+ }
+
+ function show()
+ {
+ echo __METHOD__ . "()\n";
+ foreach($this as $n => $v)
+ {
+ var_dump(array($n => $v));
+ }
+ }
+
+ function setFlags($flags)
+ {
+ echo __METHOD__ . "($flags)\n";
+ ArrayObject::setFlags($flags);
+ }
+
+ function getIterator()
+ {
+ echo __METHOD__ . "()\n";
+ $it = new ArrayIteratorEx($this, $this->getFlags());
+ $it->dyn2 = 5;
+ $it->dump();
+ return $it;
+ }
+}
+
+function check($obj, $flags)
+{
+ echo "===CHECK===\n";
+
+ $obj->setFlags($flags);
+ $obj->dump();
+ $obj->show();
+
+ echo "===FOREACH===\n";
+
+ $it = $obj->getIterator();
+ foreach($it as $n => $v)
+ {
+ var_dump(array($n => $v));
+ }
+
+ echo "===PROPERTY===\n";
+
+ var_dump($obj->pub1);
+ var_dump(isset($obj->a));
+ $obj->setFlags($flags | 2);
+ var_dump($obj->pub1);
+ var_dump(isset($obj->a));
+
+ var_dump($it->pub2);
+ var_dump(isset($it->pub1));
+ $it->setFlags($flags | 2);
+ var_dump($it->pub2);
+ var_dump(isset($it->pub1));
+}
+
+$obj = new ArrayObjectEx(array(0=>1,'a'=>25, 'pub1'=>42), 0);
+$obj->dyn1 = 5;
+
+check($obj, 0);
+check($obj, 1);
+
+echo "#####EXCHANGE#####\n";
+
+$obj->exchange();
+
+check($obj, 0);
+check($obj, 1);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+ArrayObjectEx::__construct()
+===CHECK===
+ArrayObjectEx::setFlags(0)
+ArrayObjectEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(0)
+ ["OVars"]=>
+ array(2) {
+ ["a"]=>
+ int(25)
+ ["pub1"]=>
+ int(42)
+ }
+ ["$this"]=>
+ object(ArrayObjectEx)#1 (3) {
+ [0]=>
+ int(1)
+ ["a"]=>
+ int(25)
+ ["pub1"]=>
+ int(42)
+ }
+}
+ArrayObjectEx::show()
+ArrayObjectEx::getIterator()
+ArrayIteratorEx::__construct()
+ArrayIteratorEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(0)
+ ["OVars"]=>
+ array(2) {
+ ["a"]=>
+ int(25)
+ ["pub1"]=>
+ int(42)
+ }
+ ["$this"]=>
+ object(ArrayIteratorEx)#2 (3) {
+ [0]=>
+ int(1)
+ ["a"]=>
+ int(25)
+ ["pub1"]=>
+ int(42)
+ }
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+array(1) {
+ ["a"]=>
+ int(25)
+}
+array(1) {
+ ["pub1"]=>
+ int(42)
+}
+===FOREACH===
+ArrayObjectEx::getIterator()
+ArrayIteratorEx::__construct()
+ArrayIteratorEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(0)
+ ["OVars"]=>
+ array(2) {
+ ["a"]=>
+ int(25)
+ ["pub1"]=>
+ int(42)
+ }
+ ["$this"]=>
+ object(ArrayIteratorEx)#3 (3) {
+ [0]=>
+ int(1)
+ ["a"]=>
+ int(25)
+ ["pub1"]=>
+ int(42)
+ }
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+array(1) {
+ ["a"]=>
+ int(25)
+}
+array(1) {
+ ["pub1"]=>
+ int(42)
+}
+===PROPERTY===
+int(1)
+bool(false)
+ArrayObjectEx::setFlags(2)
+int(1)
+bool(true)
+int(1)
+bool(false)
+ArrayIteratorEx::setFlags(2)
+int(1)
+bool(true)
+===CHECK===
+ArrayObjectEx::setFlags(1)
+ArrayObjectEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(1)
+ ["OVars"]=>
+ array(5) {
+ ["pub1"]=>
+ int(1)
+ ["pro1"]=>
+ int(2)
+ ["pri1"]=>
+ int(3)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+ ["$this"]=>
+ object(ArrayObjectEx)#1 (5) {
+ ["pub1"]=>
+ int(1)
+ ["pro1:protected"]=>
+ int(2)
+ ["pri1:private"]=>
+ int(3)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+}
+ArrayObjectEx::show()
+ArrayObjectEx::getIterator()
+ArrayIteratorEx::__construct()
+ArrayIteratorEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(1)
+ ["OVars"]=>
+ array(5) {
+ ["pub2"]=>
+ int(1)
+ ["pro2"]=>
+ int(2)
+ ["pri2"]=>
+ int(3)
+ ["imp2"]=>
+ int(4)
+ ["dyn2"]=>
+ int(5)
+ }
+ ["$this"]=>
+ object(ArrayIteratorEx)#3 (5) {
+ ["pub2"]=>
+ int(1)
+ ["pro2:protected"]=>
+ int(2)
+ ["pri2:private"]=>
+ int(3)
+ ["imp2"]=>
+ int(4)
+ ["dyn2"]=>
+ int(5)
+ }
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+array(1) {
+ ["a"]=>
+ int(25)
+}
+array(1) {
+ ["pub1"]=>
+ int(42)
+}
+===FOREACH===
+ArrayObjectEx::getIterator()
+ArrayIteratorEx::__construct()
+ArrayIteratorEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(1)
+ ["OVars"]=>
+ array(5) {
+ ["pub2"]=>
+ int(1)
+ ["pro2"]=>
+ int(2)
+ ["pri2"]=>
+ int(3)
+ ["imp2"]=>
+ int(4)
+ ["dyn2"]=>
+ int(5)
+ }
+ ["$this"]=>
+ object(ArrayIteratorEx)#2 (5) {
+ ["pub2"]=>
+ int(1)
+ ["pro2:protected"]=>
+ int(2)
+ ["pri2:private"]=>
+ int(3)
+ ["imp2"]=>
+ int(4)
+ ["dyn2"]=>
+ int(5)
+ }
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+array(1) {
+ ["a"]=>
+ int(25)
+}
+array(1) {
+ ["pub1"]=>
+ int(42)
+}
+===PROPERTY===
+int(1)
+bool(false)
+ArrayObjectEx::setFlags(3)
+int(1)
+bool(true)
+int(1)
+bool(false)
+ArrayIteratorEx::setFlags(3)
+int(1)
+bool(true)
+#####EXCHANGE#####
+ArrayObjectEx::exchange()
+===CHECK===
+ArrayObjectEx::setFlags(0)
+ArrayObjectEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(0)
+ ["OVars"]=>
+ array(5) {
+ ["pub1"]=>
+ int(1)
+ ["pro1"]=>
+ int(2)
+ ["pri1"]=>
+ int(3)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+ ["$this"]=>
+ object(ArrayObjectEx)#1 (5) {
+ ["pub1"]=>
+ int(1)
+ ["pro1:protected"]=>
+ int(2)
+ ["pri1:private"]=>
+ int(3)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+}
+ArrayObjectEx::show()
+ArrayObjectEx::getIterator()
+ArrayIteratorEx::__construct()
+ArrayIteratorEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(0)
+ ["OVars"]=>
+ array(4) {
+ ["pub1"]=>
+ int(1)
+ ["pro1"]=>
+ int(2)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+ ["$this"]=>
+ object(ArrayIteratorEx)#2 (5) {
+ ["pub1"]=>
+ int(1)
+ ["pro1:protected"]=>
+ int(2)
+ ["pri1:private"]=>
+ int(3)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+}
+array(1) {
+ ["pub1"]=>
+ int(1)
+}
+array(1) {
+ ["imp1"]=>
+ int(4)
+}
+array(1) {
+ ["dyn1"]=>
+ int(5)
+}
+===FOREACH===
+ArrayObjectEx::getIterator()
+ArrayIteratorEx::__construct()
+ArrayIteratorEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(0)
+ ["OVars"]=>
+ array(4) {
+ ["pub1"]=>
+ int(1)
+ ["pro1"]=>
+ int(2)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+ ["$this"]=>
+ object(ArrayIteratorEx)#3 (5) {
+ ["pub1"]=>
+ int(1)
+ ["pro1:protected"]=>
+ int(2)
+ ["pri1:private"]=>
+ int(3)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+}
+array(1) {
+ ["pub1"]=>
+ int(1)
+}
+array(1) {
+ ["imp1"]=>
+ int(4)
+}
+array(1) {
+ ["dyn1"]=>
+ int(5)
+}
+===PROPERTY===
+int(1)
+bool(false)
+ArrayObjectEx::setFlags(2)
+int(1)
+bool(false)
+int(1)
+bool(false)
+ArrayIteratorEx::setFlags(2)
+int(1)
+bool(true)
+===CHECK===
+ArrayObjectEx::setFlags(1)
+ArrayObjectEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(1)
+ ["OVars"]=>
+ array(5) {
+ ["pub1"]=>
+ int(1)
+ ["pro1"]=>
+ int(2)
+ ["pri1"]=>
+ int(3)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+ ["$this"]=>
+ object(ArrayObjectEx)#1 (5) {
+ ["pub1"]=>
+ int(1)
+ ["pro1:protected"]=>
+ int(2)
+ ["pri1:private"]=>
+ int(3)
+ ["imp1"]=>
+ int(4)
+ ["dyn1"]=>
+ int(5)
+ }
+}
+ArrayObjectEx::show()
+ArrayObjectEx::getIterator()
+ArrayIteratorEx::__construct()
+ArrayIteratorEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(1)
+ ["OVars"]=>
+ array(5) {
+ ["pub2"]=>
+ int(1)
+ ["pro2"]=>
+ int(2)
+ ["pri2"]=>
+ int(3)
+ ["imp2"]=>
+ int(4)
+ ["dyn2"]=>
+ int(5)
+ }
+ ["$this"]=>
+ object(ArrayIteratorEx)#3 (5) {
+ ["pub2"]=>
+ int(1)
+ ["pro2:protected"]=>
+ int(2)
+ ["pri2:private"]=>
+ int(3)
+ ["imp2"]=>
+ int(4)
+ ["dyn2"]=>
+ int(5)
+ }
+}
+array(1) {
+ ["pub1"]=>
+ int(1)
+}
+array(1) {
+ ["imp1"]=>
+ int(4)
+}
+array(1) {
+ ["dyn1"]=>
+ int(5)
+}
+===FOREACH===
+ArrayObjectEx::getIterator()
+ArrayIteratorEx::__construct()
+ArrayIteratorEx::dump()
+array(3) {
+ ["Flags"]=>
+ int(1)
+ ["OVars"]=>
+ array(5) {
+ ["pub2"]=>
+ int(1)
+ ["pro2"]=>
+ int(2)
+ ["pri2"]=>
+ int(3)
+ ["imp2"]=>
+ int(4)
+ ["dyn2"]=>
+ int(5)
+ }
+ ["$this"]=>
+ object(ArrayIteratorEx)#2 (5) {
+ ["pub2"]=>
+ int(1)
+ ["pro2:protected"]=>
+ int(2)
+ ["pri2:private"]=>
+ int(3)
+ ["imp2"]=>
+ int(4)
+ ["dyn2"]=>
+ int(5)
+ }
+}
+array(1) {
+ ["pub1"]=>
+ int(1)
+}
+array(1) {
+ ["imp1"]=>
+ int(4)
+}
+array(1) {
+ ["dyn1"]=>
+ int(5)
+}
+===PROPERTY===
+int(1)
+bool(false)
+ArrayObjectEx::setFlags(3)
+int(1)
+bool(false)
+int(1)
+bool(false)
+ArrayIteratorEx::setFlags(3)
+int(1)
+bool(true)
+===DONE===
diff --git a/ext/spl/tests/array_018.phpt b/ext/spl/tests/array_018.phpt
new file mode 100755
index 000000000..ef48b9749
--- /dev/null
+++ b/ext/spl/tests/array_018.phpt
@@ -0,0 +1,42 @@
+--TEST--
+SPL: ArrayObject and \0
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+try
+{
+ $foo = new ArrayObject();
+ $foo->offsetSet("\0", "Foo");
+}
+catch (Exception $e)
+{
+ var_dump($e->getMessage());
+}
+
+var_dump($foo);
+
+try
+{
+ $foo = new ArrayObject();
+ $data = explode("=", "=Foo");
+ $foo->offsetSet($data[0], $data[1]);
+}
+catch (Exception $e)
+{
+ var_dump($e->getMessage());
+}
+
+var_dump($foo);
+
+?>
+===DONE===
+--EXPECTF--
+string(44) "An offset must not begin with \0 or be empty"
+object(ArrayObject)#%d (0) {
+}
+string(44) "An offset must not begin with \0 or be empty"
+object(ArrayObject)#%d (0) {
+}
+===DONE===
diff --git a/ext/spl/tests/bug31926.phpt b/ext/spl/tests/bug31926.phpt
index 59043c412..443fef617 100755
--- a/ext/spl/tests/bug31926.phpt
+++ b/ext/spl/tests/bug31926.phpt
@@ -5,17 +5,6 @@ Bug #31926 (php in free() error with RecursiveArrayIterator)
$array = array(0 => array('world'));
-class RecursiveArrayIterator extends ArrayIterator implements
-RecursiveIterator {
- function hasChildren() {
- return (is_array($this->current()));
- }
-
- function getChildren() {
- return new self($this->current());
- }
-}
-
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
foreach($it as $key => $val) {
var_dump($key, $val);
diff --git a/ext/spl/tests/bug33136.phpt b/ext/spl/tests/bug33136.phpt
new file mode 100755
index 000000000..3adddfb5b
--- /dev/null
+++ b/ext/spl/tests/bug33136.phpt
@@ -0,0 +1,72 @@
+--TEST--
+Bug #33136 method offsetSet in class extended from ArrayObject crash PHP
+--FILE--
+<?php
+
+class Collection extends ArrayObject
+{
+ private $data;
+
+ function __construct()
+ {
+ $this->data = array();
+ parent::__construct($this->data);
+ }
+
+ function offsetGet($index)
+ {
+ echo __METHOD__ . "($index)\n";
+ return parent::offsetGet($index);
+ }
+
+ function offsetSet($index, $value)
+ {
+ echo __METHOD__ . "(" . (is_null($index) ? "NULL" : $index) . ",$value)\n";
+ parent::offsetSet($index, $value);
+ }
+}
+
+echo "\n\nInitiate Obj\n";
+$arrayObj = new Collection();
+
+echo "Assign values\n";
+
+$arrayObj[] = "foo";
+var_dump($arrayObj[0]);
+
+$arrayObj[] = "bar";
+var_dump($arrayObj[0]);
+var_dump($arrayObj[1]);
+
+$arrayObj["foo"] = "baz";
+var_dump($arrayObj["foo"]);
+
+print_r($arrayObj);
+
+var_dump(count($arrayObj));
+
+?>
+===DONE===
+<?php //exit(0); ?>
+--EXPECT--
+Initiate Obj
+Assign values
+Collection::offsetSet(NULL,foo)
+Collection::offsetGet(0)
+string(3) "foo"
+Collection::offsetSet(NULL,bar)
+Collection::offsetGet(0)
+string(3) "foo"
+Collection::offsetGet(1)
+string(3) "bar"
+Collection::offsetSet(foo,baz)
+Collection::offsetGet(foo)
+string(3) "baz"
+Collection Object
+(
+ [0] => foo
+ [1] => bar
+ [foo] => baz
+)
+int(3)
+===DONE===
diff --git a/ext/spl/tests/bug34548.phpt b/ext/spl/tests/bug34548.phpt
new file mode 100644
index 000000000..dff1375ab
--- /dev/null
+++ b/ext/spl/tests/bug34548.phpt
@@ -0,0 +1,38 @@
+--TEST--
+bug #34548 (Method append() in class extended from ArrayObject crashes PHP)
+--FILE--
+<?php
+
+class Collection extends ArrayObject
+{
+ public function add($dataArray)
+ {
+ foreach($dataArray as $value) $this->append($value);
+ }
+
+ public function offsetSet($index, $value)
+ {
+ parent::offsetSet($index, $value);
+ }
+}
+
+$data1=array('one', 'two', 'three');
+$data2=array('four', 'five');
+
+$foo=new Collection($data1);
+$foo->add($data2);
+
+print_r($foo->getArrayCopy());
+
+echo "Done\n";
+?>
+--EXPECT--
+Array
+(
+ [0] => one
+ [1] => two
+ [2] => three
+ [3] => four
+ [4] => five
+)
+Done
diff --git a/ext/spl/tests/fileobject_001.phpt b/ext/spl/tests/fileobject_001.phpt
new file mode 100755
index 000000000..61f688d79
--- /dev/null
+++ b/ext/spl/tests/fileobject_001.phpt
@@ -0,0 +1,88 @@
+--TEST--
+SPL: SplFileObject::seek'ing
+--FILE--
+<?php
+
+$o = new SplFileObject(dirname(__FILE__) . '/fileobject_001a.txt');
+
+var_dump($o->key());
+var_dump($o->current());
+$o->setFlags(SplFileObject::DROP_NEW_LINE);
+var_dump($o->key());
+var_dump($o->current());
+var_dump($o->key());
+$o->next();
+var_dump($o->key());
+var_dump($o->current());
+var_dump($o->key());
+$o->rewind();
+var_dump($o->key());
+var_dump($o->current());
+var_dump($o->key());
+$o->seek(4);
+var_dump($o->key());
+var_dump($o->current());
+var_dump($o->key());
+
+echo "===A===\n";
+foreach($o as $n => $l)
+{
+ var_dump($n, $l);
+}
+
+echo "===B===\n";
+$o = new SplFileObject(dirname(__FILE__) . '/fileobject_001b.txt');
+$o->setFlags(SplFileObject::DROP_NEW_LINE);
+foreach($o as $n => $l)
+{
+ var_dump($n, $l);
+}
+
+?>
+===DONE===
+--EXPECT--
+int(0)
+string(2) "0
+"
+int(0)
+string(2) "0
+"
+int(0)
+int(1)
+string(1) "1"
+int(1)
+int(0)
+string(1) "0"
+int(0)
+int(4)
+string(1) "4"
+int(4)
+===A===
+int(0)
+string(1) "0"
+int(1)
+string(1) "1"
+int(2)
+string(1) "2"
+int(3)
+string(1) "3"
+int(4)
+string(1) "4"
+int(5)
+string(1) "5"
+int(6)
+string(0) ""
+===B===
+int(0)
+string(1) "0"
+int(1)
+string(1) "1"
+int(2)
+string(1) "2"
+int(3)
+string(1) "3"
+int(4)
+string(1) "4"
+int(5)
+string(1) "5"
+===DONE===
diff --git a/ext/spl/tests/fileobject_001a.txt b/ext/spl/tests/fileobject_001a.txt
new file mode 100755
index 000000000..e8371f006
--- /dev/null
+++ b/ext/spl/tests/fileobject_001a.txt
@@ -0,0 +1,6 @@
+0
+1
+2
+3
+4
+5
diff --git a/ext/spl/tests/fileobject_001b.txt b/ext/spl/tests/fileobject_001b.txt
new file mode 100755
index 000000000..0c4a8b5cd
--- /dev/null
+++ b/ext/spl/tests/fileobject_001b.txt
@@ -0,0 +1,6 @@
+0
+1
+2
+3
+4
+5 \ No newline at end of file
diff --git a/ext/spl/tests/fileobject_002.phpt b/ext/spl/tests/fileobject_002.phpt
new file mode 100755
index 000000000..8031e98fd
--- /dev/null
+++ b/ext/spl/tests/fileobject_002.phpt
@@ -0,0 +1,122 @@
+--TEST--
+SPL: SplFileObject::fgetc
+--FILE--
+<?php
+
+function test($name)
+{
+ echo "===$name===\n";
+
+ $o = new SplFileObject(dirname(__FILE__) . '/' . $name);
+
+ var_dump($o->key());
+ while(($c = $o->fgetc()) !== false)
+ {
+ var_dump($o->key(), $c, $o->eof());
+ }
+ echo "===EOF?===\n";
+ var_dump($o->eof());
+ var_dump($o->key());
+ var_dump($o->eof());
+}
+
+test('fileobject_001a.txt');
+test('fileobject_001b.txt');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+===fileobject_001a.txt===
+int(0)
+int(0)
+string(1) "0"
+bool(false)
+int(1)
+string(1) "
+"
+bool(false)
+int(1)
+string(1) "1"
+bool(false)
+int(2)
+string(1) "
+"
+bool(false)
+int(2)
+string(1) "2"
+bool(false)
+int(3)
+string(1) "
+"
+bool(false)
+int(3)
+string(1) "3"
+bool(false)
+int(4)
+string(1) "
+"
+bool(false)
+int(4)
+string(1) "4"
+bool(false)
+int(5)
+string(1) "
+"
+bool(false)
+int(5)
+string(1) "5"
+bool(false)
+int(6)
+string(1) "
+"
+bool(false)
+===EOF?===
+bool(true)
+int(6)
+bool(true)
+===fileobject_001b.txt===
+int(0)
+int(0)
+string(1) "0"
+bool(false)
+int(1)
+string(1) "
+"
+bool(false)
+int(1)
+string(1) "1"
+bool(false)
+int(2)
+string(1) "
+"
+bool(false)
+int(2)
+string(1) "2"
+bool(false)
+int(3)
+string(1) "
+"
+bool(false)
+int(3)
+string(1) "3"
+bool(false)
+int(4)
+string(1) "
+"
+bool(false)
+int(4)
+string(1) "4"
+bool(false)
+int(5)
+string(1) "
+"
+bool(false)
+int(5)
+string(1) "5"
+bool(false)
+===EOF?===
+bool(true)
+int(5)
+bool(true)
+===DONE===
diff --git a/ext/spl/tests/iterator_001.phpt b/ext/spl/tests/iterator_001.phpt
index 2fd690294..223941777 100755
--- a/ext/spl/tests/iterator_001.phpt
+++ b/ext/spl/tests/iterator_001.phpt
@@ -47,7 +47,7 @@ class NumericArrayIterator implements Iterator
$this->i++;
}
- public function greaterThen($comp)
+ public function greaterThan($comp)
{
echo get_class($this) . '::' . __FUNCTION__ . '(' . $comp . ")\n";
return $this->current() > $comp;
@@ -69,7 +69,7 @@ $a = array(1, 2, 3, 4, 5);
$it = new LimitIterator(new NumericArrayIterator($a), 1, 3);
foreach ($it as $v)
{
- print $v . ' is ' . ($it->greaterThen(2) ? 'greater than 2' : 'less than or equal 2') . "\n";
+ print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n";
}
echo "===SEEKABLE===\n";
@@ -77,15 +77,16 @@ $a = array(1, 2, 3, 4, 5);
$it = new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3);
foreach($it as $v)
{
- print $v . ' is ' . ($it->greaterThen(2) ? 'greater than 2' : 'less than or equal 2') . "\n";
+ print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n";
}
echo "===STACKED===\n";
+echo "Shows '2 is greater than 2' because the test is actually done with the current value which is 3.\n";
$a = array(1, 2, 3, 4, 5);
$it = new CachingIterator(new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3));
foreach($it as $v)
{
- print $v . ' is ' . ($it->greaterThen(2) ? 'greater than 2' : 'less than or equal 2') . "\n";
+ print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n";
}
?>
@@ -100,19 +101,22 @@ NumericArrayIterator::valid(true)
NumericArrayIterator::valid(true)
NumericArrayIterator::current
NumericArrayIterator::key
-LimitIterator::greaterThen(2)
+NumericArrayIterator::greaterThan(2)
+NumericArrayIterator::current
2 is less than or equal 2
NumericArrayIterator::next
NumericArrayIterator::valid(true)
NumericArrayIterator::current
NumericArrayIterator::key
-LimitIterator::greaterThen(2)
+NumericArrayIterator::greaterThan(2)
+NumericArrayIterator::current
3 is greater than 2
NumericArrayIterator::next
NumericArrayIterator::valid(true)
NumericArrayIterator::current
NumericArrayIterator::key
-LimitIterator::greaterThen(2)
+NumericArrayIterator::greaterThan(2)
+NumericArrayIterator::current
4 is greater than 2
NumericArrayIterator::next
===SEEKABLE===
@@ -122,22 +126,26 @@ SeekableNumericArrayIterator::seek(1)
NumericArrayIterator::valid(true)
NumericArrayIterator::current
NumericArrayIterator::key
-LimitIterator::greaterThen(2)
+SeekableNumericArrayIterator::greaterThan(2)
+NumericArrayIterator::current
2 is less than or equal 2
NumericArrayIterator::next
NumericArrayIterator::valid(true)
NumericArrayIterator::current
NumericArrayIterator::key
-LimitIterator::greaterThen(2)
+SeekableNumericArrayIterator::greaterThan(2)
+NumericArrayIterator::current
3 is greater than 2
NumericArrayIterator::next
NumericArrayIterator::valid(true)
NumericArrayIterator::current
NumericArrayIterator::key
-LimitIterator::greaterThen(2)
+SeekableNumericArrayIterator::greaterThan(2)
+NumericArrayIterator::current
4 is greater than 2
NumericArrayIterator::next
===STACKED===
+Shows '2 is greater than 2' because the test is actually done with the current value which is 3.
NumericArrayIterator::__construct
NumericArrayIterator::rewind
SeekableNumericArrayIterator::seek(1)
@@ -148,15 +156,18 @@ NumericArrayIterator::next
NumericArrayIterator::valid(true)
NumericArrayIterator::current
NumericArrayIterator::key
-CachingIterator::greaterThen(2)
-2 is less than or equal 2
+SeekableNumericArrayIterator::greaterThan(2)
+NumericArrayIterator::current
+2 is greater than 2
NumericArrayIterator::next
NumericArrayIterator::valid(true)
NumericArrayIterator::current
NumericArrayIterator::key
-CachingIterator::greaterThen(2)
+SeekableNumericArrayIterator::greaterThan(2)
+NumericArrayIterator::current
3 is greater than 2
NumericArrayIterator::next
-CachingIterator::greaterThen(2)
+SeekableNumericArrayIterator::greaterThan(2)
+NumericArrayIterator::current
4 is greater than 2
===DONE===
diff --git a/ext/spl/tests/iterator_002.phpt b/ext/spl/tests/iterator_002.phpt
index b481a0e00..d56a551c3 100755
--- a/ext/spl/tests/iterator_002.phpt
+++ b/ext/spl/tests/iterator_002.phpt
@@ -38,7 +38,7 @@ class CrashIterator extends FilterIterator implements RecursiveIterator
$array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3);
-$dir = new RecursiveIteratorIterator(new CrashIterator(new RecursiceArrayIterator($array)), RIT_LEAVES_ONLY);
+$dir = new RecursiveIteratorIterator(new CrashIterator(new RecursiceArrayIterator($array)), RecursiveIteratorIterator::LEAVES_ONLY);
foreach ($dir as $file) {
print "$file\n";
diff --git a/ext/spl/tests/iterator_005.phpt b/ext/spl/tests/iterator_005.phpt
new file mode 100755
index 000000000..4aae60016
--- /dev/null
+++ b/ext/spl/tests/iterator_005.phpt
@@ -0,0 +1,54 @@
+--TEST--
+SPL: IteratorIterator and ArrayIterator/Object
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class ArrayIteratorEx extends ArrayIterator
+{
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ return parent::rewind();
+ }
+}
+
+$it = new ArrayIteratorEx(range(0,3));
+
+foreach(new IteratorIterator($it) as $v)
+{
+ var_dump($v);
+}
+
+class ArrayObjectEx extends ArrayObject
+{
+ function getIterator()
+ {
+ echo __METHOD__ . "\n";
+ return parent::getIterator();
+ }
+}
+
+$it = new ArrayObjectEx(range(0,3));
+
+foreach(new IteratorIterator($it) as $v)
+{
+ var_dump($v);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+ArrayIteratorEx::rewind
+int(0)
+int(1)
+int(2)
+int(3)
+ArrayObjectEx::getIterator
+int(0)
+int(1)
+int(2)
+int(3)
+===DONE===
diff --git a/ext/spl/tests/iterator_006.phpt b/ext/spl/tests/iterator_006.phpt
new file mode 100755
index 000000000..05a1cc5a9
--- /dev/null
+++ b/ext/spl/tests/iterator_006.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SPL: IteratorIterator and SimpleXMlElement
+--SKIPIF--
+<?php if (!extension_loaded("spl") || !extension_loaded('simplexml')) print "skip"; ?>
+--FILE--
+<?php
+
+$root = simplexml_load_string('<?xml version="1.0"?>
+<root>
+ <child>Hello</child>
+ <child>World</child>
+</root>
+');
+
+foreach (new IteratorIterator($root->child) as $child) {
+ echo $child."\n";
+}
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+Hello
+World
+===DONE===
diff --git a/ext/spl/tests/iterator_007.phpt b/ext/spl/tests/iterator_007.phpt
new file mode 100755
index 000000000..eb87977ac
--- /dev/null
+++ b/ext/spl/tests/iterator_007.phpt
@@ -0,0 +1,168 @@
+--TEST--
+SPL: NoRewindIterator
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class ArrayIteratorEx extends ArrayIterator
+{
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ parent::rewind();
+ }
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ return parent::valid();
+ }
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ parent::next();
+ }
+}
+
+class NoRewindIteratorEx extends NoRewindIterator
+{
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ parent::rewind();
+ }
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ return parent::valid();
+ }
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ parent::next();
+ }
+}
+
+$it = new NoRewindIteratorEx(new ArrayIteratorEx(range(0,3)));
+
+echo "===0===\n";
+foreach ($it->getInnerIterator() as $v) {
+ var_dump($v);
+}
+
+echo "===1===\n";
+foreach ($it as $v) {
+ var_dump($v);
+}
+
+$pos =0;
+
+$it = new NoRewindIteratorEx(new ArrayIteratorEx(range(0,3)));
+
+echo "===2===\n";
+foreach ($it as $v) {
+ var_dump($v);
+ if ($pos++ > 1) {
+ break;
+ }
+}
+
+echo "===3===\n";
+foreach ($it as $v) {
+ var_dump($v);
+}
+
+echo "===4===\n";
+foreach ($it as $v) {
+ var_dump($v);
+}
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+===0===
+ArrayIteratorEx::rewind
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+int(0)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+int(1)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+int(2)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+int(3)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+===1===
+NoRewindIteratorEx::rewind
+NoRewindIteratorEx::valid
+ArrayIteratorEx::valid
+===2===
+NoRewindIteratorEx::rewind
+NoRewindIteratorEx::valid
+ArrayIteratorEx::valid
+NoRewindIteratorEx::current
+ArrayIteratorEx::current
+int(0)
+NoRewindIteratorEx::next
+ArrayIteratorEx::next
+NoRewindIteratorEx::valid
+ArrayIteratorEx::valid
+NoRewindIteratorEx::current
+ArrayIteratorEx::current
+int(1)
+NoRewindIteratorEx::next
+ArrayIteratorEx::next
+NoRewindIteratorEx::valid
+ArrayIteratorEx::valid
+NoRewindIteratorEx::current
+ArrayIteratorEx::current
+int(2)
+===3===
+NoRewindIteratorEx::rewind
+NoRewindIteratorEx::valid
+ArrayIteratorEx::valid
+NoRewindIteratorEx::current
+int(2)
+NoRewindIteratorEx::next
+ArrayIteratorEx::next
+NoRewindIteratorEx::valid
+ArrayIteratorEx::valid
+NoRewindIteratorEx::current
+ArrayIteratorEx::current
+int(3)
+NoRewindIteratorEx::next
+ArrayIteratorEx::next
+NoRewindIteratorEx::valid
+ArrayIteratorEx::valid
+===4===
+NoRewindIteratorEx::rewind
+NoRewindIteratorEx::valid
+ArrayIteratorEx::valid
+===DONE===
diff --git a/ext/spl/tests/iterator_008.phpt b/ext/spl/tests/iterator_008.phpt
new file mode 100755
index 000000000..5f3c7d89d
--- /dev/null
+++ b/ext/spl/tests/iterator_008.phpt
@@ -0,0 +1,91 @@
+--TEST--
+SPL: InfiniteIterator
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class ArrayIteratorEx extends ArrayIterator
+{
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ parent::rewind();
+ }
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ return parent::valid();
+ }
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ parent::next();
+ }
+}
+
+$it = new InfiniteIterator(new ArrayIteratorEx(range(0,2)));
+
+$pos =0;
+
+foreach ($it as $v) {
+ var_dump($v);
+ if ($pos++ > 5) {
+ break;
+ }
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+ArrayIteratorEx::rewind
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+ArrayIteratorEx::key
+int(0)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+ArrayIteratorEx::key
+int(1)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+ArrayIteratorEx::key
+int(2)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+ArrayIteratorEx::rewind
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+ArrayIteratorEx::key
+int(0)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+ArrayIteratorEx::key
+int(1)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+ArrayIteratorEx::key
+int(2)
+ArrayIteratorEx::next
+ArrayIteratorEx::valid
+ArrayIteratorEx::rewind
+ArrayIteratorEx::valid
+ArrayIteratorEx::current
+ArrayIteratorEx::key
+int(0)
+===DONE===
diff --git a/ext/spl/tests/iterator_009.phpt b/ext/spl/tests/iterator_009.phpt
new file mode 100755
index 000000000..27a3e0655
--- /dev/null
+++ b/ext/spl/tests/iterator_009.phpt
@@ -0,0 +1,47 @@
+--TEST--
+SPL: EmptyIterator
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class EmptyIteratorEx extends EmptyIterator
+{
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ parent::rewind();
+ }
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ return parent::valid();
+ }
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ parent::next();
+ }
+}
+
+foreach (new EmptyIteratorEx() as $v) {
+ var_dump($v);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+EmptyIteratorEx::rewind
+EmptyIteratorEx::valid
+===DONE===
diff --git a/ext/spl/examples/tests/iterators_001.phpt b/ext/spl/tests/iterator_010.phpt
index 5b4a6ffd0..39d1000f6 100755
--- a/ext/spl/examples/tests/iterators_001.phpt
+++ b/ext/spl/tests/iterator_010.phpt
@@ -3,8 +3,6 @@ SPL: EmptyIterator
--FILE--
<?php
-require_once('examples.inc');
-
echo "===EmptyIterator===\n";
foreach(new LimitIterator(new EmptyIterator(), 0, 3) as $key => $val)
diff --git a/ext/spl/tests/iterator_011.phpt b/ext/spl/tests/iterator_011.phpt
new file mode 100755
index 000000000..fca159a20
--- /dev/null
+++ b/ext/spl/tests/iterator_011.phpt
@@ -0,0 +1,51 @@
+--TEST--
+SPL: InfiniteIterator
+--FILE--
+<?php
+
+echo "===EmptyIterator===\n";
+
+foreach(new LimitIterator(new InfiniteIterator(new EmptyIterator()), 0, 3) as $key=>$val)
+{
+ echo "$key=>$val\n";
+}
+
+echo "===InfiniteIterator===\n";
+
+$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D'));
+$it = new InfiniteIterator($it);
+$it = new LimitIterator($it, 2, 5);
+foreach($it as $val=>$key)
+{
+ echo "$val=>$key\n";
+}
+
+echo "===Infinite/LimitIterator===\n";
+
+$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D'));
+$it = new LimitIterator($it, 1, 2);
+$it = new InfiniteIterator($it);
+$it = new LimitIterator($it, 2, 5);
+foreach($it as $val=>$key)
+{
+ echo "$val=>$key\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===EmptyIterator===
+===InfiniteIterator===
+2=>C
+3=>D
+0=>A
+1=>B
+2=>C
+===Infinite/LimitIterator===
+1=>B
+2=>C
+1=>B
+2=>C
+1=>B
+===DONE===
diff --git a/ext/spl/examples/tests/iterators_003.phpt b/ext/spl/tests/iterator_012.phpt
index f6d047de7..09842b098 100755
--- a/ext/spl/examples/tests/iterators_003.phpt
+++ b/ext/spl/tests/iterator_012.phpt
@@ -3,8 +3,6 @@ SPL: NoRweindIterator
--FILE--
<?php
-require_once('examples.inc');
-
echo "===Current===\n";
$it = new NoRewindIterator(new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C')));
diff --git a/ext/spl/examples/tests/iterators_004.phpt b/ext/spl/tests/iterator_013.phpt
index 83827e29b..119631c00 100755
--- a/ext/spl/examples/tests/iterators_004.phpt
+++ b/ext/spl/tests/iterator_013.phpt
@@ -3,8 +3,6 @@ SPL: AppendIterator
--FILE--
<?php
-require_once('examples.inc');
-
echo "===Empty===\n";
$it = new AppendIterator;
diff --git a/ext/spl/tests/iterator_014.phpt b/ext/spl/tests/iterator_014.phpt
new file mode 100755
index 000000000..119fad05f
--- /dev/null
+++ b/ext/spl/tests/iterator_014.phpt
@@ -0,0 +1,138 @@
+--TEST--
+SPL: RecursiveIteratorIterator and beginChildren/endChildren
+--FILE--
+<?php
+
+class MyRecursiveArrayIterator extends RecursiveArrayIterator
+{
+ function valid()
+ {
+ if (!parent::valid())
+ {
+ echo __METHOD__ . " = false\n";
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ function getChildren()
+ {
+ echo __METHOD__ . "\n";
+ return parent::getChildren();
+ }
+}
+
+class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator
+{
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ parent::rewind();
+ }
+
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ return parent::valid();
+ }
+
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ parent::next();
+ }
+
+ function beginChildren()
+ {
+ echo __METHOD__ . "(".$this->getDepth().")\n";
+ }
+
+ function endChildren()
+ {
+ echo __METHOD__ . "(".$this->getDepth().")\n";
+ }
+}
+
+foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"))), array("ca"), "d"))) as $k=>$v)
+{
+ echo "$k=>$v\n";
+}
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+RecursiveArrayIteratorIterator::rewind
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>a
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::getChildren
+RecursiveArrayIteratorIterator::beginChildren(1)
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>ba
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::getChildren
+RecursiveArrayIteratorIterator::beginChildren(2)
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>bba
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+1=>bbb
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(2)
+MyRecursiveArrayIterator::getChildren
+RecursiveArrayIteratorIterator::beginChildren(2)
+MyRecursiveArrayIterator::getChildren
+RecursiveArrayIteratorIterator::beginChildren(3)
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>bcaa
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(3)
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(2)
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(1)
+MyRecursiveArrayIterator::getChildren
+RecursiveArrayIteratorIterator::beginChildren(1)
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>ca
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(1)
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+3=>d
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::valid
+MyRecursiveArrayIterator::valid = false
+===DONE===
diff --git a/ext/spl/tests/iterator_015.phpt b/ext/spl/tests/iterator_015.phpt
new file mode 100755
index 000000000..aa30f79e1
--- /dev/null
+++ b/ext/spl/tests/iterator_015.phpt
@@ -0,0 +1,62 @@
+--TEST--
+SPL: RecursiveIteratorIterator and beginChildren/endChildren
+--FILE--
+<?php
+
+class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator
+{
+ function rewind()
+ {
+ echo "<ul>\n";
+ parent::rewind();
+ }
+ function beginChildren()
+ {
+ echo str_repeat(' ',$this->getDepth())."<ul>\n";
+ }
+
+ function endChildren()
+ {
+ echo str_repeat(' ',$this->getDepth())."</ul>\n";
+ }
+ function valid()
+ {
+ if (!parent::valid()) {
+ echo "<ul>\n";
+ return false;
+ }
+ return true;
+ }
+}
+
+$arr = array("a", array("ba", array("bba", "bbb"), array(array("bcaa"))), array("ca"), "d");
+$obj = new RecursiveArrayIterator($arr);
+$rit = new RecursiveArrayIteratorIterator($obj);
+foreach($rit as $k=>$v)
+{
+ echo str_repeat(' ',$rit->getDepth()+1)."$k=>$v\n";
+}
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+<ul>
+ 0=>a
+ <ul>
+ 0=>ba
+ <ul>
+ 0=>bba
+ 1=>bbb
+ </ul>
+ <ul>
+ <ul>
+ 0=>bcaa
+ </ul>
+ </ul>
+ </ul>
+ <ul>
+ 0=>ca
+ </ul>
+ 3=>d
+<ul>
+===DONE===
diff --git a/ext/spl/tests/iterator_016.phpt b/ext/spl/tests/iterator_016.phpt
new file mode 100755
index 000000000..f231c6eb3
--- /dev/null
+++ b/ext/spl/tests/iterator_016.phpt
@@ -0,0 +1,76 @@
+--TEST--
+SPL: RecursiveIteratorIterator and beginChildren/endChildren
+--FILE--
+<?php
+
+class Menu extends ArrayObject
+{
+ function getIterator()
+ {
+ echo __METHOD__ . "\n";
+ return new RecursiveArrayIterator($this);
+ }
+}
+
+class MenuOutput extends RecursiveIteratorIterator
+{
+ function __construct(Menu $it)
+ {
+ parent::__construct($it);
+ }
+ function rewind()
+ {
+ echo "<ul>\n";
+ parent::rewind();
+ }
+ function beginChildren()
+ {
+ echo str_repeat(' ',$this->getDepth())."<ul>\n";
+ }
+
+ function endChildren()
+ {
+ echo str_repeat(' ',$this->getDepth())."</ul>\n";
+ }
+ function valid()
+ {
+ if (!parent::valid()) {
+ echo "<ul>\n";
+ return false;
+ }
+ return true;
+ }
+}
+
+$arr = array("a", array("ba", array("bba", "bbb"), array(array("bcaa"))), array("ca"), "d");
+$obj = new Menu($arr);
+$rit = new MenuOutput($obj);
+foreach($rit as $k=>$v)
+{
+ echo str_repeat(' ',$rit->getDepth()+1)."$k=>$v\n";
+}
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Menu::getIterator
+<ul>
+ 0=>a
+ <ul>
+ 0=>ba
+ <ul>
+ 0=>bba
+ 1=>bbb
+ </ul>
+ <ul>
+ <ul>
+ 0=>bcaa
+ </ul>
+ </ul>
+ </ul>
+ <ul>
+ 0=>ca
+ </ul>
+ 3=>d
+<ul>
+===DONE===
diff --git a/ext/spl/tests/iterator_017.phpt b/ext/spl/tests/iterator_017.phpt
new file mode 100755
index 000000000..39d1000f6
--- /dev/null
+++ b/ext/spl/tests/iterator_017.phpt
@@ -0,0 +1,18 @@
+--TEST--
+SPL: EmptyIterator
+--FILE--
+<?php
+
+echo "===EmptyIterator===\n";
+
+foreach(new LimitIterator(new EmptyIterator(), 0, 3) as $key => $val)
+{
+ echo "$key=>$val\n";
+}
+
+?>
+===DONE===
+<?php exit(0);
+--EXPECTF--
+===EmptyIterator===
+===DONE===
diff --git a/ext/spl/examples/tests/iterators_002.phpt b/ext/spl/tests/iterator_018.phpt
index dcbaa9c87..9c234bb11 100755
--- a/ext/spl/examples/tests/iterators_002.phpt
+++ b/ext/spl/tests/iterator_018.phpt
@@ -3,8 +3,6 @@ SPL: InfiniteIterator
--FILE--
<?php
-require_once('examples.inc');
-
echo "===EmptyIterator===\n";
foreach(new LimitIterator(new InfiniteIterator(new EmptyIterator()), 0, 3) as $key=>$val)
diff --git a/ext/spl/tests/iterator_019.phpt b/ext/spl/tests/iterator_019.phpt
new file mode 100755
index 000000000..09842b098
--- /dev/null
+++ b/ext/spl/tests/iterator_019.phpt
@@ -0,0 +1,33 @@
+--TEST--
+SPL: NoRweindIterator
+--FILE--
+<?php
+
+echo "===Current===\n";
+
+$it = new NoRewindIterator(new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C')));
+
+echo $it->key() . '=>' . $it->current() . "\n";
+
+echo "===Next===\n";
+
+$it->next();
+
+echo "===Foreach===\n";
+
+foreach($it as $key=>$val)
+{
+ echo "$key=>$val\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===Current===
+0=>A
+===Next===
+===Foreach===
+1=>B
+2=>C
+===DONE===
diff --git a/ext/spl/tests/iterator_020.phpt b/ext/spl/tests/iterator_020.phpt
new file mode 100755
index 000000000..119631c00
--- /dev/null
+++ b/ext/spl/tests/iterator_020.phpt
@@ -0,0 +1,66 @@
+--TEST--
+SPL: AppendIterator
+--FILE--
+<?php
+
+echo "===Empty===\n";
+
+$it = new AppendIterator;
+
+foreach($it as $key=>$val)
+{
+ echo "$key=>$val\n";
+}
+
+echo "===Append===\n";
+
+$it->append(new ArrayIterator(array(0 => 'A', 1 => 'B')));
+
+foreach($it as $key=>$val)
+{
+ echo "$key=>$val\n";
+}
+
+echo "===Rewind===\n";
+
+foreach($it as $key=>$val)
+{
+ echo "$key=>$val\n";
+}
+
+echo "===Append===\n";
+
+$it->append(new ArrayIterator(array(2 => 'C', 3 => 'D')));
+
+foreach(new NoRewindIterator($it) as $key=>$val)
+{
+ echo "$key=>$val\n";
+}
+
+echo "===Rewind===\n";
+
+foreach($it as $key=>$val)
+{
+ echo "$key=>$val\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===Empty===
+===Append===
+0=>A
+1=>B
+===Rewind===
+0=>A
+1=>B
+===Append===
+2=>C
+3=>D
+===Rewind===
+0=>A
+1=>B
+2=>C
+3=>D
+===DONE===
diff --git a/ext/spl/tests/iterator_021.phpt b/ext/spl/tests/iterator_021.phpt
new file mode 100755
index 000000000..4f2395a8e
--- /dev/null
+++ b/ext/spl/tests/iterator_021.phpt
@@ -0,0 +1,180 @@
+--TEST--
+SPL: RecursiveIteratorIterator and hasChildren
+--FILE--
+<?php
+
+class MyRecursiveArrayIterator extends RecursiveArrayIterator
+{
+ function valid()
+ {
+ if (!parent::valid())
+ {
+ echo __METHOD__ . " = false\n";
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ function getChildren()
+ {
+ echo __METHOD__ . "\n";
+ return parent::getChildren();
+ }
+}
+
+class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator
+{
+ private $max_depth;
+ private $over = 0;
+ private $skip = false;
+
+ function __construct($it, $max_depth)
+ {
+ $this->max_depth = $max_depth;
+ parent::__construct($it);
+ }
+
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ $this->skip = false;
+ parent::rewind();
+ }
+
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ if ($this->skip)
+ {
+ $this->skip = false;
+ $this->next();
+ }
+ return parent::valid();
+ }
+
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ parent::next();
+ }
+
+ function callHasChildren()
+ {
+ $this->skip = false;
+ $has = parent::callHasChildren();
+ $res = $this->getDepth() < $this->max_depth && $has;
+ echo __METHOD__ . "(".$this->getDepth().") = ".($res?"yes":"no")."/".($has?"yes":"no")."\n";
+ if ($has && !$res)
+ {
+ $this->over++;
+ if ($this->over == 2) {
+ $this->skip = true;
+ }
+ }
+ return $res;
+ }
+
+ function beginChildren()
+ {
+ echo __METHOD__ . "(".$this->getDepth().")\n";
+ }
+
+ function endChildren()
+ {
+ echo __METHOD__ . "(".$this->getDepth().")\n";
+ }
+}
+
+foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"), array("bcba"))), array("ca"), "d")), 2) as $k=>$v)
+{
+ if (is_array($v)) $v = join('',$v);
+ echo "$k=>$v\n";
+}
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+RecursiveArrayIteratorIterator::rewind
+RecursiveArrayIteratorIterator::callHasChildren(0) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>a
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes
+MyRecursiveArrayIterator::getChildren
+RecursiveArrayIteratorIterator::beginChildren(1)
+RecursiveArrayIteratorIterator::callHasChildren(1) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>ba
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes
+MyRecursiveArrayIterator::getChildren
+RecursiveArrayIteratorIterator::beginChildren(2)
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>bba
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+1=>bbb
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(2)
+RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes
+MyRecursiveArrayIterator::getChildren
+RecursiveArrayIteratorIterator::beginChildren(2)
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>bcaa
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(2)
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(1)
+RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes
+MyRecursiveArrayIterator::getChildren
+RecursiveArrayIteratorIterator::beginChildren(1)
+RecursiveArrayIteratorIterator::callHasChildren(1) = no/no
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>ca
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(1)
+RecursiveArrayIteratorIterator::callHasChildren(0) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+3=>d
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::valid
+MyRecursiveArrayIterator::valid = false
+===DONE===
diff --git a/ext/spl/tests/iterator_022.phpt b/ext/spl/tests/iterator_022.phpt
new file mode 100755
index 000000000..8d055313a
--- /dev/null
+++ b/ext/spl/tests/iterator_022.phpt
@@ -0,0 +1,186 @@
+--TEST--
+SPL: RecursiveIteratorIterator and callHasChildren/callGetChildren
+--FILE--
+<?php
+
+class MyRecursiveArrayIterator extends RecursiveArrayIterator
+{
+ function getChildren()
+ {
+ echo __METHOD__ . "\n";
+ return $this->current();
+ }
+
+ function valid()
+ {
+ if (!parent::valid())
+ {
+ echo __METHOD__ . " = false\n";
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+}
+
+class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator
+{
+ private $max_depth;
+ private $over = 0;
+ private $skip = false;
+
+ function __construct($it, $max_depth)
+ {
+ $this->max_depth = $max_depth;
+ parent::__construct($it);
+ }
+
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ $this->skip = false;
+ parent::rewind();
+ }
+
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ if ($this->skip)
+ {
+ $this->skip = false;
+ $this->next();
+ }
+ return parent::valid();
+ }
+
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ parent::next();
+ }
+
+ function callHasChildren()
+ {
+ $this->skip = false;
+ $has = parent::callHasChildren();
+ $res = $this->getDepth() < $this->max_depth && $has;
+ echo __METHOD__ . "(".$this->getDepth().") = ".($res?"yes":"no")."/".($has?"yes":"no")."\n";
+ if ($has && !$res)
+ {
+ $this->over++;
+ if ($this->over == 2) {
+ $this->skip = true;
+ }
+ }
+ return $res;
+ }
+
+ function callGetChildren()
+ {
+ if ($this->over == 2)
+ {
+ echo __METHOD__ . "(skip)\n";
+ return NULL;
+ }
+ echo __METHOD__ . "(ok:{$this->over})\n";
+ return new MyRecursiveArrayIterator($this->current());
+ }
+
+ function beginChildren()
+ {
+ echo __METHOD__ . "(".$this->getDepth().")\n";
+ }
+
+ function endChildren()
+ {
+ echo __METHOD__ . "(".$this->getDepth().")\n";
+ }
+}
+
+try
+{
+ foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"), array("bcba"))), array("ca"), "d")), 2) as $k=>$v)
+ {
+ if (is_array($v)) $v = join('',$v);
+ echo "$k=>$v\n";
+ }
+}
+catch(UnexpectedValueException $e)
+{
+ echo $e->getMessage() . "\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+RecursiveArrayIteratorIterator::rewind
+RecursiveArrayIteratorIterator::callHasChildren(0) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>a
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes
+RecursiveArrayIteratorIterator::callGetChildren(ok:0)
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::beginChildren(1)
+RecursiveArrayIteratorIterator::callHasChildren(1) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>ba
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes
+RecursiveArrayIteratorIterator::callGetChildren(ok:0)
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::beginChildren(2)
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>bba
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+1=>bbb
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(2)
+RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes
+RecursiveArrayIteratorIterator::callGetChildren(ok:0)
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::beginChildren(2)
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>bcaa
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(2)
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(1)
+RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes
+RecursiveArrayIteratorIterator::callGetChildren(skip)
+Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator
+===DONE===
diff --git a/ext/spl/tests/iterator_023.phpt b/ext/spl/tests/iterator_023.phpt
new file mode 100755
index 000000000..1b6b4685e
--- /dev/null
+++ b/ext/spl/tests/iterator_023.phpt
@@ -0,0 +1,193 @@
+--TEST--
+SPL: RecursiveIteratorIterator and catch getChildren
+--FILE--
+<?php
+
+class MyRecursiveArrayIterator extends RecursiveArrayIterator
+{
+ function getChildren()
+ {
+ echo __METHOD__ . "\n";
+ return $this->current();
+ }
+
+ function valid()
+ {
+ if (!parent::valid())
+ {
+ echo __METHOD__ . " = false\n";
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+}
+
+class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator
+{
+ private $max_depth;
+ private $over = 0;
+ private $skip = false;
+
+ function __construct($it, $max_depth)
+ {
+ $this->max_depth = $max_depth;
+ parent::__construct($it, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD);
+ }
+
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ $this->skip = false;
+ parent::rewind();
+ }
+
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ if ($this->skip)
+ {
+ $this->skip = false;
+ $this->next();
+ }
+ return parent::valid();
+ }
+
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ parent::next();
+ }
+
+ function callHasChildren()
+ {
+ $this->skip = false;
+ $has = parent::callHasChildren();
+ $res = $this->getDepth() < $this->max_depth && $has;
+ echo __METHOD__ . "(".$this->getDepth().") = ".($res?"yes":"no")."/".($has?"yes":"no")."\n";
+ if ($has && !$res)
+ {
+ $this->over++;
+ if ($this->over == 2) {
+ $this->skip = true;
+ }
+ }
+ return $res;
+ }
+
+ function callGetChildren()
+ {
+ if ($this->over == 2)
+ {
+ echo __METHOD__ . "(throw)\n";
+ throw new Exception("Thrown in callGetChildren()");
+ }
+ echo __METHOD__ . "(ok:{$this->over})\n";
+ return new MyRecursiveArrayIterator($this->current());
+ }
+
+ function beginChildren()
+ {
+ echo __METHOD__ . "(".$this->getDepth().")\n";
+ }
+
+ function endChildren()
+ {
+ echo __METHOD__ . "(".$this->getDepth().")\n";
+ }
+}
+
+try
+{
+ foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"), array("bcba"))), array("ca"), "d")), 2) as $k=>$v)
+ {
+ if (is_array($v)) $v = join('',$v);
+ echo "$k=>$v\n";
+ }
+}
+catch(UnexpectedValueException $e)
+{
+ echo $e->getMessage() . "\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+RecursiveArrayIteratorIterator::rewind
+RecursiveArrayIteratorIterator::callHasChildren(0) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>a
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes
+RecursiveArrayIteratorIterator::callGetChildren(ok:0)
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::beginChildren(1)
+RecursiveArrayIteratorIterator::callHasChildren(1) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>ba
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes
+RecursiveArrayIteratorIterator::callGetChildren(ok:0)
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::beginChildren(2)
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>bba
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/no
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+1=>bbb
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(2)
+RecursiveArrayIteratorIterator::callHasChildren(1) = yes/yes
+RecursiveArrayIteratorIterator::callGetChildren(ok:0)
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::beginChildren(2)
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+0=>bcaa
+RecursiveArrayIteratorIterator::next
+RecursiveArrayIteratorIterator::callHasChildren(2) = no/yes
+RecursiveArrayIteratorIterator::valid
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(2)
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::endChildren(1)
+RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes
+RecursiveArrayIteratorIterator::callGetChildren(throw)
+RecursiveArrayIteratorIterator::callHasChildren(0) = no/no
+RecursiveArrayIteratorIterator::current
+RecursiveArrayIteratorIterator::key
+3=>d
+RecursiveArrayIteratorIterator::next
+MyRecursiveArrayIterator::valid = false
+RecursiveArrayIteratorIterator::valid
+MyRecursiveArrayIterator::valid = false
+===DONE===
diff --git a/ext/spl/tests/iterator_024.phpt b/ext/spl/tests/iterator_024.phpt
new file mode 100755
index 000000000..0c7dea15b
--- /dev/null
+++ b/ext/spl/tests/iterator_024.phpt
@@ -0,0 +1,49 @@
+--TEST--
+SPL: RecursiveIteratorIterator with custom iterator class
+--FILE--
+<?php
+
+$ar = array(1, 2, array(31, 32, array(331)), 4);
+
+foreach(new RecursiveIteratorIterator(new ArrayObject($ar, 0, "RecursiveArrayIterator")) as $v) echo "$v\n";
+
+$it = new ArrayObject($ar);
+var_dump($it->getIteratorClass());
+
+try
+{
+ foreach(new RecursiveIteratorIterator(new ArrayObject($ar)) as $v) echo "$v\n";
+}
+catch (InvalidArgumentException $e)
+{
+ echo $e->getMessage() . "\n";
+}
+
+echo "===MANUAL===\n";
+
+$it->setIteratorClass("RecursiveArrayIterator");
+var_dump($it->getIteratorClass());
+foreach(new RecursiveIteratorIterator($it) as $v) echo "$v\n";
+
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+1
+2
+31
+32
+331
+4
+string(13) "ArrayIterator"
+An instance of RecursiveIterator or IteratorAggregate creating it is required
+===MANUAL===
+string(22) "RecursiveArrayIterator"
+1
+2
+31
+32
+331
+4
+===DONE===
diff --git a/ext/spl/tests/iterator_025.phpt b/ext/spl/tests/iterator_025.phpt
new file mode 100755
index 000000000..e582b1f39
--- /dev/null
+++ b/ext/spl/tests/iterator_025.phpt
@@ -0,0 +1,92 @@
+--TEST--
+SPL: RecursiveIteratorIterator and begin/endIteration()
+--FILE--
+<?php
+
+class MyRecursiveIteratorIterator extends RecursiveIteratorIterator
+{
+ function beginIteration()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function endIteration()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+$ar = array(1, 2, array(31, 32, array(331)), 4);
+
+$it = new MyRecursiveIteratorIterator(new ArrayObject($ar, 0, "RecursiveArrayIterator"));
+
+foreach($it as $v) echo "$v\n";
+
+echo "===MORE===\n";
+
+foreach($it as $v) echo "$v\n";
+
+echo "===MORE===\n";
+
+$it->rewind();
+foreach($it as $v) echo "$v\n";
+var_dump($it->valid());
+
+echo "===MANUAL===\n";
+
+$it->rewind();
+while($it->valid())
+{
+ echo $it->current() . "\n";
+ $it->next();
+ break;
+}
+$it->rewind();
+while($it->valid())
+{
+ echo $it->current() . "\n";
+ $it->next();
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+MyRecursiveIteratorIterator::beginIteration()
+1
+2
+31
+32
+331
+4
+MyRecursiveIteratorIterator::endIteration()
+===MORE===
+MyRecursiveIteratorIterator::beginIteration()
+1
+2
+31
+32
+331
+4
+MyRecursiveIteratorIterator::endIteration()
+===MORE===
+MyRecursiveIteratorIterator::beginIteration()
+1
+2
+31
+32
+331
+4
+MyRecursiveIteratorIterator::endIteration()
+bool(false)
+===MANUAL===
+MyRecursiveIteratorIterator::beginIteration()
+1
+1
+2
+31
+32
+331
+4
+MyRecursiveIteratorIterator::endIteration()
+===DONE===
diff --git a/ext/spl/tests/iterator_026.phpt b/ext/spl/tests/iterator_026.phpt
new file mode 100755
index 000000000..8df96f0d2
--- /dev/null
+++ b/ext/spl/tests/iterator_026.phpt
@@ -0,0 +1,34 @@
+--TEST--
+SPL: CachingIterator::hasNext()
+--FILE--
+<?php
+
+$ar = array(1, 2, array(31, 32, array(331)), 4);
+
+$it = new RecursiveArrayIterator($ar);
+$it = new RecursiveCachingIterator($it);
+$it = new RecursiveIteratorIterator($it);
+
+foreach($it as $k=>$v)
+{
+ echo "$k=>$v\n";
+ echo "hasNext: " . ($it->getInnerIterator()->hasNext() ? "yes" : "no") . "\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+0=>1
+hasNext: yes
+1=>2
+hasNext: yes
+0=>31
+hasNext: yes
+1=>32
+hasNext: yes
+0=>331
+hasNext: no
+3=>4
+hasNext: no
+===DONE===
diff --git a/ext/spl/tests/iterator_028.phpt b/ext/spl/tests/iterator_028.phpt
new file mode 100755
index 000000000..7ec76d814
--- /dev/null
+++ b/ext/spl/tests/iterator_028.phpt
@@ -0,0 +1,170 @@
+--TEST--
+SPL: RecursiveIteratorIterator and setMaxDepth()
+--FILE--
+<?php
+
+$ar = array(1, 2, array(31, 32, array(331, array(3321, array(33221)))), 4);
+
+$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($ar));
+
+echo "===?===\n";
+var_dump($it->getMaxDepth());
+foreach($it as $v) echo $it->getDepth() . ": $v\n";
+
+echo "===2===\n";
+$it->setMaxDepth(2);
+var_dump($it->getMaxDepth());
+foreach($it as $v) echo $it->getDepth() . ": $v\n";
+
+echo "===X===\n";
+$it->setMaxDepth();
+var_dump($it->getMaxDepth());
+foreach($it as $v) echo $it->getDepth() . ": $v\n";
+
+echo "===3===\n";
+$it->setMaxDepth(3);
+var_dump($it->getMaxDepth());
+foreach($it as $v) echo $it->getDepth() . ": $v\n";
+
+echo "===5===\n";
+$it->setMaxDepth(5);
+var_dump($it->getMaxDepth());
+foreach($it as $v) echo $it->getDepth() . ": $v\n";
+
+echo "===0===\n";
+$it->setMaxDepth(0);
+var_dump($it->getMaxDepth());
+foreach($it as $v) echo $it->getDepth() . ": $v\n";
+
+echo "===-1===\n";
+$it->setMaxDepth(-1);
+var_dump($it->getMaxDepth());
+try
+{
+ $it->setMaxDepth(4);
+ $it->setMaxDepth(-2);
+}
+catch(Exception $e)
+{
+ var_dump($e->getMessage());
+}
+var_dump($it->getMaxDepth());
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+===?===
+bool(false)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+3: 3321
+4: 33221
+0: 4
+===2===
+int(2)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+0: 4
+===X===
+bool(false)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+3: 3321
+4: 33221
+0: 4
+===3===
+int(3)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+3: 3321
+0: 4
+===5===
+int(5)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+3: 3321
+4: 33221
+0: 4
+===0===
+int(0)
+0: 1
+0: 2
+0: 4
+===-1===
+bool(false)
+string(33) "Parameter max_depth must be >= -1"
+int(4)
+===DONE===
+--UEXPECT--
+===?===
+bool(false)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+3: 3321
+4: 33221
+0: 4
+===2===
+int(2)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+0: 4
+===X===
+bool(false)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+3: 3321
+4: 33221
+0: 4
+===3===
+int(3)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+3: 3321
+0: 4
+===5===
+int(5)
+0: 1
+0: 2
+1: 31
+1: 32
+2: 331
+3: 3321
+4: 33221
+0: 4
+===0===
+int(0)
+0: 1
+0: 2
+0: 4
+===-1===
+bool(false)
+unicode(33) "Parameter max_depth must be >= -1"
+int(4)
+===DONE===
diff --git a/ext/spl/tests/observer_001.phpt b/ext/spl/tests/observer_001.phpt
new file mode 100755
index 000000000..e7d72b9e2
--- /dev/null
+++ b/ext/spl/tests/observer_001.phpt
@@ -0,0 +1,116 @@
+--TEST--
+SPL: SplObserver and SplSubject (empty notify)
+--FILE--
+<?php
+
+class ObserverImpl implements SplObserver
+{
+ protected $name = '';
+
+ function __construct($name = 'obj')
+ {
+ $this->name = '$' . $name;
+ }
+
+ function update(SplSubject $subject)
+ {
+ echo $this->name . '->' . __METHOD__ . '(' . $subject->getName() . ");\n";
+ }
+
+ function getName()
+ {
+ return $this->name;
+ }
+}
+
+class SubjectImpl implements SplSubject
+{
+ protected $name = '';
+ protected $observers = array();
+
+ function __construct($name = 'sub')
+ {
+ $this->name = '$' . $name;
+ }
+
+ function attach(SplObserver $observer)
+ {
+ echo '$sub->' . __METHOD__ . '(' . $observer->getName() . ");\n";
+ if (!in_array($observer, $this->observers))
+ {
+ $this->observers[] = $observer;
+ }
+ }
+
+ function detach(SplObserver $observer)
+ {
+ echo '$sub->' . __METHOD__ . '(' . $observer->getName() . ");\n";
+ $idx = array_search($observer, $this->observers);
+ if ($idx !== false)
+ {
+ unset($this->observers[$idx]);
+ }
+ }
+
+ function notify()
+ {
+ echo '$sub->' . __METHOD__ . "();\n";
+ foreach($this->observers as $observer)
+ {
+ $observer->update($this);
+ }
+ }
+
+ function getName()
+ {
+ return $this->name;
+ }
+}
+
+$sub = new SubjectImpl;
+
+$ob1 = new ObserverImpl("ob1");
+$ob2 = new ObserverImpl("ob2");
+$ob3 = new ObserverImpl("ob3");
+
+$sub->attach($ob1);
+$sub->attach($ob1);
+$sub->attach($ob2);
+$sub->attach($ob3);
+
+$sub->notify();
+
+$sub->detach($ob3);
+
+$sub->notify();
+
+$sub->detach($ob2);
+$sub->detach($ob1);
+
+$sub->notify();
+
+$sub->attach($ob3);
+
+$sub->notify();
+?>
+===DONE===
+--EXPECT--
+$sub->SubjectImpl::attach($ob1);
+$sub->SubjectImpl::attach($ob1);
+$sub->SubjectImpl::attach($ob2);
+$sub->SubjectImpl::attach($ob3);
+$sub->SubjectImpl::notify();
+$ob1->ObserverImpl::update($sub);
+$ob2->ObserverImpl::update($sub);
+$ob3->ObserverImpl::update($sub);
+$sub->SubjectImpl::detach($ob3);
+$sub->SubjectImpl::notify();
+$ob1->ObserverImpl::update($sub);
+$ob2->ObserverImpl::update($sub);
+$sub->SubjectImpl::detach($ob2);
+$sub->SubjectImpl::detach($ob1);
+$sub->SubjectImpl::notify();
+$sub->SubjectImpl::attach($ob3);
+$sub->SubjectImpl::notify();
+$ob3->ObserverImpl::update($sub);
+===DONE===
diff --git a/ext/spl/tests/observer_002.phpt b/ext/spl/tests/observer_002.phpt
new file mode 100755
index 000000000..5d006177f
--- /dev/null
+++ b/ext/spl/tests/observer_002.phpt
@@ -0,0 +1,199 @@
+--TEST--
+SPL: SplObjectStorage
+--FILE--
+<?php
+
+class MyObjectStorage extends SplObjectStorage
+{
+ function rewind()
+ {
+ echo __METHOD__ . "()\n";
+ parent::rewind();
+ }
+
+ function valid()
+ {
+ echo __METHOD__ . "(" . (parent::valid() ? 1 : 0) . ")\n";
+ return parent::valid();
+ }
+
+ function key()
+ {
+ echo __METHOD__ . "(" . parent::key() . ")\n";
+ return parent::key();
+ }
+
+ function current()
+ {
+ echo __METHOD__ . "(" . parent::current()->getName() . ")\n";
+ return parent::current();
+ }
+
+ function next()
+ {
+ echo __METHOD__ . "()\n";
+ parent::next();
+ }
+}
+
+class ObserverImpl implements SplObserver
+{
+ protected $name = '';
+
+ function __construct($name = 'obj')
+ {
+ $this->name = '$' . $name;
+ }
+
+ function update(SplSubject $subject)
+ {
+ echo $this->name . '->' . __METHOD__ . '(' . $subject->getName() . ");\n";
+ }
+
+ function getName()
+ {
+ return $this->name;
+ }
+}
+
+class SubjectImpl implements SplSubject
+{
+ protected $name = '';
+ protected $observers;
+
+ function __construct($name = 'sub')
+ {
+ $this->observers = new MyObjectStorage;
+ $this->name = '$' . $name;
+ }
+
+ function attach(SplObserver $observer)
+ {
+ echo $this->name . '->' . __METHOD__ . '(' . $observer->getName() . ");\n";
+ $this->observers->attach($observer);
+ }
+
+ function detach(SplObserver $observer)
+ {
+ echo $this->name . '->' . __METHOD__ . '(' . $observer->getName() . ");\n";
+ $this->observers->detach($observer);
+ }
+
+ function count()
+ {
+ return $this->observers->count();
+ }
+
+ function notify()
+ {
+ echo $this->name . '->' . __METHOD__ . "();\n";
+ foreach($this->observers as $key => $observer)
+ {
+ $observer->update($this);
+ }
+ }
+
+ function getName()
+ {
+ return $this->name;
+ }
+
+ function contains($obj)
+ {
+ return $this->observers->contains($obj);
+ }
+}
+
+$sub = new SubjectImpl;
+
+$ob1 = new ObserverImpl("ob1");
+$ob2 = new ObserverImpl("ob2");
+$ob3 = new ObserverImpl("ob3");
+
+var_dump($sub->contains($ob1));
+$sub->attach($ob1);
+var_dump($sub->contains($ob1));
+$sub->attach($ob1);
+$sub->attach($ob2);
+$sub->attach($ob3);
+var_dump($sub->count());
+
+$sub->notify();
+
+$sub->detach($ob3);
+var_dump($sub->count());
+
+$sub->notify();
+
+$sub->detach($ob2);
+$sub->detach($ob1);
+var_dump($sub->count());
+
+$sub->notify();
+
+$sub->attach($ob3);
+var_dump($sub->count());
+
+$sub->notify();
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+bool(false)
+$sub->SubjectImpl::attach($ob1);
+bool(true)
+$sub->SubjectImpl::attach($ob1);
+$sub->SubjectImpl::attach($ob2);
+$sub->SubjectImpl::attach($ob3);
+int(3)
+$sub->SubjectImpl::notify();
+MyObjectStorage::rewind()
+MyObjectStorage::valid(1)
+MyObjectStorage::current($ob1)
+MyObjectStorage::key(0)
+$ob1->ObserverImpl::update($sub);
+MyObjectStorage::next()
+MyObjectStorage::valid(1)
+MyObjectStorage::current($ob2)
+MyObjectStorage::key(1)
+$ob2->ObserverImpl::update($sub);
+MyObjectStorage::next()
+MyObjectStorage::valid(1)
+MyObjectStorage::current($ob3)
+MyObjectStorage::key(2)
+$ob3->ObserverImpl::update($sub);
+MyObjectStorage::next()
+MyObjectStorage::valid(0)
+$sub->SubjectImpl::detach($ob3);
+int(2)
+$sub->SubjectImpl::notify();
+MyObjectStorage::rewind()
+MyObjectStorage::valid(1)
+MyObjectStorage::current($ob1)
+MyObjectStorage::key(0)
+$ob1->ObserverImpl::update($sub);
+MyObjectStorage::next()
+MyObjectStorage::valid(1)
+MyObjectStorage::current($ob2)
+MyObjectStorage::key(1)
+$ob2->ObserverImpl::update($sub);
+MyObjectStorage::next()
+MyObjectStorage::valid(0)
+$sub->SubjectImpl::detach($ob2);
+$sub->SubjectImpl::detach($ob1);
+int(0)
+$sub->SubjectImpl::notify();
+MyObjectStorage::rewind()
+MyObjectStorage::valid(0)
+$sub->SubjectImpl::attach($ob3);
+int(1)
+$sub->SubjectImpl::notify();
+MyObjectStorage::rewind()
+MyObjectStorage::valid(1)
+MyObjectStorage::current($ob3)
+MyObjectStorage::key(0)
+$ob3->ObserverImpl::update($sub);
+MyObjectStorage::next()
+MyObjectStorage::valid(0)
+===DONE===
diff --git a/ext/spl/tests/spl_001.phpt b/ext/spl/tests/spl_001.phpt
new file mode 100755
index 000000000..e101272a8
--- /dev/null
+++ b/ext/spl/tests/spl_001.phpt
@@ -0,0 +1,34 @@
+--TEST--
+SPL: iterator_to_array() and iterator_count()
+--FILE--
+<?php
+
+$it = new ArrayObject(array("x"=>1, 1=>2, 3=>3, 4, "1"=>5));
+
+$ar = iterator_to_array($it);
+
+var_dump(iterator_count($it));
+
+print_r($ar);
+
+foreach($ar as $v)
+{
+ var_dump($v);
+}
+
+?>
+===DONE===
+--EXPECT--
+int(4)
+Array
+(
+ [x] => 1
+ [1] => 5
+ [3] => 3
+ [4] => 4
+)
+int(1)
+int(5)
+int(3)
+int(4)
+===DONE===
diff --git a/ext/spl/tests/spl_002.phpt b/ext/spl/tests/spl_002.phpt
new file mode 100755
index 000000000..d8b71b20c
--- /dev/null
+++ b/ext/spl/tests/spl_002.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SPL: Countable
+--FILE--
+<?php
+
+class Test implements Countable
+{
+ function count()
+ {
+ return 4;
+ }
+};
+
+$a = new Test;
+
+var_dump(count($a));
+
+?>
+===DONE===
+--EXPECT--
+int(4)
+===DONE===
diff --git a/ext/spl/tests/spl_003.phpt b/ext/spl/tests/spl_003.phpt
new file mode 100755
index 000000000..cadf3b5a6
--- /dev/null
+++ b/ext/spl/tests/spl_003.phpt
@@ -0,0 +1,76 @@
+--TEST--
+SPL: class_parents() and class_implements()
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+class a{}
+class b extends a{}
+class c extends b{}
+class d{}
+var_dump(class_parents(new c),
+ class_parents("c"),
+ class_parents(new b),
+ class_parents("b"),
+ class_parents("d"),
+ class_parents("foo", 0),
+ class_parents("foo", 1)
+);
+
+interface iface1{}
+interface iface2{}
+class f implements iface1, iface2{}
+var_dump(class_implements(new a),
+ class_implements("a"),
+ class_implements("aaa"),
+ class_implements("bbb", 0)
+);
+
+function __autoload($cname) {
+ var_dump($cname);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Warning: class_parents(): Class foo does not exist in %sspl_003.php on line %d
+string(3) "foo"
+
+Warning: class_parents(): Class foo does not exist and could not be loaded in %sspl_003.php on line %d
+array(2) {
+ ["b"]=>
+ string(1) "b"
+ ["a"]=>
+ string(1) "a"
+}
+array(2) {
+ ["b"]=>
+ string(1) "b"
+ ["a"]=>
+ string(1) "a"
+}
+array(1) {
+ ["a"]=>
+ string(1) "a"
+}
+array(1) {
+ ["a"]=>
+ string(1) "a"
+}
+array(0) {
+}
+bool(false)
+bool(false)
+string(3) "aaa"
+
+Warning: class_implements(): Class aaa does not exist and could not be loaded in %sspl_003.php on line %d
+
+Warning: class_implements(): Class bbb does not exist in %sspl_003.php on line %d
+array(0) {
+}
+array(0) {
+}
+bool(false)
+bool(false)
+===DONE=== \ No newline at end of file
diff --git a/ext/spl/tests/spl_autoload_001.phpt b/ext/spl/tests/spl_autoload_001.phpt
new file mode 100755
index 000000000..11c10e957
--- /dev/null
+++ b/ext/spl/tests/spl_autoload_001.phpt
@@ -0,0 +1,136 @@
+--TEST--
+SPL: spl_autoload() and friends
+--INI--
+include_path=.
+--FILE--
+<?php
+
+echo "===EMPTY===\n";
+
+var_dump(spl_autoload_extensions());
+
+try
+{
+ spl_autoload("TestClass");
+}
+catch(Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+
+$test_exts = array(NULL, "1", ".inc,,.php.inc", "");
+
+foreach($test_exts as $exts)
+{
+ echo "===($exts)===\n";
+ try
+ {
+ spl_autoload("TestClass", $exts);
+ }
+ catch(Exception $e)
+ {
+ echo 'Exception: ' . $e->getMessage() . "\n";
+ }
+}
+
+try
+{
+ spl_autoload_extensions(".inc,.php.inc");
+ spl_autoload("TestClass");
+}
+catch(Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+
+function TestFunc1($classname)
+{
+ echo __METHOD__ . "($classname)\n";
+}
+
+function TestFunc2($classname)
+{
+ echo __METHOD__ . "($classname)\n";
+}
+
+echo "===SPL_AUTOLOAD()===\n";
+
+spl_autoload_register();
+
+try
+{
+ var_dump(spl_autoload_extensions(".inc"));
+ var_dump(class_exists("TestClass", true));
+}
+catch(Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+
+echo "===REGISTER===\n";
+
+spl_autoload_unregister("spl_autoload");
+spl_autoload_register("TestFunc1");
+spl_autoload_register("TestFunc2");
+spl_autoload_register("TestFunc2"); /* 2nd call ignored */
+spl_autoload_extensions(".inc,.class.inc"); /* we do not have spl_autoload_registered yet */
+
+try
+{
+ var_dump(class_exists("TestClass", true));
+}
+catch(Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+
+echo "===LOAD===\n";
+
+spl_autoload_register("spl_autoload");
+var_dump(class_exists("TestClass", true));
+
+echo "===NOFUNCTION===\n";
+
+try
+{
+ spl_autoload_register("unavailable_autoload_function");
+}
+catch(Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===EMPTY===
+string(9) ".inc,.php"
+%stestclass.inc
+Exception: Class TestClass could not be loaded
+===()===
+Exception: Class TestClass could not be loaded
+===(1)===
+Exception: Class TestClass could not be loaded
+===(.inc,,.php.inc)===
+%stestclass
+%stestclass.php.inc
+Exception: Class TestClass could not be loaded
+===()===
+Exception: Class TestClass could not be loaded
+Exception: Class TestClass could not be loaded
+===SPL_AUTOLOAD()===
+string(4) ".inc"
+Exception: Class TestClass could not be loaded
+===REGISTER===
+TestFunc1(TestClass)
+TestFunc2(TestClass)
+bool(false)
+===LOAD===
+TestFunc1(TestClass)
+TestFunc2(TestClass)
+%stestclass.class.inc
+bool(true)
+===NOFUNCTION===
+Exception: Function 'unavailable_autoload_function' not found
+===DONE===
diff --git a/ext/spl/tests/spl_autoload_002.phpt b/ext/spl/tests/spl_autoload_002.phpt
new file mode 100755
index 000000000..21caa43bf
--- /dev/null
+++ b/ext/spl/tests/spl_autoload_002.phpt
@@ -0,0 +1,68 @@
+--TEST--
+SPL: spl_autoloadfunctions()
+--SKIPIF--
+<?php if (spl_autoload_functions() !== false) die('skip __autoload() registered by php.ini'); ?>
+--FILE--
+<?php
+
+function SplAutoloadTest1($name) {}
+function SplAutoloadTest2($name) {}
+
+var_dump(spl_autoload_functions());
+
+spl_autoload_register();
+
+var_dump(spl_autoload_functions());
+
+spl_autoload_register('SplAutoloadTest1');
+spl_autoload_register('SplAutoloadTest2');
+spl_autoload_register('SplAutoloadTest1');
+
+var_dump(spl_autoload_functions());
+
+spl_autoload_unregister('SplAutoloadTest1');
+
+var_dump(spl_autoload_functions());
+
+spl_autoload_unregister('spl_autoload_call');
+
+var_dump(spl_autoload_functions());
+
+spl_autoload_register();
+
+var_dump(spl_autoload_functions());
+
+spl_autoload_unregister('spl_autoload');
+
+var_dump(spl_autoload_functions());
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+bool(false)
+array(1) {
+ [0]=>
+ string(12) "spl_autoload"
+}
+array(3) {
+ [0]=>
+ string(12) "spl_autoload"
+ [1]=>
+ string(16) "SplAutoloadTest1"
+ [2]=>
+ string(16) "SplAutoloadTest2"
+}
+array(2) {
+ [0]=>
+ string(12) "spl_autoload"
+ [1]=>
+ string(16) "SplAutoloadTest2"
+}
+bool(false)
+array(1) {
+ [0]=>
+ string(12) "spl_autoload"
+}
+bool(false)
+===DONE===
diff --git a/ext/spl/tests/spl_autoload_003.phpt b/ext/spl/tests/spl_autoload_003.phpt
new file mode 100755
index 000000000..cc77756ee
--- /dev/null
+++ b/ext/spl/tests/spl_autoload_003.phpt
@@ -0,0 +1,44 @@
+--TEST--
+SPL: spl_autoload() and friends
+--INI--
+include_path=.
+--FILE--
+<?php
+
+function TestFunc1($classname)
+{
+ echo __METHOD__ . "($classname)\n";
+}
+
+function TestFunc2($classname)
+{
+ echo __METHOD__ . "($classname)\n";
+ throw new Exception("Class $classname missing");
+}
+
+function TestFunc3($classname)
+{
+ echo __METHOD__ . "($classname)\n";
+}
+
+spl_autoload_register("TestFunc1");
+spl_autoload_register("TestFunc2");
+spl_autoload_register("TestFunc3");
+
+try
+{
+ var_dump(class_exists("TestClass", true));
+}
+catch(Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+TestFunc1(TestClass)
+TestFunc2(TestClass)
+Exception: Class TestClass missing
+===DONE===
diff --git a/ext/spl/tests/spl_autoload_004.phpt b/ext/spl/tests/spl_autoload_004.phpt
new file mode 100755
index 000000000..627d39d13
--- /dev/null
+++ b/ext/spl/tests/spl_autoload_004.phpt
@@ -0,0 +1,56 @@
+--TEST--
+SPL: spl_autoload() with static methods
+--INI--
+include_path=.
+--FILE--
+<?php
+
+class MyAutoLoader {
+
+ static function autoLoad($className) {
+ echo __METHOD__ . "($className)\n";
+ }
+}
+
+spl_autoload_register(array('MyAutoLoader', 'autoLoad'));
+
+// and
+
+$myAutoLoader = new MyAutoLoader();
+
+spl_autoload_register(array($myAutoLoader, 'autoLoad'));
+
+var_dump(spl_autoload_functions());
+
+// check
+var_dump(class_exists("TestClass", true));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(12) "MyAutoLoader"
+ [1]=>
+ string(8) "autoLoad"
+ }
+}
+MyAutoLoader::autoLoad(TestClass)
+bool(false)
+===DONE===
+--UEXPECTF--
+array(1) {
+ [0]=>
+ array(2) {
+ [0]=>
+ unicode(12) "MyAutoLoader"
+ [1]=>
+ unicode(8) "autoLoad"
+ }
+}
+MyAutoLoader::autoLoad(TestClass)
+bool(false)
+===DONE===
diff --git a/ext/spl/tests/spl_autoload_005.phpt b/ext/spl/tests/spl_autoload_005.phpt
new file mode 100755
index 000000000..51af204c5
--- /dev/null
+++ b/ext/spl/tests/spl_autoload_005.phpt
@@ -0,0 +1,55 @@
+--TEST--
+SPL: spl_autoload() with methods
+--INI--
+include_path=.
+--FILE--
+<?php
+
+class MyAutoLoader {
+
+ function autoLoad($className)
+ {
+ echo __METHOD__ . "($className)\n";
+ }
+
+ function autoThrow($className)
+ {
+ echo __METHOD__ . "($className)\n";
+ throw new Exception("Unavailable");
+ }
+}
+
+try
+{
+ spl_autoload_register(array('MyAutoLoader', 'autoLoad'), true);
+}
+catch(Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+
+// and
+
+$myAutoLoader = new MyAutoLoader();
+
+spl_autoload_register(array($myAutoLoader, 'autoLoad'));
+spl_autoload_register(array($myAutoLoader, 'autoThrow'));
+
+try
+{
+ var_dump(class_exists("TestClass", true));
+}
+catch(Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Exception: Passed array specifies a non static method but no object
+MyAutoLoader::autoLoad(TestClass)
+MyAutoLoader::autoThrow(TestClass)
+Exception: Unavailable
+===DONE===
diff --git a/ext/spl/tests/spl_autoload_006.phpt b/ext/spl/tests/spl_autoload_006.phpt
new file mode 100755
index 000000000..36cf5ca19
--- /dev/null
+++ b/ext/spl/tests/spl_autoload_006.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SPL: spl_autoload() with static methods
+--INI--
+include_path=.
+--FILE--
+<?php
+
+class MyAutoLoader {
+
+ static function autoLoad($className) {
+ echo __METHOD__ . "($className)\n";
+ }
+}
+
+spl_autoload_register('MyAutoLoader::autoLoad');
+
+var_dump(spl_autoload_functions());
+
+// check
+var_dump(class_exists("TestClass", true));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(12) "MyAutoLoader"
+ [1]=>
+ string(8) "autoLoad"
+ }
+}
+MyAutoLoader::autoLoad(TestClass)
+bool(false)
+===DONE===
diff --git a/ext/spl/tests/sxe_001.phpt b/ext/spl/tests/sxe_001.phpt
index 88f83f2ab..72180d6a1 100755
--- a/ext/spl/tests/sxe_001.phpt
+++ b/ext/spl/tests/sxe_001.phpt
@@ -1,8 +1,11 @@
--TEST--
SPL: SimpleXMLIterator
--SKIPIF--
-<?php if (!extension_loaded("spl")) print "skip"; ?>
-<?php if (!extension_loaded("simplexml")) print "skip SimpleXML not present"; ?>
+<?php
+if (!extension_loaded("spl")) print "skip";
+if (!extension_loaded("simplexml")) print "skip SimpleXML not present";
+if (!extension_loaded("libxml")) print "skip LibXML not present";
+?>
--FILE--
<?php
diff --git a/ext/spl/tests/sxe_002.phpt b/ext/spl/tests/sxe_002.phpt
index b230e8cd8..ea9edd39f 100755
--- a/ext/spl/tests/sxe_002.phpt
+++ b/ext/spl/tests/sxe_002.phpt
@@ -2,8 +2,10 @@
SPL: SimpleXMLIterator and recursion
--SKIPIF--
<?php
- if (!extension_loaded('simplexml')) print 'skip';
- if (!class_exists('RecursiveIteratorIterator')) print 'skip RecursiveIteratorIterator not available';
+if (!extension_loaded("spl")) print "skip";
+if (!extension_loaded('simplexml')) print 'skip';
+if (!extension_loaded("libxml")) print "skip LibXML not present";
+if (!class_exists('RecursiveIteratorIterator')) print 'skip RecursiveIteratorIterator not available';
?>
--FILE--
<?php
diff --git a/ext/spl/tests/sxe_003.phpt b/ext/spl/tests/sxe_003.phpt
index aab7de720..e222af6eb 100755
--- a/ext/spl/tests/sxe_003.phpt
+++ b/ext/spl/tests/sxe_003.phpt
@@ -2,8 +2,10 @@
SPL: SimpleXMLIterator and getChildren()
--SKIPIF--
<?php
- if (!extension_loaded('simplexml')) print 'skip';
- if (!class_exists('RecursiveIteratorIterator')) print 'skip RecursiveIteratorIterator not available';
+if (!extension_loaded("spl")) print "skip";
+if (!extension_loaded('simplexml')) print 'skip';
+if (!extension_loaded("libxml")) print "skip LibXML not present";
+if (!class_exists('RecursiveIteratorIterator')) print 'skip RecursiveIteratorIterator not available';
?>
--FILE--
<?php
diff --git a/ext/spl/tests/sxe_004.phpt b/ext/spl/tests/sxe_004.phpt
new file mode 100755
index 000000000..487de4507
--- /dev/null
+++ b/ext/spl/tests/sxe_004.phpt
@@ -0,0 +1,206 @@
+--TEST--
+SPL: SimpleXMLIterator and getChildren()
+--SKIPIF--
+<?php
+if (!extension_loaded("spl")) print "skip";
+if (!extension_loaded('simplexml')) print 'skip';
+if (!extension_loaded("libxml")) print "skip LibXML not present";
+if (!class_exists('RecursiveIteratorIterator')) print 'skip RecursiveIteratorIterator not available';
+?>
+--FILE--
+<?php
+
+$xml =<<<EOF
+<?xml version='1.0'?>
+<!DOCTYPE sxe SYSTEM "notfound.dtd">
+<sxe id="elem1">
+ Plain text.
+ <elem1 attr1='first'>
+ Bla bla 1.
+ <!-- comment -->
+ <elem2>
+ Here we have some text data.
+ <elem3>
+ And here some more.
+ <elem4>
+ Wow once again.
+ </elem4>
+ </elem3>
+ </elem2>
+ </elem1>
+ <elem11 attr2='second'>
+ Bla bla 2.
+ <elem111>
+ Foo Bar
+ </elem111>
+ </elem11>
+</sxe>
+EOF;
+
+class SXETest extends SimpleXMLIterator
+{
+ function rewind()
+ {
+ echo __METHOD__ . "\n";
+ return parent::rewind();
+ }
+ function valid()
+ {
+ echo __METHOD__ . "\n";
+ return parent::valid();
+ }
+ function current()
+ {
+ echo __METHOD__ . "\n";
+ return parent::current();
+ }
+ function key()
+ {
+ echo __METHOD__ . "\n";
+ return parent::key();
+ }
+ function next()
+ {
+ echo __METHOD__ . "\n";
+ return parent::next();
+ }
+ function hasChildren()
+ {
+ echo __METHOD__ . "\n";
+ return parent::hasChildren();
+ }
+ function getChildren()
+ {
+ echo __METHOD__ . "\n";
+ return parent::getChildren();
+ }
+}
+
+$sxe = new SXETest($xml);
+$rit = new RecursiveIteratorIterator($sxe, RecursiveIteratorIterator::SELF_FIRST);
+
+foreach($rit as $data) {
+ var_dump(get_class($data));
+ var_dump(trim($data));
+}
+
+?>
+===DONE===
+--EXPECTF--
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+string(7) "SXETest"
+string(10) "Bla bla 1."
+SXETest::getChildren
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+string(7) "SXETest"
+string(28) "Here we have some text data."
+SXETest::getChildren
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+string(7) "SXETest"
+string(19) "And here some more."
+SXETest::getChildren
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+string(7) "SXETest"
+string(15) "Wow once again."
+SXETest::next
+SXETest::valid
+SXETest::next
+SXETest::valid
+SXETest::next
+SXETest::valid
+SXETest::next
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+string(7) "SXETest"
+string(10) "Bla bla 2."
+SXETest::getChildren
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+string(7) "SXETest"
+string(7) "Foo Bar"
+SXETest::next
+SXETest::valid
+SXETest::next
+SXETest::valid
+SXETest::valid
+===DONE===
+--UEXPECTF--
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+unicode(7) "SXETest"
+unicode(10) "Bla bla 1."
+SXETest::getChildren
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+unicode(7) "SXETest"
+unicode(28) "Here we have some text data."
+SXETest::getChildren
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+unicode(7) "SXETest"
+unicode(19) "And here some more."
+SXETest::getChildren
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+unicode(7) "SXETest"
+unicode(15) "Wow once again."
+SXETest::next
+SXETest::valid
+SXETest::next
+SXETest::valid
+SXETest::next
+SXETest::valid
+SXETest::next
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+unicode(7) "SXETest"
+unicode(10) "Bla bla 2."
+SXETest::getChildren
+SXETest::rewind
+SXETest::valid
+SXETest::hasChildren
+SXETest::valid
+SXETest::current
+unicode(7) "SXETest"
+unicode(7) "Foo Bar"
+SXETest::next
+SXETest::valid
+SXETest::next
+SXETest::valid
+SXETest::valid
+===DONE===
diff --git a/ext/spl/tests/testclass b/ext/spl/tests/testclass
new file mode 100755
index 000000000..f3cd9f360
--- /dev/null
+++ b/ext/spl/tests/testclass
@@ -0,0 +1,5 @@
+<?php
+
+echo __FILE__ . "\n";
+
+?> \ No newline at end of file
diff --git a/ext/spl/tests/testclass.class.inc b/ext/spl/tests/testclass.class.inc
new file mode 100755
index 000000000..c55541ba7
--- /dev/null
+++ b/ext/spl/tests/testclass.class.inc
@@ -0,0 +1,9 @@
+<?php
+
+echo __FILE__ . "\n";
+
+class TestClass
+{
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/tests/testclass.inc b/ext/spl/tests/testclass.inc
new file mode 100755
index 000000000..f3cd9f360
--- /dev/null
+++ b/ext/spl/tests/testclass.inc
@@ -0,0 +1,5 @@
+<?php
+
+echo __FILE__ . "\n";
+
+?> \ No newline at end of file
diff --git a/ext/spl/tests/testclass.php.inc b/ext/spl/tests/testclass.php.inc
new file mode 100755
index 000000000..f3cd9f360
--- /dev/null
+++ b/ext/spl/tests/testclass.php.inc
@@ -0,0 +1,5 @@
+<?php
+
+echo __FILE__ . "\n";
+
+?> \ No newline at end of file
diff --git a/ext/sqlite/Makefile.frag b/ext/sqlite/Makefile.frag
new file mode 100644
index 000000000..dd691d798
--- /dev/null
+++ b/ext/sqlite/Makefile.frag
@@ -0,0 +1,2 @@
+$(srcdir)/libsqlite/src/parse.c: $(srcdir)/libsqlite/src/parse.y
+ @$(LEMON) $(srcdir)/libsqlite/src/parse.y
diff --git a/ext/sqlite/TODO b/ext/sqlite/TODO
index 94834a2e3..325ac6fd6 100644
--- a/ext/sqlite/TODO
+++ b/ext/sqlite/TODO
@@ -1,3 +1,5 @@
+- Implement a PDO driver, called sqlite2
+
- Transparent binary encoding of return values from PHP callback functions.
- Add user-space callback for the authorizer function (this is potentially
@@ -14,6 +16,4 @@
--> Our test suite doesn't allow us to test persistent connections
at this time :/
-- Add support for compiled SQL.
-
vim:tw=78
diff --git a/ext/sqlite/config.m4 b/ext/sqlite/config.m4
index 23491d895..f1cddc345 100644
--- a/ext/sqlite/config.m4
+++ b/ext/sqlite/config.m4
@@ -1,61 +1,98 @@
-dnl $Id: config.m4,v 1.27.2.2 2005/08/28 23:20:20 wez Exp $
+dnl $Id: config.m4,v 1.41 2005/06/14 01:44:16 sniper Exp $
dnl config.m4 for extension sqlite
dnl vim:et:ts=2:sw=2
-PHP_ARG_ENABLE(sqlite-utf8, whether to enable UTF-8 support in sqlite (default: ISO-8859-1),
-[ --enable-sqlite-utf8 Enable UTF-8 support for SQLite], no, no)
-
PHP_ARG_WITH(sqlite, for sqlite support,
-[ --without-sqlite Do not include sqlite support.
+[ --without-sqlite Do not include sqlite support.
Use --with-sqlite=DIR to specify DIR where
Sqlite include and library files are located,
if not using bundled library.], yes)
+PHP_ARG_ENABLE(sqlite-utf8, whether to enable UTF-8 support in sqlite (default: ISO-8859-1),
+[ --enable-sqlite-utf8 SQLite: Enable UTF-8 support for SQLite], no, no)
+
+
+
+dnl
+dnl PHP_PROG_LEMON
+dnl
+dnl Search for lemon binary and check its version
+dnl
+AC_DEFUN([PHP_PROG_LEMON],[
+ # we only support certain lemon versions
+ lemon_version_list="1.0"
+
+ AC_CHECK_PROG(LEMON, lemon, lemon)
+ if test "$LEMON"; then
+ AC_CACHE_CHECK([for lemon version], php_cv_lemon_version, [
+ lemon_version=`$LEMON -x 2>/dev/null | $SED -e 's/^.* //'`
+ php_cv_lemon_version=invalid
+ for lemon_check_version in $lemon_version_list; do
+ if test "$lemon_version" = "$lemon_check_version"; then
+ php_cv_lemon_version="$lemon_check_version (ok)"
+ fi
+ done
+ ])
+ else
+ lemon_version=none
+ fi
+ case $php_cv_lemon_version in
+ ""|invalid[)]
+ lemon_msg="lemon versions supported for regeneration of libsqlite parsers: $lemon_version_list (found: $lemon_version)."
+ AC_MSG_WARN([$lemon_msg])
+ LEMON="exit 0;"
+ ;;
+ esac
+ PHP_SUBST(LEMON)
+])
+
+
if test "$PHP_SQLITE" != "no"; then
+ if test "$PHP_PDO" != "no"; then
+ PHP_CHECK_PDO_INCLUDES([], [AC_MSG_WARN([Cannot find php_pdo_driver.h.])])
+ if test -n "$pdo_inc_path"; then
+ AC_DEFINE([PHP_SQLITE2_HAVE_PDO], [1], [Have PDO])
+ pdo_inc_path="-I$pdo_inc_path"
+ fi
+ fi
if test "$PHP_SQLITE" != "yes"; then
SEARCH_PATH="/usr/local /usr"
SEARCH_FOR="/include/sqlite.h"
if test -r $PHP_SQLITE/; then # path given as parameter
- SQLITE_DIR=$PHP_SQLITE
+ SQLITE_DIR=$PHP_SQLITE
else # search default path list
- AC_MSG_CHECKING([for sqlite files in default path])
- for i in $SEARCH_PATH ; do
+ AC_MSG_CHECKING([for sqlite files in default path])
+ for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
- SQLITE_DIR=$i
- AC_MSG_RESULT(found in $i)
+ SQLITE_DIR=$i
+ AC_MSG_RESULT(found in $i)
fi
- done
+ done
fi
if test -z "$SQLITE_DIR"; then
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([Please reinstall the sqlite distribution from http://www.sqlite.org])
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Please reinstall the sqlite distribution from http://www.sqlite.org])
fi
- PHP_ADD_INCLUDE($SQLITE_DIR/include)
-
- LIBNAME=sqlite
- LIBSYMBOL=sqlite_open
-
- PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
- [
- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SQLITE_DIR/lib, SQLITE_SHARED_LIBADD)
- AC_DEFINE(HAVE_SQLITELIB,1,[ ])
+ PHP_CHECK_LIBRARY(sqlite, sqlite_open, [
+ PHP_ADD_LIBRARY_WITH_PATH(sqlite, $SQLITE_DIR/$PHP_LIBDIR, SQLITE_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($SQLITE_DIR/include)
],[
- AC_MSG_ERROR([wrong sqlite lib version or lib not found])
+ AC_MSG_ERROR([wrong sqlite lib version or lib not found])
],[
- -L$SQLITE_DIR/lib -lm
+ -L$SQLITE_DIR/$PHP_LIBDIR -lm
])
-
- PHP_SUBST(SQLITE_SHARED_LIBADD)
- PHP_NEW_EXTENSION(sqlite, sqlite.c sess_sqlite.c libsqlite/src/encode.c, $ext_shared)
+ SQLITE_MODULE_TYPE=external
+ PHP_SQLITE_CFLAGS=$pdo_inc_path
+ sqlite_extra_sources="libsqlite/src/encode.c"
else
# use bundled library
-
- PHP_SQLITE_CFLAGS="-I@ext_srcdir@/libsqlite/src"
-
- sources="libsqlite/src/opcodes.c
+ PHP_PROG_LEMON
+ SQLITE_MODULE_TYPE=builtin
+ PHP_SQLITE_CFLAGS="-I@ext_builddir@/libsqlite/src $pdo_inc_path"
+ sqlite_extra_sources="libsqlite/src/opcodes.c \
libsqlite/src/parse.c libsqlite/src/encode.c \
libsqlite/src/auth.c libsqlite/src/btree.c libsqlite/src/build.c \
libsqlite/src/delete.c libsqlite/src/expr.c libsqlite/src/func.c \
@@ -68,35 +105,47 @@ if test "$PHP_SQLITE" != "no"; then
libsqlite/src/vacuum.c libsqlite/src/copy.c \
libsqlite/src/vdbeaux.c libsqlite/src/date.c \
libsqlite/src/where.c libsqlite/src/trigger.c"
-
- PHP_NEW_EXTENSION(sqlite, sqlite.c sess_sqlite.c $sources, $ext_shared,,$PHP_SQLITE_CFLAGS)
- PHP_ADD_BUILD_DIR($ext_builddir/libsqlite)
- PHP_ADD_BUILD_DIR($ext_builddir/libsqlite/src)
- AC_CHECK_SIZEOF(char *,4)
+
+ PHP_ADD_EXTENSION_DEP(sqlite, spl)
+ PHP_ADD_EXTENSION_DEP(sqlite, pdo)
+ fi
+
+ dnl
+ dnl Common for both bundled/external
+ dnl
+ sqlite_sources="sqlite.c sess_sqlite.c pdo_sqlite2.c $sqlite_extra_sources"
+ PHP_NEW_EXTENSION(sqlite, $sqlite_sources, $ext_shared,,$PHP_SQLITE_CFLAGS)
+ PHP_ADD_MAKEFILE_FRAGMENT
+ PHP_SUBST(SQLITE_SHARED_LIBADD)
+ PHP_INSTALL_HEADERS([$ext_builddir/libsqlite/src/sqlite.h])
+
+ if test "$SQLITE_MODULE_TYPE" = "builtin"; then
+ PHP_ADD_BUILD_DIR($ext_builddir/libsqlite/src, 1)
+ AC_CHECK_SIZEOF(char *, 4)
AC_DEFINE(SQLITE_PTR_SZ, SIZEOF_CHAR_P, [Size of a pointer])
dnl use latin 1 for SQLite older than 2.8.9; the utf-8 handling
dnl in funcs.c uses assert(), which is a bit silly and something
dnl we want to avoid. This assert() was removed in SQLite 2.8.9.
if test "$PHP_SQLITE_UTF8" = "yes"; then
- SQLITE_ENCODING="UTF8"
- AC_DEFINE(SQLITE_UTF8, 1, [ ])
+ SQLITE_ENCODING="UTF8"
+ AC_DEFINE(SQLITE_UTF8, 1, [ ])
else
- SQLITE_ENCODING="ISO8859"
+ SQLITE_ENCODING="ISO8859"
fi
PHP_SUBST(SQLITE_ENCODING)
SQLITE_VERSION=`cat $ext_srcdir/libsqlite/VERSION`
PHP_SUBST(SQLITE_VERSION)
-
- sed -e s/--VERS--/$SQLITE_VERSION/ -e s/--ENCODING--/$SQLITE_ENCODING/ $ext_srcdir/libsqlite/src/sqlite.h.in >$ext_srcdir/libsqlite/src/sqlite.h
- if test "$ext_shared" = "no" || test -d $abs_srcdir/Zend ; then
- echo '#include <php_config.h>' > $ext_srcdir/libsqlite/src/config.h
+ sed -e s/--VERS--/$SQLITE_VERSION/ -e s/--ENCODING--/$SQLITE_ENCODING/ $ext_srcdir/libsqlite/src/sqlite.h.in > $ext_builddir/libsqlite/src/sqlite.h
+
+ if test "$ext_shared" = "no" || test "$ext_srcdir" != "$abs_srcdir"; then
+ echo '#include <php_config.h>' > $ext_builddir/libsqlite/src/config.h
else
- echo "#include \"$abs_builddir/config.h\"" > $ext_srcdir/libsqlite/src/config.h
+ echo "#include \"$abs_builddir/config.h\"" > $ext_builddir/libsqlite/src/config.h
fi
- cat >> $ext_srcdir/libsqlite/src/config.h <<EOF
+ cat >> $ext_builddir/libsqlite/src/config.h <<EOF
#if ZTS
# define THREADSAFE 1
#endif
@@ -104,9 +153,8 @@ if test "$PHP_SQLITE" != "no"; then
# define NDEBUG
#endif
EOF
-
fi
-
+
AC_CHECK_FUNCS(usleep nanosleep)
AC_CHECK_HEADERS(time.h)
fi
diff --git a/ext/sqlite/config.w32 b/ext/sqlite/config.w32
index 0f74e20c9..b0778fc3b 100644
--- a/ext/sqlite/config.w32
+++ b/ext/sqlite/config.w32
@@ -1,7 +1,7 @@
-// $Id: config.w32,v 1.5 2004/05/25 13:01:05 wez Exp $
+// $Id: config.w32,v 1.8.2.1 2005/09/24 15:13:13 edink Exp $
// vim:ft=javascript
-ARG_WITH("sqlite", "SQLite support", "yes");
+ARG_WITH("sqlite", "SQLite support", "no");
if (PHP_SQLITE != "no") {
copy_and_subst(configure_module_dirname + "\\libsqlite\\src\\sqlite.h.in",
@@ -12,9 +12,17 @@ if (PHP_SQLITE != "no") {
FSO.CopyFile(configure_module_dirname + "\\libsqlite\\src\\sqlite_config.w32.h",
configure_module_dirname + "\\libsqlite\\src\\config.h");
+
+ if (FSO.FileExists(configure_module_dirname + "\\..\\pdo\\php_pdo_driver.h")) {
+ PHP_SQLITE2_PDO_CFLAGS = " /DPHP_SQLITE2_HAVE_PDO=1 /I " + configure_module_dirname + "\\..";
+ ADD_EXTENSION_DEP('sqlite', 'pdo')
+ } else {
+ PHP_SQLITE2_PDO_CFLAGS = "";
+ }
- EXTENSION("sqlite", "sqlite.c sess_sqlite.c", null,
- "/D PHP_SQLITE_EXPORTS /I " + configure_module_dirname + "/libsqlite/src");
+ EXTENSION("sqlite", "sqlite.c sess_sqlite.c pdo_sqlite2.c", null,
+ "/D PHP_SQLITE_EXPORTS /I " + configure_module_dirname + "/libsqlite/src" +
+ PHP_SQLITE2_PDO_CFLAGS);
ADD_SOURCES(configure_module_dirname + "/libsqlite/src", "opcodes.c parse.c encode.c \
@@ -27,6 +35,5 @@ if (PHP_SQLITE != "no") {
if (!PHP_SQLITE_SHARED) {
ADD_DEF_FILE(configure_module_dirname + "\\php_sqlite.def");
}
+ ADD_EXTENSION_DEP('sqlite', 'spl')
}
-
-
diff --git a/ext/sqlite/libsqlite/VERSION b/ext/sqlite/libsqlite/VERSION
index 63cb62ffd..85c0a6a96 100644
--- a/ext/sqlite/libsqlite/VERSION
+++ b/ext/sqlite/libsqlite/VERSION
@@ -1 +1 @@
-2.8.14
+2.8.16
diff --git a/ext/sqlite/libsqlite/src/attach.c b/ext/sqlite/libsqlite/src/attach.c
index 0f90b1b67..d50c218b6 100644
--- a/ext/sqlite/libsqlite/src/attach.c
+++ b/ext/sqlite/libsqlite/src/attach.c
@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the ATTACH and DETACH commands.
**
-** $Id: attach.c,v 1.4 2004/07/10 12:27:51 wez Exp $
+** $Id: attach.c,v 1.4.4.1 2005/09/07 15:11:31 iliaa Exp $
*/
#include "sqliteInt.h"
diff --git a/ext/sqlite/libsqlite/src/auth.c b/ext/sqlite/libsqlite/src/auth.c
index 2b67613b7..9143971c7 100644
--- a/ext/sqlite/libsqlite/src/auth.c
+++ b/ext/sqlite/libsqlite/src/auth.c
@@ -14,7 +14,7 @@
** systems that do not need this facility may omit it by recompiling
** the library with -DSQLITE_OMIT_AUTHORIZATION=1
**
-** $Id: auth.c,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: auth.c,v 1.6.2.1 2005/09/07 15:11:31 iliaa Exp $
*/
#include "sqliteInt.h"
@@ -111,6 +111,7 @@ void sqliteAuthRead(
const char *zCol; /* Name of the column of the table */
int iSrc; /* Index in pTabList->a[] of table being read */
const char *zDBase; /* Name of database being accessed */
+ TriggerStack *pStack; /* The stack of current triggers */
if( db->xAuth==0 ) return;
assert( pExpr->op==TK_COLUMN );
@@ -119,15 +120,14 @@ void sqliteAuthRead(
}
if( iSrc>=0 && iSrc<pTabList->nSrc ){
pTab = pTabList->a[iSrc].pTab;
- }else{
+ }else if( (pStack = pParse->trigStack)!=0 ){
/* This must be an attempt to read the NEW or OLD pseudo-tables
** of a trigger.
*/
- TriggerStack *pStack; /* The stack of current triggers */
- pStack = pParse->trigStack;
- assert( pStack!=0 );
assert( pExpr->iTable==pStack->newIdx || pExpr->iTable==pStack->oldIdx );
pTab = pStack->pTab;
+ }else{
+ return;
}
if( pTab==0 ) return;
if( pExpr->iColumn>=0 ){
diff --git a/ext/sqlite/libsqlite/src/btree.c b/ext/sqlite/libsqlite/src/btree.c
index 0fc143206..f56d869c4 100644
--- a/ext/sqlite/libsqlite/src/btree.c
+++ b/ext/sqlite/libsqlite/src/btree.c
@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: btree.c,v 1.5.4.1 2005/09/07 15:11:31 iliaa Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
diff --git a/ext/sqlite/libsqlite/src/btree.h b/ext/sqlite/libsqlite/src/btree.h
index 7f035bc71..ce124cfe9 100644
--- a/ext/sqlite/libsqlite/src/btree.h
+++ b/ext/sqlite/libsqlite/src/btree.h
@@ -13,7 +13,7 @@
** subsystem. See comments in the source code for a detailed description
** of what each interface routine does.
**
-** @(#) $Id: btree.h,v 1.5 2004/07/10 12:27:51 wez Exp $
+** @(#) $Id: btree.h,v 1.5.4.1 2005/09/07 15:11:31 iliaa Exp $
*/
#ifndef _BTREE_H_
#define _BTREE_H_
diff --git a/ext/sqlite/libsqlite/src/btree_rb.c b/ext/sqlite/libsqlite/src/btree_rb.c
index a160cefd4..b9da43515 100644
--- a/ext/sqlite/libsqlite/src/btree_rb.c
+++ b/ext/sqlite/libsqlite/src/btree_rb.c
@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree_rb.c,v 1.5 2004/01/14 17:08:27 iliaa Exp $
+** $Id: btree_rb.c,v 1.5.4.1 2005/09/07 15:11:31 iliaa Exp $
**
** This file implements an in-core database using Red-Black balanced
** binary trees.
@@ -259,17 +259,16 @@ static void rightRotate(BtRbTree *pTree, BtRbNode *pX)
* concatenation of orig and val is returned. The original orig is deleted
* (using sqliteFree()).
*/
-static char *append_val(char * orig, char const * val)
-{
+static char *append_val(char * orig, char const * val){
+ char *z;
if( !orig ){
- return sqliteStrDup( val );
+ z = sqliteStrDup( val );
} else{
- char * ret = 0;
- sqliteSetString(&ret, orig, val, (char*)0);
+ z = 0;
+ sqliteSetString(&z, orig, val, (char*)0);
sqliteFree( orig );
- return ret;
}
- assert(0);
+ return z;
}
/*
@@ -723,13 +722,13 @@ static int memRbtreeCursor(
pCur = *ppCur = sqliteMalloc(sizeof(RbtCursor));
if( sqlite_malloc_failed ) return SQLITE_NOMEM;
pCur->pTree = sqliteHashFind(&tree->tblHash, 0, iTable);
+ assert( pCur->pTree );
pCur->pRbtree = tree;
pCur->iTree = iTable;
pCur->pOps = &sqliteRbtreeCursorOps;
pCur->wrFlag = wrFlag;
pCur->pShared = pCur->pTree->pCursors;
pCur->pTree->pCursors = pCur;
-
assert( (*ppCur)->pTree );
return SQLITE_OK;
@@ -1178,12 +1177,11 @@ static int memRbtreeKey(RbtCursor* pCur, int offset, int amt, char *zBuf)
if( !pCur->pNode ) return 0;
if( !pCur->pNode->pKey || ((amt + offset) <= pCur->pNode->nKey) ){
memcpy(zBuf, ((char*)pCur->pNode->pKey)+offset, amt);
- return amt;
}else{
memcpy(zBuf, ((char*)pCur->pNode->pKey)+offset, pCur->pNode->nKey-offset);
- return pCur->pNode->nKey-offset;
+ amt = pCur->pNode->nKey-offset;
}
- assert(0);
+ return amt;
}
static int memRbtreeDataSize(RbtCursor* pCur, int *pSize)
@@ -1201,12 +1199,11 @@ static int memRbtreeData(RbtCursor *pCur, int offset, int amt, char *zBuf)
if( !pCur->pNode ) return 0;
if( (amt + offset) <= pCur->pNode->nData ){
memcpy(zBuf, ((char*)pCur->pNode->pData)+offset, amt);
- return amt;
}else{
memcpy(zBuf, ((char*)pCur->pNode->pData)+offset ,pCur->pNode->nData-offset);
- return pCur->pNode->nData-offset;
+ amt = pCur->pNode->nData-offset;
}
- assert(0);
+ return amt;
}
static int memRbtreeCloseCursor(RbtCursor* pCur)
@@ -1421,13 +1418,12 @@ static int memRbtreeCursorDump(RbtCursor* pCur, int* aRes)
assert(!"Cannot call sqliteRbtreeCursorDump");
return SQLITE_OK;
}
+#endif
static struct Pager *memRbtreePager(Rbtree* tree)
{
- assert(!"Cannot call sqliteRbtreePager");
- return SQLITE_OK;
+ return 0;
}
-#endif
/*
** Return the full pathname of the underlying database file.
@@ -1463,10 +1459,9 @@ static BtOps sqliteRbtreeOps = {
(char*(*)(Btree*,int*,int)) memRbtreeIntegrityCheck,
(const char*(*)(Btree*)) memRbtreeGetFilename,
(int(*)(Btree*,Btree*)) memRbtreeCopyFile,
-
+ (struct Pager*(*)(Btree*)) memRbtreePager,
#ifdef SQLITE_TEST
(int(*)(Btree*,int,int)) memRbtreePageDump,
- (struct Pager*(*)(Btree*)) memRbtreePager
#endif
};
diff --git a/ext/sqlite/libsqlite/src/build.c b/ext/sqlite/libsqlite/src/build.c
index e4c3744a7..a18112ace 100644
--- a/ext/sqlite/libsqlite/src/build.c
+++ b/ext/sqlite/libsqlite/src/build.c
@@ -23,7 +23,7 @@
** ROLLBACK
** PRAGMA
**
-** $Id: build.c,v 1.6 2004/07/10 12:27:51 wez Exp $
+** $Id: build.c,v 1.6.4.1 2005/09/07 15:11:31 iliaa Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1537,7 +1537,7 @@ void sqliteCreateIndex(
if( pName && !db->init.busy ){
Index *pISameName; /* Another index with the same name */
Table *pTSameName; /* A table with same name as the index */
- zName = sqliteStrNDup(pName->z, pName->n);
+ zName = sqliteTableNameFromToken(pName);
if( zName==0 ) goto exit_create_index;
if( (pISameName = sqliteFindIndex(db, zName, 0))!=0 ){
sqliteErrorMsg(pParse, "index %s already exists", zName);
@@ -1557,7 +1557,7 @@ void sqliteCreateIndex(
sqliteSetString(&zName, "(", pTab->zName, " autoindex ", zBuf, (char*)0);
if( zName==0 ) goto exit_create_index;
}else{
- zName = sqliteStrNDup(pName->z, pName->n);
+ zName = sqliteTableNameFromToken(pName);
}
/* Check for authorization to create an index.
diff --git a/ext/sqlite/libsqlite/src/copy.c b/ext/sqlite/libsqlite/src/copy.c
index 8f95a5222..1dc5a0ddb 100644
--- a/ext/sqlite/libsqlite/src/copy.c
+++ b/ext/sqlite/libsqlite/src/copy.c
@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the COPY command.
**
-** $Id: copy.c,v 1.4 2004/07/10 12:27:51 wez Exp $
+** $Id: copy.c,v 1.4.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "sqliteInt.h"
diff --git a/ext/sqlite/libsqlite/src/date.c b/ext/sqlite/libsqlite/src/date.c
index 201f0a4c4..233aa7bb3 100644
--- a/ext/sqlite/libsqlite/src/date.c
+++ b/ext/sqlite/libsqlite/src/date.c
@@ -16,7 +16,7 @@
** sqliteRegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: date.c,v 1.3 2004/07/10 12:27:51 wez Exp $
+** $Id: date.c,v 1.3.4.1 2005/09/07 15:11:32 iliaa Exp $
**
** NOTES:
**
@@ -800,18 +800,20 @@ static void strftimeFunc(sqlite_func *context, int argc, const char **argv){
case 'H': sprintf(&z[j],"%02d",x.h); j+=2; break;
case 'W': /* Fall thru */
case 'j': {
- int n;
+ int n; /* Number of days since 1st day of year */
DateTime y = x;
y.validJD = 0;
y.M = 1;
y.D = 1;
computeJD(&y);
- n = x.rJD - y.rJD + 1;
+ n = x.rJD - y.rJD;
if( zFmt[i]=='W' ){
- sprintf(&z[j],"%02d",(n+6)/7);
+ int wd; /* 0=Monday, 1=Tuesday, ... 6=Sunday */
+ wd = ((int)(x.rJD+0.5)) % 7;
+ sprintf(&z[j],"%02d",(n+7-wd)/7);
j += 2;
}else{
- sprintf(&z[j],"%03d",n);
+ sprintf(&z[j],"%03d",n+1);
j += 3;
}
break;
@@ -847,19 +849,18 @@ static void strftimeFunc(sqlite_func *context, int argc, const char **argv){
** external linkage.
*/
void sqliteRegisterDateTimeFunctions(sqlite *db){
+#ifndef SQLITE_OMIT_DATETIME_FUNCS
static struct {
char *zName;
int nArg;
int dataType;
void (*xFunc)(sqlite_func*,int,const char**);
} aFuncs[] = {
-#ifndef SQLITE_OMIT_DATETIME_FUNCS
{ "julianday", -1, SQLITE_NUMERIC, juliandayFunc },
{ "date", -1, SQLITE_TEXT, dateFunc },
{ "time", -1, SQLITE_TEXT, timeFunc },
{ "datetime", -1, SQLITE_TEXT, datetimeFunc },
{ "strftime", -1, SQLITE_TEXT, strftimeFunc },
-#endif
};
int i;
@@ -870,4 +871,5 @@ void sqliteRegisterDateTimeFunctions(sqlite *db){
sqlite_function_type(db, aFuncs[i].zName, aFuncs[i].dataType);
}
}
+#endif
}
diff --git a/ext/sqlite/libsqlite/src/delete.c b/ext/sqlite/libsqlite/src/delete.c
index 0fb9756a7..b5db904dd 100644
--- a/ext/sqlite/libsqlite/src/delete.c
+++ b/ext/sqlite/libsqlite/src/delete.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle DELETE FROM statements.
**
-** $Id: delete.c,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: delete.c,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "sqliteInt.h"
diff --git a/ext/sqlite/libsqlite/src/encode.c b/ext/sqlite/libsqlite/src/encode.c
index 3562dc06d..86e33a750 100644
--- a/ext/sqlite/libsqlite/src/encode.c
+++ b/ext/sqlite/libsqlite/src/encode.c
@@ -15,7 +15,7 @@
** data in an SQLite database. The code in this file is not used by any other
** part of the SQLite library.
**
-** $Id: encode.c,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: encode.c,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include <string.h>
#include <assert.h>
diff --git a/ext/sqlite/libsqlite/src/expr.c b/ext/sqlite/libsqlite/src/expr.c
index 4339836e8..11d298d69 100644
--- a/ext/sqlite/libsqlite/src/expr.c
+++ b/ext/sqlite/libsqlite/src/expr.c
@@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
-** $Id: expr.c,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: expr.c,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -124,7 +124,7 @@ Expr *sqliteExprDup(Expr *p){
if( pNew==0 ) return 0;
memcpy(pNew, p, sizeof(*pNew));
if( p->token.z!=0 ){
- pNew->token.z = sqliteStrDup(p->token.z);
+ pNew->token.z = sqliteStrNDup(p->token.z, p->token.n);
pNew->token.dyn = 1;
}else{
assert( pNew->token.z==0 );
@@ -155,7 +155,10 @@ ExprList *sqliteExprListDup(ExprList *p){
if( pNew==0 ) return 0;
pNew->nExpr = pNew->nAlloc = p->nExpr;
pNew->a = pItem = sqliteMalloc( p->nExpr*sizeof(p->a[0]) );
- if( pItem==0 ) return 0; /* Leaks memory after a malloc failure */
+ if( pItem==0 ){
+ sqliteFree(pNew);
+ return 0;
+ }
for(i=0; i<p->nExpr; i++, pItem++){
Expr *pNewExpr, *pOldExpr;
pItem->pExpr = pNewExpr = sqliteExprDup(pOldExpr = p->a[i].pExpr);
diff --git a/ext/sqlite/libsqlite/src/func.c b/ext/sqlite/libsqlite/src/func.c
index fb21181cd..0d553f4a1 100644
--- a/ext/sqlite/libsqlite/src/func.c
+++ b/ext/sqlite/libsqlite/src/func.c
@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: func.c,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: func.c,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include <ctype.h>
#include <math.h>
@@ -157,20 +157,20 @@ static void roundFunc(sqlite_func *context, int argc, const char **argv){
** Implementation of the upper() and lower() SQL functions.
*/
static void upperFunc(sqlite_func *context, int argc, const char **argv){
- char *z;
+ unsigned char *z;
int i;
if( argc<1 || argv[0]==0 ) return;
- z = sqlite_set_result_string(context, argv[0], -1);
+ z = (unsigned char*)sqlite_set_result_string(context, argv[0], -1);
if( z==0 ) return;
for(i=0; z[i]; i++){
if( islower(z[i]) ) z[i] = toupper(z[i]);
}
}
static void lowerFunc(sqlite_func *context, int argc, const char **argv){
- char *z;
+ unsigned char *z;
int i;
if( argc<1 || argv[0]==0 ) return;
- z = sqlite_set_result_string(context, argv[0], -1);
+ z = (unsigned char*)sqlite_set_result_string(context, argv[0], -1);
if( z==0 ) return;
for(i=0; z[i]; i++){
if( isupper(z[i]) ) z[i] = tolower(z[i]);
@@ -517,26 +517,28 @@ static void minmaxStep(sqlite_func *context, int argc, const char **argv){
int mask; /* 0 for min() or 0xffffffff for max() */
assert( argc==2 );
+ if( argv[0]==0 ) return; /* Ignore NULL values */
if( argv[1][0]=='n' ){
xCompare = sqliteCompare;
}else{
xCompare = strcmp;
}
mask = (int)sqlite_user_data(context);
+ assert( mask==0 || mask==-1 );
p = sqlite_aggregate_context(context, sizeof(*p));
- if( p==0 || argc<1 || argv[0]==0 ) return;
+ if( p==0 || argc<1 ) return;
if( p->z==0 || (xCompare(argv[0],p->z)^mask)<0 ){
int len;
- if( !p->zBuf[0] ){
+ if( p->zBuf[0] ){
sqliteFree(p->z);
}
len = strlen(argv[0]);
if( len < sizeof(p->zBuf)-1 ){
p->z = &p->zBuf[1];
- p->zBuf[0] = 1;
+ p->zBuf[0] = 0;
}else{
p->z = sqliteMalloc( len+1 );
- p->zBuf[0] = 0;
+ p->zBuf[0] = 1;
if( p->z==0 ) return;
}
strcpy(p->z, argv[0]);
@@ -545,10 +547,10 @@ static void minmaxStep(sqlite_func *context, int argc, const char **argv){
static void minMaxFinalize(sqlite_func *context){
MinMaxCtx *p;
p = sqlite_aggregate_context(context, sizeof(*p));
- if( p && p->z ){
+ if( p && p->z && p->zBuf[0]<2 ){
sqlite_set_result_string(context, p->z, strlen(p->z));
}
- if( p && !p->zBuf[0] ){
+ if( p && p->zBuf[0] ){
sqliteFree(p->z);
}
}
@@ -621,7 +623,12 @@ void sqliteRegisterBuiltinFunctions(sqlite *db){
int i;
for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
- void *pArg = aFuncs[i].argType==2 ? (void*)(-1) : db;
+ void *pArg;
+ switch( aFuncs[i].argType ){
+ case 0: pArg = 0; break;
+ case 1: pArg = db; break;
+ case 2: pArg = (void*)(-1); break;
+ }
sqlite_create_function(db, aFuncs[i].zName,
aFuncs[i].nArg, aFuncs[i].xFunc, pArg);
if( aFuncs[i].xFunc ){
@@ -629,7 +636,12 @@ void sqliteRegisterBuiltinFunctions(sqlite *db){
}
}
for(i=0; i<sizeof(aAggs)/sizeof(aAggs[0]); i++){
- void *pArg = aAggs[i].argType==2 ? (void*)(-1) : db;
+ void *pArg;
+ switch( aAggs[i].argType ){
+ case 0: pArg = 0; break;
+ case 1: pArg = db; break;
+ case 2: pArg = (void*)(-1); break;
+ }
sqlite_create_aggregate(db, aAggs[i].zName,
aAggs[i].nArg, aAggs[i].xStep, aAggs[i].xFinalize, pArg);
sqlite_function_type(db, aAggs[i].zName, aAggs[i].dataType);
diff --git a/ext/sqlite/libsqlite/src/hash.c b/ext/sqlite/libsqlite/src/hash.c
index 4cf364d2d..5ecb9e50a 100644
--- a/ext/sqlite/libsqlite/src/hash.c
+++ b/ext/sqlite/libsqlite/src/hash.c
@@ -12,7 +12,7 @@
** This is the implementation of generic hash-tables
** used in SQLite.
**
-** $Id: hash.c,v 1.6 2004/07/10 12:27:51 wez Exp $
+** $Id: hash.c,v 1.6.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "sqliteInt.h"
#include <assert.h>
diff --git a/ext/sqlite/libsqlite/src/hash.h b/ext/sqlite/libsqlite/src/hash.h
index 7a07a8736..ea86c1b88 100644
--- a/ext/sqlite/libsqlite/src/hash.h
+++ b/ext/sqlite/libsqlite/src/hash.h
@@ -12,7 +12,7 @@
** This is the header file for the generic hash-table implemenation
** used in SQLite.
**
-** $Id: hash.h,v 1.6 2004/07/10 12:27:51 wez Exp $
+** $Id: hash.h,v 1.6.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#ifndef _SQLITE_HASH_H_
#define _SQLITE_HASH_H_
diff --git a/ext/sqlite/libsqlite/src/insert.c b/ext/sqlite/libsqlite/src/insert.c
index c2f6ffa89..6ec361977 100644
--- a/ext/sqlite/libsqlite/src/insert.c
+++ b/ext/sqlite/libsqlite/src/insert.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
-** $Id: insert.c,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: insert.c,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "sqliteInt.h"
diff --git a/ext/sqlite/libsqlite/src/main.c b/ext/sqlite/libsqlite/src/main.c
index 82dccf3fe..e7c6ab685 100644
--- a/ext/sqlite/libsqlite/src/main.c
+++ b/ext/sqlite/libsqlite/src/main.c
@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
-** $Id: main.c,v 1.7 2004/07/10 12:27:51 wez Exp $
+** $Id: main.c,v 1.7.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -189,10 +189,13 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
BtCursor *curMain;
int size;
Table *pTab;
- char *azArg[6];
+ char const *azArg[6];
char zDbNum[30];
int meta[SQLITE_N_BTREE_META];
InitData initData;
+ char const *zMasterSchema;
+ char const *zMasterName;
+ char *zSql = 0;
/*
** The master database table has a structure like this
@@ -216,62 +219,38 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
")"
;
- /* The following SQL will read the schema from the master tables.
- ** The first version works with SQLite file formats 2 or greater.
- ** The second version is for format 1 files.
- **
- ** Beginning with file format 2, the rowid for new table entries
- ** (including entries in sqlite_master) is an increasing integer.
- ** So for file format 2 and later, we can play back sqlite_master
- ** and all the CREATE statements will appear in the right order.
- ** But with file format 1, table entries were random and so we
- ** have to make sure the CREATE TABLEs occur before their corresponding
- ** CREATE INDEXs. (We don't have to deal with CREATE VIEW or
- ** CREATE TRIGGER in file format 1 because those constructs did
- ** not exist then.)
+ assert( iDb>=0 && iDb<db->nDb );
+
+ /* zMasterSchema and zInitScript are set to point at the master schema
+ ** and initialisation script appropriate for the database being
+ ** initialised. zMasterName is the name of the master table.
*/
- static char init_script[] =
- "SELECT type, name, rootpage, sql, 1 FROM sqlite_temp_master "
- "UNION ALL "
- "SELECT type, name, rootpage, sql, 0 FROM sqlite_master";
- static char older_init_script[] =
- "SELECT type, name, rootpage, sql, 1 FROM sqlite_temp_master "
- "UNION ALL "
- "SELECT type, name, rootpage, sql, 0 FROM sqlite_master "
- "WHERE type='table' "
- "UNION ALL "
- "SELECT type, name, rootpage, sql, 0 FROM sqlite_master "
- "WHERE type='index'";
-
-
- assert( iDb>=0 && iDb!=1 && iDb<db->nDb );
-
- /* Construct the schema tables: sqlite_master and sqlite_temp_master
+ if( iDb==1 ){
+ zMasterSchema = temp_master_schema;
+ zMasterName = TEMP_MASTER_NAME;
+ }else{
+ zMasterSchema = master_schema;
+ zMasterName = MASTER_NAME;
+ }
+
+ /* Construct the schema table.
*/
sqliteSafetyOff(db);
azArg[0] = "table";
- azArg[1] = MASTER_NAME;
+ azArg[1] = zMasterName;
azArg[2] = "2";
- azArg[3] = master_schema;
+ azArg[3] = zMasterSchema;
sprintf(zDbNum, "%d", iDb);
azArg[4] = zDbNum;
azArg[5] = 0;
initData.db = db;
initData.pzErrMsg = pzErrMsg;
- sqliteInitCallback(&initData, 5, azArg, 0);
- pTab = sqliteFindTable(db, MASTER_NAME, "main");
+ sqliteInitCallback(&initData, 5, (char **)azArg, 0);
+ pTab = sqliteFindTable(db, zMasterName, db->aDb[iDb].zName);
if( pTab ){
pTab->readOnly = 1;
- }
- if( iDb==0 ){
- azArg[1] = TEMP_MASTER_NAME;
- azArg[3] = temp_master_schema;
- azArg[4] = "1";
- sqliteInitCallback(&initData, 5, azArg, 0);
- pTab = sqliteFindTable(db, TEMP_MASTER_NAME, "temp");
- if( pTab ){
- pTab->readOnly = 1;
- }
+ }else{
+ return SQLITE_NOMEM;
}
sqliteSafetyOn(db);
@@ -320,7 +299,7 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
sqliteSetString(pzErrMsg, "unsupported file format", (char*)0);
return SQLITE_ERROR;
}
- }else if( db->file_format!=meta[2] || db->file_format<4 ){
+ }else if( iDb!=1 && (db->file_format!=meta[2] || db->file_format<4) ){
assert( db->file_format>=4 );
if( meta[2]==0 ){
sqliteSetString(pzErrMsg, "cannot attach empty database: ",
@@ -340,18 +319,35 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
*/
assert( db->init.busy );
sqliteSafetyOff(db);
- if( iDb==0 ){
- rc = sqlite_exec(db,
- db->file_format>=2 ? init_script : older_init_script,
- sqliteInitCallback, &initData, 0);
+
+ /* The following SQL will read the schema from the master tables.
+ ** The first version works with SQLite file formats 2 or greater.
+ ** The second version is for format 1 files.
+ **
+ ** Beginning with file format 2, the rowid for new table entries
+ ** (including entries in sqlite_master) is an increasing integer.
+ ** So for file format 2 and later, we can play back sqlite_master
+ ** and all the CREATE statements will appear in the right order.
+ ** But with file format 1, table entries were random and so we
+ ** have to make sure the CREATE TABLEs occur before their corresponding
+ ** CREATE INDEXs. (We don't have to deal with CREATE VIEW or
+ ** CREATE TRIGGER in file format 1 because those constructs did
+ ** not exist then.)
+ */
+ if( db->file_format>=2 ){
+ sqliteSetString(&zSql,
+ "SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"",
+ db->aDb[iDb].zName, "\".", zMasterName, (char*)0);
}else{
- char *zSql = 0;
sqliteSetString(&zSql,
- "SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"",
- db->aDb[iDb].zName, "\".sqlite_master", (char*)0);
- rc = sqlite_exec(db, zSql, sqliteInitCallback, &initData, 0);
- sqliteFree(zSql);
+ "SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"",
+ db->aDb[iDb].zName, "\".", zMasterName,
+ " WHERE type IN ('table', 'index')"
+ " ORDER BY CASE type WHEN 'table' THEN 0 ELSE 1 END", (char*)0);
}
+ rc = sqlite_exec(db, zSql, sqliteInitCallback, &initData, 0);
+
+ sqliteFree(zSql);
sqliteSafetyOn(db);
sqliteBtreeCloseCursor(curMain);
if( sqlite_malloc_failed ){
@@ -361,9 +357,6 @@ static int sqliteInitOne(sqlite *db, int iDb, char **pzErrMsg){
}
if( rc==SQLITE_OK ){
DbSetProperty(db, iDb, DB_SchemaLoaded);
- if( iDb==0 ){
- DbSetProperty(db, 1, DB_SchemaLoaded);
- }
}else{
sqliteResetInternalSchema(db, iDb);
}
@@ -391,13 +384,24 @@ int sqliteInit(sqlite *db, char **pzErrMsg){
rc = SQLITE_OK;
db->init.busy = 1;
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
- if( DbHasProperty(db, i, DB_SchemaLoaded) ) continue;
- assert( i!=1 ); /* Should have been initialized together with 0 */
+ if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue;
rc = sqliteInitOne(db, i, pzErrMsg);
if( rc ){
sqliteResetInternalSchema(db, i);
}
}
+
+ /* Once all the other databases have been initialised, load the schema
+ ** for the TEMP database. This is loaded last, as the TEMP database
+ ** schema may contain references to objects in other databases.
+ */
+ if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){
+ rc = sqliteInitOne(db, 1, pzErrMsg);
+ if( rc ){
+ sqliteResetInternalSchema(db, 1);
+ }
+ }
+
db->init.busy = 0;
if( rc==SQLITE_OK ){
db->flags |= SQLITE_Initialized;
diff --git a/ext/sqlite/libsqlite/src/os.c b/ext/sqlite/libsqlite/src/os.c
index 0e2930c0c..930d62440 100644
--- a/ext/sqlite/libsqlite/src/os.c
+++ b/ext/sqlite/libsqlite/src/os.c
@@ -830,7 +830,7 @@ int sqliteOsTempFileName(char *zBuf){
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789";
int i, j;
- char *zDir;
+ const char *zDir;
char zTempPath[SQLITE_TEMPNAME_SIZE];
if( sqlite_temp_directory==0 ){
GetTempPath(SQLITE_TEMPNAME_SIZE-30, zTempPath);
@@ -1116,6 +1116,10 @@ int sqliteOsSeek(OsFile *id, off_t offset){
#endif
}
+#ifdef SQLITE_NOSYNC
+# define fsync(X) 0
+#endif
+
/*
** Make sure all writes to a particular file are committed to disk.
**
diff --git a/ext/sqlite/libsqlite/src/pager.c b/ext/sqlite/libsqlite/src/pager.c
index b098a06e4..e8ba27fa6 100644
--- a/ext/sqlite/libsqlite/src/pager.c
+++ b/ext/sqlite/libsqlite/src/pager.c
@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.6 2004/07/10 12:27:51 wez Exp $
+** @(#) $Id: pager.c,v 1.6.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "os.h" /* Must be first to enable large file support */
#include "sqliteInt.h"
diff --git a/ext/sqlite/libsqlite/src/pager.h b/ext/sqlite/libsqlite/src/pager.h
index 1eab8211b..3e68b7f83 100644
--- a/ext/sqlite/libsqlite/src/pager.h
+++ b/ext/sqlite/libsqlite/src/pager.h
@@ -13,7 +13,7 @@
** subsystem. The page cache subsystem reads and writes a file a page
** at a time and provides a journal for rollback.
**
-** @(#) $Id: pager.h,v 1.5 2004/07/10 12:27:51 wez Exp $
+** @(#) $Id: pager.h,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
/*
diff --git a/ext/sqlite/libsqlite/src/parse.c b/ext/sqlite/libsqlite/src/parse.c
index 64e3eb3df..1c5264ca6 100644
--- a/ext/sqlite/libsqlite/src/parse.c
+++ b/ext/sqlite/libsqlite/src/parse.c
@@ -1,5 +1,5 @@
/* Driver template for the LEMON parser generator.
-** The author disclaims copyright to this source code.
+** The author disclaims copyright to this source code.
*/
/* First off, code is include which follows the "include" declaration
** in the input file. */
diff --git a/ext/sqlite/libsqlite/src/parse.y b/ext/sqlite/libsqlite/src/parse.y
index fc95149ca..da2ac2d3c 100644
--- a/ext/sqlite/libsqlite/src/parse.y
+++ b/ext/sqlite/libsqlite/src/parse.y
@@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
-** @(#) $Id: parse.y,v 1.5 2004/07/10 12:27:51 wez Exp $
+** @(#) $Id: parse.y,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
%token_prefix TK_
%token_type {Token}
diff --git a/ext/sqlite/libsqlite/src/pragma.c b/ext/sqlite/libsqlite/src/pragma.c
index d7c169ca1..9d958246b 100644
--- a/ext/sqlite/libsqlite/src/pragma.c
+++ b/ext/sqlite/libsqlite/src/pragma.c
@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the PRAGMA command.
**
-** $Id: pragma.c,v 1.4 2004/07/10 12:27:51 wez Exp $
+** $Id: pragma.c,v 1.4.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
diff --git a/ext/sqlite/libsqlite/src/printf.c b/ext/sqlite/libsqlite/src/printf.c
index 620578d76..f867d62af 100644
--- a/ext/sqlite/libsqlite/src/printf.c
+++ b/ext/sqlite/libsqlite/src/printf.c
@@ -227,6 +227,7 @@ static int vxprintf(
int nsd; /* Number of significant digits returned */
#endif
+ func(arg,"",0);
count = length = 0;
bufpt = 0;
for(; (c=(*fmt))!=0; ++fmt){
@@ -673,9 +674,11 @@ static void mout(void *arg, const char *zNewText, int nNewChar){
}
}
}
- if( pM->zText && nNewChar>0 ){
- memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
- pM->nChar += nNewChar;
+ if( pM->zText ){
+ if( nNewChar>0 ){
+ memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
+ pM->nChar += nNewChar;
+ }
pM->zText[pM->nChar] = 0;
}
}
diff --git a/ext/sqlite/libsqlite/src/random.c b/ext/sqlite/libsqlite/src/random.c
index 1ab33b730..602c88813 100644
--- a/ext/sqlite/libsqlite/src/random.c
+++ b/ext/sqlite/libsqlite/src/random.c
@@ -15,7 +15,7 @@
** Random numbers are used by some of the database backends in order
** to generate random integer keys for tables or random filenames.
**
-** $Id: random.c,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: random.c,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "sqliteInt.h"
#include "os.h"
diff --git a/ext/sqlite/libsqlite/src/select.c b/ext/sqlite/libsqlite/src/select.c
index 561bd7b5e..1c48da9cd 100644
--- a/ext/sqlite/libsqlite/src/select.c
+++ b/ext/sqlite/libsqlite/src/select.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
-** $Id: select.c,v 1.6 2004/07/10 12:27:51 wez Exp $
+** $Id: select.c,v 1.6.4.1 2005/09/07 15:11:32 iliaa Exp $
*/
#include "sqliteInt.h"
@@ -365,6 +365,30 @@ void sqliteAddKeyType(Vdbe *v, ExprList *pEList){
}
/*
+** Add code to implement the OFFSET and LIMIT
+*/
+static void codeLimiter(
+ Vdbe *v, /* Generate code into this VM */
+ Select *p, /* The SELECT statement being coded */
+ int iContinue, /* Jump here to skip the current record */
+ int iBreak, /* Jump here to end the loop */
+ int nPop /* Number of times to pop stack when jumping */
+){
+ if( p->iOffset>=0 ){
+ int addr = sqliteVdbeCurrentAddr(v) + 2;
+ if( nPop>0 ) addr++;
+ sqliteVdbeAddOp(v, OP_MemIncr, p->iOffset, addr);
+ if( nPop>0 ){
+ sqliteVdbeAddOp(v, OP_Pop, nPop, 0);
+ }
+ sqliteVdbeAddOp(v, OP_Goto, 0, iContinue);
+ }
+ if( p->iLimit>=0 ){
+ sqliteVdbeAddOp(v, OP_MemIncr, p->iLimit, iBreak);
+ }
+}
+
+/*
** This routine generates the code for the inside of the inner loop
** of a SELECT.
**
@@ -388,6 +412,7 @@ static int selectInnerLoop(
){
Vdbe *v = pParse->pVdbe;
int i;
+ int hasDistinct; /* True if the DISTINCT keyword is present */
if( v==0 ) return 0;
assert( pEList!=0 );
@@ -395,15 +420,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.
*/
- if( pOrderBy==0 ){
- if( p->iOffset>=0 ){
- int addr = sqliteVdbeCurrentAddr(v);
- sqliteVdbeAddOp(v, OP_MemIncr, p->iOffset, addr+2);
- sqliteVdbeAddOp(v, OP_Goto, 0, iContinue);
- }
- if( p->iLimit>=0 ){
- sqliteVdbeAddOp(v, OP_MemIncr, p->iLimit, iBreak);
- }
+ hasDistinct = distinct>=0 && pEList && pEList->nExpr>0;
+ if( pOrderBy==0 && !hasDistinct ){
+ codeLimiter(v, p, iContinue, iBreak, 0);
}
/* Pull the requested columns.
@@ -423,7 +442,7 @@ static int selectInnerLoop(
** and this row has been seen before, then do not make this row
** part of the result.
*/
- if( distinct>=0 && pEList && pEList->nExpr>0 ){
+ if( hasDistinct ){
#if NULL_ALWAYS_DISTINCT
sqliteVdbeAddOp(v, OP_IsNull, -pEList->nExpr, sqliteVdbeCurrentAddr(v)+7);
#endif
@@ -434,6 +453,9 @@ static int selectInnerLoop(
sqliteVdbeAddOp(v, OP_Goto, 0, iContinue);
sqliteVdbeAddOp(v, OP_String, 0, 0);
sqliteVdbeAddOp(v, OP_PutStrKey, distinct, 0);
+ if( pOrderBy==0 ){
+ codeLimiter(v, p, iContinue, iBreak, nColumn);
+ }
}
switch( eDest ){
@@ -570,14 +592,7 @@ static void generateSortTail(
if( eDest==SRT_Sorter ) return;
sqliteVdbeAddOp(v, OP_Sort, 0, 0);
addr = sqliteVdbeAddOp(v, OP_SortNext, 0, end1);
- if( p->iOffset>=0 ){
- sqliteVdbeAddOp(v, OP_MemIncr, p->iOffset, addr+4);
- sqliteVdbeAddOp(v, OP_Pop, 1, 0);
- sqliteVdbeAddOp(v, OP_Goto, 0, addr);
- }
- if( p->iLimit>=0 ){
- sqliteVdbeAddOp(v, OP_MemIncr, p->iLimit, end2);
- }
+ codeLimiter(v, p, addr, end2, 1);
switch( eDest ){
case SRT_Callback: {
sqliteVdbeAddOp(v, OP_SortCallback, nColumn, 0);
@@ -810,8 +825,9 @@ Table *sqliteResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
}else{
char zBuf[30];
sprintf(zBuf, "column%d", i+1);
- pTab->aCol[i].zName = sqliteStrDup(zBuf);
+ aCol[i].zName = sqliteStrDup(zBuf);
}
+ sqliteDequote(aCol[i].zName);
}
pTab->iPKey = -1;
return pTab;
@@ -943,11 +959,11 @@ static int fillInColumnList(Parse *pParse, Select *p){
/* This expression is a "*" or a "TABLE.*" and needs to be
** expanded. */
int tableSeen = 0; /* Set to 1 when TABLE matches */
- Token *pName; /* text of name of TABLE */
+ char *zTName; /* text of name of TABLE */
if( pE->op==TK_DOT && pE->pLeft ){
- pName = &pE->pLeft->token;
+ zTName = sqliteTableNameFromToken(&pE->pLeft->token);
}else{
- pName = 0;
+ zTName = 0;
}
for(i=0; i<pTabList->nSrc; i++){
Table *pTab = pTabList->a[i].pTab;
@@ -955,9 +971,8 @@ static int fillInColumnList(Parse *pParse, Select *p){
if( zTabName==0 || zTabName[0]==0 ){
zTabName = pTab->zName;
}
- if( pName && (zTabName==0 || zTabName[0]==0 ||
- sqliteStrNICmp(pName->z, zTabName, pName->n)!=0 ||
- zTabName[pName->n]!=0) ){
+ if( zTName && (zTabName==0 || zTabName[0]==0 ||
+ sqliteStrICmp(zTName, zTabName)!=0) ){
continue;
}
tableSeen = 1;
@@ -1002,13 +1017,14 @@ static int fillInColumnList(Parse *pParse, Select *p){
}
}
if( !tableSeen ){
- if( pName ){
- sqliteErrorMsg(pParse, "no such table: %T", pName);
+ if( zTName ){
+ sqliteErrorMsg(pParse, "no such table: %s", zTName);
}else{
sqliteErrorMsg(pParse, "no tables specified");
}
rc = 1;
}
+ sqliteFree(zTName);
}
}
sqliteExprListDelete(pEList);
@@ -1916,6 +1932,12 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
}else{
sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
sqliteVdbeOp3(v, OP_OpenRead, base+1, pIdx->tnum, pIdx->zName, P3_STATIC);
+ if( seekOp==OP_Rewind ){
+ sqliteVdbeAddOp(v, OP_String, 0, 0);
+ sqliteVdbeAddOp(v, OP_MakeKey, 1, 0);
+ sqliteVdbeAddOp(v, OP_IncrKey, 0, 0);
+ seekOp = OP_MoveTo;
+ }
sqliteVdbeAddOp(v, seekOp, base+1, 0);
sqliteVdbeAddOp(v, OP_IdxRecno, base+1, 0);
sqliteVdbeAddOp(v, OP_Close, base+1, 0);
diff --git a/ext/sqlite/libsqlite/src/sqlite.h.in b/ext/sqlite/libsqlite/src/sqlite.h.in
index a620e987e..e92e41897 100644
--- a/ext/sqlite/libsqlite/src/sqlite.h.in
+++ b/ext/sqlite/libsqlite/src/sqlite.h.in
@@ -12,7 +12,7 @@
** This header file defines the interface that the SQLite library
** presents to client programs.
**
-** @(#) $Id: sqlite.h.in,v 1.6 2004/07/10 12:27:51 wez Exp $
+** @(#) $Id: sqlite.h.in,v 1.6.4.1 2005/09/07 15:11:33 iliaa Exp $
*/
#ifndef _SQLITE_H_
#define _SQLITE_H_
@@ -28,7 +28,11 @@ extern "C" {
/*
** The version of the SQLite library.
*/
-#define SQLITE_VERSION "--VERS--"
+#ifdef SQLITE_VERSION
+# undef SQLITE_VERSION
+#else
+# define SQLITE_VERSION "--VERS--"
+#endif
/*
** The version string is also compiled into the library so that a program
@@ -479,10 +483,24 @@ int sqlite_function_type(
int datatype /* The datatype for this function */
);
#define SQLITE_NUMERIC (-1)
-#define SQLITE_TEXT (-2)
+/* #define SQLITE_TEXT (-2) // See below */
#define SQLITE_ARGS (-3)
/*
+** SQLite version 3 defines SQLITE_TEXT differently. To allow both
+** version 2 and version 3 to be included, undefine them both if a
+** conflict is seen. Define SQLITE2_TEXT to be the version 2 value.
+*/
+#ifdef SQLITE_TEXT
+# undef SQLITE_TEXT
+#else
+# define SQLITE_TEXT (-2)
+#endif
+#define SQLITE2_TEXT (-2)
+
+
+
+/*
** The user function implementations call one of the following four routines
** in order to return their results. The first parameter to each of these
** routines is a copy of the first argument to xFunc() or xFinialize().
diff --git a/ext/sqlite/libsqlite/src/sqlite.w32.h b/ext/sqlite/libsqlite/src/sqlite.w32.h
index aa4288d44..b234551f6 100644
--- a/ext/sqlite/libsqlite/src/sqlite.w32.h
+++ b/ext/sqlite/libsqlite/src/sqlite.w32.h
@@ -12,7 +12,7 @@
** This header file defines the interface that the SQLite library
** presents to client programs.
**
-** @(#) $Id: sqlite.w32.h,v 1.5.2.1 2005/05/09 16:01:12 zeev Exp $
+** @(#) $Id: sqlite.w32.h,v 1.6.2.1 2005/09/07 15:11:33 iliaa Exp $
*/
#ifndef _SQLITE_H_
#define _SQLITE_H_
@@ -28,7 +28,7 @@ extern "C" {
/*
** The version of the SQLite library.
*/
-#define SQLITE_VERSION "2.8.11"
+#define SQLITE_VERSION "2.8.16"
/*
** The version string is also compiled into the library so that a program
diff --git a/ext/sqlite/libsqlite/src/sqliteInt.h b/ext/sqlite/libsqlite/src/sqliteInt.h
index b9c5fd445..f745971d3 100644
--- a/ext/sqlite/libsqlite/src/sqliteInt.h
+++ b/ext/sqlite/libsqlite/src/sqliteInt.h
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.6 2004/07/10 12:27:51 wez Exp $
+** @(#) $Id: sqliteInt.h,v 1.6.4.1 2005/09/07 15:11:33 iliaa Exp $
*/
#include "config.h"
#include "sqlite.h"
@@ -102,6 +102,9 @@
#ifndef UINT16_TYPE
# define UINT16_TYPE unsigned short int
#endif
+#ifndef INT16_TYPE
+# define INT16_TYPE short int
+#endif
#ifndef UINT8_TYPE
# define UINT8_TYPE unsigned char
#endif
@@ -117,6 +120,7 @@
#endif
typedef UINT32_TYPE u32; /* 4-byte unsigned integer */
typedef UINT16_TYPE u16; /* 2-byte unsigned integer */
+typedef INT16_TYPE i16; /* 2-byte signed integer */
typedef UINT8_TYPE u8; /* 1-byte unsigned integer */
typedef UINT8_TYPE i8; /* 1-byte signed integer */
typedef INTPTR_TYPE ptr; /* Big enough to hold a pointer */
@@ -762,8 +766,8 @@ struct IdList {
** now be identified by a database name, a dot, then the table name: ID.ID.
*/
struct SrcList {
- u16 nSrc; /* Number of tables or subqueries in the FROM clause */
- u16 nAlloc; /* Number of entries allocated in a[] below */
+ i16 nSrc; /* Number of tables or subqueries in the FROM clause */
+ i16 nAlloc; /* Number of entries allocated in a[] below */
struct SrcList_item {
char *zDatabase; /* Name of database holding this table */
char *zName; /* Name of the table */
diff --git a/ext/sqlite/libsqlite/src/tokenize.c b/ext/sqlite/libsqlite/src/tokenize.c
index ed2ba473d..67b55e26d 100644
--- a/ext/sqlite/libsqlite/src/tokenize.c
+++ b/ext/sqlite/libsqlite/src/tokenize.c
@@ -15,7 +15,7 @@
** individual tokens and sends those tokens one-by-one over to the
** parser for analysis.
**
-** $Id: tokenize.c,v 1.6 2004/07/10 12:27:51 wez Exp $
+** $Id: tokenize.c,v 1.6.4.1 2005/09/07 15:11:33 iliaa Exp $
*/
#include "sqliteInt.h"
#include "os.h"
diff --git a/ext/sqlite/libsqlite/src/update.c b/ext/sqlite/libsqlite/src/update.c
index a1de45476..5afe0699f 100644
--- a/ext/sqlite/libsqlite/src/update.c
+++ b/ext/sqlite/libsqlite/src/update.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle UPDATE statements.
**
-** $Id: update.c,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: update.c,v 1.5.4.1 2005/09/07 15:11:33 iliaa Exp $
*/
#include "sqliteInt.h"
diff --git a/ext/sqlite/libsqlite/src/util.c b/ext/sqlite/libsqlite/src/util.c
index 2fcb4f019..be4e10828 100644
--- a/ext/sqlite/libsqlite/src/util.c
+++ b/ext/sqlite/libsqlite/src/util.c
@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
-** $Id: util.c,v 1.6 2004/07/10 12:27:51 wez Exp $
+** $Id: util.c,v 1.6.4.1 2005/09/07 15:11:33 iliaa Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -504,14 +504,14 @@ int sqliteStrICmp(const char *zLeft, const char *zRight){
a = (unsigned char *)zLeft;
b = (unsigned char *)zRight;
while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }
- return *a - *b;
+ return UpperToLower[*a] - UpperToLower[*b];
}
int sqliteStrNICmp(const char *zLeft, const char *zRight, int N){
register unsigned char *a, *b;
a = (unsigned char *)zLeft;
b = (unsigned char *)zRight;
while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }
- return N<0 ? 0 : *a - *b;
+ return N<0 ? 0 : UpperToLower[*a] - UpperToLower[*b];
}
/*
diff --git a/ext/sqlite/libsqlite/src/vacuum.c b/ext/sqlite/libsqlite/src/vacuum.c
index bc1b803c4..efa8cb141 100644
--- a/ext/sqlite/libsqlite/src/vacuum.c
+++ b/ext/sqlite/libsqlite/src/vacuum.c
@@ -14,7 +14,7 @@
** Most of the code in this file may be omitted by defining the
** SQLITE_OMIT_VACUUM macro.
**
-** $Id: vacuum.c,v 1.4 2004/07/10 12:27:51 wez Exp $
+** $Id: vacuum.c,v 1.4.4.1 2005/09/07 15:11:33 iliaa Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -164,24 +164,6 @@ static int vacuumCallback1(void *pArg, int argc, char **argv, char **NotUsed){
}
/*
-** This callback is used to transfer PRAGMA settings from one database
-** to the other. The value in argv[0] should be passed to a pragma
-** identified by ((vacuumStruct*)pArg)->zPragma.
-*/
-static int vacuumCallback3(void *pArg, int argc, char **argv, char **NotUsed){
- vacuumStruct *p = (vacuumStruct*)pArg;
- char zBuf[200];
- assert( argc==1 );
- if( argv==0 ) return 0;
- assert( argv[0]!=0 );
- assert( strlen(p->zPragma)<100 );
- assert( strlen(argv[0])<30 );
- sprintf(zBuf,"PRAGMA %s=%s;", p->zPragma, argv[0]);
- p->rc = execsql(p->pzErrMsg, p->dbNew, zBuf);
- return p->rc;
-}
-
-/*
** Generate a random name of 20 character in length.
*/
static void randomName(unsigned char *zBuf){
@@ -226,14 +208,6 @@ int sqliteRunVacuum(char **pzErrMsg, sqlite *db){
char *zErrMsg; /* Error message */
vacuumStruct sVac; /* Information passed to callbacks */
- /* These are all of the pragmas that need to be transferred over
- ** to the new database */
- static const char *zPragma[] = {
- "default_synchronous",
- "default_cache_size",
- /* "default_temp_store", */
- };
-
if( db->flags & SQLITE_InTrans ){
sqliteSetString(pzErrMsg, "cannot VACUUM from within a transaction",
(char*)0);
@@ -283,13 +257,6 @@ int sqliteRunVacuum(char **pzErrMsg, sqlite *db){
sVac.dbOld = db;
sVac.dbNew = dbNew;
sVac.pzErrMsg = pzErrMsg;
- for(i=0; rc==SQLITE_OK && i<sizeof(zPragma)/sizeof(zPragma[0]); i++){
- char zBuf[200];
- assert( strlen(zPragma[i])<100 );
- sprintf(zBuf, "PRAGMA %s;", zPragma[i]);
- sVac.zPragma = zPragma[i];
- rc = sqlite_exec(db, zBuf, vacuumCallback3, &sVac, &zErrMsg);
- }
if( rc==SQLITE_OK ){
rc = sqlite_exec(db,
"SELECT type, name, sql FROM sqlite_master "
@@ -300,6 +267,17 @@ int sqliteRunVacuum(char **pzErrMsg, sqlite *db){
vacuumCallback1, &sVac, &zErrMsg);
}
if( rc==SQLITE_OK ){
+ int meta1[SQLITE_N_BTREE_META];
+ int meta2[SQLITE_N_BTREE_META];
+ sqliteBtreeGetMeta(db->aDb[0].pBt, meta1);
+ sqliteBtreeGetMeta(dbNew->aDb[0].pBt, meta2);
+ meta2[1] = meta1[1]+1;
+ meta2[3] = meta1[3];
+ meta2[4] = meta1[4];
+ meta2[6] = meta1[6];
+ rc = sqliteBtreeUpdateMeta(dbNew->aDb[0].pBt, meta2);
+ }
+ if( rc==SQLITE_OK ){
rc = sqliteBtreeCopyFile(db->aDb[0].pBt, dbNew->aDb[0].pBt);
sqlite_exec(db, "COMMIT", 0, 0, 0);
sqliteResetInternalSchema(db, 0);
diff --git a/ext/sqlite/libsqlite/src/vdbe.c b/ext/sqlite/libsqlite/src/vdbe.c
index a63b8c01e..66aaccfc9 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 2004/07/10 12:27:51 wez Exp $
+** $Id: vdbe.c,v 1.7.4.1 2005/09/07 15:11:33 iliaa Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -4545,6 +4545,10 @@ case OP_AggGet: {
pTos->flags &= ~(MEM_Dyn|MEM_Static|MEM_Short);
pTos->flags |= MEM_Ephem;
}
+ if( pTos->flags & MEM_AggCtx ){
+ Release(pTos);
+ pTos->flags = MEM_Null;
+ }
break;
}
@@ -4695,8 +4699,9 @@ case OP_SetNext: {
break;
}
}else{
- assert( pSet->prev );
- pSet->prev = sqliteHashNext(pSet->prev);
+ if( pSet->prev ){
+ pSet->prev = sqliteHashNext(pSet->prev);
+ }
if( pSet->prev==0 ){
break;
}else{
diff --git a/ext/sqlite/libsqlite/src/vdbe.h b/ext/sqlite/libsqlite/src/vdbe.h
index a58dddb75..71d90786f 100644
--- a/ext/sqlite/libsqlite/src/vdbe.h
+++ b/ext/sqlite/libsqlite/src/vdbe.h
@@ -15,7 +15,7 @@
** or VDBE. The VDBE implements an abstract machine that runs a
** simple program to access and modify the underlying database.
**
-** $Id: vdbe.h,v 1.5 2004/07/10 12:27:51 wez Exp $
+** $Id: vdbe.h,v 1.5.4.1 2005/09/07 15:11:33 iliaa Exp $
*/
#ifndef _SQLITE_VDBE_H_
#define _SQLITE_VDBE_H_
diff --git a/ext/sqlite/libsqlite/src/where.c b/ext/sqlite/libsqlite/src/where.c
index 1a2377ac4..89d689ac8 100644
--- a/ext/sqlite/libsqlite/src/where.c
+++ b/ext/sqlite/libsqlite/src/where.c
@@ -12,7 +12,7 @@
** This module contains C code that generates VDBE code used to process
** the WHERE clause of SQL statements.
**
-** $Id: where.c,v 1.6 2004/07/10 12:27:51 wez Exp $
+** $Id: where.c,v 1.6.4.1 2005/09/07 15:11:33 iliaa Exp $
*/
#include "sqliteInt.h"
@@ -46,7 +46,7 @@ struct ExprInfo {
typedef struct ExprMaskSet ExprMaskSet;
struct ExprMaskSet {
int n; /* Number of assigned cursor values */
- int ix[32]; /* Cursor assigned to each bit */
+ int ix[31]; /* Cursor assigned to each bit */
};
/*
@@ -123,7 +123,9 @@ static int exprTableUsage(ExprMaskSet *pMaskSet, Expr *p){
unsigned int mask = 0;
if( p==0 ) return 0;
if( p->op==TK_COLUMN ){
- return getMask(pMaskSet, p->iTable);
+ mask = getMask(pMaskSet, p->iTable);
+ if( mask==0 ) mask = -1;
+ return mask;
}
if( p->pRight ){
mask = exprTableUsage(pMaskSet, p->pRight);
@@ -270,6 +272,35 @@ static Index *findSortingIndex(
}
/*
+** Disable a term in the WHERE clause. Except, do not disable the term
+** if it controls a LEFT OUTER JOIN and it did not originate in the ON
+** or USING clause of that join.
+**
+** Consider the term t2.z='ok' in the following queries:
+**
+** (1) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok'
+** (2) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok'
+** (3) SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok'
+**
+** The t2.z='ok' is disabled in the in (2) because it did not originate
+** in the ON clause. The term is disabled in (3) because it is not part
+** of a LEFT OUTER JOIN. In (1), the term is not disabled.
+**
+** Disabling a term causes that term to not be tested in the inner loop
+** of the join. Disabling is an optimization. We would get the correct
+** results if nothing were ever disabled, but joins might run a little
+** slower. The trick is to disable as much as we can without disabling
+** too much. If we disabled in (1), we'd get the wrong answer.
+** See ticket #813.
+*/
+static void disableTerm(WhereLevel *pLevel, Expr **ppExpr){
+ Expr *pExpr = *ppExpr;
+ if( pLevel->iLeftJoin==0 || ExprHasProperty(pExpr, EP_FromJoin) ){
+ *ppExpr = 0;
+ }
+}
+
+/*
** Generate the beginning of the loop used for WHERE clause processing.
** The return value is a pointer to an (opaque) structure that contains
** information needed to terminate the loop. Later, the calling routine
@@ -736,7 +767,7 @@ WhereInfo *sqliteWhereBegin(
}else{
sqliteExprCode(pParse, aExpr[k].p->pLeft);
}
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
cont = pLevel->cont = sqliteVdbeMakeLabel(v);
sqliteVdbeAddOp(v, OP_MustBeInt, 1, brk);
haveKey = 0;
@@ -760,7 +791,7 @@ WhereInfo *sqliteWhereBegin(
){
if( pX->op==TK_EQ ){
sqliteExprCode(pParse, pX->pRight);
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
break;
}
if( pX->op==TK_IN && nColumn==1 ){
@@ -777,7 +808,7 @@ WhereInfo *sqliteWhereBegin(
pLevel->inOp = OP_Next;
pLevel->inP1 = pX->iTable;
}
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
break;
}
}
@@ -787,7 +818,7 @@ WhereInfo *sqliteWhereBegin(
&& aExpr[k].p->pRight->iColumn==pIdx->aiColumn[j]
){
sqliteExprCode(pParse, aExpr[k].p->pLeft);
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
break;
}
}
@@ -854,7 +885,7 @@ WhereInfo *sqliteWhereBegin(
sqliteVdbeAddOp(v, OP_ForceInt,
aExpr[k].p->op==TK_LT || aExpr[k].p->op==TK_GT, brk);
sqliteVdbeAddOp(v, OP_MoveTo, iCur, brk);
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
}else{
sqliteVdbeAddOp(v, OP_Rewind, iCur, brk);
}
@@ -876,7 +907,7 @@ WhereInfo *sqliteWhereBegin(
}else{
testOp = OP_Gt;
}
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
}
start = sqliteVdbeCurrentAddr(v);
pLevel->op = OP_Next;
@@ -931,7 +962,7 @@ WhereInfo *sqliteWhereBegin(
&& aExpr[k].p->pLeft->iColumn==pIdx->aiColumn[j]
){
sqliteExprCode(pParse, aExpr[k].p->pRight);
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
break;
}
if( aExpr[k].idxRight==iCur
@@ -940,7 +971,7 @@ WhereInfo *sqliteWhereBegin(
&& aExpr[k].p->pRight->iColumn==pIdx->aiColumn[j]
){
sqliteExprCode(pParse, aExpr[k].p->pLeft);
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
break;
}
}
@@ -977,7 +1008,7 @@ WhereInfo *sqliteWhereBegin(
){
sqliteExprCode(pParse, pExpr->pRight);
leFlag = pExpr->op==TK_LE;
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
break;
}
if( aExpr[k].idxRight==iCur
@@ -987,7 +1018,7 @@ WhereInfo *sqliteWhereBegin(
){
sqliteExprCode(pParse, pExpr->pLeft);
leFlag = pExpr->op==TK_GE;
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
break;
}
}
@@ -1036,7 +1067,7 @@ WhereInfo *sqliteWhereBegin(
){
sqliteExprCode(pParse, pExpr->pRight);
geFlag = pExpr->op==TK_GE;
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
break;
}
if( aExpr[k].idxRight==iCur
@@ -1046,7 +1077,7 @@ WhereInfo *sqliteWhereBegin(
){
sqliteExprCode(pParse, pExpr->pLeft);
geFlag = pExpr->op==TK_LE;
- aExpr[k].p = 0;
+ disableTerm(pLevel, &aExpr[k].p);
break;
}
}
diff --git a/ext/sqlite/pdo_sqlite2.c b/ext/sqlite/pdo_sqlite2.c
new file mode 100644
index 000000000..027fb4407
--- /dev/null
+++ b/ext/sqlite/pdo_sqlite2.c
@@ -0,0 +1,629 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pdo_sqlite2.c,v 1.6 2005/06/17 13:12:31 sniper Exp $ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "php.h"
+
+#ifdef PHP_SQLITE2_HAVE_PDO
+#include "sqlite.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "zend_exceptions.h"
+
+#define php_sqlite_encode_binary(in, n, out) sqlite_encode_binary((const unsigned char *)in, n, (unsigned char *)out)
+#define php_sqlite_decode_binary(in, out) sqlite_decode_binary((const unsigned char *)in, (unsigned char *)out)
+
+
+typedef struct {
+ const char *file;
+ int line;
+ unsigned int errcode;
+ char *errmsg;
+} pdo_sqlite2_error_info;
+
+typedef struct {
+ sqlite *db;
+ pdo_sqlite2_error_info einfo;
+} pdo_sqlite2_db_handle;
+
+typedef struct {
+ pdo_sqlite2_db_handle *H;
+ sqlite_vm *vm;
+ const char **rowdata, **colnames;
+ int ncols;
+ unsigned pre_fetched:1;
+ unsigned done:1;
+ pdo_sqlite2_error_info einfo;
+} pdo_sqlite2_stmt;
+
+extern int _pdo_sqlite2_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *errmsg, const char *file, int line TSRMLS_DC);
+#define pdo_sqlite2_error(msg, s) _pdo_sqlite2_error(s, NULL, msg, __FILE__, __LINE__ TSRMLS_CC)
+#define pdo_sqlite2_error_stmt(msg, s) _pdo_sqlite2_error(stmt->dbh, stmt, msg, __FILE__, __LINE__ TSRMLS_CC)
+
+extern struct pdo_stmt_methods sqlite2_stmt_methods;
+
+static int pdo_sqlite2_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_sqlite2_stmt *S = (pdo_sqlite2_stmt*)stmt->driver_data;
+
+ if (S->vm) {
+ char *errmsg = NULL;
+ sqlite_finalize(S->vm, &errmsg);
+ if (errmsg) {
+ sqlite_freemem(errmsg);
+ }
+ S->vm = NULL;
+ }
+ if (S->einfo.errmsg) {
+ pefree(S->einfo.errmsg, stmt->dbh->is_persistent);
+ }
+ efree(S);
+ return 1;
+}
+
+static int pdo_sqlite2_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+{
+ pdo_sqlite2_stmt *S = (pdo_sqlite2_stmt*)stmt->driver_data;
+ char *errmsg = NULL;
+ const char *tail;
+
+ if (stmt->executed && !S->done) {
+ sqlite_finalize(S->vm, &errmsg);
+ pdo_sqlite2_error_stmt(errmsg, stmt);
+ errmsg = NULL;
+ S->vm = NULL;
+ }
+
+ S->einfo.errcode = sqlite_compile(S->H->db, stmt->active_query_string, &tail, &S->vm, &errmsg);
+ if (S->einfo.errcode != SQLITE_OK) {
+ pdo_sqlite2_error_stmt(errmsg, stmt);
+ return 0;
+ }
+
+ S->done = 0;
+ S->einfo.errcode = sqlite_step(S->vm, &S->ncols, &S->rowdata, &S->colnames);
+ switch (S->einfo.errcode) {
+ case SQLITE_ROW:
+ S->pre_fetched = 1;
+ stmt->column_count = S->ncols;
+ return 1;
+
+ case SQLITE_DONE:
+ stmt->column_count = S->ncols;
+ stmt->row_count = sqlite_changes(S->H->db);
+ S->einfo.errcode = sqlite_reset(S->vm, &errmsg);
+ if (S->einfo.errcode != SQLITE_OK) {
+ pdo_sqlite2_error_stmt(errmsg, stmt);
+ }
+ S->done = 1;
+ return 1;
+
+ case SQLITE_ERROR:
+ case SQLITE_MISUSE:
+ case SQLITE_BUSY:
+ default:
+ pdo_sqlite2_error_stmt(errmsg, stmt);
+ return 0;
+ }
+}
+
+static int pdo_sqlite2_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
+ enum pdo_param_event event_type TSRMLS_DC)
+{
+ return 1;
+}
+
+static int pdo_sqlite2_stmt_fetch(pdo_stmt_t *stmt,
+ enum pdo_fetch_orientation ori, long offset TSRMLS_DC)
+{
+ pdo_sqlite2_stmt *S = (pdo_sqlite2_stmt*)stmt->driver_data;
+ char *errmsg = NULL;
+
+ if (!S->vm) {
+ return 0;
+ }
+ if (S->pre_fetched) {
+ S->pre_fetched = 0;
+ return 1;
+ }
+ if (S->done) {
+ return 0;
+ }
+
+ S->einfo.errcode = sqlite_step(S->vm, &S->ncols, &S->rowdata, &S->colnames);
+ switch (S->einfo.errcode) {
+ case SQLITE_ROW:
+ return 1;
+
+ case SQLITE_DONE:
+ S->done = 1;
+ S->einfo.errcode = sqlite_reset(S->vm, &errmsg);
+ if (S->einfo.errcode != SQLITE_OK) {
+ pdo_sqlite2_error_stmt(errmsg, stmt);
+ errmsg = NULL;
+ }
+ return 0;
+
+ default:
+ pdo_sqlite2_error_stmt(errmsg, stmt);
+ return 0;
+ }
+}
+
+static int pdo_sqlite2_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+{
+ pdo_sqlite2_stmt *S = (pdo_sqlite2_stmt*)stmt->driver_data;
+
+ if(colno >= S->ncols) {
+ /* error invalid column */
+ pdo_sqlite2_error_stmt(NULL, stmt);
+ return 0;
+ }
+
+ stmt->columns[colno].name = estrdup(S->colnames[colno]);
+ stmt->columns[colno].namelen = strlen(stmt->columns[colno].name);
+ stmt->columns[colno].maxlen = 0xffffffff;
+ stmt->columns[colno].precision = 0;
+ stmt->columns[colno].param_type = PDO_PARAM_STR;
+
+ return 1;
+}
+
+static int pdo_sqlite2_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC)
+{
+ pdo_sqlite2_stmt *S = (pdo_sqlite2_stmt*)stmt->driver_data;
+ if (!S->vm) {
+ return 0;
+ }
+ if(colno >= S->ncols) {
+ /* error invalid column */
+ pdo_sqlite2_error_stmt(NULL, stmt);
+ return 0;
+ }
+ if (S->rowdata[colno]) {
+ if (S->rowdata[colno][0] == '\x01') {
+ /* encoded */
+ *caller_frees = 1;
+ *ptr = emalloc(strlen(S->rowdata[colno]));
+ *len = php_sqlite_decode_binary(S->rowdata[colno]+1, *ptr);
+ (*(char**)ptr)[*len] = '\0';
+ } else {
+ *ptr = (char*)S->rowdata[colno];
+ *len = strlen(*ptr);
+ }
+ } else {
+ *ptr = NULL;
+ *len = 0;
+ }
+ return 1;
+}
+
+struct pdo_stmt_methods sqlite2_stmt_methods = {
+ pdo_sqlite2_stmt_dtor,
+ pdo_sqlite2_stmt_execute,
+ pdo_sqlite2_stmt_fetch,
+ pdo_sqlite2_stmt_describe,
+ pdo_sqlite2_stmt_get_col,
+ pdo_sqlite2_stmt_param_hook,
+ NULL, /* set_attr */
+ NULL, /* get_attr */
+ NULL
+};
+
+
+int _pdo_sqlite2_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *errmsg, const char *file, int line TSRMLS_DC) /* {{{ */
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+ pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code;
+ pdo_sqlite2_error_info *einfo = &H->einfo;
+ pdo_sqlite2_stmt *S;
+
+ if (stmt) {
+ S = stmt->driver_data;
+ einfo = &S->einfo;
+ }
+
+ einfo->file = file;
+ einfo->line = line;
+
+ if (einfo->errmsg) {
+ pefree(einfo->errmsg, dbh->is_persistent);
+ einfo->errmsg = NULL;
+ }
+
+ if (einfo->errcode != SQLITE_OK) {
+ if (errmsg) {
+ einfo->errmsg = pestrdup(errmsg, dbh->is_persistent);
+ sqlite_freemem(errmsg);
+ } else {
+ einfo->errmsg = pestrdup(sqlite_error_string(einfo->errcode), dbh->is_persistent);
+ }
+ } else { /* no error */
+ strcpy(*pdo_err, PDO_ERR_NONE);
+ return 0;
+ }
+ switch (einfo->errcode) {
+ case SQLITE_NOTFOUND:
+ strcpy(*pdo_err, "42S02");
+ break;
+
+ case SQLITE_INTERRUPT:
+ strcpy(*pdo_err, "01002");
+ break;
+
+ case SQLITE_NOLFS:
+ strcpy(*pdo_err, "HYC00");
+ break;
+
+ case SQLITE_TOOBIG:
+ strcpy(*pdo_err, "22001");
+ break;
+
+ case SQLITE_CONSTRAINT:
+ strcpy(*pdo_err, "23000");
+ break;
+
+ case SQLITE_ERROR:
+ default:
+ strcpy(*pdo_err, "HY000");
+ break;
+ }
+
+ if (!dbh->methods) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ *pdo_err, einfo->errcode, einfo->errmsg);
+ }
+
+ return einfo->errcode;
+}
+/* }}} */
+
+static int pdo_sqlite2_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+ pdo_sqlite2_error_info *einfo = &H->einfo;
+ pdo_sqlite2_stmt *S;
+
+ if (stmt) {
+ S = stmt->driver_data;
+ einfo = &S->einfo;
+ }
+
+ if (einfo->errcode) {
+ add_next_index_long(info, einfo->errcode);
+ if (einfo->errmsg) {
+ add_next_index_string(info, einfo->errmsg, 1);
+ }
+ }
+
+ return 1;
+}
+
+static int sqlite2_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+
+ if (H) {
+ if (H->db) {
+ sqlite_close(H->db);
+ H->db = NULL;
+ }
+ pefree(H, dbh->is_persistent);
+ dbh->driver_data = NULL;
+ }
+ return 0;
+}
+/* }}} */
+
+static int sqlite2_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+ pdo_sqlite2_stmt *S = ecalloc(1, sizeof(pdo_sqlite2_stmt));
+
+ S->H = H;
+ stmt->driver_data = S;
+ stmt->methods = &sqlite2_stmt_methods;
+ stmt->supports_placeholders = PDO_PLACEHOLDER_NONE;
+
+ if (PDO_CURSOR_FWDONLY != pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC)) {
+ H->einfo.errcode = SQLITE_ERROR;
+ pdo_sqlite2_error(NULL, dbh);
+ return 0;
+ }
+
+ return 1;
+}
+
+static long sqlite2_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC)
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+ char *errmsg = NULL;
+
+ if (sqlite_exec(H->db, sql, NULL, NULL, &errmsg) != SQLITE_OK) {
+ pdo_sqlite2_error(errmsg, dbh);
+ return -1;
+ } else {
+ return sqlite_changes(H->db);
+ }
+}
+
+static char *pdo_sqlite2_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+ char *id;
+
+ id = php_pdo_int64_to_str(sqlite_last_insert_rowid(H->db) TSRMLS_CC);
+ *len = strlen(id);
+ return id;
+}
+
+static int sqlite2_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+{
+ char *ret;
+
+ if (unquotedlen && (unquoted[0] == '\x01' || memchr(unquoted, '\0', unquotedlen) != NULL)) {
+ /* binary string */
+ int len;
+ ret = safe_emalloc(1 + unquotedlen / 254, 257, 5);
+ ret[0] = '\'';
+ ret[1] = '\x01';
+ len = php_sqlite_encode_binary(unquoted, unquotedlen, ret+2);
+ ret[len + 2] = '\'';
+ ret[len + 3] = '\0';
+ *quoted = ret;
+ *quotedlen = len + 3;
+ /* fprintf(stderr, "Quoting:%d:%.*s:\n", *quotedlen, *quotedlen, *quoted); */
+ return 1;
+ } else if (unquotedlen) {
+ ret = sqlite_mprintf("'%q'", unquoted);
+ if (ret) {
+ *quoted = estrdup(ret);
+ *quotedlen = strlen(ret);
+ sqlite_freemem(ret);
+ return 1;
+ }
+ return 0;
+ } else {
+ *quoted = estrdup("''");
+ *quotedlen = 2;
+ return 1;
+ }
+}
+
+static int sqlite2_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+ char *errmsg = NULL;
+
+ if (sqlite_exec(H->db, "BEGIN", NULL, NULL, &errmsg) != SQLITE_OK) {
+ pdo_sqlite2_error(errmsg, dbh);
+ return 0;
+ }
+ return 1;
+}
+
+static int sqlite2_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+ char *errmsg = NULL;
+
+ if (sqlite_exec(H->db, "COMMIT", NULL, NULL, &errmsg) != SQLITE_OK) {
+ pdo_sqlite2_error(errmsg, dbh);
+ return 0;
+ }
+ return 1;
+}
+
+static int sqlite2_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+ char *errmsg = NULL;
+
+ if (sqlite_exec(H->db, "ROLLBACK", NULL, NULL, &errmsg) != SQLITE_OK) {
+ pdo_sqlite2_error(errmsg, dbh);
+ return 0;
+ }
+ return 1;
+}
+
+static int pdo_sqlite2_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC)
+{
+ switch (attr) {
+ case PDO_ATTR_CLIENT_VERSION:
+ case PDO_ATTR_SERVER_VERSION:
+ ZVAL_STRING(return_value, (char *)sqlite_libversion(), 1);
+ break;
+
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
+static int pdo_sqlite2_set_attr(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
+{
+ pdo_sqlite2_db_handle *H = (pdo_sqlite2_db_handle *)dbh->driver_data;
+
+ switch (attr) {
+ case PDO_ATTR_TIMEOUT:
+ convert_to_long(val);
+ sqlite_busy_timeout(H->db, Z_LVAL_P(val) * 1000);
+ return 1;
+ }
+ return 0;
+}
+
+static PHP_FUNCTION(sqlite2_create_function)
+{
+ /* TODO: implement this stuff */
+}
+
+static function_entry dbh_methods[] = {
+ PHP_FE(sqlite2_create_function, NULL)
+ {NULL, NULL, NULL}
+};
+
+static function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC)
+{
+ switch (kind) {
+ case PDO_DBH_DRIVER_METHOD_KIND_DBH:
+ return dbh_methods;
+
+ default:
+ return NULL;
+ }
+}
+
+static struct pdo_dbh_methods sqlite2_methods = {
+ sqlite2_handle_closer,
+ sqlite2_handle_preparer,
+ sqlite2_handle_doer,
+ sqlite2_handle_quoter,
+ sqlite2_handle_begin,
+ sqlite2_handle_commit,
+ sqlite2_handle_rollback,
+ pdo_sqlite2_set_attr,
+ pdo_sqlite2_last_insert_id,
+ pdo_sqlite2_fetch_error_func,
+ pdo_sqlite2_get_attribute,
+ NULL, /* check_liveness: not needed */
+ get_driver_methods
+};
+
+static char *make_filename_safe(const char *filename TSRMLS_DC)
+{
+ if (strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
+ char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
+
+ if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ efree(fullpath);
+ return NULL;
+ }
+
+ if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ efree(fullpath);
+ return NULL;
+ }
+ return fullpath;
+ }
+ return estrdup(filename);
+}
+
+static int authorizer(void *autharg, int access_type, const char *arg3, const char *arg4,
+ const char *arg5, const char *arg6)
+{
+ char *filename;
+ switch (access_type) {
+ case SQLITE_COPY: {
+ TSRMLS_FETCH();
+ filename = make_filename_safe(arg4 TSRMLS_CC);
+ if (!filename) {
+ return SQLITE_DENY;
+ }
+ efree(filename);
+ return SQLITE_OK;
+ }
+
+ case SQLITE_ATTACH: {
+ TSRMLS_FETCH();
+ filename = make_filename_safe(arg3 TSRMLS_CC);
+ if (!filename) {
+ return SQLITE_DENY;
+ }
+ efree(filename);
+ return SQLITE_OK;
+ }
+
+ default:
+ /* access allowed */
+ return SQLITE_OK;
+ }
+}
+
+static int pdo_sqlite2_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+{
+ pdo_sqlite2_db_handle *H;
+ int ret = 0;
+ long timeout = 60;
+ char *filename;
+ char *errmsg = NULL;
+
+ H = pecalloc(1, sizeof(pdo_sqlite2_db_handle), dbh->is_persistent);
+
+ H->einfo.errcode = 0;
+ H->einfo.errmsg = NULL;
+ dbh->driver_data = H;
+
+ filename = make_filename_safe(dbh->data_source TSRMLS_CC);
+
+ if (!filename) {
+ zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC,
+ "safe_mode/open_basedir prohibits opening %s",
+ dbh->data_source);
+ goto cleanup;
+ }
+
+ H->db = sqlite_open(filename, 0666, &errmsg);
+ efree(filename);
+
+ if (!H->db) {
+ pdo_sqlite2_error(errmsg, dbh);
+ goto cleanup;
+ }
+
+ sqlite_set_authorizer(H->db, authorizer, NULL);
+
+ if (driver_options) {
+ timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, timeout TSRMLS_CC);
+ }
+ sqlite_busy_timeout(H->db, timeout * 1000);
+
+ dbh->alloc_own_columns = 1;
+ dbh->max_escaped_char_length = 2;
+
+ ret = 1;
+
+cleanup:
+ dbh->methods = &sqlite2_methods;
+
+ return ret;
+}
+/* }}} */
+
+pdo_driver_t pdo_sqlite2_driver = {
+ PDO_DRIVER_HEADER(sqlite2),
+ pdo_sqlite2_handle_factory
+};
+
+
+
+#endif
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/sqlite/php_sqlite.h b/ext/sqlite/php_sqlite.h
index b2dbfa454..4160a6cf5 100644
--- a/ext/sqlite/php_sqlite.h
+++ b/ext/sqlite/php_sqlite.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
- $Id: php_sqlite.h,v 1.30 2004/05/13 14:19:10 stas Exp $
+ $Id: php_sqlite.h,v 1.32 2005/08/03 14:07:53 sniper Exp $
*/
#ifndef PHP_SQLITE_H
@@ -65,6 +65,7 @@ PHP_FUNCTION(sqlite_seek);
PHP_FUNCTION(sqlite_rewind);
PHP_FUNCTION(sqlite_next);
PHP_FUNCTION(sqlite_prev);
+PHP_FUNCTION(sqlite_key);
PHP_FUNCTION(sqlite_valid);
PHP_FUNCTION(sqlite_has_prev);
diff --git a/ext/sqlite/sess_sqlite.c b/ext/sqlite/sess_sqlite.c
index 40b8a0731..79c8c33f1 100644
--- a/ext/sqlite/sess_sqlite.c
+++ b/ext/sqlite/sess_sqlite.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sess_sqlite.c,v 1.16.2.1 2005/05/30 15:13:57 sniper Exp $ */
+/* $Id: sess_sqlite.c,v 1.18 2005/08/03 14:07:53 sniper Exp $ */
#include "php.h"
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 80907d891..f6e4ec5b7 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
- $Id: sqlite.c,v 1.146.2.7 2005/06/07 15:38:37 dmitry Exp $
+ $Id: sqlite.c,v 1.166.2.7 2005/11/25 16:01:41 sniper Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -42,6 +42,18 @@
#include <sqlite.h>
#include "zend_exceptions.h"
+#include "zend_interfaces.h"
+
+#if defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1))
+extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
+extern PHPAPI zend_class_entry *spl_ce_Countable;
+#endif
+
+#if PHP_SQLITE2_HAVE_PDO
+# include "pdo/php_pdo.h"
+# include "pdo/php_pdo_driver.h"
+extern pdo_driver_t pdo_sqlite2_driver;
+#endif
#ifndef safe_emalloc
# define safe_emalloc(a,b,c) emalloc((a)*(b)+(c))
@@ -60,6 +72,8 @@ extern int sqlite_decode_binary(const unsigned char *in, unsigned char *out);
#define php_sqlite_encode_binary(in, n, out) sqlite_encode_binary((const unsigned char *)in, n, (unsigned char *)out)
#define php_sqlite_decode_binary(in, out) sqlite_decode_binary((const unsigned char *)in, (unsigned char *)out)
+static int sqlite_count_elements(zval *object, long *count TSRMLS_DC);
+
static int le_sqlite_db, le_sqlite_result, le_sqlite_pdb;
static inline void php_sqlite_strtoupper(char *s)
@@ -85,7 +99,6 @@ STD_PHP_INI_ENTRY_EX("sqlite.assoc_case", "0", PHP_INI_ALL, OnUpdateLong, assoc_
PHP_INI_END()
/* }}} */
-
#define DB_FROM_ZVAL(db, zv) ZEND_FETCH_RESOURCE2(db, struct php_sqlite_db *, zv, -1, "sqlite database", le_sqlite_db, le_sqlite_pdb)
#define DB_FROM_OBJECT(db, object) \
@@ -108,10 +121,6 @@ PHP_INI_END()
} \
}
-#define SQLITE_THROW(message) \
- PG(suppress_errors) = 0; \
- EG(exception) = zend_throw_exception(sqlite_ce_exception, message, 0 TSRMLS_CC);
-
#define PHP_SQLITE_EMPTY_QUERY \
if (!sql_len) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot execute empty query."); \
@@ -156,8 +165,8 @@ function_entry sqlite_functions[] = {
PHP_FE(sqlite_open, third_arg_force_ref)
PHP_FE(sqlite_popen, third_arg_force_ref)
PHP_FE(sqlite_close, NULL)
- PHP_FE(sqlite_query, NULL)
- PHP_FE(sqlite_exec, NULL)
+ PHP_FE(sqlite_query, fourth_arg_force_ref)
+ PHP_FE(sqlite_exec, third_arg_force_ref)
PHP_FE(sqlite_array_query, NULL)
PHP_FE(sqlite_single_query, NULL)
PHP_FE(sqlite_fetch_array, NULL)
@@ -185,7 +194,7 @@ function_entry sqlite_functions[] = {
PHP_FE(sqlite_busy_timeout, NULL)
PHP_FE(sqlite_last_error, NULL)
PHP_FE(sqlite_error_string, NULL)
- PHP_FE(sqlite_unbuffered_query, NULL)
+ PHP_FE(sqlite_unbuffered_query, fourth_arg_force_ref)
PHP_FE(sqlite_create_aggregate, NULL)
PHP_FE(sqlite_create_function, NULL)
PHP_FE(sqlite_factory, third_arg_force_ref)
@@ -196,13 +205,13 @@ function_entry sqlite_functions[] = {
};
function_entry sqlite_funcs_db[] = {
- PHP_ME_MAPPING(__construct, sqlite_open, NULL)
+ PHP_ME_MAPPING(__construct, sqlite_open, third_arg_force_ref)
/* PHP_ME_MAPPING(close, sqlite_close, NULL)*/
- PHP_ME_MAPPING(query, sqlite_query, NULL)
- PHP_ME_MAPPING(queryExec, sqlite_exec, 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, 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)
@@ -223,12 +232,14 @@ function_entry sqlite_funcs_query[] = {
PHP_ME_MAPPING(column, sqlite_column, NULL)
PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL)
PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL)
- /* spl_forward */
+ /* 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)
- /* spl_sequence */
PHP_ME_MAPPING(rewind, sqlite_rewind, NULL)
+ /* countable */
+ PHP_ME_MAPPING(count, sqlite_num_rows, NULL)
/* additional */
PHP_ME_MAPPING(prev, sqlite_prev, NULL)
PHP_ME_MAPPING(hasPrev, sqlite_has_prev, NULL)
@@ -245,7 +256,7 @@ function_entry sqlite_funcs_ub_query[] = {
PHP_ME_MAPPING(column, sqlite_column, NULL)
PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL)
PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL)
- /* spl_forward */
+ /* iterator */
PHP_ME_MAPPING(current, sqlite_current, NULL)
PHP_ME_MAPPING(next, sqlite_next, NULL)
PHP_ME_MAPPING(valid, sqlite_valid, NULL)
@@ -256,8 +267,25 @@ function_entry sqlite_funcs_exception[] = {
{NULL, NULL, NULL}
};
+/* Dependancies */
+static zend_module_dep sqlite_deps[] = {
+#if defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1))
+ ZEND_MOD_REQUIRED("spl")
+#endif
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+ ZEND_MOD_REQUIRED("session")
+#endif
+#ifdef PHP_SQLITE2_HAVE_PDO
+ ZEND_MOD_REQUIRED("pdo")
+#endif
+ {NULL, NULL, NULL}
+};
+
zend_module_entry sqlite_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
+#if ZEND_MODULE_API_NO >= 20050922
+ STANDARD_MODULE_HEADER_EX, NULL,
+ sqlite_deps,
+#elif ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"SQLite",
@@ -802,7 +830,7 @@ static void sqlite_object_new(zend_class_entry *class_type, zend_object_handlers
zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
- retval->handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) sqlite_object_free_storage, NULL TSRMLS_CC);
+ retval->handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) sqlite_object_free_storage, NULL TSRMLS_CC);
retval->handlers = handlers;
}
@@ -997,17 +1025,27 @@ PHP_MINIT_FUNCTION(sqlite)
REGISTER_SQLITE_CLASS(Database, db, NULL);
REGISTER_SQLITE_CLASS(Result, query, NULL);
REGISTER_SQLITE_CLASS(Unbuffered, ub_query, NULL);
+#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());
+#endif
sqlite_ce_db->ce_flags &= ~ZEND_ACC_FINAL_CLASS;
sqlite_ce_db->constructor->common.fn_flags |= ZEND_ACC_FINAL;
sqlite_object_handlers_query.get_class_entry = sqlite_get_ce_query;
sqlite_object_handlers_ub_query.get_class_entry = sqlite_get_ce_ub_query;
-
+ sqlite_object_handlers_ub_query.count_elements = sqlite_count_elements;
+
sqlite_ce_ub_query->get_iterator = sqlite_get_iterator;
sqlite_ce_ub_query->iterator_funcs.funcs = &sqlite_ub_query_iterator_funcs;
+#if defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1))
+ zend_class_implements(sqlite_ce_query TSRMLS_CC, 2, zend_ce_iterator, spl_ce_Countable);
+#else
+ zend_class_implements(sqlite_ce_query TSRMLS_CC, 1, zend_ce_iterator);
+#endif
sqlite_ce_query->get_iterator = sqlite_get_iterator;
sqlite_ce_query->iterator_funcs.funcs = &sqlite_query_iterator_funcs;
@@ -1058,12 +1096,23 @@ PHP_MINIT_FUNCTION(sqlite)
REGISTER_LONG_CONSTANT("SQLITE_ROW", SQLITE_ROW, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SQLITE_DONE", SQLITE_DONE, CONST_CS|CONST_PERSISTENT);
+#ifdef PHP_SQLITE2_HAVE_PDO
+ if (FAILURE == php_pdo_register_driver(&pdo_sqlite2_driver)) {
+ return FAILURE;
+ }
+#endif
+
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(sqlite)
{
UNREGISTER_INI_ENTRIES();
+
+#ifdef PHP_SQLITE2_HAVE_PDO
+ php_pdo_unregister_driver(&pdo_sqlite2_driver);
+#endif
+
return SUCCESS;
}
@@ -1076,7 +1125,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.146.2.7 2005/06/07 15:38:37 dmitry Exp $");
+ php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.7 2005/11/25 16:01:41 sniper 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();
@@ -1128,7 +1177,9 @@ static struct php_sqlite_db *php_sqlite_open(char *filename, int mode, char *per
/* authorizer hook so we can enforce safe mode
* Note: the declaration of php_sqlite_authorizer is correct for 2.8.2 of libsqlite,
* and IS backwards binary compatible with earlier versions */
- sqlite_set_authorizer(sdb, php_sqlite_authorizer, NULL);
+ if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
+ sqlite_set_authorizer(sdb, php_sqlite_authorizer, NULL);
+ }
db->rsrc_id = ZEND_REGISTER_RESOURCE(object ? NULL : return_value, db, persistent_id ? le_sqlite_pdb : le_sqlite_db);
if (object) {
@@ -1383,7 +1434,7 @@ static int php_sqlite_fetch(struct php_sqlite_result *rres TSRMLS_DC)
{
const char **rowdata, **colnames;
int ret, i, base;
- char *errtext = NULL, *colname;
+ char *errtext = NULL;
next_row:
ret = sqlite_step(rres->vm, &rres->ncolumns, &rowdata, &colnames);
@@ -1391,14 +1442,13 @@ next_row:
/* first row - lets copy the column names */
rres->col_names = safe_emalloc(rres->ncolumns, sizeof(char *), 0);
for (i = 0; i < rres->ncolumns; i++) {
- colname = (char*)colnames[i];
+ rres->col_names[i] = estrdup((char*)colnames[i]);
if (SQLITE_G(assoc_case) == 1) {
- php_sqlite_strtoupper(colname);
+ php_sqlite_strtoupper(rres->col_names[i]);
} else if (SQLITE_G(assoc_case) == 2) {
- php_sqlite_strtolower(colname);
+ php_sqlite_strtolower(rres->col_names[i]);
}
- rres->col_names[i] = estrdup(colname);
}
if (!rres->buffered) {
/* non buffered mode - also fetch memory for on single row */
@@ -1466,7 +1516,7 @@ next_row:
/* }}} */
/* {{{ sqlite_query */
-void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_len, int mode, int buffered, zval *return_value, struct php_sqlite_result **prres TSRMLS_DC)
+void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_len, int mode, int buffered, zval *return_value, struct php_sqlite_result **prres, zval *errmsg TSRMLS_DC)
{
struct php_sqlite_result res, *rres;
int ret;
@@ -1482,6 +1532,9 @@ void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_le
if (ret != SQLITE_OK) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errtext);
+ if (errmsg) {
+ ZVAL_STRING(errmsg, errtext, 1);
+ }
sqlite_freemem(errtext);
goto terminate;
} else if (!res.vm) { /* empty query */
@@ -1534,7 +1587,7 @@ terminate:
}
/* }}} */
-/* {{{ proto resource sqlite_unbuffered_query(string query, resource db [ , int result_type ])
+/* {{{ proto resource sqlite_unbuffered_query(string query, resource db [ , int result_type [, string &error_message]])
Executes a query that does not prefetch and buffer all data. */
PHP_FUNCTION(sqlite_unbuffered_query)
{
@@ -1544,22 +1597,28 @@ PHP_FUNCTION(sqlite_unbuffered_query)
int sql_len;
long mode = PHPSQLITE_BOTH;
char *errtext = NULL;
+ zval *errmsg = NULL;
zval *object = getThis();
if (object) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &sql, &sql_len, &mode)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/", &sql, &sql_len, &mode, &errmsg)) {
return;
}
DB_FROM_OBJECT(db, object);
} else {
if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "sr|l", &sql, &sql_len, &zdb, &mode) &&
- FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &zdb, &sql, &sql_len, &mode)) {
+ ZEND_NUM_ARGS() TSRMLS_CC, "sr|lz/", &sql, &sql_len, &zdb, &mode, &errmsg) &&
+ FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lz/", &zdb, &sql, &sql_len, &mode, &errmsg)) {
return;
}
DB_FROM_ZVAL(db, &zdb);
}
+ if (errmsg) {
+ zval_dtor(errmsg);
+ ZVAL_NULL(errmsg);
+ }
+
PHP_SQLITE_EMPTY_QUERY;
/* avoid doing work if we can */
@@ -1568,16 +1627,19 @@ PHP_FUNCTION(sqlite_unbuffered_query)
if (db->last_err_code != SQLITE_OK) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errtext);
+ if (errmsg) {
+ ZVAL_STRING(errmsg, errtext, 1);
+ }
sqlite_freemem(errtext);
}
return;
}
- sqlite_query(object, db, sql, sql_len, (int)mode, 0, return_value, NULL TSRMLS_CC);
+ sqlite_query(object, db, sql, sql_len, (int)mode, 0, return_value, NULL, errmsg TSRMLS_CC);
}
/* }}} */
-/* {{{ proto resource sqlite_fetch_column_types(string table_name, resource db)
+/* {{{ proto resource sqlite_fetch_column_types(string table_name, resource db [, int result_type])
Return an array of column types from a particular table. */
PHP_FUNCTION(sqlite_fetch_column_types)
{
@@ -1590,16 +1652,17 @@ PHP_FUNCTION(sqlite_fetch_column_types)
struct php_sqlite_result res;
const char **rowdata, **colnames, *tail;
int i, ncols;
+ long result_type = PHPSQLITE_ASSOC;
if (object) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tbl, &tbl_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &tbl, &tbl_len, &result_type)) {
return;
}
DB_FROM_OBJECT(db, object);
} else {
if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "sr", &tbl, &tbl_len, &zdb) &&
- FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zdb, &tbl, &tbl_len)) {
+ ZEND_NUM_ARGS() TSRMLS_CC, "sr|l", &tbl, &tbl_len, &zdb, &result_type) &&
+ FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &zdb, &tbl, &tbl_len, &result_type)) {
return;
}
DB_FROM_ZVAL(db, &zdb);
@@ -1627,15 +1690,21 @@ PHP_FUNCTION(sqlite_fetch_column_types)
array_init(return_value);
for (i = 0; i < ncols; i++) {
- char *colname = (char *)colnames[i];
+ if (result_type == PHPSQLITE_ASSOC) {
+ char *colname = estrdup((char *)colnames[i]);
- if (SQLITE_G(assoc_case) == 1) {
- php_sqlite_strtoupper(colname);
- } else if (SQLITE_G(assoc_case) == 2) {
- php_sqlite_strtolower(colname);
- }
+ if (SQLITE_G(assoc_case) == 1) {
+ php_sqlite_strtoupper(colname);
+ } else if (SQLITE_G(assoc_case) == 2) {
+ php_sqlite_strtolower(colname);
+ }
- add_assoc_string(return_value, colname, colnames[ncols + i] ? (char *)colnames[ncols + i] : "", 1);
+ add_assoc_string(return_value, colname, colnames[ncols + i] ? (char *)colnames[ncols + i] : "", 1);
+ efree(colname);
+ }
+ if (result_type == PHPSQLITE_NUM) {
+ add_index_string(return_value, i, colnames[ncols + i] ? (char *)colnames[ncols + i] : "", 1);
+ }
}
done:
@@ -1643,7 +1712,7 @@ done:
}
/* }}} */
-/* {{{ proto resource sqlite_query(string query, resource db [, int result_type ])
+/* {{{ proto resource sqlite_query(string query, resource db [, int result_type [, string &error_message]])
Executes a query against a given database and returns a result handle. */
PHP_FUNCTION(sqlite_query)
{
@@ -1653,22 +1722,28 @@ PHP_FUNCTION(sqlite_query)
int sql_len;
long mode = PHPSQLITE_BOTH;
char *errtext = NULL;
+ zval *errmsg = NULL;
zval *object = getThis();
if (object) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &sql, &sql_len, &mode)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/", &sql, &sql_len, &mode, &errmsg)) {
return;
}
DB_FROM_OBJECT(db, object);
} else {
if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "sr|l", &sql, &sql_len, &zdb, &mode) &&
- FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &zdb, &sql, &sql_len, &mode)) {
+ ZEND_NUM_ARGS() TSRMLS_CC, "sr|lz/", &sql, &sql_len, &zdb, &mode, &errmsg) &&
+ FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lz/", &zdb, &sql, &sql_len, &mode, &errmsg)) {
return;
}
DB_FROM_ZVAL(db, &zdb);
}
+ if (errmsg) {
+ zval_dtor(errmsg);
+ ZVAL_NULL(errmsg);
+ }
+
PHP_SQLITE_EMPTY_QUERY;
/* avoid doing work if we can */
@@ -1677,16 +1752,19 @@ PHP_FUNCTION(sqlite_query)
if (db->last_err_code != SQLITE_OK) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errtext);
+ if (errmsg) {
+ ZVAL_STRING(errmsg, errtext, 1);
+ }
sqlite_freemem(errtext);
}
return;
}
- sqlite_query(object, db, sql, sql_len, (int)mode, 1, return_value, NULL TSRMLS_CC);
+ sqlite_query(object, db, sql, sql_len, (int)mode, 1, return_value, NULL, errmsg TSRMLS_CC);
}
/* }}} */
-/* {{{ proto boolean sqlite_exec(string query, resource db)
+/* {{{ proto boolean sqlite_exec(string query, resource db[, string &error_message])
Executes a result-less query against a given database */
PHP_FUNCTION(sqlite_exec)
{
@@ -1695,28 +1773,37 @@ PHP_FUNCTION(sqlite_exec)
char *sql;
int sql_len;
char *errtext = NULL;
+ zval *errmsg = NULL;
zval *object = getThis();
if (object) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &sql, &sql_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &sql, &sql_len, &errmsg)) {
return;
}
DB_FROM_OBJECT(db, object);
} else {
if(FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
ZEND_NUM_ARGS() TSRMLS_CC, "sr", &sql, &sql_len, &zdb) &&
- FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zdb, &sql, &sql_len)) {
+ FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z/", &zdb, &sql, &sql_len, &errmsg)) {
return;
}
DB_FROM_ZVAL(db, &zdb);
}
-
+
+ if (errmsg) {
+ zval_dtor(errmsg);
+ ZVAL_NULL(errmsg);
+ }
+
PHP_SQLITE_EMPTY_QUERY;
db->last_err_code = sqlite_exec(db->db, sql, NULL, NULL, &errtext);
if (db->last_err_code != SQLITE_OK) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errtext);
+ if (errmsg) {
+ ZVAL_STRING(errmsg, errtext, 1);
+ }
sqlite_freemem(errtext);
RETURN_FALSE;
}
@@ -2084,7 +2171,7 @@ PHP_FUNCTION(sqlite_array_query)
}
rres = (struct php_sqlite_result *)emalloc(sizeof(*rres));
- sqlite_query(NULL, db, sql, sql_len, (int)mode, 0, NULL, &rres TSRMLS_CC);
+ sqlite_query(NULL, db, sql, sql_len, (int)mode, 0, NULL, &rres, NULL TSRMLS_CC);
if (db->last_err_code != SQLITE_OK) {
if (rres) {
efree(rres);
@@ -2200,7 +2287,7 @@ PHP_FUNCTION(sqlite_single_query)
}
rres = (struct php_sqlite_result *)emalloc(sizeof(*rres));
- sqlite_query(NULL, db, sql, sql_len, PHPSQLITE_NUM, 0, NULL, &rres TSRMLS_CC);
+ sqlite_query(NULL, db, sql, sql_len, PHPSQLITE_NUM, 0, NULL, &rres, NULL TSRMLS_CC);
if (db->last_err_code != SQLITE_OK) {
if (rres) {
efree(rres);
@@ -2390,6 +2477,19 @@ PHP_FUNCTION(sqlite_last_insert_rowid)
}
/* }}} */
+static int sqlite_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */
+{
+ sqlite_object *obj = (sqlite_object*) zend_object_store_get_object(object TSRMLS_CC);
+
+ if (obj->u.res->buffered) {
+ * count = obj->u.res->nrows;
+ return SUCCESS;
+ } else {
+ zend_throw_exception(sqlite_ce_exception, "Row count is not available for unbuffered queries", 0 TSRMLS_CC);
+ return FAILURE;
+ }
+} /* }}} */
+
/* {{{ proto int sqlite_num_rows(resource result)
Returns the number of rows in a buffered result set. */
PHP_FUNCTION(sqlite_num_rows)
@@ -2632,6 +2732,30 @@ PHP_FUNCTION(sqlite_next)
}
/* }}} */
+/* {{{ proto int sqlite_key(resource result)
+ Return the current row index of a buffered result. */
+PHP_FUNCTION(sqlite_key)
+{
+ zval *zres;
+ struct php_sqlite_result *res;
+ zval *object = getThis();
+
+ if (object) {
+ if (ZEND_NUM_ARGS() != 0) {
+ WRONG_PARAM_COUNT
+ }
+ RES_FROM_OBJECT(res, object);
+ } else {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zres)) {
+ return;
+ }
+ ZEND_FETCH_RESOURCE(res, struct php_sqlite_result *, &zres, -1, "sqlite result", le_sqlite_result);
+ }
+
+ RETURN_LONG(res->curr_row);
+}
+/* }}} */
+
/* {{{ proto bool sqlite_prev(resource result)
* Seek to the previous row number of a result set. */
PHP_FUNCTION(sqlite_prev)
diff --git a/ext/sqlite/tests/bug35248.phpt b/ext/sqlite/tests/bug35248.phpt
new file mode 100644
index 000000000..4898a4142
--- /dev/null
+++ b/ext/sqlite/tests/bug35248.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #35248 (sqlite_query does not return parse error message)
+--SKIPIF--
+<?php if (!extension_loaded("sqlite")) print "skip"; ?>
+--FILE--
+<?php
+ $db = sqlite_open(":memory:");
+ $res = @sqlite_query($db, "asdfesdfa", SQLITE_NUM, $err);
+ var_dump($err);
+ $res = @sqlite_unbuffered_query($db, "asdfesdfa", SQLITE_NUM, $err);
+ var_dump($err);
+?>
+--EXPECT--
+string(30) "near "asdfesdfa": syntax error"
+string(30) "near "asdfesdfa": syntax error"
diff --git a/ext/sqlite/tests/pdo/common.phpt b/ext/sqlite/tests/pdo/common.phpt
new file mode 100644
index 000000000..42e736ae9
--- /dev/null
+++ b/ext/sqlite/tests/pdo/common.phpt
@@ -0,0 +1,12 @@
+--TEST--
+SQLite2
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo') || !extension_loaded('sqlite')) print 'skip'; ?>
+--REDIRECTTEST--
+return array(
+ 'ENV' => array(
+ 'PDOTEST_DSN' => 'sqlite2::memory:'
+ ),
+ 'TESTS' => 'ext/pdo/tests'
+ );
diff --git a/ext/sqlite/tests/sqlite_oo_030.phpt b/ext/sqlite/tests/sqlite_oo_030.phpt
index 215511597..95b91f61f 100755
--- a/ext/sqlite/tests/sqlite_oo_030.phpt
+++ b/ext/sqlite/tests/sqlite_oo_030.phpt
@@ -39,4 +39,6 @@ NULL
string(1) "1"
string(3) "PHP"
-Fatal error: Call to undefined method foo::bar("php")() in %ssqlite_oo_030.php on line %d
+Warning: SQLiteDatabase::singleQuery(): function `foo::bar("PHP")' is not a function name in %ssqlite_oo_030.php on line %d
+bool(false)
+===DONE===
diff --git a/ext/sqlite/tests/sqlite_oo_031.phpt b/ext/sqlite/tests/sqlite_spl_001.phpt
index f0ed40a42..2a1a2b49c 100755
--- a/ext/sqlite/tests/sqlite_oo_031.phpt
+++ b/ext/sqlite/tests/sqlite_spl_001.phpt
@@ -1,5 +1,5 @@
--TEST--
-sqlite-oo: and spl
+sqlite-spl: Iteration
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded("sqlite")) print "skip";
@@ -109,7 +109,7 @@ class SqliteNestedset implements RecursiveIterator
}
}
-$menu_iterator = new RecursiveIteratorIterator(new SqliteNestedset($db), RIT_SELF_FIRST);
+$menu_iterator = new RecursiveIteratorIterator(new SqliteNestedset($db), RecursiveIteratorIterator::SELF_FIRST);
foreach($menu_iterator as $entry) {
echo $menu_iterator->getDepth() . $entry . "\n";
}
diff --git a/ext/sqlite/tests/sqlite_spl_002.phpt b/ext/sqlite/tests/sqlite_spl_002.phpt
new file mode 100755
index 000000000..c60ca01e0
--- /dev/null
+++ b/ext/sqlite/tests/sqlite_spl_002.phpt
@@ -0,0 +1,29 @@
+--TEST--
+sqlite-spl: Countable
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded("sqlite")) print "skip";
+if (!extension_loaded("spl")) print "skip SPL is not present";
+?>
+--FILE--
+<?php
+include "blankdb_oo.inc";
+
+$db->query("CREATE TABLE menu(id_l int PRIMARY KEY, id_r int UNIQUE, key VARCHAR(10))");
+$db->query("INSERT INTO menu VALUES( 1, 12, 'A')");
+$db->query("INSERT INTO menu VALUES( 2, 9, 'B')");
+$db->query("INSERT INTO menu VALUES(10, 11, 'F')");
+$db->query("INSERT INTO menu VALUES( 3, 6, 'C')");
+$db->query("INSERT INTO menu VALUES( 7, 8, 'E')");
+$db->query("INSERT INTO menu VALUES( 4, 5, 'D')");
+
+$res = $db->query("SELECT * from menu");
+
+var_dump($res->count());
+var_dump(count($res));
+?>
+===DONE===
+--EXPECT--
+int(6)
+int(6)
+===DONE===
diff --git a/ext/sqlite/tests/sqlite_spl_003.phpt b/ext/sqlite/tests/sqlite_spl_003.phpt
new file mode 100755
index 000000000..267ceff50
--- /dev/null
+++ b/ext/sqlite/tests/sqlite_spl_003.phpt
@@ -0,0 +1,28 @@
+--TEST--
+sqlite-spl: Exception
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded("sqlite")) print "skip";
+if (!extension_loaded("spl")) print "skip SPL is not present";
+?>
+--FILE--
+<?php
+
+try
+{
+ $db = sqlite_factory();
+}
+catch(SQLiteException $e)
+{
+ $parents = class_parents($e);
+ if (array_key_exists('RuntimeException', $parents))
+ {
+ echo "GOOD\n";
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+GOOD
+===DONE===
diff --git a/ext/standard/Makefile.frag b/ext/standard/Makefile.frag
index c3a27b0a4..ca7ff9bd8 100644
--- a/ext/standard/Makefile.frag
+++ b/ext/standard/Makefile.frag
@@ -1,12 +1,9 @@
-$(srcdir)/parsedate.c: $(srcdir)/parsedate.y
- $(YACC) $(srcdir)/parsedate.y -o $@
-
$(srcdir)/var_unserializer.c: $(srcdir)/var_unserializer.re
- $(RE2C) -b $(srcdir)/var_unserializer.re > $@
+ @$(RE2C) -b $(srcdir)/var_unserializer.re > $@
$(srcdir)/url_scanner_ex.c: $(srcdir)/url_scanner_ex.re
- $(RE2C) -b $(srcdir)/url_scanner_ex.re > $@
+ @$(RE2C) -b $(srcdir)/url_scanner_ex.re > $@
$(builddir)/info.lo: $(builddir)/../../main/build-defs.h
diff --git a/ext/standard/array.c b/ext/standard/array.c
index b379a2aaf..5e5062868 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.266.2.25 2005/09/01 12:01:01 dmitry Exp $ */
+/* $Id: array.c,v 1.308.2.12 2005/10/30 13:48:30 iliaa Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -39,17 +39,15 @@
#include "win32/unistd.h"
#endif
#include "zend_globals.h"
+#include "zend_interfaces.h"
#include "php_globals.h"
#include "php_array.h"
#include "basic_functions.h"
#include "php_string.h"
#include "php_rand.h"
#include "php_smart_str.h"
-
-#ifdef ZTS
-int array_globals_id;
-#else
-php_array_globals array_globals;
+#ifdef HAVE_SPL
+#include "ext/spl/spl_array.h"
#endif
#define EXTR_OVERWRITE 0
@@ -76,15 +74,17 @@ php_array_globals array_globals;
#define COUNT_NORMAL 0
#define COUNT_RECURSIVE 1
-#define DIFF_NORMAL 0
-#define DIFF_ASSOC 1
+#define DIFF_NORMAL 1
+#define DIFF_KEY 2
+#define DIFF_ASSOC 6
#define DIFF_COMP_DATA_INTERNAL 0
#define DIFF_COMP_DATA_USER 1
#define DIFF_COMP_KEY_INTERNAL 0
#define DIFF_COMP_KEY_USER 1
-#define INTERSECT_NORMAL 0
-#define INTERSECT_ASSOC 1
+#define INTERSECT_NORMAL 1
+#define INTERSECT_KEY 2
+#define INTERSECT_ASSOC 6
#define INTERSECT_COMP_DATA_INTERNAL 0
#define INTERSECT_COMP_DATA_USER 1
#define INTERSECT_COMP_KEY_INTERNAL 0
@@ -92,12 +92,31 @@ php_array_globals array_globals;
#define DOUBLE_DRIFT_FIX 0.000000000000001
-PHP_MINIT_FUNCTION(array)
-{
+ZEND_BEGIN_MODULE_GLOBALS(array)
+ int *multisort_flags[2];
+ int (*compare_func)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_END_MODULE_GLOBALS(array)
+
+ZEND_DECLARE_MODULE_GLOBALS(array)
+
#ifdef ZTS
- ts_allocate_id(&array_globals_id, sizeof(php_array_globals), NULL, NULL);
+#define ARRAYG(v) TSRMG(array_globals_id, zend_array_globals *, v)
+#else
+#define ARRAYG(v) (array_globals.v)
#endif
+/* {{{ php_extname_init_globals
+ */
+static void php_array_init_globals(zend_array_globals *array_globals)
+{
+ memset(array_globals, 0, sizeof(array_globals));
+}
+/* }}} */
+
+PHP_MINIT_FUNCTION(array)
+{
+ ZEND_INIT_MODULE_GLOBALS(array, php_array_init_globals, NULL);
+
REGISTER_LONG_CONSTANT("EXTR_OVERWRITE", EXTR_OVERWRITE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("EXTR_SKIP", EXTR_SKIP, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("EXTR_PREFIX_SAME", EXTR_PREFIX_SAME, CONST_CS | CONST_PERSISTENT);
@@ -299,13 +318,26 @@ PHP_FUNCTION(count)
case IS_ARRAY:
RETURN_LONG (php_count_recursive (array, mode TSRMLS_CC));
break;
- case IS_OBJECT:
- if (Z_OBJ_HT(*array)->count_elements) {
+ case IS_OBJECT: {
+#ifdef HAVE_SPL
+ /* it the object implements Countable we call its count() method */
+ zval *retval;
+
+ if (Z_OBJ_HT_P(array)->get_class_entry && instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) {
+ zend_call_method_with_0_params(&array, NULL, NULL, "count", &retval);
+ RETVAL_LONG(Z_LVAL_P(retval));
+ zval_ptr_dtor(&retval);
+ return;
+ }
+#endif
+ /* if not we return the number of properties (not taking visibility into account) */
+ if (Z_OBJ_HT_P(array)->count_elements) {
RETVAL_LONG(1);
if (SUCCESS == Z_OBJ_HT(*array)->count_elements(array, &Z_LVAL_P(return_value) TSRMLS_CC)) {
return;
}
}
+ }
default:
RETURN_LONG(1);
break;
@@ -582,7 +614,7 @@ static int array_user_compare(const void *a, const void *b TSRMLS_DC)
#define PHP_ARRAY_CMP_FUNC_CHECK(func_name) \
if (!zend_is_callable(*func_name, 0, NULL)) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid comparison function."); \
- BG(user_compare_fci_cache) = old_user_compare_fci_cache; \
+ BG(user_compare_fci_cache) = old_user_compare_fci_cache; \
BG(user_compare_func_name) = old_compare_func; \
RETURN_FALSE; \
} \
@@ -596,17 +628,17 @@ static int array_user_compare(const void *a, const void *b TSRMLS_DC)
*/
#define PHP_ARRAY_CMP_FUNC_VARS \
- zval **old_compare_func; \
- zend_fcall_info_cache old_user_compare_fci_cache
+ zval **old_compare_func; \
+ zend_fcall_info_cache old_user_compare_fci_cache \
#define PHP_ARRAY_CMP_FUNC_BACKUP() \
- old_compare_func = BG(user_compare_func_name); \
- old_user_compare_fci_cache = BG(user_compare_fci_cache); \
- BG(user_compare_fci_cache) = empty_fcall_info_cache
+ old_compare_func = BG(user_compare_func_name); \
+ old_user_compare_fci_cache = BG(user_compare_fci_cache); \
+ BG(user_compare_fci_cache) = empty_fcall_info_cache; \
#define PHP_ARRAY_CMP_FUNC_RESTORE() \
BG(user_compare_fci_cache) = old_user_compare_fci_cache; \
- BG(user_compare_func_name) = old_compare_func
+ BG(user_compare_func_name) = old_compare_func; \
/* {{{ proto bool usort(array array_arg, string cmp_function)
@@ -780,8 +812,7 @@ PHP_FUNCTION(end)
RETURN_FALSE;
}
- *return_value = **entry;
- zval_copy_ctor(return_value);
+ RETURN_ZVAL(*entry, 1, 0);
}
}
/* }}} */
@@ -808,8 +839,7 @@ PHP_FUNCTION(prev)
RETURN_FALSE;
}
- *return_value = **entry;
- zval_copy_ctor(return_value);
+ RETURN_ZVAL(*entry, 1, 0);
}
}
/* }}} */
@@ -836,8 +866,7 @@ PHP_FUNCTION(next)
RETURN_FALSE;
}
- *return_value = **entry;
- zval_copy_ctor(return_value);
+ RETURN_ZVAL(*entry, 1, 0);
}
}
/* }}} */
@@ -864,8 +893,7 @@ PHP_FUNCTION(reset)
RETURN_FALSE;
}
- *return_value = **entry;
- zval_copy_ctor(return_value);
+ RETURN_ZVAL(*entry, 1, 0);
}
}
/* }}} */
@@ -888,8 +916,7 @@ PHP_FUNCTION(current)
if (zend_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) {
RETURN_FALSE;
}
- *return_value = **entry;
- zval_copy_ctor(return_value);
+ RETURN_ZVAL(*entry, 1, 0);
}
/* }}} */
@@ -943,8 +970,7 @@ PHP_FUNCTION(min)
WRONG_PARAM_COUNT;
}
if (zend_hash_minmax(Z_ARRVAL_PP(arr), array_data_compare, 0, (void **) &result TSRMLS_CC) == SUCCESS) {
- *return_value = **result;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*result, 1, 0);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element");
RETURN_FALSE;
@@ -968,8 +994,7 @@ PHP_FUNCTION(min)
}
}
- *return_value = **min;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*min, 1, 0);
efree(args);
}
@@ -995,8 +1020,7 @@ PHP_FUNCTION(max)
WRONG_PARAM_COUNT;
}
if (zend_hash_minmax(Z_ARRVAL_PP(arr), array_data_compare, 1, (void **) &result TSRMLS_CC) == SUCCESS) {
- *return_value = **result;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*result, 1, 0);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element");
RETURN_FALSE;
@@ -1020,9 +1044,7 @@ PHP_FUNCTION(max)
}
}
- *return_value = **max;
- zval_copy_ctor(return_value);
-
+ RETVAL_ZVAL(*max, 1, 0);
efree(args);
}
}
@@ -1046,10 +1068,11 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive
zend_hash_internal_pointer_reset_ex(target_hash, &pos);
/* Iterate through hash */
- while (zend_hash_get_current_data_ex(target_hash, (void **)&args[0], &pos) == SUCCESS) {
+ while (!EG(exception) && zend_hash_get_current_data_ex(target_hash, (void **)&args[0], &pos) == SUCCESS) {
if (recursive && Z_TYPE_PP(args[0]) == IS_ARRAY) {
HashTable *thash;
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]);
thash = HASH_OF(*(args[0]));
if (thash == target_hash) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
@@ -1093,7 +1116,6 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", func_name);
}
-
if (key) {
zval_ptr_dtor(&key);
key = NULL;
@@ -1160,7 +1182,7 @@ PHP_FUNCTION(array_walk_recursive)
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;
@@ -1373,6 +1395,10 @@ PHP_FUNCTION(extract)
/* break omitted intentionally */
case EXTR_OVERWRITE:
+ /* GLOBALS protection */
+ if (var_exists && !strcmp(var_name, "GLOBALS")) {
+ break;
+ }
smart_str_appendl(&final_name, var_name, var_name_len);
break;
@@ -1441,7 +1467,7 @@ PHP_FUNCTION(extract)
*data = **entry;
zval_copy_ctor(data);
- ZEND_SET_SYMBOL(EG(active_symbol_table), final_name.c, data);
+ ZEND_SET_SYMBOL_WITH_LENGTH(EG(active_symbol_table), final_name.c, final_name.len+1, data, 1, 0);
}
count++;
@@ -1531,7 +1557,7 @@ PHP_FUNCTION(array_fill)
case IS_DOUBLE:
/* allocate an array for return */
array_init(return_value);
-
+
if (PZVAL_IS_REF(*val)) {
SEPARATE_ZVAL(val);
}
@@ -1948,13 +1974,15 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end)
else
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(stack));
zend_hash_get_current_data(Z_ARRVAL_PP(stack), (void **)&val);
- *return_value = **val;
- zval_copy_ctor(return_value);
- INIT_PZVAL(return_value);
+ RETVAL_ZVAL(*val, 1, 0);
/* Delete the first or last value */
zend_hash_get_current_key_ex(Z_ARRVAL_PP(stack), &key, &key_len, &index, 0, NULL);
- zend_hash_del_key_or_index(Z_ARRVAL_PP(stack), key, key_len, index, (key) ? HASH_DEL_KEY : HASH_DEL_INDEX);
+ if (key && Z_ARRVAL_PP(stack) == &EG(symbol_table)) {
+ zend_delete_global_variable(key, key_len-1 TSRMLS_CC);
+ } else {
+ zend_hash_del_key_or_index(Z_ARRVAL_PP(stack), key, key_len, index, (key) ? HASH_DEL_KEY : HASH_DEL_INDEX);
+ }
/* If we did a shift... re-index like it did before */
if (!off_the_end) {
@@ -2037,6 +2065,9 @@ PHP_FUNCTION(array_unshift)
hashtable and replace it with new one */
new_hash = php_splice(Z_ARRVAL_P(stack), 0, 0, &args[1], argc-1, NULL);
zend_hash_destroy(Z_ARRVAL_P(stack));
+ if (Z_ARRVAL_P(stack) == &EG(symbol_table)) {
+ zend_reset_all_cv(&EG(symbol_table) TSRMLS_CC);
+ }
*Z_ARRVAL_P(stack) = *new_hash;
FREE_HASHTABLE(new_hash);
@@ -2114,6 +2145,9 @@ PHP_FUNCTION(array_splice)
/* Replace input array's hashtable with the new one */
zend_hash_destroy(Z_ARRVAL_P(array));
+ if (Z_ARRVAL_P(array) == &EG(symbol_table)) {
+ zend_reset_all_cv(&EG(symbol_table) TSRMLS_CC);
+ }
*Z_ARRVAL_P(array) = *new_hash;
FREE_HASHTABLE(new_hash);
@@ -2487,8 +2521,9 @@ PHP_FUNCTION(array_count_values)
Z_LVAL_PP(tmp)++;
}
} else if (Z_TYPE_PP(entry) == IS_STRING) {
- /* make sure our array does not end up with numeric string keys */
- if (is_numeric_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, NULL, 0) == IS_LONG) {
+ /* 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;
@@ -2620,8 +2655,7 @@ PHP_FUNCTION(array_pad)
do_pad = (input_size >= pad_size_abs) ? 0 : 1;
/* Copy the original array */
- *return_value = **input;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*input, 1, 0);
/* If no need to pad, no need to continue */
if (!do_pad) {
@@ -2648,6 +2682,9 @@ PHP_FUNCTION(array_pad)
/* Copy the result hash into return value */
zend_hash_destroy(Z_ARRVAL_P(return_value));
+ if (Z_ARRVAL_P(return_value) == &EG(symbol_table)) {
+ zend_reset_all_cv(&EG(symbol_table) TSRMLS_CC);
+ }
*Z_ARRVAL_P(return_value) = *new_hash;
FREE_HASHTABLE(new_hash);
@@ -2786,8 +2823,7 @@ PHP_FUNCTION(array_unique)
}
/* copy the argument array */
- *return_value = **array;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*array, 1, 0);
if (target_hash->nNumOfElements <= 1) { /* nothing to do */
return;
@@ -2819,7 +2855,11 @@ PHP_FUNCTION(array_unique)
p = cmpdata->b;
}
if (p->nKeyLength) {
- zend_hash_del(Z_ARRVAL_P(return_value), p->arKey, p->nKeyLength);
+ if (Z_ARRVAL_P(return_value) == &EG(symbol_table)) {
+ zend_delete_global_variable(p->arKey, p->nKeyLength-1 TSRMLS_CC);
+ } else {
+ zend_hash_del(Z_ARRVAL_P(return_value), p->arKey, p->nKeyLength);
+ }
} else {
zend_hash_index_del(Z_ARRVAL_P(return_value), p->h);
}
@@ -2886,12 +2926,16 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
return;
}
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
+ /*
+ INTERSECT_KEY is subset of INTERSECT_ASSOC. When having the former
+ no comparison of the data is done (part of INTERSECT_ASSOC)
+ */
intersect_key_compare_func = array_key_compare;
if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL
&&
key_compare_type == INTERSECT_COMP_KEY_INTERNAL) {
- /* array_intersect_assoc() */
+ /* array_intersect_assoc() or array_intersect_key() */
if (argc < 2) {
efree(args);
@@ -2922,7 +2966,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
} else if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL
&&
key_compare_type == INTERSECT_COMP_KEY_USER) {
- /* array_intersect_uassoc() */
+ /* array_intersect_uassoc() or array_intersect_ukey() */
if (argc < 3) {
efree(args);
@@ -2999,14 +3043,13 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
*list = NULL;
if (behavior == INTERSECT_NORMAL) {
zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket *), intersect_data_compare_func TSRMLS_CC);
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket *), intersect_key_compare_func TSRMLS_CC);
}
}
/* copy the argument array */
- *return_value = **args[0];
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*args[0], 1, 0);
if (return_value->value.ht == &EG(symbol_table)) {
HashTable *ht;
zval *tmp;
@@ -3017,14 +3060,14 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
return_value->value.ht = ht;
}
- if (behavior == INTERSECT_NORMAL && data_compare_type == INTERSECT_COMP_DATA_USER) {
+ if ((behavior & INTERSECT_NORMAL) && data_compare_type == INTERSECT_COMP_DATA_USER) {
/* array_uintersect() */
BG(user_compare_func_name) = args[arr_argc];
}
/* go through the lists and look for common values */
while (*ptrs[0]) {
- if (behavior == INTERSECT_ASSOC
+ if ((behavior & INTERSECT_ASSOC) /* triggered also when INTERSECT_KEY */
&&
key_compare_type == INTERSECT_COMP_KEY_USER) {
@@ -3032,16 +3075,22 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
}
for (i = 1; i < arr_argc; i++) {
- if (behavior == INTERSECT_NORMAL) {
+ if (behavior & INTERSECT_NORMAL) {
while (*ptrs[i] && (0 < (c = intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
ptrs[i]++;
}
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
while (*ptrs[i] && (0 < (c = intersect_key_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
ptrs[i]++;
}
- if (!c && *ptrs[i]) { /* this means that ptrs[i] is not NULL so we can compare */
- /* and "c==0" is from last operation */
+ if ((!c && *ptrs[i]) && (behavior == INTERSECT_ASSOC)) { /* only when INTERSECT_ASSOC */
+ /*
+ this means that ptrs[i] is not NULL so we can compare
+ and "c==0" is from last operation
+ in this branch of code we enter only when INTERSECT_ASSOC
+ since when we have INTERSECT_KEY compare of data is not
+ wanted.
+ */
if (data_compare_type == INTERSECT_COMP_DATA_USER) {
BG(user_compare_func_name) = args[arr_argc];
}
@@ -3049,7 +3098,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
c = 1;
if (key_compare_type == INTERSECT_COMP_KEY_USER) {
BG(user_compare_func_name) = args[argc - 1];
- /* When KEY_USER the last parameter is always the callback */
+ /* When KEY_USER, the last parameter is always the callback */
}
/* we are going to the break */
} else {
@@ -3094,7 +3143,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
if (0 <= intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)) {
break;
}
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
/* no need of looping because indexes are unique */
break;
}
@@ -3110,7 +3159,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
if (intersect_data_compare_func(ptrs[0]-1, ptrs[0] TSRMLS_CC)) {
break;
}
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
/* no need of looping because indexes are unique */
break;
}
@@ -3131,6 +3180,23 @@ out:
efree(args);
}
+/* {{{ proto array array_intersect_key(array arr1, array arr2 [, array ...])
+ 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(...)]). Equivalent of array_intersect_assoc() but does not do compare of the data. */
+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. */
+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 */
PHP_FUNCTION(array_intersect)
@@ -3245,12 +3311,16 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
return;
}
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior & DIFF_ASSOC) { /* triggered also if DIFF_KEY */
+ /*
+ DIFF_KEY is subset of DIFF_ASSOC. When having the former
+ no comparison of the data is done (part of DIFF_ASSOC)
+ */
diff_key_compare_func = array_key_compare;
if (data_compare_type == DIFF_COMP_DATA_INTERNAL
&&
key_compare_type == DIFF_COMP_KEY_INTERNAL) {
- /* array_diff_assoc() */
+ /* array_diff_assoc() or array_diff_key() */
if (argc < 2) {
efree(args);
@@ -3281,7 +3351,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
} else if (data_compare_type == DIFF_COMP_DATA_INTERNAL
&&
key_compare_type == DIFF_COMP_KEY_USER) {
- /* array_diff_uassoc() */
+ /* array_diff_uassoc() or array_diff_ukey() */
if (argc < 3) {
efree(args);
@@ -3358,14 +3428,13 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
*list = NULL;
if (behavior == DIFF_NORMAL) {
zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket *), diff_data_compare_func TSRMLS_CC);
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket *), diff_key_compare_func TSRMLS_CC);
}
}
/* copy the argument array */
- *return_value = **args[0];
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*args[0], 1, 0);
if (return_value->value.ht == &EG(symbol_table)) {
HashTable *ht;
zval *tmp;
@@ -3383,7 +3452,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
/* go through the lists and look for values of ptr[0] that are not in the others */
while (*ptrs[0]) {
- if (behavior == DIFF_ASSOC
+ if ((behavior & DIFF_ASSOC) /* triggered also when DIFF_KEY */
&&
key_compare_type == DIFF_COMP_KEY_USER) {
@@ -3395,7 +3464,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
while (*ptrs[i] && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
ptrs[i]++;
}
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
while (*ptrs[i] && (0 < (c = diff_key_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
ptrs[i]++;
}
@@ -3406,20 +3475,37 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
ptrs[i]++;
}
break;
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior == DIFF_ASSOC) { /* only when DIFF_ASSOC */
+ /*
+ In this branch is execute only when DIFF_ASSOC. If behavior == DIFF_KEY
+ data comparison is not needed - skipped.
+ */
if (*ptrs[i]) {
if (data_compare_type == DIFF_COMP_DATA_USER) {
BG(user_compare_func_name) = args[arr_argc];
}
if (diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC) != 0) {
+ /* the data is not the same */
c = -1;
if (key_compare_type == DIFF_COMP_KEY_USER) {
BG(user_compare_func_name) = args[argc - 1];
}
} else {
break;
+ /*
+ we have found the element in other arrays thus we don't want it
+ in the return_value -> delete from there
+ */
}
}
+ } else if (behavior == DIFF_KEY) { /* only when DIFF_KEY */
+ /*
+ the behavior here differs from INTERSECT_KEY in php_intersect
+ since in the "diff" case we have to remove the entry from
+ return_value while when doing intersection the entry must not
+ be deleted.
+ */
+ break; /* remove the key */
}
}
}
@@ -3440,7 +3526,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
if (diff_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) {
break;
}
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
/* in this case no array_key_compare is needed */
break;
}
@@ -3456,7 +3542,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
if (diff_data_compare_func(ptrs[0]-1, ptrs[0] TSRMLS_CC)) {
break;
}
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
/* in this case no array_key_compare is needed */
break;
}
@@ -3478,6 +3564,25 @@ out:
}
+/* {{{ proto array array_diff_key(array arr1, array arr2 [, array ...])
+ Returns the entries of arr1 that have keys which are not present in any of the others arguments. This function is like array_diff() but works on the keys instead of the values. The associativity is preserved. */
+PHP_FUNCTION(array_diff_key)
+{
+ php_array_diff(INTERNAL_FUNCTION_PARAM_PASSTHRU, DIFF_KEY,
+ DIFF_COMP_DATA_INTERNAL, DIFF_COMP_KEY_INTERNAL);
+}
+/* }}} */
+
+/* {{{ proto array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
+ Returns the entries of arr1 that have keys which are not present in any of the others arguments. User supplied function is used for comparing the keys. This function is like array_udiff() but works on the keys instead of the values. The associativity is preserved. */
+PHP_FUNCTION(array_diff_ukey)
+{
+ php_array_diff(INTERNAL_FUNCTION_PARAM_PASSTHRU, DIFF_KEY,
+ DIFF_COMP_DATA_INTERNAL, DIFF_COMP_KEY_USER);
+}
+/* }}} */
+
+
/* {{{ proto array array_diff(array arr1, array arr2 [, array ...])
Returns the entries of arr1 that have values which are not present in any of the others arguments. */
PHP_FUNCTION(array_diff)
@@ -3870,9 +3975,59 @@ PHP_FUNCTION(array_sum)
Z_DVAL_P(return_value) += Z_DVAL(entry_n);
}
}
+/* }}} */
+
+/* {{{ proto mixed array_product(array input)
+ Returns the product of the array entries */
+PHP_FUNCTION(array_product)
+{
+ zval **input,
+ **entry,
+ entry_n;
+ int argc = ZEND_NUM_ARGS();
+ HashPosition pos;
+ double dval;
+
+ if (argc != 1 || zend_get_parameters_ex(argc, &input) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ if (Z_TYPE_PP(input) != IS_ARRAY) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array");
+ return;
+ }
+
+ if (!zend_hash_num_elements(Z_ARRVAL_PP(input))) {
+ RETURN_LONG(0);
+ }
+ ZVAL_LONG(return_value, 1);
+
+ for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(input), &pos);
+ zend_hash_get_current_data_ex(Z_ARRVAL_PP(input), (void **)&entry, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(Z_ARRVAL_PP(input), &pos)) {
+
+ if (Z_TYPE_PP(entry) == IS_ARRAY || Z_TYPE_PP(entry) == IS_OBJECT)
+ continue;
+ entry_n = **entry;
+ zval_copy_ctor(&entry_n);
+ convert_scalar_to_number(&entry_n TSRMLS_CC);
+
+ if (Z_TYPE(entry_n) == IS_LONG && Z_TYPE_P(return_value) == IS_LONG) {
+ dval = (double)Z_LVAL_P(return_value) * (double)Z_LVAL(entry_n);
+ if ( (double)LONG_MIN <= dval && dval <= (double)LONG_MAX ) {
+ Z_LVAL_P(return_value) *= Z_LVAL(entry_n);
+ continue;
+ }
+ }
+ convert_to_double(return_value);
+ convert_to_double(&entry_n);
+ Z_DVAL_P(return_value) *= Z_DVAL(entry_n);
+ }
+}
/* }}} */
+
/* {{{ proto mixed array_reduce(array input, mixed callback [, int initial])
Iteratively reduce the array to a single value via the callback. */
PHP_FUNCTION(array_reduce)
@@ -3923,9 +4078,7 @@ PHP_FUNCTION(array_reduce)
if (zend_hash_num_elements(htbl) == 0) {
if (result) {
- *return_value = *result;
- zval_copy_ctor(return_value);
- zval_ptr_dtor(&result);
+ RETVAL_ZVAL(result, 1, 1);
}
return;
}
@@ -3963,9 +4116,7 @@ PHP_FUNCTION(array_reduce)
zend_hash_move_forward_ex(htbl, &pos);
}
- *return_value = *result;
- zval_copy_ctor(return_value);
- zval_ptr_dtor(&result);
+ RETVAL_ZVAL(result, 0, 1);
}
/* }}} */
@@ -3975,7 +4126,7 @@ PHP_FUNCTION(array_reduce)
PHP_FUNCTION(array_filter)
{
zval **input, **callback = NULL;
- zval *array;
+ zval *array, *func = NULL;
zval **operand;
zval **args[1];
zval *retval = NULL;
@@ -3995,10 +4146,13 @@ PHP_FUNCTION(array_filter)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array");
return;
}
+ if (callback) {
+ func = *callback;
+ }
array = *input;
if (ZEND_NUM_ARGS() > 1) {
- if (!zend_is_callable(*callback, 0, &callback_name)) {
+ if (!zend_is_callable(func, 0, &callback_name)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument, '%s', should be a valid callback", callback_name);
efree(callback_name);
return;
@@ -4015,14 +4169,14 @@ PHP_FUNCTION(array_filter)
zend_hash_get_current_data_ex(Z_ARRVAL_P(array), (void **)&operand, &pos) == SUCCESS;
zend_hash_move_forward_ex(Z_ARRVAL_P(array), &pos)) {
- if (callback) {
+ if (func) {
zend_fcall_info fci;
args[0] = operand;
fci.size = sizeof(fci);
fci.function_table = EG(function_table);
- fci.function_name = *callback;
+ fci.function_name = func;
fci.symbol_table = NULL;
fci.object_pp = NULL;
fci.retval_ptr_ptr = &retval;
@@ -4125,8 +4279,7 @@ PHP_FUNCTION(array_map)
/* Short-circuit: if no callback and only one array, just return it. */
if (Z_TYPE_P(callback) == IS_NULL && ZEND_NUM_ARGS() == 2) {
- *return_value = *args[1];
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(args[1], 1, 0);
efree(array_len);
efree(array_pos);
efree(args);
@@ -4347,17 +4500,16 @@ PHP_FUNCTION(array_combine)
return;
}
- if (zend_hash_num_elements(Z_ARRVAL_P(keys)) == 0 || zend_hash_num_elements(Z_ARRVAL_P(values)) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have at least 1 element");
+ 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");
RETURN_FALSE;
}
-
- 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");
+ if (!zend_hash_num_elements(Z_ARRVAL_P(keys))) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have at least 1 element");
RETURN_FALSE;
}
-
+
array_init(return_value);
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(keys), &pos_keys);
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index f5af4d192..bf23b9080 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: assert.c,v 1.59 2004/01/08 08:17:30 andi Exp $ */
+/* $Id: assert.c,v 1.60.2.1 2005/08/18 13:34:41 sniper Exp $ */
/* {{{ includes/startup/misc */
@@ -151,7 +151,7 @@ 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:\n%s", myeval);
+ 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. */
}
efree(compiled_string_description);
diff --git a/ext/standard/base64.c b/ext/standard/base64.c
index 92dab552e..ac8538712 100644
--- a/ext/standard/base64.c
+++ b/ext/standard/base64.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: base64.c,v 1.42 2004/03/06 19:06:04 iliaa Exp $ */
+/* $Id: base64.c,v 1.43.2.1 2005/08/26 03:32:31 iliaa Exp $ */
#include <string.h>
@@ -153,15 +153,6 @@ PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, in
while ((ch = *current++) != '\0' && length-- > 0) {
if (ch == base64_pad) break;
- /* When Base64 gets POSTed, all pluses are interpreted as spaces.
- This line changes them back. It's not exactly the Base64 spec,
- but it is completely compatible with it (the spec says that
- spaces are invalid). This will also save many people considerable
- headache. - Turadg Aleahmad <turadg@wise.berkeley.edu>
- */
-
- if (ch == ' ') ch = '+';
-
ch = base64_reverse_table[ch];
if (ch < 0) continue;
diff --git a/ext/standard/base64.h b/ext/standard/base64.h
index e911d9664..0838d822b 100644
--- a/ext/standard/base64.h
+++ b/ext/standard/base64.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: base64.h,v 1.13 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: base64.h,v 1.14 2005/08/03 14:07:56 sniper Exp $ */
#ifndef BASE64_H
#define BASE64_H
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index b9b687e5b..4be8f951c 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,14 +17,13 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.673.2.18 2005/08/21 18:36:33 zeev Exp $ */
+/* $Id: basic_functions.c,v 1.725.2.7 2005/11/20 18:07:27 sniper Exp $ */
#include "php.h"
#include "php_streams.h"
#include "php_main.h"
#include "php_globals.h"
#include "php_ini.h"
-#include "internal_functions_registry.h"
#include "php_standard.h"
#include "php_math.h"
#include "php_http.h"
@@ -51,7 +50,11 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
#include <time.h>
#include <stdio.h>
-#include <netdb.h>
+#ifdef NETWARE
+#include <netinet/in.h>
+#endif
+
+#include<netdb.h>
#if HAVE_ARPA_INET_H
# include <arpa/inet.h>
@@ -139,6 +142,10 @@ static
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;
@@ -163,29 +170,21 @@ function_entry basic_functions[] = {
PHP_FE(usleep, NULL)
#if HAVE_NANOSLEEP
PHP_FE(time_nanosleep, NULL)
+ PHP_FE(time_sleep_until, NULL)
#endif
- PHP_FE(time, NULL)
- PHP_FE(mktime, NULL)
- PHP_FE(gmmktime, NULL)
-#if HAVE_STRFTIME
- PHP_FE(strftime, NULL)
- PHP_FE(gmstrftime, NULL)
+#if HAVE_STRPTIME
+ PHP_FE(strptime, NULL)
#endif
- PHP_FE(strtotime, NULL)
- PHP_FE(date, NULL)
PHP_FE(idate, NULL)
- PHP_FE(gmdate, NULL)
- PHP_FE(getdate, NULL)
- PHP_FE(localtime, NULL)
- PHP_FE(checkdate, NULL)
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)
@@ -395,9 +394,7 @@ function_entry basic_functions[] = {
PHP_FE(log, NULL)
PHP_FE(log10, NULL)
PHP_FE(sqrt, NULL)
-#ifdef HAVE_HYPOT
PHP_FE(hypot, NULL)
-#endif
PHP_FE(deg2rad, NULL)
PHP_FE(rad2deg, NULL)
PHP_FE(bindec, NULL)
@@ -409,6 +406,12 @@ function_entry basic_functions[] = {
PHP_FE(base_convert, NULL)
PHP_FE(number_format, NULL)
PHP_FE(fmod, NULL)
+#ifdef HAVE_INET_NTOP
+ PHP_NAMED_FE(inet_ntop, php_inet_ntop, NULL)
+#endif
+#ifdef HAVE_INET_PTON
+ PHP_NAMED_FE(inet_pton, php_inet_pton, NULL)
+#endif
PHP_FE(ip2long, NULL)
PHP_FE(long2ip, NULL)
@@ -450,7 +453,7 @@ function_entry basic_functions[] = {
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(serialize, NULL)
PHP_FE(unserialize, NULL)
PHP_FE(var_dump, NULL)
@@ -580,17 +583,24 @@ function_entry basic_functions[] = {
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)
+#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)
@@ -604,6 +614,8 @@ function_entry basic_functions[] = {
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)
@@ -676,8 +688,10 @@ function_entry basic_functions[] = {
PHP_FE(is_link, NULL)
PHP_NAMED_FE(stat, php_if_stat, NULL)
PHP_NAMED_FE(lstat, php_if_lstat, NULL)
+#ifndef NETWARE
PHP_FE(chown, NULL)
PHP_FE(chgrp, NULL)
+#endif
PHP_FE(chmod, NULL)
#if HAVE_UTIME
PHP_FE(touch, NULL)
@@ -742,8 +756,8 @@ function_entry basic_functions[] = {
PHP_FE(prev, first_arg_force_ref)
PHP_FE(next, first_arg_force_ref)
PHP_FE(reset, first_arg_force_ref)
- PHP_FE(current, first_arg_force_ref)
- PHP_FE(key, 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)
@@ -752,7 +766,7 @@ function_entry basic_functions[] = {
PHP_FE(compact, NULL)
PHP_FE(array_fill, NULL)
PHP_FE(range, NULL)
- PHP_FE(array_multisort, 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)
@@ -772,23 +786,28 @@ function_entry basic_functions[] = {
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(array_combine, NULL)
+ PHP_FE(array_key_exists, NULL)
/* aliases from array.c */
PHP_FALIAS(pos, current, first_arg_force_ref)
@@ -934,6 +953,10 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC)
memset(&BG(url_adapt_state), 0, sizeof(BG(url_adapt_state)));
memset(&BG(url_adapt_state_ex), 0, sizeof(BG(url_adapt_state_ex)));
+
+#if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
+ memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)));
+#endif
BG(incomplete_class) = php_create_incomplete_class(TSRMLS_C);
}
@@ -997,7 +1020,7 @@ PHP_MINIT_FUNCTION(basic)
#else
basic_globals_ctor(&basic_globals TSRMLS_CC);
#ifdef PHP_WIN32
- php_win32_core_globals_ctor(&php_win32_core_globals TSRMLS_CC);
+ php_win32_core_globals_ctor(&the_php_win32_core_globals TSRMLS_CC);
#endif
#endif
@@ -1194,7 +1217,7 @@ PHP_RSHUTDOWN_FUNCTION(basic)
FG(stream_wrappers) and FG(stream_filters) are destroyed
during php_request_shutdown()
*/
-
+
PHP_RSHUTDOWN(filestat)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#ifdef HAVE_SYSLOG_H
PHP_RSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
@@ -1248,6 +1271,79 @@ PHP_FUNCTION(constant)
}
/* }}} */
+#ifdef HAVE_INET_NTOP
+/* {{{ proto string inet_ntop(string in_addr)
+ Converts a packed inet address to a human readable IP address string */
+PHP_NAMED_FUNCTION(php_inet_ntop)
+{
+ char *address;
+ int address_len, af = AF_INET;
+ char buffer[40];
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+#ifdef HAVE_IPV6
+ if (address_len == 16) {
+ af = AF_INET6;
+ } else
+#endif
+ if (address_len != 4) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid in_addr value");
+ RETURN_FALSE;
+ }
+
+ if (!inet_ntop(af, address, buffer, sizeof(buffer))) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occured");
+ RETURN_FALSE;
+ }
+
+ RETURN_STRING(buffer, 1);
+}
+/* }}} */
+#endif /* HAVE_INET_NTOP */
+
+#ifdef HAVE_INET_PTON
+/* {{{ proto string inet_pton(string ip_address)
+ Converts a human readable IP address to a packed binary string */
+PHP_NAMED_FUNCTION(php_inet_pton)
+{
+ int ret, af = AF_INET;
+ char *address;
+ int address_len;
+ char buffer[17];
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ memset(buffer, 0, sizeof(buffer));
+
+#ifdef HAVE_IPV6
+ if (strchr(address, ':')) {
+ af = AF_INET6;
+ } else
+#endif
+ if (!strchr(address, '.')) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
+ RETURN_FALSE;
+ }
+
+ ret = inet_pton(af, address, buffer);
+
+ if (ret <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
+ RETURN_FALSE;
+ }
+
+ RETURN_STRINGL(buffer, af == AF_INET ? 4 : 16, 1);
+}
+/* }}} */
+#endif /* HAVE_INET_PTON */
+
+
+
/* {{{ proto int ip2long(string ip_address)
Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address */
PHP_FUNCTION(ip2long)
@@ -1635,6 +1731,7 @@ PHP_FUNCTION(sleep)
#else
php_sleep(Z_LVAL_PP(num));
#endif
+
}
/* }}} */
@@ -1682,6 +1779,48 @@ PHP_FUNCTION(time_nanosleep)
RETURN_FALSE;
}
/* }}} */
+
+/* {{{ proto mixed time_sleep_until(float timestamp)
+ Make the script sleep until the specified time */
+PHP_FUNCTION(time_sleep_until)
+{
+ double d_ts, c_ts;
+ struct timeval tm;
+ struct timespec php_req, php_rem;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &d_ts)) {
+ WRONG_PARAM_COUNT;
+ }
+
+ if (gettimeofday((struct timeval *) &tm, NULL) != 0) {
+ RETURN_FALSE;
+ }
+
+ c_ts = (double)(d_ts - tm.tv_sec - tm.tv_usec / 1000000.00);
+ if (c_ts < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sleep until to time is less then current time.");
+ RETURN_FALSE;
+ }
+
+ php_req.tv_sec = (time_t) c_ts;
+ if (php_req.tv_sec > c_ts) { /* rounding up occurred */
+ php_req.tv_sec--;
+ }
+ /* 1sec = 1000000000 nanoseconds */
+ php_req.tv_nsec = (long) ((c_ts - php_req.tv_sec) * 1000000000.00);
+
+ while (nanosleep(&php_req, &php_rem)) {
+ if (errno == EINTR) {
+ php_req.tv_sec = php_rem.tv_sec;
+ php_req.tv_nsec = php_rem.tv_nsec;
+ } else {
+ RETURN_FALSE;
+ }
+ }
+
+ RETURN_TRUE;
+}
+/* }}} */
#endif
/* {{{ proto string get_current_user(void)
@@ -1890,7 +2029,7 @@ PHP_FUNCTION(call_user_func)
params = safe_emalloc(sizeof(zval **), argc, 0);
- if (zend_get_parameters_array_ex(argc, params) == FAILURE) {
+ if (zend_get_parameters_array_ex(1, params) == FAILURE) {
efree(params);
RETURN_FALSE;
}
@@ -1907,6 +2046,11 @@ PHP_FUNCTION(call_user_func)
RETURN_NULL();
}
+ if (zend_get_parameters_array_ex(argc, params) == FAILURE) {
+ efree(params);
+ RETURN_FALSE;
+ }
+
if (call_user_function_ex(EG(function_table), NULL, *params[0], &retval_ptr, argc-1, params+1, 0, NULL TSRMLS_CC) == SUCCESS) {
if (retval_ptr) {
COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
@@ -1964,13 +2108,17 @@ PHP_FUNCTION(call_user_func_array)
func_params_ht = Z_ARRVAL_PP(params);
count = zend_hash_num_elements(func_params_ht);
- func_params = safe_emalloc(sizeof(zval **), count, 0);
-
- for (zend_hash_internal_pointer_reset(func_params_ht);
- zend_hash_get_current_data(func_params_ht, (void **) &func_params[current]) == SUCCESS;
- zend_hash_move_forward(func_params_ht)
- ) {
- current++;
+ if (count) {
+ func_params = safe_emalloc(sizeof(zval **), count, 0);
+
+ for (zend_hash_internal_pointer_reset(func_params_ht);
+ zend_hash_get_current_data(func_params_ht, (void **) &func_params[current]) == SUCCESS;
+ zend_hash_move_forward(func_params_ht)
+ ) {
+ current++;
+ }
+ } else {
+ func_params = NULL;
}
if (call_user_function_ex(EG(function_table), NULL, *func, &retval_ptr, count, func_params, 0, NULL TSRMLS_CC) == SUCCESS) {
@@ -1982,7 +2130,9 @@ PHP_FUNCTION(call_user_func_array)
}
efree(name);
- efree(func_params);
+ if (func_params) {
+ efree(func_params);
+ }
}
/* }}} */
@@ -3076,13 +3226,27 @@ static int copy_request_variable(void *pDest, int num_args, va_list args, zend_h
prefix = va_arg(args, char *);
prefix_len = va_arg(args, uint);
- new_key_len = prefix_len + hash_key->nKeyLength;
- new_key = (char *) emalloc(new_key_len);
+ if (!prefix_len) {
+ if (!hash_key->nKeyLength) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric key detected - possible security hazard.");
+ return 0;
+ } else if (!strcmp(hash_key->arKey, "GLOBALS")) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempted GLOBALS variable overwrite.");
+ return 0;
+ }
+ }
+
+ if (hash_key->nKeyLength) {
+ new_key_len = prefix_len + hash_key->nKeyLength;
+ new_key = (char *) emalloc(new_key_len);
- memcpy(new_key, prefix, prefix_len);
- memcpy(new_key+prefix_len, hash_key->arKey, hash_key->nKeyLength);
+ memcpy(new_key, prefix, prefix_len);
+ memcpy(new_key+prefix_len, hash_key->arKey, hash_key->nKeyLength);
+ } else {
+ new_key_len = spprintf(&new_key, 0, "%s%ld", prefix, hash_key->h);
+ }
- zend_hash_del(&EG(symbol_table), new_key, new_key_len);
+ zend_delete_global_variable(new_key, new_key_len-1 TSRMLS_CC);
ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), new_key, new_key_len, *var, (*var)->refcount+1, 0);
efree(new_key);
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 655bdcc3a..0c22d294b 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.h,v 1.133.2.2 2005/08/21 18:36:34 zeev Exp $ */
+/* $Id: basic_functions.h,v 1.139 2005/08/03 14:07:57 sniper Exp $ */
#ifndef BASIC_FUNCTIONS_H
#define BASIC_FUNCTIONS_H
@@ -50,8 +50,15 @@ PHP_FUNCTION(sleep);
PHP_FUNCTION(usleep);
#if HAVE_NANOSLEEP
PHP_FUNCTION(time_nanosleep);
+PHP_FUNCTION(time_sleep_until);
#endif
PHP_FUNCTION(flush);
+#ifdef HAVE_INET_NTOP
+PHP_NAMED_FUNCTION(php_inet_ntop);
+#endif
+#ifdef HAVE_INET_PTON
+PHP_NAMED_FUNCTION(php_inet_pton);
+#endif
PHP_FUNCTION(ip2long);
PHP_FUNCTION(long2ip);
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 5f8f547a7..8f7138320 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: browscap.c,v 1.82.2.1 2005/01/25 22:00:14 andrei Exp $ */
+/* $Id: browscap.c,v 1.85 2005/08/03 14:07:57 sniper Exp $ */
#include "php.h"
#include "php_regex.h"
@@ -39,7 +39,7 @@ static void browscap_entry_dtor(zval **pvalue)
zend_hash_destroy(Z_ARRVAL_PP(pvalue));
free(Z_ARRVAL_PP(pvalue));
} else if (Z_TYPE_PP(pvalue) == IS_STRING) {
- if (Z_STRVAL_PP(pvalue) && Z_STRVAL_PP(pvalue) != empty_string) {
+ if (Z_STRVAL_PP(pvalue)) {
free(Z_STRVAL_PP(pvalue));
}
}
@@ -102,7 +102,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, int callback_type, vo
new_property = (zval *) malloc(sizeof(zval));
INIT_PZVAL(new_property);
- Z_STRVAL_P(new_property) = Z_STRLEN_P(arg2)?zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)):empty_string;
+ Z_STRVAL_P(new_property) = zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2));
Z_STRLEN_P(new_property) = Z_STRLEN_P(arg2);
Z_TYPE_P(new_property) = IS_STRING;
diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index 5dc678f33..ce27f4abb 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.75.2.1 2004/12/30 07:04:11 sniper Exp $ -*- sh -*-
+dnl $Id: config.m4,v 1.80.2.1 2005/11/21 23:08:02 sniper Exp $ -*- autoconf -*-
divert(3)dnl
@@ -67,6 +67,10 @@ AC_DEFUN([AC_CRYPT_CAP],[
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
AC_TRY_RUN([
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
@@ -94,6 +98,10 @@ main() {
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
AC_TRY_RUN([
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
@@ -121,6 +129,10 @@ main() {
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
AC_TRY_RUN([
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
@@ -160,6 +172,10 @@ main() {
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
AC_TRY_RUN([
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
@@ -200,7 +216,7 @@ AC_FLUSH_IO
divert(5)dnl
AC_ARG_WITH(regex,
-[ --with-regex=TYPE regex library type: system, apache, php. Default: php
+[ --with-regex=TYPE regex library type: system, apache, php. [TYPE=php]
WARNING: Do NOT use unless you know what you are doing!],
[
case $withval in
@@ -259,8 +275,12 @@ dnl
AC_MSG_CHECKING([whether rounding works as expected])
AC_TRY_RUN([
#include <math.h>
+ /* keep this out-of-line to prevent use of gcc inline floor() */
+ double somefn(double n) {
+ return floor(n*pow(10,2) + 0.5);
+ }
int main() {
- return floor(0.045*pow(10,2) + 0.5)/10.0 != 0.5;
+ return somefn(0.045)/10.0 != 0.5;
}
],[
PHP_ROUND_FUZZ=0.5
@@ -463,7 +483,7 @@ PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.
cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \
flock_compat.c formatted_print.c fsock.c head.c html.c image.c \
info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \
- microtime.c pack.c pageinfo.c parsedate.c quot_print.c rand.c \
+ microtime.c pack.c pageinfo.c quot_print.c rand.c \
reg.c soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \
url_scanner.c var.c versioning.c assert.c strnatcmp.c levenshtein.c \
incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
@@ -472,3 +492,6 @@ PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.
filters.c proc_open.c sunfuncs.c streamsfuncs.c http.c)
PHP_ADD_MAKEFILE_FRAGMENT
+
+PHP_INSTALL_HEADERS([ext/standard/])
+
diff --git a/ext/standard/config.w32 b/ext/standard/config.w32
index a57f23ef0..2d598906e 100644
--- a/ext/standard/config.w32
+++ b/ext/standard/config.w32
@@ -1,14 +1,16 @@
// vim:ft=javascript
-// $Id: config.w32,v 1.3 2003/12/06 16:04:33 wez Exp $
+// $Id: config.w32,v 1.4.2.1 2005/10/06 13:03:43 derick Exp $
ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", "");
AC_DEFINE("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR);
+CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_STANDARD", "ext/date/lib");
+
EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
crc32.c crypt.c cyr_convert.c datetime.c dir.c dl.c dns.c exec.c \
file.c filestat.c formatted_print.c fsock.c head.c html.c image.c \
info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c microtime.c \
- pack.c pageinfo.c parsedate.c quot_print.c rand.c reg.c soundex.c \
+ pack.c pageinfo.c quot_print.c rand.c reg.c soundex.c \
string.c scanf.c syslog.c type.c uniqid.c url.c url_scanner.c var.c \
versioning.c assert.c strnatcmp.c levenshtein.c incomplete_class.c \
url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c
index a07905254..55749d1fa 100644
--- a/ext/standard/crc32.c
+++ b/ext/standard/crc32.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: crc32.c,v 1.15 2004/01/08 08:17:30 andi Exp $ */
+/* $Id: crc32.c,v 1.16 2005/08/03 14:07:57 sniper Exp $ */
#include "php.h"
#include "basic_functions.h"
diff --git a/ext/standard/crc32.h b/ext/standard/crc32.h
index 664d775d8..4d72aa5cf 100644
--- a/ext/standard/crc32.h
+++ b/ext/standard/crc32.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: crc32.h,v 1.5 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: crc32.h,v 1.6 2005/08/03 14:07:57 sniper Exp $ */
/*
* This code implements the AUTODIN II polynomial
diff --git a/ext/standard/credits.c b/ext/standard/credits.c
index 2e489e99a..2a20a5a6a 100644
--- a/ext/standard/credits.c
+++ b/ext/standard/credits.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,10 +17,11 @@
+----------------------------------------------------------------------+
*/
-/* $Id: credits.c,v 1.32.2.1 2004/08/09 21:53:19 andi Exp $ */
+/* $Id: credits.c,v 1.36.2.2 2005/09/20 22:19:01 johannes Exp $ */
#include "php.h"
#include "info.h"
+#include "SAPI.h"
#define CREDIT_LINE(module, authors) php_info_print_table_row(2, module, authors)
@@ -28,11 +29,15 @@
*/
PHPAPI void php_print_credits(int flag TSRMLS_DC)
{
- if (flag & PHP_CREDITS_FULLPAGE) {
+ if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
php_print_info_htmlhead(TSRMLS_C);
}
- PUTS("<h1>PHP Credits</h1>\n");
+ if (!sapi_module.phpinfo_as_text) {
+ PUTS("<h1>PHP Credits</h1>\n");
+ } else {
+ PUTS("PHP Credits\n");
+ }
if (flag & PHP_CREDITS_GROUP) {
/* Group */
@@ -46,7 +51,11 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC)
if (flag & PHP_CREDITS_GENERAL) {
/* Design & Concept */
php_info_print_table_start();
- php_info_print_table_header(1, "Language Design &amp; Concept");
+ if (!sapi_module.phpinfo_as_text) {
+ php_info_print_table_header(1, "Language Design &amp; Concept");
+ } else {
+ php_info_print_table_header(1, "Language Design & Concept");
+ }
php_info_print_table_row(1, "Andi Gutmans, Rasmus Lerdorf, Zeev Suraski");
php_info_print_table_end();
@@ -57,9 +66,10 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC)
CREDIT_LINE("Zend Scripting Language Engine", "Andi Gutmans, Zeev Suraski");
CREDIT_LINE("Extension Module API", "Andi Gutmans, Zeev Suraski, Andrei Zmievski");
CREDIT_LINE("UNIX Build and Modularization", "Stig Bakken, Sascha Schumann");
- CREDIT_LINE("Win32 Port", "Shane Caraveo, Zeev Suraski");
+ CREDIT_LINE("Win32 Port", "Shane Caraveo, Zeev Suraski, Wez Furlong");
CREDIT_LINE("Server API (SAPI) Abstraction Layer", "Andi Gutmans, Shane Caraveo, Zeev Suraski");
- CREDIT_LINE("Streams Abstraction Layer", "Wez Furlong");
+ CREDIT_LINE("Streams Abstraction Layer", "Wez Furlong, Sara Golemon");
+ CREDIT_LINE("PHP Data Objects Layer", "Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle");
php_info_print_table_end();
}
@@ -95,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.0 Quality Assurance Team");
+ php_info_print_table_header(1, "PHP 5.1 Quality Assurance Team");
php_info_print_table_row(1, "Ilia Alshanetsky, Joerg Behrens, Stefan Esser, Moriyoshi Koizumi, Magnus Maatta, Sebastian Nohn, Derick Rethans, Melvyn Sopacua, Jani Taskinen");
php_info_print_table_end();
}
@@ -108,7 +118,7 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC)
php_info_print_table_end();
}
- if (flag & PHP_CREDITS_FULLPAGE) {
+ if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
PUTS("</div></body></html>\n");
}
}
diff --git a/ext/standard/credits.h b/ext/standard/credits.h
index 1ab92b1c7..f759e7063 100644
--- a/ext/standard/credits.h
+++ b/ext/standard/credits.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: credits.h,v 1.10 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: credits.h,v 1.11 2005/08/03 14:07:57 sniper Exp $ */
#ifndef CREDITS_H
#define CREDITS_H
diff --git a/ext/standard/credits_ext.h b/ext/standard/credits_ext.h
index aa2aa4f45..cf6b3b47e 100644
--- a/ext/standard/credits_ext.h
+++ b/ext/standard/credits_ext.h
@@ -15,18 +15,18 @@ CREDIT_LINE("BC Math", "Andi Gutmans");
CREDIT_LINE("Bzip2", "Sterling Hughes");
CREDIT_LINE("Calendar", "Shane Caraveo, Colin Viebrock, Hartmut Holzgraefe, Wez Furlong");
CREDIT_LINE("COM and .Net", "Wez Furlong");
-CREDIT_LINE("cpdf", "Uwe Steinmann");
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("dbx (database abstraction)", "Marc Boeren, Rui Hirokawa, Frank M. Kromann");
CREDIT_LINE("DOM", "Christian Stocker, Rob Richards, Marcus Boerger");
CREDIT_LINE("EXIF", "Rasmus Lerdorf, Marcus Boerger");
-CREDIT_LINE("fam", "Sascha Schumann");
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");
@@ -35,9 +35,7 @@ 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("Ingres II", "David Hénot");
CREDIT_LINE("InterBase", "Jouni Ahto, Andrew Avdeev, Ard Biesheuvel");
-CREDIT_LINE("IRCG", "Sascha Schumann");
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");
@@ -45,23 +43,26 @@ CREDIT_LINE("MCVE", "Brad House, Chris Faulhaber, Steven Schoch");
CREDIT_LINE("mhash", "Sascha Schumann");
CREDIT_LINE("mime_magic", "Hartmut Holzgraefe");
CREDIT_LINE("MING", "Dave Hayden, Frank M. Kromann");
-CREDIT_LINE("mnoGoSearch", "Sergey Kartashoff, Alex Barkov, Ramil Kalimullin");
CREDIT_LINE("MS SQL", "Frank M. Kromann");
CREDIT_LINE("msession", "Mark L. Woodward");
CREDIT_LINE("mSQL", "Zeev Suraski");
CREDIT_LINE("Multibyte String Functions", "Tsukada Takuya, Rui Hirokawa");
+CREDIT_LINE("mySQL 3.x driver for PDO", "George Schlossnagle");
CREDIT_LINE("MySQL", "Zeev Suraski, Zak Greant, Georg Richter");
CREDIT_LINE("MySQLi", "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");
+CREDIT_LINE("ODBC driver for PDO", "Wez Furlong");
CREDIT_LINE("ODBC", "Stig Bakken, Andreas Karajannis, Frank M. Kromann, Daniel R. Kalowsky");
CREDIT_LINE("OpenSSL", "Stig Venaas, Wez Furlong, Sascha Kettler");
-CREDIT_LINE("Oracle", "Stig Bakken, Mitch Golden, Rasmus Lerdorf, Andreas Karajannis, Thies C. Arntzen");
+CREDIT_LINE("Oracle (OCI) driver for PDO", "Wez Furlong");
CREDIT_LINE("Ovrimos", "Nikos Mavroyanopoulos");
CREDIT_LINE("pcntl", "Jason Greene");
CREDIT_LINE("Perl Compatible Regexps", "Andrei Zmievski");
+CREDIT_LINE("PHP Data Objects", "Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle");
CREDIT_LINE("Posix", "Kristian Köhntopp");
-CREDIT_LINE("PostgreSQL", "Jouni Ahto, Zeev Suraski, Yasuo Ohgaki");
+CREDIT_LINE("PostgreSQL driver for PDO", "Edin Kadribasic, Ilia Alshanetsky");
+CREDIT_LINE("PostgreSQL", "Jouni Ahto, Zeev Suraski, Yasuo Ohgaki, Chris Kings-Lynne");
CREDIT_LINE("Pspell", "Vlad Krupin");
CREDIT_LINE("Readline", "Thies C. Arntzen");
CREDIT_LINE("Recode", "Kristian Köhntopp");
@@ -72,6 +73,7 @@ CREDIT_LINE("SNMP", "Rasmus Lerdorf, Harrie Hazewinkel, Mike Jackson, Steven Law
CREDIT_LINE("SOAP", "Brad Lafountain, Shane Caraveo, Dmitry Stogov");
CREDIT_LINE("Sockets", "Chris Vandomelen, Sterling Hughes, Daniel Beulshausen, Jason Greene");
CREDIT_LINE("SPL", "Marcus Boerger");
+CREDIT_LINE("SQLite 3.x driver for PDO", "Wez Furlong");
CREDIT_LINE("SQLite", "Wez Furlong, Tal Peer, Marcus Boerger, Ilia Alshanetsky");
CREDIT_LINE("Sybase-CT", "Zeev Suraski, Tom May, Timm Friebe");
CREDIT_LINE("Sybase-DB", "Zeev Suraski");
@@ -81,10 +83,9 @@ CREDIT_LINE("System V Shared Memory", "Christian Cartus");
CREDIT_LINE("tidy", "John Coggeshall, Ilia Alshanetsky");
CREDIT_LINE("tokenizer", "Andrei Zmievski");
CREDIT_LINE("Verisign Payflow Pro", "John Donagher, David Croft");
-CREDIT_LINE("W32API", "James Moore");
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("XSL", "Christian Stocker, Rob Richards");
-CREDIT_LINE("Yellow Pages", "Stephanie Wehner, Fredrik Ohrn");
CREDIT_LINE("Zlib", "Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti");
diff --git a/ext/standard/credits_sapi.h b/ext/standard/credits_sapi.h
index e91957141..cc15c006f 100644
--- a/ext/standard/credits_sapi.h
+++ b/ext/standard/credits_sapi.h
@@ -17,7 +17,7 @@ CREDIT_LINE("Apache 2.0 Filter", "Sascha Schumann, Aaron Bannert");
CREDIT_LINE("Apache 2.0 Handler", "Ian Holsman, Justin Erenkrantz (based on Apache 2.0 Filter code)");
CREDIT_LINE("Caudium / Roxen", "David Hedbor");
CREDIT_LINE("CGI / FastCGI", "Rasmus Lerdorf, Stig Bakken, Shane Caraveo");
-CREDIT_LINE("CLI", "Edin Kadribasic, Marcus Boerger");
+CREDIT_LINE("CLI", "Edin Kadribasic, Marcus Boerger, Johannes Schlueter");
CREDIT_LINE("Continuity", "Alex Leigh (based on nsapi code)");
CREDIT_LINE("Embed", "Edin Kadribasic");
CREDIT_LINE("ISAPI", "Andi Gutmans, Zeev Suraski");
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 47a5b907e..60bda687e 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Rasmus Lerdorf <rasmus@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: crypt.c,v 1.61 2004/02/12 19:05:41 ssb Exp $ */
+/* $Id: crypt.c,v 1.62 2005/08/03 14:07:57 sniper Exp $ */
#include <stdlib.h>
#include "php.h"
diff --git a/ext/standard/css.c b/ext/standard/css.c
index 07351e4d9..0751747f9 100644
--- a/ext/standard/css.c
+++ b/ext/standard/css.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: css.c,v 1.12 2004/01/08 08:17:30 andi Exp $ */
+/* $Id: css.c,v 1.13 2005/08/03 14:07:57 sniper Exp $ */
#include "php.h"
#include "info.h"
diff --git a/ext/standard/css.h b/ext/standard/css.h
index b14033acc..e7db50f43 100644
--- a/ext/standard/css.h
+++ b/ext/standard/css.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: css.h,v 1.5 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: css.h,v 1.6 2005/08/03 14:07:57 sniper Exp $ */
#ifndef CSS_H
#define CSS_H
diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c
index 226585541..ea50ea639 100644
--- a/ext/standard/cyr_convert.c
+++ b/ext/standard/cyr_convert.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: cyr_convert.c,v 1.26 2004/01/08 08:17:30 andi Exp $ */
+/* $Id: cyr_convert.c,v 1.27 2005/08/03 14:07:57 sniper Exp $ */
#include <stdlib.h>
diff --git a/ext/standard/cyr_convert.h b/ext/standard/cyr_convert.h
index d9317cf6c..143bf8132 100644
--- a/ext/standard/cyr_convert.h
+++ b/ext/standard/cyr_convert.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: cyr_convert.h,v 1.10 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: cyr_convert.h,v 1.11 2005/08/03 14:07:57 sniper Exp $ */
#ifndef CYR_CONVERT_H
#define CYR_CONVERT_H
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index ee7bd4903..bfd1aaa16 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,11 @@
+----------------------------------------------------------------------+
*/
-/* $Id: datetime.c,v 1.121.2.6 2005/08/30 09:15:58 derick Exp $ */
+/* $Id: datetime.c,v 1.134 2005/08/03 14:07:57 sniper Exp $ */
+
+#if HAVE_STRPTIME
+#define _XOPEN_SOURCE
+#endif
#include "php.h"
#include "zend_operators.h"
@@ -31,8 +35,6 @@
#endif
#include <stdio.h>
-#include "php_parsedate.h"
-
char *mon_full_names[] = {
"January", "February", "March", "April",
"May", "June", "July", "August",
@@ -67,631 +69,9 @@ static int phpday_tab[2][12] = {
#define isleap(year) ((((year) % 4) == 0 && ((year) % 100) != 0) || ((year) % 400)==0)
#define YEAR_BASE 1900
-/* {{{ proto int time(void)
- Return current UNIX timestamp */
-PHP_FUNCTION(time)
-{
- RETURN_LONG((long)time(NULL));
-}
-/* }}} */
-
-/* {{{ php_mktime
- */
-void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm)
-{
- pval **arguments[7];
- struct tm *ta, tmbuf;
- time_t t, seconds;
- int i, gmadjust, arg_count = ZEND_NUM_ARGS();
- int is_dst = -1, chgsecs = 0;
- long val;
-
- if (arg_count > 7 || zend_get_parameters_array_ex(arg_count, arguments) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- /* convert supplied arguments to longs */
- for (i = 0; i < arg_count; i++) {
- convert_to_long_ex(arguments[i]);
- }
- t = time(NULL);
-#ifdef HAVE_TZSET
- tzset();
-#endif
- /*
- ** Set default time parameters with local time values,
- ** EVEN when some GMT time parameters are specified!
- ** This may give strange result, with PHP gmmktime(0, 0, 0),
- ** which is assumed to return GMT midnight time
- ** for today (in localtime), so that the result time may be
- ** AFTER or BEFORE the current time.
- ** May be we should initialize tn using gmtime(), so that
- ** default parameters for PHP gmmktime would be the current
- ** GMT time values...
- */
- ta = php_localtime_r(&t, &tmbuf);
-
- /* Let DST be unknown. mktime() should compute the right value
- ** and behave correctly. Unless the user overrides this.
- */
- ta->tm_isdst = -1;
-
- /*
- ** Now change date values with supplied parameters.
- */
- switch(arg_count) {
- case 7: /* daylight saving time flag */
-#ifdef PHP_WIN32
- if (daylight > 0) {
- ta->tm_isdst = is_dst = Z_LVAL_PP(arguments[6]);
- } else {
- ta->tm_isdst = is_dst = 0;
- }
-#else
- ta->tm_isdst = is_dst = Z_LVAL_PP(arguments[6]);
-#endif
- /* fall-through */
- case 6: /* year */
- /* special case:
- a zero in year, month and day is considered illegal
- as it would be interpreted as 30.11.1999 otherwise
- */
- if ( ( Z_LVAL_PP(arguments[5])==0)
- &&(Z_LVAL_PP(arguments[4])==0)
- &&(Z_LVAL_PP(arguments[3])==0)
- ) {
- RETURN_LONG(-1);
- }
-
- /*
- ** Accept parameter in range 0..1000 interpreted as 1900..2900
- ** (if 100 is given, it means year 2000)
- ** or in range 1001..9999 interpreted as is (this will store
- ** negative tm_year for years in range 1001..1899)
- ** This function is then Y2K ready, and accepts a wide range of
- ** dates including the whole gregorian calendar.
- ** But it cannot represent ancestral dates prior to year 1001.
- ** Additionally, input parameters of 0..70 are mapped to 100..170
- */
- if (Z_LVAL_PP(arguments[5]) < 70)
- ta->tm_year = Z_LVAL_PP(arguments[5]) + 100;
- else
- ta->tm_year = Z_LVAL_PP(arguments[5])
- - ((Z_LVAL_PP(arguments[5]) > 1000) ? 1900 : 0);
- /* fall-through */
- case 5: /* day in month (1-based) */
- val = (*arguments[4])->value.lval;
- if (val < 1) {
- chgsecs += (1-val) * 60*60*24;
- val = 1;
- }
- ta->tm_mday = val;
- /* fall-through */
- case 4: /* month (zero-based) */
- val = (*arguments[3])->value.lval - 1;
- while (val < 0) {
- val += 12; ta->tm_year--;
- }
- ta->tm_mon = val;
- /* fall-through */
- case 3: /* second */
- val = (*arguments[2])->value.lval;
- if (val < 1) {
- chgsecs += (1-val); val = 1;
- }
- ta->tm_sec = val;
- /* fall-through */
- case 2: /* minute */
- val = (*arguments[1])->value.lval;
- if (val < 1) {
- chgsecs += (1-val) * 60; val = 1;
- }
- ta->tm_min = val;
- /* fall-through */
- case 1: /* hour */
- val = (*arguments[0])->value.lval;
- /*
- We avoid midnight and a couple of hours after midnight here to work around
- various OS-level bugs in mktime and specifically daylight savings time issues
- in many mktime implementation.
- See bugs #27533 and #27719 for more info.
- */
- if (val < 4) {
- chgsecs += (4-val) * 60*60; val = 4;
- }
- ta->tm_hour = val;
- /* fall-through */
- case 0:
- break;
- }
-
- t = mktime(ta);
-
-#ifdef PHP_WIN32
- if (t - chgsecs < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows does not support negative values for this function");
- RETURN_LONG(-1);
- }
-#endif
-
- seconds = t - chgsecs;
-
- /*
- Here we check to see if the chgsecs fuzz factor we applied caused us to
- move from dst to non-dst or vice-versa. If so we adjust accordingly to
- avoid being off by an hour on the dst changeover date.
- */
- if (is_dst == -1) {
- struct tm t1, t2;
- t1 = *localtime(&t);
- t2 = *localtime(&seconds);
-
- if (t1.tm_isdst != t2.tm_isdst) {
- seconds += (t1.tm_isdst == 1) ? 3600 : -3600;
- ta = localtime(&seconds);
- }
-
- /*
- If the user didn't specify whether the timestamp passed in was dst or not
- then we fill it in based on the dst setting at the evaluated timestamp
- at the current TZ
- */
- is_dst = ta->tm_isdst;
- }
-
- if (gm) {
-#if HAVE_TM_GMTOFF
- /*
- ** mktime(ta) very nicely just filled ta->tm_gmtoff with
- ** the exactly right value for adjustment if we want GMT.
- */
- gmadjust = ta->tm_gmtoff;
-#else
- /*
- ** If correcting for daylight savings time, we set the adjustment to
- ** the value of timezone - 3600 seconds.
- */
-#ifdef __CYGWIN__
- gmadjust = -(is_dst ? _timezone - 3600 : _timezone);
-#else
- gmadjust = -(is_dst ? timezone - 3600 : timezone);
-#endif
-#endif
- seconds += gmadjust;
- }
-
- RETURN_LONG(seconds);
-}
-/* }}} */
-
-/* {{{ proto int mktime(int hour, int min, int sec, int mon, int day, int year)
- Get UNIX timestamp for a date */
-PHP_FUNCTION(mktime)
-{
- php_mktime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
-}
-/* }}} */
-
-/* {{{ proto int gmmktime(int hour, int min, int sec, int mon, int day, int year)
- Get UNIX timestamp for a GMT date */
-PHP_FUNCTION(gmmktime)
-{
- php_mktime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
-}
-/* }}} */
-
-/* {{{ php_date
- */
-static void php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
-{
- pval **format, **timestamp;
- time_t the_time;
- struct tm *ta, tmbuf;
- int i, size = 0, length, h, beat, fd, wd, yd, wk;
- char tmp_buff[32];
-#if !HAVE_TM_GMTOFF
- long tzone;
- char *tname[2]= {"GMT Standard Time", "BST"};
-#endif
-
- switch(ZEND_NUM_ARGS()) {
- case 1:
- if (zend_get_parameters_ex(1, &format) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- the_time = time(NULL);
- break;
- case 2:
- if (zend_get_parameters_ex(2, &format, &timestamp) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_long_ex(timestamp);
- the_time = Z_LVAL_PP(timestamp);
-#ifdef PHP_WIN32
- if (the_time < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows does not support dates prior to midnight (00:00:00), January 1, 1970");
- RETURN_FALSE;
- }
-#endif
- break;
- default:
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(format);
-
- if (gm) {
- ta = php_gmtime_r(&the_time, &tmbuf);
-#if !HAVE_TM_GMTOFF
- tzone = 0;
-#endif
- } else {
- ta = php_localtime_r(&the_time, &tmbuf);
-#if !HAVE_TM_GMTOFF
-#ifdef __CYGWIN__
- tzone = _timezone;
-#else
- tzone = timezone;
-#endif
- if (tzname[0] != NULL) {
- tname[0] = tzname[0];
- } else {
- tname[0] = "???";
- }
-
- if (tzname[1] != NULL) {
- tname[1] = tzname[1];
- }
-#endif
- }
-
- if (!ta) { /* that really shouldn't happen... */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected error");
- RETURN_FALSE;
- }
- for (i = 0; i < Z_STRLEN_PP(format); i++) {
- switch (Z_STRVAL_PP(format)[i]) {
- case 'r': /* rfc822 format */
- size += 31;
- break;
- case 'c': /* iso8601 date (Dublin Core Date) */
- size += 25;
- break;
- case 'U': /* seconds since the epoch */
- size += 10;
- break;
- case 'F': /* month, textual, full */
- case 'l': /* day (of the week), textual */
- size += 28;
- break;
- case 'T': /* timezone name */
-#if HAVE_TM_ZONE
- size += strlen(ta->tm_zone);
-#elif HAVE_TZNAME
- if (ta->tm_isdst > 0 ) {
- size += strlen(tname[1]);
- } else {
- size += strlen(tname[0]);
- }
-#endif
- break;
- case 'Z': /* timezone offset in seconds */
- size += 6;
- break;
- case 'O': /* GMT offset in [+-]HHMM format */
- size += 5;
- break;
- case 'Y': /* year, numeric, 4 digits */
- size += 4;
- break;
- case 'M': /* month, textual, 3 letters */
- case 'D': /* day, textual, 3 letters */
- case 'z': /* day of the year, 1 to 366 */
- case 'B': /* Swatch Beat, 3 digits */
- size += 3;
- break;
- case 'y': /* year, numeric, 2 digits */
- case 'm': /* month, numeric */
- case 'n': /* month, numeric, no leading zeroes */
- case 'd': /* day of the month, numeric */
- case 'j': /* day of the month, numeric, no leading zeros */
- case 'H': /* hour, numeric, 24 hour format */
- case 'h': /* hour, numeric, 12 hour format */
- case 'G': /* hour, numeric, 24 hour format, no leading zeroes */
- case 'g': /* hour, numeric, 12 hour format, no leading zeroes */
- case 'i': /* minutes, numeric */
- case 's': /* seconds, numeric */
- case 'A': /* AM/PM */
- case 'a': /* am/pm */
- case 'S': /* standard english suffix for the day of the month (e.g. 3rd, 2nd, etc) */
- case 't': /* days in current month */
- case 'W': /* ISO-8601 week number of year, weeks starting on Monday */
- size += 2;
- break;
- case '\\':
- if (i < Z_STRLEN_PP(format) - 1) {
- i++;
- }
- size ++;
- break;
- case 'L': /* boolean for leap year */
- case 'w': /* day of the week, numeric */
- case 'I': /* DST? */
- default:
- size++;
- break;
- }
- }
-
- Z_STRVAL_P(return_value) = (char *) emalloc(size + 1);
- Z_STRVAL_P(return_value)[0] = '\0';
-
- for (i = 0; i < Z_STRLEN_PP(format); i++) {
- switch (Z_STRVAL_PP(format)[i]) {
- case '\\':
- if (i < Z_STRLEN_PP(format) - 1) {
- char ch[2];
- ch[0]=Z_STRVAL_PP(format)[i + 1];
- ch[1]='\0';
- strcat(Z_STRVAL_P(return_value), ch);
- i++;
- }
- break;
- case 'U': /* seconds since the epoch */
- sprintf(tmp_buff, "%ld", (long)the_time); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'F': /* month, textual, full */
- strcat(Z_STRVAL_P(return_value), mon_full_names[ta->tm_mon]);
- break;
- case 'l': /* day (of the week), textual, full */
- strcat(Z_STRVAL_P(return_value), day_full_names[ta->tm_wday]);
- break;
- case 'Y': /* year, numeric, 4 digits */
- sprintf(tmp_buff, "%d", ta->tm_year + YEAR_BASE); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'M': /* month, textual, 3 letters */
- strcat(Z_STRVAL_P(return_value), mon_short_names[ta->tm_mon]);
- break;
- case 'D': /* day (of the week), textual, 3 letters */
- strcat(Z_STRVAL_P(return_value), day_short_names[ta->tm_wday]);
- break;
- case 'z': /* day (of the year) */
- sprintf(tmp_buff, "%d", ta->tm_yday); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'y': /* year, numeric, 2 digits */
- sprintf(tmp_buff, "%02d", ((ta->tm_year)%100)); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'm': /* month, numeric */
- sprintf(tmp_buff, "%02d", ta->tm_mon + 1); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'n': /* month, numeric, no leading zeros */
- sprintf(tmp_buff, "%d", ta->tm_mon + 1); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'd': /* day of the month, numeric */
- sprintf(tmp_buff, "%02d", ta->tm_mday); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'j':
- sprintf(tmp_buff, "%d", ta->tm_mday); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'H': /* hour, numeric, 24 hour format */
- sprintf(tmp_buff, "%02d", ta->tm_hour); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'h': /* hour, numeric, 12 hour format */
- h = ta->tm_hour % 12; if (h==0) h = 12;
- sprintf(tmp_buff, "%02d", h); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'G': /* hour, numeric, 24 hour format, no leading zeros */
- sprintf(tmp_buff, "%d", ta->tm_hour); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'g': /* hour, numeric, 12 hour format, no leading zeros */
- h = ta->tm_hour % 12; if (h==0) h = 12;
- sprintf(tmp_buff, "%d", h); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'i': /* minutes, numeric */
- sprintf(tmp_buff, "%02d", ta->tm_min); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 's': /* seconds, numeric */
- sprintf(tmp_buff, "%02d", ta->tm_sec); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'A': /* AM/PM */
- strcat(Z_STRVAL_P(return_value), (ta->tm_hour >= 12 ? "PM" : "AM"));
- break;
- case 'a': /* am/pm */
- strcat(Z_STRVAL_P(return_value), (ta->tm_hour >= 12 ? "pm" : "am"));
- break;
- case 'S': /* standard english suffix, e.g. 2nd/3rd for the day of the month */
- if (ta->tm_mday >= 10 && ta->tm_mday <= 19) {
- strcat(Z_STRVAL_P(return_value), "th");
- } else {
- switch (ta->tm_mday % 10) {
- case 1:
- strcat(Z_STRVAL_P(return_value), "st");
- break;
- case 2:
- strcat(Z_STRVAL_P(return_value), "nd");
- break;
- case 3:
- strcat(Z_STRVAL_P(return_value), "rd");
- break;
- default:
- strcat(Z_STRVAL_P(return_value), "th");
- break;
- }
- }
- break;
- case 't': /* days in current month */
- sprintf(tmp_buff, "%2d", phpday_tab[isleap((ta->tm_year+YEAR_BASE))][ta->tm_mon] );
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'w': /* day of the week, numeric EXTENSION */
- sprintf(tmp_buff, "%01d", ta->tm_wday); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'O': /* GMT offset in [+-]HHMM format */
-#if HAVE_TM_GMTOFF
- sprintf(tmp_buff, "%c%02d%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 ));
-#else
- sprintf(tmp_buff, "%c%02d%02d", ((ta->tm_isdst ? tzone - 3600:tzone)>0)?'-':'+', abs((ta->tm_isdst ? tzone - 3600 : tzone) / 3600), abs(((ta->tm_isdst ? tzone - 3600 : tzone) % 3600) / 60));
-#endif
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'Z': /* timezone offset in seconds */
-#if HAVE_TM_GMTOFF
- sprintf(tmp_buff, "%ld", ta->tm_gmtoff);
-#else
- sprintf(tmp_buff, "%ld", ta->tm_isdst ? -(tzone- 3600) : -tzone);
-#endif
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'L': /* boolean for leapyear */
- sprintf(tmp_buff, "%d", (isleap((ta->tm_year+YEAR_BASE)) ? 1 : 0 ) );
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'T': /* timezone name */
-#if HAVE_TM_ZONE
- strcat(Z_STRVAL_P(return_value), ta->tm_zone);
-#elif HAVE_TZNAME
- strcat(Z_STRVAL_P(return_value), ta->tm_isdst ? tname[1] : tname[0]);
-#endif
- break;
- case 'B': /* Swatch Beat a.k.a. Internet Time */
- beat = (((((long)the_time)-(((long)the_time) -
- ((((long)the_time) % 86400) + 3600))) * 10) / 864);
- while (beat < 0) {
- beat += 1000;
- }
- beat = beat % 1000;
- sprintf(tmp_buff, "%03d", beat); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'I':
- sprintf(tmp_buff, "%d", ta->tm_isdst);
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'r':
-#if HAVE_TM_GMTOFF
- sprintf(tmp_buff, "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d",
- day_short_names[ta->tm_wday],
- ta->tm_mday,
- mon_short_names[ta->tm_mon],
- ta->tm_year + YEAR_BASE,
- ta->tm_hour,
- ta->tm_min,
- ta->tm_sec,
- (ta->tm_gmtoff < 0) ? '-' : '+',
- abs(ta->tm_gmtoff / 3600),
- abs( (ta->tm_gmtoff % 3600) / 60 )
- );
-#else
- sprintf(tmp_buff, "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d",
- day_short_names[ta->tm_wday],
- ta->tm_mday,
- mon_short_names[ta->tm_mon],
- ta->tm_year + YEAR_BASE,
- ta->tm_hour,
- ta->tm_min,
- ta->tm_sec,
- ((ta->tm_isdst ? tzone - 3600 : tzone) > 0) ? '-' : '+',
- abs((ta->tm_isdst ? tzone - 3600 : tzone) / 3600),
- abs( ((ta->tm_isdst ? tzone - 3600 : tzone) % 3600) / 60 )
- );
-#endif
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'c':
-#if HAVE_TM_GMTOFF
- sprintf(tmp_buff, "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
- ta->tm_year + YEAR_BASE,
- ta->tm_mon + 1,
- ta->tm_mday,
- ta->tm_hour,
- ta->tm_min,
- ta->tm_sec,
- (ta->tm_gmtoff < 0) ? '-' : '+',
- abs(ta->tm_gmtoff / 3600),
- abs( (ta->tm_gmtoff % 3600) / 60 )
- );
-#else
- sprintf(tmp_buff, "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
- ta->tm_year + YEAR_BASE,
- ta->tm_mon + 1,
- ta->tm_mday,
- ta->tm_hour,
- ta->tm_min,
- ta->tm_sec,
- ((ta->tm_isdst ? tzone - 3600 : tzone) > 0) ? '-' : '+',
- abs((ta->tm_isdst ? tzone - 3600 : tzone) / 3600),
- abs( ((ta->tm_isdst ? tzone - 3600 : tzone) % 3600) / 60 )
- );
-#endif
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
- case 'W': /* ISO-8601 week number of year, weeks starting on Monday */
- wd = ta->tm_wday == 0 ? 6 : ta->tm_wday - 1; /* weekday */
- yd = ta->tm_yday + 1; /* days since January 1st */
-
- fd = (7 + wd - yd % 7+ 1) % 7; /* weekday (1st January) */
-
- /* week is a last year week (52 or 53) */
- if ((yd <= 7 - fd) && fd > 3){
- wk = (fd == 4 || (fd == 5 && isleap((ta->tm_year + YEAR_BASE - 1)))) ? 53 : 52;
- }
- /* week is a next year week (1) */
- else if (isleap((ta->tm_year+YEAR_BASE)) + 365 - yd < 3 - wd){
- wk = 1;
- }
- /* normal week */
- else {
- wk = (yd + 6 - wd + fd) / 7 - (fd > 3);
- }
-
- sprintf(tmp_buff, "%02d", wk); /* SAFE */
- strcat(Z_STRVAL_P(return_value), tmp_buff);
- break;
-
- default:
- length = strlen(Z_STRVAL_P(return_value));
- Z_STRVAL_P(return_value)[length] = Z_STRVAL_PP(format)[i];
- Z_STRVAL_P(return_value)[length + 1] = '\0';
- break;
- }
- }
- Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
- Z_TYPE_P(return_value) = IS_STRING;
-}
-/* }}} */
-
-/* {{{ proto string date(string format [, int timestamp])
- Format a local time/date */
-PHP_FUNCTION(date)
-{
- php_date(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
-}
-/* }}} */
-
-/* {{{ proto string gmdate(string format [, int timestamp])
- Format a GMT/UTC date/time */
-PHP_FUNCTION(gmdate)
-{
- php_date(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
-}
-/* }}} */
-
/* {{{ php_idate
*/
-int php_idate(char format, int timestamp, int gm)
+PHPAPI int php_idate(char format, int timestamp, int gm)
{
time_t the_time;
struct tm *ta, tmbuf;
@@ -830,114 +210,9 @@ PHP_FUNCTION(idate)
}
/* }}} */
-/* {{{ proto array localtime([int timestamp [, bool associative_array]])
- Returns the results of the C system call localtime as an associative array if the associative_array argument is set to 1 other wise it is a regular array */
-PHP_FUNCTION(localtime)
-{
- zval **timestamp_arg, **assoc_array_arg;
- struct tm *ta, tmbuf;
- time_t timestamp;
- int assoc_array = 0;
- int arg_count = ZEND_NUM_ARGS();
-
- if (arg_count < 0 || arg_count > 2 ||
- zend_get_parameters_ex(arg_count, &timestamp_arg, &assoc_array_arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- switch (arg_count) {
- case 0:
- timestamp = (long)time(NULL);
- break;
- case 1:
- convert_to_long_ex(timestamp_arg);
- timestamp = Z_LVAL_PP(timestamp_arg);
- break;
- case 2:
- convert_to_long_ex(timestamp_arg);
- convert_to_long_ex(assoc_array_arg);
- timestamp = Z_LVAL_PP(timestamp_arg);
- assoc_array = Z_LVAL_PP(assoc_array_arg);
- break;
- }
-
-#ifdef PHP_WIN32
- if (timestamp < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows does not support negative values for this function");
- RETURN_FALSE
- }
-#endif
-
- if (NULL == (ta = php_localtime_r(&timestamp, &tmbuf))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid local time");
- RETURN_FALSE;
- }
- array_init(return_value);
-
- if (assoc_array) {
- add_assoc_long(return_value, "tm_sec", ta->tm_sec);
- add_assoc_long(return_value, "tm_min", ta->tm_min);
- add_assoc_long(return_value, "tm_hour", ta->tm_hour);
- add_assoc_long(return_value, "tm_mday", ta->tm_mday);
- add_assoc_long(return_value, "tm_mon", ta->tm_mon);
- add_assoc_long(return_value, "tm_year", ta->tm_year);
- add_assoc_long(return_value, "tm_wday", ta->tm_wday);
- add_assoc_long(return_value, "tm_yday", ta->tm_yday);
- add_assoc_long(return_value, "tm_isdst", ta->tm_isdst);
- } else {
- add_next_index_long(return_value, ta->tm_sec);
- add_next_index_long(return_value, ta->tm_min);
- add_next_index_long(return_value, ta->tm_hour);
- add_next_index_long(return_value, ta->tm_mday);
- add_next_index_long(return_value, ta->tm_mon);
- add_next_index_long(return_value, ta->tm_year);
- add_next_index_long(return_value, ta->tm_wday);
- add_next_index_long(return_value, ta->tm_yday);
- add_next_index_long(return_value, ta->tm_isdst);
- }
-}
-/* }}} */
-
-/* {{{ proto array getdate([int timestamp])
- Get date/time information */
-PHP_FUNCTION(getdate)
-{
- pval **timestamp_arg;
- struct tm *ta, tmbuf;
- time_t timestamp;
-
- if (ZEND_NUM_ARGS() == 0) {
- timestamp = time(NULL);
- } else if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &timestamp_arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- } else {
- convert_to_long_ex(timestamp_arg);
- timestamp = Z_LVAL_PP(timestamp_arg);
- }
-
- ta = php_localtime_r(&timestamp, &tmbuf);
- if (!ta) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot perform date calculation");
- return;
- }
- array_init(return_value);
- add_assoc_long(return_value, "seconds", ta->tm_sec);
- add_assoc_long(return_value, "minutes", ta->tm_min);
- add_assoc_long(return_value, "hours", ta->tm_hour);
- add_assoc_long(return_value, "mday", ta->tm_mday);
- add_assoc_long(return_value, "wday", ta->tm_wday);
- add_assoc_long(return_value, "mon", ta->tm_mon + 1);
- add_assoc_long(return_value, "year", ta->tm_year + 1900);
- add_assoc_long(return_value, "yday", ta->tm_yday);
- add_assoc_string(return_value, "weekday", day_full_names[ta->tm_wday], 1);
- add_assoc_string(return_value, "month", mon_full_names[ta->tm_mon], 1);
- add_index_long(return_value, 0, timestamp);
-}
-/* }}} */
-
/* {{{ php_std_date
Return date string in standard format for http headers */
-char *php_std_date(time_t t TSRMLS_DC)
+PHPAPI char *php_std_date(time_t t TSRMLS_DC)
{
struct tm *tm1, tmbuf;
char *str;
@@ -965,136 +240,43 @@ char *php_std_date(time_t t TSRMLS_DC)
}
/* }}} */
-/* {{{ proto bool checkdate(int month, int day, int year)
- Returns true(1) if it is a valid date in gregorian calendar */
-PHP_FUNCTION(checkdate)
-{
- long m, d, y;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &m, &d, &y) == FAILURE) {
- RETURN_FALSE;
- }
- if (y < 1 || y > 32767 || m < 1 || m > 12 || d < 1 || d > phpday_tab[isleap(y)][m - 1]) {
- RETURN_FALSE;
- }
- RETURN_TRUE; /* True : This month, day, year arguments are valid */
-}
-/* }}} */
-
-#if HAVE_STRFTIME
-/* {{{ _php_strftime
- */
-void _php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm)
+#if HAVE_STRPTIME
+/* {{{ proto string strptime(string timestamp, string format)
+ Parse a time/date generated with strftime() */
+PHP_FUNCTION(strptime)
{
- pval **format_arg, **timestamp_arg;
- char *format, *buf;
- time_t timestamp;
- struct tm *ta, tmbuf;
- int max_reallocs = 5;
- size_t buf_len=64, real_len;
-
- switch (ZEND_NUM_ARGS()) {
- case 1:
- if (zend_get_parameters_ex(1, &format_arg)==FAILURE) {
- RETURN_FALSE;
- }
- time(&timestamp);
- break;
- case 2:
- if (zend_get_parameters_ex(2, &format_arg, &timestamp_arg)==FAILURE) {
- RETURN_FALSE;
- }
- convert_to_long_ex(timestamp_arg);
- timestamp = Z_LVAL_PP(timestamp_arg);
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
+ char *ts;
+ int ts_length;
+ char *format;
+ int format_length;
+ struct tm parsed_time;
+ char *unparsed_part;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ &ts, &ts_length, &format, &format_length) == FAILURE) {
+ return;
}
- convert_to_string_ex(format_arg);
- if (Z_STRLEN_PP(format_arg)==0) {
+ unparsed_part = strptime(ts, format, &parsed_time);
+ if (unparsed_part == NULL) {
RETURN_FALSE;
}
-#ifdef PHP_WIN32
- if (timestamp < 0) {
- RETURN_FALSE;
- }
-#endif
- format = Z_STRVAL_PP(format_arg);
- if (gm) {
- ta = php_gmtime_r(&timestamp, &tmbuf);
- } else {
- ta = php_localtime_r(&timestamp, &tmbuf);
- }
- buf = (char *) emalloc(buf_len);
- while ((real_len=strftime(buf, buf_len, format, ta))==buf_len || real_len==0) {
- buf_len *= 2;
- buf = (char *) erealloc(buf, buf_len);
- if (!--max_reallocs) {
- break;
- }
- }
-
- if (real_len && real_len != buf_len) {
- buf = (char *) erealloc(buf, real_len + 1);
- RETURN_STRINGL(buf, real_len, 0);
- }
- efree(buf);
- RETURN_FALSE;
-}
-/* }}} */
-
-/* {{{ proto string strftime(string format [, int timestamp])
- Format a local time/date according to locale settings */
-PHP_FUNCTION(strftime)
-{
- _php_strftime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
-}
-/* }}} */
-
-/* {{{ proto string gmstrftime(string format [, int timestamp])
- Format a GMT/UCT time/date according to locale settings */
-PHP_FUNCTION(gmstrftime)
-{
- _php_strftime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+ array_init(return_value);
+ add_assoc_long(return_value, "tm_sec", parsed_time.tm_sec);
+ add_assoc_long(return_value, "tm_min", parsed_time.tm_min);
+ add_assoc_long(return_value, "tm_hour", parsed_time.tm_hour);
+ add_assoc_long(return_value, "tm_mday", parsed_time.tm_mday);
+ add_assoc_long(return_value, "tm_mon", parsed_time.tm_mon);
+ add_assoc_long(return_value, "tm_year", parsed_time.tm_year);
+ add_assoc_long(return_value, "tm_wday", parsed_time.tm_wday);
+ add_assoc_long(return_value, "tm_yday", parsed_time.tm_yday);
+ add_assoc_string(return_value, "unparsed", unparsed_part, 1);
}
/* }}} */
-
#endif
-/* {{{ proto int strtotime(string time, int now)
- Convert string representation of date and time to a timestamp */
-PHP_FUNCTION(strtotime)
-{
- zval **z_time, **z_now;
- int argc;
- time_t now;
-
- argc = ZEND_NUM_ARGS();
-
- if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &z_time, &z_now)==FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(z_time);
- if (!Z_STRLEN_PP(z_time)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Called with an empty time parameter.");
- RETURN_LONG(-1);
- }
- if (argc == 2) {
- convert_to_long_ex(z_now);
- now = Z_LVAL_PP(z_now);
- RETURN_LONG(php_parse_date(Z_STRVAL_PP(z_time), &now));
- } else {
- RETURN_LONG(php_parse_date(Z_STRVAL_PP(z_time), NULL));
- }
-}
-/* }}} */
-
-
/*
* Local variables:
* tab-width: 4
diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h
index 04e3455ba..81a69eec7 100644
--- a/ext/standard/datetime.h
+++ b/ext/standard/datetime.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,31 +17,21 @@
+----------------------------------------------------------------------+
*/
-/* $Id: datetime.h,v 1.16 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: datetime.h,v 1.23 2005/08/03 14:07:58 sniper Exp $ */
#ifndef DATETIME_H
#define DATETIME_H
PHP_FUNCTION(time);
-PHP_FUNCTION(mktime);
-PHP_FUNCTION(gmmktime);
-PHP_FUNCTION(date);
PHP_FUNCTION(idate);
-PHP_FUNCTION(gmdate);
PHP_FUNCTION(localtime);
PHP_FUNCTION(getdate);
PHP_FUNCTION(checkdate);
-#if HAVE_STRFTIME
-PHP_FUNCTION(strftime);
-PHP_FUNCTION(gmstrftime);
-#endif
-PHP_FUNCTION(strtotime);
+#if HAVE_STRPTIME
+PHP_FUNCTION(strptime);
+#endif
-int php_idate(char format, int timestamp, int gm);
-extern char *php_std_date(time_t t TSRMLS_DC);
-void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm);
-#if HAVE_STRFTIME
-void _php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);
-#endif
+PHPAPI int php_idate(char format, int timestamp, int gm);
+PHPAPI char *php_std_date(time_t t TSRMLS_DC);
#endif /* DATETIME_H */
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 99b0ffb4b..1fec2afc2 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: dir.c,v 1.141.2.2 2005/02/23 18:53:19 iliaa Exp $ */
+/* $Id: dir.c,v 1.147 2005/08/03 14:07:58 sniper Exp $ */
/* {{{ includes/startup/misc */
@@ -155,6 +155,9 @@ PHP_MINIT_FUNCTION(dir)
#ifdef GLOB_NOESCAPE
REGISTER_LONG_CONSTANT("GLOB_NOESCAPE", GLOB_NOESCAPE, CONST_CS | CONST_PERSISTENT);
#endif
+#ifdef GLOB_ERR
+ REGISTER_LONG_CONSTANT("GLOB_ERR", GLOB_ERR, CONST_CS | CONST_PERSISTENT);
+#endif
#ifndef GLOB_ONLYDIR
#define GLOB_ONLYDIR (1<<30)
@@ -395,16 +398,16 @@ PHP_FUNCTION(glob)
if (0 != (ret = glob(pattern, flags & GLOB_FLAGMASK, NULL, &globbuf))) {
#ifdef GLOB_NOMATCH
if (GLOB_NOMATCH == ret) {
- /* Linux handles no matches as an error condition, but FreeBSD
- * doesn't. This ensure that if no match is found, an empty array
- * is always returned so it can be used without worrying in e.g.
- * foreach() */
-#ifndef __linux__
- RETURN_FALSE;
-#else
+ /* Some glob implementation simply return no data if no matches
+ were found, others return the GLOB_NOMATCH error code.
+ We don't want to treat GLOB_NOMATCH as an error condition
+ so that PHP glob() behaves the same on both types of
+ implementations and so that 'foreach (glob() as ...'
+ can be used for simple glob() calls without further error
+ checking.
+ */
array_init(return_value);
return;
-#endif
}
#endif
RETURN_FALSE;
@@ -428,7 +431,7 @@ PHP_FUNCTION(glob)
array_init(return_value);
for (n = 0; n < globbuf.gl_pathc; n++) {
- /* we need to this everytime since GLOB_ONLYDIR does not guarantee that
+ /* we need to do this everytime since GLOB_ONLYDIR does not guarantee that
* all directories will be filtered. GNU libc documentation states the
* following:
* If the information about the type of the file is easily available
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index 5b66413f9..3c5f59ca6 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,12 +18,14 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dl.c,v 1.96.2.3 2005/05/04 13:48:01 hyanantha Exp $ */
+/* $Id: dl.c,v 1.106 2005/08/08 16:49:43 sniper Exp $ */
#include "php.h"
#include "dl.h"
#include "php_globals.h"
+#include "php_ini.h"
#include "ext/standard/info.h"
+
#include "SAPI.h"
#if defined(HAVE_LIBDL) || HAVE_MACH_O_DYLD_H
@@ -39,6 +41,9 @@
#include "win32/param.h"
#include "win32/winutil.h"
#define GET_DL_ERROR() php_win_err()
+#elif defined(NETWARE)
+#include <sys/param.h>
+#define GET_DL_ERROR() dlerror()
#else
#include <sys/param.h>
#define GET_DL_ERROR() DL_ERROR()
@@ -51,7 +56,7 @@
Load a PHP extension at runtime */
PHP_FUNCTION(dl)
{
- pval **file;
+ zval **file;
/* obtain arguments */
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) {
@@ -60,24 +65,27 @@ PHP_FUNCTION(dl)
convert_to_string_ex(file);
-#ifdef ZTS
+ if (!PG(enable_dl)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't enabled");
+ RETURN_FALSE;
+ } else if (PG(safe_mode)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't allowed when running in Safe Mode");
+ RETURN_FALSE;
+ }
+
if ((strncmp(sapi_module.name, "cgi", 3)!=0) &&
(strcmp(sapi_module.name, "cli")!=0) &&
(strncmp(sapi_module.name, "embed", 5)!=0)) {
+#ifdef ZTS
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", Z_STRVAL_PP(file));
RETURN_FALSE;
- }
+#else
+ php_error_docref(NULL TSRMLS_CC, E_STRICT, "dl() is deprecated - use extension=%s in your php.ini", Z_STRVAL_PP(file));
#endif
-
- if (!PG(enable_dl)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't enabled");
- } else if (PG(safe_mode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't allowed when running in Safe Mode");
- } else {
- zend_error(E_STRICT, "dl() is deprecated - use extension=%s in your php.ini", Z_STRVAL_PP(file));
- php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC);
- EG(full_tables_cleanup) = 1;
}
+
+ php_dl(*file, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC);
+ EG(full_tables_cleanup) = 1;
}
/* }}} */
@@ -93,7 +101,7 @@ PHP_FUNCTION(dl)
/* {{{ php_dl
*/
-void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
+void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC)
{
void *handle;
char *libpath;
@@ -102,16 +110,13 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
int error_type;
char *extension_dir;
- if (type==MODULE_PERSISTENT) {
- /* Use the configuration hash directly, the INI mechanism is not yet initialized */
- if (cfg_get_string("extension_dir", &extension_dir)==FAILURE) {
- extension_dir = PHP_EXTENSION_DIR;
- }
+ if (type == MODULE_PERSISTENT) {
+ extension_dir = INI_STR("extension_dir");
} else {
extension_dir = PG(extension_dir);
}
- if (type==MODULE_TEMPORARY) {
+ if (type == MODULE_TEMPORARY) {
error_type = E_WARNING;
} else {
error_type = E_CORE_WARNING;
@@ -212,20 +217,24 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
module_entry->type = type;
module_entry->module_number = zend_next_free_module();
module_entry->handle = handle;
-
- if (zend_register_module_ex(module_entry TSRMLS_CC) == FAILURE) {
+
+ if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == NULL) {
+ DL_UNLOAD(handle);
+ RETURN_FALSE;
+ }
+
+ if ((type == MODULE_TEMPORARY || start_now) && zend_startup_module_ex(module_entry TSRMLS_CC) == FAILURE) {
DL_UNLOAD(handle);
RETURN_FALSE;
}
- if ((type == MODULE_TEMPORARY) && module_entry->request_startup_func) {
- if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC)) {
+ if ((type == MODULE_TEMPORARY || start_now) && module_entry->request_startup_func) {
+ if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, error_type, "Unable to initialize module '%s'", module_entry->name);
DL_UNLOAD(handle);
RETURN_FALSE;
}
}
-
RETURN_TRUE;
}
/* }}} */
@@ -237,7 +246,7 @@ PHP_MINFO_FUNCTION(dl)
#else
-void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
+void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC)
{
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", Z_STRVAL_P(file));
RETURN_FALSE;
diff --git a/ext/standard/dl.h b/ext/standard/dl.h
index ab99543d8..a69d44e5c 100644
--- a/ext/standard/dl.h
+++ b/ext/standard/dl.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,13 +18,12 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dl.h,v 1.19 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: dl.h,v 1.23 2005/08/08 16:49:43 sniper Exp $ */
#ifndef DL_H
#define DL_H
-void php_dl(pval *file,int type,pval *return_value TSRMLS_DC);
-
+PHPAPI void php_dl(zval *file,int type, zval *return_value, int start_now TSRMLS_DC);
/* dynamic loading functions */
PHP_FUNCTION(dl);
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 75bd2bba9..bb10b509f 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dns.c,v 1.68 2004/03/19 22:21:53 pollita Exp $ */
+/* $Id: dns.c,v 1.70.2.5 2005/10/25 14:57:14 tony2001 Exp $ */
/* {{{ includes */
#include "php.h"
@@ -69,6 +69,51 @@
#endif
#include "dns.h"
+
+/* type compat */
+#ifndef DNS_T_A
+#define DNS_T_A 1
+#endif
+#ifndef DNS_T_NS
+#define DNS_T_NS 2
+#endif
+#ifndef DNS_T_CNAME
+#define DNS_T_CNAME 5
+#endif
+#ifndef DNS_T_SOA
+#define DNS_T_SOA 6
+#endif
+#ifndef DNS_T_PTR
+#define DNS_T_PTR 12
+#endif
+#ifndef DNS_T_HINFO
+#define DNS_T_HINFO 13
+#endif
+#ifndef DNS_T_MINFO
+#define DNS_T_MINFO 14
+#endif
+#ifndef DNS_T_MX
+#define DNS_T_MX 15
+#endif
+#ifndef DNS_T_TXT
+#define DNS_T_TXT 16
+#endif
+#ifndef DNS_T_AAAA
+#define DNS_T_AAAA 28
+#endif
+#ifndef DNS_T_SRV
+#define DNS_T_SRV 33
+#endif
+#ifndef DNS_T_NAPTR
+#define DNS_T_NAPTR 35
+#endif
+#ifndef DNS_T_A6
+#define DNS_T_A6 38
+#endif
+
+#ifndef DNS_T_ANY
+#define DNS_T_ANY 255
+#endif
/* }}} */
static char *php_gethostbyaddr(char *ip);
@@ -229,21 +274,16 @@ PHP_FUNCTION(dns_check_record)
convert_to_string_ex(arg2);
if (!strcasecmp("A", Z_STRVAL_PP(arg2))) type = T_A;
- else if (!strcasecmp("NS", Z_STRVAL_PP(arg2))) type = T_NS;
- else if (!strcasecmp("MX", Z_STRVAL_PP(arg2))) type = T_MX;
- else if (!strcasecmp("PTR", Z_STRVAL_PP(arg2))) type = T_PTR;
- else if (!strcasecmp("ANY", Z_STRVAL_PP(arg2))) type = T_ANY;
- else if (!strcasecmp("SOA", Z_STRVAL_PP(arg2))) type = T_SOA;
- else if (!strcasecmp("CNAME", Z_STRVAL_PP(arg2))) type = T_CNAME;
-#ifdef T_AAAA
- else if (!strcasecmp("AAAA", Z_STRVAL_PP(arg2))) type = T_AAAA;
-#endif
-#ifdef T_SRV
- else if (!strcasecmp("SRV", Z_STRVAL_PP(arg2))) type = T_SRV;
-#endif
-#ifdef T_NAPTR
- else if (!strcasecmp("NAPTR", Z_STRVAL_PP(arg2))) type = T_NAPTR;
-#endif
+ else if (!strcasecmp("NS", Z_STRVAL_PP(arg2))) type = DNS_T_NS;
+ else if (!strcasecmp("MX", Z_STRVAL_PP(arg2))) type = DNS_T_MX;
+ else if (!strcasecmp("PTR", Z_STRVAL_PP(arg2))) type = DNS_T_PTR;
+ else if (!strcasecmp("ANY", Z_STRVAL_PP(arg2))) type = DNS_T_ANY;
+ else if (!strcasecmp("SOA", Z_STRVAL_PP(arg2))) type = DNS_T_SOA;
+ else if (!strcasecmp("CNAME", Z_STRVAL_PP(arg2))) type = DNS_T_CNAME;
+ else if (!strcasecmp("AAAA", Z_STRVAL_PP(arg2))) type = DNS_T_AAAA;
+ else if (!strcasecmp("SRV", Z_STRVAL_PP(arg2))) type = DNS_T_SRV;
+ else if (!strcasecmp("NAPTR", Z_STRVAL_PP(arg2))) type = DNS_T_NAPTR;
+ else if (!strcasecmp("A6", Z_STRVAL_PP(arg2))) type = DNS_T_A6;
else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%s' not supported", Z_STRVAL_PP(arg2));
RETURN_FALSE;
@@ -266,7 +306,7 @@ PHP_FUNCTION(dns_check_record)
#if HAVE_DNS_FUNCS
-#define PHP_DNS_NUM_TYPES 11 /* Number of DNS Types Supported by PHP currently */
+#define PHP_DNS_NUM_TYPES 12 /* Number of DNS Types Supported by PHP currently */
#define PHP_DNS_A 0x00000001
#define PHP_DNS_NS 0x00000002
@@ -276,11 +316,12 @@ PHP_FUNCTION(dns_check_record)
#define PHP_DNS_HINFO 0x00001000
#define PHP_DNS_MX 0x00004000
#define PHP_DNS_TXT 0x00008000
+#define PHP_DNS_A6 0x01000000
#define PHP_DNS_SRV 0x02000000
#define PHP_DNS_NAPTR 0x04000000
#define PHP_DNS_AAAA 0x08000000
#define PHP_DNS_ANY 0x10000000
-#define PHP_DNS_ALL (PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_AAAA)
+#define PHP_DNS_ALL (PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_AAAA)
PHP_MINIT_FUNCTION(dns) {
REGISTER_LONG_CONSTANT("DNS_A", PHP_DNS_A, CONST_CS | CONST_PERSISTENT);
@@ -294,6 +335,7 @@ PHP_MINIT_FUNCTION(dns) {
REGISTER_LONG_CONSTANT("DNS_SRV", PHP_DNS_SRV, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DNS_NAPTR", PHP_DNS_NAPTR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DNS_AAAA", PHP_DNS_AAAA, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("DNS_A6", PHP_DNS_A6, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DNS_ANY", PHP_DNS_ANY, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DNS_ALL", PHP_DNS_ALL, CONST_CS | CONST_PERSISTENT);
return SUCCESS;
@@ -307,9 +349,8 @@ PHP_MINIT_FUNCTION(dns) {
#define QFIXEDSZ 4 /* fixed data in query <arpa/nameser.h> */
#endif /* QFIXEDSZ */
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 256
-#endif /* MAXHOSTNAMELEN */
+#undef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 1024
#ifndef MAXRESOURCERECORDS
#define MAXRESOURCERECORDS 64
@@ -320,6 +361,27 @@ typedef union {
u_char qb2[65536];
} querybuf;
+/* just a hack to free resources allocated by glibc in __res_nsend()
+ * See also:
+ * res_thread_freeres() in glibc/resolv/res_init.c
+ * __libc_res_nsend() in resolv/res_send.c
+ * */
+
+#ifdef __GLIBC__
+#define php_dns_free_res(__res__) _php_dns_free_res(__res__)
+static void _php_dns_free_res(struct __res_state res) { /* {{{ */
+ int ns;
+ for (ns = 0; ns < MAXNS; ns++) {
+ if (res._u._ext.nsaddrs[ns] != NULL) {
+ free (res._u._ext.nsaddrs[ns]);
+ res._u._ext.nsaddrs[ns] = NULL;
+ }
+ }
+} /* }}} */
+#else
+#define php_dns_free_res(__res__)
+#endif
+
/* {{{ php_parserr */
static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int store, zval **subarray)
{
@@ -327,10 +389,13 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
u_long ttl;
long n, i;
u_short s;
- u_char *tp;
+ u_char *tp, *p;
char name[MAXHOSTNAMELEN];
+ int have_v6_break = 0, in_v6_break = 0;
+
+ *subarray = NULL;
- n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof(name)) - 2);
+ n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, sizeof(name) - 2);
if (n < 0) {
return NULL;
}
@@ -341,13 +406,11 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
GETLONG(ttl, cp);
GETSHORT(dlen, cp);
if (type_to_fetch != T_ANY && type != type_to_fetch) {
- *subarray = NULL;
cp += dlen;
return cp;
}
if (!store) {
- *subarray = NULL;
cp += dlen;
return cp;
}
@@ -357,27 +420,27 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
add_assoc_string(*subarray, "host", name, 1);
switch (type) {
- case T_A:
+ case DNS_T_A:
add_assoc_string(*subarray, "type", "A", 1);
sprintf(name, "%d.%d.%d.%d", cp[0], cp[1], cp[2], cp[3]);
add_assoc_string(*subarray, "ip", name, 1);
cp += dlen;
break;
- case T_MX:
+ case DNS_T_MX:
add_assoc_string(*subarray, "type", "MX", 1);
GETSHORT(n, cp);
add_assoc_long(*subarray, "pri", n);
/* no break; */
- case T_CNAME:
- if (type == T_CNAME)
+ case DNS_T_CNAME:
+ if (type == DNS_T_CNAME)
add_assoc_string(*subarray, "type", "CNAME", 1);
/* no break; */
- case T_NS:
- if (type == T_NS)
+ case DNS_T_NS:
+ if (type == DNS_T_NS)
add_assoc_string(*subarray, "type", "NS", 1);
/* no break; */
- case T_PTR:
- if (type == T_PTR)
+ case DNS_T_PTR:
+ if (type == DNS_T_PTR)
add_assoc_string(*subarray, "type", "PTR", 1);
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
if (n < 0) {
@@ -386,7 +449,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
cp += n;
add_assoc_string(*subarray, "target", name, 1);
break;
- case T_HINFO:
+ case DNS_T_HINFO:
/* See RFC 1010 for values */
add_assoc_string(*subarray, "type", "HINFO", 1);
n = *cp & 0xFF;
@@ -398,7 +461,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
add_assoc_stringl(*subarray, "os", cp, n, 1);
cp += n;
break;
- case T_TXT:
+ case DNS_T_TXT:
add_assoc_string(*subarray, "type", "TXT", 1);
n = cp[0];
tp = emalloc(n + 1);
@@ -407,7 +470,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
cp += dlen;
add_assoc_stringl(*subarray, "txt", tp, n, 0);
break;
- case T_SOA:
+ case DNS_T_SOA:
add_assoc_string(*subarray, "type", "SOA", 1);
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) -2);
if (n < 0) {
@@ -432,35 +495,115 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
GETLONG(n, cp);
add_assoc_long(*subarray, "minimum-ttl", n);
break;
-
-#ifdef T_AAAA
- case T_AAAA:
+ case DNS_T_AAAA:
tp = name;
for(i=0; i < 8; i++) {
GETSHORT(s, cp);
- if (s > 0) {
+ if (s != 0) {
if (tp > (u_char *)name) {
+ in_v6_break = 0;
tp[0] = ':';
tp++;
}
- sprintf(tp,"%x",s);
- tp += strlen(tp);
- } else if (s == 0) {
- if ((tp > (u_char *)name) && (tp[-1] != ':')) {
+ tp += sprintf(tp,"%x",s);
+ } else {
+ if (!have_v6_break) {
+ have_v6_break = 1;
+ in_v6_break = 1;
+ tp[0] = ':';
+ tp++;
+ } else if (!in_v6_break) {
tp[0] = ':';
tp++;
+ tp[0] = '0';
+ tp++;
}
}
}
- if ((tp > (u_char *)name) && (tp[-1] == ':'))
- tp[-1] = '\0';
+ if (have_v6_break && in_v6_break) {
+ tp[0] = ':';
+ tp++;
+ }
tp[0] = '\0';
add_assoc_string(*subarray, "type", "AAAA", 1);
add_assoc_string(*subarray, "ipv6", name, 1);
+ break;
+ case DNS_T_A6:
+ p = cp;
+ add_assoc_string(*subarray, "type", "A6", 1);
+ n = ((int)cp[0]) & 0xFF;
+ cp++;
+ add_assoc_long(*subarray, "masklen", n);
+ tp = name;
+ if (n > 15) {
+ have_v6_break = 1;
+ in_v6_break = 1;
+ tp[0] = ':';
+ tp++;
+ }
+ if (n % 16 > 8) {
+ /* Partial short */
+ if (cp[0] != 0) {
+ if (tp > (u_char *)name) {
+ in_v6_break = 0;
+ tp[0] = ':';
+ tp++;
+ }
+ sprintf(tp, "%x", cp[0] & 0xFF);
+ } else {
+ if (!have_v6_break) {
+ have_v6_break = 1;
+ in_v6_break = 1;
+ tp[0] = ':';
+ tp++;
+ } else if (!in_v6_break) {
+ tp[0] = ':';
+ tp++;
+ tp[0] = '0';
+ tp++;
+ }
+ }
+ cp++;
+ }
+ for(i = (n+8)/16; i < 8; i++) {
+ GETSHORT(s, cp);
+ if (s != 0) {
+ if (tp > (u_char *)name) {
+ in_v6_break = 0;
+ tp[0] = ':';
+ tp++;
+ }
+ tp += sprintf(tp,"%x",s);
+ } else {
+ if (!have_v6_break) {
+ have_v6_break = 1;
+ in_v6_break = 1;
+ tp[0] = ':';
+ tp++;
+ } else if (!in_v6_break) {
+ tp[0] = ':';
+ tp++;
+ tp[0] = '0';
+ tp++;
+ }
+ }
+ }
+ if (have_v6_break && in_v6_break) {
+ tp[0] = ':';
+ tp++;
+ }
+ tp[0] = '\0';
+ add_assoc_string(*subarray, "ipv6", name, 1);
+ if (cp < p + dlen) {
+ n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
+ if (n < 0) {
+ return NULL;
+ }
+ cp += n;
+ add_assoc_string(*subarray, "chain", name, 1);
+ }
break;
-#endif
-#ifdef T_SRV
- case T_SRV:
+ case DNS_T_SRV:
add_assoc_string(*subarray, "type", "SRV", 1);
GETSHORT(n, cp);
add_assoc_long(*subarray, "pri", n);
@@ -475,9 +618,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
cp += n;
add_assoc_string(*subarray, "target", name, 1);
break;
-#endif
-#ifdef T_NAPTR
- case T_NAPTR:
+ case DNS_T_NAPTR:
add_assoc_string(*subarray, "type", "NAPTR", 1);
GETSHORT(n, cp);
add_assoc_long(*subarray, "order", n);
@@ -499,7 +640,6 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
cp += n;
add_assoc_string(*subarray, "replacement", name, 1);
break;
-#endif
default:
cp += dlen;
}
@@ -520,9 +660,9 @@ PHP_FUNCTION(dns_get_record)
int type_to_fetch, type_param = PHP_DNS_ANY;
struct __res_state res;
HEADER *hp;
- querybuf buf, answer, *ans;
+ querybuf buf, answer;
u_char *cp = NULL, *end = NULL;
- long n, qd, an, ns = 0, ar = 0;
+ int n, qd, an, ns = 0, ar = 0;
int type, first_query = 1, store_results = 1;
switch (ZEND_NUM_ARGS()) {
@@ -535,12 +675,14 @@ PHP_FUNCTION(dns_get_record)
if (zend_get_parameters(ht, 2, &host, &fetch_type) == FAILURE) {
WRONG_PARAM_COUNT;
}
+ convert_to_long(fetch_type);
type_param = Z_LVAL_P(fetch_type);
break;
case 4:
if (zend_get_parameters(ht, 4, &host, &fetch_type, &authns, &addtl) == FAILURE) {
WRONG_PARAM_COUNT;
}
+ convert_to_long(fetch_type);
type_param = Z_LVAL_P(fetch_type);
pval_destructor(authns);
addtl_recs = 1; /* We want the additional Records */
@@ -563,70 +705,61 @@ PHP_FUNCTION(dns_get_record)
array_init(return_value);
/* - We emulate an or'ed type mask by querying type by type. (Steps 0 - NUMTYPES-1 )
- * If additional info is wanted we check again with T_ANY (step NUMTYPES / NUMTYPES+1 )
+ * If additional info is wanted we check again with DNS_T_ANY (step NUMTYPES / NUMTYPES+1 )
* store_results is used to skip storing the results retrieved in step
* NUMTYPES+1 when results were already fetched.
- * - In case of PHP_DNS_ANY we use the directly fetch T_ANY. (step NUMTYPES+1 )
+ * - In case of PHP_DNS_ANY we use the directly fetch DNS_T_ANY. (step NUMTYPES+1 )
*/
for(type = (type_param==PHP_DNS_ANY ? (PHP_DNS_NUM_TYPES + 1) : 0); type < (addtl_recs ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query; type++)
{
first_query = 0;
switch (type) {
case 0:
- type_to_fetch = type_param&PHP_DNS_A ? T_A : 0;
+ type_to_fetch = type_param&PHP_DNS_A ? DNS_T_A : 0;
break;
case 1:
- type_to_fetch = type_param&PHP_DNS_NS ? T_NS : 0;
+ type_to_fetch = type_param&PHP_DNS_NS ? DNS_T_NS : 0;
break;
case 2:
- type_to_fetch = type_param&PHP_DNS_CNAME ? T_CNAME : 0;
+ type_to_fetch = type_param&PHP_DNS_CNAME ? DNS_T_CNAME : 0;
break;
case 3:
- type_to_fetch = type_param&PHP_DNS_SOA ? T_SOA : 0;
+ type_to_fetch = type_param&PHP_DNS_SOA ? DNS_T_SOA : 0;
break;
case 4:
- type_to_fetch = type_param&PHP_DNS_PTR ? T_PTR : 0;
+ type_to_fetch = type_param&PHP_DNS_PTR ? DNS_T_PTR : 0;
break;
case 5:
- type_to_fetch = type_param&PHP_DNS_HINFO ? T_HINFO : 0;
+ type_to_fetch = type_param&PHP_DNS_HINFO ? DNS_T_HINFO : 0;
break;
case 6:
- type_to_fetch = type_param&PHP_DNS_MX ? T_MX : 0;
+ type_to_fetch = type_param&PHP_DNS_MX ? DNS_T_MX : 0;
break;
case 7:
- type_to_fetch = type_param&PHP_DNS_TXT ? T_TXT : 0;
+ type_to_fetch = type_param&PHP_DNS_TXT ? DNS_T_TXT : 0;
break;
case 8:
-#ifdef T_AAAA
- type_to_fetch = type_param&PHP_DNS_AAAA ? T_AAAA : 0;
+ type_to_fetch = type_param&PHP_DNS_AAAA ? DNS_T_AAAA : 0;
break;
-#else
- continue;
-#endif
case 9:
-#ifdef T_SRV
- type_to_fetch = type_param&PHP_DNS_SRV ? T_SRV : 0;
+ type_to_fetch = type_param&PHP_DNS_SRV ? DNS_T_SRV : 0;
break;
-#else
- continue;
-#endif
case 10:
-#ifdef T_NAPTR
- type_to_fetch = type_param&PHP_DNS_NAPTR ? T_NAPTR : 0;
+ type_to_fetch = type_param&PHP_DNS_NAPTR ? DNS_T_NAPTR : 0;
+ break;
+ case 11:
+ type_to_fetch = type_param&PHP_DNS_A6 ? DNS_T_A6 : 0;
break;
-#else
- continue;
-#endif
-
case PHP_DNS_NUM_TYPES:
store_results = 0;
continue;
default:
case (PHP_DNS_NUM_TYPES + 1):
- type_to_fetch = T_ANY;
+ type_to_fetch = DNS_T_ANY;
break;
}
if (type_to_fetch) {
+ memset(&res, 0, sizeof(res));
res_ninit(&res);
res.retrans = 5;
res.options &= ~RES_DEFNAMES;
@@ -635,30 +768,35 @@ PHP_FUNCTION(dns_get_record)
if (n<0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "res_nmkquery() failed");
zval_dtor(return_value);
+ res_nclose(&res);
+ php_dns_free_res(res);
RETURN_FALSE;
}
n = res_nsend(&res, buf.qb2, n, answer.qb2, sizeof answer);
if (n<0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "res_nsend() failed");
zval_dtor(return_value);
+ res_nclose(&res);
+ php_dns_free_res(res);
RETURN_FALSE;
}
cp = answer.qb2 + HFIXEDSZ;
end = answer.qb2 + n;
- ans = &answer;
- hp = (HEADER *)ans;
+ hp = (HEADER *)&answer;
qd = ntohs(hp->qdcount);
an = ntohs(hp->ancount);
ns = ntohs(hp->nscount);
ar = ntohs(hp->arcount);
-
+
/* Skip QD entries, they're only used by dn_expand later on */
while (qd-- > 0) {
n = dn_skipname(cp, end);
if (n < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse DNS data received");
zval_dtor(return_value);
+ res_nclose(&res);
+ php_dns_free_res(res);
RETURN_FALSE;
}
cp += n + QFIXEDSZ;
@@ -674,6 +812,7 @@ PHP_FUNCTION(dns_get_record)
}
}
res_nclose(&res);
+ php_dns_free_res(res);
}
}
@@ -682,7 +821,7 @@ PHP_FUNCTION(dns_get_record)
while (ns-- > 0 && cp && cp < end) {
zval *retval;
- cp = php_parserr(cp, &answer, T_ANY, 1, &retval);
+ cp = php_parserr(cp, &answer, DNS_T_ANY, 1, &retval);
if (retval != NULL) {
add_next_index_zval(authns, retval);
}
@@ -691,7 +830,7 @@ PHP_FUNCTION(dns_get_record)
while (ar-- > 0 && cp && cp < end) {
zval *retval;
- cp = php_parserr(cp, &answer, T_ANY, 1, &retval);
+ cp = php_parserr(cp, &answer, DNS_T_ANY, 1, &retval);
if (retval != NULL) {
add_next_index_zval(addtl, retval);
}
@@ -741,7 +880,7 @@ PHP_FUNCTION(dns_get_mx)
array_init(mx_list);
/* Go! */
- i = res_search(Z_STRVAL_P(host), C_IN, T_MX, (u_char *)&ans, sizeof(ans));
+ i = res_search(Z_STRVAL_P(host), C_IN, DNS_T_MX, (u_char *)&ans, sizeof(ans));
if (i < 0) {
RETURN_FALSE;
}
@@ -765,7 +904,7 @@ PHP_FUNCTION(dns_get_mx)
GETSHORT(type, cp);
cp += INT16SZ + INT32SZ;
GETSHORT(i, cp);
- if (type != T_MX) {
+ if (type != DNS_T_MX) {
cp += i;
continue;
}
diff --git a/ext/standard/dns.h b/ext/standard/dns.h
index 89358c7f2..a686604d6 100644
--- a/ext/standard/dns.h
+++ b/ext/standard/dns.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dns.h,v 1.18 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: dns.h,v 1.19 2005/08/03 14:07:58 sniper Exp $ */
#ifndef DNS_H
#define DNS_H
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index d268ee36a..620826903 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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 @@
| Ilia Alshanetsky <iliaa@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.111 2004/07/12 18:49:47 iliaa Exp $ */
+/* $Id: exec.c,v 1.113 2005/08/03 14:07:58 sniper Exp $ */
#include <stdio.h>
#include "php.h"
@@ -66,7 +66,7 @@ int php_exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
php_stream *stream;
size_t buflen, bufl = 0;
#if PHP_SIGCHILD
- void (*sig_handler)();
+ void (*sig_handler)() = NULL;
#endif
if (PG(safe_mode)) {
@@ -177,7 +177,9 @@ int php_exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
done:
#if PHP_SIGCHILD
- signal (SIGCHLD, sig_handler);
+ if (sig_handler) {
+ signal(SIGCHLD, sig_handler);
+ }
#endif
if (d) {
efree(d);
diff --git a/ext/standard/exec.h b/ext/standard/exec.h
index 780240d24..74f741c6c 100644
--- a/ext/standard/exec.h
+++ b/ext/standard/exec.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: exec.h,v 1.23 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: exec.h,v 1.24.2.1 2005/09/24 15:22:32 edink Exp $ */
#ifndef EXEC_H
#define EXEC_H
@@ -34,8 +34,8 @@ PHP_FUNCTION(proc_terminate);
PHP_FUNCTION(proc_nice);
PHP_MINIT_FUNCTION(proc_open);
-char *php_escape_shell_cmd(char *);
-char *php_escape_shell_arg(char *);
+PHPAPI char *php_escape_shell_cmd(char *);
+PHPAPI char *php_escape_shell_arg(char *);
int php_exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC);
#endif /* EXEC_H */
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 99a51716a..71f0e77b4 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.382.2.9 2005/04/06 13:59:48 iliaa Exp $ */
+/* $Id: file.c,v 1.409.2.1 2005/10/21 12:13:37 dmitry Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -35,6 +35,7 @@
#include "php_open_temporary_file.h"
#include "ext/standard/basic_functions.h"
#include "php_ini.h"
+#include "php_smart_str.h"
#include <stdio.h>
#include <stdlib.h>
@@ -47,6 +48,16 @@
#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#include "win32/winutil.h"
+#elif defined(NETWARE)
+#include <sys/param.h>
+#include <sys/select.h>
+#ifdef USE_WINSOCK
+#include <novsock2.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#endif
#else
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
@@ -208,6 +219,59 @@ PHP_MINIT_FUNCTION(file)
REGISTER_LONG_CONSTANT("STREAM_CLIENT_ASYNC_CONNECT", PHP_STREAM_CLIENT_ASYNC_CONNECT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("STREAM_CLIENT_CONNECT", PHP_STREAM_CLIENT_CONNECT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_CLIENT", STREAM_CRYPTO_METHOD_SSLv2_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_CLIENT", STREAM_CRYPTO_METHOD_SSLv3_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_CLIENT", STREAM_CRYPTO_METHOD_SSLv23_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_CLIENT", STREAM_CRYPTO_METHOD_TLS_CLIENT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_SERVER", STREAM_CRYPTO_METHOD_SSLv2_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_SERVER", STREAM_CRYPTO_METHOD_SSLv3_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv23_SERVER", STREAM_CRYPTO_METHOD_SSLv23_SERVER, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_TLS_SERVER", STREAM_CRYPTO_METHOD_TLS_SERVER, CONST_CS|CONST_PERSISTENT);
+
+#ifdef PF_INET
+ REGISTER_LONG_CONSTANT("STREAM_PF_INET", PF_INET, CONST_CS|CONST_PERSISTENT);
+#elif defined(AF_INET)
+ REGISTER_LONG_CONSTANT("STREAM_PF_INET", AF_INET, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifdef PF_INET6
+ REGISTER_LONG_CONSTANT("STREAM_PF_INET6", PF_INET6, CONST_CS|CONST_PERSISTENT);
+#elif defined(AF_INET6)
+ REGISTER_LONG_CONSTANT("STREAM_PF_INET6", AF_INET6, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifdef PF_UNIX
+ REGISTER_LONG_CONSTANT("STREAM_PF_UNIX", PF_UNIX, CONST_CS|CONST_PERSISTENT);
+#elif defined(AF_UNIX)
+ REGISTER_LONG_CONSTANT("STREAM_PF_UNIX", AF_UNIX, CONST_CS|CONST_PERSISTENT);
+#endif
+
+#ifdef IPPROTO_IP
+ /* most people will use this one when calling socket() or socketpair() */
+ REGISTER_LONG_CONSTANT("STREAM_IPPROTO_IP", IPPROTO_IP, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifdef IPPROTO_TCP
+ REGISTER_LONG_CONSTANT("STREAM_IPPROTO_TCP", IPPROTO_TCP, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifdef IPPROTO_UDP
+ REGISTER_LONG_CONSTANT("STREAM_IPPROTO_UDP", IPPROTO_UDP, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifdef IPPROTO_ICMP
+ REGISTER_LONG_CONSTANT("STREAM_IPPROTO_ICMP", IPPROTO_ICMP, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifdef IPPROTO_RAW
+ REGISTER_LONG_CONSTANT("STREAM_IPPROTO_RAW", IPPROTO_RAW, CONST_CS|CONST_PERSISTENT);
+#endif
+
+ REGISTER_LONG_CONSTANT("STREAM_SOCK_STREAM", SOCK_STREAM, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("STREAM_SOCK_DGRAM", SOCK_DGRAM, CONST_CS|CONST_PERSISTENT);
+#ifdef SOCK_RAW
+ REGISTER_LONG_CONSTANT("STREAM_SOCK_RAW", SOCK_RAW, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifdef SOCK_SEQPACKET
+ REGISTER_LONG_CONSTANT("STREAM_SOCK_SEQPACKET", SOCK_SEQPACKET, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifdef SOCK_RDM
+ REGISTER_LONG_CONSTANT("STREAM_SOCK_RDM", SOCK_RDM, CONST_CS|CONST_PERSISTENT);
+#endif
REGISTER_LONG_CONSTANT("STREAM_PEEK", STREAM_PEEK, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("STREAM_OOB", STREAM_OOB, CONST_CS | CONST_PERSISTENT);
@@ -410,7 +474,7 @@ PHP_FUNCTION(get_meta_tags)
if (have_content) {
add_assoc_string(return_value, name, value, 0);
} else {
- add_assoc_string(return_value, name, empty_string, 0);
+ add_assoc_string(return_value, name, "", 1);
}
efree(name);
@@ -440,7 +504,7 @@ PHP_FUNCTION(get_meta_tags)
/* }}} */
-/* {{{ proto string file_get_contents(string filename [, bool use_include_path [, resource context]])
+/* {{{ proto string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
Read the entire file into a string */
PHP_FUNCTION(file_get_contents)
{
@@ -450,12 +514,14 @@ PHP_FUNCTION(file_get_contents)
zend_bool use_include_path = 0;
php_stream *stream;
int len, newlen;
+ long offset = -1;
+ long maxlen = PHP_STREAM_COPY_ALL;
zval *zcontext = NULL;
php_stream_context *context = NULL;
/* Parse arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|br!",
- &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|br!ll",
+ &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
return;
}
@@ -468,8 +534,13 @@ PHP_FUNCTION(file_get_contents)
RETURN_FALSE;
}
+ 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);
+ RETURN_FALSE;
+ }
+
/* uses mmap if possible */
- if ((len = php_stream_copy_to_mem(stream, &contents, PHP_STREAM_COPY_ALL, 0)) > 0) {
+ if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) {
if (PG(magic_quotes_runtime)) {
contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */
@@ -513,7 +584,21 @@ PHP_FUNCTION(file_put_contents)
if (stream == NULL) {
RETURN_FALSE;
}
+
+ if (flags & LOCK_EX && php_stream_lock(stream, LOCK_EX)) {
+ RETURN_FALSE;
+ }
+
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:
@@ -525,7 +610,7 @@ PHP_FUNCTION(file_put_contents)
if (Z_STRLEN_P(data)) {
numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data));
if (numbytes != Z_STRLEN_P(data)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d bytes written, possibly out of free disk space.", numbytes, Z_STRLEN_P(data));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data));
numbytes = -1;
}
}
@@ -548,9 +633,9 @@ PHP_FUNCTION(file_put_contents)
bytes_written = php_stream_write(stream, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
if (bytes_written < 0 || bytes_written != Z_STRLEN_PP(tmp)) {
if (bytes_written < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write %d bytes to %s.", Z_STRLEN_PP(tmp), filename);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write %d bytes to %s", Z_STRLEN_PP(tmp), filename);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d bytes written, possibly out of free disk space.", bytes_written, Z_STRLEN_PP(tmp));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d bytes written, possibly out of free disk space", bytes_written, Z_STRLEN_PP(tmp));
}
numbytes = -1;
break;
@@ -562,7 +647,7 @@ PHP_FUNCTION(file_put_contents)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The 2nd parameter should be either a string or an array.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The 2nd parameter should be either a string or an array");
numbytes = -1;
break;
@@ -603,7 +688,7 @@ PHP_FUNCTION(file)
return;
}
if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%ld' flag is not supported.", flags);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%ld' flag is not supported", flags);
RETURN_FALSE;
}
@@ -936,7 +1021,7 @@ PHPAPI PHP_FUNCTION(fgets)
len = Z_LVAL_PP(arg2);
if (len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -972,7 +1057,7 @@ exit_failed:
PHPAPI PHP_FUNCTION(fgetc)
{
zval **arg1;
- char *buf;
+ char buf[2];
int result;
php_stream *stream;
@@ -982,18 +1067,15 @@ PHPAPI PHP_FUNCTION(fgetc)
PHP_STREAM_TO_ZVAL(stream, arg1);
- buf = safe_emalloc(2, sizeof(char), 0);
-
result = php_stream_getc(stream);
if (result == EOF) {
- efree(buf);
RETVAL_FALSE;
} else {
buf[0] = result;
buf[1] = '\0';
- RETURN_STRINGL(buf, 1, 0);
+ RETURN_STRINGL(buf, 1, 1);
}
}
/* }}} */
@@ -1043,7 +1125,7 @@ PHPAPI PHP_FUNCTION(fgetss)
if (bytes != NULL) {
convert_to_long_ex(bytes);
if (Z_LVAL_PP(bytes) <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -1152,7 +1234,7 @@ PHPAPI PHP_FUNCTION(fwrite)
}
convert_to_string_ex(arg2);
convert_to_long_ex(arg3);
- num_bytes = MIN(Z_LVAL_PP(arg3), Z_STRLEN_PP(arg2));
+ num_bytes = MAX(0, MIN(Z_LVAL_PP(arg3), Z_STRLEN_PP(arg2)));
break;
default:
@@ -1161,10 +1243,14 @@ PHPAPI PHP_FUNCTION(fwrite)
break;
}
+ if (!num_bytes) {
+ RETURN_LONG(0);
+ }
+
PHP_STREAM_TO_ZVAL(stream, arg1);
- if (!arg3 && PG(magic_quotes_runtime)) {
- buffer = estrndup(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2));
+ if (PG(magic_quotes_runtime)) {
+ buffer = estrndup(Z_STRVAL_PP(arg2), num_bytes);
php_stripslashes(buffer, &num_bytes TSRMLS_CC);
}
@@ -1420,17 +1506,17 @@ PHP_FUNCTION(rename)
wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0 TSRMLS_CC);
if (!wrapper || !wrapper->wops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate stream wrapper.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate stream wrapper");
RETURN_FALSE;
}
if (!wrapper->wops->rename) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s wrapper does not support renaming.", wrapper->wops->label ? wrapper->wops->label : "Source");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s wrapper does not support renaming", wrapper->wops->label ? wrapper->wops->label : "Source");
RETURN_FALSE;
}
if (wrapper != php_stream_locate_url_wrapper(new_name, NULL, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot rename a file across wrapper types.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot rename a file across wrapper types");
RETURN_FALSE;
}
@@ -1495,7 +1581,7 @@ PHP_NAMED_FUNCTION(php_if_ftruncate)
}
/* }}} */
-/* {{{ proto int fstat(resource fp)
+/* {{{ proto array fstat(resource fp)
Stat() on a filehandle */
PHP_NAMED_FUNCTION(php_if_fstat)
{
@@ -1619,6 +1705,56 @@ PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
{
php_stream *srcstream = NULL, *deststream = NULL;
int ret = FAILURE;
+ php_stream_statbuf src_s, dest_s;
+
+ switch (php_stream_stat_path_ex(src, 0, &src_s, NULL)) {
+ case -1:
+ /* non-statable stream */
+ goto safe_to_copy;
+ break;
+ case 0:
+ break;
+ default: /* failed to stat file, does not exist? */
+ return ret;
+ }
+ if (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, &dest_s, NULL) != 0) {
+ goto safe_to_copy;
+ }
+ if (!src_s.sb.st_ino || !dest_s.sb.st_ino) {
+ goto no_stat;
+ }
+ if (src_s.sb.st_ino == dest_s.sb.st_ino && src_s.sb.st_dev == dest_s.sb.st_dev) {
+ return ret;
+ } else {
+ goto safe_to_copy;
+ }
+no_stat:
+ {
+ char *sp, *dp;
+ int res;
+
+ if ((sp = expand_filepath(src, NULL TSRMLS_CC)) == NULL) {
+ return ret;
+ }
+ if ((dp = expand_filepath(dest, NULL TSRMLS_CC)) == NULL) {
+ efree(sp);
+ goto safe_to_copy;
+ }
+
+ res =
+#ifndef PHP_WIN32
+ !strcmp(sp, dp);
+#else
+ !strcasecmp(sp, dp);
+#endif
+
+ efree(sp);
+ efree(dp);
+ if (res) {
+ return ret;
+ }
+ }
+safe_to_copy:
srcstream = php_stream_open_wrapper(src, "rb", STREAM_DISABLE_OPEN_BASEDIR | REPORT_ERRORS, NULL);
@@ -1658,7 +1794,7 @@ PHPAPI PHP_FUNCTION(fread)
convert_to_long_ex(arg2);
len = Z_LVAL_PP(arg2);
if (len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -1713,6 +1849,117 @@ quit_loop:
return ptr;
}
+#define FPUTCSV_FLD_CHK(c) memchr(Z_STRVAL_PP(field), c, Z_STRLEN_PP(field))
+
+/* {{{ proto int fputcsv(resource fp, array fields [, string delimiter [, string enclosure]])
+ Format line as CSV and write to file pointer */
+PHP_FUNCTION(fputcsv)
+{
+ char delimiter = ','; /* allow this to be set as parameter */
+ char enclosure = '"'; /* allow this to be set as parameter */
+ const char escape_char = '\\';
+ php_stream *stream;
+ int ret;
+ zval *fp = NULL, *fields = NULL, **field = NULL;
+ char *delimiter_str = NULL, *enclosure_str = NULL;
+ int delimiter_str_len, enclosure_str_len;
+ HashPosition pos;
+ int count, i = 0;
+ smart_str csvline = {0};
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ass",
+ &fp, &fields, &delimiter_str, &delimiter_str_len,
+ &enclosure_str, &enclosure_str_len) == FAILURE) {
+ return;
+ }
+
+ if (delimiter_str != NULL) {
+ /* Make sure that there is at least one character in string */
+ 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 */
+ delimiter = *delimiter_str;
+ }
+
+ if (enclosure_str != NULL) {
+ 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;
+ }
+
+ PHP_STREAM_TO_ZVAL(stream, &fp);
+
+ count = zend_hash_num_elements(Z_ARRVAL_P(fields));
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(fields), &pos);
+ while (zend_hash_get_current_data_ex(Z_ARRVAL_P(fields), (void **) &field, &pos) == SUCCESS) {
+ if (Z_TYPE_PP(field) != IS_STRING) {
+ SEPARATE_ZVAL(field);
+ convert_to_string(*field);
+ }
+ /* enclose a field that contains a delimiter, an enclosure character, or a newline */
+ if (FPUTCSV_FLD_CHK(delimiter) ||
+ FPUTCSV_FLD_CHK(enclosure) ||
+ FPUTCSV_FLD_CHK(escape_char) ||
+ FPUTCSV_FLD_CHK('\n') ||
+ FPUTCSV_FLD_CHK('\r') ||
+ FPUTCSV_FLD_CHK('\t') ||
+ FPUTCSV_FLD_CHK(' ')) {
+ char *ch = Z_STRVAL_PP(field);
+ char *end = ch + Z_STRLEN_PP(field);
+ int escaped = 0;
+
+ smart_str_appendc(&csvline, enclosure);
+ while (ch < end) {
+ if (*ch == escape_char) {
+ escaped = 1;
+ } else if (!escaped && *ch == enclosure) {
+ smart_str_appendc(&csvline, enclosure);
+ } else {
+ escaped = 0;
+ }
+ smart_str_appendc(&csvline, *ch);
+ ch++;
+ }
+ smart_str_appendc(&csvline, enclosure);
+ } else {
+ smart_str_appendl(&csvline, Z_STRVAL_PP(field), Z_STRLEN_PP(field));
+ }
+
+ if (++i != count) {
+ smart_str_appendl(&csvline, &delimiter, 1);
+ }
+ zend_hash_move_forward_ex(Z_ARRVAL_P(fields), &pos);
+ }
+
+ smart_str_appendc(&csvline, '\n');
+ smart_str_0(&csvline);
+
+ if (!PG(magic_quotes_runtime)) {
+ ret = php_stream_write(stream, csvline.c, csvline.len);
+ } else {
+ char *buffer = estrndup(csvline.c, csvline.len);
+ int len = csvline.len;
+ php_stripslashes(buffer, &len TSRMLS_CC);
+ ret = php_stream_write(stream, buffer, len);
+ efree(buffer);
+ }
+
+ smart_str_free(&csvline);
+
+ RETURN_LONG(ret);
+}
+/* }}} */
+
/* {{{ proto array fgetcsv(resource fp [,int length [, string delimiter [, string enclosure]]])
Get line from file pointer and parse for CSV fields */
PHP_FUNCTION(fgetcsv)
@@ -1769,7 +2016,7 @@ PHP_FUNCTION(fgetcsv)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative");
RETURN_FALSE;
} else if (len == 0) {
- len = 1;
+ len = -1;
}
} else {
len = -1;
@@ -2182,14 +2429,11 @@ php_meta_tags_token php_next_meta_token(php_meta_tags_data *md TSRMLS_DC)
Match filename against pattern */
PHP_FUNCTION(fnmatch)
{
- char *pattern = NULL;
- char *filename = NULL;
- int argc = ZEND_NUM_ARGS();
- int pattern_len;
- int filename_len;
- long flags=0;
+ char *pattern, *filename;
+ int pattern_len, filename_len;
+ long flags = 0;
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l",
&pattern, &pattern_len,
&filename, &filename_len,
&flags)
diff --git a/ext/standard/file.h b/ext/standard/file.h
index abb1ca71b..01ac2e601 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: file.h,v 1.90.2.1 2005/07/15 09:29:18 hyanantha Exp $ */
+/* $Id: file.h,v 1.94 2005/08/03 14:07:59 sniper Exp $ */
/* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */
@@ -39,6 +39,7 @@ PHPAPI PHP_FUNCTION(fgets);
PHP_FUNCTION(fscanf);
PHPAPI PHP_FUNCTION(fgetss);
PHP_FUNCTION(fgetcsv);
+PHP_FUNCTION(fputcsv);
PHPAPI PHP_FUNCTION(fwrite);
PHPAPI PHP_FUNCTION(fflush);
PHPAPI PHP_FUNCTION(rewind);
@@ -122,7 +123,7 @@ typedef struct {
extern PHPAPI int file_globals_id;
#else
#define FG(v) (file_globals.v)
-extern php_file_globals file_globals;
+extern PHPAPI php_file_globals file_globals;
#endif
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index d48896e34..178ad5f12 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: filestat.c,v 1.130.2.4 2005/07/15 09:29:18 hyanantha Exp $ */
+/* $Id: filestat.c,v 1.136.2.1 2005/10/22 17:02:06 wez Exp $ */
#include "php.h"
#include "safe_mode.h"
@@ -105,11 +105,11 @@ PHP_RSHUTDOWN_FUNCTION(filestat)
{
if (BG(CurrentStatFile)) {
efree (BG(CurrentStatFile));
- BG(CurrentStatFile)=NULL;
+ BG(CurrentStatFile) = NULL;
}
if (BG(CurrentLStatFile)) {
efree (BG(CurrentLStatFile));
- BG(CurrentLStatFile)=NULL;
+ BG(CurrentLStatFile) = NULL;
}
return SUCCESS;
}
@@ -325,9 +325,10 @@ PHP_FUNCTION(disk_free_space)
/* {{{ proto bool chgrp(string filename, mixed group)
Change file group */
+#ifndef NETWARE
PHP_FUNCTION(chgrp)
{
-#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chgrp' won't be available on NetWare */
+#if !defined(WINDOWS)
pval **filename, **group;
gid_t gid;
struct group *gr=NULL;
@@ -369,13 +370,15 @@ PHP_FUNCTION(chgrp)
RETURN_FALSE;
#endif
}
+#endif
/* }}} */
/* {{{ proto bool chown (string filename, mixed user)
Change file owner */
+#ifndef NETWARE
PHP_FUNCTION(chown)
{
-#if !defined(WINDOWS) && !defined(NETWARE) /* I guess 'chown' won't be available on NetWare */
+#if !defined(WINDOWS)
pval **filename, **user;
int ret;
uid_t uid;
@@ -415,6 +418,7 @@ PHP_FUNCTION(chown)
#endif
RETURN_TRUE;
}
+#endif
/* }}} */
/* {{{ proto bool chmod(string filename, int mode)
@@ -539,6 +543,7 @@ PHP_FUNCTION(clearstatcache)
#define IS_LINK_OPERATION(__t) ((__t) == FS_TYPE || (__t) == FS_IS_LINK || (__t) == FS_LSTAT)
#define IS_EXISTS_CHECK(__t) ((__t) == FS_EXISTS || (__t) == FS_IS_W || (__t) == FS_IS_R || (__t) == FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || (__t) == FS_IS_LINK)
#define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == FS_IS_X)
+#define IS_ACCESS_CHECK(__t) (IS_ABLE_CHECK(type) || (__t) == FS_EXISTS)
/* {{{ php_stat
*/
@@ -556,6 +561,35 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
RETURN_FALSE;
}
+ if (IS_ACCESS_CHECK(type)) {
+ char *local;
+
+ if (php_stream_locate_url_wrapper(filename, &local, 0 TSRMLS_CC) == &php_plain_files_wrapper) {
+ switch (type) {
+#ifdef F_OK
+ case FS_EXISTS:
+ RETURN_BOOL(VCWD_ACCESS(local, F_OK) == 0);
+ break;
+#endif
+#ifdef W_OK
+ case FS_IS_W:
+ RETURN_BOOL(VCWD_ACCESS(local, W_OK) == 0);
+ break;
+#endif
+#ifdef R_OK
+ case FS_IS_R:
+ RETURN_BOOL(VCWD_ACCESS(local, R_OK) == 0);
+ break;
+#endif
+#ifdef X_OK
+ case FS_IS_X:
+ RETURN_BOOL(VCWD_ACCESS(local, X_OK) == 0);
+ break;
+#endif
+ }
+ }
+ }
+
if (IS_LINK_OPERATION(type)) {
flags |= PHP_STREAM_URL_STAT_LINK;
}
@@ -613,7 +647,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
php_stream_wrapper *wrapper;
wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
- if (wrapper && wrapper->wops && wrapper->wops->label && strcmp(wrapper->wops->label, "plainfile") == 0) {
+ if (wrapper == &php_plain_files_wrapper) {
if (type == FS_IS_X) {
xmask = S_IXROOT;
} else {
diff --git a/ext/standard/filters.c b/ext/standard/filters.c
index 2d94a4fbd..6d8862532 100644
--- a/ext/standard/filters.c
+++ b/ext/standard/filters.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filters.c,v 1.38.2.4 2004/07/20 19:36:00 moriyoshi Exp $ */
+/* $Id: filters.c,v 1.44.2.2 2005/10/20 16:54:48 tony2001 Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -307,6 +307,7 @@ typedef enum _php_conv_err_t {
PHP_CONV_ERR_INVALID_SEQ,
PHP_CONV_ERR_UNEXPECTED_EOS,
PHP_CONV_ERR_EXISTS,
+ PHP_CONV_ERR_MORE,
PHP_CONV_ERR_ALLOC,
PHP_CONV_ERR_NOT_FOUND
} php_conv_err_t;
@@ -375,7 +376,7 @@ static php_conv_err_t php_conv_base64_encode_ctor(php_conv_base64_encode *inst,
}
inst->lbchars_dup = lbchars_dup;
inst->persistent = persistent;
- return SUCCESS;
+ return PHP_CONV_ERR_SUCCESS;
}
static void php_conv_base64_encode_dtor(php_conv_base64_encode *inst)
@@ -641,7 +642,7 @@ static php_conv_err_t php_conv_base64_decode_convert(php_conv_base64_decode *ins
if (in_pp == NULL || in_left_p == NULL) {
if (inst->eos || inst->urem_nbits == 0) {
- return SUCCESS;
+ return PHP_CONV_ERR_SUCCESS;
}
return PHP_CONV_ERR_UNEXPECTED_EOS;
}
@@ -867,7 +868,7 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins
CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt);
}
} else if ((!(opts & PHP_CONV_QPRINT_OPT_FORCE_ENCODE_FIRST) || line_ccnt < inst->line_len) && ((c >= 33 && c <= 60) || (c >= 62 && c <= 126))) {
- if (line_ccnt < 2) {
+ if (line_ccnt < 2 && inst->lbchars != NULL) {
if (ocnt < inst->lbchars_len + 1) {
err = PHP_CONV_ERR_TOO_BIG;
break;
@@ -1151,6 +1152,8 @@ typedef struct _php_convert_filter {
php_conv *cd;
int persistent;
char *filtername;
+ char stub[128];
+ size_t stub_len;
} php_convert_filter;
#define PHP_CONV_BASE64_ENCODE 1
@@ -1446,6 +1449,7 @@ static int php_convert_filter_ctor(php_convert_filter *inst,
{
inst->persistent = persistent;
inst->filtername = pestrdup(filtername, persistent);
+ inst->stub_len = 0;
if ((inst->cd = php_conv_open(conv_mode, conv_opts, persistent)) == NULL) {
goto out_failure;
@@ -1476,64 +1480,145 @@ static void php_convert_filter_dtor(php_convert_filter *inst)
}
}
-static php_stream_filter_status_t strfilter_convert_filter(
- php_stream *stream,
- php_stream_filter *thisfilter,
- php_stream_bucket_brigade *buckets_in,
- php_stream_bucket_brigade *buckets_out,
- size_t *bytes_consumed,
- int flags
- TSRMLS_DC)
+/* {{{ strfilter_convert_append_bucket */
+static int strfilter_convert_append_bucket(
+ php_convert_filter *inst,
+ php_stream *stream, php_stream_filter *filter,
+ php_stream_bucket_brigade *buckets_out,
+ const char *ps, size_t buf_len, size_t *consumed,
+ int persistent TSRMLS_DC)
{
- php_stream_bucket *bucket = NULL, *new_bucket;
- size_t consumed = 0;
php_conv_err_t err;
- php_convert_filter *inst = (php_convert_filter *)thisfilter->abstract;
+ php_stream_bucket *new_bucket;
char *out_buf = NULL;
size_t out_buf_size;
char *pd;
- size_t ocnt;
-
- /* Always wind buckets_in whether this is a flush op or not */
- while (buckets_in->head != NULL) {
- const char *ps;
- size_t icnt;
-
- bucket = buckets_in->head;
+ const char *pt;
+ size_t ocnt, icnt, tcnt;
+ size_t initial_out_buf_size;
+
+ if (ps == NULL) {
+ initial_out_buf_size = 64;
+ icnt = 1;
+ } else {
+ initial_out_buf_size = buf_len;
+ icnt = buf_len;
+ }
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- icnt = bucket->buflen;
- ps = bucket->buf;
+ out_buf_size = ocnt = initial_out_buf_size;
+ if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
+ return FAILURE;
+ }
- out_buf_size = bucket->buflen;
- out_buf = pemalloc(out_buf_size, inst->persistent);
- ocnt = out_buf_size;
- pd = out_buf;
+ pd = out_buf;
- /* trying hard to reduce the number of buckets to hand to the
- * next filter */
+ if (inst->stub_len > 0) {
+ pt = inst->stub;
+ tcnt = inst->stub_len;
- while (icnt > 0) {
- err = php_conv_convert(inst->cd, &ps, &icnt, &pd, &ocnt);
+ while (tcnt > 0) {
+ err = php_conv_convert(inst->cd, &pt, &tcnt, &pd, &ocnt);
switch (err) {
- case PHP_CONV_ERR_UNKNOWN:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
- goto out_failure;
-
case PHP_CONV_ERR_INVALID_SEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
goto out_failure;
+ case PHP_CONV_ERR_MORE:
+ if (ps != NULL) {
+ if (icnt > 0) {
+ if (inst->stub_len >= sizeof(inst->stub)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
+ goto out_failure;
+ }
+ inst->stub[inst->stub_len++] = *(ps++);
+ icnt--;
+ pt = inst->stub;
+ tcnt = inst->stub_len;
+ } else {
+ tcnt = 0;
+ break;
+ }
+ }
+ break;
+
case PHP_CONV_ERR_UNEXPECTED_EOS:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername);
goto out_failure;
+ case PHP_CONV_ERR_TOO_BIG: {
+ char *new_out_buf;
+ size_t new_out_buf_size;
+
+ new_out_buf_size = out_buf_size << 1;
+
+ if (new_out_buf_size < out_buf_size) {
+ /* whoa! no bigger buckets are sold anywhere... */
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ goto out_failure;
+ }
+
+ php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+
+ out_buf_size = ocnt = initial_out_buf_size;
+ if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
+ return FAILURE;
+ }
+ pd = out_buf;
+ } else {
+ if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ goto out_failure;
+ }
+
+ php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ return FAILURE;
+ }
+
+ pd = new_out_buf + (pd - out_buf);
+ ocnt += (new_out_buf_size - out_buf_size);
+ out_buf = new_out_buf;
+ out_buf_size = new_out_buf_size;
+ }
+ } break;
+
+ case PHP_CONV_ERR_UNKNOWN:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
+ goto out_failure;
+
default:
break;
}
+ }
+ memmove(inst->stub, pt, tcnt);
+ inst->stub_len = tcnt;
+ }
+
+ while (icnt > 0) {
+ err = ((ps == NULL ? php_conv_convert(inst->cd, NULL, NULL, &pd, &ocnt):
+ php_conv_convert(inst->cd, &ps, &icnt, &pd, &ocnt)));
+ switch (err) {
+ case PHP_CONV_ERR_INVALID_SEQ:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
+ goto out_failure;
+
+ case PHP_CONV_ERR_MORE:
+ if (ps != NULL) {
+ if (icnt > sizeof(inst->stub)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
+ goto out_failure;
+ }
+ memcpy(inst->stub, ps, icnt);
+ inst->stub_len = icnt;
+ ps += icnt;
+ icnt = 0;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected octet values", inst->filtername);
+ goto out_failure;
+ }
+ break;
- if (err == PHP_CONV_ERR_TOO_BIG) {
+ case PHP_CONV_ERR_TOO_BIG: {
char *new_out_buf;
size_t new_out_buf_size;
@@ -1541,116 +1626,105 @@ static php_stream_filter_status_t strfilter_convert_filter(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, inst->persistent TSRMLS_CC);
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ goto out_failure;
+ }
php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
- out_buf_size = bucket->buflen;
- out_buf = pemalloc(out_buf_size, inst->persistent);
- ocnt = out_buf_size;
+ out_buf_size = ocnt = initial_out_buf_size;
+ if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
+ return FAILURE;
+ }
pd = out_buf;
} else {
- new_out_buf = perealloc(out_buf, new_out_buf_size, inst->persistent);
+ if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ goto out_failure;
+ }
+
+ php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ return FAILURE;
+ }
pd = new_out_buf + (pd - out_buf);
ocnt += (new_out_buf_size - out_buf_size);
out_buf = new_out_buf;
out_buf_size = new_out_buf_size;
}
- }
- }
+ } break;
- /* update consumed by the number of bytes just used */
- consumed += bucket->buflen - icnt;
+ case PHP_CONV_ERR_UNKNOWN:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
+ goto out_failure;
- /* give output bucket to next in chain */
- if (out_buf_size - ocnt > 0) {
- new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, inst->persistent TSRMLS_CC);
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
- } else {
- pefree(out_buf, inst->persistent);
+ default:
+ if (ps == NULL) {
+ icnt = 0;
+ }
+ break;
}
-
- php_stream_bucket_delref(bucket TSRMLS_CC);
}
- if (flags != PSFS_FLAG_NORMAL) {
- /* flush operation */
-
- out_buf_size = 64;
- out_buf = pemalloc(out_buf_size, inst->persistent);
- ocnt = out_buf_size;
- pd = out_buf;
-
- /* trying hard to reduce the number of buckets to hand to the
- * next filter */
-
- for (;;) {
- err = php_conv_convert(inst->cd, NULL, NULL, &pd, &ocnt);
-
- switch (err) {
- case PHP_CONV_ERR_UNKNOWN:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
- goto out_failure;
+ if (out_buf_size - ocnt > 0) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ goto out_failure;
+ }
+ php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ } else {
+ pefree(out_buf, persistent);
+ }
+ *consumed += buf_len - icnt;
- case PHP_CONV_ERR_INVALID_SEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername);
- goto out_failure;
+ return SUCCESS;
- case PHP_CONV_ERR_UNEXPECTED_EOS:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername);
- goto out_failure;
+out_failure:
+ pefree(out_buf, persistent);
+ return FAILURE;
+}
+/* }}} */
- default:
- break;
- }
+static php_stream_filter_status_t strfilter_convert_filter(
+ php_stream *stream,
+ php_stream_filter *thisfilter,
+ php_stream_bucket_brigade *buckets_in,
+ php_stream_bucket_brigade *buckets_out,
+ size_t *bytes_consumed,
+ int flags
+ TSRMLS_DC)
+{
+ php_stream_bucket *bucket = NULL;
+ size_t consumed = 0;
+ php_convert_filter *inst = (php_convert_filter *)thisfilter->abstract;
- if (err != PHP_CONV_ERR_TOO_BIG) {
- break;
- } else {
- char *new_out_buf;
- size_t new_out_buf_size;
+ while (buckets_in->head != NULL) {
+ bucket = buckets_in->head;
- new_out_buf_size = out_buf_size << 1;
+ php_stream_bucket_unlink(bucket TSRMLS_CC);
- if (new_out_buf_size < out_buf_size) {
- /* whoa! no bigger buckets are sold anywhere... */
- new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, inst->persistent TSRMLS_CC);
+ if (strfilter_convert_append_bucket(inst, stream, thisfilter,
+ buckets_out, bucket->buf, bucket->buflen, &consumed,
+ php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ goto out_failure;
+ }
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ }
- out_buf_size = bucket->buflen;
- out_buf = pemalloc(out_buf_size, inst->persistent);
- ocnt = out_buf_size;
- pd = out_buf;
- } else {
- new_out_buf = perealloc(out_buf, new_out_buf_size, inst->persistent);
- pd = new_out_buf + (pd - out_buf);
- ocnt += (new_out_buf_size - out_buf_size);
- out_buf = new_out_buf;
- out_buf_size = new_out_buf_size;
- }
- }
- }
- /* give output bucket to next in chain */
- if (out_buf_size - ocnt > 0) {
- new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, inst->persistent TSRMLS_CC);
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
- } else {
- pefree(out_buf, inst->persistent);
+ if (flags != PSFS_FLAG_NORMAL) {
+ if (strfilter_convert_append_bucket(inst, stream, thisfilter,
+ buckets_out, NULL, 0, &consumed,
+ php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ goto out_failure;
}
}
-
if (bytes_consumed) {
*bytes_consumed = consumed;
}
-
+
return PSFS_PASS_ON;
out_failure:
- if (out_buf != NULL) {
- pefree(out_buf, inst->persistent);
- }
if (bucket != NULL) {
php_stream_bucket_delref(bucket TSRMLS_CC);
}
diff --git a/ext/standard/flock_compat.c b/ext/standard/flock_compat.c
index 63f2973b2..61432e65f 100644
--- a/ext/standard/flock_compat.c
+++ b/ext/standard/flock_compat.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: flock_compat.c,v 1.27.2.1 2005/06/28 13:46:45 hyanantha Exp $ */
+/* $Id: flock_compat.c,v 1.29 2005/08/03 14:08:00 sniper Exp $ */
#include "php.h"
#include <errno.h>
diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h
index 6d48d07ce..186a5e84a 100644
--- a/ext/standard/flock_compat.h
+++ b/ext/standard/flock_compat.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: flock_compat.h,v 1.19 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: flock_compat.h,v 1.20 2005/08/03 14:08:00 sniper Exp $ */
#ifndef FLOCK_COMPAT_H
#define FLOCK_COMPAT_H
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 06a778884..a3ca441be 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: formatted_print.c,v 1.77.2.4 2005/01/26 00:02:46 iliaa Exp $ */
+/* $Id: formatted_print.c,v 1.82 2005/08/03 14:08:00 sniper Exp $ */
#include <math.h> /* modf() */
#include "php.h"
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 6b1537540..088c9aed1 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fsock.c,v 1.120 2004/06/16 23:57:25 abies Exp $ */
+/* $Id: fsock.c,v 1.121 2005/08/03 14:08:00 sniper Exp $ */
#include "php.h"
#include "php_globals.h"
diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h
index 6ca9d2719..8e1d5ac3d 100644
--- a/ext/standard/fsock.h
+++ b/ext/standard/fsock.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fsock.h,v 1.47.2.2 2005/07/25 13:10:19 hyanantha Exp $ */
+/* $Id: fsock.h,v 1.50 2005/08/03 14:08:01 sniper Exp $ */
/* Synced with php 3.0 revision 1.24 1999-06-18 [ssb] */
diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c
index ad7da5a95..b32071dd8 100644
--- a/ext/standard/ftok.c
+++ b/ext/standard/ftok.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: ftok.c,v 1.13.2.2 2005/01/28 16:47:16 tony2001 Exp $ */
+/* $Id: ftok.c,v 1.16 2005/08/03 14:08:01 sniper Exp $ */
#include "php.h"
@@ -49,7 +49,7 @@ PHP_FUNCTION(ftok)
if (Z_STRLEN_PP(proj)!=1){
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Project identifier is invalid");
RETURN_LONG(-1);
- }
+ }
if ((PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(pathname), NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(Z_STRVAL_PP(pathname) TSRMLS_CC)) {
RETURN_LONG(-1);
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index a7be53ac9..9018299a8 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
| Sara Golemon <pollita@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: ftp_fopen_wrapper.c,v 1.74.2.7 2005/06/27 08:16:42 sesser Exp $ */
+/* $Id: ftp_fopen_wrapper.c,v 1.85.2.2 2005/11/22 03:01:39 iliaa Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -49,7 +49,6 @@
#ifdef PHP_WIN32
#include <winsock2.h>
#elif defined(NETWARE) && defined(USE_WINSOCK)
-/*#include <ws2nlm.h>*/
#include <novsock2.h>
#else
#include <netinet/in.h>
@@ -116,6 +115,8 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, char *path
int result, use_ssl, use_ssl_on_data = 0, tmp_len;
char *scratch;
char tmp_line[512];
+ char *transport;
+ int transport_len;
resource = php_url_parse(path);
if (resource == NULL || resource->path == NULL) {
@@ -131,7 +132,9 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, char *path
if (resource->port == 0)
resource->port = 21;
- stream = php_stream_sock_open_host(resource->host, resource->port, SOCK_STREAM, NULL, 0);
+ transport_len = spprintf(&transport, 0, "tcp://%s:%d", resource->host, resource->port);
+ stream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, context, NULL, NULL);
+ efree(transport);
if (stream == NULL) {
result = 0; /* silence */
goto connect_errexit;
@@ -215,20 +218,18 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, char *path
} \
s++; \
} \
-}
+}
/* send the user name */
- php_stream_write_string(stream, "USER ");
if (resource->user != NULL) {
tmp_len = php_raw_url_decode(resource->user, strlen(resource->user));
PHP_FTP_CNTRL_CHK(resource->user, tmp_len, "Invalid login %s")
- php_stream_write_string(stream, resource->user);
+ php_stream_printf(stream TSRMLS_CC, "USER %s\r\n", resource->user);
} else {
- php_stream_write_string(stream, "anonymous");
+ php_stream_write_string(stream, "USER anonymous\r\n");
}
- php_stream_write_string(stream, "\r\n");
/* get the response */
result = GET_FTP_RESULT(stream);
@@ -237,24 +238,22 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, char *path
if (result >= 300 && result <= 399) {
php_stream_notify_info(context, PHP_STREAM_NOTIFY_AUTH_REQUIRED, tmp_line, 0);
- php_stream_write_string(stream, "PASS ");
if (resource->pass != NULL) {
tmp_len = php_raw_url_decode(resource->pass, strlen(resource->pass));
PHP_FTP_CNTRL_CHK(resource->pass, tmp_len, "Invalid password %s")
- php_stream_write_string(stream, resource->pass);
+ php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", resource->pass);
} else {
/* if the user has configured who they are,
send that as the password */
if (cfg_get_string("from", &scratch) == SUCCESS) {
- php_stream_write_string(stream, scratch);
+ php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", scratch);
} else {
- php_stream_write_string(stream, "anonymous");
+ php_stream_write_string(stream, "PASS anonymous\r\n");
}
}
- php_stream_write_string(stream, "\r\n");
-
+
/* read the response */
result = GET_FTP_RESULT(stream);
@@ -400,6 +399,8 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
zval **tmpzval;
int allow_overwrite = 0;
int read_write = 0;
+ char *transport;
+ int transport_len;
tmp_line[0] = '\0';
@@ -423,6 +424,18 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
return NULL;
}
+ if (context &&
+ php_stream_context_get_option(context, "ftp", "proxy", &tmpzval) == SUCCESS) {
+ if (read_write == 1) {
+ /* Use http wrapper to proxy ftp request */
+ return php_stream_url_wrap_http(wrapper, path, mode, options, opened_path, context STREAMS_CC TSRMLS_CC);
+ } else {
+ /* ftp proxy is read-only */
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP proxy may only be used in read mode");
+ return NULL;
+ }
+ }
+
stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data TSRMLS_CC);
if (!stream) {
goto errexit;
@@ -435,9 +448,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
goto errexit;
/* find out the size of the file (verifying it exists) */
- php_stream_write_string(stream, "SIZE ");
- php_stream_write_string(stream, resource->path);
- php_stream_write_string(stream, "\r\n");
+ php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", resource->path);
/* read the response */
result = GET_FTP_RESULT(stream);
@@ -466,9 +477,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
if (allow_overwrite) {
/* Context permits overwritting file,
so we just delete whatever's there in preparation */
- php_stream_write_string(stream, "DELE ");
- php_stream_write_string(stream, resource->path);
- php_stream_write_string(stream, "\r\n");
+ php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
if (result >= 300 || result <= 199) {
goto errexit;
@@ -495,8 +504,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
php_stream_context_get_option(context, "ftp", "resume_pos", &tmpzval) == SUCCESS &&
Z_TYPE_PP(tmpzval) == IS_LONG &&
Z_LVAL_PP(tmpzval) > 0) {
- snprintf(tmp_line, 511, "REST %ld\r\n", Z_LVAL_PP(tmpzval));
- php_stream_write_string(stream, tmp_line);
+ php_stream_printf(stream TSRMLS_CC, "REST %ld\r\n", Z_LVAL_PP(tmpzval));
result = GET_FTP_RESULT(stream);
if (result < 300 || result > 399) {
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to resume from offset %d", Z_LVAL_PP(tmpzval));
@@ -505,26 +513,23 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
}
/* retrieve file */
- php_stream_write_string(stream, "RETR ");
+ memcpy(tmp_line, "RETR", sizeof("RETR"));
} else if (read_write == 2) {
/* Write new file */
- php_stream_write_string(stream, "STOR ");
+ memcpy(tmp_line, "STOR", sizeof("STOR"));
} else {
/* Append */
- php_stream_write_string(stream, "APPE ");
+ memcpy(tmp_line, "APPE", sizeof("APPE"));
}
- if (resource->path != NULL) {
- php_stream_write_string(stream, resource->path);
- } else {
- php_stream_write_string(stream, "/");
- }
- php_stream_write_string(stream, "\r\n");
+ php_stream_printf(stream TSRMLS_CC, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/"));
/* open the data channel */
if (hoststart == NULL) {
hoststart = resource->host;
}
- datastream = php_stream_sock_open_host(hoststart, portno, SOCK_STREAM, 0, 0);
+ transport_len = spprintf(&transport, 0, "tcp://%s:%d", hoststart, portno);
+ datastream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, context, NULL, NULL);
+ efree(transport);
if (datastream == NULL) {
goto errexit;
}
@@ -542,9 +547,9 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
php_stream_context_set(datastream, context);
php_stream_notify_progress_init(context, 0, file_size);
- if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream,
+ if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream,
STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0)) {
+ php_stream_xport_crypto_enable(datastream, 1 TSRMLS_CC) < 0)) {
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode");
php_stream_close(datastream);
@@ -681,13 +686,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, char *path, cha
goto opendir_errexit;
}
- php_stream_write_string(stream, "NLST ");
- if (resource->path != NULL) {
- php_stream_write_string(stream, resource->path);
- } else {
- php_stream_write_string(stream, "/");
- }
- php_stream_write_string(stream, "\r\n");
+ php_stream_printf(stream TSRMLS_CC, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/"));
/* open the data channel */
if (hoststart == NULL) {
@@ -758,9 +757,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f
}
ssb->sb.st_mode = 0644; /* FTP won't give us a valid mode, so aproximate one based on being readable */
- php_stream_write_string(stream, "CWD "); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */
- php_stream_write_string(stream, resource->path);
- php_stream_write_string(stream, "\r\n");
+ php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
ssb->sb.st_mode |= S_IFREG;
@@ -768,13 +765,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f
ssb->sb.st_mode |= S_IFDIR;
}
- php_stream_write_string(stream, "SIZE ");
- if (resource->path != NULL) {
- php_stream_write_string(stream, resource->path);
- } else {
- php_stream_write_string(stream, "/");
- }
- php_stream_write_string(stream, "\r\n");
+ php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
/* Failure either means it doesn't exist
@@ -789,19 +780,67 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f
ssb->sb.st_size = atoi(tmp_line + 4);
}
+ php_stream_printf(stream TSRMLS_CC, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ result = GET_FTP_RESULT(stream);
+ if (result == 213) {
+ char *p = tmp_line + 4;
+ int n;
+ struct tm tm, tmbuf, *gmt;
+ time_t stamp;
+
+ while (p - tmp_line < sizeof(tmp_line) && !isdigit(*p)) {
+ p++;
+ }
+
+ if (p - tmp_line > sizeof(tmp_line)) {
+ goto mdtm_error;
+ }
+
+ n = sscanf(p, "%4u%2u%2u%2u%2u%2u", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec);
+ if (n != 6) {
+ goto mdtm_error;
+ }
+
+ tm.tm_year -= 1900;
+ tm.tm_mon--;
+ tm.tm_isdst = -1;
+
+ /* figure out the GMT offset */
+ stamp = time(NULL);
+ gmt = php_gmtime_r(&stamp, &tmbuf);
+ gmt->tm_isdst = -1;
+
+ /* apply the GMT offset */
+ tm.tm_sec += stamp - mktime(gmt);
+ tm.tm_isdst = gmt->tm_isdst;
+
+#ifdef NETWARE
+ ssb->sb.st_mtime.tv_sec = mktime(&tm);
+#else
+ ssb->sb.st_mtime = mktime(&tm);
+#endif
+ } else {
+ /* error or unsupported command */
+ mdtm_error:
+#ifdef NETWARE
+ ssb->sb.st_mtime.tv_sec = -1;
+#else
+ ssb->sb.st_mtime = -1;
+#endif
+ }
+
ssb->sb.st_ino = 0; /* Unknown values */
ssb->sb.st_dev = 0;
ssb->sb.st_uid = 0;
ssb->sb.st_gid = 0;
#ifdef NETWARE
ssb->sb.st_atime.tv_sec = -1;
- ssb->sb.st_mtime.tv_sec = -1;
ssb->sb.st_ctime.tv_sec = -1;
#else
ssb->sb.st_atime = -1;
- ssb->sb.st_mtime = -1;
ssb->sb.st_ctime = -1;
#endif
+
ssb->sb.st_nlink = 1;
ssb->sb.st_rdev = -1;
#ifdef HAVE_ST_BLKSIZE
@@ -850,9 +889,7 @@ static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, char *url, int opt
}
/* Attempt to delete the file */
- php_stream_write_string(stream, "DELE ");
- php_stream_write_string(stream, resource->path);
- php_stream_write_string(stream, "\r\n");
+ php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
@@ -916,9 +953,7 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, char *url_from, ch
}
/* Rename FROM */
- php_stream_write_string(stream, "RNFR ");
- php_stream_write_string(stream, resource_from->path);
- php_stream_write_string(stream, "\r\n");
+ php_stream_printf(stream TSRMLS_CC, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 300 || result > 399) {
@@ -929,9 +964,7 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, char *url_from, ch
}
/* Rename TO */
- php_stream_write_string(stream, "RNTO ");
- php_stream_write_string(stream, resource_to->path);
- php_stream_write_string(stream, "\r\n");
+ php_stream_printf(stream TSRMLS_CC, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
@@ -1110,7 +1143,7 @@ static php_stream_wrapper_ops ftp_stream_wops = {
php_stream_ftp_stream_stat,
php_stream_ftp_url_stat, /* stat_url */
php_stream_ftp_opendir, /* opendir */
- "FTP",
+ "ftp",
php_stream_ftp_unlink, /* unlink */
php_stream_ftp_rename, /* rename */
php_stream_ftp_mkdir, /* mkdir */
diff --git a/ext/standard/head.c b/ext/standard/head.c
index e59754f57..a23f7c051 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,11 +15,12 @@
| Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: head.c,v 1.75.2.2 2005/06/28 14:49:14 hyanantha Exp $ */
+/* $Id: head.c,v 1.84 2005/08/03 14:08:01 sniper Exp $ */
#include <stdio.h>
#include "php.h"
#include "ext/standard/php_standard.h"
+#include "ext/date/php_date.h"
#include "SAPI.h"
#include "php_main.h"
#include "head.h"
@@ -63,7 +64,6 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
{
char *cookie, *encoded_value = NULL;
int len=sizeof("Set-Cookie: ");
- time_t t;
char *dt;
sapi_header_line ctr = {0};
int result;
@@ -102,15 +102,15 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
* so in order to force cookies to be deleted, even on MSIE, we
* pick an expiry date 1 year and 1 second in the past
*/
- t = time(NULL) - 31536001;
- dt = php_std_date(t TSRMLS_CC);
+ time_t t = time(NULL) - 31536001;
+ dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, t, 0 TSRMLS_CC);
sprintf(cookie, "Set-Cookie: %s=deleted; expires=%s", name, dt);
efree(dt);
} else {
sprintf(cookie, "Set-Cookie: %s=%s", name, value ? encoded_value : "");
if (expires > 0) {
strcat(cookie, "; expires=");
- dt = php_std_date(expires TSRMLS_CC);
+ dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0 TSRMLS_CC);
strcat(cookie, dt);
efree(dt);
}
@@ -238,7 +238,7 @@ static void php_head_apply_header_list_to_hash(void *data, void *arg TSRMLS_DC)
}
}
-/* {{{ proto string headers_list(void)
+/* {{{ proto array headers_list(void)
Return list of headers to be sent / already sent */
PHP_FUNCTION(headers_list)
{
diff --git a/ext/standard/head.h b/ext/standard/head.h
index 9b42b3738..52b9c5889 100644
--- a/ext/standard/head.h
+++ b/ext/standard/head.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: head.h,v 1.27 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: head.h,v 1.28 2005/08/03 14:08:01 sniper Exp $ */
#ifndef HEAD_H
#define HEAD_H
diff --git a/ext/standard/html.c b/ext/standard/html.c
index aa96423f7..34884d014 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: html.c,v 1.97.2.10 2005/05/11 14:58:34 jorton Exp $ */
+/* $Id: html.c,v 1.111 2005/08/03 14:08:01 sniper Exp $ */
/*
* HTML entity resources:
@@ -465,6 +465,12 @@ static const struct {
{ 0, NULL, 0, 0 }
};
+struct basic_entities_dec {
+ unsigned short charcode;
+ char entity[8];
+ int entitylen;
+};
+
#define MB_RETURN { \
*newpos = pos; \
mbseq[mbpos] = '\0'; \
@@ -1206,6 +1212,72 @@ PHP_FUNCTION(htmlspecialchars)
}
/* }}} */
+/* {{{ proto string htmlspecialchars(string string [, int quote_style])
+ Convert special HTML entities back to characters */
+PHP_FUNCTION(htmlspecialchars_decode)
+{
+ char *str, *new_str, *e, *p;
+ int len, j, i, new_len;
+ long quote_style = ENT_COMPAT;
+ struct basic_entities_dec basic_entities_dec[8];
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &len, &quote_style) == FAILURE) {
+ return;
+ }
+
+ new_str = estrndup(str, len);
+ new_len = len;
+ e = new_str + new_len;
+
+ if (!(p = memchr(new_str, '&', new_len))) {
+ RETURN_STRINGL(new_str, new_len, 0);
+ }
+
+ for (j = 0, i = 0; basic_entities[i].charcode != 0; i++) {
+ if (basic_entities[i].flags && !(quote_style & basic_entities[i].flags)) {
+ continue;
+ }
+ basic_entities_dec[j].charcode = basic_entities[i].charcode;
+ memcpy(basic_entities_dec[j].entity, basic_entities[i].entity, basic_entities[i].entitylen + 1);
+ basic_entities_dec[j].entitylen = basic_entities[i].entitylen;
+ j++;
+ }
+ basic_entities_dec[j].charcode = '&';
+ basic_entities_dec[j].entitylen = sizeof("&amp;") - 1;
+ memcpy(basic_entities_dec[j].entity, "&amp;", sizeof("&amp;"));
+ i = j + 1;
+
+ do {
+ int l = e - p;
+
+ for (j = 0; j < i; j++) {
+ if (basic_entities_dec[j].entitylen > l) {
+ continue;
+ }
+ if (!memcmp(p, basic_entities_dec[j].entity, basic_entities_dec[j].entitylen)) {
+ int e_len = basic_entities_dec[j].entitylen - 1;
+
+ *p++ = basic_entities_dec[j].charcode;
+ memmove(p, p + e_len, (e - p - e_len));
+ e -= e_len;
+ goto done;
+ }
+ }
+ p++;
+
+done:
+ if (p >= e) {
+ break;
+ }
+ } while ((p = memchr(p, '&', (e - p))));
+
+ new_len = e - new_str;
+
+ new_str[new_len] = '\0';
+ RETURN_STRINGL(new_str, new_len, 0);
+}
+/* }}} */
+
/* {{{ proto string html_entity_decode(string string [, int quote_style][, string charset])
Convert all HTML entities to their applicable characters */
PHP_FUNCTION(html_entity_decode)
diff --git a/ext/standard/html.h b/ext/standard/html.h
index 4889e0d98..19f71a876 100644
--- a/ext/standard/html.h
+++ b/ext/standard/html.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: html.h,v 1.18 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: html.h,v 1.20 2005/08/03 14:08:04 sniper Exp $ */
#ifndef HTML_H
#define HTML_H
@@ -33,6 +33,7 @@ void register_html_constants(INIT_FUNC_ARGS);
PHP_FUNCTION(htmlspecialchars);
PHP_FUNCTION(htmlentities);
+PHP_FUNCTION(htmlspecialchars_decode);
PHP_FUNCTION(html_entity_decode);
PHP_FUNCTION(get_html_translation_table);
diff --git a/ext/standard/http.c b/ext/standard/http.c
index 5efb1d4c7..46de0c0b8 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: http.c,v 1.13 2004/06/04 16:54:14 abies Exp $ */
+/* $Id: http.c,v 1.14.2.1 2005/09/16 17:10:58 tony2001 Exp $ */
#include "php_http.h"
#include "php_ini.h"
@@ -69,7 +69,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
/* private or protected property access outside of the class */
continue;
}
- zend_unmangle_property_name(key, &tmp, &key);
+ zend_unmangle_property_name_ex(key, key_len, &tmp, &key);
key_len = strlen(key);
}
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index f46041558..49c2df18c 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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,9 +16,10 @@
| Jim Winstead <jimw@php.net> |
| Hartmut Holzgraefe <hholzgra@php.net> |
| Wez Furlong <wez@thebrainroom.com> |
+ | Sara Golemon <pollita@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.88.2.4 2005/06/06 12:41:28 derick Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.99.2.3 2005/11/15 14:46:34 iliaa Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -26,6 +27,7 @@
#include "php_network.h"
#include "php_ini.h"
#include "ext/standard/basic_functions.h"
+#include "ext/standard/php_smart_str.h"
#include <stdio.h>
#include <stdlib.h>
@@ -51,7 +53,6 @@
#ifdef PHP_WIN32
#include <winsock2.h>
#elif defined(NETWARE) && defined(USE_WINSOCK)
-/*#include <ws2nlm.h>*/
#include <novsock2.h>
#else
#include <netinet/in.h>
@@ -77,7 +78,7 @@
#define HTTP_HEADER_HOST 2
#define HTTP_HEADER_AUTH 4
#define HTTP_HEADER_FROM 8
-#define HTTP_HEADER_CONTENT_LENGTH 16
+#define HTTP_HEADER_CONTENT_LENGTH 16
#define HTTP_HEADER_TYPE 32
php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int header_init STREAMS_DC TSRMLS_DC)
@@ -85,6 +86,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
php_stream *stream = NULL;
php_url *resource = NULL;
int use_ssl;
+ int use_proxy = 0;
char *scratch = NULL;
char *tmp = NULL;
char *ua_str = NULL;
@@ -100,16 +102,13 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
int eol_detect = 0;
char *transport_string, *errstr = NULL;
int transport_len, have_header = 0, request_fulluri = 0;
+ char *protocol_version = NULL;
+ int protocol_version_len = 3; /* Default: "1.0" */
tmp_line[0] = '\0';
if (redirect_max < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Circular redirect, aborting.");
- return NULL;
- }
-
- if (strpbrk(mode, "awx+")) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP wrapper does not support writeable connections.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Redirection limit reached, aborting.");
return NULL;
}
@@ -119,26 +118,45 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
}
if (strncasecmp(resource->scheme, "http", sizeof("http")) && strncasecmp(resource->scheme, "https", sizeof("https"))) {
- php_url_free(resource);
- return php_stream_open_wrapper_ex(path, mode, ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
- }
-
- use_ssl = resource->scheme && (strlen(resource->scheme) > 4) && resource->scheme[4] == 's';
- /* choose default ports */
- if (use_ssl && resource->port == 0)
- resource->port = 443;
- else if (resource->port == 0)
- resource->port = 80;
-
- if (context && !use_ssl &&
- php_stream_context_get_option(context, "http", "proxy", &tmpzval) == SUCCESS &&
- Z_TYPE_PP(tmpzval) == IS_STRING &&
- Z_STRLEN_PP(tmpzval) > 0) {
- /* Don't use proxy server for SSL resources */
+ if (!context ||
+ php_stream_context_get_option(context, wrapper->wops->label, "proxy", &tmpzval) == FAILURE ||
+ Z_TYPE_PP(tmpzval) != IS_STRING ||
+ Z_STRLEN_PP(tmpzval) <= 0) {
+ php_url_free(resource);
+ return php_stream_open_wrapper_ex(path, mode, ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
+ }
+ /* Called from a non-http wrapper with http proxying requested (i.e. ftp) */
+ request_fulluri = 1;
+ use_ssl = 0;
+ use_proxy = 1;
+
transport_len = Z_STRLEN_PP(tmpzval);
transport_string = estrndup(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval));
} else {
- transport_len = spprintf(&transport_string, 0, "%s://%s:%d", use_ssl ? "ssl" : "tcp", resource->host, resource->port);
+ /* Normal http request (possibly with proxy) */
+
+ if (strpbrk(mode, "awx+")) {
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP wrapper does not support writeable connections.");
+ return NULL;
+ }
+
+ use_ssl = resource->scheme && (strlen(resource->scheme) > 4) && resource->scheme[4] == 's';
+ /* choose default ports */
+ if (use_ssl && resource->port == 0)
+ resource->port = 443;
+ else if (resource->port == 0)
+ resource->port = 80;
+
+ if (context &&
+ php_stream_context_get_option(context, wrapper->wops->label, "proxy", &tmpzval) == SUCCESS &&
+ Z_TYPE_PP(tmpzval) == IS_STRING &&
+ Z_STRLEN_PP(tmpzval) > 0) {
+ use_proxy = 1;
+ transport_len = Z_STRLEN_PP(tmpzval);
+ transport_string = estrndup(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval));
+ } else {
+ transport_len = spprintf(&transport_string, 0, "%s://%s:%d", use_ssl ? "ssl" : "tcp", resource->host, resource->port);
+ }
}
stream = php_stream_xport_create(transport_string, transport_len, options,
@@ -153,6 +171,45 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
efree(transport_string);
+ if (stream && use_proxy && use_ssl) {
+ smart_str header = {0};
+
+ smart_str_appendl(&header, "CONNECT ", sizeof("CONNECT ")-1);
+ smart_str_appends(&header, resource->host);
+ smart_str_appendc(&header, ':');
+ smart_str_append_unsigned(&header, resource->port);
+ smart_str_appendl(&header, " HTTP/1.0\r\n\r\n", sizeof(" HTTP/1.0\r\n\r\n")-1);
+ if (php_stream_write(stream, header.c, header.len) != header.len) {
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot conect to HTTPS server through proxy");
+ php_stream_close(stream);
+ stream = NULL;
+ }
+ smart_str_free(&header);
+
+ if (stream) {
+ char header_line[HTTP_HEADER_BLOCK_SIZE];
+
+ /* get response header */
+ while (php_stream_gets(stream, header_line, HTTP_HEADER_BLOCK_SIZE-1) != NULL) {
+ if (header_line[0] == '\n' ||
+ header_line[0] == '\r' ||
+ header_line[0] == '\0') {
+ break;
+ }
+ }
+ }
+
+ /* enable SSL transport layer */
+ if (stream) {
+ if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot conect to HTTPS server through proxy");
+ php_stream_close(stream);
+ stream = NULL;
+ }
+ }
+ }
+
if (stream == NULL)
goto out;
@@ -169,7 +226,13 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
- if (context &&
+ if (header_init && context && php_stream_context_get_option(context, "http", "max_redirects", &tmpzval) == SUCCESS) {
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_long_ex(tmpzval);
+ redirect_max = Z_LVAL_PP(tmpzval);
+ }
+
+ if (header_init && context &&
php_stream_context_get_option(context, "http", "method", &tmpzval) == SUCCESS) {
if (Z_TYPE_PP(tmpzval) == IS_STRING && Z_STRLEN_PP(tmpzval) > 0) {
scratch_len = strlen(path) + 29 + Z_STRLEN_PP(tmpzval);
@@ -179,20 +242,30 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
}
}
+ if (context &&
+ php_stream_context_get_option(context, "http", "protocol_version", &tmpzval) == SUCCESS) {
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_double_ex(tmpzval);
+ protocol_version_len = spprintf(&protocol_version, 0, "%.1f", Z_DVAL_PP(tmpzval));
+ zval_ptr_dtor(tmpzval);
+ }
+
if (!scratch) {
- scratch_len = strlen(path) + 32;
+ scratch_len = strlen(path) + 29 + protocol_version_len;
scratch = emalloc(scratch_len);
strcpy(scratch, "GET ");
}
/* Should we send the entire path in the request line, default to no. */
- if (context &&
+ if (!request_fulluri &&
+ context &&
php_stream_context_get_option(context, "http", "request_fulluri", &tmpzval) == SUCCESS) {
- (*tmpzval)->refcount++;
- SEPARATE_ZVAL(tmpzval);
- convert_to_boolean_ex(tmpzval);
- request_fulluri = Z_BVAL_PP(tmpzval) ? 1 : 0;
- zval_ptr_dtor(tmpzval);
+ zval tmp = **tmpzval;
+
+ zval_copy_ctor(&tmp);
+ convert_to_boolean(&tmp);
+ request_fulluri = Z_BVAL(tmp) ? 1 : 0;
+ zval_dtor(&tmp);
}
if (request_fulluri) {
@@ -216,7 +289,16 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
}
/* protocol version we are speaking */
- strlcat(scratch, " HTTP/1.0\r\n", scratch_len);
+ if (protocol_version) {
+ strlcat(scratch, " HTTP/", scratch_len);
+ strlcat(scratch, protocol_version, scratch_len);
+ strlcat(scratch, "\r\n", scratch_len);
+ efree(protocol_version);
+ protocol_version = NULL;
+ } else {
+ strlcat(scratch, " HTTP/1.0\r\n", scratch_len);
+ }
+
/* send it */
php_stream_write(stream, scratch, strlen(scratch));
@@ -228,6 +310,35 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
php_trim will estrndup() */
tmp = php_trim(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC);
if (strlen(tmp) > 0) {
+ if (!header_init) { /* Remove post headers for redirects */
+ int l = strlen(tmp);
+ char *s, *s2, *tmp_c = estrdup(tmp);
+
+ php_strtolower(tmp_c, l);
+ if ((s = strstr(tmp_c, "content-length:"))) {
+ if ((s2 = memchr(s, '\n', tmp_c + l - s))) {
+ int b = tmp_c + l - 1 - s2;
+ memmove(tmp, tmp + (s2 + 1 - tmp_c), b);
+ memmove(tmp_c, s2 + 1, b);
+
+ } else {
+ tmp[s - tmp_c] = *s = '\0';
+ }
+ l = strlen(tmp_c);
+ }
+ if ((s = strstr(tmp_c, "content-type:"))) {
+ if ((s2 = memchr(s, '\n', tmp_c + l - s))) {
+ memmove(tmp, tmp + (s2 + 1 - tmp_c), tmp_c + l - 1 - s2);
+ } else {
+ tmp[s - tmp_c] = '\0';
+ }
+ }
+ efree(tmp_c);
+ tmp_c = php_trim(tmp, strlen(tmp), NULL, 0, NULL, 3 TSRMLS_CC);
+ efree(tmp);
+ tmp = tmp_c;
+ }
+
/* Output trimmed headers with \r\n at the end */
php_stream_write(stream, tmp, strlen(tmp));
php_stream_write(stream, "\r\n", sizeof("\r\n") - 1);
@@ -286,7 +397,8 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
/* Send Host: header so name-based virtual hosts work */
if ((have_header & HTTP_HEADER_HOST) == 0) {
- if ((use_ssl && resource->port != 443) || (!use_ssl && resource->port != 80)) {
+ if ((use_ssl && resource->port != 443 && resource->port != 0) ||
+ (!use_ssl && resource->port != 80 && resource->port != 0)) {
if (snprintf(scratch, scratch_len, "Host: %s:%i\r\n", resource->host, resource->port) > 0)
php_stream_write(stream, scratch, strlen(scratch));
} else {
@@ -327,7 +439,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
}
/* Request content, such as for POST requests */
- if (context &&
+ if (header_init && context &&
php_stream_context_get_option(context, "http", "content", &tmpzval) == SUCCESS &&
Z_STRLEN_PP(tmpzval) > 0) {
if (!(have_header & HTTP_HEADER_CONTENT_LENGTH)) {
@@ -348,12 +460,11 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
location[0] = '\0';
- if (!header_init && FAILURE == zend_hash_find(EG(active_symbol_table),
- "http_response_header", sizeof("http_response_header"), (void **) &response_header)) {
- header_init = 1;
- }
-
- if (header_init) {
+ if (!header_init) {
+ MAKE_STD_ZVAL(stream->wrapperdata);
+ array_init(stream->wrapperdata);
+ response_header = &stream->wrapperdata;
+ } else {
zval *tmp;
MAKE_STD_ZVAL(tmp);
array_init(tmp);
@@ -363,7 +474,6 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
"http_response_header", sizeof("http_response_header"), (void **) &response_header);
}
-
if (!php_stream_eof(stream)) {
size_t tmp_line_len;
/* get response header */
@@ -372,9 +482,6 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
zval *http_response;
int response_code;
- MAKE_STD_ZVAL(http_response);
- ZVAL_NULL(http_response);
-
if (tmp_line_len > 9) {
response_code = atoi(tmp_line + 9);
} else {
@@ -383,6 +490,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
switch(response_code) {
case 200:
case 302:
+ case 303:
case 301:
reqok = 1;
break;
@@ -398,18 +506,14 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
php_stream_notify_error(context, PHP_STREAM_NOTIFY_FAILURE,
tmp_line, response_code);
}
-
- Z_STRLEN_P(http_response) = tmp_line_len;
- Z_STRVAL_P(http_response) = estrndup(tmp_line, Z_STRLEN_P(http_response));
- if (Z_STRVAL_P(http_response)[Z_STRLEN_P(http_response)-1]=='\n') {
- Z_STRVAL_P(http_response)[Z_STRLEN_P(http_response)-1]=0;
- Z_STRLEN_P(http_response)--;
- if (Z_STRVAL_P(http_response)[Z_STRLEN_P(http_response)-1]=='\r') {
- Z_STRVAL_P(http_response)[Z_STRLEN_P(http_response)-1]=0;
- Z_STRLEN_P(http_response)--;
+ if (tmp_line[tmp_line_len - 1] == '\n') {
+ --tmp_line_len;
+ if (tmp_line[tmp_line_len - 1] == '\r') {
+ --tmp_line_len;
}
}
- Z_TYPE_P(http_response) = IS_STRING;
+ MAKE_STD_ZVAL(http_response);
+ ZVAL_STRINGL(http_response, tmp_line, tmp_line_len, 1);
zend_hash_next_index_insert(Z_ARRVAL_PP(response_header), &http_response, sizeof(zval *), NULL);
}
} else {
@@ -547,8 +651,8 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
CHECK_FOR_CNTRL_CHARS(resource->pass)
CHECK_FOR_CNTRL_CHARS(resource->path)
- stream = php_stream_url_wrap_http_ex(NULL, new_path, mode, options, opened_path, context, --redirect_max, 0 STREAMS_CC TSRMLS_CC);
- if (stream && stream->wrapperdata) {
+ stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, 0 STREAMS_CC TSRMLS_CC);
+ if (stream && stream->wrapperdata && *response_header != stream->wrapperdata) {
entryp = &entry;
MAKE_STD_ZVAL(entry);
ZVAL_EMPTY_STRING(entry);
@@ -567,10 +671,18 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
}
}
out:
- if (http_header_line)
+ if (protocol_version) {
+ efree(protocol_version);
+ }
+
+ if (http_header_line) {
efree(http_header_line);
- if (scratch)
+ }
+
+ if (scratch) {
efree(scratch);
+ }
+
if (resource) {
php_url_free(resource);
}
@@ -591,6 +703,7 @@ out:
/* as far as streams are concerned, we are now at the start of
* the stream */
stream->position = 0;
+
}
return stream;
@@ -618,7 +731,7 @@ static php_stream_wrapper_ops http_stream_wops = {
php_stream_http_stream_stat,
NULL, /* stat_url */
NULL, /* opendir */
- "HTTP",
+ "http",
NULL, /* unlink */
NULL, /* rename */
NULL, /* mkdir */
diff --git a/ext/standard/image.c b/ext/standard/image.c
index db22f779a..661b02b22 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: image.c,v 1.98.2.10 2005/06/28 15:22:39 hyanantha Exp $ */
+/* $Id: image.c,v 1.114 2005/08/03 14:08:05 sniper Exp $ */
#include "php.h"
#include <stdio.h>
@@ -625,8 +625,8 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
dummy_short = php_read2(stream TSRMLS_CC); /* Lsiz */
dummy_short = php_read2(stream TSRMLS_CC); /* Rsiz */
- result->width = php_read4(stream TSRMLS_CC); /* Ysiz */
- result->height = php_read4(stream TSRMLS_CC); /* Xsiz */
+ result->width = php_read4(stream TSRMLS_CC); /* Xsiz */
+ result->height = php_read4(stream TSRMLS_CC); /* Ysiz */
#if MBO_0
php_read4(stream TSRMLS_CC); /* XOsiz */
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c
index 4b94aaa8f..0c897c9c1 100644
--- a/ext/standard/incomplete_class.c
+++ b/ext/standard/incomplete_class.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
*/
-/* $Id: incomplete_class.c,v 1.24.2.3 2004/11/25 20:28:37 zeev Exp $ */
+/* $Id: incomplete_class.c,v 1.28 2005/08/03 14:08:05 sniper Exp $ */
#include "php.h"
#include "basic_functions.h"
@@ -82,8 +82,8 @@ static int incomplete_class_has_property(zval *object, zval *member, int check_e
return 0;
}
-static union _zend_function *incomplete_class_get_method(zval *object_ptr, char *method, int method_len TSRMLS_DC) {
- incomplete_class_message(object_ptr, E_ERROR TSRMLS_CC);
+static union _zend_function *incomplete_class_get_method(zval **object, char *method, int method_len TSRMLS_DC) {
+ incomplete_class_message(*object, E_ERROR TSRMLS_CC);
return NULL;
}
@@ -122,7 +122,7 @@ zend_class_entry *php_create_incomplete_class(TSRMLS_D)
/* {{{ php_lookup_class_name
*/
-char *php_lookup_class_name(zval *object, size_t *nlen)
+char *php_lookup_class_name(zval *object, zend_uint *nlen)
{
zval **val;
char *retval = NULL;
@@ -144,7 +144,7 @@ char *php_lookup_class_name(zval *object, size_t *nlen)
/* {{{ php_store_class_name
*/
-void php_store_class_name(zval *object, const char *name, size_t len)
+void php_store_class_name(zval *object, const char *name, zend_uint len)
{
zval *val;
TSRMLS_FETCH();
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 0e3ae4412..56d235e18 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: info.c,v 1.245.2.5 2005/08/16 00:25:46 iliaa Exp $ */
+/* $Id: info.c,v 1.249.2.5 2005/11/23 00:15:08 iliaa Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -149,14 +149,16 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
php_ob_get_buffer(tmp3 TSRMLS_CC);
php_end_ob_buffer(0, 0 TSRMLS_CC);
- elem_esc = php_info_html_esc(Z_STRVAL_P(tmp3) TSRMLS_CC);
- PUTS(elem_esc);
- efree(elem_esc);
- zval_ptr_dtor(&tmp3);
-
if (!sapi_module.phpinfo_as_text) {
+ elem_esc = php_info_html_esc(Z_STRVAL_P(tmp3) TSRMLS_CC);
+ PUTS(elem_esc);
+ efree(elem_esc);
PUTS("</pre>");
+ } else {
+ PUTS(Z_STRVAL_P(tmp3));
}
+ zval_ptr_dtor(&tmp3);
+
} else if (Z_TYPE_PP(tmp) != IS_STRING) {
tmp2 = **tmp;
zval_copy_ctor(&tmp2);
@@ -201,9 +203,9 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
*/
void php_info_print_style(TSRMLS_D)
{
- php_printf("<style type=\"text/css\"><!--\n");
+ php_printf("<style type=\"text/css\">\n");
php_info_print_css(TSRMLS_C);
- php_printf("//--></style>\n");
+ php_printf("</style>\n");
}
/* }}} */
@@ -566,6 +568,47 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_table_row(2, "Stream Socket Transports", "disabled"); /* ?? */
}
}
+
+ {
+ HashTable *stream_filter_hash;
+ char *filter_name, *filter_buf = NULL;
+ int filter_name_len, filter_buf_len = 0, filter_buf_size = 0;
+ ulong num_key;
+
+ if ((stream_filter_hash = php_get_stream_filters_hash())) {
+ for(zend_hash_internal_pointer_reset(stream_filter_hash);
+ zend_hash_get_current_key_ex(stream_filter_hash, &filter_name, &filter_name_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING;
+ zend_hash_move_forward(stream_filter_hash)) {
+ if (filter_buf_len + filter_name_len + 3 > filter_buf_size) {
+ while (filter_buf_len + filter_name_len + 3 > filter_buf_size) {
+ filter_buf_size += 256;
+ }
+ if (filter_buf) {
+ filter_buf = erealloc(filter_buf, filter_buf_size);
+ } else {
+ filter_buf = emalloc(filter_buf_size);
+ }
+ }
+ if (filter_buf_len > 0) {
+ filter_buf[filter_buf_len++] = ',';
+ filter_buf[filter_buf_len++] = ' ';
+ }
+ memcpy(filter_buf + filter_buf_len, filter_name, filter_name_len);
+ filter_buf_len += filter_name_len;
+ filter_buf[filter_buf_len] = '\0';
+ }
+ if (filter_buf) {
+ php_info_print_table_row(2, "Registered Stream Filters", filter_buf);
+ efree(filter_buf);
+ } else {
+ /* Any chances we will ever hit this? */
+ php_info_print_table_row(2, "Registered Stream Filters", "no filters registered");
+ }
+ } else {
+ /* Any chances we will ever hit this? */
+ php_info_print_table_row(2, "Stream Filters", "disabled"); /* ?? */
+ }
+ }
php_info_print_table_end();
diff --git a/ext/standard/info.h b/ext/standard/info.h
index 48d8c84ef..3756e7bc6 100644
--- a/ext/standard/info.h
+++ b/ext/standard/info.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: info.h,v 1.37 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: info.h,v 1.38 2005/08/03 14:08:07 sniper Exp $ */
#ifndef INFO_H
#define INFO_H
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index 601d31ca5..01262607e 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: iptc.c,v 1.48 2004/06/22 20:27:46 iliaa Exp $ */
+/* $Id: iptc.c,v 1.50 2005/08/03 14:08:07 sniper Exp $ */
/*
* Functions to parse & compse IPTC data.
@@ -227,11 +227,6 @@ PHP_FUNCTION(iptcembed)
fstat(fileno(fp), &sb);
poi = spoolbuf = emalloc(len + sizeof(psheader) + sb.st_size + 1024);
-
- if (! spoolbuf) {
- fclose(fp);
- RETURN_FALSE;
- }
}
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) {
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c
index 441f9eb81..5dcf84bf1 100644
--- a/ext/standard/lcg.c
+++ b/ext/standard/lcg.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: lcg.c,v 1.38.2.2 2005/07/25 13:10:18 hyanantha Exp $ */
+/* $Id: lcg.c,v 1.41 2005/08/03 14:08:07 sniper Exp $ */
#include "php.h"
#include "php_lcg.h"
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index 5fdfb5d84..877392c00 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: levenshtein.c,v 1.33 2004/06/20 21:40:43 iliaa Exp $ */
+/* $Id: levenshtein.c,v 1.34 2005/08/03 14:08:08 sniper Exp $ */
#include "php.h"
#include <stdlib.h>
diff --git a/ext/standard/link.c b/ext/standard/link.c
index 486efe31f..328efd45c 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: link.c,v 1.48.2.3 2005/07/15 09:29:19 hyanantha Exp $ */
+/* $Id: link.c,v 1.52 2005/08/03 14:08:08 sniper Exp $ */
#include "php.h"
#include "php_filestat.h"
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 4ad612bfd..752798391 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: mail.c,v 1.82.2.3 2005/07/28 08:48:31 hyanantha Exp $ */
+/* $Id: mail.c,v 1.87 2005/08/07 22:06:28 sniper Exp $ */
#include <stdlib.h>
#include <ctype.h>
@@ -185,7 +185,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
if (!sendmail_path) {
#if (defined PHP_WIN32 || defined NETWARE)
/* handle old style win smtp sending */
- if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, to, message, NULL, NULL, NULL) == FAILURE) {
+ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, to, message, NULL, NULL, NULL TSRMLS_CC) == FAILURE) {
if (tsm_errmsg) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg);
efree(tsm_errmsg);
diff --git a/ext/standard/math.c b/ext/standard/math.c
index faf1e7e06..3fce99832 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: math.c,v 1.115.2.3 2005/07/29 13:00:11 sniper Exp $ */
+/* $Id: math.c,v 1.131 2005/08/03 14:08:08 sniper Exp $ */
#include "php.h"
#include "php_math.h"
@@ -55,12 +55,11 @@
/* {{{ proto int abs(int number)
Return the absolute value of the number */
-
PHP_FUNCTION(abs)
{
zval **value;
- if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1, &value)==FAILURE) {
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &value) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -75,18 +74,17 @@ PHP_FUNCTION(abs)
RETURN_LONG(Z_LVAL_PP(value) < 0 ? -Z_LVAL_PP(value) : Z_LVAL_PP(value));
}
}
-
RETURN_FALSE;
}
-
/* }}} */
+
/* {{{ proto float ceil(float number)
Returns the next highest integer value of the number */
PHP_FUNCTION(ceil)
{
zval **value;
- if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1, &value)==FAILURE) {
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &value) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -101,15 +99,15 @@ PHP_FUNCTION(ceil)
RETURN_FALSE;
}
-
/* }}} */
+
/* {{{ proto float floor(float number)
Returns the next lowest integer value from the number */
PHP_FUNCTION(floor)
{
zval **value;
- if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1, &value)==FAILURE) {
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &value) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -124,10 +122,8 @@ PHP_FUNCTION(floor)
RETURN_FALSE;
}
-
/* }}} */
-
/* {{{ proto float round(float number [, int precision])
Returns the number rounded to specified precision */
PHP_FUNCTION(round)
@@ -171,9 +167,9 @@ PHP_FUNCTION(round)
}
}
/* }}} */
+
/* {{{ proto float sin(float number)
Returns the sine of the number in radians */
-
PHP_FUNCTION(sin)
{
zval **num;
@@ -185,11 +181,10 @@ PHP_FUNCTION(sin)
Z_DVAL_P(return_value) = sin(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
+
/* {{{ proto float cos(float number)
Returns the cosine of the number in radians */
-
PHP_FUNCTION(cos)
{
zval **num;
@@ -202,6 +197,7 @@ PHP_FUNCTION(cos)
Z_TYPE_P(return_value) = IS_DOUBLE;
}
/* }}} */
+
/* {{{ proto float tan(float number)
Returns the tangent of the number in radians */
PHP_FUNCTION(tan)
@@ -215,11 +211,10 @@ PHP_FUNCTION(tan)
Z_DVAL_P(return_value) = tan(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
+
/* {{{ proto float asin(float number)
Returns the arc sine of the number in radians */
-
PHP_FUNCTION(asin)
{
zval **num;
@@ -231,11 +226,10 @@ PHP_FUNCTION(asin)
Z_DVAL_P(return_value) = asin(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
+
/* {{{ proto float acos(float number)
Return the arc cosine of the number in radians */
-
PHP_FUNCTION(acos)
{
zval **num;
@@ -247,11 +241,10 @@ PHP_FUNCTION(acos)
Z_DVAL_P(return_value) = acos(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
+
/* {{{ proto float atan(float number)
Returns the arc tangent of the number in radians */
-
PHP_FUNCTION(atan)
{
zval **num;
@@ -263,11 +256,10 @@ PHP_FUNCTION(atan)
Z_DVAL_P(return_value) = atan(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
+
/* {{{ proto float atan2(float y, float x)
Returns the arc tangent of y/x, with the resulting quadrant determined by the signs of y and x */
-
PHP_FUNCTION(atan2)
{
zval **num1, **num2;
@@ -280,11 +272,10 @@ PHP_FUNCTION(atan2)
Z_DVAL_P(return_value) = atan2(Z_DVAL_PP(num1), Z_DVAL_PP(num2));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
+
/* {{{ proto float sinh(float number)
Returns the hyperbolic sine of the number, defined as (exp(number) - exp(-number))/2 */
-
PHP_FUNCTION(sinh)
{
zval **num;
@@ -296,11 +287,10 @@ PHP_FUNCTION(sinh)
Z_DVAL_P(return_value) = sinh(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
+
/* {{{ proto float cosh(float number)
Returns the hyperbolic cosine of the number, defined as (exp(number) + exp(-number))/2 */
-
PHP_FUNCTION(cosh)
{
zval **num;
@@ -313,6 +303,7 @@ PHP_FUNCTION(cosh)
Z_TYPE_P(return_value) = IS_DOUBLE;
}
/* }}} */
+
/* {{{ proto float tanh(float number)
Returns the hyperbolic tangent of the number, defined as sinh(number)/cosh(number) */
PHP_FUNCTION(tanh)
@@ -326,7 +317,6 @@ PHP_FUNCTION(tanh)
Z_DVAL_P(return_value) = tanh(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
#if !defined(PHP_WIN32) && !defined(NETWARE)
@@ -382,7 +372,6 @@ PHP_FUNCTION(atanh)
#endif /* HAVE_ATANH */
#endif /* !defined(PHP_WIN32) && !defined(NETWARE) */
-
/* {{{ proto float pi(void)
Returns an approximation of pi */
PHP_FUNCTION(pi)
@@ -392,7 +381,6 @@ PHP_FUNCTION(pi)
}
/* }}} */
-
/* {{{ proto bool is_finite(float val)
Returns whether argument is finite */
PHP_FUNCTION(is_finite)
@@ -485,7 +473,6 @@ PHP_FUNCTION(pow)
/* {{{ proto float exp(float number)
Returns e raised to the power of the number */
-
PHP_FUNCTION(exp)
{
zval **num;
@@ -497,19 +484,15 @@ PHP_FUNCTION(exp)
Z_DVAL_P(return_value) = exp(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
-
#if !defined(PHP_WIN32) && !defined(NETWARE)
/* {{{ proto float expm1(float number)
Returns exp(number) - 1, computed in a way that accurate even when the value of number is close to zero */
-
/*
WARNING: this function is expermental: it could change its name or
disappear in the next version of PHP!
*/
-
PHP_FUNCTION(expm1)
{
zval **num;
@@ -521,19 +504,17 @@ PHP_FUNCTION(expm1)
Z_DVAL_P(return_value) = expm1(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
+
+#ifdef HAVE_LOG1P
/* {{{ proto float log1p(float number)
Returns log(1 + number), computed in a way that accurate even when the value of number is close to zero */
-
/*
WARNING: this function is expermental: it could change its name or
disappear in the next version of PHP!
*/
-
PHP_FUNCTION(log1p)
{
-#ifdef HAVE_LOG1P
zval **num;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
@@ -542,15 +523,13 @@ PHP_FUNCTION(log1p)
convert_to_double_ex(num);
Z_DVAL_P(return_value) = log1p(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
-#endif
}
-
/* }}} */
+#endif /* HAVE_LOG1P */
+#endif /* !defined(PHP_WIN32) && !defined(NETWARE) */
-#endif
/* {{{ proto float log(float number, [float base])
Returns the natural logarithm of the number, or the base log if base is specified */
-
PHP_FUNCTION(log)
{
zval **num, **base;
@@ -578,11 +557,10 @@ PHP_FUNCTION(log)
WRONG_PARAM_COUNT;
}
}
-
/* }}} */
+
/* {{{ proto float log10(float number)
Returns the base-10 logarithm of the number */
-
PHP_FUNCTION(log10)
{
zval **num;
@@ -594,11 +572,10 @@ PHP_FUNCTION(log10)
Z_DVAL_P(return_value) = log10(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
+
/* {{{ proto float sqrt(float number)
Returns the square root of the number */
-
PHP_FUNCTION(sqrt)
{
zval **num;
@@ -610,14 +587,10 @@ PHP_FUNCTION(sqrt)
Z_DVAL_P(return_value) = sqrt(Z_DVAL_PP(num));
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-
/* }}} */
-
/* {{{ proto float hypot(float num1, float num2)
Returns sqrt(num1*num1 + num2*num2) */
-
-#ifdef HAVE_HYPOT
PHP_FUNCTION(hypot)
{
zval **num1, **num2;
@@ -627,16 +600,20 @@ PHP_FUNCTION(hypot)
}
convert_to_double_ex(num1);
convert_to_double_ex(num2);
+#if HAVE_HYPOT
Z_DVAL_P(return_value) = hypot(Z_DVAL_PP(num1), Z_DVAL_PP(num2));
+#elif defined(_MSC_VER)
+ Z_DVAL_P(return_value) = _hypot(Z_DVAL_PP(num1), Z_DVAL_PP(num2));
+#else
+ Z_DVAL_P(return_value) = sqrt((Z_DVAL_PP(num1) * Z_DVAL_PP(num1)) +
+ (Z_DVAL_PP(num2) * Z_DVAL_PP(num2)));
+#endif
Z_TYPE_P(return_value) = IS_DOUBLE;
}
-#endif
-
/* }}} */
/* {{{ proto float deg2rad(float number)
Converts the number in degrees to the radian equivalent */
-
PHP_FUNCTION(deg2rad)
{
zval **deg;
@@ -647,11 +624,10 @@ PHP_FUNCTION(deg2rad)
convert_to_double_ex(deg);
RETVAL_DOUBLE((Z_DVAL_PP(deg) / 180.0) * M_PI);
}
-
/* }}} */
+
/* {{{ proto float rad2deg(float number)
Converts the radian number to the equivalent number in degrees */
-
PHP_FUNCTION(rad2deg)
{
zval **rad;
@@ -662,15 +638,14 @@ PHP_FUNCTION(rad2deg)
convert_to_double_ex(rad);
RETVAL_DOUBLE((Z_DVAL_PP(rad) / M_PI) * 180);
}
-
/* }}} */
-/* {{{ _php_math_basetolong */
+/* {{{ _php_math_basetolong */
/*
* Convert a string representation of a base(2-36) number to a long.
*/
-PHPAPI long
-_php_math_basetolong(zval *arg, int base) {
+PHPAPI long _php_math_basetolong(zval *arg, int base)
+{
long num = 0, digit, onum;
int i;
char c, *s;
@@ -708,17 +683,14 @@ _php_math_basetolong(zval *arg, int base) {
return num;
}
-
/* }}} */
-/* {{{ _php_math_longtobase */
/* {{{ _php_math_basetozval */
-
/*
* Convert a string representation of a base(2-36) number to a zval.
*/
-PHPAPI int
-_php_math_basetozval(zval *arg, int base, zval *ret) {
+PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret)
+{
long num = 0;
double fnum = 0;
int i;
@@ -774,16 +746,14 @@ _php_math_basetozval(zval *arg, int base, zval *ret) {
}
return SUCCESS;
}
-
/* }}} */
-/* {{{ _php_math_longtobase */
+/* {{{ _php_math_longtobase */
/*
* Convert a long to a string containing a base(2-36) representation of
* the number.
*/
-PHPAPI char *
-_php_math_longtobase(zval *arg, int base)
+PHPAPI char * _php_math_longtobase(zval *arg, int base)
{
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
char buf[(sizeof(unsigned long) << 3) + 1];
@@ -791,7 +761,7 @@ _php_math_longtobase(zval *arg, int base)
unsigned long value;
if (Z_TYPE_P(arg) != IS_LONG || base < 2 || base > 36) {
- return empty_string;
+ return STR_EMPTY_ALLOC();
}
value = Z_LVAL_P(arg);
@@ -806,21 +776,19 @@ _php_math_longtobase(zval *arg, int base)
return estrndup(ptr, end - ptr);
}
-
/* }}} */
-/* {{{ _php_math_zvaltobase */
+/* {{{ _php_math_zvaltobase */
/*
* Convert a zval to a string containing a base(2-36) representation of
* the number.
*/
-PHPAPI char *
-_php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
+PHPAPI char * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
{
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
if ((Z_TYPE_P(arg) != IS_LONG && Z_TYPE_P(arg) != IS_DOUBLE) || base < 2 || base > 36) {
- return empty_string;
+ return STR_EMPTY_ALLOC();
}
if (Z_TYPE_P(arg) == IS_DOUBLE) {
@@ -831,7 +799,7 @@ _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
/* Don't try to convert +/- infinity */
if (fvalue == HUGE_VAL || fvalue == -HUGE_VAL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number too large");
- return empty_string;
+ return STR_EMPTY_ALLOC();
}
end = ptr = buf + sizeof(buf) - 1;
@@ -847,11 +815,10 @@ _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
return _php_math_longtobase(arg, base);
}
-
/* }}} */
+
/* {{{ proto int bindec(string binary_number)
Returns the decimal equivalent of the binary number */
-
PHP_FUNCTION(bindec)
{
zval **arg;
@@ -865,11 +832,10 @@ PHP_FUNCTION(bindec)
RETURN_FALSE;
}
}
-
/* }}} */
+
/* {{{ proto int hexdec(string hexadecimal_number)
Returns the decimal equivalent of the hexadecimal number */
-
PHP_FUNCTION(hexdec)
{
zval **arg;
@@ -884,11 +850,10 @@ PHP_FUNCTION(hexdec)
RETURN_FALSE;
}
}
-
/* }}} */
+
/* {{{ proto int octdec(string octal_number)
Returns the decimal equivalent of an octal string */
-
PHP_FUNCTION(octdec)
{
zval **arg;
@@ -903,11 +868,10 @@ PHP_FUNCTION(octdec)
RETURN_FALSE;
}
}
-
/* }}} */
+
/* {{{ proto string decbin(int decimal_number)
Returns a string containing a binary representation of the number */
-
PHP_FUNCTION(decbin)
{
zval **arg;
@@ -924,11 +888,10 @@ PHP_FUNCTION(decbin)
Z_STRLEN_P(return_value) = strlen(result);
Z_STRVAL_P(return_value) = result;
}
-
/* }}} */
+
/* {{{ proto string decoct(int decimal_number)
Returns a string containing an octal representation of the given number */
-
PHP_FUNCTION(decoct)
{
zval **arg;
@@ -945,11 +908,10 @@ PHP_FUNCTION(decoct)
Z_STRLEN_P(return_value) = strlen(result);
Z_STRVAL_P(return_value) = result;
}
-
/* }}} */
+
/* {{{ proto string dechex(int decimal_number)
Returns a string containing a hexadecimal representation of the given number */
-
PHP_FUNCTION(dechex)
{
zval **arg;
@@ -966,11 +928,10 @@ PHP_FUNCTION(dechex)
Z_STRLEN_P(return_value) = strlen(result);
Z_STRVAL_P(return_value) = result;
}
-
/* }}} */
+
/* {{{ proto string base_convert(string number, int frombase, int tobase)
Converts a number in a string from any base <= 36 to any base <= 36 */
-
PHP_FUNCTION(base_convert)
{
zval **number, **frombase, **tobase, temp;
@@ -997,10 +958,10 @@ PHP_FUNCTION(base_convert)
result = _php_math_zvaltobase(&temp, Z_LVAL_PP(tobase) TSRMLS_CC);
RETVAL_STRING(result, 0);
}
-
/* }}} */
-/* {{{ _php_math_number_format */
+/* {{{ _php_math_number_format
+*/
PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char thousand_sep)
{
char *tmpbuf = NULL, *resbuf;
@@ -1104,11 +1065,10 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
return resbuf;
}
-
/* }}} */
+
/* {{{ proto string number_format(float number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]])
Formats a number with grouped thousands */
-
PHP_FUNCTION(number_format)
{
zval **num, **dec, **t_s, **d_p;
@@ -1177,6 +1137,8 @@ PHP_FUNCTION(fmod)
}
/* }}} */
+
+
/*
* Local variables:
* tab-width: 4
diff --git a/ext/standard/md5.c b/ext/standard/md5.c
index 6b6b03b05..810e8aba1 100644
--- a/ext/standard/md5.c
+++ b/ext/standard/md5.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: md5.c,v 1.35.2.2 2005/04/16 09:50:13 thetaphi Exp $ */
+/* $Id: md5.c,v 1.39 2005/08/03 14:08:09 sniper Exp $ */
/*
* md5.c - Copyright 1997 Lachlan Roche
diff --git a/ext/standard/md5.h b/ext/standard/md5.h
index 98ddd6383..e35ca1655 100644
--- a/ext/standard/md5.h
+++ b/ext/standard/md5.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: md5.h,v 1.16 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: md5.h,v 1.17 2005/08/03 14:08:09 sniper Exp $ */
#ifndef MD5_H
#define MD5_H
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index 31eca7ad9..eaba31031 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: metaphone.c,v 1.27 2004/01/08 08:17:33 andi Exp $ */
+/* $Id: metaphone.c,v 1.28 2005/08/03 14:08:09 sniper Exp $ */
/*
Based on CPANs "Text-Metaphone-1.96" by Michael G Schwern <schwern@pobox.com>
diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c
index 08a83b696..7d08c2747 100644
--- a/ext/standard/microtime.c
+++ b/ext/standard/microtime.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: microtime.c,v 1.44.2.2 2005/06/28 15:19:35 hyanantha Exp $ */
+/* $Id: microtime.c,v 1.53.2.1 2005/11/20 20:14:23 derick Exp $ */
#include "php.h"
@@ -25,6 +25,9 @@
#endif
#ifdef PHP_WIN32
#include "win32/time.h"
+#elif defined(NETWARE)
+#include <sys/timeval.h>
+#include <sys/time.h>
#else
#include <sys/time.h>
#endif
@@ -40,71 +43,66 @@
#include <errno.h>
#include "microtime.h"
+#include "ext/date/php_date.h"
#define NUL '\0'
#define MICRO_IN_SEC 1000000.00
#define SEC_IN_MIN 60
#ifdef HAVE_GETTIMEOFDAY
-/* {{{ proto mixed microtime([bool get_as_float])
- Returns either a string or a float containing the current time in seconds and microseconds */
-PHP_FUNCTION(microtime)
+static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
- struct timeval tp;
- long sec = 0L;
- double msec = 0.0;
zend_bool get_as_float = 0;
+ struct timeval tp = {0};
+ struct timezone tz = {0};
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &get_as_float) == FAILURE) {
return;
}
-
- if (gettimeofday((struct timeval *) &tp, (NUL)) == 0) {
- msec = (double) (tp.tv_usec / MICRO_IN_SEC);
- sec = tp.tv_sec;
-
- if (msec >= 1.0) msec -= (long) msec;
- if (get_as_float == 0) {
- char ret[100];
-
- snprintf(ret, 100, "%.8f %ld", msec, sec);
- RETURN_STRING(ret,1);
- } else {
- RETURN_DOUBLE((double) (sec + msec));
- }
- } else {
+
+ if (gettimeofday(&tp, &tz)) {
RETURN_FALSE;
}
-}
-/* }}} */
-#endif
+ if (get_as_float) {
+ RETURN_DOUBLE((double)(tp.tv_sec + tp.tv_usec / MICRO_IN_SEC));
+ }
-/* {{{ proto array gettimeofday(void)
- Returns the current time as array */
-#ifdef HAVE_GETTIMEOFDAY
-PHP_FUNCTION(gettimeofday)
-{
- struct timeval tp;
- struct timezone tz;
-
- memset(&tp, 0, sizeof(tp));
- memset(&tz, 0, sizeof(tz));
- if(gettimeofday(&tp, &tz) == 0) {
+ if (mode) {
+ timelib_time_offset *offset;
+
+ offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info(TSRMLS_C));
+
array_init(return_value);
add_assoc_long(return_value, "sec", tp.tv_sec);
add_assoc_long(return_value, "usec", tp.tv_usec);
-#ifdef PHP_WIN32
- add_assoc_long(return_value, "minuteswest", tz.tz_minuteswest/SEC_IN_MIN);
-#else
- add_assoc_long(return_value, "minuteswest", tz.tz_minuteswest);
-#endif
- add_assoc_long(return_value, "dsttime", tz.tz_dsttime);
- return;
+
+ add_assoc_long(return_value, "minuteswest", -offset->offset / SEC_IN_MIN);
+ add_assoc_long(return_value, "dsttime", offset->is_dst);
+
+ timelib_time_offset_dtor(offset);
} else {
- RETURN_FALSE;
+ char ret[100];
+
+ snprintf(ret, 100, "%.8f %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec);
+ RETURN_STRING(ret, 1);
}
}
+
+/* {{{ proto mixed microtime([bool get_as_float])
+ Returns either a string or a float containing the current time in seconds and microseconds */
+PHP_FUNCTION(microtime)
+{
+ _php_gettimeofday(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+
+/* {{{ proto array gettimeofday([bool get_as_float])
+ Returns the current time as array */
+PHP_FUNCTION(gettimeofday)
+{
+ _php_gettimeofday(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
#endif
/* }}} */
@@ -114,19 +112,16 @@ PHP_FUNCTION(gettimeofday)
PHP_FUNCTION(getrusage)
{
struct rusage usg;
- int ac = ZEND_NUM_ARGS();
- pval **pwho;
+ long pwho = 0;
int who = RUSAGE_SELF;
- if(ac == 1 &&
- zend_get_parameters_ex(ac, &pwho) != FAILURE) {
- convert_to_long_ex(pwho);
- if(Z_LVAL_PP(pwho) == 1)
- who = RUSAGE_CHILDREN;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) != FAILURE && pwho == 1) {
+ who = RUSAGE_CHILDREN;
}
- memset(&usg, 0, sizeof(usg));
- if(getrusage(who, &usg) == -1) {
+ memset(&usg, 0, sizeof(struct rusage));
+
+ if (getrusage(who, &usg) == -1) {
RETURN_FALSE;
}
diff --git a/ext/standard/microtime.h b/ext/standard/microtime.h
index f9664c203..8bf445d18 100644
--- a/ext/standard/microtime.h
+++ b/ext/standard/microtime.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: microtime.h,v 1.13 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: microtime.h,v 1.14 2005/08/03 14:08:09 sniper Exp $ */
#ifndef MICROTIME_H
#define MICROTIME_H
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index 7a0c70384..a014eed5d 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Chris Schneider <cschneid@relog.ch> |
+----------------------------------------------------------------------+
*/
-/* $Id: pack.c,v 1.52.2.4 2005/05/27 02:03:27 iliaa Exp $ */
+/* $Id: pack.c,v 1.57 2005/08/03 14:08:09 sniper Exp $ */
#include "php.h"
diff --git a/ext/standard/pack.h b/ext/standard/pack.h
index 18394d28f..3091cf545 100644
--- a/ext/standard/pack.h
+++ b/ext/standard/pack.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: pack.h,v 1.15 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: pack.h,v 1.16 2005/08/03 14:08:09 sniper Exp $ */
#ifndef PACK_H
#define PACK_H
diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c
index 78faba588..bac1596f6 100644
--- a/ext/standard/pageinfo.c
+++ b/ext/standard/pageinfo.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: pageinfo.c,v 1.37.2.2 2005/07/15 09:29:19 hyanantha Exp $ */
+/* $Id: pageinfo.c,v 1.40 2005/08/03 14:08:09 sniper Exp $ */
#include "php.h"
#include "pageinfo.h"
diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h
index 76567d156..59f648e0f 100644
--- a/ext/standard/pageinfo.h
+++ b/ext/standard/pageinfo.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: pageinfo.h,v 1.13 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: pageinfo.h,v 1.14 2005/08/03 14:08:09 sniper Exp $ */
#ifndef PAGEINFO_H
#define PAGEINFO_H
diff --git a/ext/standard/parsedate.c b/ext/standard/parsedate.c
deleted file mode 100644
index 4cb276415..000000000
--- a/ext/standard/parsedate.c
+++ /dev/null
@@ -1,2404 +0,0 @@
-/* A Bison parser, made from ext/standard/parsedate.y
- by GNU bison 1.35. */
-
-#define YYBISON 1 /* Identify Bison output. */
-
-# define tAGO 257
-# define tDAY 258
-# define tDAY_UNIT 259
-# define tDAYZONE 260
-# define tDST 261
-# define tHOUR_UNIT 262
-# define tID 263
-# define tTZONE 264
-# define tWZONE 265
-# define tZZONE 266
-# define tMERIDIAN 267
-# define tMINUTE_UNIT 268
-# define tMONTH 269
-# define tMONTH_UNIT 270
-# define tSEC_UNIT 271
-# define tSNUMBER 272
-# define tUNUMBER 273
-# define tYEAR_UNIT 274
-# define tZONE 275
-
-
-/*
-** Originally written by Steven M. Bellovin <smb@research.att.com> while
-** at the University of North Carolina at Chapel Hill. Later tweaked by
-** a couple of people on Usenet. Completely overhauled by Rich $alz
-** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990.
-**
-** This code is in the public domain and has no copyright.
-*/
-
-/* $Id: parsedate.y,v 1.56.2.2 2005/05/20 11:14:01 derick Exp $ */
-
-#include "php.h"
-
-#ifdef PHP_WIN32
-#include <malloc.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <time.h>
-#include <ctype.h>
-
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef PHP_WIN32
-# include "win32/time.h"
-#endif
-
-#include "php_parsedate.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h> /* for `free'; used by Bison 1.27 */
-#endif
-
-#if defined(_HPUX_SOURCE)
-#include <alloca.h>
-#endif
-
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-# define IN_CTYPE_DOMAIN(c) 1
-#else
-# define IN_CTYPE_DOMAIN(c) isascii(c)
-#endif
-
-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
-#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
-
-/* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
- - Its arg may be any int or unsigned int; it need not be an unsigned char.
- - It's guaranteed to evaluate its argument exactly once.
- - It's typically faster.
- Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
- only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE unless
- it's important to use the locale's definition of `digit' even when the
- host does not conform to Posix. */
-#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
-
-#if defined (STDC_HEADERS) || defined (USG)
-# include <string.h>
-#endif
-
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __attribute__(x)
-#endif
-
-#ifndef ATTRIBUTE_UNUSED
-# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-#endif
-
-/* Some old versions of bison generate parsers that use bcopy.
- That loses on systems that don't provide the function, so we have
- to redefine it here. */
-#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
-# define bcopy(from, to, len) memcpy ((to), (from), (len))
-#endif
-
-/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
- as well as gratuitiously global symbol names, so we can have multiple
- yacc generated parsers in the same program. Note that these are only
- the variables produced by yacc. If other parser generators (bison,
- byacc, etc) produce additional global names that conflict at link time,
- then those parser generators need to be fixed instead of adding those
- names to this list. */
-
-#define yyparse php_gd_parse
-#define yylex php_gd_lex
-
-static int yyerror ();
-
-#define EPOCH 1970
-#define HOUR(x) ((x) * 60)
-
-#define MAX_BUFF_LEN 128 /* size of buffer to read the date into */
-
-/*
-** An entry in the lexical lookup table.
-*/
-typedef struct _TABLE {
- const char *name;
- int type;
- int value;
-} TABLE;
-
-
-/*
-** Meridian: am, pm, or 24-hour style.
-*/
-typedef enum _MERIDIAN {
- MERam, MERpm, MER24
-} MERIDIAN;
-
-struct date_yy {
- const char *yyInput;
- int yyDayOrdinal;
- int yyDayNumber;
- int yyHaveDate;
- int yyHaveDay;
- int yyHaveRel;
- int yyHaveTime;
- int yyHaveZone;
- int yyTimezone;
- int yyDay;
- int yyHour;
- int yyMinutes;
- int yyMonth;
- int yySeconds;
- int yyYear;
- MERIDIAN yyMeridian;
- int yyRelDay;
- int yyRelHour;
- int yyRelMinutes;
- int yyRelMonth;
- int yyRelSeconds;
- int yyRelYear;
-};
-
-typedef union _date_ll {
- int Number;
- enum _MERIDIAN Meridian;
-} date_ll;
-
-#define YYPARSE_PARAM parm
-#define YYLEX_PARAM parm
-#define YYSTYPE date_ll
-#define YYLTYPE void
-
-static int yylex (YYSTYPE *lvalp, void *parm);
-#ifndef YYSTYPE
-# define YYSTYPE int
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-
-
-#define YYFINAL 100
-#define YYFLAG -32768
-#define YYNTBASE 26
-
-/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
-#define YYTRANSLATE(x) ((unsigned)(x) <= 275 ? yytranslate[x] : 47)
-
-/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
-static const char yytranslate[] =
-{
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 24, 2, 22, 25, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 23, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21
-};
-
-#if YYDEBUG
-static const short yyprhs[] =
-{
- 0, 0, 1, 4, 6, 8, 10, 12, 14, 16,
- 18, 21, 23, 27, 31, 35, 39, 41, 43, 45,
- 46, 49, 50, 52, 56, 60, 64, 66, 68, 70,
- 72, 74, 77, 79, 82, 85, 89, 98, 104, 106,
- 108, 112, 116, 119, 124, 127, 131, 135, 139, 143,
- 146, 149, 152, 156, 158, 162, 165, 167, 170, 173,
- 175, 178, 181, 183, 186, 189, 191, 194, 197, 199,
- 202, 205, 207, 210, 213, 215, 217
-};
-static const short yyrhs[] =
-{
- -1, 26, 27, 0, 28, 0, 36, 0, 38, 0,
- 37, 0, 43, 0, 45, 0, 46, 0, 19, 13,
- 0, 29, 0, 34, 31, 43, 0, 35, 31, 43,
- 0, 34, 31, 30, 0, 35, 31, 30, 0, 32,
- 0, 33, 0, 36, 0, 0, 22, 19, 0, 0,
- 18, 0, 18, 23, 19, 0, 35, 23, 19, 0,
- 19, 23, 19, 0, 10, 0, 11, 0, 12, 0,
- 21, 0, 6, 0, 21, 7, 0, 4, 0, 4,
- 24, 0, 19, 4, 0, 19, 25, 19, 0, 15,
- 19, 19, 23, 19, 23, 19, 19, 0, 19, 25,
- 19, 25, 19, 0, 40, 0, 39, 0, 19, 15,
- 18, 0, 15, 19, 19, 0, 15, 19, 0, 15,
- 19, 24, 19, 0, 19, 15, 0, 19, 15, 19,
- 0, 40, 10, 42, 0, 19, 10, 42, 0, 19,
- 18, 18, 0, 19, 18, 0, 19, 41, 0, 11,
- 19, 0, 11, 19, 18, 0, 29, 0, 19, 31,
- 30, 0, 44, 3, 0, 44, 0, 19, 20, 0,
- 18, 20, 0, 20, 0, 19, 16, 0, 18, 16,
- 0, 16, 0, 19, 5, 0, 18, 5, 0, 5,
- 0, 19, 8, 0, 18, 8, 0, 8, 0, 19,
- 14, 0, 18, 14, 0, 14, 0, 19, 17, 0,
- 18, 17, 0, 17, 0, 19, 0, 13, 0
-};
-
-#endif
-
-#if YYDEBUG
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const short yyrline[] =
-{
- 0, 169, 170, 173, 176, 179, 182, 185, 188, 189,
- 192, 198, 202, 205, 209, 212, 218, 221, 224, 227,
- 230, 232, 235, 245, 251, 257, 273, 276, 279, 282,
- 285, 288, 293, 297, 301, 307, 311, 322, 340, 341,
- 344, 350, 355, 363, 368, 376, 383, 384, 403, 409,
- 415, 427, 430, 435, 437, 462, 476, 479, 482, 485,
- 488, 491, 494, 497, 500, 503, 506, 509, 512, 515,
- 518, 521, 524, 527, 530, 535, 570
-};
-#endif
-
-
-#if (YYDEBUG) || defined YYERROR_VERBOSE
-
-/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
-static const char *const yytname[] =
-{
- "$", "error", "$undefined.", "tAGO", "tDAY", "tDAY_UNIT", "tDAYZONE",
- "tDST", "tHOUR_UNIT", "tID", "tTZONE", "tWZONE", "tZZONE", "tMERIDIAN",
- "tMINUTE_UNIT", "tMONTH", "tMONTH_UNIT", "tSEC_UNIT", "tSNUMBER",
- "tUNUMBER", "tYEAR_UNIT", "tZONE", "'.'", "':'", "','", "'/'", "spec",
- "item", "time", "iso8601time_colon", "iso8601zonepart",
- "sec_fraction_part", "zonepart_numeric_without_colon",
- "zonepart_numeric_with_colon", "HMStime_with_colon",
- "HMtime_with_colon", "zone", "day", "date", "iso8601datetime",
- "iso8601date", "iso8601weekspec", "iso8601time", "rel", "relunit",
- "number", "o_merid", 0
-};
-#endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const short yyr1[] =
-{
- 0, 26, 26, 27, 27, 27, 27, 27, 27, 27,
- 28, 28, 29, 29, 29, 29, 30, 30, 30, 30,
- 31, 31, 32, 33, 34, 35, 36, 36, 36, 36,
- 36, 36, 37, 37, 37, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 39, 39, 40, 40,
- 40, 41, 41, 42, 42, 43, 43, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 45, 46
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const short yyr2[] =
-{
- 0, 0, 2, 1, 1, 1, 1, 1, 1, 1,
- 2, 1, 3, 3, 3, 3, 1, 1, 1, 0,
- 2, 0, 1, 3, 3, 3, 1, 1, 1, 1,
- 1, 2, 1, 2, 2, 3, 8, 5, 1, 1,
- 3, 3, 2, 4, 2, 3, 3, 3, 3, 2,
- 2, 2, 3, 1, 3, 2, 1, 2, 2, 1,
- 2, 2, 1, 2, 2, 1, 2, 2, 1, 2,
- 2, 1, 2, 2, 1, 1, 1
-};
-
-/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
- doesn't specify something else to do. Zero means the default is an
- error. */
-static const short yydefact[] =
-{
- 1, 0, 32, 65, 30, 68, 26, 27, 28, 76,
- 71, 0, 62, 74, 0, 75, 59, 29, 2, 3,
- 11, 21, 21, 4, 6, 5, 39, 38, 7, 56,
- 8, 9, 33, 42, 64, 67, 70, 61, 73, 58,
- 34, 63, 66, 0, 0, 10, 69, 44, 60, 72,
- 49, 57, 0, 0, 50, 31, 0, 19, 0, 19,
- 0, 55, 41, 0, 21, 53, 47, 51, 40, 45,
- 48, 25, 35, 20, 22, 0, 14, 16, 17, 18,
- 12, 24, 15, 13, 46, 0, 43, 19, 52, 0,
- 0, 0, 22, 54, 37, 23, 0, 0, 36, 0,
- 0
-};
-
-static const short yydefgoto[] =
-{
- 1, 18, 19, 65, 76, 57, 77, 78, 21, 22,
- 79, 24, 25, 26, 27, 54, 66, 28, 29, 30,
- 31
-};
-
-static const short yypact[] =
-{
- -32768, 2, -13,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- -32768, 13,-32768,-32768, 69, 20,-32768, 32,-32768,-32768,
- -32768, 29, 4,-32768,-32768,-32768,-32768, 44,-32768, 58,
- -32768,-32768,-32768, -15,-32768,-32768,-32768,-32768,-32768,-32768,
- -32768,-32768,-32768, 46, 48,-32768,-32768, 28,-32768,-32768,
- 37,-32768, 56, 57,-32768,-32768, 59, 52, 61, 52,
- 46,-32768, 64, 62, 26,-32768,-32768, 66,-32768,-32768,
- -32768,-32768, 68,-32768, 36, 74,-32768,-32768,-32768,-32768,
- -32768,-32768,-32768,-32768,-32768, 76,-32768, 86,-32768, 80,
- 81, 78, 79,-32768,-32768,-32768, 84, 87,-32768, 105,
- -32768
-};
-
-static const short yypgoto[] =
-{
- -32768,-32768,-32768, 107, -58, -22,-32768,-32768,-32768,-32768,
- 108,-32768,-32768,-32768,-32768,-32768, 50, -54,-32768,-32768,
- -32768
-};
-
-
-#define YYLAST 110
-
-
-static const short yytable[] =
-{
- 59, 82, 99, 80, 62, 83, 2, 3, 4, 63,
- 5, 32, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 40, 41, 56, 58, 42, 93,
- 43, 44, 33, 45, 46, 47, 48, 49, 50, 55,
- 51, 34, 87, 52, 35, 53, 68, 69, 56, 52,
- 36, 56, 37, 38, 60, 70, 39, 3, 4, 90,
- 5, 61, 6, 7, 8, 64, 10, 67, 12, 13,
- 74, 75, 16, 17, 34, 71, 72, 35, 73, 41,
- 81, 86, 42, 36, 88, 37, 38, 85, 46, 39,
- 48, 49, 4, 89, 51, 91, 6, 7, 8, 94,
- 95, 96, 90, 97, 92, 100, 98, 17, 20, 23,
- 84
-};
-
-static const short yycheck[] =
-{
- 22, 59, 0, 57, 19, 59, 4, 5, 6, 24,
- 8, 24, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 4, 5, 22, 23, 8, 87,
- 10, 11, 19, 13, 14, 15, 16, 17, 18, 7,
- 20, 5, 64, 23, 8, 25, 18, 19, 22, 23,
- 14, 22, 16, 17, 10, 18, 20, 5, 6, 23,
- 8, 3, 10, 11, 12, 19, 14, 19, 16, 17,
- 18, 19, 20, 21, 5, 19, 19, 8, 19, 5,
- 19, 19, 8, 14, 18, 16, 17, 23, 14, 20,
- 16, 17, 6, 25, 20, 19, 10, 11, 12, 19,
- 19, 23, 23, 19, 18, 0, 19, 21, 1, 1,
- 60
-};
-#define YYPURE 1
-
-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-
-/* Skeleton output parser for bison,
-
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
- Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* This is the parser code that is written into each bison parser when
- the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
-
-#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
-
-/* The parser invokes alloca or malloc; define the necessary symbols. */
-
-# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
-# else
-# ifndef YYSTACK_USE_ALLOCA
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
-# else
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-# define YYSTACK_ALLOC malloc
-# define YYSTACK_FREE free
-# endif
-#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
-
-
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- short yyss;
- YYSTYPE yyvs;
-# if YYLSP_NEEDED
- YYLTYPE yyls;
-# endif
-};
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# if YYLSP_NEEDED
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
- + 2 * YYSTACK_GAP_MAX)
-# else
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAX)
-# endif
-
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- register YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (0)
-# endif
-# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (0)
-
-#endif
-
-
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY -2
-#define YYEOF 0
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrlab1
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-#define YYFAIL goto yyerrlab
-#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yychar1 = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror ("syntax error: cannot back up"); \
- YYERROR; \
- } \
-while (0)
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
- are run).
-
- When YYLLOC_DEFAULT is run, CURRENT is set the location of the
- first token. By default, to implement support for ranges, extend
- its range to the last symbol. */
-
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- Current.last_line = Rhs[N].last_line; \
- Current.last_column = Rhs[N].last_column;
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#if YYPURE
-# if YYLSP_NEEDED
-# ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
-# else
-# define YYLEX yylex (&yylval, &yylloc)
-# endif
-# else /* !YYLSP_NEEDED */
-# ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-# else
-# define YYLEX yylex (&yylval)
-# endif
-# endif /* !YYLSP_NEEDED */
-#else /* !YYPURE */
-# define YYLEX yylex ()
-#endif /* !YYPURE */
-
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (0)
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-#endif /* !YYDEBUG */
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
-
- Do not make this value too large; the results are undefined if
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
-
-#if YYMAXDEPTH == 0
-# undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-#ifdef YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
-yystrlen (const char *yystr)
-# else
-yystrlen (yystr)
- const char *yystr;
-# endif
-{
- register const char *yys = yystr;
-
- while (*yys++ != '\0')
- continue;
-
- return yys - yystr - 1;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-static char *
-# if defined (__STDC__) || defined (__cplusplus)
-yystpcpy (char *yydest, const char *yysrc)
-# else
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
-{
- register char *yyd = yydest;
- register const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-#endif
-
-
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
- into yyparse. The argument should have type void *.
- It should actually point to an object.
- Grammar actions can access the variable by casting it
- to the proper pointer type. */
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-# define YYPARSE_PARAM_DECL
-# else
-# define YYPARSE_PARAM_ARG YYPARSE_PARAM
-# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-# endif
-#else /* !YYPARSE_PARAM */
-# define YYPARSE_PARAM_ARG
-# define YYPARSE_PARAM_DECL
-#endif /* !YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
-# ifdef YYPARSE_PARAM
-int yyparse (void *);
-# else
-int yyparse (void);
-# endif
-#endif
-
-/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
- variables are global, or local to YYPARSE. */
-
-#define YY_DECL_NON_LSP_VARIABLES \
-/* The lookahead symbol. */ \
-int yychar; \
- \
-/* The semantic value of the lookahead symbol. */ \
-YYSTYPE yylval; \
- \
-/* Number of parse errors so far. */ \
-int yynerrs;
-
-#if YYLSP_NEEDED
-# define YY_DECL_VARIABLES \
-YY_DECL_NON_LSP_VARIABLES \
- \
-/* Location data for the lookahead symbol. */ \
-YYLTYPE yylloc;
-#else
-# define YY_DECL_VARIABLES \
-YY_DECL_NON_LSP_VARIABLES
-#endif
-
-
-/* If nonreentrant, generate the variables here. */
-
-#if !YYPURE
-YY_DECL_VARIABLES
-#endif /* !YYPURE */
-
-int
-yyparse (YYPARSE_PARAM_ARG)
- YYPARSE_PARAM_DECL
-{
- /* If reentrant, generate the variables here. */
-#if YYPURE
- YY_DECL_VARIABLES
-#endif /* !YYPURE */
-
- register int yystate;
- register int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Lookahead token as an internal (translated) token number. */
- int yychar1 = 0;
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- short yyssa[YYINITDEPTH];
- short *yyss = yyssa;
- register short *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- register YYSTYPE *yyvsp;
-
-#if YYLSP_NEEDED
- /* The location stack. */
- YYLTYPE yylsa[YYINITDEPTH];
- YYLTYPE *yyls = yylsa;
- YYLTYPE *yylsp;
-#endif
-
-#if YYLSP_NEEDED
-# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
-#else
-# define YYPOPSTACK (yyvsp--, yyssp--)
-#endif
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-#if YYLSP_NEEDED
- YYLTYPE yyloc;
-#endif
-
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
-#if YYLSP_NEEDED
- yylsp = yyls;
-#endif
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
- yyssp++;
-
- yysetstate:
- *yyssp = yystate;
-
- if (yyssp >= yyss + yystacksize - 1)
- {
- /* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. */
-# if YYLSP_NEEDED
- YYLTYPE *yyls1 = yyls;
- /* This used to be a conditional around just the two extra args,
- but that might be undefined if yyoverflow is a macro. */
- yyoverflow ("parser stack overflow",
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yyls1, yysize * sizeof (*yylsp),
- &yystacksize);
- yyls = yyls1;
-# else
- yyoverflow ("parser stack overflow",
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yystacksize);
-# endif
- yyss = yyss1;
- yyvs = yyvs1;
- }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyoverflowlab;
-# else
- /* Extend the stack our own way. */
- if (yystacksize >= YYMAXDEPTH)
- goto yyoverflowlab;
- yystacksize *= 2;
- if (yystacksize > YYMAXDEPTH)
- yystacksize = YYMAXDEPTH;
-
- {
- short *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyoverflowlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-# if YYLSP_NEEDED
- YYSTACK_RELOCATE (yyls);
-# endif
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-#if YYLSP_NEEDED
- yylsp = yyls + yysize - 1;
-#endif
-
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
-
- if (yyssp >= yyss + yystacksize - 1)
- YYABORT;
- }
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
- goto yybackup;
-
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
-
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
-
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yydefault;
-
- /* Not known => get a lookahead token if don't already have one. */
-
- /* yychar is either YYEMPTY or YYEOF
- or a valid token in external form. */
-
- if (yychar == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- }
-
- /* Convert token to internal form (in yychar1) for indexing tables with */
-
- if (yychar <= 0) /* This means end of input. */
- {
- yychar1 = 0;
- yychar = YYEOF; /* Don't call YYLEX any more */
-
- YYDPRINTF ((stderr, "Now at end of input.\n"));
- }
- else
- {
- yychar1 = YYTRANSLATE (yychar);
-
-#if YYDEBUG
- /* We have to keep this `#if YYDEBUG', since we use variables
- which are defined only if `YYDEBUG' is set. */
- if (yydebug)
- {
- YYFPRINTF (stderr, "Next token is %d (%s",
- yychar, yytname[yychar1]);
- /* Give the individual parser a way to print the precise
- meaning of a token, for further debugging info. */
-# ifdef YYPRINT
- YYPRINT (stderr, yychar, yylval);
-# endif
- YYFPRINTF (stderr, ")\n");
- }
-#endif
- }
-
- yyn += yychar1;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
- goto yydefault;
-
- yyn = yytable[yyn];
-
- /* yyn is what to do for this token type in this state.
- Negative => reduce, -yyn is rule number.
- Positive => shift, yyn is new state.
- New state is final state => don't bother to shift,
- just return success.
- 0, or most negative number => error. */
-
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrlab;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the lookahead token. */
- YYDPRINTF ((stderr, "Shifting token %d (%s), ",
- yychar, yytname[yychar1]));
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-#if YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
-yydefault:
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
- goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
-yyreduce:
- /* yyn is the number of a rule to reduce with. */
- yylen = yyr2[yyn];
-
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
-
- Otherwise, the following line sets YYVAL to the semantic value of
- the lookahead token. This behavior is undocumented and Bison
- users should not rely upon it. Assigning to YYVAL
- unconditionally makes the parser a bit smaller, and it avoids a
- GCC warning that YYVAL may be used uninitialized. */
- yyval = yyvsp[1-yylen];
-
-#if YYLSP_NEEDED
- /* Similarly for the default location. Let the user run additional
- commands if for instance locations are ranges. */
- yyloc = yylsp[1-yylen];
- YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
-#endif
-
-#if YYDEBUG
- /* We have to keep this `#if YYDEBUG', since we use variables which
- are defined only if `YYDEBUG' is set. */
- if (yydebug)
- {
- int yyi;
-
- YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
-
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
- YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
- YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
- }
-#endif
-
- switch (yyn) {
-
-case 3:
-{
- ((struct date_yy *)parm)->yyHaveTime++;
- }
- break;
-case 4:
-{
- ((struct date_yy *)parm)->yyHaveZone++;
- }
- break;
-case 5:
-{
- ((struct date_yy *)parm)->yyHaveDate++;
- }
- break;
-case 6:
-{
- ((struct date_yy *)parm)->yyHaveDay++;
- }
- break;
-case 7:
-{
- ((struct date_yy *)parm)->yyHaveRel++;
- }
- break;
-case 10:
-{
- ((struct date_yy *)parm)->yyHour = yyvsp[-1].Number;
- ((struct date_yy *)parm)->yyMinutes = 0;
- ((struct date_yy *)parm)->yySeconds = 0;
- ((struct date_yy *)parm)->yyMeridian = yyvsp[0].Meridian;
- }
- break;
-case 12:
-{
- ((struct date_yy *)parm)->yyMeridian = MER24;
- }
- break;
-case 13:
-{
- ((struct date_yy *)parm)->yyMeridian = MER24;
- ((struct date_yy *)parm)->yySeconds = 0;
- }
- break;
-case 14:
-{
- ((struct date_yy *)parm)->yyMeridian = MER24;
- }
- break;
-case 15:
-{
- ((struct date_yy *)parm)->yyMeridian = MER24;
- ((struct date_yy *)parm)->yySeconds = 0;
- }
- break;
-case 16:
-{
- ((struct date_yy *)parm)->yyHaveZone++;
- }
- break;
-case 17:
-{
- ((struct date_yy *)parm)->yyHaveZone++;
- }
- break;
-case 18:
-{
- ((struct date_yy *)parm)->yyHaveZone++;
- }
- break;
-case 20:
-{
- }
- break;
-case 22:
-{
- /* format: [+-]hhmm */
- if (yyvsp[0].Number <= -100 || yyvsp[0].Number >= 100) {
- ((struct date_yy *)parm)->yyTimezone = (-yyvsp[0].Number / 100) * 60 + (-yyvsp[0].Number % 100);
- } else if (yyvsp[0].Number >= -99 || yyvsp[0].Number <= 99) {
- ((struct date_yy *)parm)->yyTimezone = -yyvsp[0].Number * 60;
- }
- }
- break;
-case 23:
-{
- /* format: [+-]hh:mm */
- ((struct date_yy *)parm)->yyTimezone = -yyvsp[-2].Number * 60 + (yyvsp[-2].Number > 0 ? -yyvsp[0].Number: yyvsp[0].Number);
- }
- break;
-case 24:
-{
- /* format: hh:mm:ss */
- ((struct date_yy *)parm)->yySeconds = yyvsp[0].Number;
- }
- break;
-case 25:
-{
- /* format: hh:mm */
- ((struct date_yy *)parm)->yyHour = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyMinutes = yyvsp[0].Number;
- }
- break;
-case 26:
-{
- ((struct date_yy *)parm)->yyTimezone = yyvsp[0].Number;
- }
- break;
-case 27:
-{
- ((struct date_yy *)parm)->yyTimezone = yyvsp[0].Number;
- }
- break;
-case 28:
-{
- ((struct date_yy *)parm)->yyTimezone = yyvsp[0].Number;
- }
- break;
-case 29:
-{
- ((struct date_yy *)parm)->yyTimezone = yyvsp[0].Number;
- }
- break;
-case 30:
-{
- ((struct date_yy *)parm)->yyTimezone = yyvsp[0].Number - 60;
- }
- break;
-case 31:
-{
- ((struct date_yy *)parm)->yyTimezone = yyvsp[-1].Number - 60;
- }
- break;
-case 32:
-{
- ((struct date_yy *)parm)->yyDayOrdinal = 1;
- ((struct date_yy *)parm)->yyDayNumber = yyvsp[0].Number;
- }
- break;
-case 33:
-{
- ((struct date_yy *)parm)->yyDayOrdinal = 1;
- ((struct date_yy *)parm)->yyDayNumber = yyvsp[-1].Number;
- }
- break;
-case 34:
-{
- ((struct date_yy *)parm)->yyDayOrdinal = yyvsp[-1].Number;
- ((struct date_yy *)parm)->yyDayNumber = yyvsp[0].Number;
- }
- break;
-case 35:
-{
- ((struct date_yy *)parm)->yyMonth = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyDay = yyvsp[0].Number;
- }
- break;
-case 36:
-{
- ((struct date_yy *)parm)->yyYear = yyvsp[0].Number;
- ((struct date_yy *)parm)->yyMonth = yyvsp[-7].Number;
- ((struct date_yy *)parm)->yyDay = yyvsp[-6].Number;
-
- ((struct date_yy *)parm)->yyHour = yyvsp[-5].Number;
- ((struct date_yy *)parm)->yyMinutes = yyvsp[-3].Number;
- ((struct date_yy *)parm)->yySeconds = yyvsp[-1].Number;
-
- ((struct date_yy *)parm)->yyHaveTime = 1;
- }
- break;
-case 37:
-{
- /* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY.
- The goal in recognizing YYYY/MM/DD is solely to support legacy
- machine-generated dates like those in an RCS log listing. If
- you want portability, use the ISO 8601 format. */
- if (yyvsp[-4].Number >= 1000)
- {
- ((struct date_yy *)parm)->yyYear = yyvsp[-4].Number;
- ((struct date_yy *)parm)->yyMonth = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyDay = yyvsp[0].Number;
- }
- else
- {
- ((struct date_yy *)parm)->yyMonth = yyvsp[-4].Number;
- ((struct date_yy *)parm)->yyDay = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyYear = yyvsp[0].Number;
- }
- }
- break;
-case 39:
-{
- ((struct date_yy *)parm)->yyHaveTime++;
- }
- break;
-case 40:
-{
- /* e.g. 17-JUN-1992. */
- ((struct date_yy *)parm)->yyDay = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyMonth = yyvsp[-1].Number;
- ((struct date_yy *)parm)->yyYear = -yyvsp[0].Number;
- }
- break;
-case 41:
-{
- ((struct date_yy *)parm)->yyMonth = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyDay = yyvsp[-1].Number;
- ((struct date_yy *)parm)->yyYear = yyvsp[0].Number;
- }
- break;
-case 42:
-{
- ((struct date_yy *)parm)->yyMonth = yyvsp[-1].Number;
- if (yyvsp[0].Number > 1000) {
- ((struct date_yy *)parm)->yyYear = yyvsp[0].Number;
- } else {
- ((struct date_yy *)parm)->yyDay = yyvsp[0].Number;
- }
- }
- break;
-case 43:
-{
- ((struct date_yy *)parm)->yyMonth = yyvsp[-3].Number;
- ((struct date_yy *)parm)->yyDay = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyYear = yyvsp[0].Number;
- }
- break;
-case 44:
-{
- ((struct date_yy *)parm)->yyMonth = yyvsp[0].Number;
- if (yyvsp[-1].Number > 1000) {
- ((struct date_yy *)parm)->yyYear = yyvsp[-1].Number;
- } else {
- ((struct date_yy *)parm)->yyDay = yyvsp[-1].Number;
- }
- }
- break;
-case 45:
-{
- ((struct date_yy *)parm)->yyMonth = yyvsp[-1].Number;
- ((struct date_yy *)parm)->yyDay = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyYear = yyvsp[0].Number;
- }
- break;
-case 47:
-{
- int i = yyvsp[-2].Number;
-
- if (i >= 10000) {
- /* format: yyyymmdd */
- ((struct date_yy *)parm)->yyYear = i / 10000;
- i %= 10000;
- ((struct date_yy *)parm)->yyMonth = i / 100;
- i %= 100;
- ((struct date_yy *)parm)->yyDay = i;
- } else if (i >= 1000 && i <= 9999) {
- /* format: yyyy */
- ((struct date_yy *)parm)->yyYear = i;
- ((struct date_yy *)parm)->yyDay= 1;
- ((struct date_yy *)parm)->yyMonth = 1;
- }
- }
- break;
-case 48:
-{
- /* ISO 8601 format. yyyy-mm-dd. */
- ((struct date_yy *)parm)->yyYear = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyMonth = -yyvsp[-1].Number;
- ((struct date_yy *)parm)->yyDay = -yyvsp[0].Number;
- }
- break;
-case 49:
-{
- /* ISO 8601 format yyyy-mm */
- ((struct date_yy *)parm)->yyYear = yyvsp[-1].Number;
- ((struct date_yy *)parm)->yyMonth = -yyvsp[0].Number;
- ((struct date_yy *)parm)->yyDay = 1;
- }
- break;
-case 50:
-{
- const int om = (1 + 9) % 12; /* offset month */
- const int oy = yyvsp[-1].Number - 1; /* offset year */
-
- ((struct date_yy *)parm)->yyYear = yyvsp[-1].Number;
- ((struct date_yy *)parm)->yyMonth = 1;
- /* Zeller's formula */
- ((struct date_yy *)parm)->yyDay -= ((13 * om + 12) / 5 +
- oy + oy / 4 + oy / 400 - oy / 100) % 7 - 1;
- }
- break;
-case 51:
-{
- ((struct date_yy *)parm)->yyDay = (yyvsp[0].Number / 10) * 7 + (yyvsp[0].Number % 10) - 8;
- }
- break;
-case 52:
-{
- ((struct date_yy *)parm)->yyDay = yyvsp[-1].Number * 7 - yyvsp[0].Number - 8;
- }
- break;
-case 54:
-{
- int i = yyvsp[-2].Number;
-
- if (i <= -100000 || i >= 100000) {
- ((struct date_yy *)parm)->yyHour = i / 10000;
- i %= 10000;
- ((struct date_yy *)parm)->yyMinutes = i / 100;
- i %= 100;
- ((struct date_yy *)parm)->yySeconds = i;
- } else if (i <= -1000 || i >= 1000) {
- ((struct date_yy *)parm)->yyHour = i / 100;
- i %= 100;
- ((struct date_yy *)parm)->yyMinutes = i;
- ((struct date_yy *)parm)->yySeconds = 0;
- } else if (i >= -99 || i <= 99) {
- ((struct date_yy *)parm)->yyHour = yyvsp[-2].Number;
- ((struct date_yy *)parm)->yyMinutes = 0;
- ((struct date_yy *)parm)->yySeconds = 0;
- } else {
- ((struct date_yy *)parm)->yyHaveTime = 0;
- }
- ((struct date_yy *)parm)->yyMeridian = MER24;
- }
- break;
-case 55:
-{
- ((struct date_yy *)parm)->yyRelSeconds =
- -((struct date_yy *)parm)->yyRelSeconds;
- ((struct date_yy *)parm)->yyRelMinutes =
- -((struct date_yy *)parm)->yyRelMinutes;
- ((struct date_yy *)parm)->yyRelHour =
- -((struct date_yy *)parm)->yyRelHour;
- ((struct date_yy *)parm)->yyRelDay =
- -((struct date_yy *)parm)->yyRelDay;
- ((struct date_yy *)parm)->yyRelMonth =
- -((struct date_yy *)parm)->yyRelMonth;
- ((struct date_yy *)parm)->yyRelYear =
- -((struct date_yy *)parm)->yyRelYear;
- }
- break;
-case 57:
-{
- ((struct date_yy *)parm)->yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 58:
-{
- ((struct date_yy *)parm)->yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 59:
-{
- ((struct date_yy *)parm)->yyRelYear += yyvsp[0].Number;
- }
- break;
-case 60:
-{
- ((struct date_yy *)parm)->yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 61:
-{
- ((struct date_yy *)parm)->yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 62:
-{
- ((struct date_yy *)parm)->yyRelMonth += yyvsp[0].Number;
- }
- break;
-case 63:
-{
- ((struct date_yy *)parm)->yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 64:
-{
- ((struct date_yy *)parm)->yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 65:
-{
- ((struct date_yy *)parm)->yyRelDay += yyvsp[0].Number;
- }
- break;
-case 66:
-{
- ((struct date_yy *)parm)->yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 67:
-{
- ((struct date_yy *)parm)->yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 68:
-{
- ((struct date_yy *)parm)->yyRelHour += yyvsp[0].Number;
- }
- break;
-case 69:
-{
- ((struct date_yy *)parm)->yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 70:
-{
- ((struct date_yy *)parm)->yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 71:
-{
- ((struct date_yy *)parm)->yyRelMinutes += yyvsp[0].Number;
- }
- break;
-case 72:
-{
- ((struct date_yy *)parm)->yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 73:
-{
- ((struct date_yy *)parm)->yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
- }
- break;
-case 74:
-{
- ((struct date_yy *)parm)->yyRelSeconds += yyvsp[0].Number;
- }
- break;
-case 75:
-{
- if (((struct date_yy *)parm)->yyHaveTime &&
- ((struct date_yy *)parm)->yyHaveDate &&
- !((struct date_yy *)parm)->yyHaveRel)
- ((struct date_yy *)parm)->yyYear = yyvsp[0].Number;
- else
- {
- if (yyvsp[0].Number>10000)
- {
- ((struct date_yy *)parm)->yyHaveDate++;
- ((struct date_yy *)parm)->yyDay= (yyvsp[0].Number)%100;
- ((struct date_yy *)parm)->yyMonth= (yyvsp[0].Number/100)%100;
- ((struct date_yy *)parm)->yyYear = yyvsp[0].Number/10000;
- }
- else
- {
- ((struct date_yy *)parm)->yyHaveTime++;
- if (yyvsp[0].Number < 100)
- {
- ((struct date_yy *)parm)->yyHour = yyvsp[0].Number;
- ((struct date_yy *)parm)->yyMinutes = 0;
- }
- else
- {
- ((struct date_yy *)parm)->yyHour = yyvsp[0].Number / 100;
- ((struct date_yy *)parm)->yyMinutes = yyvsp[0].Number % 100;
- }
- ((struct date_yy *)parm)->yySeconds = 0;
- ((struct date_yy *)parm)->yyMeridian = MER24;
- }
- }
- }
- break;
-case 76:
-{
- ((struct date_yy *)parm)->yyMeridian = yyvsp[0].Meridian;
- }
- break;
-}
-
-
-
- yyvsp -= yylen;
- yyssp -= yylen;
-#if YYLSP_NEEDED
- yylsp -= yylen;
-#endif
-
-#if YYDEBUG
- if (yydebug)
- {
- short *yyssp1 = yyss - 1;
- YYFPRINTF (stderr, "state stack now");
- while (yyssp1 != yyssp)
- YYFPRINTF (stderr, " %d", *++yyssp1);
- YYFPRINTF (stderr, "\n");
- }
-#endif
-
- *++yyvsp = yyval;
-#if YYLSP_NEEDED
- *++yylsp = yyloc;
-#endif
-
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTBASE];
-
- goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
- {
- ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (yyn > YYFLAG && yyn < YYLAST)
- {
- YYSIZE_T yysize = 0;
- char *yymsg;
- int yyx, yycount;
-
- yycount = 0;
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- for (yyx = yyn < 0 ? -yyn : 0;
- yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
- if (yycheck[yyx + yyn] == yyx)
- yysize += yystrlen (yytname[yyx]) + 15, yycount++;
- yysize += yystrlen ("parse error, unexpected ") + 1;
- yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
- {
- char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
- yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
-
- if (yycount < 5)
- {
- yycount = 0;
- for (yyx = yyn < 0 ? -yyn : 0;
- yyx < (int) (sizeof (yytname) / sizeof (char *));
- yyx++)
- if (yycheck[yyx + yyn] == yyx)
- {
- const char *yyq = ! yycount ? ", expecting " : " or ";
- yyp = yystpcpy (yyp, yyq);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yycount++;
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- yyerror ("parse error; also virtual memory exhausted");
- }
- else
-#endif /* defined (YYERROR_VERBOSE) */
- yyerror ("parse error");
- }
- goto yyerrlab1;
-
-
-/*--------------------------------------------------.
-| yyerrlab1 -- error raised explicitly by an action |
-`--------------------------------------------------*/
-yyerrlab1:
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse lookahead token after an
- error, discard it. */
-
- /* return failure if at end of input */
- if (yychar == YYEOF)
- YYABORT;
- YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
- yychar, yytname[yychar1]));
- yychar = YYEMPTY;
- }
-
- /* Else will try to reuse lookahead token after shifting the error
- token. */
-
- yyerrstatus = 3; /* Each real token shifted decrements this */
-
- goto yyerrhandle;
-
-
-/*-------------------------------------------------------------------.
-| yyerrdefault -- current state does not do anything special for the |
-| error token. |
-`-------------------------------------------------------------------*/
-yyerrdefault:
-#if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
-
- /* If its default is to accept any token, ok. Otherwise pop it. */
- yyn = yydefact[yystate];
- if (yyn)
- goto yydefault;
-#endif
-
-
-/*---------------------------------------------------------------.
-| yyerrpop -- pop the current state because it cannot handle the |
-| error token |
-`---------------------------------------------------------------*/
-yyerrpop:
- if (yyssp == yyss)
- YYABORT;
- yyvsp--;
- yystate = *--yyssp;
-#if YYLSP_NEEDED
- yylsp--;
-#endif
-
-#if YYDEBUG
- if (yydebug)
- {
- short *yyssp1 = yyss - 1;
- YYFPRINTF (stderr, "Error: state stack now");
- while (yyssp1 != yyssp)
- YYFPRINTF (stderr, " %d", *++yyssp1);
- YYFPRINTF (stderr, "\n");
- }
-#endif
-
-/*--------------.
-| yyerrhandle. |
-`--------------*/
-yyerrhandle:
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
-
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
-
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrpop;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- YYDPRINTF ((stderr, "Shifting error token, "));
-
- *++yyvsp = yylval;
-#if YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-/*---------------------------------------------.
-| yyoverflowab -- parser overflow comes here. |
-`---------------------------------------------*/
-yyoverflowlab:
- yyerror ("parser stack overflow");
- yyresult = 2;
- /* Fall through. */
-
-yyreturn:
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
- return yyresult;
-}
-
-
-time_t get_date (char *p, time_t *now);
-
-#ifndef PHP_WIN32
-extern struct tm *gmtime();
-extern struct tm *localtime();
-extern time_t mktime();
-#endif
-
-/* Month and day table. */
-static TABLE const MonthDayTable[] = {
- { "january", tMONTH, 1 },
- { "february", tMONTH, 2 },
- { "march", tMONTH, 3 },
- { "april", tMONTH, 4 },
- { "may", tMONTH, 5 },
- { "june", tMONTH, 6 },
- { "july", tMONTH, 7 },
- { "august", tMONTH, 8 },
- { "september", tMONTH, 9 },
- { "sept", tMONTH, 9 },
- { "october", tMONTH, 10 },
- { "november", tMONTH, 11 },
- { "december", tMONTH, 12 },
- { "sunday", tDAY, 0 },
- { "monday", tDAY, 1 },
- { "tuesday", tDAY, 2 },
- { "tues", tDAY, 2 },
- { "wednesday", tDAY, 3 },
- { "wednes", tDAY, 3 },
- { "thursday", tDAY, 4 },
- { "thur", tDAY, 4 },
- { "thurs", tDAY, 4 },
- { "friday", tDAY, 5 },
- { "saturday", tDAY, 6 },
- { NULL, 0, 0 }
-};
-
-/* Time units table. */
-static TABLE const UnitsTable[] = {
- { "year", tYEAR_UNIT, 1 },
- { "month", tMONTH_UNIT, 1 },
- { "fortnight", tDAY_UNIT, 14 },
- { "week", tDAY_UNIT, 7 },
- { "day", tDAY_UNIT, 1 },
- { "hour", tHOUR_UNIT, 1 },
- { "minute", tMINUTE_UNIT, 1 },
- { "min", tMINUTE_UNIT, 1 },
- { "second", tSEC_UNIT, 1 },
- { "sec", tSEC_UNIT, 1 },
- { NULL, 0, 0 }
-};
-
-/* Assorted relative-time words. */
-static TABLE const OtherTable[] = {
- { "tomorrow", tDAY_UNIT, 1 },
- { "yesterday", tDAY_UNIT, -1 },
- { "today", tDAY_UNIT, 0 },
- { "now", tDAY_UNIT, 0 },
- { "last", tUNUMBER, -1 },
- { "this", tUNUMBER, 0 },
- { "next", tUNUMBER, 1 },
- { "first", tUNUMBER, 1 },
-/* { "second", tUNUMBER, 2 }, */
- { "third", tUNUMBER, 3 },
- { "fourth", tUNUMBER, 4 },
- { "fifth", tUNUMBER, 5 },
- { "sixth", tUNUMBER, 6 },
- { "seventh", tUNUMBER, 7 },
- { "eighth", tUNUMBER, 8 },
- { "ninth", tUNUMBER, 9 },
- { "tenth", tUNUMBER, 10 },
- { "eleventh", tUNUMBER, 11 },
- { "twelfth", tUNUMBER, 12 },
- { "ago", tAGO, 1 },
- { NULL, 0, 0 }
-};
-
-/* The timezone table. */
-static TABLE const TimezoneTable[] = {
- { "gmt", tZONE, HOUR ( 0) }, /* Greenwich Mean */
- { "ut", tZONE, HOUR ( 0) }, /* Universal (Coordinated) */
- { "utc", tZONE, HOUR ( 0) },
- { "wet", tZONE, HOUR ( 0) }, /* Western European */
- { "bst", tDAYZONE, HOUR ( 0) }, /* British Summer */
- { "wat", tZONE, HOUR ( 1) }, /* West Africa */
- { "at", tZONE, HOUR ( 2) }, /* Azores */
-#if 0
- /* For completeness. BST is also British Summer, and GST is
- * also Guam Standard. */
- { "bst", tZONE, HOUR ( 3) }, /* Brazil Standard */
- { "gst", tZONE, HOUR ( 3) }, /* Greenland Standard */
-#endif
-#if 0
- { "nft", tZONE, HOUR (3.5) }, /* Newfoundland */
- { "nst", tZONE, HOUR (3.5) }, /* Newfoundland Standard */
- { "ndt", tDAYZONE, HOUR (3.5) }, /* Newfoundland Daylight */
-#endif
- { "ast", tZONE, HOUR ( 4) }, /* Atlantic Standard */
- { "adt", tDAYZONE, HOUR ( 4) }, /* Atlantic Daylight */
- { "est", tZONE, HOUR ( 5) }, /* Eastern Standard */
- { "edt", tDAYZONE, HOUR ( 5) }, /* Eastern Daylight */
- { "cst", tZONE, HOUR ( 6) }, /* Central Standard */
- { "cdt", tDAYZONE, HOUR ( 6) }, /* Central Daylight */
- { "mst", tZONE, HOUR ( 7) }, /* Mountain Standard */
- { "mdt", tDAYZONE, HOUR ( 7) }, /* Mountain Daylight */
- { "pst", tZONE, HOUR ( 8) }, /* Pacific Standard */
- { "pdt", tDAYZONE, HOUR ( 8) }, /* Pacific Daylight */
- { "yst", tZONE, HOUR ( 9) }, /* Yukon Standard */
- { "ydt", tDAYZONE, HOUR ( 9) }, /* Yukon Daylight */
- { "hst", tZONE, HOUR (10) }, /* Hawaii Standard */
- { "hdt", tDAYZONE, HOUR (10) }, /* Hawaii Daylight */
- { "cat", tZONE, HOUR (10) }, /* Central Alaska */
- { "akst", tZONE, HOUR (10) }, /* Alaska Standard */
- { "akdt", tZONE, HOUR (10) }, /* Alaska Daylight */
- { "ahst", tZONE, HOUR (10) }, /* Alaska-Hawaii Standard */
- { "nt", tZONE, HOUR (11) }, /* Nome */
- { "idlw", tZONE, HOUR (12) }, /* International Date Line West */
- { "cet", tZONE, -HOUR (1) }, /* Central European */
- { "cest", tDAYZONE, -HOUR (1) }, /* Central European Summer */
- { "met", tZONE, -HOUR (1) }, /* Middle European */
- { "mewt", tZONE, -HOUR (1) }, /* Middle European Winter */
- { "mest", tDAYZONE, -HOUR (1) }, /* Middle European Summer */
- { "mesz", tDAYZONE, -HOUR (1) }, /* Middle European Summer */
- { "swt", tZONE, -HOUR (1) }, /* Swedish Winter */
- { "sst", tDAYZONE, -HOUR (1) }, /* Swedish Summer */
- { "fwt", tZONE, -HOUR (1) }, /* French Winter */
- { "fst", tDAYZONE, -HOUR (1) }, /* French Summer */
- { "eet", tZONE, -HOUR (2) }, /* Eastern Europe, USSR Zone 1 */
- { "bt", tZONE, -HOUR (3) }, /* Baghdad, USSR Zone 2 */
-#if 0
- { "it", tZONE, -HOUR (3.5) },/* Iran */
-#endif
- { "zp4", tZONE, -HOUR (4) }, /* USSR Zone 3 */
- { "zp5", tZONE, -HOUR (5) }, /* USSR Zone 4 */
-#if 0
- { "ist", tZONE, -HOUR (5.5) },/* Indian Standard */
-#endif
- { "zp6", tZONE, -HOUR (6) }, /* USSR Zone 5 */
-#if 0
- /* For completeness. NST is also Newfoundland Standard, and SST is
- * also Swedish Summer. */
- { "nst", tZONE, -HOUR (6.5) },/* North Sumatra */
- { "sst", tZONE, -HOUR (7) }, /* South Sumatra, USSR Zone 6 */
-#endif /* 0 */
- { "wast", tZONE, -HOUR (7) }, /* West Australian Standard */
- { "wadt", tDAYZONE, -HOUR (7) }, /* West Australian Daylight */
-#if 0
- { "jt", tZONE, -HOUR (7.5) },/* Java (3pm in Cronusland!) */
-#endif
- { "cct", tZONE, -HOUR (8) }, /* China Coast, USSR Zone 7 */
- { "jst", tZONE, -HOUR (9) }, /* Japan Standard, USSR Zone 8 */
-#if 0
- { "cast", tZONE, -HOUR (9.5) },/* Central Australian Standard */
- { "cadt", tDAYZONE, -HOUR (9.5) },/* Central Australian Daylight */
-#endif
- { "east", tZONE, -HOUR (10) }, /* Eastern Australian Standard */
- { "eadt", tDAYZONE, -HOUR (10) }, /* Eastern Australian Daylight */
- { "gst", tZONE, -HOUR (10) }, /* Guam Standard, USSR Zone 9 */
- { "nzt", tZONE, -HOUR (12) }, /* New Zealand */
- { "nzst", tZONE, -HOUR (12) }, /* New Zealand Standard */
- { "nzdt", tDAYZONE, -HOUR (12) }, /* New Zealand Daylight */
- { "idle", tZONE, -HOUR (12) }, /* International Date Line East */
- { NULL, 0, 0 }
-};
-
-/* Military timezone table. */
-static TABLE const MilitaryTable[] = {
- { "a", tZONE, HOUR (- 1) },
- { "b", tZONE, HOUR (- 2) },
- { "c", tZONE, HOUR (- 3) },
- { "d", tZONE, HOUR (- 4) },
- { "e", tZONE, HOUR (- 5) },
- { "f", tZONE, HOUR (- 6) },
- { "g", tZONE, HOUR (- 7) },
- { "h", tZONE, HOUR (- 8) },
- { "i", tZONE, HOUR (- 9) },
- { "k", tZONE, HOUR (-10) },
- { "l", tZONE, HOUR (-11) },
- { "m", tZONE, HOUR (-12) },
- { "n", tZONE, HOUR ( 1) },
- { "o", tZONE, HOUR ( 2) },
- { "p", tZONE, HOUR ( 3) },
- { "q", tZONE, HOUR ( 4) },
- { "r", tZONE, HOUR ( 5) },
- { "s", tZONE, HOUR ( 6) },
- { "t", tTZONE, HOUR ( 7) },
- { "u", tZONE, HOUR ( 8) },
- { "v", tZONE, HOUR ( 9) },
- { "w", tWZONE, HOUR ( 10) },
- { "x", tZONE, HOUR ( 11) },
- { "y", tZONE, HOUR ( 12) },
- { "z", tZZONE, HOUR ( 0) },
- { NULL, 0, 0 }
-};
-
-
-
-
-/* ARGSUSED */
-static int
-yyerror (s)
- char *s ATTRIBUTE_UNUSED;
-{
- return 0;
-}
-
-static int
-ToHour (Hours, Meridian)
- int Hours;
- MERIDIAN Meridian;
-{
- switch (Meridian)
- {
- case MER24:
- if (Hours < 0 || Hours > 23)
- return -1;
- return Hours;
- case MERam:
- if (Hours < 1 || Hours > 12)
- return -1;
- if (Hours == 12)
- Hours = 0;
- return Hours;
- case MERpm:
- if (Hours < 1 || Hours > 12)
- return -1;
- if (Hours == 12)
- Hours = 0;
- return Hours + 12;
- default:
- abort ();
- }
- /* NOTREACHED */
-}
-
-static int
-ToYear (Year)
- int Year;
-{
- if (Year < 0)
- Year = -Year;
-
- /* XPG4 suggests that years 00-68 map to 2000-2068, and
- years 69-99 map to 1969-1999. */
- if (Year < 69)
- Year += 2000;
- else if (Year < 100)
- Year += 1900;
-
- return Year;
-}
-
-static int
-LookupWord (lvalp,buff)
- YYSTYPE *lvalp;
- char *buff;
-{
- register char *p;
- register char *q;
- register const TABLE *tp;
- int i;
- int abbrev;
-
- /* Make it lowercase. */
- for (p = buff; *p; p++)
- if (ISUPPER ((unsigned char) *p))
- *p = tolower (*p);
-
- if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0)
- {
- lvalp->Meridian = MERam;
- return tMERIDIAN;
- }
- if (strcmp (buff, "pm") == 0 || strcmp (buff, "p.m.") == 0)
- {
- lvalp->Meridian = MERpm;
- return tMERIDIAN;
- }
-
- /* See if we have an abbreviation for a month. */
- if (strlen (buff) == 3)
- abbrev = 1;
- else if (strlen (buff) == 4 && buff[3] == '.')
- {
- abbrev = 1;
- buff[3] = '\0';
- }
- else
- abbrev = 0;
-
- for (tp = MonthDayTable; tp->name; tp++)
- {
- if (abbrev)
- {
- if (strncmp (buff, tp->name, 3) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
- }
- else if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
- }
-
- for (tp = TimezoneTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
-
- if (strcmp (buff, "dst") == 0)
- return tDST;
-
- for (tp = UnitsTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
-
- /* Strip off any plural and try the units table again. */
- i = strlen (buff) - 1;
- if (buff[i] == 's')
- {
- buff[i] = '\0';
- for (tp = UnitsTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
- buff[i] = 's'; /* Put back for "this" in OtherTable. */
- }
-
- for (tp = OtherTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
-
- /* Military timezones. */
- if (buff[1] == '\0' && ISALPHA ((unsigned char) *buff))
- {
- for (tp = MilitaryTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
- }
-
- /* Drop out any periods and try the timezone table again. */
- for (i = 0, p = q = buff; *q; q++)
- if (*q != '.')
- *p++ = *q;
- else
- i++;
- *p = '\0';
- if (i)
- for (tp = TimezoneTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
-
- return tID;
-}
-
-int yylex (YYSTYPE *lvalp, void *parm)
-{
- register unsigned char c;
- register char *p;
- char buff[20];
- int Count;
- int sign;
- struct date_yy * date = (struct date_yy *)parm;
-
- for (;;)
- {
- while (ISSPACE ((unsigned char) *date->yyInput))
- date->yyInput++;
-
- if (ISDIGIT (c = *date->yyInput) || c == '-' || c == '+')
- {
- if (c == '-' || c == '+')
- {
- sign = c == '-' ? -1 : 1;
- if (!ISDIGIT (*++date->yyInput))
- /* skip the '-' sign */
- continue;
- }
- else
- sign = 0;
- for (lvalp->Number = 0; ISDIGIT (c = *date->yyInput++);)
- lvalp->Number = 10 * lvalp->Number + c - '0';
- date->yyInput--;
- if (sign < 0)
- lvalp->Number = -lvalp->Number;
- /* Ignore ordinal suffixes on numbers */
- c = *date->yyInput;
- if (c == 's' || c == 'n' || c == 'r' || c == 't') {
- c = *++date->yyInput;
- if (c == 't' || c == 'd' || c == 'h') {
- date->yyInput++;
- } else {
- date->yyInput--;
- }
- }
- return sign ? tSNUMBER : tUNUMBER;
- }
- if (ISALPHA (c))
- {
- for (p = buff; (c = *date->yyInput++, ISALPHA (c)) || c == '.';)
- if (p < &buff[sizeof buff - 1])
- *p++ = c;
- *p = '\0';
- date->yyInput--;
- return LookupWord (lvalp, buff);
- }
- if (c != '(')
- return *date->yyInput++;
- Count = 0;
- do
- {
- c = *date->yyInput++;
- if (c == '\0')
- return c;
- if (c == '(')
- Count++;
- else if (c == ')')
- Count--;
- }
- while (Count > 0);
- }
-}
-
-#define TM_YEAR_ORIGIN 1900
-
-/* Yield A - B, measured in seconds. */
-static long
-difftm (struct tm *a, struct tm *b)
-{
- int ay = a->tm_year + (TM_YEAR_ORIGIN - 1);
- int by = b->tm_year + (TM_YEAR_ORIGIN - 1);
- long days = (
- /* difference in day of year */
- a->tm_yday - b->tm_yday
- /* + intervening leap days */
- + ((ay >> 2) - (by >> 2))
- - (ay / 100 - by / 100)
- + ((ay / 100 >> 2) - (by / 100 >> 2))
- /* + difference in years * 365 */
- + (long) (ay - by) * 365
- );
- return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
- + (a->tm_min - b->tm_min))
- + (a->tm_sec - b->tm_sec));
-}
-
-time_t php_parse_date(char *p, time_t *now)
-{
- struct tm tm, tm0, *tmp;
- time_t Start;
- struct date_yy date;
-
- date.yyInput = p;
- Start = now ? *now : time ((time_t *) NULL);
- tmp = localtime (&Start);
- if (!tmp)
- return -1;
- date.yyYear = tmp->tm_year + TM_YEAR_ORIGIN;
- date.yyMonth = tmp->tm_mon + 1;
- date.yyDay = tmp->tm_mday;
- date.yyHour = tmp->tm_hour;
- date.yyMinutes = tmp->tm_min;
- date.yySeconds = tmp->tm_sec;
- tm.tm_isdst = tmp->tm_isdst;
- date.yyMeridian = MER24;
- date.yyRelSeconds = 0;
- date.yyRelMinutes = 0;
- date.yyRelHour = 0;
- date.yyRelDay = 0;
- date.yyRelMonth = 0;
- date.yyRelYear = 0;
- date.yyHaveDate = 0;
- date.yyHaveDay = 0;
- date.yyHaveRel = 0;
- date.yyHaveTime = 0;
- date.yyHaveZone = 0;
-
- if (yyparse ((void *)&date)
- || date.yyHaveTime > 1 || date.yyHaveZone > 1
- || date.yyHaveDate > 1 || date.yyHaveDay > 1) {
- return -1;
- }
- tm.tm_year = ToYear (date.yyYear) - TM_YEAR_ORIGIN + date.yyRelYear;
- tm.tm_mon = date.yyMonth - 1 + date.yyRelMonth;
- tm.tm_mday = date.yyDay + date.yyRelDay;
- if (date.yyHaveTime || (date.yyHaveRel && !date.yyHaveDate && !date.yyHaveDay))
- {
- tm.tm_hour = ToHour (date.yyHour, date.yyMeridian);
- if (tm.tm_hour < 0)
- return -1;
- tm.tm_min = date.yyMinutes;
- tm.tm_sec = date.yySeconds;
- }
- else
- {
- tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
- }
- tm.tm_hour += date.yyRelHour;
- tm.tm_min += date.yyRelMinutes;
- tm.tm_sec += date.yyRelSeconds;
-
- /* Let mktime deduce tm_isdst if we have an absolute timestamp,
- or if the relative timestamp mentions days, months, or years. */
- if (date.yyHaveDate | date.yyHaveDay | date.yyHaveTime | date.yyRelDay | date.yyRelMonth | date.yyRelYear)
- tm.tm_isdst = -1;
-
- tm0 = tm;
-
- Start = mktime (&tm);
-
- if (Start == (time_t) -1)
- {
-
- /* Guard against falsely reporting errors near the time_t boundaries
- when parsing times in other time zones. For example, if the min
- time_t value is 1970-01-01 00:00:00 UTC and we are 8 hours ahead
- of UTC, then the min localtime value is 1970-01-01 08:00:00; if
- we apply mktime to 1970-01-01 00:00:00 we will get an error, so
- we apply mktime to 1970-01-02 08:00:00 instead and adjust the time
- zone by 24 hours to compensate. This algorithm assumes that
- there is no DST transition within a day of the time_t boundaries. */
- if (date.yyHaveZone)
- {
- tm = tm0;
- if (tm.tm_year <= EPOCH - TM_YEAR_ORIGIN)
- {
- tm.tm_mday++;
- date.yyTimezone -= 24 * 60;
- }
- else
- {
- tm.tm_mday--;
- date.yyTimezone += 24 * 60;
- }
- Start = mktime (&tm);
- }
-
- if (Start == (time_t) -1)
- return Start;
- }
-
- if (date.yyHaveDay && !date.yyHaveDate)
- {
- tm.tm_mday += ((date.yyDayNumber - tm.tm_wday + 7) % 7
- + 7 * (date.yyDayOrdinal - (0 < date.yyDayOrdinal)));
- Start = mktime (&tm);
- if (Start == (time_t) -1)
- return Start;
- }
-
- if (date.yyHaveZone)
- {
- long delta;
- struct tm *gmt = gmtime (&Start);
- if (!gmt)
- return -1;
- delta = date.yyTimezone * 60L + difftm (&tm, gmt);
-
- if ((Start + delta < Start) != (delta < 0))
- return -1; /* time_t overflow */
- Start += delta;
- }
-
- return Start;
-}
diff --git a/ext/standard/parsedate.h b/ext/standard/parsedate.h
deleted file mode 100644
index 01c41fcb6..000000000
--- a/ext/standard/parsedate.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef BISON_EXT_STANDARD_PARSEDATE_H
-# define BISON_EXT_STANDARD_PARSEDATE_H
-
-# ifndef YYSTYPE
-# define YYSTYPE int
-# define YYSTYPE_IS_TRIVIAL 1
-# endif
-# define tAGO 257
-# define tDAY 258
-# define tDAY_UNIT 259
-# define tDAYZONE 260
-# define tDST 261
-# define tHOUR_UNIT 262
-# define tID 263
-# define tTZONE 264
-# define tWZONE 265
-# define tZZONE 266
-# define tMERIDIAN 267
-# define tMINUTE_UNIT 268
-# define tMONTH 269
-# define tMONTH_UNIT 270
-# define tSEC_UNIT 271
-# define tSNUMBER 272
-# define tUNUMBER 273
-# define tYEAR_UNIT 274
-# define tZONE 275
-
-
-#endif /* not BISON_EXT_STANDARD_PARSEDATE_H */
diff --git a/ext/standard/parsedate.y b/ext/standard/parsedate.y
deleted file mode 100644
index 6502fb355..000000000
--- a/ext/standard/parsedate.y
+++ /dev/null
@@ -1,1161 +0,0 @@
-%{
-/*
-** Originally written by Steven M. Bellovin <smb@research.att.com> while
-** at the University of North Carolina at Chapel Hill. Later tweaked by
-** a couple of people on Usenet. Completely overhauled by Rich $alz
-** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990.
-**
-** This code is in the public domain and has no copyright.
-*/
-
-/* $Id: parsedate.y,v 1.56.2.2 2005/05/20 11:14:01 derick Exp $ */
-
-#include "php.h"
-
-#ifdef PHP_WIN32
-#include <malloc.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <time.h>
-#include <ctype.h>
-
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef PHP_WIN32
-# include "win32/time.h"
-#endif
-
-#include "php_parsedate.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h> /* for `free'; used by Bison 1.27 */
-#endif
-
-#if defined(_HPUX_SOURCE)
-#include <alloca.h>
-#endif
-
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-# define IN_CTYPE_DOMAIN(c) 1
-#else
-# define IN_CTYPE_DOMAIN(c) isascii(c)
-#endif
-
-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
-#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
-
-/* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
- - Its arg may be any int or unsigned int; it need not be an unsigned char.
- - It's guaranteed to evaluate its argument exactly once.
- - It's typically faster.
- Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
- only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE unless
- it's important to use the locale's definition of `digit' even when the
- host does not conform to Posix. */
-#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
-
-#if defined (STDC_HEADERS) || defined (USG)
-# include <string.h>
-#endif
-
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __attribute__(x)
-#endif
-
-#ifndef ATTRIBUTE_UNUSED
-# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-#endif
-
-/* Some old versions of bison generate parsers that use bcopy.
- That loses on systems that don't provide the function, so we have
- to redefine it here. */
-#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
-# define bcopy(from, to, len) memcpy ((to), (from), (len))
-#endif
-
-/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
- as well as gratuitiously global symbol names, so we can have multiple
- yacc generated parsers in the same program. Note that these are only
- the variables produced by yacc. If other parser generators (bison,
- byacc, etc) produce additional global names that conflict at link time,
- then those parser generators need to be fixed instead of adding those
- names to this list. */
-
-#define yyparse php_gd_parse
-#define yylex php_gd_lex
-
-static int yyerror ();
-
-#define EPOCH 1970
-#define HOUR(x) ((x) * 60)
-
-#define MAX_BUFF_LEN 128 /* size of buffer to read the date into */
-
-/*
-** An entry in the lexical lookup table.
-*/
-typedef struct _TABLE {
- const char *name;
- int type;
- int value;
-} TABLE;
-
-
-/*
-** Meridian: am, pm, or 24-hour style.
-*/
-typedef enum _MERIDIAN {
- MERam, MERpm, MER24
-} MERIDIAN;
-
-struct date_yy {
- const char *yyInput;
- int yyDayOrdinal;
- int yyDayNumber;
- int yyHaveDate;
- int yyHaveDay;
- int yyHaveRel;
- int yyHaveTime;
- int yyHaveZone;
- int yyTimezone;
- int yyDay;
- int yyHour;
- int yyMinutes;
- int yyMonth;
- int yySeconds;
- int yyYear;
- MERIDIAN yyMeridian;
- int yyRelDay;
- int yyRelHour;
- int yyRelMinutes;
- int yyRelMonth;
- int yyRelSeconds;
- int yyRelYear;
-};
-
-typedef union _date_ll {
- int Number;
- enum _MERIDIAN Meridian;
-} date_ll;
-
-#define YYPARSE_PARAM parm
-#define YYLEX_PARAM parm
-#define YYSTYPE date_ll
-#define YYLTYPE void
-
-static int yylex (YYSTYPE *lvalp, void *parm);
-%}
-
-/* This grammar has 56 shift/reduce conflicts. */
-%expect 56
-%pure_parser
-
-%token tAGO tDAY tDAY_UNIT tDAYZONE tDST tHOUR_UNIT tID tTZONE tWZONE tZZONE
-%token tMERIDIAN tMINUTE_UNIT tMONTH tMONTH_UNIT
-%token tSEC_UNIT tSNUMBER tUNUMBER tYEAR_UNIT tZONE
-
-%type <Number> tDAY tDAY_UNIT tDAYZONE tHOUR_UNIT tMINUTE_UNIT
-%type <Number> tMONTH tMONTH_UNIT
-%type <Number> tSEC_UNIT tSNUMBER tUNUMBER tYEAR_UNIT tZONE tTZONE tWZONE tZZONE
-%type <Meridian> tMERIDIAN
-
-%%
-
-spec : /* NULL */
- | spec item
- ;
-
-item : time {
- ((struct date_yy *)parm)->yyHaveTime++;
- }
- | zone {
- ((struct date_yy *)parm)->yyHaveZone++;
- }
- | date {
- ((struct date_yy *)parm)->yyHaveDate++;
- }
- | day {
- ((struct date_yy *)parm)->yyHaveDay++;
- }
- | rel {
- ((struct date_yy *)parm)->yyHaveRel++;
- }
- | number
- | o_merid
- ;
-
-time : tUNUMBER tMERIDIAN {
- ((struct date_yy *)parm)->yyHour = $1;
- ((struct date_yy *)parm)->yyMinutes = 0;
- ((struct date_yy *)parm)->yySeconds = 0;
- ((struct date_yy *)parm)->yyMeridian = $2;
- }
- | iso8601time_colon
- /* | pgsqltime ... shares a common spec with ISO8601 */
- ;
-
-iso8601time_colon: HMStime_with_colon sec_fraction_part rel {
- ((struct date_yy *)parm)->yyMeridian = MER24;
- }
- | HMtime_with_colon sec_fraction_part rel {
- ((struct date_yy *)parm)->yyMeridian = MER24;
- ((struct date_yy *)parm)->yySeconds = 0;
- }
- | HMStime_with_colon sec_fraction_part iso8601zonepart {
- ((struct date_yy *)parm)->yyMeridian = MER24;
- }
- | HMtime_with_colon sec_fraction_part iso8601zonepart {
- ((struct date_yy *)parm)->yyMeridian = MER24;
- ((struct date_yy *)parm)->yySeconds = 0;
- }
- ;
-
-iso8601zonepart: zonepart_numeric_without_colon {
- ((struct date_yy *)parm)->yyHaveZone++;
- }
- | zonepart_numeric_with_colon {
- ((struct date_yy *)parm)->yyHaveZone++;
- }
- | zone {
- ((struct date_yy *)parm)->yyHaveZone++;
- }
- | /* empty */
- ;
-
-sec_fraction_part: '.' tUNUMBER {
- }
- | /* empty */
- ;
-
-zonepart_numeric_without_colon: tSNUMBER {
- /* format: [+-]hhmm */
- if ($1 <= -100 || $1 >= 100) {
- ((struct date_yy *)parm)->yyTimezone = (-$1 / 100) * 60 + (-$1 % 100);
- } else if ($1 >= -99 || $1 <= 99) {
- ((struct date_yy *)parm)->yyTimezone = -$1 * 60;
- }
- }
- ;
-
-zonepart_numeric_with_colon: tSNUMBER ':' tUNUMBER {
- /* format: [+-]hh:mm */
- ((struct date_yy *)parm)->yyTimezone = -$1 * 60 + ($1 > 0 ? -$3: $3);
- }
- ;
-
-HMStime_with_colon: HMtime_with_colon ':' tUNUMBER {
- /* format: hh:mm:ss */
- ((struct date_yy *)parm)->yySeconds = $3;
- }
- ;
-
-HMtime_with_colon: tUNUMBER ':' tUNUMBER {
- /* format: hh:mm */
- ((struct date_yy *)parm)->yyHour = $1;
- ((struct date_yy *)parm)->yyMinutes = $3;
- }
- ;
-
-
- /* we have to deal with a special case for the datetime format
- of XML Schema here: '2003-11-18T22:40:00Z'
- the combination of a 'T' timezone specifier later followed
- by a 'Z' is now recognized and allowed
- TODO: change the grammer so that the exact positions are checked
- right now '2003-11-18 22:40:00 TZ' is also accepted (hartmut)
- */
-
-zone : tTZONE {
- ((struct date_yy *)parm)->yyTimezone = $1;
- }
- | tWZONE {
- ((struct date_yy *)parm)->yyTimezone = $1;
- }
- | tZZONE {
- ((struct date_yy *)parm)->yyTimezone = $1;
- }
- | tZONE {
- ((struct date_yy *)parm)->yyTimezone = $1;
- }
- | tDAYZONE {
- ((struct date_yy *)parm)->yyTimezone = $1 - 60;
- }
- | tZONE tDST {
- ((struct date_yy *)parm)->yyTimezone = $1 - 60;
- }
- ;
-
-day : tDAY {
- ((struct date_yy *)parm)->yyDayOrdinal = 1;
- ((struct date_yy *)parm)->yyDayNumber = $1;
- }
- | tDAY ',' {
- ((struct date_yy *)parm)->yyDayOrdinal = 1;
- ((struct date_yy *)parm)->yyDayNumber = $1;
- }
- | tUNUMBER tDAY {
- ((struct date_yy *)parm)->yyDayOrdinal = $1;
- ((struct date_yy *)parm)->yyDayNumber = $2;
- }
- ;
-
-date : tUNUMBER '/' tUNUMBER {
- ((struct date_yy *)parm)->yyMonth = $1;
- ((struct date_yy *)parm)->yyDay = $3;
- }
- | tMONTH tUNUMBER tUNUMBER ':' tUNUMBER ':' tUNUMBER tUNUMBER {
- ((struct date_yy *)parm)->yyYear = $8;
- ((struct date_yy *)parm)->yyMonth = $1;
- ((struct date_yy *)parm)->yyDay = $2;
-
- ((struct date_yy *)parm)->yyHour = $3;
- ((struct date_yy *)parm)->yyMinutes = $5;
- ((struct date_yy *)parm)->yySeconds = $7;
-
- ((struct date_yy *)parm)->yyHaveTime = 1;
- }
- | tUNUMBER '/' tUNUMBER '/' tUNUMBER {
- /* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY.
- The goal in recognizing YYYY/MM/DD is solely to support legacy
- machine-generated dates like those in an RCS log listing. If
- you want portability, use the ISO 8601 format. */
- if ($1 >= 1000)
- {
- ((struct date_yy *)parm)->yyYear = $1;
- ((struct date_yy *)parm)->yyMonth = $3;
- ((struct date_yy *)parm)->yyDay = $5;
- }
- else
- {
- ((struct date_yy *)parm)->yyMonth = $1;
- ((struct date_yy *)parm)->yyDay = $3;
- ((struct date_yy *)parm)->yyYear = $5;
- }
- }
- | iso8601date
- | iso8601datetime {
- ((struct date_yy *)parm)->yyHaveTime++;
- }
- | tUNUMBER tMONTH tSNUMBER {
- /* e.g. 17-JUN-1992. */
- ((struct date_yy *)parm)->yyDay = $1;
- ((struct date_yy *)parm)->yyMonth = $2;
- ((struct date_yy *)parm)->yyYear = -$3;
- }
- | tMONTH tUNUMBER tUNUMBER {
- ((struct date_yy *)parm)->yyMonth = $1;
- ((struct date_yy *)parm)->yyDay = $2;
- ((struct date_yy *)parm)->yyYear = $3;
- }
- | tMONTH tUNUMBER {
- ((struct date_yy *)parm)->yyMonth = $1;
- if ($2 > 1000) {
- ((struct date_yy *)parm)->yyYear = $2;
- } else {
- ((struct date_yy *)parm)->yyDay = $2;
- }
- }
- | tMONTH tUNUMBER ',' tUNUMBER {
- ((struct date_yy *)parm)->yyMonth = $1;
- ((struct date_yy *)parm)->yyDay = $2;
- ((struct date_yy *)parm)->yyYear = $4;
- }
- | tUNUMBER tMONTH {
- ((struct date_yy *)parm)->yyMonth = $2;
- if ($1 > 1000) {
- ((struct date_yy *)parm)->yyYear = $1;
- } else {
- ((struct date_yy *)parm)->yyDay = $1;
- }
- }
- | tUNUMBER tMONTH tUNUMBER {
- ((struct date_yy *)parm)->yyMonth = $2;
- ((struct date_yy *)parm)->yyDay = $1;
- ((struct date_yy *)parm)->yyYear = $3;
- }
- ;
-
-iso8601datetime: iso8601date tTZONE iso8601time
- | tUNUMBER tTZONE iso8601time {
- int i = $1;
-
- if (i >= 10000) {
- /* format: yyyymmdd */
- ((struct date_yy *)parm)->yyYear = i / 10000;
- i %= 10000;
- ((struct date_yy *)parm)->yyMonth = i / 100;
- i %= 100;
- ((struct date_yy *)parm)->yyDay = i;
- } else if (i >= 1000 && i <= 9999) {
- /* format: yyyy */
- ((struct date_yy *)parm)->yyYear = i;
- ((struct date_yy *)parm)->yyDay= 1;
- ((struct date_yy *)parm)->yyMonth = 1;
- }
- }
- ;
-
-iso8601date: tUNUMBER tSNUMBER tSNUMBER {
- /* ISO 8601 format. yyyy-mm-dd. */
- ((struct date_yy *)parm)->yyYear = $1;
- ((struct date_yy *)parm)->yyMonth = -$2;
- ((struct date_yy *)parm)->yyDay = -$3;
- }
- | tUNUMBER tSNUMBER {
- /* ISO 8601 format yyyy-mm */
- ((struct date_yy *)parm)->yyYear = $1;
- ((struct date_yy *)parm)->yyMonth = -$2;
- ((struct date_yy *)parm)->yyDay = 1;
- }
- | tUNUMBER iso8601weekspec {
- const int om = (1 + 9) % 12; /* offset month */
- const int oy = $1 - 1; /* offset year */
-
- ((struct date_yy *)parm)->yyYear = $1;
- ((struct date_yy *)parm)->yyMonth = 1;
- /* Zeller's formula */
- ((struct date_yy *)parm)->yyDay -= ((13 * om + 12) / 5 +
- oy + oy / 4 + oy / 400 - oy / 100) % 7 - 1;
- }
- ;
-
-iso8601weekspec: tWZONE tUNUMBER {
- ((struct date_yy *)parm)->yyDay = ($2 / 10) * 7 + ($2 % 10) - 8;
- }
- | tWZONE tUNUMBER tSNUMBER {
- ((struct date_yy *)parm)->yyDay = $2 * 7 - $3 - 8;
- }
- ;
-
-iso8601time:
- iso8601time_colon
- | tUNUMBER sec_fraction_part iso8601zonepart {
- int i = $1;
-
- if (i <= -100000 || i >= 100000) {
- ((struct date_yy *)parm)->yyHour = i / 10000;
- i %= 10000;
- ((struct date_yy *)parm)->yyMinutes = i / 100;
- i %= 100;
- ((struct date_yy *)parm)->yySeconds = i;
- } else if (i <= -1000 || i >= 1000) {
- ((struct date_yy *)parm)->yyHour = i / 100;
- i %= 100;
- ((struct date_yy *)parm)->yyMinutes = i;
- ((struct date_yy *)parm)->yySeconds = 0;
- } else if (i >= -99 || i <= 99) {
- ((struct date_yy *)parm)->yyHour = $1;
- ((struct date_yy *)parm)->yyMinutes = 0;
- ((struct date_yy *)parm)->yySeconds = 0;
- } else {
- ((struct date_yy *)parm)->yyHaveTime = 0;
- }
- ((struct date_yy *)parm)->yyMeridian = MER24;
- }
- ;
-
-rel : relunit tAGO {
- ((struct date_yy *)parm)->yyRelSeconds =
- -((struct date_yy *)parm)->yyRelSeconds;
- ((struct date_yy *)parm)->yyRelMinutes =
- -((struct date_yy *)parm)->yyRelMinutes;
- ((struct date_yy *)parm)->yyRelHour =
- -((struct date_yy *)parm)->yyRelHour;
- ((struct date_yy *)parm)->yyRelDay =
- -((struct date_yy *)parm)->yyRelDay;
- ((struct date_yy *)parm)->yyRelMonth =
- -((struct date_yy *)parm)->yyRelMonth;
- ((struct date_yy *)parm)->yyRelYear =
- -((struct date_yy *)parm)->yyRelYear;
- }
- | relunit
- ;
-
-relunit : tUNUMBER tYEAR_UNIT {
- ((struct date_yy *)parm)->yyRelYear += $1 * $2;
- }
- | tSNUMBER tYEAR_UNIT {
- ((struct date_yy *)parm)->yyRelYear += $1 * $2;
- }
- | tYEAR_UNIT {
- ((struct date_yy *)parm)->yyRelYear += $1;
- }
- | tUNUMBER tMONTH_UNIT {
- ((struct date_yy *)parm)->yyRelMonth += $1 * $2;
- }
- | tSNUMBER tMONTH_UNIT {
- ((struct date_yy *)parm)->yyRelMonth += $1 * $2;
- }
- | tMONTH_UNIT {
- ((struct date_yy *)parm)->yyRelMonth += $1;
- }
- | tUNUMBER tDAY_UNIT {
- ((struct date_yy *)parm)->yyRelDay += $1 * $2;
- }
- | tSNUMBER tDAY_UNIT {
- ((struct date_yy *)parm)->yyRelDay += $1 * $2;
- }
- | tDAY_UNIT {
- ((struct date_yy *)parm)->yyRelDay += $1;
- }
- | tUNUMBER tHOUR_UNIT {
- ((struct date_yy *)parm)->yyRelHour += $1 * $2;
- }
- | tSNUMBER tHOUR_UNIT {
- ((struct date_yy *)parm)->yyRelHour += $1 * $2;
- }
- | tHOUR_UNIT {
- ((struct date_yy *)parm)->yyRelHour += $1;
- }
- | tUNUMBER tMINUTE_UNIT {
- ((struct date_yy *)parm)->yyRelMinutes += $1 * $2;
- }
- | tSNUMBER tMINUTE_UNIT {
- ((struct date_yy *)parm)->yyRelMinutes += $1 * $2;
- }
- | tMINUTE_UNIT {
- ((struct date_yy *)parm)->yyRelMinutes += $1;
- }
- | tUNUMBER tSEC_UNIT {
- ((struct date_yy *)parm)->yyRelSeconds += $1 * $2;
- }
- | tSNUMBER tSEC_UNIT {
- ((struct date_yy *)parm)->yyRelSeconds += $1 * $2;
- }
- | tSEC_UNIT {
- ((struct date_yy *)parm)->yyRelSeconds += $1;
- }
- ;
-
-number : tUNUMBER
- {
- if (((struct date_yy *)parm)->yyHaveTime &&
- ((struct date_yy *)parm)->yyHaveDate &&
- !((struct date_yy *)parm)->yyHaveRel)
- ((struct date_yy *)parm)->yyYear = $1;
- else
- {
- if ($1>10000)
- {
- ((struct date_yy *)parm)->yyHaveDate++;
- ((struct date_yy *)parm)->yyDay= ($1)%100;
- ((struct date_yy *)parm)->yyMonth= ($1/100)%100;
- ((struct date_yy *)parm)->yyYear = $1/10000;
- }
- else
- {
- ((struct date_yy *)parm)->yyHaveTime++;
- if ($1 < 100)
- {
- ((struct date_yy *)parm)->yyHour = $1;
- ((struct date_yy *)parm)->yyMinutes = 0;
- }
- else
- {
- ((struct date_yy *)parm)->yyHour = $1 / 100;
- ((struct date_yy *)parm)->yyMinutes = $1 % 100;
- }
- ((struct date_yy *)parm)->yySeconds = 0;
- ((struct date_yy *)parm)->yyMeridian = MER24;
- }
- }
- }
- ;
-
-o_merid : tMERIDIAN
- {
- ((struct date_yy *)parm)->yyMeridian = $1;
- }
- ;
-
-%%
-
-time_t get_date (char *p, time_t *now);
-
-#ifndef PHP_WIN32
-extern struct tm *gmtime();
-extern struct tm *localtime();
-extern time_t mktime();
-#endif
-
-/* Month and day table. */
-static TABLE const MonthDayTable[] = {
- { "january", tMONTH, 1 },
- { "february", tMONTH, 2 },
- { "march", tMONTH, 3 },
- { "april", tMONTH, 4 },
- { "may", tMONTH, 5 },
- { "june", tMONTH, 6 },
- { "july", tMONTH, 7 },
- { "august", tMONTH, 8 },
- { "september", tMONTH, 9 },
- { "sept", tMONTH, 9 },
- { "october", tMONTH, 10 },
- { "november", tMONTH, 11 },
- { "december", tMONTH, 12 },
- { "sunday", tDAY, 0 },
- { "monday", tDAY, 1 },
- { "tuesday", tDAY, 2 },
- { "tues", tDAY, 2 },
- { "wednesday", tDAY, 3 },
- { "wednes", tDAY, 3 },
- { "thursday", tDAY, 4 },
- { "thur", tDAY, 4 },
- { "thurs", tDAY, 4 },
- { "friday", tDAY, 5 },
- { "saturday", tDAY, 6 },
- { NULL, 0, 0 }
-};
-
-/* Time units table. */
-static TABLE const UnitsTable[] = {
- { "year", tYEAR_UNIT, 1 },
- { "month", tMONTH_UNIT, 1 },
- { "fortnight", tDAY_UNIT, 14 },
- { "week", tDAY_UNIT, 7 },
- { "day", tDAY_UNIT, 1 },
- { "hour", tHOUR_UNIT, 1 },
- { "minute", tMINUTE_UNIT, 1 },
- { "min", tMINUTE_UNIT, 1 },
- { "second", tSEC_UNIT, 1 },
- { "sec", tSEC_UNIT, 1 },
- { NULL, 0, 0 }
-};
-
-/* Assorted relative-time words. */
-static TABLE const OtherTable[] = {
- { "tomorrow", tDAY_UNIT, 1 },
- { "yesterday", tDAY_UNIT, -1 },
- { "today", tDAY_UNIT, 0 },
- { "now", tDAY_UNIT, 0 },
- { "last", tUNUMBER, -1 },
- { "this", tUNUMBER, 0 },
- { "next", tUNUMBER, 1 },
- { "first", tUNUMBER, 1 },
-/* { "second", tUNUMBER, 2 }, */
- { "third", tUNUMBER, 3 },
- { "fourth", tUNUMBER, 4 },
- { "fifth", tUNUMBER, 5 },
- { "sixth", tUNUMBER, 6 },
- { "seventh", tUNUMBER, 7 },
- { "eighth", tUNUMBER, 8 },
- { "ninth", tUNUMBER, 9 },
- { "tenth", tUNUMBER, 10 },
- { "eleventh", tUNUMBER, 11 },
- { "twelfth", tUNUMBER, 12 },
- { "ago", tAGO, 1 },
- { NULL, 0, 0 }
-};
-
-/* The timezone table. */
-static TABLE const TimezoneTable[] = {
- { "gmt", tZONE, HOUR ( 0) }, /* Greenwich Mean */
- { "ut", tZONE, HOUR ( 0) }, /* Universal (Coordinated) */
- { "utc", tZONE, HOUR ( 0) },
- { "wet", tZONE, HOUR ( 0) }, /* Western European */
- { "bst", tDAYZONE, HOUR ( 0) }, /* British Summer */
- { "wat", tZONE, HOUR ( 1) }, /* West Africa */
- { "at", tZONE, HOUR ( 2) }, /* Azores */
-#if 0
- /* For completeness. BST is also British Summer, and GST is
- * also Guam Standard. */
- { "bst", tZONE, HOUR ( 3) }, /* Brazil Standard */
- { "gst", tZONE, HOUR ( 3) }, /* Greenland Standard */
-#endif
-#if 0
- { "nft", tZONE, HOUR (3.5) }, /* Newfoundland */
- { "nst", tZONE, HOUR (3.5) }, /* Newfoundland Standard */
- { "ndt", tDAYZONE, HOUR (3.5) }, /* Newfoundland Daylight */
-#endif
- { "ast", tZONE, HOUR ( 4) }, /* Atlantic Standard */
- { "adt", tDAYZONE, HOUR ( 4) }, /* Atlantic Daylight */
- { "est", tZONE, HOUR ( 5) }, /* Eastern Standard */
- { "edt", tDAYZONE, HOUR ( 5) }, /* Eastern Daylight */
- { "cst", tZONE, HOUR ( 6) }, /* Central Standard */
- { "cdt", tDAYZONE, HOUR ( 6) }, /* Central Daylight */
- { "mst", tZONE, HOUR ( 7) }, /* Mountain Standard */
- { "mdt", tDAYZONE, HOUR ( 7) }, /* Mountain Daylight */
- { "pst", tZONE, HOUR ( 8) }, /* Pacific Standard */
- { "pdt", tDAYZONE, HOUR ( 8) }, /* Pacific Daylight */
- { "yst", tZONE, HOUR ( 9) }, /* Yukon Standard */
- { "ydt", tDAYZONE, HOUR ( 9) }, /* Yukon Daylight */
- { "hst", tZONE, HOUR (10) }, /* Hawaii Standard */
- { "hdt", tDAYZONE, HOUR (10) }, /* Hawaii Daylight */
- { "cat", tZONE, HOUR (10) }, /* Central Alaska */
- { "akst", tZONE, HOUR (10) }, /* Alaska Standard */
- { "akdt", tZONE, HOUR (10) }, /* Alaska Daylight */
- { "ahst", tZONE, HOUR (10) }, /* Alaska-Hawaii Standard */
- { "nt", tZONE, HOUR (11) }, /* Nome */
- { "idlw", tZONE, HOUR (12) }, /* International Date Line West */
- { "cet", tZONE, -HOUR (1) }, /* Central European */
- { "cest", tDAYZONE, -HOUR (1) }, /* Central European Summer */
- { "met", tZONE, -HOUR (1) }, /* Middle European */
- { "mewt", tZONE, -HOUR (1) }, /* Middle European Winter */
- { "mest", tDAYZONE, -HOUR (1) }, /* Middle European Summer */
- { "mesz", tDAYZONE, -HOUR (1) }, /* Middle European Summer */
- { "swt", tZONE, -HOUR (1) }, /* Swedish Winter */
- { "sst", tDAYZONE, -HOUR (1) }, /* Swedish Summer */
- { "fwt", tZONE, -HOUR (1) }, /* French Winter */
- { "fst", tDAYZONE, -HOUR (1) }, /* French Summer */
- { "eet", tZONE, -HOUR (2) }, /* Eastern Europe, USSR Zone 1 */
- { "bt", tZONE, -HOUR (3) }, /* Baghdad, USSR Zone 2 */
-#if 0
- { "it", tZONE, -HOUR (3.5) },/* Iran */
-#endif
- { "zp4", tZONE, -HOUR (4) }, /* USSR Zone 3 */
- { "zp5", tZONE, -HOUR (5) }, /* USSR Zone 4 */
-#if 0
- { "ist", tZONE, -HOUR (5.5) },/* Indian Standard */
-#endif
- { "zp6", tZONE, -HOUR (6) }, /* USSR Zone 5 */
-#if 0
- /* For completeness. NST is also Newfoundland Standard, and SST is
- * also Swedish Summer. */
- { "nst", tZONE, -HOUR (6.5) },/* North Sumatra */
- { "sst", tZONE, -HOUR (7) }, /* South Sumatra, USSR Zone 6 */
-#endif /* 0 */
- { "wast", tZONE, -HOUR (7) }, /* West Australian Standard */
- { "wadt", tDAYZONE, -HOUR (7) }, /* West Australian Daylight */
-#if 0
- { "jt", tZONE, -HOUR (7.5) },/* Java (3pm in Cronusland!) */
-#endif
- { "cct", tZONE, -HOUR (8) }, /* China Coast, USSR Zone 7 */
- { "jst", tZONE, -HOUR (9) }, /* Japan Standard, USSR Zone 8 */
-#if 0
- { "cast", tZONE, -HOUR (9.5) },/* Central Australian Standard */
- { "cadt", tDAYZONE, -HOUR (9.5) },/* Central Australian Daylight */
-#endif
- { "east", tZONE, -HOUR (10) }, /* Eastern Australian Standard */
- { "eadt", tDAYZONE, -HOUR (10) }, /* Eastern Australian Daylight */
- { "gst", tZONE, -HOUR (10) }, /* Guam Standard, USSR Zone 9 */
- { "nzt", tZONE, -HOUR (12) }, /* New Zealand */
- { "nzst", tZONE, -HOUR (12) }, /* New Zealand Standard */
- { "nzdt", tDAYZONE, -HOUR (12) }, /* New Zealand Daylight */
- { "idle", tZONE, -HOUR (12) }, /* International Date Line East */
- { NULL, 0, 0 }
-};
-
-/* Military timezone table. */
-static TABLE const MilitaryTable[] = {
- { "a", tZONE, HOUR (- 1) },
- { "b", tZONE, HOUR (- 2) },
- { "c", tZONE, HOUR (- 3) },
- { "d", tZONE, HOUR (- 4) },
- { "e", tZONE, HOUR (- 5) },
- { "f", tZONE, HOUR (- 6) },
- { "g", tZONE, HOUR (- 7) },
- { "h", tZONE, HOUR (- 8) },
- { "i", tZONE, HOUR (- 9) },
- { "k", tZONE, HOUR (-10) },
- { "l", tZONE, HOUR (-11) },
- { "m", tZONE, HOUR (-12) },
- { "n", tZONE, HOUR ( 1) },
- { "o", tZONE, HOUR ( 2) },
- { "p", tZONE, HOUR ( 3) },
- { "q", tZONE, HOUR ( 4) },
- { "r", tZONE, HOUR ( 5) },
- { "s", tZONE, HOUR ( 6) },
- { "t", tTZONE, HOUR ( 7) },
- { "u", tZONE, HOUR ( 8) },
- { "v", tZONE, HOUR ( 9) },
- { "w", tWZONE, HOUR ( 10) },
- { "x", tZONE, HOUR ( 11) },
- { "y", tZONE, HOUR ( 12) },
- { "z", tZZONE, HOUR ( 0) },
- { NULL, 0, 0 }
-};
-
-
-
-
-/* ARGSUSED */
-static int
-yyerror (s)
- char *s ATTRIBUTE_UNUSED;
-{
- return 0;
-}
-
-static int
-ToHour (Hours, Meridian)
- int Hours;
- MERIDIAN Meridian;
-{
- switch (Meridian)
- {
- case MER24:
- if (Hours < 0 || Hours > 23)
- return -1;
- return Hours;
- case MERam:
- if (Hours < 1 || Hours > 12)
- return -1;
- if (Hours == 12)
- Hours = 0;
- return Hours;
- case MERpm:
- if (Hours < 1 || Hours > 12)
- return -1;
- if (Hours == 12)
- Hours = 0;
- return Hours + 12;
- default:
- abort ();
- }
- /* NOTREACHED */
-}
-
-static int
-ToYear (Year)
- int Year;
-{
- if (Year < 0)
- Year = -Year;
-
- /* XPG4 suggests that years 00-68 map to 2000-2068, and
- years 69-99 map to 1969-1999. */
- if (Year < 69)
- Year += 2000;
- else if (Year < 100)
- Year += 1900;
-
- return Year;
-}
-
-static int
-LookupWord (lvalp,buff)
- YYSTYPE *lvalp;
- char *buff;
-{
- register char *p;
- register char *q;
- register const TABLE *tp;
- int i;
- int abbrev;
-
- /* Make it lowercase. */
- for (p = buff; *p; p++)
- if (ISUPPER ((unsigned char) *p))
- *p = tolower (*p);
-
- if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0)
- {
- lvalp->Meridian = MERam;
- return tMERIDIAN;
- }
- if (strcmp (buff, "pm") == 0 || strcmp (buff, "p.m.") == 0)
- {
- lvalp->Meridian = MERpm;
- return tMERIDIAN;
- }
-
- /* See if we have an abbreviation for a month. */
- if (strlen (buff) == 3)
- abbrev = 1;
- else if (strlen (buff) == 4 && buff[3] == '.')
- {
- abbrev = 1;
- buff[3] = '\0';
- }
- else
- abbrev = 0;
-
- for (tp = MonthDayTable; tp->name; tp++)
- {
- if (abbrev)
- {
- if (strncmp (buff, tp->name, 3) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
- }
- else if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
- }
-
- for (tp = TimezoneTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
-
- if (strcmp (buff, "dst") == 0)
- return tDST;
-
- for (tp = UnitsTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
-
- /* Strip off any plural and try the units table again. */
- i = strlen (buff) - 1;
- if (buff[i] == 's')
- {
- buff[i] = '\0';
- for (tp = UnitsTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
- buff[i] = 's'; /* Put back for "this" in OtherTable. */
- }
-
- for (tp = OtherTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
-
- /* Military timezones. */
- if (buff[1] == '\0' && ISALPHA ((unsigned char) *buff))
- {
- for (tp = MilitaryTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
- }
-
- /* Drop out any periods and try the timezone table again. */
- for (i = 0, p = q = buff; *q; q++)
- if (*q != '.')
- *p++ = *q;
- else
- i++;
- *p = '\0';
- if (i)
- for (tp = TimezoneTable; tp->name; tp++)
- if (strcmp (buff, tp->name) == 0)
- {
- lvalp->Number = tp->value;
- return tp->type;
- }
-
- return tID;
-}
-
-int yylex (YYSTYPE *lvalp, void *parm)
-{
- register unsigned char c;
- register char *p;
- char buff[20];
- int Count;
- int sign;
- struct date_yy * date = (struct date_yy *)parm;
-
- for (;;)
- {
- while (ISSPACE ((unsigned char) *date->yyInput))
- date->yyInput++;
-
- if (ISDIGIT (c = *date->yyInput) || c == '-' || c == '+')
- {
- if (c == '-' || c == '+')
- {
- sign = c == '-' ? -1 : 1;
- if (!ISDIGIT (*++date->yyInput))
- /* skip the '-' sign */
- continue;
- }
- else
- sign = 0;
- for (lvalp->Number = 0; ISDIGIT (c = *date->yyInput++);)
- lvalp->Number = 10 * lvalp->Number + c - '0';
- date->yyInput--;
- if (sign < 0)
- lvalp->Number = -lvalp->Number;
- /* Ignore ordinal suffixes on numbers */
- c = *date->yyInput;
- if (c == 's' || c == 'n' || c == 'r' || c == 't') {
- c = *++date->yyInput;
- if (c == 't' || c == 'd' || c == 'h') {
- date->yyInput++;
- } else {
- date->yyInput--;
- }
- }
- return sign ? tSNUMBER : tUNUMBER;
- }
- if (ISALPHA (c))
- {
- for (p = buff; (c = *date->yyInput++, ISALPHA (c)) || c == '.';)
- if (p < &buff[sizeof buff - 1])
- *p++ = c;
- *p = '\0';
- date->yyInput--;
- return LookupWord (lvalp, buff);
- }
- if (c != '(')
- return *date->yyInput++;
- Count = 0;
- do
- {
- c = *date->yyInput++;
- if (c == '\0')
- return c;
- if (c == '(')
- Count++;
- else if (c == ')')
- Count--;
- }
- while (Count > 0);
- }
-}
-
-#define TM_YEAR_ORIGIN 1900
-
-/* Yield A - B, measured in seconds. */
-static long
-difftm (struct tm *a, struct tm *b)
-{
- int ay = a->tm_year + (TM_YEAR_ORIGIN - 1);
- int by = b->tm_year + (TM_YEAR_ORIGIN - 1);
- long days = (
- /* difference in day of year */
- a->tm_yday - b->tm_yday
- /* + intervening leap days */
- + ((ay >> 2) - (by >> 2))
- - (ay / 100 - by / 100)
- + ((ay / 100 >> 2) - (by / 100 >> 2))
- /* + difference in years * 365 */
- + (long) (ay - by) * 365
- );
- return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
- + (a->tm_min - b->tm_min))
- + (a->tm_sec - b->tm_sec));
-}
-
-time_t php_parse_date(char *p, time_t *now)
-{
- struct tm tm, tm0, *tmp;
- time_t Start;
- struct date_yy date;
-
- date.yyInput = p;
- Start = now ? *now : time ((time_t *) NULL);
- tmp = localtime (&Start);
- if (!tmp)
- return -1;
- date.yyYear = tmp->tm_year + TM_YEAR_ORIGIN;
- date.yyMonth = tmp->tm_mon + 1;
- date.yyDay = tmp->tm_mday;
- date.yyHour = tmp->tm_hour;
- date.yyMinutes = tmp->tm_min;
- date.yySeconds = tmp->tm_sec;
- tm.tm_isdst = tmp->tm_isdst;
- date.yyMeridian = MER24;
- date.yyRelSeconds = 0;
- date.yyRelMinutes = 0;
- date.yyRelHour = 0;
- date.yyRelDay = 0;
- date.yyRelMonth = 0;
- date.yyRelYear = 0;
- date.yyHaveDate = 0;
- date.yyHaveDay = 0;
- date.yyHaveRel = 0;
- date.yyHaveTime = 0;
- date.yyHaveZone = 0;
-
- if (yyparse ((void *)&date)
- || date.yyHaveTime > 1 || date.yyHaveZone > 1
- || date.yyHaveDate > 1 || date.yyHaveDay > 1) {
- return -1;
- }
- tm.tm_year = ToYear (date.yyYear) - TM_YEAR_ORIGIN + date.yyRelYear;
- tm.tm_mon = date.yyMonth - 1 + date.yyRelMonth;
- tm.tm_mday = date.yyDay + date.yyRelDay;
- if (date.yyHaveTime || (date.yyHaveRel && !date.yyHaveDate && !date.yyHaveDay))
- {
- tm.tm_hour = ToHour (date.yyHour, date.yyMeridian);
- if (tm.tm_hour < 0)
- return -1;
- tm.tm_min = date.yyMinutes;
- tm.tm_sec = date.yySeconds;
- }
- else
- {
- tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
- }
- tm.tm_hour += date.yyRelHour;
- tm.tm_min += date.yyRelMinutes;
- tm.tm_sec += date.yyRelSeconds;
-
- /* Let mktime deduce tm_isdst if we have an absolute timestamp,
- or if the relative timestamp mentions days, months, or years. */
- if (date.yyHaveDate | date.yyHaveDay | date.yyHaveTime | date.yyRelDay | date.yyRelMonth | date.yyRelYear)
- tm.tm_isdst = -1;
-
- tm0 = tm;
-
- Start = mktime (&tm);
-
- if (Start == (time_t) -1)
- {
-
- /* Guard against falsely reporting errors near the time_t boundaries
- when parsing times in other time zones. For example, if the min
- time_t value is 1970-01-01 00:00:00 UTC and we are 8 hours ahead
- of UTC, then the min localtime value is 1970-01-01 08:00:00; if
- we apply mktime to 1970-01-01 00:00:00 we will get an error, so
- we apply mktime to 1970-01-02 08:00:00 instead and adjust the time
- zone by 24 hours to compensate. This algorithm assumes that
- there is no DST transition within a day of the time_t boundaries. */
- if (date.yyHaveZone)
- {
- tm = tm0;
- if (tm.tm_year <= EPOCH - TM_YEAR_ORIGIN)
- {
- tm.tm_mday++;
- date.yyTimezone -= 24 * 60;
- }
- else
- {
- tm.tm_mday--;
- date.yyTimezone += 24 * 60;
- }
- Start = mktime (&tm);
- }
-
- if (Start == (time_t) -1)
- return Start;
- }
-
- if (date.yyHaveDay && !date.yyHaveDate)
- {
- tm.tm_mday += ((date.yyDayNumber - tm.tm_wday + 7) % 7
- + 7 * (date.yyDayOrdinal - (0 < date.yyDayOrdinal)));
- Start = mktime (&tm);
- if (Start == (time_t) -1)
- return Start;
- }
-
- if (date.yyHaveZone)
- {
- long delta;
- struct tm *gmt = gmtime (&Start);
- if (!gmt)
- return -1;
- delta = date.yyTimezone * 60L + difftm (&tm, gmt);
-
- if ((Start + delta < Start) != (delta < 0))
- return -1; /* time_t overflow */
- Start += delta;
- }
-
- return Start;
-}
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index c62b9c1f8..dcb767107 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_array.h,v 1.46 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_array.h,v 1.50 2005/08/03 14:08:09 sniper Exp $ */
#ifndef PHP_ARRAY_H
#define PHP_ARRAY_H
@@ -76,18 +76,23 @@ PHP_FUNCTION(array_change_key_case);
PHP_FUNCTION(array_rand);
PHP_FUNCTION(array_unique);
PHP_FUNCTION(array_intersect);
+PHP_FUNCTION(array_intersect_key);
+PHP_FUNCTION(array_intersect_ukey);
PHP_FUNCTION(array_uintersect);
PHP_FUNCTION(array_intersect_assoc);
PHP_FUNCTION(array_uintersect_assoc);
PHP_FUNCTION(array_intersect_uassoc);
PHP_FUNCTION(array_uintersect_uassoc);
PHP_FUNCTION(array_diff);
+PHP_FUNCTION(array_diff_key);
+PHP_FUNCTION(array_diff_ukey);
PHP_FUNCTION(array_udiff);
PHP_FUNCTION(array_diff_assoc);
PHP_FUNCTION(array_udiff_assoc);
PHP_FUNCTION(array_diff_uassoc);
PHP_FUNCTION(array_udiff_uassoc);
PHP_FUNCTION(array_sum);
+PHP_FUNCTION(array_product);
PHP_FUNCTION(array_filter);
PHP_FUNCTION(array_map);
PHP_FUNCTION(array_key_exists);
@@ -98,17 +103,4 @@ HashTable* php_splice(HashTable *, int, int, zval ***, int, HashTable **);
PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS_DC);
int multisort_compare(const void *a, const void *b TSRMLS_DC);
-typedef struct {
- int *multisort_flags[2];
- int (*compare_func)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-} php_array_globals;
-
-#ifdef ZTS
-#define ARRAYG(v) TSRMG(array_globals_id, php_array_globals *, v)
-extern int array_globals_id;
-#else
-#define ARRAYG(v) (array_globals.v)
-extern php_array_globals array_globals;
-#endif
-
#endif /* PHP_ARRAY_H */
diff --git a/ext/standard/php_assert.h b/ext/standard/php_assert.h
index 83e6aa2a4..a8130eba1 100644
--- a/ext/standard/php_assert.h
+++ b/ext/standard/php_assert.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_assert.h,v 1.14 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_assert.h,v 1.15 2005/08/03 14:08:09 sniper Exp $ */
#ifndef PHP_ASSERT_H
#define PHP_ASSERT_H
diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h
index da0097396..0506a950d 100644
--- a/ext/standard/php_browscap.h
+++ b/ext/standard/php_browscap.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_browscap.h,v 1.12 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_browscap.h,v 1.13 2005/08/03 14:08:09 sniper Exp $ */
#ifndef PHP_BROWSCAP_H
#define PHP_BROWSCAP_H
diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h
index 21e9fdf2a..8694b25d5 100644
--- a/ext/standard/php_crypt.h
+++ b/ext/standard/php_crypt.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_crypt.h,v 1.17 2004/02/12 19:05:41 ssb Exp $ */
+/* $Id: php_crypt.h,v 1.18 2005/08/03 14:08:09 sniper Exp $ */
#ifndef PHP_CRYPT_H
#define PHP_CRYPT_H
diff --git a/ext/standard/php_dir.h b/ext/standard/php_dir.h
index 18db1f231..2444b3ac6 100644
--- a/ext/standard/php_dir.h
+++ b/ext/standard/php_dir.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_dir.h,v 1.23 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_dir.h,v 1.24 2005/08/03 14:08:09 sniper Exp $ */
#ifndef PHP_DIR_H
#define PHP_DIR_H
diff --git a/ext/standard/php_ext_syslog.h b/ext/standard/php_ext_syslog.h
index 32ef50d60..a025a4652 100644
--- a/ext/standard/php_ext_syslog.h
+++ b/ext/standard/php_ext_syslog.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_ext_syslog.h,v 1.11 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_ext_syslog.h,v 1.12 2005/08/03 14:08:09 sniper Exp $ */
#ifndef PHP_EXT_SYSLOG_H
#define PHP_EXT_SYSLOG_H
diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h
index e79eea5f7..8a924678a 100644
--- a/ext/standard/php_filestat.h
+++ b/ext/standard/php_filestat.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_filestat.h,v 1.23 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_filestat.h,v 1.24 2005/08/03 14:08:09 sniper Exp $ */
#ifndef PHP_FILESTAT_H
#define PHP_FILESTAT_H
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index a33d5fc84..c8087e0c9 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_fopen_wrapper.c,v 1.44 2004/04/19 17:41:39 wez Exp $ */
+/* $Id: php_fopen_wrapper.c,v 1.45.2.2 2005/11/17 19:40:38 pollita Exp $ */
#include <stdio.h>
#include <stdlib.h>
@@ -73,17 +73,19 @@ static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t
static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
{
+ off_t *position = (off_t*)stream->abstract;
size_t read_bytes = 0;
+
if(!stream->eof) {
if(SG(request_info).raw_post_data) { /* data has already been read by a post handler */
- read_bytes = SG(request_info).raw_post_data_length - stream->position;
+ read_bytes = SG(request_info).raw_post_data_length - *position;
if(read_bytes <= count) {
stream->eof = 1;
} else {
read_bytes = count;
}
if(read_bytes) {
- memcpy(buf, SG(request_info).raw_post_data + stream->position, read_bytes);
+ memcpy(buf, SG(request_info).raw_post_data + *position, read_bytes);
}
} else if(sapi_module.read_post) {
read_bytes = sapi_module.read_post(buf, count TSRMLS_CC);
@@ -96,12 +98,15 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count
}
}
+ *position += read_bytes;
SG(read_post_bytes) += read_bytes;
return read_bytes;
}
static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC)
{
+ efree(stream->abstract);
+
return 0;
}
@@ -132,14 +137,14 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i
if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) {
php_stream_filter_append(&stream->readfilters, temp_filter);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)\n", p);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p);
}
}
if (write_chain) {
if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) {
php_stream_filter_append(&stream->writefilters, temp_filter);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)\n", p);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p);
}
}
p = php_strtok_r(NULL, "|", &token);
@@ -162,7 +167,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
}
if (!strcasecmp(path, "input")) {
- return php_stream_alloc(&php_stream_input_ops, NULL, 0, "rb");
+ return php_stream_alloc(&php_stream_input_ops, ecalloc(1, sizeof(off_t)), 0, "rb");
}
if (!strcasecmp(path, "stdin")) {
diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h
index 85c6cf32d..7cd5a3cd7 100644
--- a/ext/standard/php_fopen_wrappers.h
+++ b/ext/standard/php_fopen_wrappers.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_fopen_wrappers.h,v 1.20 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_fopen_wrappers.h,v 1.21 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_FOPEN_WRAPPERS_H
#define PHP_FOPEN_WRAPPERS_H
diff --git a/ext/standard/php_ftok.h b/ext/standard/php_ftok.h
index dad7970a2..badd39579 100644
--- a/ext/standard/php_ftok.h
+++ b/ext/standard/php_ftok.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_ftok.h,v 1.8 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_ftok.h,v 1.9 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_FTOK_H
#define PHP_FTOK_H
diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h
index 9ef2c549f..f71e7fd3a 100644
--- a/ext/standard/php_http.h
+++ b/ext/standard/php_http.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_http.h,v 1.3.2.1 2004/12/16 22:40:46 iliaa Exp $ */
+/* $Id: php_http.h,v 1.5 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_HTTP_H
#define PHP_HTTP_H
diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h
index e8b29a491..cb6437446 100644
--- a/ext/standard/php_image.h
+++ b/ext/standard/php_image.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_image.h,v 1.28 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_image.h,v 1.29 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_IMAGE_H
#define PHP_IMAGE_H
diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h
index 187584ff8..3e36be0de 100644
--- a/ext/standard/php_incomplete_class.h
+++ b/ext/standard/php_incomplete_class.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_incomplete_class.h,v 1.13.2.2 2005/06/29 09:29:08 johannes Exp $ */
+/* $Id: php_incomplete_class.h,v 1.17 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_INCOMPLETE_CLASS_H
#define PHP_INCOMPLETE_CLASS_H
@@ -42,7 +42,7 @@
#define PHP_CLASS_ATTRIBUTES \
char *class_name; \
- size_t name_len; \
+ zend_uint name_len; \
zend_bool free_class_name = 0; \
zend_bool incomplete_class = 0
@@ -55,8 +55,8 @@ extern "C" {
zend_class_entry *php_create_incomplete_class(TSRMLS_D);
-char *php_lookup_class_name(zval *object, size_t *nlen);
-void php_store_class_name(zval *object, const char *name, size_t len);
+char *php_lookup_class_name(zval *object, zend_uint *nlen);
+void php_store_class_name(zval *object, const char *name, zend_uint len);
#ifdef __cplusplus
};
diff --git a/ext/standard/php_iptc.h b/ext/standard/php_iptc.h
index 3bf670ce8..8737b85eb 100644
--- a/ext/standard/php_iptc.h
+++ b/ext/standard/php_iptc.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_iptc.h,v 1.10 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_iptc.h,v 1.11 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_IPTC_H
#define PHP_IPTC_H
diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h
index 61b97448e..c973d590e 100644
--- a/ext/standard/php_lcg.h
+++ b/ext/standard/php_lcg.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_lcg.h,v 1.20 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_lcg.h,v 1.21 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_LCG_H
#define PHP_LCG_H
diff --git a/ext/standard/php_link.h b/ext/standard/php_link.h
index 77cbd9212..9eee8a16e 100644
--- a/ext/standard/php_link.h
+++ b/ext/standard/php_link.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_link.h,v 1.11 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_link.h,v 1.12 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_LINK_H
#define PHP_LINK_H
diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h
index dd0e5dd13..1eadf0959 100644
--- a/ext/standard/php_mail.h
+++ b/ext/standard/php_mail.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_mail.h,v 1.17 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_mail.h,v 1.18 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_MAIL_H
#define PHP_MAIL_H
diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h
index 18cb7ed22..22079eb57 100644
--- a/ext/standard/php_math.h
+++ b/ext/standard/php_math.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_math.h,v 1.22 2004/05/24 17:02:12 iliaa Exp $ */
+/* $Id: php_math.h,v 1.28 2005/08/03 14:08:10 sniper Exp $ */
#ifndef PHP_MATH_H
#define PHP_MATH_H
@@ -66,9 +66,7 @@ PHP_FUNCTION(rad2deg);
WARNING: these functions are expermental: they could change their names or
disappear in the next version of PHP!
*/
-#ifdef HAVE_HYPOT
PHP_FUNCTION(hypot);
-#endif
PHP_FUNCTION(expm1);
PHP_FUNCTION(log1p);
diff --git a/ext/standard/php_metaphone.h b/ext/standard/php_metaphone.h
index b75330c5d..e7a593dfd 100644
--- a/ext/standard/php_metaphone.h
+++ b/ext/standard/php_metaphone.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_metaphone.h,v 1.15 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_metaphone.h,v 1.16 2005/08/03 14:08:11 sniper Exp $ */
#ifndef PHP_METAPHONE_H
#define PHP_METAPHONE_H
diff --git a/ext/standard/php_parsedate.h b/ext/standard/php_parsedate.h
deleted file mode 100644
index 7d96c3fc0..000000000
--- a/ext/standard/php_parsedate.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Sascha Schumann <sascha@schumann.cx> |
- +----------------------------------------------------------------------+
- */
-
-#ifndef PHP_PARSEDATE_H
-#define PHP_PARSEDATE_H
-
-#include <time.h>
-
-time_t php_parse_date(char *p, time_t *now);
-
-#endif
diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h
index 717c132f8..baebecda8 100644
--- a/ext/standard/php_rand.h
+++ b/ext/standard/php_rand.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
| Based on code from: Shawn Cokus <Cokus@math.washington.edu> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_rand.h,v 1.27 2004/01/19 02:30:54 sniper Exp $ */
+/* $Id: php_rand.h,v 1.28 2005/08/03 14:08:11 sniper Exp $ */
#ifndef PHP_RAND_H
#define PHP_RAND_H
diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h
index a659a94d5..10cbdb1f6 100644
--- a/ext/standard/php_smart_str.h
+++ b/ext/standard/php_smart_str.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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,6 +16,8 @@
+----------------------------------------------------------------------+
*/
+/* $Id: php_smart_str.h,v 1.30 2005/08/03 14:08:11 sniper Exp $ */
+
#ifndef PHP_SMART_STR_H
#define PHP_SMART_STR_H
diff --git a/ext/standard/php_smart_str_public.h b/ext/standard/php_smart_str_public.h
index 79f5d22e2..7934ba04f 100644
--- a/ext/standard/php_smart_str_public.h
+++ b/ext/standard/php_smart_str_public.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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,6 +16,8 @@
+----------------------------------------------------------------------+
*/
+/* $Id: php_smart_str_public.h,v 1.10 2005/08/03 14:08:11 sniper Exp $ */
+
#ifndef PHP_SMART_STR_PUBLIC_H
#define PHP_SMART_STR_PUBLIC_H
diff --git a/ext/standard/php_standard.h b/ext/standard/php_standard.h
index 3c337cc64..83673e8c7 100644
--- a/ext/standard/php_standard.h
+++ b/ext/standard/php_standard.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_standard.h,v 1.23 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_standard.h,v 1.24 2005/08/03 14:08:11 sniper Exp $ */
#include "basic_functions.h"
#include "php_math.h"
diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h
index 8f683412e..4eb9d367e 100644
--- a/ext/standard/php_string.h
+++ b/ext/standard/php_string.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_string.h,v 1.84.2.2 2005/05/31 12:55:33 sniper Exp $ */
+/* $Id: php_string.h,v 1.87 2005/08/03 14:08:11 sniper Exp $ */
/* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
diff --git a/ext/standard/php_sunfuncs.h b/ext/standard/php_sunfuncs.h
index f5e5efa9b..2f6209bbc 100644
--- a/ext/standard/php_sunfuncs.h
+++ b/ext/standard/php_sunfuncs.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_sunfuncs.h,v 1.3 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_sunfuncs.h,v 1.4 2005/08/03 14:08:11 sniper Exp $ */
#ifndef PHP_SUNFUNCS_H
#define PHP_SUNFUNCS_H
diff --git a/ext/standard/php_type.h b/ext/standard/php_type.h
index 7244cff23..30564cd89 100644
--- a/ext/standard/php_type.h
+++ b/ext/standard/php_type.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_type.h,v 1.5 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_type.h,v 1.6 2005/08/03 14:08:11 sniper Exp $ */
#ifndef PHP_TYPE_H
#define PHP_TYPE_H
diff --git a/ext/standard/php_uuencode.h b/ext/standard/php_uuencode.h
index 9f4dbc125..33618aad9 100644
--- a/ext/standard/php_uuencode.h
+++ b/ext/standard/php_uuencode.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_uuencode.h,v 1.3 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_uuencode.h,v 1.4 2005/08/03 14:08:11 sniper Exp $ */
#ifndef PHP_UUENCODE_H
#define PHP_UUENCODE_H
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index 5103a74f2..55a00551c 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_var.h,v 1.27.2.2 2005/01/15 18:49:25 sesser Exp $ */
+/* $Id: php_var.h,v 1.30 2005/08/03 14:08:11 sniper Exp $ */
#ifndef PHP_VAR_H
#define PHP_VAR_H
diff --git a/ext/standard/php_versioning.h b/ext/standard/php_versioning.h
index bfefb9ab7..9df0a588a 100644
--- a/ext/standard/php_versioning.h
+++ b/ext/standard/php_versioning.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_versioning.h,v 1.9 2004/01/08 17:32:51 sniper Exp $ */
+/* $Id: php_versioning.h,v 1.10 2005/08/03 14:08:11 sniper Exp $ */
#ifndef PHP_VERSIONING_H
#define PHP_VERSIONING_H
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 9df0afd21..6e4691749 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: proc_open.c,v 1.28.2.5 2005/07/01 05:53:06 hyanantha Exp $ */
+/* $Id: proc_open.c,v 1.36 2005/08/03 14:08:11 sniper Exp $ */
#if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
# define _BSD_SOURCE /* linux wants this when XOPEN mode is on */
@@ -697,7 +697,7 @@ PHP_FUNCTION(proc_open)
descriptors[ndesc].parentend = dup(dev_ptmx);
descriptors[ndesc].mode_flags = O_RDWR;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pty pseudo terminal is not support on this system");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "pty pseudo terminal not supported on this system");
goto exit_fail;
#endif
} else {
diff --git a/ext/standard/proc_open.h b/ext/standard/proc_open.h
index 59c366990..7e039ef02 100644
--- a/ext/standard/proc_open.h
+++ b/ext/standard/proc_open.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: proc_open.h,v 1.4 2004/01/08 17:32:52 sniper Exp $ */
+/* $Id: proc_open.h,v 1.5 2005/08/03 14:08:11 sniper Exp $ */
#ifdef PHP_WIN32
typedef HANDLE php_file_descriptor_t;
diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c
index 8b13adb62..f3e0f5e0a 100644
--- a/ext/standard/quot_print.c
+++ b/ext/standard/quot_print.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: quot_print.c,v 1.28 2004/01/08 08:17:33 andi Exp $ */
+/* $Id: quot_print.c,v 1.29 2005/08/03 14:08:11 sniper Exp $ */
#include <stdlib.h>
diff --git a/ext/standard/quot_print.h b/ext/standard/quot_print.h
index 65d584110..6c96e62d0 100644
--- a/ext/standard/quot_print.h
+++ b/ext/standard/quot_print.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: quot_print.h,v 1.12 2004/01/08 17:32:52 sniper Exp $ */
+/* $Id: quot_print.h,v 1.13 2005/08/03 14:08:12 sniper Exp $ */
#ifndef QUOT_PRINT_H
#define QUOT_PRINT_H
diff --git a/ext/standard/rand.c b/ext/standard/rand.c
index 2797b87d0..42528772b 100644
--- a/ext/standard/rand.c
+++ b/ext/standard/rand.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
| Based on code from: Shawn Cokus <Cokus@math.washington.edu> |
+----------------------------------------------------------------------+
*/
-/* $Id: rand.c,v 1.68.2.1 2005/03/10 13:33:35 hyanantha Exp $ */
+/* $Id: rand.c,v 1.70 2005/08/03 14:08:12 sniper Exp $ */
#include <stdlib.h>
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index 3e37f55e3..d11a93d97 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
| Jaakko Hyvätti <jaakko@hyvatti.iki.fi> |
+----------------------------------------------------------------------+
*/
-/* $Id: reg.c,v 1.78.2.2 2005/07/18 23:10:08 sniper Exp $ */
+/* $Id: reg.c,v 1.82 2005/08/03 14:08:12 sniper Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -459,7 +459,7 @@ static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
if (Z_STRVAL_PP(arg_pattern) && Z_STRLEN_PP(arg_pattern))
pattern = estrndup(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern));
else
- pattern = empty_string;
+ pattern = STR_EMPTY_ALLOC();
} else {
convert_to_long_ex(arg_pattern);
pattern = emalloc(2);
@@ -471,7 +471,7 @@ static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
if (Z_STRVAL_PP(arg_replace) && Z_STRLEN_PP(arg_replace))
replace = estrndup(Z_STRVAL_PP(arg_replace), Z_STRLEN_PP(arg_replace));
else
- replace = empty_string;
+ replace = STR_EMPTY_ALLOC();
} else {
convert_to_long_ex(arg_replace);
replace = emalloc(2);
@@ -483,7 +483,7 @@ static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
if (Z_STRVAL_PP(arg_string) && Z_STRLEN_PP(arg_string))
string = estrndup(Z_STRVAL_PP(arg_string), Z_STRLEN_PP(arg_string));
else
- string = empty_string;
+ string = STR_EMPTY_ALLOC();
/* do the actual work */
ret = php_reg_replace(pattern, replace, string, icase, 1);
@@ -558,7 +558,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) {
if (subs[0].rm_so == 0 && subs[0].rm_eo) {
/* match is at start of string, return empty string */
- add_next_index_stringl(return_value, empty_string, 0, 1);
+ add_next_index_stringl(return_value, "", 0, 1);
/* skip ahead the length of the regex match */
strp += subs[0].rm_eo;
} else if (subs[0].rm_so == 0 && subs[0].rm_eo == 0) {
diff --git a/ext/standard/reg.h b/ext/standard/reg.h
index 9330031f7..e7f7cc89f 100644
--- a/ext/standard/reg.h
+++ b/ext/standard/reg.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
*/
-/* $Id: reg.h,v 1.20 2004/01/08 17:32:52 sniper Exp $ */
+/* $Id: reg.h,v 1.21 2005/08/03 14:08:12 sniper Exp $ */
#ifndef REG_H
#define REG_H
diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c
index a8a9ede4b..ef4f8866d 100644
--- a/ext/standard/scanf.c
+++ b/ext/standard/scanf.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: scanf.c,v 1.29.2.1 2004/11/03 23:27:27 derick Exp $ */
+/* $Id: scanf.c,v 1.31 2005/08/03 14:08:12 sniper Exp $ */
/*
scanf.c --
diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h
index 3c4befa92..a7b4b7fa0 100644
--- a/ext/standard/scanf.h
+++ b/ext/standard/scanf.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: scanf.h,v 1.13 2004/01/08 17:32:52 sniper Exp $ */
+/* $Id: scanf.h,v 1.14 2005/08/03 14:08:12 sniper Exp $ */
#ifndef SCANF_H
#define SCANF_H
diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c
index f72c73b37..bf02fbbcc 100644
--- a/ext/standard/sha1.c
+++ b/ext/standard/sha1.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: sha1.c,v 1.9.2.2 2005/04/16 09:50:13 thetaphi Exp $ */
+/* $Id: sha1.c,v 1.13 2005/08/03 14:08:12 sniper Exp $ */
#include "php.h"
diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h
index df89f07e3..fc68885d1 100644
--- a/ext/standard/sha1.h
+++ b/ext/standard/sha1.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: sha1.h,v 1.4 2004/01/08 17:32:52 sniper Exp $ */
+/* $Id: sha1.h,v 1.5 2005/08/03 14:08:12 sniper Exp $ */
#ifndef SHA1_H
#define SHA1_H
diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c
index 38ab1cca9..188d933da 100644
--- a/ext/standard/soundex.c
+++ b/ext/standard/soundex.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Bjørn Borud - Guardian Networks AS <borud@guardian.no> |
+----------------------------------------------------------------------+
*/
-/* $Id: soundex.c,v 1.24 2004/06/17 00:17:49 iliaa Exp $ */
+/* $Id: soundex.c,v 1.25 2005/08/03 14:08:12 sniper Exp $ */
#include "php.h"
#include <stdlib.h>
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 394c41b1e..9881e12f8 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.c,v 1.35.2.10 2005/01/15 04:51:03 sniper Exp $ */
+/* $Id: streamsfuncs.c,v 1.58 2005/08/03 14:08:12 sniper Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -41,6 +41,38 @@ static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
/* Streams based network functions */
+#if HAVE_SOCKETPAIR
+/* {{{ proto array stream_socket_pair(int domain, int type, int protocol)
+ Creates a pair of connected, indistinguishable socket streams */
+PHP_FUNCTION(stream_socket_pair)
+{
+ long domain, type, protocol;
+ php_stream *s1, *s2;
+ int pair[2];
+
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll",
+ &domain, &type, &protocol)) {
+ RETURN_FALSE;
+ }
+
+ if (0 != socketpair(domain, type, protocol, pair)) {
+ char errbuf[256];
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create sockets: [%d]: %s",
+ php_socket_errno(), php_socket_strerror(php_socket_errno(), errbuf, sizeof(errbuf)));
+ RETURN_FALSE;
+ }
+
+ array_init(return_value);
+
+ s1 = php_stream_sock_open_from_socket(pair[0], 0);
+ s2 = php_stream_sock_open_from_socket(pair[1], 0);
+
+ add_next_index_resource(return_value, php_stream_get_resource_id(s1));
+ add_next_index_resource(return_value, php_stream_get_resource_id(s2));
+}
+/* }}} */
+#endif
+
/* {{{ proto resource stream_socket_client(string remoteaddress [, long &errcode, string &errstring, double timeout, long flags, resource context])
Open a client connection to a remote address */
PHP_FUNCTION(stream_socket_client)
@@ -353,22 +385,27 @@ PHP_FUNCTION(stream_socket_recvfrom)
}
/* }}} */
-/* {{{ proto long stream_get_contents(resource source [, long maxlen ])
+/* {{{ proto long stream_get_contents(resource source [, long maxlen [, long offset]])
Reads all remaining bytes (or up to maxlen bytes) from a stream and returns them as a string. */
PHP_FUNCTION(stream_get_contents)
{
php_stream *stream;
zval *zsrc;
- long maxlen = PHP_STREAM_COPY_ALL;
+ long maxlen = PHP_STREAM_COPY_ALL, pos = 0;
int len, newlen;
char *contents = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zsrc, &maxlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ll", &zsrc, &maxlen, &pos) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, &zsrc);
+ if (pos > 0 && php_stream_seek(stream, pos, SEEK_SET) < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to %ld position in the stream.", pos);
+ RETURN_FALSE;
+ }
+
if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) {
if (PG(magic_quotes_runtime)) {
@@ -385,21 +422,26 @@ PHP_FUNCTION(stream_get_contents)
}
/* }}} */
-/* {{{ proto long stream_copy_to_stream(resource source, resource dest [, long maxlen ])
+/* {{{ proto long stream_copy_to_stream(resource source, resource dest [, long maxlen [, long pos]])
Reads up to maxlen bytes from source stream and writes them to dest stream. */
PHP_FUNCTION(stream_copy_to_stream)
{
php_stream *src, *dest;
zval *zsrc, *zdest;
- long maxlen = PHP_STREAM_COPY_ALL;
+ long maxlen = PHP_STREAM_COPY_ALL, pos = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|l", &zsrc, &zdest, &maxlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(src, &zsrc);
php_stream_from_zval(dest, &zdest);
+ if (pos > 0 && php_stream_seek(src, pos, SEEK_SET) < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to %ld position in the stream.", pos);
+ RETURN_FALSE;
+ }
+
RETURN_LONG(php_stream_copy_to_stream(src, dest, maxlen));
}
/* }}} */
@@ -895,9 +937,7 @@ PHP_FUNCTION(stream_context_get_options)
RETURN_FALSE;
}
- *return_value = *context->options;
- zval_copy_ctor(return_value);
- INIT_PZVAL(return_value);
+ RETURN_ZVAL(context->options, 1, 0);
}
/* }}} */
@@ -958,6 +998,30 @@ PHP_FUNCTION(stream_context_set_params)
}
/* }}} */
+/* {{{ proto resource stream_context_get_default([array options])
+ Get a handle on the default file/stream context and optionally set parameters */
+PHP_FUNCTION(stream_context_get_default)
+{
+ zval *params = NULL;
+ php_stream_context *context;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a", &params) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if (FG(default_context) == NULL) {
+ FG(default_context) = php_stream_context_alloc();
+ }
+ context = FG(default_context);
+
+ if (params) {
+ parse_context_options(context, params);
+ }
+
+ php_stream_context_to_zval(context, return_value);
+}
+/* }}} */
+
/* {{{ proto resource stream_context_create([array options])
Create a file context and optionally set parameters */
PHP_FUNCTION(stream_context_create)
@@ -988,7 +1052,7 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
int filternamelen;
long read_write = 0;
zval *filterparams = NULL;
- php_stream_filter *filter;
+ php_stream_filter *filter = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lz", &zstream,
&filtername, &filternamelen, &read_write, &filterparams) == FAILURE) {
@@ -1037,10 +1101,14 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
}
}
- RETURN_TRUE;
+ if (filter) {
+ RETURN_RESOURCE(filter->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, filter, php_file_le_stream_filter()));
+ } else {
+ RETURN_FALSE;
+ }
}
-/* {{{ proto bool stream_filter_prepend(resource stream, string filtername[, int read_write[, string filterparams]])
+/* {{{ proto resource stream_filter_prepend(resource stream, string filtername[, int read_write[, string filterparams]])
Prepend a filter to a stream */
PHP_FUNCTION(stream_filter_prepend)
{
@@ -1048,7 +1116,7 @@ PHP_FUNCTION(stream_filter_prepend)
}
/* }}} */
-/* {{{ proto bool stream_filter_append(resource stream, string filtername[, int read_write[, string filterparams]])
+/* {{{ proto resource stream_filter_append(resource stream, string filtername[, int read_write[, string filterparams]])
Append a filter to a stream */
PHP_FUNCTION(stream_filter_append)
{
@@ -1056,6 +1124,36 @@ PHP_FUNCTION(stream_filter_append)
}
/* }}} */
+/* {{{ proto bool stream_filter_remove(resource stream_filter)
+ Flushes any data in the filter's internal buffer, removes it from the chain, and frees the resource */
+PHP_FUNCTION(stream_filter_remove)
+{
+ zval *zfilter;
+ php_stream_filter *filter;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zfilter) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ filter = zend_fetch_resource(&zfilter TSRMLS_CC, -1, NULL, NULL, 1, php_file_le_stream_filter());
+ if (!filter) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid resource given, not a stream filter");
+ RETURN_FALSE;
+ }
+
+ if (php_stream_filter_flush(filter, 1) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to flush filter, not removing");
+ RETURN_FALSE;
+ }
+
+ if (zend_list_delete(Z_LVAL_P(zfilter)) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not invalidate filter, not removing");
+ RETURN_FALSE;
+ } else {
+ php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ RETURN_TRUE;
+ }
+}
/* }}} */
/* {{{ proto string stream_get_line(resource stream, int maxlen [, string ending])
@@ -1078,6 +1176,9 @@ PHP_FUNCTION(stream_get_line)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The maximum allowed length must be greater then or equal to zero.");
RETURN_FALSE;
}
+ if (!max_length) {
+ max_length = PHP_SOCK_CHUNK_SIZE;
+ }
php_stream_from_zval(stream, &zstream);
@@ -1196,6 +1297,46 @@ PHP_FUNCTION(stream_set_write_buffer)
}
/* }}} */
+/* {{{ proto int stream_socket_enable_crypto(resource stream, bool enable [, int cryptokind, resource sessionstream])
+ Enable or disable a specific kind of crypto on the stream */
+PHP_FUNCTION(stream_socket_enable_crypto)
+{
+ long cryptokind;
+ zval *zstream, *zsessstream = NULL;
+ php_stream *stream, *sessstream = NULL;
+ zend_bool enable;
+ int ret;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|lr", &zstream, &enable, &cryptokind, &zsessstream) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ php_stream_from_zval(stream, &zstream);
+
+ if (ZEND_NUM_ARGS() >= 3) {
+ if (zsessstream) {
+ php_stream_from_zval(sessstream, &zsessstream);
+ }
+
+ if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream TSRMLS_CC) < 0) {
+ RETURN_FALSE;
+ }
+ }
+
+ ret = php_stream_xport_crypto_enable(stream, enable TSRMLS_CC);
+ switch (ret) {
+ case -1:
+ RETURN_FALSE;
+
+ case 0:
+ RETURN_LONG(0);
+
+ default:
+ RETURN_TRUE;
+ }
+}
+/* }}} */
+
/*
* Local variables:
* tab-width: 4
diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h
index 89558da40..bdcf8cbea 100644
--- a/ext/standard/streamsfuncs.h
+++ b/ext/standard/streamsfuncs.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: streamsfuncs.h,v 1.8 2004/01/08 17:32:52 sniper Exp $ */
+/* $Id: streamsfuncs.h,v 1.13 2005/08/03 14:08:13 sniper Exp $ */
/* Flags for stream_socket_client */
#define PHP_STREAM_CLIENT_PERSISTENT 1
@@ -43,12 +43,18 @@ PHP_FUNCTION(stream_get_wrappers);
PHP_FUNCTION(stream_get_line);
PHP_FUNCTION(stream_get_meta_data);
PHP_FUNCTION(stream_wrapper_register);
+PHP_FUNCTION(stream_wrapper_unregister);
+PHP_FUNCTION(stream_wrapper_restore);
PHP_FUNCTION(stream_context_create);
PHP_FUNCTION(stream_context_set_params);
PHP_FUNCTION(stream_context_set_option);
PHP_FUNCTION(stream_context_get_options);
+PHP_FUNCTION(stream_context_get_default);
PHP_FUNCTION(stream_filter_prepend);
PHP_FUNCTION(stream_filter_append);
+PHP_FUNCTION(stream_filter_remove);
+PHP_FUNCTION(stream_socket_enable_crypto);
+PHP_FUNCTION(stream_socket_pair);
/*
* Local variables:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 2c8c87265..cf3fcb191 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.420.2.12 2005/07/16 11:18:35 hyanantha Exp $ */
+/* $Id: string.c,v 1.445.2.1 2005/09/28 22:39:52 iliaa Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -784,8 +784,52 @@ PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit)
}
/* }}} */
+/* {{{ php_explode_negative_limit
+ */
+PHPAPI void php_explode_negative_limit(zval *delim, zval *str, zval *return_value, int limit)
+{
+#define EXPLODE_ALLOC_STEP 50
+ char *p1, *p2, *endp;
+ int allocated = EXPLODE_ALLOC_STEP, found = 0, i = 0, to_return = 0;
+ char **positions = safe_emalloc(allocated, sizeof(char *), 0);
+
+ endp = Z_STRVAL_P(str) + Z_STRLEN_P(str);
+
+ p1 = Z_STRVAL_P(str);
+ p2 = php_memnstr(Z_STRVAL_P(str), Z_STRVAL_P(delim), Z_STRLEN_P(delim), endp);
+
+ if (p2 == NULL) {
+ /*
+ do nothing since limit <= -1, thus if only one chunk - 1 + (limit) <= 0
+ by doing nothing we return empty array
+ */
+ } else {
+ positions[found++] = p1;
+ do {
+ if (found >= allocated) {
+ allocated = found + EXPLODE_ALLOC_STEP;/* make sure we have enough memory */
+ positions = erealloc(positions, allocated*sizeof(char *));
+ }
+ positions[found++] = p1 = p2 + Z_STRLEN_P(delim);
+ } while ((p2 = php_memnstr(p1, Z_STRVAL_P(delim), Z_STRLEN_P(delim), endp)) != NULL);
+
+ to_return = limit + found;
+ /* limit is at least -1 therefore no need of bounds checking : i will be always less than found */
+ for (i = 0;i < to_return;i++) { /* this checks also for to_return > 0 */
+ add_next_index_stringl(return_value, positions[i],
+ (positions[i+1] - Z_STRLEN_P(delim)) - positions[i],
+ 1
+ );
+ }
+ }
+ efree(positions);
+#undef EXPLODE_ALLOC_STEP
+}
+/* }}} */
+
+
/* {{{ proto array explode(string separator, string str [, int limit])
- Splits a string on string separator and return array of components */
+ Splits a string on string separator and return array of components. If limit is positive only limit number of components is returned. If limit is negative all components except the last abs(limit) are returned. */
PHP_FUNCTION(explode)
{
zval **str, **delim, **zlimit = NULL;
@@ -810,8 +854,16 @@ PHP_FUNCTION(explode)
array_init(return_value);
+ if (! Z_STRLEN_PP(str)) {
+ add_next_index_stringl(return_value, "", sizeof("") - 1, 1);
+ return;
+ }
+
+
if (limit == 0 || limit == 1) {
add_index_stringl(return_value, 0, Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1);
+ } else if (limit < 0 && argc == 3) {
+ php_explode_negative_limit(*delim, *str, return_value, limit);
} else {
php_explode(*delim, *str, return_value, limit);
}
@@ -1026,8 +1078,7 @@ PHP_FUNCTION(strtoupper)
}
convert_to_string_ex(arg);
- *return_value = **arg;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*arg, 1, 0);
php_strtoupper(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value));
}
/* }}} */
@@ -1061,8 +1112,7 @@ PHP_FUNCTION(strtolower)
}
convert_to_string_ex(str);
- *return_value = **str;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*str, 1, 0);
ret = php_strtolower(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value));
}
/* }}} */
@@ -1188,9 +1238,9 @@ PHPAPI size_t php_dirname(char *path, size_t len)
len_adjust = ((colonpos - path) + 1);
path += len_adjust;
if(len_adjust == len) {
- return len;
+ return len;
}
- }
+ }
#endif
if (len == 0) {
@@ -1321,19 +1371,17 @@ PHP_FUNCTION(pathinfo)
}
if (opt == PHP_PATHINFO_ALL) {
- *return_value = *tmp;
+ RETURN_ZVAL(tmp, 0, 1);
} else {
zval **element;
if (zend_hash_get_current_data(Z_ARRVAL_P(tmp), (void **) &element) == SUCCESS) {
- *return_value = **element;
+ RETVAL_ZVAL(*element, 1, 0);
} else {
ZVAL_EMPTY_STRING(return_value);
}
}
- zval_copy_ctor(return_value);
- zval_dtor(tmp);
- efree(tmp);
+ zval_ptr_dtor(&tmp);
}
/* }}} */
@@ -3196,7 +3244,7 @@ static void php_str_replace_in_subject(zval *search, zval *replace, zval **subje
convert_to_string_ex(subject);
Z_TYPE_P(result) = IS_STRING;
if (Z_STRLEN_PP(subject) == 0) {
- ZVAL_STRINGL(result, empty_string, 0, 1);
+ ZVAL_STRINGL(result, "", 0, 1);
return;
}
@@ -3244,7 +3292,7 @@ static void php_str_replace_in_subject(zval *search, zval *replace, zval **subje
zend_hash_move_forward(Z_ARRVAL_P(replace));
} else {
/* We've run out of replacement strings, so use an empty one. */
- replace_value = empty_string;
+ replace_value = "";
replace_len = 0;
}
}
@@ -3809,7 +3857,6 @@ PHP_FUNCTION(parse_str)
zval *sarg;
char *res = NULL;
int argCount;
- int old_rg;
argCount = ZEND_NUM_ARGS();
if (argCount < 1 || argCount > 2 || zend_get_parameters_ex(argCount, &arg, &arrayArg) == FAILURE) {
@@ -3822,19 +3869,18 @@ PHP_FUNCTION(parse_str)
res = estrndup(Z_STRVAL_P(sarg), Z_STRLEN_P(sarg));
}
- old_rg = PG(register_globals);
if (argCount == 1) {
- PG(register_globals) = 1;
- sapi_module.treat_data(PARSE_STRING, res, NULL TSRMLS_CC);
+ zval tmp;
+ Z_ARRVAL(tmp) = EG(active_symbol_table);
+
+ sapi_module.treat_data(PARSE_STRING, res, &tmp TSRMLS_CC);
} else {
- PG(register_globals) = 0;
/* Clear out the array that was passed in. */
zval_dtor(*arrayArg);
array_init(*arrayArg);
sapi_module.treat_data(PARSE_STRING, res, *arrayArg TSRMLS_CC);
}
- PG(register_globals) = old_rg;
}
/* }}} */
@@ -4164,11 +4210,11 @@ PHP_FUNCTION(str_repeat)
/* Don't waste our time if it's empty */
if (Z_STRLEN_PP(input_str) == 0)
- RETURN_STRINGL(empty_string, 0, 1);
+ RETURN_STRINGL("", 0, 1);
/* ... or if the multiplier is zero */
if (Z_LVAL_PP(mult) == 0)
- RETURN_STRINGL(empty_string, 0, 1);
+ RETURN_STRINGL("", 0, 1);
/* Initialize the result string */
result_len = Z_STRLEN_PP(input_str) * Z_LVAL_PP(mult);
@@ -4400,15 +4446,16 @@ PHP_FUNCTION(strnatcasecmp)
}
/* }}} */
-/* {{{ proto int substr_count(string haystack, string needle)
+/* {{{ proto int substr_count(string haystack, string needle [, int offset [, int length]])
Returns the number of times a substring occurs in the string */
PHP_FUNCTION(substr_count)
{
- zval **haystack, **needle;
+ zval **haystack, **needle, **offset, **length;
+ int ac = ZEND_NUM_ARGS();
int count = 0;
char *p, *endp, cmp;
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &haystack, &needle) == FAILURE) {
+ if (ac < 2 || ac > 4 || zend_get_parameters_ex(ac, &haystack, &needle, &offset, &length) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -4423,13 +4470,37 @@ PHP_FUNCTION(substr_count)
p = Z_STRVAL_PP(haystack);
endp = p + Z_STRLEN_PP(haystack);
+ if (ac > 2) {
+ convert_to_long_ex(offset);
+ if (Z_LVAL_PP(offset) < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset should be greater then or equal to 0.");
+ RETURN_FALSE;
+ }
+ p += Z_LVAL_PP(offset);
+ if (p > endp) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value %ld exceeds string length.", Z_LVAL_PP(offset));
+ RETURN_FALSE;
+ }
+ if (ac == 4) {
+ convert_to_long_ex(length);
+ if (Z_LVAL_PP(length) <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length should be greater than 0.");
+ RETURN_FALSE;
+ }
+ if ((p + Z_LVAL_PP(length)) > endp) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length value %ld exceeds string length.", Z_LVAL_PP(length));
+ RETURN_FALSE;
+ }
+ endp = p + Z_LVAL_PP(length);
+ }
+ }
+
if (Z_STRLEN_PP(needle) == 1) {
cmp = Z_STRVAL_PP(needle)[0];
-
- while (p < endp) {
- if (*(p++) == cmp) {
- count++;
- }
+
+ while ((p = memchr(p, cmp, endp - p))) {
+ count++;
+ p++;
}
} else {
while ((p = php_memnstr(p, Z_STRVAL_PP(needle), Z_STRLEN_PP(needle), endp))) {
@@ -4476,9 +4547,7 @@ PHP_FUNCTION(str_pad)
/* If resulting string turns out to be shorter than input string,
we simply copy the input and return. */
if (num_pad_chars < 0) {
- *return_value = **input;
- zval_copy_ctor(return_value);
- return;
+ RETURN_ZVAL(*input, 1, 0);
}
/* Setup the padding string values if specified. */
@@ -4584,9 +4653,7 @@ PHP_FUNCTION(str_rot13)
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg)) {
WRONG_PARAM_COUNT;
}
- convert_to_string_ex(arg);
- *return_value = **arg;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*arg, 1, 0);
php_strtr(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value), rot13_from, rot13_to, 52);
}
@@ -4630,15 +4697,14 @@ PHP_FUNCTION(str_shuffle)
}
convert_to_string_ex(arg);
- *return_value = **arg;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*arg, 1, 0);
if (Z_STRLEN_P(return_value) > 1) {
php_string_shuffle(Z_STRVAL_P(return_value), (long) Z_STRLEN_P(return_value) TSRMLS_CC);
}
}
/* }}} */
-/* {{{ proto mixed str_word_count(string str, [int format])
+/* {{{ proto mixed str_word_count(string str, [int format [, string charlist]])
Counts the number of words inside a string. If format of 1 is specified,
then the function will return an array containing all the words
found inside the string. If format of 2 is specified, then the function
@@ -4651,39 +4717,29 @@ PHP_FUNCTION(str_shuffle)
*/
PHP_FUNCTION(str_word_count)
{
- zval **str, **o_format;
- char *s, *e, *p, *buf;
- int word_count = 0;
- int type = 0;
- int n_args = ZEND_NUM_ARGS();
+ char *buf, *str, *char_list = NULL, *p, *e, *s, ch[256];
+ int str_len, char_list_len, word_count = 0;
+ long type = 0;
- if (n_args > 2 || n_args < 1 || zend_get_parameters_ex(n_args, &str, &o_format) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len, &type, &char_list, &char_list_len) == FAILURE) {
WRONG_PARAM_COUNT;
}
-
- if (n_args == 2) {
- convert_to_long_ex(o_format);
- type = Z_LVAL_PP(o_format);
-
- if (type != 1 && type != 2) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The specified format parameter, '%d' is invalid.", type);
- RETURN_FALSE;
- }
- }
- convert_to_string_ex(str);
+ if (char_list) {
+ php_charmask(char_list, char_list_len, ch TSRMLS_CC);
+ }
- p = s = Z_STRVAL_PP(str);
- e = Z_STRVAL_PP(str) + Z_STRLEN_PP(str);
+ p = str;
+ e = str + str_len;
if (type == 1 || type == 2) {
array_init(return_value);
}
while (p < e) {
- if (isalpha(*p++)) {
- s = p - 1;
- while (isalpha(*p) || *p == '\'' || (*p == '-' && isalpha(*(p+1)))) {
+ if (isalpha(*p) || (char_list && ch[(unsigned char)*p])) {
+ s = ++p - 1;
+ while (isalpha(*p) || *p == '\'' || (*p == '-' && isalpha(*(p+1))) || (char_list && ch[(unsigned char)*p])) {
p++;
}
@@ -4696,14 +4752,16 @@ PHP_FUNCTION(str_word_count)
break;
case 2:
buf = estrndup(s, (p-s));
- add_index_stringl(return_value, (s - Z_STRVAL_PP(str)), buf, p-s, 1);
+ add_index_stringl(return_value, (s - str), buf, p-s, 1);
efree(buf);
break;
default:
word_count++;
break;
}
- }
+ } else {
+ p++;
+ }
}
if (!type) {
@@ -4760,6 +4818,11 @@ PHP_FUNCTION(str_split)
array_init(return_value);
+ if (split_length >= str_len) {
+ add_next_index_stringl(return_value, str, str_len, 1);
+ return;
+ }
+
n_reg_segments = floor(str_len / split_length);
p = str;
@@ -4818,6 +4881,10 @@ PHP_FUNCTION(substr_compare)
RETURN_FALSE;
}
+ if (offset < 0) {
+ offset = s1_len + offset;
+ }
+
cmp_len = (uint) (len ? len : MAX(s2_len, (s1_len - offset)));
if (!cs) {
diff --git a/ext/standard/sunfuncs.c b/ext/standard/sunfuncs.c
index c11aa317f..b4fb8150b 100644
--- a/ext/standard/sunfuncs.c
+++ b/ext/standard/sunfuncs.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: sunfuncs.c,v 1.6.2.3 2005/02/10 14:35:13 pajoye Exp $ */
+/* $Id: sunfuncs.c,v 1.11 2005/08/03 14:08:14 sniper Exp $ */
/*
The sun position algorithm taken from the 'US Naval Observatory's
@@ -219,7 +219,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
/* }}} */
/* {{{ proto mixed date_sunrise(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
- Returns time of sunrise for a given day & location */
+ Returns time of sunrise for a given day and location */
PHP_FUNCTION(date_sunrise)
{
php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
@@ -227,7 +227,7 @@ PHP_FUNCTION(date_sunrise)
/* }}} */
/* {{{ proto mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
- Returns time of sunset for a given day & location */
+ Returns time of sunset for a given day and location */
PHP_FUNCTION(date_sunset)
{
php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c
index 1800dad40..eb0155507 100644
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: syslog.c,v 1.46.2.2 2005/07/15 09:29:19 hyanantha Exp $ */
+/* $Id: syslog.c,v 1.49 2005/08/03 14:08:14 sniper Exp $ */
#include "php.h"
diff --git a/ext/standard/tests/array/007.phpt b/ext/standard/tests/array/007.phpt
index 95479e18b..0e5c32af2 100644
--- a/ext/standard/tests/array/007.phpt
+++ b/ext/standard/tests/array/007.phpt
@@ -254,57 +254,57 @@ array(9) {
-=-=-=-=-=-=-=-=- New functionality from 5.0.0 -=-=-=-=-=-=-=-
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_udiff_uassoc($a, $b, "comp_func_cr", "comp_func"));
array(3) {
@@ -332,57 +332,57 @@ array(3) {
}
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));
array(3) {
@@ -410,57 +410,57 @@ array(3) {
}
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_diff_assoc($a, $b));
array(5) {
@@ -502,57 +502,57 @@ array(5) {
}
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_udiff($a, $b, "comp_func_cr"));
array(2) {
@@ -573,57 +573,57 @@ array(2) {
}
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_udiff_assoc($a, $b, "comp_func_cr"));
array(3) {
diff --git a/ext/standard/tests/array/array_diff_key.phpt b/ext/standard/tests/array/array_diff_key.phpt
new file mode 100644
index 000000000..91664a871
--- /dev/null
+++ b/ext/standard/tests/array/array_diff_key.phpt
@@ -0,0 +1,250 @@
+--TEST--
+Test of the array_diff_key() and array_diff_ukey()
+--FILE--
+<?php
+$a = array(1, 6, 2, -20, 15, 1200, -2500);
+$b = array(0, 7, 2, -20, 11, 1100, -2500);
+$c = array(0, 6, 2, -20, 19, 1000, -2500);
+$d = array(3, 8,-2, -20, 14, 900, -2600);
+$a_f = array_flip($a);
+$b_f = array_flip($b);
+$c_f = array_flip($c);
+$d_f = array_flip($d);
+$i = 1;
+/* give nicer values */
+foreach ($a_f as $k=> &$a_f_el) { $a_f_el =$k*2;}
+foreach ($b_f as $k=> &$b_f_el) { $b_f_el =$k*2;}
+foreach ($c_f as $k=> &$c_f_el) { $c_f_el =$k*2;}
+foreach ($d_f as $k=> &$d_f_el) { $d_f_el =$k*2;}
+
+echo "------ Test $i --------\n";$i++;// 1
+var_dump(array_diff_key($a_f, $b_f));// keys -> 1, 6, 15, 1200
+var_dump(array_diff_ukey($a_f, $b_f, "comp_func"));// 1, 6, 15, 1200
+
+echo "------ Test $i --------\n";$i++;// 2
+var_dump(array_diff_key($a_f, $c_f));// keys -> 1, 15, 1200
+var_dump(array_diff_ukey($a_f, $c_f, "comp_func"));// 1, 15, 1200
+
+echo "------ Test $i --------\n";$i++;// 3
+var_dump(array_diff_key($a_f, $d_f));// 1, 6, 2, 15, 1200, -2500
+var_dump(array_diff_ukey($a_f, $d_f, "comp_func"));// 1, 6, 2, 15, 1200, -2500
+
+echo "------ Test $i --------\n";$i++;// 4
+var_dump(array_diff_key($a_f, $b_f, $c_f));// 1, 15, 1200
+var_dump(array_diff_ukey($a_f, $b_f, $c_f, "comp_func"));// 1, 15, 1200
+
+echo "------ Test $i --------\n";$i++;// 5
+var_dump(array_diff_key($a_f, $b_f, $d_f));// 1, 6, 15, 1200
+var_dump(array_diff_ukey($a_f, $b_f, $d_f, "comp_func"));// 1, 6, 15, 1200
+
+
+echo "------ Test $i --------\n";$i++;// 6
+var_dump(array_diff_key($a_f, $b_f, $c_f, $d_f));// 1, 15, 1200
+var_dump(array_diff_ukey($a_f, $b_f, $c_f, $d_f, "comp_func"));//1, 15, 1200
+
+
+echo "------ Test $i --------\n";$i++;// 7
+var_dump(array_diff_key($b_f, $c_f));// 7, 11, 1100
+var_dump(array_diff_ukey($b_f, $c_f, "comp_func"));//7, 11, 1100
+
+echo "------ Test $i --------\n";$i++;// 8
+var_dump(array_diff_key($b_f, $d_f));//0, 7, 2, 11, 1100, -2500
+var_dump(array_diff_ukey($b_f, $d_f, "comp_func"));//0, 7, 2, 11, 1100, -2500
+
+
+echo "------ Test $i --------\n";$i++;// 9
+var_dump(array_diff_key($b_f, $c_f, $d_f));// 7, 11, 1100
+var_dump(array_diff_ukey($b_f, $c_f, $d_f, "comp_func"));// 7, 11, 1000
+
+function comp_func($a, $b) {
+ if ($a === $b) return 0;
+ return ($a > $b)? 1:-1;
+
+}
+?>
+--EXPECTF--
+------ Test 1 --------
+array(4) {
+ [1]=>
+ &int(2)
+ [6]=>
+ &int(12)
+ [15]=>
+ &int(30)
+ [1200]=>
+ &int(2400)
+}
+array(4) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 2 --------
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 3 --------
+array(6) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [2]=>
+ int(4)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+ [-2500]=>
+ &int(-5000)
+}
+array(6) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [2]=>
+ int(4)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+ [-2500]=>
+ &int(-5000)
+}
+------ Test 4 --------
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 5 --------
+array(4) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+array(4) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 6 --------
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 7 --------
+array(3) {
+ [7]=>
+ &int(14)
+ [11]=>
+ &int(22)
+ [1100]=>
+ &int(2200)
+}
+array(3) {
+ [7]=>
+ int(14)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+}
+------ Test 8 --------
+array(6) {
+ [0]=>
+ int(0)
+ [7]=>
+ int(14)
+ [2]=>
+ int(4)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+ [-2500]=>
+ &int(-5000)
+}
+array(6) {
+ [0]=>
+ int(0)
+ [7]=>
+ int(14)
+ [2]=>
+ int(4)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+ [-2500]=>
+ &int(-5000)
+}
+------ Test 9 --------
+array(3) {
+ [7]=>
+ int(14)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+}
+array(3) {
+ [7]=>
+ int(14)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+}
diff --git a/ext/standard/tests/array/array_intersect_1.phpt b/ext/standard/tests/array/array_intersect_1.phpt
index 1fed25dcb..74c4828c2 100644
--- a/ext/standard/tests/array/array_intersect_1.phpt
+++ b/ext/standard/tests/array/array_intersect_1.phpt
@@ -90,57 +90,57 @@ echo "end ------------ array_uintersect_uassoc() with method --------\n";
begin ------------ array_intersect() ----------------------------
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_intersect($a, $b);
array(0) {
@@ -149,57 +149,57 @@ end ------------ array_intersect() ----------------------------
begin ------------ array_uintersect() ---------------------------
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_uintersect($a, $b, "comp_func_cr"));
array(3) {
@@ -229,57 +229,57 @@ end ------------ array_uintersect() ---------------------------
begin ------------ array_intersect_assoc() ----------------------
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_intersect_assoc($a, $b));
array(0) {
@@ -288,57 +288,57 @@ end ------------ array_intersect_assoc() ----------------------
begin ------------ array_uintersect_assoc() ---------------------
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_uintersect_assoc($a, $b, "comp_func_cr"));
array(2) {
@@ -361,57 +361,57 @@ end ------------ array_uintersect_assoc() ---------------------
begin ------------ array_intersect_uassoc() ---------------------
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_intersect_uassoc($a, $b, "comp_func"));
array(0) {
@@ -420,57 +420,57 @@ end ------------ array_intersect_uassoc() ---------------------
begin ------------ array_uintersect_uassoc() with ordinary func -
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_uintersect_uassoc($a, $b, "comp_func_cr", "comp_func"));
array(2) {
@@ -493,57 +493,57 @@ end ------------ array_uintersect_uassoc() with ordinary func -
begin ------------ array_uintersect_uassoc() with method --------
$a=array (
'0.1' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 12;
- public $public_member = 12;
- },
+ cr::__set_state(array(
+ 'priv_member' => 12,
+ 'public_member' => 12,
+ )),
0 =>
- class cr {
- private $priv_member = 23;
- public $public_member = 23;
- },
+ cr::__set_state(array(
+ 'priv_member' => 23,
+ 'public_member' => 23,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
$b=array (
'0.2' =>
- class cr {
- private $priv_member = 9;
- public $public_member = 9;
- },
+ cr::__set_state(array(
+ 'priv_member' => 9,
+ 'public_member' => 9,
+ )),
'0.5' =>
- class cr {
- private $priv_member = 22;
- public $public_member = 22;
- },
+ cr::__set_state(array(
+ 'priv_member' => 22,
+ 'public_member' => 22,
+ )),
0 =>
- class cr {
- private $priv_member = 3;
- public $public_member = 3;
- },
+ cr::__set_state(array(
+ 'priv_member' => 3,
+ 'public_member' => 3,
+ )),
1 =>
- class cr {
- private $priv_member = 4;
- public $public_member = 4;
- },
+ cr::__set_state(array(
+ 'priv_member' => 4,
+ 'public_member' => 4,
+ )),
2 =>
- class cr {
- private $priv_member = -15;
- public $public_member = -15;
- },
+ cr::__set_state(array(
+ 'priv_member' => -15,
+ 'public_member' => -15,
+ )),
);
var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));
array(2) {
diff --git a/ext/standard/tests/array/array_intersect_key.phpt b/ext/standard/tests/array/array_intersect_key.phpt
new file mode 100644
index 000000000..6a5965ba7
--- /dev/null
+++ b/ext/standard/tests/array/array_intersect_key.phpt
@@ -0,0 +1,209 @@
+--TEST--
+Test of the array_intersect_key() and array_intersect_ukey()
+--FILE--
+<?php
+$a = array(1, 6, 2, -20, 15, 1200, -2500);
+$b = array(0, 7, 2, -20, 11, 1100, -2500);
+$c = array(0, 6, 2, -20, 19, 1000, -2500);
+$d = array(3, 8,-2, -20, 14, 900, -2600);
+
+$a_f = array_flip($a);
+$b_f = array_flip($b);
+$c_f = array_flip($c);
+$d_f = array_flip($d);
+
+/* give nicer values */
+foreach ($a_f as $k=> &$a_f_el) { $a_f_el =$k*2;}
+foreach ($b_f as $k=> &$b_f_el) { $b_f_el =$k*2;}
+foreach ($c_f as $k=> &$c_f_el) { $c_f_el =$k*2;}
+foreach ($d_f as $k=> &$d_f_el) { $d_f_el =$k*2;}
+
+var_dump(array_intersect_key($a_f, $b_f));// keys -> 2, -20, -2500
+var_dump(array_intersect_ukey($a_f, $b_f, "comp_func"));// 2, 20, -2500
+var_dump(array_intersect_key($a_f, $c_f));// keys -> 6, 2, -20, -2500
+var_dump(array_intersect_ukey($a_f, $c_f, "comp_func"));// 6, 2, -20, -2500
+var_dump(array_intersect_key($a_f, $d_f));// -20
+var_dump(array_intersect_ukey($a_f, $d_f, "comp_func"));// -20
+
+var_dump(array_intersect_key($a_f, $b_f, $c_f));// 2, -20, -2500
+var_dump(array_intersect_ukey($a_f, $b_f, $c_f, "comp_func"));// 2, -20, -2500
+var_dump(array_intersect_key($a_f, $b_f, $d_f));// -20
+var_dump(array_intersect_ukey($a_f, $b_f, $d_f, "comp_func"));// -20
+
+var_dump(array_intersect_key($a_f, $b_f, $c_f, $d_f));// -20
+var_dump(array_intersect_ukey($a_f, $b_f, $c_f, $d_f, "comp_func"));//-20
+
+
+var_dump(array_intersect_key($b_f, $c_f));// 0, 2, -20, -2500
+var_dump(array_intersect_ukey($b_f, $c_f, "comp_func"));//0, 2, -20, 2500
+
+var_dump(array_intersect_key($b_f, $d_f));// -20
+var_dump(array_intersect_ukey($b_f, $d_f, "comp_func"));// -20
+
+var_dump(array_intersect_key($b_f, $c_f, $d_f));// -20
+var_dump(array_intersect_ukey($b_f, $c_f, $d_f, "comp_func"));// -20
+
+
+echo "----- Now testing array_intersect() ------- \n";
+var_dump(array_intersect($a, $b_f));
+var_dump(array_uintersect($a, $b, "comp_func"));
+var_dump(array_intersect($a, $b, $c));
+var_dump(array_uintersect($a, $b, $c, "comp_func"));
+var_dump(array_intersect($a, $b, $c, $d));
+var_dump(array_uintersect($a, $b, $c, $d, "comp_func"));
+
+///////////////////////////////////////////////////////////////////////
+function comp_func($a, $b) {
+ if ($a === $b) return 0;
+ return ($a > $b)? 1:-1;
+
+}
+?>
+--EXPECTF--
+array(3) {
+ [2]=>
+ &int(4)
+ [-20]=>
+ &int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(3) {
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(4) {
+ [6]=>
+ int(12)
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(4) {
+ [6]=>
+ int(12)
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(3) {
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(3) {
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(4) {
+ [0]=>
+ &int(0)
+ [2]=>
+ &int(4)
+ [-20]=>
+ &int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(4) {
+ [0]=>
+ int(0)
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+----- Now testing array_intersect() -------
+array(0) {
+}
+array(3) {
+ [2]=>
+ int(2)
+ [3]=>
+ int(-20)
+ [6]=>
+ int(-2500)
+}
+array(3) {
+ [2]=>
+ int(2)
+ [3]=>
+ int(-20)
+ [6]=>
+ int(-2500)
+}
+array(3) {
+ [2]=>
+ int(2)
+ [3]=>
+ int(-20)
+ [6]=>
+ int(-2500)
+}
+array(1) {
+ [3]=>
+ int(-20)
+}
+array(1) {
+ [3]=>
+ int(-20)
+}
diff --git a/ext/standard/tests/array/array_sum.phpt b/ext/standard/tests/array/array_sum.phpt
index d4c91e991..f1868cb2e 100644
--- a/ext/standard/tests/array/array_sum.phpt
+++ b/ext/standard/tests/array/array_sum.phpt
@@ -1,7 +1,7 @@
--TEST--
Test array_sum()
--INI--
-memory_limit=16M
+memory_limit=64M
--FILE--
<?php
$i = 0;
diff --git a/ext/standard/tests/array/bug25359.phpt b/ext/standard/tests/array/bug25359.phpt
new file mode 100644
index 000000000..0b9b89a70
--- /dev/null
+++ b/ext/standard/tests/array/bug25359.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug #25359 (array_multisort() does not work in a function if array is global or reference)
+--FILE--
+<?php
+
+function does_not_work()
+{
+ global $data; // Remove this line to make array_multisort() work
+
+ $data = array('first', 'fifth', 'second', 'forth', 'third');
+ $sort = array(1, 5, 2, 4, 3);
+ array_multisort($sort, $data);
+
+ var_dump($data);
+}
+
+does_not_work();
+
+?>
+--EXPECT--
+array(5) {
+ [0]=>
+ string(5) "first"
+ [1]=>
+ string(6) "second"
+ [2]=>
+ string(5) "third"
+ [3]=>
+ string(5) "forth"
+ [4]=>
+ string(5) "fifth"
+}
diff --git a/ext/standard/tests/array/bug29253.phpt b/ext/standard/tests/array/bug29253.phpt
index 7d6cdaeb4..b2202a104 100755
--- a/ext/standard/tests/array/bug29253.phpt
+++ b/ext/standard/tests/array/bug29253.phpt
@@ -1,13 +1,14 @@
---TEST--
-Bug #29253 array_diff with $GLOBALS argument fails
---FILE--
-<?php
-$zz = $GLOBALS;
-$gg = 'afad';
-var_dump(array_diff_assoc($GLOBALS, $zz));
-var_dump($gg);
-?>
---EXPECT--
-array(0) {
-}
-string(4) "afad"
+--TEST--
+Bug #29253 array_diff with $GLOBALS argument fails
+--FILE--
+<?php
+$zz = $GLOBALS;
+$gg = 'afad';
+var_dump(array_diff_assoc($GLOBALS, $zz));
+var_dump($gg);
+?>
+--EXPECT--
+array(0) {
+}
+string(4) "afad"
+
diff --git a/ext/standard/tests/array/bug29992.phpt b/ext/standard/tests/array/bug29992.phpt
deleted file mode 100755
index 74be29189..000000000
--- a/ext/standard/tests/array/bug29992.phpt
+++ /dev/null
@@ -1,44 +0,0 @@
---TEST--
-Bug #29992 (foreach by reference corrupts the array)
---FILE--
-<?php
-
-$array = array(1,2,3);
-
-print_r($array);
-
-foreach($array as $item) var_dump($item);
-foreach($array as &$item) var_dump($item);
-foreach($array as &$item) var_dump($item);
-foreach($array as $item) var_dump($item);
-
-print_r($array);
-
-?>
-===DONE===
---EXPECT--
-Array
-(
- [0] => 1
- [1] => 2
- [2] => 3
-)
-int(1)
-int(2)
-int(3)
-int(1)
-int(2)
-int(3)
-int(1)
-int(2)
-int(3)
-int(1)
-int(2)
-int(3)
-Array
-(
- [0] => 1
- [1] => 2
- [2] => 3
-)
-===DONE===
diff --git a/ext/standard/tests/array/bug30266.phpt b/ext/standard/tests/array/bug30266.phpt
new file mode 100755
index 000000000..8f7c3d213
--- /dev/null
+++ b/ext/standard/tests/array/bug30266.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #30266 (Invalid opcode 137/1/8) and array_walk
+--FILE--
+<?php
+class testc
+{
+ public $b = "c";
+
+ function crash($val)
+ {
+ $this->b = $val;
+ throw new Exception("Error");
+ }
+}
+
+$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
+
+$myobj = new testc();
+
+function test($item2, $key, $userd)
+{
+ $userd->crash($item2);
+}
+
+try
+{
+ array_walk($fruits, 'test', $myobj);
+}
+catch(Exception $e)
+{
+ echo "Caught: " . $e->getMessage() . "\n";
+}
+?>
+===DONE===
+--EXPECT--
+Caught: Error
+===DONE===
diff --git a/ext/standard/tests/array/bug30833.phpt b/ext/standard/tests/array/bug30833.phpt
index 61701a532..ecf5f1f52 100644
--- a/ext/standard/tests/array/bug30833.phpt
+++ b/ext/standard/tests/array/bug30833.phpt
@@ -23,7 +23,7 @@ array(2) {
array(2) {
["abc"]=>
int(1)
- [0]=>
+ ["0000"]=>
int(1)
}
array(2) {
diff --git a/ext/standard/tests/array/bug33382.phpt b/ext/standard/tests/array/bug33382.phpt
new file mode 100644
index 000000000..407b5846f
--- /dev/null
+++ b/ext/standard/tests/array/bug33382.phpt
@@ -0,0 +1,27 @@
+--TEST--
+bug #33382 ( array_reverse() fails after *sort() )
+--FILE--
+<?php
+
+$array = array(1,2,3,4,5);
+
+sort($array);
+
+var_dump(array_reverse($array));
+
+echo "Done\n";
+?>
+--EXPECT--
+array(5) {
+ [0]=>
+ int(5)
+ [1]=>
+ int(4)
+ [2]=>
+ int(3)
+ [3]=>
+ int(2)
+ [4]=>
+ int(1)
+}
+Done
diff --git a/ext/standard/tests/array/bug33940.phpt b/ext/standard/tests/array/bug33940.phpt
index e5c499001..f1aba87bd 100755
--- a/ext/standard/tests/array/bug33940.phpt
+++ b/ext/standard/tests/array/bug33940.phpt
@@ -1,62 +1,63 @@
---TEST--
-Bug #33940 array_map() fails to pass by reference when called recursively
---INI--
-error_reporting=4095
---FILE--
-<?php
-function ref_map(&$item) {
- if(!is_array($item)) {
- $item = 1;
- return 2;
- } else {
- $ret = array_map('ref_map', &$item);
- return $ret;
- }
-}
-
-$a = array(array(0), 0);
-$ret = array_map('ref_map', $a);
-echo 'Array: '; print_r($a);
-echo 'Return: '; print_r($ret);
-$a = array(array(0), 0);
-$ret = array_map('ref_map', &$a);
-echo 'Array: '; print_r($a);
-echo 'Return: '; print_r($ret);
-?>
---EXPECT--
-Array: Array
-(
- [0] => Array
- (
- [0] => 0
- )
-
- [1] => 0
-)
-Return: Array
-(
- [0] => Array
- (
- [0] => 2
- )
-
- [1] => 2
-)
-Array: Array
-(
- [0] => Array
- (
- [0] => 1
- )
-
- [1] => 1
-)
-Return: Array
-(
- [0] => Array
- (
- [0] => 2
- )
-
- [1] => 2
-)
+--TEST--
+Bug #33940 array_map() fails to pass by reference when called recursively
+--INI--
+error_reporting=4095
+allow_call_time_pass_reference=1
+--FILE--
+<?php
+function ref_map(&$item) {
+ if(!is_array($item)) {
+ $item = 1;
+ return 2;
+ } else {
+ $ret = array_map('ref_map', &$item);
+ return $ret;
+ }
+}
+
+$a = array(array(0), 0);
+$ret = array_map('ref_map', $a);
+echo 'Array: '; print_r($a);
+echo 'Return: '; print_r($ret);
+$a = array(array(0), 0);
+$ret = array_map('ref_map', &$a);
+echo 'Array: '; print_r($a);
+echo 'Return: '; print_r($ret);
+?>
+--EXPECT--
+Array: Array
+(
+ [0] => Array
+ (
+ [0] => 0
+ )
+
+ [1] => 0
+)
+Return: Array
+(
+ [0] => Array
+ (
+ [0] => 2
+ )
+
+ [1] => 2
+)
+Array: Array
+(
+ [0] => Array
+ (
+ [0] => 1
+ )
+
+ [1] => 1
+)
+Return: Array
+(
+ [0] => Array
+ (
+ [0] => 2
+ )
+
+ [1] => 2
+)
diff --git a/ext/standard/tests/array/bug34982.phpt b/ext/standard/tests/array/bug34982.phpt
new file mode 100755
index 000000000..bcfed5938
--- /dev/null
+++ b/ext/standard/tests/array/bug34982.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #34982 array_walk_recursive() modifies elements outside function scope
+--FILE--
+<?php
+$ar = array(
+ 'element 1',
+ array('subelement1')
+ );
+
+func($ar);
+print_r($ar);
+
+function func($a) {
+ array_walk_recursive($a, 'apply');
+ print_r($a);
+}
+
+function apply(&$input, $key) {
+ $input = 'changed';
+}
+?>
+--EXPECT--
+Array
+(
+ [0] => changed
+ [1] => Array
+ (
+ [0] => changed
+ )
+
+)
+Array
+(
+ [0] => element 1
+ [1] => Array
+ (
+ [0] => subelement1
+ )
+
+)
diff --git a/ext/standard/tests/array/bug35014.phpt b/ext/standard/tests/array/bug35014.phpt
new file mode 100644
index 000000000..213bacae3
--- /dev/null
+++ b/ext/standard/tests/array/bug35014.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #35014 (array_product() always returns 0)
+--INI--
+precision=14
+--FILE--
+<?php
+$tests = array(
+ 'foo',
+ array(),
+ array(0),
+ array(3),
+ array(3, 3),
+ array(0.5, 2),
+ array(99999999, 99999999),
+ array(8.993, 7443241,988, sprintf("%u", -1)+0.44),
+ array(2,sprintf("%u", -1)),
+);
+
+foreach ($tests as $v) {
+ var_dump(array_product($v));
+}
+?>
+--EXPECTF--
+
+Warning: array_product(): The argument should be an array in %s/bug35014.php on line 15
+NULL
+int(0)
+int(0)
+int(3)
+int(9)
+float(1)
+float(9.9999998E+15)
+float(2.8404260053903E+20)
+float(8589934590)
diff --git a/ext/standard/tests/array/bug35022.phpt b/ext/standard/tests/array/bug35022.phpt
new file mode 100644
index 000000000..e3f538648
--- /dev/null
+++ b/ext/standard/tests/array/bug35022.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #35022 (Regression in the behavior of key/current functions)
+--FILE--
+<?php
+$state = array("one" => 1, "two" => 2, "three" => 3);
+function foo( &$state ) {
+ $contentDict = end( $state );
+ for ( $contentDict = end( $state ); $contentDict !== false; $contentDict = prev( $state ) ) {
+ echo key($state) . " => " . current($state) . "\n";
+ }
+}
+foo($state);
+reset($state);
+var_dump( key($state), current($state) );
+?>
+--EXPECT--
+three => 3
+two => 2
+one => 1
+string(3) "one"
+int(1)
diff --git a/ext/standard/tests/array/locale_sort.phpt b/ext/standard/tests/array/locale_sort.phpt
new file mode 100644
index 000000000..b4e15fa52
--- /dev/null
+++ b/ext/standard/tests/array/locale_sort.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Sort with SORT_LOCALE_STRING
+--SKIPIF--
+<?php
+if ("fr_FR" != setlocale(LC_CTYPE, "fr_FR")) {
+ die("skip setlocale() failed\n");
+}
+?>
+--FILE--
+<?php
+setlocale(LC_ALL, 'fr_FR');
+$table = array("AB" => "Alberta",
+"BC" => "Colombie-Britannique",
+"MB" => "Manitoba",
+"NB" => "Nouveau-Brunswick",
+"NL" => "Terre-Neuve-et-Labrador",
+"NS" => "Nouvelle-Écosse",
+"ON" => "Ontario",
+"PE" => "Île-du-Prince-Édouard",
+"QC" => "Québec",
+"SK" => "Saskatchewan",
+"NT" => "Territoires du Nord-Ouest",
+"NU" => "Nunavut",
+"YT" => "Territoire du Yukon");
+asort($table, SORT_LOCALE_STRING);
+var_dump($table);
+?>
+--EXPECT--
+array(13) {
+ ["AB"]=>
+ string(7) "Alberta"
+ ["BC"]=>
+ string(20) "Colombie-Britannique"
+ ["PE"]=>
+ string(21) "Île-du-Prince-Édouard"
+ ["MB"]=>
+ string(8) "Manitoba"
+ ["NB"]=>
+ string(17) "Nouveau-Brunswick"
+ ["NS"]=>
+ string(15) "Nouvelle-Écosse"
+ ["NU"]=>
+ string(7) "Nunavut"
+ ["ON"]=>
+ string(7) "Ontario"
+ ["QC"]=>
+ string(6) "Québec"
+ ["SK"]=>
+ string(12) "Saskatchewan"
+ ["NL"]=>
+ string(23) "Terre-Neuve-et-Labrador"
+ ["YT"]=>
+ string(19) "Territoire du Yukon"
+ ["NT"]=>
+ string(25) "Territoires du Nord-Ouest"
+}
diff --git a/ext/standard/tests/array/var_export.phpt b/ext/standard/tests/array/var_export.phpt
index d5acf9dad..acfec7699 100644
--- a/ext/standard/tests/array/var_export.phpt
+++ b/ext/standard/tests/array/var_export.phpt
@@ -6,6 +6,6 @@ $a = (object) array (1, 3, "foo" => "bar");
var_export($a);
?>
--EXPECT--
-class stdClass {
- public $foo = 'bar';
-}
+stdClass::__set_state(array(
+ 'foo' => 'bar',
+))
diff --git a/ext/standard/tests/array/var_export3.phpt b/ext/standard/tests/array/var_export3.phpt
new file mode 100644
index 000000000..6d3994691
--- /dev/null
+++ b/ext/standard/tests/array/var_export3.phpt
@@ -0,0 +1,24 @@
+--TEST--
+var_export() and classes
+--FILE--
+<?php
+class kake {
+ public $mann;
+ protected $kvinne;
+
+ function __construct()
+ {
+ $this->mann = 42;
+ $this->kvinne = 43;
+ }
+}
+
+$kake = new kake;
+
+var_export($kake);
+?>
+--EXPECT--
+kake::__set_state(array(
+ 'mann' => 42,
+ 'kvinne' => 43,
+))
diff --git a/ext/standard/tests/file/bug24482.phpt b/ext/standard/tests/file/bug24482.phpt
index 4bf12e8f6..f545f1add 100644
--- a/ext/standard/tests/file/bug24482.phpt
+++ b/ext/standard/tests/file/bug24482.phpt
@@ -13,7 +13,7 @@ $globdirs = glob("*", GLOB_ONLYDIR);
$dirs = array();
$dh = opendir(".");
while (is_string($file = readdir($dh))) {
- if ($file{0} === ".") continue;
+ if ($file[0] === ".") continue;
if (!is_dir($file)) continue;
$dirs[] = $file;
}
diff --git a/ext/standard/tests/file/bug26615.phpt b/ext/standard/tests/file/bug26615.phpt
index 656c53a44..34d71e4b3 100644
--- a/ext/standard/tests/file/bug26615.phpt
+++ b/ext/standard/tests/file/bug26615.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #26615 (exec crash on long input lines)
+--INI---
+variables_order=E
--FILE--
<?php
$out = array();
diff --git a/ext/standard/tests/file/bug27508.phpt b/ext/standard/tests/file/bug27508.phpt
new file mode 100644
index 000000000..5374a0dcb
--- /dev/null
+++ b/ext/standard/tests/file/bug27508.phpt
@@ -0,0 +1,69 @@
+--TEST--
+Bug #27508 (userspace wrappers have bogus eof indicator)
+--FILE--
+<?php # vim:ft=php
+class FileStream {
+ public $fp;
+
+ function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $url = urldecode(substr($path, 9));
+ $this->fp = fopen($url, $mode);
+
+ return true;
+ }
+
+ function stream_read($count)
+ {
+ return fread($this->fp, $count);
+ }
+
+ function stream_write($data)
+ {
+ return fwrite($this->fp, $data);
+ }
+
+ function stream_tell()
+ {
+ return ftell($this->fp);
+ }
+
+ function stream_eof()
+ {
+ return feof($this->fp);
+ }
+
+ function stream_seek($offset, $whence)
+ {
+ return fseek($this->fp, $offset, $whence) == 0 ? true : false;
+ }
+}
+
+stream_wrapper_register("myFile", "FileStream")
+ or die("Failed to register protocol");
+
+$tn = tempnam('/tmp', 'foo');
+
+$fp = fopen("myFile://" . urlencode($tn), "w+");
+
+fwrite($fp, "line1\n");
+fwrite($fp, "line2\n");
+fwrite($fp, "line3\n");
+
+debug_zval_dump(feof($fp));
+rewind($fp);
+echo ftell($fp) . "\n";
+debug_zval_dump(feof($fp));
+while (!feof($fp)) {
+ echo fgets($fp);
+}
+fclose($fp);
+
+unlink($tn);
+--EXPECT--
+bool(false) refcount(1)
+0
+bool(false) refcount(1)
+line1
+line2
+line3
diff --git a/ext/standard/tests/file/bug32160.phpt b/ext/standard/tests/file/bug32160.phpt
new file mode 100644
index 000000000..e4968034a
--- /dev/null
+++ b/ext/standard/tests/file/bug32160.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #32160 (copying a file into itself leads to data loss)
+--FILE--
+<?php
+$path = dirname(__FILE__) . "/bug32160.txt";
+var_dump(copy($path, $path));
+chdir(dirname(__FILE__));
+var_dump(copy($path, "bug32160.txt"));
+var_dump(copy("bug32160.txt", "bug32160.txt"));
+?>
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
diff --git a/ext/standard/tests/file/bug32160.txt b/ext/standard/tests/file/bug32160.txt
new file mode 100644
index 000000000..1e4a6b512
--- /dev/null
+++ b/ext/standard/tests/file/bug32160.txt
@@ -0,0 +1 @@
+copy test
diff --git a/ext/standard/tests/file/fputcsv.phpt b/ext/standard/tests/file/fputcsv.phpt
new file mode 100755
index 000000000..486d10a1f
--- /dev/null
+++ b/ext/standard/tests/file/fputcsv.phpt
@@ -0,0 +1,107 @@
+--TEST--
+various fputcsv() functionality tests
+--INI--
+magic_quotes_runtime=0
+--FILE--
+<?php
+
+$list = array (
+ 0 => 'aaa,bbb',
+ 1 => 'aaa,"bbb"',
+ 2 => '"aaa","bbb"',
+ 3 => 'aaa,bbb',
+ 4 => '"aaa",bbb',
+ 5 => '"aaa", "bbb"',
+ 6 => ',',
+ 7 => 'aaa,',
+ 8 => ',"aaa"',
+ 9 => '"",""',
+ 10 => '"""""",',
+ 11 => '""""",aaa',
+ 12 => 'aaa,bbb ',
+ 13 => 'aaa,"bbb "',
+ 14 => 'aaa"aaa","bbb"bbb',
+ 15 => 'aaa"aaa""",bbb',
+ 16 => 'aaa,"\\"bbb,ccc',
+ 17 => 'aaa"\\"a","bbb"',
+ 18 => '"\\"","aaa"',
+ 19 => '"\\""",aaa',
+);
+
+$file = dirname(__FILE__) . 'fgetcsv.csv';
+@unlink($file);
+
+$fp = fopen($file, "w");
+foreach ($list as $v) {
+ fputcsv($fp, split(',', $v));
+}
+fclose($fp);
+
+$res = file($file);
+foreach($res as &$val)
+{
+ $val = substr($val, 0, -1);
+}
+echo '$list = ';var_export($res);echo ";\n";
+
+$fp = fopen($file, "r");
+$res = array();
+while($l=fgetcsv($fp))
+{
+ $res[] = join(',',$l);
+}
+fclose($fp);
+
+echo '$list = ';var_export($res);echo ";\n";
+
+@unlink($file);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+$list = array (
+ 0 => 'aaa,bbb',
+ 1 => 'aaa,"""bbb"""',
+ 2 => '"""aaa""","""bbb"""',
+ 3 => 'aaa,bbb',
+ 4 => '"""aaa""",bbb',
+ 5 => '"""aaa"""," ""bbb"""',
+ 6 => ',',
+ 7 => 'aaa,',
+ 8 => ',"""aaa"""',
+ 9 => '"""""",""""""',
+ 10 => '"""""""""""""",',
+ 11 => '"""""""""""",aaa',
+ 12 => 'aaa,"bbb "',
+ 13 => 'aaa,"""bbb """',
+ 14 => '"aaa""aaa""","""bbb""bbb"',
+ 15 => '"aaa""aaa""""""",bbb',
+ 16 => 'aaa,"""\\"bbb",ccc',
+ 17 => '"aaa""\\"a""","""bbb"""',
+ 18 => '"""\\"""","""aaa"""',
+ 19 => '"""\\"""""",aaa',
+);
+$list = array (
+ 0 => 'aaa,bbb',
+ 1 => 'aaa,"bbb"',
+ 2 => '"aaa","bbb"',
+ 3 => 'aaa,bbb',
+ 4 => '"aaa",bbb',
+ 5 => '"aaa", "bbb"',
+ 6 => ',',
+ 7 => 'aaa,',
+ 8 => ',"aaa"',
+ 9 => '"",""',
+ 10 => '"""""",',
+ 11 => '""""",aaa',
+ 12 => 'aaa,bbb ',
+ 13 => 'aaa,"bbb "',
+ 14 => 'aaa"aaa","bbb"bbb',
+ 15 => 'aaa"aaa""",bbb',
+ 16 => 'aaa,"\\"bbb,ccc',
+ 17 => 'aaa"\\"a","bbb"',
+ 18 => '"\\"","aaa"',
+ 19 => '"\\""",aaa',
+);
+===DONE===
diff --git a/ext/standard/tests/file/stream_get_line.phpt b/ext/standard/tests/file/stream_get_line.phpt
new file mode 100644
index 000000000..2c11f00ee
--- /dev/null
+++ b/ext/standard/tests/file/stream_get_line.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Crash inside stream_get_line(), when length=0
+--FILE--
+<?php
+$path = dirname(__FILE__) . '/test.html';
+
+file_put_contents($path, "foo<br>bar<br>foo");
+$fp = fopen($path, "r");
+while ($fp && !feof($fp)) {
+ echo stream_get_line($fp, 0, "<br>")."\n";
+}
+fclose($fp);
+@unlink($path);
+?>
+--EXPECT--
+foo
+bar
+foo
diff --git a/ext/standard/tests/filters/basic.phpt b/ext/standard/tests/filters/basic.phpt
index 702c1ddad..13a79e2cd 100644
--- a/ext/standard/tests/filters/basic.phpt
+++ b/ext/standard/tests/filters/basic.phpt
@@ -27,18 +27,18 @@ foreach ($filters as $filter) {
filter_test(array($filters[0], $filters[1]));
?>
---EXPECT--
+--EXPECTF--
filter: string.rot13
-bool(true)
+resource(%d) of type (stream filter)
string(12) "Uryyb Gurer!"
filter: string.toupper
-bool(true)
+resource(%d) of type (stream filter)
string(12) "HELLO THERE!"
filter: string.tolower
-bool(true)
+resource(%d) of type (stream filter)
string(12) "hello there!"
filter: string.rot13
-bool(true)
+resource(%d) of type (stream filter)
filter: string.toupper
-bool(true)
+resource(%d) of type (stream filter)
string(12) "URYYB GURER!"
diff --git a/ext/standard/tests/general_functions/bug29038.phpt b/ext/standard/tests/general_functions/bug29038.phpt
index 8804ffbaa..0f7922999 100644
--- a/ext/standard/tests/general_functions/bug29038.phpt
+++ b/ext/standard/tests/general_functions/bug29038.phpt
@@ -1,5 +1,5 @@
--TEST--
-bug #29038 (extract(), EXTR_PREFIX_SAME option prefixes empty strings)
+Bug #29038 (extract(), EXTR_PREFIX_SAME option prefixes empty strings)
--FILE--
<?php
function f1() {
@@ -71,4 +71,4 @@ Array
(
[prefix_111] => 1
[c] => 1
-) \ No newline at end of file
+)
diff --git a/ext/standard/tests/general_functions/bug31190.phpt b/ext/standard/tests/general_functions/bug31190.phpt
index 8fdf8eea7..7d154708f 100644
--- a/ext/standard/tests/general_functions/bug31190.phpt
+++ b/ext/standard/tests/general_functions/bug31190.phpt
@@ -1,5 +1,5 @@
--TEST--
-bug #31190 (exception in call_user_func_array())
+Bug #31190 (exception in call_user_func_array())
--FILE--
<?php
diff --git a/ext/standard/tests/general_functions/bug35229.phpt b/ext/standard/tests/general_functions/bug35229.phpt
new file mode 100755
index 000000000..bcd0ef548
--- /dev/null
+++ b/ext/standard/tests/general_functions/bug35229.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #35229 (call_user_func() crashes when arguement_stack is nearly full)
+--FILE--
+<?php
+class test2 {
+ static function use_stack() {
+ echo "OK\n";
+ }
+}
+
+function __autoload($class)
+{
+ eval('class test1 extends test2 {}');
+
+ test1::use_stack(
+ 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
+ );
+}
+
+call_user_func(array('test1', 'use_stack'),
+ 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
+);
+?>
+--EXPECT--
+OK
+OK
diff --git a/ext/standard/tests/general_functions/sunfuncts.phpt b/ext/standard/tests/general_functions/sunfuncts.phpt
index 3e528b59c..a9711ffc3 100644
--- a/ext/standard/tests/general_functions/sunfuncts.phpt
+++ b/ext/standard/tests/general_functions/sunfuncts.phpt
@@ -18,27 +18,27 @@ for($a=1;$a<=12;$a++){
}
?>
--EXPECT--
-1041293199 06:39 6.652455761896
-1041293806 16:46 16.76937486746
-1043971592 06:32 6.54537029266
-1043972233 17:13 17.21752470874
-1046390766 06:06 6.115652675685
-1046391456 17:36 17.6108549623
-1049069128 05:28 5.472742029069
-1049069878 17:58 17.97255258437
-1051661094 04:54 4.901229982859
-1051661898 18:18 18.31368876948
-1054339474 04:34 4.57442928945
-1054340319 18:39 18.65640094324
-1056931476 04:36 4.616120450519
-1056932328 18:48 18.80887165777
-1059609894 04:54 4.906882509836
-1059610715 18:35 18.59928600203
-1062288314 05:14 5.236889557074
-1062289083 18:03 18.06054178788
-1064880332 05:32 5.542366581139
-1064881044 17:24 17.41150561492
-1067558754 05:54 5.916208842058
-1067559410 16:50 16.83369857063
-1070150780 06:20 6.34622155207
-1070151395 16:35 16.58358905554
+1041316748 06:39 6.652455761896
+1041353169 16:46 16.76937486746
+1043994763 06:32 6.54537029266
+1044033183 17:13 17.21752470874
+1046412416 06:06 6.115652675685
+1046453799 17:36 17.6108549623
+1049088501 05:28 5.472742029069
+1049133501 17:58 17.97255258437
+1051678444 04:54 4.901229982859
+1051726729 18:18 18.31368876948
+1054355667 04:34 4.57442928945
+1054406363 18:39 18.65640094324
+1056947818 04:36 4.616120450519
+1056998911 18:48 18.80887165777
+1059627264 04:54 4.906882509836
+1059676557 18:35 18.59928600203
+1062306852 05:14 5.236889557074
+1062353017 18:03 18.06054178788
+1064899952 05:32 5.542366581139
+1064942681 17:24 17.41150561492
+1067579698 05:54 5.916208842058
+1067619001 16:50 16.83369857063
+1070173246 06:20 6.34622155207
+1070210100 16:35 16.58358905554
diff --git a/ext/standard/tests/math/bug25665.phpt b/ext/standard/tests/math/bug25665.phpt
index b7875db11..469236c94 100644
--- a/ext/standard/tests/math/bug25665.phpt
+++ b/ext/standard/tests/math/bug25665.phpt
@@ -1,5 +1,10 @@
--TEST--
Bug #25665 (var_dump () hangs on Nan and INF)
+--SKIPIF--
+<?php
+ $OS = strtoupper(PHP_OS);
+ if ($OS == 'SUNOS' || $OS == 'SOLARIS') die("SKIP Solaris acos() returns wrong value");
+?>
--FILE--
<?php
set_time_limit(5);
diff --git a/ext/standard/tests/math/bug30069.phpt b/ext/standard/tests/math/bug30069.phpt
new file mode 100755
index 000000000..5e3246c51
--- /dev/null
+++ b/ext/standard/tests/math/bug30069.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #30069 (floats as strings used in calculations do not work)
+--FILE--
+<?php
+echo ".1" * "2";
+echo "\n";
+echo "-.1" * "2";
+echo "\n";
+?>
+--EXPECT--
+0.2
+-0.2
diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt
new file mode 100755
index 000000000..d67f6fbf7
--- /dev/null
+++ b/ext/standard/tests/serialize/005.phpt
@@ -0,0 +1,186 @@
+--TEST--
+serialize()/unserialize() objects
+--SKIPIF--
+<?php if (!interface_exists('Serializable')) die('skip Interface Serialzable not defined'); ?>
+--FILE--
+<?php
+
+// This test verifies that old and new style (un)serializing do not interfere.
+
+function do_autoload($class_name)
+{
+ if ($class_name != 'autoload_not_available')
+ {
+ require_once(dirname(__FILE__) . '/' . strtolower($class_name) . '.p5c');
+ }
+ echo __FUNCTION__ . "($class_name)\n";
+}
+
+function unserializer($class_name)
+{
+ echo __METHOD__ . "($class_name)\n";
+ switch($class_name)
+ {
+ case 'TestNAOld':
+ eval("class TestNAOld extends TestOld {}");
+ break;
+ case 'TestNANew':
+ eval("class TestNANew extends TestNew {}");
+ break;
+ case 'TestNANew2':
+ eval("class TestNANew2 extends TestNew {}");
+ break;
+ default:
+ echo "Try __autoload()\n";
+ if (!function_exists('__autoload'))
+ {
+ eval('function __autoload($class_name) { do_autoload($class_name); }');
+ }
+ __autoload($class_name);
+ break;
+ }
+}
+
+ini_set('unserialize_callback_func', 'unserializer');
+
+class TestOld
+{
+ function serialize()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function unserialize($serialized)
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function __wakeup()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function __sleep()
+ {
+ echo __METHOD__ . "()\n";
+ return array();
+ }
+}
+
+class TestNew implements Serializable
+{
+ protected static $check = 0;
+
+ function serialize()
+ {
+ echo __METHOD__ . "()\n";
+ switch(++self::$check)
+ {
+ case 1:
+ return NULL;
+ case 2:
+ return "2";
+ }
+ }
+
+ function unserialize($serialized)
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function __wakeup()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ function __sleep()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+echo "===O1===\n";
+var_dump($ser = serialize(new TestOld));
+var_dump(unserialize($ser));
+
+echo "===N1===\n";
+var_dump($ser = serialize(new TestNew));
+var_dump(unserialize($ser));
+
+echo "===N2===\n";
+var_dump($ser = serialize(new TestNew));
+var_dump(unserialize($ser));
+
+echo "===NAOld===\n";
+var_dump(unserialize('O:9:"TestNAOld":0:{}'));
+
+echo "===NANew===\n";
+var_dump(unserialize('O:9:"TestNANew":0:{}'));
+
+echo "===NANew2===\n";
+var_dump(unserialize('C:10:"TestNANew2":0:{}'));
+
+echo "===AutoOld===\n";
+var_dump(unserialize('O:19:"autoload_implements":0:{}'));
+
+// Now we have __autoload(), that will be called before the old style header.
+// If the old style handler also fails to register the class then the object
+// becomes an incomplete class instance.
+
+echo "===AutoNA===\n";
+var_dump(unserialize('O:22:"autoload_not_available":0:{}'));
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===O1===
+TestOld::__sleep()
+string(18) "O:7:"TestOld":0:{}"
+TestOld::__wakeup()
+object(TestOld)#%d (0) {
+}
+===N1===
+TestNew::serialize()
+string(2) "N;"
+NULL
+===N2===
+TestNew::serialize()
+string(19) "C:7:"TestNew":1:{2}"
+TestNew::unserialize()
+object(TestNew)#%d (0) {
+}
+===NAOld===
+unserializer(TestNAOld)
+TestOld::__wakeup()
+object(TestNAOld)#%d (0) {
+}
+===NANew===
+unserializer(TestNANew)
+TestNew::__wakeup()
+object(TestNANew)#%d (0) {
+}
+===NANew2===
+unserializer(TestNANew2)
+TestNew::unserialize()
+object(TestNANew2)#%d (0) {
+}
+===AutoOld===
+unserializer(autoload_implements)
+Try __autoload()
+do_autoload(autoload_interface)
+do_autoload(autoload_implements)
+object(autoload_implements)#%d (0) {
+}
+===AutoNA===
+do_autoload(autoload_not_available)
+unserializer(autoload_not_available)
+Try __autoload()
+do_autoload(autoload_not_available)
+do_autoload(autoload_not_available)
+
+Warning: unserialize(): Function unserializer() hasn't defined the class it was called for in %s005.php on line %d
+object(__PHP_Incomplete_Class)#1 (1) {
+ ["__PHP_Incomplete_Class_Name"]=>
+ string(22) "autoload_not_available"
+}
+===DONE===
diff --git a/ext/standard/tests/serialize/006.phpt b/ext/standard/tests/serialize/006.phpt
new file mode 100644
index 000000000..fb813bc0d
--- /dev/null
+++ b/ext/standard/tests/serialize/006.phpt
@@ -0,0 +1,29 @@
+--TEST--
+serialize()/unserialize() with exotic letters
+--FILE--
+<?php
+ $åäöÅÄÖ = array('åäöÅÄÖ' => 'åäöÅÄÖ');
+
+ class ÜberKööliäå
+ {
+ public $åäöÅÄÖüÜber = 'åäöÅÄÖ';
+ }
+
+ $foo = new Überkööliäå();
+
+ var_dump(serialize($foo));
+ var_dump(unserialize(serialize($foo)));
+ var_dump(serialize($åäöÅÄÖ));
+ var_dump(unserialize(serialize($åäöÅÄÖ)));
+?>
+--EXPECT--
+string(55) "O:11:"ÜberKööliäå":1:{s:11:"åäöÅÄÖüÜber";s:6:"åäöÅÄÖ";}"
+object(ÜberKööliäå)#2 (1) {
+ ["åäöÅÄÖüÜber"]=>
+ string(6) "åäöÅÄÖ"
+}
+string(32) "a:1:{s:6:"åäöÅÄÖ";s:6:"åäöÅÄÖ";}"
+array(1) {
+ ["åäöÅÄÖ"]=>
+ string(6) "åäöÅÄÖ"
+}
diff --git a/ext/standard/tests/serialize/bug30234.phpt b/ext/standard/tests/serialize/bug30234.phpt
index 37fc8cde3..9b40cc54b 100755
--- a/ext/standard/tests/serialize/bug30234.phpt
+++ b/ext/standard/tests/serialize/bug30234.phpt
@@ -1,5 +1,5 @@
--TEST--
-#30234 (__autoload() not invoked for interfaces)
+Bug #30234 (__autoload() not invoked for interfaces)
--SKIPIF--
<?php
if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already');
diff --git a/ext/standard/tests/serialize/bug31402.phpt b/ext/standard/tests/serialize/bug31402.phpt
index 0fbb445d0..9db838d71 100644
--- a/ext/standard/tests/serialize/bug31402.phpt
+++ b/ext/standard/tests/serialize/bug31402.phpt
@@ -1,72 +1,87 @@
--TEST--
Bug #31402 (unserialize() generates references when it should not)
+--INI--
+error_reporting=E_ALL&~E_STRICT
--FILE--
<?php
-class X {
- public $i;
+class TestX {
+ var $i;
- function X($i) {
+ function __construct($i) {
$this->i = $i;
}
}
-class Y {
- public $A = array();
- public $B;
+class TestY {
+ var $A = array();
+ var $B;
- function Y() {
- $this->A[1] = new X(1);
- $this->A[2] = new X(2);
+ function __construct() {
+ $this->A[1] = new TestX(1);
+ $this->A[2] = & new TestX(2);
+ $this->A[3] = & $this->A[2];
$this->B = $this->A[1];
}
}
-$before = new Y();
+$before = new TestY();
$ser = serialize($before);
$after = unserialize($ser);
var_dump($before, $after);
?>
+===DONE===
--EXPECTF--
-object(Y)#%d (2) {
+object(TestY)#%d (2) {
["A"]=>
- array(2) {
+ array(3) {
[1]=>
- object(X)#%d (1) {
+ object(TestX)#%d (1) {
["i"]=>
int(1)
}
[2]=>
- object(X)#%d (1) {
+ &object(TestX)#%d (1) {
+ ["i"]=>
+ int(2)
+ }
+ [3]=>
+ &object(TestX)#%d (1) {
["i"]=>
int(2)
}
}
["B"]=>
- object(X)#%d (1) {
+ object(TestX)#%d (1) {
["i"]=>
int(1)
}
}
-object(Y)#%d (2) {
+object(TestY)#%d (2) {
["A"]=>
- array(2) {
+ array(3) {
[1]=>
- object(X)#%d (1) {
+ object(TestX)#%d (1) {
["i"]=>
int(1)
}
[2]=>
- object(X)#%d (1) {
+ &object(TestX)#%d (1) {
+ ["i"]=>
+ int(2)
+ }
+ [3]=>
+ &object(TestX)#%d (1) {
["i"]=>
int(2)
}
}
["B"]=>
- object(X)#%d (1) {
+ object(TestX)#%d (1) {
["i"]=>
int(1)
}
}
+===DONE===
diff --git a/ext/standard/tests/serialize/bug31442.phpt b/ext/standard/tests/serialize/bug31442.phpt
new file mode 100755
index 000000000..f508d6b98
--- /dev/null
+++ b/ext/standard/tests/serialize/bug31442.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #31442 (unserialize broken on 64-bit systems)
+--FILE--
+<?php
+echo unserialize(serialize(2147483648));
+?>
+--EXPECT--
+2147483648
diff --git a/ext/standard/tests/strings/bug34214.phpt b/ext/standard/tests/strings/bug34214.phpt
new file mode 100644
index 000000000..dc2eb4503
--- /dev/null
+++ b/ext/standard/tests/strings/bug34214.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #34214 (base64_decode() does not properly ignore whitespace)
+--FILE--
+<?php
+$txt = 'Zm9vYmFyIG
+ Zvb2Jhcg==';
+echo base64_decode($txt), "\n";
+?>
+--EXPECT--
+foobar foobar
diff --git a/ext/standard/tests/strings/explode.phpt b/ext/standard/tests/strings/explode.phpt
index 9f9b61d5b..1198a09a9 100644
--- a/ext/standard/tests/strings/explode.phpt
+++ b/ext/standard/tests/strings/explode.phpt
@@ -19,6 +19,14 @@ var_dump(@explode("somestring", "otherstring"));
var_dump(@explode("a", "aaaaaa"));
var_dump(@explode("==", str_repeat("-=".ord(0)."=-", 10)));
var_dump(@explode("=", str_repeat("-=".ord(0)."=-", 10)));
+//////////////////////////////////////
+var_dump(explode(":","a lazy dog:jumps:over:",-1));
+var_dump(explode(":","a lazy dog:jumps:over", -1));
+var_dump(explode(":","a lazy dog:jumps:over", -2));
+var_dump(explode(":","a lazy dog:jumps:over:",-4));
+var_dump(explode(":","a lazy dog:jumps:over:",-40000000000000));
+var_dump(explode(":^:","a lazy dog:^:jumps::over:^:",-1));
+var_dump(explode(":^:","a lazy dog:^:jumps::over:^:",-2));
?>
--EXPECTF--
26d4e18734cb2582df5055e2175223df
@@ -112,3 +120,35 @@ array(21) {
[20]=>
string(1) "-"
}
+array(3) {
+ [0]=>
+ string(10) "a lazy dog"
+ [1]=>
+ string(5) "jumps"
+ [2]=>
+ string(4) "over"
+}
+array(2) {
+ [0]=>
+ string(10) "a lazy dog"
+ [1]=>
+ string(5) "jumps"
+}
+array(1) {
+ [0]=>
+ string(10) "a lazy dog"
+}
+array(0) {
+}
+array(0) {
+}
+array(2) {
+ [0]=>
+ string(10) "a lazy dog"
+ [1]=>
+ string(11) "jumps::over"
+}
+array(1) {
+ [0]=>
+ string(10) "a lazy dog"
+}
diff --git a/ext/standard/tests/strings/str_word_count.phpt b/ext/standard/tests/strings/str_word_count.phpt
new file mode 100644
index 000000000..0c6c5ae56
--- /dev/null
+++ b/ext/standard/tests/strings/str_word_count.phpt
@@ -0,0 +1,228 @@
+--TEST--
+str_word_count()
+--FILE--
+<?php
+error_reporting(E_ALL);
+$str = "Hello friend, you're
+ looking good today!";
+$b =& $str;
+var_dump(str_word_count($str, 1));
+var_dump(str_word_count($str, 2));
+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, array()));
+var_dump(str_word_count($str, $b));
+var_dump($str);
+
+$str2 = "F0o B4r 1s bar foo";
+var_dump(str_word_count($str2, NULL, "04"));
+var_dump(str_word_count($str2, NULL, "01"));
+var_dump(str_word_count($str2, NULL, "014"));
+var_dump(str_word_count($str2, NULL, array()));
+var_dump(str_word_count($str2, NULL, new stdClass));
+var_dump(str_word_count($str2, NULL, ""));
+var_dump(str_word_count($str2, 1, "04"));
+var_dump(str_word_count($str2, 1, "01"));
+var_dump(str_word_count($str2, 1, "014"));
+var_dump(str_word_count($str2, 1, array()));
+var_dump(str_word_count($str2, 1, new stdClass));
+var_dump(str_word_count($str2, 1, ""));
+var_dump(str_word_count($str2, 2, "04"));
+var_dump(str_word_count($str2, 2, "01"));
+var_dump(str_word_count($str2, 2, "014"));
+var_dump(str_word_count($str2, 2, array()));
+var_dump(str_word_count($str2, 2, new stdClass));
+var_dump(str_word_count($str2, 2, ""));
+
+?>
+--EXPECTF--
+array(6) {
+ [0]=>
+ string(5) "Hello"
+ [1]=>
+ string(6) "friend"
+ [2]=>
+ string(6) "you're"
+ [3]=>
+ string(7) "looking"
+ [4]=>
+ string(4) "good"
+ [5]=>
+ string(5) "today"
+}
+array(6) {
+ [0]=>
+ string(5) "Hello"
+ [6]=>
+ string(6) "friend"
+ [14]=>
+ string(6) "you're"
+ [27]=>
+ string(7) "looking"
+ [44]=>
+ string(4) "good"
+ [49]=>
+ string(5) "today"
+}
+int(6)
+NULL
+NULL
+NULL
+NULL
+
+Warning: str_word_count() expects parameter 2 to be long, array given in %s on line 13
+
+Warning: Wrong parameter count for str_word_count() in %s on line 13
+NULL
+
+Warning: str_word_count() expects parameter 2 to be long, string given in %s on line 14
+
+Warning: Wrong parameter count for str_word_count() in %s on line 14
+NULL
+string(55) "Hello friend, you're
+ looking good today!"
+int(5)
+int(6)
+int(5)
+
+Warning: str_word_count() expects parameter 3 to be string, array given in %s on line 21
+
+Warning: Wrong parameter count for str_word_count() in %s on line 21
+NULL
+
+Warning: str_word_count() expects parameter 3 to be string, object given in %s on line 22
+
+Warning: Wrong parameter count for str_word_count() in %s on line 22
+NULL
+int(7)
+array(5) {
+ [0]=>
+ string(3) "F0o"
+ [1]=>
+ string(3) "B4r"
+ [2]=>
+ string(1) "s"
+ [3]=>
+ string(3) "bar"
+ [4]=>
+ string(3) "foo"
+}
+array(6) {
+ [0]=>
+ string(3) "F0o"
+ [1]=>
+ string(1) "B"
+ [2]=>
+ string(1) "r"
+ [3]=>
+ string(2) "1s"
+ [4]=>
+ string(3) "bar"
+ [5]=>
+ string(3) "foo"
+}
+array(5) {
+ [0]=>
+ string(3) "F0o"
+ [1]=>
+ string(3) "B4r"
+ [2]=>
+ string(2) "1s"
+ [3]=>
+ string(3) "bar"
+ [4]=>
+ string(3) "foo"
+}
+
+Warning: str_word_count() expects parameter 3 to be string, array given in %s on line 27
+
+Warning: Wrong parameter count for str_word_count() in %s on line 27
+NULL
+
+Warning: str_word_count() expects parameter 3 to be string, object given in %s on line 28
+
+Warning: Wrong parameter count for str_word_count() in %s on line 28
+NULL
+array(7) {
+ [0]=>
+ string(1) "F"
+ [1]=>
+ string(1) "o"
+ [2]=>
+ string(1) "B"
+ [3]=>
+ string(1) "r"
+ [4]=>
+ string(1) "s"
+ [5]=>
+ string(3) "bar"
+ [6]=>
+ string(3) "foo"
+}
+array(5) {
+ [0]=>
+ string(3) "F0o"
+ [4]=>
+ string(3) "B4r"
+ [9]=>
+ string(1) "s"
+ [11]=>
+ string(3) "bar"
+ [15]=>
+ string(3) "foo"
+}
+array(6) {
+ [0]=>
+ string(3) "F0o"
+ [4]=>
+ string(1) "B"
+ [6]=>
+ string(1) "r"
+ [8]=>
+ string(2) "1s"
+ [11]=>
+ string(3) "bar"
+ [15]=>
+ string(3) "foo"
+}
+array(5) {
+ [0]=>
+ string(3) "F0o"
+ [4]=>
+ string(3) "B4r"
+ [8]=>
+ string(2) "1s"
+ [11]=>
+ string(3) "bar"
+ [15]=>
+ string(3) "foo"
+}
+
+Warning: str_word_count() expects parameter 3 to be string, array given in %s on line 33
+
+Warning: Wrong parameter count for str_word_count() in %s on line 33
+NULL
+
+Warning: str_word_count() expects parameter 3 to be string, object given in %s on line 34
+
+Warning: Wrong parameter count for str_word_count() in %s on line 34
+NULL
+array(7) {
+ [0]=>
+ string(1) "F"
+ [2]=>
+ string(1) "o"
+ [4]=>
+ string(1) "B"
+ [6]=>
+ string(1) "r"
+ [9]=>
+ string(1) "s"
+ [11]=>
+ string(3) "bar"
+ [15]=>
+ string(3) "foo"
+} \ No newline at end of file
diff --git a/ext/standard/tests/strings/substr_count.phpt b/ext/standard/tests/strings/substr_count.phpt
index 636590bb7..6aee36534 100644
--- a/ext/standard/tests/strings/substr_count.phpt
+++ b/ext/standard/tests/strings/substr_count.phpt
@@ -13,6 +13,9 @@ substr_count() function
$a = str_repeat("abcacbabca", 100);
var_dump(@substr_count($a, "bca"));
+
+ var_dump(substr_count($a, "bca", 200));
+ var_dump(substr_count($a, "bca", 200, 50));
?>
--EXPECT--
bool(false)
@@ -22,3 +25,5 @@ int(0)
int(0)
int(100)
int(200)
+int(160)
+int(10)
diff --git a/ext/standard/tests/time/002-win32.phpt b/ext/standard/tests/time/002-win32.phpt
deleted file mode 100644
index 1d7ef5715..000000000
--- a/ext/standard/tests/time/002-win32.phpt
+++ /dev/null
@@ -1,66 +0,0 @@
---TEST--
-strtotime() function
---SKIPIF--
-<?php
-if (substr(PHP_OS, 0, 3) != 'WIN') {
- print 'skip test for win32 only';
-}
-if (!@putenv("TZ=GST-1GDT") || getenv("TZ") != 'GST-1GDT') {
- die("skip unable to change TZ enviroment variable\n");
-}
-?>
---FILE--
-<?php
- $dates = array (
- "1999-10-13",
- "Oct 13 1999",
- "2000-01-19",
- "Jan 19 2000",
- "2001-12-21",
- "Dec 21 2001",
- "2001-12-21 12:16",
- "Dec 21 2001 12:16",
- "2001-10-22 21:19:58",
- "2001-10-22 21:19:58-02",
- "2001-10-22 21:19:58-0213",
- "2001-10-22 21:19:58+02",
- "2001-10-22 21:19:58+0213"
- );
-
- putenv ("TZ=GMT");
- foreach ($dates as $date) {
- echo date("Y-m-d H:i:s\n", strtotime ($date));
- }
-
- putenv ("TZ=GST-1GDT");
- foreach ($dates as $date) {
- echo date("Y-m-d H:i:s\n", strtotime ($date));
- }
-?>
---EXPECT--
-1999-10-13 00:00:00
-1999-10-13 00:00:00
-2000-01-19 00:00:00
-2000-01-19 00:00:00
-2001-12-21 00:00:00
-2001-12-21 00:00:00
-2001-12-21 12:16:00
-2001-12-21 12:16:00
-2001-10-22 21:19:58
-2001-10-22 23:19:58
-2001-10-22 23:32:58
-2001-10-22 19:19:58
-2001-10-22 19:06:58
-1999-10-13 00:00:00
-1999-10-13 00:00:00
-2000-01-19 00:00:00
-2000-01-19 00:00:00
-2001-12-21 00:00:00
-2001-12-21 00:00:00
-2001-12-21 12:16:00
-2001-12-21 12:16:00
-2001-10-22 21:19:58
-2001-10-23 01:19:58
-2001-10-23 01:32:58
-2001-10-22 21:19:58
-2001-10-22 21:06:58
diff --git a/ext/standard/tests/time/bug26198.phpt b/ext/standard/tests/time/bug26198.phpt
deleted file mode 100644
index 318108da7..000000000
--- a/ext/standard/tests/time/bug26198.phpt
+++ /dev/null
@@ -1,10 +0,0 @@
---TEST--
-Bug #26198 (strtotime handling of "M Y" and "Y M" format)
---FILE--
-<?php
- echo date("F Y\n", strtotime("Oct 2001"));
- echo date("M Y\n", strtotime("2001 Oct"));
-?>
---EXPECT--
-October 2001
-Oct 2001
diff --git a/ext/standard/tests/time/idate.phpt b/ext/standard/tests/time/idate.phpt
index 485f9804a..efeef665f 100644
--- a/ext/standard/tests/time/idate.phpt
+++ b/ext/standard/tests/time/idate.phpt
@@ -6,7 +6,7 @@ putenv ("TZ=GMT0");
$tmp = "UYzymndjHGhgistwLBIW";
for($a = 0;$a < strlen($tmp); $a++){
- echo $tmp{$a}, ': ', idate($tmp{$a}, 1043324459)."\n";
+ echo $tmp[$a], ': ', idate($tmp[$a], 1043324459)."\n";
}
?>
--EXPECT--
diff --git a/ext/standard/type.c b/ext/standard/type.c
index a90ae5396..f91e3c07d 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: type.c,v 1.25.2.1 2005/05/25 10:58:26 stas Exp $ */
+/* $Id: type.c,v 1.30 2005/08/03 14:08:14 sniper Exp $ */
#include "php.h"
#include "php_incomplete_class.h"
@@ -44,10 +44,6 @@ PHP_FUNCTION(gettype)
RETVAL_STRING("integer", 1);
break;
- case IS_RESOURCE:
- RETVAL_STRING("resource", 1);
- break;
-
case IS_DOUBLE:
RETVAL_STRING("double", 1);
break;
@@ -75,6 +71,16 @@ PHP_FUNCTION(gettype)
*/
break;
+ case IS_RESOURCE:
+ {
+ char *type_name;
+ type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) TSRMLS_CC);
+ if (type_name) {
+ RETVAL_STRING("resource", 1);
+ break;
+ }
+ }
+
default:
RETVAL_STRING("unknown type", 1);
}
@@ -153,8 +159,7 @@ PHP_FUNCTION(intval)
WRONG_PARAM_COUNT;
}
- *return_value = **num;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*num, 1, 0);
convert_to_long_base(return_value, base);
}
/* }}} */
@@ -169,8 +174,7 @@ PHP_FUNCTION(floatval)
WRONG_PARAM_COUNT;
}
- *return_value = **num;
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*num, 1, 0);
convert_to_double(return_value);
}
/* }}} */
@@ -179,7 +183,7 @@ PHP_FUNCTION(floatval)
Get the string value of a variable */
PHP_FUNCTION(strval)
{
- pval **num;
+ zval **num, *tmp;
zval expr_copy;
int use_copy;
@@ -187,16 +191,12 @@ PHP_FUNCTION(strval)
WRONG_PARAM_COUNT;
}
- *return_value = **num;
-
- zend_make_printable_zval(return_value, &expr_copy, &use_copy);
+ zend_make_printable_zval(*num, &expr_copy, &use_copy);
if (use_copy) {
- *return_value = expr_copy;
- INIT_PZVAL(return_value);
- zval_copy_ctor(return_value);
- zval_dtor(&expr_copy);
+ tmp = &expr_copy;
+ RETVAL_ZVAL(tmp, 0, 0);
} else {
- zval_copy_ctor(return_value);
+ RETVAL_ZVAL(*num, 1, 0);
}
}
/* }}} */
diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c
index 46ed5d841..e89f280b8 100644
--- a/ext/standard/uniqid.c
+++ b/ext/standard/uniqid.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: uniqid.c,v 1.39 2004/01/08 08:17:34 andi Exp $ */
+/* $Id: uniqid.c,v 1.41.2.1 2005/10/19 13:41:44 iliaa Exp $ */
#include "php.h"
@@ -50,11 +50,10 @@ PHP_FUNCTION(uniqid)
zend_bool more_entropy = 0;
#endif
char *uniqid;
- int sec, usec, argc, prefix_len = 0;
+ int sec, usec, prefix_len = 0;
struct timeval tv;
- argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "|sb", &prefix, &prefix_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &prefix, &prefix_len,
&more_entropy)) {
return;
}
@@ -62,8 +61,8 @@ PHP_FUNCTION(uniqid)
#if HAVE_USLEEP && !defined(PHP_WIN32)
if (!more_entropy) {
#if defined(__CYGWIN__)
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "You must use 'more entropy' under CYGWIN.");
- return;
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must use 'more entropy' under CYGWIN.");
+ RETURN_FALSE;
#else
usleep(1);
#endif
diff --git a/ext/standard/uniqid.h b/ext/standard/uniqid.h
index 5be456d41..151258b0f 100644
--- a/ext/standard/uniqid.h
+++ b/ext/standard/uniqid.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: uniqid.h,v 1.12 2004/01/08 17:32:52 sniper Exp $ */
+/* $Id: uniqid.h,v 1.13 2005/08/03 14:08:14 sniper Exp $ */
#ifndef UNIQID_H
#define UNIQID_H
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 48848d7ce..c683ae0ec 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: url.c,v 1.81.2.5 2005/08/16 14:15:43 iliaa Exp $ */
+/* $Id: url.c,v 1.86.2.1 2005/08/16 14:20:41 iliaa Exp $ */
#include <stdlib.h>
#include <string.h>
diff --git a/ext/standard/url.h b/ext/standard/url.h
index f28bf7d48..b2b3b0c73 100644
--- a/ext/standard/url.h
+++ b/ext/standard/url.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: url.h,v 1.18.2.1 2004/09/20 05:14:35 iliaa Exp $ */
+/* $Id: url.h,v 1.20 2005/08/03 14:08:14 sniper Exp $ */
#ifndef URL_H
#define URL_H
diff --git a/ext/standard/url_scanner.c b/ext/standard/url_scanner.c
index 5ecab1e42..d21de76be 100644
--- a/ext/standard/url_scanner.c
+++ b/ext/standard/url_scanner.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: url_scanner.c,v 1.43 2004/01/08 08:17:35 andi Exp $ */
+/* $Id: url_scanner.c,v 1.44 2005/08/03 14:08:14 sniper Exp $ */
#include "php.h"
diff --git a/ext/standard/url_scanner.h b/ext/standard/url_scanner.h
index 65d0ade27..a2af7f65f 100644
--- a/ext/standard/url_scanner.h
+++ b/ext/standard/url_scanner.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Sascha Schumann <sascha@schumann.cx> |
+----------------------------------------------------------------------+
*/
-/* $Id: url_scanner.h,v 1.15 2004/01/08 17:32:52 sniper Exp $ */
+/* $Id: url_scanner.h,v 1.16 2005/08/03 14:08:14 sniper Exp $ */
#ifndef URI_SCANNER_H
#define URI_SCANNER_H
diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c
index 92c35479e..ad03646f4 100644
--- a/ext/standard/url_scanner_ex.c
+++ b/ext/standard/url_scanner_ex.c
@@ -1,9 +1,9 @@
-/* Generated by re2c 0.9.6 on Fri Apr 15 01:39:15 2005 */
+/* Generated by re2c 0.9.8 on Wed Jun 29 02:16:53 2005 */
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,6 +17,8 @@
+----------------------------------------------------------------------+
*/
+/* $Id: url_scanner_ex.c,v 1.95 2005/08/03 14:08:15 sniper Exp $ */
+
#include "php.h"
#ifdef HAVE_UNISTD_H
@@ -105,10 +107,7 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
q = (p = url->c) + url->len;
scan:
-
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
@@ -143,6 +142,9 @@ scan:
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
+
+{
+ YYCTYPE yych;
goto yy0;
++YYCURSOR;
yy0:
@@ -177,6 +179,7 @@ yy9: if(yybm[0+yych] & 128) {
yy10:
{ goto scan; }
}
+}
done:
@@ -344,10 +347,7 @@ state_plain_begin:
state_plain:
start = YYCURSOR;
-
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
@@ -382,6 +382,9 @@ state_plain:
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
+
+{
+ YYCTYPE yych;
goto yy11;
++YYCURSOR;
yy11:
@@ -406,14 +409,12 @@ yy16: if(yybm[0+yych] & 128) {
yy17:
{ passthru(STD_ARGS); goto state_plain; }
}
+}
state_tag:
start = YYCURSOR;
-
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -448,6 +449,9 @@ state_tag:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+{
+ YYCTYPE yych;
goto yy18;
++YYCURSOR;
yy18:
@@ -476,6 +480,7 @@ yy25: if(yybm[0+yych] & 128) {
}
goto yy21;
}
+}
state_next_arg_begin:
@@ -483,10 +488,7 @@ state_next_arg_begin:
state_next_arg:
start = YYCURSOR;
-
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 128, 128, 128, 0, 0, 0, 0,
@@ -521,6 +523,9 @@ state_next_arg:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+{
+ YYCTYPE yych;
goto yy26;
++YYCURSOR;
yy26:
@@ -571,14 +576,12 @@ yy37: if(yybm[0+yych] & 128) {
}
goto yy31;
}
+}
state_arg:
start = YYCURSOR;
-
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -613,6 +616,9 @@ state_arg:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+{
+ YYCTYPE yych;
goto yy38;
++YYCURSOR;
yy38:
@@ -641,14 +647,12 @@ yy45: if(yybm[0+yych] & 128) {
}
goto yy41;
}
+}
state_before_val:
start = YYCURSOR;
-
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -683,6 +687,10 @@ state_before_val:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
goto yy46;
++YYCURSOR;
yy46:
@@ -725,15 +733,13 @@ yy57: YYCURSOR = YYMARKER;
case 0: goto yy49;
}
}
+}
state_val:
start = YYCURSOR;
-
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
248, 248, 248, 248, 248, 248, 248, 248,
248, 160, 160, 248, 248, 248, 248, 248,
@@ -768,6 +774,10 @@ state_val:
248, 248, 248, 248, 248, 248, 248, 248,
248, 248, 248, 248, 248, 248, 248, 248,
};
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
goto yy58;
++YYCURSOR;
yy58:
@@ -879,6 +889,7 @@ yy82: ++YYCURSOR;
yych = *YYCURSOR;
goto yy79;
}
+}
stop:
diff --git a/ext/standard/url_scanner_ex.c.orig b/ext/standard/url_scanner_ex.c.orig
index 80d30531e..5678119de 100644
--- a/ext/standard/url_scanner_ex.c.orig
+++ b/ext/standard/url_scanner_ex.c.orig
@@ -1,10 +1,10 @@
-/* Generated by re2c 0.9.6 on Fri Apr 15 01:39:15 2005 */
-#line 1 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+/* Generated by re2c 0.9.8 on Wed Jun 29 02:16:53 2005 */
+#line 1 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,6 +18,8 @@
+----------------------------------------------------------------------+
*/
+/* $Id: url_scanner_ex.c,v 1.95 2005/08/03 14:08:15 sniper Exp $ */
+
#include "php.h"
#ifdef HAVE_UNISTD_H
@@ -89,7 +91,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals)
PHP_INI_END()
-#line 95 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 97 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
#define YYFILL(n) goto done
@@ -107,11 +109,7 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
q = (p = url->c) + url->len;
scan:
-
-#line 7 "<stdout>"
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
@@ -146,6 +144,10 @@ scan:
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
+
+#line 149 "<stdout>"
+{
+ YYCTYPE yych;
goto yy0;
++YYCURSOR;
yy0:
@@ -160,21 +162,21 @@ yy0:
yy2: ++YYCURSOR;
goto yy3;
yy3:
-#line 113 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 115 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ smart_str_append(dest, url); return; }
-#line 61 "<stdout>"
+#line 168 "<stdout>"
yy4: ++YYCURSOR;
goto yy5;
yy5:
-#line 114 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 116 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ sep = separator; goto scan; }
-#line 67 "<stdout>"
+#line 174 "<stdout>"
yy6: ++YYCURSOR;
goto yy7;
yy7:
-#line 115 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 117 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ bash = p - 1; goto done; }
-#line 73 "<stdout>"
+#line 180 "<stdout>"
yy8: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
@@ -184,11 +186,12 @@ yy9: if(yybm[0+yych] & 128) {
}
goto yy10;
yy10:
-#line 116 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 118 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ goto scan; }
-#line 86 "<stdout>"
+#line 192 "<stdout>"
}
-#line 117 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+}
+#line 119 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
done:
@@ -356,11 +359,7 @@ state_plain_begin:
state_plain:
start = YYCURSOR;
-
-#line 90 "<stdout>"
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
@@ -395,6 +394,10 @@ state_plain:
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
+
+#line 399 "<stdout>"
+{
+ YYCTYPE yych;
goto yy11;
++YYCURSOR;
yy11:
@@ -407,9 +410,9 @@ yy11:
yy13: ++YYCURSOR;
goto yy14;
yy14:
-#line 285 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 287 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
-#line 142 "<stdout>"
+#line 416 "<stdout>"
yy15: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
@@ -419,20 +422,17 @@ yy16: if(yybm[0+yych] & 128) {
}
goto yy17;
yy17:
-#line 286 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 288 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain; }
-#line 155 "<stdout>"
+#line 428 "<stdout>"
+}
}
-#line 287 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 289 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
state_tag:
start = YYCURSOR;
-
-#line 159 "<stdout>"
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -467,6 +467,10 @@ state_tag:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+#line 472 "<stdout>"
+{
+ YYCTYPE yych;
goto yy18;
++YYCURSOR;
yy18:
@@ -481,15 +485,15 @@ yy20: ++YYCURSOR;
yych = *YYCURSOR;
goto yy25;
yy21:
-#line 292 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 294 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
-#line 212 "<stdout>"
+#line 491 "<stdout>"
yy22: ++YYCURSOR;
goto yy23;
yy23:
-#line 293 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 295 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
-#line 218 "<stdout>"
+#line 497 "<stdout>"
yy24: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
@@ -499,7 +503,8 @@ yy25: if(yybm[0+yych] & 128) {
}
goto yy21;
}
-#line 294 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+}
+#line 296 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
state_next_arg_begin:
@@ -507,11 +512,7 @@ state_next_arg_begin:
state_next_arg:
start = YYCURSOR;
-
-#line 231 "<stdout>"
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 128, 128, 128, 0, 0, 0, 0,
@@ -546,6 +547,10 @@ state_next_arg:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+#line 552 "<stdout>"
+{
+ YYCTYPE yych;
goto yy26;
++YYCURSOR;
yy26:
@@ -573,28 +578,28 @@ yy26:
yy28: ++YYCURSOR;
goto yy29;
yy29:
-#line 302 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 304 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
-#line 298 "<stdout>"
+#line 584 "<stdout>"
yy30: ++YYCURSOR;
yych = *YYCURSOR;
goto yy37;
yy31:
-#line 303 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 305 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_next_arg; }
-#line 304 "<stdout>"
+#line 591 "<stdout>"
yy32: ++YYCURSOR;
goto yy33;
yy33:
-#line 304 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 306 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
-#line 310 "<stdout>"
+#line 597 "<stdout>"
yy34: ++YYCURSOR;
goto yy35;
yy35:
-#line 305 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 307 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
-#line 316 "<stdout>"
+#line 603 "<stdout>"
yy36: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
@@ -604,16 +609,13 @@ yy37: if(yybm[0+yych] & 128) {
}
goto yy31;
}
-#line 306 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+}
+#line 308 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
state_arg:
start = YYCURSOR;
-
-#line 329 "<stdout>"
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -648,6 +650,10 @@ state_arg:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+#line 655 "<stdout>"
+{
+ YYCTYPE yych;
goto yy38;
++YYCURSOR;
yy38:
@@ -662,15 +668,15 @@ yy40: ++YYCURSOR;
yych = *YYCURSOR;
goto yy45;
yy41:
-#line 311 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 313 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; }
-#line 382 "<stdout>"
+#line 674 "<stdout>"
yy42: ++YYCURSOR;
goto yy43;
yy43:
-#line 312 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 314 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; }
-#line 388 "<stdout>"
+#line 680 "<stdout>"
yy44: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
@@ -680,16 +686,13 @@ yy45: if(yybm[0+yych] & 128) {
}
goto yy41;
}
-#line 313 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+}
+#line 315 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
state_before_val:
start = YYCURSOR;
-
-#line 401 "<stdout>"
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -724,6 +727,11 @@ state_before_val:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+#line 732 "<stdout>"
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
goto yy46;
++YYCURSOR;
yy46:
@@ -738,16 +746,16 @@ yy48: yyaccept = 0;
if(yych == '=') goto yy53;
goto yy49;
yy49:
-#line 319 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 321 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ --YYCURSOR; goto state_next_arg_begin; }
-#line 455 "<stdout>"
+#line 752 "<stdout>"
yy50: ++YYCURSOR;
yych = *YYCURSOR;
goto yy54;
yy51:
-#line 318 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 320 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; }
-#line 461 "<stdout>"
+#line 759 "<stdout>"
yy52: yych = *++YYCURSOR;
goto yy49;
yy53: ++YYCURSOR;
@@ -770,17 +778,14 @@ yy57: YYCURSOR = YYMARKER;
case 0: goto yy49;
}
}
-#line 320 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+}
+#line 322 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
state_val:
start = YYCURSOR;
-
-#line 488 "<stdout>"
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
248, 248, 248, 248, 248, 248, 248, 248,
248, 160, 160, 248, 248, 248, 248, 248,
@@ -815,6 +820,11 @@ state_val:
248, 248, 248, 248, 248, 248, 248, 248,
248, 248, 248, 248, 248, 248, 248, 248,
};
+
+#line 825 "<stdout>"
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
goto yy58;
++YYCURSOR;
yy58:
@@ -842,9 +852,9 @@ yy60: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
goto yy77;
yy61:
-#line 328 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 330 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ handle_val(STD_ARGS, 0, '\0'); goto state_next_arg_begin; }
-#line 555 "<stdout>"
+#line 858 "<stdout>"
yy62: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
goto yy69;
@@ -853,9 +863,9 @@ yy63: yych = *++YYCURSOR;
yy64: ++YYCURSOR;
goto yy65;
yy65:
-#line 329 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 331 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_next_arg_begin; }
-#line 566 "<stdout>"
+#line 869 "<stdout>"
yy66: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
@@ -882,9 +892,9 @@ yy70: ++YYCURSOR;
}
goto yy71;
yy71:
-#line 327 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 329 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
-#line 595 "<stdout>"
+#line 898 "<stdout>"
yy72: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
@@ -918,9 +928,9 @@ yy78: ++YYCURSOR;
}
goto yy79;
yy79:
-#line 326 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+#line 328 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
{ handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
-#line 631 "<stdout>"
+#line 934 "<stdout>"
yy80: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
@@ -934,7 +944,8 @@ yy82: ++YYCURSOR;
yych = *YYCURSOR;
goto yy79;
}
-#line 330 "/usr/src/php/php_5_0/ext/standard/url_scanner_ex.re"
+}
+#line 332 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
stop:
diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h
index a5969fb4f..df5430714 100644
--- a/ext/standard/url_scanner_ex.h
+++ b/ext/standard/url_scanner_ex.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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,6 +16,8 @@
+----------------------------------------------------------------------+
*/
+/* $Id: url_scanner_ex.h,v 1.26 2005/08/03 14:08:15 sniper Exp $ */
+
#ifndef URL_SCANNER_EX_H
#define URL_SCANNER_EX_H
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index 5debff724..d1f02e321 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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,6 +16,8 @@
+----------------------------------------------------------------------+
*/
+/* $Id: url_scanner_ex.re,v 1.76 2005/08/03 14:08:15 sniper Exp $ */
+
#include "php.h"
#ifdef HAVE_UNISTD_H
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index ba7472724..6ea4a1ea9 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: user_filters.c,v 1.28.2.1 2005/06/09 08:19:18 dmitry Exp $ */
+/* $Id: user_filters.c,v 1.31 2005/08/03 14:08:15 sniper Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -116,7 +116,6 @@ static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
zval *obj = (zval*)thisfilter->abstract;
zval func_name;
zval *retval = NULL;
- zval **tmp;
if (obj == NULL) {
/* If there's no object associated then there's nothing to dispose of */
diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c
index 6556d156f..481a2da48 100644
--- a/ext/standard/uuencode.c
+++ b/ext/standard/uuencode.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: uuencode.c,v 1.3.2.1 2004/08/24 15:25:59 iliaa Exp $ */
+/* $Id: uuencode.c,v 1.5 2005/08/03 14:08:15 sniper Exp $ */
/*
* Portions of this code are based on Berkeley's uuencode/uudecode
diff --git a/ext/standard/var.c b/ext/standard/var.c
index b6459b15b..1e3297526 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.191.2.8 2005/06/28 09:17:19 stas Exp $ */
+/* $Id: var.c,v 1.203.2.4 2005/10/17 14:38:09 derick Exp $ */
@@ -76,7 +76,7 @@ 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(hash_key->arKey, &class_name, &prop_name);
+ zend_unmangle_property_name_ex(hash_key->arKey, hash_key->nKeyLength, &class_name, &prop_name);
if (class_name) {
php_printf("%*c[\"%s", level + 1, ' ', prop_name);
if (class_name[0]=='*') {
@@ -252,10 +252,18 @@ PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC)
break;
case IS_ARRAY:
myht = Z_ARRVAL_PP(struc);
+ if (myht->nApplyCount > 1) {
+ PUTS("*RECURSION*\n");
+ return;
+ }
php_printf("%sarray(%d) refcount(%u){\n", COMMON, zend_hash_num_elements(myht), Z_REFCOUNT_PP(struc));
goto head_done;
case IS_OBJECT:
myht = Z_OBJPROP_PP(struc);
+ if (myht && myht->nApplyCount > 1) {
+ PUTS("*RECURSION*\n");
+ return;
+ }
ce = Z_OBJCE(**struc);
Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC);
php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0, Z_REFCOUNT_PP(struc));
@@ -343,19 +351,10 @@ 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(hash_key->arKey, &class_name, &prop_name);
- if (class_name) {
- if (class_name[0] == '*') {
- php_printf("protected");
- } else {
- php_printf("private");
- }
- } else {
- php_printf("public");
- }
- php_printf(" $%s = ", prop_name);
+ zend_unmangle_property_name_ex(hash_key->arKey, hash_key->nKeyLength, &class_name, &prop_name);
+ php_printf(" '%s' => ", prop_name);
php_var_export(zv, level + 2 TSRMLS_CC);
- PUTS (";\n");
+ PUTS (",\n");
}
return 0;
}
@@ -406,7 +405,7 @@ PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC)
php_printf("\n%*c", level - 1, ' ');
}
Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC);
- php_printf ("class %s {\n", class_name);
+ php_printf ("%s::__set_state(array(\n", class_name);
efree(class_name);
if (myht) {
zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_object_element_export, 1, level);
@@ -414,7 +413,7 @@ PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC)
if (level > 1) {
php_printf("%*c", level - 1, ' ');
}
- PUTS("}");
+ php_printf ("))");
break;
default:
PUTS ("NULL");
@@ -464,7 +463,7 @@ static inline int php_add_var_hash(HashTable *var_hash, zval *var, void *var_old
/* relies on "(long)" being a perfect hash function for data pointers,
however the actual identity of an object has had to be determined
by its object handle and the class entry since 5.0. */
- if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry != NULL) {
+ if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) {
p = smart_str_print_long(id + sizeof(id) - 1,
(((unsigned long)Z_OBJCE_P(var) << 5)
| ((unsigned long)Z_OBJCE_P(var) >> (sizeof(long) * 8 - 5)))
@@ -671,15 +670,45 @@ static void php_var_serialize_intern(smart_str *buf, zval **struc, HashTable *va
zval *retval_ptr = NULL;
zval fname;
int res;
-
- if (Z_OBJ_HT_PP(struc)->get_class_entry && Z_OBJCE_PP(struc) != PHP_IC_ENTRY &&
- zend_hash_exists(&Z_OBJCE_PP(struc)->function_table, "__sleep", sizeof("__sleep"))) {
+ zend_class_entry *ce = NULL;
+
+ if(Z_OBJ_HT_PP(struc)->get_class_entry) {
+ ce = Z_OBJCE_PP(struc);
+ }
+
+ if(ce && ce->serialize != NULL) {
+ /* has custom handler */
+ unsigned char *serialized_data = NULL;
+ zend_uint serialized_length;
+
+ if(ce->serialize(*struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) {
+ smart_str_appendl(buf, "C:", 2);
+ smart_str_append_long(buf, Z_OBJCE_PP(struc)->name_length);
+ smart_str_appendl(buf, ":\"", 2);
+ smart_str_appendl(buf, Z_OBJCE_PP(struc)->name, Z_OBJCE_PP(struc)->name_length);
+ smart_str_appendl(buf, "\":", 2);
+
+ smart_str_append_long(buf, serialized_length);
+ smart_str_appendl(buf, ":{", 2);
+ smart_str_appendl(buf, serialized_data, serialized_length);
+ smart_str_appendc(buf, '}');
+ } else {
+ smart_str_appendl(buf, "N;", 2);
+ }
+ if(serialized_data) {
+ efree(serialized_data);
+ }
+ return;
+ }
+
+ if (ce && ce != PHP_IC_ENTRY &&
+ zend_hash_exists(&ce->function_table, "__sleep", sizeof("__sleep"))) {
INIT_PZVAL(&fname);
ZVAL_STRINGL(&fname, "__sleep", sizeof("__sleep") - 1, 0);
res = call_user_function_ex(CG(function_table), struc, &fname,
&retval_ptr, 0, 0, 1, NULL TSRMLS_CC);
- if (res == SUCCESS) {
+ if (res == SUCCESS && !EG(exception)) {
if (retval_ptr) {
if (HASH_OF(retval_ptr)) {
php_var_serialize_class(buf, struc, retval_ptr,
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index e45f24aef..11f650f7e 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -1,9 +1,9 @@
-/* Generated by re2c 0.9.6 on Fri Apr 15 01:39:24 2005 */
+/* Generated by re2c 0.9.10 on Mon Sep 5 19:22:38 2005 */
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var_unserializer.c,v 1.38.2.15 2005/06/01 10:53:25 dmitry Exp $ */
+/* $Id: var_unserializer.c,v 1.70.2.1 2005/09/05 16:22:58 sniper Exp $ */
#include "php.h"
#include "ext/standard/php_var.h"
@@ -88,7 +88,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **n
for (i = 0; i < var_hash->used_slots; i++) {
if (var_hash->data[i] == ozval) {
var_hash->data[i] = *nzval;
- return;
+ /* do not break here */
}
}
var_hash = var_hash->next;
@@ -124,7 +124,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
efree(var_hash);
var_hash = next;
}
-
+
var_hash = var_hashx->first_dtor;
while (var_hash) {
@@ -275,10 +275,37 @@ static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
return 0;
}
-static inline int object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
+static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
{
- long elements;
+ long datalen;
+
+ if(ce->unserialize == NULL) {
+ zend_error(E_WARNING, "Class %s has no unserializer", ce->name);
+ return 0;
+ }
+
+ datalen = parse_iv2((*p) + 2, p);
+
+ (*p) += 2;
+
+ if(datalen < 0 || (*p) + datalen >= max) {
+ zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %d present", datalen, max - (*p));
+ return 0;
+ }
+
+ if(ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+ return 0;
+ }
+
+ (*p) += datalen;
+
+ return finish_nested_data(UNSERIALIZE_PASSTHRU);
+}
+static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
+{
+ long elements;
+
elements = parse_iv2((*p) + 2, p);
(*p) += 2;
@@ -325,10 +352,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
-
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -363,118 +387,95 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
goto yy0;
++YYCURSOR;
yy0:
if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
yych = *YYCURSOR;
- if(yych <= 'd'){
- if(yych <= 'R'){
- if(yych <= 'N'){
- if(yych <= 'M') goto yy16;
- goto yy6;
- } else {
- if(yych <= 'O') goto yy13;
- if(yych <= 'Q') goto yy16;
- goto yy3;
- }
- } else {
- if(yych <= 'a'){
- if(yych <= '`') goto yy16;
- goto yy11;
- } else {
- if(yych <= 'b') goto yy7;
- if(yych <= 'c') goto yy16;
- goto yy9;
- }
- }
- } else {
- if(yych <= 'q'){
- if(yych <= 'i'){
- if(yych <= 'h') goto yy16;
- goto yy8;
- } else {
- if(yych == 'o') goto yy12;
- goto yy16;
- }
- } else {
- if(yych <= '|'){
- if(yych <= 'r') goto yy5;
- if(yych <= 's') goto yy10;
- goto yy16;
- } else {
- if(yych <= '}') goto yy14;
- if(yych <= 0xBF) goto yy16;
- goto yy2;
- }
- }
+ switch(yych){
+ case 'C': case 'O': goto yy12;
+ case 'N': goto yy5;
+ case 'R': goto yy2;
+ case 'a': goto yy10;
+ case 'b': goto yy6;
+ case 'd': goto yy8;
+ case 'i': goto yy7;
+ case 'o': goto yy11;
+ case 'r': goto yy4;
+ case 's': goto yy9;
+ case '}': goto yy13;
+ default: goto yy15;
}
-yy2: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy4;
- }
-yy3: yyaccept = 0;
+yy2: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy87;
- goto yy4;
-yy4:
+ goto yy3;
+yy3:
{ return 0; }
-yy5: yyaccept = 0;
+yy4: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy81;
- goto yy4;
-yy6: yych = *++YYCURSOR;
+ goto yy3;
+yy5: yych = *++YYCURSOR;
if(yych == ';') goto yy79;
- goto yy4;
-yy7: yyaccept = 0;
+ goto yy3;
+yy6: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy75;
- goto yy4;
-yy8: yyaccept = 0;
+ goto yy3;
+yy7: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy69;
- goto yy4;
-yy9: yyaccept = 0;
+ goto yy3;
+yy8: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy45;
- goto yy4;
-yy10: yyaccept = 0;
+ goto yy3;
+yy9: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy38;
- goto yy4;
-yy11: yyaccept = 0;
+ goto yy3;
+yy10: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy31;
- goto yy4;
-yy12: yyaccept = 0;
+ goto yy3;
+yy11: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy24;
- goto yy4;
-yy13: yyaccept = 0;
+ goto yy3;
+yy12: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == ':') goto yy17;
- goto yy4;
-yy14: ++YYCURSOR;
- goto yy15;
-yy15:
+ if(yych == ':') goto yy16;
+ goto yy3;
+yy13: ++YYCURSOR;
+ goto yy14;
+yy14:
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
+yy15: yych = *++YYCURSOR;
+ goto yy3;
yy16: yych = *++YYCURSOR;
- goto yy4;
-yy17: yych = *++YYCURSOR;
if(yybm[0+yych] & 128) {
goto yy19;
}
- if(yych != '+') goto yy2;
- goto yy18;
+ if(yych == '+') goto yy18;
+ goto yy17;
+yy17: YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 0: goto yy3;
+ }
yy18: yych = *++YYCURSOR;
if(yybm[0+yych] & 128) {
goto yy19;
}
- goto yy2;
+ goto yy17;
yy19: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
@@ -482,10 +483,10 @@ yy19: ++YYCURSOR;
yy20: if(yybm[0+yych] & 128) {
goto yy19;
}
- if(yych != ':') goto yy2;
+ if(yych != ':') goto yy17;
goto yy21;
yy21: yych = *++YYCURSOR;
- if(yych != '"') goto yy2;
+ if(yych != '"') goto yy17;
goto yy22;
yy22: ++YYCURSOR;
goto yy23;
@@ -497,11 +498,17 @@ yy23:
zend_class_entry *ce;
zend_class_entry **pce;
int incomplete_class = 0;
-
+
+ int custom_object = 0;
+
zval *user_func;
zval *retval_ptr;
zval **args[1];
zval *arg_func_name;
+
+ if(*start == 'C') {
+ custom_object = 1;
+ }
INIT_PZVAL(*rval);
len2 = len = parse_uiv(start + 2);
@@ -524,7 +531,7 @@ yy23:
return 0;
}
- len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377");
if (len3 != len)
{
*p = YYCURSOR + len3 - len;
@@ -578,8 +585,14 @@ yy23:
zval_ptr_dtor(&arg_func_name);
break;
} while (1);
-
+
*p = YYCURSOR;
+
+ if(custom_object) {
+ efree(class_name);
+ return object_custom(UNSERIALIZE_PASSTHRU, ce);
+ }
+
elements = object_common1(UNSERIALIZE_PASSTHRU, ce);
if (incomplete_class) {
@@ -591,28 +604,28 @@ yy23:
}
yy24: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy25;
} else {
if(yych <= '-') goto yy25;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy26;
- goto yy2;
+ goto yy17;
}
yy25: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy26;
yy26: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
goto yy27;
-yy27: if(yych <= '/') goto yy2;
+yy27: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy26;
- if(yych >= ';') goto yy2;
+ if(yych >= ';') goto yy17;
goto yy28;
yy28: yych = *++YYCURSOR;
- if(yych != '"') goto yy2;
+ if(yych != '"') goto yy17;
goto yy29;
yy29: ++YYCURSOR;
goto yy30;
@@ -626,23 +639,23 @@ yy30:
}
yy31: yych = *++YYCURSOR;
if(yych == '+') goto yy32;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy33;
- goto yy2;
+ goto yy17;
yy32: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy33;
yy33: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
goto yy34;
-yy34: if(yych <= '/') goto yy2;
+yy34: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy33;
- if(yych >= ';') goto yy2;
+ if(yych >= ';') goto yy17;
goto yy35;
yy35: yych = *++YYCURSOR;
- if(yych != '{') goto yy2;
+ if(yych != '{') goto yy17;
goto yy36;
yy36: ++YYCURSOR;
goto yy37;
@@ -656,10 +669,6 @@ yy37:
return 0;
}
- if (elements < 0) {
- return 0;
- }
-
INIT_PZVAL(*rval);
Z_TYPE_PP(rval) = IS_ARRAY;
ALLOC_HASHTABLE(Z_ARRVAL_PP(rval));
@@ -674,23 +683,23 @@ yy37:
}
yy38: yych = *++YYCURSOR;
if(yych == '+') goto yy39;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy40;
- goto yy2;
+ goto yy17;
yy39: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy40;
yy40: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
goto yy41;
-yy41: if(yych <= '/') goto yy2;
+yy41: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy40;
- if(yych >= ';') goto yy2;
+ if(yych >= ';') goto yy17;
goto yy42;
yy42: yych = *++YYCURSOR;
- if(yych != '"') goto yy2;
+ if(yych != '"') goto yy17;
goto yy43;
yy43: ++YYCURSOR;
goto yy44;
@@ -726,41 +735,41 @@ yy45: yych = *++YYCURSOR;
if(yych <= '/'){
if(yych <= ','){
if(yych == '+') goto yy49;
- goto yy2;
+ goto yy17;
} else {
if(yych <= '-') goto yy47;
if(yych <= '.') goto yy52;
- goto yy2;
+ goto yy17;
}
} else {
if(yych <= 'I'){
if(yych <= '9') goto yy50;
- if(yych <= 'H') goto yy2;
+ if(yych <= 'H') goto yy17;
goto yy48;
} else {
- if(yych != 'N') goto yy2;
+ if(yych != 'N') goto yy17;
goto yy46;
}
}
yy46: yych = *++YYCURSOR;
if(yych == 'A') goto yy68;
- goto yy2;
+ goto yy17;
yy47: yych = *++YYCURSOR;
if(yych <= '/'){
if(yych == '.') goto yy52;
- goto yy2;
+ goto yy17;
} else {
if(yych <= '9') goto yy50;
- if(yych != 'I') goto yy2;
+ if(yych != 'I') goto yy17;
goto yy48;
}
yy48: yych = *++YYCURSOR;
if(yych == 'N') goto yy64;
- goto yy2;
+ goto yy17;
yy49: yych = *++YYCURSOR;
if(yych == '.') goto yy52;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy50;
yy50: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
@@ -768,43 +777,43 @@ yy50: ++YYCURSOR;
goto yy51;
yy51: if(yych <= ':'){
if(yych <= '.'){
- if(yych <= '-') goto yy2;
+ if(yych <= '-') goto yy17;
goto yy62;
} else {
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy50;
- goto yy2;
+ goto yy17;
}
} else {
if(yych <= 'E'){
if(yych <= ';') goto yy55;
- if(yych <= 'D') goto yy2;
+ if(yych <= 'D') goto yy17;
goto yy57;
} else {
if(yych == 'e') goto yy57;
- goto yy2;
+ goto yy17;
}
}
yy52: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy53;
yy53: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
goto yy54;
yy54: if(yych <= ';'){
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy53;
- if(yych <= ':') goto yy2;
+ if(yych <= ':') goto yy17;
goto yy55;
} else {
if(yych <= 'E'){
- if(yych <= 'D') goto yy2;
+ if(yych <= 'D') goto yy17;
goto yy57;
} else {
if(yych == 'e') goto yy57;
- goto yy2;
+ goto yy17;
}
}
yy55: ++YYCURSOR;
@@ -818,59 +827,59 @@ yy56:
}
yy57: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy58;
} else {
if(yych <= '-') goto yy58;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy59;
- goto yy2;
+ goto yy17;
}
yy58: yych = *++YYCURSOR;
if(yych <= ','){
if(yych == '+') goto yy61;
- goto yy2;
+ goto yy17;
} else {
if(yych <= '-') goto yy61;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy59;
}
yy59: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy60;
-yy60: if(yych <= '/') goto yy2;
+yy60: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy59;
if(yych == ';') goto yy55;
- goto yy2;
+ goto yy17;
yy61: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy59;
- goto yy2;
+ goto yy17;
yy62: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
goto yy63;
yy63: if(yych <= ';'){
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy62;
- if(yych <= ':') goto yy2;
+ if(yych <= ':') goto yy17;
goto yy55;
} else {
if(yych <= 'E'){
- if(yych <= 'D') goto yy2;
+ if(yych <= 'D') goto yy17;
goto yy57;
} else {
if(yych == 'e') goto yy57;
- goto yy2;
+ goto yy17;
}
}
yy64: yych = *++YYCURSOR;
- if(yych != 'F') goto yy2;
+ if(yych != 'F') goto yy17;
goto yy65;
yy65: yych = *++YYCURSOR;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy66;
yy66: ++YYCURSOR;
goto yy67;
@@ -891,28 +900,28 @@ yy67:
}
yy68: yych = *++YYCURSOR;
if(yych == 'N') goto yy65;
- goto yy2;
+ goto yy17;
yy69: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy70;
} else {
if(yych <= '-') goto yy70;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy71;
- goto yy2;
+ goto yy17;
}
yy70: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy71;
yy71: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy72;
-yy72: if(yych <= '/') goto yy2;
+yy72: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy71;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy73;
yy73: ++YYCURSOR;
goto yy74;
@@ -924,11 +933,11 @@ yy74:
return 1;
}
yy75: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= '2') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= '2') goto yy17;
goto yy76;
yy76: yych = *++YYCURSOR;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy77;
yy77: ++YYCURSOR;
goto yy78;
@@ -950,25 +959,25 @@ yy80:
}
yy81: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy82;
} else {
if(yych <= '-') goto yy82;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy83;
- goto yy2;
+ goto yy17;
}
yy82: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy83;
yy83: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy84;
-yy84: if(yych <= '/') goto yy2;
+yy84: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy83;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy85;
yy85: ++YYCURSOR;
goto yy86;
@@ -983,7 +992,7 @@ yy86:
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
return 0;
}
-
+
if (*rval == *rval_ref) return 0;
if (*rval != NULL) {
@@ -997,25 +1006,25 @@ yy86:
}
yy87: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy88;
} else {
if(yych <= '-') goto yy88;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy89;
- goto yy2;
+ goto yy17;
}
yy88: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy89;
yy89: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy90;
-yy90: if(yych <= '/') goto yy2;
+yy90: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy89;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy91;
yy91: ++YYCURSOR;
goto yy92;
@@ -1041,6 +1050,7 @@ yy92:
return 1;
}
}
+}
return 0;
diff --git a/ext/standard/var_unserializer.c.orig b/ext/standard/var_unserializer.c.orig
index 678877067..97c5648ef 100644
--- a/ext/standard/var_unserializer.c.orig
+++ b/ext/standard/var_unserializer.c.orig
@@ -1,10 +1,10 @@
-/* Generated by re2c 0.9.6 on Fri Apr 15 01:39:24 2005 */
-#line 1 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+/* Generated by re2c 0.9.10 on Mon Sep 5 19:22:38 2005 */
+#line 1 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var_unserializer.c,v 1.38.2.15 2005/06/01 10:53:25 dmitry Exp $ */
+/* $Id: var_unserializer.c,v 1.70.2.1 2005/09/05 16:22:58 sniper Exp $ */
#include "php.h"
#include "ext/standard/php_var.h"
@@ -89,7 +89,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **n
for (i = 0; i < var_hash->used_slots; i++) {
if (var_hash->data[i] == ozval) {
var_hash->data[i] = *nzval;
- return;
+ /* do not break here */
}
}
var_hash = var_hash->next;
@@ -125,7 +125,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
efree(var_hash);
var_hash = next;
}
-
+
var_hash = var_hashx->first_dtor;
while (var_hash) {
@@ -147,7 +147,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
#define YYMARKER marker
-#line 154 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 155 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
@@ -277,10 +277,37 @@ static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
return 0;
}
-static inline int object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
+static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
{
- long elements;
+ long datalen;
+
+ if(ce->unserialize == NULL) {
+ zend_error(E_WARNING, "Class %s has no unserializer", ce->name);
+ return 0;
+ }
+
+ datalen = parse_iv2((*p) + 2, p);
+
+ (*p) += 2;
+
+ if(datalen < 0 || (*p) + datalen >= max) {
+ zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %d present", datalen, max - (*p));
+ return 0;
+ }
+
+ if(ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+ return 0;
+ }
+
+ (*p) += datalen;
+
+ return finish_nested_data(UNSERIALIZE_PASSTHRU);
+}
+static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
+{
+ long elements;
+
elements = parse_iv2((*p) + 2, p);
(*p) += 2;
@@ -327,11 +354,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
-
-#line 7 "<stdout>"
{
- YYCTYPE yych;
- unsigned int yyaccept;
static unsigned char yybm[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -366,122 +389,100 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
+#line 394 "<stdout>"
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
goto yy0;
++YYCURSOR;
yy0:
if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
yych = *YYCURSOR;
- if(yych <= 'd'){
- if(yych <= 'R'){
- if(yych <= 'N'){
- if(yych <= 'M') goto yy16;
- goto yy6;
- } else {
- if(yych <= 'O') goto yy13;
- if(yych <= 'Q') goto yy16;
- goto yy3;
- }
- } else {
- if(yych <= 'a'){
- if(yych <= '`') goto yy16;
- goto yy11;
- } else {
- if(yych <= 'b') goto yy7;
- if(yych <= 'c') goto yy16;
- goto yy9;
- }
- }
- } else {
- if(yych <= 'q'){
- if(yych <= 'i'){
- if(yych <= 'h') goto yy16;
- goto yy8;
- } else {
- if(yych == 'o') goto yy12;
- goto yy16;
- }
- } else {
- if(yych <= '|'){
- if(yych <= 'r') goto yy5;
- if(yych <= 's') goto yy10;
- goto yy16;
- } else {
- if(yych <= '}') goto yy14;
- if(yych <= 0xBF) goto yy16;
- goto yy2;
- }
- }
+ switch(yych){
+ case 'C': case 'O': goto yy12;
+ case 'N': goto yy5;
+ case 'R': goto yy2;
+ case 'a': goto yy10;
+ case 'b': goto yy6;
+ case 'd': goto yy8;
+ case 'i': goto yy7;
+ case 'o': goto yy11;
+ case 'r': goto yy4;
+ case 's': goto yy9;
+ case '}': goto yy13;
+ default: goto yy15;
}
-yy2: YYCURSOR = YYMARKER;
- switch(yyaccept){
- case 0: goto yy4;
- }
-yy3: yyaccept = 0;
+yy2: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy87;
- goto yy4;
-yy4:
-#line 589 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+ goto yy3;
+yy3:
+#line 626 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{ return 0; }
-#line 102 "<stdout>"
-yy5: yyaccept = 0;
+#line 424 "<stdout>"
+yy4: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy81;
- goto yy4;
-yy6: yych = *++YYCURSOR;
+ goto yy3;
+yy5: yych = *++YYCURSOR;
if(yych == ';') goto yy79;
- goto yy4;
-yy7: yyaccept = 0;
+ goto yy3;
+yy6: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy75;
- goto yy4;
-yy8: yyaccept = 0;
+ goto yy3;
+yy7: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy69;
- goto yy4;
-yy9: yyaccept = 0;
+ goto yy3;
+yy8: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy45;
- goto yy4;
-yy10: yyaccept = 0;
+ goto yy3;
+yy9: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy38;
- goto yy4;
-yy11: yyaccept = 0;
+ goto yy3;
+yy10: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy31;
- goto yy4;
-yy12: yyaccept = 0;
+ goto yy3;
+yy11: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == ':') goto yy24;
- goto yy4;
-yy13: yyaccept = 0;
+ goto yy3;
+yy12: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == ':') goto yy17;
- goto yy4;
-yy14: ++YYCURSOR;
- goto yy15;
-yy15:
-#line 583 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+ if(yych == ':') goto yy16;
+ goto yy3;
+yy13: ++YYCURSOR;
+ goto yy14;
+yy14:
+#line 620 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
-#line 147 "<stdout>"
+#line 469 "<stdout>"
+yy15: yych = *++YYCURSOR;
+ goto yy3;
yy16: yych = *++YYCURSOR;
- goto yy4;
-yy17: yych = *++YYCURSOR;
if(yybm[0+yych] & 128) {
goto yy19;
}
- if(yych != '+') goto yy2;
- goto yy18;
+ if(yych == '+') goto yy18;
+ goto yy17;
+yy17: YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 0: goto yy3;
+ }
yy18: yych = *++YYCURSOR;
if(yybm[0+yych] & 128) {
goto yy19;
}
- goto yy2;
+ goto yy17;
yy19: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
@@ -489,15 +490,15 @@ yy19: ++YYCURSOR;
yy20: if(yybm[0+yych] & 128) {
goto yy19;
}
- if(yych != ':') goto yy2;
+ if(yych != ':') goto yy17;
goto yy21;
yy21: yych = *++YYCURSOR;
- if(yych != '"') goto yy2;
+ if(yych != '"') goto yy17;
goto yy22;
yy22: ++YYCURSOR;
goto yy23;
yy23:
-#line 483 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 508 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
long elements;
@@ -505,11 +506,17 @@ yy23:
zend_class_entry *ce;
zend_class_entry **pce;
int incomplete_class = 0;
-
+
+ int custom_object = 0;
+
zval *user_func;
zval *retval_ptr;
zval **args[1];
zval *arg_func_name;
+
+ if(*start == 'C') {
+ custom_object = 1;
+ }
INIT_PZVAL(*rval);
len2 = len = parse_uiv(start + 2);
@@ -532,7 +539,7 @@ yy23:
return 0;
}
- len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377");
if (len3 != len)
{
*p = YYCURSOR + len3 - len;
@@ -586,8 +593,14 @@ yy23:
zval_ptr_dtor(&arg_func_name);
break;
} while (1);
-
+
*p = YYCURSOR;
+
+ if(custom_object) {
+ efree(class_name);
+ return object_custom(UNSERIALIZE_PASSTHRU, ce);
+ }
+
elements = object_common1(UNSERIALIZE_PASSTHRU, ce);
if (incomplete_class) {
@@ -597,36 +610,36 @@ yy23:
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 277 "<stdout>"
+#line 614 "<stdout>"
yy24: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy25;
} else {
if(yych <= '-') goto yy25;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy26;
- goto yy2;
+ goto yy17;
}
yy25: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy26;
yy26: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
goto yy27;
-yy27: if(yych <= '/') goto yy2;
+yy27: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy26;
- if(yych >= ';') goto yy2;
+ if(yych >= ';') goto yy17;
goto yy28;
yy28: yych = *++YYCURSOR;
- if(yych != '"') goto yy2;
+ if(yych != '"') goto yy17;
goto yy29;
yy29: ++YYCURSOR;
goto yy30;
yy30:
-#line 475 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 500 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
INIT_PZVAL(*rval);
@@ -634,31 +647,31 @@ yy30:
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-#line 315 "<stdout>"
+#line 651 "<stdout>"
yy31: yych = *++YYCURSOR;
if(yych == '+') goto yy32;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy33;
- goto yy2;
+ goto yy17;
yy32: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy33;
yy33: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
goto yy34;
-yy34: if(yych <= '/') goto yy2;
+yy34: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy33;
- if(yych >= ';') goto yy2;
+ if(yych >= ';') goto yy17;
goto yy35;
yy35: yych = *++YYCURSOR;
- if(yych != '{') goto yy2;
+ if(yych != '{') goto yy17;
goto yy36;
yy36: ++YYCURSOR;
goto yy37;
yy37:
-#line 449 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 478 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -668,10 +681,6 @@ yy37:
return 0;
}
- if (elements < 0) {
- return 0;
- }
-
INIT_PZVAL(*rval);
Z_TYPE_PP(rval) = IS_ARRAY;
ALLOC_HASHTABLE(Z_ARRVAL_PP(rval));
@@ -684,31 +693,31 @@ yy37:
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 366 "<stdout>"
+#line 697 "<stdout>"
yy38: yych = *++YYCURSOR;
if(yych == '+') goto yy39;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy40;
- goto yy2;
+ goto yy17;
yy39: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy40;
yy40: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
goto yy41;
-yy41: if(yych <= '/') goto yy2;
+yy41: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy40;
- if(yych >= ';') goto yy2;
+ if(yych >= ';') goto yy17;
goto yy42;
yy42: yych = *++YYCURSOR;
- if(yych != '"') goto yy2;
+ if(yych != '"') goto yy17;
goto yy43;
yy43: ++YYCURSOR;
goto yy44;
yy44:
-#line 421 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 450 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -736,46 +745,46 @@ yy44:
ZVAL_STRINGL(*rval, str, len, 1);
return 1;
}
-#line 419 "<stdout>"
+#line 749 "<stdout>"
yy45: yych = *++YYCURSOR;
if(yych <= '/'){
if(yych <= ','){
if(yych == '+') goto yy49;
- goto yy2;
+ goto yy17;
} else {
if(yych <= '-') goto yy47;
if(yych <= '.') goto yy52;
- goto yy2;
+ goto yy17;
}
} else {
if(yych <= 'I'){
if(yych <= '9') goto yy50;
- if(yych <= 'H') goto yy2;
+ if(yych <= 'H') goto yy17;
goto yy48;
} else {
- if(yych != 'N') goto yy2;
+ if(yych != 'N') goto yy17;
goto yy46;
}
}
yy46: yych = *++YYCURSOR;
if(yych == 'A') goto yy68;
- goto yy2;
+ goto yy17;
yy47: yych = *++YYCURSOR;
if(yych <= '/'){
if(yych == '.') goto yy52;
- goto yy2;
+ goto yy17;
} else {
if(yych <= '9') goto yy50;
- if(yych != 'I') goto yy2;
+ if(yych != 'I') goto yy17;
goto yy48;
}
yy48: yych = *++YYCURSOR;
if(yych == 'N') goto yy64;
- goto yy2;
+ goto yy17;
yy49: yych = *++YYCURSOR;
if(yych == '.') goto yy52;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy50;
yy50: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
@@ -783,116 +792,116 @@ yy50: ++YYCURSOR;
goto yy51;
yy51: if(yych <= ':'){
if(yych <= '.'){
- if(yych <= '-') goto yy2;
+ if(yych <= '-') goto yy17;
goto yy62;
} else {
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy50;
- goto yy2;
+ goto yy17;
}
} else {
if(yych <= 'E'){
if(yych <= ';') goto yy55;
- if(yych <= 'D') goto yy2;
+ if(yych <= 'D') goto yy17;
goto yy57;
} else {
if(yych == 'e') goto yy57;
- goto yy2;
+ goto yy17;
}
}
yy52: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy53;
yy53: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
goto yy54;
yy54: if(yych <= ';'){
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy53;
- if(yych <= ':') goto yy2;
+ if(yych <= ':') goto yy17;
goto yy55;
} else {
if(yych <= 'E'){
- if(yych <= 'D') goto yy2;
+ if(yych <= 'D') goto yy17;
goto yy57;
} else {
if(yych == 'e') goto yy57;
- goto yy2;
+ goto yy17;
}
}
yy55: ++YYCURSOR;
goto yy56;
yy56:
-#line 414 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 443 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 517 "<stdout>"
+#line 845 "<stdout>"
yy57: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy58;
} else {
if(yych <= '-') goto yy58;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy59;
- goto yy2;
+ goto yy17;
}
yy58: yych = *++YYCURSOR;
if(yych <= ','){
if(yych == '+') goto yy61;
- goto yy2;
+ goto yy17;
} else {
if(yych <= '-') goto yy61;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy59;
}
yy59: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy60;
-yy60: if(yych <= '/') goto yy2;
+yy60: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy59;
if(yych == ';') goto yy55;
- goto yy2;
+ goto yy17;
yy61: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy59;
- goto yy2;
+ goto yy17;
yy62: ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
goto yy63;
yy63: if(yych <= ';'){
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy62;
- if(yych <= ':') goto yy2;
+ if(yych <= ':') goto yy17;
goto yy55;
} else {
if(yych <= 'E'){
- if(yych <= 'D') goto yy2;
+ if(yych <= 'D') goto yy17;
goto yy57;
} else {
if(yych == 'e') goto yy57;
- goto yy2;
+ goto yy17;
}
}
yy64: yych = *++YYCURSOR;
- if(yych != 'F') goto yy2;
+ if(yych != 'F') goto yy17;
goto yy65;
yy65: yych = *++YYCURSOR;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy66;
yy66: ++YYCURSOR;
goto yy67;
yy67:
-#line 399 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 428 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -907,98 +916,98 @@ yy67:
return 1;
}
-#line 594 "<stdout>"
+#line 920 "<stdout>"
yy68: yych = *++YYCURSOR;
if(yych == 'N') goto yy65;
- goto yy2;
+ goto yy17;
yy69: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy70;
} else {
if(yych <= '-') goto yy70;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy71;
- goto yy2;
+ goto yy17;
}
yy70: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy71;
yy71: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy72;
-yy72: if(yych <= '/') goto yy2;
+yy72: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy71;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy73;
yy73: ++YYCURSOR;
goto yy74;
yy74:
-#line 392 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 421 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_LONG(*rval, parse_iv(start + 2));
return 1;
}
-#line 631 "<stdout>"
+#line 956 "<stdout>"
yy75: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= '2') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= '2') goto yy17;
goto yy76;
yy76: yych = *++YYCURSOR;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy77;
yy77: ++YYCURSOR;
goto yy78;
yy78:
-#line 385 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 414 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_BOOL(*rval, parse_iv(start + 2));
return 1;
}
-#line 649 "<stdout>"
+#line 974 "<stdout>"
yy79: ++YYCURSOR;
goto yy80;
yy80:
-#line 378 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 407 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_NULL(*rval);
return 1;
}
-#line 660 "<stdout>"
+#line 985 "<stdout>"
yy81: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy82;
} else {
if(yych <= '-') goto yy82;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy83;
- goto yy2;
+ goto yy17;
}
yy82: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy83;
yy83: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy84;
-yy84: if(yych <= '/') goto yy2;
+yy84: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy83;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy85;
yy85: ++YYCURSOR;
goto yy86;
yy86:
-#line 355 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 384 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
long id;
@@ -1009,7 +1018,7 @@ yy86:
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
return 0;
}
-
+
if (*rval == *rval_ref) return 0;
if (*rval != NULL) {
@@ -1021,33 +1030,33 @@ yy86:
return 1;
}
-#line 710 "<stdout>"
+#line 1034 "<stdout>"
yy87: yych = *++YYCURSOR;
if(yych <= ','){
- if(yych != '+') goto yy2;
+ if(yych != '+') goto yy17;
goto yy88;
} else {
if(yych <= '-') goto yy88;
- if(yych <= '/') goto yy2;
+ if(yych <= '/') goto yy17;
if(yych <= '9') goto yy89;
- goto yy2;
+ goto yy17;
}
yy88: yych = *++YYCURSOR;
- if(yych <= '/') goto yy2;
- if(yych >= ':') goto yy2;
+ if(yych <= '/') goto yy17;
+ if(yych >= ':') goto yy17;
goto yy89;
yy89: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy90;
-yy90: if(yych <= '/') goto yy2;
+yy90: if(yych <= '/') goto yy17;
if(yych <= '9') goto yy89;
- if(yych != ';') goto yy2;
+ if(yych != ';') goto yy17;
goto yy91;
yy91: ++YYCURSOR;
goto yy92;
yy92:
-#line 334 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 363 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
{
long id;
@@ -1068,9 +1077,10 @@ yy92:
return 1;
}
-#line 758 "<stdout>"
+#line 1081 "<stdout>"
+}
}
-#line 591 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 628 "/usr/src/php/php_5_1/ext/standard/var_unserializer.re"
return 0;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index a96972eeb..e6a90af7d 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: var_unserializer.re,v 1.27.2.13 2005/06/01 10:53:25 dmitry Exp $ */
+/* $Id: var_unserializer.re,v 1.52.2.1 2005/09/05 16:22:19 sniper Exp $ */
#include "php.h"
#include "ext/standard/php_var.h"
@@ -87,7 +87,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **n
for (i = 0; i < var_hash->used_slots; i++) {
if (var_hash->data[i] == ozval) {
var_hash->data[i] = *nzval;
- return;
+ /* do not break here */
}
}
var_hash = var_hash->next;
@@ -123,7 +123,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
efree(var_hash);
var_hash = next;
}
-
+
var_hash = var_hashx->first_dtor;
while (var_hash) {
@@ -150,7 +150,8 @@ uiv = [+]? [0-9]+;
iv = [+-]? [0-9]+;
nv = [+-]? ([0-9]* "." [0-9]+|[0-9]+ "." [0-9]*);
nvexp = (iv | nv) [eE] [+-]? iv;
-any = [\000-\277];
+any = [\000-\377];
+object = [OC];
*/
@@ -280,10 +281,37 @@ static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
return 0;
}
-static inline int object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
+static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
{
- long elements;
+ long datalen;
+
+ if(ce->unserialize == NULL) {
+ zend_error(E_WARNING, "Class %s has no unserializer", ce->name);
+ return 0;
+ }
+
+ datalen = parse_iv2((*p) + 2, p);
+
+ (*p) += 2;
+
+ if(datalen < 0 || (*p) + datalen >= max) {
+ zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %d present", datalen, max - (*p));
+ return 0;
+ }
+
+ if(ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+ return 0;
+ }
+
+ (*p) += datalen;
+
+ return finish_nested_data(UNSERIALIZE_PASSTHRU);
+}
+static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
+{
+ long elements;
+
elements = parse_iv2((*p) + 2, p);
(*p) += 2;
@@ -363,7 +391,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
return 0;
}
-
+
if (*rval == *rval_ref) return 0;
if (*rval != NULL) {
@@ -456,10 +484,6 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
return 0;
}
- if (elements < 0) {
- return 0;
- }
-
INIT_PZVAL(*rval);
Z_TYPE_PP(rval) = IS_ARRAY;
ALLOC_HASHTABLE(Z_ARRVAL_PP(rval));
@@ -481,18 +505,24 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-"O:" uiv ":" ["] {
+object ":" uiv ":" ["] {
size_t len, len2, len3, maxlen;
long elements;
char *class_name;
zend_class_entry *ce;
zend_class_entry **pce;
int incomplete_class = 0;
-
+
+ int custom_object = 0;
+
zval *user_func;
zval *retval_ptr;
zval **args[1];
zval *arg_func_name;
+
+ if(*start == 'C') {
+ custom_object = 1;
+ }
INIT_PZVAL(*rval);
len2 = len = parse_uiv(start + 2);
@@ -515,7 +545,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
return 0;
}
- len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377");
if (len3 != len)
{
*p = YYCURSOR + len3 - len;
@@ -569,8 +599,14 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
zval_ptr_dtor(&arg_func_name);
break;
} while (1);
-
+
*p = YYCURSOR;
+
+ if(custom_object) {
+ efree(class_name);
+ return object_custom(UNSERIALIZE_PASSTHRU, ce);
+ }
+
elements = object_common1(UNSERIALIZE_PASSTHRU, ce);
if (incomplete_class) {
diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c
index da6d82cfc..a322db10f 100644
--- a/ext/standard/versioning.c
+++ b/ext/standard/versioning.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: versioning.c,v 1.18 2004/01/08 08:17:35 andi Exp $ */
+/* $Id: versioning.c,v 1.19 2005/08/03 14:08:16 sniper Exp $ */
#include <stdio.h>
#include <sys/types.h>
diff --git a/ext/sybase/config.m4 b/ext/sybase/config.m4
index 30862e6f8..b8713c7d1 100644
--- a/ext/sybase/config.m4
+++ b/ext/sybase/config.m4
@@ -1,11 +1,10 @@
dnl
-dnl $Id: config.m4,v 1.10 2002/03/12 16:36:10 sas Exp $
+dnl $Id: config.m4,v 1.11.2.1 2005/08/31 22:28:46 sniper Exp $
dnl
PHP_ARG_WITH(sybase,for Sybase support,
[ --with-sybase[=DIR] Include Sybase-DB support. DIR is the Sybase home
- directory, defaults to /home/sybase.])
-
+ directory, defaults to /home/sybase])
if test "$PHP_SYBASE" != "no"; then
if test "$PHP_SYBASE" = "yes"; then
@@ -27,4 +26,6 @@ if test "$PHP_SYBASE" != "no"; then
[ AC_DEFINE(PHP_SYBASE_DBOPEN,tdsdbopen,[ ])
AC_DEFINE(DBMFIX,1,[ ]) ],
[ AC_DEFINE(PHP_SYBASE_DBOPEN,dbopen,[ ]) ])
+
+ PHP_SUBST(SYBASE_SHARED_LIBADD)
fi
diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c
index 5c15ac451..731d99e0f 100644
--- a/ext/sybase/php_sybase_db.c
+++ b/ext/sybase/php_sybase_db.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_sybase_db.c,v 1.62.2.1 2004/12/21 06:57:15 sniper Exp $ */
+/* $Id: php_sybase_db.c,v 1.66 2005/08/06 05:42:42 fmk Exp $ */
#ifdef HAVE_CONFIG_H
@@ -100,6 +100,8 @@ function_entry sybase_functions[] = {
PHP_FE(sybase_affected_rows, NULL)
PHP_FE(sybase_min_error_severity, NULL)
PHP_FE(sybase_min_message_severity, NULL)
+
+#if !defined(PHP_WIN32) && !defined(HAVE_MSSQL)
PHP_FALIAS(mssql_connect, sybase_connect, NULL)
PHP_FALIAS(mssql_pconnect, sybase_pconnect, NULL)
PHP_FALIAS(mssql_close, sybase_close, NULL)
@@ -119,6 +121,7 @@ function_entry sybase_functions[] = {
PHP_FALIAS(mssql_affected_rows, sybase_affected_rows, NULL)
PHP_FALIAS(mssql_min_error_severity, sybase_min_error_severity, NULL)
PHP_FALIAS(mssql_min_message_severity, sybase_min_message_severity, NULL)
+#endif
{NULL, NULL, NULL}
};
@@ -282,7 +285,7 @@ PHP_RINIT_FUNCTION(sybase)
php_sybase_module.default_link=-1;
php_sybase_module.num_links = php_sybase_module.num_persistent;
php_sybase_module.appname = estrndup("PHP " PHP_VERSION, sizeof("PHP " PHP_VERSION));
- php_sybase_module.server_message = empty_string;
+ php_sybase_module.server_message = STR_EMPTY_ALLOC();
php_sybase_module.min_error_severity = php_sybase_module.cfg_min_error_severity;
php_sybase_module.min_message_severity = php_sybase_module.cfg_min_message_severity;
return SUCCESS;
@@ -886,7 +889,7 @@ PHP_FUNCTION(sybase_query)
result->fields[i].max_length = dbcollen(sybase_ptr->link,i+1);
result->fields[i].column_source = estrdup(dbcolsource(sybase_ptr->link,i+1));
if (!result->fields[i].column_source) {
- result->fields[i].column_source = empty_string;
+ result->fields[i].column_source = STR_EMPTY_ALLOC();
}
Z_TYPE(result->fields[i]) = column_types[i];
/* set numeric flag */
diff --git a/ext/sybase/php_sybase_db.h b/ext/sybase/php_sybase_db.h
index ffbe66b0b..bfe6ebd36 100644
--- a/ext/sybase/php_sybase_db.h
+++ b/ext/sybase/php_sybase_db.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_sybase_db.h,v 1.11 2004/01/08 17:32:53 sniper Exp $ */
+/* $Id: php_sybase_db.h,v 1.12 2005/08/03 14:08:17 sniper Exp $ */
#ifndef PHP_SYBASE_DB_H
#define PHP_SYBASE_DB_H
diff --git a/ext/sybase_ct/config.m4 b/ext/sybase_ct/config.m4
index b5dc9dfac..ed2cf37c2 100644
--- a/ext/sybase_ct/config.m4
+++ b/ext/sybase_ct/config.m4
@@ -1,10 +1,10 @@
dnl
-dnl $Id: config.m4,v 1.14 2003/06/18 18:28:47 sniper Exp $
+dnl $Id: config.m4,v 1.15 2005/05/29 23:16:44 sniper Exp $
dnl
PHP_ARG_WITH(sybase-ct, for Sybase-CT support,
[ --with-sybase-ct[=DIR] Include Sybase-CT support. DIR is the Sybase home
- directory. Defaults to /home/sybase.])
+ directory. Defaults to /home/sybase])
if test "$PHP_SYBASE_CT" != "no"; then
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index 5d05194af..3e30cbf19 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_sybase_ct.c,v 1.97.2.1 2004/07/29 20:05:46 thekid Exp $ */
+/* $Id: php_sybase_ct.c,v 1.103.2.1 2005/08/18 13:34:41 sniper Exp $ */
#ifdef HAVE_CONFIG_H
@@ -62,6 +62,7 @@ function_entry sybase_functions[] = {
PHP_FE(sybase_set_message_handler, NULL)
PHP_FE(sybase_deadlock_retry_count, NULL)
+#if !defined(PHP_WIN32) && !defined(HAVE_MSSQL)
PHP_FALIAS(mssql_connect, sybase_connect, NULL)
PHP_FALIAS(mssql_pconnect, sybase_pconnect, NULL)
PHP_FALIAS(mssql_close, sybase_close, NULL)
@@ -85,6 +86,7 @@ function_entry sybase_functions[] = {
PHP_FALIAS(mssql_min_server_severity, sybase_min_server_severity, NULL)
PHP_FALIAS(mssql_set_message_handler, sybase_set_message_handler, NULL)
PHP_FALIAS(mssql_deadlock_retry_count, sybase_deadlock_retry_count, NULL)
+#endif
{NULL, NULL, NULL}
};
@@ -190,6 +192,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
}
+ ct_cmd_drop(sybase_ptr->cmd);
ct_con_drop(sybase_ptr->connection);
efree(sybase_ptr);
SybCtG(num_links)--;
@@ -349,7 +352,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("sybct.min_client_severity", "10", PHP_INI_ALL, OnUpdateLong, min_client_severity, zend_sybase_globals, sybase_globals)
STD_PHP_INI_ENTRY("sybct.login_timeout", "-1", PHP_INI_ALL, OnUpdateLong, login_timeout, zend_sybase_globals, sybase_globals)
STD_PHP_INI_ENTRY("sybct.hostname", NULL, PHP_INI_ALL, OnUpdateString, hostname, zend_sybase_globals, sybase_globals)
- STD_PHP_INI_ENTRY_EX("sybct.deadlock_retry_count", "-1", PHP_INI_ALL, OnUpdateLong, deadlock_retry_count, zend_sybase_globals, sybase_globals, display_link_numbers)
+ STD_PHP_INI_ENTRY_EX("sybct.deadlock_retry_count", "0", PHP_INI_ALL, OnUpdateLong, deadlock_retry_count, zend_sybase_globals, sybase_globals, display_link_numbers)
PHP_INI_END()
@@ -399,14 +402,6 @@ static void php_sybase_init_globals(zend_sybase_globals *sybase_globals)
}
}
- /* Set the packet size, which is also per context */
- if (cfg_get_long("sybct.packet_size", &opt)==SUCCESS) {
- CS_INT cs_packet_size = opt;
- if (ct_config(sybase_globals->context, CS_SET, CS_PACKETSIZE, &cs_packet_size, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the packet size");
- }
- }
-
sybase_globals->num_persistent=0;
sybase_globals->callback_name = NULL;
}
@@ -438,7 +433,7 @@ PHP_RINIT_FUNCTION(sybase)
SybCtG(default_link)=-1;
SybCtG(num_links) = SybCtG(num_persistent);
SybCtG(appname) = estrndup("PHP " PHP_VERSION, sizeof("PHP " PHP_VERSION));
- SybCtG(server_message) = empty_string;
+ SybCtG(server_message) = STR_EMPTY_ALLOC();
return SUCCESS;
}
@@ -473,6 +468,7 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
{
CS_LOCALE *tmp_locale;
TSRMLS_FETCH();
+ long packetsize;
/* set a CS_CONNECTION record */
if (ct_con_alloc(SybCtG(context), &sybase->connection)!=CS_SUCCEED) {
@@ -520,6 +516,12 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
}
}
}
+
+ if (cfg_get_long("sybct.packet_size", &packetsize) == SUCCESS) {
+ if (ct_con_props(sybase->connection, CS_SET, CS_PACKETSIZE, (CS_VOID *)&packetsize, CS_UNUSED, NULL) != CS_SUCCEED) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection packetsize.");
+ }
+ }
/* Set the login timeout. Actually, the login timeout is per context
* and not per connection, but we will update the context here to
@@ -1321,7 +1323,7 @@ static sybase_result * php_sybase_fetch_result_set (sybase_link *sybase_ptr, int
result->fields[i].name = estrdup(computed_buf);
j++;
}
- result->fields[i].column_source = empty_string;
+ result->fields[i].column_source = STR_EMPTY_ALLOC();
result->fields[i].max_length = result->datafmt[i].maxlength-1;
result->fields[i].numeric = result->numerics[i];
Z_TYPE(result->fields[i]) = result->types[i];
@@ -1575,7 +1577,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
/* Retry deadlocks up until deadlock_retry_count times */
if (sybase_ptr->deadlock && SybCtG(deadlock_retry_count) != -1 && ++deadlock_count > SybCtG(deadlock_retry_count)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Retried deadlock %d times [max: %ld], giving up\n", deadlock_count- 1, SybCtG(deadlock_retry_count));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Retried deadlock %d times [max: %ld], giving up", deadlock_count- 1, SybCtG(deadlock_retry_count));
if (result != NULL) {
_free_sybase_result(result);
}
@@ -1652,7 +1654,7 @@ PHP_FUNCTION(sybase_free_result)
/* Did we fetch up until the end? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) {
- /* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cancelling the rest of the results\n"); */
+ /* 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);
}
diff --git a/ext/sybase_ct/php_sybase_ct.h b/ext/sybase_ct/php_sybase_ct.h
index 2386be12c..51c7b132e 100644
--- a/ext/sybase_ct/php_sybase_ct.h
+++ b/ext/sybase_ct/php_sybase_ct.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_sybase_ct.h,v 1.18 2004/01/25 20:03:10 thekid Exp $ */
+/* $Id: php_sybase_ct.h,v 1.19 2005/08/03 14:08:17 sniper Exp $ */
#ifndef PHP_SYBASE_CT_H
#define PHP_SYBASE_CT_H
diff --git a/ext/sybase_ct/tests/bug22403.phpt b/ext/sybase_ct/tests/bug22403.phpt
index 9ef19ad0d..349d90a17 100644
--- a/ext/sybase_ct/tests/bug22403.phpt
+++ b/ext/sybase_ct/tests/bug22403.phpt
@@ -6,7 +6,7 @@ Sybase-CT bug #22403 (crash when executing a stored procedure without parameters
<?php
/* This file is part of PHP test framework for ext/sybase_ct
*
- * $Id: bug22403.phpt,v 1.1 2004/01/24 02:18:13 thekid Exp $
+ * $Id: bug22403.phpt,v 1.2 2005/02/06 12:59:03 thekid Exp $
*/
require('test.inc');
@@ -16,7 +16,7 @@ Sybase-CT bug #22403 (crash when executing a stored procedure without parameters
error_reporting(error_reporting() & !E_NOTICE); // Suppress notices
// Check if stored procedure already exists
- $sp_name= basename(__FILE__, '.php');
+ $sp_name= 'phpt_bug22403';
var_dump(sybase_select_db('tempdb', $db));
if (!sybase_select_single($db, 'select object_id("'.$sp_name.'")')) {
echo "Stored procedure {$sp_name} not found, creating\n";
diff --git a/ext/sybase_ct/tests/bug26407.phpt b/ext/sybase_ct/tests/bug26407.phpt
index c2da52919..8d16d0d76 100644
--- a/ext/sybase_ct/tests/bug26407.phpt
+++ b/ext/sybase_ct/tests/bug26407.phpt
@@ -6,7 +6,7 @@ Sybase-CT bug #26407 (Result set fetching broken around transactions)
<?php
/* This file is part of PHP test framework for ext/sybase_ct
*
- * $Id: bug26407.phpt,v 1.1 2004/01/24 02:54:33 thekid Exp $
+ * $Id: bug26407.phpt,v 1.2 2005/02/06 12:59:03 thekid Exp $
*/
require('test.inc');
@@ -14,7 +14,7 @@ Sybase-CT bug #26407 (Result set fetching broken around transactions)
$db= sybase_connect_ex();
// Create temporary table
- $table= basename(__FILE__, '.php');
+ $table= 'phpt_bug26407';
var_dump(sybase_query('create table #'.$table.' ( the_big_answer int )', $db));
// I
@@ -67,7 +67,7 @@ array(1) {
>>> Query:
begin transaction
-- no result returned...
- update #bug26407 set the_big_answer=42
+ update #phpt_bug26407 set the_big_answer=42
commit
<<< Return: boolean
diff --git a/ext/sybase_ct/tests/bug27843.phpt b/ext/sybase_ct/tests/bug27843.phpt
index f54e469f4..ac2f9a745 100644
--- a/ext/sybase_ct/tests/bug27843.phpt
+++ b/ext/sybase_ct/tests/bug27843.phpt
@@ -1,12 +1,12 @@
--TEST--
-Sybase-CT bug #27843: notices when query is a stored procedure
+Sybase-CT bug #27843 (notices when query is a stored procedure)
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
/* This file is part of PHP test framework for ext/sybase_ct
*
- * $Id: bug27843.phpt,v 1.1 2004/07/11 16:31:32 thekid Exp $
+ * $Id: bug27843.phpt,v 1.3 2005/02/06 12:59:03 thekid Exp $
*/
require('test.inc');
@@ -14,7 +14,7 @@ Sybase-CT bug #27843: notices when query is a stored procedure
$db= sybase_connect_ex();
// Check if stored procedure already exists
- $sp_name= basename(__FILE__, '.php');
+ $sp_name= 'phpt_bug27843';
var_dump(sybase_select_db('tempdb', $db));
if (!sybase_select_single($db, 'select object_id("'.$sp_name.'")')) {
echo "Stored procedure {$sp_name} not found, creating\n";
@@ -42,7 +42,7 @@ Sybase-CT bug #27843: notices when query is a stored procedure
bool(true)
Stored procedure %s
bool(true)
->>> Query: exec bug27843
+>>> Query: exec phpt_bug27843
<<< Return: resource
array(1) {
[0]=>
diff --git a/ext/sybase_ct/tests/bug28354.phpt b/ext/sybase_ct/tests/bug28354.phpt
index cdcbf381e..949a38cca 100644
--- a/ext/sybase_ct/tests/bug28354.phpt
+++ b/ext/sybase_ct/tests/bug28354.phpt
@@ -6,7 +6,7 @@ Sybase-CT bug #28354 (sybase_free_result crash)
<?php
/* This file is part of PHP test framework for ext/sybase_ct
*
- * $Id: bug28354.phpt,v 1.2 2004/05/21 20:53:01 thekid Exp $
+ * $Id: bug28354.phpt,v 1.3 2005/02/06 12:59:03 thekid Exp $
*/
require('test.inc');
@@ -16,7 +16,7 @@ Sybase-CT bug #28354 (sybase_free_result crash)
error_reporting(error_reporting() & !E_NOTICE); // Suppress notices
// Check if stored procedure already exists
- $sp_name= basename(__FILE__, '.php');
+ $sp_name= 'phpt_bug28354';
var_dump(sybase_select_db('tempdb', $db));
if (!sybase_select_single($db, 'select object_id("'.$sp_name.'")')) {
echo "Stored procedure {$sp_name} not found, creating\n";
diff --git a/ext/sybase_ct/tests/bug30312.phpt b/ext/sybase_ct/tests/bug30312.phpt
new file mode 100644
index 000000000..a7b02a622
--- /dev/null
+++ b/ext/sybase_ct/tests/bug30312.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Sybase-CT bug #30312 (sybase_unbuffered_query calls)
+--SKIPIF--
+<?php require('skipif.inc'); ?>
+--FILE--
+<?php
+/* This file is part of PHP test framework for ext/sybase_ct
+ *
+ * $Id: bug30312.phpt,v 1.1 2005/02/06 11:58:53 thekid Exp $
+ */
+
+ require('test.inc');
+ error_reporting(error_reporting() & !E_NOTICE); // Suppress notices
+
+ $db= sybase_connect_ex();
+
+ $query= sybase_unbuffered_query('select getdate()');
+ $array= sybase_fetch_array($query);
+ var_dump($array[0]);
+
+ $query= sybase_unbuffered_query('select getdate()');
+ $array= sybase_fetch_array($query);
+ var_dump($array[0]);
+?>
+--EXPECTF--
+string(%d) "%s %d %d %d:%d%s"
+string(%d) "%s %d %d %d:%d%s"
diff --git a/ext/sybase_ct/tests/index.php b/ext/sybase_ct/tests/index.php
new file mode 100644
index 000000000..8905ac77c
--- /dev/null
+++ b/ext/sybase_ct/tests/index.php
@@ -0,0 +1,216 @@
+<?php
+/* This file is part of PHP test framework for ext/sybase_ct
+ *
+ * $Id: index.php,v 1.3 2005/02/06 14:08:11 thekid Exp $
+ */
+
+ // {{{ class PHPTExpectancy
+ // Abstract base class for expectancies
+ class PHPTExpectancy {
+ var
+ $expected = '';
+
+ function PHPTExpectancy($expected) {
+ $this->expected= $expected;
+ }
+
+ function matches($output) { }
+ }
+ // }}}
+
+ // {{{ class PHPTRegexExpectancy
+ // Expectancy class for regular expressions
+ class PHPTRegexExpectancy extends PHPTExpectancy {
+
+ function matches($output) {
+ return preg_match('°^'.strtr(preg_quote(rtrim($this->expected), '°'), array(
+ '%s' => '(.+)',
+ '%d' => '([0-9]+)'
+ )).'°', $output);
+ }
+ }
+ // }}}
+
+ // {{{ class PHPTTest
+ // Represents a single .phpt-style test
+ class PHPTTest {
+ var
+ $name = '',
+ $description = '',
+ $skipif = '',
+ $code = '',
+ $expectancy = NULL,
+ $output = '';
+
+ function &fromFile($filename) {
+ $fd= fopen($filename, 'r');
+
+ $sections= array();
+ $current= NULL;
+ while (!feof($fd)) {
+ $line= fgets($fd, 0xFFFF);
+ if (1 == sscanf($line, '--%[^-]--', $section)) {
+ $sections[$section]= '';
+ $current= $section;
+ continue;
+ }
+ $sections[$current].= $line;
+ }
+ fclose($fd);
+
+ // Create instance from read data and return it
+ $t= &new PHPTTest(); {
+ $t->name= substr(realpath($filename), 0, -1);
+ $t->description= rtrim($sections['TEST']);
+ $t->skipif= $sections['SKIPIF'];
+ $t->code= $sections['FILE'];
+
+ if (isset($sections['EXPECTF'])) {
+ $t->expectancy= &new PHPTRegexExpectancy($sections['EXPECTF']);
+ } else {
+ // XXX TBI XXX
+ }
+ }
+ return $t;
+ }
+
+ function onError($errno, $errstr, $errfile, $errline) {
+ static $names= array(
+ E_NOTICE => 'Notice',
+ E_WARNING => 'Warning'
+ );
+
+ if (!(error_reporting() & $errno)) return;
+ printf(
+ "\n%s: %s in %s on line %d\n",
+ $names[$errno],
+ $errstr,
+ strstr($errfile, 'eval()\'d code') ? $this->name : $errfile,
+ $errline
+ );
+ }
+
+ function run() {
+
+ // Precondition check - will die if test needs to be skipped
+ eval('?>'.$this->skipif);
+
+ set_error_handler(array(&$this, 'onError')); {
+ error_reporting(E_ALL);
+
+ ob_start();
+ eval('?>'.$this->code);
+ $this->output= rtrim(ob_get_contents());
+ ob_end_clean();
+ } restore_error_handler();
+
+ return $this->expectancy->matches($this->output);
+ }
+ }
+ // }}}
+
+ // {{{ main
+ if (isset($_GET['phpinfo'])) {
+ phpinfo((int)$_GET['phpinfo']);
+
+ echo '<a href="?">Home</a>';
+ exit();
+ }
+
+ echo <<<__
+ <html>
+ <head>
+ <title>PHPT Test</title>
+ <style type="text/css">
+ body {
+ background-color: #ffffff;
+ color: #000000;
+ font-size: 75%;
+ }
+ body, td, th, h1, h2 {
+ font-family: sans-serif;
+ }
+ h1 {
+ font-size: 150%;
+ }
+ h2 {
+ font-size: 125%;
+ }
+ .header {
+ background: url(?=PHPE9568F34-D428-11d2-A769-00AA001ACF42);
+ background-position: right center;
+ background-repeat: no-repeat;
+ min-height: 70px;
+ background-color: #9999cc;
+ padding: 4px;
+ padding-right: 120px;
+ border: 1px solid #000000;
+ }
+ hr {
+ width: 600px;
+ background-color: #cccccc;
+ border: 0px;
+ height: 1px;
+ color: #000000;
+ }
+ </style>
+ </head>
+ <body>
+__;
+
+ $test= basename($_SERVER['QUERY_STRING']);
+ if ($test && file_exists($test)) {
+ $t= &PHPTTest::fromFile($test);
+ echo '<div class="header"><h1>'.basename($t->name), ': ', $t->description.'</h1></div>';
+ echo '<a href="?">Back to test suite</a>';
+ flush();
+
+ // Run the test
+ $result= $t->run();
+
+ // Evaluate results
+ if ($result) {
+ echo '<h2>Passed</h2>';
+ } else {
+ echo '<h2>Failed</h2><hr/>';
+
+ echo '<h3>Actual output</h3>';
+ echo '<xmp>', $t->output, '</xmp><hr/>';
+
+ echo '<h3>Expectancy</h3>';
+ echo '<xmp>', $t->expectancy->expected, '</xmp>';
+ }
+
+ echo '<hr/>';
+ exit();
+ }
+
+ echo '<div class="header"><h1>Test suite</h1></div>';
+
+ // phpinfo() links
+ echo 'phpinfo(): ';
+ foreach (array(
+ 1 => 'General',
+ 4 => 'Configuration',
+ 8 => 'Modules'
+ ) as $const => $name) {
+ printf('<a href="?phpinfo=%d">%s</a> | ', $const, $name);
+ }
+ echo '<a href="?phpinfo=-1">(All)</a>';
+
+ echo '<h2>Select one to run</h2>';
+ echo '<ul>';
+ $d= dir(dirname(__FILE__));
+ while ($entry= $d->read()) {
+ if ('.phpt' != substr($entry, -5)) continue;
+ echo '<li><a href="?'.$entry.'">'.$entry.'</a></li>';
+ }
+ $d->close();
+ echo '</ul><hr/>';
+
+ echo <<<__
+ </body>
+ </html>
+__;
+ // }}}
+?>
diff --git a/ext/sybase_ct/tests/skipif.inc b/ext/sybase_ct/tests/skipif.inc
index b1d1e154c..ac5fa2fe5 100644
--- a/ext/sybase_ct/tests/skipif.inc
+++ b/ext/sybase_ct/tests/skipif.inc
@@ -1,7 +1,7 @@
<?php
/* This file is part of PHP test framework for ext/sybase_ct
*
- * $Id: skipif.inc,v 1.1.2.1 2004/11/22 15:15:31 dmitry Exp $
+ * $Id: skipif.inc,v 1.2 2004/11/22 15:15:50 dmitry Exp $
*/
if (!extension_loaded('sybase_ct')) die('skip Sybase-CT extension not loaded');
diff --git a/ext/sybase_ct/tests/test_appname.phpt b/ext/sybase_ct/tests/test_appname.phpt
index bf8582132..d409ae222 100644
--- a/ext/sybase_ct/tests/test_appname.phpt
+++ b/ext/sybase_ct/tests/test_appname.phpt
@@ -6,7 +6,7 @@ Sybase-CT application name
<?php
/* This file is part of PHP test framework for ext/sybase_ct
*
- * $Id: test_appname.phpt,v 1.1 2004/01/24 02:42:26 thekid Exp $
+ * $Id: test_appname.phpt,v 1.2 2005/02/06 12:59:03 thekid Exp $
*/
require('test.inc');
@@ -19,7 +19,7 @@ Sybase-CT application name
}
// }}}
- $program_name= basename(__FILE__, '.php');
+ $program_name= 'phpt_test';
$hostname= 'php.net';
ini_set('sybct.hostname', $hostname);
@@ -50,7 +50,7 @@ Sybase-CT application name
from
master..sysprocesses
where
- program_name = "test_appname"
+ program_name = "phpt_test"
<<< Return: resource
array(1) {
[0]=>
@@ -58,7 +58,7 @@ array(1) {
["hostname"]=>
string(10) "php.net%s"
["program_name"]=>
- string(16) "test_appname%s"
+ string(16) "phpt_test%s"
}
}
bool(true)
diff --git a/ext/sysvmsg/php_sysvmsg.h b/ext/sysvmsg/php_sysvmsg.h
index 825f7e808..a0fdc90b7 100644
--- a/ext/sysvmsg/php_sysvmsg.h
+++ b/ext/sysvmsg/php_sysvmsg.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_sysvmsg.h,v 1.5 2004/01/08 17:32:55 sniper Exp $ */
+/* $Id: php_sysvmsg.h,v 1.6 2005/08/03 14:08:18 sniper Exp $ */
#ifndef PHP_SYSVMSG_H
#define PHP_SYSVMSG_H
diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c
index 386962b63..a0723ca20 100644
--- a/ext/sysvmsg/sysvmsg.c
+++ b/ext/sysvmsg/sysvmsg.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: sysvmsg.c,v 1.16.2.3 2005/02/07 22:31:56 iliaa Exp $ */
+/* $Id: sysvmsg.c,v 1.20 2005/08/03 14:08:18 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -142,7 +142,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.16.2.3 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.20 $");
php_info_print_table_end();
}
/* }}} */
diff --git a/ext/sysvmsg/tests/001.phpt b/ext/sysvmsg/tests/001.phpt
index 4f57dba30..d3a5b1e3e 100644
--- a/ext/sysvmsg/tests/001.phpt
+++ b/ext/sysvmsg/tests/001.phpt
@@ -5,7 +5,7 @@ send/receive serialized message.
if (!extension_loaded("sysvmsg")) print "skip"; ?>
--FILE--
<?php
-$key = ftok("./ext/sysvmsg/tests/001.phpt", "p");
+$key = ftok(dirname(__FILE__) . "/001.phpt", "p");
$q = msg_get_queue($key);
msg_send($q, 1, "hello") or print "FAIL\n";
$type = null;
diff --git a/ext/sysvsem/config.m4 b/ext/sysvsem/config.m4
index a73c2fc03..fec4c2a29 100644
--- a/ext/sysvsem/config.m4
+++ b/ext/sysvsem/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.5 2002/03/12 16:36:40 sas Exp $
+dnl $Id: config.m4,v 1.6 2005/05/29 23:16:44 sniper Exp $
dnl
PHP_ARG_ENABLE(sysvsem,whether to enable System V semaphore support,
-[ --enable-sysvsem Enable System V semaphore support.])
+[ --enable-sysvsem Enable System V semaphore support])
if test "$PHP_SYSVSEM" != "no"; then
PHP_NEW_EXTENSION(sysvsem, sysvsem.c, $ext_shared)
diff --git a/ext/sysvsem/php_sysvsem.h b/ext/sysvsem/php_sysvsem.h
index 39b85632a..87a448cc1 100644
--- a/ext/sysvsem/php_sysvsem.h
+++ b/ext/sysvsem/php_sysvsem.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_sysvsem.h,v 1.15 2004/01/08 17:32:55 sniper Exp $ */
+/* $Id: php_sysvsem.h,v 1.16 2005/08/03 14:08:18 sniper Exp $ */
#ifndef PHP_SYSVSEM_H
#define PHP_SYSVSEM_H
diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c
index 1b794f9fb..736184509 100644
--- a/ext/sysvsem/sysvsem.c
+++ b/ext/sysvsem/sysvsem.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sysvsem.c,v 1.49.2.1 2005/01/20 10:02:24 tony2001 Exp $ */
+/* $Id: sysvsem.c,v 1.51 2005/08/03 14:08:18 sniper Exp $ */
/* Latest update build anc tested on Linux 2.2.14
*
diff --git a/ext/sysvshm/config.m4 b/ext/sysvshm/config.m4
index 03d93c114..d9627f435 100644
--- a/ext/sysvshm/config.m4
+++ b/ext/sysvshm/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.5 2002/03/12 16:37:01 sas Exp $
+dnl $Id: config.m4,v 1.6 2005/05/29 23:16:45 sniper Exp $
dnl
PHP_ARG_ENABLE(sysvshm,whether to enable System V shared memory support,
-[ --enable-sysvshm Enable the System V shared memory support.])
+[ --enable-sysvshm Enable the System V shared memory support])
if test "$PHP_SYSVSHM" != "no"; then
AC_DEFINE(HAVE_SYSVSHM, 1, [ ])
diff --git a/ext/sysvshm/php_sysvshm.h b/ext/sysvshm/php_sysvshm.h
index c30704188..19e880f2d 100644
--- a/ext/sysvshm/php_sysvshm.h
+++ b/ext/sysvshm/php_sysvshm.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_sysvshm.h,v 1.16 2004/01/08 17:32:56 sniper Exp $ */
+/* $Id: php_sysvshm.h,v 1.17 2005/08/03 14:08:18 sniper Exp $ */
#ifndef PHP_SYSVSHM_H
#define PHP_SYSVSHM_H
diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c
index 76193226b..47ccda141 100644
--- a/ext/sysvshm/sysvshm.c
+++ b/ext/sysvshm/sysvshm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: sysvshm.c,v 1.67.2.1 2005/01/20 10:03:32 tony2001 Exp $ */
+/* $Id: sysvshm.c,v 1.70 2005/08/03 14:08:18 sniper Exp $ */
/* This has been built and tested on Linux 2.2.14
*
@@ -316,7 +316,7 @@ PHP_FUNCTION(shm_get_var)
shm_data = &shm_var->mem;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (php_var_unserialize(&return_value, (const char **) &shm_data, shm_data + shm_var->length, &var_hash TSRMLS_CC) != 1) {
+ if (php_var_unserialize(&return_value, (const unsigned char **) &shm_data, shm_data + shm_var->length, &var_hash TSRMLS_CC) != 1) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable data in shared memory is corrupted");
RETURN_FALSE;
diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4
index 961b54ab8..c962fe6a4 100644
--- a/ext/tidy/config.m4
+++ b/ext/tidy/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.3 2003/12/18 19:59:58 sniper Exp $
+dnl $Id: config.m4,v 1.5 2005/05/29 23:16:45 sniper Exp $
dnl
PHP_ARG_WITH(tidy,for TIDY support,
-[ --with-tidy[=DIR] Include TIDY support])
+[ --with-tidy[=DIR] Include TIDY support])
if test "$PHP_TIDY" != "no"; then
@@ -32,6 +32,12 @@ if test "$PHP_TIDY" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH(tidy, $TIDY_LIBDIR, TIDY_SHARED_LIBADD)
PHP_ADD_INCLUDE($TIDY_INCDIR)
+ PHP_CHECK_LIBRARY(tidy,tidyOptGetDoc,
+ [
+ AC_DEFINE(HAVE_TIDYOPTGETDOC,1,[ ])
+ ],[],[])
+
+
PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared)
PHP_SUBST(TIDY_SHARED_LIBADD)
AC_DEFINE(HAVE_TIDY,1,[ ])
diff --git a/ext/tidy/examples/cleanhtml5.php b/ext/tidy/examples/cleanhtml5.php
index c31e36f1f..4dfd7643e 100644
--- a/ext/tidy/examples/cleanhtml5.php
+++ b/ext/tidy/examples/cleanhtml5.php
@@ -23,10 +23,10 @@
$tidy->cleanRepair();
- if(!empty($tidy->error_buf)) {
+ if(!empty($tidy->errorBuffer)) {
echo "\n\nThe following errors or warnings occured:\n";
- echo "{$tidy->error_buf}\n";
+ echo "{$tidy->errorBuffer}\n";
}
diff --git a/ext/tidy/examples/dumpit.php b/ext/tidy/examples/dumpit.php
deleted file mode 100644
index e77b7b932..000000000
--- a/ext/tidy/examples/dumpit.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
- /*
- * dumpit.php
- *
- * a command-line script which dumps the given HTML, PHP, ASP, XHTML, etc.
- * file as it is represented in the document model.
- *
- * By: John Coggeshall <john@php.net>
- *
- * Usage; php dumpit.php <filename>
- */
-
- tidy_parse_file($_SERVER['argv'][1]);
-
- /* Optionally you can do this here if you want to fix up the document */
-
- /* tidy_clean_repair(); */
-
- $tree = tidy_get_root();
- dump_tree($tree);
- echo "\n";
-
- function node_type($type) {
-
- switch($type) {
-
- case TIDY_NODETYPE_ROOT: return "Root Node";
- case TIDY_NODETYPE_DOCTYPE: return "DocType Node";
- case TIDY_NODETYPE_COMMENT: return "Comment Node";
- case TIDY_NODETYPE_PROCINS: return "ProcIns Node";
- case TIDY_NODETYPE_TEXT: return "Text Node";
- case TIDY_NODETYPE_START: return "Start Node";
- case TIDY_NODETYPE_END: return "End Node";
- case TIDY_NODETYPE_STARTEND: return "Start/End Node";
- case TIDY_NODETYPE_CDATA: return "CDATA Node";
- case TIDY_NODETYPE_SECTION: return "Section Node";
- case TIDY_NODETYPE_ASP: return "ASP Source Code Node";
- case TIDY_NODETYPE_PHP: return "PHP Source Code Node";
- case TIDY_NODETYPE_JSTE: return "JSTE Source Code";
- case TIDY_NODETYPE_XMLDECL: return "XML Declaration Node";
- default: return "Unknown Node";
- }
- }
-
- function do_leaf($string, $indent) {
- for($i = 0; $i < $indent; $i++) {
- echo " ";
- }
- echo $string;
- }
-
- function dump_tree($node, $indent = 0) {
- if($node) {
- /* Put something there if the node name is empty */
- $nodename = trim(strtoupper($node->name));
- $nodename = (empty($nodename)) ? "[EMPTY]" : $nodename;
-
- /* Generate the Node, and a pretty name for it */
- do_leaf(" + $nodename (".node_type($node->type).")\n", $indent);
-
- /* Check to see if this node is a text node. Text nodes are
- generated by start/end tags and contain the text in between.
- i.e. <B>foo</B> will create a text node with $node->value
- equal to 'foo' */
- if($node->type == TIDY_NODETYPE_TEXT) {
- do_leaf(" |\n", $indent);
- do_leaf(" +---- Value: '{$node->value}'\n", $indent);
- }
-
- /* Any attributes on this node? */
- if(count($node->attributes())) {
- do_leaf(" |\n", $indent);
- do_leaf(" +---- Attributes\n", $indent);
-
- /* Cycle through the attributes and display them and their values. */
- foreach($node->attributes() as $attrib) {
- do_leaf(" +--{$attrib->name}\n", $indent);
- do_leaf(" | +-- Value: {$attrib->value}\n", $indent);
- }
- }
-
- /* Recurse along the children to generate the remaining nodes */
- if($node->has_children()) {
- foreach($node->children() as $child) {
- dump_tree($child, $indent + 3);
- }
- }
- }
- }
-
- echo tidy_get_output();
-
-?> \ No newline at end of file
diff --git a/ext/tidy/examples/dumpit5.php b/ext/tidy/examples/dumpit5.php
index ad9157f6a..d7aee2d65 100644
--- a/ext/tidy/examples/dumpit5.php
+++ b/ext/tidy/examples/dumpit5.php
@@ -51,7 +51,7 @@
echo $string;
}
- function dump_tree(tidy_node $node, $indent = 0) {
+ function dump_tree(tidyNode $node, $indent = 0) {
/* Put something there if the node name is empty */
$nodename = trim(strtoupper($node->name));
@@ -80,7 +80,7 @@
}
/* Recurse along the children to generate the remaining nodes */
- if($node->has_children()) {
+ if($node->hasChildren()) {
foreach($node->child as $child) {
dump_tree($child, $indent + 3);
}
diff --git a/ext/tidy/examples/urlgrab.php b/ext/tidy/examples/urlgrab.php
deleted file mode 100644
index 9ec4c42ba..000000000
--- a/ext/tidy/examples/urlgrab.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-
- /*
- * urlgrab.php
- *
- * A simple command-line utility to extract all of the URLS contained
- * within <A HREF> tags from a document.
- *
- * NOTE: Only works with tidy for PHP 4.3.x, please see urlgrab5.php for tidy for PHP 5
- *
- * By: John Coggeshall <john@php.net>
- *
- * Usage: php urlgrab.php <file>
- *
- */
-
- /* Parse the document */
- tidy_parse_file($_SERVER['argv'][1]);
-
- /* Fix up the document */
- tidy_clean_repair();
-
- /* Get an object representing everything from the <HTML> tag in */
- $html = tidy_get_html();
-
- /* Traverse the document tree */
- print_r(get_links($html));
-
- function get_links($node) {
- $urls = array();
-
- /* Check to see if we are on an <A> tag or not */
- if($node->id == TIDY_TAG_A) {
- /* If we are, find the HREF attribute */
- $attrib = $node->get_attr(TIDY_ATTR_HREF);
- if($attrib) {
- /* Add the value of the HREF attrib to $urls */
- $urls[] = $attrib->value;
- }
-
- }
-
- /* Are there any children? */
- if($node->has_children()) {
-
- /* Traverse down each child recursively */
- foreach($node->children() as $child) {
-
- /* Append the results from recursion to $urls */
- foreach(get_links($child) as $url) {
-
- $urls[] = $url;
-
- }
-
- }
- }
-
- return $urls;
- }
-
-?> \ No newline at end of file
diff --git a/ext/tidy/examples/urlgrab5.php b/ext/tidy/examples/urlgrab5.php
index 8e08322a1..875baf0cf 100644
--- a/ext/tidy/examples/urlgrab5.php
+++ b/ext/tidy/examples/urlgrab5.php
@@ -12,7 +12,7 @@
* Usage: php urlgrab5.php <file>
*
*/
- function dump_nodes(tidy_node $node, &$urls = NULL) {
+ function dump_nodes(tidyNode $node, &$urls = NULL) {
$urls = (is_array($urls)) ? $urls : array();
diff --git a/ext/tidy/php_tidy.def b/ext/tidy/php_tidy.def
index 1c17276de..0caabc01f 100644
--- a/ext/tidy/php_tidy.def
+++ b/ext/tidy/php_tidy.def
@@ -45,6 +45,7 @@ tidyOptGetCategory
tidyOptGetDefault
tidyOptGetDefaultInt
tidyOptGetDefaultBool
+tidyOptGetDoc
tidyOptGetPickList
tidyOptGetNextPick
tidyOptGetValue
diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h
index 6e4c4dba8..3ec290f3a 100644
--- a/ext/tidy/php_tidy.h
+++ b/ext/tidy/php_tidy.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_tidy.h,v 1.22.2.1 2005/02/08 05:29:48 rasmus Exp $ */
+/* $Id: php_tidy.h,v 1.26 2005/08/03 14:08:19 sniper Exp $ */
#ifndef PHP_TIDY_H
#define PHP_TIDY_H
@@ -57,6 +57,9 @@ 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);
diff --git a/ext/tidy/tests/010.phpt b/ext/tidy/tests/010.phpt
index 2bb66d49a..eabbc0391 100644
--- a/ext/tidy/tests/010.phpt
+++ b/ext/tidy/tests/010.phpt
@@ -12,7 +12,7 @@ Accessing root, body, html, and head nodes..
?>
--EXPECT--
-object(tidyNode)#2 (5) {
+object(tidyNode)#2 (8) {
["value"]=>
string(94) "<html>
<head>
@@ -25,12 +25,18 @@ object(tidyNode)#2 (5) {
string(0) ""
["type"]=>
int(0)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(1)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#3 (6) {
+ &object(tidyNode)#3 (9) {
["value"]=>
string(94) "<html>
<head>
@@ -43,6 +49,12 @@ object(tidyNode)#2 (5) {
string(4) "html"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(1)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(48)
["attribute"]=>
@@ -50,7 +62,7 @@ object(tidyNode)#2 (5) {
["child"]=>
array(2) {
[0]=>
- &object(tidyNode)#4 (6) {
+ &object(tidyNode)#4 (9) {
["value"]=>
string(31) "<head>
<title></title>
@@ -60,6 +72,12 @@ object(tidyNode)#2 (5) {
string(4) "head"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(7)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(46)
["attribute"]=>
@@ -67,7 +85,7 @@ object(tidyNode)#2 (5) {
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#5 (6) {
+ &object(tidyNode)#5 (9) {
["value"]=>
string(16) "<title></title>
"
@@ -75,6 +93,12 @@ object(tidyNode)#2 (5) {
string(5) "title"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(57)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(111)
["attribute"]=>
@@ -85,7 +109,7 @@ object(tidyNode)#2 (5) {
}
}
[1]=>
- &object(tidyNode)#6 (6) {
+ &object(tidyNode)#6 (9) {
["value"]=>
string(49) "<body bgcolor="#FFFFFF" alink="#000000">
</body>
@@ -94,6 +118,12 @@ object(tidyNode)#2 (5) {
string(4) "body"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(7)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(16)
["attribute"]=>
@@ -110,7 +140,7 @@ object(tidyNode)#2 (5) {
}
}
}
-object(tidyNode)#2 (6) {
+object(tidyNode)#2 (9) {
["value"]=>
string(49) "<body bgcolor="#FFFFFF" alink="#000000">
</body>
@@ -119,6 +149,12 @@ object(tidyNode)#2 (6) {
string(4) "body"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(7)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(16)
["attribute"]=>
@@ -131,7 +167,7 @@ object(tidyNode)#2 (6) {
["child"]=>
NULL
}
-object(tidyNode)#2 (6) {
+object(tidyNode)#2 (9) {
["value"]=>
string(94) "<html>
<head>
@@ -144,6 +180,12 @@ object(tidyNode)#2 (6) {
string(4) "html"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(1)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(48)
["attribute"]=>
@@ -151,7 +193,7 @@ object(tidyNode)#2 (6) {
["child"]=>
array(2) {
[0]=>
- &object(tidyNode)#3 (6) {
+ &object(tidyNode)#3 (9) {
["value"]=>
string(31) "<head>
<title></title>
@@ -161,6 +203,12 @@ object(tidyNode)#2 (6) {
string(4) "head"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(7)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(46)
["attribute"]=>
@@ -168,7 +216,7 @@ object(tidyNode)#2 (6) {
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#6 (6) {
+ &object(tidyNode)#6 (9) {
["value"]=>
string(16) "<title></title>
"
@@ -176,6 +224,12 @@ object(tidyNode)#2 (6) {
string(5) "title"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(57)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(111)
["attribute"]=>
@@ -186,7 +240,7 @@ object(tidyNode)#2 (6) {
}
}
[1]=>
- &object(tidyNode)#4 (6) {
+ &object(tidyNode)#4 (9) {
["value"]=>
string(49) "<body bgcolor="#FFFFFF" alink="#000000">
</body>
@@ -195,6 +249,12 @@ object(tidyNode)#2 (6) {
string(4) "body"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(7)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(16)
["attribute"]=>
@@ -209,7 +269,7 @@ object(tidyNode)#2 (6) {
}
}
}
-object(tidyNode)#2 (6) {
+object(tidyNode)#2 (9) {
["value"]=>
string(31) "<head>
<title></title>
@@ -219,6 +279,12 @@ object(tidyNode)#2 (6) {
string(4) "head"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(7)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(46)
["attribute"]=>
@@ -226,7 +292,7 @@ object(tidyNode)#2 (6) {
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#4 (6) {
+ &object(tidyNode)#4 (9) {
["value"]=>
string(16) "<title></title>
"
@@ -234,6 +300,12 @@ object(tidyNode)#2 (6) {
string(5) "title"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(57)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(111)
["attribute"]=>
diff --git a/ext/tidy/tests/012.phpt b/ext/tidy/tests/012.phpt
index 5cec346b1..43fff38df 100644
--- a/ext/tidy/tests/012.phpt
+++ b/ext/tidy/tests/012.phpt
@@ -32,7 +32,7 @@ Accessing children nodes
?>
--EXPECT--
bool(true)
-object(tidyNode)#3 (6) {
+object(tidyNode)#3 (9) {
["value"]=>
string(31) "<head>
<title></title>
@@ -42,6 +42,12 @@ object(tidyNode)#3 (6) {
string(4) "head"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(7)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(46)
["attribute"]=>
@@ -49,7 +55,7 @@ object(tidyNode)#3 (6) {
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#4 (6) {
+ &object(tidyNode)#4 (9) {
["value"]=>
string(16) "<title></title>
"
@@ -57,6 +63,12 @@ object(tidyNode)#3 (6) {
string(5) "title"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(87)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(111)
["attribute"]=>
@@ -67,7 +79,7 @@ object(tidyNode)#3 (6) {
}
}
bool(true)
-object(tidyNode)#4 (6) {
+object(tidyNode)#4 (9) {
["value"]=>
string(16) "<title></title>
"
@@ -75,6 +87,12 @@ object(tidyNode)#4 (6) {
string(5) "title"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(87)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(111)
["attribute"]=>
@@ -82,7 +100,7 @@ object(tidyNode)#4 (6) {
["child"]=>
NULL
}
-object(tidyNode)#5 (6) {
+object(tidyNode)#5 (9) {
["value"]=>
string(80) "<body bgcolor="#FFFFFF" alink="#000000">
<b>Hi</b><i>Bye<u>Test</u></i>
@@ -92,6 +110,12 @@ object(tidyNode)#5 (6) {
string(4) "body"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(7)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(16)
["attribute"]=>
@@ -104,13 +128,19 @@ object(tidyNode)#5 (6) {
["child"]=>
array(2) {
[0]=>
- &object(tidyNode)#6 (6) {
+ &object(tidyNode)#6 (9) {
["value"]=>
string(9) "<b>Hi</b>"
["name"]=>
string(1) "b"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(43)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(8)
["attribute"]=>
@@ -118,13 +148,19 @@ object(tidyNode)#5 (6) {
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#7 (5) {
+ &object(tidyNode)#7 (8) {
["value"]=>
string(2) "Hi"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(46)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
@@ -133,13 +169,19 @@ object(tidyNode)#5 (6) {
}
}
[1]=>
- &object(tidyNode)#8 (6) {
+ &object(tidyNode)#8 (9) {
["value"]=>
string(21) "<i>Bye<u>Test</u></i>"
["name"]=>
string(1) "i"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(52)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(49)
["attribute"]=>
@@ -147,26 +189,38 @@ object(tidyNode)#5 (6) {
["child"]=>
array(2) {
[0]=>
- &object(tidyNode)#9 (5) {
+ &object(tidyNode)#9 (8) {
["value"]=>
string(3) "Bye"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(55)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
NULL
}
[1]=>
- &object(tidyNode)#10 (6) {
+ &object(tidyNode)#10 (9) {
["value"]=>
string(11) "<u>Test</u>"
["name"]=>
string(1) "u"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(58)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(114)
["attribute"]=>
@@ -174,13 +228,19 @@ object(tidyNode)#5 (6) {
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#11 (5) {
+ &object(tidyNode)#11 (8) {
["value"]=>
string(4) "Test"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(61)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
@@ -193,13 +253,19 @@ object(tidyNode)#5 (6) {
}
}
bool(true)
-object(tidyNode)#6 (6) {
+object(tidyNode)#6 (9) {
["value"]=>
string(9) "<b>Hi</b>"
["name"]=>
string(1) "b"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(43)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(8)
["attribute"]=>
@@ -207,13 +273,19 @@ object(tidyNode)#6 (6) {
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#7 (5) {
+ &object(tidyNode)#7 (8) {
["value"]=>
string(2) "Hi"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(46)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
@@ -222,25 +294,37 @@ object(tidyNode)#6 (6) {
}
}
bool(true)
-object(tidyNode)#7 (5) {
+object(tidyNode)#7 (8) {
["value"]=>
string(2) "Hi"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(46)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
NULL
}
-object(tidyNode)#8 (6) {
+object(tidyNode)#8 (9) {
["value"]=>
string(21) "<i>Bye<u>Test</u></i>"
["name"]=>
string(1) "i"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(52)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(49)
["attribute"]=>
@@ -248,26 +332,38 @@ object(tidyNode)#8 (6) {
["child"]=>
array(2) {
[0]=>
- &object(tidyNode)#9 (5) {
+ &object(tidyNode)#9 (8) {
["value"]=>
string(3) "Bye"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(55)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
NULL
}
[1]=>
- &object(tidyNode)#10 (6) {
+ &object(tidyNode)#10 (9) {
["value"]=>
string(11) "<u>Test</u>"
["name"]=>
string(1) "u"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(58)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(114)
["attribute"]=>
@@ -275,13 +371,19 @@ object(tidyNode)#8 (6) {
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#11 (5) {
+ &object(tidyNode)#11 (8) {
["value"]=>
string(4) "Test"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(61)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
@@ -292,25 +394,37 @@ object(tidyNode)#8 (6) {
}
}
bool(true)
-object(tidyNode)#9 (5) {
+object(tidyNode)#9 (8) {
["value"]=>
string(3) "Bye"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(55)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
NULL
}
-object(tidyNode)#10 (6) {
+object(tidyNode)#10 (9) {
["value"]=>
string(11) "<u>Test</u>"
["name"]=>
string(1) "u"
["type"]=>
int(5)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(58)
+ ["proprietary"]=>
+ bool(false)
["id"]=>
int(114)
["attribute"]=>
@@ -318,13 +432,19 @@ object(tidyNode)#10 (6) {
["child"]=>
array(1) {
[0]=>
- &object(tidyNode)#11 (5) {
+ &object(tidyNode)#11 (8) {
["value"]=>
string(4) "Test"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(61)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
@@ -333,13 +453,19 @@ object(tidyNode)#10 (6) {
}
}
bool(true)
-object(tidyNode)#11 (5) {
+object(tidyNode)#11 (8) {
["value"]=>
string(4) "Test"
["name"]=>
string(0) ""
["type"]=>
int(4)
+ ["line"]=>
+ int(1)
+ ["column"]=>
+ int(61)
+ ["proprietary"]=>
+ bool(false)
["attribute"]=>
NULL
["child"]=>
diff --git a/ext/tidy/tests/016.phpt b/ext/tidy/tests/016.phpt
index c2fddce6f..001371aa3 100644
--- a/ext/tidy/tests/016.phpt
+++ b/ext/tidy/tests/016.phpt
@@ -1,5 +1,5 @@
--TEST--
-Passing configuration file through tidy_parse_file()
+Passing configuration file through tidy_parse_file() (may fail with buggy libtidy)
--SKIPIF--
<?php if (!extension_loaded("tidy")) print "skip"; ?>
--FILE--
diff --git a/ext/tidy/tests/018.phpt b/ext/tidy/tests/018.phpt
new file mode 100644
index 000000000..405a46d42
--- /dev/null
+++ b/ext/tidy/tests/018.phpt
@@ -0,0 +1,16 @@
+--TEST--
+binary safety
+--SKIPIF--
+<?php if (!extension_loaded("tidy")) print "skip"; ?>
+--FILE--
+<?php
+$x = tidy_repair_string("<p>abra\0cadabra</p>",
+ array( 'show-body-only' => true,
+ 'clean' => false,
+ 'newline' => "\n")
+ );
+var_dump($x);
+?>
+--EXPECT--
+string(19) "<p>abracadabra</p>
+"
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index 62c3a8ea8..d7f761937 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: tidy.c,v 1.56.2.5 2005/02/08 05:29:48 rasmus Exp $ */
+/* $Id: tidy.c,v 1.66.2.3 2005/11/14 22:03:02 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -127,6 +127,18 @@
zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \
}
+#define ADD_PROPERTY_STRINGL(_table, _key, _string, _len) \
+ { \
+ zval *tmp; \
+ MAKE_STD_ZVAL(tmp); \
+ if (_string) { \
+ ZVAL_STRINGL(tmp, (char *)_string, _len, 1); \
+ } else { \
+ ZVAL_EMPTY_STRING(tmp); \
+ } \
+ zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \
+ }
+
#define ADD_PROPERTY_LONG(_table, _key, _long) \
{ \
zval *tmp; \
@@ -143,6 +155,14 @@
zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \
}
+#define ADD_PROPERTY_BOOL(_table, _key, _bool) \
+ { \
+ zval *tmp; \
+ MAKE_STD_ZVAL(tmp); \
+ ZVAL_BOOL(tmp, _bool); \
+ zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \
+ }
+
#define TIDY_SAFE_MODE_CHECK(filename) \
if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)) { \
RETURN_FALSE; \
@@ -190,7 +210,7 @@ struct _PHPTidyObj {
/* {{{ ext/tidy prototypes
*/
-static char *php_tidy_file_to_mem(char *, zend_bool TSRMLS_DC);
+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);
@@ -237,6 +257,9 @@ function_entry tidy_functions[] = {
PHP_FE(tidy_warning_count, NULL)
PHP_FE(tidy_access_count, NULL)
PHP_FE(tidy_config_count, NULL)
+#if HAVE_TIDYOPTGETDOC
+ PHP_FE(tidy_get_opt_doc, NULL)
+#endif
PHP_FE(tidy_get_root, NULL)
PHP_FE(tidy_get_head, NULL)
PHP_FE(tidy_get_html, NULL)
@@ -257,6 +280,9 @@ function_entry tidy_funcs_doc[] = {
TIDY_METHOD_MAP(getConfig, tidy_get_config, NULL)
TIDY_METHOD_MAP(getStatus, tidy_get_status, NULL)
TIDY_METHOD_MAP(getHtmlVer, tidy_get_html_ver, NULL)
+#if HAVE_TIDYOPTGETDOC
+ TIDY_METHOD_MAP(getOptDoc, tidy_get_opt_doc, NULL)
+#endif
TIDY_METHOD_MAP(isXhtml, tidy_is_xhtml, NULL)
TIDY_METHOD_MAP(isXml, tidy_is_xml, NULL)
TIDY_METHOD_MAP(root, tidy_get_root, NULL)
@@ -391,7 +417,7 @@ static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS
static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_file)
{
char *data=NULL, *arg1, *enc = NULL;
- int arg1_len, enc_len = 0;
+ int arg1_len, enc_len = 0, data_len = 0;
zend_bool use_include_path = 0;
TidyDoc doc;
TidyBuffer *errbuf;
@@ -404,11 +430,12 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
}
if (is_file) {
- if (!(data = php_tidy_file_to_mem(arg1, use_include_path TSRMLS_CC))) {
+ if (!(data = php_tidy_file_to_mem(arg1, use_include_path, &data_len TSRMLS_CC))) {
RETURN_FALSE;
}
} else {
data = arg1;
+ data_len = arg1_len;
}
doc = tidyCreate();
@@ -450,7 +477,12 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
}
if (data) {
- if (tidyParseString(doc, data) < 0) {
+ TidyBuffer buf = {0};
+
+ tidyBufInit(&buf);
+ tidyBufAppend(&buf, data, data_len);
+
+ if (tidyParseBuffer(doc, &buf) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf->bp);
RETVAL_FALSE;
} else {
@@ -458,12 +490,14 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
TidyBuffer output = {0};
tidySaveBuffer (doc, &output);
- RETVAL_STRING(output.bp, 1);
+ RETVAL_STRINGL(output.bp, output.size-1, 1);
tidyBufFree(&output);
} else {
RETVAL_FALSE;
}
}
+
+ tidyBufFree(&buf);
}
if (is_file) {
@@ -475,17 +509,17 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
tidyRelease(doc);
}
-static char *php_tidy_file_to_mem(char *filename, zend_bool use_include_path TSRMLS_DC)
+static char *php_tidy_file_to_mem(char *filename, zend_bool use_include_path, int *len TSRMLS_DC)
{
php_stream *stream;
- int len;
char *data = NULL;
if (!(stream = php_stream_open_wrapper(filename, "rb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE, NULL))) {
return NULL;
}
- if ((len = php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0)) == 0) {
+ if ((*len = (int) php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0)) == 0) {
data = estrdup("");
+ *len = 0;
}
php_stream_close(stream);
@@ -564,7 +598,7 @@ static void tidy_object_new(zend_class_entry *class_type, zend_object_handlers *
break;
}
- retval->handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) tidy_object_free_storage, NULL TSRMLS_CC);
+ retval->handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) tidy_object_free_storage, NULL TSRMLS_CC);
retval->handlers = handlers;
}
@@ -633,7 +667,7 @@ static int tidy_doc_cast_handler(zval *in, zval *out, int type, int free TSRMLS_
case IS_STRING:
obj = (PHPTidyObj *)zend_object_store_get_object(in TSRMLS_CC);
tidySaveBuffer (obj->ptdoc->doc, &output);
- ZVAL_STRINGL(out, output.bp, output.size, TRUE);
+ ZVAL_STRINGL(out, output.bp, output.size-1, TRUE);
tidyBufFree(&output);
break;
@@ -665,7 +699,7 @@ static int tidy_node_cast_handler(zval *in, zval *out, int type, int free TSRMLS
case IS_STRING:
obj = (PHPTidyObj *)zend_object_store_get_object(in TSRMLS_CC);
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
- ZVAL_STRINGL(out, buf.bp, buf.size, TRUE);
+ ZVAL_STRINGL(out, buf.bp, buf.size-1, TRUE);
tidyBufFree(&buf);
break;
@@ -686,7 +720,7 @@ static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
if (output.size) {
MAKE_STD_ZVAL(temp);
- ZVAL_STRINGL(temp, output.bp, output.size, TRUE);
+ ZVAL_STRINGL(temp, output.bp, output.size-1, TRUE);
zend_hash_update(obj->std.properties, "value", sizeof("value"), (void *)&temp, sizeof(zval *), NULL);
}
@@ -694,7 +728,7 @@ static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
if (obj->ptdoc->errbuf->size) {
MAKE_STD_ZVAL(temp);
- ZVAL_STRINGL(temp, obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size, TRUE);
+ ZVAL_STRINGL(temp, obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size-1, TRUE);
zend_hash_update(obj->std.properties, "errorBuffer", sizeof("errorBuffer"), (void *)&temp, sizeof(zval *), NULL);
}
}
@@ -714,12 +748,14 @@ static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRM
memset(&buf, 0, sizeof(buf));
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
- buf.bp[buf.size-1] = '\0';
- ADD_PROPERTY_STRING(obj->std.properties, value, buf.bp);
+ ADD_PROPERTY_STRINGL(obj->std.properties, value, buf.bp, buf.size-1);
tidyBufFree(&buf);
ADD_PROPERTY_STRING(obj->std.properties, name, tidyNodeGetName(obj->node));
ADD_PROPERTY_LONG(obj->std.properties, type, tidyNodeGetType(obj->node));
+ ADD_PROPERTY_LONG(obj->std.properties, line, tidyNodeLine(obj->node));
+ ADD_PROPERTY_LONG(obj->std.properties, column, tidyNodeColumn(obj->node));
+ ADD_PROPERTY_BOOL(obj->std.properties, proprietary, tidyNodeIsProp(obj->ptdoc->doc, obj->node));
switch(tidyNodeGetType(obj->node)) {
case TidyNode_Root:
@@ -874,8 +910,10 @@ static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRML
return SUCCESS;
}
-static int php_tidy_parse_string(PHPTidyObj *obj, char *string, char *enc TSRMLS_DC)
-{
+static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *enc TSRMLS_DC)
+{
+ TidyBuffer buf = {0};
+
if(enc) {
if (tidySetCharEncoding(obj->ptdoc->doc, enc) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", enc);
@@ -883,18 +921,18 @@ static int php_tidy_parse_string(PHPTidyObj *obj, char *string, char *enc TSRMLS
}
}
- if (tidyParseString(obj->ptdoc->doc, string) < 0) {
+ tidyBufInit(&buf);
+ tidyBufAppend(&buf, string, len);
+ if (tidyParseBuffer(obj->ptdoc->doc, &buf) < 0) {
+ tidyBufFree(&buf);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", obj->ptdoc->errbuf->bp);
return FAILURE;
- } else {
- tidy_doc_update_properties(obj TSRMLS_CC);
-
- return SUCCESS;
}
-
+ tidyBufFree(&buf);
tidy_doc_update_properties(obj TSRMLS_CC);
-
+
+ return SUCCESS;
}
static void tidy_globals_ctor(void *global TSRMLS_DC)
@@ -945,7 +983,7 @@ 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.56.2.5 2005/02/08 05:29:48 rasmus Exp $)");
+ php_info_print_table_row(2, "Extension Version", PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.3 2005/11/14 22:03:02 tony2001 Exp $)");
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
@@ -979,7 +1017,12 @@ PHP_FUNCTION(ob_tidyhandler)
TIDY_SET_DEFAULT_CONFIG(doc);
if (input_len > 1) {
- if (tidyParseString(doc, input) < 0 || tidyCleanAndRepair(doc) < 0) {
+ TidyBuffer buf = {0};
+
+ tidyBufInit(&buf);
+ tidyBufAppend(&buf, input, input_len);
+
+ if (tidyParseBuffer(doc, &buf) < 0 || tidyCleanAndRepair(doc) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf.bp);
RETVAL_NULL();
} else {
@@ -987,10 +1030,12 @@ PHP_FUNCTION(ob_tidyhandler)
tidyBufInit(&output);
tidySaveBuffer(doc, &output);
- RETVAL_STRING(output.bp, 1);
+ RETVAL_STRINGL(output.bp, output.size-1, 1);
tidyBufFree(&output);
}
+
+ tidyBufFree(&buf);
} else {
RETVAL_NULL();
}
@@ -1020,7 +1065,7 @@ PHP_FUNCTION(tidy_parse_string)
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if(php_tidy_parse_string(obj, input, enc TSRMLS_CC) == FAILURE) {
+ if(php_tidy_parse_string(obj, input, input_len, enc TSRMLS_CC) == FAILURE) {
zval_dtor(return_value);
INIT_ZVAL(*return_value);
RETURN_FALSE;
@@ -1036,7 +1081,7 @@ PHP_FUNCTION(tidy_get_error_buffer)
TIDY_FETCH_OBJECT;
if (obj->ptdoc->errbuf && obj->ptdoc->errbuf->bp) {
- RETURN_STRING(obj->ptdoc->errbuf->bp, 1);
+ RETURN_STRINGL(obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size-1, 1);
} else {
RETURN_FALSE;
}
@@ -1052,7 +1097,7 @@ PHP_FUNCTION(tidy_get_output)
tidySaveBuffer(obj->ptdoc->doc, &output);
- RETVAL_STRING(output.bp, 1);
+ RETVAL_STRINGL(output.bp, output.size-1, 1);
tidyBufFree(&output);
}
@@ -1063,7 +1108,7 @@ PHP_FUNCTION(tidy_get_output)
PHP_FUNCTION(tidy_parse_file)
{
char *inputfile, *enc = NULL;
- int input_len, enc_len = 0;
+ int input_len, contents_len, enc_len = 0;
zend_bool use_include_path = 0;
char *contents;
zval *options = NULL;
@@ -1079,14 +1124,14 @@ PHP_FUNCTION(tidy_parse_file)
tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC);
obj = (PHPTidyObj *) zend_object_store_get_object(return_value TSRMLS_CC);
- if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path TSRMLS_CC))) {
+ if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path, &contents_len TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include path)" : "");
RETURN_FALSE;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if(php_tidy_parse_string(obj, contents, enc TSRMLS_CC) == FAILURE) {
+ if(php_tidy_parse_string(obj, contents, contents_len, enc TSRMLS_CC) == FAILURE) {
zval_dtor(return_value);
INIT_ZVAL(*return_value);
RETVAL_FALSE;
@@ -1158,6 +1203,48 @@ 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)
+{
+ PHPTidyObj *obj;
+ char *optname, *optval;
+ int optname_len;
+ TidyOption opt;
+
+ TIDY_SET_CONTEXT;
+
+ if (object) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+ } else {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+ }
+
+ obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC);
+
+ opt = tidyGetOptionByName(obj->ptdoc->doc, optname);
+
+ if (!opt) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
+ RETURN_FALSE;
+ }
+
+ if ( (optval = (char *) tidyOptGetDoc(obj->ptdoc->doc, opt)) ) {
+ RETURN_STRING(optval, 1);
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+#endif
+
+
/* {{{ proto array tidy_get_config()
Get current Tidy configuarion */
PHP_FUNCTION(tidy_get_config)
@@ -1339,7 +1426,7 @@ PHP_FUNCTION(tidy_getopt)
TIDY_DOC_METHOD(__construct)
{
char *inputfile = NULL, *enc = NULL;
- int input_len = 0, enc_len = 0;
+ int input_len = 0, enc_len = 0, contents_len = 0;
zend_bool use_include_path = 0;
char *contents;
zval *options = NULL;
@@ -1355,14 +1442,14 @@ TIDY_DOC_METHOD(__construct)
obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC);
if (inputfile) {
- if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path TSRMLS_CC))) {
+ if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path, &contents_len TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include path)" : "");
return;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- php_tidy_parse_string(obj, contents, enc TSRMLS_CC);
+ php_tidy_parse_string(obj, contents, contents_len, enc TSRMLS_CC);
efree(contents);
}
@@ -1371,7 +1458,7 @@ TIDY_DOC_METHOD(__construct)
TIDY_DOC_METHOD(parseFile)
{
char *inputfile, *enc = NULL;
- int input_len, enc_len = 0;
+ int input_len, enc_len = 0, contents_len = 0;
zend_bool use_include_path = 0;
char *contents;
zval *options = NULL;
@@ -1386,14 +1473,14 @@ TIDY_DOC_METHOD(parseFile)
RETURN_FALSE;
}
- if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path TSRMLS_CC))) {
+ if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path, &contents_len TSRMLS_CC))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include path)" : "");
RETURN_FALSE;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if(php_tidy_parse_string(obj, contents, enc TSRMLS_CC) == FAILURE) {
+ if(php_tidy_parse_string(obj, contents, contents_len, enc TSRMLS_CC) == FAILURE) {
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -1419,7 +1506,7 @@ TIDY_DOC_METHOD(parseString)
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if(php_tidy_parse_string(obj, input, enc TSRMLS_CC) == SUCCESS) {
+ if(php_tidy_parse_string(obj, input, input_len, enc TSRMLS_CC) == SUCCESS) {
RETURN_TRUE;
}
diff --git a/ext/tokenizer/php_tokenizer.h b/ext/tokenizer/php_tokenizer.h
index c4485243c..4f069c3e2 100644
--- a/ext/tokenizer/php_tokenizer.h
+++ b/ext/tokenizer/php_tokenizer.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_tokenizer.h,v 1.8 2004/01/08 17:32:57 sniper Exp $ */
+/* $Id: php_tokenizer.h,v 1.9 2005/08/03 14:08:19 sniper Exp $ */
#ifndef PHP_TOKENIZER_H
#define PHP_TOKENIZER_H
diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c
index 009ca5789..e05bef24a 100644
--- a/ext/tokenizer/tokenizer.c
+++ b/ext/tokenizer/tokenizer.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: tokenizer.c,v 1.29.2.1 2004/12/30 15:23:07 sniper Exp $ */
+/* $Id: tokenizer.c,v 1.31.2.3 2005/11/27 06:41:31 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -282,7 +282,8 @@ PHP_MINIT_FUNCTION(tokenizer)
REGISTER_LONG_CONSTANT("T_THROW", T_THROW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_TRY", T_TRY, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("T_CLONE", T_CLONE, CONST_CS | CONST_PERSISTENT);
-
+ REGISTER_LONG_CONSTANT("T_HALT_COMPILER", T_HALT_COMPILER, CONST_CS | CONST_PERSISTENT);
+
return SUCCESS;
}
/* }}} */
@@ -343,6 +344,8 @@ static void tokenize(zval *return_value TSRMLS_DC)
while ((token_type = lex_scan(&token TSRMLS_CC))) {
destroy = 1;
switch (token_type) {
+ case EOF:
+ zendleng--; /* don't count EOF */
case T_OPEN_TAG:
case T_OPEN_TAG_WITH_ECHO:
case T_WHITESPACE:
@@ -495,6 +498,7 @@ get_token_type_name(int token_type)
case T_THROW: return "T_THROW";
case T_TRY: return "T_TRY";
case T_CLONE: return "T_CLONE";
+ case T_HALT_COMPILER: return "T_HALT_COMPILER";
}
return "UNKNOWN";
}
@@ -519,6 +523,8 @@ PHP_FUNCTION(token_get_all)
RETURN_EMPTY_STRING();
}
+ LANG_SCNG(start) = 1;
+
tokenize(return_value TSRMLS_CC);
zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
diff --git a/ext/w32api/CREDITS b/ext/w32api/CREDITS
deleted file mode 100644
index 8d55cfc6b..000000000
--- a/ext/w32api/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-W32API
-James Moore
diff --git a/ext/w32api/README b/ext/w32api/README
deleted file mode 100644
index 087edff0f..000000000
--- a/ext/w32api/README
+++ /dev/null
@@ -1,5 +0,0 @@
-Win 32 API Extension
-====================
-/* $Revision: 1.2 $ */
-
-See notes in w32api.c \ No newline at end of file
diff --git a/ext/w32api/TODO b/ext/w32api/TODO
deleted file mode 100644
index 771ad3b38..000000000
--- a/ext/w32api/TODO
+++ /dev/null
@@ -1,3 +0,0 @@
- TODO
- ====
-.... LOTS .... \ No newline at end of file
diff --git a/ext/w32api/package.xml b/ext/w32api/package.xml
deleted file mode 100644
index ddcbdb022..000000000
--- a/ext/w32api/package.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>w32api</name>
- <summary>Win32 and DLL API interface functions</summary>
- <maintainers>
- <maintainer>
- <user>jmoore</user>
- <name>James Moore</name>
- <email>jmoore@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-This extension is a generic extension API to DLLs.
-This was originally written to allow access to the Win32 API from PHP,
-although you can also access other functions exported via other DLLs.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support intallation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="README"/>
- <file role="doc" name="TODO"/>
- <file role="src" name="w32api.dsp"/>
- <file role="src" name="w32api.c"/>
- <file role="src" name="w32api_function_definition_parser.y"/>
- <file role="src" name="w32api_function_definition_scanner.l"/>
- <file role="src" name="w32api_type_definition_parser.y"/>
- <file role="src" name="w32api_type_definition_scanner.l"/>
- <file role="src" name="php_w32api.h"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="windows"/> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/w32api/php_w32api.h b/ext/w32api/php_w32api.h
deleted file mode 100644
index 9672db7aa..000000000
--- a/ext/w32api/php_w32api.h
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2001 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: James Moore <jmoore@php.net> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: php_w32api.h,v 1.6 2003/06/10 20:03:40 imajes Exp $ */
-
-#if HAVE_W32API
-
-#ifndef PHP_W32API_H
-#define PHP_W32API_H
-
-/* ================================================================================================
- * Type Definitions
- * ================================================================================================
- */
-typedef struct _w32api_lib_handle w32api_lib_handle;
-typedef struct _w32api_func_handle w32api_func_handle;
-typedef struct _w32api_type_handle w32api_type_handle;
-typedef struct _w32api_type_instance w32api_type_instance;
-typedef struct _arguments arguments;
-typedef struct _argument argument;
-typedef union _w32api_parser_function_definition_union w32api_parser_function_definition_union;
-typedef struct _w32api_func_handle_ptr w32api_func_handle_ptr;
-typedef struct _w32api_type_handle_ptr w32api_type_handle_ptr;
-typedef union _w32api_parser_type_definition_union w32api_parser_type_definition_union;
-typedef struct _member member;
-typedef struct _members members;
-typedef union _w32api_result w32api_result;
-typedef struct _w32api_dynamic_param w32api_dynamic_param;
-
-struct _w32api_lib_handle
-{
- HINSTANCE handle; /* Handle for our library */
- char *library_name; /* name of our library */
- int ref_count; /* reference counter */
-};
-
-struct _w32api_func_handle_ptr /* Temporary structure */
-{ /* To work around problems */
- w32api_func_handle *hnd; /* at 3am.. Ill sort it out */
-}; /* When I can think straight */
-
-struct _w32api_type_handle_ptr /* Ditto.. should really combine */
-{ /* These two into a union at least */
- w32api_type_handle *hnd;
-};
-
-struct _w32api_type_handle
-{
- char *type_name; /* Name of our type */
- long size; /* Size of type */
- members *member_list; /* Pointer List of members */
- long member_count; /* Number of members */
-};
-
-struct _w32api_type_instance
-{
- w32api_type_handle *type; /* pointer to w32api_type_handle */
- zval **values; /* First element of an array of ptr's to zvals */
-};
-
-struct _w32api_func_handle
-{
- FARPROC handle; /* Handle for our function */
- w32api_lib_handle *lib; /* Pointer to the library handle */
- char *function_name; /* Name of our function (Alias is store if supplied) */
- long return_type_id; /* ID of return type */
- char *return_type_name; /* Name of return type (if W32API_COMPLEX) */
- long flags; /* Flags for function */
- arguments *argument_list; /* Pointer List of arguments */
-};
-
-struct _arguments
-{
- argument *arg; /* Current Argument */
- arguments *next_arg; /* Next Arugment */
- arguments *prev_arg; /* Previous Argument */
-};
-
-struct _argument
-{
- long type_id; /* ID of the return type */
- char *type_name; /* Name of type (if W32API_COMPLEX) */
- char *argument_name; /* Name of argument, currently not used */
- long flags; /* Currently used for byref/byval */
-};
-
-struct _member
-{
- char *member_name;
- long member_type_id;
- char *member_type_name;
- long flags;
- long offset;
-};
-
-struct _members
-{
- member *member;
- members *next_member;
- members *prev_member;
-};
-
-union _w32api_result
-{
- int ival;
- unsigned long lval;
- DWORD dwval;
- void *ptr;
- float fval;
- double dval;
- __int64 i64val;
-};
-
-struct _w32api_dynamic_param
-{
- long flags;
- int width;
- union {
- unsigned long argument;
- void *argument_ptr;
- };
-};
-
-
-union _w32api_parser_function_definition_union
-{
- char *s;
- arguments *arg;
-};
-
-union _w32api_parser_type_definition_union
-{
- char *s;
- members *type;
-};
-
-/* ================================================================================================
- * Constants
- * ================================================================================================
- */
-
-/* Recognised Base types */
-#define W32API_UNKNOWN -1
-#define W32API_NULL 1
-#define W32API_INT 2
-#define W32API_LONG 3
-#define W32API_DOUBLE 4
-#define W32API_FLOAT 5
-#define W32API_STRING 6
-#define W32API_BYTE 7
-#define W32API_BOOL 8
-#define W32API_COMPLEX 9
-
-/* Function Flags */
-#define W32API_ARGPTR (1<<0)
-#define W32API_BORLAND (1<<1)
-#define W32API_CDECL (1<<2)
-#define W32API_REAL4 (1<<3)
-#define W32API_REAL8 (1<<4)
-
-/* ================================================================================================
- * Utility Macros
- * ================================================================================================
- */
-#define PROP_SET_ARGS zend_property_reference *property_reference, pval *value
-#define PROP_GET_ARGS zend_property_reference *property_reference
-
-#define W32API_PROP_SET_FUNCTION_N(class_name) w32api_set_property_handler_##class_name
-#define W32API_PROP_GET_FUNCTION_N(class_name) w32api_get_property_handler_##class_name
-#define W32API_CALL_FUNCTION_N(class_name) w32api_call_handler_##class_name
-
-#define W32API_PROP_SET_FUNCTION(class_name) PHP_W32API_API int W32API_PROP_SET_FUNCTION_N(class_name)(PROP_SET_ARGS)
-#define W32API_PROP_GET_FUNCTION(class_name) PHP_W32API_API zval W32API_PROP_GET_FUNCTION_N(class_name)(PROP_GET_ARGS)
-#define W32API_CALL_FUNCITON(class_name) PHP_W32API_API void W32API_CALL_FUNCTION_N(class_name)(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
-
-#define W32API_CLASS_FUNCTION(class_name, function_name) PHP_FUNCTION(##class_name##function_name)
-#define W32API_CLASS_FN(class_name, function_name) PHP_FN(##class_name##function_name)
-#define W32API_CLASS_FE(class_name, function_name, function_args) {#function_name, W32API_CLASS_FN(class_name, function_name), function_args},
-
-/* ================================================================================================
- * Module exports, Global Variables and General Definitions
- * ================================================================================================
- */
-extern zend_module_entry w32api_module_entry;
-#define phpext_w32api_ptr &w32api_module_entry;
-
-#define PHP_W32API_API __declspec(dllexport)
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif /* ZTS */
-
-ZEND_BEGIN_MODULE_GLOBALS(w32api)
- zend_class_entry *win32_ce; /* The class entry for our win32 class */
- zend_class_entry *type_ce; /* The class entry for our type class */
- HashTable *funcs; /* Functions we registered */
- HashTable *libraries; /* Libraries we load using LoadLibrary */
- HashTable *types; /* Types we have registed with us */
- HashTable *callbacks; /* Callbacks we have registered with us */
- long le_type_instance; /* Resource hanlde for runtime instances */
-ZEND_END_MODULE_GLOBALS(w32api)
-
-ZEND_DECLARE_MODULE_GLOBALS(w32api)
-
-#ifdef ZTS
-#define WG(v) TSRMG(w32api_globals_id, zend_w32api_globals *, v)
-#else
-#define WG(v) (w32api_globals.v)
-#endif
-
-
-/* ================================================================================================
- * Startup, Shutdown and Info Functions
- * ================================================================================================
- */
-PHP_MINIT_FUNCTION(w32api);
-PHP_MSHUTDOWN_FUNCTION(w32api);
-PHP_RINIT_FUNCTION(w32api);
-PHP_RSHUTDOWN_FUNCTION(w32api);
-PHP_MINFO_FUNCTION(w32api);
-static void php_w32api_init_globals(zend_w32api_globals *w32api_globals);
-static void php_w32api_hash_lib_dtor(void *data);
-static void php_w32api_hash_func_dtor(void *data);
-static void php_w32api_hash_callback_dtor(void *data);
-static void php_w32api_hash_type_dtor(void *data);
-static void w32api_type_instance_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC);
-
-/* ================================================================================================
- * Win32 Class Functions
- * ================================================================================================
- */
-int win32_class_init(TSRMLS_D);
-int win32_class_rshutdown(TSRMLS_D);
-W32API_CLASS_FUNCTION(win32, registerfunction);
-W32API_CLASS_FUNCTION(win32, unregisterfunction);
-W32API_CLASS_FUNCTION(win32, registercallback);
-W32API_CLASS_FUNCTION(win32, definetype);
-W32API_CLASS_FUNCTION(win32, gettypesize);
-W32API_CLASS_FUNCTION(win32, inittype);
-W32API_CLASS_FUNCTION(win32, decref);
-W32API_CLASS_FUNCTION(win32, invokefunction);
-
-
-/* ================================================================================================
- * Type Class Functions
- * ================================================================================================
- */
-int type_class_init(TSRMLS_DC);
-
-W32API_CLASS_FUNCTION(type, clone);
-W32API_PROP_SET_FUNCTION(type);
-W32API_PROP_GET_FUNCTION(type);
-
-/* ================================================================================================
- * Utility Functions
- * ================================================================================================
- */
-
-static int php_w32api_load_function (char *definition, int definition_len, int flags TSRMLS_DC);
-static void php_w32api_unload_function (w32api_func_handle **fh TSRMLS_DC);
-
-static int php_w32api_load_library (char *library_name, w32api_lib_handle **lh TSRMLS_DC);
-static void php_w32api_unload_library (w32api_lib_handle *lh, int flags TSRMLS_DC);
-
-static int php_w32api_register_callback(char *function_definition, int function_definition_len TSRMLS_DC);
-
-static void php_w32api_free_arguments(arguments *argument_list);
-static void php_w32api_free_members(members *member_list);
-
-static int php_w32api_get_type_id_from_name(char *type);
-static unsigned char *php_w32api_do_arg_types(arguments **arguments);
-
-void php_w32api_marshall_zval_to_c(argument *arg, w32api_dynamic_param *dp, zval *pzval TSRMLS_DC);
-
-static void php_w32api_init_type(w32api_type_handle *th, zval *obj TSRMLS_DC);
-static int php_w32api_do_prop_get(zval *object, zval *return_value, zend_llist_element **element TSRMLS_DC);
-static int php_w32api_do_prop_set(zval *object, zval *value, zend_llist_element **element TSRMLS_DC);
-static void *php_w32api_complex_marshall_zval_to_c(zval *pzval, int *width, void *data TSRMLS_DC);
-
-/* ================================================================================================
- * Parser & Scanner Functions
- * ================================================================================================
- */
-#define w32api_parser_load_alias_function w32api_parser_load_function_ex
-#define w32api_parser_load_function(return_type, function_name, arguments, library_name) w32api_parser_load_function_ex (return_type, function_name, NULL, arguments, library_name)
-#define w32api_parser_make_argument_byref(arg_type, arg_name) w32api_parser_make_argument(arg_type, arg_name, BYREF_FORCE)
-#define w32api_parser_make_argument_byval(arg_type, arg_name) w32api_parser_make_argument(arg_type, arg_name, BYREF_NONE)
-
-#define w32api_parser_type_make_byref_value(member_name, member_type) w32api_parser_type_make_value(member_name, member_type, BYREF_FORCE)
-#define w32api_parser_type_make_byval_value(member_name, member_type) w32api_parser_type_make_value(member_name, member_type, BYREF_NONE)
-
-w32api_func_handle *w32api_parser_load_function_ex(char *return_type, char *function_name, char *alias_name, arguments *argument_list, char *library_name);
-arguments *w32api_parser_make_argument(char *arg_type, char *arg_name, int byref);
-arguments *w32api_parser_join_arguments(arguments *lval, arguments *rval);
-int w32api_function_definition_error(char *s);
-
-w32api_type_handle *w32api_parser_register_type(char *type_name, members *member_list);
-members *w32api_parser_type_make_value(char *member_name, char *type_name, long flags);
-members *w32api_parser_type_join_values(members *lval, members *rval);
-int w32api_type_definition_error(char *s);
-
-struct yy_buffer_state *w32api_function_definition_scan_bytes(char *bytes, int len); /* Definied in w32api_function_definition_scanner.c */
-int w32api_function_definition_parse(void *fh); /* Definied in w32api_function_definition_parser.c */
-
-struct yy_buffer_state *w32api_type_definition_scan_bytes(char *bytes, int len); /* Definied in w32api_type_definition_scanner.c */
-int w32api_type_definition_parse(void *th); /* Definied in w32api_type_definition_parser.c */
-
-
-/* ================================================================================================
- * Various Debugging Functions
- * ================================================================================================
- */
-#ifndef NDEBUG
-W32API_CLASS_FUNCTION(win32, dump_library_hash);
-W32API_CLASS_FUNCTION(win32, dump_function_hash);
-W32API_CLASS_FUNCTION(win32, dump_callback_hash);
-W32API_CLASS_FUNCTION(win32, dump_type_hash);
-
-int php_w32api_dump_library_hash_cb(void *pData TSRMLS_DC);
-int php_w32api_dump_function_hash_cb(void *pData TSRMLS_DC);
-int php_w32api_dump_callback_hash_cb(void *pData TSRMLS_DC);
-int php_w32api_dump_type_hash_cb(void *pData TSRMLS_DC);
-
-void php_w32api_print_arguments(arguments *argument_list);
-void php_w32api_print_members(members *member_list);
-
-#endif /* ifndef NDEBUG */
-
-#endif /* ifndef PHP_W32API_H */
-#endif /* if HAVE_W32API */ \ No newline at end of file
diff --git a/ext/w32api/w32api.c b/ext/w32api/w32api.c
deleted file mode 100644
index 966c23c59..000000000
--- a/ext/w32api/w32api.c
+++ /dev/null
@@ -1,2293 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2001 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: James Moore <jmoore@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: w32api.c,v 1.16 2004/07/10 07:46:09 andi Exp $ */
-
-/*
- * Win32 API Extension for PHP
- * ===========================
- *
- * This extension allows PHP Developers to access the underlying functions in the
- * Win32 API Dll's in a generic way, it provides a mechanism for the user to load
- * and register functions from dll's and then to call them, it also implements a
- * generic callback handler which allows the user to pass a pointer to one of
- * their PHP functions to act as a callback from the C function enabling the PHP
- * programmer to handle callbacks in PHP seemlessly. Finally the extension marshalls
- * from PHP types (Zvals) to C structures seemlessly once it has been told about them
- *
- * I would like to thank Ton Plooy for his article on a similar subject which gave me
- * the initial idea for a generic dll caller and some good pointers on how to actaully
- * implement it.
- */
-
-/*
- * Interface the PHP Programmer Sees
- * ==================================
- *
- * To keep namespaces tidy the module will introduce two classes, the first is
- * the win32 class which has several functions to load and register functions from
- * the underlying DLL's. The Win32 class also has functions for informing the
- * module about the C types we will be using so it can marshall and demarshall to and from
- * the C Interface. . Our second class is the Type class. The type class is our container
- * for complex C types which are registered and initiated using our win32 class functions.
- *
- * Win32 Class Functions
- * =====================
- *
- * static int Win32::RegisterFunction( string Definition, long flags )
- * -------------------------------------------------------------------
- *
- * This function is used for registering a dll function with the module. The Definition should take
- * the form:
- * Definition: <return_type> <function_name> [Alias <alias_name] (<argument_list>) From <some_dll>
- *
- * return_type :- Either a simple type or a type that has
- * been registered with the module
- *
- * function_name :- The name of the function within the dll, if this is not found
- * we append an A to the function name to check for a ASCII version,
- * if this is not found we fail.
- *
- * alias_name :- If this is provided then we register the function under this name
- * in the PHP Symbol table.
- *
- * argument_list :- A comma seperated list of arguments in the form <argument_type>
- * [&]argument_name.
- *
- * argument_type :- Argument type is a type known to the module
- *
- * argument_name :- This is not currently used although if it is proceeded by an
- * & (Ampersand) then a pointer is passed rather than the value.
- *
- * some_dll :- This is the name of the dll to find the function in.
- *
- * On success the function returns TRUE, on error FALSE, The function issues appropriate errors
- * to allow the PHP Progammer to catch individual errors.
- *
- * static int Win32::UnregisterFunction(string FunctionName)
- * ---------------------------------------------------------
- *
- * Allows the PHP programmer to force a function to be unregistered saving on memory resources. Can
- * be useful in long running scripts.
- *
- * Returns TRUE on success, FALSE on error.
- *
- *
- * static int Win32::DefineType( string Definition )
- * -------------------------------------------------
- *
- * This function is used to register a C-Type which will be used when calling a function, it only
- * supports the equivilent of C structures at this time so if you need to use a union you must use the
- * largest member of that union as the type in the struct for this to work.
- *
- * The definition string takes the form:
- *
- * Definition: <type_name> { <type_list> }
- *
- * type_name :- A unique name for this type.
- *
- * type_list :- Takes for form <member_type> [&]<member_name>
- *
- * member_type :- The type of this member.
- *
- * member_name :- The name for this member, if an & (ampersand) preceeds
- * the name it will be stripped and a pointer rather than
- * the value will be used.
- *
- * Returns TRUE on success, FALSE on error.
- *
- *
- * static int Win32::GetTypeSize(mixed TypeHandle)
- * -----------------------------------------------
- *
- * This function returns the size of a type registered with the module. The parameter should
- * either be the name of the type or an instance of it. The Function returns FALSE on error
- * ***USE === to distinguish between this and a size of 0*** or the size of the type on success.
- *
- *
- * static mixed Win32::InitType(String TypeName)
- * ---------------------------------------------
- *
- * Creates an instance of the type so that the PHP Programmer can assign values and then pass
- * it to a C Function. Returns NULL on error.
- *
- * static int Win32::DecRef(mixed var)
- * -----------------------------------
- * Decreases the reference count on a variable only if we incremented the refcount when passing
- * the variable to a C function.
- *
- * TYPE Functions
- * ==============
- *
- * mixed Type::Type(String TypeName)
- * ---------------------------------
- * See Win32::InitType,
- *
- * mixed Type::Clone()
- * -------------------
- *
- * Allows you to make an exact copy of the class, this should be used rather than the &= syntax
- * Due to the nesting within classes. This function WILL become redundant in PHP 5.
- */
-
-/*
- * Implementation Details
- * ======================
- *
- * This module will only work on the Intel platform.
- *
- * We basically want to set up this structure:
- *
- * +-----------+
- * | PHP |
- * +-----------+
- * Call | /|\
- * \|/ | call_user_function_ex
- * +------------------------+
- * | Win 32 API Extension |
- * +------------------------+
- * | /|\
- * \|/ | Callback
- * +-------------+
- * | C-Space |
- * +-------------+
- *
- * Win32 Needs to then Marshall between zvals and
- *
- * Marshalling from ZVAL's to C Types.
- * -----------------------------------
- * For simple types this is very easy as we either just copy the value or a pointer
- * to it onto the stack, if we copy a pointer then we must increase the refcount on
- * the zval and must also make sure we get it passed to us by reference.
- *
- * The problem here is when to dereference the zval again as we may get into the following
- * situation
- *
- * We call somefunction giving it an argument by reference (IE we pass a pointer to the value union of a zval)
- * we must increase the ref count on the zval to avoid the possibility of a GPE (IE the zval is dtord and then
- * the function uses the zval in some sort of callback we could end up with a GPE)
- * But if we increase the zval's refcount without dtoring it anywhere it would cause a mem leak.
- *
- * Therefore we probably need to keep a local reference table so we can either allow the user to call
- * Win32::DecRef($var) to decrement the reference count (We would want to keep a local table to avoid anyone
- * breaking Zend's handling off it as well..))
- *
- * Then at MSHUTDOWN we free this hashtable decrementing the refcount as needed..
- *
- * Complex types are less clear cut on how to handle them. My prefered method is to always
- * keep these in a C Format but to allow access to these via a wrapper object which calculates
- * the offset of the data to allow access to it from PHP. This also allows us to do no conversion
- * when dealing with C types coming to us allowing us to deal with pointers in a more clear way.
- *
- *
- * Enabling C Code to call PHP Code in a generic fashion
- * -----------------------------------------------------
- * What we do here is we use _declspec(naked) to tell the compiler we will handle all stack operations
- * ourself, we also then create (At runtime) function prologues which we place on the heap which push
- * extra arguments onto the stack which tell us which php_function is being called back and the callback type
- * which has been registered with us.
- *
- */
-
-#if HAVE_W32API
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "ext/standard/php_string.h"
-#include "php_w32api.h"
-
-
-/* =====================================================================================================
- * PHP Module Startup, Shutdown & Info Code
- * =====================================================================================================
- */
-
-#ifdef COMPILE_DL_W32API
-ZEND_GET_MODULE(w32api)
-#endif
-
-/* {{{ w32api_module_entry
- */
-zend_module_entry w32api_module_entry = {
- STANDARD_MODULE_HEADER,
- "Win32 API",
- NULL, /* We define no global functions */
- PHP_MINIT(w32api),
- PHP_MSHUTDOWN(w32api),
- PHP_RINIT(w32api),
- PHP_RSHUTDOWN(w32api),
- PHP_MINFO(w32api),
- "0.2",
- STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(w32api)
-{
- /* Setup out module globals */
- ZEND_INIT_MODULE_GLOBALS(w32api, php_w32api_init_globals, NULL);
-
-
- if(win32_class_init(TSRMLS_C) != SUCCESS)
- {
- return FAILURE;
- }
-
- if(type_class_init(TSRMLS_C) != SUCCESS)
- {
- return FAILURE;
- }
-
- WG(le_type_instance) = zend_register_list_destructors_ex(w32api_type_instance_dtor, NULL, "Type Instance", module_number);
-
- /* Function Flags */
- REGISTER_LONG_CONSTANT( "W32API_ARGPTR", W32API_ARGPTR, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT( "W32API_BORLAND", W32API_BORLAND, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT( "W32API_CDECL", W32API_CDECL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT( "W32API_REAL4", W32API_REAL4, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT( "W32API_REAL8", W32API_REAL8, CONST_CS | CONST_PERSISTENT);
-
-
- return SUCCESS;
-
-};
-/* }}} */
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(w32api)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RINIT_FUNCTION
- */
-PHP_RINIT_FUNCTION(w32api)
-{
- HashTable *tmp;
- WG(funcs) = WG(libraries) = WG(callbacks) = WG(types) = NULL;
-
- /* Allocate Request Specific HT's here
- */
- ALLOC_HASHTABLE(tmp);
- zend_hash_init(tmp, 1, NULL, php_w32api_hash_func_dtor, 1);
- WG(funcs) = tmp;
-
- ALLOC_HASHTABLE(tmp);
- zend_hash_init(tmp, 1, NULL, php_w32api_hash_lib_dtor, 1);
- WG(libraries) = tmp;
-
- ALLOC_HASHTABLE(tmp);
- zend_hash_init(tmp, 1, NULL, php_w32api_hash_callback_dtor, 1);
- WG(callbacks) = tmp;
-
- ALLOC_HASHTABLE(tmp);
- zend_hash_init(tmp, 1, NULL, php_w32api_hash_type_dtor, 1);
- WG(types) = tmp;
-
- return SUCCESS;
-
-};
-/* }}} */
-
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(w32api)
-{
-
- win32_class_rshutdown(TSRMLS_C);
-
- /* Must be dtor'd before libraries */
- zend_hash_destroy(WG(funcs));
- FREE_HASHTABLE(WG(funcs));
-
- zend_hash_destroy(WG(libraries));
- FREE_HASHTABLE(WG(libraries)); /* we may only want to do this on MSHUTDOWN but for now it can be here */
-
- zend_hash_destroy(WG(callbacks));
- FREE_HASHTABLE(WG(callbacks));
-
- zend_hash_destroy(WG(types));
- FREE_HASHTABLE(WG(types));
-
- WG(funcs) = WG(libraries) = WG(callbacks) = WG(types) = NULL;
-
- return SUCCESS;
-}
-/* }}} */
-
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(w32api)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "Win32 API Support", "enabled" );
- php_info_print_table_end();
-}
-/* }}} */
-
-/* {{{ php_w32api_init_globals
- */
-static void php_w32api_init_globals(zend_w32api_globals *w32api_globals)
-{
- w32api_globals->win32_ce = NULL;
- w32api_globals->type_ce = NULL;
- w32api_globals->funcs = NULL;
- w32api_globals->libraries = NULL;
- w32api_globals->callbacks = NULL;
- w32api_globals->types = NULL;
-}
-/* }}} */
-
-/* {{{ php_w32api_hash_lib_dtor (void *data)
- * Dtor function called when hash is destroied, unloads library
- */
-static void php_w32api_hash_lib_dtor(void *data)
-{
- w32api_lib_handle *lh; /* Library Handle */
- TSRMLS_FETCH(); /* Get thread safe stuff */
- lh = (w32api_lib_handle *)data;
-
- FreeLibrary(lh->handle);
- efree(lh->library_name);
-}
-/* }}} */
-
-/* {{{ php_w32api_hash_func_dtor (void *data)
- * Dtor function called when hash is destroied, unloads function.
- */
-static void php_w32api_hash_func_dtor(void *data)
-{
- w32api_func_handle **fh; /* Function Handle */
- TSRMLS_FETCH(); /* Get thread safe stuff */
-
- fh = (w32api_func_handle **)data;
- php_w32api_unload_function(fh TSRMLS_CC);
-}
-/* }}} */
-
-/* {{{ php_w32api_hash_callback_dtor
- * DTOR function called when hash is destroied, removes callback.
- */
-static void php_w32api_hash_callback_dtor(void *data)
-{
- w32api_func_handle **fh;
-
- fh = (w32api_func_handle **)data;
-
- php_w32api_free_arguments((*fh)->argument_list);
- efree((*fh)->function_name);
-
- if((*fh)->return_type_name)
- efree((*fh)->return_type_name);
-
- efree(*fh);
-}
-
-/* {{{ php_w32api_hash_type_dtor
- * DTOR function called when hash is destroied, removes callback.
- */
-static void php_w32api_hash_type_dtor(void *data)
-{
- w32api_type_handle **th;
-
- th = (w32api_type_handle **)data;
-
- php_w32api_free_members((*th)->member_list);
- efree((*th)->type_name);
- efree(*th);
-}
-
-static void w32api_type_instance_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-{
- w32api_type_instance *ti;
- int i = 0;
-
- if(!rsrc || !rsrc->ptr)
- return;
-
- ti = (w32api_type_instance *)rsrc->ptr;
-
- for(i = 0; i < ti->type->member_count; i++)
- {
- if(ti->values[i])
- zval_ptr_dtor(&ti->values[i]);
- }
-
- efree(ti);
-
- return;
-}
-/* =====================================================================================================
- * Utility Functions
- * =====================================================================================================
- */
-
-/* {{{ php_w32api_unload_library
- * Expects two arguments, the first is the pointer to a w32api_lib_handle
- * and the second is a flag, if the flag is 0 then the reference counter is
- * use if it is one then the library is unloaded irrespective of the reference
- * counter
- */
-static void php_w32api_unload_library (w32api_lib_handle *lh, int flags TSRMLS_DC)
-{
-
- if(flags == 0)
- {
- lh->ref_count--;
- }
-
- if((flags == 1) || (lh->ref_count == 0))
- {
- /* remove outselves from the hashtable */
- zend_hash_del(WG(libraries), lh->library_name, strlen(lh->library_name) + 1);
- }
-}
-/* }}} */
-
-/* {{{ php_w32api_unload_function
- * Expects one argument, a pointer to a w32api_func_handle, unloads this
- * function from both the function table internally and the PHP function
- * table then it decrements the reference counter on the library.
- */
-static void php_w32api_unload_function (w32api_func_handle **fh TSRMLS_DC)
-{
- zend_function *function = NULL;
-
- efree((*fh)->return_type_name);
- php_w32api_free_arguments((*fh)->argument_list);
-
- /* If needs be we need to retrieve function ptr from hash table
- * and free anything we allocate when creating them at runtime (most notably
- * arg_types
- */
- if(zend_hash_find( &WG(win32_ce)->function_table,
- (*fh)->function_name,
- strlen((*fh)->function_name) + 1,
- (void **)&function) == SUCCESS)
- {
- zend_internal_function *internal_function = (zend_internal_function *)function;
- if(internal_function->arg_types)
- efree(internal_function->arg_types);
- }
-
- /* Remove from Function Table */
- zend_hash_del(&WG(win32_ce)->function_table, (*fh)->function_name, strlen((*fh)->function_name) + 1);
- php_w32api_unload_library((*fh)->lib, 0 TSRMLS_CC);
-
- efree((*fh)->function_name);
- efree(*fh);
-
-}
-/* }}} */
-
-/* {{{ php_w32api_load_function
- * Expects three arguments, The definition of the function in string format, the definitions length
- * and a pointer to a pointer to a function handle. returns SUCCESS or FAILURE.
- */
-static int php_w32api_load_function (char *definition, int definition_len, int flags TSRMLS_DC)
-{
- zend_function function;
- zend_internal_function *internal_function = (zend_internal_function *)&function;
- w32api_func_handle **fh;
- w32api_func_handle_ptr hnd;
-
- fh = emalloc(sizeof(w32api_func_handle *));
- *fh = NULL;
-
- /* Parse function */
- w32api_function_definition_scan_bytes(definition, definition_len);
- if((w32api_function_definition_parse((void *)&hnd) != 0))
- {
- *fh = hnd.hnd;
- if(*fh != NULL)
- efree(*fh);
-
- efree(fh);
- return FAILURE;
- }
- *fh = hnd.hnd;
-
- if(!*fh)
- return FAILURE;
-
-
- if(zend_hash_exists(&WG(win32_ce)->function_table, (*fh)->function_name, strlen((*fh)->function_name) + 1))
- {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
- "A function by the name %s already has been registered, cannot redefine function",
- (*fh)->function_name);
-
- /* We dont want to unload function as it already exists so lets just free it ourselves */
- php_w32api_unload_library((*fh)->lib, 0 TSRMLS_CC);
- php_w32api_free_arguments((*fh)->argument_list);
- efree((*fh)->return_type_name);
- efree((*fh)->function_name);
- efree(*fh);
- efree(fh);
-
- return FAILURE;
- }
-
- /* Insert it into our hash table */
- if(zend_hash_add( WG(funcs),
- (*fh)->function_name,
- strlen((*fh)->function_name) + 1,
- fh,
- sizeof(w32api_func_handle),
- NULL) != SUCCESS)
- {
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
- "Loading of function %s failed: Could not insert function handle into hash",
- (*fh)->function_name);
-
- /* Tidy up */
- zend_hash_del(WG(funcs), (*fh)->function_name, strlen((*fh)->function_name) +1);
- return FAILURE;
- }
-
- /* Insert function into win32_ce's function_table */
- internal_function->type = ZEND_INTERNAL_FUNCTION;
- internal_function->handler = W32API_CLASS_FN(win32, invokefunction);
- internal_function->function_name = (*fh)->function_name;
- internal_function->arg_types = php_w32api_do_arg_types(&(*fh)->argument_list);
-
- if(zend_hash_add(&WG(win32_ce)->function_table, (*fh)->function_name,
- strlen((*fh)->function_name) + 1, &function, sizeof(zend_function), NULL) == FAILURE)
- {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not register function %s into function table", (*fh)->function_name);
- zend_hash_del(WG(funcs), (*fh)->function_name, strlen((*fh)->function_name) +1);
-
- return FAILURE;;
- }
-
- if(flags)
- {
- (*fh)->flags = (*fh)->flags | flags;
- }
-
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ php_w32api_unload_type
- * Expects one argument, a pointer to a w32api_type_handle, unloads this
- * type.
- */
-static void php_w32api_unload_type (w32api_type_handle **th TSRMLS_DC)
-{
- php_w32api_free_members((*th)->member_list);
-
- zend_hash_del(WG(types), (*th)->type_name, strlen((*th)->type_name) + 1);
-
-}
-/* }}} */
-
-/* {{{ php_w32api_register_type
- */
-static int php_w32api_register_type(char *type_definition, int type_definition_len TSRMLS_DC)
-{
- w32api_type_handle **th;
- w32api_type_handle_ptr hnd;
-
- th = emalloc(sizeof(w32api_type_handle *));
- *th = NULL;
-
- w32api_type_definition_scan_bytes(type_definition, type_definition_len);
- if(w32api_type_definition_parse((void *)&hnd) != 0)
- {
- *th = hnd.hnd;
-
- /* Leaks */
- if(*th != NULL)
- efree(*th);
-
- efree(th);
- return FAILURE;
- }
-
- *th = hnd.hnd;
-
- if(!*th)
- return FAILURE;
-
- if((zend_hash_exists(WG(callbacks), (*th)->type_name, strlen((*th)->type_name) +1)) ||
- (zend_hash_exists(WG(types), (*th)->type_name, strlen((*th)->type_name) + 1)))
- {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
- "A type or callback by the name %s already has been registered, cannot redefine type or callback",
- (*th)->type_name);
-
- /* We dont want to unload function as it already exists so lets just free it ourselves */
- php_w32api_free_members((*th)->member_list);
- efree((*th)->type_name);
- efree(*th);
- efree(th);
-
- return FAILURE;
- }
-
- /* Insert it into our hash table */
- if(zend_hash_add( WG(types),
- (*th)->type_name,
- strlen((*th)->type_name) + 1,
- th,
- sizeof(w32api_type_handle *),
- NULL) != SUCCESS)
- {
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
- "Loading of type %s failed: Could not insert type handle into hash",
- (*th)->type_name);
-
- /* Tidy up */
- zend_hash_del(WG(types), (*th)->type_name, strlen((*th)->type_name) + 1);
- return FAILURE;
- }
-
- return SUCCESS;
-
-}
-/* }}} */
-
-
-/* {{{ php_w32api_register_callback
- */
-static int php_w32api_register_callback(char *function_definition, int function_definition_len TSRMLS_DC)
-{
- w32api_func_handle **fh;
- w32api_func_handle_ptr hnd;
-
- char *new_definition = NULL;
-
- fh = emalloc(sizeof(w32api_func_handle *));
- *fh = NULL;
-
- new_definition = emalloc(function_definition_len + sizeof(" from cb.cb"));
-
- snprintf(new_definition, function_definition_len + sizeof(" from cb.cb"), "%s from cb.cb", function_definition);
-
-
- /* Parse function */
- w32api_function_definition_scan_bytes(new_definition, function_definition_len + sizeof(" from cb.cb"));
- if(w32api_function_definition_parse((void *)&hnd) != 0)
- {
- *fh = hnd.hnd;
-
- /* Leaks */
- if(*fh != NULL)
- efree(*fh);
-
- efree(fh);
- return FAILURE;
- }
- *fh = hnd.hnd;
-
- if(!*fh)
- return FAILURE;
-
-
- if(zend_hash_exists(WG(callbacks), (*fh)->function_name, strlen((*fh)->function_name) + 1))
- {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
- "A callback by the name %s already has been registered, cannot redefine type",
- (*fh)->function_name);
-
- /* We dont want to unload function as it already exists so lets just free it ourselves */
- php_w32api_free_arguments((*fh)->argument_list);
- efree((*fh)->return_type_name);
- efree((*fh)->function_name);
- efree(*fh);
- efree(fh);
-
- return FAILURE;
- }
-
- /* Insert it into our hash table */
- if(zend_hash_add( WG(callbacks),
- (*fh)->function_name,
- strlen((*fh)->function_name) + 1,
- fh,
- sizeof(w32api_func_handle *),
- NULL) != SUCCESS)
- {
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
- "Loading of function %s failed: Could not insert function handle into hash",
- (*fh)->function_name);
-
- /* Tidy up */
- zend_hash_del(WG(callbacks), (*fh)->function_name, strlen((*fh)->function_name) + 1);
- return FAILURE;
- }
-
- return SUCCESS;
-
-
-
-}
-/* }}} */
-
-
-/* {{{ php_w32api_free_arguments
- * Expects one argument, the head of a list of arguments to free
- */
-static void php_w32api_free_arguments(arguments *argument_list)
-{
- if(argument_list == NULL)
- return;
-
- efree(argument_list->arg->argument_name);
- efree(argument_list->arg->type_name);
- efree(argument_list->arg);
-
- if(argument_list->next_arg != NULL)
- {
- php_w32api_free_arguments(argument_list->next_arg);
- }
-
- efree(argument_list);
-
- return;
-}
-/* }}} */
-
-/* {{{ php_w32api_free_members
- * Expects one argument, the head of a list of members to free
- */
-static void php_w32api_free_members(members *member_list)
-{
- if(member_list == NULL)
- return;
-
- efree(member_list->member->member_name);
-
- if(member_list->member->member_type_name != NULL)
- efree(member_list->member->member_type_name);
-
- efree(member_list->member);
-
- php_w32api_free_members(member_list->next_member);
- efree(member_list);
- return;
-}
-/* }}} */
-
-/* {{{ php_w32api_load_library
- * Expects two parameters, first is libraries name the second is a pointer
- * to a pointer to w32api_lib_handle which will recieve the resultant handle.
- * returns SUCCESS on success and FAILURE on failure.
- */
-static int php_w32api_load_library (char *library_name, w32api_lib_handle **lh TSRMLS_DC)
-{
- if(zend_hash_find(WG(libraries), library_name, strlen(library_name) + 1, (void **)lh) == SUCCESS)
- {
- (*lh)->ref_count++;
- return SUCCESS;
- }
-
- *lh = (w32api_lib_handle *) emalloc( sizeof(w32api_lib_handle) );
- (*lh)->ref_count = 1;
- (*lh)->library_name = estrdup(library_name);
-
- (*lh)->handle = LoadLibrary((*lh)->library_name);
-
- if(!(*lh)->handle) /* Could not load library */
- {
- LPVOID message_buffer;
- FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
- (LPTSTR)&message_buffer,
- 0,
- NULL);
-
- /* Tidy up */
- efree((*lh)->library_name);
- efree(*lh);
- efree(lh);
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Loading of library failed: %s", message_buffer);
- LocalFree(message_buffer);
-
- return FAILURE;
- }
-
- /* Add to hash */
- if(zend_hash_add( WG(libraries),
- (*lh)->library_name,
- strlen((*lh)->library_name) + 1,
- *lh,
- sizeof(w32api_lib_handle),
- NULL) != SUCCESS)
- {
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
- "Loading of library %s failed: Could not insert library handle into hash",
- (*lh)->library_name);
-
- /* Tidy up */
- efree((*lh)->library_name);
- efree(*lh);
- efree(lh);
-
- return FAILURE;
- }
-
-
- return SUCCESS;
-
-}
-/* }}} */
-
-
-/* {{{ php_w32api_do_arg_types
- */
-static unsigned char *php_w32api_do_arg_types(arguments **argument_list)
-{
- int i = 0;
- int j = 0;
- arguments *curr_arg = NULL;
- unsigned char *retval = NULL;
-
- if(!(argument_list) || !(*argument_list))
- return NULL;
-
- curr_arg = *argument_list;
-
- /* See how much room we need to emalloc */
- while(curr_arg)
- {
- i++;
-
- if(curr_arg->arg->flags & BYREF_FORCE)
- {
- j = i;
- }
-
- curr_arg = curr_arg->next_arg;
- }
-
- /* Check to see if any args are by ref */
- if( j == 0 )
- return NULL;
-
- retval = (unsigned char *)safe_emalloc(sizeof(unsigned char), j, 1);
- retval[0] = (unsigned char)j;
-
- curr_arg = *argument_list;
-
- for(i=1; i <= j; i++)
- {
-
- retval[i] = (unsigned char)curr_arg->arg->flags;
- curr_arg = curr_arg->next_arg;
-
- }
-
- return retval;
-}
-/* }}} */
-
-static int php_w32api_get_type_size(int type_id, char *type_name, int flags)
-{
- TSRMLS_FETCH();
-
- if(flags & BYREF_FORCE)
- {
- return sizeof(void *); /* Pointers are always the same size */
- }
-
- switch(type_id)
- {
- case W32API_NULL:
- return sizeof(void *);
- case W32API_INT:
- return sizeof(int);
- case W32API_LONG:
- return sizeof(long);
- case W32API_DOUBLE:
- return sizeof(double);
- case W32API_FLOAT:
- return sizeof(float);
- case W32API_STRING:
- return sizeof(char *);
- case W32API_BYTE:
- return sizeof(char);
- case W32API_BOOL:
- return sizeof(int);
- case W32API_COMPLEX:
- {
- w32api_type_handle **th;
-
- if(zend_hash_find(WG(types), type_name, strlen(type_name) +1, (void **)&th) != SUCCESS)
- {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown type %s", type_name);
- return -1;
- }
-
- return (*th)->size;
-
- }
- break;
- case W32API_UNKNOWN:
- default:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown type %s", type_name);
- return -1;
- }
-}
-
-static int php_w32api_get_type_id_from_name(char *type)
-{
-
- TSRMLS_FETCH();
-
- if(!strcmp(type, "long"))
- {
- return W32API_LONG;
- }
- else if(!strcmp(type, "int"))
- {
- return W32API_INT;
- }
- else if (!strcmp(type, "string"))
- {
- return W32API_STRING;
- }
- else if (!strcmp(type, "byte"))
- {
- return W32API_BYTE;
- }
- else if (!strcmp(type, "bool"))
- {
- return W32API_BOOL;
- }
- else if (!strcmp(type, "double"))
- {
- return W32API_DOUBLE;
- }
- else if (!strcmp(type, "float"))
- {
- return W32API_FLOAT;
- }
- else if (!strcmp(type, "void"))
- {
- return W32API_NULL;
- }
- else
- {
- if(zend_hash_exists(WG(types), type, strlen(type) +1))
- {
- return W32API_COMPLEX;
- }
- else
- {
- return W32API_UNKNOWN;
- }
- }
-}
-
-static void php_w32api_init_type(w32api_type_handle *th, zval *obj TSRMLS_DC)
-{
- w32api_type_instance *ti;
- zval *rsrc_handle = NULL;
-
- ti = emalloc(sizeof(w32api_type_instance));
-
- if(!obj)
- MAKE_STD_ZVAL(obj);
-
- object_init_ex(obj, WG(type_ce));
-
- ti->type = th;
- ti->values = safe_emalloc(sizeof(zval *), th->member_count, 0);
- memset(ti->values, '\0', sizeof(zval *) * th->member_count);
-
- MAKE_STD_ZVAL(rsrc_handle);
- ZEND_REGISTER_RESOURCE(rsrc_handle, ti, WG(le_type_instance));
-
- zend_hash_index_update(Z_OBJPROP_P(obj), 0, &rsrc_handle, sizeof(zval *), NULL);
-}
-
-
-static int php_w32api_do_prop_get(zval *object, zval *return_value, zend_llist_element **element TSRMLS_DC)
-{
- w32api_type_instance *th;
- zval **type_instance_handle;
- members *current_member;
- char *property_name;
- int i = 0;
-
- zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &type_instance_handle);
-
- th = (w32api_type_instance *)zend_fetch_resource(type_instance_handle TSRMLS_CC,
- -1, "Complex Type Instance", NULL,
- 1, WG(le_type_instance));
-
- if(!th)
- return FAILURE;
-
- property_name = Z_STRVAL(((zend_overloaded_element *)(*element)->data)->element);
-
- current_member = th->type->member_list;
-
- while(strcmp(current_member->member->member_name, property_name) != 0)
- {
- i++;
-
- if(current_member->next_member != NULL)
- current_member = current_member->next_member;
- else
- return FAILURE;
- }
-
- *return_value = *(th->values[i]);
- zval_copy_ctor(return_value);
-
- return SUCCESS;
-}
-
-static int php_w32api_do_prop_set(zval *object, zval *value, zend_llist_element **element TSRMLS_DC)
-{
- w32api_type_instance *th;
- zval **type_instance_handle;
- zval *new_var;
- members *current_member;
- char *property_name;
- int i = 0;
-
- zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &type_instance_handle);
-
- th = (w32api_type_instance *)zend_fetch_resource(type_instance_handle TSRMLS_CC,
- -1, "Complex Type Instance", NULL,
- 1, WG(le_type_instance));
-
- if(!th)
- return FAILURE;
-
- property_name = Z_STRVAL(((zend_overloaded_element *)(*element)->data)->element);
-
- current_member = th->type->member_list;
-
- while(strcmp(current_member->member->member_name, property_name) != 0)
- {
- i++;
-
- if(current_member->next_member != NULL)
- current_member = current_member->next_member;
- else
- return FAILURE;
- }
-
- if(current_member->member->flags & BYREF_FORCE)
- {
- if(th->values[i])
- zval_ptr_dtor(&th->values[i]);
-
- MAKE_STD_ZVAL(new_var);
- *new_var = *value;
- zval_copy_ctor(new_var);
- th->values[i] = new_var;
-
- }
- else
- {
- th->values[i] = value;
- zval_add_ref(&value);
- }
-
- return SUCCESS;
-}
-
-w32api_result php_w32api_do_dynamic_dll_call(w32api_func_handle *fh, int argc, w32api_dynamic_param *params, void *return_buffer, int return_buffer_size)
-{
-
- /**
- * Theory Behind Implementation
- * ============================
- * We have four main jobs:
- * 1) Push arguments onto stach aligned at 4 bytes.
- * 2) Call Function
- * 3) Get Return Values
- * 4) Perform any cleanup needed.
- *
- * Pushing arguments onto the stack is fairly simple, just push from right to left
- * so for a function with the prototype int sum(int a, int b) we would push b and
- * then a in that order.
- *
- * Calling the function is fine as we already have the pointer to the function which
- * we can use with call [function_pointer] to make the actual call.
- *
- * Return values are where we begin to get complicated. Now for simple return values up
- * to 8 bytes they are returned via the EAX/EDX register pair. This means we can just
- * copy the EAX/EDX pair to the win32_result sturcture and be sure we get any simple
- * return type. If the return type is more than 8 bytes then things get complicated.
- * When calling we must pass a hidden argument on the stach which points to a tempory
- * buffer with enough memory to hold the return value, this return value is then copied
- * to the correct varaible by us. Microsoft being the nice bunnies they are, decided to
- * copy an optimization Borland introduced under win16 which is to pass structs of under
- * 8 bytes directly via EAX/EDX pair. One final notable exception is dealing with floating
- * point return types where we need to retrive the floating point number of the systems
- * math coprocessor stack using the fstp call.
- *
- * Finally if its a __cdecl call we have to clean up the stack, otherwise the callee does this.
- *
- */
-
- w32api_result result = { 0 };
- DWORD *stack_pointer, stack_size = 0, eaxv, edxv;
- BYTE *arg_ptr = NULL;
- int size = 0, i = 0;
- FARPROC fp = fh->handle;
-
- _asm mov stack_pointer, esp /* Store stack pointer (esp) in stack_pointer */
- _asm sub esp, 0x100 /* Give ourselves 256 bytes on the stack */
-
-
- for(i = (argc - 1); i >= 0; i--)
- {
- size = (params[i].width + 3)/4 * 4;
- arg_ptr = (unsigned char *)params[i].argument_ptr + size - 4;
- stack_size += (unsigned long)size;
-
- while(size > 0)
- {
- stack_pointer--;
- if(params[i].flags == W32API_ARGPTR)
- {
- *stack_pointer = *(unsigned long *)arg_ptr;
- arg_ptr -= 4;
- }
- else
- {
- *stack_pointer = params[i].argument;
- }
-
- size -= 4;
- }
- }
-
- if((return_buffer) && ((fh->flags & W32API_BORLAND) || (return_buffer_size > 8)))
- {
-
- stack_size += 4;
- stack_pointer--;
- *stack_pointer = (unsigned long)return_buffer;
- }
-
- _asm add esp, 0x100
- _asm sub esp, stack_size
- _asm call [fp]
- _asm mov eaxv, eax
- _asm mov edxv, edx
-
- if(fh->flags & W32API_CDECL)
- {
- _asm add esp, stack_size
- }
-
- if(fh->flags & W32API_REAL4)
- _asm fstp dword ptr [result]
- else if (fh->flags & W32API_REAL8)
- _asm fstp qword ptr [result]
- else if (!return_buffer)
- {
- _asm mov eax, [eaxv]
- _asm mov edx, [edxv]
- _asm mov DWORD PTR [result], eax
- _asm mov DWORD PTR [result + 4], edx
- }
- else if (!(fh->flags & W32API_BORLAND) && (return_buffer_size <= 8))
- {
- _asm mov ecx, DWORD PTR [return_buffer]
- _asm mov eax, [eaxv]
- _asm mov DWORD PTR [ecx], eax
- _asm mov edx, [edxv]
- _asm mov DWORD PTR [ecx + 4], edx
- }
-
- return result;
-}
-
-void php_w32api_marshall_zval_to_c(argument *arg, w32api_dynamic_param *dp, zval *pzval TSRMLS_DC)
-{
- dp->flags = 0;
-
- /* We should have been passed a write reference when
- * BYREF_FORCE is Set so we just add a reference
- * when we pass it to the function,
- * TODO: register the reference internally for safe unreferencing
- */
-
- switch(arg->type_id)
- {
- case W32API_INT:
- convert_to_long_ex(&pzval);
- if(arg->flags & BYREF_FORCE)
- {
- dp->argument = (unsigned long)&pzval->value.lval;
- dp->width = sizeof(int *);
-
- }
- else
- {
- dp->argument = (int)pzval->value.lval;
- dp->width = sizeof(int);
- }
- break;
- case W32API_LONG:
- convert_to_long_ex(&pzval);
-
- if(arg->flags & BYREF_FORCE)
- {
- dp->argument = (unsigned long)&pzval->value.lval;
- dp->width = sizeof(int *);
- zval_add_ref(&pzval);
- }
- else
- {
- dp->argument = pzval->value.lval;
- dp->width = sizeof(int);
- }
- break;
- case W32API_STRING:
-
- convert_to_string_ex(&pzval);
- if(!(arg->flags & BYREF_FORCE))
- {
- /* Need to free this when we demarshall */
- dp->argument = (unsigned long)estrndup(Z_STRVAL_P(pzval), Z_STRLEN_P(pzval));
- }
- else
- {
- dp->argument = (unsigned long)Z_STRVAL_P(pzval);
- zval_add_ref(&pzval);
- }
-
- dp->width = sizeof(char *);
- break;
-
- case W32API_DOUBLE:
- convert_to_double_ex(&pzval);
-
- if(arg->flags & BYREF_FORCE)
- {
- dp->argument = (unsigned long)&pzval->value.dval;
- dp->width = sizeof(double *);
- zval_add_ref(&pzval);
- }
- else
- {
- dp->argument_ptr = &pzval->value.dval;
- dp->width = sizeof(double);
- dp->flags = W32API_ARGPTR;
- }
- break;
- case W32API_FLOAT:
- convert_to_double_ex(&pzval);
-
- if(arg->flags & BYREF_FORCE)
- {
- dp->argument = (unsigned long)&pzval->value.dval;
- dp->width = sizeof(double *);
- zval_add_ref(&pzval);
- }
- else
- {
- dp->argument_ptr = &pzval->value.dval;
- dp->width = sizeof(float);
- dp->flags = W32API_ARGPTR;
- }
- break;
- case W32API_BYTE:
- /* Thanks sterling */
- convert_to_string_ex(&pzval);
- if(arg->flags & BYREF_FORCE)
- {
- dp->argument = (unsigned long)&Z_STRVAL_P(pzval);
- dp->width = sizeof(char *);
- zval_add_ref(&pzval);
- }
- else
- {
- dp->argument = (char)Z_STRVAL_P(pzval)[0];
- dp->width = sizeof(char);
- }
- break;
- case W32API_BOOL:
- convert_to_boolean_ex(&pzval);
-
- if(arg->flags & BYREF_FORCE)
- {
- dp->argument = (unsigned long)&pzval->value.lval;
- dp->width = sizeof(int *);
- zval_add_ref(&pzval);
- }
- else
- {
- dp->argument = (int)pzval->value.lval;
- dp->width = sizeof(int);
- }
- break;
- case W32API_COMPLEX:
- if(Z_TYPE_P(pzval) != IS_OBJECT)
- {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Variable passed as complex value is not an object");
- break;
- }
-
- if(arg->flags & BYREF_FORCE)
- {
- int width= 0;
- void **ptr = NULL;
- ptr = emalloc(sizeof(void *));
- *ptr = php_w32api_complex_marshall_zval_to_c(pzval, &width, NULL TSRMLS_CC);
- dp->argument = (unsigned long)ptr;
- dp->width = width;
- }
- else
- {
- int width= 0;
- dp->argument_ptr = php_w32api_complex_marshall_zval_to_c(pzval, &width, NULL TSRMLS_CC);
- dp->width = width;
- }
- break;
-
- case W32API_UNKNOWN:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown type when calling function, marshalling failed");
- break;
- }
-
-}
-
-static void *php_w32api_complex_marshall_zval_to_c(zval *pzval, int *width, void *return_value TSRMLS_DC)
-{
- w32api_type_instance *th;
- zval **type_instance_handle;
- members *current_member;
- char *offset = return_value;
- int i = 0;
-
-
- if(return_value == NULL)
- {
- /* First call */
-/* return_value = emalloc(th->type->size);
-
- zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &type_instance_handle);
- th = (w32api_type_instance *)zend_fetch_resource(type_instance_handle TSRMLS_CC,
- -1, "Complex Type Instance", NULL,
- 1, WG(le_type_instance));
-
- if(!th)
- return NULL;
-
-
- for(i = 0; i < th->type->member_count; i++)
- {
-
-
- }
-*/ }
-
-
-}
-
-
-/* =====================================================================================================
- * Win32 Class Code
- * =====================================================================================================
- */
-
-/* {{{ win32_class_functions[]
- */
-function_entry win32_class_functions[] = {
- W32API_CLASS_FE(win32, registerfunction, NULL)
- W32API_CLASS_FE(win32, unregisterfunction, NULL)
- W32API_CLASS_FE(win32, registercallback, NULL)
- W32API_CLASS_FE(win32, definetype, NULL)
- W32API_CLASS_FE(win32, gettypesize, NULL)
- W32API_CLASS_FE(win32, inittype, NULL)
- W32API_CLASS_FE(win32, decref, NULL)
-#ifndef NDEBUG
- W32API_CLASS_FE(win32, dump_function_hash, NULL)
- W32API_CLASS_FE(win32, dump_library_hash, NULL)
- W32API_CLASS_FE(win32, dump_callback_hash, NULL)
- W32API_CLASS_FE(win32, dump_type_hash, NULL)
-#endif
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-/* {{{ win32_class_init(TSRMLS_D)
- */
-int win32_class_init(TSRMLS_D)
-{
- zend_class_entry ce;
-
- INIT_CLASS_ENTRY(ce,
- "win32",
- win32_class_functions);
-
- WG(win32_ce) = zend_register_internal_class(&ce TSRMLS_CC);
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ win32_class_rshutdown(TSRMLS_D)
- * Cleans up at the end of the shutdown removing and freeing anything we added to the function
- * table.
- */
-int win32_class_rshutdown(TSRMLS_D)
-{
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ proto: int Win32::RegisterFunction(string definition [, int flags])
- * Registers and Loads a function from an underlying Dll
- */
-W32API_CLASS_FUNCTION(win32, registerfunction)
-{
- char *function_definition = NULL;
- int function_definition_len;
- long flags = 0;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
- &function_definition,
- &function_definition_len,
- &flags) == FAILURE)
- {
- return;
- }
-
- if(php_w32api_load_function(function_definition, function_definition_len, flags TSRMLS_CC) != SUCCESS)
- {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Registering Function %s failed", function_definition);
- RETURN_FALSE;
- }
-
- RETURN_TRUE;
-
-
-}
-/* }}} */
-
-/* {{{ proto: int Win32::UnregisterFunction(string function_name)
- * Unregisters a previously loaded function
- */
-W32API_CLASS_FUNCTION(win32, unregisterfunction)
-{
- char *function_name = NULL;
- int function_name_len;
- w32api_func_handle **fh = NULL;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
- &function_name,
- &function_name_len) == FAILURE)
- {
- return;
- }
-
- /* Our deleteor handler removes us from the WG(win32_ce)->function_table
- * so no need to delete specifically from there
- */
- zend_hash_del(WG(funcs), function_name, strlen(function_name) + 1);
-
- RETURN_TRUE;
-
-}
-/* }}} */
-
-/* {{{ proto: int Win32::RegisterCallback(string definition)
- * Registers a callback type
- */
-W32API_CLASS_FUNCTION(win32, registercallback)
-{
- char *function_definition = NULL;
- int function_definition_len;
- w32api_func_handle **fh = NULL;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
- &function_definition,
- &function_definition_len) == FAILURE)
- {
- return;
- }
-
- if(php_w32api_register_callback(function_definition, function_definition_len TSRMLS_CC) != SUCCESS)
- {
- RETURN_FALSE;
- }
-
- RETURN_TRUE;
-
-}
-/* }}} */
-
-
-/* {{{ proto: int Win32::DefineType(string definition)
- * Defines a C Like Type for use.
- */
-W32API_CLASS_FUNCTION(win32, definetype)
-{
- char *type_definition = NULL;
- int type_definition_len;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
- &type_definition,
- &type_definition_len) == FAILURE)
- {
- return;
- }
-
- if(php_w32api_register_type(type_definition, type_definition_len TSRMLS_CC) != SUCCESS)
- {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Registering Type %s failed", type_definition);
- RETURN_FALSE;
- }
-
- RETURN_TRUE;
-
-}
-/* }}} */
-
-/* {{{ proto: int Win32::GetTypeSize(string type_name)
- * Returns the size of a registered type
- */
-W32API_CLASS_FUNCTION(win32, gettypesize)
-{
- char *type = NULL;
- int type_len;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
- &type,
- &type_len) == FAILURE)
- {
- return;
- }
-
- RETURN_LONG(php_w32api_get_type_size(php_w32api_get_type_id_from_name(type), type, BYREF_NONE));
-
-
-}
-/* }}} */
-
-/* {{{ proto: int Win32::InitType(string TypeName)
- * Creates an instance of type TypeName
- */
-W32API_CLASS_FUNCTION(win32, inittype)
-{
- char *type_name = NULL;
- int type_name_len = 0;
- w32api_type_handle **th = NULL;
-
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
- &type_name, &type_name_len) == FAILURE)
- {
- return;
- }
-
- if(zend_hash_find(WG(types), type_name, type_name_len +1, (void **)&th) == FAILURE)
- {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not retrieve type handle for type %s from hash table", type_name);
- RETURN_FALSE;
- }
-
- php_w32api_init_type(*th, return_value TSRMLS_CC);
-
-}
-/* }}} */
-
-/* {{{ proto: int Win32::DecRef(mixed Variable)
- * Decreases the reference count on a variable
- */
-W32API_CLASS_FUNCTION(win32, decref)
-{
-
-}
-/* }}} */
-
-/* {{{ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- * THIS FUNCTION IS NOT PUBLICALLY ACCESSABLE
- * IT IS USED AS A GENERIC HANDLER FOR W32API
- * CALLS.
- */
-W32API_CLASS_FUNCTION(win32, invokefunction)
-{
- char *function_name = get_active_function_name(TSRMLS_C);
- int argc = ZEND_NUM_ARGS();
- int i = 0;
- w32api_dynamic_param *params = NULL;
- w32api_dynamic_param *current_dynamic_param = NULL;
- w32api_func_handle **fh = NULL;
- w32api_result res = {0};
- void *w32api_return_buffer = NULL;
- int w32api_return_buffer_size = 0;
- zval **func_arguments = NULL;
- zval *current_zval = NULL;
- arguments *curr_arg = NULL;
- w32api_type_handle *th = NULL;
-
- if(zend_hash_find(WG(funcs), function_name, strlen(function_name) +1, (void **)&fh) == FAILURE)
- {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not retrieve function handle from hash table");
- RETURN_FALSE;
- }
-
- if(argc)
- {
- if(zend_get_parameters_array_ex(argc, &func_arguments) == FAILURE)
- {
- WRONG_PARAM_COUNT
- }
-
- params = (w32api_dynamic_param *)safe_emalloc(sizeof(w32api_dynamic_param), argc, 0);
-
- curr_arg = (*fh)->argument_list;
- current_dynamic_param = params;
-
- for(i = 0; i < argc; i++)
- {
- current_zval = func_arguments[i];
- php_w32api_marshall_zval_to_c(curr_arg->arg, current_dynamic_param, current_zval TSRMLS_CC);
-
- current_dynamic_param++;
- curr_arg = curr_arg->next_arg;
- }
- }
- else
- {
- params = NULL;
- }
-
- if((*fh)->return_type_id == W32API_COMPLEX)
- {
- if(zend_hash_find(WG(types), (*fh)->return_type_name, strlen((*fh)->return_type_name) +1, (void **)&th) != SUCCESS)
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not find type handle for type %s", (*fh)->return_type_name);
-
- w32api_return_buffer = emalloc(th->size);
- w32api_return_buffer_size = th->size;
- }
-
-
-
- res = php_w32api_do_dynamic_dll_call(*fh, argc, params, w32api_return_buffer, w32api_return_buffer_size);
-
- if(argc)
- /* We should demarshall here not just efree */
- efree(params);
-
- switch((*fh)->return_type_id)
- {
- case W32API_LONG:
- RETURN_LONG(res.lval);
- break;
- case W32API_INT:
- RETURN_LONG(res.ival);
- break;
- case W32API_STRING:
- case W32API_BYTE:
- RETURN_STRING(res.ptr, 1);
- break;
- case W32API_DOUBLE:
- RETURN_DOUBLE(res.dval);
- break;
- case W32API_FLOAT:
- RETURN_DOUBLE(res.fval);
- break;
- case W32API_BOOL:
- if(res.ival)
- {
- RETURN_TRUE;
- }
- else
- {
- RETURN_FALSE;
- }
- break;
- case W32API_COMPLEX:
- break;
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown return type %s", (*fh)->return_type_name);
- }
-
-}
-/* }}} */
-
-#ifndef NDEBUG
-W32API_CLASS_FUNCTION(win32, dump_library_hash)
-{
- zend_hash_apply(WG(libraries), (apply_func_t)php_w32api_dump_library_hash_cb TSRMLS_CC);
-}
-
-W32API_CLASS_FUNCTION(win32, dump_function_hash)
-{
- zend_hash_apply(WG(funcs), (apply_func_t)php_w32api_dump_function_hash_cb TSRMLS_CC);
-}
-
-W32API_CLASS_FUNCTION(win32, dump_callback_hash)
-{
-
- zend_hash_apply(WG(callbacks), (apply_func_t)php_w32api_dump_callback_hash_cb TSRMLS_CC);
-}
-
-
-W32API_CLASS_FUNCTION(win32, dump_type_hash)
-{
-
- zend_hash_apply(WG(types), (apply_func_t)php_w32api_dump_type_hash_cb TSRMLS_CC);
-}
-
-int php_w32api_dump_library_hash_cb(void *pData TSRMLS_DC)
-{
- w32api_lib_handle *lh = pData;
-
- printf("=====================================================================\n");
- printf("Library Name: \t\t%s\n", lh->library_name);
- printf("Reference Count: \t\t%d\n", lh->ref_count);
- printf("Library Handle: \t\t%p\n", lh->handle);
- printf("Lib ptr loc \t\t%p\n", lh);
- printf("ll n loc \t\t%p\n", &lh->ref_count);
-
- printf("=====================================================================\n");
-
- return 0;
-}
-
-int php_w32api_dump_function_hash_cb(void *pData TSRMLS_DC)
-{
- w32api_func_handle **fh = pData;
-
- printf("=====================================================================\n");
- printf("Function Name: \t\t%s\n", (*fh)->function_name);
- printf("Return Type Name: \t\t%s\n", (*fh)->return_type_name);
- printf("Library Name: \t\t%s\n", (*fh)->lib->library_name );
- printf("Function Flags: \t\t%d\n", (*fh)->flags);
- printf("Function Handle: \t\t%p\n", (*fh)->handle);
- printf("Return Type ID: \t\t%d\n", (*fh)->return_type_id);
- printf("Return Type Name: \t\t%s\n", (*fh)->return_type_name);
- printf("## Arguments ##\n");
- printf("---------------------------------------------------------------------\n");
- php_w32api_print_arguments((*fh)->argument_list);
- printf("=====================================================================\n\n");
-
- return 0;
-}
-
-int php_w32api_dump_callback_hash_cb(void *pData TSRMLS_DC)
-{
- w32api_func_handle **fh = pData;
-
- printf("=====================================================================\n");
- printf("Callback Name: \t\t%s\n", (*fh)->function_name);
- printf("Return Type Name: \t\t%s\n", (*fh)->return_type_name);
- printf("Callback Flags: \t\t%d\n", (*fh)->flags);
- printf("Return Type ID: \t\t%d\n", (*fh)->return_type_id);
- printf("Return Type Name: \t\t%s\n", (*fh)->return_type_name);
- printf("## Arguments ##\n");
- printf("---------------------------------------------------------------------\n");
- php_w32api_print_arguments((*fh)->argument_list);
- printf("=====================================================================\n\n");
-
- return 0;
-}
-
-int php_w32api_dump_type_hash_cb(void *pData TSRMLS_DC)
-{
- w32api_type_handle **th = pData;
-
-
- printf("=====================================================================\n");
- printf("Type Name: \t\t%s\n", (*th)->type_name);
- printf("Type Size: \t\t%d\n", (*th)->size);
- printf("Member Count: \t\t%d\n", (*th)->member_count);
- printf("## Members ##\n");
- printf("---------------------------------------------------------------------\n");
- php_w32api_print_members((*th)->member_list);
- printf("=====================================================================\n\n");
-
- return 0;
-}
-
-void php_w32api_print_members(members *member_list)
-{
- if(member_list == NULL)
- return;
-
- printf("\tMember Name: \t%s\n", member_list->member->member_name);
- printf("\tMember Flags: \t%d\n", member_list->member->flags);
- printf("\tMember Type ID: \t%d\n", member_list->member->member_type_id);
- printf("\tMember Type Name:\t%s\n", member_list->member->member_type_name);
- printf("\tMember Offset: \t%d\n", member_list->member->offset);
- printf("---------------------------------------------------------------------\n");
-
- php_w32api_print_members(member_list->next_member);
-
-}
-void php_w32api_print_arguments(arguments *argument_list)
-{
- if(argument_list == NULL)
- return;
-
- printf("\tArgument Name: \t%s\n", argument_list->arg->argument_name);
- printf("\tArgument Flags: \t%d\n", argument_list->arg->flags);
- printf("\tArgument Type ID:\t%d\n", argument_list->arg->type_id);
- printf("\tArg Type Name: \t%s\n", argument_list->arg->type_name);
- printf("---------------------------------------------------------------------\n");
-
- php_w32api_print_arguments(argument_list->next_arg);
-}
-#endif
-/* =====================================================================================================
- * Type Class Code
- * =====================================================================================================
- */
-
-/* {{{ type_class_functions[]
- */
-function_entry type_class_functions[] = {
- W32API_CLASS_FE(type, clone, NULL)
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-
-/* {{{ type_class_init(TSRMLS_DC)
- */
-int type_class_init(TSRMLS_D)
-{
- zend_class_entry ce;
-
- INIT_OVERLOADED_CLASS_ENTRY(ce,
- "type",
- type_class_functions,
- NULL,
- W32API_PROP_GET_FUNCTION_N(type),
- W32API_PROP_SET_FUNCTION_N(type));
-
- WG(type_ce) = zend_register_internal_class(&ce TSRMLS_CC);
-
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ W32API_PROP_SET_FUNCTION(type)
- */
-/* Most of this code is borrowed from php-gtk. Thanks to Andrei and Zeev for their
- * help with the prop-get/set functions
- */
-W32API_PROP_SET_FUNCTION(type)
-{
- zval result, temp;
- zval *temp_ptr = &temp;
- zval *new_val;
- zend_overloaded_element *overloaded_property;
- zend_llist_element *element;
- zval **object = &property_reference->object;
- int setter_retval, getter_retval;
- TSRMLS_FETCH();
-
-
- /* If we have $foo->bar->baz->boo->bin we have to do sucessive propgets
- * Until we can do our prop set (thanks Zeev, Andrei)
- */
- for (element=property_reference->elements_list->head; element != property_reference->elements_list->tail; element=element->next) {
- overloaded_property = (zend_overloaded_element *)element->data;
-
- getter_retval = FAILURE;
- if (Z_TYPE_P(overloaded_property) == OE_IS_OBJECT) {
- if (Z_TYPE_PP(object) == IS_NULL ||
- (Z_TYPE_PP(object) == IS_BOOL && Z_LVAL_PP(object) == 0) ||
- (Z_TYPE_PP(object) == IS_STRING && Z_STRLEN_PP(object) == 0)) {
- object_init(*object);
- }
-
-
- /* Trying to access a property on a non-object. */
- if (Z_TYPE_PP(object) != IS_OBJECT) {
- return FAILURE;
- }
-
- getter_retval = php_w32api_do_prop_get(*object, &result, &element TSRMLS_CC);
-
- if (getter_retval == SUCCESS) {
- temp = result;
- object = &temp_ptr;
- } else {
- if ((getter_retval = zend_hash_find(Z_OBJPROP_PP(object),
- Z_STRVAL(overloaded_property->element),
- Z_STRLEN(overloaded_property->element)+1,
- (void **)&object)) == FAILURE) {
- MAKE_STD_ZVAL(new_val);
- ZVAL_NULL(new_val);
- zend_hash_update(Z_OBJPROP_PP(object),
- Z_STRVAL(overloaded_property->element),
- Z_STRLEN(overloaded_property->element)+1,
- &new_val, sizeof(void *), (void **)&object);
- }
- }
-
- } else if (Z_TYPE_P(overloaded_property) == OE_IS_ARRAY) {
- if (Z_TYPE_PP(object) == IS_NULL ||
- (Z_TYPE_PP(object) == IS_BOOL && Z_LVAL_PP(object) == 0) ||
- (Z_TYPE_PP(object) == IS_STRING && Z_STRLEN_PP(object) == 0)) {
- array_init(*object);
- }
-
- /* Trying to access index on a non-array. */
- if (Z_TYPE_PP(object) != IS_ARRAY) {
- return FAILURE;
- }
-
- if (Z_TYPE(overloaded_property->element) == IS_STRING) {
- getter_retval = zend_hash_find(Z_ARRVAL_PP(object),
- Z_STRVAL(overloaded_property->element),
- Z_STRLEN(overloaded_property->element)+1,
- (void **)&object);
- } else if (Z_TYPE(overloaded_property->element) == IS_LONG) {
- getter_retval = zend_hash_index_find(Z_ARRVAL_PP(object),
- Z_LVAL(overloaded_property->element),
- (void **)&object);
- }
-
- if (getter_retval == FAILURE) {
- MAKE_STD_ZVAL(new_val);
- ZVAL_NULL(new_val);
-
- if (Z_TYPE(overloaded_property->element) == IS_STRING) {
- zend_hash_update(Z_ARRVAL_PP(object),
- Z_STRVAL(overloaded_property->element),
- Z_STRLEN(overloaded_property->element)+1,
- &new_val, sizeof(void *), (void **)&object);
- } else if (Z_TYPE(overloaded_property->element) == IS_LONG) {
- zend_hash_index_update(Z_ARRVAL_PP(object),
- Z_LVAL(overloaded_property->element),
- &new_val, sizeof(void *), (void **)&object);
- }
- }
- }
-
- zval_dtor(&overloaded_property->element);
- }
-
- /* object is now the object we want to set our property on */
- overloaded_property = (zend_overloaded_element *) element->data;
- setter_retval = php_w32api_do_prop_set(*object, value, &element TSRMLS_CC);
- zval_dtor(&overloaded_property->element);
-
- return setter_retval;
-
-}
-/* }}} */
-
-/* {{{ W32API_PROP_GET_FUNCTION(type)
- */
-W32API_PROP_GET_FUNCTION(type)
-{
- zval result;
- zval *result_ptr = &result;
- zval **prop_result;
- zend_overloaded_element *overloaded_property;
- zend_llist_element *element;
- zval object = *property_reference->object;
- int getter_retval;
- TSRMLS_FETCH();
-
- for (element=property_reference->elements_list->head; element; element=element->next) {
- overloaded_property = (zend_overloaded_element *) element->data;
-
- getter_retval = FAILURE;
- ZVAL_NULL(&result);
- if (Z_TYPE_P(overloaded_property) == OE_IS_OBJECT) {
- /* Trying to access a property on a non-object. */
- if (Z_TYPE(object) != IS_OBJECT ||
- Z_TYPE(overloaded_property->element) != IS_STRING) {
- return result;
- }
-
- if ((getter_retval = php_w32api_do_prop_get(&object, &result, &element TSRMLS_CC) == FAILURE)) {
- if ((getter_retval = zend_hash_find(Z_OBJPROP(object),
- Z_STRVAL(overloaded_property->element),
- Z_STRLEN(overloaded_property->element)+1,
- (void **)&prop_result)) == SUCCESS) {
- result = **prop_result;
- }
- }
- } else if (Z_TYPE_P(overloaded_property) == OE_IS_ARRAY) {
- /* Trying to access index on a non-array. */
- if (Z_TYPE(object) != IS_ARRAY) {
- return result;
- }
-
- if (Z_TYPE(overloaded_property->element) == IS_STRING) {
- getter_retval = zend_hash_find(Z_ARRVAL(object),
- Z_STRVAL(overloaded_property->element),
- Z_STRLEN(overloaded_property->element)+1,
- (void **)&prop_result);
- } else if (Z_TYPE(overloaded_property->element) == IS_LONG) {
- getter_retval = zend_hash_index_find(Z_ARRVAL(object),
- Z_LVAL(overloaded_property->element),
- (void **)&prop_result);
- }
- if (getter_retval == SUCCESS)
- result = **prop_result;
- }
-
- zval_dtor(&overloaded_property->element);
-
- object = result;
-
- if (getter_retval == FAILURE) {
- return result;
- }
- }
-
- zval_add_ref(&result_ptr);
- SEPARATE_ZVAL(&result_ptr);
- return *result_ptr;
-}
-/* }}} */
-
-/* {{{ proto: Type Type::Clone()
- * Creates an exact clone of the object.
- */
-W32API_CLASS_FUNCTION(type, clone)
-{
-
-}
-/* }}} */
-
-/* =====================================================================================================
- * Scanner & Parser Functions
- * =====================================================================================================
- */
-
-/* -----------------------------
- * Function Definition Functions
- * -----------------------------
- */
-
-/* {{{ w32api_parser_load_function_ex
- * Callback for the parser, if the library name is cb.cb we are registering a
- * callback so the LoadLibary and GetProcAddress code is skipped
- */
-w32api_func_handle *w32api_parser_load_function_ex(char *return_type, char *function_name, char *alias_name, arguments *argument_list, char *library_name)
-{
- w32api_func_handle *return_value;
- TSRMLS_FETCH();
-
- return_value = (w32api_func_handle *)emalloc(sizeof(w32api_func_handle));
- memset(return_value, '\0', sizeof(w32api_func_handle));
-
- return_value->argument_list = argument_list;
- return_value->flags = 0;
- return_value->function_name = (alias_name)?alias_name:function_name; /* This is estrdup'd in the Scanner already!! */
- return_value->return_type_name = return_type; /* This is estrdup'd in the Scanner already!! */
- return_value->return_type_id = php_w32api_get_type_id_from_name(return_type);
-
- if(strcmp("cb.cb", library_name)) /* Bit of a hack but we are registering a callback */
- {
- php_w32api_load_library(library_name, &return_value->lib TSRMLS_CC);
-
- if(!return_value->lib)
- {
- /* php_w32api_load_library has already given error */
- efree(return_value);
- return NULL;
- }
-
- return_value->handle = GetProcAddress(return_value->lib->handle, function_name);
-
- if(!return_value->handle)
- {
- /* Check for variation ending with A */
- char *ascii_name = NULL;
-
- ascii_name = emalloc(strlen(function_name) + 2);
- strcpy(ascii_name, function_name);
- ascii_name[strlen(function_name)] = 'A';
- ascii_name[strlen(function_name) + 1] = '\0';
- return_value->handle = GetProcAddress(return_value->lib->handle, ascii_name);
- efree(ascii_name);
-
- if(!return_value->handle)
- {
- /* TODO: php_error_docref and GetLastError etc */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load function %s", function_name);
- efree(return_value);
- return NULL;
- }
- }
- }
-
- /* We want function_name in lowercase now */
- php_strtolower(return_value->function_name, strlen(return_value->function_name));
-
- /* Free it if we have a alias */
- if(alias_name)
- efree(function_name);
-
- return return_value;
-}
-/* }}} */
-
-/* {{{ w32api_parser_make_argument
- * Helper function for the parser
- */
-arguments *w32api_parser_make_argument(char *arg_type, char *arg_name, int byref)
-{
- arguments *return_value = NULL; /* Pointer to our return value */
- argument *argument_value = NULL; /* Our actual argument */
-
- argument_value = emalloc(sizeof(argument));
- return_value = emalloc(sizeof(arguments));
-
- return_value->arg = argument_value;
- return_value->next_arg = return_value->prev_arg = NULL;
-
- argument_value->flags = byref;
- argument_value->argument_name = arg_name;
- argument_value->type_name = arg_type;
- argument_value->type_id = php_w32api_get_type_id_from_name(arg_type);
-
- if(argument_value->type_id == W32API_UNKNOWN) {
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown type %s used as arugment type", arg_type);
- }
-
- return return_value;
-}
-/* }}} */
-
-/* {{{ w32api_parser_join_arguments
- * Helper function for the parser
- */
-arguments *w32api_parser_join_arguments(arguments *lval, arguments *rval)
-{
- lval->next_arg = rval;
- rval->prev_arg = lval;
-
- return lval;
-}
-/* }}} */
-
-/* {{{ w32api_function_definition_error
- * Error function for the parser
- */
-int w32api_function_definition_error(char *s)
-{
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Function Definition Parse Error: %s", s);
- return 0;
-}
-/* }}} */
-
-/* -------------------------
- * Type Definition Functions
- * -------------------------
- */
-w32api_type_handle *w32api_parser_register_type(char *type_name, members *member_list)
-{
- w32api_type_handle *return_value = NULL;
- members *current_member;
- int offset = 0;
- int member_count = 0;
-
- return_value = emalloc(sizeof(w32api_type_handle));
-
- return_value->member_list = member_list;
- return_value->type_name = type_name; /* estrdup'd in parser */
- return_value->member_count = 0;
-
- current_member = return_value->member_list;
-
-
- while(current_member != NULL)
- {
- return_value->member_count++;
- current_member->member->offset = offset;
- offset += php_w32api_get_type_size(current_member->member->member_type_id, current_member->member->member_type_name, current_member->member->flags);
- current_member = current_member->next_member;
- }
-
-
- return_value->size = offset;
-
- return return_value;
-
-
-}
-
-members *w32api_parser_type_make_value(char *type_name, char *member_name, long flags)
-{
- members *return_value = NULL; /* Pointer to our return value */
- member *member_value = NULL; /* Our actual member */
-
- member_value = emalloc(sizeof(member));
- return_value = emalloc(sizeof(members));
-
- return_value->member = member_value;
- return_value->next_member = return_value->prev_member = NULL;
-
- member_value->member_name = member_name; /* estrdup'd in parser */
- member_value->member_type_name = type_name; /* estrdup'd in parser */
- member_value->member_type_id = php_w32api_get_type_id_from_name(type_name);
- member_value->flags = flags;
-
- return return_value;
-}
-
-
-members *w32api_parser_type_join_values(members *lval, members *rval)
-{
- lval->next_member = rval;
- rval->prev_member = lval;
-
- return lval;
-}
-
-/* {{{ w32api_function_definition_error
- * Error function for the parser
- */
-int w32api_type_definition_error(char *s)
-{
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Type Definition Parse Error: %s", s);
- return 0;
-}
-/* }}} */
-
-
-#endif /* HAVE_W32API */
diff --git a/ext/w32api/w32api.dsp b/ext/w32api/w32api.dsp
deleted file mode 100644
index aa77f3621..000000000
--- a/ext/w32api/w32api.dsp
+++ /dev/null
@@ -1,281 +0,0 @@
-# Microsoft Developer Studio Project File - Name="w32api" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=w32api - 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 "w32api.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 "w32api.mak" CFG="w32api - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "w32api - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "w32api - 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)" == "w32api - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "w32api___Win32_Debug_TS"
-# PROP BASE Intermediate_Dir "w32api___Win32_Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "../../Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "W32API_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "W32API_EXPORTS" /D HAVE_W32API=1 /D "COMPILE_DL_W32API" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x809 /d "_DEBUG"
-# ADD RSC /l 0x809 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../../Debug_TS/php_w32api.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "w32api___Win32_Release_TS"
-# PROP BASE Intermediate_Dir "w32api___Win32_Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "../../Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "W32API_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "W32API_EXPORTS" /D "HAVE_W32API" /D "COMPILE_DL_W32API" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /YX /FD /c
-# SUBTRACT CPP /WX /Fr
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x809 /d "NDEBUG"
-# ADD RSC /l 0x809 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /debugtype:both /machine:I386 /out:"../../Release_TS/php_w32api.dll" /libpath:"..\..\Release_TS"
-# SUBTRACT LINK32 /incremental:yes
-
-!ENDIF
-
-# Begin Target
-
-# Name "w32api - Win32 Debug_TS"
-# Name "w32api - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\w32api.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\w32api_function_definition_parser.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\w32api_function_definition_scanner.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\w32api_type_definition_parser.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\w32api_type_definition_scanner.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_w32api.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\w32api_function_definition_parser.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\w32api_type_definition_parser.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Group "Parsers"
-
-# PROP Default_Filter ".y"
-# Begin Source File
-
-SOURCE=.\w32api_function_definition_parser.y
-
-!IF "$(CFG)" == "w32api - Win32 Debug_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\w32api_function_definition_parser.y
-
-BuildCmds= \
- bison --output=w32api_function_definition_parser.c -v -d -p w32api_function_definition_ w32api_function_definition_parser.y
-
-"$(InputDir)/w32api_function_definition_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)/w32api_function_definition_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\w32api_function_definition_parser.y
-
-BuildCmds= \
- bison --output=w32api_function_definition_parser.c -v -d -p w32api_function_definition_ w32api_function_definition_parser.y
-
-"$(InputDir)/w32api_function_definition_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)/w32api_function_definition_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\w32api_type_definition_parser.y
-
-!IF "$(CFG)" == "w32api - Win32 Debug_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\w32api_type_definition_parser.y
-
-BuildCmds= \
- bison --output=w32api_type_definition_parser.c -v -d -p w32api_type_definition_ w32api_type_definition_parser.y
-
-"$(InputDir)/w32api_type_definition_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)/w32api_type_definition_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\w32api_type_definition_parser.y
-
-BuildCmds= \
- bison --output=w32api_type_definition_parser.c -v -d -p w32api_type_definition_ w32api_type_definition_parser.y
-
-"$(InputDir)/w32api_type_definition_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputDir)/w32api_type_definition_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Scanners"
-
-# PROP Default_Filter ".l"
-# Begin Source File
-
-SOURCE=.\w32api_function_definition_scanner.l
-
-!IF "$(CFG)" == "w32api - Win32 Debug_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\w32api_function_definition_scanner.l
-
-"$(InputDir)\w32api_function_definition_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Pw32api_function_definition -ow32api_function_definition_scanner.c w32api_function_definition_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\w32api_function_definition_scanner.l
-
-"$(InputDir)\w32api_function_definition_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Pw32api_function_definition -ow32api_function_definition_scanner.c w32api_function_definition_scanner.l
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\w32api_type_definition_scanner.l
-
-!IF "$(CFG)" == "w32api - Win32 Debug_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\w32api_type_definition_scanner.l
-
-"$(InputDir)/w32api_type_definition_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Pw32api_type_definition -ow32api_type_definition_scanner.c w32api_type_definition_scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "w32api - Win32 Release_TS"
-
-# Begin Custom Build
-InputDir=.
-InputPath=.\w32api_type_definition_scanner.l
-
-"$(InputDir)/w32api_type_definition_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -B -i -Pw32api_type_definition -ow32api_type_definition_scanner.c w32api_type_definition_scanner.l
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/w32api/w32api_function_definition_parser.y b/ext/w32api/w32api_function_definition_parser.y
deleted file mode 100644
index b4a157c7b..000000000
--- a/ext/w32api/w32api_function_definition_parser.y
+++ /dev/null
@@ -1,67 +0,0 @@
-%{
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2001 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: James Moore <jmoore@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: w32api_function_definition_parser.y,v 1.4 2003/06/10 20:03:40 imajes Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <string.h>
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "ext/standard/php_string.h"
-#include "php_w32api.h"
-
-
-#define YYSTYPE w32api_parser_function_definition_union
-#define YYPARSE_PARAM fh
-
-int w32api_function_definition_lex(w32api_parser_function_definition_union *funcdef_lval);
-
-%}
-
-%pure_parser
-
-%token tFROM
-%token tBYREF
-%token tALIAS
-%token <s> tIDENTIFIER
-%token <s> tFILENAME
-
-%type <arg> argument argument_list
-
-%start funcdef
-
-%%
-
-funcdef: tIDENTIFIER tIDENTIFIER tALIAS tIDENTIFIER'(' argument_list ')' tFROM tFILENAME {((w32api_func_handle_ptr *)fh)->hnd = w32api_parser_load_alias_function($1, $2, $4, $6, $9);}
- | tIDENTIFIER tIDENTIFIER '(' argument_list ')' tFROM tFILENAME {((w32api_func_handle_ptr *)fh)->hnd = w32api_parser_load_function($1, $2, $4, $7);}
-;
-
-argument_list: argument ',' argument_list { $$ = w32api_parser_join_arguments($1, $3);}
- | argument {$$ = $1;}
- | {$$ = NULL;}
-;
-
-argument: tIDENTIFIER tIDENTIFIER { $$ = w32api_parser_make_argument_byval($1, $2); }
- | tIDENTIFIER tBYREF tIDENTIFIER { $$ = w32api_parser_make_argument_byref($1, $3); }
-;
diff --git a/ext/w32api/w32api_function_definition_scanner.l b/ext/w32api/w32api_function_definition_scanner.l
deleted file mode 100644
index ee1ace750..000000000
--- a/ext/w32api/w32api_function_definition_scanner.l
+++ /dev/null
@@ -1,63 +0,0 @@
-%{
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2001 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: James Moore <jmoore@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: w32api_function_definition_scanner.l,v 1.3 2003/06/10 20:03:40 imajes Exp $ */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <string.h>
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "ext/standard/php_string.h"
-#include "php_w32api.h"
-#include "w32api_function_definition_parser.h"
-
-#ifdef YYSTYPE
-#undef YYSTYPE
-#endif
-
-#define YYSTYPE w32api_parser_function_definition_union
-
-#define YY_DECL int w32api_function_definition_lex(w32api_parser_function_definition_union *funcdef_lval)
-
-
-%}
-
-ID [A-Za-z][A-Za-z0-9_]*
-FILENAME {ID}\.{ID}
-
-%option noyywrap
-
-%%
-
-"from" {return tFROM;}
-"alias" {return tALIAS;}
-"&" {return tBYREF;}
-{FILENAME} {funcdef_lval->s = estrdup(yytext); return tFILENAME;}
-{ID} {funcdef_lval->s = estrdup(yytext); return tIDENTIFIER;}
-[ \r\t\n] /* Ignore Whitespace */
-. {return *yytext;}
-
-%%
-
diff --git a/ext/w32api/w32api_type_definition_parser.y b/ext/w32api/w32api_type_definition_parser.y
deleted file mode 100644
index 7a4e24351..000000000
--- a/ext/w32api/w32api_type_definition_parser.y
+++ /dev/null
@@ -1,67 +0,0 @@
-%{
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2001 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: James Moore <jmoore@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: w32api_type_definition_parser.y,v 1.3 2003/06/10 20:03:40 imajes Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <string.h>
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "ext/standard/php_string.h"
-#include "php_w32api.h"
-
-#define YYSTYPE w32api_parser_type_definition_union
-#define YYPARSE_PARAM th
-
-int w32api_type_definition_lex(w32api_parser_type_definition_union *typedef_lval);
-
-%}
-
-%pure_parser
-
-%token <s> tTYPEID
-%token tBYREF
-
-%type <type> value_list value
-
-%%
-
-start:
- type_definition
-;
-
-type_definition:
- tTYPEID '{' value_list '}' {((w32api_type_handle_ptr *)th)->hnd = w32api_parser_register_type($1, $3);}
-;
-
-value_list:
- value ';' value_list {$$ = w32api_parser_type_join_values($1, $3);}
- | value ';' {$$ = $1;}
-;
-
-value:
- tTYPEID tTYPEID {$$ = w32api_parser_type_make_byval_value($1, $2);}
- | tTYPEID tBYREF tTYPEID {$$ = w32api_parser_type_make_byref_value($1, $3);}
-;
-
diff --git a/ext/w32api/w32api_type_definition_scanner.l b/ext/w32api/w32api_type_definition_scanner.l
deleted file mode 100644
index 904e21675..000000000
--- a/ext/w32api/w32api_type_definition_scanner.l
+++ /dev/null
@@ -1,56 +0,0 @@
-%{
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2001 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: James Moore <jmoore@php.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id: w32api_type_definition_scanner.l,v 1.3 2003/06/10 20:03:40 imajes Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <string.h>
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "ext/standard/php_string.h"
-#include "php_w32api.h"
-#include "w32api_type_definition_parser.h"
-
-#ifdef YYSTYPE
-#undef YYSTYPE
-#endif
-
-#define YYSTYPE w32api_parser_type_definition_union
-
-#define YY_DECL int w32api_type_definition_lex(w32api_parser_type_definition_union *typedef_lval)
-
-%}
-
-TYPEID [A-Za-z][A-Za-z0-9_]*
-
-%option noyywrap
-
-%%
-
-"&" {return tBYREF;}
-{TYPEID} {typedef_lval->s = estrdup(yytext); return tTYPEID;}
-[ \r\t\n] /* Ignore Whitespace */
-. {return *yytext;}
-
-%% \ No newline at end of file
diff --git a/ext/wddx/config.m4 b/ext/wddx/config.m4
index 724fad5a6..0c5228b0a 100644
--- a/ext/wddx/config.m4
+++ b/ext/wddx/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.10 2002/03/12 16:37:42 sas Exp $
+dnl $Id: config.m4,v 1.11 2005/05/29 23:16:45 sniper Exp $
dnl
PHP_ARG_ENABLE(wddx,whether to enable WDDX support,
-[ --enable-wddx Enable WDDX support.])
+[ --enable-wddx Enable WDDX support])
if test "$PHP_WDDX" != "no"; then
if test "$ext_shared" != "yes" && test "$enable_xml" = "no"; then
diff --git a/ext/wddx/config.w32 b/ext/wddx/config.w32
index 3952e6652..cdb79fb5f 100644
--- a/ext/wddx/config.w32
+++ b/ext/wddx/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.2 2003/12/22 13:16:41 wez Exp $
+// $Id: config.w32,v 1.2.4.1 2005/10/06 13:03:43 derick Exp $
// vim:ft=javascript
ARG_WITH("wddx", "WDDX support", "yes");
@@ -7,6 +7,7 @@ if (PHP_WDDX == "yes" && PHP_LIBXML == "yes") {
EXTENSION("wddx", "wddx.c");
AC_DEFINE("HAVE_WDDX", 1, "WDDX support");
ADD_EXTENSION_DEP('wddx', 'libxml');
+ CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_WDDX", "ext/date/lib");
}
diff --git a/ext/wddx/php_wddx.h b/ext/wddx/php_wddx.h
index a8247f396..c774654fa 100644
--- a/ext/wddx/php_wddx.h
+++ b/ext/wddx/php_wddx.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_wddx.h,v 1.17 2004/01/08 17:32:58 sniper Exp $ */
+/* $Id: php_wddx.h,v 1.18 2005/08/03 14:08:20 sniper Exp $ */
#ifndef PHP_WDDX_H
#define PHP_WDDX_H
diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h
index 010aa8540..3a5ebda2f 100644
--- a/ext/wddx/php_wddx_api.h
+++ b/ext/wddx/php_wddx_api.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_wddx_api.h,v 1.22 2004/01/08 17:32:58 sniper Exp $ */
+/* $Id: php_wddx_api.h,v 1.23.2.2 2005/10/06 18:48:19 rrichards Exp $ */
#ifndef PHP_WDDX_API_H
#define PHP_WDDX_API_H
diff --git a/ext/wddx/tests/bug34306.phpt b/ext/wddx/tests/bug34306.phpt
new file mode 100755
index 000000000..2212dad91
--- /dev/null
+++ b/ext/wddx/tests/bug34306.phpt
@@ -0,0 +1,12 @@
+--TEST--
+#34306 (wddx_serialize_value() crashes with long array keys)
+--FILE--
+<?php
+
+$var = array('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12345678901234567890123456789012345678901234567890ba12345678901234567890123456789012345678901234567890ba12345678901234567890123456789012345678901234567890ba12345678901234567890123456789012345678901234567890b12345678901234567891234567890123123121231211111' => 1);
+$buf = wddx_serialize_value($var, 'name');
+echo "OK\n";
+
+?>
+--EXPECT--
+OK
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 2216fb0ff..e801d60a6 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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: wddx.c,v 1.111.2.3 2005/05/30 15:13:57 sniper Exp $ */
+/* $Id: wddx.c,v 1.119.2.5 2005/10/06 18:48:19 rrichards Exp $ */
#include "php.h"
@@ -34,7 +34,7 @@
#include "ext/standard/php_smart_str.h"
#include "ext/standard/html.h"
#include "ext/standard/php_string.h"
-#include "ext/standard/php_parsedate.h"
+#include "ext/date/php_date.h"
#define WDDX_BUF_LEN 256
#define PHP_CLASS_NAME_VAR "php_class_name"
@@ -422,7 +422,7 @@ static void php_wddx_serialize_number(wddx_packet *packet, zval *var)
tmp = *var;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
- sprintf(tmp_buf, WDDX_NUMBER, Z_STRVAL(tmp));
+ snprintf(tmp_buf, sizeof(tmp_buf), WDDX_NUMBER, Z_STRVAL(tmp));
zval_dtor(&tmp);
php_wddx_add_chunk(packet, tmp_buf);
@@ -524,7 +524,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(key, &class_name, &prop_name);
+ zend_unmangle_property_name_ex(key, key_len, &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);
@@ -617,15 +617,17 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
*/
void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC)
{
- char tmp_buf[WDDX_BUF_LEN];
+ char *tmp_buf;
char *name_esc;
int name_esc_len;
HashTable *ht;
if (name) {
name_esc = php_escape_html_entities(name, name_len, &name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
- sprintf(tmp_buf, WDDX_VAR_S, name_esc);
+ tmp_buf = emalloc(name_esc_len + sizeof(WDDX_VAR_S));
+ snprintf(tmp_buf, name_esc_len + sizeof(WDDX_VAR_S), WDDX_VAR_S, name_esc);
php_wddx_add_chunk(packet, tmp_buf);
+ efree(tmp_buf);
efree(name_esc);
}
@@ -728,7 +730,7 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_STRING;
- Z_STRVAL_P(ent.data) = empty_string;
+ Z_STRVAL_P(ent.data) = STR_EMPTY_ALLOC();
Z_STRLEN_P(ent.data) = 0;
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_BINARY)) {
@@ -738,7 +740,7 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_STRING;
- Z_STRVAL_P(ent.data) = empty_string;
+ Z_STRVAL_P(ent.data) = STR_EMPTY_ALLOC();
Z_STRLEN_P(ent.data) = 0;
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_CHAR)) {
@@ -997,10 +999,20 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name)
ent1->data->refcount--;
add_property_zval(ent2->data, ent1->varname, ent1->data);
EG(scope) = old_scope;
- } else
- zend_hash_update(target_hash,
- ent1->varname, strlen(ent1->varname)+1,
- &ent1->data, sizeof(zval *), NULL);
+ } else {
+ long l;
+ double d;
+
+ switch (is_numeric_string(ent1->varname, strlen(ent1->varname), &l, &d, 0)) {
+ case IS_DOUBLE:
+ l = (long) d;
+ case IS_LONG:
+ zend_hash_index_update(target_hash, l, &ent1->data, sizeof(zval *), NULL);
+ break;
+ default:
+ zend_hash_update(target_hash,ent1->varname, strlen(ent1->varname)+1, &ent1->data, sizeof(zval *), NULL);
+ }
+ }
efree(ent1->varname);
} else {
zend_hash_next_index_insert(target_hash,
@@ -1039,6 +1051,7 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
decoded = xml_utf8_decode(s, len, &decoded_len, "ISO-8859-1");
if (Z_STRLEN_P(ent->data) == 0) {
+ STR_FREE(Z_STRVAL_P(ent->data));
Z_STRVAL_P(ent->data) = estrndup(decoded, decoded_len);
Z_STRLEN_P(ent->data) = decoded_len;
} else {
@@ -1054,6 +1067,7 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
case ST_BINARY:
if (Z_STRLEN_P(ent->data) == 0) {
+ STR_FREE(Z_STRVAL_P(ent->data));
Z_STRVAL_P(ent->data) = estrndup(s, len + 1);
} else {
Z_STRVAL_P(ent->data) = erealloc(Z_STRVAL_P(ent->data), Z_STRLEN_P(ent->data) + len + 1);
diff --git a/ext/xml/compat.c b/ext/xml/compat.c
index c2a6dfebd..43e116b86 100644
--- a/ext/xml/compat.c
+++ b/ext/xml/compat.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
*/
#include "php.h"
-#if defined(HAVE_LIBXML) && defined(HAVE_XML) && !defined(HAVE_LIBEXPAT)
+#if defined(HAVE_LIBXML) && (defined(HAVE_XML) || defined(HAVE_XMLRPC)) && !defined(HAVE_LIBEXPAT)
#include "expat_compat.h"
typedef struct _php_xml_ns {
@@ -33,7 +33,6 @@ typedef struct _php_xml_ns {
((__ns) != NULL && strlen(__ns) == 5 && *(__ns) == 'x' && *((__ns)+1) == 'm' && \
*((__ns)+2) == 'l' && *((__ns)+3) == 'n' && *((__ns)+4) == 's')
-#if LIBXML_VERSION >= 20600
static void
_qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI, xmlChar **qualified)
{
@@ -46,7 +45,6 @@ _qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI, x
*qualified = xmlStrdup(name);
}
}
-#endif
static void
_start_element_handler(void *user, const xmlChar *name, const xmlChar **attributes)
@@ -55,6 +53,29 @@ _start_element_handler(void *user, const xmlChar *name, const xmlChar **attribut
xmlChar *qualified_name = NULL;
if (parser->h_start_element == NULL) {
+ if (parser->h_default) {
+ int attno = 0;
+
+ qualified_name = xmlStrncatNew((xmlChar *)"<", name, xmlStrlen(name));
+ if (attributes) {
+ while (attributes[attno] != NULL) {
+ int att_len;
+ char *att_string, *att_name, *att_value;
+
+ att_name = (char *)attributes[attno++];
+ att_value = (char *)attributes[attno++];
+
+ att_len = spprintf(&att_string, 0, " %s=\"%s\"", att_name, att_value);
+
+ qualified_name = xmlStrncat(qualified_name, (xmlChar *)att_string, att_len);
+ efree(att_string);
+ }
+
+ }
+ qualified_name = xmlStrncat(qualified_name, (xmlChar *)">", 1);
+ parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name));
+ xmlFree(qualified_name);
+ }
return;
}
@@ -65,7 +86,6 @@ _start_element_handler(void *user, const xmlChar *name, const xmlChar **attribut
xmlFree(qualified_name);
}
-#if LIBXML_VERSION >= 20600
static void
_start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar ** namespaces, int nb_attributes, int nb_defaulted, const xmlChar ** attributes)
{
@@ -84,7 +104,7 @@ _start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix
y = 0;
}
- if (parser->h_start_element == NULL) {
+ if (parser->h_start_element == NULL && parser->h_default == NULL) {
return;
}
_qualify_namespace(parser, name, URI, &qualified_name);
@@ -117,7 +137,6 @@ _start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix
}
xmlFree(qualified_name);
}
-#endif
static void
_namespace_handler(XML_Parser parser, xmlNsPtr nsptr)
@@ -135,6 +154,13 @@ _end_element_handler(void *user, const xmlChar *name)
XML_Parser parser = (XML_Parser) user;
if (parser->h_end_element == NULL) {
+ if (parser->h_default) {
+ char *end_element;
+
+ spprintf(&end_element, 0, "</%s>", (char *)name);
+ parser->h_default(parser->user, (const XML_Char *) end_element, strlen(end_element));
+ efree(end_element);
+ }
return;
}
@@ -145,7 +171,6 @@ _end_element_handler(void *user, const xmlChar *name)
xmlFree(qualified_name);
}
-#if LIBXML_VERSION >= 20600
static void
_end_element_handler_ns(void *user, const xmlChar *name, const xmlChar * prefix, const xmlChar *URI)
{
@@ -162,7 +187,6 @@ _end_element_handler_ns(void *user, const xmlChar *name, const xmlChar * prefix,
xmlFree(qualified_name);
}
-#endif
static void
_cdata_handler(void *user, const xmlChar *cdata, int cdata_len)
@@ -170,6 +194,9 @@ _cdata_handler(void *user, const xmlChar *cdata, int cdata_len)
XML_Parser parser = (XML_Parser) user;
if (parser->h_cdata == NULL) {
+ if (parser->h_default) {
+ parser->h_default(parser->user, (const XML_Char *) cdata, cdata_len);
+ }
return;
}
@@ -182,6 +209,12 @@ _pi_handler(void *user, const xmlChar *target, const xmlChar *data)
XML_Parser parser = (XML_Parser) user;
if (parser->h_pi == NULL) {
+ if (parser->h_default) {
+ char *full_pi;
+ spprintf(&full_pi, 0, "<?%s %s?>", (char *)target, (char *)data);
+ parser->h_default(parser->user, (const XML_Char *) full_pi, xmlStrlen(full_pi));
+ efree(full_pi);
+ }
return;
}
@@ -191,8 +224,8 @@ _pi_handler(void *user, const xmlChar *target, const xmlChar *data)
static void
_unparsed_entity_decl_handler(void *user,
const xmlChar *name,
- const xmlChar *sys_id,
const xmlChar *pub_id,
+ const xmlChar *sys_id,
const xmlChar *notation)
{
XML_Parser parser = (XML_Parser) user;
@@ -205,7 +238,7 @@ _unparsed_entity_decl_handler(void *user,
}
static void
-_notation_decl_handler(void *user, const xmlChar *notation, const xmlChar *sys_id, const xmlChar *pub_id)
+_notation_decl_handler(void *user, const xmlChar *notation, const xmlChar *pub_id, const xmlChar *sys_id)
{
XML_Parser parser = (XML_Parser) user;
@@ -335,16 +368,11 @@ php_xml_compat_handlers = {
NULL, /* getParameterEntity */
_cdata_handler, /* cdataBlock */
NULL, /* externalSubset */
-#if LIBXML_VERSION < 20600
- 1,
-#else
XML_SAX2_MAGIC,
NULL,
_start_element_handler_ns,
_end_element_handler_ns,
- NULL
-#endif
-
+ NULL
};
PHPAPI XML_Parser
@@ -390,16 +418,12 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m
parser->parser->wellFormed = 0;
if (sep != NULL) {
parser->use_namespace = 1;
-#if LIBXML_VERSION >= 20600
parser->parser->sax2 = 1;
-#endif
parser->_ns_seperator = xmlStrdup(sep);
-#if LIBXML_VERSION >= 20600
} else {
/* Reset flag as XML_SAX2_MAGIC is needed for xmlCreatePushParserCtxt
so must be set in the handlers */
parser->parser->sax->initialized = 1;
-#endif
}
return parser;
}
@@ -480,9 +504,7 @@ XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler en
PHPAPI int
XML_Parse(XML_Parser parser, const XML_Char *data, int data_len, int is_final)
{
-#if LIBXML_VERSION >= 20600
int error;
-#endif
/* The following is a hack to keep BC with PHP 4 while avoiding
the inifite loop in libxml <= 2.6.17 which occurs when no encoding
@@ -508,7 +530,6 @@ has been defined and none can be detected */
}
#endif
-#if LIBXML_VERSION >= 20600
error = xmlParseChunk(parser->parser, data, data_len, is_final);
if (!error) {
return 1;
@@ -517,9 +538,6 @@ has been defined and none can be detected */
} else {
return 1;
}
-#else
- return !xmlParseChunk(parser->parser, data, data_len, is_final);
-#endif
}
PHPAPI int
@@ -528,7 +546,7 @@ XML_GetErrorCode(XML_Parser parser)
return parser->parser->errNo;
}
-const XML_Char *error_mapping[] = {
+static const XML_Char *const error_mapping[] = {
"No error",
"Internal error",
"No memory",
@@ -684,6 +702,10 @@ XML_ParserFree(XML_Parser parser)
xmlFree(parser->_ns_seperator);
}
}
+ if (parser->parser->myDoc) {
+ xmlFreeDoc(parser->parser->myDoc);
+ parser->parser->myDoc = NULL;
+ }
xmlFreeParserCtxt(parser->parser);
efree(parser);
}
diff --git a/ext/xml/config.m4 b/ext/xml/config.m4
index 7d288042d..2afcd7dc9 100644
--- a/ext/xml/config.m4
+++ b/ext/xml/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.48.2.1 2005/04/27 13:13:38 sniper Exp $
+dnl $Id: config.m4,v 1.54 2005/06/20 00:52:59 sniper Exp $
dnl
PHP_ARG_ENABLE(xml,whether to enable XML support,
-[ --disable-xml Disable XML support.], yes)
+[ --disable-xml Disable XML support], yes)
if test -z "$PHP_LIBXML_DIR"; then
PHP_ARG_WITH(libxml-dir, libxml2 install dir,
@@ -26,6 +26,7 @@ if test "$PHP_XML" != "no"; then
PHP_SETUP_LIBXML(XML_SHARED_LIBADD, [
xml_extra_sources="compat.c"
+ PHP_ADD_EXTENSION_DEP(xml, libxml)
], [
AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=<DIR>])
])
@@ -36,7 +37,7 @@ if test "$PHP_XML" != "no"; then
dnl
if test "$PHP_LIBEXPAT_DIR" != "no"; then
for i in $PHP_XML $PHP_LIBEXPAT_DIR; do
- if test -f "$i/lib/libexpat.a" || test -f "$i/lib/libexpat.$SHLIB_SUFFIX_NAME"; then
+ if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then
EXPAT_DIR=$i
break
fi
@@ -47,11 +48,12 @@ if test "$PHP_XML" != "no"; then
fi
PHP_ADD_INCLUDE($EXPAT_DIR/include)
- PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/lib, XML_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/$PHP_LIBDIR, XML_SHARED_LIBADD)
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
fi
PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared)
PHP_SUBST(XML_SHARED_LIBADD)
+ PHP_INSTALL_HEADERS([ext/xml/])
AC_DEFINE(HAVE_XML, 1, [ ])
fi
diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h
index a687c7a21..2c1ec1e87 100644
--- a/ext/xml/expat_compat.h
+++ b/ext/xml/expat_compat.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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,14 +16,21 @@
+----------------------------------------------------------------------+
*/
-/* $Id: expat_compat.h,v 1.16 2004/02/22 17:51:01 chregu Exp $ */
+/* $Id: expat_compat.h,v 1.19 2005/08/03 14:08:21 sniper Exp $ */
#ifndef PHP_EXPAT_COMPAT_H
#define PHP_EXPAT_COMPAT_H
+#ifdef PHP_WIN32
+#include "config.w32.h"
+#else
+#include <php_config.h>
+#endif
+
#if !defined(HAVE_LIBEXPAT) && defined(HAVE_LIBXML)
#define LIBXML_EXPAT_COMPAT 1
+#include "php.h"
#include "php_compat.h"
#include <libxml/parser.h>
diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h
index e149bdb72..773b8698b 100644
--- a/ext/xml/php_xml.h
+++ b/ext/xml/php_xml.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xml.h,v 1.26.2.1 2005/04/28 12:17:18 rrichards Exp $ */
+/* $Id: php_xml.h,v 1.28 2005/08/03 14:08:21 sniper Exp $ */
#ifndef PHP_XML_H
#define PHP_XML_H
diff --git a/ext/xml/tests/bug26614.phpt b/ext/xml/tests/bug26614.phpt
index 14a4ea8a9..a8a91ae87 100644
--- a/ext/xml/tests/bug26614.phpt
+++ b/ext/xml/tests/bug26614.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #26614 (CDATA sections skipped on line count)
+--SKIPIF--
+<?php if (defined("LIBXML_VERSION")) die('skip expat test'); ?>
--FILE--
<?php
/*
diff --git a/ext/xml/tests/bug26614_libxml.phpt b/ext/xml/tests/bug26614_libxml.phpt
new file mode 100755
index 000000000..645bf7e75
--- /dev/null
+++ b/ext/xml/tests/bug26614_libxml.phpt
@@ -0,0 +1,90 @@
+--TEST--
+Bug #26614 (CDATA sections skipped on line count)
+--SKIPIF--
+<?php if (!defined("LIBXML_VERSION")) die('skip libxml2 test'); ?>
+--FILE--
+<?php
+/*
+this test works fine with Expat but fails with libxml
+which we now use as default
+
+further investigation has shown that not only line count
+is skippet on CDATA sections but that libxml does also
+show different column numbers and byte positions depending
+on context and in opposition to what one would expect to
+see and what good old Expat reported just fine ...
+*/
+
+$xmls = array();
+
+// Case 1: CDATA Sections
+$xmls["CDATA"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
+<data>
+<![CDATA[
+multi
+line
+CDATA
+block
+]]>
+</data>';
+
+// Case 2: replace some characters so that we get comments instead
+$xmls["Comment"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
+<data>
+<!-- ATA[
+multi
+line
+CDATA
+block
+-->
+</data>';
+
+// Case 3: replace even more characters so that only textual data is left
+$xmls["Text"] ='<?xml version="1.0" encoding="iso-8859-1" ?>
+<data>
+-!-- ATA[
+multi
+line
+CDATA
+block
+---
+</data>';
+
+function startElement($parser, $name, $attrs) {
+ printf("<$name> at line %d, col %d (byte %d)\n",
+ xml_get_current_line_number($parser),
+ xml_get_current_column_number($parser),
+ xml_get_current_byte_index($parser));
+}
+
+function endElement($parser, $name) {
+ printf("</$name> at line %d, col %d (byte %d)\n",
+ xml_get_current_line_number($parser),
+ xml_get_current_column_number($parser),
+ xml_get_current_byte_index($parser));
+}
+
+function characterData($parser, $data) {
+ // dummy
+}
+
+foreach ($xmls as $desc => $xml) {
+ echo "$desc\n";
+ $xml_parser = xml_parser_create();
+ xml_set_element_handler($xml_parser, "startElement", "endElement");
+ xml_set_character_data_handler($xml_parser, "characterData");
+ if (!xml_parse($xml_parser, $xml, true))
+ echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n";
+ xml_parser_free($xml_parser);
+}
+?>
+--EXPECTF--
+CDATA
+<DATA> at line 2, col %d (byte 9)
+</DATA> at line 9, col %d (byte 56)
+Comment
+<DATA> at line 2, col %d (byte 9)
+</DATA> at line 9, col %d (byte 56)
+Text
+<DATA> at line 2, col %d (byte 9)
+</DATA> at line 9, col %d (byte 56)
diff --git a/ext/xml/tests/bug27908.phpt b/ext/xml/tests/bug27908.phpt
new file mode 100644
index 000000000..abb856137
--- /dev/null
+++ b/ext/xml/tests/bug27908.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #27908 (default handler not being called)
+--FILE--
+<?php
+
+function x_default_handler($xp,$data)
+{
+ echo "x_default_handler $data\n";
+}
+$xp = xml_parser_create();
+xml_set_default_handler($xp,'x_default_handler');
+xml_parse($xp, '<root></root>',TRUE);
+xml_parser_free($xp);
+echo "Done\n";
+?>
+--EXPECT--
+x_default_handler <root>
+x_default_handler </root>
+Done
diff --git a/ext/xml/tests/bug30266.phpt b/ext/xml/tests/bug30266.phpt
new file mode 100644
index 000000000..ebc0a270c
--- /dev/null
+++ b/ext/xml/tests/bug30266.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Bug #30266 (Invalid opcode 137/1/8)
+--FILE--
+<?php
+/*
+
+Currently (Feb 10, 2005) CVS HEAD fails with the following message:
+
+Fatal error: Invalid opcode 137/1/8. in /home/hartmut/projects/php/dev/head/ext/xml/tests/bug30266.php on line 22
+
+*/
+class XML_Parser
+{
+ public $dummy = "a";
+
+ function parse($data)
+ {
+ $parser = xml_parser_create();
+
+ xml_set_object($parser, $this);
+
+ xml_set_element_handler($parser, 'startHandler', 'endHandler');
+
+ xml_parse($parser, $data, true);
+
+ xml_parser_free($parser);
+ }
+
+ function startHandler($XmlParser, $tag, $attr)
+ {
+ $this->dummy = "b";
+ throw new Exception("ex");
+ }
+
+ function endHandler($XmlParser, $tag)
+ {
+ }
+}
+
+$p1 = new Xml_Parser();
+try {
+ $p1->parse('<tag1><tag2></tag2></tag1>');
+} catch (Exception $e) {
+ echo "OK\n";
+}
+?>
+--EXPECT--
+OK
diff --git a/ext/xml/tests/bug32001.phpt b/ext/xml/tests/bug32001.phpt
index 57b0d130c..22f405ae5 100644
--- a/ext/xml/tests/bug32001.phpt
+++ b/ext/xml/tests/bug32001.phpt
@@ -1,8 +1,11 @@
--TEST--
Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect)
--SKIPIF--
-<?php # vim:ft=php
-if (!extension_loaded("iconv")) print "skip";
+<?php
+ if (!extension_loaded('iconv')) {
+ die ("skip iconv extension not available\n");
+ }
+?>
--FILE--
<?php
class testcase {
@@ -155,7 +158,8 @@ $suite = array(
);
if (XML_SAX_IMPL == 'libxml') {
- preg_match("/^libxml2 Version.*\$/im", `$_ENV[TEST_PHP_EXECUTABLE] -i`, $match);
+ $php = getenv('TEST_PHP_EXECUTABLE');
+ preg_match("/^libxml2 Version.*\$/im", `$php -i`, $match);
echo $match[0], "\n";
} else {
echo "libxml2 Version => NONE\n";
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 007a5b93c..d40b2810b 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xml.c,v 1.151.2.4 2005/04/28 12:17:18 rrichards Exp $ */
+/* $Id: xml.c,v 1.157.2.1 2005/10/12 03:21:05 rrichards Exp $ */
#define IS_EXT_MODULE
@@ -139,8 +139,20 @@ function_entry xml_functions[] = {
{NULL, NULL, NULL}
};
+#ifdef LIBXML_EXPAT_COMPAT
+static zend_module_dep xml_deps[] = {
+ ZEND_MOD_REQUIRED("libxml")
+ {NULL, NULL, NULL}
+};
+#endif
+
zend_module_entry xml_module_entry = {
+#ifdef LIBXML_EXPAT_COMPAT
+ STANDARD_MODULE_HEADER_EX, NULL,
+ xml_deps,
+#else
STANDARD_MODULE_HEADER,
+#endif
"xml", /* extension name */
xml_functions, /* extension function list */
PHP_MINIT(xml), /* extension-wide startup function */
@@ -442,8 +454,8 @@ static zval *xml_call_handler(xml_parser *parser, zval *handler, zend_function *
} else {
for (i = 0; i < argc; i++) {
zval_ptr_dtor(&argv[i]);
- }
- return NULL;
+ }
+ return NULL;
}
}
/* }}} */
@@ -1096,12 +1108,7 @@ PHP_FUNCTION(xml_parser_create)
Create an XML parser */
PHP_FUNCTION(xml_parser_create_ns)
{
-#if defined(HAVE_LIBXML) && defined(HAVE_XML) && !defined(HAVE_LIBEXPAT) && LIBXML_VERSION < 20600
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "is broken with libxml2 %s. Please upgrade to libxml2 2.6", LIBXML_DOTTED_VERSION);
- RETURN_FALSE;
-#else
php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
-#endif
}
/* }}} */
diff --git a/ext/xmlreader/CREDITS b/ext/xmlreader/CREDITS
new file mode 100644
index 000000000..35f3af193
--- /dev/null
+++ b/ext/xmlreader/CREDITS
@@ -0,0 +1,2 @@
+XMLReader
+Rob Richards
diff --git a/ext/xmlreader/README b/ext/xmlreader/README
new file mode 100644
index 000000000..0d946f62d
--- /dev/null
+++ b/ext/xmlreader/README
@@ -0,0 +1,5 @@
+XMLReader represents a reader that provides non-cached,
+forward-only access to XML data. It is based upon the
+xmlTextReader api from libxml
+
+This extension is designed to only work under PHP 5.
diff --git a/ext/xmlreader/TODO b/ext/xmlreader/TODO
new file mode 100644
index 000000000..744c56192
--- /dev/null
+++ b/ext/xmlreader/TODO
@@ -0,0 +1,8 @@
+- Implement functions to support PHP 4
+
+- Refactor internals once libxml 2.6.x is minimum requirement for PHP 5
+ use new api for creating the xmlTextReaderPtr
+
+- Add Custom Error Handling
+
+
diff --git a/ext/xmlreader/config.m4 b/ext/xmlreader/config.m4
new file mode 100644
index 000000000..64e617bf9
--- /dev/null
+++ b/ext/xmlreader/config.m4
@@ -0,0 +1,26 @@
+dnl
+dnl $Id: config.m4,v 1.3 2005/05/29 23:16:45 sniper Exp $
+dnl
+
+PHP_ARG_WITH(xmlreader, for XMLReader support,
+[ --with-xmlreader Include XMLReader support])
+
+if test -z "$PHP_LIBXML_DIR"; then
+ PHP_ARG_WITH(libxml-dir, libxml2 install dir,
+ [ --with-libxml-dir=DIR XMLReader: libxml2 install prefix], no, no)
+fi
+
+if test "$PHP_XMLREADER" != "no"; then
+
+ if test "$PHP_LIBXML" = "no"; then
+ AC_MSG_ERROR([XMLReader extension requires LIBXML extension, add --enable-libxml])
+ fi
+
+ PHP_SETUP_LIBXML(XMLREADER_SHARED_LIBADD, [
+ AC_DEFINE(HAVE_XMLREADER,1,[ ])
+ PHP_NEW_EXTENSION(xmlreader, php_xmlreader.c, $ext_shared)
+ PHP_SUBST(XMLREADER_SHARED_LIBADD)
+ ], [
+ AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
+ ])
+fi
diff --git a/ext/xmlreader/config.w32 b/ext/xmlreader/config.w32
new file mode 100644
index 000000000..e33536643
--- /dev/null
+++ b/ext/xmlreader/config.w32
@@ -0,0 +1,14 @@
+// $Id: config.w32,v 1.2 2004/07/29 20:42:49 edink Exp $
+// vim:ft=javascript
+
+ARG_WITH("xmlreader", "XMLReader support", "no");
+
+if (PHP_XMLREADER == "yes" && PHP_LIBXML == "yes") {
+ EXTENSION("xmlreader", "php_xmlreader.c");
+ AC_DEFINE("HAVE_XMLREADER", 1, "XMLReader support");
+ if (!PHP_XMLREADER_SHARED) {
+ ADD_FLAG("CFLAGS_XMLREADER", "/D LIBXML_STATIC");
+ }
+ ADD_EXTENSION_DEP('xmlreader', 'libxml');
+}
+
diff --git a/ext/xmlreader/examples/dtdexample.dtd b/ext/xmlreader/examples/dtdexample.dtd
new file mode 100644
index 000000000..ce53f0bc1
--- /dev/null
+++ b/ext/xmlreader/examples/dtdexample.dtd
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!ELEMENT LIST (MOVIE+)>
+<!ELEMENT MOVIE (TITLE, ORGTITLE, LOC, INFO)>
+<!ATTLIST MOVIE ID ID #REQUIRED>
+<!ELEMENT TITLE (#PCDATA)>
+<!ELEMENT ORGTITLE (#PCDATA)>
+<!ELEMENT LOC (#PCDATA)>
+<!ELEMENT INFO (#PCDATA)>
diff --git a/ext/xmlreader/examples/dtdexample.xml b/ext/xmlreader/examples/dtdexample.xml
new file mode 100644
index 000000000..052889c05
--- /dev/null
+++ b/ext/xmlreader/examples/dtdexample.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE LIST SYSTEM "dtdexample.dtd">
+<LIST>
+<MOVIE ID="x200338360">
+<TITLE>Move Title 1</TITLE>
+<ORGTITLE/><LOC>Location 1</LOC>
+<INFO/>
+</MOVIE>
+<MOVIE ID="m200338361">
+<TITLE>Move Title 2</TITLE>
+<ORGTITLE/>
+<LOC>Location 2</LOC>
+<INFO/>
+</MOVIE>
+</LIST>
diff --git a/ext/xmlreader/examples/relaxNG.rng b/ext/xmlreader/examples/relaxNG.rng
new file mode 100644
index 000000000..f4357e04e
--- /dev/null
+++ b/ext/xmlreader/examples/relaxNG.rng
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+<include href="relaxNG2.rng">
+<define name="TEI.prose"><ref name="INCLUDE"/></define>
+</include>
+</grammar>
+
+
+
diff --git a/ext/xmlreader/examples/relaxNG.xml b/ext/xmlreader/examples/relaxNG.xml
new file mode 100644
index 000000000..6b0cac122
--- /dev/null
+++ b/ext/xmlreader/examples/relaxNG.xml
@@ -0,0 +1 @@
+<TEI.2>hello</TEI.2> \ No newline at end of file
diff --git a/ext/xmlreader/examples/relaxNG2.rng b/ext/xmlreader/examples/relaxNG2.rng
new file mode 100644
index 000000000..4adae7b15
--- /dev/null
+++ b/ext/xmlreader/examples/relaxNG2.rng
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:t="http://www.thaiopensource.com/ns/annotations" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+ <start>
+ <ref name="TEI.2"/>
+ </start>
+ <define name="IGNORE">
+ <notAllowed/>
+ </define>
+ <define name="INCLUDE">
+ <empty/>
+ </define>
+
+
+ <include href="relaxNG3.rng"/>
+
+ <define name="TEI.2">
+ <element name="TEI.2">
+ <text/>
+ </element>
+ </define>
+
+</grammar> \ No newline at end of file
diff --git a/ext/xmlreader/examples/relaxNG3.rng b/ext/xmlreader/examples/relaxNG3.rng
new file mode 100644
index 000000000..73e1eb616
--- /dev/null
+++ b/ext/xmlreader/examples/relaxNG3.rng
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:t="http://www.thaiopensource.com/ns/annotations" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+ <define name="TEI.prose" combine="interleave">
+ <ref name="IGNORE"/>
+ </define>
+
+</grammar> \ No newline at end of file
diff --git a/ext/xmlreader/examples/xmlreader.xml b/ext/xmlreader/examples/xmlreader.xml
new file mode 100644
index 000000000..4c53743de
--- /dev/null
+++ b/ext/xmlreader/examples/xmlreader.xml
@@ -0,0 +1,10 @@
+<books>
+ <book num="1">
+ <title>The Grapes of Wrath</title>
+ <author>John Steinbeck</author>
+ </book>
+ <book num="2">
+ <title>The Pearl</title>
+ <author>John Steinbeck</author>
+ </book>
+</books>
diff --git a/ext/xmlreader/examples/xmlreader_file.php b/ext/xmlreader/examples/xmlreader_file.php
new file mode 100644
index 000000000..531e20b6f
--- /dev/null
+++ b/ext/xmlreader/examples/xmlreader_file.php
@@ -0,0 +1,20 @@
+<?php
+$reader = new XMLReader();
+$reader->open('xmlreader.xml');
+while ($reader->read()) {
+ if ($reader->nodeType != XMLREADER::END_ELEMENT) {
+ print "Node Name: ".$reader->name."\n";
+ print "Node Value: ".$reader->value."\n";
+ print "Node Depth: ".$reader->depth."\n";
+ if ($reader->nodeType==XMLREADER::ELEMENT && $reader->hasAttributes) {
+ $attr = $reader->moveToFirstAttribute();
+ while ($attr) {
+ print " Attribute Name: ".$reader->name."\n";
+ print " Attribute Value: ".$reader->value."\n";
+ $attr = $reader->moveToNextAttribute();
+ }
+ }
+ print "\n";
+ }
+}
+?>
diff --git a/ext/xmlreader/examples/xmlreader_relaxNG.php b/ext/xmlreader/examples/xmlreader_relaxNG.php
new file mode 100644
index 000000000..e56739a2f
--- /dev/null
+++ b/ext/xmlreader/examples/xmlreader_relaxNG.php
@@ -0,0 +1,25 @@
+<?php
+$indent = 5; /* Number of spaces to indent per level */
+
+$reader = new XMLReader();
+$reader->open('relaxNG.xml');
+/*
+Example setting relaxNG using string:
+$reader->setRelaxNGSchemaSource(file_get_contents('relaxNG.rng'));
+*/
+if ($reader->setRelaxNGSchema('relaxNG.rng')) {
+ while ($reader->read()) {
+ /* Print node name indenting it based on depth and $indent var */
+ print str_repeat(" ", $reader->depth * $indent).$reader->name."\n";
+ }
+}
+
+print "\n";
+
+if (! $reader->isValid()) {
+ print "Document is not valid\n";
+} else {
+ print "Document is valid\n";
+}
+
+?> \ No newline at end of file
diff --git a/ext/xmlreader/examples/xmlreader_string.php b/ext/xmlreader/examples/xmlreader_string.php
new file mode 100644
index 000000000..f267245fd
--- /dev/null
+++ b/ext/xmlreader/examples/xmlreader_string.php
@@ -0,0 +1,31 @@
+<?php
+$xmlstring = '<books>
+ <book num="1">
+ <title>The Grapes of Wrath</title>
+ <author>John Steinbeck</author>
+ </book>
+ <book num="2">
+ <title>The Pearl</title>
+ <author>John Steinbeck</author>
+ </book>
+</books>';
+
+$reader = new XMLReader();
+$reader->XML($xmlstring);
+while ($reader->read()) {
+ if ($reader->nodeType != XMLREADER::END_ELEMENT) {
+ print "Node Name: ".$reader->name."\n";
+ print "Node Value: ".$reader->value."\n";
+ print "Node Depth: ".$reader->depth."\n";
+ if ($reader->nodeType==XMLREADER::ELEMENT && $reader->hasAttributes) {
+ $attr = $reader->moveToFirstAttribute();
+ while ($attr) {
+ print " Attribute Name: ".$reader->name."\n";
+ print " Attribute Value: ".$reader->value."\n";
+ $attr = $reader->moveToNextAttribute();
+ }
+ }
+ print "\n";
+ }
+}
+?>
diff --git a/ext/xmlreader/examples/xmlreader_validatedtd.php b/ext/xmlreader/examples/xmlreader_validatedtd.php
new file mode 100644
index 000000000..520a61ee3
--- /dev/null
+++ b/ext/xmlreader/examples/xmlreader_validatedtd.php
@@ -0,0 +1,18 @@
+<?php
+$indent = 5; /* Number of spaces to indent per level */
+
+$xml = new XMLReader();
+$xml->open("dtdexample.xml");
+$xml->setParserProperty(XMLREADER::LOADDTD, TRUE);
+$xml->setParserProperty(XMLREADER::VALIDATE, TRUE);
+while($xml->read()) {
+ /* Print node name indenting it based on depth and $indent var */
+ print str_repeat(" ", $xml->depth * $indent).$xml->name."\n";
+ if ($xml->hasAttributes) {
+ $attCount = $xml->attributeCount;
+ print str_repeat(" ", $xml->depth * $indent)." Number of Attributes: ".$xml->attributeCount."\n";
+ }
+}
+print "\n\nValid:\n";
+var_dump($xml->isValid());
+?> \ No newline at end of file
diff --git a/ext/xmlreader/package.xml b/ext/xmlreader/package.xml
new file mode 100644
index 000000000..6536b78c1
--- /dev/null
+++ b/ext/xmlreader/package.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE package SYSTEM "../package.dtd">
+<package>
+ <name>xmlreader</name>
+ <summary>Provides fast, non-cached, forward-only access to XML data under PHP 5.</summary>
+ <description>
+ This extension wraps the libxml xmlReader API. The reader acts as a cursor
+ going forward on the document stream and stopping at each node in the way.
+ xmlReader is similar to SAX though uses a much simpler API.
+ </description>
+ <license>PHP License</license>
+ <maintainers>
+ <maintainer>
+ <user>rrichards</user>
+ <name>Rob Richards</name>
+ <email>rrichards@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>chregu</user>
+ <role>lead</role>
+ <name>Christian Stocker</name>
+ <email>chregu@php.net</email>
+ </maintainer>
+ </maintainers>
+
+ <release>
+ <version>1.0.1</version>
+ <date>2005-04-30</date>
+ <state>stable</state>
+ <notes>
+ Add workaround for next() bug when using libxml 2.6.17 and lower.
+ </notes>
+ </release>
+
+ <changelog>
+ <release>
+ <version>1.0</version>
+ <date>2004-07-27</date>
+ <state>stable</state>
+ <notes>
+ Add name parameter to next() to skip to next named sibling node.
+ </notes>
+ </release>
+ </changelog>
+
+ <configureoptions>
+ <configureoption name="with-xmlreader" default="autodetect" prompt="Include XMLReader support?"/>
+ </configureoptions>
+ <filelist>
+ <file role="src" name="config.m4"/>
+ <file role="src" name="config.w32"/>
+ <file role="src" name="php_xmlreader.c"/>
+ <file role="src" name="php_xmlreader.h"/>
+
+ <file role="doc" name="CREDITS"/>
+ <file role="doc" name="TODO"/>
+ <file role="doc" name="README"/>
+ <file role="doc" name="examples/xmlreader_file.php"/>
+ <file role="doc" name="examples/xmlreader_string.php"/>
+ <file role="doc" name="examples/xmlreader.xml"/>
+ <file role="doc" name="examples/xmlreader_validatedtd.php"/>
+ <file role="doc" name="examples/dtdexample.xml"/>
+ <file role="doc" name="examples/dtdexample.dtd"/>
+ <file role="doc" name="examples/xmlreader_relaxNG.php"/>
+ <file role="doc" name="examples/relaxNG.xml"/>
+ <file role="doc" name="examples/relaxNG.rng"/>
+ <file role="doc" name="examples/relaxNG2.rng"/>
+ <file role="doc" name="examples/relaxNG3.rng"/>
+ </filelist>
+ <deps>
+ <dep type="php" rel="ge" version="5" />
+ <dep type="ext" rel="has">libxml</dep>
+ </deps>
+</package>
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
new file mode 100644
index 000000000..23bf828eb
--- /dev/null
+++ b/ext/xmlreader/php_xmlreader.c
@@ -0,0 +1,1176 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Rob Richards <rrichards@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_xmlreader.c,v 1.13.2.3 2005/11/15 14:28:40 dmitry Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_xmlreader.h"
+#ifdef HAVE_DOM
+#include "ext/dom/xml_common.h"
+#endif
+#include <libxml/uri.h>
+
+zend_class_entry *xmlreader_class_entry;
+
+static zend_object_handlers xmlreader_object_handlers;
+
+static HashTable xmlreader_prop_handlers;
+
+typedef int (*xmlreader_read_int_t)(xmlTextReaderPtr reader);
+typedef unsigned char *(*xmlreader_read_char_t)(xmlTextReaderPtr reader);
+typedef 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_write_t write_func;
+ int type;
+} xmlreader_prop_handler;
+
+#define XMLREADER_LOAD_STRING 0
+#define XMLREADER_LOAD_FILE 1
+
+static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_char_t read_char_func, int rettype TSRMLS_DC)
+{
+ xmlreader_prop_handler hnd;
+
+ hnd.read_char_func = read_char_func;
+ hnd.read_int_func = read_int_func;
+ hnd.type = rettype;
+ zend_hash_add(prop_handler, name, strlen(name)+1, &hnd, sizeof(xmlreader_prop_handler), NULL);
+}
+
+static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handler *hnd, zval **retval TSRMLS_DC)
+{
+ char *retchar = NULL;
+ int retint = 0;
+
+ if (obj->ptr != NULL) {
+ if (hnd->read_char_func) {
+ retchar = hnd->read_char_func(obj->ptr);
+ } else {
+ if (hnd->read_int_func) {
+ retint = hnd->read_int_func(obj->ptr);
+ if (retint == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal libxml error returned");
+ return FAILURE;
+ }
+ }
+ }
+ }
+
+ ALLOC_ZVAL(*retval);
+
+ switch (hnd->type) {
+ case IS_STRING:
+ if (retchar) {
+ ZVAL_STRING(*retval, retchar, 1);
+ xmlFree(retchar);
+ } else {
+ ZVAL_EMPTY_STRING(*retval);
+ }
+ break;
+ case IS_BOOL:
+ ZVAL_BOOL(*retval, retint);
+ break;
+ case IS_LONG:
+ ZVAL_LONG(*retval, retint);
+ break;
+ default:
+ ZVAL_NULL(*retval);
+ }
+
+ return SUCCESS;
+}
+
+/* {{{ xmlreader_read_property */
+zval *xmlreader_read_property(zval *object, zval *member, int type TSRMLS_DC)
+{
+ xmlreader_object *obj;
+ zval tmp_member;
+ zval *retval;
+ xmlreader_prop_handler *hnd;
+ zend_object_handlers *std_hnd;
+ int ret;
+
+ if (member->type != IS_STRING) {
+ tmp_member = *member;
+ zval_copy_ctor(&tmp_member);
+ convert_to_string(&tmp_member);
+ member = &tmp_member;
+ }
+
+ ret = FAILURE;
+ obj = (xmlreader_object *)zend_objects_get_address(object TSRMLS_CC);
+
+ if (obj->prop_handler != NULL) {
+ ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd);
+ }
+ if (ret == SUCCESS) {
+ ret = xmlreader_property_reader(obj, hnd, &retval TSRMLS_CC);
+ if (ret == SUCCESS) {
+ /* ensure we're creating a temporary variable */
+ retval->refcount = 0;
+ } else {
+ retval = EG(uninitialized_zval_ptr);
+ }
+ } else {
+ std_hnd = zend_get_std_object_handlers();
+ retval = std_hnd->read_property(object, member, type TSRMLS_CC);
+ }
+
+ if (member == &tmp_member) {
+ zval_dtor(member);
+ }
+ return retval;
+}
+/* }}} */
+
+/* {{{ xmlreader_write_property */
+void xmlreader_write_property(zval *object, zval *member, zval *value TSRMLS_DC)
+{
+ xmlreader_object *obj;
+ zval tmp_member;
+ xmlreader_prop_handler *hnd;
+ zend_object_handlers *std_hnd;
+ int ret;
+
+ if (member->type != IS_STRING) {
+ tmp_member = *member;
+ zval_copy_ctor(&tmp_member);
+ convert_to_string(&tmp_member);
+ member = &tmp_member;
+ }
+
+ ret = FAILURE;
+ obj = (xmlreader_object *)zend_objects_get_address(object TSRMLS_CC);
+
+ if (obj->prop_handler != NULL) {
+ ret = zend_hash_find((HashTable *)obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd);
+ }
+ if (ret == SUCCESS) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write to read-only property");
+ } else {
+ std_hnd = zend_get_std_object_handlers();
+ std_hnd->write_property(object, member, value TSRMLS_CC);
+ }
+
+ if (member == &tmp_member) {
+ zval_dtor(member);
+ }
+}
+/* }}} */
+
+/* _xmlreader_get_valid_file_path and _xmlreader_get_relaxNG should be made a
+ common function in libxml extension as code is common to a few xml extensions */
+char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) {
+ xmlURI *uri;
+ xmlChar *escsource;
+ char *file_dest;
+ int isFileUri = 0;
+
+ uri = xmlCreateURI();
+ escsource = xmlURIEscapeStr(source, ":");
+ xmlParseURIReference(uri, escsource);
+ xmlFree(escsource);
+
+ if (uri->scheme != NULL) {
+ /* absolute file uris - libxml only supports localhost or empty host */
+ if (strncasecmp(source, "file:///",8) == 0) {
+ isFileUri = 1;
+#ifdef PHP_WIN32
+ source += 8;
+#else
+ source += 7;
+#endif
+ } else if (strncasecmp(source, "file://localhost/",17) == 0) {
+ isFileUri = 1;
+#ifdef PHP_WIN32
+ source += 17;
+#else
+ source += 16;
+#endif
+ }
+ }
+
+ file_dest = source;
+
+ if ((uri->scheme == NULL || isFileUri)) {
+ /* XXX possible buffer overflow if VCWD_REALPATH does not know size of resolved_path */
+ if (! VCWD_REALPATH(source, resolved_path)) {
+ expand_filepath(source, resolved_path TSRMLS_CC);
+ }
+ file_dest = resolved_path;
+ }
+
+ xmlFreeURI(uri);
+
+ return file_dest;
+}
+
+#ifdef LIBXML_SCHEMAS_ENABLED
+static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, int source_len, int type,
+ xmlRelaxNGValidityErrorFunc error_func,
+ xmlRelaxNGValidityWarningFunc warn_func TSRMLS_DC)
+{
+ char *valid_file = NULL;
+ xmlRelaxNGParserCtxtPtr parser = NULL;
+ xmlRelaxNGPtr sptr;
+ char resolved_path[MAXPATHLEN + 1];
+
+ switch (type) {
+ case XMLREADER_LOAD_FILE:
+ valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ if (!valid_file) {
+ return NULL;
+ }
+ parser = xmlRelaxNGNewParserCtxt(valid_file);
+ break;
+ case XMLREADER_LOAD_STRING:
+ parser = xmlRelaxNGNewMemParserCtxt(source, source_len);
+ /* If loading from memory, we need to set the base directory for the document
+ but it is not apparent how to do that for schema's */
+ break;
+ default:
+ return NULL;
+ }
+
+ if (parser == NULL) {
+ return NULL;
+ }
+
+ if (error_func || warn_func) {
+ xmlRelaxNGSetParserErrors(parser,
+ (xmlRelaxNGValidityErrorFunc) error_func,
+ (xmlRelaxNGValidityWarningFunc) warn_func,
+ parser);
+ }
+ sptr = xmlRelaxNGParse(parser);
+ xmlRelaxNGFreeParserCtxt(parser);
+
+ return sptr;
+}
+#endif
+
+static zend_module_dep xmlreader_deps[] = {
+ ZEND_MOD_REQUIRED("libxml")
+ {NULL, NULL, NULL}
+};
+
+/* {{{ xmlreader_module_entry
+ */
+zend_module_entry xmlreader_module_entry = {
+ STANDARD_MODULE_HEADER_EX, NULL,
+ xmlreader_deps,
+ "xmlreader",
+ NULL,
+ PHP_MINIT(xmlreader),
+ PHP_MSHUTDOWN(xmlreader),
+ NULL,
+ NULL,
+ PHP_MINFO(xmlreader),
+ "0.1", /* Replace with version number for your extension */
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_XMLREADER
+ZEND_GET_MODULE(xmlreader)
+#endif
+
+/* {{{ xmlreader_objects_clone */
+void xmlreader_objects_clone(void *object, void **object_clone TSRMLS_DC)
+{
+ /* TODO */
+}
+/* }}} */
+
+static void xmlreader_free_resources(xmlreader_object *intern) {
+ if (intern) {
+ if (intern->input) {
+ xmlFreeParserInputBuffer(intern->input);
+ intern->input = NULL;
+ }
+
+ if (intern->ptr) {
+ xmlFreeTextReader(intern->ptr);
+ intern->ptr = NULL;
+ }
+#ifdef LIBXML_SCHEMAS_ENABLED
+ if (intern->schema) {
+ xmlRelaxNGFree((xmlRelaxNGPtr) intern->schema);
+ intern->schema = NULL;
+ }
+#endif
+ }
+}
+
+/* {{{ xmlreader_objects_free_storage */
+void xmlreader_objects_free_storage(void *object TSRMLS_DC)
+{
+ xmlreader_object *intern = (xmlreader_object *)object;
+
+ zend_hash_destroy(intern->std.properties);
+ FREE_HASHTABLE(intern->std.properties);
+
+ xmlreader_free_resources(intern);
+
+ efree(object);
+}
+/* }}} */
+
+/* {{{ xmlreader_objects_new */
+zend_object_value xmlreader_objects_new(zend_class_entry *class_type TSRMLS_DC)
+{
+ zend_object_value retval;
+ xmlreader_object *intern;
+ zval *tmp;
+
+ intern = emalloc(sizeof(xmlreader_object));
+ intern->std.ce = class_type;
+ intern->std.guards = NULL;
+ intern->ptr = NULL;
+ intern->input = NULL;
+ intern->schema = NULL;
+ intern->prop_handler = &xmlreader_prop_handlers;
+
+ ALLOC_HASHTABLE(intern->std.properties);
+ zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+ retval.handle = zend_objects_store_put(intern, (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;
+ return retval;
+}
+/* }}} */
+
+static void php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_one_char_t internal_function) {
+ zval *id;
+ int name_len = 0;
+ char *retchar = NULL;
+ xmlreader_object *intern;
+ char *name;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ return;
+ }
+
+ if (!name_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument cannot be an empty string");
+ RETURN_FALSE;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retchar = internal_function(intern->ptr, name);
+ }
+ if (retchar) {
+ RETVAL_STRING(retchar, 1);
+ xmlFree(retchar);
+ return;
+ } else {
+ RETVAL_EMPTY_STRING();
+ }
+}
+
+static void php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_int_t internal_function) {
+ zval *id;
+ int retval;
+ xmlreader_object *intern;
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retval = internal_function(intern->ptr);
+ if (retval == 1) {
+ RETURN_TRUE;
+ }
+ }
+
+ RETURN_FALSE;
+}
+
+/* This function not yet needed until some additional functions are implemented in libxml
+static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_char_t internal_function) {
+ zval *id;
+ char *retchar = NULL;
+ xmlreader_object *intern;
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retchar = xmlTextReaderReadString(intern->ptr);
+ }
+ if (retchar) {
+ RETVAL_STRING(retchar, 1);
+ xmlFree(retchar);
+ return;
+ } else {
+ RETVAL_EMPTY_STRING();
+ }
+}
+*/
+
+static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int type) {
+#ifdef LIBXML_SCHEMAS_ENABLED
+ zval *id;
+ int source_len = 0, retval = -1;
+ xmlreader_object *intern;
+ xmlRelaxNGPtr schema = NULL;
+ char *source;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &source, &source_len) == FAILURE) {
+ return;
+ }
+
+ if (source != NULL && !source_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Schema data source is requried");
+ RETURN_FALSE;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ if (source) {
+ schema = _xmlreader_get_relaxNG(source, source_len, type, NULL, NULL TSRMLS_CC);
+ if (schema) {
+ retval = xmlTextReaderRelaxNGSetSchema(intern->ptr, schema);
+ }
+ } else {
+ /* unset the associated relaxNG context and schema if one exists */
+ retval = xmlTextReaderRelaxNGSetSchema(intern->ptr, NULL);
+ }
+
+ if (retval == 0) {
+ if (intern->schema) {
+ xmlRelaxNGFree((xmlRelaxNGPtr) intern->schema);
+ }
+
+ intern->schema = schema;
+
+ RETURN_TRUE;
+ }
+ }
+
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors.");
+
+ RETURN_FALSE;
+#else
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No Schema support built into libxml.");
+
+ RETURN_FALSE;
+#endif
+}
+
+/* {{{ proto boolean close()
+Closes xmlreader - current frees resources until xmlTextReaderClose is fixed in libxml */
+PHP_METHOD(xmlreader, close)
+{
+ zval *id;
+ xmlreader_object *intern;
+
+ id = getThis();
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ /* libxml is segfaulting in versions up to 2.6.8 using xmlTextReaderClose so for
+ now we will free the whole reader when close is called as it would get rebuilt on
+ a new load anyways */
+ xmlreader_free_resources(intern);
+
+ RETURN_TRUE;
+}
+
+/* {{{ proto string getAttribute(string name)
+Get value of an attribute from current element */
+PHP_METHOD(xmlreader, getAttribute)
+{
+ php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderGetAttribute);
+}
+/* }}} */
+
+/* {{{ proto string getAttributeNo(int index)
+Get value of an attribute at index from current element */
+PHP_METHOD(xmlreader, getAttributeNo)
+{
+ zval *id;
+ int attr_pos;
+ char *retchar = NULL;
+ xmlreader_object *intern;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) {
+ return;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retchar = xmlTextReaderGetAttributeNo(intern->ptr,attr_pos);
+ }
+ if (retchar) {
+ RETVAL_STRING(retchar, 1);
+ xmlFree(retchar);
+ return;
+ } else {
+ RETURN_EMPTY_STRING();
+ }
+}
+/* }}} */
+
+/* {{{ proto string getAttributeNs(string name, string namespaceURI)
+Get value of a attribute via name and namespace from current element */
+PHP_METHOD(xmlreader, getAttributeNs)
+{
+ zval *id;
+ int name_len = 0, ns_uri_len = 0;
+ xmlreader_object *intern;
+ char *name, *ns_uri, *retchar = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ return;
+ }
+
+ if (name_len == 0 || ns_uri_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
+ RETURN_FALSE;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retchar = xmlTextReaderGetAttributeNs(intern->ptr, name, ns_uri);
+ }
+ if (retchar) {
+ RETVAL_STRING(retchar, 1);
+ xmlFree(retchar);
+ return;
+ } else {
+ RETURN_EMPTY_STRING();
+ }
+}
+/* }}} */
+
+/* {{{ proto boolean getParserProperty(int property)
+Indicates wether given property (one of the parser option constants) is set or not on parser */
+PHP_METHOD(xmlreader, getParserProperty)
+{
+ zval *id;
+ int property, retval = -1;
+ xmlreader_object *intern;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &property) == FAILURE) {
+ return;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retval = xmlTextReaderGetParserProp(intern->ptr,property);
+ }
+ if (retval == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property");
+ RETURN_FALSE;
+ }
+
+ RETURN_BOOL(retval);
+}
+/* }}} */
+
+/* {{{ proto boolean isValid()
+Returns boolean indicating if parsed document is valid or not.
+Must set XMLREADER_LOADDTD or XMLREADER_VALIDATE parser option prior to the first call to read
+or this method will always return FALSE */
+PHP_METHOD(xmlreader, isValid)
+{
+ php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderIsValid);
+}
+/* }}} */
+
+/* {{{ proto string lookupNamespace(string prefix)
+Return namespaceURI for associated prefix on current node */
+PHP_METHOD(xmlreader, lookupNamespace)
+{
+ php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderLookupNamespace);
+}
+/* }}} */
+
+/* {{{ proto boolean moveToAttribute(string name)
+Positions reader at specified attribute - Returns TRUE on success and FALSE on failure */
+PHP_METHOD(xmlreader, moveToAttribute)
+{
+ zval *id;
+ int name_len = 0, retval;
+ xmlreader_object *intern;
+ char *name;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ return;
+ }
+
+ if (name_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required");
+ RETURN_FALSE;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retval = xmlTextReaderMoveToAttribute(intern->ptr, name);
+ if (retval == 1) {
+ RETURN_TRUE;
+ }
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto boolean moveToAttributeNo(int index)
+Positions reader at attribute at spcecified index.
+Returns TRUE on success and FALSE on failure */
+PHP_METHOD(xmlreader, moveToAttributeNo)
+{
+ zval *id;
+ int attr_pos, retval;
+ xmlreader_object *intern;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) {
+ return;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retval = xmlTextReaderMoveToAttributeNo(intern->ptr, attr_pos);
+ if (retval == 1) {
+ RETURN_TRUE;
+ }
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto boolean moveToAttributeNs(string name, string namespaceURI)
+Positions reader at attribute spcified by name and namespaceURI.
+Returns TRUE on success and FALSE on failure */
+PHP_METHOD(xmlreader, moveToAttributeNs)
+{
+ zval *id;
+ int name_len=0, ns_uri_len=0, retval;
+ xmlreader_object *intern;
+ char *name, *ns_uri;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ return;
+ }
+
+ if (name_len == 0 || ns_uri_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
+ RETURN_FALSE;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retval = xmlTextReaderMoveToAttributeNs(intern->ptr, name, ns_uri);
+ if (retval == 1) {
+ RETURN_TRUE;
+ }
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto boolean moveToElement()
+Moves the position of the current instance to the node that contains the current Attribute node. */
+PHP_METHOD(xmlreader, moveToElement)
+{
+ php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToElement);
+}
+/* }}} */
+
+/* {{{ proto boolean moveToFirstAttribute()
+Moves the position of the current instance to the first attribute associated with the current node. */
+PHP_METHOD(xmlreader, moveToFirstAttribute)
+{
+ php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToFirstAttribute);
+}
+/* }}} */
+
+/* {{{ proto boolean moveToNextAttribute()
+Moves the position of the current instance to the next attribute associated with the current node. */
+PHP_METHOD(xmlreader, moveToNextAttribute)
+{
+ php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToNextAttribute);
+}
+/* }}} */
+
+/* {{{ proto boolean read()
+Moves the position of the current instance to the next node in the stream. */
+PHP_METHOD(xmlreader, read)
+{
+ zval *id;
+ int retval;
+ xmlreader_object *intern;
+
+ id = getThis();
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern != NULL && intern->ptr != NULL) {
+ retval = xmlTextReaderRead(intern->ptr);
+ if (retval == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading");
+ RETURN_FALSE;
+ } else {
+ RETURN_BOOL(retval);
+ }
+ }
+
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read");
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto boolean next([string localname])
+Moves the position of the current instance to the next node in the stream. */
+PHP_METHOD(xmlreader, next)
+{
+ zval *id;
+ int retval, name_len=0;
+ xmlreader_object *intern;
+ char *name = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ return;
+ }
+
+ id = getThis();
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern != NULL && intern->ptr != NULL) {
+#if LIBXML_VERSION <= 20617
+ /* Bug in libxml prevents a next in certain cases when positioned on end of element */
+ if (xmlTextReaderNodeType(intern->ptr) == XML_READER_TYPE_END_ELEMENT) {
+ retval = xmlTextReaderRead(intern->ptr);
+ } else
+#endif
+ retval = xmlTextReaderNext(intern->ptr);
+ while (name != NULL && retval == 1) {
+ if (xmlStrEqual(xmlTextReaderConstLocalName(intern->ptr), name)) {
+ RETURN_TRUE;
+ }
+ retval = xmlTextReaderNext(intern->ptr);
+ }
+ if (retval == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading");
+ RETURN_FALSE;
+ } else {
+ RETURN_BOOL(retval);
+ }
+ }
+
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read");
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto boolean open(string URI)
+Sets the URI that the the XMLReader will parse. */
+PHP_METHOD(xmlreader, open)
+{
+ zval *id;
+ int source_len = 0;
+ xmlreader_object *intern;
+ char *source, *valid_file = NULL;
+ char resolved_path[MAXPATHLEN + 1];
+ xmlTextReaderPtr reader = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) {
+ return;
+ }
+
+ id = getThis();
+ if (id != NULL) {
+ if (! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) {
+ id = NULL;
+ } else {
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ xmlreader_free_resources(intern);
+ }
+ }
+
+ if (!source_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ RETURN_FALSE;
+ }
+
+ valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+
+ if (valid_file) {
+ reader = xmlNewTextReaderFilename(valid_file);
+ }
+
+ if (reader == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open source data");
+ RETURN_FALSE;
+ }
+
+ if (id == NULL) {
+ object_init_ex(return_value, xmlreader_class_entry);
+ intern = (xmlreader_object *)zend_objects_get_address(return_value TSRMLS_CC);
+ intern->ptr = reader;
+ return;
+ }
+
+ intern->ptr = reader;
+
+ RETURN_TRUE;
+
+}
+/* }}} */
+
+/* Not Yet Implemented in libxml - functions exist just not coded
+PHP_METHOD(xmlreader, readInnerXml)
+{
+ php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadInnerXml);
+}
+
+PHP_METHOD(xmlreader, readOuterXml)
+{
+ php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadInnerXml);
+}
+
+PHP_METHOD(xmlreader, readString)
+{
+ php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadString);
+}
+
+PHP_METHOD(xmlreader, resetState)
+{
+
+}
+*/
+
+/* {{{ proto boolean setParserProperty(int property, boolean value)
+Sets parser property (one of the parser option constants).
+Properties must be set after open() or XML() and before the first read() is called */
+PHP_METHOD(xmlreader, setParserProperty)
+{
+ zval *id;
+ int property, retval = -1;
+ zend_bool value;
+ xmlreader_object *intern;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &property, &value) == FAILURE) {
+ return;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retval = xmlTextReaderSetParserProp(intern->ptr,property, value);
+ }
+ if (retval == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property");
+ RETURN_FALSE;
+ }
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto boolean setRelaxNGSchemaSource(string filename)
+Sets the string that the the XMLReader will parse. */
+PHP_METHOD(xmlreader, setRelaxNGSchema)
+{
+ php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_FILE);
+}
+/* }}} */
+
+/* {{{ proto boolean setRelaxNGSchemaSource(string source)
+Sets the string that the the XMLReader will parse. */
+PHP_METHOD(xmlreader, setRelaxNGSchemaSource)
+{
+ php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_STRING);
+}
+/* }}} */
+
+/* {{{ proto boolean XML(string source)
+Sets the string that the the XMLReader will parse. */
+PHP_METHOD(xmlreader, XML)
+{
+ zval *id;
+ int source_len = 0;
+ xmlreader_object *intern;
+ char *source, *uri = 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) {
+ return;
+ }
+
+ id = getThis();
+ if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) {
+ id = NULL;
+ }
+ if (id != NULL) {
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ xmlreader_free_resources(intern);
+ }
+
+ if (!source_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ RETURN_FALSE;
+ }
+
+ inputbfr = xmlParserInputBufferCreateMem(source, source_len, XML_CHAR_ENCODING_NONE);
+
+ if (inputbfr != NULL) {
+/* Get the URI of the current script so that we can set the base directory in libxml */
+#if HAVE_GETCWD
+ directory = VCWD_GETCWD(resolved_path, MAXPATHLEN);
+#elif HAVE_GETWD
+ directory = VCWD_GETWD(resolved_path);
+#endif
+ if (directory) {
+ resolved_path_len = strlen(resolved_path);
+ if (resolved_path[resolved_path_len - 1] != DEFAULT_SLASH) {
+ resolved_path[resolved_path_len] = DEFAULT_SLASH;
+ resolved_path[++resolved_path_len] = '\0';
+ }
+ uri = (char *) xmlCanonicPath((const xmlChar *) resolved_path);
+ }
+ reader = xmlNewTextReader(inputbfr, uri);
+ if (uri) {
+ xmlFree(uri);
+ }
+ if (reader != NULL) {
+ if (id == NULL) {
+ object_init_ex(return_value, xmlreader_class_entry);
+ intern = (xmlreader_object *)zend_objects_get_address(return_value TSRMLS_CC);
+ intern->input = inputbfr;
+ intern->ptr = reader;
+ return;
+ } else {
+ intern->input = inputbfr;
+ intern->ptr = reader;
+ RETURN_TRUE;
+
+ }
+ }
+ }
+
+ if (inputbfr) {
+ xmlFreeParserInputBuffer(inputbfr);
+ }
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load source data");
+ RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto boolean expand()
+Moves the position of the current instance to the next node in the stream. */
+PHP_METHOD(xmlreader, expand)
+{
+#ifdef HAVE_DOM
+ zval *id, *rv = NULL;
+ int ret;
+ xmlreader_object *intern;
+ xmlNode *node, *nodec;
+
+ id = getThis();
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+
+ if (intern && intern->ptr) {
+ node = xmlTextReaderExpand(intern->ptr);
+
+ if (node == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while expanding ");
+ RETURN_FALSE;
+ } else {
+ nodec = xmlCopyNode(node, 1);
+ DOM_RET_OBJ(rv, nodec, &ret, NULL);
+ }
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to expand");
+ RETURN_FALSE;
+ }
+#else
+ php_error(E_WARNING, "DOM support is not enabled");
+ return;
+#endif
+}
+/* }}} */
+
+static zend_function_entry xmlreader_functions[] = {
+ PHP_ME(xmlreader, close, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, getAttribute, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, getAttributeNo, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, getAttributeNs, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, getParserProperty, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, isValid, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, lookupNamespace, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, moveToAttributeNo, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, moveToAttribute, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, moveToAttributeNs, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, moveToElement, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, moveToFirstAttribute, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, moveToNextAttribute, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, open, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC)
+ PHP_ME(xmlreader, read, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, next, NULL, ZEND_ACC_PUBLIC)
+/* Not Yet Implemented though defined in libxml as of 2.6.9dev
+ 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, resetState, NULL, ZEND_ACC_PUBLIC)
+*/
+ PHP_ME(xmlreader, setParserProperty, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, setRelaxNGSchema, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, setRelaxNGSchemaSource, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(xmlreader, XML, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC)
+ PHP_ME(xmlreader, expand, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+/* {{{ PHP_MINIT_FUNCTION
+ */
+PHP_MINIT_FUNCTION(xmlreader)
+{
+
+ zend_class_entry ce;
+
+ memcpy(&xmlreader_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ xmlreader_object_handlers.read_property = xmlreader_read_property;
+ xmlreader_object_handlers.write_property = xmlreader_write_property;
+ xmlreader_object_handlers.get_property_ptr_ptr = NULL;
+
+ INIT_CLASS_ENTRY(ce, "XMLReader", xmlreader_functions);
+ ce.create_object = xmlreader_objects_new;
+ xmlreader_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+
+ zend_hash_init(&xmlreader_prop_handlers, 0, NULL, NULL, 1);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "attributeCount", xmlTextReaderAttributeCount, NULL, IS_LONG TSRMLS_CC);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "baseURI", NULL, xmlTextReaderBaseUri, 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, "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);
+
+ /* Constants for NodeType - cannot define common types to share with dom as there are differences in these types */
+
+ REGISTER_XMLREADER_CLASS_CONST_LONG("NONE", XML_READER_TYPE_NONE);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("ELEMENT", XML_READER_TYPE_ELEMENT);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("ATTRIBUTE", XML_READER_TYPE_ATTRIBUTE);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("TEXT", XML_READER_TYPE_TEXT);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("CDATA", XML_READER_TYPE_CDATA);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("ENTITY_REF", XML_READER_TYPE_ENTITY_REFERENCE);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("ENTITY", XML_READER_TYPE_ENTITY);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("PI", XML_READER_TYPE_PROCESSING_INSTRUCTION);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("COMMENT", XML_READER_TYPE_COMMENT);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("DOC", XML_READER_TYPE_DOCUMENT);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("DOC_TYPE", XML_READER_TYPE_DOCUMENT_TYPE);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("DOC_FRAGMENT", XML_READER_TYPE_DOCUMENT_FRAGMENT);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("NOTATION", XML_READER_TYPE_NOTATION);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("WHITESPACE", XML_READER_TYPE_WHITESPACE);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("SIGNIFICANT_WHITESPACE", XML_READER_TYPE_SIGNIFICANT_WHITESPACE);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("END_ELEMENT", XML_READER_TYPE_END_ELEMENT);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("END_ENTITY", XML_READER_TYPE_END_ENTITY);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("XML_DECLARATION", XML_READER_TYPE_XML_DECLARATION);
+
+ /* Constants for Parser options */
+ REGISTER_XMLREADER_CLASS_CONST_LONG("LOADDTD", XML_PARSER_LOADDTD);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("DEFAULTATTRS", XML_PARSER_DEFAULTATTRS);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("VALIDATE", XML_PARSER_VALIDATE);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("SUBST_ENTITIES", XML_PARSER_SUBST_ENTITIES);
+
+ /* Constants for Errors when loading - not yet used until we implement custom error handling
+ REGISTER_XMLREADER_CLASS_CONST_LONG("VALIDITY_WARNING", XML_PARSER_SEVERITY_VALIDITY_WARNING, CONST_CS | CONST_PERSISTENT);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("VALIDITY_ERROR", XML_PARSER_SEVERITY_VALIDITY_ERROR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("WARNING", XML_PARSER_SEVERITY_WARNING, CONST_CS | CONST_PERSISTENT);
+ REGISTER_XMLREADER_CLASS_CONST_LONG("ERROR", XML_PARSER_SEVERITY_ERROR, CONST_CS | CONST_PERSISTENT);
+ */
+
+ return SUCCESS;
+}
+/* }}} */
+
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(xmlreader)
+{
+ zend_hash_destroy(&xmlreader_prop_handlers);
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(xmlreader)
+{
+ php_info_print_table_start();
+ {
+ php_info_print_table_row(2, "XMLReader", "enabled");
+ }
+ php_info_print_table_end();
+
+ /* Remove comments if you have entries in php.ini
+ DISPLAY_INI_ENTRIES();
+ */
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h
new file mode 100644
index 000000000..32c7d40e4
--- /dev/null
+++ b/ext/xmlreader/php_xmlreader.h
@@ -0,0 +1,74 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Rob Richards <rrichards@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_xmlreader.h,v 1.3.2.1 2005/10/13 21:20:11 rrichards Exp $ */
+
+#ifndef PHP_XMLREADER_H
+#define PHP_XMLREADER_H
+
+extern zend_module_entry xmlreader_module_entry;
+#define phpext_xmlreader_ptr &xmlreader_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_XMLREADER_API __declspec(dllexport)
+#else
+#define PHP_XMLREADER_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+#include "ext/libxml/php_libxml.h"
+#include <libxml/xmlreader.h>
+
+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 */
+ xmlParserInputBufferPtr input;
+ void *schema;
+ HashTable *prop_handler;
+ zend_object_handle handle;
+} xmlreader_object;
+
+PHP_MINIT_FUNCTION(xmlreader);
+PHP_MSHUTDOWN_FUNCTION(xmlreader);
+PHP_MINFO_FUNCTION(xmlreader);
+
+#define REGISTER_XMLREADER_CLASS_CONST_LONG(const_name, value) \
+ zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
+
+#ifdef ZTS
+#define XMLREADER_G(v) TSRMG(xmlreader_globals_id, zend_xmlreader_globals *, v)
+#else
+#define XMLREADER_G(v) (xmlreader_globals.v)
+#endif
+
+#endif /* PHP_XMLREADER_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/xmlreader/xmlreader.dsp b/ext/xmlreader/xmlreader.dsp
new file mode 100644
index 000000000..7b21518ba
--- /dev/null
+++ b/ext/xmlreader/xmlreader.dsp
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="xmlreader" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=xmlreader - Win32 Release_TS
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "xmlreader.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "xmlreader.mak" CFG="xmlreader - Win32 Release_TS"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "xmlreader - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "xmlreader - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "xmlreader - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "xmlreader___Win32_Debug_TS"
+# PROP BASE Intermediate_Dir "xmlreader___Win32_Debug_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XMLREADER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 php5ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
+
+!ELSEIF "$(CFG)" == "xmlreader - Win32 Release_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "xmlreader___Win32_Release_TS0"
+# PROP BASE Intermediate_Dir "xmlreader___Win32_Release_TS0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Release_TS"
+# PROP Intermediate_Dir "Release_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /YX /FD /GZ /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 php5ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
+# ADD LINK32 php5ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /incremental:no /machine:I386 /out:"..\..\Release_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
+# SUBTRACT LINK32 /debug
+
+!ENDIF
+
+# Begin Target
+
+# Name "xmlreader - Win32 Debug_TS"
+# Name "xmlreader - Win32 Release_TS"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\php_xmlreader.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\php_xmlreader.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/ext/xmlrpc/config.m4 b/ext/xmlrpc/config.m4
index 5dc99956f..661305442 100644
--- a/ext/xmlrpc/config.m4
+++ b/ext/xmlrpc/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.21 2003/10/01 02:53:15 sniper Exp $
+dnl $Id: config.m4,v 1.25.2.2 2005/09/12 17:14:35 sniper Exp $
dnl
sinclude(ext/xmlrpc/libxmlrpc/acinclude.m4)
@@ -8,39 +8,64 @@ sinclude(libxmlrpc/acinclude.m4)
sinclude(libxmlrpc/xmlrpc.m4)
PHP_ARG_WITH(xmlrpc, for XMLRPC-EPI support,
-[ --with-xmlrpc[=DIR] Include XMLRPC-EPI support.])
+[ --with-xmlrpc[=DIR] Include XMLRPC-EPI support])
-PHP_ARG_WITH(expat-dir, libexpat dir for XMLRPC-EPI,
-[ --with-expat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI.],no,no)
+if test -z "$PHP_LIBXML_DIR"; then
+ PHP_ARG_WITH(libxml-dir, libxml2 install dir,
+ [ --with-libxml-dir=DIR XMLRPC-EPI: libxml2 install prefix], no, no)
+fi
+
+PHP_ARG_WITH(libexpat-dir, libexpat dir for XMLRPC-EPI,
+[ --with-libexpat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)],no,no)
PHP_ARG_WITH(iconv-dir, iconv dir for XMLRPC-EPI,
-[ --with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI.],no,no)
+[ --with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI],no,no)
if test "$PHP_XMLRPC" != "no"; then
+ PHP_ADD_EXTENSION_DEP(xmlrpc, libxml)
PHP_SUBST(XMLRPC_SHARED_LIBADD)
AC_DEFINE(HAVE_XMLRPC,1,[ ])
- testval=no
- for i in $PHP_EXPAT_DIR $XMLRPC_DIR /usr/local /usr; do
- if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME; then
- AC_DEFINE(HAVE_LIBEXPAT2,1,[ ])
- PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib, XMLRPC_SHARED_LIBADD)
- PHP_ADD_INCLUDE($i/include)
- testval=yes
- break
+ dnl
+ dnl Default to libxml2 if --with-libexpat-dir is not used
+ dnl
+ if test "$PHP_LIBEXPAT_DIR" = "no"; then
+
+ if test "$PHP_LIBXML" = "no"; then
+ AC_MSG_ERROR([XML-RPC extension requires LIBXML extension, add --enable-libxml])
fi
- done
- if test "$testval" = "no"; then
- AC_MSG_ERROR(XML-RPC support requires libexpat. Use --with-expat-dir=<DIR>)
+ PHP_SETUP_LIBXML(XMLRPC_SHARED_LIBADD, [
+ if test "$PHP_XML" = "no"; then
+ PHP_ADD_SOURCES(ext/xml, compat.c)
+ PHP_ADD_BUILD_DIR(ext/xml)
+ fi
+ ], [
+ AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=<DIR>])
+ ])
+ else
+ testval=no
+ for i in $PHP_LIBEXPAT_DIR $XMLRPC_DIR /usr/local /usr; do
+ if test -f $i/$PHP_LIBDIR/libexpat.a -o -f $i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME; then
+ AC_DEFINE(HAVE_LIBEXPAT,1,[ ])
+ PHP_ADD_LIBRARY_WITH_PATH(expat, $i/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($i/include)
+ testval=yes
+ break
+ fi
+ done
+
+ if test "$testval" = "no"; then
+ AC_MSG_ERROR([XML-RPC support requires libexpat. Use --with-libexpat-dir=<DIR> (deprecated!)])
+ fi
fi
if test "$PHP_ICONV_DIR" != "no"; then
PHP_ICONV=$PHP_ICONV_DIR
fi
- if test "$PHP_ICONV" = "no"; then
+ if test -z "$PHP_ICONV" || test "$PHP_ICONV" = "no"; then
PHP_ICONV=yes
fi
@@ -49,7 +74,6 @@ if test "$PHP_XMLRPC" != "no"; then
])
fi
-
if test "$PHP_XMLRPC" = "yes"; then
XMLRPC_CHECKS
PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c libxmlrpc/base64.c \
@@ -88,6 +112,7 @@ dnl for xmlrpc-epi because of this.
fi
PHP_ADD_INCLUDE($XMLRPC_DIR)
- PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/lib, XMLRPC_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD)
+ PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c, $ext_shared)
+ XMLRPC_MODULE_TYPE=external
fi
-
diff --git a/ext/xmlrpc/libxmlrpc/xml_element.c b/ext/xmlrpc/libxmlrpc/xml_element.c
index 6a6a49202..073105638 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.6.2.1 2005/04/22 11:54:17 jorton Exp $";
+static const char rcsid[] = "#(@) $Id: xml_element.c,v 1.9 2005/04/22 11:06:53 jorton Exp $";
@@ -44,8 +44,14 @@ static const char rcsid[] = "#(@) $Id: xml_element.c,v 1.6.2.1 2005/04/22 11:54:
* 06/2000
* HISTORY
* $Log: xml_element.c,v $
- * Revision 1.6.2.1 2005/04/22 11:54:17 jorton
- * MFH: Fixed bug #32797 (invalid C code in xmlrpc extension).
+ * Revision 1.9 2005/04/22 11:06:53 jorton
+ * Fixed bug #32797 (invalid C code in xmlrpc extension).
+ *
+ * Revision 1.8 2005/03/28 00:07:24 edink
+ * Reshufle includes to make it compile on windows
+ *
+ * Revision 1.7 2005/03/26 03:13:58 sniper
+ * - Made it possible to build ext/xmlrpc with libxml2
*
* Revision 1.6 2004/06/01 20:16:06 iliaa
* Fixed bug #28597 (xmlrpc_encode_request() incorrectly encodes chars in
@@ -104,6 +110,7 @@ static const char rcsid[] = "#(@) $Id: xml_element.c,v 1.6.2.1 2005/04/22 11:54:
* there must be some.
******/
+#include "ext/xml/expat_compat.h"
#ifdef _WIN32
#include "xmlrpc_win32.h"
#endif
@@ -113,7 +120,6 @@ static const char rcsid[] = "#(@) $Id: xml_element.c,v 1.6.2.1 2005/04/22 11:54:
#include "xml_element.h"
#include "queue.h"
-#include "expat.h"
#include "encodings.h"
#define my_free(thing) if(thing) {free(thing); thing = NULL;}
@@ -578,7 +584,7 @@ typedef struct _xml_elem_data {
/* expat start of element handler */
-static void startElement(void *userData, const char *name, const char **attrs)
+static void _xmlrpc_startElement(void *userData, const char *name, const char **attrs)
{
xml_element *c;
xml_elem_data* mydata = (xml_elem_data*)userData;
@@ -606,7 +612,7 @@ static void startElement(void *userData, const char *name, const char **attrs)
}
/* expat end of element handler */
-static void endElement(void *userData, const char *name)
+static void _xmlrpc_endElement(void *userData, const char *name)
{
xml_elem_data* mydata = (xml_elem_data*)userData;
@@ -618,7 +624,7 @@ static void endElement(void *userData, const char *name)
}
/* expat char data handler */
-static void charHandler(void *userData,
+static void _xmlrpc_charHandler(void *userData,
const char *s,
int len)
{
@@ -691,8 +697,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, startElement, endElement);
- XML_SetCharacterDataHandler(parser, charHandler);
+ XML_SetElementHandler(parser, _xmlrpc_startElement, _xmlrpc_endElement);
+ XML_SetCharacterDataHandler(parser, _xmlrpc_charHandler);
/* pass the xml_elem_data struct along */
XML_SetUserData(parser, (void*)&mydata);
diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c
index 16a38090b..fa3dafd60 100644
--- a/ext/xmlrpc/libxmlrpc/xmlrpc.c
+++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c
@@ -31,7 +31,7 @@
*/
-static const char rcsid[] = "#(@) $Id: xmlrpc.c,v 1.6 2004/04/27 17:33:59 iliaa Exp $";
+static const char rcsid[] = "#(@) $Id: xmlrpc.c,v 1.8 2005/03/28 00:07:24 edink Exp $";
/****h* ABOUT/xmlrpc
@@ -43,6 +43,12 @@ static const char rcsid[] = "#(@) $Id: xmlrpc.c,v 1.6 2004/04/27 17:33:59 iliaa
* 9/1999 - 10/2000
* HISTORY
* $Log: xmlrpc.c,v $
+ * Revision 1.8 2005/03/28 00:07:24 edink
+ * Reshufle includes to make it compile on windows
+ *
+ * Revision 1.7 2005/03/26 03:13:58 sniper
+ * - Made it possible to build ext/xmlrpc with libxml2
+ *
* Revision 1.6 2004/04/27 17:33:59 iliaa
* Removed C++ style comments.
*
@@ -119,7 +125,7 @@ static const char rcsid[] = "#(@) $Id: xmlrpc.c,v 1.6 2004/04/27 17:33:59 iliaa
* - comprehensive API for manipulation of values
*******/
-
+#include "ext/xml/expat_compat.h"
#ifdef _WIN32
#include "xmlrpc_win32.h"
#endif
@@ -132,7 +138,6 @@ static const char rcsid[] = "#(@) $Id: xmlrpc.c,v 1.6 2004/04/27 17:33:59 iliaa
#include "queue.h"
#include "xmlrpc.h"
-#include "expat.h"
#include "base64.h"
#include "xml_to_xmlrpc.h"
diff --git a/ext/xmlrpc/php_xmlrpc.h b/ext/xmlrpc/php_xmlrpc.h
index c3cee0191..e3c6971b5 100644
--- a/ext/xmlrpc/php_xmlrpc.h
+++ b/ext/xmlrpc/php_xmlrpc.h
@@ -37,7 +37,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -51,7 +51,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xmlrpc.h,v 1.10 2004/01/08 17:33:00 sniper Exp $ */
+/* $Id: php_xmlrpc.h,v 1.11 2005/08/03 14:08:22 sniper Exp $ */
#ifndef _PHP_XMLRPC_H
#define _PHP_XMLRPC_H
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index befaec836..1665cfd67 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -37,7 +37,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -51,7 +51,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xmlrpc-epi-php.c,v 1.37 2004/01/08 08:17:47 andi Exp $ */
+/* $Id: xmlrpc-epi-php.c,v 1.39.2.2 2005/10/05 16:40:21 rrichards Exp $ */
/**********************************************************************
* BUGS: *
@@ -478,7 +478,7 @@ static XMLRPC_VECTOR_TYPE determine_vector_type (HashTable *ht)
}
/* recursively convert php values into xmlrpc values */
-static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth)
+static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth TSRMLS_DC)
{
XMLRPC_VALUE xReturn = NULL;
if(in_val) {
@@ -520,28 +520,41 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
unsigned long num_index;
zval** pIter;
char* my_key;
+ HashTable *ht = NULL;
+ ht = HASH_OF(val);
+ if (ht && ht->nApplyCount > 1) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "XML-RPC doesn't support circular references");
+ return NULL;
+ }
+
convert_to_array(val);
-
xReturn = XMLRPC_CreateVector(key, determine_vector_type(Z_ARRVAL_P(val)));
zend_hash_internal_pointer_reset(Z_ARRVAL_P(val));
- while(1) {
+ while(zend_hash_get_current_data(Z_ARRVAL_P(val), (void**)&pIter) == SUCCESS) {
int res = my_zend_hash_get_current_key(Z_ARRVAL_P(val), &my_key, &num_index);
- if(res == HASH_KEY_IS_LONG) {
- if(zend_hash_get_current_data(Z_ARRVAL_P(val), (void**)&pIter) == SUCCESS) {
- XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++));
- }
- }
- else if(res == HASH_KEY_NON_EXISTANT) {
- break;
- }
- else if(res == HASH_KEY_IS_STRING) {
- if(zend_hash_get_current_data(Z_ARRVAL_P(val), (void**)&pIter) == SUCCESS) {
- XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++));
- }
+
+ switch (res) {
+ case HASH_KEY_NON_EXISTANT:
+ break;
+ case HASH_KEY_IS_STRING:
+ case HASH_KEY_IS_LONG:
+ ht = HASH_OF(*pIter);
+ if (ht) {
+ ht->nApplyCount++;
+ }
+ if (res == HASH_KEY_IS_LONG) {
+ XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++ TSRMLS_CC));
+ }
+ else {
+ XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++ TSRMLS_CC));
+ }
+ if (ht) {
+ ht->nApplyCount--;
+ }
+ break;
}
-
zend_hash_move_forward(Z_ARRVAL_P(val));
}
}
@@ -554,9 +567,9 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
return xReturn;
}
-static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val)
+static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val TSRMLS_DC)
{
- return PHP_to_XMLRPC_worker(NULL, root_val, 0);
+ return PHP_to_XMLRPC_worker(NULL, root_val, 0 TSRMLS_CC);
}
/* recursively convert xmlrpc values into php values */
@@ -656,7 +669,7 @@ PHP_FUNCTION(xmlrpc_encode_request)
XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call);
}
if (Z_TYPE_PP(vals) != IS_NULL) {
- XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals));
+ XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals TSRMLS_CC));
}
outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0);
@@ -667,6 +680,10 @@ PHP_FUNCTION(xmlrpc_encode_request)
XMLRPC_RequestFree(xRequest, 1);
}
}
+
+ if (out.xmlrpc_out.xml_elem_opts.encoding != ENCODING_DEFAULT) {
+ efree(out.xmlrpc_out.xml_elem_opts.encoding);
+ }
}
/* }}} */
@@ -684,7 +701,7 @@ PHP_FUNCTION(xmlrpc_encode)
if( return_value_used ) {
/* convert native php type to xmlrpc type */
- xOut = PHP_to_XMLRPC(*arg1);
+ xOut = PHP_to_XMLRPC(*arg1 TSRMLS_CC);
/* generate raw xml from xmlrpc data */
outBuf = XMLRPC_VALUE_ToXML(xOut, 0);
@@ -1086,7 +1103,7 @@ PHP_FUNCTION(xmlrpc_server_call_method)
FREE_ZVAL(data.return_data);
data.return_data = XMLRPC_to_PHP(xAnswer);
} else if(data.php_executed && !out.b_php_out) {
- xAnswer = PHP_to_XMLRPC(data.return_data);
+ xAnswer = PHP_to_XMLRPC(data.return_data TSRMLS_CC);
}
/* should we return data as xml? */
@@ -1155,7 +1172,7 @@ PHP_FUNCTION(xmlrpc_server_add_introspection_data)
server = zend_list_find(Z_LVAL_PP(handle), &type);
if (type == le_xmlrpc_server) {
- XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc);
+ XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc TSRMLS_CC);
if (xDesc) {
int retval = XMLRPC_ServerAddIntrospectionData(server->server_ptr, xDesc);
XMLRPC_CleanupValue(xDesc);
diff --git a/ext/xsl/config.m4 b/ext/xsl/config.m4
index 18827ef62..2db7a8c87 100644
--- a/ext/xsl/config.m4
+++ b/ext/xsl/config.m4
@@ -1,10 +1,10 @@
dnl
-dnl $Id: config.m4,v 1.7.2.1 2005/04/27 13:13:38 sniper Exp $
+dnl $Id: config.m4,v 1.11 2005/05/29 23:16:45 sniper Exp $
dnl
PHP_ARG_WITH(xsl, for XSL support,
[ --with-xsl[=DIR] Include new XSL support (requires libxslt >= 1.0.18).
- DIR is the libxslt install directory.])
+ DIR is the libxslt install directory])
if test "$PHP_XSL" != "no"; then
@@ -49,7 +49,7 @@ if test "$PHP_XSL" != "no"; then
AC_MSG_RESULT(not found)
else
AC_MSG_RESULT(found)
- PHP_ADD_LIBRARY_WITH_PATH(exslt, $PHP_XSL_EXSL_DIR/lib, XSL_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(exslt, $PHP_XSL_EXSL_DIR/$PHP_LIBDIR, XSL_SHARED_LIBADD)
PHP_ADD_INCLUDE($PHP_XSL_EXSL_DIR/include)
AC_DEFINE(HAVE_XSL_EXSLT,1,[ ])
fi
@@ -63,4 +63,5 @@ if test "$PHP_XSL" != "no"; then
AC_DEFINE(HAVE_XSL,1,[ ])
PHP_NEW_EXTENSION(xsl, php_xsl.c xsltprocessor.c, $ext_shared)
PHP_SUBST(XSL_SHARED_LIBADD)
+ PHP_ADD_EXTENSION_DEP(xsl, libxml)
fi
diff --git a/ext/xsl/config.w32 b/ext/xsl/config.w32
index 2a7f07e64..81ea2b853 100644
--- a/ext/xsl/config.w32
+++ b/ext/xsl/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.8.2.1 2004/07/18 13:22:46 rrichards Exp $
+// $Id: config.w32,v 1.9 2004/07/18 13:23:33 rrichards Exp $
// vim: ft=javascript
ARG_WITH("xsl", "xsl support", "no");
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index 67a0bb398..9d633727d 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_xsl.c,v 1.22.2.6 2005/01/17 16:06:57 chregu Exp $ */
+/* $Id: php_xsl.c,v 1.32.2.2 2005/11/15 14:28:38 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -31,7 +31,7 @@
/* If you declare any globals in php_xsl.h uncomment this:
ZEND_DECLARE_MODULE_GLOBALS(xsl)
*/
-
+zend_class_entry *xsl_xsltprocessor_class_entry;
static zend_object_handlers xsl_object_handlers;
/* {{{ xsl_functions[]
@@ -43,10 +43,18 @@ function_entry xsl_functions[] = {
};
/* }}} */
+static zend_module_dep xsl_deps[] = {
+ ZEND_MOD_REQUIRED("libxml")
+ {NULL, NULL, NULL}
+};
+
/* {{{ xsl_module_entry
*/
zend_module_entry xsl_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
+#if ZEND_MODULE_API_NO >= 20050617
+ STANDARD_MODULE_HEADER_EX, NULL,
+ xsl_deps,
+#elif ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"xsl",
@@ -78,11 +86,19 @@ void xsl_objects_free_storage(void *object TSRMLS_DC)
zend_hash_destroy(intern->parameter);
FREE_HASHTABLE(intern->parameter);
+ zend_hash_destroy(intern->registered_phpfunctions);
+ FREE_HASHTABLE(intern->registered_phpfunctions);
+
if (intern->node_list) {
zend_hash_destroy(intern->node_list);
FREE_HASHTABLE(intern->node_list);
}
+ if (intern->doc) {
+ php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC);
+ efree(intern->doc);
+ }
+
if (intern->ptr) {
/* free wrapper */
if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) {
@@ -104,21 +120,24 @@ zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC)
intern = emalloc(sizeof(xsl_object));
intern->std.ce = class_type;
- intern->std.in_get = 0;
- intern->std.in_set = 0;
+ intern->std.guards = NULL;
intern->ptr = NULL;
intern->prop_handler = NULL;
intern->parameter = NULL;
intern->hasKeys = 0;
intern->registerPhpFunctions = 0;
+ intern->registered_phpfunctions = NULL;
intern->node_list = NULL;
+ intern->doc = NULL;
ALLOC_HASHTABLE(intern->std.properties);
zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
ALLOC_HASHTABLE(intern->parameter);
zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0);
- retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) xsl_objects_free_storage, NULL TSRMLS_CC);
+ ALLOC_HASHTABLE(intern->registered_phpfunctions);
+ zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0);
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) xsl_objects_free_storage, NULL TSRMLS_CC);
intern->handle = retval.handle;
retval.handlers = &xsl_object_handlers;
return retval;
diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h
index 76b0d5567..c6026db55 100644
--- a/ext/xsl/php_xsl.h
+++ b/ext/xsl/php_xsl.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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_xsl.h,v 1.10.2.4 2005/01/17 16:06:57 chregu Exp $ */
+/* $Id: php_xsl.h,v 1.15 2005/08/03 14:08:23 sniper Exp $ */
#ifndef PHP_XSL_H
#define PHP_XSL_H
@@ -57,7 +57,9 @@ typedef struct _xsl_object {
HashTable *parameter;
int hasKeys;
int registerPhpFunctions;
+ HashTable *registered_phpfunctions;
HashTable *node_list;
+ php_libxml_node_object *doc;
} xsl_object;
void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC);
diff --git a/ext/xsl/tests/xslt012.phpt b/ext/xsl/tests/xslt012.phpt
new file mode 100644
index 000000000..60387af4c
--- /dev/null
+++ b/ext/xsl/tests/xslt012.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Test 12: Using Associative Array of Parameters
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+echo "Test 12: Using Associative Array of Parameters";
+
+$dom = new domDocument;
+$dom->load(dirname(__FILE__)."/xslt.xml");
+if(!$dom) {
+ echo "Error while parsing the document\n";
+ exit;
+}
+
+$xsl = new domDocument;
+$xsl->load(dirname(__FILE__)."/xslt012.xsl");
+if(!$xsl) {
+ echo "Error while parsing the document\n";
+ exit;
+}
+
+$proc = new xsltprocessor;
+if(!$proc) {
+ echo "Error while making xsltprocessor object\n";
+ exit;
+}
+
+
+$proc->importStylesheet($xsl);
+
+$parameters = Array(
+ 'foo' => 'barbar',
+ 'foo1' => 'test',
+ );
+
+$proc->setParameter( "", $parameters);
+
+print "\n";
+print $proc->transformToXml($dom);
+print "\n";
+
+
+--EXPECT--
+Test 12: Using Associative Array of Parameters
+<?xml version="1.0" encoding="iso-8859-1"?>
+<html><body>barbar
+test
+a1 b1 c1 <br/>
+a2 c2 <br/>
+ä3 b3 c3 <br/>
+</body></html>
diff --git a/ext/xsl/tests/xslt012.xsl b/ext/xsl/tests/xslt012.xsl
new file mode 100644
index 000000000..eb0c491da
--- /dev/null
+++ b/ext/xsl/tests/xslt012.xsl
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- $Id: xslt012.xsl,v 1.1 2004/08/05 13:31:17 tony2001 Exp $ -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
+
+ <xsl:output method="xml" encoding="iso-8859-1" indent="no"/>
+ <xsl:param name="foo" select="'bar'"/>
+ <xsl:param name="foo1" select="'bar1'"/>
+ <xsl:template match="/">
+ <html>
+ <body>
+ <xsl:value-of select="$foo"/><xsl:text>
+</xsl:text>
+ <xsl:value-of select="$foo1"/><xsl:text>
+</xsl:text>
+ <xsl:apply-templates select="/chapter/para/informaltable/tgroup/tbody/row"/>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="row">
+ <xsl:for-each select="entry">
+ <xsl:value-of select="."/>
+ <xsl:text> </xsl:text>
+ </xsl:for-each>
+ <br/> <xsl:text>
+</xsl:text>
+
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h
index 93f79bea1..d856bb354 100644
--- a/ext/xsl/xsl_fe.h
+++ b/ext/xsl/xsl_fe.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This 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,13 +16,13 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xsl_fe.h,v 1.6 2004/01/19 15:07:08 chregu Exp $ */
+/* $Id: xsl_fe.h,v 1.8 2005/08/03 14:08:23 sniper Exp $ */
#ifndef XSL_FE_H
#define XSL_FE_H
extern zend_function_entry php_xsl_xsltprocessor_class_functions[];
-zend_class_entry *xsl_xsltprocessor_class_entry;
+extern zend_class_entry *xsl_xsltprocessor_class_entry;
PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet);
PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc);
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 6ffa0bac4..474b5aba6 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xsltprocessor.c,v 1.29.2.6 2005/06/14 19:40:33 rrichards Exp $ */
+/* $Id: xsltprocessor.c,v 1.39.2.1 2005/09/02 06:38:02 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -103,7 +103,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS
SEPARATE_ZVAL(value);
convert_to_string(*value);
}
-
+
if (!xpath_params) {
xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC);
} else {
@@ -144,10 +144,10 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
"xsltExtFunctionTest: Function called from outside of PHP\n");
error = 1;
} else {
- tctxt = xsltXPathGetTransformContext(ctxt);
- if (tctxt == NULL) {
- xsltGenericError(xsltGenericErrorContext,
- "xsltExtFunctionTest: failed to get the transformation context\n");
+ tctxt = xsltXPathGetTransformContext(ctxt);
+ if (tctxt == NULL) {
+ xsltGenericError(xsltGenericErrorContext,
+ "xsltExtFunctionTest: failed to get the transformation context\n");
error = 1;
} else {
intern = (xsl_object *) tctxt->_private;
@@ -171,7 +171,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
}
return;
}
-
+
fci.param_count = nargs - 1;
if (fci.param_count > 0) {
fci.params = safe_emalloc(fci.param_count, sizeof(zval**), 0);
@@ -198,14 +198,12 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
xmlFree(str);
} else if (type == 2) {
int j;
- dom_object *domintern;
+ dom_object *domintern = (dom_object *)intern->doc;
array_init(args[i]);
if (obj->nodesetval && obj->nodesetval->nodeNr > 0) {
- domintern = (dom_object *) php_dom_object_get_data((void *) obj->nodesetval->nodeTab[0]->doc);
for (j = 0; j < obj->nodesetval->nodeNr; j++) {
xmlNodePtr node = obj->nodesetval->nodeTab[j];
zval *child;
-
MAKE_STD_ZVAL(child);
/* not sure, if we need this... it's copied from xpath.c */
if (node->type == XML_NAMESPACE_DECL) {
@@ -269,6 +267,10 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
if (!zend_make_callable(&handler, &callable TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", callable);
+ } else if ( intern->registerPhpFunctions == 2 && zend_hash_exists(intern->registered_phpfunctions, callable, strlen(callable) + 1) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to call handler '%s()'.", callable);
+ // Push an empty string, so that we at least have an xslt result...
+ valuePush(ctxt, xmlXPathNewString(""));
} else {
result = zend_call_function(&fci, NULL TSRMLS_CC);
if (result == FAILURE) {
@@ -409,13 +411,26 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
/* }}} end xsl_xsltprocessor_import_stylesheet */
-static xmlDocPtr php_xsl_apply_stylesheet(xsl_object *intern, xsltStylesheetPtr style, xmlDocPtr doc TSRMLS_DC)
+static xmlDocPtr php_xsl_apply_stylesheet(xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC)
{
xmlDocPtr newdocp;
+ xmlDocPtr doc = NULL;
+ xmlNodePtr node = NULL;
xsltTransformContextPtr ctxt;
+ php_libxml_node_object *object;
char **params = NULL;
int clone;
+ node = php_libxml_import_node(docp TSRMLS_CC);
+
+ if (node) {
+ doc = node->doc;
+ }
+ if (doc == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Document");
+ return NULL;
+ }
+
if (style == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stylesheet associated to this object");
return NULL;
@@ -424,10 +439,18 @@ static xmlDocPtr php_xsl_apply_stylesheet(xsl_object *intern, xsltStylesheetPtr
params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC);
}
+ intern->doc = emalloc(sizeof(php_libxml_node_object));
+ memset(intern->doc, 0, sizeof(php_libxml_node_object));
+
if (intern->hasKeys == 1) {
doc = xmlCopyDoc(doc, 1);
+ } else {
+ object = (php_libxml_node_object *)zend_object_store_get_object(docp TSRMLS_CC);
+ intern->doc->document = object->document;
}
+ php_libxml_increment_doc_ref(intern->doc, doc TSRMLS_CC);
+
ctxt = xsltNewTransformContext(style, doc);
ctxt->_private = (void *) intern;
@@ -441,9 +464,10 @@ static xmlDocPtr php_xsl_apply_stylesheet(xsl_object *intern, xsltStylesheetPtr
intern->node_list = NULL;
}
- if (intern->hasKeys == 1) {
- xmlFreeDoc(doc);
- }
+ php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC);
+ efree(intern->doc);
+ intern->doc = NULL;
+
if (params) {
clone = 0;
@@ -464,8 +488,6 @@ Since:
PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
{
zval *id, *rv = NULL, *docp = NULL;
- xmlDoc *doc = NULL;
- xmlNodePtr node = NULL;
xmlDoc *newdocp;
xsltStylesheetPtr sheetp;
int ret;
@@ -479,17 +501,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
RETURN_FALSE;
}
- node = php_libxml_import_node(docp TSRMLS_CC);
-
- if (node) {
- doc = node->doc;
- }
- if (doc == NULL) {
- php_error(E_WARNING, "Invalid Document");
- RETURN_NULL();
- }
-
- newdocp = php_xsl_apply_stylesheet(intern, sheetp, doc TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(intern, sheetp, docp TSRMLS_CC);
if (newdocp) {
DOM_RET_OBJ(rv, (xmlNodePtr) newdocp, &ret, NULL);
@@ -506,9 +518,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
{
zval *id, *docp = NULL;
- xmlDoc *doc = NULL;
xmlDoc *newdocp;
- xmlNodePtr node = NULL;
xsltStylesheetPtr sheetp;
int ret, uri_len;
char *uri;
@@ -522,17 +532,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
RETURN_FALSE;
}
- node = php_libxml_import_node(docp TSRMLS_CC);
-
- if (node) {
- doc = node->doc;
- }
- if (doc == NULL) {
- php_error(E_WARNING, "Invalid Document");
- RETURN_NULL();
- }
-
- newdocp = php_xsl_apply_stylesheet(intern, sheetp, doc TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(intern, sheetp, docp TSRMLS_CC);
ret = -1;
if (newdocp) {
@@ -550,9 +550,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
{
zval *id, *docp = NULL;
- xmlDoc *doc = NULL;
xmlDoc *newdocp;
- xmlNodePtr node = NULL;
xsltStylesheetPtr sheetp;
int ret;
xmlChar *doc_txt_ptr;
@@ -567,17 +565,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
RETURN_FALSE;
}
- node = php_libxml_import_node(docp TSRMLS_CC);
-
- if (node) {
- doc = node->doc;
- }
- if (doc == NULL) {
- php_error(E_WARNING, "Invalid Document");
- RETURN_NULL();
- }
-
- newdocp = php_xsl_apply_stylesheet(intern, sheetp, doc TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(intern, sheetp, docp TSRMLS_CC);
ret = -1;
if (newdocp) {
@@ -596,28 +584,54 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
/* }}} end xsl_xsltprocessor_transform_to_xml */
-/* {{{ proto xsl_ xsl_xsltprocessor_set_parameter(string namespace, string name, string value);
+/* {{{ proto bool xsl_xsltprocessor_set_parameter(string namespace, mixed name [, string value]);
*/
PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
{
zval *id;
- int name_len = 0, namespace_len = 0, value_len = 0;
- char *name, *namespace, *value;
+ zval *array_value, **entry, *new_string;
xsl_object *intern;
- zval *new_string;
-
+ char *string_key, *name, *value, *namespace;
+ ulong idx;
+ int string_key_len, namespace_len, name_len, value_len;
DOM_GET_THIS(id);
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &namespace, &namespace_len, &name, &name_len, &value, &value_len) == FAILURE) {
- RETURN_FALSE;
- }
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
-
- MAKE_STD_ZVAL(new_string);
- ZVAL_STRING(new_string, value, 1);
- zend_hash_update(intern->parameter, name, name_len + 1, &new_string, sizeof(zval*), NULL);
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sa", &namespace, &namespace_len, &array_value) == SUCCESS) {
+ intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value));
+
+ while (zend_hash_get_current_data(Z_ARRVAL_P(array_value), (void **)&entry) == SUCCESS) {
+ SEPARATE_ZVAL(entry);
+ convert_to_string_ex(entry);
+
+ if (zend_hash_get_current_key_ex(Z_ARRVAL_P(array_value), &string_key, &string_key_len, &idx, 0, NULL) != HASH_KEY_IS_STRING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter array");
+ RETURN_FALSE;
+ }
+
+ ALLOC_ZVAL(new_string);
+ ZVAL_ADDREF(*entry);
+ COPY_PZVAL_TO_ZVAL(*new_string, *entry);
+
+ zend_hash_update(intern->parameter, string_key, string_key_len, &new_string, sizeof(zval*), NULL);
+ zend_hash_move_forward(Z_ARRVAL_P(array_value));
+ }
+ RETURN_TRUE;
+
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sss", &namespace, &namespace_len, &name, &name_len, &value, &value_len) == SUCCESS) {
+
+ intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
+
+ MAKE_STD_ZVAL(new_string);
+ ZVAL_STRING(new_string, value, 1);
+
+ zend_hash_update(intern->parameter, name, name_len + 1, &new_string, sizeof(zval*), NULL);
+ RETURN_TRUE;
+ } else {
+ WRONG_PARAM_COUNT;
+ }
+
}
/* }}} end xsl_xsltprocessor_set_parameter */
@@ -675,12 +689,42 @@ PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
{
zval *id;
xsl_object *intern;
+ zval *array_value, **entry, *new_string;
+ int name_len = 0;
+ char *name;
DOM_GET_THIS(id);
- intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
- intern->registerPhpFunctions = 1;
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "a", &array_value) == SUCCESS) {
+ intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value));
+
+ while (zend_hash_get_current_data(Z_ARRVAL_P(array_value), (void **)&entry) == SUCCESS) {
+ SEPARATE_ZVAL(entry);
+ convert_to_string_ex(entry);
+
+ MAKE_STD_ZVAL(new_string);
+ ZVAL_LONG(new_string,1);
+
+ zend_hash_update(intern->registered_phpfunctions, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &new_string, sizeof(zval*), NULL);
+ zend_hash_move_forward(Z_ARRVAL_P(array_value));
+ }
+ intern->registerPhpFunctions = 2;
+ RETURN_TRUE;
+
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == SUCCESS) {
+ intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
+
+ MAKE_STD_ZVAL(new_string);
+ ZVAL_LONG(new_string,1);
+ zend_hash_update(intern->registered_phpfunctions, name, name_len + 1, &new_string, sizeof(zval*), NULL);
+ intern->registerPhpFunctions = 2;
+
+ } else {
+ intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
+ intern->registerPhpFunctions = 1;
+ }
}
/* }}} end xsl_xsltprocessor_register_php_functions(); */
diff --git a/ext/yp/CREDITS b/ext/yp/CREDITS
deleted file mode 100644
index 4c5214587..000000000
--- a/ext/yp/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-Yellow Pages
-Stephanie Wehner, Fredrik Ohrn
diff --git a/ext/yp/config.m4 b/ext/yp/config.m4
deleted file mode 100644
index 03f1f2037..000000000
--- a/ext/yp/config.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl
-dnl $Id: config.m4,v 1.9 2002/10/23 16:03:52 hholzgra Exp $
-dnl
-
-PHP_ARG_ENABLE(yp,whether to include YP support,
-[ --enable-yp Include YP support.])
-
-if test "$PHP_YP" != "no"; then
-
- AC_CHECK_LIB(nsl, yp_match, [
- YP_LIBS=nsl
- YP_CHECK_IN_LIB=nsl
- ],
- AC_CHECK_LIB(c, yp_match, [
- YP_LIBS=
- YP_CHECK_IN_LIB=c
- ],[
- AC_MSG_ERROR(Unable to find required yp/nis library)
- ])
- )
-
-
- AC_DEFINE(HAVE_YP,1,[ ])
- PHP_NEW_EXTENSION(yp, yp.c, $ext_shared)
-
- PHP_SUBST(YP_SHARED_LIBADD)
-
- if test -n "$YP_LIBS"; then
- PHP_ADD_LIBRARY_WITH_PATH($YP_LIBS, $YP_LIBDIR, YP_SHARED_LIBADD)
- fi
-
-
-
- case $host_alias in
- *solaris*)
- AC_DEFINE(SOLARIS_YP,1,[ ]) ;;
- esac
-fi
diff --git a/ext/yp/package.xml b/ext/yp/package.xml
deleted file mode 100644
index 12ebf916e..000000000
--- a/ext/yp/package.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>yp</name>
- <summary>YP/NIS functions</summary>
- <maintainers>
- <maintainer>
- <user>???</user>
- <name>Stephanie Wehner</name>
- <email>_@r4k.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>???</user>
- <name>Fredrik Ohrn</name>
- <email>???@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-NIS (formerly called Yellow Pages) allows network management
-of important administrative files (e.g. the password file).
- </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="yp.c"/>
- <file role="src" name="php_yp.h"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/yp/php_yp.h b/ext/yp/php_yp.h
deleted file mode 100644
index eff02a348..000000000
--- a/ext/yp/php_yp.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Stephanie Wehner <_@r4k.net> |
- | Fredrik Ohrn |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: php_yp.h,v 1.15 2004/01/08 17:33:02 sniper Exp $ */
-
-#ifndef PHP_YP_H
-#define PHP_YP_H
-
-#if HAVE_YP
-
-#ifdef PHP_WIN32
-#define PHP_YP_API __declspec(dllexport)
-#else
-#define PHP_YP_API
-#endif
-
-extern zend_module_entry yp_module_entry;
-#define yp_module_ptr &yp_module_entry
-
-/* yp.c functions */
-PHP_FUNCTION(yp_get_default_domain);
-PHP_FUNCTION(yp_order);
-PHP_FUNCTION(yp_master);
-PHP_FUNCTION(yp_match);
-PHP_FUNCTION(yp_first);
-PHP_FUNCTION(yp_next);
-PHP_FUNCTION(yp_all);
-PHP_FUNCTION(yp_cat);
-PHP_FUNCTION(yp_errno);
-PHP_FUNCTION(yp_err_string);
-PHP_MINIT_FUNCTION(yp);
-PHP_RINIT_FUNCTION(yp);
-PHP_MINFO_FUNCTION(yp);
-
-typedef struct {
- int error;
-} php_yp_globals;
-
-#ifdef ZTS
-#define YP(v) TSRMG(yp_globals_id, php_yp_globals *, v)
-#else
-#define YP(v) (yp_globals.v)
-#endif
-
-#else
-
-#define yp_module_ptr NULL
-
-#endif /* HAVE_YP */
-
-#define phpext_yp_ptr yp_module_ptr
-
-#endif /* PHP_YP_H */
diff --git a/ext/yp/yp.c b/ext/yp/yp.c
deleted file mode 100644
index 2de5c1287..000000000
--- a/ext/yp/yp.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Stephanie Wehner <_@r4k.net> |
- | Fredrik Ohrn |
- +----------------------------------------------------------------------+
- */
-/* $Id: yp.c,v 1.45 2004/05/31 21:01:18 iliaa Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "ext/standard/info.h"
-
-#if HAVE_YP
-
-#include "php_yp.h"
-
-#include <rpcsvc/ypclnt.h>
-
-/* {{{ thread safety stuff */
-
-#ifdef ZTS
-int yp_globals_id;
-#else
-PHP_YP_API php_yp_globals yp_globals;
-#endif
-
-/* }}} */
-
-function_entry yp_functions[] = {
- PHP_FE(yp_get_default_domain, NULL)
- PHP_FE(yp_order, NULL)
- PHP_FE(yp_master, NULL)
- PHP_FE(yp_match, NULL)
- PHP_FE(yp_first, NULL)
- PHP_FE(yp_next, NULL)
- PHP_FE(yp_all, NULL)
- PHP_FE(yp_cat, NULL)
- PHP_FE(yp_errno, NULL)
- PHP_FE(yp_err_string, NULL)
- {NULL, NULL, NULL}
-};
-
-zend_module_entry yp_module_entry = {
- STANDARD_MODULE_HEADER,
- "yp",
- yp_functions,
- PHP_MINIT(yp),
- NULL,
- PHP_RINIT(yp),
- NULL,
- PHP_MINFO(yp),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_YP
-ZEND_GET_MODULE(yp)
-#endif
-
-/* {{{ proto string yp_get_default_domain(void)
- Returns the domain or false */
-PHP_FUNCTION(yp_get_default_domain)
-{
- char *outdomain;
-
- if (ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- if((YP(error) = yp_get_default_domain(&outdomain))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", yperr_string (YP(error)));
- RETURN_FALSE;
- }
- RETVAL_STRING(outdomain,1);
-}
-/* }}} */
-
-/* {{{ proto int yp_order(string domain, string map)
- Returns the order number or false */
-PHP_FUNCTION(yp_order)
-{
- pval **domain, **map;
-
-#if SOLARIS_YP
- unsigned long outval;
-#else
- int outval;
-#endif
-
- if((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2,&domain,&map) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(domain);
- convert_to_string_ex(map);
-
- if((YP(error) = yp_order(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), &outval))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", yperr_string (YP(error)));
- RETURN_FALSE;
- }
-
- RETVAL_LONG(outval);
-}
-/* }}} */
-
-/* {{{ proto string yp_master(string domain, string map)
- Returns the machine name of the master */
-PHP_FUNCTION(yp_master)
-{
- pval **domain, **map;
- char *outname;
-
- if((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2,&domain,&map) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(domain);
- convert_to_string_ex(map);
-
- if((YP(error) = yp_master(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), &outname))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", yperr_string (YP(error)));
- RETURN_FALSE;
- }
-
- RETVAL_STRING(outname,1);
-}
-/* }}} */
-
-/* {{{ proto string yp_match(string domain, string map, string key)
- Returns the matched line or false */
-PHP_FUNCTION(yp_match)
-{
- pval **domain, **map, **key;
- char *outval;
- int outvallen;
-
- if((ZEND_NUM_ARGS() != 3) || zend_get_parameters_ex(3,&domain,&map,&key) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(domain);
- convert_to_string_ex(map);
- convert_to_string_ex(key);
-
- if((YP(error) = yp_match(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), Z_STRVAL_PP (key), Z_STRLEN_PP (key), &outval, &outvallen))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", yperr_string (YP(error)));
- RETURN_FALSE;
- }
-
- RETVAL_STRINGL(outval,outvallen,1);
-}
-/* }}} */
-
-/* {{{ proto array yp_first(string domain, string map)
- Returns the first key as array with $var[$key] and the the line as the value */
-PHP_FUNCTION(yp_first)
-{
- pval **domain, **map;
- char *outval, *outkey;
- int outvallen, outkeylen;
-
- if((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2,&domain,&map) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(domain);
- convert_to_string_ex(map);
-
- if((YP(error) = yp_first(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), &outkey, &outkeylen, &outval, &outvallen))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", yperr_string (YP(error)));
- RETURN_FALSE;
- }
- array_init(return_value);
- add_assoc_stringl_ex(return_value,outkey,outkeylen+1,outval,outvallen,1);
-
- /* Deprecated */
- add_assoc_stringl(return_value,"key",outkey,outkeylen,1);
- add_assoc_stringl(return_value,"value",outval,outvallen,1);
-}
-/* }}} */
-
-/* {{{ proto array yp_next(string domain, string map, string key)
- Returns an array with $var[$key] and the the line as the value */
-PHP_FUNCTION(yp_next)
-{
- pval **domain, **map, **key;
- char *outval, *outkey;
- int outvallen, outkeylen;
-
- if((ZEND_NUM_ARGS() != 3) || zend_get_parameters_ex(3,&domain,&map,&key) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(domain);
- convert_to_string_ex(map);
- convert_to_string_ex(key);
-
- if((YP(error) = yp_next(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), Z_STRVAL_PP (key), Z_STRLEN_PP (key), &outkey, &outkeylen, &outval, &outvallen))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", yperr_string (YP(error)));
- RETURN_FALSE;
- }
-
- array_init(return_value);
- add_assoc_stringl_ex(return_value,outkey,outkeylen+1,outval,outvallen,1);
-}
-/* }}} */
-
-/* {{{ php_foreach_all
- */
-static int php_foreach_all (int instatus, char *inkey, int inkeylen, char *inval, int invallen, char *indata)
-{
- int r;
- zval *status, *key, *value;
- zval **args [3];
- zval *retval;
- TSRMLS_FETCH();
-
- args[0] = &status;
- args[1] = &key;
- args[2] = &value;
-
- MAKE_STD_ZVAL (status);
- ZVAL_LONG (status, ypprot_err (instatus));
-
- MAKE_STD_ZVAL (key);
- ZVAL_STRINGL (key, inkey, inkeylen, 1);
-
- MAKE_STD_ZVAL (value);
- ZVAL_STRINGL (value, inval, invallen, 1);
-
- if(call_user_function_ex(CG(function_table), NULL, *((zval **)indata), &retval, 3, args, 0, NULL TSRMLS_CC) != SUCCESS)
- {
- zval_ptr_dtor(&status);
- zval_ptr_dtor(&key);
- zval_ptr_dtor(&value);
-
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Function call failed");
- return 1;
- }
-
- convert_to_long_ex(&retval);
- r = Z_LVAL_P (retval);
-
- zval_ptr_dtor(&retval);
-
- zval_ptr_dtor(&status);
- zval_ptr_dtor(&key);
- zval_ptr_dtor(&value);
-
- return r;
-}
-/* }}} */
-
-/* {{{ proto bool yp_all(string domain, string map, string callback)
- Traverse the map and call a function on each entry */
-PHP_FUNCTION(yp_all)
-{
- pval **domain, **map, **php_callback;
- struct ypall_callback callback;
-
- if((ZEND_NUM_ARGS() != 3) || zend_get_parameters_ex(3,&domain,&map,&php_callback) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(domain);
- convert_to_string_ex(map);
-
- callback.foreach = php_foreach_all;
- callback.data = (char *) php_callback;
-
- yp_all(Z_STRVAL_PP(domain),Z_STRVAL_PP(map),&callback);
-
- RETURN_FALSE;
-}
-/* }}} */
-
-/* {{{ php_foreach_cat
- */
-static int php_foreach_cat (int instatus, char *inkey, int inkeylen, char *inval, int invallen, char *indata)
-{
- int err;
-
- err = ypprot_err (instatus);
-
- if (!err)
- {
- if (inkeylen) {
- char *key = emalloc(inkeylen+1);
- strlcpy(key, inkey, inkeylen+1);
- add_assoc_stringl_ex((zval *) indata, key, inkeylen+1, inval, invallen, 1);
- efree(key);
- }
-
- return 0;
- }
-
- if (err != YPERR_NOMORE)
- {
- TSRMLS_FETCH();
-
- YP(error) = err;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", yperr_string (err));
- }
-
- return 0;
-}
-/* }}} */
-
-/* {{{ proto array yp_cat(string domain, string map)
- Return an array containing the entire map */
-PHP_FUNCTION(yp_cat)
-{
- pval **domain, **map;
- struct ypall_callback callback;
-
- if((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2,&domain,&map) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(domain);
- convert_to_string_ex(map);
-
- array_init(return_value);
-
- callback.foreach = php_foreach_cat;
- callback.data = (char *) return_value;
-
- yp_all(Z_STRVAL_PP(domain),Z_STRVAL_PP(map),&callback);
-}
-/* }}} */
-
-/* {{{ proto int yp_errno()
- Returns the error code from the last call or 0 if no error occured */
-PHP_FUNCTION(yp_errno)
-{
- if((ZEND_NUM_ARGS() != 0)) {
- WRONG_PARAM_COUNT;
- }
-
- RETURN_LONG (YP(error));
-}
-/* }}} */
-
-/* {{{ proto string yp_err_string(int errorcode)
- Returns the corresponding error string for the given error code */
-PHP_FUNCTION(yp_err_string)
-{
- pval **error;
- char *string;
-
- if((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1,&error) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_long_ex(error);
-
- if((string = yperr_string(Z_LVAL_PP(error))) == NULL) {
- RETURN_FALSE;
- }
-
- RETVAL_STRING(string,1);
-}
-/* }}} */
-
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(yp)
-{
-#ifdef ZTS
- ts_allocate_id(&yp_globals_id, sizeof(php_yp_globals), NULL, NULL);
-#endif
-
- REGISTER_LONG_CONSTANT("YPERR_BADARGS", YPERR_BADARGS, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_BADDB", YPERR_BADDB, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_BUSY", YPERR_BUSY, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_DOMAIN", YPERR_DOMAIN, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_KEY", YPERR_KEY, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_MAP", YPERR_MAP, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_NODOM", YPERR_NODOM, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_NOMORE", YPERR_NOMORE, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_PMAP", YPERR_PMAP, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_RESRC", YPERR_RESRC, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_RPC", YPERR_RPC, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_YPBIND", YPERR_YPBIND, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_YPERR", YPERR_YPERR, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_YPSERV", YPERR_YPSERV, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("YPERR_VERS", YPERR_VERS, CONST_CS | CONST_PERSISTENT);
-
- return SUCCESS;
-}
-/* }}} */
-
-PHP_RINIT_FUNCTION(yp)
-{
- YP(error) = 0;
-
- return SUCCESS;
-}
-
-PHP_MINFO_FUNCTION(yp)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "YP Support", "enabled");
- php_info_print_table_end();
-}
-#endif /* HAVE_YP */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim<600: sw=4 ts=4
- */
diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32
index a5c82c953..918e70ef5 100644
--- a/ext/zlib/config.w32
+++ b/ext/zlib/config.w32
@@ -1,10 +1,10 @@
-// $Id: config.w32,v 1.7 2004/03/10 18:30:44 fmk Exp $
+// $Id: config.w32,v 1.8 2004/07/17 00:21:04 pollita Exp $
// vim:ft=javascript
ARG_ENABLE("zlib", "ZLIB support", "yes");
if (PHP_ZLIB == "yes") {
- EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c", null, "/D ZLIB_EXPORTS");
+ EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS");
AC_DEFINE("HAVE_ZLIB", 1, "ZLIB support");
CHECK_LIB("zlib.lib", "zlib", PHP_ZLIB);
CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects);
diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4
index 4499b447a..ce602e553 100644
--- a/ext/zlib/config0.m4
+++ b/ext/zlib/config0.m4
@@ -1,15 +1,15 @@
dnl
-dnl $Id: config0.m4,v 1.14 2003/06/27 00:37:21 sas Exp $
+dnl $Id: config0.m4,v 1.17 2005/05/29 23:16:45 sniper Exp $
dnl
PHP_ARG_WITH(zlib,for ZLIB support,
-[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9).])
+[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)])
PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined,
[ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no)
if test "$PHP_ZLIB" != "no" -o "$PHP_ZLIB_DIR" != "no"; then
- PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c, $ext_shared)
+ PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared)
PHP_SUBST(ZLIB_SHARED_LIBADD)
if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then
@@ -38,7 +38,7 @@ if test "$PHP_ZLIB" != "no" -o "$PHP_ZLIB_DIR" != "no"; then
case $ZLIB_DIR in
/usr) ac_extra= ;;
- *) ac_extra=-L$ZLIB_DIR/lib ;;
+ *) ac_extra=-L$ZLIB_DIR/$PHP_LIBDIR ;;
esac
PHP_CHECK_LIBRARY(z, gzgets, [
@@ -49,7 +49,7 @@ if test "$PHP_ZLIB" != "no" -o "$PHP_ZLIB_DIR" != "no"; then
$ac_extra
])
- PHP_ADD_LIBPATH($ZLIB_DIR/lib, ZLIB_SHARED_LIBADD)
+ PHP_ADD_LIBPATH($ZLIB_DIR/$PHP_LIBDIR, ZLIB_SHARED_LIBADD)
PHP_ZLIB_DIR=$ZLIB_DIR
PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD)
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index 9367d2e80..f4b1f93db 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_zlib.h,v 1.40 2004/01/08 17:33:03 sniper Exp $ */
+/* $Id: php_zlib.h,v 1.42 2005/08/03 14:08:23 sniper Exp $ */
#ifndef PHP_ZLIB_H
#define PHP_ZLIB_H
@@ -35,6 +35,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib)
char *output_handler;
ZEND_END_MODULE_GLOBALS(zlib)
+extern php_stream_filter_factory php_zlib_filter_factory;
extern zend_module_entry php_zlib_module_entry;
#define zlib_module_ptr &php_zlib_module_entry
diff --git a/ext/zlib/tests/bug_34821.phpt b/ext/zlib/tests/bug_34821.phpt
new file mode 100644
index 000000000..ff845c6df
--- /dev/null
+++ b/ext/zlib/tests/bug_34821.phpt
@@ -0,0 +1,41 @@
+--TEST--
+bug 34821
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php
+
+// test 50 bytes to 500k
+$b = array(
+ 50,
+ 500,
+ 5000,
+ 500000,
+// 1000000, // works, but test would take too long
+);
+
+srand(time());
+
+foreach ($b as $size) {
+ $s = '';
+ for ($i = 0; $i <= $size; ++$i) {
+ $s .= chr(rand(0,255));
+ }
+ var_dump($s == gzinflate(gzdeflate($s)));
+ var_dump($s == gzuncompress(gzcompress($s)));
+ var_dump($s == gzinflate(substr(gzencode($s), 10, -8)));
+}
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
diff --git a/ext/zlib/tests/compress_zlib_wrapper.phpt b/ext/zlib/tests/compress_zlib_wrapper.phpt
new file mode 100644
index 000000000..de6b3d80b
--- /dev/null
+++ b/ext/zlib/tests/compress_zlib_wrapper.phpt
@@ -0,0 +1,19 @@
+--TEST--
+compress.zlib:// wrapper
+--FILE--
+<?php
+
+$pfx = str_repeat('../', substr_count($_SERVER['PHP_SELF'], '../'));
+
+// Relative path
+$fp = fopen("compress.zlib://{$pfx}ext/xsl/tests/xslt.xsl.gz", "rb");
+fclose($fp);
+
+// Absolute path
+$fp = fopen("compress.zlib://". dirname(__FILE__). "/../../../ext/xsl/tests/xslt.xsl.gz", "rb");
+fclose($fp);
+
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/ext/zlib/tests/zlib_filter_deflate.phpt b/ext/zlib/tests/zlib_filter_deflate.phpt
new file mode 100644
index 000000000..0f1851ec6
--- /dev/null
+++ b/ext/zlib/tests/zlib_filter_deflate.phpt
@@ -0,0 +1,17 @@
+--TEST--
+zlib.deflate (with convert.base64-encode)
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php /* $Id: zlib_filter_deflate.phpt,v 1.1.2.1 2005/11/24 04:37:47 pollita Exp $ */
+$text = 'I am the very model of a modern major general, I\'ve information vegetable, animal, and mineral.';
+
+$fp = fopen('php://stdout', 'w');
+stream_filter_append($fp, 'zlib.deflate', STREAM_FILTER_WRITE);
+stream_filter_append($fp, 'convert.base64-encode', STREAM_FILTER_WRITE);
+fwrite($fp, $text);
+fclose($fp);
+
+?>
+--EXPECT--
+HctBDoAgDETRq8zOjfEeHKOGATG0TRpC4u1Vdn/xX4IoxkVMxgP1zA4vkJVhULk9UGkM6TvSNolmxUNlNLePVQ45O3eINf0fsQxtCxwv
diff --git a/ext/zlib/tests/zlib_filter_inflate.phpt b/ext/zlib/tests/zlib_filter_inflate.phpt
new file mode 100644
index 000000000..0220c85e5
--- /dev/null
+++ b/ext/zlib/tests/zlib_filter_inflate.phpt
@@ -0,0 +1,17 @@
+--TEST--
+zlib.inflate (with convert.base64-decode)
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php /* $Id: zlib_filter_inflate.phpt,v 1.1.2.1 2005/11/24 04:37:47 pollita Exp $ */
+$text = 'HctBDoAgDETRq8zOjfEeHKOGATG0TRpC4u1Vdn/xX4IoxkVMxgP1zA4vkJVhULk9UGkM6TvSNolmxUNlNLePVQ45O3eINf0fsQxtCxwv';
+
+$fp = fopen('php://stdout', 'w');
+stream_filter_append($fp, 'convert.base64-decode', STREAM_FILTER_WRITE);
+stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_WRITE);
+fwrite($fp, $text);
+fclose($fp);
+
+?>
+--EXPECT--
+I am the very model of a modern major general, I've information vegetable, animal, and mineral.
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index bca37a772..d64cd1b27 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zlib.c,v 1.181.2.2 2005/09/02 17:25:22 iliaa Exp $ */
+/* $Id: zlib.c,v 1.183.2.4 2005/10/25 15:35:39 mike Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -70,6 +70,13 @@
#endif
#endif
+/* Win32 needs some more memory */
+#ifdef PHP_WIN32
+#define PHP_ZLIB_MODIFIER 100
+#else
+#define PHP_ZLIB_MODIFIER 1000
+#endif
+
#define OS_CODE 0x03 /* FIXME */
#define GZIP_HEADER_LENGTH 10
#define GZIP_FOOTER_LENGTH 8
@@ -209,6 +216,7 @@ PHP_MINIT_FUNCTION(zlib)
ts_allocate_id(&zlib_globals_id, sizeof(zend_zlib_globals), (ts_allocate_ctor) php_zlib_init_globals, NULL);
#endif
php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper TSRMLS_CC);
+ php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory TSRMLS_CC);
REGISTER_LONG_CONSTANT("FORCE_GZIP", CODING_GZIP, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FORCE_DEFLATE", CODING_DEFLATE, CONST_CS | CONST_PERSISTENT);
@@ -243,6 +251,7 @@ PHP_RINIT_FUNCTION(zlib)
PHP_MSHUTDOWN_FUNCTION(zlib)
{
php_unregister_url_stream_wrapper("zlib" TSRMLS_CC);
+ php_stream_filter_unregister_factory("zlib.*" TSRMLS_CC);
UNREGISTER_INI_ENTRIES();
@@ -256,6 +265,8 @@ PHP_MINFO_FUNCTION(zlib)
{
php_info_print_table_start();
php_info_print_table_row(2, "ZLib Support", "enabled");
+ php_info_print_table_row(2, "Stream Wrapper support", "compress.zlib://");
+ php_info_print_table_row(2, "Stream Filter support", "zlib.inflate, zlib.deflate");
php_info_print_table_row(2, "Compiled Version", ZLIB_VERSION);
php_info_print_table_row(2, "Linked Version", (char *) zlibVersion());
php_info_print_table_end();
@@ -382,7 +393,7 @@ PHP_FUNCTION(gzcompress)
RETURN_FALSE;
}
- l2 = data_len + (data_len / 1000) + 15 + 1; /* room for \0 */
+ l2 = data_len + (data_len / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */
s2 = (char *) emalloc(l2);
if (!s2) {
RETURN_FALSE;
@@ -478,7 +489,7 @@ PHP_FUNCTION(gzdeflate)
stream.next_in = (Bytef *) data;
stream.avail_in = data_len;
- stream.avail_out = stream.avail_in + (stream.avail_in / 1000) + 15 + 1; /* room for \0 */
+ stream.avail_out = stream.avail_in + (stream.avail_in / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */
s2 = (char *) emalloc(stream.avail_out);
if (!s2) {
@@ -614,7 +625,7 @@ static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buffer_len,
int start_offset = ((do_start && ZLIBG(compression_coding) == CODING_GZIP) ? 10 : 0);
int end_offset = (do_end ? 8 : 0);
- outlen = (uint) (sizeof(char) * (str_length * 1.001f + 12) + 1); /* leave some room for a trailing \0 */
+ outlen = (uint) (str_length + (str_length / PHP_ZLIB_MODIFIER) + 12 + 1); /* leave some room for a trailing \0 */
if ((outlen + start_offset + end_offset) > *p_buffer_len) {
buffer = (Bytef *) emalloc(outlen + start_offset + end_offset);
} else {
@@ -754,7 +765,7 @@ PHP_FUNCTION(gzencode)
stream.next_in = (Bytef *) data;
stream.avail_in = data_len;
- stream.avail_out = stream.avail_in + (stream.avail_in / 1000) + 15 + 1; /* room for \0 */
+ stream.avail_out = stream.avail_in + (stream.avail_in / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */
s2 = (char *) emalloc(stream.avail_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0));
/* add gzip file header */
diff --git a/ext/zlib/zlib.dsp b/ext/zlib/zlib.dsp
index 97543e49f..8986bc6f0 100644
--- a/ext/zlib/zlib.dsp
+++ b/ext/zlib/zlib.dsp
@@ -1,117 +1,121 @@
-# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=zlib - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "zlib.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "zlib - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "zlib - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "zlib - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_zlib.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\zlib\Release" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "zlib - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_zlib.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\zlib\Debug"
-
-!ENDIF
-
-# Begin Target
-
-# Name "zlib - Win32 Release_TS"
-# Name "zlib - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\zlib.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\zlib_fopen_wrapper.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_zlib.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=zlib - Win32 Release_TS
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "zlib.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 Release_TS"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "zlib - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlib - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "zlib - Win32 Release_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_TS"
+# PROP Intermediate_Dir "Release_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x406 /d "NDEBUG"
+# ADD RSC /l 0x406 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_zlib.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\zlib\Release" /libpath:"..\..\Release_TS_Inline"
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /FR /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x406 /d "NDEBUG"
+# ADD RSC /l 0x406 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_zlib.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\zlib\Debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "zlib - Win32 Release_TS"
+# Name "zlib - Win32 Debug_TS"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\zlib.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib_filter.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\php_zlib.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c
new file mode 100644
index 000000000..f7062c307
--- /dev/null
+++ b/ext/zlib/zlib_filter.c
@@ -0,0 +1,421 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Sara Golemon (pollita@php.net) |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: zlib_filter.c,v 1.6.2.1 2005/11/22 22:05:38 pollita Exp $ */
+
+#include "php.h"
+#include "php_zlib.h"
+
+/* {{{ data structure */
+
+/* Passed as opaque in malloc callbacks */
+typedef struct _php_zlib_filter_data {
+ int persistent;
+ z_stream strm;
+ char *inbuf;
+ size_t inbuf_len;
+ char *outbuf;
+ size_t outbuf_len;
+} php_zlib_filter_data;
+
+/* }}} */
+
+/* {{{ Memory management wrappers */
+
+static voidpf php_zlib_alloc(voidpf opaque, uInt items, uInt size)
+{
+ return (voidpf)safe_pemalloc(items, size, 0, ((php_zlib_filter_data*)opaque)->persistent);
+}
+
+static void php_zlib_free(voidpf opaque, voidpf address)
+{
+ pefree((void*)address, ((php_zlib_filter_data*)opaque)->persistent);
+}
+/* }}} */
+
+/* {{{ zlib.inflate filter implementation */
+
+static php_stream_filter_status_t php_zlib_inflate_filter(
+ php_stream *stream,
+ php_stream_filter *thisfilter,
+ php_stream_bucket_brigade *buckets_in,
+ php_stream_bucket_brigade *buckets_out,
+ size_t *bytes_consumed,
+ int flags
+ TSRMLS_DC)
+{
+ php_zlib_filter_data *data;
+ php_stream_bucket *bucket;
+ size_t consumed = 0, original_out, original_in;
+ int status;
+ php_stream_filter_status_t exit_status = PSFS_FEED_ME;
+ z_stream *streamp;
+
+ if (!thisfilter || !thisfilter->abstract) {
+ /* Should never happen */
+ return PSFS_ERR_FATAL;
+ }
+
+ data = (php_zlib_filter_data *)(thisfilter->abstract);
+ streamp = &(data->strm);
+ original_in = data->strm.total_in;
+ original_out = data->strm.total_out;
+
+ while (buckets_in->head) {
+ size_t bin = 0, desired;
+
+ bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ while (bin < bucket->buflen) {
+ desired = bucket->buflen - bin;
+ if (desired > data->inbuf_len) {
+ desired = data->inbuf_len;
+ }
+ memcpy(data->strm.next_in, bucket->buf + bin, desired);
+ data->strm.avail_in = desired;
+
+ status = inflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FINISH : Z_SYNC_FLUSH);
+ if (status != Z_OK && status != Z_STREAM_END) {
+ /* Something bad happened */
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ return PSFS_ERR_FATAL;
+ }
+ desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
+ data->strm.next_in = data->inbuf;
+ data->strm.avail_in = 0;
+ consumed += desired;
+ bin += desired;
+
+ if (data->strm.avail_out < data->outbuf_len) {
+ php_stream_bucket *out_bucket;
+ size_t bucketlen = data->outbuf_len - data->strm.avail_out;
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ data->strm.avail_out = data->outbuf_len;
+ data->strm.next_out = data->outbuf;
+ exit_status = PSFS_PASS_ON;
+ }
+ }
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ }
+
+ if (flags & PSFS_FLAG_FLUSH_CLOSE) {
+ /* Spit it out! */
+ status = Z_OK;
+ while (status == Z_OK) {
+ status = inflate(&(data->strm), Z_FINISH);
+ if (data->strm.avail_out < data->outbuf_len) {
+ size_t bucketlen = data->outbuf_len - data->strm.avail_out;
+
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ data->strm.avail_out = data->outbuf_len;
+ data->strm.next_out = data->outbuf;
+ exit_status = PSFS_PASS_ON;
+ }
+ }
+ }
+
+ if (bytes_consumed) {
+ *bytes_consumed = consumed;
+ }
+
+ return exit_status;
+}
+
+static void php_zlib_inflate_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+{
+ if (thisfilter && thisfilter->abstract) {
+ php_zlib_filter_data *data = thisfilter->abstract;
+ inflateEnd(&(data->strm));
+ pefree(data->inbuf, data->persistent);
+ pefree(data->outbuf, data->persistent);
+ pefree(data, data->persistent);
+ }
+}
+
+static php_stream_filter_ops php_zlib_inflate_ops = {
+ php_zlib_inflate_filter,
+ php_zlib_inflate_dtor,
+ "zlib.inflate"
+};
+/* }}} */
+
+/* {{{ zlib.inflate filter implementation */
+
+static php_stream_filter_status_t php_zlib_deflate_filter(
+ php_stream *stream,
+ php_stream_filter *thisfilter,
+ php_stream_bucket_brigade *buckets_in,
+ php_stream_bucket_brigade *buckets_out,
+ size_t *bytes_consumed,
+ int flags
+ TSRMLS_DC)
+{
+ php_zlib_filter_data *data;
+ php_stream_bucket *bucket;
+ size_t consumed = 0, original_out, original_in;
+ int status;
+ php_stream_filter_status_t exit_status = PSFS_FEED_ME;
+ z_stream *streamp;
+
+ if (!thisfilter || !thisfilter->abstract) {
+ /* Should never happen */
+ return PSFS_ERR_FATAL;
+ }
+
+ data = (php_zlib_filter_data *)(thisfilter->abstract);
+ streamp = &(data->strm);
+ original_in = data->strm.total_in;
+ original_out = data->strm.total_out;
+
+ while (buckets_in->head) {
+ size_t bin = 0, desired;
+
+ bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+
+ while (bin < bucket->buflen) {
+ desired = bucket->buflen - bin;
+ if (desired > data->inbuf_len) {
+ desired = data->inbuf_len;
+ }
+ memcpy(data->strm.next_in, bucket->buf + bin, desired);
+ data->strm.avail_in = desired;
+
+ status = deflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FULL_FLUSH : (flags & PSFS_FLAG_FLUSH_INC ? Z_SYNC_FLUSH : Z_NO_FLUSH));
+ if (status != Z_OK) {
+ /* Something bad happened */
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ return PSFS_ERR_FATAL;
+ }
+ desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
+ data->strm.next_in = data->inbuf;
+ data->strm.avail_in = 0;
+ consumed += desired;
+ bin += desired;
+
+ if (data->strm.avail_out < data->outbuf_len) {
+ php_stream_bucket *out_bucket;
+ size_t bucketlen = data->outbuf_len - data->strm.avail_out;
+
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ data->strm.avail_out = data->outbuf_len;
+ data->strm.next_out = data->outbuf;
+ exit_status = PSFS_PASS_ON;
+ }
+ }
+ php_stream_bucket_delref(bucket TSRMLS_CC);
+ }
+
+ if (flags & PSFS_FLAG_FLUSH_CLOSE) {
+ /* Spit it out! */
+ status = Z_OK;
+ while (status == Z_OK) {
+ status = deflate(&(data->strm), Z_FINISH);
+ if (data->strm.avail_out < data->outbuf_len) {
+ size_t bucketlen = data->outbuf_len - data->strm.avail_out;
+
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ data->strm.avail_out = data->outbuf_len;
+ data->strm.next_out = data->outbuf;
+ exit_status = PSFS_PASS_ON;
+ }
+ }
+ }
+
+ if (bytes_consumed) {
+ *bytes_consumed = consumed;
+ }
+ return exit_status;
+}
+
+static void php_zlib_deflate_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+{
+ if (thisfilter && thisfilter->abstract) {
+ php_zlib_filter_data *data = thisfilter->abstract;
+ deflateEnd(&(data->strm));
+ pefree(data->inbuf, data->persistent);
+ pefree(data->outbuf, data->persistent);
+ pefree(data, data->persistent);
+ }
+}
+
+static php_stream_filter_ops php_zlib_deflate_ops = {
+ php_zlib_deflate_filter,
+ php_zlib_deflate_dtor,
+ "zlib.deflate"
+};
+
+/* }}} */
+
+/* {{{ zlib.* common factory */
+
+static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+{
+ php_stream_filter_ops *fops = NULL;
+ php_zlib_filter_data *data;
+ int status;
+
+ /* Create this filter */
+ data = pecalloc(1, sizeof(php_zlib_filter_data), persistent);
+ if (!data) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", sizeof(php_zlib_filter_data));
+ return NULL;
+ }
+
+ /* Circular reference */
+ data->strm.opaque = (voidpf) data;
+
+ data->strm.zalloc = (alloc_func) php_zlib_alloc;
+ data->strm.zfree = (free_func) php_zlib_free;
+ data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048;
+ data->strm.next_in = data->inbuf = (Bytef *) pemalloc(data->inbuf_len, persistent);
+ if (!data->inbuf) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", data->inbuf_len);
+ pefree(data, persistent);
+ return NULL;
+ }
+ data->strm.avail_in = 0;
+ data->strm.next_out = data->outbuf = (Bytef *) pemalloc(data->outbuf_len, persistent);
+ if (!data->outbuf) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", data->outbuf_len);
+ pefree(data->inbuf, persistent);
+ pefree(data, persistent);
+ return NULL;
+ }
+
+ data->strm.data_type = Z_ASCII;
+
+ if (strcasecmp(filtername, "zlib.inflate") == 0) {
+ int windowBits = -MAX_WBITS;
+
+ if (filterparams) {
+ zval **tmpzval;
+
+ if ((Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) &&
+ zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void **) &tmpzval) == SUCCESS) {
+ /* log-2 base of history window (9 - 15) */
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_long_ex(tmpzval);
+ if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval));
+ } else {
+ windowBits = Z_LVAL_PP(tmpzval);
+ }
+ zval_ptr_dtor(tmpzval);
+ }
+ }
+
+ /* RFC 1951 Inflate */
+ status = inflateInit2(&(data->strm), windowBits);
+ fops = &php_zlib_inflate_ops;
+ } else if (strcasecmp(filtername, "zlib.deflate") == 0) {
+ /* RFC 1951 Deflate */
+ int level = Z_DEFAULT_COMPRESSION;
+ int windowBits = -MAX_WBITS;
+ int memLevel = MAX_MEM_LEVEL;
+
+
+ if (filterparams) {
+ zval **tmpzval;
+
+ /* filterparams can either be a scalar value to indicate compression level (shortcut method)
+ Or can be a hash containing one or more of 'window', 'memory', and/or 'level' members. */
+
+ switch (Z_TYPE_P(filterparams)) {
+ case IS_ARRAY:
+ case IS_OBJECT:
+ if (zend_hash_find(HASH_OF(filterparams), "memory", sizeof("memory"), (void**) &tmpzval) == SUCCESS) {
+ /* Memory Level (1 - 9) */
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_long_ex(tmpzval);
+ if (Z_LVAL_PP(tmpzval) < 1 || Z_LVAL_PP(tmpzval) > MAX_MEM_LEVEL) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", Z_LVAL_PP(tmpzval));
+ } else {
+ memLevel = Z_LVAL_PP(tmpzval);
+ }
+ zval_ptr_dtor(tmpzval);
+ }
+
+ if (zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void**) &tmpzval) == SUCCESS) {
+ /* log-2 base of history window (9 - 15) */
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_long_ex(tmpzval);
+ if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval));
+ } else {
+ windowBits = Z_LVAL_PP(tmpzval);
+ }
+ zval_ptr_dtor(tmpzval);
+ }
+
+ if (zend_hash_find(HASH_OF(filterparams), "level", sizeof("level"), (void**) &tmpzval) == SUCCESS) {
+ /* Psuedo pass through to catch level validating code */
+ goto factory_setlevel;
+ }
+ break;
+ case IS_STRING:
+ case IS_DOUBLE:
+ case IS_LONG:
+ tmpzval = &filterparams;
+factory_setlevel:
+ /* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_long_ex(tmpzval);
+ if (Z_LVAL_PP(tmpzval) < -1 || Z_LVAL_PP(tmpzval) > 9) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid compression level specified. (%ld)", Z_LVAL_PP(tmpzval));
+ } else {
+ level = Z_LVAL_PP(tmpzval);
+ }
+ zval_ptr_dtor(tmpzval);
+ break;
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filter parameter, ignored.");
+ }
+ }
+ status = deflateInit2(&(data->strm), level, Z_DEFLATED, windowBits, memLevel, 0);
+ fops = &php_zlib_deflate_ops;
+ } else {
+ status = Z_DATA_ERROR;
+ }
+
+ if (status != Z_OK) {
+ /* Unspecified (probably strm) error, let stream-filter error do its own whining */
+ pefree(data->strm.next_in, persistent);
+ pefree(data->strm.next_out, persistent);
+ pefree(data, persistent);
+ return NULL;
+ }
+
+ return php_stream_filter_alloc(fops, data, persistent);
+}
+
+php_stream_filter_factory php_zlib_filter_factory = {
+ php_zlib_filter_create
+};
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: sw=4 ts=4 fdm=marker
+ * vim<600: sw=4 ts=4
+ */
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c
index c6a68957a..600129180 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zlib_fopen_wrapper.c,v 1.44.2.1 2004/08/26 23:36:08 iliaa Exp $ */
+/* $Id: zlib_fopen_wrapper.c,v 1.46 2005/08/03 14:08:25 sniper Exp $ */
#define _GNU_SOURCE